完善功能

master
chen 4 years ago
parent ceb46ec638
commit 4659e6c9c7
  1. 15
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgAuditProcessController.java
  2. 3
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/feign/HrmsFeignService.java
  3. 98
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgEfficiencyServiceImpl.java
  4. 4
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgAuditProcessMapper.xml
  5. 8
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/RoleController.java
  6. 3
      dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgAuditProcess.java

@ -2,9 +2,11 @@ package com.daqing.financial.guarantee.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.daqing.financial.guarantee.feign.HrmsFeignService;
import com.daqing.financial.guarantee.service.IDgAuditProcessService; import com.daqing.financial.guarantee.service.IDgAuditProcessService;
import com.daqing.framework.domain.guarantee.DgAuditProcess; import com.daqing.framework.domain.guarantee.DgAuditProcess;
import com.daqing.framework.domain.guarantee.po.ProcessPO; import com.daqing.framework.domain.guarantee.po.ProcessPO;
import com.daqing.framework.domain.hrms.RoleEntity;
import com.daqing.framework.model.response.ResponseResult; import com.daqing.framework.model.response.ResponseResult;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -34,6 +36,9 @@ public class DgAuditProcessController {
@Autowired @Autowired
private IDgAuditProcessService auditProcessService; private IDgAuditProcessService auditProcessService;
@Autowired
private HrmsFeignService hrmsFeignService;
@ApiOperation(value = "审核流程进程列表") @ApiOperation(value = "审核流程进程列表")
@GetMapping("/auditProcessList") @GetMapping("/auditProcessList")
public ResponseResult processList( public ResponseResult processList(
@ -42,6 +47,16 @@ public class DgAuditProcessController {
@ApiParam(name = "processId", value = "流程id", required = false) @ApiParam(name = "processId", value = "流程id", required = false)
@RequestParam(required = false) String processId){ @RequestParam(required = false) String processId){
List<DgAuditProcess> processList = auditProcessService.queryProcessList(businessId,processId); List<DgAuditProcess> processList = auditProcessService.queryProcessList(businessId,processId);
ResponseResult responseResult = hrmsFeignService.roleList();
//获取角色名称信息
List<RoleEntity> list = (List<RoleEntity>) responseResult.getData();
for (DgAuditProcess process:processList){
for (RoleEntity roleEntity:list){
if (process.getRoleId().equals(roleEntity.getId())){
process.setDeptName(roleEntity.getName());
}
}
}
return ResponseResult.SUCCESS(processList); return ResponseResult.SUCCESS(processList);
} }

@ -90,4 +90,7 @@ public interface HrmsFeignService {
@GetMapping("/hrms/permission/info") @GetMapping("/hrms/permission/info")
ResponseResult info(@RequestParam("id") Long id);*/ ResponseResult info(@RequestParam("id") Long id);*/
@GetMapping("/hrms/role/roleList")
ResponseResult roleList();
} }

@ -234,40 +234,6 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
roleList.add(Integer.parseInt(id)); roleList.add(Integer.parseInt(id));
} }
} }
//查询用户处理过的业务
QueryWrapper<DgAuditProcess> wrapper = new QueryWrapper<>();
wrapper.eq("user_id", currentUser).groupBy("business_id").select("business_id");
List<DgAuditProcess> auditProcessList = dgAuditProcessMapper.selectList(wrapper);
if (auditProcessList != null && auditProcessList.size() != 0) {
List<Integer> businessIdList = new ArrayList<>();
auditProcessList.forEach(dgAuditProcess -> {
businessIdList.add(dgAuditProcess.getBusinessId());
});
//根据业务id查询业务流程,统计耗时,完成时间
businessIdList.forEach(businessId -> {
//new返回对象
PersonalEfficiencyListResponse efficiencyListResponse = new PersonalEfficiencyListResponse();
efficiencyListResponse.setBusinessId(businessId);
//根据业务id查询业务
DgApplyAmountInfo dgApplyAmountInfo = applyAmountInfoMapper.selectById(businessId);
//业务申请日期
Date createTime = dgApplyAmountInfo.getCreateTime();
//客户公司id
Integer companyId = dgApplyAmountInfo.getCompanyId();
//提单人id
Integer presenterId = dgApplyAmountInfo.getPresenterId();
efficiencyListResponse.setApplicantId(presenterId);
efficiencyListResponse.setApplicationDate(new SimpleDateFormat("yyyy-MM-dd").format(createTime));
efficiencyListResponse.setClientName(String.valueOf(companyId));
//获取累计耗时,完成时间,任务节点
HashMap<String, Object> hashMap = getTime(businessId, currentUser);
Object countTime = hashMap.get("countTime");
Object endTime = hashMap.get("endTime");
efficiencyListResponse.setTimeConsuming(String.valueOf(countTime));
efficiencyListResponse.setCompleteTime(String.valueOf(endTime));
efficiencyList.add(efficiencyListResponse);
});
//获取每个业务id的三种状态 //获取每个业务id的三种状态
HashMap<Integer, Object> hashMap = Maps.newHashMap(); HashMap<Integer, Object> hashMap = Maps.newHashMap();
//角色不为空 //角色不为空
@ -490,31 +456,45 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
}); });
} }
} }
//再次循环,拼接数据 //遍历map,key值为业务id
efficiencyList.forEach(personalEfficiencyListResponse -> { for (Integer key : hashMap.keySet()) {
Integer businessId = personalEfficiencyListResponse.getBusinessId(); PersonalEfficiencyListResponse efficiencyListResponse = new PersonalEfficiencyListResponse();
Object o = hashMap.get(businessId); efficiencyListResponse.setBusinessId(key);
//有数据 StatusPO po = (StatusPO)hashMap.get(key);
if (ObjectUtil.isNotNull(o)){ Integer businessStatus = po.getBusinessStatus();
//强制转换 Integer operatingStatus = po.getOperatingStatus();
if (o instanceof StatusPO){ Integer processId = po.getProcessId();
StatusPO statusPO = (StatusPO)o; Integer status = po.getStatus();
String name = statusPO.getName(); String name = po.getName();
Integer operatingStatus = statusPO.getOperatingStatus(); //根据业务id查询业务
Integer processId = statusPO.getProcessId(); DgApplyAmountInfo dgApplyAmountInfo = applyAmountInfoMapper.selectById(key);
Integer status = statusPO.getStatus(); //业务申请日期
Integer businessStatus = statusPO.getBusinessStatus(); Date createTime = dgApplyAmountInfo.getCreateTime();
personalEfficiencyListResponse.setTaskNode(String.valueOf(processId)); //客户公司id
personalEfficiencyListResponse.setBusinessStatus(businessStatus); Integer companyId = dgApplyAmountInfo.getCompanyId();
personalEfficiencyListResponse.setOperatingStatus(operatingStatus); //提单人id
personalEfficiencyListResponse.setApproveStatus(status); Integer presenterId = dgApplyAmountInfo.getPresenterId();
personalEfficiencyListResponse.setClientName(name); efficiencyListResponse.setOperatingStatus(operatingStatus);
} efficiencyListResponse.setApproveStatus(status);
} efficiencyListResponse.setBusinessStatus(businessStatus);
String timeConsuming = personalEfficiencyListResponse.getTimeConsuming(); efficiencyListResponse.setTaskNode(String.valueOf(processId));
String totalTimeConsuming = countTime(timeConsuming); efficiencyListResponse.setClientName(name);
personalEfficiencyListResponse.setTimeConsuming(totalTimeConsuming); efficiencyListResponse.setApplicantId(presenterId);
}); efficiencyListResponse.setApplicationDate(new SimpleDateFormat("yyyy-MM-dd").format(createTime));
efficiencyListResponse.setClientName(String.valueOf(companyId));
//用户处理过业务,统计耗时
QueryWrapper<DgAuditProcess> wrapper = new QueryWrapper<>();
wrapper.eq("user_id", currentUser).eq("business_id",key);
List<DgAuditProcess> auditProcessList = dgAuditProcessMapper.selectList(wrapper);
if (auditProcessList != null && auditProcessList.size() != 0) {
//获取累计耗时,完成时间
HashMap<String, Object> hashMapTime = getTime(key, currentUser);
Object countTime = hashMapTime.get("countTime");
Object endTime = hashMapTime.get("endTime");
efficiencyListResponse.setTimeConsuming(countTime(String.valueOf(countTime)));
efficiencyListResponse.setCompleteTime(String.valueOf(endTime));
}
efficiencyList.add(efficiencyListResponse);
} }
return efficiencyList; return efficiencyList;
} }

@ -7,17 +7,17 @@
<id column="id" property="id" /> <id column="id" property="id" />
<result column="business_id" property="businessId" /> <result column="business_id" property="businessId" />
<result column="approver" property="approver" /> <result column="approver" property="approver" />
<result column="dept_name" property="deptName"/>
<result column="create_time" property="createTime" /> <result column="create_time" property="createTime" />
<result column="status" property="status" /> <result column="status" property="status" />
<result column="audit_opinion" property="auditOpinion" /> <result column="audit_opinion" property="auditOpinion" />
<result column="reason" property="reason" /> <result column="reason" property="reason" />
<result column="loan_money" property="loanMoney" /> <result column="loan_money" property="loanMoney" />
<result column="loan_tern" property="loanTern" /> <result column="loan_tern" property="loanTern" />
<result column="role_id" property="roleId" />
</resultMap> </resultMap>
<select id="selectAuditProcessList" resultMap="BaseResultMap"> <select id="selectAuditProcessList" resultMap="BaseResultMap">
select dap.id,dap.business_id,dap.approver,dap.dept_name,dap.create_time,dap.audit_opinion, select dap.id,dap.business_id,dap.approver,dap.create_time,dap.audit_opinion,dap.role_id,
dbps.business_status as status,dap.reason,dap.loan_money,dap.loan_tern dbps.business_status as status,dap.reason,dap.loan_money,dap.loan_tern
from dg_audit_process dap from dg_audit_process dap
left join dg_business_process_status dbps on dbps.business_id = dap.business_id left join dg_business_process_status dbps on dbps.business_id = dap.business_id

@ -8,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.Arrays; import java.util.Arrays;
import java.util.List;
import java.util.Map; import java.util.Map;
@ -35,6 +36,13 @@ public class RoleController {
return ResponseResult.SUCCESS(); return ResponseResult.SUCCESS();
} }
//查询角色名称
@GetMapping("/roleList")
public ResponseResult roleList() {
List<RoleEntity> list = roleService.list();
return ResponseResult.SUCCESS(list);
}
/** /**
* 信息 * 信息

@ -38,6 +38,9 @@ public class DgAuditProcess implements Serializable {
@ApiModelProperty(value = "用户id") @ApiModelProperty(value = "用户id")
private Integer userId; private Integer userId;
@ApiModelProperty(value = "部门名称(实为角色名称)")
private String deptName;
@ApiModelProperty(value = "部门ids") @ApiModelProperty(value = "部门ids")
private String departmentId; private String departmentId;

Loading…
Cancel
Save