Commit 4e37be5a42c0d4ae2cdb626b8c66efe219f0ee2a
Merge remote-tracking branch 'origin/develop' into develop
# Conflicts: # .idea/workspace.xml
Showing
16 changed files
with
508 additions
and
217 deletions
src/main/java/com/huaheng/pc/config/material/controller/MaterialController.java
... | ... | @@ -108,35 +108,7 @@ public class MaterialController extends BaseController { |
108 | 108 | @ResponseBody |
109 | 109 | public AjaxResult addSave(Material material) { |
110 | 110 | |
111 | - LambdaQueryWrapper<Material> lambda = Wrappers.lambdaQuery(); | |
112 | - lambda.eq(Material::getCode, material.getCode()) | |
113 | - .eq(Material::getWarehouseCode, ShiroUtils.getWarehouseCode()) | |
114 | - .eq(Material::getDeleted, false); | |
115 | - Map<String, Object> map = materialService.getMap(lambda); | |
116 | - if (map != null) { | |
117 | - return AjaxResult.error("物料已经存在"); | |
118 | - } | |
119 | - LambdaQueryWrapper<MaterialUnit> lambdaQueryWrapper = Wrappers.lambdaQuery(); | |
120 | - lambdaQueryWrapper.eq(MaterialUnit::getMaterialCode, material.getCode()) | |
121 | - .eq(MaterialUnit::getUnit, material.getUnit()); | |
122 | - if (materialUnitService.getOne(lambdaQueryWrapper) == null){ | |
123 | - MaterialUnit materialUnit = new MaterialUnit(); | |
124 | - materialUnit.setMaterialCode(material.getCode()); | |
125 | - materialUnit.setMaterialName(material.getName()); | |
126 | - materialUnit.setMaterialSpec(material.getSpec()); | |
127 | - materialUnit.setCompanyCode(material.getCompanyCode()); | |
128 | - materialUnit.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
129 | - materialUnit.setUnit(material.getUnit()); | |
130 | - materialUnit.setCreatedBy(ShiroUtils.getLoginName()); | |
131 | - materialUnit.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
132 | - | |
133 | - materialUnitService.save(materialUnit); | |
134 | - } | |
135 | - | |
136 | - material.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
137 | - material.setCreatedBy(ShiroUtils.getLoginName()); | |
138 | - material.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
139 | - return AjaxResult.toAjax(materialService.save(material)); | |
111 | + return materialService.addSave(material); | |
140 | 112 | } |
141 | 113 | |
142 | 114 | /** |
... | ... |
src/main/java/com/huaheng/pc/config/material/service/MaterialService.java
... | ... | @@ -13,5 +13,10 @@ public interface MaterialService extends IService<Material>{ |
13 | 13 | |
14 | 14 | String importMaterial(List<Material> materialList, Boolean updateSupport,String operName); |
15 | 15 | |
16 | - | |
16 | + /** | |
17 | + * 添加物料 | |
18 | + * @param material | |
19 | + * @return | |
20 | + */ | |
21 | + AjaxResult addSave(Material material); | |
17 | 22 | } |
... | ... |
src/main/java/com/huaheng/pc/config/material/service/MaterialServiceImpl.java
... | ... | @@ -7,10 +7,15 @@ import com.huaheng.common.support.Convert; |
7 | 7 | import com.huaheng.common.utils.StringUtils; |
8 | 8 | import com.huaheng.common.utils.security.ShiroUtils; |
9 | 9 | import com.huaheng.framework.web.domain.AjaxResult; |
10 | +import com.huaheng.pc.config.materialType.domain.MaterialType; | |
11 | +import com.huaheng.pc.config.materialType.service.MaterialTypeService; | |
12 | +import com.huaheng.pc.config.materialUnit.domain.MaterialUnit; | |
13 | +import com.huaheng.pc.config.materialUnit.service.MaterialUnitService; | |
10 | 14 | import com.huaheng.pc.receipt.receiptDetail.domain.ReceiptDetail; |
11 | 15 | import com.huaheng.pc.receipt.receiptDetail.service.ReceiptDetailService; |
12 | 16 | import org.springframework.stereotype.Service; |
13 | 17 | import javax.annotation.Resource; |
18 | +import java.lang.ref.WeakReference; | |
14 | 19 | import java.util.List; |
15 | 20 | import java.util.Map; |
16 | 21 | |
... | ... | @@ -23,6 +28,10 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i |
23 | 28 | |
24 | 29 | @Resource |
25 | 30 | private ReceiptDetailService receiptDetailService; |
31 | + @Resource | |
32 | + private MaterialUnitService materialUnitService; | |
33 | + @Resource | |
34 | + private MaterialTypeService materialTypeService; | |
26 | 35 | |
27 | 36 | @Override |
28 | 37 | public AjaxResult removeByIds(String ids) { |
... | ... | @@ -94,4 +103,60 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i |
94 | 103 | } |
95 | 104 | return successMsg.toString(); |
96 | 105 | } |
106 | + | |
107 | + /** | |
108 | + * 添加物料 | |
109 | + * @param material | |
110 | + * @return | |
111 | + */ | |
112 | + @Override | |
113 | + public AjaxResult addSave(Material material) { | |
114 | + LambdaQueryWrapper<Material> lambda = Wrappers.lambdaQuery(); | |
115 | + //如果物料编码为空则生成物料编码 | |
116 | + if (material.getCode() == null) { | |
117 | + material.setCode(createCode(material.getType())); | |
118 | + } | |
119 | + lambda.eq(Material::getCode, material.getCode()) | |
120 | + .eq(Material::getWarehouseCode, ShiroUtils.getWarehouseCode()) | |
121 | + .eq(Material::getDeleted, false); | |
122 | + Map<String, Object> map = this.getMap(lambda); | |
123 | + if (map != null) { | |
124 | + return AjaxResult.error("物料已经存在"); | |
125 | + } | |
126 | + | |
127 | + LambdaQueryWrapper<MaterialUnit> lambdaQueryWrapper = Wrappers.lambdaQuery(); | |
128 | + lambdaQueryWrapper.eq(MaterialUnit::getMaterialCode, material.getCode()) | |
129 | + .eq(MaterialUnit::getUnit, material.getUnit()); | |
130 | + //如果不存在该物料的单位是新建物料单位 | |
131 | + if (materialUnitService.getOne(lambdaQueryWrapper) == null){ | |
132 | + MaterialUnit materialUnit = new MaterialUnit(); | |
133 | + materialUnit.setMaterialCode(material.getCode()); | |
134 | + materialUnit.setMaterialName(material.getName()); | |
135 | + materialUnit.setMaterialSpec(material.getSpec()); | |
136 | + materialUnit.setCompanyCode(material.getCompanyCode()); | |
137 | + materialUnit.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
138 | + materialUnit.setUnit(material.getUnit()); | |
139 | + materialUnit.setCreatedBy(ShiroUtils.getLoginName()); | |
140 | + materialUnit.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
141 | + | |
142 | + materialUnitService.save(materialUnit); | |
143 | + } | |
144 | + material.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
145 | + material.setCreatedBy(ShiroUtils.getLoginName()); | |
146 | + material.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
147 | + return null; | |
148 | + } | |
149 | + | |
150 | + /** | |
151 | + * 生成物料编码 | |
152 | + * @param code | |
153 | + * @return | |
154 | + */ | |
155 | + private String createCode(String code){ | |
156 | + LambdaQueryWrapper<MaterialType> lambda = Wrappers.lambdaQuery(); | |
157 | + lambda.eq(MaterialType::getCode, code); | |
158 | + MaterialType materialType = materialTypeService.getOne(lambda); | |
159 | + | |
160 | + return String.format(materialType.getAutoGenSerialNumFormat(), materialType.getTrackSerialNum()); | |
161 | + } | |
97 | 162 | } |
... | ... |
src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailService.java
... | ... | @@ -3,6 +3,7 @@ package com.huaheng.pc.inventory.inventoryDetail.service; |
3 | 3 | import com.baomidou.mybatisplus.extension.service.IService; |
4 | 4 | import com.huaheng.framework.web.domain.AjaxResult; |
5 | 5 | import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail; |
6 | +import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail; | |
6 | 7 | |
7 | 8 | import java.util.List; |
8 | 9 | |
... | ... | @@ -11,7 +12,7 @@ public interface InventoryDetailService extends IService<InventoryDetail> { |
11 | 12 | |
12 | 13 | AjaxResult detailcreateCheckOutTask (Integer id); |
13 | 14 | |
14 | - List<InventoryDetail> selectBysql(String sql); | |
15 | + List<InventoryDetail> selectBysql(String sql, ShipmentDetail shipmentDetail); | |
15 | 16 | |
16 | 17 | } |
17 | 18 | |
... | ... |
src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailServiceImpl.java
... | ... | @@ -9,6 +9,7 @@ import com.huaheng.framework.web.domain.AjaxResult; |
9 | 9 | import com.huaheng.pc.config.location.domain.Location; |
10 | 10 | import com.huaheng.pc.config.location.service.LocationService; |
11 | 11 | import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail; |
12 | +import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail; | |
12 | 13 | import com.huaheng.pc.task.taskDetail.domain.TaskDetail; |
13 | 14 | import com.huaheng.pc.task.taskDetail.service.TaskDetailService; |
14 | 15 | import com.huaheng.pc.task.taskHeader.domain.TaskHeader; |
... | ... | @@ -103,7 +104,11 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe |
103 | 104 | } |
104 | 105 | |
105 | 106 | @Override |
106 | - public List<InventoryDetail> selectBysql(String sql) { | |
107 | + public List<InventoryDetail> selectBysql(String sql, ShipmentDetail shipmentDetail) { | |
108 | + sql=sql+" \n" +"and warehouseCode='" + shipmentDetail.getWarehouseCode()+"' \n" + | |
109 | + "and companyCode='" + shipmentDetail.getCompanyCode()+"' \n" + | |
110 | + "and materialCode='" + shipmentDetail.getMaterialCode() +"' \n" + | |
111 | + "and inventorySts='" + shipmentDetail.getInventorySts() + "'"; | |
107 | 112 | return inventoryDetailMapper.selectBysql(sql); |
108 | 113 | } |
109 | 114 | |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiptDetail/service/ReceiptDetailServiceImpl.java
... | ... | @@ -154,8 +154,9 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
154 | 154 | * @param receiptDetail |
155 | 155 | * @return |
156 | 156 | */ |
157 | + @Transactional | |
157 | 158 | public ReceiptDetail queryflow(ReceiptDetail receiptDetail){ |
158 | - | |
159 | + //当单据状态为驳回或作废时不更新状态 | |
159 | 160 | if ("10".equals(receiptDetail.getProcessStamp()) || "20".equals(receiptDetail.getProcessStamp())){ |
160 | 161 | return receiptDetail; |
161 | 162 | } |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/service/ShipmentContainerHeaderServiceImpl.java
... | ... | @@ -21,7 +21,10 @@ import com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader; |
21 | 21 | import com.huaheng.pc.shipment.shipmentHeader.service.ShipmentHeaderService; |
22 | 22 | import com.huaheng.pc.shipment.shippingCombination.domain.ShippingSearch; |
23 | 23 | import com.huaheng.pc.shipment.shippingCombination.service.ShippingCombinationService; |
24 | +import com.huaheng.pc.task.taskDetail.domain.TaskDetail; | |
25 | +import com.huaheng.pc.task.taskDetail.service.TaskDetailService; | |
24 | 26 | import com.huaheng.pc.task.taskHeader.domain.ShipmentTaskCreateModel; |
27 | +import com.huaheng.pc.task.taskHeader.domain.TaskHeader; | |
25 | 28 | import com.huaheng.pc.task.taskHeader.service.TaskHeaderService; |
26 | 29 | import org.springframework.beans.factory.annotation.Autowired; |
27 | 30 | import org.springframework.stereotype.Service; |
... | ... | @@ -58,6 +61,8 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
58 | 61 | private ShippingCombinationService shippingCombinationService; |
59 | 62 | @Autowired |
60 | 63 | private TaskHeaderService taskHeaderService; |
64 | + @Autowired | |
65 | + private TaskDetailService taskDetailService; | |
61 | 66 | |
62 | 67 | |
63 | 68 | @Override |
... | ... | @@ -106,24 +111,26 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
106 | 111 | Location location = locationService.getOne(lambdaQueryWrapper); |
107 | 112 | if (location == null) |
108 | 113 | throw new ServiceException("库位 "+ inventoryDetail.getLocationCode() +" 不存在"); |
109 | - if (location.getStatus().equals("lock")) { | |
110 | - //如果库位状态是锁定的话,就查找出库组盘表,如果存在未下发 | |
111 | - LambdaQueryWrapper<ShipmentContainerHeader> lam=Wrappers.lambdaQuery(); | |
112 | - lam.eq(ShipmentContainerHeader::getWarehouseCode,ShiroUtils.getWarehouseCode()) | |
113 | - .eq(ShipmentContainerHeader::getContainerCode,location.getContainerCode()) | |
114 | - .eq(ShipmentContainerHeader::getTaskCreated,0); | |
115 | - ShipmentContainerHeader shipmentContainerHeader = this.getOne(lam); | |
116 | - if (shipmentContainerHeader == null) { | |
117 | - throw new ServiceException("库位已经锁定不能使用"); | |
118 | - } | |
119 | - } | |
114 | +// if (location.getStatus().equals("lock")) { | |
115 | +// //如果库位状态是锁定的话,就查找出库组盘表,如果存在未下发 | |
116 | +// LambdaQueryWrapper<ShipmentContainerHeader> lam=Wrappers.lambdaQuery(); | |
117 | +// lam.eq(ShipmentContainerHeader::getWarehouseCode,ShiroUtils.getWarehouseCode()) | |
118 | +// .eq(ShipmentContainerHeader::getContainerCode,location.getContainerCode()) | |
119 | +// .eq(ShipmentContainerHeader::getTaskCreated,0); | |
120 | +// ShipmentContainerHeader shipmentContainerHeader = this.getOne(lam); | |
121 | +// if (shipmentContainerHeader == null) { | |
122 | +// throw new ServiceException("库位已经锁定不能使用"); | |
123 | +// } | |
124 | +// } | |
120 | 125 | |
121 | 126 | //更新库存分配数 |
122 | 127 | inventoryDetail.setTaskQty(inventoryDetail.getTaskQty().add(shipmentCombinationModel.getShipQty())); |
123 | 128 | inventoryDetailService.saveOrUpdate(inventoryDetail); |
124 | 129 | //获取库位,然后锁定 |
125 | - location.setStatus("lock"); | |
126 | - locationService.saveOrUpdate(location); | |
130 | + if(location.getStatus().equals("empty")) { | |
131 | + location.setStatus("lock"); | |
132 | + locationService.saveOrUpdate(location); | |
133 | + } | |
127 | 134 | //更新单据明细的已出库数量 |
128 | 135 | shipmentDetail.setRequestQty(shipmentDetail.getRequestQty().add(shipmentCombinationModel.getShipQty())); |
129 | 136 | int i = shipmentDetail.getShipQty().compareTo(shipmentDetail.getRequestQty()); |
... | ... | @@ -166,20 +173,19 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
166 | 173 | LambdaQueryWrapper<ShipmentContainerHeader> lambdaQueryWrapper=Wrappers.lambdaQuery(); |
167 | 174 | lambdaQueryWrapper.eq(ShipmentContainerHeader::getContainerCode,location.getContainerCode()) |
168 | 175 | .eq(ShipmentContainerHeader::getWarehouseCode,ShiroUtils.getWarehouseCode()) |
169 | - .eq(ShipmentContainerHeader::getTaskCreated,1) | |
170 | - .eq(ShipmentContainerHeader::getStatus,10); | |
176 | + .le(ShipmentContainerHeader::getStatus,20); | |
171 | 177 | ShipmentContainerHeader shipmentContainerHeader = this.getOne(lambdaQueryWrapper); |
172 | 178 | if(shipmentContainerHeader != null) { |
173 | - throw new ServiceException("容器"+location.getContainerCode()+"已经生成任务,不能再添加明细;操作中止;"); | |
179 | + return shipmentContainerHeader; | |
174 | 180 | } |
175 | 181 | else { |
176 | - LambdaQueryWrapper<ShipmentContainerHeader> lam=Wrappers.lambdaQuery(); | |
177 | - lam.eq(ShipmentContainerHeader::getContainerCode,location.getContainerCode()) | |
178 | - .eq(ShipmentContainerHeader::getWarehouseCode,ShiroUtils.getWarehouseCode()) | |
179 | - .eq(ShipmentContainerHeader::getTaskCreated,0) | |
180 | - .eq(ShipmentContainerHeader::getStatus,0); | |
181 | - shipmentContainerHeader = this.getOne(lam); | |
182 | - if (shipmentContainerHeader == null) { | |
182 | +// LambdaQueryWrapper<ShipmentContainerHeader> lam=Wrappers.lambdaQuery(); | |
183 | +// lam.eq(ShipmentContainerHeader::getContainerCode,location.getContainerCode()) | |
184 | +// .eq(ShipmentContainerHeader::getWarehouseCode,ShiroUtils.getWarehouseCode()) | |
185 | +// .eq(ShipmentContainerHeader::getTaskCreated,0) | |
186 | +// .eq(ShipmentContainerHeader::getStatus,0); | |
187 | +// shipmentContainerHeader = this.getOne(lam); | |
188 | +// if (shipmentContainerHeader == null) { | |
183 | 189 | shipmentContainerHeader = new ShipmentContainerHeader(); |
184 | 190 | shipmentContainerHeader.setContainerCode(location.getContainerCode()); |
185 | 191 | shipmentContainerHeader.setLocationCode(location.getCode()); |
... | ... | @@ -194,9 +200,9 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
194 | 200 | // material.setCode(shipmentDetail.getMaterialCode()); |
195 | 201 | // shipmentContainerHeader.setZoneCode(materialService.selectFirstEntity(material).getZoneCode()); |
196 | 202 | this.save(shipmentContainerHeader); |
203 | + return shipmentContainerHeader; | |
197 | 204 | } |
198 | - } | |
199 | - return shipmentContainerHeader; | |
205 | +// } | |
200 | 206 | } |
201 | 207 | |
202 | 208 | /** |
... | ... | @@ -246,6 +252,45 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
246 | 252 | shipmentContainerDetail.setCreatedBy(ShiroUtils.getLoginName()); |
247 | 253 | shipmentContainerDetailService.save(shipmentContainerDetail); |
248 | 254 | } |
255 | + | |
256 | + // | |
257 | + if(shipmentContainerHeader.getStatus()<=10){ | |
258 | + LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper=Wrappers.lambdaQuery(); | |
259 | + taskHeaderLambdaQueryWrapper.eq(TaskHeader::getWarehouseCode,shipmentContainerHeader.getWarehouseCode()) | |
260 | + .eq(TaskHeader::getInternalTaskType,200) | |
261 | + .eq(TaskHeader::getAllocationHeadId,shipmentContainerHeader.getId()); | |
262 | + TaskHeader taskHeader=taskHeaderService.getOne(taskHeaderLambdaQueryWrapper); | |
263 | + if(taskHeader==null){ | |
264 | + throw new ServiceException("找不到相应的任务头"); | |
265 | + } | |
266 | + TaskDetail taskDetail = new TaskDetail(); | |
267 | + taskDetail.setTaskId(taskHeader.getId()); | |
268 | + taskDetail.setInternalTaskType(taskHeader.getInternalTaskType()); | |
269 | + taskDetail.setWarehouseCode(taskHeader.getWarehouseCode()); | |
270 | + taskDetail.setCompanyCode(taskHeader.getCompanyCode()); | |
271 | + taskDetail.setTaskType(taskHeader.getTaskType()); | |
272 | + taskDetail.setAllocationId(shipmentContainerDetail.getId()); | |
273 | + taskDetail.setBillCode(shipmentContainerDetail.getShipmentCode()); | |
274 | + taskDetail.setBillDetailId(shipmentContainerDetail.getShipmentDetailId()); | |
275 | + taskDetail.setMaterialCode(shipmentContainerDetail.getMaterialCode()); | |
276 | + taskDetail.setMaterialName(shipmentContainerDetail.getMaterialName()); | |
277 | + taskDetail.setMaterialSpec(shipmentContainerDetail.getMaterialSpec()); | |
278 | + taskDetail.setMaterialUnit(shipmentContainerDetail.getMaterialUnit()); | |
279 | + taskDetail.setFromInventoryId(shipmentContainerDetail.getInventoryId()); | |
280 | + taskDetail.setQty(shipmentContainerDetail.getQty()); | |
281 | + taskDetail.setContainerCode(taskHeader.getContainerCode()); | |
282 | + taskDetail.setFromLocation(taskHeader.getFromLocation()); | |
283 | + taskDetail.setToLocation(taskHeader.getToLocation()); | |
284 | + if(shipmentContainerHeader.getStatus()==10) { | |
285 | + taskDetail.setStatus(0); | |
286 | + }else { | |
287 | + taskDetail.setStatus(10); | |
288 | + } | |
289 | + taskDetail.setTaskType(taskHeader.getTaskType()); | |
290 | + taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
291 | + taskDetail.setLastUpdated(null); | |
292 | + taskDetailService.save(taskDetail); | |
293 | + } | |
249 | 294 | return shipmentContainerDetail; |
250 | 295 | } |
251 | 296 | |
... | ... | @@ -360,13 +405,13 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
360 | 405 | continue; |
361 | 406 | } |
362 | 407 | // 根据 仓库编码、货主编码、存货编码,物料状态,项目号来查找可以出库的物料 |
363 | - ShippingSearch search = new ShippingSearch(); | |
364 | - search.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
365 | - search.setCompanyCode(item.getCompanyCode()); | |
366 | - search.setMaterialCode(item.getMaterialCode()); | |
367 | - search.setInventorySts(item.getInventorySts()); //物料状态 | |
408 | +// ShippingSearch search = new ShippingSearch(); | |
409 | +// search.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
410 | +// search.setCompanyCode(item.getCompanyCode()); | |
411 | +// search.setMaterialCode(item.getMaterialCode()); | |
412 | +// search.setInventorySts(item.getInventorySts()); //物料状态 | |
368 | 413 | |
369 | - List<InventoryDetail> inventoryList = shippingCombinationService.getInventorys(search); | |
414 | + List<InventoryDetail> inventoryList = shippingCombinationService.getInventorys(item); | |
370 | 415 | if (inventoryList.size() < 1) { |
371 | 416 | num = num + 1; |
372 | 417 | } else { |
... | ... |
src/main/java/com/huaheng/pc/shipment/shippingCombination/controller/ShippingCombinationController.java
... | ... | @@ -42,8 +42,7 @@ public class ShippingCombinationController extends BaseController { |
42 | 42 | |
43 | 43 | private String prefix = "shipment/shippingCombination"; |
44 | 44 | |
45 | - @Autowired | |
46 | - MaterialServiceImpl materialService; | |
45 | + | |
47 | 46 | @Autowired |
48 | 47 | ShipmentDetailServiceImpl shipmentDetailService; |
49 | 48 | @Autowired |
... | ... | @@ -54,14 +53,6 @@ public class ShippingCombinationController extends BaseController { |
54 | 53 | ShipmentContainerDetailService shipmentContainerDetailService; |
55 | 54 | @Autowired |
56 | 55 | ShipmentHeaderService shipmentHeaderService; |
57 | - @Autowired | |
58 | - InventoryDetailService inventoryDetailService; | |
59 | - @Autowired | |
60 | - ConfigValueService configValueService; | |
61 | - @Autowired | |
62 | - FilterConfigDetailService filterConfigDetailService; | |
63 | - @Autowired | |
64 | - ShipmentPreferenceService shipmentPreferenceService; | |
65 | 56 | |
66 | 57 | |
67 | 58 | /** |
... | ... | @@ -152,72 +143,8 @@ public class ShippingCombinationController extends BaseController { |
152 | 143 | throw new ServiceException("找不到子单"); |
153 | 144 | } |
154 | 145 | |
146 | + List<InventoryDetail> list=shippingCombinationService.getInventorys(shipmentDetail); | |
155 | 147 | //查找分配规则 |
156 | - List<InventoryDetail> list=new ArrayList<>(); | |
157 | - FilterConfigDetail filterConfigDetail=new FilterConfigDetail(); | |
158 | - LambdaQueryWrapper<FilterConfigDetail> filterConfigDetailLambdaQueryWrapper=Wrappers.lambdaQuery(); | |
159 | - filterConfigDetailLambdaQueryWrapper.eq(FilterConfigDetail::getWarehouseCode,shipmentDetail.getWarehouseCode()); | |
160 | - | |
161 | - //出库子单的分配规则有时,优先出库子单的分配规则 | |
162 | - if(StringUtils.isNotEmpty(shipmentDetail.getAllocationRule())){ | |
163 | - filterConfigDetailLambdaQueryWrapper.eq(FilterConfigDetail::getCode,shipmentDetail.getAllocationRule()); | |
164 | - filterConfigDetail=filterConfigDetailService.getOne(filterConfigDetailLambdaQueryWrapper); | |
165 | - if(filterConfigDetail==null){ | |
166 | - throw new ServiceException("出库子单出库规则配置不存在"); | |
167 | - } | |
168 | - | |
169 | - //根据sql查库存 | |
170 | - try { | |
171 | - list = inventoryDetailService.selectBysql(filterConfigDetail.getStatement()); | |
172 | - }catch (Exception e){ | |
173 | - throw new ServiceException("sql错误"); | |
174 | - } | |
175 | - return getDataTable(list); | |
176 | - } | |
177 | - | |
178 | - //出库子单的分配规则没有时,优先物料的分配规则 | |
179 | - LambdaQueryWrapper<Material> materialLambdaQueryWrapper=Wrappers.lambdaQuery(); | |
180 | - materialLambdaQueryWrapper.eq(Material::getCode,shipmentDetail.getMaterialCode()) | |
181 | - .eq(Material::getWarehouseCode,shipmentDetail.getWarehouseCode()); | |
182 | - Material material=materialService.getOne(materialLambdaQueryWrapper); | |
183 | - if(StringUtils.isNotEmpty(material.getAllocationRule())){ | |
184 | - filterConfigDetailLambdaQueryWrapper.eq(FilterConfigDetail::getCode,material.getAllocationRule()); | |
185 | - filterConfigDetail=filterConfigDetailService.getOne(filterConfigDetailLambdaQueryWrapper); | |
186 | - if(filterConfigDetail==null){ | |
187 | - throw new ServiceException("物料出库规则配置不存在"); | |
188 | - } | |
189 | - | |
190 | - //根据sql查库存 | |
191 | - list=inventoryDetailService.selectBysql(filterConfigDetail.getStatement()); | |
192 | - return getDataTable(list); | |
193 | - } | |
194 | - | |
195 | - //都没有时,默认仓库的分配规则 | |
196 | - LambdaQueryWrapper<ConfigValue> configValueLambdaQueryWrapper=Wrappers.lambdaQuery(); | |
197 | - configValueLambdaQueryWrapper.eq(ConfigValue::getModuleType,"shipment") | |
198 | - .eq(ConfigValue::getWarehouseCode,shipmentDetail.getWarehouseCode()); | |
199 | - ConfigValue configValue=configValueService.getOne(configValueLambdaQueryWrapper); | |
200 | - if(configValue==null){ | |
201 | - throw new ServiceException("仓库的出库配置不存在"); | |
202 | - } | |
203 | - | |
204 | - //查找出库首选项 | |
205 | - LambdaQueryWrapper<ShipmentPreference> slam=Wrappers.lambdaQuery(); | |
206 | - slam.eq(ShipmentPreference::getCode,configValue.getIdentifier()) | |
207 | - .eq(ShipmentPreference::getWarehouseCode,configValue.getWarehouseCode()); | |
208 | - ShipmentPreference shipmentPreference=shipmentPreferenceService.getOne(slam); | |
209 | - if(shipmentPreference==null){ | |
210 | - throw new ServiceException("仓库的出库配置中出库首选项不存在"); | |
211 | - } | |
212 | - //查找分配规则 | |
213 | - filterConfigDetailLambdaQueryWrapper.eq(FilterConfigDetail::getCode,shipmentPreference.getAllocationRule()); | |
214 | - filterConfigDetail=filterConfigDetailService.getOne(filterConfigDetailLambdaQueryWrapper); | |
215 | - if(filterConfigDetail==null){ | |
216 | - throw new ServiceException("出库首选项中出库规则配置不存在"); | |
217 | - } | |
218 | - | |
219 | - //根据sql查库存 | |
220 | - list=inventoryDetailService.selectBysql(filterConfigDetail.getStatement()); | |
221 | 148 | return getDataTable(list); |
222 | 149 | } |
223 | 150 | |
... | ... |
src/main/java/com/huaheng/pc/shipment/shippingCombination/service/ShippingCombinationService.java
1 | 1 | package com.huaheng.pc.shipment.shippingCombination.service; |
2 | 2 | |
3 | 3 | |
4 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
5 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
6 | +import com.huaheng.common.exception.service.ServiceException; | |
7 | +import com.huaheng.common.utils.StringUtils; | |
8 | +import com.huaheng.pc.config.FilterConfigDetail.domain.FilterConfigDetail; | |
9 | +import com.huaheng.pc.config.FilterConfigDetail.service.FilterConfigDetailService; | |
10 | +import com.huaheng.pc.config.configValue.domain.ConfigValue; | |
11 | +import com.huaheng.pc.config.configValue.service.ConfigValueService; | |
12 | +import com.huaheng.pc.config.material.domain.Material; | |
13 | +import com.huaheng.pc.config.material.service.MaterialServiceImpl; | |
14 | +import com.huaheng.pc.config.shipmentPreference.domain.ShipmentPreference; | |
15 | +import com.huaheng.pc.config.shipmentPreference.service.ShipmentPreferenceService; | |
4 | 16 | import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail; |
17 | +import com.huaheng.pc.inventory.inventoryDetail.service.InventoryDetailService; | |
18 | +import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail; | |
5 | 19 | import com.huaheng.pc.shipment.shippingCombination.domain.ShippingSearch; |
6 | 20 | import com.huaheng.pc.shipment.shippingCombination.mapper.ShippingCombinationMapper; |
21 | +import org.springframework.beans.factory.annotation.Autowired; | |
7 | 22 | import org.springframework.stereotype.Service; |
8 | 23 | |
9 | 24 | import javax.annotation.Resource; |
25 | +import java.util.ArrayList; | |
10 | 26 | import java.util.List; |
11 | 27 | |
12 | 28 | |
... | ... | @@ -15,10 +31,86 @@ public class ShippingCombinationService { |
15 | 31 | |
16 | 32 | @Resource |
17 | 33 | private ShippingCombinationMapper shippingCombinationMapper; |
34 | + @Autowired | |
35 | + InventoryDetailService inventoryDetailService; | |
36 | + @Autowired | |
37 | + ConfigValueService configValueService; | |
38 | + @Autowired | |
39 | + FilterConfigDetailService filterConfigDetailService; | |
40 | + @Autowired | |
41 | + ShipmentPreferenceService shipmentPreferenceService; | |
42 | + @Autowired | |
43 | + MaterialServiceImpl materialService; | |
18 | 44 | |
19 | 45 | |
20 | - public List<InventoryDetail> getInventorys(ShippingSearch search) { | |
21 | - List<InventoryDetail> list = shippingCombinationMapper.getInventorys(search); | |
46 | + | |
47 | + //根据分配规则查找库存 | |
48 | + public List<InventoryDetail> getInventorys(ShipmentDetail shipmentDetail) { | |
49 | + List<InventoryDetail> list=new ArrayList<>(); | |
50 | + FilterConfigDetail filterConfigDetail=new FilterConfigDetail(); | |
51 | + LambdaQueryWrapper<FilterConfigDetail> filterConfigDetailLambdaQueryWrapper= Wrappers.lambdaQuery(); | |
52 | + filterConfigDetailLambdaQueryWrapper.eq(FilterConfigDetail::getWarehouseCode,shipmentDetail.getWarehouseCode()); | |
53 | + | |
54 | + //出库子单的分配规则有时,优先出库子单的分配规则 | |
55 | + if(StringUtils.isNotEmpty(shipmentDetail.getAllocationRule())){ | |
56 | + filterConfigDetailLambdaQueryWrapper.eq(FilterConfigDetail::getCode,shipmentDetail.getAllocationRule()); | |
57 | + filterConfigDetail=filterConfigDetailService.getOne(filterConfigDetailLambdaQueryWrapper); | |
58 | + if(filterConfigDetail==null){ | |
59 | + throw new ServiceException("出库子单出库规则配置不存在"); | |
60 | + } | |
61 | + | |
62 | + //根据sql查库存 | |
63 | + try { | |
64 | + list = inventoryDetailService.selectBysql(filterConfigDetail.getStatement(),shipmentDetail); | |
65 | + }catch (Exception e){ | |
66 | + throw new ServiceException("sql错误"); | |
67 | + } | |
68 | + return list; | |
69 | + } | |
70 | + | |
71 | + //出库子单的分配规则没有时,优先物料的分配规则 | |
72 | + LambdaQueryWrapper<Material> materialLambdaQueryWrapper=Wrappers.lambdaQuery(); | |
73 | + materialLambdaQueryWrapper.eq(Material::getCode,shipmentDetail.getMaterialCode()) | |
74 | + .eq(Material::getWarehouseCode,shipmentDetail.getWarehouseCode()); | |
75 | + Material material=materialService.getOne(materialLambdaQueryWrapper); | |
76 | + if(StringUtils.isNotEmpty(material.getAllocationRule())){ | |
77 | + filterConfigDetailLambdaQueryWrapper.eq(FilterConfigDetail::getCode,material.getAllocationRule()); | |
78 | + filterConfigDetail=filterConfigDetailService.getOne(filterConfigDetailLambdaQueryWrapper); | |
79 | + if(filterConfigDetail==null){ | |
80 | + throw new ServiceException("物料出库规则配置不存在"); | |
81 | + } | |
82 | + | |
83 | + //根据sql查库存 | |
84 | + list=inventoryDetailService.selectBysql(filterConfigDetail.getStatement(),shipmentDetail); | |
85 | + return list; | |
86 | + } | |
87 | + | |
88 | + //都没有时,默认仓库的分配规则 | |
89 | + LambdaQueryWrapper<ConfigValue> configValueLambdaQueryWrapper=Wrappers.lambdaQuery(); | |
90 | + configValueLambdaQueryWrapper.eq(ConfigValue::getModuleType,"shipment") | |
91 | + .eq(ConfigValue::getWarehouseCode,shipmentDetail.getWarehouseCode()); | |
92 | + ConfigValue configValue=configValueService.getOne(configValueLambdaQueryWrapper); | |
93 | + if(configValue==null){ | |
94 | + throw new ServiceException("仓库的出库配置不存在"); | |
95 | + } | |
96 | + | |
97 | + //查找出库首选项 | |
98 | + LambdaQueryWrapper<ShipmentPreference> slam=Wrappers.lambdaQuery(); | |
99 | + slam.eq(ShipmentPreference::getCode,configValue.getIdentifier()) | |
100 | + .eq(ShipmentPreference::getWarehouseCode,configValue.getWarehouseCode()); | |
101 | + ShipmentPreference shipmentPreference=shipmentPreferenceService.getOne(slam); | |
102 | + if(shipmentPreference==null){ | |
103 | + throw new ServiceException("仓库的出库配置中出库首选项不存在"); | |
104 | + } | |
105 | + //查找分配规则 | |
106 | + filterConfigDetailLambdaQueryWrapper.eq(FilterConfigDetail::getCode,shipmentPreference.getAllocationRule()); | |
107 | + filterConfigDetail=filterConfigDetailService.getOne(filterConfigDetailLambdaQueryWrapper); | |
108 | + if(filterConfigDetail==null){ | |
109 | + throw new ServiceException("出库首选项中出库规则配置不存在"); | |
110 | + } | |
111 | + | |
112 | + //根据sql查库存 | |
113 | + list=inventoryDetailService.selectBysql(filterConfigDetail.getStatement(),shipmentDetail); | |
22 | 114 | return list; |
23 | 115 | } |
24 | 116 | |
... | ... |
src/main/java/com/huaheng/pc/task/taskDetail/domain/TaskDetail.java
... | ... | @@ -57,6 +57,14 @@ public class TaskDetail implements Serializable { |
57 | 57 | @ApiModelProperty(value="货主") |
58 | 58 | private String companyCode; |
59 | 59 | |
60 | + | |
61 | + /** | |
62 | + * 组盘子id | |
63 | + */ | |
64 | + @TableField(value = "allocationId") | |
65 | + @ApiModelProperty(value="组盘子id") | |
66 | + private Integer allocationId; | |
67 | + | |
60 | 68 | /** |
61 | 69 | * 单据编码 |
62 | 70 | */ |
... | ... | @@ -162,12 +170,6 @@ public class TaskDetail implements Serializable { |
162 | 170 | @ApiModelProperty(value="参考单号") |
163 | 171 | private String referenceCode; |
164 | 172 | |
165 | - /** | |
166 | - * 参考内部号 | |
167 | - */ | |
168 | - @TableField(value = "referenceId") | |
169 | - @ApiModelProperty(value="参考内部号") | |
170 | - private Integer referenceId; | |
171 | 173 | |
172 | 174 | /** |
173 | 175 | * 参考内部行号 |
... | ... | @@ -379,6 +381,8 @@ public class TaskDetail implements Serializable { |
379 | 381 | |
380 | 382 | public static final String COL_COMPANYCODE = "companyCode"; |
381 | 383 | |
384 | + public static final String COL_ALLOCATIONID= "allocationId"; | |
385 | + | |
382 | 386 | public static final String COL_BILLCODE= "billCode"; |
383 | 387 | |
384 | 388 | public static final String COL_BILLDETAILID= "billDetailId"; |
... | ... |
src/main/java/com/huaheng/pc/task/taskHeader/domain/TaskHeader.java
... | ... | @@ -43,6 +43,13 @@ public class TaskHeader implements Serializable { |
43 | 43 | private Integer taskType; |
44 | 44 | |
45 | 45 | /** |
46 | + * 入库或出库组盘头ID | |
47 | + */ | |
48 | + @TableField(value = "allocationHeadId") | |
49 | + @ApiModelProperty(value="入库或出库组盘头ID") | |
50 | + private Integer allocationHeadId; | |
51 | + | |
52 | + /** | |
46 | 53 | * 内部类型 |
47 | 54 | */ |
48 | 55 | @TableField(value = "internalTaskType") |
... | ... |
src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderService.java
src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
... | ... | @@ -30,12 +30,21 @@ import com.huaheng.pc.shipment.shipmentContainerDetail.domain.ShipmentContainerD |
30 | 30 | import com.huaheng.pc.shipment.shipmentContainerDetail.service.ShipmentContainerDetailService; |
31 | 31 | import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentContainerHeader; |
32 | 32 | import com.huaheng.pc.shipment.shipmentContainerHeader.service.ShipmentContainerHeaderService; |
33 | +import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail; | |
34 | +import com.huaheng.pc.shipment.shipmentDetail.service.ShipmentDetailService; | |
33 | 35 | import com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader; |
36 | +import com.huaheng.pc.shipment.shipmentHeader.service.ShipmentHeaderService; | |
34 | 37 | import com.huaheng.pc.task.taskDetail.domain.TaskDetail; |
35 | 38 | import com.huaheng.pc.task.taskDetail.service.TaskDetailService; |
36 | 39 | import com.huaheng.pc.task.taskHeader.domain.ShipmentTaskCreateModel; |
40 | +import org.jsoup.helper.DataUtil; | |
37 | 41 | import org.springframework.stereotype.Service; |
38 | 42 | import java.math.BigDecimal; |
43 | +import java.text.SimpleDateFormat; | |
44 | +import java.util.ArrayList; | |
45 | +import java.util.Date; | |
46 | +import java.util.List; | |
47 | +import java.util.Map; | |
39 | 48 | import java.util.*; |
40 | 49 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
41 | 50 | import com.huaheng.pc.task.taskHeader.domain.TaskHeader; |
... | ... | @@ -74,6 +83,13 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
74 | 83 | @Resource |
75 | 84 | private ReceiptContainerDetailService receiptContainerDetailService; |
76 | 85 | @Resource |
86 | + private ShipmentHeaderService shipmentHeaderService; | |
87 | + @Resource | |
88 | + private ShipmentDetailService shipmentDetailService; | |
89 | + | |
90 | + | |
91 | + | |
92 | + @Resource | |
77 | 93 | private ReceiptContainerHeaderService receiptContainerHeaderService; |
78 | 94 | @Resource |
79 | 95 | private TaskHeaderMapper taskHeaderMapper; |
... | ... | @@ -156,12 +172,13 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
156 | 172 | task.setToLocation(""); |
157 | 173 | } |
158 | 174 | } |
175 | + task.setInternalTaskType(200); | |
176 | + task.setAllocationHeadId(shipmentContainerHeader.getId()); | |
159 | 177 | task.setWarehouseCode(shipmentContainerHeader.getWarehouseCode()); |
160 | 178 | task.setCompanyCode(shipmentContainerHeader.getCompanyCode()); |
161 | - task.setInternalTaskType(null); | |
162 | 179 | task.setAssignedUser(ShiroUtils.getLoginName()); |
163 | 180 | task.setConfirmedBy(ShiroUtils.getLoginName()); |
164 | - task.setStatus(1); | |
181 | + task.setStatus(0); | |
165 | 182 | task.setContainerCode(shipmentContainerHeader.getContainerCode()); |
166 | 183 | task.setCreatedBy(ShiroUtils.getLoginName()); |
167 | 184 | task.setCreated(new Date()); |
... | ... | @@ -172,9 +189,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
172 | 189 | for (ShipmentContainerDetail shipmentContainerDetail : shipmentContainerDetails) { |
173 | 190 | TaskDetail taskDetail = new TaskDetail(); |
174 | 191 | taskDetail.setTaskId(task.getId()); |
192 | + taskDetail.setInternalTaskType(task.getInternalTaskType()); | |
175 | 193 | taskDetail.setWarehouseCode(task.getWarehouseCode()); |
176 | 194 | taskDetail.setCompanyCode(task.getCompanyCode()); |
177 | 195 | taskDetail.setTaskType(task.getTaskType()); |
196 | + taskDetail.setAllocationId(shipmentContainerDetail.getId()); | |
178 | 197 | taskDetail.setBillCode(shipmentContainerDetail.getShipmentCode()); |
179 | 198 | taskDetail.setBillDetailId(shipmentContainerDetail.getShipmentDetailId()); |
180 | 199 | taskDetail.setMaterialCode(shipmentContainerDetail.getMaterialCode()); |
... | ... | @@ -186,7 +205,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
186 | 205 | taskDetail.setContainerCode(task.getContainerCode()); |
187 | 206 | taskDetail.setFromLocation(task.getFromLocation()); |
188 | 207 | taskDetail.setToLocation(task.getToLocation()); |
189 | - taskDetail.setStatus(1); | |
208 | + taskDetail.setStatus(0); | |
190 | 209 | taskDetail.setTaskType(task.getTaskType()); |
191 | 210 | taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); |
192 | 211 | taskDetail.setLastUpdated(null); |
... | ... | @@ -205,7 +224,12 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
205 | 224 | /** |
206 | 225 | * 下发WCS执行任务 |
207 | 226 | */ |
227 | + /** | |
228 | + * | |
229 | + * 执行任务 | |
230 | + * */ | |
208 | 231 | @Override |
232 | + @Transactional | |
209 | 233 | public AjaxResult<TaskHeader> sendTaskToWcs(Integer[] taskIds) { |
210 | 234 | TaskHeader task = null; |
211 | 235 | for (Integer taskId : taskIds) { |
... | ... | @@ -220,7 +244,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
220 | 244 | task.setLastUpdatedBy(ShiroUtils.getLoginName()); |
221 | 245 | LambdaUpdateWrapper<TaskHeader> HeaderUpdateWrapper = Wrappers.lambdaUpdate(); |
222 | 246 | HeaderUpdateWrapper.eq(TaskHeader::getId, taskId); |
223 | - taskHeaderService.update(task, HeaderUpdateWrapper); | |
247 | + if (!taskHeaderService.update(task, HeaderUpdateWrapper)) | |
248 | + throw new ServiceException("更新任务头失败"); | |
224 | 249 | //修改任务明细状态 |
225 | 250 | TaskDetail record = new TaskDetail(); |
226 | 251 | record.setStatus(10); |
... | ... | @@ -228,38 +253,24 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
228 | 253 | record.setLastUpdatedBy(ShiroUtils.getLoginName()); |
229 | 254 | LambdaUpdateWrapper<TaskDetail> lambdaUpdateWrapper = Wrappers.lambdaUpdate(); |
230 | 255 | lambdaUpdateWrapper.eq(TaskDetail::getTaskId, task.getId()); |
231 | - taskDetailService.update(record, lambdaUpdateWrapper); | |
232 | - | |
233 | - | |
234 | -// if (task.getInternalTaskType().equals("100")) | |
235 | -// { | |
236 | -// List<Map<String, Object>> maps = taskDetailService.selectListMapByEqual("billId, billDetailId", condition); | |
237 | -// for (Map<String, Object> item : maps){ | |
238 | -// Integer billDetailId = DataUtils.getInteger(item.get("billDetailId")); | |
239 | -// receiptHeaderService.updateDetailStatus(billDetailId, (short)300); | |
240 | -// } | |
241 | -// maps.stream().map(X -> X.get("billId")).distinct().forEach(X -> receiptHeaderService.receiptStatusUpdate(DataUtils.getInteger(X), (short)300)); | |
242 | -// } | |
243 | -// //盘点单执行 | |
244 | -// if(task.getType() == 700){ | |
245 | -// CyclecountDetail cyclecountDetai = cyclecountDetailService.selectEntityById( | |
246 | -// task.getAllocationHeadId()); | |
247 | -// cyclecountDetai.setStatus(10); | |
248 | -// cyclecountDetailService.updateByModel(cyclecountDetai); | |
249 | -// } | |
250 | -//// //如果是单排人工库,那么出入库都是先完成,在下发AGV任务 | |
251 | -//// if (task.getType().intValue() == 300 || task.getType().intValue() == 600) { | |
252 | -//// if (task.getSourceLocation().startsWith("L03") == false ) { | |
253 | -//// taskAgvService.createTaskAgv(task); | |
254 | -//// } | |
255 | -//// } | |
256 | -//// else { | |
257 | -//// taskAgvService.createTaskAgv(task); | |
258 | -//// } | |
259 | -// //任务类型是出库,那就完成任务在叫agv | |
260 | -// if (task.getType().intValue() == 100 || task.getType().intValue() == 500) { | |
261 | -// taskAgvService.createTaskAgv(task); | |
262 | -// } | |
256 | + if (!taskDetailService.update(record, lambdaUpdateWrapper)){ | |
257 | + throw new ServiceException("更新任务明细失败"); | |
258 | + } | |
259 | + //修改入库明细 | |
260 | + ReceiptDetail receiptDetail = receiptDetailService.queryflow(receiptDetailService.getById(record.getId())); | |
261 | + if (!receiptDetailService.updateById(receiptDetail)){ | |
262 | + throw new ServiceException("更新状态失败"); | |
263 | + } | |
264 | + receiptDetailService.updateReceiptHeaderLastStatus(receiptDetail.getReceiptId()); | |
265 | + //修改组盘表状态为20 | |
266 | + ReceiptContainerDetail receiptContainerDetail = new ReceiptContainerDetail(); | |
267 | + receiptContainerDetail.setStatus(20); | |
268 | + receiptContainerDetail.setLastUpdated(new Date()); | |
269 | + receiptContainerDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
270 | + LambdaUpdateWrapper<ReceiptContainerDetail> receiptContainerDetailLambdaUpdateWrapper = Wrappers.lambdaUpdate(); | |
271 | + receiptContainerDetailLambdaUpdateWrapper.eq(ReceiptContainerDetail::getReceiptId,receiptDetail.getReceiptId()); | |
272 | + if (! receiptContainerDetailService.update(receiptContainerDetail, receiptContainerDetailLambdaUpdateWrapper)) | |
273 | + throw new ServiceException("更新组盘状态失败"); | |
263 | 274 | } |
264 | 275 | return AjaxResult.success("下发任务成功", task); |
265 | 276 | } |
... | ... | @@ -293,13 +304,13 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
293 | 304 | */ |
294 | 305 | public void completeTask(TaskHeader task) throws Exception { |
295 | 306 | //区分任务类型 |
296 | - if (task.getInternalTaskType() == 100 || task.getInternalTaskType() == 200) { | |
307 | + if (task.getInternalTaskType() == 100) { | |
297 | 308 | //入库任务 |
298 | 309 | completeReceiptTask(task); |
299 | 310 | } |
300 | - if (task.getInternalTaskType() == 300 || task.getInternalTaskType() == 400) { | |
301 | -// //出库任务 | |
302 | -// completeShipmentTask(task); | |
311 | + if (task.getInternalTaskType() == 200) { | |
312 | +// 出库任务 | |
313 | + completeShipmentTask(task); | |
303 | 314 | } |
304 | 315 | // 700 盘点 900 出库查看,包过空托出库查看 |
305 | 316 | if (task.getInternalTaskType() == 700 || task.getInternalTaskType() == 900) { |
... | ... | @@ -321,9 +332,10 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
321 | 332 | |
322 | 333 | |
323 | 334 | /** |
324 | - * | |
335 | + *完成任务 | |
325 | 336 | */ |
326 | 337 | @Override |
338 | + @Transactional | |
327 | 339 | public AjaxResult completeReceiptTask(TaskHeader task) throws Exception { |
328 | 340 | List<Map<String, Object>> taskReceiptContainerDetail = taskHeaderMapper.getReceiptTask(task.getId()); |
329 | 341 | if (taskReceiptContainerDetail.size() < 1) { |
... | ... | @@ -344,13 +356,16 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
344 | 356 | header.setWarehouseCode(DataUtils.getString(map.get("warehouseCode")));//仓库 |
345 | 357 | header.setCompanyCode(task.getCompanyCode());//货主 |
346 | 358 | header.setContainerCode(DataUtils.getString(map.get("containerCode")));//容器号 |
359 | + header.setLocationCode(task.getToLocation()); | |
347 | 360 | header.setTotalQty(DataUtils.getInteger(map.get("totalQty")));//总数量 |
348 | 361 | header.setLocking(1); |
349 | 362 | header.setEnable(1); |
350 | 363 | header.setCreatedBy(ShiroUtils.getLoginName()); |
351 | 364 | header.setCreated(new Date()); |
352 | 365 | header.setLastUpdated(new Date()); |
353 | - inventoryHeaderService.save(header); | |
366 | + if (!inventoryHeaderService.save(header)) | |
367 | + throw new ServiceException("添加库存单失败"); | |
368 | + | |
354 | 369 | //库存明细添加 |
355 | 370 | detail = new InventoryDetail(); |
356 | 371 | detail.setInventoryHeaderId(header.getId());//库存头ID |
... | ... | @@ -366,19 +381,23 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
366 | 381 | detail.setBatch(DataUtils.getString(map.get("batch")));//批次 |
367 | 382 | detail.setLot(DataUtils.getString(map.get("lot")));//批号 |
368 | 383 | detail.setInventorySts(DataUtils.getString(map.get("inventorySts")));//库存状态 |
369 | - detail.setManufactureDate(DataUtils.getDateTime(map.get("manufactureDate")));//生产日期 | |
370 | - detail.setExpirationDate(DataUtils.getDateTime(map.get("expirationDate")));//失效日期 | |
384 | + detail.setManufactureDate(new SimpleDateFormat("yyyy-MM-dd").parse(map.get("manufactureDate").toString()));//生产日期 | |
385 | +// detail.setExpirationDate(new SimpleDateFormat("yyyy-MM-dd").parse(map.get("expirationDate").toString()));//失效日期 | |
371 | 386 | detail.setQty(DataUtils.getBigDecimal(map.get("qty")));//数量 |
372 | 387 | detail.setTaskQty(DataUtils.getBigDecimal(map.get("qty"))); |
373 | 388 | detail.setCreatedBy(ShiroUtils.getLoginName());//创建人 |
374 | 389 | detail.setLastUpdatedBy(ShiroUtils.getLoginName());//创建时间 |
375 | - inventoryDetailService.save(detail); | |
376 | - } else { | |
390 | + if (!inventoryDetailService.save(detail)) | |
391 | + throw new ServiceException("添加库存明细失败"); | |
392 | + } | |
393 | + else { | |
377 | 394 | detail.setQty(detail.getQty().add(DataUtils.getBigDecimal(map.get("qty")))); |
378 | 395 | detail.setLastUpdatedBy(ShiroUtils.getLoginName()); |
379 | 396 | LambdaUpdateWrapper<InventoryDetail> lambdaUpdateWrapper = Wrappers.lambdaUpdate(); |
380 | - lambdaUpdateWrapper.eq(InventoryDetail::getId, DataUtils.getInteger(map.get("receiptDetailId"))); | |
381 | - inventoryDetailService.update(detail, lambdaUpdateWrapper); | |
397 | + lambdaUpdateWrapper.eq(InventoryDetail::getId,DataUtils.getInteger(map.get("receiptDetailId"))); | |
398 | + if (!inventoryDetailService.update(detail, lambdaUpdateWrapper)) | |
399 | + throw new ServiceException("更新入库单明细失败"); | |
400 | + | |
382 | 401 | } |
383 | 402 | //记录库存交易记录 |
384 | 403 | InventoryTransaction inventoryTransaction = new InventoryTransaction(); |
... | ... | @@ -393,28 +412,49 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
393 | 412 | inventoryTransaction.setBillDetailId(DataUtils.getInteger(map.get("receiptDetailId"))); |
394 | 413 | inventoryTransaction.setBatch(DataUtils.getString(map.get("batch"))); |
395 | 414 | inventoryTransaction.setLot(DataUtils.getString(map.get("lot"))); |
396 | - inventoryTransaction.setManufactureDate(DataUtils.getDateTime(map.get("manufactureDate"))); | |
397 | - inventoryTransaction.setExpirationDate(DataUtils.getDateTime(map.get("expirationDate"))); | |
415 | + inventoryTransaction.setManufactureDate(new SimpleDateFormat("yyyy-MM-dd").parse(map.get("manufactureDate").toString()));//生产日期 | |
416 | +// inventoryTransaction.setExpirationDate(DataUtils.getDateTime(map.get("expirationDate"))); | |
398 | 417 | inventoryTransaction.setInventorySts(DataUtils.getString((map.get("inventorySts")))); |
399 | 418 | inventoryTransaction.setTaskQty(DataUtils.getInteger(map.get("qty"))); |
400 | 419 | inventoryTransaction.setCreated(new Date()); |
401 | 420 | inventoryTransaction.setCreatedBy(ShiroUtils.getLoginName()); |
402 | - inventoryTransactionService.save(inventoryTransaction); | |
421 | + if (!inventoryTransactionService.save(inventoryTransaction)) | |
422 | + throw new ServiceException("新增库存记录失败"); | |
403 | 423 | //修改任务明细的状态为完成 |
404 | 424 | TaskDetail taskDetail = new TaskDetail(); |
405 | 425 | taskDetail.setStatus(100); |
406 | 426 | taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); |
407 | 427 | taskDetail.setAgingDate(new Date()); //入库时间 |
408 | 428 | LambdaUpdateWrapper<TaskDetail> lambdaUpdateWrapper = Wrappers.lambdaUpdate(); |
409 | - lambdaUpdateWrapper.eq(TaskDetail::getTaskId, DataUtils.getInteger(map.get("taskDetailId"))); | |
429 | + lambdaUpdateWrapper.eq(TaskDetail::getTaskId,task.getId()); | |
410 | 430 | taskDetailService.update(taskDetail, lambdaUpdateWrapper); |
411 | - //修改入库单的状态 | |
412 | - ReceiptHeader receiptHeader = new ReceiptHeader(); | |
413 | - receiptHeader.setFirstStatus(100); | |
414 | - receiptHeader.setLastStatus(100); | |
415 | - LambdaUpdateWrapper<ReceiptHeader> receiptHeaderLambdaUpdateWrapper = Wrappers.lambdaUpdate(); | |
416 | - receiptHeaderLambdaUpdateWrapper.eq(ReceiptHeader::getId, DataUtils.getInteger(map.get("receiptId"))); | |
417 | - receiptHeaderService.update(receiptHeader, receiptHeaderLambdaUpdateWrapper); | |
431 | + if ( !taskDetailService.update(taskDetail, lambdaUpdateWrapper)){ | |
432 | + throw new ServiceException("修改入库单明细失败"); | |
433 | + } | |
434 | +// //修改入库单的状态 | |
435 | +// ReceiptHeader receiptHeader = new ReceiptHeader(); | |
436 | +// receiptHeader.setFirstStatus(100); | |
437 | +// receiptHeader.setLastStatus(100); | |
438 | +// LambdaUpdateWrapper<ReceiptHeader> receiptHeaderLambdaUpdateWrapper = Wrappers.lambdaUpdate(); | |
439 | +// receiptHeaderLambdaUpdateWrapper.eq(ReceiptHeader::getId, DataUtils.getInteger(map.get("receiptId"))); | |
440 | +// if (!receiptHeaderService.update(receiptHeader, receiptHeaderLambdaUpdateWrapper)){ | |
441 | +// throw new ServiceException("修改入库单失败"); | |
442 | +// } | |
443 | +// //修改任务明细的状态为完成 | |
444 | +// TaskDetail taskDetail = new TaskDetail(); | |
445 | +// taskDetail.setStatus(100); | |
446 | +// taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
447 | +// taskDetail.setAgingDate(new Date()); //入库时间 | |
448 | +// LambdaUpdateWrapper<TaskDetail> lambdaUpdateWrapper = Wrappers.lambdaUpdate(); | |
449 | +// lambdaUpdateWrapper.eq(TaskDetail::getTaskId, DataUtils.getInteger(map.get("taskDetailId"))); | |
450 | +// taskDetailService.update(taskDetail, lambdaUpdateWrapper); | |
451 | +// //修改入库单的状态 | |
452 | +// ReceiptHeader receiptHeader =new ReceiptHeader(); | |
453 | +// receiptHeader.setFirstStatus(100); | |
454 | +// receiptHeader.setLastStatus(100); | |
455 | +// LambdaUpdateWrapper<ReceiptHeader> receiptHeaderLambdaUpdateWrapper = Wrappers.lambdaUpdate(); | |
456 | +// receiptHeaderLambdaUpdateWrapper.eq(ReceiptHeader::getId, DataUtils.getInteger(map.get("receiptId"))); | |
457 | +// receiptHeaderService.update(receiptHeader, receiptHeaderLambdaUpdateWrapper); | |
418 | 458 | |
419 | 459 | //修改任务主表状态,因为立库任务表单头只对应一个货箱,表单详情的任务会同时完成 |
420 | 460 | task.setStatus(100); |
... | ... | @@ -422,25 +462,43 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
422 | 462 | task.setLastUpdated(new Date()); |
423 | 463 | LambdaUpdateWrapper<TaskHeader> taskHeaderLambdaUpdateWrapper = Wrappers.lambdaUpdate(); |
424 | 464 | taskHeaderLambdaUpdateWrapper.eq(TaskHeader::getId, task.getId()); |
425 | - taskHeaderService.update(task, taskHeaderLambdaUpdateWrapper); | |
465 | + if (!taskHeaderService.update(task, taskHeaderLambdaUpdateWrapper)) | |
466 | + throw new ServiceException("更新任务主表失败"); | |
467 | + | |
426 | 468 | //修改库位状态和对应的容器 |
427 | 469 | Location location = new Location(); |
428 | 470 | location.setContainerCode(task.getContainerCode()); |
429 | 471 | location.setStatus("empty"); |
430 | 472 | LambdaUpdateWrapper<Location> locationLambdaUpdateWrapper = Wrappers.lambdaUpdate(); |
431 | 473 | locationLambdaUpdateWrapper.eq(Location::getCode, task.getToLocation()); |
432 | - locationService.update(location, locationLambdaUpdateWrapper); | |
474 | + if (!locationService.update(location, locationLambdaUpdateWrapper)) | |
475 | + throw new ServiceException("更新库位失败"); | |
476 | + | |
433 | 477 | //修改容器状态和对应的库位 |
434 | 478 | Container container = new Container(); |
435 | 479 | container.setLocationCode(task.getToLocation()); |
436 | 480 | container.setStatus("some"); |
437 | - //修改组盘表状态为20 | |
481 | + if (!containerService.save(container)){ | |
482 | + throw new ServiceException("更新容器失败"); | |
483 | + } | |
484 | + //修改组盘表状态为20 | |
438 | 485 | ReceiptContainerDetail receiptContainerDetail = new ReceiptContainerDetail(); |
439 | 486 | receiptContainerDetail.setStatus(20); |
487 | + receiptContainerDetail.setProcessStamp("0"); | |
488 | + receiptContainerDetail.setLastUpdated(new Date()); | |
489 | + receiptContainerDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
440 | 490 | LambdaUpdateWrapper<ReceiptContainerDetail> receiptContainerDetailLambdaUpdateWrapper = Wrappers.lambdaUpdate(); |
441 | 491 | receiptContainerDetailLambdaUpdateWrapper.eq(ReceiptContainerDetail::getReceiptId, DataUtils.getInteger(map.get("receiptId"))); |
442 | - receiptContainerDetailService.update(receiptContainerDetail, receiptContainerDetailLambdaUpdateWrapper); | |
492 | + if (! receiptContainerDetailService.update(receiptContainerDetail, receiptContainerDetailLambdaUpdateWrapper)) | |
493 | + throw new ServiceException("更新组盘状态失败"); | |
494 | + //修改入库明细 | |
495 | + ReceiptDetail receiptDetail = receiptDetailService.queryflow(receiptDetailService.getById(DataUtils.getInteger(map.get("receiptDetailId")))); | |
496 | + if (!receiptDetailService.updateById(receiptDetail)){ | |
497 | + throw new ServiceException("更新状态失败"); | |
498 | + } | |
499 | + receiptDetailService.updateReceiptHeaderLastStatus(receiptDetail.getReceiptId()); | |
443 | 500 | } |
501 | + | |
444 | 502 | } |
445 | 503 | return AjaxResult.success("完成入库任务"); |
446 | 504 | } |
... | ... | @@ -847,7 +905,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
847 | 905 | |
848 | 906 | /** |
849 | 907 | * 创建上架任务 |
850 | - * | |
851 | 908 | * @param ids |
852 | 909 | * @return |
853 | 910 | */ |
... | ... | @@ -932,5 +989,108 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
932 | 989 | |
933 | 990 | |
934 | 991 | |
992 | + /** | |
993 | + * | |
994 | + * 完成出库任务 | |
995 | + * */ | |
996 | + @Override | |
997 | + public void completeShipmentTask(TaskHeader task) { | |
998 | + //获取所有子任务 | |
999 | + TaskDetail condition = new TaskDetail(); | |
1000 | + condition.setTaskId(task.getId()); | |
1001 | + LambdaQueryWrapper<TaskDetail> lambdaQueryWrapper = Wrappers.lambdaQuery(condition); | |
1002 | + List<TaskDetail> taskDetails = taskDetailService.list(lambdaQueryWrapper); | |
1003 | + List<Integer> shipmentHeadIds = new ArrayList<>(); | |
1004 | + for(TaskDetail taskDetail : taskDetails){ | |
1005 | + if(taskDetail.getStatus()<20){ | |
1006 | + //获取出库子货箱 | |
1007 | + ShipmentContainerDetail shipmentContainerDetail = shipmentContainerDetailService.getById(taskDetail.getAllocationId()); | |
1008 | + //取出子单据 | |
1009 | + ShipmentDetail shipmentDetail = shipmentDetailService.getById(taskDetail.getBillDetailId()); | |
1010 | + //暂存id,为更新单据状态准备 | |
1011 | + shipmentHeadIds.add(shipmentDetail.getShipmentId()); | |
1012 | + //获取对应库存记录 | |
1013 | + InventoryDetail inventoryDetail = inventoryDetailService.getById(taskDetail.getToInventoryId()); | |
1014 | + if (inventoryDetail == null) { | |
1015 | + throw new ServiceException("任务明细对应的库存ID【" + taskDetail.getToInventoryId().toString() + "】不存在!"); | |
1016 | + } | |
1017 | + BigDecimal orignalQty = inventoryDetail.getQty(); | |
1018 | + //扣减库存 | |
1019 | + inventoryDetail.setTaskQty(inventoryDetail.getTaskQty().subtract(taskDetail.getQty())); | |
1020 | + inventoryDetail.setQty(inventoryDetail.getQty().subtract(taskDetail.getQty())); | |
1021 | + if(inventoryDetail.getQty().compareTo(new BigDecimal("0"))==0 && inventoryDetail.getTaskQty().compareTo(new BigDecimal("0"))==0){ | |
1022 | + //如果库存没有了,就删除这个库存 | |
1023 | + inventoryDetailService.removeById(inventoryDetail.getId()); | |
1024 | + }else { | |
1025 | + //否则更新这个库存 | |
1026 | + inventoryDetailService.updateById(inventoryDetail); | |
1027 | + } | |
1028 | + //设置子任务状态为已执行 | |
1029 | + taskDetail.setStatus(100); | |
1030 | + taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
1031 | + taskDetail.setLastUpdated(new Date()); //完成时间 | |
1032 | + taskDetailService.updateById(taskDetail); | |
1033 | + //记录库存交易记录 | |
1034 | + InventoryTransaction inventoryTransaction = new InventoryTransaction(); | |
1035 | + inventoryTransaction.setWarehouseCode(task.getWarehouseCode()); | |
1036 | + inventoryTransaction.setCompanyCode(shipmentDetail.getCompanyCode()); | |
1037 | + inventoryTransaction.setLocationCode(inventoryDetail.getLocationCode()); | |
1038 | + inventoryTransaction.setContainerCode(inventoryDetail.getContainerCode()); | |
1039 | + inventoryTransaction.setTransactionType(20); | |
1040 | + inventoryTransaction.setMaterialCode(shipmentDetail.getMaterialCode()); | |
1041 | + //inventory.setMaterialName(DataUtils.getString(taskDetail.getMaterialName()));//物料名称 | |
1042 | + inventoryTransaction.setBillCode(taskDetail.getBillCode()); | |
1043 | + inventoryTransaction.setBillDetailId(shipmentDetail.getId()); | |
1044 | + inventoryTransaction.setBatch(shipmentDetail.getBatch()); | |
1045 | + inventoryTransaction.setLot(shipmentDetail.getLot()); | |
1046 | + inventoryTransaction.setManufactureDate(shipmentDetail.getManufactureDate()); | |
1047 | + inventoryTransaction.setExpirationDate(shipmentDetail.getExpirationDate()); | |
1048 | + inventoryTransaction.setInventorySts(inventoryDetail.getInventorySts()); | |
1049 | + //这里取反,更符合出库的语义,同时方便对记录进行统计 | |
1050 | + inventoryTransaction.setTaskQty(taskDetail.getQty().intValue()); | |
1051 | +// inventoryTransaction.setCostPrice(shipmentDetail.); | |
1052 | + inventoryTransaction.setCreated(null); | |
1053 | + inventoryTransaction.setCreatedBy(ShiroUtils.getLoginName()); | |
1054 | + inventoryTransactionService.save(inventoryTransaction); | |
1055 | +// //更新单据状态 | |
1056 | +// shipmentHeaderService.updateShipmentStatus(shipmentHeader.getId()); | |
1057 | + } | |
1058 | + } | |
1059 | + //设置主任务为已执行 | |
1060 | + task.setStatus(100); | |
1061 | + task.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
1062 | + task.setLastUpdated(new Date()); | |
1063 | + taskHeaderService.updateById(task); | |
1064 | + //将库位状态改为空闲,如果是整出的对应的容器也清空 | |
1065 | + Location locationRecord = new Location(); | |
1066 | + locationRecord.setStatus("empty"); | |
1067 | + if(task.getTaskType()==300) { | |
1068 | + locationRecord.setContainerCode(""); | |
1069 | + } | |
1070 | + LambdaUpdateWrapper<Location> locationLambdaUpdateWrapper = Wrappers.lambdaUpdate(); | |
1071 | + locationLambdaUpdateWrapper.eq(Location::getCode,task.getToLocation()); | |
1072 | + locationService.update(locationLambdaUpdateWrapper); | |
1073 | + //如果是整出,删掉这个库位上的这个托盘,否则更改托盘状态 | |
1074 | + Container containerRecord = new Container(); | |
1075 | +// if(task.getTaskType()==300) { | |
1076 | +// containerService.updateLocationCodeAndStatus(task.getContainerCode(),"","empty"); | |
1077 | +// } | |
1078 | +// else{ | |
1079 | +// //查询是否存在关联的库存,入如果没有就修改容器状态为empty | |
1080 | +// Inventory inventoryCondition = new Inventory(); | |
1081 | +// inventoryCondition.setLocationCode(task.getSourceLocation()); | |
1082 | +// Map<String, Object> map = inventoryService.selectFirstMap("id", inventoryCondition); | |
1083 | +// if (map == null) { | |
1084 | +// //如果没有库存就设置为empty | |
1085 | +// containerService.updateStatus(task.getContainerCode(), "empty"); | |
1086 | +// } | |
1087 | +// } | |
1088 | +// //设置出库货箱状态为拣货任务完成 | |
1089 | +// shipmentContainerHeaderService.resetStatusShipmentContainer(task.getAllocationHeadId(),(short)20); | |
1090 | + //最后更新单据状态 | |
1091 | + shipmentHeadIds.stream().distinct().forEach(t->shipmentHeaderService.updateShipmentStatus(t)); | |
1092 | + | |
1093 | + } | |
1094 | + | |
935 | 1095 | |
936 | 1096 | } |
... | ... |
src/main/resources/templates/shipment/shippingCombination/shippingCombination.html
... | ... | @@ -135,7 +135,12 @@ |
135 | 135 | id:row.id |
136 | 136 | }, |
137 | 137 | success:res=>{ |
138 | - $("#bootstrap-table1").bootstrapTable('load',res.data) | |
138 | + if(res.code===200){ | |
139 | + $("#bootstrap-table1").bootstrapTable('load',res.data) | |
140 | + } | |
141 | + else{ | |
142 | + $.modal.alertError(res.msg) | |
143 | + } | |
139 | 144 | } |
140 | 145 | }) |
141 | 146 | }, |
... | ... |
src/main/resources/templates/task/taskDetail/taskDetail.html
... | ... | @@ -72,12 +72,12 @@ |
72 | 72 | sortable:true |
73 | 73 | }, |
74 | 74 | { |
75 | - field : 'sourceLocation', | |
75 | + field : 'fromLocation', | |
76 | 76 | title : '源库位', |
77 | 77 | sortable:true |
78 | 78 | }, |
79 | 79 | { |
80 | - field : 'destinationLocation', | |
80 | + field : 'toLocation', | |
81 | 81 | title : '目的库位', |
82 | 82 | sortable:true |
83 | 83 | }, |
... | ... |
src/main/resources/templates/task/taskHeader/taskHeader.html
... | ... | @@ -32,7 +32,7 @@ |
32 | 32 | </li> |
33 | 33 | |
34 | 34 | <li> |
35 | - 库位编号:<input type="text" name="locationCode"/> | |
35 | + 库位编号:<input type="text" name="toLocation"/> | |
36 | 36 | </li> |
37 | 37 | <li class="time" style="height: 30px"> |
38 | 38 | <label>创建时间: </label> |
... | ... | @@ -171,7 +171,7 @@ |
171 | 171 | |
172 | 172 | }, |
173 | 173 | { |
174 | - field : 'locationCode', | |
174 | + field : 'toLocation', | |
175 | 175 | title : '库位号', |
176 | 176 | visible:true |
177 | 177 | }, |
... | ... | @@ -234,7 +234,7 @@ |
234 | 234 | actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>取消</a> '); |
235 | 235 | actions.push('<a class="btn btn-primary btn-xs ' + completeFlag + '" href="#" onclick="complete(\'' + row.id + '\')"><i class="fa fa-check"></i>完成</a>'); |
236 | 236 | } |
237 | - if (row.status >=10) { | |
237 | + if (row.status >= 10 && row.status < 100) { | |
238 | 238 | actions.push('<a class="btn btn-primary btn-xs ' + completeFlag + '" href="#" onclick="complete(\'' + row.id + '\')"><i class="fa fa-check"></i>完成</a>'); |
239 | 239 | } |
240 | 240 | return actions.join(''); |
... | ... |