|
@@ -0,0 +1,126 @@
|
|
|
+package com.ims.eval.service.impl;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.ims.common.utils.StringUtils;
|
|
|
+import com.ims.eval.config.CustomException;
|
|
|
+import com.ims.eval.dao.EvaluationRevisionMapper;
|
|
|
+import com.ims.eval.entity.DeptResponsibility;
|
|
|
+import com.ims.eval.entity.EvaluationRevision;
|
|
|
+import com.ims.eval.service.IDeptResponsibilityService;
|
|
|
+import com.ims.eval.service.IEvaluationRevisionService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author hlf
|
|
|
+ * @date 2023/5/23 10:34
|
|
|
+ * 文件说明:
|
|
|
+ */
|
|
|
+@Service
|
|
|
+public class EvaluationRevisionServiceImpl extends ServiceImpl<EvaluationRevisionMapper, EvaluationRevision> implements IEvaluationRevisionService {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IDeptResponsibilityService deptResponsibilityService;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public IPage<EvaluationRevision> listPage(Integer pageNum, Integer pageSize, String id, String responsibilityCode, String cycleUnit, List<String> checkCycle, String beginDate, String endDate, String stage, String createBy, String year, String month, String des) {
|
|
|
+
|
|
|
+ QueryWrapper<EvaluationRevision> qw = new QueryWrapper<>();
|
|
|
+ if (null == pageNum || null == pageSize) {
|
|
|
+ throw new CustomException("分页参数为空");
|
|
|
+ }
|
|
|
+ //构造分页构造器
|
|
|
+ Page<EvaluationRevision> page = new Page<>(pageNum, pageSize);
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(id)) {
|
|
|
+ qw.lambda().eq(EvaluationRevision::getId, id);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(responsibilityCode)) {
|
|
|
+ qw.lambda().like(EvaluationRevision::getResponsibilityCode, responsibilityCode);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(cycleUnit)) {
|
|
|
+ qw.lambda().eq(EvaluationRevision::getCycleUnit, cycleUnit);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(checkCycle)) {
|
|
|
+ qw.lambda().in(EvaluationRevision::getCheckCycle, checkCycle);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(beginDate) && StringUtils.isNotEmpty(endDate)) {
|
|
|
+ qw.lambda().ge(EvaluationRevision::getBeginDate, beginDate);
|
|
|
+ qw.lambda().le(EvaluationRevision::getEndDate, endDate);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(stage)) {
|
|
|
+ qw.lambda().eq(EvaluationRevision::getStage, stage);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(createBy)) {
|
|
|
+ qw.lambda().eq(EvaluationRevision::getCreateBy, createBy);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(createBy)) {
|
|
|
+ qw.lambda().eq(EvaluationRevision::getCreateBy, createBy);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(year)) {
|
|
|
+ qw.lambda().eq(EvaluationRevision::getYear, year);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(month)) {
|
|
|
+ qw.lambda().eq(EvaluationRevision::getMonth, month);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(des)) {
|
|
|
+ qw.lambda().like(EvaluationRevision::getDes, des);
|
|
|
+ }
|
|
|
+
|
|
|
+ qw.lambda().orderByDesc(EvaluationRevision::getCreateTime);
|
|
|
+
|
|
|
+ IPage<EvaluationRevision> list = baseMapper.selectPage(page, qw);
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean save(String id) {
|
|
|
+ DeptResponsibility deptResponsibility = deptResponsibilityService.getById(id);
|
|
|
+ if (null != deptResponsibility) {
|
|
|
+ EvaluationRevision evaluationRevision = new EvaluationRevision();
|
|
|
+ evaluationRevision.setDeptResponsibilityId(deptResponsibility.getId());
|
|
|
+ String responsibilityCode = deptResponsibility.getResponsibilityCode();
|
|
|
+ int index = responsibilityCode.indexOf("_");
|
|
|
+ evaluationRevision.setResponsibilityCode("MBXD" + responsibilityCode.substring(index).toUpperCase());
|
|
|
+ evaluationRevision.setOrganizationId(deptResponsibility.getOrganizationId());
|
|
|
+ evaluationRevision.setOrganizationName(deptResponsibility.getOrganizationName());
|
|
|
+ evaluationRevision.setOrganizationType(deptResponsibility.getOrganizationType());
|
|
|
+ evaluationRevision.setCycleUnit(deptResponsibility.getCycleUnit());
|
|
|
+ evaluationRevision.setCheckCycle(deptResponsibility.getCheckCycle());
|
|
|
+ evaluationRevision.setYear(deptResponsibility.getYear());
|
|
|
+ evaluationRevision.setMonth(deptResponsibility.getMonth());
|
|
|
+ evaluationRevision.setOrganizationEvaluationRuleId(deptResponsibility.getOrganizationEvaluationRuleId());
|
|
|
+ evaluationRevision.setBeginDate(deptResponsibility.getBeginDate());
|
|
|
+ evaluationRevision.setEndDate(deptResponsibility.getEndDate());
|
|
|
+ evaluationRevision.setStage("流程未启动");
|
|
|
+ evaluationRevision.setDes(deptResponsibility.getDes());
|
|
|
+ evaluationRevision.setCreateTime(new Date());
|
|
|
+ evaluationRevision.setReviewPeople(deptResponsibility.getReviewPeople());
|
|
|
+ evaluationRevision.setReviewPeopleTime(deptResponsibility.getReviewPeopleTime());
|
|
|
+ evaluationRevision.setReviewOpinion(deptResponsibility.getReviewOpinion());
|
|
|
+ evaluationRevision.setFinalReviewPeople(deptResponsibility.getFinalReviewPeople());
|
|
|
+ evaluationRevision.setFinalReviewPeopleTime(deptResponsibility.getFinalReviewPeopleTime());
|
|
|
+ evaluationRevision.setFinalReviewOpinion(deptResponsibility.getFinalReviewOpinion());
|
|
|
+ evaluationRevision.setRemark(deptResponsibility.getRemark());
|
|
|
+ evaluationRevision.setCreateOrgId(deptResponsibility.getCreateOrgId());
|
|
|
+ evaluationRevision.setCreateOrgName(deptResponsibility.getCreateOrgName());
|
|
|
+ return super.save(evaluationRevision);
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|