Commit daec5955576d762b2642e45d530328a28e13c54f
1 parent
9ab6dee1
新增结束单据按钮,出库打印带托盘号
Showing
8 changed files
with
195 additions
and
180 deletions
src/main/java/com/huaheng/api/mes/controller/MesReceiptController.java
... | ... | @@ -424,11 +424,10 @@ public class MesReceiptController extends BaseController { |
424 | 424 | material.setCInvCName(cInvCName); |
425 | 425 | materialList.add(material); |
426 | 426 | } |
427 | - // materialService.saveBatch(materialList); | |
428 | 427 | } catch (SQLException throwable) { |
429 | 428 | throwable.printStackTrace(); |
430 | 429 | } |
431 | - logger.debug("******************************同步海王物料档案" + materialList.size() + "条数据!!!"); | |
430 | + logger.debug("******************************同步海王物料" + materialList.size() + "条数据!!!"); | |
432 | 431 | return materialList; |
433 | 432 | } |
434 | 433 | |
... | ... |
src/main/java/com/huaheng/pc/config/material/domain/Material.java
... | ... | @@ -7,12 +7,14 @@ import com.baomidou.mybatisplus.annotation.TableName; |
7 | 7 | import com.huaheng.framework.aspectj.lang.annotation.Excel; |
8 | 8 | import io.swagger.annotations.ApiModel; |
9 | 9 | import io.swagger.annotations.ApiModelProperty; |
10 | + | |
10 | 11 | import java.io.Serializable; |
11 | 12 | import java.math.BigDecimal; |
12 | 13 | import java.util.Date; |
14 | + | |
13 | 15 | import lombok.Data; |
14 | 16 | |
15 | -@ApiModel(value="com.huaheng.pc.config.material.domain.Material") | |
17 | +@ApiModel(value = "com.huaheng.pc.config.material.domain.Material") | |
16 | 18 | @Data |
17 | 19 | @TableName(value = "material") |
18 | 20 | public class Material implements Serializable { |
... | ... | @@ -20,7 +22,7 @@ public class Material implements Serializable { |
20 | 22 | * ID |
21 | 23 | */ |
22 | 24 | @TableId(value = "id", type = IdType.AUTO) |
23 | - @ApiModelProperty(value="ID") | |
25 | + @ApiModelProperty(value = "ID") | |
24 | 26 | @Excel(name = "ID") |
25 | 27 | private Integer id; |
26 | 28 | |
... | ... | @@ -28,7 +30,7 @@ public class Material implements Serializable { |
28 | 30 | * 物料编码 |
29 | 31 | */ |
30 | 32 | @TableField(value = "code") |
31 | - @ApiModelProperty(value="物料编码") | |
33 | + @ApiModelProperty(value = "物料编码") | |
32 | 34 | @Excel(name = "物料编码") |
33 | 35 | private String code; |
34 | 36 | |
... | ... | @@ -36,7 +38,7 @@ public class Material implements Serializable { |
36 | 38 | * 货主编码 |
37 | 39 | */ |
38 | 40 | @TableField(value = "companyCode") |
39 | - @ApiModelProperty(value="货主编码") | |
41 | + @ApiModelProperty(value = "货主编码") | |
40 | 42 | @Excel(name = "货主编码") |
41 | 43 | private String companyCode; |
42 | 44 | |
... | ... | @@ -44,7 +46,7 @@ public class Material implements Serializable { |
44 | 46 | * 仓库编码 |
45 | 47 | */ |
46 | 48 | @TableField(value = "warehouseCode") |
47 | - @ApiModelProperty(value="仓库编码") | |
49 | + @ApiModelProperty(value = "仓库编码") | |
48 | 50 | @Excel(name = "仓库编码") |
49 | 51 | private String warehouseCode; |
50 | 52 | |
... | ... | @@ -52,7 +54,7 @@ public class Material implements Serializable { |
52 | 54 | * 名称 |
53 | 55 | */ |
54 | 56 | @TableField(value = "name") |
55 | - @ApiModelProperty(value="名称") | |
57 | + @ApiModelProperty(value = "名称") | |
56 | 58 | @Excel(name = "名称") |
57 | 59 | private String name; |
58 | 60 | |
... | ... | @@ -60,7 +62,7 @@ public class Material implements Serializable { |
60 | 62 | * 规格 |
61 | 63 | */ |
62 | 64 | @TableField(value = "spec") |
63 | - @ApiModelProperty(value="规格") | |
65 | + @ApiModelProperty(value = "规格") | |
64 | 66 | @Excel(name = "规格") |
65 | 67 | private String spec; |
66 | 68 | |
... | ... | @@ -68,7 +70,7 @@ public class Material implements Serializable { |
68 | 70 | * 单位 |
69 | 71 | */ |
70 | 72 | @TableField(value = "unit") |
71 | - @ApiModelProperty(value="单位") | |
73 | + @ApiModelProperty(value = "单位") | |
72 | 74 | @Excel(name = "单位") |
73 | 75 | private String unit; |
74 | 76 | |
... | ... | @@ -76,7 +78,7 @@ public class Material implements Serializable { |
76 | 78 | * 类别 |
77 | 79 | */ |
78 | 80 | @TableField(value = "type") |
79 | - @ApiModelProperty(value="类别") | |
81 | + @ApiModelProperty(value = "类别") | |
80 | 82 | @Excel(name = "类别") |
81 | 83 | private String type; |
82 | 84 | |
... | ... | @@ -84,7 +86,7 @@ public class Material implements Serializable { |
84 | 86 | * ABC分类 |
85 | 87 | */ |
86 | 88 | @TableField(value = "abcClass") |
87 | - @ApiModelProperty(value="ABC分类") | |
89 | + @ApiModelProperty(value = "ABC分类") | |
88 | 90 | @Excel(name = "ABC分类") |
89 | 91 | private String abcClass; |
90 | 92 | |
... | ... | @@ -92,7 +94,7 @@ public class Material implements Serializable { |
92 | 94 | * 保质期(天) |
93 | 95 | */ |
94 | 96 | @TableField(value = "daysToExpire") |
95 | - @ApiModelProperty(value="保质期(天)") | |
97 | + @ApiModelProperty(value = "保质期(天)") | |
96 | 98 | @Excel(name = "保质期(天)") |
97 | 99 | private Integer daysToExpire; |
98 | 100 | |
... | ... | @@ -100,7 +102,7 @@ public class Material implements Serializable { |
100 | 102 | * 定位规则 |
101 | 103 | */ |
102 | 104 | @TableField(value = "locatingRule") |
103 | - @ApiModelProperty(value="定位规则") | |
105 | + @ApiModelProperty(value = "定位规则") | |
104 | 106 | @Excel(name = "定位规则") |
105 | 107 | private String locatingRule; |
106 | 108 | |
... | ... | @@ -108,7 +110,7 @@ public class Material implements Serializable { |
108 | 110 | * 分配规则 |
109 | 111 | */ |
110 | 112 | @TableField(value = "allocationRule") |
111 | - @ApiModelProperty(value="分配规则") | |
113 | + @ApiModelProperty(value = "分配规则") | |
112 | 114 | @Excel(name = "分配规则") |
113 | 115 | private String allocationRule; |
114 | 116 | |
... | ... | @@ -116,7 +118,7 @@ public class Material implements Serializable { |
116 | 118 | * 补货规则 |
117 | 119 | */ |
118 | 120 | @TableField(value = "replenishmentRule") |
119 | - @ApiModelProperty(value="补货规则") | |
121 | + @ApiModelProperty(value = "补货规则") | |
120 | 122 | @Excel(name = "补货规则") |
121 | 123 | private String replenishmentRule; |
122 | 124 | |
... | ... | @@ -124,7 +126,7 @@ public class Material implements Serializable { |
124 | 126 | * 空货位规则 |
125 | 127 | */ |
126 | 128 | @TableField(value = "emptyLocRule") |
127 | - @ApiModelProperty(value="空货位规则") | |
129 | + @ApiModelProperty(value = "空货位规则") | |
128 | 130 | @Excel(name = "空货位规则") |
129 | 131 | private String emptyLocRule; |
130 | 132 | |
... | ... | @@ -132,7 +134,7 @@ public class Material implements Serializable { |
132 | 134 | * 入库流程 |
133 | 135 | */ |
134 | 136 | @TableField(value = "receivingFlow") |
135 | - @ApiModelProperty(value="入库流程") | |
137 | + @ApiModelProperty(value = "入库流程") | |
136 | 138 | @Excel(name = "入库流程") |
137 | 139 | private String receivingFlow; |
138 | 140 | |
... | ... | @@ -140,7 +142,7 @@ public class Material implements Serializable { |
140 | 142 | * 出库流程 |
141 | 143 | */ |
142 | 144 | @TableField(value = "shippingFlow") |
143 | - @ApiModelProperty(value="出库流程") | |
145 | + @ApiModelProperty(value = "出库流程") | |
144 | 146 | @Excel(name = "出库流程") |
145 | 147 | private String shippingFlow; |
146 | 148 | |
... | ... | @@ -148,7 +150,7 @@ public class Material implements Serializable { |
148 | 150 | * 属性模版 |
149 | 151 | */ |
150 | 152 | @TableField(value = "attributeTemplateCode") |
151 | - @ApiModelProperty(value="属性模版") | |
153 | + @ApiModelProperty(value = "属性模版") | |
152 | 154 | @Excel(name = "属性模版") |
153 | 155 | private String attributeTemplateCode; |
154 | 156 | |
... | ... | @@ -156,7 +158,7 @@ public class Material implements Serializable { |
156 | 158 | * 记录序列号 |
157 | 159 | */ |
158 | 160 | @TableField(value = "trackSerialNum") |
159 | - @ApiModelProperty(value="记录序列号") | |
161 | + @ApiModelProperty(value = "记录序列号") | |
160 | 162 | @Excel(name = "记录序列号") |
161 | 163 | private Integer trackSerialNum; |
162 | 164 | |
... | ... | @@ -164,7 +166,7 @@ public class Material implements Serializable { |
164 | 166 | * 自动生成序列号 |
165 | 167 | */ |
166 | 168 | @TableField(value = "autoGenSerialNum") |
167 | - @ApiModelProperty(value="自动生成序列号") | |
169 | + @ApiModelProperty(value = "自动生成序列号") | |
168 | 170 | @Excel(name = "自动生成序列号") |
169 | 171 | private Integer autoGenSerialNum; |
170 | 172 | |
... | ... | @@ -172,7 +174,7 @@ public class Material implements Serializable { |
172 | 174 | * 自动生成序列号表达式 |
173 | 175 | */ |
174 | 176 | @TableField(value = "autoGenSerialNumFormat") |
175 | - @ApiModelProperty(value="自动生成序列号表达式") | |
177 | + @ApiModelProperty(value = "自动生成序列号表达式") | |
176 | 178 | @Excel(name = "自动生成序列号表达式") |
177 | 179 | private String autoGenSerialNumFormat; |
178 | 180 | |
... | ... | @@ -180,7 +182,7 @@ public class Material implements Serializable { |
180 | 182 | * 序列号模版 |
181 | 183 | */ |
182 | 184 | @TableField(value = "snTemplateCode") |
183 | - @ApiModelProperty(value="序列号模版") | |
185 | + @ApiModelProperty(value = "序列号模版") | |
184 | 186 | @Excel(name = "序列号模版") |
185 | 187 | private String snTemplateCode; |
186 | 188 | |
... | ... | @@ -188,7 +190,7 @@ public class Material implements Serializable { |
188 | 190 | * 临期预警天数 |
189 | 191 | */ |
190 | 192 | @TableField(value = "expiringDays") |
191 | - @ApiModelProperty(value="临期预警天数") | |
193 | + @ApiModelProperty(value = "临期预警天数") | |
192 | 194 | @Excel(name = "临期预警天数") |
193 | 195 | private Integer expiringDays; |
194 | 196 | |
... | ... | @@ -196,7 +198,7 @@ public class Material implements Serializable { |
196 | 198 | * 收货预警天数 |
197 | 199 | */ |
198 | 200 | @TableField(value = "minShelfLifeDays") |
199 | - @ApiModelProperty(value="收货预警天数") | |
201 | + @ApiModelProperty(value = "收货预警天数") | |
200 | 202 | @Excel(name = "收货预警天数") |
201 | 203 | private Integer minShelfLifeDays; |
202 | 204 | |
... | ... | @@ -204,21 +206,21 @@ public class Material implements Serializable { |
204 | 206 | * 状态 |
205 | 207 | */ |
206 | 208 | @TableField(value = "enable") |
207 | - @ApiModelProperty(value="状态") | |
209 | + @ApiModelProperty(value = "状态") | |
208 | 210 | private Boolean enable; |
209 | 211 | |
210 | 212 | /** |
211 | 213 | * 创建时间 |
212 | 214 | */ |
213 | 215 | @TableField(value = "created") |
214 | - @ApiModelProperty(value="创建时间") | |
216 | + @ApiModelProperty(value = "创建时间") | |
215 | 217 | private Date created; |
216 | 218 | |
217 | 219 | /** |
218 | 220 | * 创建用户 |
219 | 221 | */ |
220 | 222 | @TableField(value = "createdBy") |
221 | - @ApiModelProperty(value="创建用户") | |
223 | + @ApiModelProperty(value = "创建用户") | |
222 | 224 | |
223 | 225 | private String createdBy; |
224 | 226 | |
... | ... | @@ -226,21 +228,21 @@ public class Material implements Serializable { |
226 | 228 | * 创建时间 |
227 | 229 | */ |
228 | 230 | @TableField(value = "lastUpdated") |
229 | - @ApiModelProperty(value="创建时间") | |
231 | + @ApiModelProperty(value = "创建时间") | |
230 | 232 | private Date lastUpdated; |
231 | 233 | |
232 | 234 | /** |
233 | 235 | * 更新用户 |
234 | 236 | */ |
235 | 237 | @TableField(value = "lastUpdatedBy") |
236 | - @ApiModelProperty(value="更新用户") | |
238 | + @ApiModelProperty(value = "更新用户") | |
237 | 239 | private String lastUpdatedBy; |
238 | 240 | |
239 | 241 | /** |
240 | 242 | * 数据版本 |
241 | 243 | */ |
242 | 244 | @TableField(value = "version") |
243 | - @ApiModelProperty(value="数据版本") | |
245 | + @ApiModelProperty(value = "数据版本") | |
244 | 246 | @Excel(name = "数据版本") |
245 | 247 | private Integer version; |
246 | 248 | |
... | ... | @@ -248,7 +250,7 @@ public class Material implements Serializable { |
248 | 250 | * 是否AGV区域发货 |
249 | 251 | */ |
250 | 252 | @TableField(value = "userDef1") |
251 | - @ApiModelProperty(value="是否AGV区域发货") | |
253 | + @ApiModelProperty(value = "是否AGV区域发货") | |
252 | 254 | @Excel(name = "是否AGV区域发货") |
253 | 255 | private String userDef1; |
254 | 256 | |
... | ... | @@ -256,64 +258,70 @@ public class Material implements Serializable { |
256 | 258 | * 自定义字段2 |
257 | 259 | */ |
258 | 260 | @TableField(value = "userDef2") |
259 | - @ApiModelProperty(value="自定义字段2") | |
261 | + @ApiModelProperty(value = "自定义字段2") | |
260 | 262 | private String userDef2; |
261 | 263 | |
262 | 264 | /** |
263 | 265 | * 商品同步标识 |
264 | 266 | */ |
265 | 267 | @TableField(value = "userDef3") |
266 | - @ApiModelProperty(value="商品同步标识") | |
268 | + @ApiModelProperty(value = "商品同步标识") | |
267 | 269 | private String userDef3; |
268 | 270 | |
269 | 271 | /** |
270 | 272 | * 自定义字段4 |
271 | 273 | */ |
272 | 274 | @TableField(value = "userDef4") |
273 | - @ApiModelProperty(value="自定义字段4") | |
275 | + @ApiModelProperty(value = "自定义字段4") | |
274 | 276 | private String userDef4; |
275 | 277 | |
276 | 278 | /** |
277 | 279 | * 自定义字段5 |
278 | 280 | */ |
279 | 281 | @TableField(value = "userDef5") |
280 | - @ApiModelProperty(value="自定义字段5") | |
282 | + @ApiModelProperty(value = "自定义字段5") | |
281 | 283 | private String userDef5; |
282 | 284 | |
283 | 285 | /** |
284 | 286 | * 自定义字段6 |
285 | 287 | */ |
286 | 288 | @TableField(value = "userDef6") |
287 | - @ApiModelProperty(value="自定义字段6") | |
289 | + @ApiModelProperty(value = "自定义字段6") | |
288 | 290 | private String userDef6; |
289 | 291 | |
290 | 292 | /** |
291 | 293 | * 自定义字段7 |
292 | 294 | */ |
293 | 295 | @TableField(value = "userDef7") |
294 | - @ApiModelProperty(value="自定义字段7") | |
296 | + @ApiModelProperty(value = "自定义字段7") | |
295 | 297 | private String userDef7; |
296 | 298 | |
297 | 299 | /** |
298 | 300 | * 自定义字段8 |
299 | 301 | */ |
300 | 302 | @TableField(value = "userDef8") |
301 | - @ApiModelProperty(value="自定义字段8") | |
303 | + @ApiModelProperty(value = "自定义字段8") | |
302 | 304 | private String userDef8; |
303 | 305 | |
304 | - /** 删除标记*/ | |
306 | + /** | |
307 | + * 删除标记 | |
308 | + */ | |
305 | 309 | @TableField(value = "deleted") |
306 | 310 | @ApiModelProperty(value = "删除标记") |
307 | 311 | private Boolean deleted; |
308 | 312 | |
309 | - /** */ | |
313 | + /** | |
314 | + * | |
315 | + */ | |
310 | 316 | @TableField(value = "isMix") |
311 | 317 | @ApiModelProperty(value = "是否允许混放") |
312 | 318 | private Boolean isMix; |
313 | 319 | /** 打印机名称 */ |
314 | 320 | // private static final String printName = "Gprinter GP-1424D"; |
315 | 321 | |
316 | - /** */ | |
322 | + /** | |
323 | + * | |
324 | + */ | |
317 | 325 | @TableField(value = "isHigh") |
318 | 326 | @ApiModelProperty(value = "是否高托") |
319 | 327 | private Integer isHigh; |
... | ... | @@ -372,4 +380,22 @@ public class Material implements Serializable { |
372 | 380 | @TableField(value = "cInvCName") |
373 | 381 | private String cInvCName; |
374 | 382 | |
383 | + @Override | |
384 | + public String toString() { | |
385 | + return "Material{" + | |
386 | + "物料编码='" + code + '\'' + | |
387 | + ", 物料名称='" + name + '\'' + | |
388 | + ", 物料规格='" + spec + '\'' + | |
389 | + ", 物料单位='" + unit + '\'' + | |
390 | + ", 是否高托=" + isHigh + | |
391 | + ", 外形尺寸='" + physicalDimension + '\'' + | |
392 | + ", u8仓库='" + defWareHouse + '\'' + | |
393 | + ", 单位编码='" + unitCode + '\'' + | |
394 | + ", 修改时间=" + modifyDate + | |
395 | + ", 启动时间=" + startDate + | |
396 | + ", 重量='" + weight + '\'' + | |
397 | + ", 存货类别编码='" + cinvccode + '\'' + | |
398 | + ", 存货类别名称='" + cInvCName + '\'' + | |
399 | + '}'; | |
400 | + } | |
375 | 401 | } |
... | ... |
src/main/java/com/huaheng/pc/monitor/job/task/RyTask.java
... | ... | @@ -3,6 +3,7 @@ package com.huaheng.pc.monitor.job.task; |
3 | 3 | |
4 | 4 | import com.alibaba.fastjson.JSON; |
5 | 5 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
6 | +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |
6 | 7 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
7 | 8 | import com.huaheng.api.mes.controller.MesReceiptController; |
8 | 9 | import com.huaheng.api.mes.result.ReturnInfo; |
... | ... | @@ -16,6 +17,7 @@ import com.huaheng.pc.config.container.service.ContainerService; |
16 | 17 | import com.huaheng.pc.config.location.domain.Location; |
17 | 18 | import com.huaheng.pc.config.location.service.LocationService; |
18 | 19 | import com.huaheng.pc.config.material.domain.Material; |
20 | +import com.huaheng.pc.config.material.mapper.MaterialMapper; | |
19 | 21 | import com.huaheng.pc.config.material.service.MaterialService; |
20 | 22 | import com.huaheng.pc.config.station.domain.Station; |
21 | 23 | import com.huaheng.pc.config.station.service.StationService; |
... | ... | @@ -69,6 +71,8 @@ import java.util.stream.Collectors; |
69 | 71 | public class RyTask extends BaseController { |
70 | 72 | |
71 | 73 | @Resource |
74 | + private MaterialMapper materialMapper; | |
75 | + @Resource | |
72 | 76 | private IJobLogService jobLogService; |
73 | 77 | @Resource |
74 | 78 | private IOperLogService operLogService; |
... | ... | @@ -320,76 +324,6 @@ public class RyTask extends BaseController { |
320 | 324 | } |
321 | 325 | } |
322 | 326 | |
323 | - //public void clearContainerHeader(String params) { | |
324 | - // LambdaQueryWrapper<ReceiptContainerHeader> receiptContainerHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
325 | - // receiptContainerHeaderLambdaQueryWrapper.eq(ReceiptContainerHeader::getStatus, | |
326 | - // QuantityConstant.RECEIPT_CONTAINER_BUILD); | |
327 | - // List<ReceiptContainerHeader> receiptContainerHeaderList = | |
328 | - // receiptContainerHeaderService.list(receiptContainerHeaderLambdaQueryWrapper); | |
329 | - // for(ReceiptContainerHeader receiptContainerHeader : receiptContainerHeaderList) { | |
330 | - // Date date = receiptContainerHeader.getCreated(); | |
331 | - // Date now = new Date(); | |
332 | - // int fore = date.getDay(); | |
333 | - // int day = now.getDay(); | |
334 | - // if(fore != day) { | |
335 | - // receiptContainerHeaderService.removeById(receiptContainerHeader); | |
336 | - // } | |
337 | - // } | |
338 | - // | |
339 | - // LambdaQueryWrapper<ReceiptContainerHeader> receiptContainerHeaderLambdaQueryWrapper1 = Wrappers.lambdaQuery(); | |
340 | - // receiptContainerHeaderLambdaQueryWrapper1.eq(ReceiptContainerHeader::getStatus, | |
341 | - // QuantityConstant.RECEIPT_CONTAINER_TASK); | |
342 | - // List<ReceiptContainerHeader> receiptContainerHeaderList1 = | |
343 | - // receiptContainerHeaderService.list(receiptContainerHeaderLambdaQueryWrapper1); | |
344 | - // for(ReceiptContainerHeader receiptContainerHeader : receiptContainerHeaderList1) { | |
345 | - // String containerCode = receiptContainerHeader.getContainerCode(); | |
346 | - // LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
347 | - // taskHeaderLambdaQueryWrapper.lt(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_COMPLETED) | |
348 | - // .in(TaskHeader::getTaskType, QuantityConstant.TASK_TYPE_WHOLERECEIPT, | |
349 | - // QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT) | |
350 | - // .eq(TaskHeader::getContainerCode, containerCode); | |
351 | - // List<TaskHeader> taskHeaderList = taskHeaderService.list(taskHeaderLambdaQueryWrapper); | |
352 | - // if(taskHeaderList.size() == 0) { | |
353 | - // receiptContainerHeader.setStatus(QuantityConstant.RECEIPT_CONTAINER_FINISHED); | |
354 | - // receiptContainerHeaderService.updateById(receiptContainerHeader); | |
355 | - // } | |
356 | - // } | |
357 | - // | |
358 | - // LambdaQueryWrapper<ShipmentContainerHeader> shipmentContainerHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
359 | - // shipmentContainerHeaderLambdaQueryWrapper.eq(ShipmentContainerHeader::getStatus, | |
360 | - // QuantityConstant.SHIPMENT_CONTAINER_BUILD); | |
361 | - // List<ShipmentContainerHeader> shipmentContainerHeaderList = | |
362 | - // shipmentContainerHeaderService.list(shipmentContainerHeaderLambdaQueryWrapper); | |
363 | - // for(ShipmentContainerHeader shipmentContainerHeader : shipmentContainerHeaderList) { | |
364 | - // Date date = shipmentContainerHeader.getCreated(); | |
365 | - // Date now = new Date(); | |
366 | - // int fore = date.getDay(); | |
367 | - // int day = now.getDay(); | |
368 | - // if(fore != day) { | |
369 | - // shipmentContainerHeaderService.removeById(shipmentContainerHeader); | |
370 | - // } | |
371 | - // } | |
372 | - // | |
373 | - // LambdaQueryWrapper<ShipmentContainerHeader> shipmentContainerHeaderLambdaQueryWrapper1 = Wrappers.lambdaQuery(); | |
374 | - // shipmentContainerHeaderLambdaQueryWrapper1.eq(ShipmentContainerHeader::getStatus, | |
375 | - // QuantityConstant.SHIPMENT_CONTAINER_TASK); | |
376 | - // List<ShipmentContainerHeader> shipmentContainerHeaderList1 = | |
377 | - // shipmentContainerHeaderService.list(shipmentContainerHeaderLambdaQueryWrapper1); | |
378 | - // for(ShipmentContainerHeader shipmentContainerHeader : shipmentContainerHeaderList1) { | |
379 | - // String containerCode = shipmentContainerHeader.getContainerCode(); | |
380 | - // LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
381 | - // taskHeaderLambdaQueryWrapper.lt(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_COMPLETED) | |
382 | - // .in(TaskHeader::getTaskType, QuantityConstant.TASK_TYPE_WHOLESHIPMENT, | |
383 | - // QuantityConstant.TASK_TYPE_SORTINGSHIPMENT) | |
384 | - // .eq(TaskHeader::getContainerCode, containerCode); | |
385 | - // List<TaskHeader> taskHeaderList = taskHeaderService.list(taskHeaderLambdaQueryWrapper); | |
386 | - // if(taskHeaderList.size() == 0) { | |
387 | - // shipmentContainerHeader.setStatus(QuantityConstant.SHIPMENT_CONTAINER_FINISHED); | |
388 | - // shipmentContainerHeaderService.updateById(shipmentContainerHeader); | |
389 | - // } | |
390 | - // } | |
391 | - //} | |
392 | - | |
393 | 327 | |
394 | 328 | /** |
395 | 329 | * 同步物料接口 |
... | ... | @@ -398,64 +332,45 @@ public class RyTask extends BaseController { |
398 | 332 | MesReceiptController MesReceiptController = new MesReceiptController(); |
399 | 333 | List<Material> materialList = MesReceiptController.getMaterial(); |
400 | 334 | List<Material> saveMaterials = new ArrayList<>(); |
401 | - List<Material> updateMaterials = new ArrayList<>(); | |
402 | - | |
403 | 335 | if (materialList != null && materialList.size() > 0) { |
404 | 336 | for (Material material : materialList) { |
405 | 337 | Material one = materialService.getOne(new LambdaQueryWrapper<Material>().eq(Material::getCode, material.getCode())); |
406 | 338 | if (one == null) { |
407 | - ApiLog apiLog = new ApiLog(); | |
408 | - apiLog.setApiName("同步物料"); | |
409 | - apiLog.setRequestBody(material.toString()); | |
410 | - apiLog.setRequestTime(new Date()); | |
411 | - apiLog.setRequestFrom("WMS"); | |
412 | - apiLog.setResponseBy("U8"); | |
413 | - apiLog.setResponseBody("同步物料成功"); | |
414 | - apiLogService.save(apiLog); | |
415 | 339 | saveMaterials.add(material); |
340 | + addApiLog("新增物料", material.toString()); | |
416 | 341 | } else { |
417 | - updateMaterials.add(material); | |
418 | - ApiLog apiLog = new ApiLog(); | |
419 | - apiLog.setApiName("更新物料"); | |
420 | - apiLog.setRequestBody(material.toString()); | |
421 | - apiLog.setRequestTime(new Date()); | |
422 | - apiLog.setRequestFrom("WMS"); | |
423 | - apiLog.setResponseBy("U8"); | |
424 | - apiLog.setResponseBody("更新物料成功"); | |
425 | - apiLogService.save(apiLog); | |
342 | + LambdaUpdateWrapper<Material> updateWrapper = new LambdaUpdateWrapper<>(); | |
343 | + updateWrapper.eq(Material::getCode, material.getCode()); | |
344 | + Material newMaterial = new Material(); | |
345 | + newMaterial.setName(material.getName()); | |
346 | + newMaterial.setSpec(material.getSpec()); | |
347 | + newMaterial.setUnit(material.getUnit()); | |
348 | + newMaterial.setCode(material.getCode()); | |
349 | + newMaterial.setLastUpdated(material.getLastUpdated()); | |
350 | + newMaterial.setLastUpdatedBy(material.getLastUpdatedBy()); | |
351 | + materialMapper.update(newMaterial, updateWrapper); | |
352 | + addApiLog("更新物料", material.toString()); | |
426 | 353 | } |
427 | 354 | } |
428 | 355 | if (saveMaterials.size() > 0) { |
429 | 356 | materialService.saveBatch(saveMaterials); |
430 | 357 | } |
431 | - if (updateMaterials.size() > 0) { | |
432 | - materialService.updateBatchById(updateMaterials); | |
433 | - } | |
434 | - } | |
435 | - } | |
436 | 358 | |
437 | - /** | |
438 | - * 开启plc | |
439 | - * | |
440 | - * @param params | |
441 | - */ | |
442 | - public void autoCheckPlcConnectTask(String params) { | |
443 | - System.out.println("0000000000000000000000000"); | |
444 | - LambdaQueryWrapper<PlcEquipment> wrapper = Wrappers.lambdaQuery(); | |
445 | - wrapper.eq(PlcEquipment::getStatus, 1); | |
446 | - List<PlcEquipment> list = equipmentService.list(wrapper); | |
447 | - for (int a = 0; a < list.size(); a++) { | |
448 | - PlcEquipment plcEquipment = list.get(a); | |
449 | - String addressIp = plcEquipment.getEquipmentIp(); | |
450 | - int port = plcEquipment.getPort(); | |
451 | - //SiemensS7NetV siemensS7NetV= PlcConnectUtil.start(addressIp,a+1); | |
452 | - if (!PlcConnectUtil.checkConnect(a + 1)) { | |
453 | - PlcConnectUtil.start(addressIp, a + 1, port); | |
454 | - } | |
455 | 359 | } |
456 | 360 | } |
457 | 361 | |
458 | 362 | |
363 | + public void addApiLog(String name, String requestBody) { | |
364 | + ApiLog apiLog = new ApiLog(); | |
365 | + apiLog.setApiName(name); | |
366 | + apiLog.setRequestBody(requestBody); | |
367 | + apiLog.setRequestTime(new Date()); | |
368 | + apiLog.setRequestFrom("MOM"); | |
369 | + apiLog.setResponseBy("WMS"); | |
370 | + apiLog.setResponseBody("成功"); | |
371 | + apiLogService.save(apiLog); | |
372 | + } | |
373 | + | |
459 | 374 | //回传单据的记录历史单据 |
460 | 375 | public void gcBill() { |
461 | 376 | LambdaQueryWrapper<ReceiptHeader> query = Wrappers.lambdaQuery(); |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiptHeader/controller/ReceiptHeaderController.java
... | ... | @@ -268,7 +268,7 @@ public class ReceiptHeaderController extends BaseController { |
268 | 268 | if (receiptHeader == null) { |
269 | 269 | return AjaxResult.error("没有找到单据" + String.valueOf(id)); |
270 | 270 | } |
271 | - if(receiptHeader.getFirstStatus() >= QuantityConstant.RECEIPT_HEADER_POOL) { | |
271 | + if (receiptHeader.getFirstStatus() >= QuantityConstant.RECEIPT_HEADER_POOL) { | |
272 | 272 | return AjaxResult.error("订单状态大于100不能删除"); |
273 | 273 | } |
274 | 274 | List<ReceiptDetail> list = receiptDetailService.list(new LambdaQueryWrapper<ReceiptDetail>().eq(ReceiptDetail::getReceiptId, id)); |
... | ... | @@ -444,4 +444,28 @@ public class ReceiptHeaderController extends BaseController { |
444 | 444 | receiptHeaderService.updateById(receiptHeader); |
445 | 445 | return AjaxResult.success("回传成功"); |
446 | 446 | } |
447 | + | |
448 | + /** | |
449 | + * 无需回传 | |
450 | + */ | |
451 | + @PostMapping("/noReturnRequired") | |
452 | + @ResponseBody | |
453 | + public AjaxResult noReturnRequired(String id) { | |
454 | + if (StringUtils.isEmpty(id)) { | |
455 | + return AjaxResult.error("id不能为空"); | |
456 | + } | |
457 | + ReceiptHeader receiptHeader = receiptHeaderService.getById(id); | |
458 | + if (receiptHeader == null) { | |
459 | + return AjaxResult.error("没有找到入库单"); | |
460 | + } | |
461 | + if (receiptHeader.getPushSuccessStatus() != 2) { | |
462 | + return AjaxResult.error("只有回传错误,才能结束回传!"); | |
463 | + } | |
464 | + receiptHeader.setFirstStatus(QuantityConstant.RECEIPT_HEADER_RETURN); | |
465 | + receiptHeader.setLastStatus(QuantityConstant.RECEIPT_HEADER_RETURN); | |
466 | + receiptHeader.setPushSuccessStatus(1); | |
467 | + receiptHeader.setErrorMsg(""); | |
468 | + receiptHeaderService.updateById(receiptHeader); | |
469 | + return AjaxResult.success("修改单据成功"); | |
470 | + } | |
447 | 471 | } |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentHeader/controller/ShipmentHeaderController.java
... | ... | @@ -418,9 +418,11 @@ public class ShipmentHeaderController extends BaseController { |
418 | 418 | |
419 | 419 | List<ShipmentContainerDetail> list = shipmentContainerDetailService.list(new LambdaQueryWrapper<ShipmentContainerDetail>() |
420 | 420 | .eq(ShipmentContainerDetail::getShipmentDetailId, item.getId())); |
421 | - if (!list.isEmpty()) { | |
422 | - item.setContainerCode(list.get(0).getContainerCode()); | |
423 | - } | |
421 | + | |
422 | + list.stream() | |
423 | + .findFirst() | |
424 | + .ifPresent(shipmentContainerDetail -> item.setContainerCode(shipmentContainerDetail.getContainerCode())); | |
425 | + | |
424 | 426 | item.setInventoryQty(inventoryDetailService.getSumQty(inventory)); |
425 | 427 | if (item.getQty().compareTo(item.getTaskQty()) != 0) { |
426 | 428 | if (item.getInventoryQty().compareTo(new BigDecimal(0)) == 0) { |
... | ... | @@ -641,5 +643,29 @@ public class ShipmentHeaderController extends BaseController { |
641 | 643 | return AjaxResult.error("回传失败"); |
642 | 644 | } |
643 | 645 | |
646 | + /** | |
647 | + * 无需回传 | |
648 | + */ | |
649 | + @PostMapping("/noReturnRequired") | |
650 | + @ResponseBody | |
651 | + public AjaxResult noReturnRequired(String id) { | |
652 | + if (StringUtils.isEmpty(id)) { | |
653 | + return AjaxResult.error("id不能为空"); | |
654 | + } | |
655 | + ShipmentHeader shipmentHeader = shipmentHeaderService.getById(id); | |
656 | + if (shipmentHeader == null) { | |
657 | + return AjaxResult.error("没有找到入库单"); | |
658 | + } | |
659 | + if (shipmentHeader.getPushSuccessStatus() != 2) { | |
660 | + return AjaxResult.error("只有回传错误,才能结束回传!"); | |
661 | + } | |
662 | + shipmentHeader.setFirstStatus(QuantityConstant.RECEIPT_HEADER_RETURN); | |
663 | + shipmentHeader.setLastStatus(QuantityConstant.RECEIPT_HEADER_RETURN); | |
664 | + shipmentHeader.setPushSuccessStatus(1); | |
665 | + shipmentHeader.setErrorMsg(""); | |
666 | + shipmentHeaderService.updateById(shipmentHeader); | |
667 | + return AjaxResult.success("修改单据成功"); | |
668 | + } | |
669 | + | |
644 | 670 | |
645 | 671 | } |
... | ... |
src/main/resources/templates/receipt/receiptHeader/receiptHeader.html
... | ... | @@ -113,10 +113,10 @@ |
113 | 113 | </form> |
114 | 114 | </div> |
115 | 115 | <div class="btn-group hidden-xs" id="toolbar" role="group"> |
116 | -<!-- <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()"--> | |
117 | -<!-- shiro:hasPermission="receipt:receiptHeader:add">--> | |
118 | -<!-- <i class="fa fa-plus"></i> 新增--> | |
119 | -<!-- </a>--> | |
116 | + <!-- <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()"--> | |
117 | + <!-- shiro:hasPermission="receipt:receiptHeader:add">--> | |
118 | + <!-- <i class="fa fa-plus"></i> 新增--> | |
119 | + <!-- </a>--> | |
120 | 120 | <!-- <a class="btn btn-outline btn-default btn-rounded" onclick="submitReview()" shiro:hasPermission="receipt:receiptHeader:approval">--> |
121 | 121 | <!-- <i class="fa fa-fighter-jet"></i> 提交审核--> |
122 | 122 | <!-- </a>--> |
... | ... | @@ -126,14 +126,14 @@ |
126 | 126 | <!-- <a class="btn btn-outline btn-primary btn-rounded" onclick="addPool()" shiro:hasPermission="receipt:receiptHeader:addPool">--> |
127 | 127 | <!-- <i class="fa fa-check-circle"></i> 加入订单池--> |
128 | 128 | <!-- </a>--> |
129 | -<!-- <a class="btn btn-outline btn-info btn-rounded" onclick="crossLocation()"--> | |
130 | -<!-- shiro:hasPermission="receipt:receiptHeader:cross">--> | |
131 | -<!-- <i class="fa fa-random"></i> 越库--> | |
132 | -<!-- </a>--> | |
133 | -<!-- <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()"--> | |
134 | -<!-- shiro:hasPermission="receipt:receiptHeader:remove">--> | |
135 | -<!-- <i class="fa fa-trash-o"></i> 删除--> | |
136 | -<!-- </a>--> | |
129 | + <!-- <a class="btn btn-outline btn-info btn-rounded" onclick="crossLocation()"--> | |
130 | + <!-- shiro:hasPermission="receipt:receiptHeader:cross">--> | |
131 | + <!-- <i class="fa fa-random"></i> 越库--> | |
132 | + <!-- </a>--> | |
133 | + <!-- <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()"--> | |
134 | + <!-- shiro:hasPermission="receipt:receiptHeader:remove">--> | |
135 | + <!-- <i class="fa fa-trash-o"></i> 删除--> | |
136 | + <!-- </a>--> | |
137 | 137 | </div> |
138 | 138 | <table id="bootstrap-table" data-th-height="50" data-mobile-responsive="true" |
139 | 139 | class="table table-bordered table-hover text-nowrap"></table> |
... | ... | @@ -240,14 +240,14 @@ |
240 | 240 | </form> |
241 | 241 | </div> |
242 | 242 | <div class="btn-group hidden-xs" id="toolbar1" role="group" style="position:relative;"> |
243 | -<!-- <a class="btn btn-outline btn-success btn-rounded" onclick="add()"--> | |
244 | -<!-- shiro:hasPermission="receipt:receiptDetail:add">--> | |
245 | -<!-- <i class="fa fa-plus"></i> 新增--> | |
246 | -<!-- </a>--> | |
247 | -<!-- <a class="btn btn-outline btn-danger btn-rounded" onclick="batRemove()"--> | |
248 | -<!-- shiro:hasPermission="receipt:receiptDetail:remove">--> | |
249 | -<!-- <i class="fa fa-trash-o"></i> 删除--> | |
250 | -<!-- </a>--> | |
243 | + <!-- <a class="btn btn-outline btn-success btn-rounded" onclick="add()"--> | |
244 | + <!-- shiro:hasPermission="receipt:receiptDetail:add">--> | |
245 | + <!-- <i class="fa fa-plus"></i> 新增--> | |
246 | + <!-- </a>--> | |
247 | + <!-- <a class="btn btn-outline btn-danger btn-rounded" onclick="batRemove()"--> | |
248 | + <!-- shiro:hasPermission="receipt:receiptDetail:remove">--> | |
249 | + <!-- <i class="fa fa-trash-o"></i> 删除--> | |
250 | + <!-- </a>--> | |
251 | 251 | <a class="btn btn-outline btn-success btn-rounded" onclick="receiptDetailPrint()" |
252 | 252 | shiro:hasPermission="shipment:bill:report"> |
253 | 253 | <i class="fa fa-print"></i> 打印 |
... | ... | @@ -265,6 +265,7 @@ |
265 | 265 | </div> |
266 | 266 | <div th:include="include :: footer"></div> |
267 | 267 | <script th:inline="javascript"> |
268 | + var noReturnRequiredFlag = [[${@permission.hasPermi('receipt:receiptHeader:noReturnRequired')}]]; | |
268 | 269 | var printFlag = [[${@permission.hasPermi('receipt:receiptHeader:report')}]]; |
269 | 270 | var editFlag = [[${@permission.hasPermi('receipt:receiptHeader:edit')}]]; |
270 | 271 | var removeFlag = [[${@permission.hasPermi('receipt:receiptHeader:remove')}]]; |
... | ... | @@ -335,6 +336,9 @@ |
335 | 336 | if (row.firstStatus < 100) { |
336 | 337 | actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a>'); |
337 | 338 | } |
339 | + if (row.pushSuccessStatus === 2) { | |
340 | + actions.push('<a class="btn btn-danger btn-xs ' + noReturnRequiredFlag + '" href="#" onclick="noReturnRequired(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>无需回传</a>'); | |
341 | + } | |
338 | 342 | return actions.join(''); |
339 | 343 | } |
340 | 344 | }, |
... | ... | @@ -982,6 +986,13 @@ |
982 | 986 | $.modal.open("预约到货" + $.table._option.modalName, url); |
983 | 987 | } |
984 | 988 | |
989 | + /* 无需回传 */ | |
990 | + function noReturnRequired(id) { | |
991 | + var url = prefix + "/noReturnRequired"; | |
992 | + var data = {"id": id}; | |
993 | + $.operate.submit(url, "post", "json", data); | |
994 | + } | |
995 | + | |
985 | 996 | function check(id) { |
986 | 997 | var url = prefix + "/check"; |
987 | 998 | var data = {"id": id}; |
... | ... |
src/main/resources/templates/shipment/shipmentHeader/report.html
... | ... | @@ -30,7 +30,7 @@ |
30 | 30 | <div style="width:45%; float:left;">母件名称:<span |
31 | 31 | th:text="${shipmentHeader['superiorName']}"></span></div> |
32 | 32 | <span></span> |
33 | - | |
33 | + | |
34 | 34 | <div style="width:45%; float:left;">调入仓库名称:<span |
35 | 35 | th:text="${shipmentHeader['transferWarehouseName']}"></span> |
36 | 36 | </div> |
... | ... | @@ -52,6 +52,7 @@ |
52 | 52 | </td> |
53 | 53 | </tr> |
54 | 54 | <tr> |
55 | + <th width="18%">托盘号</th> | |
55 | 56 | <th width="18%">物料编码</th> |
56 | 57 | <th width="22%">物料名称</th> |
57 | 58 | <!-- <th width="10%">物料规格</th> |
... | ... | @@ -65,6 +66,7 @@ |
65 | 66 | </thead> |
66 | 67 | <tbody> |
67 | 68 | <tr th:each="row,rowStat : ${details}"> |
69 | + <td th:text="${row.containerCode}"></td> | |
68 | 70 | <td th:text="${row.materialCode}"></td> |
69 | 71 | <td th:text="${row.materialName}"></td> |
70 | 72 | <!--<td th:text="${row.materialSpec}"></td> |
... | ... |
src/main/resources/templates/shipment/shipmentHeader/shipmentHeader.html
... | ... | @@ -293,6 +293,7 @@ |
293 | 293 | </div> |
294 | 294 | <div th:include="include :: footer"></div> |
295 | 295 | <script th:inline="javascript"> |
296 | + var noReturnRequiredFlag = [[${@permission.hasPermi('shipment:shipmentHeader:noReturnRequired')}]]; | |
296 | 297 | var printFlag = [[${@permission.hasPermi('shipment:bill:report')}]]; //打印 |
297 | 298 | var editFlag = [[${@permission.hasPermi('shipment:bill:edit')}]]; |
298 | 299 | var removeFlag = [[${@permission.hasPermi('shipment:remove')}]]; |
... | ... | @@ -381,6 +382,9 @@ |
381 | 382 | if (row.firstStatus == 500 && row.lastStatus == 500) { |
382 | 383 | actions.push('<a class="btn btn-info btn-xs ' + '" href="#" onclick="backERP(\'' + row.id + '\')"><i class="fa fa-upload"></i>回传</a>'); |
383 | 384 | } |
385 | + if (row.pushSuccessStatus === 2) { | |
386 | + actions.push('<a class="btn btn-danger btn-xs ' + noReturnRequiredFlag + '" href="#" onclick="noReturnRequired(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>无需回传</a>'); | |
387 | + } | |
384 | 388 | return actions.join(''); |
385 | 389 | } |
386 | 390 | }, |
... | ... | @@ -1025,6 +1029,14 @@ |
1025 | 1029 | $.ajax(config) |
1026 | 1030 | } |
1027 | 1031 | |
1032 | + /* 无需回传 */ | |
1033 | + function noReturnRequired(id) { | |
1034 | + var url = prefix + "/noReturnRequired"; | |
1035 | + var data = {"id": id}; | |
1036 | + $.operate.submit(url, "post", "json", data); | |
1037 | + } | |
1038 | + | |
1039 | + | |
1028 | 1040 | /* 出库组盘 */ |
1029 | 1041 | function Toshipping(flag) { |
1030 | 1042 | let storage = window.localStorage; |
... | ... |