zhangf
2024-05-08 0414ddb0b2b3a7199ae6181a770f97ac140dbd73
goal-manage/goal-manage-service/src/main/java/com/gkhy/safePlatform/targetDuty/controller/ExamineTemplateController.java
@@ -7,6 +7,7 @@
import com.gkhy.safePlatform.commons.utils.PageUtils;
import com.gkhy.safePlatform.commons.vo.ResultVO;
import com.gkhy.safePlatform.targetDuty.entity.ExamineItem;
import com.gkhy.safePlatform.targetDuty.entity.ExamineTemplate;
import com.gkhy.safePlatform.targetDuty.model.dto.req.ExamineTemplateQueryCriteria;
import com.gkhy.safePlatform.targetDuty.model.dto.req.ExamineTemplateSaveOrUpdate;
import com.gkhy.safePlatform.targetDuty.service.ExamineTemplateService;
@@ -17,6 +18,7 @@
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -67,16 +69,7 @@
     */
    @PostMapping(value = "/addOrUpdate")
    public ResultVO update(Authentication authentication, @RequestBody ExamineTemplateSaveOrUpdate examineTemplateSaveOrUpdate) {
        if(!StringUtils.hasText(examineTemplateSaveOrUpdate.getTitle())){
            return new ResultVO<>(ResultCodes.CLIENT_PARAM_ILLEGAL,"缺少title");
        }
        // 获取当前用户
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        //设置设定人ID和设定人部门ID
        examineTemplateSaveOrUpdate.setSetPersonDepartmentId(currentUser.getDepId());
        examineTemplateSaveOrUpdate.setSetPersonId(currentUser.getUid());
        examineTemplateService.addOrUpdate(examineTemplateSaveOrUpdate);
        examineTemplateService.addOrUpdate(examineTemplateSaveOrUpdate,authentication);
        return new ResultVO<>(ResultCodes.OK);
    }
@@ -88,11 +81,7 @@
     */
    @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.examineTemplateService.removeByIds(idList);
        this.examineTemplateService.delete(ids);
        return new ResultVO<>(ResultCodes.OK);
    }