Commit 5b4d0e7d65a63fcc89a1cc1a6a40efec6817d7f4
Merge branch 'develop' of http://172.16.29.40:8010/huhai/WMSV1 into develop
Showing
8 changed files
with
88 additions
and
73 deletions
src/main/java/com/huaheng/mobile/shipment/MobileTaskForASRSController2.java
... | ... | @@ -5,7 +5,9 @@ import com.huaheng.framework.aspectj.lang.annotation.Log; |
5 | 5 | import com.huaheng.framework.aspectj.lang.constant.BusinessType; |
6 | 6 | import com.huaheng.framework.web.domain.AjaxResult; |
7 | 7 | import com.huaheng.pc.receipt.receiptHeader.service.IReceiptHeaderService; |
8 | +import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentCombinationModel; | |
8 | 9 | import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentContainerHeader; |
10 | +import com.huaheng.pc.shipment.shipmentContainerHeader.service.IShipmentContainerHeaderService; | |
9 | 11 | import com.huaheng.pc.shipment.shipmentHeader.service.IShipmentHeaderService; |
10 | 12 | import com.huaheng.pc.task.task.domain.ShipmentTaskCreateModel; |
11 | 13 | import com.huaheng.pc.task.task.service.ITaskService; |
... | ... | @@ -16,6 +18,8 @@ import org.apache.ibatis.annotations.Param; |
16 | 18 | import org.springframework.web.bind.annotation.*; |
17 | 19 | |
18 | 20 | import javax.annotation.Resource; |
21 | +import java.util.ArrayList; | |
22 | +import java.util.List; | |
19 | 23 | import java.util.Map; |
20 | 24 | |
21 | 25 | @CrossOrigin |
... | ... | @@ -28,6 +32,8 @@ public class MobileTaskForASRSController2 { |
28 | 32 | private IShipmentHeaderService shipmentHeaderService; |
29 | 33 | @Resource |
30 | 34 | private ITaskService taskService; |
35 | + @Resource | |
36 | + private IShipmentContainerHeaderService shipmentContainerHeaderService; | |
31 | 37 | |
32 | 38 | @PostMapping("/getTaskDetail") |
33 | 39 | @ApiOperation("移动端扫描出库单") |
... | ... | @@ -46,7 +52,7 @@ public class MobileTaskForASRSController2 { |
46 | 52 | if (param.get("containerCode") == null || param.get("containerCode").trim().length() < 1) |
47 | 53 | throw new JSONException("容器号(containerCode)不能为空"); |
48 | 54 | String containerCode = param.get("containerCode"); |
49 | - int[] ids = {4}; | |
55 | + int[] ids = {5}; | |
50 | 56 | ShipmentTaskCreateModel model = new ShipmentTaskCreateModel(); |
51 | 57 | model.setTaskType(1); |
52 | 58 | model.setPriority((short)10); |
... | ... | @@ -55,6 +61,17 @@ public class MobileTaskForASRSController2 { |
55 | 61 | return result; |
56 | 62 | } |
57 | 63 | |
58 | - | |
59 | - | |
64 | + @PostMapping("/combination") | |
65 | + @ApiOperation("移动端生成出库组盘") | |
66 | + @Log(title = "移动端成出库组盘", action = BusinessType.OTHER) | |
67 | + public AjaxResult combination(@RequestBody @ApiParam(value = "出库组盘") Map<String, String> param) throws IllegalAccessException { | |
68 | + if (param.get("containerCode") == null || param.get("containerCode").trim().length() < 1) | |
69 | + throw new JSONException("容器号(containerCode)不能为空"); | |
70 | + String shipmentDetailId = param.get("shipmentDetailId"); | |
71 | + List<ShipmentCombinationModel> shipmentCombinationModels = new ArrayList<>(); | |
72 | + ShipmentCombinationModel model = new ShipmentCombinationModel(); | |
73 | +// model.setShipmentDetailId(); | |
74 | + AjaxResult result = shipmentContainerHeaderService.combination(shipmentCombinationModels); | |
75 | + return result; | |
76 | + } | |
60 | 77 | } |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiptHeader/service/ReceiptHeaderServiceImpl.java
src/main/java/com/huaheng/pc/shipment/shipmentHeader/mapper/ShipmentHeaderMapper.java
... | ... | @@ -43,5 +43,11 @@ public interface ShipmentHeaderMapper { |
43 | 43 | * @return |
44 | 44 | */ |
45 | 45 | List<Map<String, Object>> getContainerMaterial(@Param("containerCode") String containerCode); |
46 | + | |
47 | + /** | |
48 | + * 生成出库单编码 | |
49 | + * @return | |
50 | + */ | |
51 | + String createCode(String shipmentType); | |
46 | 52 | } |
47 | 53 | |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentHeader/service/IShipmentHeaderService.java
... | ... | @@ -53,12 +53,15 @@ public interface IShipmentHeaderService extends AutoService<ShipmentHeader> { |
53 | 53 | |
54 | 54 | |
55 | 55 | /** |
56 | - * 根据containerCode生成出库任务 | |
57 | - * @param containerCode | |
56 | + * 保存出库单头 | |
57 | + * @param shipmentHeader | |
58 | 58 | * @return |
59 | - * @throws IllegalAccessException | |
59 | + | |
60 | 60 | */ |
61 | - // AjaxResult<List<Map<String, Object>>> createShipTask(String containerCode) throws IllegalAccessException; | |
61 | + AjaxResult<Boolean> saveHeader(ShipmentHeader shipmentHeader) throws IllegalAccessException; | |
62 | + | |
63 | + | |
64 | + | |
62 | 65 | } |
63 | 66 | |
64 | 67 | |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentHeader/service/ShipmentHeaderServiceImpl.java
... | ... | @@ -8,11 +8,15 @@ import com.huaheng.pc.shipment.shipmentDetail.service.IShipmentDetailService; |
8 | 8 | import com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader; |
9 | 9 | import com.huaheng.pc.shipment.shipmentHeader.mapper.ShipmentHeaderAutoMapper; |
10 | 10 | import com.huaheng.pc.shipment.shipmentHeader.mapper.ShipmentHeaderMapper; |
11 | -import org.springframework.beans.factory.annotation.Autowired; | |
11 | +import com.huaheng.pc.system.dict.service.IDictDataService; | |
12 | +import com.huaheng.pc.task.task.domain.Task; | |
13 | +import com.huaheng.pc.task.taskDetail.domain.TaskDetail;import org.springframework.beans.factory.annotation.Autowired; | |
12 | 14 | import org.springframework.stereotype.Service; |
13 | 15 | import org.springframework.transaction.annotation.Transactional; |
16 | + | |
14 | 17 | import javax.annotation.Resource; |
15 | -import java.util.List; | |
18 | +import java.text.SimpleDateFormat; | |
19 | +import java.util.Date;import java.util.List; | |
16 | 20 | import java.util.Map; |
17 | 21 | |
18 | 22 | |
... | ... | @@ -29,7 +33,9 @@ public class ShipmentHeaderServiceImpl implements IShipmentHeaderService { |
29 | 33 | IShipmentDetailService shipmentDetailService; |
30 | 34 | @Autowired |
31 | 35 | IShipmentContainerHeaderService shipmentContainerHeaderService; |
32 | - @Resource | |
36 | + @Autowired | |
37 | + IDictDataService dictDataService; | |
38 | + @Resource | |
33 | 39 | private ShipmentHeaderMapper shipmentHeaderMapper; |
34 | 40 | @Resource |
35 | 41 | private ShipmentHeaderAutoMapper aotuMapper; |
... | ... | @@ -78,10 +84,7 @@ public class ShipmentHeaderServiceImpl implements IShipmentHeaderService { |
78 | 84 | |
79 | 85 | public int deleteByCondition(ShipmentHeader condition) { |
80 | 86 | return aotuMapper.deleteByCondition(condition); |
81 | - } | |
82 | - | |
83 | - | |
84 | - /** | |
87 | + } /** | |
85 | 88 | * 获取出库单头 |
86 | 89 | * @param condition |
87 | 90 | * @return |
... | ... | @@ -118,7 +121,7 @@ public class ShipmentHeaderServiceImpl implements IShipmentHeaderService { |
118 | 121 | */ |
119 | 122 | @Override |
120 | 123 | public AjaxResult updateHeard(ShipmentHeader shipmentHeader) { |
121 | - ShipmentHeader sh = this.selectEntityById(shipmentHeader.getId()); | |
124 | + ShipmentHeader sh = this.selectEntityById(shipmentHeader.getId()); | |
122 | 125 | if(sh == null){ |
123 | 126 | return AjaxResult.error("未找到出库单头"); |
124 | 127 | } |
... | ... | @@ -129,7 +132,7 @@ public class ShipmentHeaderServiceImpl implements IShipmentHeaderService { |
129 | 132 | shipmentHeader.setCreatedBy(null); |
130 | 133 | shipmentHeader.setLastUpdatedBy(ShiroUtils.getUser().getLoginName()); |
131 | 134 | shipmentHeader.setLastUpdated(null); |
132 | - if (this.updateByModel(shipmentHeader) > 0) | |
135 | + if (this.updateByModel(shipmentHeader) > 0) | |
133 | 136 | return AjaxResult.success(""); |
134 | 137 | else |
135 | 138 | return AjaxResult.error(""); |
... | ... | @@ -174,7 +177,7 @@ public class ShipmentHeaderServiceImpl implements IShipmentHeaderService { |
174 | 177 | * @return |
175 | 178 | */ |
176 | 179 | @Override |
177 | - public AjaxResult updateShipmentStatus(int shipmentId) { | |
180 | + public AjaxResult updateShipmentStatus(int shipmentId) { | |
178 | 181 | //获取这个单 |
179 | 182 | ShipmentHeader shipmentHeader = this.selectEntityById(shipmentId); |
180 | 183 | if(shipmentHeader==null){ |
... | ... | @@ -273,68 +276,50 @@ public class ShipmentHeaderServiceImpl implements IShipmentHeaderService { |
273 | 276 | if (shipmentHeader.getFirstStatus() < 200) |
274 | 277 | { |
275 | 278 | shipmentHeader.setFirstStatus(200); |
279 | + | |
276 | 280 | this.updateByModel(shipmentHeader); |
277 | 281 | } |
282 | + | |
278 | 283 | List<Map<String, Object>> detail = shipmentHeaderMapper.getShipDetail(shipCode); |
279 | 284 | return AjaxResult.success(detail); |
280 | 285 | } |
281 | 286 | |
282 | - /* @Override | |
283 | - public AjaxResult<List<Map<String, Object>>> createShipTask(String containerCode) throws IllegalAccessException { | |
284 | - ShipmentContainerHeader condition = new ShipmentContainerHeader(); | |
285 | - condition.setShipmentContainerCode(containerCode); | |
286 | - ShipmentContainerHeader shipmentContainerHeader = shipmentContainerHeaderService.selectFirstEntity(condition); | |
287 | - if (shipmentContainerHeader == null) | |
288 | - throw new ServiceException("该容器没有任务!"); | |
289 | - if (shipmentContainerHeader.getWarehouseId() != ShiroUtils.getUser().getWarehouseId()) | |
290 | - throw new ServiceException("容器不在当前仓库!"); | |
291 | - //查询容器里面的物料明细,生成任务和任务明细 | |
292 | - List<Map<String, Object>> result = this.baseMapper.getContainerMaterial(containerCode); | |
293 | - if (shipmentContainerHeader.getStatus() == 0) | |
287 | + @Override | |
288 | + public AjaxResult<Boolean> saveHeader(ShipmentHeader shipmentHeader) throws IllegalAccessException { | |
289 | + if(dictDataService.checkConfig("shipmentHeaderType", shipmentHeader.getType()) == false) | |
294 | 290 | { |
295 | - shipmentContainerHeader.setStatus(20); | |
296 | - shipmentContainerHeaderService.updateById(shipmentContainerHeader); | |
297 | - | |
298 | - //添加任务主表 | |
299 | - Task task = new Task(); | |
300 | - task.setCompanyId(0); | |
301 | - task.setWarehouseId(shipmentContainerHeader.getWarehouseId()); | |
302 | - task.setWarehouseCode(shipmentContainerHeader.getWarehouseCode()); | |
303 | - task.setPriority(10); | |
304 | - task.setType(shipmentContainerHeader.getTaskType()); | |
305 | - task.setContainerCode(shipmentContainerHeader.getReceiptContainerCode()); | |
306 | - task.setDestinationLocation(shipmentContainerHeader.getLocationCode()); | |
307 | - task.setContainerCode(shipmentContainerHeader.getReceiptContainerCode()); | |
308 | - task.setStatus(20); | |
309 | - task.setCreated(new Date()); | |
310 | - task.setCreatedBy(ShiroUtils.getUser().getLoginName()); | |
311 | - task.setBeginTime(new Date()); | |
312 | - this.insert(task); | |
313 | - | |
314 | - //添加任务明细表 | |
315 | - for(Map<String, Object> map : returnValue) | |
316 | - { | |
317 | - TaskDetail taskDetail = new TaskDetail(); | |
318 | - taskDetail.setTaskId(task.getId()); | |
319 | - taskDetail.setWarehouseId(task.getWarehouseId()); | |
320 | - taskDetail.setWarehouseCode(task.getWarehouseCode()); | |
321 | - taskDetail.setMaterialCode(DataUtils.getString(map.get("barcode"))); | |
322 | - taskDetail.setMaterialName(DataUtils.getString(map.get("name"))); | |
323 | - taskDetail.setAllocationId(DataUtils.getInteger(map.get("id"))); | |
324 | - taskDetail.setContainerCode(task.getContainerCode()); | |
325 | - taskDetail.setDestinationLocation(task.getDestinationLocation()); | |
326 | - taskDetail.setStatus(20); | |
327 | - taskDetailService.insert(taskDetail); | |
328 | - } | |
329 | - //修改库位状态 | |
330 | - Location locationRecord = new Location(); | |
331 | - locationRecord.setStatus("lock"); | |
332 | - Location locationCondition = new Location(); | |
333 | - locationCondition.setCode(task.getDestinationLocation()); | |
334 | - locationService.updateByCondition(locationRecord, locationCondition); | |
291 | + return AjaxResult.error("没有对应的出库单类型"); | |
335 | 292 | } |
336 | - return null; | |
337 | - } */ | |
293 | + String code = createCode(shipmentHeader.getType()); | |
294 | + shipmentHeader.setId(null); | |
295 | + shipmentHeader.setLastUpdated(null); | |
296 | + shipmentHeader.setLastUpdatedBy(null); | |
297 | + shipmentHeader.setCreated(null); | |
298 | + shipmentHeader.setCreatedBy(ShiroUtils.getUser().getLoginName()); | |
299 | + shipmentHeader.setWarehouseId(ShiroUtils.getUser().getWarehouseId()); | |
300 | + shipmentHeader.setWarehouseCode(ShiroUtils.getUser().getWarehouseCode()); | |
301 | + shipmentHeader.setCode(code); | |
302 | + shipmentHeader.setUploadStatus(0); | |
303 | + boolean result = this.insert(shipmentHeader) > 0; | |
304 | + return AjaxResult.toAjax(result); | |
305 | + } | |
338 | 306 | |
307 | + private String createCode(String shipmentHeaderType) | |
308 | + { | |
309 | + String code = null; | |
310 | + Date now = new Date(); | |
311 | + SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd"); | |
312 | + String maxCode = shipmentHeaderMapper.createCode(shipmentHeaderType); | |
313 | + if (maxCode != null && maxCode.length() > 13 && maxCode.substring(maxCode.length() - 13, maxCode.length() - 5).equals(df.format(now))) | |
314 | + { | |
315 | + Integer Count = Integer.valueOf(maxCode.substring(maxCode.length() - 5, maxCode.length())); | |
316 | + code = shipmentHeaderType + df.format(now) + String.format("%05d", Count + 1); | |
317 | + } | |
318 | + else | |
319 | + { | |
320 | + code = shipmentHeaderType + df.format(now) + "00001"; | |
321 | + } | |
322 | + return code; | |
323 | + } | |
339 | 324 | |
340 | 325 | } |
... | ... |
src/main/resources/mybatis/shipment/ShipmentHeaderMapper.xml
... | ... | @@ -26,6 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
26 | 26 | FROM shipment_detail WHERE shipmentCode = #{code,jdbcType=VARCHAR} |
27 | 27 | </insert> |
28 | 28 | |
29 | + | |
29 | 30 | <select id="list" resultType="com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader"> |
30 | 31 | select * from shipment_header |
31 | 32 | <where> |
... | ... | @@ -66,4 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
66 | 67 | INNER JOIN receipt_detail rd ON rd.id = rcd.receiptDetailId |
67 | 68 | INNER JOIN material m ON rd.materialId = m.id AND m.deleted = FALSE |
68 | 69 | </select> |
70 | + <select id="createCode" resultType="java.lang.String"> | |
71 | + SELECT code FROM shipment_header WHERE type = #{shipmentType,jdbcType=VARCHAR} ORDER BY id DESC LIMIT 1 | |
72 | + </select> | |
69 | 73 | </mapper> |
70 | 74 | \ No newline at end of file |
... | ... |
src/main/resources/static/img/jt.png
0 → 100644
1.11 KB
src/main/resources/templates/receipt/receiving/receiving.html
... | ... | @@ -20,7 +20,6 @@ |
20 | 20 | </div> |
21 | 21 | </form> |
22 | 22 | </div> |
23 | - | |
24 | 23 | <div class="col-sm-12 select-info table-striped"> |
25 | 24 | <table id="bootstrap-table" data-mobile-responsive="true"></table> |
26 | 25 | </div> |
... | ... | @@ -88,6 +87,7 @@ |
88 | 87 | return actions.join(''); |
89 | 88 | } |
90 | 89 | }] |
90 | + | |
91 | 91 | }; |
92 | 92 | $.table.init(options); |
93 | 93 | }); |
... | ... |