This commit is contained in:
parent
de852b063d
commit
20a162bfc1
|
|
@ -126,4 +126,28 @@ public class LeaseTaskController extends BaseController {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核人员领用记录查询
|
||||
*/
|
||||
@ApiOperation(value = "审核人员领用记录查询")
|
||||
@GetMapping("/auditList")
|
||||
public AjaxResult auditList(LeaseApplyInfo leaseApplyInfo) {
|
||||
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
|
||||
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
|
||||
try {
|
||||
List<LeaseApplyInfo> list = service.selectAuditLeaseApplyInfoList(leaseApplyInfo);
|
||||
if (leaseApplyInfo.getIsApp()==null){
|
||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
|
||||
}else {
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
if (leaseApplyInfo.getIsApp()==null){
|
||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, new ArrayList<>()));
|
||||
}else {
|
||||
return AjaxResult.success(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,4 +69,6 @@ public interface LeaseTaskMapper {
|
|||
* @return 结果
|
||||
*/
|
||||
List<Type> getTypeDataList(Type bean);
|
||||
|
||||
List<LeaseApplyInfo> selectAuditLeaseApplyInfoList(LeaseApplyInfo leaseApplyInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,5 +64,7 @@ public interface ILeaseTaskService {
|
|||
* @return
|
||||
*/
|
||||
List<Type> getTypeDataList(Type bean);
|
||||
|
||||
List<LeaseApplyInfo> selectAuditLeaseApplyInfoList(LeaseApplyInfo leaseApplyInfo);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,9 +24,15 @@ import com.bonus.material.task.domain.TmTask;
|
|||
import com.bonus.material.task.domain.TmTaskAgreement;
|
||||
import com.bonus.material.task.mapper.TmTaskAgreementMapper;
|
||||
import com.bonus.material.task.mapper.TmTaskMapper;
|
||||
import com.bonus.material.work.domain.SysWorkflowRecord;
|
||||
import com.bonus.material.work.domain.SysWorkflowType;
|
||||
import com.bonus.material.work.mapper.SysWorkflowRecordMapper;
|
||||
import com.bonus.material.work.mapper.SysWorkflowTypeMapper;
|
||||
import com.bonus.material.work.service.SysWorkflowRecordService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
|
@ -63,7 +69,8 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService {
|
|||
@Resource
|
||||
private BmFileInfoMapper bmFileInfoMapper;
|
||||
|
||||
|
||||
@Resource
|
||||
private SysWorkflowRecordService sysWorkflowRecordService;
|
||||
/**
|
||||
* 新增领用任务
|
||||
*
|
||||
|
|
@ -71,6 +78,7 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService {
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public AjaxResult insertLeaseApplyInfo(LeaseApplyRequestVo leaseApplyRequestVo) {
|
||||
if (null == leaseApplyRequestVo.getLeaseApplyInfo()) {
|
||||
return AjaxResult.error("请先填写领用任务信息");
|
||||
|
|
@ -113,6 +121,7 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService {
|
|||
bmFileInfoMapper.insertBmFileInfo(bmFileInfo);
|
||||
});
|
||||
}
|
||||
sysWorkflowRecordService.addSysWorkflowRecord(tmTask.getTaskId().intValue(),taskCode,2);
|
||||
if (count > 0) {
|
||||
return insertPurchaseCheckDetails(leaseApplyRequestVo.getLeaseApplyDetailsList(), leaseApplyRequestVo.getLeaseApplyInfo().getId());
|
||||
} else {
|
||||
|
|
@ -273,6 +282,23 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService {
|
|||
return mapper.getTypeDataList(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LeaseApplyInfo> selectAuditLeaseApplyInfoList(LeaseApplyInfo leaseApplyInfo) {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
leaseApplyInfo.setUserId(userId == 0 ? null : userId);
|
||||
List<LeaseApplyInfo> list = mapper.selectAuditLeaseApplyInfoList(leaseApplyInfo);
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
String keyWord = leaseApplyInfo.getKeyWord();
|
||||
// 如果关键字不为空,进行过滤
|
||||
if (!StringUtils.isBlank(keyWord)) {
|
||||
list = list.stream()
|
||||
.filter(item -> containsKeyword(item, keyWord))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 关键字搜索
|
||||
* @param item
|
||||
|
|
|
|||
|
|
@ -82,4 +82,20 @@ public class SysWorkflowNodeController extends BaseController {
|
|||
return error();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据任务id查询工作流详情列表
|
||||
*/
|
||||
@ApiOperation(value = "根据任务id查询工作流详情列表")
|
||||
@GetMapping("/listByTaskId")
|
||||
public TableDataInfo listByTaskId(SysWorkflowNode sysWorkflowNode)
|
||||
{
|
||||
try {
|
||||
startPage();
|
||||
List<SysWorkflowNode> list = sysWorkflowNodeService.listByTaskId(sysWorkflowNode);
|
||||
return getDataTable(list);
|
||||
}catch (Exception e){
|
||||
return getDataTableError(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,4 +82,5 @@ public class SysWorkflowTypeController extends BaseController {
|
|||
return error();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,4 +66,19 @@ public class SysWorkflowNode {
|
|||
* 配置值
|
||||
*/
|
||||
private String configValues;
|
||||
|
||||
/**
|
||||
* 任务Id
|
||||
*/
|
||||
private String taskId;
|
||||
|
||||
/**
|
||||
* 备注 意见 驳回原因
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 审批结果,0拒绝 1通过
|
||||
*/
|
||||
private Integer isAccept;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,4 +14,6 @@ public interface SysWorkflowNodeMapper {
|
|||
int deleteSysWorkflowNode(SysWorkflowNode sysWorkflowNode);
|
||||
|
||||
int updateSysWorkflowNode(SysWorkflowNode sysWorkflowNode);
|
||||
|
||||
List<SysWorkflowNode> listByTaskId(SysWorkflowNode sysWorkflowNode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,4 +13,6 @@ public interface SysWorkflowNodeService {
|
|||
int deleteSysWorkflowNode(SysWorkflowNode sysWorkflowNode);
|
||||
|
||||
int updateSysWorkflowNode(SysWorkflowNode sysWorkflowNode);
|
||||
|
||||
List<SysWorkflowNode> listByTaskId(SysWorkflowNode sysWorkflowNode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,4 +93,10 @@ public class SysWorkflowNodeServiceImpl implements SysWorkflowNodeService {
|
|||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysWorkflowNode> listByTaskId(SysWorkflowNode sysWorkflowNode) {
|
||||
|
||||
return sysWorkflowNodeMapper.listByTaskId(sysWorkflowNode);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,9 +3,11 @@ package com.bonus.material.work.service.impl;
|
|||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.work.domain.SysWorkflowNode;
|
||||
import com.bonus.material.work.domain.SysWorkflowRecord;
|
||||
import com.bonus.material.work.domain.SysWorkflowRecordHistory;
|
||||
import com.bonus.material.work.domain.SysWorkflowType;
|
||||
import com.bonus.material.work.mapper.SysWorkflowNodeMapper;
|
||||
import com.bonus.material.work.mapper.SysWorkflowRecordHistoryMapper;
|
||||
import com.bonus.material.work.mapper.SysWorkflowRecordMapper;
|
||||
import com.bonus.material.work.mapper.SysWorkflowTypeMapper;
|
||||
|
|
@ -28,6 +30,9 @@ public class SysWorkflowRecordServiceImpl implements SysWorkflowRecordService {
|
|||
@Resource
|
||||
private SysWorkflowRecordHistoryMapper sysWorkflowRecordHistoryMapper;
|
||||
|
||||
@Resource
|
||||
private SysWorkflowNodeMapper sysWorkflowNodeMapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public int addSysWorkflowRecord(int taskId,String taskCode,int taskType) {
|
||||
|
|
@ -37,7 +42,7 @@ public class SysWorkflowRecordServiceImpl implements SysWorkflowRecordService {
|
|||
sysWorkflowType.setIsEnable(1);
|
||||
List<SysWorkflowType> sysWorkflowTypeList =sysWorkflowTypeMapper.selectSysWorkflowTypeList(sysWorkflowType);
|
||||
if (sysWorkflowTypeList.size()<1){
|
||||
throw new ServiceException("新增任务失败,请创建领料审核流程");
|
||||
throw new ServiceException("新增任务失败,请创建审核流程");
|
||||
}
|
||||
sysWorkflowType = sysWorkflowTypeList.get(0);
|
||||
SysWorkflowRecord sysWorkflowRecord = new SysWorkflowRecord();
|
||||
|
|
@ -47,11 +52,15 @@ public class SysWorkflowRecordServiceImpl implements SysWorkflowRecordService {
|
|||
sysWorkflowRecord.setTaskCode(taskCode);
|
||||
//创建审批任务
|
||||
int count = sysWorkflowRecordMapper.addSysWorkflowRecord(sysWorkflowRecord);
|
||||
//获取当前审核流下的节点
|
||||
SysWorkflowNode sysWorkflowNode = new SysWorkflowNode();
|
||||
sysWorkflowNode.setTypeId(sysWorkflowType.getId());
|
||||
List<SysWorkflowNode> sysWorkflowNodeList = sysWorkflowNodeMapper.selectSysWorkflowNodeList(sysWorkflowNode);
|
||||
//创建审核记录
|
||||
SysWorkflowRecordHistory sysWorkflowRecordHistory = new SysWorkflowRecordHistory();
|
||||
sysWorkflowRecordHistory.setRecordId(sysWorkflowRecord.getId());
|
||||
sysWorkflowRecordHistory.setNodeId(1);
|
||||
sysWorkflowRecordHistory.setNextNodeId(2);
|
||||
sysWorkflowRecordHistory.setNodeId(sysWorkflowNodeList.get(0).getId());
|
||||
sysWorkflowRecordHistory.setNextNodeId(sysWorkflowNodeList.get(1).getId());
|
||||
sysWorkflowRecordHistory.setIsAccept(1);
|
||||
sysWorkflowRecordHistory.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||
sysWorkflowRecordHistory.setCreateTime(DateUtils.getNowDate());
|
||||
|
|
|
|||
|
|
@ -391,4 +391,65 @@
|
|||
where m.del_flag = '0'
|
||||
and m.parent_id = #{typeId}
|
||||
</select>
|
||||
<select id="selectAuditLeaseApplyInfoList" resultType="com.bonus.common.biz.domain.lease.LeaseApplyInfo">
|
||||
<include refid="selectLeaseApplyInfoVo"/>
|
||||
left join sys_workflow_record swr on tt.task_id = swr.task_id
|
||||
left join sys_workflow_type swt on swr.workflow_id = swt.id
|
||||
left join sys_workflow_node swn on swt.id = swn.type_id
|
||||
left join sys_workflow_config swc on swn.id = swc.node_id
|
||||
where 1=1
|
||||
<if test="userId != null and userId != ''">and swc.config_value = #{userId}</if>
|
||||
<if test="code != null and code != ''">and lai.code = #{code}</if>
|
||||
<if test="taskId != null ">and lai.task_id = #{taskId}</if>
|
||||
<if test="leasePerson != null and leasePerson != ''">and lai.lease_person = #{leasePerson}</if>
|
||||
<if test="phone != null and phone != ''">and lai.phone = #{phone}</if>
|
||||
<if test="type != null and type != ''">and lai.type = #{type}</if>
|
||||
<if test="companyAuditBy != null ">and lai.company_audit_by = #{companyAuditBy}</if>
|
||||
<if test="companyAuditTime != null ">and lai.company_audit_time = #{companyAuditTime}</if>
|
||||
<if test="companyAuditRemark != null and companyAuditRemark != ''">and lai.company_audit_remark =
|
||||
#{companyAuditRemark}
|
||||
</if>
|
||||
<if test="deptAuditBy != null ">and lai.dept_audit_by = #{deptAuditBy}</if>
|
||||
<if test="deptAuditTime != null ">and lai.dept_audit_time = #{deptAuditTime}</if>
|
||||
<if test="deptAuditRemark != null and deptAuditRemark != ''">and lai.dept_audit_remark =
|
||||
#{deptAuditRemark}
|
||||
</if>
|
||||
<if test="directAuditBy != null ">and lai.direct_audit_by = #{directAuditBy}</if>
|
||||
<if test="directAuditTime != null ">and lai.direct_audit_time = #{directAuditTime}</if>
|
||||
<if test="directAuditRemark != null and directAuditRemark != ''">and lai.direct_audit_remark =
|
||||
#{directAuditRemark}
|
||||
</if>
|
||||
<if test="companyId != null ">and lai.company_id = #{companyId}</if>
|
||||
<if test="statusList != null and statusList.size() > 0">
|
||||
and tt.task_status in
|
||||
<foreach item="item" collection="statusList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (bu.unit_name like concat('%', #{keyWord}, '%') or
|
||||
bp.pro_name like concat('%', #{keyWord}, '%') or
|
||||
lai.code like concat('%', #{keyWord}, '%') or
|
||||
lai.create_by like concat('%', #{keyWord}, '%') or
|
||||
lai.lease_person like concat('%', #{keyWord}, '%') or
|
||||
lai.phone like concat('%', #{keyWord}, '%') or
|
||||
bp.contract_part like concat('%', #{keyWord}, '%') or
|
||||
sd.dept_name like concat('%', #{keyWord}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||
AND DATE_FORMAT( lai.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
|
||||
</if>
|
||||
<if test="directId != null ">and lai.direct_id = #{directId}</if>
|
||||
<if test="leaseType != null and leaseType != ''">and lai.lease_type = #{leaseType}</if>
|
||||
<if test="estimateLeaseTime != null ">and lai.estimate_lease_time = #{estimateLeaseTime}</if>
|
||||
<if test="costBearingParty != null and costBearingParty != ''">and lai.cost_bearing_party =
|
||||
#{costBearingParty}
|
||||
</if>
|
||||
and lai.apply_code is not null
|
||||
<if test="isApp != null and taskStatus==1">and (tt.task_status = 0 or tt.task_status = 1 or tt.task_status = 2) </if>
|
||||
<if test="isApp != null and taskStatus==3">and (tt.task_status = 3 or tt.task_status = 4)</if>
|
||||
GROUP BY lai.id
|
||||
ORDER BY tt.task_status,tt.create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -65,7 +65,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where swn.type_id=#{typeId}
|
||||
<if test="nodeName != null "> and type_name like concat('%', #{typeName}, '%')</if>
|
||||
<if test="nodeSignType != null "> and node_sign_type = #{nodeSignType}</if>
|
||||
GROUP BY swn.id ORDER BY swn.node_sort
|
||||
</select>
|
||||
<select id="listByTaskId" resultType="com.bonus.material.work.domain.SysWorkflowNode">
|
||||
select swn.id as id, swn.type_id typeId, swn.node_name as nodeName, swn.node_sort as nodeSort,
|
||||
swn.node_sign_type as nodeSignType, swn.node_sign_config as nodeSignConfig,
|
||||
swrh.create_by as createBy,swrh.create_time as createTime,swn.is_enable as isEnable,
|
||||
GROUP_CONCAT(sec.config_value SEPARATOR ',') AS configValues,
|
||||
swrh.remark as remark,swrh.is_accept as isAccept
|
||||
from sys_workflow_node swn
|
||||
left join sys_workflow_config sec on swn.id= sec.node_id
|
||||
left join sys_workflow_record swr on swr.workflow_id = swn.type_id
|
||||
left join sys_workflow_record_history swrh on swr.id = swrh.record_id
|
||||
where swr.task_id=#{taskId}
|
||||
<if test="nodeName != null "> and type_name like concat('%', #{typeName}, '%')</if>
|
||||
<if test="nodeSignType != null "> and node_sign_type = #{nodeSignType}</if>
|
||||
GROUP BY swn.id
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue