修改企业标准入库时的评分和查看时显示的评分

This commit is contained in:
SUNJIABIN
2023-05-31 18:13:32 +08:00
parent 8514dddb38
commit e3719c7c34
6 changed files with 169 additions and 35 deletions
@@ -1913,36 +1913,38 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
// 查询属性表数据
if (StringUtils.isNotBlank(fieldInfo)) {
Map<String, Object> getAttrMap = sarBussStandAttrInfoEODao.selectStandFieldAndData(fieldInfo,row.getId());
if(getAttrMap.get("FBGBUSS")!=null){
if(org.apache.commons.lang3.StringUtils.isNotBlank(getAttrMap.get("FBGBUSS").toString())){
String[] split = getAttrMap.get("FBGBUSS").toString().split(",");
String fileId = "";
for (String id :split){
if(id.contains("ATT_FILE_")){
//则是正规数据
if(org.apache.commons.lang3.StringUtils.isNotBlank(fileId)){
fileId = fileId+","+ id;
}else {
fileId = id;
}
}else {
//加工数据
QueryWrapper<OnlineFileLog> onlineFileLogQueryWrapper = new QueryWrapper<>();
onlineFileLogQueryWrapper.eq("HIS_ID",id);
onlineFileLogQueryWrapper.orderByDesc("CREATE_TIME");
List<OnlineFileLog> onlineFileLogs = onlineFileLogDao.selectList(onlineFileLogQueryWrapper);
if(!onlineFileLogs.isEmpty()){
if(org.apache.commons.lang3.StringUtils.isNotBlank(fileId)){
fileId = fileId+","+onlineFileLogs.get(0).getAttFileId();
}else {
fileId = onlineFileLogs.get(0).getAttFileId();
if(getAttrMap!=null) {
if (getAttrMap.get("FBGBUSS") != null) {
if (org.apache.commons.lang3.StringUtils.isNotBlank(getAttrMap.get("FBGBUSS").toString())) {
String[] split = getAttrMap.get("FBGBUSS").toString().split(",");
String fileId = "";
for (String id : split) {
if (id.contains("ATT_FILE_")) {
//则是正规数据
if (org.apache.commons.lang3.StringUtils.isNotBlank(fileId)) {
fileId = fileId + "," + id;
} else {
fileId = id;
}
} else {
//加工数据
QueryWrapper<OnlineFileLog> onlineFileLogQueryWrapper = new QueryWrapper<>();
onlineFileLogQueryWrapper.eq("HIS_ID", id);
onlineFileLogQueryWrapper.orderByDesc("CREATE_TIME");
List<OnlineFileLog> onlineFileLogs = onlineFileLogDao.selectList(onlineFileLogQueryWrapper);
if (!onlineFileLogs.isEmpty()) {
if (org.apache.commons.lang3.StringUtils.isNotBlank(fileId)) {
fileId = fileId + "," + onlineFileLogs.get(0).getAttFileId();
} else {
fileId = onlineFileLogs.get(0).getAttFileId();
}
}
}
}
}
Object obj = fileId;
getAttrMap.put("FBGBUSS", obj);
}
Object obj = fileId;
getAttrMap.put("FBGBUSS",obj);
}
}
if (InitStandAttrUtil.clobFieldListBuss != null && !InitStandAttrUtil.clobFieldListBuss.isEmpty()) {
@@ -26,4 +26,15 @@ public interface QualityEvaluationDao extends BaseMapper<QualityEvaluation> {
public List<QualityEvaluation> getEvaluationForm(@Param(Constants.WRAPPER) QueryWrapper<QualityEvaluation> queryWrapper);
List<Integer> selectCountZQYJ(@Param("node") String node,@Param("lawId") String lawId);
List<Integer> selectCountJSWY(@Param("node") String node,@Param("lawId") String lawId);
List<Integer> selectCXJSWY(@Param("node") String node,@Param("lawId") String lawId);
List<Integer> selectBZHFS(@Param("node") String node,@Param("lawId") String lawId);
List<Integer> selectBZSH(@Param("node") String node,@Param("lawId") String lawId);
void updateByProcessNode(@Param("lawId") String lawId);
}
@@ -81,6 +81,9 @@ public class QualityEvaluationServiceImpl extends ServiceImpl<QualityEvaluationD
}else {
upObj.setReason("-");
}
if ("重新技术委员会评审、评审意见修改".equals(upObj.getProcessNode())){
qualityEvaluationDao.updateByProcessNode(tableData.get(0).getLawId());
}
return upObj;
}).orElse(null))
.collect(Collectors.toList());
@@ -96,6 +99,9 @@ public class QualityEvaluationServiceImpl extends ServiceImpl<QualityEvaluationD
item.setScore(String.valueOf (Double.parseDouble(item.getScore()) * 2) );
}
if ("重新技术委员会评审、评审意见修改".equals(item.getProcessNode())){
qualityEvaluationDao.updateByProcessNode(tableData.get(0).getLawId());
}
});
return this.saveBatch(tableData);
}
@@ -180,6 +186,52 @@ public class QualityEvaluationServiceImpl extends ServiceImpl<QualityEvaluationD
// ));
Integer countZQYJStr = null;
Integer countJSWYStr = null;
Integer countCXJSWYStr = null;
Integer countBZHFSStr = null;
Integer countBZSHStr = null;
if(!list.isEmpty()){
for (QualityEvaluation qualityEvaluations :list){
if(qualityEvaluations.getProcessNode().equals("征求意见")) {
List<Integer> countZQYJList = qualityEvaluationDao.selectCountZQYJ(qualityEvaluations.getProcessNode(), qualityEvaluations.getLawId());
if(!countZQYJList.isEmpty()){
countZQYJStr = countZQYJList.size();
}
}
if(qualityEvaluations.getProcessNode().equals("技术委员会评审、评审意见修改")) {
List<Integer> countJSWYList = qualityEvaluationDao.selectCountJSWY(qualityEvaluations.getProcessNode(), qualityEvaluations.getLawId());
if(!countJSWYList.isEmpty()){
countJSWYStr = countJSWYList.size();
}
}
if(qualityEvaluations.getProcessNode().equals("重新技术委员会评审、评审意见修改")) {
List<Integer> countCXJSWYList = qualityEvaluationDao.selectCXJSWY(qualityEvaluations.getProcessNode(), qualityEvaluations.getLawId());
if(!countCXJSWYList.isEmpty()){
countCXJSWYStr = countCXJSWYList.size();
}
}
if(qualityEvaluations.getProcessNode().equals("标准化复审")) {
List<Integer> countBZHFSList = qualityEvaluationDao.selectBZHFS(qualityEvaluations.getProcessNode(), qualityEvaluations.getLawId());
if(!countBZHFSList.isEmpty()){
countBZHFSStr = countBZHFSList.size();
}
}
if(qualityEvaluations.getProcessNode().equals("标准法规部高级经理审核")) {
List<Integer> countBZSHList = qualityEvaluationDao.selectBZSH(qualityEvaluations.getProcessNode(), qualityEvaluations.getLawId());
if(!countBZSHList.isEmpty()){
countBZSHStr = countBZSHList.size();
}
}
}
}
final Integer countZQYJ = countZQYJStr;
final Integer countJSWY = countJSWYStr;
final Integer countCXJSWY = countCXJSWYStr;
final Integer countBZHFS = countBZHFSStr;
final Integer countBZSH = countBZSHStr;
HashMap<String, Double> result = new HashMap<>();
result.put("dynamic",0.0);
result.put("quality",0.0);
@@ -203,19 +255,19 @@ public class QualityEvaluationServiceImpl extends ServiceImpl<QualityEvaluationD
}
switch (value){
case "征求意见":
score=Double.valueOf(item.getScore()) * 0.3;
score=Double.valueOf(item.getScore()) / countZQYJ * 0.3;
break;
case "技术委员会评审、评审意见修改":
score=Double.valueOf(item.getScore()) * 0.4;
score=Double.valueOf(item.getScore()) / countJSWY * 0.4;
break;
case "重新技术委员会评审、评审意见修改":
score=Double.valueOf(item.getScore()) * 0.4;
score=Double.valueOf(item.getScore()) / countCXJSWY * 0.4;
break;
case "标准化复审":
score=Double.valueOf(item.getScore()) * 0.15;
score=Double.valueOf(item.getScore()) / countBZHFS * 0.15;
break;
case "标准法规部高级经理审核":
score=Double.valueOf(item.getScore()) * 0.15;
score=Double.valueOf(item.getScore()) / countBZSH * 0.15;
break;
default: score=Double.valueOf(item.getScore());