|
@@ -13,6 +13,7 @@ import com.ims.eval.dao.OrganizationEvaluationMapper;
|
|
import com.ims.eval.entity.dto.request.IndicatorDTO;
|
|
import com.ims.eval.entity.dto.request.IndicatorDTO;
|
|
import com.ims.eval.entity.dto.request.IndicatorDictionaryDTO;
|
|
import com.ims.eval.entity.dto.request.IndicatorDictionaryDTO;
|
|
import com.ims.eval.entity.dto.response.*;
|
|
import com.ims.eval.entity.dto.response.*;
|
|
|
|
+import com.ims.eval.entity.dto.result.R;
|
|
import com.ims.eval.feign.RemoteServiceBuilder;
|
|
import com.ims.eval.feign.RemoteServiceBuilder;
|
|
import com.ims.eval.service.*;
|
|
import com.ims.eval.service.*;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -165,7 +166,7 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
if (checkCycle.contains("DWPJ")) {
|
|
if (checkCycle.contains("DWPJ")) {
|
|
List<OrganizationEvaluation> dwpj = list.getRecords().stream().filter(ll -> "DWPJ".equals(ll.getCheckCycle())).collect(Collectors.toList());
|
|
List<OrganizationEvaluation> dwpj = list.getRecords().stream().filter(ll -> "DWPJ".equals(ll.getCheckCycle())).collect(Collectors.toList());
|
|
QueryWrapper<OrganizationEvaluation> q = new QueryWrapper<>();
|
|
QueryWrapper<OrganizationEvaluation> q = new QueryWrapper<>();
|
|
- q.eq("check_cycle","NDKP");
|
|
|
|
|
|
+ q.eq("check_cycle", "NDKP");
|
|
List<OrganizationEvaluation> organizationEvaluations = baseMapper.selectList(q);
|
|
List<OrganizationEvaluation> organizationEvaluations = baseMapper.selectList(q);
|
|
List<OrganizationEvaluation> ndkp = organizationEvaluations.stream().filter(yy -> "NDKP".equals(yy.getCheckCycle()) && "2023".equals(yy.getYear())).collect(Collectors.toList());
|
|
List<OrganizationEvaluation> ndkp = organizationEvaluations.stream().filter(yy -> "NDKP".equals(yy.getCheckCycle()) && "2023".equals(yy.getYear())).collect(Collectors.toList());
|
|
if (dwpj.isEmpty()) {
|
|
if (dwpj.isEmpty()) {
|
|
@@ -254,7 +255,7 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
}
|
|
}
|
|
|
|
|
|
String uuid = UUID.randomUUID().toString().replace("-", "");
|
|
String uuid = UUID.randomUUID().toString().replace("-", "");
|
|
- entity.setOrganizationEvaluationCode("dwpj_"+entity.getYear());
|
|
|
|
|
|
+ entity.setOrganizationEvaluationCode("dwpj_" + entity.getYear());
|
|
entity.setId(uuid);
|
|
entity.setId(uuid);
|
|
entity.setCheckCycle("DWPJ");
|
|
entity.setCheckCycle("DWPJ");
|
|
boolean c = super.save(entity);
|
|
boolean c = super.save(entity);
|
|
@@ -302,10 +303,9 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
@Transactional
|
|
@Transactional
|
|
@Override
|
|
@Override
|
|
- public boolean generateUnitEvaluationInfo(List<String> ids, String indicatorId, String organizationId) {
|
|
|
|
|
|
+ public R generateUnitEvaluationInfo(List<String> ids, String indicatorId, String organizationId, Boolean mark) {
|
|
|
|
|
|
for (String id : ids) {
|
|
for (String id : ids) {
|
|
OrganizationEvaluation organizationEvaluation = baseMapper.selectById(id);
|
|
OrganizationEvaluation organizationEvaluation = baseMapper.selectById(id);
|
|
@@ -316,7 +316,11 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
List<OrganizationEvaluationInfo> organizationEvaluationInfoOris = organizationEvaluationInfoService.getConvergeCommonInfo(id, organizationId, indicatorId);
|
|
List<OrganizationEvaluationInfo> organizationEvaluationInfoOris = organizationEvaluationInfoService.getConvergeCommonInfo(id, organizationId, indicatorId);
|
|
|
|
|
|
if (null != organizationEvaluationInfoOris && organizationEvaluationInfoOris.size() > 0) {
|
|
if (null != organizationEvaluationInfoOris && organizationEvaluationInfoOris.size() > 0) {
|
|
- throw new CustomException("考评明细记录已存在");
|
|
|
|
|
|
+ if (mark) {
|
|
|
|
+ int i = organizationEvaluationInfoService.clearOldData(id, organizationId, indicatorId);
|
|
|
|
+ } else {
|
|
|
|
+ return R.error("考评明细记录已存在");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
//查询对应年度的目标责任书
|
|
//查询对应年度的目标责任书
|
|
@@ -471,13 +475,13 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
organizationEvaluation.setStage("数据已生成");
|
|
organizationEvaluation.setStage("数据已生成");
|
|
baseMapper.updateById(organizationEvaluation);
|
|
baseMapper.updateById(organizationEvaluation);
|
|
}
|
|
}
|
|
-
|
|
|
|
- return true;
|
|
|
|
|
|
+// return true;
|
|
|
|
+ return R.ok();
|
|
}
|
|
}
|
|
|
|
|
|
@Transactional
|
|
@Transactional
|
|
@Override
|
|
@Override
|
|
- public boolean generateUnitMonthEvaluation(List<String> ids, String indicatorId, String organizationId) {
|
|
|
|
|
|
+ public R generateUnitMonthEvaluation(List<String> ids, String indicatorId, String organizationId, Boolean mark) {
|
|
|
|
|
|
for (String id : ids) {
|
|
for (String id : ids) {
|
|
OrganizationEvaluation organizationEvaluation = baseMapper.selectById(id);
|
|
OrganizationEvaluation organizationEvaluation = baseMapper.selectById(id);
|
|
@@ -485,11 +489,15 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
throw new CustomException("不存在考评记录");
|
|
throw new CustomException("不存在考评记录");
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
List<OrganizationEvaluationInfo> organizationEvaluationInfoOris = organizationEvaluationInfoService.getConvergeCommonInfo(id, organizationId, indicatorId);
|
|
List<OrganizationEvaluationInfo> organizationEvaluationInfoOris = organizationEvaluationInfoService.getConvergeCommonInfo(id, organizationId, indicatorId);
|
|
|
|
|
|
if (null != organizationEvaluationInfoOris && organizationEvaluationInfoOris.size() > 0) {
|
|
if (null != organizationEvaluationInfoOris && organizationEvaluationInfoOris.size() > 0) {
|
|
- throw new CustomException("考评明细记录已存在");
|
|
|
|
|
|
+ if (mark) {
|
|
|
|
+ int i = organizationEvaluationInfoService.clearOldData(id, organizationId, indicatorId);
|
|
|
|
+ } else {
|
|
|
|
+ return R.error("考评明细记录已存在");
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
String organizationType = organizationEvaluation.getOrganizationType();//考评类型 DWKP
|
|
String organizationType = organizationEvaluation.getOrganizationType();//考评类型 DWKP
|
|
@@ -498,7 +506,9 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
|
|
|
//查询当前周期下对应的考评权重(需要考评的单位)
|
|
//查询当前周期下对应的考评权重(需要考评的单位)
|
|
List<OrganizationEvaluationRule> evaluationRules = organizationEvaluationRuleService.getOrganizationEvaluationRuleByYearAndCycle(organizationType, checkCycle, year, "");
|
|
List<OrganizationEvaluationRule> evaluationRules = organizationEvaluationRuleService.getOrganizationEvaluationRuleByYearAndCycle(organizationType, checkCycle, year, "");
|
|
-
|
|
|
|
|
|
+ if (evaluationRules == null || evaluationRules.isEmpty()) {
|
|
|
|
+ throw new CustomException("单位权重未配置");
|
|
|
|
+ }
|
|
|
|
|
|
//判断组织id 是否有值;不为空只生成当前组织的数据
|
|
//判断组织id 是否有值;不为空只生成当前组织的数据
|
|
if (StringUtils.isNotEmpty(organizationId)) {
|
|
if (StringUtils.isNotEmpty(organizationId)) {
|
|
@@ -615,7 +625,7 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
organizationEvaluation.setStage("数据已生成");
|
|
organizationEvaluation.setStage("数据已生成");
|
|
baseMapper.updateById(organizationEvaluation);
|
|
baseMapper.updateById(organizationEvaluation);
|
|
}
|
|
}
|
|
- return true;
|
|
|
|
|
|
+ return R.ok();
|
|
}
|
|
}
|
|
|
|
|
|
@Transactional
|
|
@Transactional
|