parent
3621d28701
commit
944d980bf8
|
|
@ -2,6 +2,7 @@ package com.zcloud.edu.web.training;
|
|||
|
||||
|
||||
import com.zcloud.edu.api.training.TrainingApplyProcessServiceI;
|
||||
import com.zcloud.edu.dto.clientobject.training.TrainingApplyProcessFlowVO;
|
||||
import com.zcloud.edu.dto.clientobject.training.TrainingApplyProcessNodeCO;
|
||||
import com.zcloud.edu.dto.training.TrainingApplyProcessAddCmd;
|
||||
import com.zcloud.edu.dto.training.TrainingApplyProcessPageQry;
|
||||
|
|
@ -47,8 +48,8 @@ public class TrainingApplyProcessController {
|
|||
|
||||
@ApiOperation("审批流程图")
|
||||
@PostMapping("/processDiagram")
|
||||
public MultiResponse<TrainingApplyProcessNodeCO> getProcessDiagramByRecordId(@RequestBody TrainingApplyProcessPageQry qry) {
|
||||
return MultiResponse.of(trainingApplyProcessService.getProcessDiagramByRecordId(qry));
|
||||
public SingleResponse<TrainingApplyProcessFlowVO> getProcessDiagramByRecordId(@RequestBody TrainingApplyProcessPageQry qry) {
|
||||
return SingleResponse.of(trainingApplyProcessService.getProcessDiagramByRecordId(qry));
|
||||
}
|
||||
|
||||
@ApiOperation("所有数据")
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
package com.zcloud.edu.command.query.training;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.zcloud.edu.command.convertor.training.TrainingApplyProcessCoConvertor;
|
||||
import com.zcloud.edu.domain.model.training.TrainingApplyProcessNodeE;
|
||||
import com.zcloud.edu.dto.clientobject.training.FlowCO;
|
||||
import com.zcloud.edu.dto.clientobject.training.TrainingApplyProcessFlowVO;
|
||||
import com.zcloud.edu.dto.clientobject.training.TrainingApplyProcessNodeCO;
|
||||
import com.zcloud.edu.dto.training.TrainingApplyProcessPageQry;
|
||||
import com.zcloud.edu.dto.clientobject.training.TrainingApplyProcessCO;
|
||||
|
|
@ -12,9 +15,8 @@ import com.alibaba.cola.dto.PageResponse;
|
|||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -42,9 +44,31 @@ public class TrainingApplyProcessQueryExe {
|
|||
}
|
||||
|
||||
|
||||
public List<TrainingApplyProcessNodeCO> getProcessDiagramByRecordId(TrainingApplyProcessPageQry qry) {
|
||||
List<TrainingApplyProcessNodeE> processList = trainingApplyProcessRepository.getProcessNodeByRecordId(qry.getEqTrainingApplyRecordId());
|
||||
return trainingApplyProcessCoConvertor.converEsToCOs(processList);
|
||||
public TrainingApplyProcessFlowVO getProcessDiagramByRecordId(TrainingApplyProcessPageQry qry) {
|
||||
|
||||
List<TrainingApplyProcessNodeE> processList =
|
||||
trainingApplyProcessRepository.getProcessNodeByRecordId(qry.getEqTrainingApplyRecordId());
|
||||
|
||||
List<FlowCO> flowList = Optional.ofNullable(processList).orElse(Collections.emptyList())
|
||||
.stream()
|
||||
.map(e -> {
|
||||
FlowCO item = new FlowCO();
|
||||
|
||||
item.setType(e.getApplyType());
|
||||
item.setStatus(e.getApprovalStatus());
|
||||
|
||||
String nodeName = e.getNodeName() == null ? "" : e.getNodeName();
|
||||
String username = e.getUsername() == null ? "" : e.getUsername();
|
||||
String time = e.getTime();
|
||||
|
||||
String secondLine = StrUtil.isNotBlank(time) ? (username + " " + time) : username;
|
||||
item.setFlowList(Arrays.asList(nodeName, secondLine));
|
||||
|
||||
return item;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
return TrainingApplyProcessFlowVO.of(flowList);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.zcloud.edu.command.training.TrainingApplyProcessUpdateExe;
|
|||
import com.zcloud.edu.command.query.training.TrainingApplyProcessQueryExe;
|
||||
import com.zcloud.edu.domain.enums.ApplyTypeEnum;
|
||||
import com.zcloud.edu.domain.model.training.TrainingApplyProcessE;
|
||||
import com.zcloud.edu.dto.clientobject.training.TrainingApplyProcessFlowVO;
|
||||
import com.zcloud.edu.dto.clientobject.training.TrainingApplyProcessNodeCO;
|
||||
import com.zcloud.edu.dto.clientobject.training.TrainingApplyRecordCO;
|
||||
import com.zcloud.edu.dto.training.TrainingApplyProcessAddCmd;
|
||||
|
|
@ -66,7 +67,7 @@ public class TrainingApplyProcessServiceImpl implements TrainingApplyProcessServ
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<TrainingApplyProcessNodeCO> getProcessDiagramByRecordId(TrainingApplyProcessPageQry qry) {
|
||||
public TrainingApplyProcessFlowVO getProcessDiagramByRecordId(TrainingApplyProcessPageQry qry) {
|
||||
return trainingApplyProcessQueryExe.getProcessDiagramByRecordId(qry);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.zcloud.edu.api.training;
|
||||
|
||||
import com.zcloud.edu.dto.clientobject.training.TrainingApplyProcessFlowVO;
|
||||
import com.zcloud.edu.dto.clientobject.training.TrainingApplyProcessNodeCO;
|
||||
import com.zcloud.edu.dto.training.TrainingApplyProcessAddCmd;
|
||||
import com.zcloud.edu.dto.training.TrainingApplyProcessPageQry;
|
||||
|
|
@ -30,7 +31,7 @@ public interface TrainingApplyProcessServiceI {
|
|||
/**
|
||||
* 获取审批流程图
|
||||
*/
|
||||
List<TrainingApplyProcessNodeCO> getProcessDiagramByRecordId(TrainingApplyProcessPageQry qry);
|
||||
TrainingApplyProcessFlowVO getProcessDiagramByRecordId(TrainingApplyProcessPageQry qry);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
package com.zcloud.edu.dto.clientobject.training;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class FlowCO {
|
||||
|
||||
private Integer type;
|
||||
|
||||
private Integer status;
|
||||
|
||||
private List<String> flowList;
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.zcloud.edu.dto.clientobject.training;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class TrainingApplyProcessFlowVO {
|
||||
private List<FlowCO> flowCOList;
|
||||
|
||||
public static TrainingApplyProcessFlowVO of(List<FlowCO> list) {
|
||||
TrainingApplyProcessFlowVO vo = new TrainingApplyProcessFlowVO();
|
||||
vo.setFlowCOList(list);
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
|
|
@ -21,6 +21,10 @@ import java.util.List;
|
|||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TrainingApplyRecordAddCmd extends Command {
|
||||
|
||||
@ApiModelProperty(value = "业务ID")
|
||||
private String trainingApplyRecordId;
|
||||
|
||||
@ApiModelProperty(value = "申请企业id", name = "applyCorpinfoId", required = true)
|
||||
// @NotNull(message = "申请企业id不能为空")
|
||||
private Long applyCorpinfoId;
|
||||
|
|
|
|||
|
|
@ -33,6 +33,9 @@ public class TrainingApplyUserAddCmd extends Command {
|
|||
@ApiModelProperty(value = "身份证号" , name = "idCard", required = true)
|
||||
// @NotEmpty(message = "身份证号不能为空")
|
||||
private String idCard;
|
||||
|
||||
@ApiModelProperty(value = "关联项目")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty(value = "申请状态1:待审批2:审批通过,3:审批不通过", name = "applyStatus", required = true)
|
||||
// @NotNull(message = "申请状态1:待审批2:审批通过,3:审批不通过不能为空")
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ public class TrainingApplyUserUpdateCmd extends Command {
|
|||
private String phone;
|
||||
@ApiModelProperty(value = "身份证号" , name = "idCard", required = true)
|
||||
private String idCard;
|
||||
@ApiModelProperty(value = "关联项目")
|
||||
private String projectName;
|
||||
@ApiModelProperty(value = "申请状态1:待审批2:审批通过,3:审批不通过", name = "applyStatus", required = true)
|
||||
private Long applyStatus;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,13 +10,13 @@ public class TrainingApplyProcessNodeE {
|
|||
private String nodeName;
|
||||
|
||||
@ApiModelProperty(value = "审批状态")
|
||||
private Long approvalStatus;
|
||||
private Integer approvalStatus;
|
||||
|
||||
@ApiModelProperty(value = "姓名")
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty(value = "审批类型")
|
||||
private Long applyType;
|
||||
private Integer applyType;
|
||||
|
||||
@ApiModelProperty(value = "时间")
|
||||
private String time;
|
||||
|
|
|
|||
|
|
@ -76,6 +76,8 @@ public class TrainingApplyRecordE extends BaseE {
|
|||
this.applyUserId = ssoUser.getUserId();
|
||||
this.applyDepartmentId = ssoUser.getOrgId();
|
||||
this.applyCorpinfoId = ssoUser.getTenantId();
|
||||
}else {
|
||||
throw new BizException("参数异常");
|
||||
}
|
||||
this.trainingApplyRecordId = StrUtil.isNotBlank(this.trainingApplyRecordId) ? this.trainingApplyRecordId : IdUtil.simpleUUID();
|
||||
|
||||
|
|
@ -148,9 +150,6 @@ public class TrainingApplyRecordE extends BaseE {
|
|||
public void addApplyUsers(List<TrainingApplyUserE> users) {
|
||||
if (!CollectionUtils.isEmpty(users)) {
|
||||
this.applyUsers.addAll(users);
|
||||
if (StrUtil.isNotBlank(this.projectName)) {
|
||||
applyUsers.forEach(applyUser -> {applyUser.setProjectName(projectName);});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,9 @@ public class TrainingApplyUserDO extends BaseDO {
|
|||
//身份证号
|
||||
@ApiModelProperty(value = "身份证号")
|
||||
private String idCard;
|
||||
//关联项目
|
||||
@ApiModelProperty(value = "关联项目")
|
||||
private String projectName;
|
||||
//申请状态1:待审批2:审批通过,3:审批不通过
|
||||
@ApiModelProperty(value = "申请状态1:待审批2:审批通过,3:审批不通过")
|
||||
private Long applyStatus;
|
||||
|
|
|
|||
|
|
@ -80,9 +80,9 @@
|
|||
<select id="selectByBusinessId" resultType="com.zcloud.edu.domain.model.training.TrainingApplyRecordDetailE">
|
||||
SELECT
|
||||
r.*,
|
||||
(SELECT username FROM user WHERE id = r.apply_user_id AND delete_enum = 'FALSE') AS applyUserName,
|
||||
(SELECT name FROM user WHERE id = r.apply_user_id AND delete_enum = 'FALSE') AS applyUserName,
|
||||
(SELECT corp_name FROM corp_info WHERE id = r.apply_corpinfo_id AND delete_enum = 'FALSE') AS applyCorpName,
|
||||
(SELECT username FROM user WHERE id = r.approval_user_id AND delete_enum = 'FALSE') AS approvalUserName,
|
||||
(SELECT name FROM user WHERE id = r.approval_user_id AND delete_enum = 'FALSE') AS approvalUserName,
|
||||
(SELECT name FROM department WHERE id = r.approval_department_id AND delete_enum = 'FALSE') AS approvalDepartmentName,
|
||||
(SELECT corp_name FROM corp_info WHERE id = r.approval_corpinfo_id AND delete_enum = 'FALSE') AS approvalCorpName
|
||||
FROM
|
||||
|
|
|
|||
Loading…
Reference in New Issue