|
@@ -21,6 +21,7 @@ import com.ruoyi.ams.inv.domain.InvLotAtt;
|
|
|
import com.ruoyi.ams.inv.domain.InvLotLocId;
|
|
|
import com.ruoyi.ams.inv.domain.form.InvLocIdSearchFrom;
|
|
|
import com.ruoyi.ams.inv.domain.form.InvLotLocIdMoveForm;
|
|
|
+import com.ruoyi.ams.inv.domain.vo.InvLotLocIdLotattVO;
|
|
|
import com.ruoyi.ams.inv.mapper.InvLotLocIdMapper;
|
|
|
import com.ruoyi.ams.inv.service.IActTransactionLogService;
|
|
|
import com.ruoyi.ams.inv.service.IInvLotAttService;
|
|
@@ -284,8 +285,9 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
|
|
|
wmsBoxInfo.setBoxNo(stockForm.getPalletNo());
|
|
|
wmsBoxInfo.setBoxState(1);
|
|
|
wmsBoxInfo.setBoxType("pallet");
|
|
|
- wmsBoxInfo.setIsEmpty("N");
|
|
|
wmsBoxInfo.setIsFull(stockForm.getFullTag());
|
|
|
+ wmsBoxInfo.setIsEmpty("N");
|
|
|
+ wmsBoxInfo.setLocationId(Long.parseLong(STAGE01));
|
|
|
wmsBoxInfo.setCreateBy(loginUser.getUsername());
|
|
|
wmsBoxInfo.setCreateTime(new Date());
|
|
|
wmsBoxInfo.setUpdateBy(loginUser.getUsername());
|
|
@@ -297,11 +299,11 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
|
|
|
throw new ServiceException("该托盘已放满");
|
|
|
}
|
|
|
wmsBoxInfo.setBoxState(1);//启用状态
|
|
|
+ wmsBoxInfo.setIsFull(stockForm.getFullTag());
|
|
|
+ wmsBoxInfo.setIsEmpty("N");
|
|
|
wmsBoxInfo.setLocationId(Long.parseLong(STAGE01));
|
|
|
wmsBoxInfo.setUpdateBy(loginUser.getUsername());
|
|
|
wmsBoxInfo.setUpdateTime(new Date());
|
|
|
- wmsBoxInfo.setIsFull(stockForm.getFullTag());
|
|
|
- wmsBoxInfo.setIsEmpty("N");
|
|
|
boxInfoService.updateWmsBoxInfo(wmsBoxInfo);
|
|
|
}
|
|
|
|
|
@@ -387,15 +389,31 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
|
|
|
return AjaxResult.error("没有可以接收的入库单");
|
|
|
} else {
|
|
|
for (WmsDocAsnDetails details : list) {
|
|
|
- InvLotAtt attQuery = new InvLotAtt();
|
|
|
- attQuery.setSku(codeSkuRelationshipVO.getSku());
|
|
|
- attQuery.setLotatt07(stockForm.getPalletNo());
|
|
|
- attQuery.setLotatt02(codeSkuRelationshipVO.getSn());
|
|
|
- attQuery.setLotatt08(details.getAsnNo());
|
|
|
- attQuery.setLotatt14(stockForm.getOrderNo());
|
|
|
- List<InvLotLocId> samePalletInvList = invLotLocIdMapper.queryInvByInvLotatt(attQuery);
|
|
|
- if (samePalletInvList != null && samePalletInvList.size() > 0) {
|
|
|
- throw new ServiceException("每个成品条码相同托盘只允许码一次");
|
|
|
+ // 成品条码,扫码新托盘的时候,自动解绑老托盘数据。
|
|
|
+ if(codeSkuRelationshipVO.isProduct()) {
|
|
|
+ InvLotAtt attQuery = new InvLotAtt();
|
|
|
+ attQuery.setSku(codeSkuRelationshipVO.getSku());
|
|
|
+// attQuery.setLotatt07(stockForm.getPalletNo());
|
|
|
+ attQuery.setLotatt02(codeSkuRelationshipVO.getSn());
|
|
|
+ attQuery.setLotatt08(details.getAsnNo());
|
|
|
+ attQuery.setLotatt14(stockForm.getOrderNo());
|
|
|
+ List<InvLotLocIdLotattVO> samePalletInvList = invLotLocIdMapper.queryInvLotattByInvLotatt(attQuery);
|
|
|
+ if (samePalletInvList != null && samePalletInvList.size() > 0) {
|
|
|
+ for (InvLotLocIdLotattVO locIdLotattVO : samePalletInvList) {
|
|
|
+ if (locIdLotattVO.getLotatt07().equals(stockForm.getPalletNo())) {
|
|
|
+ throw new ServiceException("每个成品条码只允许码盘一次");
|
|
|
+ }
|
|
|
+ // 解绑老托盘
|
|
|
+ UnlockForm unlockForm = new UnlockForm();
|
|
|
+ unlockForm.setPalletNo(locIdLotattVO.getLotatt07());
|
|
|
+ unlockForm.setSku(locIdLotattVO.getSku());
|
|
|
+ unlockForm.setLotnum(locIdLotattVO.getLotnum());
|
|
|
+ AjaxResult ajaxResult = unloadStock(unlockForm);
|
|
|
+ if (!ajaxResult.isSuccess()) {
|
|
|
+ throw new ServiceException("解绑老托盘失败:" + ajaxResult.getMsg());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//如果入库单预计数量大于接收数
|
|
@@ -427,7 +445,7 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
|
|
|
throw new ServiceException("更新接收数失败");
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(stockForm.getOrderNo())) {
|
|
|
- //绑定对应入库单号
|
|
|
+ //绑定对应入库单号 todo 这边修改了个寂寞
|
|
|
WmsDocAsnDetails updateDetails = new WmsDocAsnDetails();
|
|
|
updateDetails.setAsnNo(details.getAsnNo());
|
|
|
updateDetails.setAsnLineNo(details.getAsnLineNo());
|
|
@@ -566,10 +584,10 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
|
|
|
public AjaxResult unloadStock(UnlockForm unlockForm) {
|
|
|
WmsBoxInfo wmsBoxInfo = wmsBoxInfoService.selectWmsBoxInfoByBoxNo(unlockForm.getPalletNo());
|
|
|
if (wmsBoxInfo == null) {
|
|
|
- return AjaxResult.error("查询不到托盘");
|
|
|
+ return AjaxResult.error("查询不到托盘:" + unlockForm.getPalletNo());
|
|
|
}
|
|
|
if (wmsBoxInfo.getLocationId() == null) {
|
|
|
- return AjaxResult.error("托盘未绑定");
|
|
|
+ return AjaxResult.error("托盘未绑定库位:" + unlockForm.getPalletNo());
|
|
|
}
|
|
|
|
|
|
//把托盘设置成非满拖
|
|
@@ -582,7 +600,7 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
|
|
|
query.setLocationId(wmsBoxInfo.getLocationId().toString());
|
|
|
List<InvLotLocId> invLotLocIdList = invLotLocIdMapper.selectInvLotLocIdList(query);
|
|
|
if (invLotLocIdList == null || invLotLocIdList.size() == 0) {
|
|
|
- return AjaxResult.error("该托盘不存在库存");
|
|
|
+ return AjaxResult.error("该托盘不存在库存:" + unlockForm.getPalletNo());
|
|
|
}
|
|
|
for (InvLotLocId inv : invLotLocIdList) {
|
|
|
//修改入库单的接收数
|
|
@@ -595,7 +613,7 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
|
|
|
for (WmsDocAsnDetails d : details) {
|
|
|
wmsDocAsnDetailsMapper.updateWmsReceivedQty(d.getAsnNo(), d.getAsnLineNo().intValue(), BigDecimal.valueOf(-1 * inv.getQty().doubleValue()), "30");
|
|
|
}
|
|
|
- //删除库存
|
|
|
+ //删除库存 todo 物料增加库存的时候如果改成根据相同库存和批次可以累加数量,这边就需要减库存,而不是直接删除
|
|
|
invLotLocIdMapper.deleteInvLotLocIdBy(inv.getLotnum(), inv.getSku(), inv.getLocationId(), inv.getCustomerId());
|
|
|
}
|
|
|
//查询分配单
|