| | |
| | | import com.vincent.rsf.server.common.domain.KeyValVo; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.manager.entity.StockStatistic; |
| | | import com.vincent.rsf.server.manager.enums.TaskType; |
| | | import com.vincent.rsf.server.manager.service.StockStatisticService; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<StockStatistic, BaseParam> pageParam = new PageParam<>(baseParam, StockStatistic.class); |
| | | QueryWrapper<StockStatistic> wrapper = pageParam.buildWrapper(true); |
| | | wrapper.select("id, day_time, COUNT( barcode ) `count`, SUM( anfme ) anfme, COUNT(IF (task_type = 1, 0, NULL)) in_anfme_count, COUNT(IF ( task_type = 101, 0, NULL)) out_anfme_count, SUM(CASE WHEN task_type = 1 THEN)"); |
| | | wrapper.groupBy("barcode, day_time"); |
| | | wrapper.select("id, day_time, COUNT( barcode ) `count`, " + |
| | | "SUM( anfme ) anfme," + |
| | | "COUNT(IF (task_type = 1, 0, NULL)) in_anfme_count, " + |
| | | "COUNT(IF ( task_type = 101, 0, NULL)) out_anfme_count, " + |
| | | "SUM( CASE WHEN task_type = 1 THEN anfme ELSE 0 END ) in_anfme," + |
| | | "SUM( CASE WHEN task_type = 101 THEN anfme ELSE 0 END ) out_anfme"); |
| | | wrapper.in("task_type", Arrays.asList(TaskType.TASK_TYPE_IN.type, TaskType.TASK_TYPE_OUT.type)).groupBy("day_time"); |
| | | return R.ok().add(stockStatisticService.page(pageParam, wrapper)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @PreAuthorize("hasAuthority('manager:stockStatistic:list')") |
| | | @PostMapping("/stockStatistic/list") |