From 7685db0d7a9b53d3305a167c6211694bdc45c7e1 Mon Sep 17 00:00:00 2001 From: wulin Date: Thu, 3 Dec 2020 16:55:22 +0800 Subject: [PATCH 1/7] =?UTF-8?q?resultScore=20=E5=92=8CresultDetail?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ResultRecordController.java | 17 ++++++++ .../lz/modules/flow/entity/ResultScore.java | 21 +++++++++- .../modules/sys/entity/app/ResultDetail.java | 40 ++++++++++++++++++- .../mapper/app/ResultDetailMapper.xml | 14 ++++++- .../mapper/flow/ResultScoreMapper.xml | 15 ++++--- src/test/java/com/lz/mysql/MysqlMain.java | 3 +- 6 files changed, 100 insertions(+), 10 deletions(-) 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 + select * from lz_print where id=#{id} and is_delete = 0 limit 1 + + + + + insert into lz_print( + url, + remark, + batch_no, + status, + image_url, + is_image, + is_print, + is_delete, + gmt_create, + gmt_modified + )values( + #{ url}, + #{ remark}, + #{ batchNo}, + #{ status}, + #{ imageUrl}, + #{ isImage}, + #{ isPrint}, + 0, + now(), + now() + ) + + + + + update + lz_print + + is_delete = #{isDelete}, + gmt_create = #{gmtCreate}, + url = #{url}, + remark = #{remark}, + batch_no = #{batchNo}, + status = #{status}, + image_url = #{imageUrl}, + is_image = #{isImage}, + is_print = #{isPrint} + + ,gmt_modified = now() + where id = #{id} + + + + + update + lz_print + set + is_delete = #{isDelete}, + gmt_create = #{gmtCreate}, + url = #{url}, + remark = #{remark}, + batch_no = #{batchNo}, + status = #{status}, + image_url = #{imageUrl}, + is_image = #{isImage}, + is_print = #{isPrint} + ,gmt_modified = now() + where id = #{id} + + + + + update lz_print set is_delete = 1 where id=#{id} limit 1 + + + + diff --git a/src/main/resources/mapper/sys/ResourceMapper.xml b/src/main/resources/mapper/sys/ResourceMapper.xml new file mode 100644 index 00000000..eb1f3c28 --- /dev/null +++ b/src/main/resources/mapper/sys/ResourceMapper.xml @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, creator AS creator, modifier AS modifier, data_type AS dataType, type AS type, sec_type AS secType, type_desc AS typeDesc, name AS name, value AS value, description AS description, value_1 AS value1, value_2 AS value2, value_3 AS value3, value_4 AS value4, sort AS sort + + + + + + + + + + insert into lz_resource( + creator, + modifier, + data_type, + type, + sec_type, + type_desc, + name, + value, + description, + value_1, + value_2, + value_3, + value_4, + sort, + is_delete, + gmt_create, + gmt_modified + )values( + #{ creator}, + #{ modifier}, + #{ dataType}, + #{ type}, + #{ secType}, + #{ typeDesc}, + #{ name}, + #{ value}, + #{ description}, + #{ value1}, + #{ value2}, + #{ value3}, + #{ value4}, + #{ sort}, + 0, + now(), + now() + ) + + + + + update + lz_resource + + is_delete = #{isDelete}, + gmt_create = #{gmtCreate}, + creator = #{creator}, + modifier = #{modifier}, + data_type = #{dataType}, + type = #{type}, + sec_type = #{secType}, + type_desc = #{typeDesc}, + name = #{name}, + value = #{value}, + description = #{description}, + value_1 = #{value1}, + value_2 = #{value2}, + value_3 = #{value3}, + value_4 = #{value4}, + sort = #{sort} + + ,gmt_modified = now() + where id = #{id} + + + + + update + lz_resource + set + is_delete = #{isDelete}, + gmt_create = #{gmtCreate}, + creator = #{creator}, + modifier = #{modifier}, + data_type = #{dataType}, + type = #{type}, + sec_type = #{secType}, + type_desc = #{typeDesc}, + name = #{name}, + value = #{value}, + description = #{description}, + value_1 = #{value1}, + value_2 = #{value2}, + value_3 = #{value3}, + value_4 = #{value4}, + sort = #{sort} + ,gmt_modified = now() + where id = #{id} + + + + + update lz_resource set is_delete = 1 where id=#{id} limit 1 + + + + diff --git a/src/test/java/com/lz/mysql/MysqlMain.java b/src/test/java/com/lz/mysql/MysqlMain.java index 6410c7a3..00ac715c 100644 --- a/src/test/java/com/lz/mysql/MysqlMain.java +++ b/src/test/java/com/lz/mysql/MysqlMain.java @@ -84,8 +84,8 @@ public class MysqlMain { List list = new ArrayList(); - list.add(new TablesBean("lz_result_score")); - list.add(new TablesBean("lz_result_detail")); + list.add(new TablesBean("lz_resource")); + list.add(new TablesBean("lz_print")); List list2 = new ArrayList(); Map map = MysqlUtil2ShowCreateTable.getComments(); From 53b4bfb15344ae410322343fbd67758c5a255034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E5=BB=BA=E8=B6=85?= <3182967682@qq.com> Date: Fri, 4 Dec 2020 14:38:18 +0800 Subject: [PATCH 7/7] fix --- .../lz/modules/sys/service/PrintService.java | 33 +++++++++++ .../modules/sys/service/ResourceService.java | 25 +++++++++ .../sys/service/impl/PrintServiceImpl.java | 55 +++++++++++++++++++ .../sys/service/impl/ResourceServiceImpl.java | 54 ++++++++++++++++++ 4 files changed, 167 insertions(+) create mode 100644 src/main/java/com/lz/modules/sys/service/PrintService.java create mode 100644 src/main/java/com/lz/modules/sys/service/ResourceService.java create mode 100644 src/main/java/com/lz/modules/sys/service/impl/PrintServiceImpl.java create mode 100644 src/main/java/com/lz/modules/sys/service/impl/ResourceServiceImpl.java diff --git a/src/main/java/com/lz/modules/sys/service/PrintService.java b/src/main/java/com/lz/modules/sys/service/PrintService.java new file mode 100644 index 00000000..e92db5cf --- /dev/null +++ b/src/main/java/com/lz/modules/sys/service/PrintService.java @@ -0,0 +1,33 @@ +package com.lz.modules.sys.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.lz.modules.sys.entity.Print; + +/** +*

+* 流转表 服务类 +*

+* +* @author quyixiao +* @since 2020-12-04 +*/ +public interface PrintService extends IService { + + + + Print selectPrintById(Long id); + + + Long insertPrint(Print print); + + + int updatePrintById(Print print); + + + int updateCoverPrintById(Print print); + + + int deletePrintById(Long id); + + +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/sys/service/ResourceService.java b/src/main/java/com/lz/modules/sys/service/ResourceService.java new file mode 100644 index 00000000..3659c714 --- /dev/null +++ b/src/main/java/com/lz/modules/sys/service/ResourceService.java @@ -0,0 +1,25 @@ +package com.lz.modules.sys.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.lz.modules.sys.entity.Resource; + +public interface ResourceService extends IService { + + + + Resource selectResourceById(Long id); + + + Long insertResource(Resource resource); + + + int updateResourceById(Resource resource); + + + int updateCoverResourceById(Resource resource); + + + int deleteResourceById(Long id); + + +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/sys/service/impl/PrintServiceImpl.java b/src/main/java/com/lz/modules/sys/service/impl/PrintServiceImpl.java new file mode 100644 index 00000000..56f66cd4 --- /dev/null +++ b/src/main/java/com/lz/modules/sys/service/impl/PrintServiceImpl.java @@ -0,0 +1,55 @@ +package com.lz.modules.sys.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.lz.modules.sys.dao.PrintMapper; +import com.lz.modules.sys.entity.Print; +import com.lz.modules.sys.service.PrintService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +@Service +public class PrintServiceImpl extends ServiceImpl implements PrintService { + + + @Autowired + private PrintMapper printMapper; + + + + @Override + public Print selectPrintById(Long id){ + return printMapper.selectPrintById(id); + } + + + + @Override + public Long insertPrint(Print print){ + return printMapper.insertPrint(print); + } + + + + @Override + public int updatePrintById(Print print){ + return printMapper.updatePrintById(print); + } + + + + @Override + public int updateCoverPrintById(Print print){ + return printMapper.updateCoverPrintById(print); + } + + + + @Override + public int deletePrintById(Long id){ + return printMapper.deletePrintById(id); + } + + + +} diff --git a/src/main/java/com/lz/modules/sys/service/impl/ResourceServiceImpl.java b/src/main/java/com/lz/modules/sys/service/impl/ResourceServiceImpl.java new file mode 100644 index 00000000..2142a80d --- /dev/null +++ b/src/main/java/com/lz/modules/sys/service/impl/ResourceServiceImpl.java @@ -0,0 +1,54 @@ +package com.lz.modules.sys.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.lz.modules.sys.dao.ResourceMapper; +import com.lz.modules.sys.entity.Resource; +import com.lz.modules.sys.service.ResourceService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class ResourceServiceImpl extends ServiceImpl implements ResourceService { + + + @Autowired + private ResourceMapper resourceMapper; + + + + @Override + public Resource selectResourceById(Long id){ + return resourceMapper.selectResourceById(id); + } + + + + @Override + public Long insertResource(Resource resource){ + return resourceMapper.insertResource(resource); + } + + + + @Override + public int updateResourceById(Resource resource){ + return resourceMapper.updateResourceById(resource); + } + + + + @Override + public int updateCoverResourceById(Resource resource){ + return resourceMapper.updateCoverResourceById(resource); + } + + + + @Override + public int deleteResourceById(Long id){ + return resourceMapper.deleteResourceById(id); + } + + + +}