Преглед изворни кода

部门考评评级数据权限;根据部门序号计划、考评、评级、申报修改排序方式

hlf пре 1 година
родитељ
комит
7372fad772

+ 2 - 28
ims-service/ims-eval/src/main/java/com/ims/eval/controller/DepartmentAllocationController.java

@@ -13,8 +13,6 @@ import com.ims.eval.entity.dto.request.UserDTO;
 import com.ims.eval.entity.dto.result.R;
 import com.ims.eval.service.IEvaluationDeptService;
 import com.ims.eval.service.IUserService;
-import com.ims.eval.service.custom.PostService;
-import com.ims.eval.service.custom.PostUserService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -39,12 +37,6 @@ public class DepartmentAllocationController {
 	private IEvaluationDeptService evaluationDeptService;
 
 	@Autowired
-	private PostService postService;
-
-	@Autowired
-	private PostUserService postUserService;
-
-	@Autowired
 	private HttpServletRequest request;
 
 	@Autowired
@@ -72,6 +64,7 @@ public class DepartmentAllocationController {
 		if (StringUtils.isNotEmpty(chargePersonName)) {
 			qw.lambda().like(EvaluationDept::getChargePersonName, chargePersonName);
 		}
+		qw.lambda().orderByAsc(EvaluationDept::getSerialNumber);
 		Page<EvaluationDept> page = new Page<>(pageNum, pageSize);
 		IPage<EvaluationDept> list = evaluationDeptService.page(page, qw);
 		return R.ok().data(list);
@@ -86,6 +79,7 @@ public class DepartmentAllocationController {
 	public R listAll() {
 		QueryWrapper<EvaluationDept> qw = new QueryWrapper<>();
 		qw.lambda().eq(EvaluationDept::getJxjgkhsbType, "1");
+		qw.lambda().orderByAsc(EvaluationDept::getSerialNumber);
 		List<EvaluationDept> list = evaluationDeptService.list(qw);
 		return R.ok().data(list);
 	}
@@ -128,26 +122,6 @@ public class DepartmentAllocationController {
 	 */
 	@GetMapping(value = "/getDepartmentLeader/{id}")
 	public R getDepartmentLeader(@PathVariable String id) {
-		/*List<PostUserDTO> list = new ArrayList<>();
-		Object postList = postService.getPostList(1, 500, id, request);
-		if (null != postList) {
-			JSONObject postJsonArr = (JSONObject) postList;
-			JSONArray postArray = JSONUtil.parseArray(postJsonArr.get("records"));
-			List<PostDTO> postArrList = JSONUtil.toList(postArray, PostDTO.class);
-			for (PostDTO post : postArrList) {
-				if (post.getName().contains("主任")) {
-					Object postPersonnelList = postUserService.getPostUserList(1, 500, post.getId(), request);
-					if (null != postPersonnelList) {
-						JSONObject postPersonnelJsonArr = (JSONObject) postPersonnelList;
-						JSONArray postPersonnelArray = JSONUtil.parseArray(postPersonnelJsonArr.get("records"));
-						List<PostUserDTO> userArrList = JSONUtil.toList(postPersonnelArray, PostUserDTO.class);
-						if (userArrList.size() > 0) {
-							list.addAll(userArrList);
-						}
-					}
-				}
-			}
-		}*/
 		JSONObject jsonArr = userService.pageList(1, 500, id, "", "", "", "", "", request);
 		JSONObject jsonArr1 = (JSONObject) jsonArr.get("data");
 		JSONArray array = JSONUtil.parseArray(jsonArr1.get("records"));

+ 3 - 2
ims-service/ims-eval/src/main/java/com/ims/eval/controller/DepartmentPerformanceAppraisalRatingController.java

@@ -65,9 +65,10 @@ public class DepartmentPerformanceAppraisalRatingController {
 	 * @return 结果
 	 */
 	@GetMapping(value = "/listAll")
-	public R listAll(@RequestParam(value = "deptName", required = false) String deptName,
+	public R listAll(@RequestParam(value = "deptId") String deptId,
+					 @RequestParam(value = "deptName", required = false) String deptName,
 					 @RequestParam(value = "annual", required = false) String annual) {
-		List<EvaluationDeptRating> list = evaluationDeptRatingService.list(deptName, annual);
+		List<EvaluationDeptRating> list = evaluationDeptRatingService.list(deptId, deptName, annual);
 		return R.ok().data(list);
 	}
 

+ 1 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/controller/DepartmentalPerformanceIndicatorAssessmentController.java

@@ -97,6 +97,7 @@ public class DepartmentalPerformanceIndicatorAssessmentController {
 		List<DeptDTO> deptList = new ArrayList<>();
 		QueryWrapper<EvaluationDept> qw = new QueryWrapper<>();
 		qw.lambda().eq(EvaluationDept::getYjzbjhType, "1");
+		qw.lambda().orderByAsc(EvaluationDept::getSerialNumber);
 		List<EvaluationDept> evaluationDeptList = evaluationDeptService.list(qw);
 		for (EvaluationDept evaluationDept : evaluationDeptList) {
 			DeptDTO dept = new DeptDTO();

+ 2 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/controller/DepartmentalPerformanceIndicatorPlanController.java

@@ -257,6 +257,7 @@ public class DepartmentalPerformanceIndicatorPlanController {
 		Map<String, String> map = new HashMap<>();
 		QueryWrapper<EvaluationDept> qw = new QueryWrapper<>();
 		qw.lambda().eq(EvaluationDept::getYjzbjhType, "1");
+		qw.lambda().orderByAsc(EvaluationDept::getSerialNumber);
 		List<EvaluationDept> evaluationDeptList = evaluationDeptService.list(qw);
 		for (EvaluationDept evaluationDept : evaluationDeptList) {
 			if ("23031009".equals(deptId)) {//组织人事部
@@ -354,6 +355,7 @@ public class DepartmentalPerformanceIndicatorPlanController {
 		List<DeptDTO> deptList = new ArrayList<>();
 		QueryWrapper<EvaluationDept> qw = new QueryWrapper<>();
 		qw.lambda().eq(EvaluationDept::getYjzbjhType, "1");
+		qw.lambda().orderByAsc(EvaluationDept::getSerialNumber);
 		List<EvaluationDept> evaluationDeptList = evaluationDeptService.list(qw);
 		for (EvaluationDept evaluationDept : evaluationDeptList) {
 			DeptDTO dept = new DeptDTO();

+ 7 - 5
ims-service/ims-eval/src/main/java/com/ims/eval/controller/DeptAssessmentDeclarationController.java

@@ -31,10 +31,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.InputStream;
 import java.net.URLEncoder;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -376,7 +373,6 @@ public class DeptAssessmentDeclarationController {
 		DeptAssessmentDeclaration deptAssessmentDeclaration = deptAssessmentDeclarationService.getById(id);
 		String departmentName = deptAssessmentDeclaration.getDeptName();
 		String month = deptAssessmentDeclaration.getDeclarationMonth();
-		//String level = deptAssessmentDeclaration.getDeclarationLevel();
 		String level = deptAssessmentDeclaration.getRatingGrade();
 		String leader = deptAssessmentDeclaration.getDeptLeaderName();
 		String declarationReason = deptAssessmentDeclaration.getDeclarationReason();
@@ -401,6 +397,7 @@ public class DeptAssessmentDeclarationController {
 		}
 		List<DeptAssessmentDeclaration> deptAssessmentDeclarationList = deptAssessmentDeclarationService.list(qw);
 		for (DeptAssessmentDeclaration deptAssessmentDeclaration : deptAssessmentDeclarationList) {
+			EvaluationDept evaluationDept = evaluationDeptService.getById(deptAssessmentDeclaration.getDeptId());
 			List<DeptAssessmentDeclarationContent> deptAssessmentDeclarationContentList = deptAssessmentDeclarationContentService.detailsList(deptAssessmentDeclaration.getId());
 			for (DeptAssessmentDeclarationContent deptAssessmentDeclarationContent : deptAssessmentDeclarationContentList) {
 				SummaryInformationDTO summaryInformationDTO = new SummaryInformationDTO();
@@ -409,6 +406,9 @@ public class DeptAssessmentDeclarationController {
 				summaryInformationDTO.setSuggestedValue(deptAssessmentDeclarationContent.getSuggestedValue());
 				summaryInformationDTO.setReportingDepartment(deptAssessmentDeclaration.getDeptName());
 				summaryInformationDTO.setDeclarationLevel(deptAssessmentDeclaration.getRatingGrade());
+				if (null != evaluationDept) {
+					summaryInformationDTO.setSerialNumber(evaluationDept.getSerialNumber());
+				}
 				summaryInformationDTOList.add(summaryInformationDTO);
 			}
 		}
@@ -420,6 +420,7 @@ public class DeptAssessmentDeclarationController {
 			}
 			list.addAll(value);
 		});
+		list.stream().sorted(Comparator.comparing(SummaryInformationDTO::getSerialNumber,Comparator.nullsLast(Integer::compareTo))).collect(Collectors.toList());
 		return R.ok().data(list);
 	}
 
@@ -467,6 +468,7 @@ public class DeptAssessmentDeclarationController {
 			}
 			list.addAll(value);
 		});
+		list.stream().sorted(Comparator.comparing(SummaryInformationDTO::getSerialNumber,Comparator.nullsLast(Integer::compareTo))).collect(Collectors.toList());
 		ExcelUtils.createCollectExcel(list, annual, month, response.getOutputStream());
 	}
 

+ 4 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/dao/EvaluationDeptRatingMapper.java

@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ims.eval.entity.EvaluationDeptRating;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 /**
  * @author hlf
  * @date 2023/4/28 16:18
@@ -14,4 +16,6 @@ import org.apache.ibatis.annotations.Param;
 public interface EvaluationDeptRatingMapper extends BaseMapper<EvaluationDeptRating> {
 
 	IPage<EvaluationDeptRating> selectListPage(Page<EvaluationDeptRating> page, @Param("deptId") String deptId, @Param("deptName") String deptName, @Param("annual") String annual);
+
+	List<EvaluationDeptRating> list(@Param("deptId") String deptId, @Param("deptName") String deptName, @Param("annual") String annual);
 }

+ 3 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/entity/EvaluationDept.java

@@ -18,6 +18,9 @@ public class EvaluationDept extends Model {
 	//主键
 	private String id;
 
+	//序号
+	private Integer serialNumber;
+
 	//父级主键
 	private String parentId;
 

+ 2 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/entity/dto/request/SummaryInformationDTO.java

@@ -23,4 +23,6 @@ public class SummaryInformationDTO {
 	//申报级别
 	private String declarationLevel;
 
+	private Integer serialNumber;
+
 }

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

@@ -17,5 +17,5 @@ public interface IEvaluationDeptRatingService extends IService<EvaluationDeptRat
 
 	boolean saveOrUpdate(EvaluationDeptRating evaluationDeptRating);
 
-	List<EvaluationDeptRating> list(String deptName, String annual);
+	List<EvaluationDeptRating> list(String deptId, String deptName, String annual);
 }

+ 4 - 8
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluationDeptRatingServiceImpl.java

@@ -130,14 +130,10 @@ public class EvaluationDeptRatingServiceImpl extends ServiceImpl<EvaluationDeptR
 	}
 
 	@Override
-	public List<EvaluationDeptRating> list(String deptName, String annual) {
-		QueryWrapper<EvaluationDeptRating> qw = new QueryWrapper<>();
-		if (StringUtils.isNotEmpty(deptName)) {
-			qw.lambda().like(EvaluationDeptRating::getDeptName, deptName);
-		}
-		if (StringUtils.isNotEmpty(annual)) {
-			qw.lambda().eq(EvaluationDeptRating::getAnnual, annual);
+	public List<EvaluationDeptRating> list(String deptId, String deptName, String annual) {
+		if ("23031009".equals(deptId)) {//组织人事部
+			deptId = "";
 		}
-		return super.list(qw);
+		return baseMapper.list(deptId, deptName, annual);
 	}
 }

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

@@ -56,25 +56,26 @@
     </sql>
 
     <select id="selectListPage" resultType="com.ims.eval.entity.DeptAssessmentDeclaration">
-        <include refid="selectDeptAssessmentDeclarationVo"/>
+        select dad.* from dept_assessment_declaration dad
+        left join evaluation_dept ed on ed.dept_id = dad.dept_id
         <where>
             <if test="deptId != null and deptId != ''">
-                AND dept_id = #{deptId}
+                AND dad.dept_id = #{deptId}
             </if>
             <if test="orderNumber != null and orderNumber != ''">
-                AND order_number like CONCAT('%',#{orderNumber},'%')
+                AND dad.order_number like CONCAT('%',#{orderNumber},'%')
             </if>
             <if test="deptName != null and deptName != ''">
-                AND dept_name like CONCAT('%',#{deptName},'%')
+                AND dad.dept_name like CONCAT('%',#{deptName},'%')
             </if>
             <if test="annual != null and annual != ''">
-                AND annual = #{annual}
+                AND dad.annual = #{annual}
             </if>
             <if test="declarationMonth != null and declarationMonth != ''">
-                AND declaration_month = #{declarationMonth}
+                AND dad.declaration_month = #{declarationMonth}
             </if>
         </where>
-        order by create_time desc
+        order by ed.serial_number asc
     </select>
 
 </mapper>

+ 5 - 4
ims-service/ims-eval/src/main/resources/mappers/EvaluationDeptBusinessContentMapper.xml

@@ -52,16 +52,17 @@
     </sql>
 
     <select id="detailsList" resultType="com.ims.eval.entity.EvaluationDeptBusinessContent">
-        <include refid="selectEvaluationDeptBusinessContentVo"/>
+        select edbc.* from evaluation_dept_business_content edbc
+        left join evaluation_dept ed on ed.dept_id = edbc.dept_id
         <where>
             <if test="deptId != null and deptId != ''">
-                AND dept_id = #{deptId}
+                AND edbc.dept_id = #{deptId}
             </if>
             <if test="businessPlanId != null and businessPlanId != ''">
-                AND business_plan_id = #{businessPlanId}
+                AND edbc.business_plan_id = #{businessPlanId}
             </if>
         </where>
-        order by dept_name asc, serial_number asc
+        order by ed.serial_number asc, edbc.serial_number asc
     </select>
 
     <select id="selectEvaluationDeptBusinessContentListByBusinessPlanId" resultType="com.ims.eval.entity.EvaluationDeptBusinessContent">

+ 23 - 5
ims-service/ims-eval/src/main/resources/mappers/EvaluationDeptRatingMapper.xml

@@ -82,19 +82,37 @@
     </sql>
 
     <select id="selectListPage" resultType="com.ims.eval.entity.EvaluationDeptRating">
-        <include refid="selectEvaluationDeptPlanContentVo"/>
+        select edr.* from evaluation_dept_rating edr
+        left join evaluation_dept ed on ed.dept_id = edr.dept_id
         <where>
             <if test="deptId != null and deptId != ''">
-                AND dept_id = #{deptId}
+                AND edr.dept_id = #{deptId}
             </if>
             <if test="deptName != null and deptName != ''">
-                AND dept_name like CONCAT('%',#{deptName},'%')
+                AND edr.dept_name like CONCAT('%',#{deptName},'%')
             </if>
             <if test="annual != null and annual != ''">
-                AND annual = #{annual}
+                AND edr.annual = #{annual}
             </if>
         </where>
-        order by create_time desc
+        order by ed.serial_number asc
+    </select>
+
+    <select id="list" resultType="com.ims.eval.entity.EvaluationDeptRating">
+        select edr.* from evaluation_dept_rating edr
+        left join evaluation_dept ed on ed.dept_id = edr.dept_id
+        <where>
+            <if test="deptId != null and deptId != ''">
+                AND edr.dept_id = #{deptId}
+            </if>
+            <if test="deptName != null and deptName != ''">
+                AND edr.dept_name like CONCAT('%',#{deptName},'%')
+            </if>
+            <if test="annual != null and annual != ''">
+                AND edr.annual = #{annual}
+            </if>
+        </where>
+        order by ed.serial_number asc
     </select>
 
 </mapper>