预约改造;pda报错;

This commit is contained in:
王奎兴
2026-06-29 10:56:57 +08:00
parent 8be0813e21
commit de1ef5dec7
15 changed files with 83 additions and 4 deletions
@@ -33,6 +33,10 @@ import com.mhd.oms.domain.executionStockOutOrder.repository.todo.ExecutionStockO
import com.mhd.oms.domain.reservationDeliveryDetailsLink.entity.ReservationDeliveryDetailsLink;
import com.mhd.oms.domain.reservationDeliveryDetailsLink.repository.facade.IReservationDeliveryDetailsLinkService;
//import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO;
import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.entity.ReservationInventoryAdjustmentRecord;
import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.mapper.ReservationInventoryAdjustmentRecordMapper;
import com.mhd.oms.domain.reservationMaterialInventory.entity.ReservationMaterialInventory;
import com.mhd.oms.domain.reservationMaterialInventory.repository.mapper.ReservationMaterialInventoryMapper;
import com.mhd.system.api.SystemServiceFeign;
import com.mhd.system.api.WmsServiceFeign;
import com.mhd.system.api.domain.*;
@@ -85,6 +89,10 @@ public class ExecutionStockOutOrderDomainService {
private IBusinessDeliveryDetailsLinkService businessDeliveryDetailsLinkService;
@Autowired
private BusinessDeliveryDetailsLinkMapper businessDeliveryDetailsLinkMapper;
@Autowired
private ReservationInventoryAdjustmentRecordMapper inventoryAdjustmentRecordMapper;
@Autowired
private ReservationMaterialInventoryMapper reservationMaterialInventoryMapper;
/**
* 分页查询出库单列表
@@ -317,6 +325,33 @@ public class ExecutionStockOutOrderDomainService {
stockOutOrder.setOutOrderNumber(outOrderNumber);
wmsServiceFeign.omsCancelExecutionOrder(stockOutOrder);
//还原oms库存及调整记录
List<ReservationInventoryAdjustmentRecord> reservationInventoryAdjustmentRecords = inventoryAdjustmentRecordMapper.selectList(new LambdaQueryWrapper<ReservationInventoryAdjustmentRecord>()
.eq(ReservationInventoryAdjustmentRecord::getExecutionOrderNumber, outOrderNumber)
.eq(ReservationInventoryAdjustmentRecord::getDelFlag, 1));
for (ReservationInventoryAdjustmentRecord reservationInventoryAdjustmentRecord : reservationInventoryAdjustmentRecords) {
Long materialInventoryId = reservationInventoryAdjustmentRecord.getMaterialInventoryId();
ReservationMaterialInventory reservationMaterialInventory = reservationMaterialInventoryMapper.selectById(materialInventoryId);
// BigDecimal inventoryBeforeQuantity = reservationInventoryAdjustmentRecord.getInventoryBeforeQuantity();
// BigDecimal inventoryAfterQuantity = reservationInventoryAdjustmentRecord.getInventoryAfterQuantity();
BigDecimal allocationBeforeQuantity = reservationInventoryAdjustmentRecord.getAllocationBeforeQuantity();
BigDecimal allocationAfterQuantity = reservationInventoryAdjustmentRecord.getAllocationAfterQuantity();
BigDecimal allocation = allocationBeforeQuantity.subtract(allocationAfterQuantity);
BigDecimal freezeBeforeQuantity = reservationInventoryAdjustmentRecord.getFreezeBeforeQuantity();
BigDecimal freezeAfterQuantity = reservationInventoryAdjustmentRecord.getFreezeAfterQuantity();
BigDecimal freeze = freezeAfterQuantity.subtract(freezeBeforeQuantity);
BigDecimal allocationQuantity = reservationMaterialInventory.getAllocationQuantity();
BigDecimal freezeQuantity = reservationMaterialInventory.getFreezeQuantity();
allocationQuantity.add(allocation);
freezeQuantity.subtract(freeze);
reservationMaterialInventory.setAllocationQuantity(allocationQuantity);
reservationMaterialInventory.setFreezeQuantity(freezeQuantity);
reservationMaterialInventory.setUpdateTime(new Date());
reservationMaterialInventory.setUpdateBy(loginUser.getUserid());
reservationMaterialInventory.setUpdateByName(userRealName);
reservationMaterialInventoryMapper.updateById(reservationMaterialInventory);
reservationInventoryAdjustmentRecord.setDelFlag(2);
inventoryAdjustmentRecordMapper.updateById(reservationInventoryAdjustmentRecord);
}
}
}
@@ -199,4 +199,8 @@ public class ReservationInventoryAdjustmentRecord extends BaseVOEntity {
@Excel(name = "批次号")
private String batchNumber;
@ApiModelProperty("执行单号")
@Excel(name = "执行单号")
private String executionOrderNumber;
}
@@ -255,4 +255,7 @@ public class ReservationInventoryAdjustmentRecordPO extends BaseVOEntity {
@ApiModelProperty("批次号")
@Excel(name = "批次号")
private String batchNumber;
@ApiModelProperty("执行单号")
@Excel(name = "执行单号")
private String executionOrderNumber;
}
@@ -214,4 +214,7 @@ public class ReservationInventoryAdjustmentRecordDO extends BaseVOEntity {
private String lotCode;
private String expiryDate;
private String productionDate;
@ApiModelProperty("执行单号")
@Excel(name = "执行单号")
private String executionOrderNumber;
}
@@ -172,4 +172,7 @@ public class ReservationInventoryAdjustmentRecordDTO extends BaseVOEntity {
@ApiModelProperty(name = "权限菜单ID")
private Long permissionMenuId;
@ApiModelProperty("执行单号")
@Excel(name = "执行单号")
private String executionOrderNumber;
}
@@ -296,7 +296,10 @@ public class ReservationMaterialInventoryImpl extends ServiceImpl<ReservationMat
UserPo userPo = loginUser.getUserPo();
if (userPo != null) inventoryAdjustmentRecord.setCreateByName(userPo.getUserName());
inventoryAdjustmentRecord.setCreateTime(new Date());
String executioOrderNumber = materialInventoryParamDO.getExecutioOrderNumber();
if (ObjectUtil.isNotEmpty(executioOrderNumber)) {
inventoryAdjustmentRecord.setExecutionOrderNumber(executioOrderNumber);
}
BigDecimal qty = nz(materialInventoryParamDO.getQuantity());
if ("分配库存".equals(adjustAction)) {
// 总库存不变;可用减少、冻结增加(数量从可用转至冻结)
@@ -43,4 +43,7 @@ public interface ReserveStockInOrderMapper extends BaseMapper<ReserveStockInOrde
List<ReserveStockInOrderPO> queryNoticePrint(ReserveStockInOrderDO stockInOrderDO);
List<ReserveInMaterialDetailPO> queryNoticePrintDetail(ReserveStockInOrderDO stockInOrderDO);}
List<ReserveInMaterialDetailPO> queryNoticePrintDetail(ReserveStockInOrderDO stockInOrderDO);
public String getJsbz(@Param("id") Long id);
}
@@ -451,6 +451,9 @@ public class ReserveStockInOrderDomainService {
reservationStockInOrder.setOrderTypeCode("pu_tong_ru_ku");
reservationStockInOrder.setOrderTypeName("普通入库");
reservationStockInOrder.setReservationOrderSource("客户预约");
Long shipperId = reservationStockInOrder.getShipperId();
String jsbz = reservationStockInOrderMapper.getJsbz(shipperId);
reservationStockInOrder.setSettlementCurrency(jsbz);
String inOrderNumber = reservationStockInOrder.getInOrderNumber();
List<ReserveInMaterialDetail> materialDetailList = materialDetailService.list(new QueryWrapper<ReserveInMaterialDetail>().lambda().eq(ReserveInMaterialDetail::getInOrderNumber, inOrderNumber));
List<ReservationInMaterialDetail> inMaterialDetailList = new ArrayList<>();
@@ -282,6 +282,9 @@ public class ReserveStockOutOrderDomainService {
reservationStockOutOrder.setOrderTypeCode("pu_tong_chu_ku");
reservationStockOutOrder.setOrderTypeName("普通出库");
reservationStockOutOrder.setReservationOrderSource("客户预约");
Long shipperId = reservationStockOutOrder.getShipperId();
String jsbz = reservationStockInOrderMapper.getJsbz(shipperId);
reservationStockOutOrder.setSettlementCurrency(jsbz);
reservationStockOutOrderService.save(reservationStockOutOrder);
String outOrderNumber = reservationStockOutOrder.getOutOrderNumber();
List<ReserveOutMaterialDetail> materialDetailList = outMaterialDetailService.list(new QueryWrapper<ReserveOutMaterialDetail>().lambda().eq(ReserveOutMaterialDetail::getOutOrderNumber, outOrderNumber));
@@ -769,4 +769,12 @@
<result property="inboundQuantity" column="inbound_quantity"/>
</resultMap>
<select id="getJsbz" resultType="java.lang.String" parameterType="java.lang.Long">
SELECT
SETTLEMENT_CURRENCY
FROM NGWL_TEST_USER.USER_SHIPPER
WHERE del_flag = 1
AND USER_ID = #{id} limit 1
</select>
</mapper>