|
@@ -17,6 +17,7 @@ import com.ruoyi.ams.inv.mapper.InvLotAttMapper;
|
|
|
import com.ruoyi.ams.inv.mapper.InvLotLocIdMapper;
|
|
|
import com.ruoyi.ams.inv.service.IInvLotLocIdService;
|
|
|
import com.ruoyi.ams.order.domain.WmsDocOrderHeader;
|
|
|
+import com.ruoyi.ams.order.form.LineReleaseFrom;
|
|
|
import com.ruoyi.ams.order.service.IWmsDocOrderHeaderService;
|
|
|
import com.ruoyi.ams.task.domain.WcsTask;
|
|
|
import com.ruoyi.base.constant.Constant;
|
|
@@ -264,7 +265,7 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
|
|
|
, warehouseId, updateBy);
|
|
|
|
|
|
// 更新托盘绑定库位关系
|
|
|
- iWmsBoxInfoService.updateLocationBind(palletNo,baseLocationFrom.getId(),baseLocationTo.getId(),null);
|
|
|
+ iWmsBoxInfoService.updateLocationBind(palletNo, baseLocationFrom.getId(), baseLocationTo.getId(), null);
|
|
|
return AjaxResult.success("执行成功");
|
|
|
}
|
|
|
|
|
@@ -316,7 +317,7 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
|
|
|
baseLocationInfoService.updateLocationIdleAndNoEmpty(baseLocationTo.getId(), warehouseId, updateBy);
|
|
|
|
|
|
// 更新托盘绑定库位关系
|
|
|
- iWmsBoxInfoService.updateLocationBind(palletNo,baseLocationFrom.getId(),baseLocationTo.getId(),null);
|
|
|
+ iWmsBoxInfoService.updateLocationBind(palletNo, baseLocationFrom.getId(), baseLocationTo.getId(), null);
|
|
|
return AjaxResult.success("操作成功!");
|
|
|
}
|
|
|
|
|
@@ -379,7 +380,7 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
|
|
|
baseLocationInfoService.updateLocationIdleAndEmpty(id, warehouseId, updateBy);
|
|
|
//修改托盘绑定
|
|
|
WmsBoxInfo wmsBoxInfo = iWmsBoxInfoService.selectByLocationId(baseLocationInfo.getId().toString());
|
|
|
- if(wmsBoxInfo != null) {
|
|
|
+ if (wmsBoxInfo != null) {
|
|
|
wmsBoxInfo.setIsFull("N");
|
|
|
wmsBoxInfo.setIsEmpty("Y");
|
|
|
wmsBoxInfo.setUpdateBy(updateBy);
|
|
@@ -390,6 +391,33 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
|
|
|
return AjaxResult.success("操作成功!");
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @Transactional
|
|
|
+ @Override
|
|
|
+ public AjaxResult clear(Long locationId,String palletNo, Long warehouseId, String updateBy) {
|
|
|
+ InvLocIdSearchFrom invLocIdSearchFrom = new InvLocIdSearchFrom();
|
|
|
+ invLocIdSearchFrom.setLocationId(locationId.toString());
|
|
|
+ invLocIdSearchFrom.setLotatt07(palletNo);
|
|
|
+ List<InvLotLocIdLotattVO> invLotLocIdLotattVOList = invLotLocIdService.selectInvLocIdLotattList(invLocIdSearchFrom);
|
|
|
+ if (invLotLocIdLotattVOList.size() == 0) {
|
|
|
+ return AjaxResult.error("没有可以清除的库存!");
|
|
|
+ }
|
|
|
+ for (InvLotLocIdLotattVO locIdLotattVO : invLotLocIdLotattVOList) {
|
|
|
+ // 清除库存
|
|
|
+ invLotLocIdMapper.deleteInvLotLocIdByPrimaryKey(locIdLotattVO.getLocationId().toString(), locIdLotattVO.getCustomerId()
|
|
|
+ , locIdLotattVO.getSku(), locIdLotattVO.getLotnum());
|
|
|
+ }
|
|
|
+ //修改托盘绑定
|
|
|
+ WmsBoxInfo wmsBoxInfo = iWmsBoxInfoService.selectWmsBoxInfoByBoxNo(palletNo);
|
|
|
+ if (wmsBoxInfo != null) {
|
|
|
+ wmsBoxInfo.setIsFull("N");
|
|
|
+ wmsBoxInfo.setIsEmpty("Y");
|
|
|
+ wmsBoxInfo.setUpdateBy(updateBy);
|
|
|
+ iWmsBoxInfoService.updateWmsBoxInfoIsNull(wmsBoxInfo);
|
|
|
+ }
|
|
|
+ return AjaxResult.success("操作成功!");
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public AjaxResult clearZeroInventory(String locationId, String customerId, String sku, String lotnum) {
|
|
|
InvLotLocId invLotLocId = invLotLocIdService.selectInvLotLocIdById(locationId, customerId, sku, lotnum);
|
|
@@ -564,22 +592,22 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
|
|
|
// query.setQtyEach(query.getQty());
|
|
|
// invLotLocIdService.updateInvLotLocId(query);
|
|
|
// } else {
|
|
|
- InvLotLocId invLotLocId = new InvLotLocId();
|
|
|
- invLotLocId.setLotnum(lotnum);
|
|
|
- invLotLocId.setLocationId(locationFrom);
|
|
|
- invLotLocId.setSku(sku);
|
|
|
- invLotLocId.setCustomerId(customerId);
|
|
|
- invLotLocId.setQty(new BigDecimal(qty));
|
|
|
- invLotLocId.setQtyEach(new BigDecimal(qty));
|
|
|
- invLotLocId.setQtyallocated(qtyallocated);
|
|
|
- invLotLocId.setQtyallocatedEach(qtyallocated);
|
|
|
+ InvLotLocId invLotLocId = new InvLotLocId();
|
|
|
+ invLotLocId.setLotnum(lotnum);
|
|
|
+ invLotLocId.setLocationId(locationFrom);
|
|
|
+ invLotLocId.setSku(sku);
|
|
|
+ invLotLocId.setCustomerId(customerId);
|
|
|
+ invLotLocId.setQty(new BigDecimal(qty));
|
|
|
+ invLotLocId.setQtyEach(new BigDecimal(qty));
|
|
|
+ invLotLocId.setQtyallocated(qtyallocated);
|
|
|
+ invLotLocId.setQtyallocatedEach(qtyallocated);
|
|
|
// invLotLocId.setQtyEach(new BigDecimal(0));
|
|
|
// invLotLocId.setQtyallocated(new BigDecimal(0));
|
|
|
// invLotLocId.setQtyallocatedEach(new BigDecimal(0));
|
|
|
- invLotLocId.setQtypa(BigDecimal.ZERO);
|
|
|
- invLotLocId.setQtyrpin(BigDecimal.ZERO);
|
|
|
- invLotLocId.setCreateTime(new Date());
|
|
|
- invLotLocIdMapper.insertInvLotLocId(invLotLocId);
|
|
|
+ invLotLocId.setQtypa(BigDecimal.ZERO);
|
|
|
+ invLotLocId.setQtyrpin(BigDecimal.ZERO);
|
|
|
+ invLotLocId.setCreateTime(new Date());
|
|
|
+ invLotLocIdMapper.insertInvLotLocId(invLotLocId);
|
|
|
// }
|
|
|
|
|
|
BaseLocationInfo baseLocationInfo = new BaseLocationInfo();
|
|
@@ -619,19 +647,19 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
|
|
|
// query.setQtyEach(query.getQty());
|
|
|
// invLotLocIdService.updateInvLotLocId(query);
|
|
|
// } else {
|
|
|
- InvLotLocId invLotLocId = new InvLotLocId();
|
|
|
- invLotLocId.setLotnum(lotnum);
|
|
|
- invLotLocId.setLocationId(locationFrom);
|
|
|
- invLotLocId.setSku(sku);
|
|
|
- invLotLocId.setCustomerId(customerId);
|
|
|
- invLotLocId.setQty(new BigDecimal(qty));
|
|
|
- invLotLocId.setQtyEach(invLotLocId.getQty());
|
|
|
- invLotLocId.setQtyallocated(invLotLocId.getQty());
|
|
|
- invLotLocId.setQtyallocatedEach(invLotLocId.getQty());
|
|
|
- invLotLocId.setQtypa(BigDecimal.ZERO);
|
|
|
- invLotLocId.setQtyrpin(BigDecimal.ZERO);
|
|
|
- invLotLocId.setCreateTime(new Date());
|
|
|
- invLotLocIdMapper.insertInvLotLocId(invLotLocId);
|
|
|
+ InvLotLocId invLotLocId = new InvLotLocId();
|
|
|
+ invLotLocId.setLotnum(lotnum);
|
|
|
+ invLotLocId.setLocationId(locationFrom);
|
|
|
+ invLotLocId.setSku(sku);
|
|
|
+ invLotLocId.setCustomerId(customerId);
|
|
|
+ invLotLocId.setQty(new BigDecimal(qty));
|
|
|
+ invLotLocId.setQtyEach(invLotLocId.getQty());
|
|
|
+ invLotLocId.setQtyallocated(invLotLocId.getQty());
|
|
|
+ invLotLocId.setQtyallocatedEach(invLotLocId.getQty());
|
|
|
+ invLotLocId.setQtypa(BigDecimal.ZERO);
|
|
|
+ invLotLocId.setQtyrpin(BigDecimal.ZERO);
|
|
|
+ invLotLocId.setCreateTime(new Date());
|
|
|
+ invLotLocIdMapper.insertInvLotLocId(invLotLocId);
|
|
|
// }
|
|
|
|
|
|
BaseLocationInfo baseLocationInfo = new BaseLocationInfo();
|
|
@@ -845,9 +873,9 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
|
|
|
adjLocationIsEmpty(locationFrom, Constant.WAREHOUSE_ID, updateBy);
|
|
|
//修改托盘库位绑定关系
|
|
|
WmsBoxInfo wmsBoxInfo = iWmsBoxInfoService.selectByLocationId(String.valueOf(baseLocationInfo.getId()));
|
|
|
- if(wmsBoxInfo!=null) {
|
|
|
+ if (wmsBoxInfo != null) {
|
|
|
iWmsBoxInfoService.updateLocationBind(baseLocationInfo.getId(), Constant.LOC_SORTATION_CACHE
|
|
|
- , wmsBoxInfo.getIsFull() == null?"":wmsBoxInfo.getIsFull());
|
|
|
+ , wmsBoxInfo.getIsFull() == null ? "" : wmsBoxInfo.getIsFull());
|
|
|
}
|
|
|
//释放库位状态
|
|
|
return AjaxResult.success("操作成功");
|
|
@@ -891,24 +919,54 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
|
|
|
return invLotLocIdService.releaseLocation(basLocationForm.getLocationNo(), Constant.WAREHOUSE_ID, "PDA");
|
|
|
}
|
|
|
|
|
|
+ @Transactional
|
|
|
+ @Override
|
|
|
+ public AjaxResult locationReleaseLine(LineReleaseFrom lineReleaseFrom) {
|
|
|
+ String palletNo = lineReleaseFrom.getPalletNo();
|
|
|
+ String orderNo = "";
|
|
|
+ Long locationId = 0l;
|
|
|
+ InvLocIdSearchFrom invLocIdSearchFrom = new InvLocIdSearchFrom();
|
|
|
+ invLocIdSearchFrom.setLotatt07(palletNo);
|
|
|
+ List<InvLotLocIdLotattVO> invLotLocIdLotattVOList = invLotLocIdService.selectInvLocIdLotattList(invLocIdSearchFrom);
|
|
|
+ if (invLotLocIdLotattVOList.size() == 0) {
|
|
|
+ return AjaxResult.error("托盘没有可以出库的库存!" + palletNo);
|
|
|
+ }
|
|
|
+ for (InvLotLocIdLotattVO locIdLotattVO : invLotLocIdLotattVOList) {
|
|
|
+ if (StringUtils.isEmpty(locIdLotattVO.getLotatt14())) {
|
|
|
+ return AjaxResult.error("线边仓不是备货库存不可出库!");
|
|
|
+ }
|
|
|
+ orderNo = locIdLotattVO.getLotatt14();
|
|
|
+ locationId = locIdLotattVO.getLocationId();
|
|
|
+ }
|
|
|
+ WmsDocOrderHeader wmsDocOrderHeader = wmsDocOrderHeaderService.selectWmsDocOrderHeaderByOrderNo(orderNo);
|
|
|
+ if (!wmsDocOrderHeader.getOrderType().equals(Constant.ORDER_TYP.BH.getValue())) {
|
|
|
+ return AjaxResult.success("线边仓库单据类型位备货单才可出库!");
|
|
|
+ }
|
|
|
+ // 修改出库单状态
|
|
|
+ wmsDocOrderHeaderService.modifyAssignmentStockTaskStatusComplete(orderNo, locationId, palletNo, true);
|
|
|
+ // 清除库存
|
|
|
+ invLotLocIdService.clear(locationId.toString(), Constant.WAREHOUSE_ID, "PDA");
|
|
|
+ return AjaxResult.success("托盘出库成功!" + palletNo);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public AjaxResult checkPalletIsOnlyOrderNo(String palletNoTo, String orderNo) {
|
|
|
InvLocIdSearchFrom invLocIdSearchFrom = new InvLocIdSearchFrom();
|
|
|
invLocIdSearchFrom.setLotatt07(palletNoTo);
|
|
|
List<InvLotLocIdLotattVO> invLotLocIdLotattVOS = invLotLocIdService.selectInvLocIdLotattList(invLocIdSearchFrom);
|
|
|
- if(invLotLocIdLotattVOS.size() == 0){
|
|
|
+ if (invLotLocIdLotattVOS.size() == 0) {
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
for (InvLotLocIdLotattVO invLotLocIdLotattVO : invLotLocIdLotattVOS) {
|
|
|
- String lotatt14 = StringUtils.isEmpty(invLotLocIdLotattVO.getLotatt14())?"":invLotLocIdLotattVO.getLotatt14();
|
|
|
- if (!lotatt14.equals(orderNo)) {
|
|
|
- if(StringUtils.isNotEmpty(orderNo)) {
|
|
|
- return AjaxResult.error("托盘已经存在不是此出库单备货的库存!");
|
|
|
- }else {
|
|
|
- return AjaxResult.error("托盘已经存在备货的库存!");
|
|
|
- }
|
|
|
+ String lotatt14 = StringUtils.isEmpty(invLotLocIdLotattVO.getLotatt14()) ? "" : invLotLocIdLotattVO.getLotatt14();
|
|
|
+ if (!lotatt14.equals(orderNo)) {
|
|
|
+ if (StringUtils.isNotEmpty(orderNo)) {
|
|
|
+ return AjaxResult.error("托盘已经存在不是此出库单备货的库存!");
|
|
|
+ } else {
|
|
|
+ return AjaxResult.error("托盘已经存在备货的库存!");
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
|
|
@@ -917,7 +975,7 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
|
|
|
InvLocIdSearchFrom invLocIdSearchFrom = new InvLocIdSearchFrom();
|
|
|
invLocIdSearchFrom.setLotatt07(palletNo);
|
|
|
List<InvLotLocIdLotattVO> invLotLocIdLotattVOS = invLotLocIdService.selectInvLocIdLotattList(invLocIdSearchFrom);
|
|
|
- if(invLotLocIdLotattVOS.size() == 0){
|
|
|
+ if (invLotLocIdLotattVOS.size() == 0) {
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
for (InvLotLocIdLotattVO invLotLocIdLotattVO : invLotLocIdLotattVOS) {
|
|
@@ -931,7 +989,7 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
|
|
|
List<InvLotLocId> invLotLocIds = invLotLocIdService.selectInvLotLocIdList(Long.valueOf(locationId));
|
|
|
for (InvLotLocId invLotLocId : invLotLocIds) {
|
|
|
InvLotAtt invLotAtt = invLotAttMapper.selectInvLotAttByLotnum(invLotLocId.getLotnum());
|
|
|
- if (invLotAtt != null ) {
|
|
|
+ if (invLotAtt != null) {
|
|
|
if (StringUtils.isNotEmpty(invLotAtt.getLotatt15()) && invLotAtt.getLotatt15().equals(orderNo)) {
|
|
|
break;
|
|
|
}
|