|
@@ -23,6 +23,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.text.DecimalFormat;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -53,21 +55,15 @@ public class EvaluationDeptBusinessPlanServiceImpl extends ServiceImpl<Evaluatio
|
|
|
//构造分页构造器
|
|
|
Page<EvaluationDeptBusinessPlan> page = new Page<>(pageNum, pageSize);
|
|
|
IPage<EvaluationDeptBusinessPlan> list = null;
|
|
|
-
|
|
|
String code = request.getHeader("code");
|
|
|
JSONObject json = remoteServiceBuilder.getGatewayUrl().getSysUser(code);
|
|
|
MyuserResDTO user = JSONObject.parseObject(json.getJSONObject("data").toJSONString(), MyuserResDTO.class);
|
|
|
-
|
|
|
user.getDeptOrg().getType();
|
|
|
-
|
|
|
- if("150".equals(user.getDeptOrg().getType())){
|
|
|
+ if ("150".equals(user.getDeptOrg().getType())) {
|
|
|
deptId = user.getDeptOrg().getParentId();
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
if ("23031009".equals(deptId)) {//组织人事部
|
|
|
- list = baseMapper.selectListPage(page, responsibilityCode, des, appraisalYear, stage);
|
|
|
+ list = baseMapper.selectListPage(page, "", responsibilityCode, des, appraisalYear, stage);
|
|
|
} else {
|
|
|
QueryWrapper<EvaluationDept> qw = new QueryWrapper<>();
|
|
|
qw.lambda().eq(EvaluationDept::getYjzbjhType, "1");
|
|
@@ -75,7 +71,7 @@ public class EvaluationDeptBusinessPlanServiceImpl extends ServiceImpl<Evaluatio
|
|
|
String finalDeptId = deptId;
|
|
|
EvaluationDept evaluationDept = evaluationDeptList.stream().filter(item -> item.getDeptId().equals(finalDeptId)).findFirst().orElse(null);
|
|
|
if (evaluationDept != null) {
|
|
|
- list = baseMapper.selectListPage(page, responsibilityCode, des, appraisalYear, stage);
|
|
|
+ list = baseMapper.selectListPage(page, finalDeptId, responsibilityCode, des, appraisalYear, stage);
|
|
|
}
|
|
|
}
|
|
|
return list;
|
|
@@ -83,12 +79,34 @@ public class EvaluationDeptBusinessPlanServiceImpl extends ServiceImpl<Evaluatio
|
|
|
|
|
|
@Override
|
|
|
public boolean save(EvaluationDeptBusinessPlan evaluationDeptBusinessPlan) {
|
|
|
- evaluationDeptBusinessPlan.setId(Convert.toStr(IdUtil.getSnowflake(1, 1).nextId()));
|
|
|
- evaluationDeptBusinessPlan.setResponsibilityCode("YJZB_GDDL_BMKP_" + evaluationDeptBusinessPlan.getAppraisalYear());
|
|
|
- evaluationDeptBusinessPlan.setDocumentStatus("有效");
|
|
|
- evaluationDeptBusinessPlan.setStage("流程未启动");
|
|
|
- evaluationDeptBusinessPlan.setCreateTime(DateUtil.date());
|
|
|
- return super.save(evaluationDeptBusinessPlan);
|
|
|
+ List<EvaluationDeptBusinessPlan> list = new ArrayList<>();
|
|
|
+ QueryWrapper<EvaluationDept> qw = new QueryWrapper<>();
|
|
|
+ qw.lambda().eq(EvaluationDept::getYjzbjhType, "1");
|
|
|
+ List<EvaluationDept> evaluationDeptList = evaluationDeptService.list(qw);
|
|
|
+ for (EvaluationDept dept : evaluationDeptList) {
|
|
|
+ QueryWrapper<EvaluationDeptBusinessPlan> qw1 = new QueryWrapper<>();
|
|
|
+ qw1.lambda().eq(EvaluationDeptBusinessPlan::getAppraisalYear, evaluationDeptBusinessPlan.getAppraisalYear());
|
|
|
+ qw1.lambda().eq(EvaluationDeptBusinessPlan::getDeptId, evaluationDeptBusinessPlan.getDeptId());
|
|
|
+ EvaluationDeptBusinessPlan businessPlan = super.getOne(qw1);
|
|
|
+ if (null == businessPlan) {
|
|
|
+ EvaluationDeptBusinessPlan plan = new EvaluationDeptBusinessPlan();
|
|
|
+ plan.setId(Convert.toStr(IdUtil.getSnowflake(1, 1).nextId()));
|
|
|
+ plan.setResponsibilityCode("ZBJH_" + dept.getDeptId() + "_" + evaluationDeptBusinessPlan.getAppraisalYear() + getThreePipelineNumbers());
|
|
|
+ plan.setAppraisalYear(evaluationDeptBusinessPlan.getAppraisalYear());
|
|
|
+ plan.setEvaluationCategory("BMKP");
|
|
|
+ plan.setBusinessClass("NDKP");
|
|
|
+ plan.setDocumentStatus("有效");
|
|
|
+ plan.setStage("流程未启动");
|
|
|
+ plan.setDes(dept.getDeptName() + evaluationDeptBusinessPlan.getAppraisalYear() + "年度业绩指标计划申报");
|
|
|
+ plan.setCreateTime(DateUtil.date());
|
|
|
+ plan.setCreateBy(evaluationDeptBusinessPlan.getCreateBy());
|
|
|
+ plan.setCreateName(evaluationDeptBusinessPlan.getCreateName());
|
|
|
+ plan.setDeptId(dept.getDeptId());
|
|
|
+ plan.setDeptName(dept.getDeptName());
|
|
|
+ list.add(plan);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return super.saveBatch(list);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -99,21 +117,17 @@ public class EvaluationDeptBusinessPlanServiceImpl extends ServiceImpl<Evaluatio
|
|
|
state = "流程已结束";
|
|
|
EvaluationDeptBusinessAssessment evaluationDeptBusinessAssessment = new EvaluationDeptBusinessAssessment();
|
|
|
evaluationDeptBusinessAssessment.setId(evaluationDeptBusinessPlan.getId());
|
|
|
- evaluationDeptBusinessAssessment.setResponsibilityCode(evaluationDeptBusinessPlan.getResponsibilityCode());
|
|
|
+ evaluationDeptBusinessAssessment.setResponsibilityCode("ZBKP_" + evaluationDeptBusinessPlan.getDeptId() + "_" + evaluationDeptBusinessPlan.getAppraisalYear() + getThreePipelineNumbers());
|
|
|
evaluationDeptBusinessAssessment.setAppraisalYear(evaluationDeptBusinessPlan.getAppraisalYear());
|
|
|
evaluationDeptBusinessAssessment.setEvaluationCategory(evaluationDeptBusinessPlan.getEvaluationCategory());
|
|
|
evaluationDeptBusinessAssessment.setBusinessClass(evaluationDeptBusinessPlan.getBusinessClass());
|
|
|
evaluationDeptBusinessAssessment.setDocumentStatus(evaluationDeptBusinessPlan.getDocumentStatus());
|
|
|
evaluationDeptBusinessAssessment.setStage("流程未启动");
|
|
|
evaluationDeptBusinessAssessment.setDes(evaluationDeptBusinessPlan.getDes());
|
|
|
- evaluationDeptBusinessAssessment.setReviewPeople(evaluationDeptBusinessPlan.getReviewPeople());
|
|
|
- evaluationDeptBusinessAssessment.setReviewPeopleTime(evaluationDeptBusinessPlan.getReviewPeopleTime());
|
|
|
- evaluationDeptBusinessAssessment.setReviewOpinion(evaluationDeptBusinessPlan.getReviewOpinion());
|
|
|
- evaluationDeptBusinessAssessment.setFinalReviewPeople(evaluationDeptBusinessPlan.getFinalReviewPeople());
|
|
|
- evaluationDeptBusinessAssessment.setFinalReviewPeopleTime(evaluationDeptBusinessPlan.getFinalReviewPeopleTime());
|
|
|
- evaluationDeptBusinessAssessment.setFinalReviewOpinion(evaluationDeptBusinessPlan.getFinalReviewOpinion());
|
|
|
evaluationDeptBusinessAssessment.setCreateTime(DateUtil.date());
|
|
|
evaluationDeptBusinessAssessment.setRemark(evaluationDeptBusinessPlan.getRemark());
|
|
|
+ evaluationDeptBusinessAssessment.setDeptId(evaluationDeptBusinessPlan.getDeptId());
|
|
|
+ evaluationDeptBusinessAssessment.setDeptName(evaluationDeptBusinessPlan.getDeptName());
|
|
|
evaluationDeptBusinessAssessmentService.save(evaluationDeptBusinessAssessment);
|
|
|
}
|
|
|
evaluationDeptBusinessPlan.setStage(state);
|
|
@@ -148,4 +162,20 @@ public class EvaluationDeptBusinessPlanServiceImpl extends ServiceImpl<Evaluatio
|
|
|
evaluationDeptBusinessAssessmentService.updateById(evaluationDeptBusinessAssessment);
|
|
|
return super.updateById(evaluationDeptBusinessPlan);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<EvaluationDeptBusinessPlan> selectEvaluationDeptBusinessPlanByYear(String year) {
|
|
|
+ return baseMapper.selectEvaluationDeptBusinessPlanByYear(year);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return 获取三位流水号
|
|
|
+ */
|
|
|
+ public String getThreePipelineNumbers() {
|
|
|
+ String code = "";
|
|
|
+ int num = super.count() + 1;
|
|
|
+ DecimalFormat def = new DecimalFormat("000");
|
|
|
+ code += def.format(num);
|
|
|
+ return code;
|
|
|
+ }
|
|
|
}
|