|
@@ -17,6 +17,8 @@ import com.ruoyi.ams.erp.domain.ErpOrderList;
|
|
|
import com.ruoyi.ams.inv.domain.ActTransactionLog;
|
|
|
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.InvLotLocIdForm;
|
|
|
import com.ruoyi.ams.inv.domain.vo.InvLotLocIdLotattVO;
|
|
|
import com.ruoyi.ams.inv.mapper.InvLotAttMapper;
|
|
|
import com.ruoyi.ams.inv.mapper.InvLotLocIdMapper;
|
|
@@ -41,6 +43,7 @@ import com.ruoyi.base.utils.IdSequenceUtils;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.common.core.domain.model.LoginUser;
|
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
|
+import com.ruoyi.common.utils.DateUtils;
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.common.utils.uuid.SnowflakeIdWorker;
|
|
@@ -426,21 +429,6 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
invLotLocIdService.stockTransfer(actAllocationDetails.getLocationId(), "", Long.parseLong(locationTo));
|
|
|
//托盘进行绑定修改
|
|
|
wmsBoxInfoMapper.updateLocationBind(Long.parseLong(location), Long.parseLong(locationTo), null);
|
|
|
- /*if (!exitsMap.containsKey(location)) {
|
|
|
- exitsMap.put(location, location);
|
|
|
- //生成任务退回
|
|
|
- FlowConfigHeaderVO flowConfigHeader = flowConfigHeaderService.selectFlowConfigHeaderById(4L);
|
|
|
- AgvCallDTO agvCallDTO = new AgvCallDTO();
|
|
|
- agvCallDTO.setId(flowConfigHeader.getId());
|
|
|
- agvCallDTO.setLocationFrom(location);
|
|
|
- agvCallDTO.setLocationTo(p.getLocationTo());
|
|
|
- agvCallDTO.setPalletNo(actAllocationDetails.getUserdefine1());
|
|
|
- agvCallDTO.setWarehouseId(Constant.WAREHOUSE_ID);
|
|
|
- AjaxResult result = businessService.agvCall(flowConfigHeader, agvCallDTO);
|
|
|
- if ((int) result.get(AjaxResult.CODE_TAG) == 500) {
|
|
|
- throw new ServiceException("任务生成失败");
|
|
|
- }
|
|
|
- }*/
|
|
|
}
|
|
|
return AjaxResult.success("操作成功");
|
|
|
}
|
|
@@ -485,9 +473,9 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
wmsDocOrderDetailsMapper.updateWmsDocOrderDetails(wmsDocOrderDetails);*/
|
|
|
|
|
|
//修改出库单状态为完成
|
|
|
- WmsDocOrderHeader header = wmsDocOrderHeaderService.selectWmsDocOrderHeaderByOrderNo(check.getOrderNo());
|
|
|
- header.setOrderStatus("99");
|
|
|
- wmsDocOrderHeaderMapper.updateWmsDocOrderHeader(header);
|
|
|
+// WmsDocOrderHeader header = wmsDocOrderHeaderService.selectWmsDocOrderHeaderByOrderNo(check.getOrderNo());
|
|
|
+// header.setOrderStatus("99");
|
|
|
+// wmsDocOrderHeaderMapper.updateWmsDocOrderHeader(header);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -551,6 +539,76 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Transactional
|
|
|
+ @Override
|
|
|
+ public AjaxResult groupDisk(GroupDiskFrom groupDiskFrom) {
|
|
|
+ String palletNoFrom = groupDiskFrom.getPalletNoFrom(); // 起始托盘
|
|
|
+ String palletNoTo = groupDiskFrom.getPalletNoTo(); // 目标托盘
|
|
|
+ String sn = groupDiskFrom.getSn(); // 条码号
|
|
|
+ String orderNo = ""; // 出库单号(备货才会传入)
|
|
|
+/// String sku = ""; // 物料编码
|
|
|
+ if (StringUtils.isNotEmpty(groupDiskFrom.getOrderNo())) {
|
|
|
+ groupDiskFrom.getOrderNo();
|
|
|
+ }
|
|
|
+ /// 根据条码获取物料号
|
|
|
+// CodeSkuRelationshipVO codeSkuRelationshipVO = codeSkuRelationshipService.checkIsProduct(sn);
|
|
|
+// sku = codeSkuRelationshipVO.getSku();
|
|
|
+ // 根据起始托盘,条码号查出库存
|
|
|
+ InvLocIdSearchFrom locIdSearchFrom = new InvLocIdSearchFrom();
|
|
|
+ LotattDTO lotattDTO = new LotattDTO();
|
|
|
+ lotattDTO.setLotatt07(palletNoFrom);
|
|
|
+ lotattDTO.setLotatt02(sn);
|
|
|
+ locIdSearchFrom.setLotattDTO(lotattDTO);
|
|
|
+ List<InvLotLocIdLotattVO> invLotLocIdLotattVOList = invLotLocIdService.selectInvLocIdLotattList(locIdSearchFrom);
|
|
|
+ // 组盘是把出库的库存重新组到一个新的托盘上,所以起始托盘和条码理应可以查询到系统里有对应的库存。
|
|
|
+ if (invLotLocIdLotattVOList.size() == 0) {
|
|
|
+ return AjaxResult.error(String.format("不存在对应库存!起始托盘:%s,条码:%s", palletNoFrom, sn));
|
|
|
+ }
|
|
|
+ // 创建Lotnum和库存对应关系,可能是一对多
|
|
|
+ Map<String, List<InvLotLocIdLotattVO>> lotnumAndInvLocIdMap = new HashMap<>();
|
|
|
+ invLotLocIdLotattVOList.stream().forEach(v -> {
|
|
|
+ if (lotnumAndInvLocIdMap.get(v) == null) {
|
|
|
+ lotnumAndInvLocIdMap.put(v.getLotnum(), Arrays.asList(v));
|
|
|
+ } else {
|
|
|
+ List<InvLotLocIdLotattVO> locIdLotattVOList = lotnumAndInvLocIdMap.get(v.getLotnum());
|
|
|
+ locIdLotattVOList.add(v);
|
|
|
+ lotnumAndInvLocIdMap.put(v.getLotnum(),locIdLotattVOList);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (palletNoFrom.equals(palletNoTo) && orderNo.equals("")) {
|
|
|
+ // 起始托盘和目标托盘一样,并且出库单传入为空,不做操作
|
|
|
+ return AjaxResult.success("起始和目标托盘一致,不用组盘!");
|
|
|
+
|
|
|
+ } else {
|
|
|
+ // 根据老Lotnum创建新的Lotnum
|
|
|
+ for (Map.Entry<String, List<InvLotLocIdLotattVO>> lotnumToInvLocId: lotnumAndInvLocIdMap.entrySet()) {
|
|
|
+ String lotnum = lotnumToInvLocId.getKey();
|
|
|
+ List<InvLotLocIdLotattVO> invLocIdList = lotnumToInvLocId.getValue();
|
|
|
+ InvLotAtt invLotAtt = invLotAttMapper.selectInvLotAttByLotnum(lotnum);
|
|
|
+ String newLotnum = idSequenceUtils.generateId("LOTNUMBER");
|
|
|
+ invLotAtt.setLotnum(newLotnum);
|
|
|
+ invLotAtt.setLotatt07(palletNoTo);
|
|
|
+ if (!orderNo.equals("")) {
|
|
|
+ invLotAtt.setLotatt14(orderNo); // 备货对应的出库单号
|
|
|
+ }
|
|
|
+ invLotAtt.setCreateTime(DateUtils.getNowDate());
|
|
|
+ if (invLotAttMapper.insertInvLotAtt(invLotAtt) > 0) {
|
|
|
+ for (InvLotLocIdLotattVO v : invLocIdList) {
|
|
|
+ InvLotLocIdForm invLotLocIdUpdate = new InvLotLocIdForm();
|
|
|
+ invLotLocIdUpdate.setLotnum(lotnum);
|
|
|
+ invLotLocIdUpdate.setLocationId(v.getLocationId().toString());
|
|
|
+ invLotLocIdUpdate.setCustomerId(v.getCustomerId());
|
|
|
+ invLotLocIdUpdate.setSku(v.getSku());
|
|
|
+ invLotLocIdUpdate.setLotnumTo(newLotnum);
|
|
|
+ invLotLocIdService.updateInvLotLocId(invLotLocIdUpdate);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return AjaxResult.success("组盘成功!");
|
|
|
+ }
|
|
|
+
|
|
|
@Transactional
|
|
|
@Override
|
|
|
public AjaxResult arrangeStock(ArrangeStockForm arrangeStockForm) {
|