|
@@ -4,6 +4,7 @@ import com.ruoyi.ams.asn.domain.WmsDocAsnDetails;
|
|
|
import com.ruoyi.ams.asn.domain.WmsDocAsnHeader;
|
|
|
import com.ruoyi.ams.asn.service.IWmsDocAsnDetailsService;
|
|
|
import com.ruoyi.ams.asn.service.IWmsDocAsnHeaderService;
|
|
|
+import com.ruoyi.ams.asn.vo.SearchStockSkuVO;
|
|
|
import com.ruoyi.ams.inv.domain.InvLotAtt;
|
|
|
import com.ruoyi.ams.inv.domain.InvLotLocId;
|
|
|
import com.ruoyi.ams.inv.service.IInvLotLocIdService;
|
|
@@ -65,7 +66,8 @@ public class WcsTaskSubService {
|
|
|
BaseLocationInfo baseLocationInfoFrom = iBaseLocationInfoService.selectBaseLocationInfoByIdOrNo(locationFrom, 1l);
|
|
|
BaseLocationInfo baseLocationInfoTo = iBaseLocationInfoService.selectBaseLocationInfoByIdOrNo(locationTo, 1l);
|
|
|
|
|
|
- String taskNo = generateTaskNo();;
|
|
|
+ String taskNo = generateTaskNo();
|
|
|
+ ;
|
|
|
WcsTask wcsTask = new WcsTask();
|
|
|
wcsTask.setTaskNo(taskNo);
|
|
|
wcsTask.setState(10L);
|
|
@@ -176,24 +178,32 @@ public class WcsTaskSubService {
|
|
|
iBaseLocationInfoService.unLockLocationStockStatus(Long.parseLong(wcsTask.getLocationFrom())
|
|
|
, Long.parseLong(wcsTask.getLocationTo())
|
|
|
, Constant.WAREHOUSE_ID, updateBy);
|
|
|
- // 将起始点库存移动到终点库位
|
|
|
- iWcsTaskService.moveStartingPointToDestination(wcsTask);
|
|
|
- // 修改入库单收货数量
|
|
|
- completeTheCallback(wcsTask);
|
|
|
-
|
|
|
+ if (wcsTask.getExt1().startsWith("ASN")) {
|
|
|
+ // 将起始点库存移动到终点库位
|
|
|
+ iWcsTaskService.moveStartingPointToDestination(wcsTask);
|
|
|
+ // 修改入库单收货数量
|
|
|
+ completeTheCallback(wcsTask);
|
|
|
+ }
|
|
|
+ if (wcsTask.getExt1().startsWith("SO")) {
|
|
|
+ // 将起始点库存移动到终点库位
|
|
|
+ iWcsTaskService.moveStartingPointToDestinationout(wcsTask);
|
|
|
+ invLotLocIdService.adjLocationIsEmpty(wcsTask.getLocationFrom(), Constant.WAREHOUSE_ID, "Wcs");
|
|
|
+ // 修改出库单收货数量
|
|
|
+ completeTheCallbackOut(wcsTask);
|
|
|
+ }
|
|
|
break;
|
|
|
case 4:
|
|
|
if (wcsTask.getState() == 4) {
|
|
|
log.info("不能重复取货," + taskNo);
|
|
|
return;
|
|
|
}
|
|
|
- // 解锁起始库位
|
|
|
- iBaseLocationInfoService.unLockLocationStockStatus(Long.parseLong(wcsTask.getLocationFrom())
|
|
|
- , Constant.WAREHOUSE_ID, updateBy);
|
|
|
- // 将起始点库存移动到中间缓存位
|
|
|
- iWcsTaskService.moveStartingPointToMiddleCache(wcsTask);
|
|
|
- completeTheCallbackOut(wcsTask);
|
|
|
+// // 解锁起始库位
|
|
|
+// iBaseLocationInfoService.unLockLocationStockStatus(Long.parseLong(wcsTask.getLocationFrom())
|
|
|
+// , Constant.WAREHOUSE_ID, updateBy);
|
|
|
+// // 将起始点库存移动到终点位
|
|
|
+// iWcsTaskService.moveStartingPointToDestination(wcsTask);
|
|
|
break;
|
|
|
+
|
|
|
case 7://取消
|
|
|
wcsTask.setEndTime(new Date());
|
|
|
// 解锁终点和起始库位
|
|
@@ -230,29 +240,29 @@ public class WcsTaskSubService {
|
|
|
WmsDocAsnDetails wmsDocAsnDetails = iWmsDocAsnDetailsService.selectWmsDocAsnDetailsByAsnNoLineNo(asnNo, "1");
|
|
|
BigDecimal expectedQty = wmsDocAsnDetails.getExpectedQty();
|
|
|
BigDecimal receivedQty = wmsDocAsnDetails.getReceivedQty();
|
|
|
- BigDecimal canQty= expectedQty.subtract(receivedQty);
|
|
|
+ BigDecimal canQty = expectedQty.subtract(receivedQty);
|
|
|
InvLotAtt invLotAtt = new InvLotAtt();
|
|
|
invLotAtt.setLotatt07(palletNo);
|
|
|
invLotAtt.setLotatt08(asnNo);
|
|
|
List<InvLotLocId> invLotLocIds = invLotLocIdService.queryInvByInvLotatt(invLotAtt);
|
|
|
- for (InvLotLocId invLotLocId:invLotLocIds) {
|
|
|
+ for (InvLotLocId invLotLocId : invLotLocIds) {
|
|
|
BigDecimal qty = invLotLocId.getQty();
|
|
|
- if (qty.compareTo(canQty) == 1){
|
|
|
+ if (qty.compareTo(canQty) == 1) {
|
|
|
continue;
|
|
|
- }else if ( qty.compareTo(canQty) == 0){
|
|
|
+ } else if (qty.compareTo(canQty) == 0) {
|
|
|
wmsDocAsnDetails.setReceivedQty(expectedQty);
|
|
|
int i = iWmsDocAsnDetailsService.updateWmsDocAsnDetails(wmsDocAsnDetails);
|
|
|
- if ( i > 0){
|
|
|
+ if (i > 0) {
|
|
|
wmsDocAsnDetails.setLineStatus(Constant.ASN_STS.STS40.getValue());
|
|
|
iWmsDocAsnDetailsService.updateWmsDocAsnDetails(wmsDocAsnDetails);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
con = false;
|
|
|
continue;
|
|
|
}
|
|
|
- }else if (qty.compareTo(canQty) == -1){
|
|
|
+ } else if (qty.compareTo(canQty) == -1) {
|
|
|
wmsDocAsnDetails.setReceivedQty(receivedQty.add(qty));
|
|
|
int i = iWmsDocAsnDetailsService.updateWmsDocAsnDetails(wmsDocAsnDetails);
|
|
|
- if ( i > 0){
|
|
|
+ if (i > 0) {
|
|
|
wmsDocAsnDetails.setLineStatus(Constant.ASN_STS.STS30.getValue());
|
|
|
iWmsDocAsnDetailsService.updateWmsDocAsnDetails(wmsDocAsnDetails);
|
|
|
con1 = false;
|
|
@@ -276,6 +286,7 @@ public class WcsTaskSubService {
|
|
|
|
|
|
/**
|
|
|
* 出库完成任务回调
|
|
|
+ *
|
|
|
* @param wcsTask
|
|
|
* @return
|
|
|
*/
|
|
@@ -285,33 +296,32 @@ public class WcsTaskSubService {
|
|
|
String palletNo = wcsTask.getExt2();
|
|
|
String orderNo = wcsTask.getExt1();
|
|
|
List<WmsDocOrderDetails> list = iWmsDocOrderDetailsService.selectWmsDocOrderDetailsByOrderNo(orderNo);
|
|
|
- BigDecimal qtyOrderedEach = list.get(1).getQtyOrderedEach();
|
|
|
- BigDecimal allocatedEach = list.get(1).getQtyAllocatedEach();
|
|
|
- BigDecimal canQty= qtyOrderedEach.subtract(allocatedEach);
|
|
|
+ BigDecimal qtyOrderedEach = list.get(0).getQtyOrderedEach();
|
|
|
+ BigDecimal allocatedEach = list.get(0).getQtyAllocated();
|
|
|
+ BigDecimal canQty = qtyOrderedEach.subtract(allocatedEach);
|
|
|
InvLotAtt invLotAtt = new InvLotAtt();
|
|
|
invLotAtt.setLotatt07(palletNo);
|
|
|
- invLotAtt.setLotatt08(orderNo);
|
|
|
List<InvLotLocId> invLotLocIds = invLotLocIdService.queryInvByInvLotatt(invLotAtt);
|
|
|
- for (InvLotLocId invLotLocId:invLotLocIds) {
|
|
|
+ for (InvLotLocId invLotLocId : invLotLocIds) {
|
|
|
BigDecimal qty = invLotLocId.getQty();
|
|
|
- if (qty.compareTo(canQty) == 1){
|
|
|
+ if (qty.compareTo(canQty) == 1) {
|
|
|
continue;
|
|
|
- }else if ( qty.compareTo(canQty) == 0){
|
|
|
- list.get(1).setQtyAllocatedEach(qtyOrderedEach);
|
|
|
- int i = iWmsDocOrderDetailsService.updateWmsDocOrderDetails(list.get(1));
|
|
|
- if ( i > 0){
|
|
|
- list.get(1).setLineStatus(Constant.ASN_STS.STS40.getValue());
|
|
|
- iWmsDocOrderDetailsService.updateWmsDocOrderDetails(list.get(1));
|
|
|
- }else {
|
|
|
+ } else if (qty.compareTo(canQty) == 0) {
|
|
|
+ list.get(0).setQtyAllocated(qtyOrderedEach);
|
|
|
+ int i = iWmsDocOrderDetailsService.updateWmsDocOrderDetails(list.get(0));
|
|
|
+ if (i > 0) {
|
|
|
+ list.get(0).setLineStatus(Constant.ASN_STS.STS40.getValue());
|
|
|
+ iWmsDocOrderDetailsService.updateWmsDocOrderDetails(list.get(0));
|
|
|
+ } else {
|
|
|
con = false;
|
|
|
continue;
|
|
|
}
|
|
|
- }else if (qty.compareTo(canQty) == -1){
|
|
|
- list.get(1).setQtyAllocatedEach(allocatedEach.add(qty));
|
|
|
- int i = iWmsDocOrderDetailsService.updateWmsDocOrderDetails(list.get(1));
|
|
|
- if ( i > 0){
|
|
|
- list.get(1).setLineStatus(Constant.ASN_STS.STS30.getValue());
|
|
|
- iWmsDocOrderDetailsService.updateWmsDocOrderDetails(list.get(1));
|
|
|
+ } else if (qty.compareTo(canQty) == -1) {
|
|
|
+ list.get(0).setQtyAllocated(allocatedEach.add(qty));
|
|
|
+ int i = iWmsDocOrderDetailsService.updateWmsDocOrderDetails(list.get(0));
|
|
|
+ if (i > 0) {
|
|
|
+ list.get(0).setLineStatus(Constant.ASN_STS.STS30.getValue());
|
|
|
+ iWmsDocOrderDetailsService.updateWmsDocOrderDetails(list.get(0));
|
|
|
con1 = false;
|
|
|
}
|
|
|
}
|