add 项目库 符合不符合项
This commit is contained in:
+5
-19
@@ -1,25 +1,14 @@
|
||||
package com.jero.modules.projectLibrary.controller;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import cn.hutool.core.collection.CollStreamUtil;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.api.vo.ResultCommon;
|
||||
import com.jero.common.system.api.ISysBaseAPI;
|
||||
import com.jero.common.system.vo.DictModel;
|
||||
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
|
||||
import com.jero.modules.laws.standard.entity.LawsOverseasStandard;
|
||||
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
|
||||
import com.jero.modules.laws.standard.service.ILawsOverseasStandardService;
|
||||
import com.jero.modules.projectLibrary.entity.LawsAssess;
|
||||
import com.jero.modules.projectLibrary.entity.LawsAssessResults;
|
||||
|
||||
import com.jero.modules.projectLibrary.service.ILawsAssessResultsService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.modules.projectLibrary.service.ILawsAssessService;
|
||||
import com.jero.modules.projectLibrary.vo.MetNotMetVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -29,9 +18,6 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 标准评估结果
|
||||
@@ -71,11 +57,11 @@ public class LawsAssessResultsController extends JeroController<LawsAssessResult
|
||||
*/
|
||||
@AutoLog(value = "项目库详情页-评估结果历史-通过id查询-符合/不符合项")
|
||||
@ApiOperation(value="项目库详情页-评估结果历史-通过id查询-符合/不符合项", notes="项目库详情页-评估结果历史-通过id查询-符合/不符合项")
|
||||
@GetMapping(value = "/queryByAssessId")
|
||||
public Result<List<LawsAssessResults>> queryByAssessId(@RequestParam(name="assessId",required=true) String assessId) {
|
||||
List<LawsAssessResults> lawsAssessResultsList = lawsAssessResultsService.queryByAssessId(assessId);
|
||||
@GetMapping(value = "/getMetNotMetVOById")
|
||||
public Result<MetNotMetVO> getMetNotMetVOById(@RequestParam(name="id",required=true) String id) {
|
||||
MetNotMetVO metNotMetVO = lawsAssessResultsService.getMetNotMetVOById(id);
|
||||
|
||||
return Result.OK(lawsAssessResultsList);
|
||||
return Result.OK(metNotMetVO);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+3
-2
@@ -4,6 +4,8 @@ import com.jero.modules.projectLibrary.entity.LawsAssessResults;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.modules.projectLibrary.vo.MetNotMetVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -72,7 +74,6 @@ public interface ILawsAssessResultsService extends IService<LawsAssessResults> {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
LawsAssessResults queryById(String id);
|
||||
MetNotMetVO getMetNotMetVOById(String id);
|
||||
|
||||
List<LawsAssessResults> queryByAssessId(String assessId);
|
||||
}
|
||||
|
||||
+72
-50
@@ -1,6 +1,8 @@
|
||||
package com.jero.modules.projectLibrary.service.impl;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import cn.hutool.core.collection.CollStreamUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.api.vo.ResultCommon;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
@@ -10,11 +12,13 @@ import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
|
||||
import com.jero.modules.laws.standard.entity.LawsOverseasStandard;
|
||||
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
|
||||
import com.jero.modules.laws.standard.service.ILawsOverseasStandardService;
|
||||
import com.jero.modules.projectLibrary.common.AssessCommon;
|
||||
import com.jero.modules.projectLibrary.entity.LawsAssess;
|
||||
import com.jero.modules.projectLibrary.entity.LawsAssessResults;
|
||||
import com.jero.modules.projectLibrary.mapper.LawsAssessResultsMapper;
|
||||
import com.jero.modules.projectLibrary.service.ILawsAssessResultsService;
|
||||
import com.jero.modules.projectLibrary.service.ILawsAssessService;
|
||||
import com.jero.modules.projectLibrary.vo.MetNotMetVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -62,9 +66,60 @@ public class LawsAssessResultsServiceImpl extends ServiceImpl<LawsAssessResultsM
|
||||
@Override
|
||||
public IPage<LawsAssessResults> queryPage(LawsAssessResults lawsAssessResults, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<LawsAssessResults> queryWrapper = QueryGenerator.initQueryWrapper(lawsAssessResults, req.getParameterMap());
|
||||
String assessId = lawsAssessResults.getAssessId();
|
||||
|
||||
LawsAssess lawsAssess = lawsAssessService.queryById(assessId);
|
||||
if(lawsAssess==null) {
|
||||
throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||
}
|
||||
String projectId = lawsAssess.getProjectId();
|
||||
String standardId = lawsAssess.getStandardId();
|
||||
String source = lawsAssess.getSource();
|
||||
String processStatus = lawsAssess.getProcessStatus();
|
||||
String standardNumber = null;
|
||||
String standardName = null;
|
||||
String standardEnglishName = null;
|
||||
String standardState = null;
|
||||
List<DictModel> dictModels = sysBaseAPI.queryDictItemsByCode("standard_state");
|
||||
Map<String, String> standardStateMap = CollStreamUtil.toMap(dictModels, DictModel::getValue, DictModel::getText);
|
||||
if (CommonConstant.STANDARD_SOURCE_1.equals(source)){
|
||||
//查询国内标准数据,赋值给collection
|
||||
LawsDomesticStandard standard = lawsDomesticStandardService.queryById(standardId);
|
||||
if (standard != null){
|
||||
standardNumber = standard.getStandardNumber();
|
||||
standardName = standard.getStandardName();
|
||||
standardEnglishName = standard.getStandardEnglishName();
|
||||
standardState = standardStateMap.get(standard.getStandardState());
|
||||
}
|
||||
}
|
||||
if (CommonConstant.STANDARD_SOURCE_2.equals(source)){
|
||||
//查询海外标准数据,赋值给collection
|
||||
LawsOverseasStandard standard = lawsOverseasStandardService.queryById(standardId);
|
||||
if (standard != null){
|
||||
standardNumber = standard.getStandardNumber();
|
||||
standardName = standard.getStandardName();
|
||||
standardEnglishName = standard.getStandardEnglishName();
|
||||
standardState = standardStateMap.get(standard.getStandardState());
|
||||
}
|
||||
}
|
||||
Map<String, String[]> parameterMap = req.getParameterMap();
|
||||
parameterMap.remove("assessId");
|
||||
QueryWrapper<LawsAssessResults> queryWrapper = QueryGenerator.initQueryWrapper(lawsAssessResults, parameterMap);
|
||||
queryWrapper.lambda()
|
||||
.eq(LawsAssessResults::getProjectId,projectId)
|
||||
.eq(LawsAssessResults::getStandardId,standardId)
|
||||
.groupBy(LawsAssessResults::getTermNumber)
|
||||
.groupBy(LawsAssessResults::getAssessorId);
|
||||
Page<LawsAssessResults> page = new Page<>(pageNo, pageSize);
|
||||
return page(page, queryWrapper);
|
||||
Page<LawsAssessResults> pageList = page(page, queryWrapper);
|
||||
for (LawsAssessResults assessResults : pageList.getRecords()) {
|
||||
assessResults.setStandardName(standardName);
|
||||
assessResults.setStandardNumber(standardNumber);
|
||||
assessResults.setStandardEnglishName(standardEnglishName);
|
||||
assessResults.setStandardState(standardState);
|
||||
assessResults.setSource(source);
|
||||
}
|
||||
return pageList;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -135,54 +190,21 @@ public class LawsAssessResultsServiceImpl extends ServiceImpl<LawsAssessResultsM
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public LawsAssessResults queryById(String id) {
|
||||
return getById(id);
|
||||
public MetNotMetVO getMetNotMetVOById(String id) {
|
||||
LawsAssessResults assessResults = getById(id);
|
||||
LambdaQueryWrapper<LawsAssessResults> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper
|
||||
.eq(LawsAssessResults::getProjectId,assessResults.getProjectId())
|
||||
.eq(LawsAssessResults::getStandardId,assessResults.getStandardId())
|
||||
.eq(LawsAssessResults::getTermNumber,assessResults.getTermNumber());
|
||||
List<LawsAssessResults> assessResultsList = this.list(queryWrapper);
|
||||
Map<String, List<LawsAssessResults>> stringListMap = CollStreamUtil.groupByKey(assessResultsList, LawsAssessResults::getAssessResults);
|
||||
MetNotMetVO metNotMetVO = new MetNotMetVO();
|
||||
metNotMetVO.setAccordWithList(stringListMap.get(AssessCommon.ACCORD_WITH));
|
||||
metNotMetVO.setNotCompliantList(stringListMap.get(AssessCommon.NOT_COMPLIANT));
|
||||
metNotMetVO.setToBeVerifiedList(stringListMap.get(AssessCommon.TO_BE_VERIFIED));
|
||||
metNotMetVO.setNotInvolvedList(stringListMap.get(AssessCommon.NOT_INVOLVED));
|
||||
return metNotMetVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LawsAssessResults> queryByAssessId(String assessId) {
|
||||
LawsAssess lawsAssess = lawsAssessService.queryById(assessId);
|
||||
if(lawsAssess==null) {
|
||||
throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||
}
|
||||
String projectId = lawsAssess.getProjectId();
|
||||
String standardId = lawsAssess.getStandardId();
|
||||
String source = lawsAssess.getSource();
|
||||
String processStatus = lawsAssess.getProcessStatus();
|
||||
String standardNumber = null;
|
||||
String standardName = null;
|
||||
String standardEnglishName = null;
|
||||
String standardState = null;
|
||||
List<DictModel> dictModels = sysBaseAPI.queryDictItemsByCode("standard_state");
|
||||
Map<String, String> standardStateMap = CollStreamUtil.toMap(dictModels, DictModel::getValue, DictModel::getText);
|
||||
if (CommonConstant.STANDARD_SOURCE_1.equals(source)){
|
||||
//查询国内标准数据,赋值给collection
|
||||
LawsDomesticStandard standard = lawsDomesticStandardService.queryById(standardId);
|
||||
if (standard != null){
|
||||
standardNumber = standard.getStandardNumber();
|
||||
standardName = standard.getStandardName();
|
||||
standardEnglishName = standard.getStandardEnglishName();
|
||||
standardState = standardStateMap.get(standard.getStandardState());
|
||||
}
|
||||
}
|
||||
if (CommonConstant.STANDARD_SOURCE_2.equals(source)){
|
||||
//查询海外标准数据,赋值给collection
|
||||
LawsOverseasStandard standard = lawsOverseasStandardService.queryById(standardId);
|
||||
if (standard != null){
|
||||
standardNumber = standard.getStandardNumber();
|
||||
standardName = standard.getStandardName();
|
||||
standardEnglishName = standard.getStandardEnglishName();
|
||||
standardState = standardStateMap.get(standard.getStandardState());
|
||||
}
|
||||
}
|
||||
List<LawsAssessResults> lawsAssessResultsList = baseMapper.selectListByProjectIdAndStandardId(projectId,standardId);
|
||||
for (LawsAssessResults lawsAssessResults : lawsAssessResultsList) {
|
||||
lawsAssessResults.setStandardName(standardName);
|
||||
lawsAssessResults.setStandardNumber(standardNumber);
|
||||
lawsAssessResults.setStandardEnglishName(standardEnglishName);
|
||||
lawsAssessResults.setStandardState(standardState);
|
||||
lawsAssessResults.setSource(source);
|
||||
}
|
||||
return lawsAssessResultsList;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.jero.modules.projectLibrary.vo;
|
||||
|
||||
import com.jero.modules.projectLibrary.entity.LawsAssessResults;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 符合、不符合页
|
||||
* @author liJiaRao
|
||||
* @date 2023-12-22 18:29
|
||||
*/
|
||||
@Data
|
||||
public class MetNotMetVO {
|
||||
/**
|
||||
* 符合
|
||||
*/
|
||||
@ApiModelProperty(value = "主键")
|
||||
private List<LawsAssessResults> accordWithList;
|
||||
@ApiModelProperty(value = "不符合")
|
||||
private List<LawsAssessResults> notCompliantList;
|
||||
@ApiModelProperty(value = "待验证")
|
||||
private List<LawsAssessResults> toBeVerifiedList;
|
||||
@ApiModelProperty(value = "不涉及")
|
||||
private List<LawsAssessResults> notInvolvedList;
|
||||
}
|
||||
Reference in New Issue
Block a user