|
@@ -3,7 +3,7 @@ package com.rongwei.bscommon.sys.service.impl;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.fasterxml.jackson.databind.JsonNode;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
-import com.rongwei.bscommon.sys.service.*;
|
|
|
+import com.rongwei.bscommon.sys.service.ExamineService;
|
|
|
import com.rongwei.bscommon.sys.strategy.scoreCalculation.ScoreCalculationService;
|
|
|
import com.rongwei.bscommon.sys.utils.JXKHUtils;
|
|
|
import com.rongwei.bsentity.domain.*;
|
|
@@ -70,6 +70,8 @@ public class ExamineServiceImpl implements ExamineService {
|
|
|
private JtXcjhqdServiceImpl jtXcjhqdService;
|
|
|
@Autowired
|
|
|
private JtYcpfhzDetailServiceImpl jtYcpfhzDetailService;
|
|
|
+ @Autowired
|
|
|
+ private SysUserServiceImpl sysUserService;
|
|
|
|
|
|
/**
|
|
|
* 部门考核
|
|
@@ -92,13 +94,13 @@ public class ExamineServiceImpl implements ExamineService {
|
|
|
.eq(JtYcpfhzDetail::getDeleted, "0")
|
|
|
.eq(JtYcpfhzDetail::getYcpfhzid, id));
|
|
|
List<String> list = new ArrayList<>();
|
|
|
- if(StringUtils.isNotBlank(khzbNum)){
|
|
|
- list= Arrays.asList(khzbNum.split(","));
|
|
|
+ if (StringUtils.isNotBlank(khzbNum)) {
|
|
|
+ list = Arrays.asList(khzbNum.split(","));
|
|
|
}
|
|
|
// 获取考核规则
|
|
|
List<JkAssessmentRules> jkAssessmentRules = jkAssessmentRulesService.list(new LambdaQueryWrapper<JkAssessmentRules>()
|
|
|
.eq(BaseDo::getDeleted, "0")
|
|
|
- .in(StringUtils.isNotBlank(khzbNum), JkAssessmentRules::getNum,list)
|
|
|
+ .in(StringUtils.isNotBlank(khzbNum), JkAssessmentRules::getNum, list)
|
|
|
.orderByAsc(JkAssessmentRules::getNum));
|
|
|
if (jkAssessmentRules.isEmpty()) {
|
|
|
throw new CustomException("获取获取到考核规则信息");
|
|
@@ -116,7 +118,7 @@ public class ExamineServiceImpl implements ExamineService {
|
|
|
// .in(JtKhxm::getMainid, khbmList.stream().map(JtXmkh::getId).collect(Collectors.toList())));
|
|
|
// 公司考核管理填报数据
|
|
|
JtGsjtbsj jtGsjtbsj = jtGsjtbsjService.getById(jtYcpfhz.getMainid());
|
|
|
- if(jtGsjtbsj==null){
|
|
|
+ if (jtGsjtbsj == null) {
|
|
|
throw new CustomException("无法获取到公司考核管理数据");
|
|
|
}
|
|
|
List<JtYcpfhzDetail> saveData = new ArrayList<>();
|
|
@@ -164,7 +166,7 @@ public class ExamineServiceImpl implements ExamineService {
|
|
|
List<JtZtfaps> jtZtfapsList = new ArrayList<>();
|
|
|
List<JtWyys> jtWyysList = new ArrayList<>();
|
|
|
List<JtYjbhgl> jtYjbhglList = new ArrayList<>();
|
|
|
- List<JtScsdl> jtScsdlList = new ArrayList<>();
|
|
|
+ List<JtScsdl> jtScsdlList = new ArrayList<>();
|
|
|
List<JtWtbhgl> jtWtbhglList = new ArrayList<>();
|
|
|
List<JtScbhgl> jtScbhglList = new ArrayList<>();
|
|
|
List<JtSjjdqd> jtSjjdqdList = new ArrayList<>();
|
|
@@ -179,6 +181,16 @@ public class ExamineServiceImpl implements ExamineService {
|
|
|
String xmzsjbm = (String) data.getOrDefault("XMZSJBM", ""); // 项目主数据编码
|
|
|
String year = (String) data.getOrDefault("YEAR", ""); // 考核年
|
|
|
String zbztdw = (String) data.getOrDefault("ZBZTDW", ""); // 中标主体单位
|
|
|
+ Date jhkssj = (Date) data.getOrDefault("JHKSSJ", null); //计划开始时间
|
|
|
+ Date jhwcsj = (Date) data.getOrDefault("JHWCSJ", null); // 计划完成时间
|
|
|
+ String xmjd = (String) data.getOrDefault("XMJD", ""); // 项目阶段
|
|
|
+ String xmjl = (String) data.getOrDefault("XMJL", ""); // 项目经理
|
|
|
+ String xmjlid = (String) data.getOrDefault("XMJLID", ""); // 项目经理ID
|
|
|
+ String xmjlCode = "";
|
|
|
+ if (StringUtils.isNotBlank(xmjlid)) {
|
|
|
+ SysUser byId = sysUserService.getById(xmjlid);
|
|
|
+ xmjlCode = byId == null ? "" : byId.getCode();
|
|
|
+ }
|
|
|
|
|
|
//根据 id 和 xmmc去 JtFjglxm表里查询有没有 maminid xmmc=xmmc 的数据 如果有的话就不新增 如果没有就要新增一条数据
|
|
|
JtFjglxm jtFjglxm1 = jtFjglxmService.getOne(new LambdaQueryWrapper<JtFjglxm>()
|
|
@@ -194,6 +206,13 @@ public class ExamineServiceImpl implements ExamineService {
|
|
|
jtFjglxm.setYear(year); // 设置考核年
|
|
|
jtFjglxm.setZbztdw(zbztdw); // 设置中标主体单位
|
|
|
jtFjglxm.setDeleted("0");
|
|
|
+ jtFjglxm.setXmdw("重要");
|
|
|
+ jtFjglxm.setSfxxyw("1");
|
|
|
+ jtFjglxm.setSfzdxm("0");
|
|
|
+ jtFjglxm.setJhkssj(jhkssj);
|
|
|
+ jtFjglxm.setJhwcsj(jhwcsj);
|
|
|
+ jtFjglxm.setZbztdj("67".equals(zbztdw) ? "0" : "1");
|
|
|
+ jtFjglxm.setSfsjsggl("1");
|
|
|
jtFjglxm.setCreatedate(new Date());
|
|
|
jtFjglxm.setModifydate(new Date());
|
|
|
jtFjglxm.setCreateusername("系统生成");
|
|
@@ -220,6 +239,14 @@ public class ExamineServiceImpl implements ExamineService {
|
|
|
jtKcsjxm.setYear(year); // 设置考核年
|
|
|
jtKcsjxm.setZbztdw(zbztdw); // 设置中标主体单位
|
|
|
jtKcsjxm.setDeleted("0");
|
|
|
+ jtKcsjxm.setQdbh(scxmbh + "Q_01");
|
|
|
+ jtKcsjxm.setQdmc(xmmc + "任务");
|
|
|
+ jtKcsjxm.setRwhjbh(scxmbh + "-Q-01-01");
|
|
|
+ jtKcsjxm.setRwhjmc(xmjd);
|
|
|
+ jtKcsjxm.setRwhjzrr(xmjl);
|
|
|
+ jtKcsjxm.setRwhjzrrid(xmjlid);
|
|
|
+ jtKcsjxm.setRwhjzrrcode(xmjlCode);
|
|
|
+ jtKcsjxm.setHjjhwcsj(jhwcsj);
|
|
|
jtKcsjxm.setCreatedate(new Date());
|
|
|
jtKcsjxm.setModifydate(new Date());
|
|
|
jtKcsjxm.setCreateusername("系统生成");
|
|
@@ -345,6 +372,10 @@ public class ExamineServiceImpl implements ExamineService {
|
|
|
jtScsdl.setYear(year); // 设置考核年
|
|
|
jtScsdl.setZbztdw(zbztdw); // 设置中标主体单位
|
|
|
jtScsdl.setDeleted("0");
|
|
|
+ jtScsdl.setQdbh(scxmbh + "Q_01");
|
|
|
+ jtScsdl.setQdmc(xmmc + "任务");
|
|
|
+ jtScsdl.setRwhjbh(scxmbh + "-Q-01-01");
|
|
|
+ jtScsdl.setRwhjmc(xmmc + "0101");
|
|
|
jtScsdl.setCreatedate(new Date());
|
|
|
jtScsdl.setModifydate(new Date());
|
|
|
jtScsdl.setCreateusername("系统生成");
|
|
@@ -504,23 +535,23 @@ public class ExamineServiceImpl implements ExamineService {
|
|
|
// jtXcjhqdList.add(jtXcjhqd);
|
|
|
// }
|
|
|
|
|
|
- });
|
|
|
- // 批量保存数据
|
|
|
- jtFjglxmService.saveBatch(jtFjglxmList);
|
|
|
- jtKcsjxmService.saveBatch(jtKcsjxmList);
|
|
|
- jtGzdgService.saveBatch(jtGzdgList);
|
|
|
- jtZtfapsService.saveBatch(jtZtfapsList);
|
|
|
- jtWyysService.saveBatch(jtWyysList);
|
|
|
- jtYjbhglService.saveBatch(jtYjbhglList);
|
|
|
- jtScsdlService.saveBatch(jtScsdlList);
|
|
|
- jtWtbhglService.saveBatch(jtWtbhglList);
|
|
|
- jtScbhglService.saveBatch(jtScbhglList);
|
|
|
- jtSjjdqdService.saveBatch(jtSjjdqdList);
|
|
|
- jtSjbgqdService.saveBatch(jtSjbgqdList);
|
|
|
- jtZdxmszmnService.saveBatch(jtZdxmszmnList);
|
|
|
+ });
|
|
|
+ // 批量保存数据
|
|
|
+ jtFjglxmService.saveBatch(jtFjglxmList);
|
|
|
+ jtKcsjxmService.saveBatch(jtKcsjxmList);
|
|
|
+ jtGzdgService.saveBatch(jtGzdgList);
|
|
|
+ jtZtfapsService.saveBatch(jtZtfapsList);
|
|
|
+ jtWyysService.saveBatch(jtWyysList);
|
|
|
+ jtYjbhglService.saveBatch(jtYjbhglList);
|
|
|
+ jtScsdlService.saveBatch(jtScsdlList);
|
|
|
+ jtWtbhglService.saveBatch(jtWtbhglList);
|
|
|
+ jtScbhglService.saveBatch(jtScbhglList);
|
|
|
+ jtSjjdqdService.saveBatch(jtSjjdqdList);
|
|
|
+ jtSjbgqdService.saveBatch(jtSjbgqdList);
|
|
|
+ jtZdxmszmnService.saveBatch(jtZdxmszmnList);
|
|
|
// jtXcjhqdService.saveBatch(jtXcjhqdList);
|
|
|
- return R.ok("保存成功");
|
|
|
- }
|
|
|
+ return R.ok("保存成功");
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public R addkhbm(Map<String, Object> jsonDatas) throws Exception {
|
|
@@ -540,31 +571,31 @@ public class ExamineServiceImpl implements ExamineService {
|
|
|
|
|
|
//根据year gldw 和org 在表 jt_xmkh中查询数据是否已经存在 已经存在的数据不需要重复生产
|
|
|
|
|
|
- // 拆分 ORG 字段
|
|
|
- String[] orgArray = org.split(",");
|
|
|
- List<JtXmkh> dataList = new ArrayList<>();
|
|
|
- for (String orgValue : orgArray) {
|
|
|
- JtXmkh jtXmkh1 = jtXmkhService.getOne(new LambdaQueryWrapper<JtXmkh>()
|
|
|
- .eq(JtXmkh::getYear, year)
|
|
|
- .eq(JtXmkh::getGldw, gldw)
|
|
|
- .eq(JtXmkh::getOrgid, orgValue)
|
|
|
- .eq(JtXmkh::getDeleted, "0"));
|
|
|
- if (jtXmkh1 == null) {
|
|
|
- JtXmkh jtXmkh = new JtXmkh();
|
|
|
- jtXmkh.setYear(year);
|
|
|
- jtXmkh.setGldw(gldw);
|
|
|
- jtXmkh.setOrgid(orgValue);
|
|
|
- jtXmkh.setReportstatus(reportStatus);
|
|
|
- jtXmkh.setProcessstatus(processStatus);
|
|
|
- jtXmkh.setId(SecurityUtil.getUUID());
|
|
|
- jtXmkh.setDeleted(deleted);
|
|
|
- jtXmkh.setCreateuserid(createuserid);
|
|
|
- jtXmkh.setCreateusername(name);
|
|
|
- jtXmkh.setCreatedate(new Date());
|
|
|
- jtXmkh.setProcessstatus("审批通过");
|
|
|
- dataList.add(jtXmkh);
|
|
|
- }
|
|
|
+ // 拆分 ORG 字段
|
|
|
+ String[] orgArray = org.split(",");
|
|
|
+ List<JtXmkh> dataList = new ArrayList<>();
|
|
|
+ for (String orgValue : orgArray) {
|
|
|
+ JtXmkh jtXmkh1 = jtXmkhService.getOne(new LambdaQueryWrapper<JtXmkh>()
|
|
|
+ .eq(JtXmkh::getYear, year)
|
|
|
+ .eq(JtXmkh::getGldw, gldw)
|
|
|
+ .eq(JtXmkh::getOrgid, orgValue)
|
|
|
+ .eq(JtXmkh::getDeleted, "0"));
|
|
|
+ if (jtXmkh1 == null) {
|
|
|
+ JtXmkh jtXmkh = new JtXmkh();
|
|
|
+ jtXmkh.setYear(year);
|
|
|
+ jtXmkh.setGldw(gldw);
|
|
|
+ jtXmkh.setOrgid(orgValue);
|
|
|
+ jtXmkh.setReportstatus(reportStatus);
|
|
|
+ jtXmkh.setProcessstatus(processStatus);
|
|
|
+ jtXmkh.setId(SecurityUtil.getUUID());
|
|
|
+ jtXmkh.setDeleted(deleted);
|
|
|
+ jtXmkh.setCreateuserid(createuserid);
|
|
|
+ jtXmkh.setCreateusername(name);
|
|
|
+ jtXmkh.setCreatedate(new Date());
|
|
|
+ jtXmkh.setProcessstatus("审批通过");
|
|
|
+ dataList.add(jtXmkh);
|
|
|
}
|
|
|
+ }
|
|
|
if (dataList.size() > 0) {
|
|
|
jtXmkhService.saveBatch(dataList);
|
|
|
}
|