Kaynağa Gözat

绩效结果考核申报添加审批领导

hlf 1 yıl önce
ebeveyn
işleme
bbc754fa2a

+ 23 - 9
ims-service/ims-eval/src/main/java/com/ims/eval/component/NextApproverImpl.java

@@ -2,9 +2,13 @@ package com.ims.eval.component;
 
 import com.ims.eval.entity.DeptAssessmentDeclaration;
 import com.ims.eval.service.IDeptAssessmentDeclarationService;
+import com.ims.idms.modules.sys.entity.SysUser;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * @author hlf
  * @date 2023/8/9 9:28
@@ -17,26 +21,36 @@ public class NextApproverImpl {
 	private IDeptAssessmentDeclarationService deptAssessmentDeclarationService;
 
 	/**
-	 * 申报等级有变化
+	 * 获取流程审批人员
 	 *
 	 * @return 结果
 	 */
-	public boolean submitTask1(String a1, String a2, String a3) {
+	public List<SysUser> submitTask1(String a1, String a2, String a3) {
 		System.out.println("进入方法submitTask1----------------->" + "a1:" + a1 + "-----------a2:" + a2 + "-----------a3:" + a3);
 		DeptAssessmentDeclaration deptAssessmentDeclaration = deptAssessmentDeclarationService.getById(a1);
-		boolean flag = !deptAssessmentDeclaration.getDeclarationLevel().equals(deptAssessmentDeclaration.getRatingGrade());
-		return flag;
+		List<SysUser> userList = new ArrayList<>();
+		SysUser user = new SysUser();
+		user.setId(deptAssessmentDeclaration.getDeptLeaderId());
+		user.setNo(deptAssessmentDeclaration.getDeptLeaderNo());
+		user.setName(deptAssessmentDeclaration.getDeptLeaderName());
+		userList.add(user);
+		return userList;
 	}
 
 	/**
-	 * 申报等级无变化
+	 * 获取流程复批人员
 	 *
 	 * @return 结果
 	 */
-	public boolean submitTask2(String a1, String a2, String a3) {
-		System.out.println("进入方法submitTask2----------------->" + "a1:" + a1 + "-----------a2:" + a2 + "-----------a3:" + a3);
+	public List<SysUser> submitTask2(String a1, String a2, String a3) {
+		System.out.println("进入方法submitTask1----------------->" + "a1:" + a1 + "-----------a2:" + a2 + "-----------a3:" + a3);
 		DeptAssessmentDeclaration deptAssessmentDeclaration = deptAssessmentDeclarationService.getById(a1);
-		boolean flag = deptAssessmentDeclaration.getDeclarationLevel().equals(deptAssessmentDeclaration.getRatingGrade());
-		return flag;
+		List<SysUser> userList = new ArrayList<>();
+		SysUser user = new SysUser();
+		user.setId(deptAssessmentDeclaration.getSeconderId());
+		user.setNo(deptAssessmentDeclaration.getSeconderNo());
+		user.setName(deptAssessmentDeclaration.getSeconderName());
+		userList.add(user);
+		return userList;
 	}
 }

+ 29 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/controller/DeptAssessmentDeclarationController.java

@@ -665,6 +665,35 @@ public class DeptAssessmentDeclarationController {
 	}
 
 	/**
+	 * 添加复批领导
+	 *
+	 * @param id         主键
+	 * @param employeeNo 用户编号
+	 * @return 结果
+	 */
+	@PostMapping(value = "/addRepeatBatchLeader")
+	public R addRepeatBatchLeader(@RequestParam(value = "id") String id,
+							   @RequestParam(value = "employeeNo") String employeeNo) {
+		boolean b = false;
+		JSONObject jsonArr = userService.pageList(1, 500, "", "", "", employeeNo, "", "", request);
+		JSONObject jsonArr1 = (JSONObject) jsonArr.get("data");
+		JSONArray array = JSONUtil.parseArray(jsonArr1.get("records"));
+		List<UserDTO> userList = JSONUtil.toList(array, UserDTO.class);
+		if (userList.size() > 0) {
+			DeptAssessmentDeclaration deptAssessmentDeclaration = deptAssessmentDeclarationService.getById(id);
+			deptAssessmentDeclaration.setSeconderId(userList.get(0).getId());
+			deptAssessmentDeclaration.setSeconderNo(userList.get(0).getNo());
+			deptAssessmentDeclaration.setSeconderName(userList.get(0).getName());
+			b = deptAssessmentDeclarationService.updateById(deptAssessmentDeclaration);
+		}
+		if (b) {
+			return R.ok().data(b);
+		} else {
+			return R.error("添加复批领导失败!");
+		}
+	}
+
+	/**
 	 * 获取审批领导
 	 *
 	 * @param id 部门主键

+ 6 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/entity/DeptAssessmentDeclaration.java

@@ -66,5 +66,10 @@ public class DeptAssessmentDeclaration extends Model {
 	private String updateBy;
 	//备注
 	private String remark;
-
+	//复批人主键
+	private String seconderId;
+	//复批人编号
+	private String seconderNo;
+	//复批人名称
+	private String seconderName;
 }

+ 7 - 1
ims-service/ims-eval/src/main/resources/mappers/DeptAssessmentDeclarationMapper.xml

@@ -27,6 +27,9 @@
         <result column="update_time" property="updateTime" />
         <result column="update_by" property="updateBy" />
         <result column="remark" property="remark" />
+        <result column="seconder_id" property="seconderId" />
+        <result column="seconder_no" property="seconderNo" />
+        <result column="seconder_name" property="seconderName" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
@@ -53,7 +56,10 @@
                create_name,
                update_time,
                update_by,
-               remark
+               remark,
+               seconder_id,
+               seconder_no,
+               seconder_name
         from dept_assessment_declaration
     </sql>