Merge branch 'version_performance_2.0' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_performance_2.0

This commit is contained in:
杜建超 2020-12-18 10:54:16 +08:00
commit b151f8a9ec
4 changed files with 27 additions and 16 deletions

View File

@ -468,7 +468,7 @@ public class ResultRecordController extends AbstractController {
List<FlowChartDetailRecord> flowChartDetailRecords =
flowChartDetailRecordService.selectFlowChartDetailRecordsByFlowProcess(resultRecord.getEvaluationId(), ChartFlowType.SCORE.getCode());//获取参与评分的人
//List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdFlowProcess(resultRecord.getId(), ChartFlowType.SCORE.getCode());
List<FlowRecord> flowRecords1 = flowRecordService.selectFlowRecordByRecordIdFlowProcess(resultRecord.getId(), ChartFlowType.SCORE.getCode());
List<StaffEntity> staffs = new ArrayList<>();
Boolean isAllScore = true;//false表示返回所有的评分true表示值返回评分了的人
Boolean isOrScore = false;//是否为或签
@ -987,8 +987,8 @@ public class ResultRecordController extends AbstractController {
}
resultRecordService.updateResultRecordById(resultRecord);
if(dto.getCommentId() != null && dto.getCommentId().intValue() > 0){
String commentId = null;
if(dto.getSave() == null && editResultDetails.size() > 0){//非暂存
//修改评论信息
log.info("修改了多少个指标{}", editResultDetails.size());
editResultDetails.addAll(resultDetailService.selectNotNoticeResultDetailByRecordId(dto.getId())) ;
@ -1058,17 +1058,13 @@ public class ResultRecordController extends AbstractController {
}
if(commandValue.length() > 0){
log.info("需要写入评论,具体呢容为{}", commandValue);
ResultComment resultComment = resultCommentService.selectResultCommentById(dto.getCommentId());
ResultComment resultComment = new ResultComment();//resultCommentService.selectResultCommentById(dto.getCommentId());
log.info("resultComment的值{}", resultComment);
if(resultComment.getOptDesc().indexOf("制定了目标") >= 0){
resultComment.setOptDesc("修改了目标");
resultComment.setComment(commandValue);
}else{
resultComment.setOptDesc("修改了目标-" + resultComment.getOptDesc());
resultComment.setOptDesc("修改了目标");
resultComment.setComment(commandValue);
resultComment.setComment((resultComment.getComment() == null ? "" : (resultComment.getComment() + "\n")) + commandValue);
}
resultCommentService.updateResultCommentById(resultComment);//.updateResultCommentCommentById(dto.getCommentId(), commandValue);
resultCommentService.insertResultComment(resultComment);//.updateResultCommentCommentById(dto.getCommentId(), commandValue);
commentId = resultComment.getId().toString();
}
}
}else{
@ -1084,7 +1080,7 @@ public class ResultRecordController extends AbstractController {
resultDetailService.updateBatchById(editResultDetails);
}
return R.ok();
return R.ok().put("commentId", commentId);
}
/**

View File

@ -13,4 +13,5 @@ public class ApprovalDto {
private Long flowRecordId;// 流程 id
private int resetFlag;
private int clearFlag;//0 全清1 还是保留指标
private Long commentId;
}

View File

@ -101,6 +101,7 @@ public class ResultRecordDetailDto {
@ApiModelProperty(value = "职位", name = "position")
private String position;
/**
*
* @return

View File

@ -143,6 +143,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
@Autowired
private ResultScoreService resultScoreService;
@Override
public ResultRecord selectResultRecordById(Long id) {
return resultRecordMapper.selectResultRecordById(id);
@ -1067,12 +1068,24 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
StaffEntity staffEntity = staffService.selectStaffById(approvalDto.getLoginUserId());
if (staffEntity != null) {
ResultComment resultComment = new ResultComment();
resultComment.setComment(approvalDto.getComment());
if(approvalDto.getCommentId() !=null && approvalDto.getCommentId() > 0 ){
log.info("更新前评论commentId=" + approvalDto.getCommentId());
resultComment = resultCommentService.selectResultCommentById(approvalDto.getCommentId());
}
String comment = StringUtil.isNotBlank(resultComment.getComment()) ? resultComment.getComment() + "_" : "";
String optDesc = StringUtil.isNotBlank(resultComment.getOptDesc()) ? resultComment.getOptDesc() + "_" : "";
resultComment.setComment(comment + approvalDto.getComment());
resultComment.setStaffName(staffEntity.getName());
resultComment.setStaffId(staffEntity.getId());
resultComment.setRecordId(approvalDto.getResultRecordId());
resultComment.setOptDesc(approvalDto.getMenuName() + flowChart.getName());
resultCommentService.insertResultComment(resultComment);
resultComment.setOptDesc(optDesc + approvalDto.getMenuName() + flowChart.getName());
if (approvalDto.getCommentId() !=null && approvalDto.getCommentId() > 0 ){
resultCommentService.updateResultCommentById(resultComment);
log.info("更新后评论commentId=" + resultComment.getId());
}else{
resultCommentService.insertResultComment(resultComment);
log.info("插入后评论commentId=" + resultComment.getId());
}
return resultComment.getId();
}
return 0l;