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

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
@@ -26,6 +26,7 @@ import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
import com.adc.da.slrs.sarBussionessStand.service.ISarBussionessStandService; import com.adc.da.slrs.sarBussionessStand.service.ISarBussionessStandService;
import com.adc.da.slrs.sarBussionessStandState.entity.SarBussionessStandState; import com.adc.da.slrs.sarBussionessStandState.entity.SarBussionessStandState;
import com.adc.da.slrs.sarBussionessStandState.service.ISarBussionessStandStateService; import com.adc.da.slrs.sarBussionessStandState.service.ISarBussionessStandStateService;
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.dao.QualityEvaluationDao;
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation; import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation;
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IQualityEvaluationService; import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IQualityEvaluationService;
import com.adc.da.slrs.sarLawsAttrInfo.service.ISarLawsAttrInfoService; import com.adc.da.slrs.sarLawsAttrInfo.service.ISarLawsAttrInfoService;
@@ -112,6 +113,9 @@ public class ActSarItemsBussEOService {
@Autowired @Autowired
private SarBussionessStandDao sarBussionessStandEODao; private SarBussionessStandDao sarBussionessStandEODao;
@Autowired
private QualityEvaluationDao qualityEvaluationDao;
public void processCreateFsBuss(String standJson) throws Exception { public void processCreateFsBuss(String standJson) throws Exception {
Map<String,Object> standMap = new HashMap(); Map<String,Object> standMap = new HashMap();
@@ -559,7 +563,12 @@ public class ActSarItemsBussEOService {
}); });
} }
}); });
qualityEvaluationService.saveBatch(evaluations); if (evaluations.get(0).getProcessNode().equals("重新技术委员会评审、评审意见修改")){
qualityEvaluationService.saveBatch(evaluations);
qualityEvaluationDao.updateByProcessNode(evaluations.get(0).getLawId());
}else {
qualityEvaluationService.saveBatch(evaluations);
}
} }
} }
@@ -3,7 +3,7 @@
# 数据库配置 # 数据库配置
#============================================= #=============================================
spring.datasource.driverClassName = com.mysql.cj.jdbc.Driver spring.datasource.driverClassName = com.mysql.cj.jdbc.Driver
spring.datasource.url = jdbc:mysql://121.36.69.172:3307/foton_slrs_test?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC&useSSL=false&serverTimezone=Asia/Shanghai spring.datasource.url = jdbc:mysql://121.36.69.172:3307/foton_slrs_20230531?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC&useSSL=false&serverTimezone=Asia/Shanghai
spring.datasource.username = root spring.datasource.username = root
spring.datasource.password = hzwlsoft.com spring.datasource.password = hzwlsoft.com
@@ -1913,36 +1913,38 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
// 查询属性表数据 // 查询属性表数据
if (StringUtils.isNotBlank(fieldInfo)) { if (StringUtils.isNotBlank(fieldInfo)) {
Map<String, Object> getAttrMap = sarBussStandAttrInfoEODao.selectStandFieldAndData(fieldInfo,row.getId()); Map<String, Object> getAttrMap = sarBussStandAttrInfoEODao.selectStandFieldAndData(fieldInfo,row.getId());
if(getAttrMap.get("FBGBUSS")!=null){ if(getAttrMap!=null) {
if(org.apache.commons.lang3.StringUtils.isNotBlank(getAttrMap.get("FBGBUSS").toString())){ if (getAttrMap.get("FBGBUSS") != null) {
String[] split = getAttrMap.get("FBGBUSS").toString().split(","); if (org.apache.commons.lang3.StringUtils.isNotBlank(getAttrMap.get("FBGBUSS").toString())) {
String fileId = ""; String[] split = getAttrMap.get("FBGBUSS").toString().split(",");
for (String id :split){ String fileId = "";
if(id.contains("ATT_FILE_")){ for (String id : split) {
//则是正规数据 if (id.contains("ATT_FILE_")) {
if(org.apache.commons.lang3.StringUtils.isNotBlank(fileId)){ //则是正规数据
fileId = fileId+","+ id; if (org.apache.commons.lang3.StringUtils.isNotBlank(fileId)) {
}else { fileId = fileId + "," + id;
fileId = id; } else {
} fileId = id;
}else { }
//加工数据 } else {
QueryWrapper<OnlineFileLog> onlineFileLogQueryWrapper = new QueryWrapper<>(); //加工数据
onlineFileLogQueryWrapper.eq("HIS_ID",id); QueryWrapper<OnlineFileLog> onlineFileLogQueryWrapper = new QueryWrapper<>();
onlineFileLogQueryWrapper.orderByDesc("CREATE_TIME"); onlineFileLogQueryWrapper.eq("HIS_ID", id);
List<OnlineFileLog> onlineFileLogs = onlineFileLogDao.selectList(onlineFileLogQueryWrapper); onlineFileLogQueryWrapper.orderByDesc("CREATE_TIME");
if(!onlineFileLogs.isEmpty()){ List<OnlineFileLog> onlineFileLogs = onlineFileLogDao.selectList(onlineFileLogQueryWrapper);
if(org.apache.commons.lang3.StringUtils.isNotBlank(fileId)){ if (!onlineFileLogs.isEmpty()) {
fileId = fileId+","+onlineFileLogs.get(0).getAttFileId(); if (org.apache.commons.lang3.StringUtils.isNotBlank(fileId)) {
}else { fileId = fileId + "," + onlineFileLogs.get(0).getAttFileId();
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()) { 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); 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 { }else {
upObj.setReason("-"); upObj.setReason("-");
} }
if ("重新技术委员会评审、评审意见修改".equals(upObj.getProcessNode())){
qualityEvaluationDao.updateByProcessNode(tableData.get(0).getLawId());
}
return upObj; return upObj;
}).orElse(null)) }).orElse(null))
.collect(Collectors.toList()); .collect(Collectors.toList());
@@ -96,6 +99,9 @@ public class QualityEvaluationServiceImpl extends ServiceImpl<QualityEvaluationD
item.setScore(String.valueOf (Double.parseDouble(item.getScore()) * 2) ); item.setScore(String.valueOf (Double.parseDouble(item.getScore()) * 2) );
} }
if ("重新技术委员会评审、评审意见修改".equals(item.getProcessNode())){
qualityEvaluationDao.updateByProcessNode(tableData.get(0).getLawId());
}
}); });
return this.saveBatch(tableData); 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<>(); HashMap<String, Double> result = new HashMap<>();
result.put("dynamic",0.0); result.put("dynamic",0.0);
result.put("quality",0.0); result.put("quality",0.0);
@@ -203,19 +255,19 @@ public class QualityEvaluationServiceImpl extends ServiceImpl<QualityEvaluationD
} }
switch (value){ switch (value){
case "征求意见": case "征求意见":
score=Double.valueOf(item.getScore()) * 0.3; score=Double.valueOf(item.getScore()) / countZQYJ * 0.3;
break; break;
case "技术委员会评审、评审意见修改": case "技术委员会评审、评审意见修改":
score=Double.valueOf(item.getScore()) * 0.4; score=Double.valueOf(item.getScore()) / countJSWY * 0.4;
break; break;
case "重新技术委员会评审、评审意见修改": case "重新技术委员会评审、评审意见修改":
score=Double.valueOf(item.getScore()) * 0.4; score=Double.valueOf(item.getScore()) / countCXJSWY * 0.4;
break; break;
case "标准化复审": case "标准化复审":
score=Double.valueOf(item.getScore()) * 0.15; score=Double.valueOf(item.getScore()) / countBZHFS * 0.15;
break; break;
case "标准法规部高级经理审核": case "标准法规部高级经理审核":
score=Double.valueOf(item.getScore()) * 0.15; score=Double.valueOf(item.getScore()) / countBZSH * 0.15;
break; break;
default: score=Double.valueOf(item.getScore()); default: score=Double.valueOf(item.getScore());
@@ -2,6 +2,10 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.adc.da.slrs.sarEnterpriseStandardEvaluation.dao.QualityEvaluationDao"> <mapper namespace="com.adc.da.slrs.sarEnterpriseStandardEvaluation.dao.QualityEvaluationDao">
<update id="updateByProcessNode">
update quality_evaluation set score = '0' where law_id = #{lawId} and process_node = '技术委员会评审、评审意见修改'
</update>
<select id="getHistory" <select id="getHistory"
resultType="com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation"> resultType="com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation">
@@ -11,8 +15,9 @@
`index`.value_type as valueType, `index`.value_type as valueType,
eva.evaluation_type as evaluationType, eva.evaluation_type as evaluationType,
process_node as processNode, process_node as processNode,
sum(eva.score * `index`.weight) AS score, sum(eva.score) AS score,
max(eva.create_time) as createTiem max(eva.create_time) as createTiem,
eva.law_id
FROM FROM
quality_evaluation AS eva quality_evaluation AS eva
LEFT JOIN ts_user `user` ON eva.user_id = `user`.USID LEFT JOIN ts_user `user` ON eva.user_id = `user`.USID
@@ -64,4 +69,59 @@
) )
ORDER BY `index`.index_sort ORDER BY `index`.index_sort
</select> </select>
<select id="selectCountZQYJ" resultType="java.lang.Integer">
select
count(1)
from
quality_evaluation
where
law_id = #{lawId}
and process_node = '征求意见'
group by user_id
</select>
<select id="selectCountJSWY" resultType="java.lang.Integer">
select
count(1)
from
quality_evaluation
where
law_id = #{lawId}
and process_node = '技术委员会评审、评审意见修改'
group by user_id
</select>
<select id="selectCXJSWY" resultType="java.lang.Integer">
select
count(1)
from
quality_evaluation
where
law_id = #{lawId}
and process_node = '重新技术委员会评审、评审意见修改'
group by user_id
</select>
<select id="selectBZHFS" resultType="java.lang.Integer">
select
count(1)
from
quality_evaluation
where
law_id = #{lawId}
and process_node = '标准化复审'
group by user_id
</select>
<select id="selectBZSH" resultType="java.lang.Integer">
select
count(1)
from
quality_evaluation
where
law_id = #{lawId}
and process_node = '标准法规部高级经理审核'
group by user_id
</select>
</mapper> </mapper>