From 6b6bac4899c5119565317a3affea7d0ba26b17b6 Mon Sep 17 00:00:00 2001 From: wulin Date: Thu, 22 Oct 2020 16:04:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=8A=82=E7=82=B9=E5=92=8C?= =?UTF-8?q?=E5=8D=95=E4=B8=AA=E8=8E=B7=E5=8F=96=E8=8A=82=E7=82=B9=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=8E=A5=E5=8F=A3=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model/FlowChartDetailRecordListDto.java | 88 +++++++++++++ .../model/FlowChartDetailRecordSimpleDto.java | 119 ++++++++++++++++++ .../lz/modules/flow/model/FlowChartDto.java | 4 + .../req/FlowChartDetailRecordListReq.java | 3 +- .../req/FlowChartDetailRecordSimpleReq.java | 2 +- .../controller/FlowChartController.java | 65 +++++++--- 6 files changed, 265 insertions(+), 16 deletions(-) create mode 100644 src/main/java/com/lz/modules/flow/model/FlowChartDetailRecordListDto.java create mode 100644 src/main/java/com/lz/modules/flow/model/FlowChartDetailRecordSimpleDto.java diff --git a/src/main/java/com/lz/modules/flow/model/FlowChartDetailRecordListDto.java b/src/main/java/com/lz/modules/flow/model/FlowChartDetailRecordListDto.java new file mode 100644 index 00000000..309e5076 --- /dev/null +++ b/src/main/java/com/lz/modules/flow/model/FlowChartDetailRecordListDto.java @@ -0,0 +1,88 @@ +package com.lz.modules.flow.model; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** +*

+*

*考核模板流程记录表 +* @author quyixiao +* @since 2020-10-19 +*/ + +@Data +@ApiModel(value = "考核模板流程记录表ListDto") +public class FlowChartDetailRecordListDto { + // + @ApiModelProperty(value = "结点id,必传", name = "id") + private Long id; + //考核组ID + @ApiModelProperty(value = "考核组ID", name = "evaluationGroupId") + private Long evaluationGroupId; + //0关闭,1开启 + @ApiModelProperty(value = "0关闭,1开启", name = "status") + private Integer status; + + @ApiModelProperty(value = "小结点列表", name = "recordSimpleDtos") + private List recordSimpleDtos; + /** + * + * @return + */ + public Long getId() { + return id; + } + /** + * + * @param id + */ + public void setId(Long id) { + this.id = id; + } + + + + /** + * 考核组ID + * @return + */ + public Long getEvaluationGroupId() { + return evaluationGroupId; + } + /** + * 考核组ID + * @param evaluationGroupId + */ + public void setEvaluationGroupId(Long evaluationGroupId) { + this.evaluationGroupId = evaluationGroupId; + } + + /** + * 0关闭,1开启 + * @return + */ + public Integer getStatus() { + return status; + } + /** + * 0关闭,1开启 + * @param status + */ + public void setStatus(Integer status) { + this.status = status; + } + + + + + @Override + public String toString() { + return "FlowChartDetailRecordDto{" + + ",id=" + id + + ",evaluationGroupId=" + evaluationGroupId + + ",status=" + status + + "}"; + } +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/model/FlowChartDetailRecordSimpleDto.java b/src/main/java/com/lz/modules/flow/model/FlowChartDetailRecordSimpleDto.java new file mode 100644 index 00000000..5617f92a --- /dev/null +++ b/src/main/java/com/lz/modules/flow/model/FlowChartDetailRecordSimpleDto.java @@ -0,0 +1,119 @@ +package com.lz.modules.flow.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.lz.modules.app.dto.StaffSimpleDto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +/** +*

+*

*考核模板流程记录表 +* @author quyixiao +* @since 2020-10-21 +*/ + +@Data +@ApiModel(value = "考核模板流程记录表SimpleDto") +public class FlowChartDetailRecordSimpleDto implements java.io.Serializable { + // + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + @ApiModelProperty(value = "是否删除0或者不传,不删除,1删除", name = "isDelete") + private Integer isDelete; + @ApiModelProperty(value = "人员集合,如果人员中途离职,第二次返回会自动去掉", name = "staffs") + private List staffs; + //-1考核人员自己,0人员id,1一级主管,2二级主管.... + @ApiModelProperty(value = "-1考核人员自己,0人员id,1一级主管,2二级主管....", name = "optType") + private Integer optType; + //role id集合,逗号隔开 + @ApiModelProperty(value = "role id集合,逗号隔开", name = "roleIds") + private String roleIds; + //步骤类型0:依次,1或签(同时通知,一人通过或拒绝即可),2会签(同时通知,所有人同意才可以) + @ApiModelProperty(value = "步骤类型0:依次,1或签(同时通知,一人通过或拒绝即可),2会签(同时通知,所有人同意才可以)", name = "stepType") + private Integer stepType; + + //权重,评分时所占权重 + @ApiModelProperty(value = "权重,评分时所占权重", name = "weight") + private BigDecimal weight; + + /** + * + * @return + */ + public Long getId() { + return id; + } + /** + * + * @param id + */ + public void setId(Long id) { + this.id = id; + } + + + + + /** + * -1考核人员自己,0人员id,1一级主管,2二级主管.... + * @return + */ + public Integer getOptType() { + return optType; + } + /** + * -1考核人员自己,0人员id,1一级主管,2二级主管.... + * @param optType + */ + public void setOptType(Integer optType) { + this.optType = optType; + } + + /** + * role id集合,逗号隔开 + * @return + */ + public String getRoleIds() { + return roleIds; + } + /** + * role id集合,逗号隔开 + * @param roleIds + */ + public void setRoleIds(String roleIds) { + this.roleIds = roleIds; + } + + /** + * 步骤类型0:依次,1或签(同时通知,一人通过或拒绝即可),2会签(同时通知,所有人同意才可以) + * @return + */ + public Integer getStepType() { + return stepType; + } + /** + * 步骤类型0:依次,1或签(同时通知,一人通过或拒绝即可),2会签(同时通知,所有人同意才可以) + * @param stepType + */ + public void setStepType(Integer stepType) { + this.stepType = stepType; + } + + + + @Override + public String toString() { + return "FlowChartDetailRecord{" + + ",id=" + id + + ",optType=" + optType + + ",roleIds=" + roleIds + + ",stepType=" + stepType + + "}"; + } +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/model/FlowChartDto.java b/src/main/java/com/lz/modules/flow/model/FlowChartDto.java index 19118515..081f0d17 100644 --- a/src/main/java/com/lz/modules/flow/model/FlowChartDto.java +++ b/src/main/java/com/lz/modules/flow/model/FlowChartDto.java @@ -1,4 +1,5 @@ package com.lz.modules.flow.model; +import com.lz.modules.flow.req.FlowChartDetailRecordListReq; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -36,6 +37,9 @@ public class FlowChartDto { @ApiModelProperty(value = "节点权限列表", name = "roleDtos") private List roleDtos; + + @ApiModelProperty(value = "节点详细数据", name = "chartDetails") + private FlowChartDetailRecordListDto chartDetails; /** * * @return diff --git a/src/main/java/com/lz/modules/flow/req/FlowChartDetailRecordListReq.java b/src/main/java/com/lz/modules/flow/req/FlowChartDetailRecordListReq.java index e7da07c4..d4b86e08 100644 --- a/src/main/java/com/lz/modules/flow/req/FlowChartDetailRecordListReq.java +++ b/src/main/java/com/lz/modules/flow/req/FlowChartDetailRecordListReq.java @@ -1,4 +1,5 @@ package com.lz.modules.flow.req; +import com.lz.modules.flow.model.FlowChartDetailRecordSimpleDto; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -13,7 +14,7 @@ import java.util.List; */ @Data -@ApiModel(value = "考核模板流程记录表ListDto") +@ApiModel(value = "考核模板流程记录表ListReq") public class FlowChartDetailRecordListReq { // @ApiModelProperty(value = "结点id,必传", name = "id") diff --git a/src/main/java/com/lz/modules/flow/req/FlowChartDetailRecordSimpleReq.java b/src/main/java/com/lz/modules/flow/req/FlowChartDetailRecordSimpleReq.java index 440b8561..414d3b4f 100644 --- a/src/main/java/com/lz/modules/flow/req/FlowChartDetailRecordSimpleReq.java +++ b/src/main/java/com/lz/modules/flow/req/FlowChartDetailRecordSimpleReq.java @@ -18,7 +18,7 @@ import java.util.Date; */ @Data -@ApiModel(value = "考核模板流程记录表SimpleDto") +@ApiModel(value = "考核模板流程记录表SimpleReq") public class FlowChartDetailRecordSimpleReq implements java.io.Serializable { // @TableId(value = "id", type = IdType.AUTO) diff --git a/src/main/java/com/lz/modules/performance/controller/FlowChartController.java b/src/main/java/com/lz/modules/performance/controller/FlowChartController.java index 44aacb42..2fc31be5 100644 --- a/src/main/java/com/lz/modules/performance/controller/FlowChartController.java +++ b/src/main/java/com/lz/modules/performance/controller/FlowChartController.java @@ -8,9 +8,7 @@ import com.lz.modules.app.service.StaffService; import com.lz.modules.flow.entity.FlowChart; import com.lz.modules.flow.entity.FlowChartDetailRecord; import com.lz.modules.flow.entity.FlowManager; -import com.lz.modules.flow.model.FlowChartDetailRecordDto; -import com.lz.modules.flow.model.FlowChartDto; -import com.lz.modules.flow.model.FlowChartRoleDto; +import com.lz.modules.flow.model.*; import com.lz.modules.flow.req.FlowChartDetailRecordListReq; import com.lz.modules.flow.req.FlowChartDetailRecordSimpleReq; import com.lz.modules.flow.service.FlowChartDetailRecordService; @@ -48,10 +46,9 @@ public class FlowChartController { private StaffService staffService; @GetMapping("/getByFlowManagerId") - @ApiOperation("根据Manager Id获取大流程节点") - @ApiImplicitParam(name = "id",value = "流程id,绩效请传1", required = true, dataType = "String",paramType = "query") + @ApiOperation("获取大流程节点") @ApiResponses({@ApiResponse(code = 200,message = "成功",response = FlowChartDto.class)}) - public R getByFlowManagerId(@RequestParam Long id) { + public R getByFlowManagerId(@RequestParam @ApiParam("流程id,绩效请传1") Long id, @RequestParam @ApiParam(value = "考评组id,新建时传0", defaultValue = "0") Long groupId) { FlowManager flowManager = flowManagerService.selectFlowManagerById(id); if(flowManager != null){ List flowChartDtos = flowChartService.selectFlowChartDtoByFlowManagerId(flowManager.getId()); @@ -59,6 +56,42 @@ public class FlowChartController { ) { List flowCharts = flowChartService.selectChartRoleByChartId(dto.getId()); dto.setRoleDtos(flowCharts); + if(groupId > 0){ + //获取节点已保存的数据 + FlowChartDetailRecordListDto flowChartDetailRecordListDto = new FlowChartDetailRecordListDto(); + flowChartDetailRecordListDto.setEvaluationGroupId(groupId); + flowChartDetailRecordListDto.setId(dto.getId()); + List recordSimpleDtos = new ArrayList<>(); + List flowChartDetailRecords = + flowChartDetailRecordService.selectFlowChartDetailRecordByGroupIdAndChartId(groupId, dto.getId()); + + for (FlowChartDetailRecord record:flowChartDetailRecords + ) { + flowChartDetailRecordListDto.setStatus(dto.getStatus()); + FlowChartDetailRecordSimpleDto detailRecordSimpleDto = new FlowChartDetailRecordSimpleDto(); + + BeanUtils.copyProperties(record, detailRecordSimpleDto); + if(record.getOptType().intValue() == ChartOptType.APPOINT.getCode() + && record.getOptIds() != null + && record.getOptIds().length() > 0){ + List ids = Arrays.stream(record.getOptIds().split(",")).map(new Function() { + @Override + public Long apply(String s) { + return Long.parseLong(s); + } + }).collect(Collectors.toList()); + + //指定人员,搜索人员信息 + List staffSimpleDtos = staffService.selectStaffSimpleInfoByIds(ids); + detailRecordSimpleDto.setStaffs(staffSimpleDtos); + + } + recordSimpleDtos.add(detailRecordSimpleDto); + + } + flowChartDetailRecordListDto.setRecordSimpleDtos(recordSimpleDtos); + dto.setChartDetails(flowChartDetailRecordListDto); + } } return R.ok().put("data",flowChartDtos); @@ -66,7 +99,7 @@ public class FlowChartController { return R.error("无相关流程"); } - @GetMapping("/getRoleByChatId") + /*@GetMapping("/getRoleByChatId") @ApiOperation("根据流程节点 Id获取相关权限") @ApiImplicitParam(name = "id",value = "节点id", required = true, dataType = "String",paramType = "query") @ApiResponses({@ApiResponse(code = 200,message = "成功",response = FlowChartRoleDto.class)}) @@ -74,7 +107,7 @@ public class FlowChartController { List flowCharts = flowChartService.selectChartRoleByChartId(id); return R.ok().put("data",flowCharts); - } + }*/ @@ -91,7 +124,7 @@ public class FlowChartController { } - @PostMapping("/saveDetailProc") + /*@PostMapping("/saveDetailProc") @ApiOperation("保存流程节点小流程") @ApiResponses({@ApiResponse(code = 200, message = "成功", response = FlowChartDetailRecord.class)}) public R saveDetailProc(@RequestBody @ApiParam FlowChartDetailRecord flowChartDetailRecord) { @@ -100,7 +133,7 @@ public class FlowChartController { } flowChartDetailRecordService.insertFlowChartDetailRecord(flowChartDetailRecord); return R.ok().put("data", flowChartDetailRecord); - } + }*/ @PostMapping("/saveDetailProcs") @ApiOperation("保存流程节点小流程列表") @@ -152,14 +185,19 @@ public class FlowChartController { return R.ok(); } - @GetMapping("/getDetailProc") + /* @GetMapping("/getDetailProc") @ApiOperation("获取已保存的考核节点详情") @ApiResponses({@ApiResponse(code = 200, message = "成功", response = FlowChartDetailRecordDto.class)}) public R getDetailProc(@RequestParam @ApiParam("考核组id") Long groupId, @RequestParam @ApiParam("节点id") Long chartId) { + + return R.ok().put("data", flowChartDetailRecordDtos); + }*/ + + private List getChartDetailRecort(Long chartId, Long groupId){ List flowChartDetailRecords = flowChartDetailRecordService.selectFlowChartDetailRecordByGroupIdAndChartId(groupId, chartId); List flowChartDetailRecordDtos = new ArrayList<>(); for (FlowChartDetailRecord record:flowChartDetailRecords - ) { + ) { FlowChartDetailRecordDto dto = new FlowChartDetailRecordDto(); BeanUtils.copyProperties(record, dto); if(record.getOptType().intValue() == ChartOptType.APPOINT.getCode() @@ -178,10 +216,9 @@ public class FlowChartController { } flowChartDetailRecordDtos.add(dto); } - return R.ok().put("data", flowChartDetailRecordDtos); + return flowChartDetailRecordDtos; } - @RequestMapping("/delete") public R list(@RequestBody Long id) { flowChartService.deleteFlowChartById(id);