Browse Source

1.干线bug修复

dist.1.3.0
zhenghaoyu 6 months ago
parent
commit
b32f0cca8d
  1. 1
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/AdvanceDTO.java
  2. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml
  3. 77
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

1
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/AdvanceDTO.java

@ -38,6 +38,7 @@ public class AdvanceDTO implements Serializable {
private String brand;
private Integer hasPackage;
private Integer enterNum;
private String startCreateTimeStr;
private String endCreateTimeStr;

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml

@ -187,6 +187,7 @@
</if>
</foreach>
) orderCodes where orderCodes.orderCode = lta.order_code)
and lta.waybill_status = '0'
</select>

77
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

@ -3317,9 +3317,84 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
public R createOrderPackage(AdvanceDTO advanceDTO) {
Long advanceId = advanceDTO.getAdvanceId();
Long warehouseId = advanceDTO.getWarehouseId();
Integer enterNum = advanceDTO.getEnterNum();
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
if(Objects.isNull(warehouseEntity)){
log.warn("##########createOrderPackage: 仓库信息不存在 warehouseId={}",warehouseId);
return R.fail(405,"仓库信息不存在");
}
String warehouseName = warehouseEntity.getName();
String warehouseCode = warehouseEntity.getWarehouseCode();
TrunklineAdvanceEntity advanceEntity = advanceService.getById(advanceId);
Integer totalNum = advanceEntity.getTotalNum();
List<TrunklineAdvanceDetailVO> advanceDetailList = advanceDetailService.findList(advanceId);
if(totalNum > 0 || CollUtil.isNotEmpty(advanceDetailList)){
log.warn("##########createOrderPackage: 订单已有包件数据 advanceId={}",advanceId);
return R.fail(405,"订单已有包件数据");
}
if(enterNum == null || enterNum <= 0){
log.warn("##########createOrderPackage: 输入的数量不正确 enterNum={}",enterNum);
return R.fail(405,"输入的数量不正确");
}
TrunklineAdvanceDetailEntity advanceDetailModel = new TrunklineAdvanceDetailEntity();
advanceDetailModel.setWarehouseId(warehouseId);
advanceDetailModel.setWarehouseName(warehouseName);
advanceDetailModel.setAdvanceId(advanceId);
advanceDetailModel.setOrderCode(advanceEntity.getOrderCode());
advanceDetailModel.setBrand(advanceEntity.getBrand());
advanceDetailModel.setSystemType("线上");
return null;
// advanceDetailModel.setFirstPackName(firsts);
// String sencods = importOrderNoPackageExcelDTO.getSeconds();
// if (StringUtil.isBlank(sencods)) {
// advanceDetailModel.setSecondPackName(firsts);
// } else {
// advanceDetailModel.setSecondPackName(sencods);
// }
// String thirds = importOrderNoPackageExcelDTO.getThirds();
// if (StringUtil.isBlank(thirds)) {
// advanceDetailModel.setThirdPackName(firsts);
// } else {
// advanceDetailModel.setThirdPackName(thirds);
// }
advanceDetailModel.setQuantity(1);
advanceDetailModel.setServiceNum(advanceEntity.getServiceNum());
// advanceDetailModel.setMaterialCode(importOrderNoPackageExcelDTO.getMaterialCode());
// advanceDetailModel.setMaterialName(importOrderNoPackageExcelDTO.getMaterialName());
// String volume = importOrderNoPackageExcelDTO.getVolume();
// if (StringUtil.isBlank(volume)){
// advanceDetailModel.setVolume(BigDecimal.ZERO);
// }else{
// advanceDetailModel.setVolume(new BigDecimal(volume));
// }
// String weight = importOrderNoPackageExcelDTO.getWeight();
// if (StringUtil.isBlank(weight)){
// advanceDetailModel.setWeight(BigDecimal.ZERO);
// }else{
// advanceDetailModel.setWeight(new BigDecimal(weight));
// }
advanceDetailModel.setPackageStatus("0");
List<TrunklineAdvanceDetailEntity> advanceDetailEntities = new ArrayList<>();
List<String> orderPackageCodes = basicdataCodeClient.getBatchPackageCodeByType(warehouseCode, advanceEntity.getOrderCode(), totalNum);
orderPackageCodes.forEach(orderPackageCode -> {
TrunklineAdvanceDetailEntity advanceDetailEntity = new TrunklineAdvanceDetailEntity();
BeanUtil.copy(advanceDetailModel, advanceDetailEntity);
advanceDetailEntity.setOrderPackageCode(orderPackageCode);
advanceDetailEntities.add(advanceDetailEntity);
});
advanceDetailService.saveBatch(advanceDetailEntities);
advanceEntity.setTotalNum(enterNum);
advanceService.updateById(advanceEntity);
return R.success("添加成功");
}
private List<EditOrderMsgVO> verifyData(OpenOrderDTO openOrderDTO, WarehouseWaybillEntity waybillEntity) {

Loading…
Cancel
Save