Commit ffff903a20b5aa64053852e9056f80238f4d8f38
Merge remote-tracking branch 'origin/develop' into develop
Showing
4 changed files
with
51 additions
and
46 deletions
src/main/java/com/huaheng/pc/inventory/inventoryHeader/controller/InventoryHeaderController.java
@@ -320,17 +320,17 @@ public class InventoryHeaderController extends BaseController | @@ -320,17 +320,17 @@ public class InventoryHeaderController extends BaseController | ||
320 | } | 320 | } |
321 | /** | 321 | /** |
322 | * 合托保存 | 322 | * 合托保存 |
323 | - * @param destContainerCode 原容器 | ||
324 | - * @param destContainerCode 目的容器 | ||
325 | - * detailIdList ,原容器下面的库存详情id | 323 | + * @param orgLocationCode 原库位 |
324 | + * @param destLocationCode 目的库位 | ||
325 | + * detailIdList ,原库位下面的库存详情id | ||
326 | * @return | 326 | * @return |
327 | */ | 327 | */ |
328 | @Log(title = "入库-入库单 ",operating = "修改入库单 ", action = BusinessType.UPDATE) | 328 | @Log(title = "入库-入库单 ",operating = "修改入库单 ", action = BusinessType.UPDATE) |
329 | @PostMapping("/conformContainerSave") | 329 | @PostMapping("/conformContainerSave") |
330 | @ResponseBody | 330 | @ResponseBody |
331 | - public AjaxResult conformContainerSave(String orgContainerCode, String destContainerCode, String detailIdList) | 331 | + public AjaxResult conformContainerSave(String orgLocationCode, String destLocationCode, String detailIdList) |
332 | { | 332 | { |
333 | - return inventoryHeaderService.conformContainerSave(orgContainerCode, destContainerCode,detailIdList); | 333 | + return inventoryHeaderService.conformContainerSave(orgLocationCode, destLocationCode,detailIdList); |
334 | } | 334 | } |
335 | 335 | ||
336 | 336 |
src/main/java/com/huaheng/pc/inventory/inventoryHeader/service/InventoryHeaderService.java
@@ -67,7 +67,7 @@ public interface InventoryHeaderService extends IService<InventoryHeader> { | @@ -67,7 +67,7 @@ public interface InventoryHeaderService extends IService<InventoryHeader> { | ||
67 | 67 | ||
68 | List<Integer> cycleCountInventoryHeader(); | 68 | List<Integer> cycleCountInventoryHeader(); |
69 | 69 | ||
70 | - AjaxResult conformContainerSave(String orgContainerCode, String destContainerCode, String detailIdList); | 70 | + AjaxResult conformContainerSave(String orgLocationCode, String destLocationCode, String detailIdList); |
71 | 71 | ||
72 | } | 72 | } |
73 | 73 |
src/main/java/com/huaheng/pc/inventory/inventoryHeader/service/InventoryHeaderServiceImpl.java
@@ -447,27 +447,30 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe | @@ -447,27 +447,30 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe | ||
447 | /** | 447 | /** |
448 | * 合托,将原容器物料移到目的容器,可以整个容器全部移到目的容器,也可以其中一分部移动 | 448 | * 合托,将原容器物料移到目的容器,可以整个容器全部移到目的容器,也可以其中一分部移动 |
449 | * 记录库存交易,判断明细不能是锁定状态(详情表锁状态没用到,暂时没判断) | 449 | * 记录库存交易,判断明细不能是锁定状态(详情表锁状态没用到,暂时没判断) |
450 | - * @param orgContainerCode 原容器 | ||
451 | - * @param destContainerCode 目的容器 | 450 | + * @param orgLocationCode 原容器 |
451 | + * @param destLocationCode 目的容器 | ||
452 | * @param detailIdList 库存详情id | 452 | * @param detailIdList 库存详情id |
453 | * @return | 453 | * @return |
454 | */ | 454 | */ |
455 | @Override | 455 | @Override |
456 | @Transactional(rollbackFor = Exception.class) | 456 | @Transactional(rollbackFor = Exception.class) |
457 | - public AjaxResult conformContainerSave(String orgContainerCode, String destContainerCode, String detailIdList) { | ||
458 | - if(StringUtils.isEmpty(orgContainerCode)||StringUtils.isEmpty(destContainerCode)){ | ||
459 | - return AjaxResult.error("原容器,目的容器不能为空"); | 457 | + public AjaxResult conformContainerSave(String orgLocationCode, String destLocationCode, String detailIdList) { |
458 | + if(StringUtils.isEmpty(orgLocationCode)||StringUtils.isEmpty(destLocationCode)){ | ||
459 | + return AjaxResult.error("原库位,目的库位不能为空"); | ||
460 | } | 460 | } |
461 | // 判断原容器、目的容器是否存在库存里 | 461 | // 判断原容器、目的容器是否存在库存里 |
462 | - InventoryHeader inventoryHeader=checkContainer(orgContainerCode); | ||
463 | - InventoryHeader inventoryHeader1=checkContainer(destContainerCode); | 462 | + InventoryHeader inventoryHeader=checkContainer(orgLocationCode); |
463 | + InventoryHeader inventoryHeader1=checkContainer(destLocationCode); | ||
464 | if(inventoryHeader==null){ | 464 | if(inventoryHeader==null){ |
465 | - return AjaxResult.error("原容器不存在库存"); | 465 | + return AjaxResult.error("原库位不存在库存"); |
466 | } | 466 | } |
467 | if(inventoryHeader1==null){ | 467 | if(inventoryHeader1==null){ |
468 | - return AjaxResult.error("目的容器不存在库存"); | 468 | + return AjaxResult.error("目的库位不存在库存"); |
469 | + } | ||
470 | + if(inventoryHeader.getId().equals(inventoryHeader1.getId())){ | ||
471 | + return AjaxResult.error("目的库位库存不能和原库位库存同一个"); | ||
469 | } | 472 | } |
470 | - List<InventoryDetail> list=getDetailByContainerCode(orgContainerCode); | 473 | + List<InventoryDetail> list=getDetailByContainerCode(orgLocationCode); |
471 | if(null==list||list.size()==0){ | 474 | if(null==list||list.size()==0){ |
472 | return AjaxResult.error("原容器不存在库存"); | 475 | return AjaxResult.error("原容器不存在库存"); |
473 | } | 476 | } |
@@ -483,7 +486,7 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe | @@ -483,7 +486,7 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe | ||
483 | for(int a=0;a<str.length;a++){ | 486 | for(int a=0;a<str.length;a++){ |
484 | Integer detailid=Integer.valueOf(str[a]); | 487 | Integer detailid=Integer.valueOf(str[a]); |
485 | if(detail.getId().equals(detailid)){ | 488 | if(detail.getId().equals(detailid)){ |
486 | - saveInvDetail(detail,destContainerCode,inventoryHeader1); | 489 | + saveInvDetail(detail,destLocationCode,inventoryHeader1); |
487 | } | 490 | } |
488 | } | 491 | } |
489 | } | 492 | } |
@@ -492,20 +495,20 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe | @@ -492,20 +495,20 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe | ||
492 | } | 495 | } |
493 | }else{ | 496 | }else{ |
494 | for (InventoryDetail detail:list){ | 497 | for (InventoryDetail detail:list){ |
495 | - saveInvDetail(detail,destContainerCode,inventoryHeader1); | 498 | + saveInvDetail(detail,destLocationCode,inventoryHeader1); |
496 | } | 499 | } |
497 | } | 500 | } |
498 | //修改库存主表 | 501 | //修改库存主表 |
499 | - updateInventoryHeader(orgContainerCode); | ||
500 | - updateInventoryHeader(destContainerCode); | 502 | + updateInventoryHeader(orgLocationCode); |
503 | + updateInventoryHeader(destLocationCode); | ||
501 | return AjaxResult.success(); | 504 | return AjaxResult.success(); |
502 | } | 505 | } |
503 | //保存库存交易表,修改库存详情 | 506 | //保存库存交易表,修改库存详情 |
504 | - public void saveInvDetail(InventoryDetail detail,String destContainerCode,InventoryHeader inventoryHeader1){ | 507 | + public void saveInvDetail(InventoryDetail detail,String destLocationCode,InventoryHeader inventoryHeader1){ |
505 | //保存库存交易 | 508 | //保存库存交易 |
506 | saveInventoryTransaction(detail,true); | 509 | saveInventoryTransaction(detail,true); |
507 | - detail.setContainerCode(destContainerCode); | ||
508 | - detail.setLocationCode(inventoryHeader1.getLocationCode()); | 510 | + detail.setLocationCode(destLocationCode); |
511 | + detail.setContainerCode(inventoryHeader1.getContainerCode()); | ||
509 | detail.setInventoryHeaderId(inventoryHeader1.getId()); | 512 | detail.setInventoryHeaderId(inventoryHeader1.getId()); |
510 | detail.setLastUpdated(new Date()); | 513 | detail.setLastUpdated(new Date()); |
511 | detail.setLastUpdatedBy(ShiroUtils.getLoginName()); | 514 | detail.setLastUpdatedBy(ShiroUtils.getLoginName()); |
@@ -514,27 +517,27 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe | @@ -514,27 +517,27 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe | ||
514 | saveInventoryTransaction(detail,false); | 517 | saveInventoryTransaction(detail,false); |
515 | } | 518 | } |
516 | //根据容器检查库存主表是否有数量 | 519 | //根据容器检查库存主表是否有数量 |
517 | - public InventoryHeader checkContainer(String orgContainerCode){ | 520 | + public InventoryHeader checkContainer(String orgLocationCode){ |
518 | boolean result=false; | 521 | boolean result=false; |
519 | LambdaQueryWrapper<InventoryHeader> lambdaQueryWrapper = Wrappers.lambdaQuery(); | 522 | LambdaQueryWrapper<InventoryHeader> lambdaQueryWrapper = Wrappers.lambdaQuery(); |
520 | - lambdaQueryWrapper.eq(InventoryHeader::getContainerCode, orgContainerCode); | 523 | + lambdaQueryWrapper.eq(InventoryHeader::getLocationCode, orgLocationCode); |
521 | lambdaQueryWrapper.gt(InventoryHeader::getTotalQty,0); | 524 | lambdaQueryWrapper.gt(InventoryHeader::getTotalQty,0); |
522 | InventoryHeader inventoryHeader=this.getOne(lambdaQueryWrapper); | 525 | InventoryHeader inventoryHeader=this.getOne(lambdaQueryWrapper); |
523 | return inventoryHeader; | 526 | return inventoryHeader; |
524 | } | 527 | } |
525 | //根据容器查询库存详情列表 | 528 | //根据容器查询库存详情列表 |
526 | - public List<InventoryDetail> getDetailByContainerCode(String orgContainerCode){ | 529 | + public List<InventoryDetail> getDetailByContainerCode(String orgLocationCode){ |
527 | LambdaQueryWrapper<InventoryDetail> lambdaQueryWrapper = Wrappers.lambdaQuery(); | 530 | LambdaQueryWrapper<InventoryDetail> lambdaQueryWrapper = Wrappers.lambdaQuery(); |
528 | - lambdaQueryWrapper.eq(InventoryDetail::getContainerCode, orgContainerCode); | 531 | + lambdaQueryWrapper.eq(InventoryDetail::getLocationCode, orgLocationCode); |
529 | List<InventoryDetail> list=inventoryDetailService.list(lambdaQueryWrapper); | 532 | List<InventoryDetail> list=inventoryDetailService.list(lambdaQueryWrapper); |
530 | return list; | 533 | return list; |
531 | } | 534 | } |
532 | //根据容器修改库存主表 | 535 | //根据容器修改库存主表 |
533 | - public void updateInventoryHeader(String orgContainerCode){ | ||
534 | - List<InventoryDetail> list=getDetailByContainerCode(orgContainerCode); | 536 | + public void updateInventoryHeader(String orgLocationCode){ |
537 | + List<InventoryDetail> list=getDetailByContainerCode(orgLocationCode); | ||
535 | int qty=0; | 538 | int qty=0; |
536 | LambdaQueryWrapper<InventoryHeader> lambdaQueryWrapper = Wrappers.lambdaQuery(); | 539 | LambdaQueryWrapper<InventoryHeader> lambdaQueryWrapper = Wrappers.lambdaQuery(); |
537 | - lambdaQueryWrapper.eq(InventoryHeader::getContainerCode, orgContainerCode); | 540 | + lambdaQueryWrapper.eq(InventoryHeader::getLocationCode, orgLocationCode); |
538 | InventoryHeader inventoryHeader=this.getOne(lambdaQueryWrapper); | 541 | InventoryHeader inventoryHeader=this.getOne(lambdaQueryWrapper); |
539 | if(list==null||list.size()==0){ | 542 | if(list==null||list.size()==0){ |
540 | this.removeById(inventoryHeader); | 543 | this.removeById(inventoryHeader); |
src/main/resources/templates/inventory/inventoryHeader/conformContainer.html
@@ -5,20 +5,22 @@ | @@ -5,20 +5,22 @@ | ||
5 | <body class="white-bg"> | 5 | <body class="white-bg"> |
6 | <div class="wrapper wrapper-content animated fadeInRight ibox-content"> | 6 | <div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
7 | <form class="form-horizontal m" id="form-task-emptyIn"> | 7 | <form class="form-horizontal m" id="form-task-emptyIn"> |
8 | - <span style="color:red;margin-left:25%">*如果不勾选明细,则默认该容器明细全部转移到目的容器</span> | 8 | + <span style="color:red;margin-left:25%">*如果不勾选明细,则默认该库位明细全部转移到目的容器</span> |
9 | <div class="form-group"> | 9 | <div class="form-group"> |
10 | - <label class="col-sm-3 control-label">原容器编码:</label> | 10 | + <label class="col-sm-3 control-label">原库位编码:</label> |
11 | <div class="col-sm-6"> | 11 | <div class="col-sm-6"> |
12 | - <input id="orgContainerCode" name="orgContainerCode" class="form-control" type="text" > | 12 | + <input id="orgLocationCode" name="orgLocationCode" class="form-control" type="text" > |
13 | + <!--<input id="orgContainerCode" name="orgContainerCode" class="form-control" type="text" >--> | ||
13 | </div> | 14 | </div> |
14 | <input type="hidden" id="detailIdList" name="detailIdList"> | 15 | <input type="hidden" id="detailIdList" name="detailIdList"> |
15 | <button type="button" class="btn btn-primary" onclick="selectMaterial()">选取明细</button> | 16 | <button type="button" class="btn btn-primary" onclick="selectMaterial()">选取明细</button> |
16 | <button type="button" class="btn btn-primary" onclick="clearSelect()">清空明细</button> | 17 | <button type="button" class="btn btn-primary" onclick="clearSelect()">清空明细</button> |
17 | </div> | 18 | </div> |
18 | <div class="form-group"> | 19 | <div class="form-group"> |
19 | - <label class="col-sm-3 control-label">目的容器:</label> | 20 | + <label class="col-sm-3 control-label">目的库位:</label> |
20 | <div class="col-sm-8"> | 21 | <div class="col-sm-8"> |
21 | - <input id="destContainerCode" name="destContainerCode" class="form-control" type="text" > | 22 | + <input id="destLocationCode" name="destLocationCode" class="form-control" type="text"> |
23 | + <!--<input id="destContainerCode" name="destContainerCode" class="form-control" type="text">--> | ||
22 | </div> | 24 | </div> |
23 | </div> | 25 | </div> |
24 | <div class="col-sm-12 select-info" id="selecttable" > | 26 | <div class="col-sm-12 select-info" id="selecttable" > |
@@ -43,16 +45,16 @@ | @@ -43,16 +45,16 @@ | ||
43 | $("#detailIdList").val(''); | 45 | $("#detailIdList").val(''); |
44 | } | 46 | } |
45 | function selectMaterial(){ | 47 | function selectMaterial(){ |
46 | - var orgContainerCode=$("#orgContainerCode").val(); | ||
47 | - if(orgContainerCode==''||orgContainerCode==undefined){ | ||
48 | - $.modal.alertError("请填写原容器编码"); | 48 | + var orgLocationCode=$("#orgLocationCode").val(); |
49 | + if(orgLocationCode==''||orgLocationCode==undefined){ | ||
50 | + $.modal.alertError("请填写原库位编码"); | ||
49 | return; | 51 | return; |
50 | } | 52 | } |
51 | $.ajax({ | 53 | $.ajax({ |
52 | url:prefix + '/inventoryDetailLook', | 54 | url:prefix + '/inventoryDetailLook', |
53 | type:"post", | 55 | type:"post", |
54 | data:{ | 56 | data:{ |
55 | - "containerCode":orgContainerCode, | 57 | + "locationCode":orgLocationCode, |
56 | }, | 58 | }, |
57 | success:function (value) { | 59 | success:function (value) { |
58 | console.log(value) | 60 | console.log(value) |
@@ -183,14 +185,14 @@ | @@ -183,14 +185,14 @@ | ||
183 | $("#form-task-emptyIn").validate({ | 185 | $("#form-task-emptyIn").validate({ |
184 | 186 | ||
185 | submitHandler: function(form) { | 187 | submitHandler: function(form) { |
186 | - var orgContainerCode=$("#orgContainerCode").val(); | ||
187 | - var destContainerCode=$("#destContainerCode").val(); | ||
188 | - if(orgContainerCode==''||destContainerCode==''){ | ||
189 | - $.modal.alertError("请填写原容器编码和目的容器编号"); | 188 | + var orgLocationCode=$("#orgLocationCode").val(); |
189 | + var destLocationCode=$("#destLocationCode").val(); | ||
190 | + if(orgLocationCode==''||destLocationCode==''){ | ||
191 | + $.modal.alertError("请填写原库位编码和目的库位编号"); | ||
190 | return; | 192 | return; |
191 | } | 193 | } |
192 | let rows = $("#bootstrap-table").bootstrapTable('getSelections'); | 194 | let rows = $("#bootstrap-table").bootstrapTable('getSelections'); |
193 | - console.log(rows); | 195 | + //console.log(rows); |
194 | var ids = ""; | 196 | var ids = ""; |
195 | for (var i = 0; i<rows.length; i++){ | 197 | for (var i = 0; i<rows.length; i++){ |
196 | ids += rows[i].id; | 198 | ids += rows[i].id; |
@@ -202,8 +204,8 @@ | @@ -202,8 +204,8 @@ | ||
202 | url:prefix_header + "/conformContainerSave", | 204 | url:prefix_header + "/conformContainerSave", |
203 | type:"post", | 205 | type:"post", |
204 | data:{ | 206 | data:{ |
205 | - "orgContainerCode":orgContainerCode, | ||
206 | - "destContainerCode":destContainerCode, | 207 | + "orgLocationCode":orgLocationCode, |
208 | + "destLocationCode":destLocationCode, | ||
207 | "detailIdList":ids, | 209 | "detailIdList":ids, |
208 | }, | 210 | }, |
209 | success:function (result) { | 211 | success:function (result) { |