XWmsInfoController.java
4.48 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
package com.huaheng.api.wmsinfo2.contoller;
import com.huaheng.api.wmsinfo.domain.WmsInfoResult;
import com.huaheng.api.wmsinfo2.domain.*;
import com.huaheng.common.constant.QuantityConstant;
import com.huaheng.pc.config.location.service.CscLocationServiceImpl;
import com.huaheng.pc.config.location.service.LocationServiceImpl;
import com.huaheng.pc.inventory.inventoryDetail.service.InventoryDetailServiceImpl;
import com.huaheng.pc.inventory.inventoryTransaction.service.InventoryTransactionService;
import com.huaheng.pc.task.taskDetail.service.TaskDetailServiceImpl;
import com.huaheng.pc.task.taskHeader.service.TaskHeaderServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Calendar;
import java.util.Date;
@RestController
@RequestMapping("/api/wms/info")
public class XWmsInfoController {
@Resource
private LocationServiceImpl locationService;
@Resource
private CscLocationServiceImpl cscLocationService;
@Resource
private InventoryDetailServiceImpl inventoryDetailService;
@Resource
private InventoryTransactionService inventoryTransactionService;
@Resource
private TaskDetailServiceImpl taskDetailService;
@Resource
private TaskHeaderServiceImpl taskHeaderService;
/**
* 仓库数据概况
*/
@PostMapping()
@ResponseBody
public WmsResult getInfo() {
WmsResult result = new WmsResult();
result.data.add(getDataOfThisYearByMonth());
result.data.add(getDataOfThisMonth());
result.data.add(getLocationUsedPercent());
result.data.add(getLocationUsedCount());
result.data.add(getMaterialTypePercent());
result.data.add(getMaterialQtyAll());
result.data.add(getReceiptNow());
result.data.add(getReceiptUnfinish());
return result;
}
/**
* 本年月度出入库数量
*
* @return
*/
public DataItem getDataOfThisYearByMonth() {
DataItem item = new DataItem("月度出入库数量");
DataPkg pkg = new DataPkg();
pkg.categories.add("1月");
pkg.categories.add("2月");
pkg.categories.add("3月");
pkg.categories.add("4月");
pkg.categories.add("5月");
pkg.categories.add("6月");
pkg.categories.add("7月");
pkg.categories.add("8月");
pkg.categories.add("9月");
pkg.categories.add("10月");
pkg.categories.add("11月");
pkg.categories.add("12月");
DataSeries seriesReceipt = new DataSeries("月度出库数量");
DataSeries seriesShipment = new DataSeries("月度入库数量");
int year = Calendar.getInstance().get(Calendar.YEAR);
for (int i = 1; i <= 12; i++) {
Data dataReceipt = new Data(inventoryTransactionService.getReceiptQtyOfMonth(year, i));
seriesReceipt.data.add(dataReceipt);
Data dataShipment = new Data(inventoryTransactionService.getShipmentQtyOfMonth(year, i));
seriesShipment.data.add(dataShipment);
}
pkg.series.add(seriesReceipt);
pkg.series.add(seriesShipment);
item.parseJson(pkg);
return item;
}
/**
* 当月出入库数量
*
* @return
*/
public DataItem getDataOfThisMonth() {
return null;
}
/**
* 库容使用率
*
* @return
*/
public DataItem getLocationUsedPercent() {
return null;
}
/**
* 物资分类占比
*
* @return
*/
public DataItem getMaterialTypePercent() {
return null;
}
/**
* 库位情况,已用库位数
*
* @return
*/
public DataItem getLocationUsedCount() {
return null;
}
/**
* 总货物数量
*
* @return
*/
public DataItem getMaterialQtyAll() {
return null;
}
/**
* 当前应入库总数
*
* @return
*/
public DataItem getReceiptNow() {
return null;
}
/**
* 入库未领数
*/
public DataItem getReceiptUnfinish() {
return null;
}
}