预约改造;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
@@ -84,4 +84,6 @@ public class MaterialInventoryOmsParamDO extends BaseVOEntity {
//过期日期 //过期日期
private Date expiryDate; private Date expiryDate;
private String executioOrderNumber;
} }
@@ -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.entity.ReservationDeliveryDetailsLink;
import com.mhd.oms.domain.reservationDeliveryDetailsLink.repository.facade.IReservationDeliveryDetailsLinkService; import com.mhd.oms.domain.reservationDeliveryDetailsLink.repository.facade.IReservationDeliveryDetailsLinkService;
//import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO; //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.SystemServiceFeign;
import com.mhd.system.api.WmsServiceFeign; import com.mhd.system.api.WmsServiceFeign;
import com.mhd.system.api.domain.*; import com.mhd.system.api.domain.*;
@@ -85,6 +89,10 @@ public class ExecutionStockOutOrderDomainService {
private IBusinessDeliveryDetailsLinkService businessDeliveryDetailsLinkService; private IBusinessDeliveryDetailsLinkService businessDeliveryDetailsLinkService;
@Autowired @Autowired
private BusinessDeliveryDetailsLinkMapper businessDeliveryDetailsLinkMapper; private BusinessDeliveryDetailsLinkMapper businessDeliveryDetailsLinkMapper;
@Autowired
private ReservationInventoryAdjustmentRecordMapper inventoryAdjustmentRecordMapper;
@Autowired
private ReservationMaterialInventoryMapper reservationMaterialInventoryMapper;
/** /**
* 分页查询出库单列表 * 分页查询出库单列表
@@ -317,6 +325,33 @@ public class ExecutionStockOutOrderDomainService {
stockOutOrder.setOutOrderNumber(outOrderNumber); stockOutOrder.setOutOrderNumber(outOrderNumber);
wmsServiceFeign.omsCancelExecutionOrder(stockOutOrder); wmsServiceFeign.omsCancelExecutionOrder(stockOutOrder);
//还原oms库存及调整记录 //还原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 = "批次号") @Excel(name = "批次号")
private String batchNumber; private String batchNumber;
@ApiModelProperty("执行单号")
@Excel(name = "执行单号")
private String executionOrderNumber;
} }
@@ -255,4 +255,7 @@ public class ReservationInventoryAdjustmentRecordPO extends BaseVOEntity {
@ApiModelProperty("批次号") @ApiModelProperty("批次号")
@Excel(name = "批次号") @Excel(name = "批次号")
private String batchNumber; private String batchNumber;
@ApiModelProperty("执行单号")
@Excel(name = "执行单号")
private String executionOrderNumber;
} }
@@ -214,4 +214,7 @@ public class ReservationInventoryAdjustmentRecordDO extends BaseVOEntity {
private String lotCode; private String lotCode;
private String expiryDate; private String expiryDate;
private String productionDate; private String productionDate;
@ApiModelProperty("执行单号")
@Excel(name = "执行单号")
private String executionOrderNumber;
} }
@@ -172,4 +172,7 @@ public class ReservationInventoryAdjustmentRecordDTO extends BaseVOEntity {
@ApiModelProperty(name = "权限菜单ID") @ApiModelProperty(name = "权限菜单ID")
private Long permissionMenuId; private Long permissionMenuId;
@ApiModelProperty("执行单号")
@Excel(name = "执行单号")
private String executionOrderNumber;
} }
@@ -296,7 +296,10 @@ public class ReservationMaterialInventoryImpl extends ServiceImpl<ReservationMat
UserPo userPo = loginUser.getUserPo(); UserPo userPo = loginUser.getUserPo();
if (userPo != null) inventoryAdjustmentRecord.setCreateByName(userPo.getUserName()); if (userPo != null) inventoryAdjustmentRecord.setCreateByName(userPo.getUserName());
inventoryAdjustmentRecord.setCreateTime(new Date()); inventoryAdjustmentRecord.setCreateTime(new Date());
String executioOrderNumber = materialInventoryParamDO.getExecutioOrderNumber();
if (ObjectUtil.isNotEmpty(executioOrderNumber)) {
inventoryAdjustmentRecord.setExecutionOrderNumber(executioOrderNumber);
}
BigDecimal qty = nz(materialInventoryParamDO.getQuantity()); BigDecimal qty = nz(materialInventoryParamDO.getQuantity());
if ("分配库存".equals(adjustAction)) { if ("分配库存".equals(adjustAction)) {
// 总库存不变;可用减少、冻结增加(数量从可用转至冻结) // 总库存不变;可用减少、冻结增加(数量从可用转至冻结)
@@ -43,4 +43,7 @@ public interface ReserveStockInOrderMapper extends BaseMapper<ReserveStockInOrde
List<ReserveStockInOrderPO> queryNoticePrint(ReserveStockInOrderDO stockInOrderDO); 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.setOrderTypeCode("pu_tong_ru_ku");
reservationStockInOrder.setOrderTypeName("普通入库"); reservationStockInOrder.setOrderTypeName("普通入库");
reservationStockInOrder.setReservationOrderSource("客户预约"); reservationStockInOrder.setReservationOrderSource("客户预约");
Long shipperId = reservationStockInOrder.getShipperId();
String jsbz = reservationStockInOrderMapper.getJsbz(shipperId);
reservationStockInOrder.setSettlementCurrency(jsbz);
String inOrderNumber = reservationStockInOrder.getInOrderNumber(); String inOrderNumber = reservationStockInOrder.getInOrderNumber();
List<ReserveInMaterialDetail> materialDetailList = materialDetailService.list(new QueryWrapper<ReserveInMaterialDetail>().lambda().eq(ReserveInMaterialDetail::getInOrderNumber, inOrderNumber)); List<ReserveInMaterialDetail> materialDetailList = materialDetailService.list(new QueryWrapper<ReserveInMaterialDetail>().lambda().eq(ReserveInMaterialDetail::getInOrderNumber, inOrderNumber));
List<ReservationInMaterialDetail> inMaterialDetailList = new ArrayList<>(); List<ReservationInMaterialDetail> inMaterialDetailList = new ArrayList<>();
@@ -282,6 +282,9 @@ public class ReserveStockOutOrderDomainService {
reservationStockOutOrder.setOrderTypeCode("pu_tong_chu_ku"); reservationStockOutOrder.setOrderTypeCode("pu_tong_chu_ku");
reservationStockOutOrder.setOrderTypeName("普通出库"); reservationStockOutOrder.setOrderTypeName("普通出库");
reservationStockOutOrder.setReservationOrderSource("客户预约"); reservationStockOutOrder.setReservationOrderSource("客户预约");
Long shipperId = reservationStockOutOrder.getShipperId();
String jsbz = reservationStockInOrderMapper.getJsbz(shipperId);
reservationStockOutOrder.setSettlementCurrency(jsbz);
reservationStockOutOrderService.save(reservationStockOutOrder); reservationStockOutOrderService.save(reservationStockOutOrder);
String outOrderNumber = reservationStockOutOrder.getOutOrderNumber(); String outOrderNumber = reservationStockOutOrder.getOutOrderNumber();
List<ReserveOutMaterialDetail> materialDetailList = outMaterialDetailService.list(new QueryWrapper<ReserveOutMaterialDetail>().lambda().eq(ReserveOutMaterialDetail::getOutOrderNumber, outOrderNumber)); List<ReserveOutMaterialDetail> materialDetailList = outMaterialDetailService.list(new QueryWrapper<ReserveOutMaterialDetail>().lambda().eq(ReserveOutMaterialDetail::getOutOrderNumber, outOrderNumber));
@@ -769,4 +769,12 @@
<result property="inboundQuantity" column="inbound_quantity"/> <result property="inboundQuantity" column="inbound_quantity"/>
</resultMap> </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> </mapper>
@@ -255,5 +255,7 @@ public class MaterialInventoryQueryListDO extends MaterialBaseDO {
/** 为 true 时 SQL 排除库存数量为 0(含 null 视为 0) */ /** 为 true 时 SQL 排除库存数量为 0(含 null 视为 0) */
private Boolean excludeZeroInventoryQuantity; private Boolean excludeZeroInventoryQuantity;
private String expiryDateStr;
private String productionDateStr;
private String updateTimeStr;
} }
@@ -598,6 +598,7 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
BeanUtils.copyProperties(materialInventoryParamDO, materialInventoryOmsParamDO); BeanUtils.copyProperties(materialInventoryParamDO, materialInventoryOmsParamDO);
materialInventoryOmsParamDO.setKctzType("分配库存"); materialInventoryOmsParamDO.setKctzType("分配库存");
materialInventoryOmsParamDO.setLoginUser(loginUser); materialInventoryOmsParamDO.setLoginUser(loginUser);
materialInventoryOmsParamDO.setExecutioOrderNumber(outMaterialDetail.getOutOrderNumber());
omsServiceFeign.omsEdit(materialInventoryOmsParamDO); omsServiceFeign.omsEdit(materialInventoryOmsParamDO);
//materialInventoryMapper.updateById(materialInventory); //materialInventoryMapper.updateById(materialInventory);
@@ -190,5 +190,8 @@ public class MaterialInventoryDTO extends MaterialBaseDTO {
private Boolean excludeZeroInventoryQuantity; private Boolean excludeZeroInventoryQuantity;
private String expiryDate; private String expiryDate;
private String productionDate; private String productionDate;
private String expiryDateStr;
private String productionDateStr;
private String updateTimeStr;
} }
@@ -188,4 +188,7 @@ public class MaterialInventoryQueryListDTO extends MaterialBaseDTO {
/** 为 true 时排除库存数量为 0 的行;库存查询页不传或 false */ /** 为 true 时排除库存数量为 0 的行;库存查询页不传或 false */
@ApiModelProperty(value = "是否排除库存数量为0", example = "false") @ApiModelProperty(value = "是否排除库存数量为0", example = "false")
private Boolean excludeZeroInventoryQuantity; private Boolean excludeZeroInventoryQuantity;
} private String expiryDateStr;
private String productionDateStr;
private String updateTimeStr;
}