songhuangfeng123
2022-09-08 bfb4c1e1d4e3f99f74a51ef5b67531f9d91d0dde
goal-manage/goal-manage-service/src/main/java/com/gkhy/safePlatform/targetDuty/controller/TargetExamineController.java
@@ -10,6 +10,7 @@
import com.gkhy.safePlatform.targetDuty.service.CommonService;
import com.gkhy.safePlatform.targetDuty.service.TargetExamineService;
import com.gkhy.safePlatform.targetDuty.service.TargetMngService;
import com.gkhy.safePlatform.targetDuty.service.baseService.TargetExamineBaseService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -35,11 +36,7 @@
    @Resource
    private TargetExamineService targetExamineService;
    @Resource
    private TargetMngService targetMngService;
    @Resource
    private CommonService commonService;
    private TargetExamineBaseService targetExamineBaseService;
//    /**
//     * 通过主键查询单条数据
//     *
@@ -94,7 +91,7 @@
     */
    @GetMapping(value = "/selectOne/{id}")
    public ResultVO selectOne(@PathVariable Serializable id) {
        return new ResultVO<>(ResultCodes.OK,this.targetExamineService.getById(id));
        return new ResultVO<>(ResultCodes.OK,this.targetExamineBaseService.getById(id));
    }
@@ -108,9 +105,9 @@
    public ResultVO update(@RequestBody TargetExamine infoDto) {
        infoDto.setExamineDate(new Timestamp(new Date().getTime()));
        if (infoDto.getId() == null) {
            return new ResultVO<>(ResultCodes.OK,targetExamineService.save(infoDto));
            return new ResultVO<>(ResultCodes.OK,targetExamineBaseService.save(infoDto));
        } else {
            targetExamineService.update(infoDto,new UpdateWrapper<TargetExamine>().eq("id",infoDto.getId()));
            targetExamineBaseService.update(infoDto,new UpdateWrapper<TargetExamine>().eq("id",infoDto.getId()));
            return new ResultVO<>(ResultCodes.OK);
        }
    }
@@ -123,19 +120,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);
        List<TargetExamine> delList = new ArrayList<>();
        idList.forEach(f->{
            TargetExamine info = new TargetExamine();
            info.setDelFlag(1);
            info.setId(f);
            delList.add(info);
        });
        this.targetExamineService.updateBatchById(delList);
        this.targetExamineService.delete(ids);
        return new ResultVO<>(ResultCodes.OK);
    }