| | |
| | | package com.gkhy.safePlatform.targetDuty.controller; |
| | | import java.util.Date; |
| | | |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.util.*; |
| | | |
| | | |
| | | 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.TargetDutySummary; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetMng; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.TargetDutySummaryExcel; |
| | | import com.gkhy.safePlatform.targetDuty.service.TargetDutySummaryService; |
| | | import com.gkhy.safePlatform.targetDuty.service.baseService.TargetDutySummaryBaseService; |
| | | import com.gkhy.safePlatform.targetDuty.utils.DateUtils; |
| | | import com.gkhy.safePlatform.targetDuty.utils.poihelper.ExcelUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.gkhy.safePlatform.commons.query.PageQuery; |
| | | import com.gkhy.safePlatform.commons.utils.PageUtils; |
| | |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.req.TargetDutySummaryQueryCriteria; |
| | | |
| | | import java.sql.Timestamp; |
| | | import java.util.Arrays; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (TargetDutySummary)表控制层 |
| | |
| | | @Resource |
| | | private TargetDutySummaryService targetDutySummaryService; |
| | | |
| | | @Resource |
| | | private TargetDutySummaryBaseService targetDutySummaryBaseService; |
| | | |
| | | @Autowired |
| | | public HttpServletRequest request; |
| | | |
| | | @Autowired |
| | | public HttpServletResponse response; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | |
| | | */ |
| | | @PostMapping(value = "/page/list") |
| | | public ResultVO selectAll(@RequestBody PageQuery<TargetDutySummaryQueryCriteria> pageQuery){ |
| | | PageUtils.checkCheck(pageQuery.getPageIndex(), pageQuery.getPageSize()); |
| | | PageUtils.checkCheck(pageQuery); |
| | | return this.targetDutySummaryService.queryAll(pageQuery); |
| | | } |
| | | |
| | |
| | | */ |
| | | @GetMapping(value = "/selectOne/{id}") |
| | | public ResultVO selectOne(@PathVariable Serializable id) { |
| | | return new ResultVO<>(ResultCodes.OK,this.targetDutySummaryService.getById(id)); |
| | | return new ResultVO<>(ResultCodes.OK,this.targetDutySummaryBaseService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @PostMapping(value = "/addOrUpdate") |
| | | public ResultVO update(@RequestBody TargetDutySummary targetDutySummary) { |
| | | if (targetDutySummary.getId() == null) { |
| | | return new ResultVO<>(ResultCodes.OK,targetDutySummaryService.save(targetDutySummary)); |
| | | return new ResultVO<>(ResultCodes.OK,targetDutySummaryBaseService.save(targetDutySummary)); |
| | | } else { |
| | | targetDutySummaryService.update(targetDutySummary,new UpdateWrapper<TargetDutySummary>().eq("id",targetDutySummary.getId())); |
| | | targetDutySummaryBaseService.update(targetDutySummary,new UpdateWrapper<TargetDutySummary>().eq("id",targetDutySummary.getId())); |
| | | return new ResultVO<>(ResultCodes.OK); |
| | | } |
| | | } |
| | |
| | | * @param ids 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @GetMapping(value = "/delete") |
| | | public ResultVO delete(String ids) { |
| | | List<String> idList = Arrays.stream(ids.split(",")) |
| | | .collect(Collectors.toList()); |
| | | this.targetDutySummaryService.removeByIds(idList); |
| | | @RequestMapping(value = "/delete",method = RequestMethod.POST) |
| | | public ResultVO delete(@RequestBody Long[] ids) { |
| | | this.targetDutySummaryService.delete(ids); |
| | | return new ResultVO<>(ResultCodes.OK); |
| | | } |
| | | |
| | | /** |
| | | * 导出一览数据 |
| | | * |
| | | */ |
| | | @GetMapping(value = "/exportData") |
| | | public void exportData(TargetDutySummaryQueryCriteria queryCriteria) throws IOException { |
| | | targetDutySummaryService.exportData(queryCriteria); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | |
| | | mng.setExamineResult(1); |
| | | |
| | | mng.setYiYue("1"); |
| | | mng.setFebruary("2"); |
| | | mng.setErYue("3"); |
| | | mng.setSanYue("4"); |
| | | mng.setSiYue("5"); |