| | |
| | | package com.zy.asrs.wms.asrs.controller.statistics; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.zy.asrs.framework.common.R; |
| | | import com.zy.asrs.wms.asrs.entity.TaskDetlFieldLog; |
| | | import com.zy.asrs.wms.asrs.entity.statistics.ViewWorkOut; |
| | | import com.zy.asrs.wms.asrs.mapper.statistics.ViewWorkOutMapper; |
| | | import com.zy.asrs.wms.asrs.service.TaskDetlFieldLogService; |
| | | import com.zy.asrs.wms.common.annotation.CacheData; |
| | | import com.zy.asrs.wms.common.domain.BaseParam; |
| | | import com.zy.asrs.wms.common.domain.PageParam; |
| | | import com.zy.asrs.wms.system.controller.BaseController; |
| | | import com.zy.asrs.wms.utils.ExcelUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @RequestMapping("/api") |
| | | public class ViewWorkOutController extends BaseController { |
| | | |
| | | @Autowired |
| | | private ViewWorkOutMapper viewWorkOutMapper; |
| | | @Autowired |
| | | private TaskDetlFieldLogService taskDetlFieldLogService; |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:viewWorkOut:list')") |
| | | @PostMapping("/viewWorkOut/page") |
| | | @CacheData(tableName = {"view_work_out", "man_task_log", "man_task_detl_log", "man_task_detl_field_log"}) |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<ViewWorkOut, BaseParam> pageParam = new PageParam<>(baseParam, ViewWorkOut.class); |
| | | QueryWrapper<ViewWorkOut> queryWrapper = pageParam.buildWrapper(true); |
| | | PageParam<ViewWorkOut, BaseParam> page = viewWorkOutMapper.selectPage(pageParam, queryWrapper); |
| | | List<ViewWorkOut> records = page.getRecords(); |
| | | for (ViewWorkOut record : records) { |
| | | List<TaskDetlFieldLog> list = taskDetlFieldLogService.list(new LambdaQueryWrapper<TaskDetlFieldLog>().eq(TaskDetlFieldLog::getDetlId, record.getId())); |
| | | record.syncField(list); |
| | | } |
| | | return R.ok().add(page); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:viewWorkOut:list')") |
| | | @PostMapping("/viewWorkOut/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<ViewWorkOut, BaseParam> pageParam = new PageParam<>(baseParam, ViewWorkOut.class); |
| | | QueryWrapper<ViewWorkOut> queryWrapper = pageParam.buildWrapper(true); |
| | | ExcelUtil.build(ExcelUtil.create(viewWorkOutMapper.selectList(queryWrapper), ViewWorkOut.class), response); |
| | | } |
| | | |
| | | } |
| | | package com.zy.asrs.wms.asrs.controller.statistics;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
| | | import com.zy.asrs.framework.common.R;
|
| | | import com.zy.asrs.wms.asrs.entity.TaskDetlFieldLog;
|
| | | import com.zy.asrs.wms.asrs.entity.statistics.ViewWorkOut;
|
| | | import com.zy.asrs.wms.asrs.mapper.statistics.ViewWorkOutMapper;
|
| | | import com.zy.asrs.wms.asrs.service.TaskDetlFieldLogService;
|
| | | import com.zy.asrs.wms.common.annotation.CacheData;
|
| | | import com.zy.asrs.wms.common.domain.BaseParam;
|
| | | import com.zy.asrs.wms.common.domain.PageParam;
|
| | | import com.zy.asrs.wms.system.controller.BaseController;
|
| | | import com.zy.asrs.wms.utils.ExcelUtil;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.web.bind.annotation.PostMapping;
|
| | | import org.springframework.web.bind.annotation.RequestBody;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | |
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | @RestController
|
| | | @RequestMapping("/api")
|
| | | public class ViewWorkOutController extends BaseController {
|
| | |
|
| | | @Autowired
|
| | | private ViewWorkOutMapper viewWorkOutMapper;
|
| | | @Autowired
|
| | | private TaskDetlFieldLogService taskDetlFieldLogService;
|
| | |
|
| | | @PreAuthorize("hasAuthority('asrs:viewWorkOut:list')")
|
| | | @PostMapping("/viewWorkOut/page")
|
| | | @CacheData(tableName = {"view_work_out", "man_task_log", "man_task_detl_log", "man_task_detl_field_log"})
|
| | | public R page(@RequestBody Map<String, Object> map) {
|
| | | BaseParam baseParam = buildParam(map, BaseParam.class);
|
| | | PageParam<ViewWorkOut, BaseParam> pageParam = new PageParam<>(baseParam, ViewWorkOut.class);
|
| | | QueryWrapper<ViewWorkOut> queryWrapper = pageParam.buildWrapper(true);
|
| | | PageParam<ViewWorkOut, BaseParam> page = viewWorkOutMapper.selectPage(pageParam, queryWrapper);
|
| | | List<ViewWorkOut> records = page.getRecords();
|
| | | for (ViewWorkOut record : records) {
|
| | | List<TaskDetlFieldLog> list = taskDetlFieldLogService.list(new LambdaQueryWrapper<TaskDetlFieldLog>().eq(TaskDetlFieldLog::getDetlId, record.getId()));
|
| | | record.syncField(list);
|
| | | }
|
| | | return R.ok().add(page);
|
| | | }
|
| | |
|
| | | @PreAuthorize("hasAuthority('asrs:viewWorkOut:list')")
|
| | | @PostMapping("/viewWorkOut/export")
|
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception {
|
| | | BaseParam baseParam = buildParam(map, BaseParam.class);
|
| | | PageParam<ViewWorkOut, BaseParam> pageParam = new PageParam<>(baseParam, ViewWorkOut.class);
|
| | | QueryWrapper<ViewWorkOut> queryWrapper = pageParam.buildWrapper(true);
|
| | | ExcelUtil.build(ExcelUtil.create(viewWorkOutMapper.selectList(queryWrapper), ViewWorkOut.class), response);
|
| | | }
|
| | |
|
| | | }
|