From 2595c1008bfe2d0d5e01f3b6b035faa7ccb8a2b8 Mon Sep 17 00:00:00 2001
From: songhuangfeng123 <shf18767906695@163.com>
Date: Fri, 19 Aug 2022 17:46:03 +0800
Subject: [PATCH] 目标考核
---
goal-manage/goal-manage-service/src/main/java/com/gkhy/safePlatform/targetDuty/controller/RewardPunishmentDetailController.java | 42 ++++++++++++++++++++++++------------------
1 files changed, 24 insertions(+), 18 deletions(-)
diff --git a/goal-manage/goal-manage-service/src/main/java/com/gkhy/safePlatform/targetDuty/controller/RewardPunishmentDetailController.java b/goal-manage/goal-manage-service/src/main/java/com/gkhy/safePlatform/targetDuty/controller/RewardPunishmentDetailController.java
index ab5bb18..1942653 100644
--- a/goal-manage/goal-manage-service/src/main/java/com/gkhy/safePlatform/targetDuty/controller/RewardPunishmentDetailController.java
+++ b/goal-manage/goal-manage-service/src/main/java/com/gkhy/safePlatform/targetDuty/controller/RewardPunishmentDetailController.java
@@ -7,7 +7,9 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gkhy.safePlatform.commons.utils.BeanCopyUtils;
import com.gkhy.safePlatform.targetDuty.entity.RewardPunishmentDetail;
+import com.gkhy.safePlatform.targetDuty.model.dto.resp.ExamineMngDto;
import com.gkhy.safePlatform.targetDuty.model.dto.resp.ExamineTemplateDto;
+import com.gkhy.safePlatform.targetDuty.model.dto.resp.RewardPunishmentDetailDto;
import com.gkhy.safePlatform.targetDuty.model.dto.resp.RewardPunishmentDetailExcel;
import com.gkhy.safePlatform.targetDuty.service.RewardPunishmentDetailService;
import com.gkhy.safePlatform.targetDuty.utils.DateUtils;
@@ -61,7 +63,7 @@
PageUtils.checkCheck(pageQuery);
return this.rewardPunishmentDetailService.queryAll(pageQuery);
}
-
+
/**
* 通过主键查询单条数据
@@ -71,7 +73,8 @@
*/
@GetMapping(value = "/selectOne/{id}")
public ResultVO selectOne(@PathVariable Serializable id) {
- return new ResultVO<>(ResultCodes.OK,this.rewardPunishmentDetailService.getById(id));
+ RewardPunishmentDetailDto mngDto = this.rewardPunishmentDetailService.selectOne(id);
+ return new ResultVO<>(ResultCodes.OK,mngDto);
}
/**
@@ -89,19 +92,20 @@
return new ResultVO<>(ResultCodes.CLIENT_PARAM_ILLEGAL,"缺少rewardPunishmentStandardId");
}
- List<Long> pIdList = Arrays.stream(rewardPunishmentDetail.getPersonId().split(",")).map(s-> Long.parseLong(s.trim()))
- .collect(Collectors.toList());
-
- List<RewardPunishmentDetail> list = new ArrayList<>();
- pIdList.forEach(f->{
- RewardPunishmentDetail new1 = BeanCopyUtils.copyBean(rewardPunishmentDetail, RewardPunishmentDetail.class);
- new1.setPersonId(f+"");
- list.add(new1);
- });
+// List<Long> pIdList = Arrays.stream(rewardPunishmentDetail.getPersonId().split(",")).map(s-> Long.parseLong(s.trim()))
+// .collect(Collectors.toList());
+//
+// List<RewardPunishmentDetail> list = new ArrayList<>();
+// pIdList.forEach(f->{
+// RewardPunishmentDetail new1 = BeanCopyUtils.copyBean(rewardPunishmentDetail, RewardPunishmentDetail.class);
+// new1.setPersonId(f+"");
+// list.add(new1);
+// });
if (rewardPunishmentDetail.getId() == null) {
- return new ResultVO<>(ResultCodes.OK,rewardPunishmentDetailService.saveBatch(list));
+ rewardPunishmentDetail.setCreateTime(new Date());
+ return new ResultVO<>(ResultCodes.OK,rewardPunishmentDetailService.save(rewardPunishmentDetail));
} else {
- rewardPunishmentDetailService.updateBatchById(list);
+ rewardPunishmentDetailService.updateById(rewardPunishmentDetail);
return new ResultVO<>(ResultCodes.OK);
}
}
@@ -112,10 +116,12 @@
* @param ids 主键结合
* @return 删除结果
*/
- @GetMapping(value = "/delete")
- public ResultVO delete(String ids) {
- List<String> idList = Arrays.stream(ids.split(","))
- .collect(Collectors.toList());
+ @RequestMapping(value = "/delete",method = RequestMethod.POST)
+ public ResultVO delete(@RequestBody Long[] ids) {
+ if(ids == null){
+ return new ResultVO<>(ResultCodes.CLIENT_PARAM_ILLEGAL);
+ }
+ List<Long> idList = Arrays.asList(ids);
this.rewardPunishmentDetailService.removeByIds(idList);
return new ResultVO<>(ResultCodes.OK);
}
@@ -148,4 +154,4 @@
response.getOutputStream().close();
}
-}
+}
\ No newline at end of file
--
Gitblit v1.9.2