diff --git a/src/main/java/com/lz/modules/flow/entity/Flow.java b/src/main/java/com/lz/modules/flow/entity/Flow.java index b6786571..a7632813 100644 --- a/src/main/java/com/lz/modules/flow/entity/Flow.java +++ b/src/main/java/com/lz/modules/flow/entity/Flow.java @@ -3,6 +3,8 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; + +import java.math.BigDecimal; import java.util.Date; /** *

@@ -24,7 +26,7 @@ public class Flow implements java.io.Serializable { private Date gmtCreate; //最后修改时间 private Date gmtModified; - //自己部门小伙伴 走的 流程id + //自己部门小伙伴 走的 流程id,考核组id private Long flowId; // private String opt; @@ -32,6 +34,10 @@ public class Flow implements java.io.Serializable { private String optDesc; //角色 id private Long roleId; + //chart_id,流程节点id + private Long chartId; + //权重,评分时的权重 + private BigDecimal weight; /** * * @return diff --git a/src/main/java/com/lz/modules/flow/entity/FlowChartDetailRecord.java b/src/main/java/com/lz/modules/flow/entity/FlowChartDetailRecord.java index 6cf10374..c3ead12f 100644 --- a/src/main/java/com/lz/modules/flow/entity/FlowChartDetailRecord.java +++ b/src/main/java/com/lz/modules/flow/entity/FlowChartDetailRecord.java @@ -5,12 +5,14 @@ import com.baomidou.mybatisplus.annotation.IdType; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; + +import java.math.BigDecimal; import java.util.Date; /** *

*

*考核模板流程记录表 * @author quyixiao -* @since 2020-10-19 +* @since 2020-10-21 */ @Data @@ -53,6 +55,9 @@ public class FlowChartDetailRecord implements java.io.Serializable { //第几步从0开始,按照有小到排序 @ApiModelProperty(value = "第几步从0开始,按照有小到排序", name = "stepIndex") private Integer stepIndex; + //权重,评分时所占权重 + @ApiModelProperty(value = "权重,评分时所占权重", name = "weight") + private BigDecimal weight; /** * * @return @@ -233,6 +238,21 @@ public class FlowChartDetailRecord implements java.io.Serializable { this.stepIndex = stepIndex; } + /** + * 权重,评分时所占权重 + * @return + */ + public BigDecimal getWeight() { + return weight; + } + /** + * 权重,评分时所占权重 + * @param weight + */ + public void setWeight(BigDecimal weight) { + this.weight = weight; + } + @Override public String toString() { return "FlowChartDetailRecord{" + @@ -248,6 +268,7 @@ public class FlowChartDetailRecord implements java.io.Serializable { ",roleIds=" + roleIds + ",stepType=" + stepType + ",stepIndex=" + stepIndex + + ",weight=" + weight + "}"; } } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/model/FlowChartDetailRecordDto.java b/src/main/java/com/lz/modules/flow/model/FlowChartDetailRecordDto.java index 71b48106..6ae80371 100644 --- a/src/main/java/com/lz/modules/flow/model/FlowChartDetailRecordDto.java +++ b/src/main/java/com/lz/modules/flow/model/FlowChartDetailRecordDto.java @@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.math.BigDecimal; import java.util.List; /** @@ -43,6 +44,9 @@ public class FlowChartDetailRecordDto { //第几步从0开始,按照有小到排序 @ApiModelProperty(value = "第几步从0开始,按照有小到排序", name = "stepIndex") private Integer stepIndex; + //权重,评分时所占权重 + @ApiModelProperty(value = "权重,评分时所占权重", name = "weight") + private BigDecimal weight; /** * * @return diff --git a/src/main/java/com/lz/modules/flow/req/FlowChartDetailRecordReq.java b/src/main/java/com/lz/modules/flow/req/FlowChartDetailRecordReq.java index 3178975d..fed51076 100644 --- a/src/main/java/com/lz/modules/flow/req/FlowChartDetailRecordReq.java +++ b/src/main/java/com/lz/modules/flow/req/FlowChartDetailRecordReq.java @@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.annotation.IdType; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; + +import java.math.BigDecimal; import java.util.Date; /** *

@@ -62,6 +64,9 @@ public class FlowChartDetailRecordReq implements java.io.Serializable { //第几步从0开始,按照有小到排序 @ApiModelProperty(value = "第几步从0开始,按照有小到排序", name = "stepIndex") private Integer stepIndex; + //权重,评分时所占权重 + @ApiModelProperty(value = "权重,评分时所占权重", name = "weight") + private BigDecimal weight; /** * * @return diff --git a/src/main/java/com/lz/modules/performance/controller/FlowStartController.java b/src/main/java/com/lz/modules/performance/controller/FlowStartController.java index 3db5a7da..d0c4996a 100644 --- a/src/main/java/com/lz/modules/performance/controller/FlowStartController.java +++ b/src/main/java/com/lz/modules/performance/controller/FlowStartController.java @@ -2,6 +2,7 @@ package com.lz.modules.performance.controller; import com.alibaba.fastjson.JSONObject; +import com.lz.common.emun.ChartOptType; import com.lz.common.emun.CheckStaffType; import com.lz.common.utils.PageUtils; import com.lz.common.utils.R; @@ -45,6 +46,9 @@ public class FlowStartController { @Autowired private FlowChartDetailRecordService flowChartDetailRecordService; + @Autowired + private FlowService flowService; + @@ -95,7 +99,7 @@ public class FlowStartController { } List evaluationStartStaffs = new ArrayList<>(); - + //下面初始化参与人员 for (String staffId:staffIds ) { EvaluationStartStaff evaluationStartStaff = new EvaluationStartStaff(); @@ -106,6 +110,11 @@ public class FlowStartController { evaluationStartStaffs.add(evaluationStartStaff); } + if(evaluationStartStaffs.size() == 0){ + + return R.error(evaluationGroup.getName() + "——未指定考核参与人员"); + + } //下面初始化管理人员 if(evaluationGroup.getManagerIds() != null && evaluationGroup.getManagerIds().length() > 0){ String[] managerIds = evaluationGroup.getManagerIds().split(","); @@ -122,8 +131,50 @@ public class FlowStartController { } if(evaluationStartStaffs.size() > 0){ evaluationStartStaffService.insertEvaluationStartStaffs(evaluationStartStaffs); + //下面初始化lz_flow流程表 lz_flow_approval_role流程审批表 + List flows = new ArrayList<>(); + List flowApprovalRoles = new ArrayList<>(); + for (FlowChartDetailRecord flowChartDetailRecord:flowChartDetailRecords + ) { + Flow flow = new Flow(); + flow.setFlowId(evaluationGroup.getId()); + flow.setOpt("+"); + flow.setChartId(flowChartDetailRecord.getChartId()); + + flowService.insertFlow(flow); + + if(flowChartDetailRecord.getOptType().intValue() == ChartOptType.APPOINT.getCode()){//指定人员的 + String[] optIds = flowChartDetailRecord.getOptIds().split(","); + for (String id:optIds + ) { + String[] roleIds = flowChartDetailRecord.getRoleIds().split(","); + for (String roleId:roleIds + ) { + FlowApprovalRole flowApprovalRole = new FlowApprovalRole(); + flowApprovalRole.setFlowId(flow.getId()); + flowApprovalRole.setApprovalId(Long.getLong(id)); + flowApprovalRole.setStepType(flowChartDetailRecord.getStepType()); + flowApprovalRole.setRoleId(Long.getLong(roleId)); + flowApprovalRoles.add(flowApprovalRole); + + } + + } + } + + } + + for (EvaluationStartStaff startStaff:evaluationStartStaffs + ) { + if(startStaff.getType().intValue() == CheckStaffType.STAFF.getCode()){ + //初始化人员及流程表id + } + + + + } } - //下面初始化lz_flow流程表 lz_flow_approval_role流程审批表 + } diff --git a/src/main/resources/mapper/flow/FlowChartDetailRecordMapper.xml b/src/main/resources/mapper/flow/FlowChartDetailRecordMapper.xml index 9dd52877..1ff2848a 100644 --- a/src/main/resources/mapper/flow/FlowChartDetailRecordMapper.xml +++ b/src/main/resources/mapper/flow/FlowChartDetailRecordMapper.xml @@ -16,12 +16,13 @@ + - id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, chart_id AS chartId, evaluation_group_id AS evaluationGroupId, status AS status, opt_ids AS optIds, opt_type AS optType, role_ids AS roleIds, step_type AS stepType, step_index AS stepIndex + id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, chart_id AS chartId, evaluation_group_id AS evaluationGroupId, status AS status, opt_ids AS optIds, opt_type AS optType, role_ids AS roleIds, step_type AS stepType, step_index AS stepIndex, weight AS weight @@ -42,6 +43,7 @@ role_ids, step_type, step_index, + weight, is_delete, gmt_create, gmt_modified @@ -54,6 +56,7 @@ #{ roleIds}, #{ stepType}, #{ stepIndex}, + #{ weight}, 0, now(), now() @@ -74,7 +77,8 @@ opt_type = #{optType}, role_ids = #{roleIds}, step_type = #{stepType}, - step_index = #{stepIndex} + step_index = #{stepIndex}, + weight = #{weight} ,gmt_modified = now() where id = #{id} @@ -94,7 +98,8 @@ opt_type = #{optType}, role_ids = #{roleIds}, step_type = #{stepType}, - step_index = #{stepIndex} + step_index = #{stepIndex}, + weight = #{weight} ,gmt_modified = now() where id = #{id} diff --git a/src/test/java/com/lz/mysql/MysqlMain.java b/src/test/java/com/lz/mysql/MysqlMain.java index d2303851..d2efcf66 100644 --- a/src/test/java/com/lz/mysql/MysqlMain.java +++ b/src/test/java/com/lz/mysql/MysqlMain.java @@ -78,7 +78,7 @@ public class MysqlMain { //list.add(new TablesBean("lz_result_model")); //list.add(new TablesBean("lz_result_score")); //list.add(new TablesBean("lz_result_taget_lib")); - list.add(new TablesBean("lz_staff_role")); + list.add(new TablesBean("lz_flow_chart_detail_record")); List list2 = new ArrayList(); Map map = MysqlUtil2ShowCreateTable.getComments();