| | |
| | | package com.gkhy.safePlatform.targetDuty.controller; |
| | | import java.util.*; |
| | | import java.sql.Timestamp; |
| | | |
| | | |
| | | import com.gkhy.safePlatform.targetDuty.utils.DateUtils; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.gkhy.safePlatform.commons.utils.BeanCopyUtils; |
| | | import com.gkhy.safePlatform.targetDuty.entity.ExamineItem; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetDutyfileInfo; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetExamine; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetMng; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.req.ExamineTemplateSaveOrUpdate; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.req.TargetDutyfileInfoQueryCriteria; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.req.TargetExamineSaveOrUpdate; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.ExamineTemplateDto; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.TargetExamineDivideDto; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.TargetExamineDto; |
| | | import com.gkhy.safePlatform.targetDuty.service.CommonService; |
| | | import com.gkhy.safePlatform.targetDuty.service.TargetExamineService; |
| | | import com.gkhy.safePlatform.targetDuty.service.TargetMngService; |
| | | import com.google.common.collect.Lists; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.commons.query.PageQuery; |
| | | import com.gkhy.safePlatform.commons.utils.PageUtils; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetExamine; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.req.TargetExamineQueryCriteria; |
| | | 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 java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (TargetExamine)表控制层 |
| | |
| | | @Resource |
| | | private TargetExamineService targetExamineService; |
| | | @Resource |
| | | private TargetMngService targetMngService; |
| | | |
| | | @Resource |
| | | private CommonService commonService; |
| | | |
| | | private TargetExamineBaseService targetExamineBaseService; |
| | | // /** |
| | | // * 通过主键查询单条数据 |
| | | // * |
| | |
| | | // } |
| | | |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param pageQuery 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @PostMapping(value = "/page/list") |
| | | public ResultVO selectAll(@RequestBody PageQuery<TargetExamineQueryCriteria> pageQuery){ |
| | | PageUtils.checkCheck(pageQuery); |
| | | return this.targetExamineService.queryAll(pageQuery); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | |
| | | */ |
| | | @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)); |
| | | } |
| | | |
| | | |
| | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | */ |
| | | @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.targetExamineService.removeByIds(idList); |
| | | this.targetExamineService.delete(ids); |
| | | return new ResultVO<>(ResultCodes.OK); |
| | | } |
| | | |
| | |
| | | // saveOrUpdate.setExamineList(examineList); |
| | | // System.out.println(JSONObject.toJSONString(saveOrUpdate)); |
| | | } |
| | | } |
| | | } |