hlf преди 1 година
родител
ревизия
aa0716306e

+ 6 - 10
ims-service/ims-eval/src/main/java/com/ims/eval/controller/DepartmentalPerformanceIndicatorPlanController.java

@@ -26,6 +26,7 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletRequest;
 import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
 import java.util.*;
 
 /**
@@ -75,7 +76,7 @@ public class DepartmentalPerformanceIndicatorPlanController {
 		@RequestParam(value = "des", required = false) String des,
 		@RequestParam(value = "appraisalYear", required = false) String appraisalYear,
 		@RequestParam(value = "stage", required = false) String stage) {
-		IPage<EvaluationDeptBusinessPlan> list = evaluationDeptBusinessPlanService.listPage(pageNum, pageSize, deptId, responsibilityCode, des, appraisalYear, stage,request);
+		IPage<EvaluationDeptBusinessPlan> list = evaluationDeptBusinessPlanService.listPage(pageNum, pageSize, deptId, responsibilityCode, des, appraisalYear, stage, request);
 		return R.ok().data(list);
 	}
 
@@ -193,17 +194,13 @@ public class DepartmentalPerformanceIndicatorPlanController {
 	 */
 	@GetMapping(value = "/details/{id}/{deptId}/{deptName}")
 	public R details(@PathVariable("id") String id, @PathVariable("deptId") String deptId, @PathVariable("deptName") String deptName) {
-
 		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();
 		}
-
 		List<EvaluationDeptBusinessContent> list = evaluationDeptBusinessContentService.detailsList(id, deptId, deptName);
 		for (EvaluationDeptBusinessContent evaluationDeptBusinessContent : list) {
 			if (!"23031009".equals(evaluationDeptBusinessContent.getCreateDept())) {//是否组织人事部添加的数据
@@ -212,9 +209,6 @@ public class DepartmentalPerformanceIndicatorPlanController {
 				if ("23031009".equals(deptId)) {//组织人事部
 					evaluationDeptBusinessContent.setDataPermission("1");
 				} else {
-
-
-
 					evaluationDeptBusinessContent.setDataPermission("-1");
 				}
 			}
@@ -239,6 +233,8 @@ public class DepartmentalPerformanceIndicatorPlanController {
 			}
 		} catch (CustomException e) {
 			return R.customError(e.getMessage()).data("失败!");
+		} catch (UnsupportedEncodingException e) {
+			throw new RuntimeException(e);
 		}
 	}
 
@@ -297,7 +293,7 @@ public class DepartmentalPerformanceIndicatorPlanController {
 
 				user.getDeptOrg().getType();
 
-				if("150".equals(user.getDeptOrg().getType())){
+				if ("150".equals(user.getDeptOrg().getType())) {
 					deptId = user.getDeptOrg().getParentId();
 				}
 

+ 2 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/service/IEvaluationDeptBusinessContentService.java

@@ -3,6 +3,7 @@ package com.ims.eval.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ims.eval.entity.EvaluationDeptBusinessContent;
 
+import java.io.UnsupportedEncodingException;
 import java.util.List;
 
 /**
@@ -16,7 +17,7 @@ public interface IEvaluationDeptBusinessContentService extends IService<Evaluati
 
 	boolean removeByBusinessPlanId(String businessPlanId);
 
-	boolean saveOrUpdateBatch(List<EvaluationDeptBusinessContent> evaluationDeptBusinessContentList);
+	boolean saveOrUpdateBatch(List<EvaluationDeptBusinessContent> evaluationDeptBusinessContentList) throws UnsupportedEncodingException;
 
 	List<EvaluationDeptBusinessContent> selectEvaluationDeptBusinessContentListByBusinessPlanId(String businessPlanId, String deptId);
 

+ 10 - 8
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/DeptAssessmentDeclarationServiceImpl.java

@@ -148,13 +148,14 @@ public class DeptAssessmentDeclarationServiceImpl extends ServiceImpl<DeptAssess
 				List<UserDTO> userList = JSONUtil.toList(array, UserDTO.class);
 				userList.removeAll(secondaryList);
 				for (int i = 0; i < userList.size(); i++) {
-					if (StringUtils.isNotEmpty(userList.get(i).getNo())) {
+					UserDTO user = userList.get(i);
+					if (!"".equals(user.getNo()) && null != user.getNo()) {
 						DeptAssessmentDeclarationContent deptAssessmentDeclarationContent = new DeptAssessmentDeclarationContent();
 						deptAssessmentDeclarationContent.setAssessmentDeclarationId(id);
 						deptAssessmentDeclarationContent.setSerialNumber(i + 1);
-						deptAssessmentDeclarationContent.setEmployeeId(userList.get(i).getId());
-						deptAssessmentDeclarationContent.setEmployeeNo(userList.get(i).getNo());
-						deptAssessmentDeclarationContent.setEmployeeName(userList.get(i).getName());
+						deptAssessmentDeclarationContent.setEmployeeId(user.getId());
+						deptAssessmentDeclarationContent.setEmployeeNo(user.getNo());
+						deptAssessmentDeclarationContent.setEmployeeName(user.getName());
 						deptAssessmentDeclarationContent.setSuggestedValue("1");
 						deptAssessmentDeclarationContentList.add(deptAssessmentDeclarationContent);
 					}
@@ -165,13 +166,14 @@ public class DeptAssessmentDeclarationServiceImpl extends ServiceImpl<DeptAssess
 				JSONArray array = JSONUtil.parseArray(jsonArr1.get("records"));
 				List<UserDTO> userList = JSONUtil.toList(array, UserDTO.class);
 				for (int i = 0; i < userList.size(); i++) {
-					if (StringUtils.isNotEmpty(userList.get(i).getNo())) {
+					UserDTO user = userList.get(i);
+					if (!"".equals(user.getNo()) && null != user.getNo()) {
 						DeptAssessmentDeclarationContent deptAssessmentDeclarationContent = new DeptAssessmentDeclarationContent();
 						deptAssessmentDeclarationContent.setAssessmentDeclarationId(id);
 						deptAssessmentDeclarationContent.setSerialNumber(i + 1);
-						deptAssessmentDeclarationContent.setEmployeeId(userList.get(i).getId());
-						deptAssessmentDeclarationContent.setEmployeeNo(userList.get(i).getNo());
-						deptAssessmentDeclarationContent.setEmployeeName(userList.get(i).getName());
+						deptAssessmentDeclarationContent.setEmployeeId(user.getId());
+						deptAssessmentDeclarationContent.setEmployeeNo(user.getNo());
+						deptAssessmentDeclarationContent.setEmployeeName(user.getName());
 						deptAssessmentDeclarationContent.setSuggestedValue("1");
 						deptAssessmentDeclarationContentList.add(deptAssessmentDeclarationContent);
 					}

+ 24 - 48
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluationDeptBusinessContentServiceImpl.java

@@ -12,6 +12,8 @@ import com.ims.eval.service.IOrganizationStructureService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -31,7 +33,7 @@ public class EvaluationDeptBusinessContentServiceImpl extends ServiceImpl<Evalua
 		if ("23031009".equals(deptId)) {//组织人事部
 			deptId = "";
 		}
-		if ("null".equals(deptName)){
+		if ("null".equals(deptName)) {
 			deptName = "";
 		}
 		return baseMapper.detailsList(businessPlanId, deptId, deptName);
@@ -43,54 +45,28 @@ public class EvaluationDeptBusinessContentServiceImpl extends ServiceImpl<Evalua
 	}
 
 	@Override
-	public boolean saveOrUpdateBatch(List<EvaluationDeptBusinessContent> evaluationDeptBusinessContentList) {
+	public boolean saveOrUpdateBatch(List<EvaluationDeptBusinessContent> evaluationDeptBusinessContentList) throws UnsupportedEncodingException {
 		List<EvaluationDeptBusinessContent> list = new ArrayList<>();
 		for (EvaluationDeptBusinessContent evaluationDeptBusinessContent : evaluationDeptBusinessContentList) {
+			if (!"".equals(evaluationDeptBusinessContent.getTargetValue()) && null != evaluationDeptBusinessContent.getTargetValue()) {
+				String targetValue = URLDecoder.decode(evaluationDeptBusinessContent.getTargetValue(), "UTF-8");
+				evaluationDeptBusinessContent.setTargetValue(targetValue);
+			}
+			if (!"".equals(evaluationDeptBusinessContent.getCompletionStatus()) && null != evaluationDeptBusinessContent.getCompletionStatus()) {
+				String completionStatus = URLDecoder.decode(evaluationDeptBusinessContent.getCompletionStatus(), "UTF-8");
+				evaluationDeptBusinessContent.setCompletionStatus(completionStatus);
+			}
 			if (evaluationDeptBusinessContent.getId() == null || "".equals(evaluationDeptBusinessContent.getId())) {//新增
-				QueryWrapper<EvaluationDeptBusinessContent> qw = new QueryWrapper<>();
-				if (StringUtils.isNotEmpty(evaluationDeptBusinessContent.getBusinessPlanId())) {
-					qw.lambda().like(EvaluationDeptBusinessContent::getBusinessPlanId, evaluationDeptBusinessContent.getBusinessPlanId());
-				}
-				if (StringUtils.isNotEmpty(evaluationDeptBusinessContent.getDeptId())) {
-					qw.lambda().like(EvaluationDeptBusinessContent::getDeptId, evaluationDeptBusinessContent.getDeptId());
-				}
-				if (StringUtils.isNotEmpty(evaluationDeptBusinessContent.getTargetName())) {
-					qw.lambda().like(EvaluationDeptBusinessContent::getTargetName, evaluationDeptBusinessContent.getTargetName());
-				}
-				List<EvaluationDeptBusinessContent> objList1 = super.list(qw);
-				if (objList1.size() == 0) {
-					List<OrganizationStructure> organizationStructureList = organizationStructureService.getTree("23031001", 1, "140");
-					OrganizationStructure organizationStructure = organizationStructureList.get(0).getChildren().stream().filter(item -> item.getId().equals(evaluationDeptBusinessContent.getDeptId())).findFirst().orElse(null);
-					if (null != organizationStructure) {
-						evaluationDeptBusinessContent.setDeptName(organizationStructure.getName());
-						evaluationDeptBusinessContent.setAuditStatusKp("-1");
-						evaluationDeptBusinessContent.setCreateTime(DateUtil.date());
-						list.add(evaluationDeptBusinessContent);
-					}
+				List<OrganizationStructure> organizationStructureList = organizationStructureService.getTree("23031001", 1, "140");
+				OrganizationStructure organizationStructure = organizationStructureList.get(0).getChildren().stream().filter(item -> item.getId().equals(evaluationDeptBusinessContent.getDeptId())).findFirst().orElse(null);
+				if (null != organizationStructure) {
+					evaluationDeptBusinessContent.setDeptName(organizationStructure.getName());
+					evaluationDeptBusinessContent.setAuditStatusKp("-1");
+					evaluationDeptBusinessContent.setCreateTime(DateUtil.date());
+					list.add(evaluationDeptBusinessContent);
 				}
 			} else {//修改
-				evaluationDeptBusinessContent.setCreateDept(null);
-				EvaluationDeptBusinessContent obj = super.getById(evaluationDeptBusinessContent.getId());
-				if (null != obj) {
-					if (obj.getTargetName().equals(evaluationDeptBusinessContent.getTargetName())) {
-						list.add(evaluationDeptBusinessContent);
-					} else {
-						QueryWrapper<EvaluationDeptBusinessContent> qw = new QueryWrapper<>();
-						if (StringUtils.isNotEmpty(evaluationDeptBusinessContent.getBusinessPlanId())) {
-							qw.lambda().like(EvaluationDeptBusinessContent::getBusinessPlanId, evaluationDeptBusinessContent.getBusinessPlanId());
-						}
-						if (StringUtils.isNotEmpty(evaluationDeptBusinessContent.getDeptId())) {
-							qw.lambda().like(EvaluationDeptBusinessContent::getDeptId, evaluationDeptBusinessContent.getDeptId());
-						}
-						if (StringUtils.isNotEmpty(evaluationDeptBusinessContent.getTargetName())) {
-							qw.lambda().like(EvaluationDeptBusinessContent::getTargetName, evaluationDeptBusinessContent.getTargetName());
-						}
-						List<EvaluationDeptBusinessContent> objList3 = super.list(qw);
-						if (objList3.size() == 0) {
-							list.add(evaluationDeptBusinessContent);
-						}
-					}
-				}
+				list.add(evaluationDeptBusinessContent);
 			}
 		}
 		return super.saveOrUpdateBatch(list);
@@ -107,10 +83,10 @@ public class EvaluationDeptBusinessContentServiceImpl extends ServiceImpl<Evalua
 		for (EvaluationDeptBusinessContent evaluationDeptBusinessContent : evaluationDeptBusinessContentList) {
 			QueryWrapper<EvaluationDeptBusinessContent> qw = new QueryWrapper<>();
 			if (StringUtils.isNotEmpty(evaluationDeptBusinessContent.getBusinessPlanId())) {
-				qw.lambda().like(EvaluationDeptBusinessContent::getBusinessPlanId, evaluationDeptBusinessContent.getBusinessPlanId());
+				qw.lambda().eq(EvaluationDeptBusinessContent::getBusinessPlanId, evaluationDeptBusinessContent.getBusinessPlanId());
 			}
 			if (StringUtils.isNotEmpty(evaluationDeptBusinessContent.getTargetName())) {
-				qw.lambda().like(EvaluationDeptBusinessContent::getTargetName, evaluationDeptBusinessContent.getTargetName());
+				qw.lambda().eq(EvaluationDeptBusinessContent::getTargetName, evaluationDeptBusinessContent.getTargetName());
 			}
 			List<EvaluationDeptBusinessContent> objList = super.list(qw);
 			if (objList.size() == 1) {//修改
@@ -138,10 +114,10 @@ public class EvaluationDeptBusinessContentServiceImpl extends ServiceImpl<Evalua
 		for (EvaluationDeptBusinessContent evaluationDeptBusinessContent : evaluationDeptBusinessContentList) {
 			QueryWrapper<EvaluationDeptBusinessContent> qw = new QueryWrapper<>();
 			if (StringUtils.isNotEmpty(evaluationDeptBusinessContent.getBusinessPlanId())) {
-				qw.lambda().like(EvaluationDeptBusinessContent::getBusinessPlanId, evaluationDeptBusinessContent.getBusinessPlanId());
+				qw.lambda().eq(EvaluationDeptBusinessContent::getBusinessPlanId, evaluationDeptBusinessContent.getBusinessPlanId());
 			}
 			if (StringUtils.isNotEmpty(evaluationDeptBusinessContent.getTargetName())) {
-				qw.lambda().like(EvaluationDeptBusinessContent::getTargetName, evaluationDeptBusinessContent.getTargetName());
+				qw.lambda().eq(EvaluationDeptBusinessContent::getTargetName, evaluationDeptBusinessContent.getTargetName());
 			}
 			List<EvaluationDeptBusinessContent> objList = super.list(qw);
 			if (objList.size() == 1) {//修改