From 9ad3d87eeecec71ceb858a8db482a1ae197b933d Mon Sep 17 00:00:00 2001 From: wulin Date: Mon, 7 Dec 2020 11:54:23 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=BB=A9=E6=95=88=E8=AF=A6=E6=83=85=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ResultRecordController.java | 87 +++++++++++++++---- .../sys/dao/app/ResultCommentMapper.java | 1 + .../sys/dao/app/ResultDetailMapper.java | 2 + .../sys/service/app/ResultCommentService.java | 2 + .../sys/service/app/ResultDetailService.java | 2 + .../app/impl/ResultCommentServiceImpl.java | 5 ++ .../app/impl/ResultDetailServiceImpl.java | 5 ++ .../mapper/app/ResultCommentMapper.xml | 9 ++ .../mapper/app/ResultDetailMapper.xml | 6 +- 9 files changed, 99 insertions(+), 20 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 23a3ee5d..3b469322 100644 --- a/src/main/java/com/lz/modules/app/controller/ResultRecordController.java +++ b/src/main/java/com/lz/modules/app/controller/ResultRecordController.java @@ -123,6 +123,7 @@ public class ResultRecordController extends AbstractController { @Autowired private ResourceService resourceService; + /** * 列表 */ @@ -755,6 +756,8 @@ public class ResultRecordController extends AbstractController { } } + String commandValue = ""; + int commandIndex = 1; for (ResultRecortModelDto model:dto.getRecortModelDtos() ) { int index = 0; @@ -766,36 +769,77 @@ public class ResultRecordController extends AbstractController { ) {//排序 ResultDetail resultDetail = new ResultDetail(); BeanUtils.copyProperties(detailDto, resultDetail); + ResultDetail resultDetail1 = null; if(!isSetKeyResult && resultDetail.getId() != null && mapDetails.containsKey(resultDetail.getId())){ //这里判断是否有更新,或者删除 - ResultDetail resultDetail1 = mapDetails.get(resultDetail.getId()); + resultDetail1 = mapDetails.get(resultDetail.getId()); boolean isUp = false; - if(!resultDetail.getTarget().equals(resultDetail1.getTarget())){ - //打上标识 - isUp = true; - - } - - if(!resultDetail.getKeyResult().equals(resultDetail1.getKeyResult())){ - //打上标识 - isUp = true; - resultDetail1.setKeyResult("" + resultDetail1.getKeyResult() + ""); - } if(resultDetail.getIsDelete().intValue() == 1){//被删除了 - resultDetail.setIsDelete(0); - isUp = true; - } - if(!resultDetail.getCheckWeight().equals(resultDetail1.getCheckWeight())){ - //打上标识 isUp = true; + }else{ + if(!resultDetail.getTarget().equals(resultDetail1.getTarget())){ + //打上标识 + isUp = true; + } + if(!resultDetail.getKeyResult().equals(resultDetail1.getKeyResult())){ + //打上标识 + isUp = true; + } + + if(!resultDetail.getCheckWeight().equals(resultDetail1.getCheckWeight())){ + //打上标识 + isUp = true; + } } + if(isUp){ resultDetail1.setId(null); - resultDetail1.setIsBack(1); - resultDetail1.setTarget("" + resultDetail1.getTarget() + ""); + resultDetail1.setIsBack(2); resultDetail1.setBackId(resultDetail.getId()); inserts.add(resultDetail1); } + }else{ + //查询本detail是否编辑过 + resultDetail1 = resultDetailService.selectNotNoticeResultDetailByBackId(resultDetail.getId()); + if(resultDetail1 != null){ + updates.add(resultDetail1); + } + + } + if(dto.getCommandId() != null && dto.getCommandId().intValue() > 0 && resultDetail1 != null){ + //有评论id + if(resultDetail1.getIsDelete().intValue() == 1){ + commandValue += (commandIndex + "(删除)" + resultDetail1.getTarget() + "\r\n"); + commandIndex++; + resultDetail1.setIsBack(1); + }else{ + boolean isUp = false; + if(!resultDetail.getTarget().equals(resultDetail1.getTarget())){ + //打上标识 + commandValue += (commandIndex + "(修改) 名称:" + + resultDetail1.getTarget()+ " 为:" + resultDetail.getTarget() + "\r\n"); + isUp = true; + + } + if(!resultDetail.getKeyResult().equals(resultDetail1.getKeyResult())){ + //打上标识 + commandValue += (commandIndex + "(修改) 考核标准:" + + resultDetail1.getKeyResult() + " 为:" + resultDetail.getTarget() + "\r\n"); + isUp = true; + } + if(!resultDetail.getCheckWeight().equals(resultDetail1.getCheckWeight())){ + //打上标识 + commandValue += (commandIndex + "(修改) 权重:" + + resultDetail1.getCheckWeight().multiply(new BigDecimal(100)).intValue() + "% 为:" + + resultDetail.getCheckWeight().multiply(new BigDecimal(100)).intValue() + + "%\r\n"); + isUp = true; + } + if(isUp){ + commandIndex++; + resultDetail1.setIsBack(1); + } + } } resultDetail.setPriority(index); @@ -857,6 +901,11 @@ public class ResultRecordController extends AbstractController { resultRecordService.updateResultRecordById(resultRecord); + if(dto.getCommandId() != null && dto.getCommandId().intValue() > 0 && commandValue.length() > 0){ + //修改评论信息 + resultCommentService.updateResultCommentCommentById(dto.getCommandId(), commandValue); + } + return R.ok(); diff --git a/src/main/java/com/lz/modules/sys/dao/app/ResultCommentMapper.java b/src/main/java/com/lz/modules/sys/dao/app/ResultCommentMapper.java index aa02c47d..384a9b20 100644 --- a/src/main/java/com/lz/modules/sys/dao/app/ResultCommentMapper.java +++ b/src/main/java/com/lz/modules/sys/dao/app/ResultCommentMapper.java @@ -38,4 +38,5 @@ public interface ResultCommentMapper extends BaseMapper { ResultComment selectLastComment(@Param("recordId") Long recordId); + int updateResultCommentCommentById(@Param("commandId") Long commandId, @Param("commandValue") String commandValue); } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/sys/dao/app/ResultDetailMapper.java b/src/main/java/com/lz/modules/sys/dao/app/ResultDetailMapper.java index e57b1598..cf20b5a9 100644 --- a/src/main/java/com/lz/modules/sys/dao/app/ResultDetailMapper.java +++ b/src/main/java/com/lz/modules/sys/dao/app/ResultDetailMapper.java @@ -48,4 +48,6 @@ public interface ResultDetailMapper extends BaseMapper { List selectDtosByRecordId(@Param("recordResultId") Long id, @Param("modelId") Long modelId); int deleteResultDetailByRecordId(@Param("recordId") Long recordId); + + ResultDetail selectNotNoticeResultDetailByBackId(@Param("backId") Long backId); } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/sys/service/app/ResultCommentService.java b/src/main/java/com/lz/modules/sys/service/app/ResultCommentService.java index 2c40aa72..f9abc583 100644 --- a/src/main/java/com/lz/modules/sys/service/app/ResultCommentService.java +++ b/src/main/java/com/lz/modules/sys/service/app/ResultCommentService.java @@ -40,4 +40,6 @@ public interface ResultCommentService extends IService { void addOrUpdateComment(ResultRecordReq req, Long userId, int status , FlowRecord lastUsedFlowRecord); + + int updateResultCommentCommentById(Long commandId, String commandValue); } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/sys/service/app/ResultDetailService.java b/src/main/java/com/lz/modules/sys/service/app/ResultDetailService.java index b79f45d5..c7f5d852 100644 --- a/src/main/java/com/lz/modules/sys/service/app/ResultDetailService.java +++ b/src/main/java/com/lz/modules/sys/service/app/ResultDetailService.java @@ -72,4 +72,6 @@ public interface ResultDetailService extends IService { List selectDtosByRecordId(Long id, Long modelId); int deleteResultDetailByRecordId(Long recordId); + + ResultDetail selectNotNoticeResultDetailByBackId(Long id); } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/sys/service/app/impl/ResultCommentServiceImpl.java b/src/main/java/com/lz/modules/sys/service/app/impl/ResultCommentServiceImpl.java index 78929397..899a7e7a 100644 --- a/src/main/java/com/lz/modules/sys/service/app/impl/ResultCommentServiceImpl.java +++ b/src/main/java/com/lz/modules/sys/service/app/impl/ResultCommentServiceImpl.java @@ -113,4 +113,9 @@ public class ResultCommentServiceImpl extends ServiceImpl + + update + lz_result_comment + set + + comment = #{commandValue} + ,gmt_modified = now() + where id = #{commandId} + diff --git a/src/main/resources/mapper/app/ResultDetailMapper.xml b/src/main/resources/mapper/app/ResultDetailMapper.xml index 256ba69d..f6739378 100644 --- a/src/main/resources/mapper/app/ResultDetailMapper.xml +++ b/src/main/resources/mapper/app/ResultDetailMapper.xml @@ -196,12 +196,16 @@ update lz_result_detail set is_delete = 1, gmt_modified = now() where record_id=#{recordId} and is_delete = 0 + + From e2616f675df2983fd42dd5179e3a1adfe0788f89 Mon Sep 17 00:00:00 2001 From: wulin Date: Mon, 7 Dec 2020 13:37:53 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9commandId=E4=B8=BAcomme?= =?UTF-8?q?ntId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lz/modules/app/controller/ResultRecordController.java | 6 +++--- .../com/lz/modules/flow/model/ResultRecordDetailDto.java | 2 +- 2 files changed, 4 insertions(+), 4 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 deecf083..31b6d724 100644 --- a/src/main/java/com/lz/modules/app/controller/ResultRecordController.java +++ b/src/main/java/com/lz/modules/app/controller/ResultRecordController.java @@ -812,7 +812,7 @@ public class ResultRecordController extends AbstractController { } } - if(dto.getCommandId() != null && dto.getCommandId().intValue() > 0 && resultDetail1 != null){ + if(dto.getCommentId() != null && dto.getCommentId().intValue() > 0 && resultDetail1 != null){ //有评论id if(resultDetail1.getIsDelete().intValue() == 1){ commandValue += (commandIndex + "(删除)" + resultDetail1.getTarget() + "\r\n"); @@ -907,9 +907,9 @@ public class ResultRecordController extends AbstractController { resultRecordService.updateResultRecordById(resultRecord); - if(dto.getCommandId() != null && dto.getCommandId().intValue() > 0 && commandValue.length() > 0){ + if(dto.getCommentId() != null && dto.getCommentId().intValue() > 0 && commandValue.length() > 0){ //修改评论信息 - resultCommentService.updateResultCommentCommentById(dto.getCommandId(), commandValue); + resultCommentService.updateResultCommentCommentById(dto.getCommentId(), commandValue); } return R.ok(); diff --git a/src/main/java/com/lz/modules/flow/model/ResultRecordDetailDto.java b/src/main/java/com/lz/modules/flow/model/ResultRecordDetailDto.java index 19d1ad27..58648fbf 100644 --- a/src/main/java/com/lz/modules/flow/model/ResultRecordDetailDto.java +++ b/src/main/java/com/lz/modules/flow/model/ResultRecordDetailDto.java @@ -34,7 +34,7 @@ public class ResultRecordDetailDto { @ApiModelProperty(value = "备注", name = "remark") private String remark; @ApiModelProperty(value = "业绩评论id", name = "commandId") - private Long commandId; + private Long commentId; //员工id @ApiModelProperty(value = "员工id", name = "staffId") private Long staffId; From d23a9536f3244fda2d5d236a55f1e1bc89b92f30 Mon Sep 17 00:00:00 2001 From: wulin Date: Mon, 7 Dec 2020 14:01:59 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/app/controller/ResultRecordController.java | 9 +++++---- src/main/resources/mapper/app/ResultCommentMapper.xml | 2 +- src/main/resources/mapper/app/ResultDetailMapper.xml | 4 ++-- 3 files changed, 8 insertions(+), 7 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 31b6d724..6eae6c67 100644 --- a/src/main/java/com/lz/modules/app/controller/ResultRecordController.java +++ b/src/main/java/com/lz/modules/app/controller/ResultRecordController.java @@ -815,33 +815,34 @@ public class ResultRecordController extends AbstractController { if(dto.getCommentId() != null && dto.getCommentId().intValue() > 0 && resultDetail1 != null){ //有评论id if(resultDetail1.getIsDelete().intValue() == 1){ - commandValue += (commandIndex + "(删除)" + resultDetail1.getTarget() + "\r\n"); + commandValue += (commandIndex + ":(删除)" + resultDetail1.getTarget() + "\r\n"); commandIndex++; resultDetail1.setIsBack(1); }else{ boolean isUp = false; if(!resultDetail.getTarget().equals(resultDetail1.getTarget())){ //打上标识 - commandValue += (commandIndex + "(修改) 名称:" + + commandValue += ("(修改) 名称:" + resultDetail1.getTarget()+ " 为:" + resultDetail.getTarget() + "\r\n"); isUp = true; } if(!resultDetail.getKeyResult().equals(resultDetail1.getKeyResult())){ //打上标识 - commandValue += (commandIndex + "(修改) 考核标准:" + + commandValue += ("(修改) 考核标准:" + resultDetail1.getKeyResult() + " 为:" + resultDetail.getTarget() + "\r\n"); isUp = true; } if(!resultDetail.getCheckWeight().equals(resultDetail1.getCheckWeight())){ //打上标识 - commandValue += (commandIndex + "(修改) 权重:" + + commandValue += ("(修改) 权重:" + resultDetail1.getCheckWeight().multiply(new BigDecimal(100)).intValue() + "% 为:" + resultDetail.getCheckWeight().multiply(new BigDecimal(100)).intValue() + "%\r\n"); isUp = true; } if(isUp){ + commandValue = commandValue + ":" + commandValue; commandIndex++; resultDetail1.setIsBack(1); } diff --git a/src/main/resources/mapper/app/ResultCommentMapper.xml b/src/main/resources/mapper/app/ResultCommentMapper.xml index f0ec404d..8e831093 100644 --- a/src/main/resources/mapper/app/ResultCommentMapper.xml +++ b/src/main/resources/mapper/app/ResultCommentMapper.xml @@ -113,7 +113,7 @@ update lz_result_comment set - + opt_desc = '修改了目标', comment = #{commandValue} ,gmt_modified = now() where id = #{commandId} diff --git a/src/main/resources/mapper/app/ResultDetailMapper.xml b/src/main/resources/mapper/app/ResultDetailMapper.xml index f6739378..a24c4744 100644 --- a/src/main/resources/mapper/app/ResultDetailMapper.xml +++ b/src/main/resources/mapper/app/ResultDetailMapper.xml @@ -147,7 +147,7 @@ + From 3717d59286e14ee9b6fea6603ed068d1e55939f7 Mon Sep 17 00:00:00 2001 From: wulin Date: Mon, 7 Dec 2020 14:51:48 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ResultRecordController.java | 148 ++++++++++-------- .../sys/dao/app/ResultDetailMapper.java | 2 + .../sys/service/app/ResultDetailService.java | 2 + .../app/impl/ResultDetailServiceImpl.java | 4 + .../mapper/app/ResultDetailMapper.xml | 4 + 5 files changed, 99 insertions(+), 61 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 6eae6c67..e4d4ab94 100644 --- a/src/main/java/com/lz/modules/app/controller/ResultRecordController.java +++ b/src/main/java/com/lz/modules/app/controller/ResultRecordController.java @@ -752,6 +752,8 @@ public class ResultRecordController extends AbstractController { Map mapDetails = resultDetails.stream().collect(Collectors.toMap(ResultDetail::getId, Function.identity(), (e, r) -> e)); + List updateResultDetails = new ArrayList<>(); + //获取当前绩效的节点 boolean isSetKeyResult = false; List flowRecords = flowRecordService.selectFlowRecordByRecordIdStatus(dto.getId(), 2); @@ -762,8 +764,7 @@ public class ResultRecordController extends AbstractController { } } - String commandValue = ""; - int commandIndex = 1; + for (ResultRecortModelDto model:dto.getRecortModelDtos() ) { int index = 0; @@ -775,79 +776,43 @@ public class ResultRecordController extends AbstractController { ) {//排序 ResultDetail resultDetail = new ResultDetail(); BeanUtils.copyProperties(detailDto, resultDetail); - ResultDetail resultDetail1 = null; - if(!isSetKeyResult && resultDetail.getId() != null && mapDetails.containsKey(resultDetail.getId())){ - //这里判断是否有更新,或者删除 - resultDetail1 = mapDetails.get(resultDetail.getId()); - boolean isUp = false; - if(resultDetail.getIsDelete().intValue() == 1){//被删除了 - isUp = true; - }else{ - if(!resultDetail.getTarget().equals(resultDetail1.getTarget())){ - //打上标识 - isUp = true; - } - if(!resultDetail.getKeyResult().equals(resultDetail1.getKeyResult())){ - //打上标识 - isUp = true; - } - if(!resultDetail.getCheckWeight().equals(resultDetail1.getCheckWeight())){ - //打上标识 - isUp = true; - } - } - - if(isUp){ - resultDetail1.setId(null); - resultDetail1.setIsBack(2); - resultDetail1.setBackId(resultDetail.getId()); - inserts.add(resultDetail1); - } - }else{ - //查询本detail是否编辑过 - resultDetail1 = resultDetailService.selectNotNoticeResultDetailByBackId(resultDetail.getId()); - if(resultDetail1 != null){ - updates.add(resultDetail1); - } - - } - if(dto.getCommentId() != null && dto.getCommentId().intValue() > 0 && resultDetail1 != null){ - //有评论id - if(resultDetail1.getIsDelete().intValue() == 1){ - commandValue += (commandIndex + ":(删除)" + resultDetail1.getTarget() + "\r\n"); - commandIndex++; - resultDetail1.setIsBack(1); - }else{ + if(resultDetail.getIsDelete().intValue() == 1){//被删除了 + resultDetail.setIsBack(2); + resultDetail.setBackId(resultDetail.getId()); + updateResultDetails.add(resultDetail); + }else { + if(!isSetKeyResult && resultDetail.getId() != null && mapDetails.containsKey(resultDetail.getId())){ + //这里判断是否有更新,或者删除 boolean isUp = false; + ResultDetail resultDetail1 = null; + resultDetail1 = mapDetails.get(resultDetail.getId()); + + if(!resultDetail.getTarget().equals(resultDetail1.getTarget())){ //打上标识 - commandValue += ("(修改) 名称:" + - resultDetail1.getTarget()+ " 为:" + resultDetail.getTarget() + "\r\n"); isUp = true; - } if(!resultDetail.getKeyResult().equals(resultDetail1.getKeyResult())){ //打上标识 - commandValue += ("(修改) 考核标准:" + - resultDetail1.getKeyResult() + " 为:" + resultDetail.getTarget() + "\r\n"); isUp = true; } + if(!resultDetail.getCheckWeight().equals(resultDetail1.getCheckWeight())){ //打上标识 - commandValue += ("(修改) 权重:" + - resultDetail1.getCheckWeight().multiply(new BigDecimal(100)).intValue() + "% 为:" - + resultDetail.getCheckWeight().multiply(new BigDecimal(100)).intValue() + - "%\r\n"); isUp = true; } if(isUp){ - commandValue = commandValue + ":" + commandValue; - commandIndex++; - resultDetail1.setIsBack(1); + resultDetail1.setId(null); + resultDetail1.setIsBack(2); + resultDetail1.setBackId(resultDetail.getId()); + inserts.add(resultDetail1); } } + + } + resultDetail.setPriority(index); index++; @@ -908,14 +873,75 @@ public class ResultRecordController extends AbstractController { resultRecordService.updateResultRecordById(resultRecord); - if(dto.getCommentId() != null && dto.getCommentId().intValue() > 0 && commandValue.length() > 0){ + if(dto.getCommentId() != null && dto.getCommentId().intValue() > 0){ //修改评论信息 - resultCommentService.updateResultCommentCommentById(dto.getCommentId(), commandValue); + updateResultDetails.addAll(resultDetailService.selectNotNoticeResultDetailByRecordId(dto.getId())) ; + log.info("可能需要写入评论的内容条数{}", updateResultDetails.size()); + //去重 + mapDetails = updateResultDetails.stream().collect(Collectors.toMap(ResultDetail::getId, Function.identity(), (e, r) -> e)); + updateResultDetails = mapDetails.values().stream().collect(Collectors.toList()); + log.info("实际需要写入评论的内容条数{}", updateResultDetails.size()); + if(updateResultDetails.size() > 0){ + updates.addAll(inserts); + + mapDetails = updates.stream().collect(Collectors.toMap(ResultDetail::getId, Function.identity(), (e, r) -> e)); + + String commandValue = ""; + int commandIndex = 1; + for (ResultDetail resultDetail1:updateResultDetails + ) { + log.info("修改的对象为{}", resultDetail1); + if(resultDetail1.getIsDelete().intValue() == 1){ + commandValue += (commandIndex + ":(删除)" + resultDetail1.getTarget() + "\r\n"); + commandIndex++; + resultDetail1.setIsBack(1); + }else{ + + ResultDetail resultDetail = mapDetails.get(resultDetail1.getBackId()); + if(resultDetail != null){ + log.info("修改后的对象为{}", resultDetail1); + boolean isUp = false; + if(!resultDetail.getTarget().equals(resultDetail1.getTarget())){ + //打上标识 + commandValue += ("(修改) 名称:" + + resultDetail1.getTarget()+ " 为:" + resultDetail.getTarget() + "\r\n"); + isUp = true; + + } + if(!resultDetail.getKeyResult().equals(resultDetail1.getKeyResult())){ + //打上标识 + commandValue += ("(修改) 考核标准:" + + resultDetail1.getKeyResult() + " 为:" + resultDetail.getTarget() + "\r\n"); + isUp = true; + } + if(!resultDetail.getCheckWeight().equals(resultDetail1.getCheckWeight())){ + //打上标识 + commandValue += ("(修改) 权重:" + + resultDetail1.getCheckWeight().multiply(new BigDecimal(100)).intValue() + "% 为:" + + resultDetail.getCheckWeight().multiply(new BigDecimal(100)).intValue() + + "%\r\n"); + isUp = true; + } + if(isUp){ + commandValue = commandValue + ":" + commandValue; + commandIndex++; + resultDetail1.setIsBack(1); + } + } + + } + } + if(commandValue.length() > 0){ + log.info("需要写入评论,具体呢容为{}", commandValue); + resultDetailService.updateBatchById(updateResultDetails); + resultCommentService.updateResultCommentCommentById(dto.getCommentId(), commandValue); + } + } + + } return R.ok(); - - } /** diff --git a/src/main/java/com/lz/modules/sys/dao/app/ResultDetailMapper.java b/src/main/java/com/lz/modules/sys/dao/app/ResultDetailMapper.java index cf20b5a9..a99e12d1 100644 --- a/src/main/java/com/lz/modules/sys/dao/app/ResultDetailMapper.java +++ b/src/main/java/com/lz/modules/sys/dao/app/ResultDetailMapper.java @@ -50,4 +50,6 @@ public interface ResultDetailMapper extends BaseMapper { int deleteResultDetailByRecordId(@Param("recordId") Long recordId); ResultDetail selectNotNoticeResultDetailByBackId(@Param("backId") Long backId); + + List selectNotNoticeResultDetailByRecordId(@Param("recordId") Long recordId); } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/sys/service/app/ResultDetailService.java b/src/main/java/com/lz/modules/sys/service/app/ResultDetailService.java index c7f5d852..8fe6ad2b 100644 --- a/src/main/java/com/lz/modules/sys/service/app/ResultDetailService.java +++ b/src/main/java/com/lz/modules/sys/service/app/ResultDetailService.java @@ -74,4 +74,6 @@ public interface ResultDetailService extends IService { int deleteResultDetailByRecordId(Long recordId); ResultDetail selectNotNoticeResultDetailByBackId(Long id); + + List selectNotNoticeResultDetailByRecordId(Long recordId); } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/sys/service/app/impl/ResultDetailServiceImpl.java b/src/main/java/com/lz/modules/sys/service/app/impl/ResultDetailServiceImpl.java index 075b03b9..83c04159 100644 --- a/src/main/java/com/lz/modules/sys/service/app/impl/ResultDetailServiceImpl.java +++ b/src/main/java/com/lz/modules/sys/service/app/impl/ResultDetailServiceImpl.java @@ -350,4 +350,8 @@ public class ResultDetailServiceImpl extends ServiceImpl selectNotNoticeResultDetailByRecordId(Long recordId){ + return resultDetailMapper.selectNotNoticeResultDetailByRecordId(recordId); + } } diff --git a/src/main/resources/mapper/app/ResultDetailMapper.xml b/src/main/resources/mapper/app/ResultDetailMapper.xml index a24c4744..50f504c4 100644 --- a/src/main/resources/mapper/app/ResultDetailMapper.xml +++ b/src/main/resources/mapper/app/ResultDetailMapper.xml @@ -207,5 +207,9 @@ select * from lz_result_detail where back_id = #{backId} and is_back = 2 order by priority asc + + From c49306c2a1c77e12a5b4fe2547cc8ce685e80dd4 Mon Sep 17 00:00:00 2001 From: wulin Date: Mon, 7 Dec 2020 15:32:19 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/controller/ResultRecordController.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 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 e4d4ab94..78a6b21b 100644 --- a/src/main/java/com/lz/modules/app/controller/ResultRecordController.java +++ b/src/main/java/com/lz/modules/app/controller/ResultRecordController.java @@ -777,7 +777,7 @@ public class ResultRecordController extends AbstractController { ResultDetail resultDetail = new ResultDetail(); BeanUtils.copyProperties(detailDto, resultDetail); - if(resultDetail.getIsDelete().intValue() == 1){//被删除了 + if(resultDetail.getIsDelete() != null && resultDetail.getIsDelete().intValue() == 1){//被删除了 resultDetail.setIsBack(2); resultDetail.setBackId(resultDetail.getId()); updateResultDetails.add(resultDetail); @@ -901,29 +901,33 @@ public class ResultRecordController extends AbstractController { if(resultDetail != null){ log.info("修改后的对象为{}", resultDetail1); boolean isUp = false; + String value = ""; + String heard = ""; if(!resultDetail.getTarget().equals(resultDetail1.getTarget())){ //打上标识 - commandValue += ("(修改) 名称:" + + value += ("(修改) 名称:" + resultDetail1.getTarget()+ " 为:" + resultDetail.getTarget() + "\r\n"); isUp = true; + }else{ + heard = resultDetail1.getTarget() + ":\r\n"; } if(!resultDetail.getKeyResult().equals(resultDetail1.getKeyResult())){ //打上标识 - commandValue += ("(修改) 考核标准:" + + value += ("(修改) 考核标准:" + resultDetail1.getKeyResult() + " 为:" + resultDetail.getTarget() + "\r\n"); isUp = true; } if(!resultDetail.getCheckWeight().equals(resultDetail1.getCheckWeight())){ //打上标识 - commandValue += ("(修改) 权重:" + + value += ("(修改) 权重:" + resultDetail1.getCheckWeight().multiply(new BigDecimal(100)).intValue() + "% 为:" + resultDetail.getCheckWeight().multiply(new BigDecimal(100)).intValue() + "%\r\n"); isUp = true; } if(isUp){ - commandValue = commandValue + ":" + commandValue; + commandValue += (commandIndex + ":" + heard + value); commandIndex++; resultDetail1.setIsBack(1); } From f2fb7854232d65164c10ac2fbe0aff3eb5c5ce00 Mon Sep 17 00:00:00 2001 From: wulin Date: Mon, 7 Dec 2020 15:45:29 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lz/modules/app/controller/ResultRecordController.java | 2 ++ src/main/resources/mapper/app/ResultDetailMapper.xml | 4 ++-- 2 files changed, 4 insertions(+), 2 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 78a6b21b..2c3f0b82 100644 --- a/src/main/java/com/lz/modules/app/controller/ResultRecordController.java +++ b/src/main/java/com/lz/modules/app/controller/ResultRecordController.java @@ -781,6 +781,8 @@ public class ResultRecordController extends AbstractController { resultDetail.setIsBack(2); resultDetail.setBackId(resultDetail.getId()); updateResultDetails.add(resultDetail); + }else if(resultDetail.getId() == null){ + resultDetail.setIsBack(3);//新增 }else { if(!isSetKeyResult && resultDetail.getId() != null && mapDetails.containsKey(resultDetail.getId())){ //这里判断是否有更新,或者删除 diff --git a/src/main/resources/mapper/app/ResultDetailMapper.xml b/src/main/resources/mapper/app/ResultDetailMapper.xml index 50f504c4..d5ac1dc0 100644 --- a/src/main/resources/mapper/app/ResultDetailMapper.xml +++ b/src/main/resources/mapper/app/ResultDetailMapper.xml @@ -196,7 +196,7 @@ @@ -208,7 +208,7 @@ From 4b0fb6eaa6aa350e6850764699ab788d6144386a Mon Sep 17 00:00:00 2001 From: wulin Date: Mon, 7 Dec 2020 15:51:44 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lz/modules/app/controller/ResultRecordController.java | 4 ++++ 1 file changed, 4 insertions(+) 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 2c3f0b82..f2c64844 100644 --- a/src/main/java/com/lz/modules/app/controller/ResultRecordController.java +++ b/src/main/java/com/lz/modules/app/controller/ResultRecordController.java @@ -897,6 +897,10 @@ public class ResultRecordController extends AbstractController { commandValue += (commandIndex + ":(删除)" + resultDetail1.getTarget() + "\r\n"); commandIndex++; resultDetail1.setIsBack(1); + }else if(resultDetail1.getIsBack().intValue() == 3){ + commandValue += (commandIndex + ":(新增)" + resultDetail1.getTarget() + "\r\n"); + commandIndex++; + resultDetail1.setIsBack(0); }else{ ResultDetail resultDetail = mapDetails.get(resultDetail1.getBackId()); From 5eab0c77fce4ab7b103cccdeca7a91a9ab2832f9 Mon Sep 17 00:00:00 2001 From: wulin Date: Mon, 7 Dec 2020 16:00:50 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=83=A8=E5=88=86?= =?UTF-8?q?=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lz/modules/app/controller/ResultRecordController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 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 f2c64844..243f9563 100644 --- a/src/main/java/com/lz/modules/app/controller/ResultRecordController.java +++ b/src/main/java/com/lz/modules/app/controller/ResultRecordController.java @@ -894,11 +894,11 @@ public class ResultRecordController extends AbstractController { ) { log.info("修改的对象为{}", resultDetail1); if(resultDetail1.getIsDelete().intValue() == 1){ - commandValue += (commandIndex + ":(删除)" + resultDetail1.getTarget() + "\r\n"); + commandValue += (commandIndex + ":(删除) 指标" + resultDetail1.getTarget() + "\r\n"); commandIndex++; resultDetail1.setIsBack(1); }else if(resultDetail1.getIsBack().intValue() == 3){ - commandValue += (commandIndex + ":(新增)" + resultDetail1.getTarget() + "\r\n"); + commandValue += (commandIndex + ":(新增) 指标" + resultDetail1.getTarget() + "\r\n"); commandIndex++; resultDetail1.setIsBack(0); }else{ @@ -916,7 +916,7 @@ public class ResultRecordController extends AbstractController { isUp = true; }else{ - heard = resultDetail1.getTarget() + ":\r\n"; + heard = "指标:" + resultDetail1.getTarget() + "\r\n"; } if(!resultDetail.getKeyResult().equals(resultDetail1.getKeyResult())){ //打上标识 From 5787104f13a0d9c0b3c6f5f10059b9b513a9e2c5 Mon Sep 17 00:00:00 2001 From: wulin Date: Mon, 7 Dec 2020 16:06:29 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=80=83=E6=A0=B8?= =?UTF-8?q?=E6=A0=87=E5=87=86=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lz/modules/app/controller/ResultRecordController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 243f9563..be2d2af8 100644 --- a/src/main/java/com/lz/modules/app/controller/ResultRecordController.java +++ b/src/main/java/com/lz/modules/app/controller/ResultRecordController.java @@ -921,7 +921,7 @@ public class ResultRecordController extends AbstractController { if(!resultDetail.getKeyResult().equals(resultDetail1.getKeyResult())){ //打上标识 value += ("(修改) 考核标准:" + - resultDetail1.getKeyResult() + " 为:" + resultDetail.getTarget() + "\r\n"); + resultDetail1.getKeyResult() + " 为:" + resultDetail.getKeyResult() + "\r\n"); isUp = true; } if(!resultDetail.getCheckWeight().equals(resultDetail1.getCheckWeight())){ From c333fc78a424688e7c07d12568030b953d66fcc1 Mon Sep 17 00:00:00 2001 From: wulin Date: Mon, 7 Dec 2020 16:13:31 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E6=96=87=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/controller/ResultRecordController.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 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 be2d2af8..4b8e4c13 100644 --- a/src/main/java/com/lz/modules/app/controller/ResultRecordController.java +++ b/src/main/java/com/lz/modules/app/controller/ResultRecordController.java @@ -894,11 +894,11 @@ public class ResultRecordController extends AbstractController { ) { log.info("修改的对象为{}", resultDetail1); if(resultDetail1.getIsDelete().intValue() == 1){ - commandValue += (commandIndex + ":(删除) 指标" + resultDetail1.getTarget() + "\r\n"); + commandValue += (commandIndex + ":(删除) 指标" + resultDetail1.getTarget() + "\n"); commandIndex++; resultDetail1.setIsBack(1); }else if(resultDetail1.getIsBack().intValue() == 3){ - commandValue += (commandIndex + ":(新增) 指标" + resultDetail1.getTarget() + "\r\n"); + commandValue += (commandIndex + ":(新增) 指标" + resultDetail1.getTarget() + "\n"); commandIndex++; resultDetail1.setIsBack(0); }else{ @@ -912,24 +912,24 @@ public class ResultRecordController extends AbstractController { if(!resultDetail.getTarget().equals(resultDetail1.getTarget())){ //打上标识 value += ("(修改) 名称:" + - resultDetail1.getTarget()+ " 为:" + resultDetail.getTarget() + "\r\n"); + resultDetail1.getTarget()+ " \n(为):\n" + resultDetail.getTarget() + "\n"); isUp = true; }else{ - heard = "指标:" + resultDetail1.getTarget() + "\r\n"; + heard = "指标:" + resultDetail1.getTarget() + "\n"; } if(!resultDetail.getKeyResult().equals(resultDetail1.getKeyResult())){ //打上标识 value += ("(修改) 考核标准:" + - resultDetail1.getKeyResult() + " 为:" + resultDetail.getKeyResult() + "\r\n"); + resultDetail1.getKeyResult() + "\n(为):\n" + resultDetail.getKeyResult() + "\n"); isUp = true; } if(!resultDetail.getCheckWeight().equals(resultDetail1.getCheckWeight())){ //打上标识 value += ("(修改) 权重:" + - resultDetail1.getCheckWeight().multiply(new BigDecimal(100)).intValue() + "% 为:" + resultDetail1.getCheckWeight().multiply(new BigDecimal(100)).intValue() + "%\n(为):\n" + resultDetail.getCheckWeight().multiply(new BigDecimal(100)).intValue() + - "%\r\n"); + "%\n"); isUp = true; } if(isUp){