|
@@ -2465,6 +2465,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
|
|
|
|
|
|
@Transactional
|
|
|
+ @Override
|
|
|
public AjaxResult modifystockCompletionStatus(String orderNo, String sku, BigDecimal qty
|
|
|
, String sn, String palletNo, String boxNo) {
|
|
|
WmsDocOrderHeader docOrderHeader = wmsDocOrderHeaderService.selectWmsDocOrderHeaderByOrderNo(orderNo);
|
|
@@ -2536,6 +2537,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
}
|
|
|
|
|
|
@Transactional
|
|
|
+ @Override
|
|
|
public AjaxResult modifystockCompletionStatusAsn(String orderNo, String sku, BigDecimal qty
|
|
|
, String sn, String palletNo, String boxNo) {
|
|
|
WmsDocOrderHeader docOrderHeader = wmsDocOrderHeaderService.selectWmsDocOrderHeaderByOrderNo(orderNo);
|
|
@@ -2615,4 +2617,76 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
+
|
|
|
+ @Transactional
|
|
|
+ @Override
|
|
|
+ public AjaxResult modifystockCompletionStatusAsnUntie(String orderNo, String sku, BigDecimal qty, String sn, String palletNo) {
|
|
|
+ WmsDocOrderHeader docOrderHeader = wmsDocOrderHeaderService.selectWmsDocOrderHeaderByOrderNo(orderNo);
|
|
|
+ // 明细
|
|
|
+ List<WmsDocOrderDetails> wmsDocOrderDetails = wmsDocOrderDetailsMapper.selectWmsDocOrderDetailsByOrderNo(orderNo);
|
|
|
+ for (WmsDocOrderDetails wmsDocOrderDetail : wmsDocOrderDetails) {
|
|
|
+ if (qty.compareTo(BigDecimal.ZERO) == 0) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (sku.equals(wmsDocOrderDetail.getSku())) {
|
|
|
+ // 多少已经备货的
|
|
|
+ BigDecimal toQty = wmsDocOrderDetail.getQtySoftAllocated();
|
|
|
+ if (toQty.compareTo(BigDecimal.ZERO) == 0) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ WmsDocOrderDetails detailsUpdate = new WmsDocOrderDetails();
|
|
|
+ detailsUpdate.setOrderNo(wmsDocOrderDetail.getOrderNo());
|
|
|
+ detailsUpdate.setOrderLineNo(wmsDocOrderDetail.getOrderLineNo());
|
|
|
+ // 数量相等
|
|
|
+ if (qty.compareTo(toQty) == 0) {
|
|
|
+ detailsUpdate.setQtyAllocated(wmsDocOrderDetail.getQtyAllocated().subtract(qty));
|
|
|
+ detailsUpdate.setQtySoftAllocated(wmsDocOrderDetail.getQtySoftAllocated().subtract(qty));
|
|
|
+ // 如果分配数量等于0 订单创建|部分分配
|
|
|
+ if (detailsUpdate.getQtyAllocated().compareTo(BigDecimal.ZERO) == 0) {
|
|
|
+ detailsUpdate.setLineStatus(Constant.ORDER_STS.STS00.getValue());
|
|
|
+ } else {
|
|
|
+ detailsUpdate.setLineStatus(Constant.ORDER_STS.STS10.getValue());
|
|
|
+ }
|
|
|
+ wmsDocOrderDetailsMapper.updateWmsDocOrderDetails(detailsUpdate);
|
|
|
+ // 解绑扫码数据
|
|
|
+ erpBarcodesService.untieRecordErpBarcodeListAsnSo(docOrderHeader.getSoReference1()
|
|
|
+ , wmsDocOrderDetail.getdEdi07() == null ? "" : wmsDocOrderDetail.getdEdi07()
|
|
|
+ , sn);
|
|
|
+ break;
|
|
|
+ // 数量小于备货数量
|
|
|
+ } else if (qty.compareTo(toQty) == -1) {
|
|
|
+ detailsUpdate.setQtyAllocated(wmsDocOrderDetail.getQtyAllocated().subtract(qty));
|
|
|
+ detailsUpdate.setQtySoftAllocated(wmsDocOrderDetail.getQtySoftAllocated().subtract(qty));
|
|
|
+ // 如果分配数量等于0 订单创建|部分分配
|
|
|
+ if (detailsUpdate.getQtyAllocated().compareTo(BigDecimal.ZERO) == 0) {
|
|
|
+ detailsUpdate.setLineStatus(Constant.ORDER_STS.STS00.getValue());
|
|
|
+ } else {
|
|
|
+ detailsUpdate.setLineStatus(Constant.ORDER_STS.STS10.getValue());
|
|
|
+ }
|
|
|
+ wmsDocOrderDetailsMapper.updateWmsDocOrderDetails(detailsUpdate);
|
|
|
+ // 解绑扫码数据
|
|
|
+ erpBarcodesService.untieRecordErpBarcodeListAsnSo(docOrderHeader.getSoReference1()
|
|
|
+ , wmsDocOrderDetail.getdEdi07() == null ? "" : wmsDocOrderDetail.getdEdi07()
|
|
|
+ , sn);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //修改头单状态
|
|
|
+ String soStatus = Constant.ORDER_STS.STS00.getValue();
|
|
|
+ List<WmsDocOrderDetails> wmsDocOrderDetailsList = wmsDocOrderDetailsMapper.selectWmsDocOrderDetailsByOrderNo(orderNo);
|
|
|
+ for (WmsDocOrderDetails d : wmsDocOrderDetailsList) {
|
|
|
+ if (!d.getLineStatus().equals(Constant.ORDER_STS.STS00.getValue())) {
|
|
|
+ soStatus = Constant.ORDER_STS.STS10.getValue();
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ WmsDocOrderHeader headerUpdate = new WmsDocOrderHeader();
|
|
|
+ headerUpdate.setOrderNo(orderNo);
|
|
|
+ headerUpdate.setOrderStatus(soStatus);
|
|
|
+ headerUpdate.setUpdateTime(new Date());
|
|
|
+ wmsDocOrderHeaderMapper.updateWmsDocOrderHeader(headerUpdate);
|
|
|
+
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
}
|