Merge branch 'master_online' into fix_foton_20231031

This commit is contained in:
wxyclub
2023-10-31 11:57:23 +08:00
8 changed files with 130 additions and 42 deletions
@@ -66,7 +66,13 @@ public class ActSarItemsBussEOController extends BaseController<ActSarItemsEO> {
}
Object issueTime = jsonObject.get("issueTime");
Object standSort = jsonObject.get("standSort");
if(issueTime!=null && standSort!=null){
// 如果是企标制修定流程 类别是修改则不修改 发布日期
String reviseStatus = jsonObject.getString("reviseStatus");
if ("buss1_3".equals(reviseStatus)) {
issueTime = null;
jsonObject.put("issueTime",null);
}
if(issueTime!=null && standSort!=null){
String issueTimeStr =issueTime.toString();
String standSortStr = standSort.toString();
if(StringUtils.isNotBlank(issueTimeStr) && StringUtils.isNotBlank(standSortStr)){
@@ -165,41 +165,41 @@ public class EsRevisePlanController extends BaseController<EsRevisePlan> {
}
}
revisePlan.setArea(area);
//查评分
if (ObjectUtils.isNotEmpty(revisePlan.getStandId())) {
List<Double> last = new ArrayList<>();
List<QualityEvaluation> evaluations = qualityEvaluationDao.getEvaluationForm(new QueryWrapper<QualityEvaluation>().eq("law_id", revisePlan.getStandId()).eq("evaluation_type", "quality"));
for (QualityEvaluation evaluation : evaluations) {
Double score;
String value;
if (evaluation.getProcessNode()==null){
value="";
}else {
value=evaluation.getProcessNode();
}
String evaluationScore = ObjectUtils.isEmpty(evaluation.getScore()) ? "0" : evaluation.getScore();
switch (value){
case "征求意见":
score=Double.valueOf(evaluationScore) * 0.3;
break;
case "技术委员会评审、评审意见修改":
score=Double.valueOf(evaluationScore) * 0.4;
break;
case "重新技术委员会评审、评审意见修改":
score=Double.valueOf(evaluationScore) * 0.4;
break;
case "标准化复审":
score=Double.valueOf(evaluationScore) * 0.15;
break;
case "标准法规部高级经理审核":
score=Double.valueOf(evaluationScore) * 0.15;
break;
default: score=Double.valueOf(evaluationScore);
}
last.add(score);
}
revisePlan.setScore(last.stream().mapToDouble(Double::doubleValue).sum());
}
// //查评分
// if (ObjectUtils.isNotEmpty(revisePlan.getStandId())) {
// List<Double> last = new ArrayList<>();
// List<QualityEvaluation> evaluations = qualityEvaluationDao.getEvaluationForm(new QueryWrapper<QualityEvaluation>().eq("law_id", revisePlan.getStandId()).eq("evaluation_type", "quality"));
// for (QualityEvaluation evaluation : evaluations) {
// Double score;
// String value;
// if (evaluation.getProcessNode()==null){
// value="";
// }else {
// value=evaluation.getProcessNode();
// }
// String evaluationScore = ObjectUtils.isEmpty(evaluation.getScore()) ? "0" : evaluation.getScore();
// switch (value){
// case "征求意见":
// score=Double.valueOf(evaluationScore) * 0.3;
// break;
// case "技术委员会评审、评审意见修改":
// score=Double.valueOf(evaluationScore) * 0.4;
// break;
// case "重新技术委员会评审、评审意见修改":
// score=Double.valueOf(evaluationScore) * 0.4;
// break;
// case "标准化复审":
// score=Double.valueOf(evaluationScore) * 0.15;
// break;
// case "标准法规部高级经理审核":
// score=Double.valueOf(evaluationScore) * 0.15;
// break;
// default: score=Double.valueOf(evaluationScore);
// }
// last.add(score);
// }
// revisePlan.setScore(last.stream().mapToDouble(Double::doubleValue).sum());
// }
}
PageInfo<EsRevisePlan> pageInfo = getPageInfo(esRevisePlan.getPager(),esRevisePlans);
return Result.success(pageInfo);
@@ -15,6 +15,7 @@ import com.adc.da.slrs.esStandRelation.entity.EsStandRelation;
import com.adc.da.slrs.esStandRelation.service.IEsStandRelationService;
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
import com.adc.da.slrs.sarBussionessStand.service.ISarBussionessStandService;
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IQualityEvaluationService;
import com.adc.da.sys.entity.UserEO;
import com.adc.da.util.UUIDUtils;
import com.alibaba.fastjson.JSON;
@@ -26,6 +27,9 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.RoundingMode;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@@ -55,6 +59,8 @@ public class EsRevisePlanServiceImpl extends ServiceImpl<EsRevisePlanDao, EsRevi
private EsRevisePlanLogDao esRevisePlanLogDao;
@Autowired
private IEsRevisePlanLogService esRevisePlanLogService;
@Resource
private IQualityEvaluationService qualityEvaluationService;
@Override
public List<EsRevisePlan> getAllPlans(EsRevisePlan esRevisePlan) {
@@ -73,6 +79,17 @@ public class EsRevisePlanServiceImpl extends ServiceImpl<EsRevisePlanDao, EsRevi
Integer count = esRevisePlanDao.getQueryTotal(esRevisePlan);
esRevisePlan.getPager().setRowCount(count);
List<EsRevisePlan> esRevisePlans = esRevisePlanDao.queryAll(esRevisePlan);
// 获取质量评分
NumberFormat nf = NumberFormat.getNumberInstance();
nf.setMaximumFractionDigits(2);
nf.setRoundingMode(RoundingMode.UP);
for (EsRevisePlan revisePlan : esRevisePlans) {
if (StringUtils.isNotBlank(revisePlan.getStandId())) {
Map<String, Double> scoreMap = qualityEvaluationService.getScore(revisePlan.getStandId());
String quality = nf.format(scoreMap.get("quality"));
revisePlan.setScore(Double.valueOf(quality));
}
}
return esRevisePlans;
}
@@ -83,4 +83,12 @@ public class SarBussStandFileController extends BaseController<SarBussStandFile>
//非在线编辑文件可转换pdf
return sarBussStandFileEOService.batchUpdateSarBussFileMQ();
}
@ApiOperation(value = "企标发布稿重复问题,去重处理")
@GetMapping("/batchUpdateSarBussFileRepeat")
public ResponseMessage<String> batchUpdateSarBussFileRepeat() throws Exception {
String result = sarBussStandFileEOService.batchUpdateSarBussFileRepeat();
return Result.success(result);
}
}
@@ -21,4 +21,6 @@ public interface ISarBussStandFileService extends IService<SarBussStandFile> {
ResponseMessage<List<SarBussStandFile>> batchUpdateSarBussFile();
ResponseMessage<List<SarBussStandFile>> batchUpdateSarBussFileMQ();
String batchUpdateSarBussFileRepeat();
}
@@ -7,11 +7,15 @@ import com.adc.da.common.UseModuleEnum;
import com.adc.da.http.ResponseMessage;
import com.adc.da.http.Result;
import com.adc.da.mq.CreateOnlineEditingFileMQService;
import com.adc.da.slrs.sarBussStandAttrInfo.entity.SarBussStandAttrInfo;
import com.adc.da.slrs.sarBussStandAttrInfo.service.ISarBussStandAttrInfoService;
import com.adc.da.slrs.sarBussStandFile.entity.SarBussStandFile;
import com.adc.da.slrs.sarBussStandFile.dao.SarBussStandFileDao;
import com.adc.da.slrs.sarBussStandFile.service.ISarBussStandFileService;
import com.adc.da.slrs.sarBussionessStand.service.impl.SarBussionessStandServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
@@ -20,7 +24,12 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;
/**
* <p>
@@ -47,6 +56,9 @@ public class SarBussStandFileServiceImpl extends ServiceImpl<SarBussStandFileDao
@Autowired
private CreateOnlineEditingFileMQService createOnlineEditingFileMQService;
@Resource
private ISarBussStandAttrInfoService standAttrInfoService;
@Override
public List<SarBussStandFile> selectFileByAttId(String attId) throws Exception{
return sarStandFileEODao.selectFileByAttId(attId);
@@ -140,4 +152,47 @@ public class SarBussStandFileServiceImpl extends ServiceImpl<SarBussStandFileDao
}
return Result.success(sarBussStandFileArrayList);
}
@Override
public String batchUpdateSarBussFileRepeat() {
// 获取所有企标详情的企标ID和发布稿字段
LambdaQueryWrapper<SarBussStandAttrInfo> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SarBussStandAttrInfo::getValidFlag,"0");
wrapper.isNotNull(SarBussStandAttrInfo::getFbgbuss);
wrapper.ne(SarBussStandAttrInfo::getFbgbuss,"");
wrapper.select(SarBussStandAttrInfo::getStandId,SarBussStandAttrInfo::getFbgbuss);
List<SarBussStandAttrInfo> allStand = standAttrInfoService.list(wrapper);
// 转换为Map
Map<String,String> fbBussMap = new HashMap<>();
allStand.forEach(each -> fbBussMap.put(each.getStandId(),each.getFbgbuss()));
// 循环每条数据
for (Map.Entry<String, String> entry : fbBussMap.entrySet()) {
// 把发布告文件做分割
List<String> attIdList = Arrays.asList(entry.getValue().split(","));
// 根据发布稿文件查询发布告的具体信息,获取原文件名
LambdaQueryWrapper<SarBussStandFile> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(SarBussStandFile::getValidFlag,"0");
wrapper1.in(SarBussStandFile::getAttId, attIdList);
List<SarBussStandFile> sarBussStandFileList = sarStandFileEODao.selectList(wrapper1);
// 对文件名做去重
List<SarBussStandFile> collect = sarBussStandFileList.stream()
.filter(distinctByKey(SarBussStandFile::getFileName))
// .sorted(Comparator.comparing(SarBussStandFile::getCreationTime))
.collect(Collectors.toList());
// 如果长度不相等,说明执行了去重,需要修改,重新放回企标详情表中
String fbgbuss = collect.stream().map(SarBussStandFile::getAttId).collect(Collectors.joining(","));
if (fbgbuss.length() != entry.getValue().length()) {
LambdaUpdateWrapper<SarBussStandAttrInfo> wrapper2 = new LambdaUpdateWrapper<>();
wrapper2.eq(SarBussStandAttrInfo::getStandId,entry.getKey());
wrapper2.set(SarBussStandAttrInfo::getFbgbuss,fbgbuss);
standAttrInfoService.update(wrapper2);
logger.info("出现重复的企标:"+ entry.getKey() + ",去重后发布稿包含:" + fbgbuss + "---去重前发布稿包含:" + entry.getValue());
}
}
return "去重成功";
}
public static <T> Predicate<T> distinctByKey(Function<? super T, Object> keyExtractor) {
Set<Object> seen = ConcurrentHashMap.newKeySet();
return t -> seen.add(keyExtractor.apply(t));
}
}
@@ -196,32 +196,32 @@ public class QualityEvaluationServiceImpl extends ServiceImpl<QualityEvaluationD
Integer countBZSHStr = null;
if(!list.isEmpty()){
for (QualityEvaluation qualityEvaluations :list){
if(qualityEvaluations.getProcessNode().equals("征求意见")) {
if("征求意见".equals(qualityEvaluations.getProcessNode())) {
List<Integer> countZQYJList = qualityEvaluationDao.selectCountZQYJ(qualityEvaluations.getProcessNode(), qualityEvaluations.getLawId());
if(!countZQYJList.isEmpty()){
countZQYJStr = countZQYJList.size();
}
}
if(qualityEvaluations.getProcessNode().equals("技术委员会评审、评审意见修改")) {
if("技术委员会评审、评审意见修改".equals(qualityEvaluations.getProcessNode())) {
List<Integer> countJSWYList = qualityEvaluationDao.selectCountJSWY(qualityEvaluations.getProcessNode(), qualityEvaluations.getLawId());
if(!countJSWYList.isEmpty()){
countJSWYStr = countJSWYList.size();
}
}
if(qualityEvaluations.getProcessNode().equals("重新技术委员会评审、评审意见修改")) {
if("重新技术委员会评审、评审意见修改".equals(qualityEvaluations.getProcessNode())) {
List<Integer> countCXJSWYList = qualityEvaluationDao.selectCXJSWY(qualityEvaluations.getProcessNode(), qualityEvaluations.getLawId());
if(!countCXJSWYList.isEmpty()){
countCXJSWYStr = countCXJSWYList.size();
}
}
if(qualityEvaluations.getProcessNode().equals("标准化复审")) {
if("标准化复审".equals(qualityEvaluations.getProcessNode())) {
List<Integer> countBZHFSList = qualityEvaluationDao.selectBZHFS(qualityEvaluations.getProcessNode(), qualityEvaluations.getLawId());
if(!countBZHFSList.isEmpty()){
countBZHFSStr = countBZHFSList.size();
}
}
if(qualityEvaluations.getProcessNode().equals("标准法规部高级经理审核")) {
if("标准法规部高级经理审核".equals(qualityEvaluations.getProcessNode())) {
List<Integer> countBZSHList = qualityEvaluationDao.selectBZSH(qualityEvaluations.getProcessNode(), qualityEvaluations.getLawId());
if(!countBZSHList.isEmpty()){
countBZSHStr = countBZSHList.size();
@@ -686,7 +686,7 @@ public class SarFileSplitInfoEOServiceImpl implements SarFileSplitInfoEOService
if (ObjectUtils.isNotEmpty(smalltext)) {
switch (subscript) {
case BASELINE:
xwrun.setText(smalltext);
xwrun.setText(smalltext, 0);
break;
case SUBSCRIPT:
xwrun.setText("<span class=sub>" + smalltext + "</span>");