fix 80746 车型项目库详情-删除评估过的数据,风险性总览数量没有变化,再次添加提示操作失败
This commit is contained in:
+3
-2
@@ -705,7 +705,6 @@ public class ProcessProjectStandardService extends ServiceImpl<ProcessProjectSta
|
|||||||
projectLibrary.setTermName(termName);
|
projectLibrary.setTermName(termName);
|
||||||
}
|
}
|
||||||
projectLibrary.setStandardState(processProjectStandard.getDecompositionOrderSource());
|
projectLibrary.setStandardState(processProjectStandard.getDecompositionOrderSource());
|
||||||
projectLibrary.setModelSeries(term.getModelSeries());
|
|
||||||
projectLibrary.setResult(term.getAssessResults());
|
projectLibrary.setResult(term.getAssessResults());
|
||||||
projectLibrary.setMaterial(term.getFileId());
|
projectLibrary.setMaterial(term.getFileId());
|
||||||
projectLibrary.setValuationTime(date);
|
projectLibrary.setValuationTime(date);
|
||||||
@@ -713,11 +712,13 @@ public class ProcessProjectStandardService extends ServiceImpl<ProcessProjectSta
|
|||||||
projectLibrary.setProcessInstanceId(process.getProcessInstanceId());
|
projectLibrary.setProcessInstanceId(process.getProcessInstanceId());
|
||||||
projectLibrary.setProcessNum(process.getPrcNum());
|
projectLibrary.setProcessNum(process.getPrcNum());
|
||||||
projectLibrary.setProcessTermId(termId);
|
projectLibrary.setProcessTermId(termId);
|
||||||
//存入不符合描述
|
//存入不符合描述,车型系列
|
||||||
if (termIdMap.containsKey(termId)) {
|
if (termIdMap.containsKey(termId)) {
|
||||||
List<ProcessProjectStandardTermUser> termUserList = termIdMap.get(termId);
|
List<ProcessProjectStandardTermUser> termUserList = termIdMap.get(termId);
|
||||||
String description = termUserList.stream().map(ProcessProjectStandardTermUser::getDescription).collect(Collectors.joining(","));
|
String description = termUserList.stream().map(ProcessProjectStandardTermUser::getDescription).collect(Collectors.joining(","));
|
||||||
projectLibrary.setDescription(description);
|
projectLibrary.setDescription(description);
|
||||||
|
String modelSeries = termUserList.stream().map(ProcessProjectStandardTermUser::getModelSeries).distinct().collect(Collectors.joining(","));
|
||||||
|
projectLibrary.setModelSeries(modelSeries);
|
||||||
}
|
}
|
||||||
if (allTermIdMap.containsKey(termId)) {
|
if (allTermIdMap.containsKey(termId)) {
|
||||||
List<ProcessProjectStandardTermUser> termUserList = allTermIdMap.get(termId);
|
List<ProcessProjectStandardTermUser> termUserList = allTermIdMap.get(termId);
|
||||||
|
|||||||
+7
-4
@@ -10,6 +10,7 @@ import com.jero.common.api.vo.Result;
|
|||||||
import com.jero.common.aspect.annotation.AutoLog;
|
import com.jero.common.aspect.annotation.AutoLog;
|
||||||
import com.jero.common.aspect.annotation.DictPoint;
|
import com.jero.common.aspect.annotation.DictPoint;
|
||||||
import com.jero.common.constant.CommonConstant;
|
import com.jero.common.constant.CommonConstant;
|
||||||
|
import com.jero.common.constant.enums.YesOrNoEnum;
|
||||||
import com.jero.common.exception.JeroBootException;
|
import com.jero.common.exception.JeroBootException;
|
||||||
import com.jero.common.system.base.controller.JeroController;
|
import com.jero.common.system.base.controller.JeroController;
|
||||||
import com.jero.common.system.query.QueryGenerator;
|
import com.jero.common.system.query.QueryGenerator;
|
||||||
@@ -180,13 +181,15 @@ public class LawsProjectLibraryController extends JeroController<LawsProjectLibr
|
|||||||
}
|
}
|
||||||
LambdaQueryWrapper<LawsAssess> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<LawsAssess> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.eq(LawsAssess::getProjectId, id);
|
wrapper.eq(LawsAssess::getProjectId, id);
|
||||||
List<LawsAssess> list = lawsAssessService.list(wrapper);
|
wrapper.eq(LawsAssess::getDelFlag, YesOrNoEnum.NO.getValue());
|
||||||
List<String> collect = list.stream().map(LawsAssess::getId).collect(Collectors.toList());
|
List<LawsAssess> assessList = lawsAssessService.list(wrapper);
|
||||||
if (collect.isEmpty()) {
|
List<String> standardIdList = assessList.stream().map(LawsAssess::getStandardId).collect(Collectors.toList());
|
||||||
|
if (standardIdList.isEmpty()) {
|
||||||
return Result.OK(new RiskOverviewVo(0, 0, 0, 0));
|
return Result.OK(new RiskOverviewVo(0, 0, 0, 0));
|
||||||
}
|
}
|
||||||
LambdaQueryWrapper<LawsAssessResults> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<LawsAssessResults> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.in(LawsAssessResults::getProjectId, id);
|
queryWrapper.eq(LawsAssessResults::getProjectId, id);
|
||||||
|
queryWrapper.in(LawsAssessResults::getStandardId, standardIdList);
|
||||||
List<LawsAssessResults> assessResults = lawsAssessResultsService.list(queryWrapper);
|
List<LawsAssessResults> assessResults = lawsAssessResultsService.list(queryWrapper);
|
||||||
int a = Math.toIntExact(assessResults.stream().filter(LawsAssessResults -> "1".equals(LawsAssessResults.getAssessResults())).count());
|
int a = Math.toIntExact(assessResults.stream().filter(LawsAssessResults -> "1".equals(LawsAssessResults.getAssessResults())).count());
|
||||||
int b = Math.toIntExact(assessResults.stream().filter(LawsAssessResults -> "2".equals(LawsAssessResults.getAssessResults())).count());
|
int b = Math.toIntExact(assessResults.stream().filter(LawsAssessResults -> "2".equals(LawsAssessResults.getAssessResults())).count());
|
||||||
|
|||||||
+1
-1
@@ -14,7 +14,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||||||
*/
|
*/
|
||||||
public interface LawsAssessMapper extends BaseMapper<LawsAssess> {
|
public interface LawsAssessMapper extends BaseMapper<LawsAssess> {
|
||||||
|
|
||||||
Integer changeDelFlag(@Param("id") String id);
|
Integer changeDelFlag(@Param("projectId") String projectId, @Param("standardId") String standardId);
|
||||||
|
|
||||||
List<LawsAssess> getAllByProjectIdDeleted(@Param("projectId") String projectId);
|
List<LawsAssess> getAllByProjectIdDeleted(@Param("projectId") String projectId);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -34,6 +34,7 @@
|
|||||||
<update id="changeDelFlag">
|
<update id="changeDelFlag">
|
||||||
update laws_assess la
|
update laws_assess la
|
||||||
set la.del_flag = 0
|
set la.del_flag = 0
|
||||||
where id = #{id}
|
where project_id = #{projectId}
|
||||||
|
and standard_id = #{standardId}
|
||||||
</update>
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
+17
-12
@@ -2,6 +2,7 @@ package com.jero.modules.projectLibrary.service.impl;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.jero.common.api.vo.ResultCommon;
|
import com.jero.common.api.vo.ResultCommon;
|
||||||
import com.jero.common.constant.CommonConstant;
|
import com.jero.common.constant.CommonConstant;
|
||||||
import com.jero.common.system.api.ISysBaseAPI;
|
import com.jero.common.system.api.ISysBaseAPI;
|
||||||
@@ -12,7 +13,9 @@ import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
|
|||||||
import com.jero.modules.laws.standard.service.ILawsOverseasStandardService;
|
import com.jero.modules.laws.standard.service.ILawsOverseasStandardService;
|
||||||
import com.jero.modules.projectLibrary.common.AssessCommon;
|
import com.jero.modules.projectLibrary.common.AssessCommon;
|
||||||
import com.jero.modules.projectLibrary.entity.LawsAssess;
|
import com.jero.modules.projectLibrary.entity.LawsAssess;
|
||||||
|
import com.jero.modules.projectLibrary.entity.LawsAssessResults;
|
||||||
import com.jero.modules.projectLibrary.mapper.LawsAssessMapper;
|
import com.jero.modules.projectLibrary.mapper.LawsAssessMapper;
|
||||||
|
import com.jero.modules.projectLibrary.service.ILawsAssessResultsService;
|
||||||
import com.jero.modules.projectLibrary.service.ILawsAssessService;
|
import com.jero.modules.projectLibrary.service.ILawsAssessService;
|
||||||
import com.jero.modules.projectLibrary.vo.DecompositionOrderSourceVO;
|
import com.jero.modules.projectLibrary.vo.DecompositionOrderSourceVO;
|
||||||
import com.jero.modules.projectLibrary.vo.LawsAssessAddVo;
|
import com.jero.modules.projectLibrary.vo.LawsAssessAddVo;
|
||||||
@@ -57,6 +60,8 @@ public class LawsAssessServiceImpl extends ServiceImpl<LawsAssessMapper, LawsAss
|
|||||||
private ISysBaseAPI sysBaseAPI;
|
private ISysBaseAPI sysBaseAPI;
|
||||||
@Resource
|
@Resource
|
||||||
private LawsAssessMapper lawsAssessMapper;
|
private LawsAssessMapper lawsAssessMapper;
|
||||||
|
@Resource
|
||||||
|
private ILawsAssessResultsService lawsAssessResultsService;
|
||||||
/**
|
/**
|
||||||
* 分页查询
|
* 分页查询
|
||||||
*
|
*
|
||||||
@@ -244,21 +249,21 @@ public class LawsAssessServiceImpl extends ServiceImpl<LawsAssessMapper, LawsAss
|
|||||||
for (String standardNumber : standardNumbers.split(",")) {
|
for (String standardNumber : standardNumbers.split(",")) {
|
||||||
LawsDomesticStandard lawsDomesticStandard = lawsDomesticStandardService.queryByStandardNumber(standardNumber);
|
LawsDomesticStandard lawsDomesticStandard = lawsDomesticStandardService.queryByStandardNumber(standardNumber);
|
||||||
if (lawsDomesticStandard != null){
|
if (lawsDomesticStandard != null){
|
||||||
String id = lawsDomesticStandard.getId();
|
String standardId = lawsDomesticStandard.getId();
|
||||||
if (allByProjectIdNotDeletedIdList.contains(id)){
|
if (allByProjectIdNotDeletedIdList.contains(standardId)){
|
||||||
//如果已存在跳过新增
|
//如果已存在跳过新增
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (allByProjectIdDeletedIdList.contains(id)){
|
if (allByProjectIdDeletedIdList.contains(standardId)){
|
||||||
//如果已删除则恢复未删除状态
|
//如果已删除则恢复未删除状态
|
||||||
lawsAssessMapper.changeDelFlag(id);
|
lawsAssessMapper.changeDelFlag(projectId,standardId);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
LawsAssess lawsAssess = new LawsAssess();
|
LawsAssess lawsAssess = new LawsAssess();
|
||||||
lawsAssess.setSource(CommonConstant.STANDARD_SOURCE_1);
|
lawsAssess.setSource(CommonConstant.STANDARD_SOURCE_1);
|
||||||
lawsAssess.setProjectId(projectId);
|
lawsAssess.setProjectId(projectId);
|
||||||
lawsAssess.setStandardId(id);
|
lawsAssess.setStandardId(standardId);
|
||||||
LawsDomesticStandard standard = lawsDomesticStandardService.queryById(id);
|
LawsDomesticStandard standard = lawsDomesticStandardService.queryById(standardId);
|
||||||
lawsAssess.setStandardNumber(standard.getStandardNumber());
|
lawsAssess.setStandardNumber(standard.getStandardNumber());
|
||||||
lawsAssess.setStandardName(standard.getStandardName());
|
lawsAssess.setStandardName(standard.getStandardName());
|
||||||
lawsAssess.setProcessStatus(AssessCommon.NOT_EVALUATED);
|
lawsAssess.setProcessStatus(AssessCommon.NOT_EVALUATED);
|
||||||
@@ -268,21 +273,21 @@ public class LawsAssessServiceImpl extends ServiceImpl<LawsAssessMapper, LawsAss
|
|||||||
}
|
}
|
||||||
LawsOverseasStandard lawsOverseasStandard = lawsOverseasStandardService.queryByStandardNumber(standardNumber);
|
LawsOverseasStandard lawsOverseasStandard = lawsOverseasStandardService.queryByStandardNumber(standardNumber);
|
||||||
if (lawsOverseasStandard != null){
|
if (lawsOverseasStandard != null){
|
||||||
String id = lawsOverseasStandard.getId();
|
String standardId = lawsOverseasStandard.getId();
|
||||||
if (allByProjectIdNotDeletedIdList.contains(id)){
|
if (allByProjectIdNotDeletedIdList.contains(standardId)){
|
||||||
//如果已存在跳过新增
|
//如果已存在跳过新增
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (allByProjectIdDeletedIdList.contains(id)){
|
if (allByProjectIdDeletedIdList.contains(standardId)){
|
||||||
//如果已删除则恢复未删除状态
|
//如果已删除则恢复未删除状态
|
||||||
lawsAssessMapper.changeDelFlag(id);
|
lawsAssessMapper.changeDelFlag(projectId, standardId);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
LawsAssess lawsAssess = new LawsAssess();
|
LawsAssess lawsAssess = new LawsAssess();
|
||||||
lawsAssess.setSource(CommonConstant.STANDARD_SOURCE_2);
|
lawsAssess.setSource(CommonConstant.STANDARD_SOURCE_2);
|
||||||
lawsAssess.setProjectId(projectId);
|
lawsAssess.setProjectId(projectId);
|
||||||
lawsAssess.setStandardId(id);
|
lawsAssess.setStandardId(standardId);
|
||||||
LawsOverseasStandard standard = lawsOverseasStandardService.queryById(id);
|
LawsOverseasStandard standard = lawsOverseasStandardService.queryById(standardId);
|
||||||
lawsAssess.setStandardNumber(standard.getStandardNumber());
|
lawsAssess.setStandardNumber(standard.getStandardNumber());
|
||||||
lawsAssess.setStandardName(standard.getStandardName());
|
lawsAssess.setStandardName(standard.getStandardName());
|
||||||
lawsAssess.setProcessStatus(AssessCommon.NOT_EVALUATED);
|
lawsAssess.setProcessStatus(AssessCommon.NOT_EVALUATED);
|
||||||
|
|||||||
Reference in New Issue
Block a user