Commit 25f1b728e822e8cc0928fc0abe1fff5937a4e278

Authored by 肖超群
1 parent 4fc936bd

优化出库代码

Showing 19 changed files with 51 additions and 68 deletions
src/main/java/com/huaheng/api/general/service/AdjustService.java
... ... @@ -178,7 +178,7 @@ public class AdjustService {
178 178 }
179 179 }
180 180 //检查物料
181   - Material material = materialService.findAllByCode(adjustDetail.getMaterialCode());
  181 + Material material = materialService.getMaterialByCode(adjustDetail.getMaterialCode());
182 182 if(material == null){
183 183 return AjaxResult.error("物料编码错误!");
184 184 }
... ...
src/main/java/com/huaheng/api/general/service/ReceiptApiService.java
... ... @@ -124,8 +124,8 @@ public class ReceiptApiService {
124 124 receiptDetail.setReceiptCode(receiptHeader.getCode());
125 125 receiptDetail.setWarehouseCode(receiptHeader.getWarehouseCode());
126 126 receiptDetail.setCompanyCode(receiptHeader.getCompanyCode());
127   - Material material = materialService.findAllByCode(receiptDetail.getMaterialCode(),
128   - receiptHeader.getWarehouseCode());
  127 + Material material = materialService.getMaterialByCode(receiptDetail.getMaterialCode(),
  128 + receiptDetail.getWarehouseCode());
129 129 receiptDetail.setMaterialName(material.getName());
130 130 receiptDetail.setMaterialSpec(material.getSpec());
131 131 receiptDetail.setMaterialUnit(material.getUnit());
... ... @@ -205,7 +205,7 @@ public class ReceiptApiService {
205 205 }
206 206  
207 207 /* 1.step 判断供应商是否存在*/
208   - if (receiptDetail.getSupplierCode() != null) {
  208 + if (StringUtils.isNotEmpty(receiptDetail.getSupplierCode())) {
209 209 LambdaQueryWrapper<Supplier> supplierLambda = Wrappers.lambdaQuery();
210 210 supplierLambda.eq(Supplier::getCode, receiptDetail.getSupplierCode());
211 211 if (supplierService.getOne(supplierLambda) == null) {
... ... @@ -213,28 +213,11 @@ public class ReceiptApiService {
213 213 }
214 214 }
215 215  
216   - /* 2.step 判断定位规则是否存在*/
217   - if (receiptDetail.getLocatingRule() != null) {
218   - LambdaQueryWrapper<FilterConfigDetail> filterConfigDetailLambda = Wrappers.lambdaQuery();
219   - filterConfigDetailLambda.eq(FilterConfigDetail::getCode, receiptDetail.getLocatingRule())
220   - .eq(FilterConfigDetail::getModuleType, "receipt")
221   - .eq(FilterConfigDetail::getRecordType, "locationRule");
222   - FilterConfigDetail filterConfigDetail = filterConfigDetailService.getOne(filterConfigDetailLambda);
223   - if (filterConfigDetail == null) {
224   - return AjaxResult.error(receiptDetail.getLocatingRule() + "定位规则不存在");
225   - }
226   - }
227   -
228   - /* 3.step 判断流程编码是否存在*/
229   - if (receiptDetail.getStatusFlowCode() != null) {
230   - LambdaQueryWrapper<StatusFlowHeader> statusFlowHeaderLambda = Wrappers.lambdaQuery();
231   - statusFlowHeaderLambda.eq(StatusFlowHeader::getCode, receiptDetail.getStatusFlowCode())
232   - .eq(StatusFlowHeader::getModuleType, "receipt")
233   - .eq(StatusFlowHeader::getRecordType, "receivingFlow");
234   - StatusFlowHeader statusFlowHeader = statusFlowHeaderService.getOne(statusFlowHeaderLambda);
235   - if (statusFlowHeader == null) {
236   - return AjaxResult.error(receiptDetail.getLocatingRule() + "该流程不存在");
237   - }
  216 + String materialCode = receiptDetail.getMaterialCode();
  217 + String warehouseCode = receiptDetail.getWarehouseCode();
  218 + Material material = materialService.getMaterialByCode(materialCode, warehouseCode);
  219 + if(material == null) {
  220 + return AjaxResult.error(materialCode + "物料不存在");
238 221 }
239 222 }
240 223  
... ...
src/main/java/com/huaheng/api/general/service/ReceiptService.java
... ... @@ -109,7 +109,7 @@ public class ReceiptService {
109 109 receiptDetail.setReceiptCode(receiptHeader.getCode());
110 110 receiptDetail.setWarehouseCode(receiptHeader.getWarehouseCode());
111 111 receiptDetail.setCompanyCode(receiptHeader.getWarehouseCode());
112   - Material material = materialService.findAllByCode(receiptDetail.getMaterialCode());
  112 + Material material = materialService.getMaterialByCode(receiptDetail.getMaterialCode());
113 113 receiptDetail.setMaterialName(material.getName());
114 114 receiptDetail.setMaterialSpec(material.getSpec());
115 115 receiptDetail.setMaterialUnit(material.getUnit());
... ...
src/main/java/com/huaheng/api/tv/controller/TvController.java
... ... @@ -64,7 +64,7 @@ public class TvController extends BaseController {
64 64 for(TaskHeader taskHeader : taskHeaderList) {
65 65 String materialCode = taskHeader.getMaterialCode();
66 66 String warehouseCode = taskHeader.getWarehouseCode();
67   - Material material = materialService.findAllByCode(materialCode, warehouseCode);
  67 + Material material = materialService.getMaterialByCode(materialCode, warehouseCode);
68 68 if(material != null) {
69 69 taskHeader.setMaterialCode(material.getName());
70 70 }
... ...
src/main/java/com/huaheng/api/wcs/service/overrideHandle/OverrideHandleServiceImpl.java
... ... @@ -137,7 +137,7 @@ public class OverrideHandleServiceImpl implements OverrideHandleService {
137 137 String materialAreaCode = null;
138 138 if(taskDetailList != null && taskDetailList.size() > 0) {
139 139 String materialCode = taskDetailList.get(0).getMaterialCode();
140   - Material material = materialService.findAllByCode(materialCode, warehouseCode);
  140 + Material material = materialService.getMaterialByCode(materialCode, warehouseCode);
141 141 materialAreaCode = material.getMaterialAreaCode();
142 142 }
143 143 String locationCode = locationAllocationService.allocation(allocationRule,
... ...
src/main/java/com/huaheng/api/wcs/service/warecellAllocation/WarecellAllocationServiceImpl.java
... ... @@ -192,7 +192,7 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService
192 192 receiptContainerDetailList = receiptContainerDetailList.stream().distinct().collect(Collectors.toList());
193 193 if(receiptContainerDetailList != null && receiptContainerDetailList.size() > 0) {
194 194 String materialCode = receiptContainerDetailList.get(0).getMaterialCode();
195   - Material material = materialService.findAllByCode(materialCode, warehouseCode);
  195 + Material material = materialService.getMaterialByCode(materialCode, warehouseCode);
196 196 materialAreaCode = material.getMaterialAreaCode();
197 197 }
198 198 locationCode = locationAllocationService.allocation(allocationRule,
... ...
src/main/java/com/huaheng/mobile/receipt/MobileBatchReceiptController.java
... ... @@ -138,7 +138,7 @@ public class MobileBatchReceiptController {
138 138 if (param.get("code") == null || param.get("code").trim().length() < 1) {
139 139 throw new JSONException("容器号(code)不能为空");
140 140 }
141   - Material material = materialService.findAllByCode(param.get("code"));
  141 + Material material = materialService.getMaterialByCode(param.get("code"));
142 142 if (material == null) {
143 143 return AjaxResult.error("没有该物料");
144 144 }
... ...
src/main/java/com/huaheng/pc/config/configWarning/service/ConfigWarningService.java
... ... @@ -61,7 +61,7 @@ public class ConfigWarningService extends ServiceImpl&lt;ConfigWarningMapper, Confi
61 61  
62 62 /* 设置物料信息*/
63 63 if (configWarning.getMaterialCode() != null){
64   - Material material = materialService.findAllByCode(configWarning.getMaterialCode());
  64 + Material material = materialService.getMaterialByCode(configWarning.getMaterialCode());
65 65 configWarning.setMaterialName(material.getName());
66 66 configWarning.setMaterialSpec(material.getSpec());
67 67 configWarning.setMaterialUnit(material.getUnit());
... ... @@ -88,7 +88,7 @@ public class ConfigWarningService extends ServiceImpl&lt;ConfigWarningMapper, Confi
88 88  
89 89 /* 设置物料信息*/
90 90 if (configWarning.getMaterialCode() != null){
91   - Material material = materialService.findAllByCode(configWarning.getMaterialCode());
  91 + Material material = materialService.getMaterialByCode(configWarning.getMaterialCode());
92 92 configWarning.setMaterialName(material.getName());
93 93 configWarning.setMaterialSpec(material.getSpec());
94 94 configWarning.setMaterialUnit(material.getUnit());
... ...
src/main/java/com/huaheng/pc/config/material/service/MaterialService.java
... ... @@ -32,9 +32,9 @@ public interface MaterialService extends IService&lt;Material&gt;{
32 32 */
33 33 AjaxResult addSave(Material material);
34 34  
35   - Material findAllByCode(String code);
  35 + Material getMaterialByCode(String code);
36 36  
37   - Material findAllByCode(String code, String warehouseCode);
  37 + Material getMaterialByCode(String code, String warehouseCode);
38 38  
39 39 List<Material> findLatest();
40 40  
... ...
src/main/java/com/huaheng/pc/config/material/service/MaterialServiceImpl.java
... ... @@ -174,7 +174,7 @@ public class MaterialServiceImpl extends ServiceImpl&lt;MaterialMapper, Material&gt; i
174 174 }
175 175  
176 176 @Override
177   - public Material findAllByCode(String code) {
  177 + public Material getMaterialByCode(String code) {
178 178 String warehouseCode = ShiroUtils.getWarehouseCode();
179 179 LambdaQueryWrapper<Material> queryWrapper = Wrappers.lambdaQuery();
180 180 queryWrapper.eq(Material::getCode, code);
... ... @@ -184,7 +184,7 @@ public class MaterialServiceImpl extends ServiceImpl&lt;MaterialMapper, Material&gt; i
184 184 }
185 185  
186 186 @Override
187   - public Material findAllByCode(String code, String warehouseCode) {
  187 + public Material getMaterialByCode(String code, String warehouseCode) {
188 188 LambdaQueryWrapper<Material> queryWrapper = Wrappers.lambdaQuery();
189 189 queryWrapper.eq(Material::getCode, code);
190 190 queryWrapper.eq(Material::getWarehouseCode, warehouseCode);
... ...
src/main/java/com/huaheng/pc/config/materialWarnning/service/impl/MaterialWarningServiceImpl.java
... ... @@ -45,7 +45,7 @@ public class MaterialWarningServiceImpl extends ServiceImpl&lt;MaterialWarningMappe
45 45  
46 46 @Override
47 47 public AjaxResult addSave(MaterialWarning materialWarning) {
48   - Material material = materialService.findAllByCode(materialWarning.getMaterialCode());
  48 + Material material = materialService.getMaterialByCode(materialWarning.getMaterialCode());
49 49 materialWarning.setMaterialName(material.getName());
50 50 materialWarning.setMaterialSpec(material.getSpec());
51 51 materialWarning.setMaterialUnit(material.getUnit());
... ...
src/main/java/com/huaheng/pc/inventory/adjustDetail/service/AdjustDetailServiceImpl.java
... ... @@ -107,7 +107,7 @@ public class AdjustDetailServiceImpl extends ServiceImpl&lt;AdjustDetailMapper, Adj
107 107 }
108 108 }
109 109 //检查物料
110   - Material material = materialService.findAllByCode(adjustDetail.getMaterialCode());
  110 + Material material = materialService.getMaterialByCode(adjustDetail.getMaterialCode());
111 111 if(material != null){
112 112 if(!material.getName().equals(adjustDetail.getMaterialName())){
113 113 return AjaxResult.error("物料名称错误!");
... ...
src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/service/ReceiptContainerHeaderServiceImpl.java
... ... @@ -336,7 +336,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
336 336 */
337 337 @Transactional
338 338 public Integer checkContainer(String containerCode, String materialCode) {
339   - Material material = materialService.findAllByCode(materialCode);
  339 + Material material = materialService.getMaterialByCode(materialCode);
340 340 if (StringUtils.isEmpty(containerCode)){
341 341 if (material.getAutoGenSerialNum() == 0){
342 342 return 1;
... ...
src/main/java/com/huaheng/pc/receipt/receiving/service/ReceivingService.java
... ... @@ -158,7 +158,7 @@ public class ReceivingService {
158 158 throw new ServiceException("未绑定定位规则");
159 159 }
160 160 int allocationRule = Integer.parseInt(value);
161   - Material material = materialService.findAllByCode(receiptContainerDetail.getMaterialCode());
  161 + Material material = materialService.getMaterialByCode(receiptContainerDetail.getMaterialCode());
162 162 String materialAreaCode = material.getMaterialAreaCode();
163 163 String locationCode = locationAllocationService.allocation(allocationRule, null,
164 164 0, area, null, ShiroUtils.getWarehouseCode(),container.getCode(), materialAreaCode);
... ...
src/main/java/com/huaheng/pc/shipment/shippingCombination/controller/ShippingCombinationController.java
... ... @@ -155,7 +155,6 @@ public class ShippingCombinationController extends BaseController {
155 155 }
156 156 }
157 157 list.removeAll(removeList);
158   - //查找分配规则
159 158 return getDataTable(list);
160 159 }
161 160  
... ... @@ -167,10 +166,11 @@ public class ShippingCombinationController extends BaseController {
167 166 * @return
168 167 */
169 168 @RequiresPermissions("shipment:shippingCombination:combination")
170   - @PostMapping("/Addcombination")
  169 + @PostMapping("/addcombination")
171 170 @ResponseBody
172   - public AjaxResult Addcombination(ShipmentCombinationModel shipmentCombinationModel){
173   - ShipmentContainerHeader shipmentContainerHeader= shipmentContainerHeaderService.combination(shipmentCombinationModel);
  171 + public AjaxResult addcombination(ShipmentCombinationModel shipmentCombinationModel){
  172 + ShipmentContainerHeader shipmentContainerHeader=
  173 + shipmentContainerHeaderService.combination(shipmentCombinationModel);
174 174 ShipmentTaskCreateModel shipmentTask = new ShipmentTaskCreateModel();
175 175 shipmentTask.setShipmentContainerHeaderIds(shipmentContainerHeader.getId());
176 176 return AjaxResult.success(shipmentContainerHeader.getId());
... ...
src/main/java/com/huaheng/pc/task/taskHeader/service/ReceiptTaskService.java
... ... @@ -415,7 +415,7 @@ public class ReceiptTaskService {
415 415 .eq(InventoryDetail::getBatch,taskDetail.getBatch())
416 416 .eq(InventoryDetail::getReceiptDetailId, taskDetail.getBillDetailId());
417 417 InventoryDetail inventoryDetail = inventoryDetailService.getOne(inventory);
418   - Material material = materialService.findAllByCode(receiptDetail.getMaterialCode(), warehouseCode);
  418 + Material material = materialService.getMaterialByCode(receiptDetail.getMaterialCode(), warehouseCode);
419 419 /*单位换算*/
420 420 BigDecimal receiptQty = taskDetail.getQty();
421 421 if (StringUtils.isNotEmpty(receiptDetail.getMaterialUnit()) &&
... ...
src/main/resources/application.yml
... ... @@ -9,7 +9,7 @@ huaheng:
9 9 #版本
10 10 version: 4.0.0
11 11 #版权年份
12   - copyrightYear: 2021
  12 + copyrightYear: 2022
13 13 # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
14 14 profile: D:/Huaheng/uploadPath/
15 15 # apk路径
... ...
src/main/resources/templates/shipment/shipmentHeader/shipmentHeader.html
... ... @@ -480,18 +480,8 @@
480 480 title: '物料规格'
481 481 },
482 482 {
483   - field: 'batch',
484   - title: '批次',
485   - visible: false
486   - },
487   - {
488   - field: 'lot',
489   - title: '批号',
490   - visible: false
491   - },
492   - {
493   - field: 'projectNo',
494   - title: '项目号'
  483 + field: 'materialUnit',
  484 + title: '物料单位'
495 485 },
496 486 /*{
497 487 field: 'status',
... ... @@ -524,10 +514,6 @@
524 514 },
525 515 },
526 516 {
527   - field: 'port',
528   - title: '出库口',
529   - },
530   - {
531 517 field: 'qty',
532 518 title: '单据数量'
533 519 },
... ... @@ -540,8 +526,22 @@
540 526 title: '库存数量'
541 527 },
542 528 {
543   - field: 'materialUnit',
544   - title: '物料单位'
  529 + field: 'batch',
  530 + title: '批次',
  531 + },
  532 + {
  533 + field: 'lot',
  534 + title: '批号',
  535 + visible: false
  536 + },
  537 + {
  538 + field: 'projectNo',
  539 + title: '项目号',
  540 + visible: false,
  541 + },
  542 + {
  543 + field: 'port',
  544 + title: '出库口',
545 545 },
546 546 {
547 547 field: 'status',
... ...
src/main/resources/templates/shipment/shippingCombination/combination.html
... ... @@ -449,7 +449,7 @@
449 449 $.ajax({
450 450 cache : true,
451 451 type : "post",
452   - url : prefix + "/Addcombination",
  452 + url : prefix + "/addcombination",
453 453 dataType: "json",
454 454 // contentType:"application/json;charset=utf-8",
455 455 data:{
... ... @@ -489,7 +489,7 @@
489 489 $.ajax({
490 490 cache : true,
491 491 type : "post",
492   - url : prefix + "/Addcombination",
  492 + url : prefix + "/addcombination",
493 493 dataType: "json",
494 494 // contentType:"application/json;charset=utf-8",
495 495 data:{
... ... @@ -526,7 +526,7 @@
526 526 $.ajax({
527 527 cache : true,
528 528 type : "post",
529   - url : prefix + "/Addcombination",
  529 + url : prefix + "/addcombination",
530 530 dataType: "json",
531 531 // contentType:"application/json;charset=utf-8",
532 532 data:{
... ...