TvStatisticController.java
5.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
package com.huaheng.api.tv.controller;
import java.util.Collections;
import java.util.List;
import javax.annotation.Resource;
import com.huaheng.api.tv.domain.TvStatisticBean;
import com.huaheng.api.tv.service.TvStatisticService;
import com.huaheng.common.utils.StringUtils;
import com.huaheng.common.utils.WarehouseEnum;
import com.huaheng.framework.aspectj.lang.annotation.ApiLogger;
import com.huaheng.framework.web.domain.AjaxResultTv;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.huaheng.api.tv.domain.TvBean;
import com.huaheng.api.wcs.domain.WcsTask;
import com.huaheng.common.constant.QuantityConstant;
import com.huaheng.common.utils.Wrappers;
import com.huaheng.framework.web.controller.BaseController;
import com.huaheng.framework.web.domain.AjaxResult;
import com.huaheng.pc.config.container.domain.Container;
import com.huaheng.pc.config.container.service.ContainerService;
import com.huaheng.pc.config.location.domain.Location;
import com.huaheng.pc.config.location.service.LocationService;
import com.huaheng.pc.config.material.domain.Material;
import com.huaheng.pc.config.material.service.MaterialService;
import com.huaheng.pc.config.zone.domain.Zone;
import com.huaheng.pc.config.zone.service.ZoneService;
import com.huaheng.pc.inventory.InventoryMaterialSummary.domain.InventoryMaterialSummary;
import com.huaheng.pc.inventory.InventoryMaterialSummary.service.InventoryMaterialSummaryService;
import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail;
import com.huaheng.pc.inventory.inventoryDetail.service.InventoryDetailService;
import com.huaheng.pc.inventory.inventoryTransaction.service.InventoryTransactionService;
import com.huaheng.pc.task.taskHeader.domain.TaskHeader;
import com.huaheng.pc.task.taskHeader.service.TaskHeaderService;
import io.swagger.annotations.ApiOperation;
@RestController
@RequestMapping("/api")
public class TvStatisticController extends BaseController {
@Resource
private TvStatisticService tvStatisticService;
@PostMapping("/getInventoryData")
@ApiOperation("立库信息查询接口")
@ResponseBody
@CrossOrigin
// @ApiLogger(apiName = "立库库存查询接口", from = "tv")
public AjaxResultTv getInventoryData(@RequestBody TvStatisticBean tvStatisticBean) {
String Requestor= tvStatisticBean.getRequestor();
String InventoryCode= tvStatisticBean.getInventoryCode();
if(StringUtils.isEmpty(Requestor)){
return AjaxResultTv.error("Requestor为空");
}
String warehouseCode=WarehouseEnum.getWarehouseCode(Requestor);
if(StringUtils.isEmpty(warehouseCode)){
return AjaxResultTv.error("Requestor错误");
}
return tvStatisticService.getInventoryData(warehouseCode,InventoryCode);
}
@PostMapping("/getMaterialData")
@ApiOperation("立库信息查询接口")
@ResponseBody
@CrossOrigin
// @ApiLogger(apiName = "立库物料查询接口", from = "tv")
public AjaxResultTv getMaterialData(@RequestBody TvStatisticBean tvStatisticBean) {
String Requestor= tvStatisticBean.getRequestor();
String container= tvStatisticBean.getContainer();
if(StringUtils.isEmpty(Requestor)||StringUtils.isEmpty(container)){
return AjaxResultTv.error("Requestor或container为空");
}
String warehouseCode=WarehouseEnum.getWarehouseCode(Requestor);
if(StringUtils.isEmpty(warehouseCode)){
return AjaxResultTv.error("Requestor错误");
}
return tvStatisticService.getMaterialData(warehouseCode,container);
}
@PostMapping("/getTaskData")
@ApiOperation("立库任务信息查询接口")
@ResponseBody
@CrossOrigin
@ApiLogger(apiName = "立库任务查询接口", from = "tv")
public AjaxResultTv getTaskData(@RequestBody TvStatisticBean tvStatisticBean) {
String Requestor= tvStatisticBean.getRequestor();
String InventoryCode= tvStatisticBean.getInventoryCode();
if(StringUtils.isEmpty(Requestor)){
return AjaxResultTv.error("Requestor");
}
String warehouseCode=WarehouseEnum.getWarehouseCode(Requestor);
if(StringUtils.isEmpty(warehouseCode)){
return AjaxResultTv.error("Requestor错误");
}
return tvStatisticService.getTaskData(warehouseCode,InventoryCode);
}
@PostMapping("/getTaskDetailData")
@ApiOperation("立库信息查询接口")
@ResponseBody
public AjaxResultTv getTaskDetailData(@RequestBody TvStatisticBean tvStatisticBean) {
Integer id= tvStatisticBean.getId();
if(StringUtils.isNull(id)){
return AjaxResultTv.error("id为空");
}
return tvStatisticService.getTaskDetailData(id);
}
@PostMapping("/getReportData")
@ApiOperation("立库报表查询接口")
@ResponseBody
@CrossOrigin
@ApiLogger(apiName = "立库报表查询接口", from = "tv")
public AjaxResultTv getReportData(@RequestBody TvStatisticBean tvStatisticBean)throws Exception {
String Requestor= tvStatisticBean.getRequestor();
String InventoryCode= tvStatisticBean.getInventoryCode();
String dateType=tvStatisticBean.getDateType();
if(StringUtils.isEmpty(Requestor)||StringUtils.isEmpty(InventoryCode)||StringUtils.isEmpty(dateType)){
return AjaxResultTv.error("Requestor或InventoryCode或dateType为空");
}
String warehouseCode=WarehouseEnum.getWarehouseCode(Requestor);
if(StringUtils.isEmpty(warehouseCode)){
return AjaxResultTv.error("Requestor错误");
}
return tvStatisticService.getReportData(warehouseCode,InventoryCode,dateType);
}
}