Преглед на файлове

绩效结果考核申报修改

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

+ 2 - 6
ims-service/ims-eval/src/main/java/com/ims/eval/controller/DeptAssessmentDeclarationController.java

@@ -203,12 +203,8 @@ public class DeptAssessmentDeclarationController {
 	public R deleteAll(@PathVariable("ids") String ids) {
 		try {
 			String[] strings = ids.split(",");
-			boolean b = deptAssessmentDeclarationService.removeByIds(Arrays.asList(strings));
-			if (b) {
-				return R.ok().data(b);
-			} else {
-				return R.error("删除失败!");
-			}
+			String msg = deptAssessmentDeclarationService.removeByIds(Arrays.asList(strings));
+			return R.ok().message(msg);
 		} catch (CustomException e) {
 			return R.customError(e.getMessage()).data("失败!");
 		}

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

@@ -1,6 +1,5 @@
 package com.ims.eval.service;
 
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ims.eval.entity.DeptAssessmentDeclaration;
@@ -19,7 +18,7 @@ public interface IDeptAssessmentDeclarationService extends IService<DeptAssessme
 
 	boolean save(DeptAssessmentDeclaration deptAssessmentDeclaration, HttpServletRequest request);
 
-	boolean removeByIds(List<String> ids);
+	String removeByIds(List<String> ids);
 
 	boolean editState(String id, String state, String instId, String destination);
 

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

@@ -77,7 +77,7 @@ public class DeptAssessmentDeclarationServiceImpl extends ServiceImpl<DeptAssess
 
 		String code = request.getHeader("code");
 		String auth = request.getHeader("Blade-Auth");
-		JSONObject json = userService.getSysUser(code,auth);
+		JSONObject json = userService.getSysUser(code, auth);
 		MyuserResDTO user = JSONObject.parseObject(json.getJSONObject("data").toJSONString(), MyuserResDTO.class);
 
 		user.getDeptOrg().getType();
@@ -190,16 +190,21 @@ public class DeptAssessmentDeclarationServiceImpl extends ServiceImpl<DeptAssess
 	}
 
 	@Override
-	public boolean removeByIds(List<String> ids) {
+	public String removeByIds(List<String> ids) {
+		int successfulCount = 0;
+		int loseCount = 0;
 		for (String id : ids) {
 			DeptAssessmentDeclaration deptAssessmentDeclaration = super.getById(id);
 			if ("流程未启动".equals(deptAssessmentDeclaration.getStage())) {
 				deptAssessmentDeclarationContentService.removeByAssessmentDeclarationId(id);
 				deptAssessmentDeclarationCompleteService.removeByAssessmentDeclarationId(id);
 				super.removeById(id);
+				successfulCount++;
+			} else {
+				loseCount++;
 			}
 		}
-		return true;
+		return "成功删除" + successfulCount + "条,删除失败" + loseCount + "条";
 	}
 
 	@Override