diff --git a/src/main/java/com/lz/modules/app/controller/ResultRecordController.java b/src/main/java/com/lz/modules/app/controller/ResultRecordController.java index 5618de6c..a4853267 100644 --- a/src/main/java/com/lz/modules/app/controller/ResultRecordController.java +++ b/src/main/java/com/lz/modules/app/controller/ResultRecordController.java @@ -727,6 +727,19 @@ public class ResultRecordController extends AbstractController { List insertScores = new ArrayList<>(); List updateScores = new ArrayList<>(); + List resultDetails = resultDetailService.selectByRecordId(dto.getId()); + Map mapDetails = + resultDetails.stream().collect(Collectors.toMap(ResultDetail::getId, Function.identity(), (e, r) -> e)); + + //获取当前绩效的节点 + boolean isSetKeyResult = false; + List flowRecords = flowRecordService.selectFlowRecordByRecordIdStatus(dto.getId(), 2); + if(flowRecords.size() > 0){ + if(flowRecords.get(0).getFlowProcess().intValue() == 0){ + //指定目标中 + isSetKeyResult = true; + } + } for (ResultRecortModelDto model:dto.getRecortModelDtos() ) { @@ -739,6 +752,10 @@ public class ResultRecordController extends AbstractController { ) {//排序 ResultDetail resultDetail = new ResultDetail(); BeanUtils.copyProperties(detailDto, resultDetail); + if(!isSetKeyResult && resultDetail.getId() != null && mapDetails.containsKey(resultDetail.getId())){ + //这里判断是否有更新,或者删除 + + } resultDetail.setPriority(index); index++; diff --git a/src/main/java/com/lz/modules/flow/entity/ResultScore.java b/src/main/java/com/lz/modules/flow/entity/ResultScore.java index f6a322d8..c948f40a 100644 --- a/src/main/java/com/lz/modules/flow/entity/ResultScore.java +++ b/src/main/java/com/lz/modules/flow/entity/ResultScore.java @@ -12,7 +12,7 @@ import java.util.Date; *

*

*业绩详情评分表 * @author quyixiao -* @since 2020-11-12 +* @since 2020-12-03 */ @Data @@ -46,6 +46,9 @@ public class ResultScore implements java.io.Serializable { //评分权重 @ApiModelProperty(value = "评分权重", name = "weight") private BigDecimal weight; + //根据权重计算除的实际得分 + @ApiModelProperty(value = "根据权重计算除的实际得分", name = "score") + private BigDecimal score; /** * * @return @@ -181,6 +184,21 @@ public class ResultScore implements java.io.Serializable { this.weight = weight; } + /** + * 根据权重计算除的实际得分 + * @return + */ + public BigDecimal getScore() { + return score; + } + /** + * 根据权重计算除的实际得分 + * @param score + */ + public void setScore(BigDecimal score) { + this.score = score; + } + @Override public String toString() { return "ResultScore{" + @@ -193,6 +211,7 @@ public class ResultScore implements java.io.Serializable { ",approvalId=" + approvalId + ",scoreComment=" + scoreComment + ",weight=" + weight + + ",score=" + score + "}"; } } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/sys/entity/app/ResultDetail.java b/src/main/java/com/lz/modules/sys/entity/app/ResultDetail.java index c042cc82..3b477599 100644 --- a/src/main/java/com/lz/modules/sys/entity/app/ResultDetail.java +++ b/src/main/java/com/lz/modules/sys/entity/app/ResultDetail.java @@ -12,7 +12,7 @@ import java.util.Date; *

*

*业绩详情表 * @author quyixiao -* @since 2020-11-17 +* @since 2020-12-03 */ @Data @@ -31,6 +31,12 @@ public class ResultDetail implements java.io.Serializable { //最后修改时间 @ApiModelProperty(value = "最后修改时间", name = "gmtModified") private Date gmtModified; + //备份id,本表得id + @ApiModelProperty(value = "备份id,本表得id", name = "backId") + private Long backId; + //是否为备份,0非备份,1备份值 + @ApiModelProperty(value = "是否为备份,0非备份,1备份值", name = "isBack") + private Integer isBack; //1,业绩,2文化价值观 @ApiModelProperty(value = "1,业绩,2文化价值观", name = "type") private Integer type; @@ -133,6 +139,36 @@ public class ResultDetail implements java.io.Serializable { this.gmtModified = gmtModified; } + /** + * 备份id,本表得id + * @return + */ + public Long getBackId() { + return backId; + } + /** + * 备份id,本表得id + * @param backId + */ + public void setBackId(Long backId) { + this.backId = backId; + } + + /** + * 是否为备份,0非备份,1备份值 + * @return + */ + public Integer getIsBack() { + return isBack; + } + /** + * 是否为备份,0非备份,1备份值 + * @param isBack + */ + public void setIsBack(Integer isBack) { + this.isBack = isBack; + } + /** * 1,业绩,2文化价值观 * @return @@ -350,6 +386,8 @@ public class ResultDetail implements java.io.Serializable { ",isDelete=" + isDelete + ",gmtCreate=" + gmtCreate + ",gmtModified=" + gmtModified + + ",backId=" + backId + + ",isBack=" + isBack + ",type=" + type + ",target=" + target + ",keyResult=" + keyResult + diff --git a/src/main/resources/mapper/app/ResultDetailMapper.xml b/src/main/resources/mapper/app/ResultDetailMapper.xml index da34a43f..256ba69d 100644 --- a/src/main/resources/mapper/app/ResultDetailMapper.xml +++ b/src/main/resources/mapper/app/ResultDetailMapper.xml @@ -8,6 +8,8 @@ + + @@ -27,7 +29,7 @@ - id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, type AS type, target AS target, key_result AS keyResult, key_result_3_5 AS keyResult35, key_result_3_7 AS keyResult37, check_weight AS checkWeight, check_result AS checkResult, super_score AS superScore, acquire_score AS acquireScore, score_comment AS scoreComment, record_id AS recordId, staff_id AS staffId, priority AS priority, model_id AS modelId + id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, back_id AS backId, is_back AS isBack, type AS type, target AS target, key_result AS keyResult, key_result_3_5 AS keyResult35, key_result_3_7 AS keyResult37, check_weight AS checkWeight, check_result AS checkResult, super_score AS superScore, acquire_score AS acquireScore, score_comment AS scoreComment, record_id AS recordId, staff_id AS staffId, priority AS priority, model_id AS modelId @@ -40,6 +42,8 @@ insert into lz_result_detail( + back_id, + is_back, type, target, key_result, @@ -58,6 +62,8 @@ gmt_create, gmt_modified )values( + #{ backId}, + #{ isBack}, #{ type}, #{ target}, #{ keyResult}, @@ -85,6 +91,8 @@ is_delete = #{isDelete}, gmt_create = #{gmtCreate}, + back_id = #{backId}, + is_back = #{isBack}, type = #{type}, target = #{target}, key_result = #{keyResult}, @@ -111,6 +119,8 @@ set is_delete = #{isDelete}, gmt_create = #{gmtCreate}, + back_id = #{backId}, + is_back = #{isBack}, type = #{type}, target = #{target}, key_result = #{keyResult}, @@ -125,7 +135,7 @@ staff_id = #{staffId}, priority = #{priority}, model_id = #{modelId} - ,gmt_modified = now() + ,gmt_modified = now() where id = #{id} diff --git a/src/main/resources/mapper/flow/ResultScoreMapper.xml b/src/main/resources/mapper/flow/ResultScoreMapper.xml index ac8203bb..6689788a 100644 --- a/src/main/resources/mapper/flow/ResultScoreMapper.xml +++ b/src/main/resources/mapper/flow/ResultScoreMapper.xml @@ -13,12 +13,13 @@ + - id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, acquire_score AS acquireScore, detail_id AS detailId, approval_id AS approvalId, score_comment AS scoreComment, weight AS weight + id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, acquire_score AS acquireScore, detail_id AS detailId, approval_id AS approvalId, score_comment AS scoreComment, weight AS weight, score AS score @@ -36,6 +37,7 @@ approval_id, score_comment, weight, + score, is_delete, gmt_create, gmt_modified @@ -45,6 +47,7 @@ #{ approvalId}, #{ scoreComment}, #{ weight}, + #{ score}, 0, now(), now() @@ -62,7 +65,8 @@ detail_id = #{detailId}, approval_id = #{approvalId}, score_comment = #{scoreComment}, - weight = #{weight} + weight = #{weight}, + score = #{score} ,gmt_modified = now() where id = #{id} @@ -79,14 +83,15 @@ detail_id = #{detailId}, approval_id = #{approvalId}, score_comment = #{scoreComment}, - weight = #{weight} - ,gmt_modified = now() + weight = #{weight}, + score = #{score} + ,gmt_modified = now() where id = #{id} - update lz_result_score set is_delete = 1 where id=#{id} limit 1 + update lz_result_score set is_delete = 1 where id=#{id} limit 1