Browse Source

1.修改线上报错

master
pref_mail@163.com 10 months ago
parent
commit
936d637353
  1. 14
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml
  2. 433
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
  3. 11
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/ServiceNumServiceImpl.java

14
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml

@ -320,8 +320,8 @@
law.waybill_number,
law.order_code,
law.train_number,
law.FIRST,
law.secondary,
laap.FIRST,
laap.secondary,
law.vehicle_route,
law.deliver_goods_time,
law.discovery_time,
@ -343,10 +343,12 @@
law.audit_time,
law.entry_time,
law.operator,
law.brand_name
laap.brand_name
FROM
logpm_aftersales_processor lap
LEFT JOIN logpm_aftersales_work_order law ON lap.work_order_id = law.id
left join logpm_aftersales_abnormal_package laap on laap.work_order_id=law.id
<where>
lap.conditions != '3' and lap.is_deleted = 0 and law.id is not null and lap.processing_status in ('1','3') and lap.types_of = '2' and law.work_order_status in ('10','20','30')
<if test="param.workOrderStatusNameS != null and param.workOrderStatusNameS != '' ">and law.work_order_status = #{param.workOrderStatusNameS } </if>
@ -357,8 +359,8 @@
<if test="param.workOrderNumber != null and param.workOrderNumber != ''">and law.work_order_number like concat('%',#{param.workOrderNumber},'%')</if>
<if test="param.waybillNumber != null and param.waybillNumber != ''">and law.waybill_number like concat('%',#{param.waybillNumber},'%')</if>
<if test="param.orderCode != null and param.orderCode != ''">and law.order_code like concat('%',#{param.orderCode},'%')</if>
<if test="param.first != null and param.first != ''">and law.first like concat('%',#{param.first},'%')</if>
<if test="param.secondary != null and param.secondary != ''">and law.secondary like concat('%',#{param.secondary},'%')</if>
<if test="param.first != null and param.first != ''">and laap.first like concat('%',#{param.first},'%')</if>
<if test="param.secondary != null and param.secondary != ''">and laap.secondary like concat('%',#{param.secondary},'%')</if>
<if test="param.waybillMall != null and param.waybillMall != ''">and law.waybill_mall like concat('%',#{param.waybillMall},'%')</if>
<if test="param.brandName != null and param.brandName != ''">and law.brand_name like concat('%',#{param.brandName},'%')</if>
<if test="param.customerServiceName != null and param.customerServiceName != ''">and law.customer_service_name like concat('%',#{param.customerServiceName},'%')</if>
@ -375,7 +377,7 @@
<if test="param.auditTime != null ">and date_format(from_unixtime(law.audit_time),'%Y-%m-%d') = date_format(#{param.auditTime},'%Y-%m-%d') </if>
<if test="param.entryTime != null ">and date_format(from_unixtime(law.entry_time),'%Y-%m-%d') = date_format(#{param.entryTime},'%Y-%m-%d') </if>
<if test="param.overTime != null ">and date_format(from_unixtime(law.over_time),'%Y-%m-%d') = date_format(#{param.overTime}),'%Y-%m-%d') </if>
<if test="param.brandName != null and param.brandName != '' ">and law.brand_name like concat('%',#{param.brandName},'%') </if>
<if test="param.brandName != null and param.brandName != '' ">and laap.brand_name like concat('%',#{param.brandName},'%') </if>
</where>
</select>

433
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

@ -2970,276 +2970,269 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
@Override
@Transactional(rollbackFor = Exception.class)
public Resp getScan(Map<String, Object> distrilbutionBillLading) {
Object billLadingId = distrilbutionBillLading.get("id"); //提货ID
Object coding = distrilbutionBillLading.get("coding"); //包条码
Object type = distrilbutionBillLading.get("type"); //类型 2 订单 1 库存品
if (Func.isNull(billLadingId) || ObjectUtil.isEmpty(coding) || Func.isNull(type)) {
return Resp.scanFail("3000", "参数不完整!!");
} else {
DistrilbutionBillLadingEntity billLadingEntity1 = baseMapper.selectById((Serializable) billLadingId);
DistrilbutionAppBillLadingOrderMainVO billLadingOrderMainVO = baseMapper.getBillLadingOrderMainVO(Long.parseLong((String) billLadingId));
Integer planNum = billLadingOrderMainVO.getPlanNum();
Integer signedNum = billLadingOrderMainVO.getSignedNum();
if ((planNum + billLadingOrderMainVO.getInventoryNub()) == signedNum) {
return Resp.scanFail("提货任务扫描已完成!", "提货任务扫描已完成!");
}
if (ObjectUtils.isNotNull(billLadingEntity1) && "30".equals(billLadingEntity1.getConditions())) {
return Resp.scanFail("提货任务已完成!", "提货任务已完成!");
}
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (ObjectUtils.isNull(myCurrentWarehouse)) {
return Resp.scanFail("请选择仓库!", "请选择仓库!");
}
//查询是否签收
List<DistributionBillLadingScanEntity> list3 = distributionBillLadingScanService.list(Wrappers.<DistributionBillLadingScanEntity>query().lambda()
.eq(DistributionBillLadingScanEntity::getBillLadingId, billLadingId)
.eq(DistributionBillLadingScanEntity::getMaterialType, type)
.eq(DistributionBillLadingScanEntity::getPacketBarCode, coding)
);
if (!list3.isEmpty()) {
return Resp.scanFail("该包件已签收!", "该包件已签收!");
}
//添加扫描记录
DistributionBillLadingScanEntity distributionBillLadingScan = new DistributionBillLadingScanEntity();
distributionBillLadingScan.setMaterialType((String) type);
distributionBillLadingScan.setBillLadingId(Long.parseLong(billLadingId.toString()));
distributionBillLadingScan.setScanType(1);
distributionBillLadingScan.setScanUser(AuthUtil.getUser().getNickName());
//扫描
if ("1".equals(type)) {
//查询该自提单存在几种品类的库存品
List<DistrilbutionBillLadingInventoryAppVO> inventoryAppVO = distributionDeliveryDetailsService.listCode(String.valueOf(billLadingId));
if (ObjectUtils.isNotNull(inventoryAppVO)) {
List<Long> stocklistIds = inventoryAppVO.stream().map(DistrilbutionBillLadingInventoryAppVO::getStockListId).collect(Collectors.toList());
//查询该自提单所有的库存品包件信息
List<DisStockListDetailEntity> inventoryPackage = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
.eq(DisStockListDetailEntity::getReservationId, billLadingId)
.in(DisStockListDetailEntity::getStockListId, stocklistIds)
.ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())
);
Long stockListId = 0L;
if (Func.isNotEmpty(inventoryPackage)) {
//检测库存品包件是否都已经完成备货
boolean flag = inventoryPackage.stream().anyMatch(f -> Func.isEmpty(f.getStockPackageCode()));
if (flag) {
return Resp.scanFail("库存品备货未完成,请联系库管人员!", "库存品备货未完成,请联系库管人员");
}
//校验包件李彪是否存在满足码值的包件
List<DisStockListDetailEntity> collect = inventoryPackage.stream().filter(f -> coding.equals(f.getStockPackageCode())).collect(Collectors.toList());
if (collect.size() == 1) {
//满足签收
distributionBillLadingScan.setPacketBarCode((String) coding);
distributionBillLadingScan.setStockListId(collect.get(0).getStockListId());
distributionBillLadingScan.setQuantity(1);
distributionBillLadingScanService.save(distributionBillLadingScan);
stockListId = collect.get(0).getStockListId();
//扣减库存
distributionStockListMapper.deductionQuantityStock(collect.get(0).getStockListId(), collect.get(0).getNum());
try{
Object billLadingId = distrilbutionBillLading.get("id"); //提货ID
Object coding = distrilbutionBillLading.get("coding"); //包条码
Object type = distrilbutionBillLading.get("type"); //类型 2 订单 1 库存品
if (Func.isNull(billLadingId) || ObjectUtil.isEmpty(coding) || Func.isNull(type)) {
return Resp.scanFail("3000", "参数不完整!!");
} else {
DistrilbutionBillLadingEntity billLadingEntity1 = baseMapper.selectById((Serializable) billLadingId);
DistrilbutionAppBillLadingOrderMainVO billLadingOrderMainVO = baseMapper.getBillLadingOrderMainVO(Long.parseLong((String) billLadingId));
Integer planNum = billLadingOrderMainVO.getPlanNum();
Integer signedNum = billLadingOrderMainVO.getSignedNum();
if ((planNum + billLadingOrderMainVO.getInventoryNub()) == signedNum) {
return Resp.scanFail("提货任务扫描已完成!", "提货任务扫描已完成!");
}
if (ObjectUtils.isNotNull(billLadingEntity1) && "30".equals(billLadingEntity1.getConditions())) {
return Resp.scanFail("提货任务已完成!", "提货任务已完成!");
}
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (ObjectUtils.isNull(myCurrentWarehouse)) {
return Resp.scanFail("请选择仓库!", "请选择仓库!");
}
//查询是否签收
List<DistributionBillLadingScanEntity> list3 = distributionBillLadingScanService.list(Wrappers.<DistributionBillLadingScanEntity>query().lambda()
.eq(DistributionBillLadingScanEntity::getBillLadingId, billLadingId)
.eq(DistributionBillLadingScanEntity::getMaterialType, type)
.eq(DistributionBillLadingScanEntity::getPacketBarCode, coding)
);
if (!list3.isEmpty()) {
return Resp.scanFail("该包件已签收!", "该包件已签收!");
}
//添加扫描记录
DistributionBillLadingScanEntity distributionBillLadingScan = new DistributionBillLadingScanEntity();
distributionBillLadingScan.setMaterialType((String) type);
distributionBillLadingScan.setBillLadingId(Long.parseLong(billLadingId.toString()));
distributionBillLadingScan.setScanType(1);
distributionBillLadingScan.setScanUser(AuthUtil.getUser().getNickName());
//扫描
if ("1".equals(type)) {
//查询该自提单存在几种品类的库存品
List<DistrilbutionBillLadingInventoryAppVO> inventoryAppVO = distributionDeliveryDetailsService.listCode(String.valueOf(billLadingId));
if (ObjectUtils.isNotNull(inventoryAppVO)) {
List<Long> stocklistIds = inventoryAppVO.stream().map(DistrilbutionBillLadingInventoryAppVO::getStockListId).collect(Collectors.toList());
//查询该自提单所有的库存品包件信息
List<DisStockListDetailEntity> inventoryPackage = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
.eq(DisStockListDetailEntity::getReservationId, billLadingId)
.in(DisStockListDetailEntity::getStockListId, stocklistIds)
.ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())
);
Long stockListId = 0L;
if (Func.isNotEmpty(inventoryPackage)) {
//检测库存品包件是否都已经完成备货
boolean flag = inventoryPackage.stream().anyMatch(f -> Func.isEmpty(f.getStockPackageCode()));
if (flag) {
return Resp.scanFail("库存品备货未完成,请联系库管人员!", "库存品备货未完成,请联系库管人员");
}
//校验包件李彪是否存在满足码值的包件
List<DisStockListDetailEntity> collect = inventoryPackage.stream().filter(f -> coding.equals(f.getStockPackageCode())).collect(Collectors.toList());
if (collect.size() == 1) {
//满足签收
distributionBillLadingScan.setPacketBarCode((String) coding);
distributionBillLadingScan.setStockListId(collect.get(0).getStockListId());
distributionBillLadingScan.setQuantity(1);
distributionBillLadingScanService.save(distributionBillLadingScan);
stockListId = collect.get(0).getStockListId();
//扣减库存
distributionStockListMapper.deductionQuantityStock(collect.get(0).getStockListId(), collect.get(0).getNum());
} else {
//不满足签收,记录为什么不满足
if (collect.size() > 1) {
//已备货库存品包件存在多条一样的
log.info("########################PDA签收库存品包件存在多条一样的备货码值:{}", coding);
return Resp.scanFail("系统无此编码!", "系统无此编码");
} else {
//备货库存品不存在
return Resp.scanFail("系统无此编码!", "系统无此编码");
//不满足签收,记录为什么不满足
if (collect.size() > 1) {
//已备货库存品包件存在多条一样的
log.info("########################PDA签收库存品包件存在多条一样的备货码值:{}", coding);
return Resp.scanFail("系统无此编码!", "系统无此编码");
} else {
//备货库存品不存在
return Resp.scanFail("系统无此编码!", "系统无此编码");
}
}
}
Map<Long, List<DistrilbutionBillLadingInventoryAppVO>> stockListMap = inventoryAppVO.stream().collect(Collectors.groupingBy(DistrilbutionBillLadingInventoryAppVO::getStockListId));
//查询签收数量
List<DistributionBillLadingScanEntity> list = distributionBillLadingScanService.list(Wrappers.<DistributionBillLadingScanEntity>query().lambda()
.eq(DistributionBillLadingScanEntity::getBillLadingId, billLadingId)
.eq(DistributionBillLadingScanEntity::getMaterialType, "1")
.eq(DistributionBillLadingScanEntity::getStockListId, stockListId)
);
List<DistrilbutionBillLadingInventoryAppVO> billLadingInventoryAppVOS = stockListMap.get(stockListId);
if (Func.isNotEmpty(billLadingInventoryAppVOS)) {
DistrilbutionBillLadingInventoryAppVO distrilbutionBillLadingInventoryAppVO = billLadingInventoryAppVOS.get(0);
if (list.size() == distrilbutionBillLadingInventoryAppVO.getQuantity()) {
//修改完成状态
distributionAsyncService.getInventoryOrderSelfPickup(distrilbutionBillLadingInventoryAppVO.getLdddId());
}
if (list.size() > distrilbutionBillLadingInventoryAppVO.getQuantity()) {
return Resp.scanFail("已完成!", "已完成!!");
Map<Long, List<DistrilbutionBillLadingInventoryAppVO>> stockListMap = inventoryAppVO.stream().collect(Collectors.groupingBy(DistrilbutionBillLadingInventoryAppVO::getStockListId));
//查询签收数量
List<DistributionBillLadingScanEntity> list = distributionBillLadingScanService.list(Wrappers.<DistributionBillLadingScanEntity>query().lambda()
.eq(DistributionBillLadingScanEntity::getBillLadingId, billLadingId)
.eq(DistributionBillLadingScanEntity::getMaterialType, "1")
.eq(DistributionBillLadingScanEntity::getStockListId, stockListId)
);
List<DistrilbutionBillLadingInventoryAppVO> billLadingInventoryAppVOS = stockListMap.get(stockListId);
if (Func.isNotEmpty(billLadingInventoryAppVOS)) {
DistrilbutionBillLadingInventoryAppVO distrilbutionBillLadingInventoryAppVO = billLadingInventoryAppVOS.get(0);
if (list.size() == distrilbutionBillLadingInventoryAppVO.getQuantity()) {
//修改完成状态
distributionAsyncService.getInventoryOrderSelfPickup(distrilbutionBillLadingInventoryAppVO.getLdddId());
}
if (list.size() > distrilbutionBillLadingInventoryAppVO.getQuantity()) {
return Resp.scanFail("已完成!", "已完成!!");
}
//修改库存品签收
distributionAsyncService.getInventorySelfPickup(distrilbutionBillLadingInventoryAppVO.getStockArticleId());
}
//修改库存品签收
distributionAsyncService.getInventorySelfPickup(distrilbutionBillLadingInventoryAppVO.getStockArticleId());
} else {
return Resp.scanFail("库存品暂未备货请联系库管人员!", "库存品暂未备货请联系库管人员");
}
} else {
return Resp.scanFail("库存品暂未备货请联系库管人员!", "库存品暂未备货请联系库管人员");
return Resp.scanFail("包件信息不存在", "包件信息不存在");
}
} else {
return Resp.scanFail("包件信息不存在", "包件信息不存在");
}
} else {
//查询订单是否已签收
List<DistributionParcelListEntity> list4 = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getOrderPackageCode, coding)
.eq(DistributionParcelListEntity::getWarehouseId, myCurrentWarehouse.getId())
);
if (list4.isEmpty()) {
return Resp.scanFail(PdaAudioLingoStatus.baojianbucunzai.getName(), PdaAudioLingoStatus.baojianbucunzai.getName());
}
if (list4.size() > 1) {
return Resp.scanFail("包件信息错误", "包件信息错误");
}
//查询订单是否已签收
List<DistributionParcelListEntity> list4 = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getOrderPackageCode, coding)
.eq(DistributionParcelListEntity::getWarehouseId, myCurrentWarehouse.getId())
);
if (list4.isEmpty()) {
return Resp.scanFail(PdaAudioLingoStatus.baojianbucunzai.getName(), PdaAudioLingoStatus.baojianbucunzai.getName());
}
if (list4.size() > 1) {
return Resp.scanFail("包件信息错误", "包件信息错误");
}
DistrilbutionBillStockEntity one2 = distrilbutionBillStockService.getOne(Wrappers.<DistrilbutionBillStockEntity>query().lambda()
.eq(DistrilbutionBillStockEntity::getBillLadingId, billLadingId)
.apply("order_status in ('1' , '3')")
.eq(DistrilbutionBillStockEntity::getStockArticleId, list4.get(0).getStockArticleId())
);
DistrilbutionBillStockEntity one2 = distrilbutionBillStockService.getOne(Wrappers.<DistrilbutionBillStockEntity>query().lambda()
.eq(DistrilbutionBillStockEntity::getBillLadingId, billLadingId)
.apply("order_status in ('1' , '3')")
.eq(DistrilbutionBillStockEntity::getStockArticleId, list4.get(0).getStockArticleId())
);
DistrilbutionBillPackageEntity one3 = distrilbutionBillPackageService.getOne(Wrappers.<DistrilbutionBillPackageEntity>query().lambda()
.eq(DistrilbutionBillPackageEntity::getBillLadingId, billLadingId)
.ne(DistrilbutionBillPackageEntity::getPacketBarStatus, 2)
.eq(DistrilbutionBillPackageEntity::getParceListId, list4.get(0).getId())
);
if (ObjectUtils.isNull(one3)) {
return Resp.scanFail("不是本客户的货!", "不是本客户的货!");
}
DistrilbutionBillPackageEntity one3 = distrilbutionBillPackageService.getOne(Wrappers.<DistrilbutionBillPackageEntity>query().lambda()
.eq(DistrilbutionBillPackageEntity::getBillLadingId, billLadingId)
.ne(DistrilbutionBillPackageEntity::getPacketBarStatus, 2)
.eq(DistrilbutionBillPackageEntity::getParceListId, list4.get(0).getId())
);
if (ObjectUtils.isNull(one3)) {
return Resp.scanFail("不是本客户的货!", "不是本客户的货!");
}
if ("20".equals(one2.getConditions())) {
return Resp.scanFail("当前提货任务," + list4.get(0).getOrderCode() + "已齐套!", "当前提货任务," + list4.get(0).getOrderCode() + "已齐套!");
}
if ("20".equals(one2.getConditions())) {
return Resp.scanFail("当前提货任务," + list4.get(0).getOrderCode() + "已齐套!", "当前提货任务," + list4.get(0).getOrderCode() + "已齐套!");
}
//查询订单存在吗
List<DistrilbutionBillStockEntity> list = distrilbutionBillStockService.list(Wrappers.<DistrilbutionBillStockEntity>query().lambda()
.eq(DistrilbutionBillStockEntity::getBillLadingId, billLadingId)
);
if (list.isEmpty()) {
return Resp.scanFail("当前提货任务,订单不存在!", "当前提货任务,订单不存在!");
} else {
AtomicBoolean n = new AtomicBoolean(false);
//查询订单存在吗
List<DistrilbutionBillStockEntity> list = distrilbutionBillStockService.list(Wrappers.<DistrilbutionBillStockEntity>query().lambda()
.eq(DistrilbutionBillStockEntity::getBillLadingId, billLadingId)
);
if (list.isEmpty()) {
return Resp.scanFail("当前提货任务,订单不存在!", "当前提货任务,订单不存在!");
} else {
AtomicBoolean n = new AtomicBoolean(false);
// 获取订单的ID
List<Long> ls = list.stream() // 转换为Stream
.map(DistrilbutionBillStockEntity::getStockArticleId) // 提取每个元素的orderId
.collect(Collectors.toList()); // 收集到新的List<String>
// 获取订单的ID
List<Long> ls = list.stream() // 转换为Stream
.map(DistrilbutionBillStockEntity::getStockArticleId) // 提取每个元素的orderId
.collect(Collectors.toList()); // 收集到新的List<String>
List<DistributionStockArticleEntity> distributionStockArticleEntityList = distributionStockArticleService.list(Wrappers.<DistributionStockArticleEntity>query().lambda()
.in(DistributionStockArticleEntity::getId, ls));
List<DistributionStockArticleEntity> distributionStockArticleEntityList = distributionStockArticleService.list(Wrappers.<DistributionStockArticleEntity>query().lambda()
.in(DistributionStockArticleEntity::getId, ls));
List<DistributionParcelListEntity> list1 = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.in(DistributionParcelListEntity::getStockArticleId, ls)
);
List<DistributionParcelListEntity> list1 = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.in(DistributionParcelListEntity::getStockArticleId, ls)
);
List<DistributionBillLadingScanEntity> distributionBillLadingScanEntities = distributionBillLadingScanService.list(Wrappers.<DistributionBillLadingScanEntity>query().lambda()
.in(DistributionBillLadingScanEntity::getStockArticleId, ls)
.eq(DistributionBillLadingScanEntity::getMaterialType, "2")
.eq(DistributionBillLadingScanEntity::getBillLadingId, billLadingId)
);
List<DistributionBillLadingScanEntity> distributionBillLadingScanEntities = distributionBillLadingScanService.list(Wrappers.<DistributionBillLadingScanEntity>query().lambda()
.in(DistributionBillLadingScanEntity::getStockArticleId, ls)
.eq(DistributionBillLadingScanEntity::getMaterialType, "2")
.eq(DistributionBillLadingScanEntity::getBillLadingId, billLadingId)
);
list.forEach(so -> {
//查询包件信息
list.forEach(so -> {
//查询包件信息
DistributionParcelListEntity distributionParcelListEntity = null;
DistributionParcelListEntity distributionParcelListEntity = null;
for (DistributionParcelListEntity parcelListEntity : list1) {
if (parcelListEntity.getStockArticleId().equals(so.getStockArticleId()) && parcelListEntity.getOrderPackageCode().equals(coding)) {
distributionParcelListEntity = parcelListEntity;
for (DistributionParcelListEntity parcelListEntity : list1) {
if (parcelListEntity.getStockArticleId().equals(so.getStockArticleId()) && parcelListEntity.getOrderPackageCode().equals(coding)) {
distributionParcelListEntity = parcelListEntity;
}
}
}
if (distributionParcelListEntity != null) {
n.set(true);
//查询订单包件数量签收的信息
DistributionStockArticleEntity one = distributionStockArticleEntityList.stream().filter(s -> s.getId().equals(so.getStockArticleId())).findFirst().orElse(null);
if (distributionParcelListEntity != null) {
n.set(true);
//查询订单包件数量签收的信息
DistributionStockArticleEntity one = distributionStockArticleEntityList.stream().filter(s -> s.getId().equals(so.getStockArticleId())).findFirst().orElse(null);
List<DistributionBillLadingScanEntity> list2 = new ArrayList<>();
for (DistributionBillLadingScanEntity distributionBillLadingScanEntity : distributionBillLadingScanEntities) {
if (distributionBillLadingScanEntity.getStockArticleId().equals(so.getStockArticleId())) {
list2.add(distributionBillLadingScanEntity);
List<DistributionBillLadingScanEntity> list2 = new ArrayList<>();
for (DistributionBillLadingScanEntity distributionBillLadingScanEntity : distributionBillLadingScanEntities) {
if (distributionBillLadingScanEntity.getStockArticleId().equals(so.getStockArticleId())) {
list2.add(distributionBillLadingScanEntity);
}
}
}
one.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue());
one.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue());
//判断当前签收数 修改订单和备货订单状态
if (one.getTotalNumber().equals(list2.size() + 1)) {
//判断当前签收数 修改订单和备货订单状态
if (one.getTotalNumber().equals(list2.size() + 1)) {
//
DistrilbutionBillStockEntity one1 = null;
DistrilbutionBillStockEntity one1 = null;
for (DistrilbutionBillStockEntity distrilbutionBillStockEntity : list) {
if (distrilbutionBillStockEntity.getStockArticleId().equals(so.getStockArticleId()) && distrilbutionBillStockEntity.getConditions().equals(BillLadingStatusConstant.daitihuo.getValue())) {
one1 = distrilbutionBillStockEntity;
}
}
for (DistrilbutionBillStockEntity distrilbutionBillStockEntity : list) {
if (distrilbutionBillStockEntity.getStockArticleId().equals(so.getStockArticleId()) && distrilbutionBillStockEntity.getConditions().equals(BillLadingStatusConstant.daitihuo.getValue())) {
one1 = distrilbutionBillStockEntity;
if (one1 != null) {
distributionAsyncService.updateBillStock(one1.getId());
}
one.setOrderStatus(OrderStatusConstant.qianshou.getValue());
}
//修改在库数量
if (ObjectUtils.isNotNull(one.getHandQuantity()) && one.getHandQuantity() > 0) {
int i = one.getHandQuantity() - 1;
int i2 = ObjectUtils.isNull(one.getSigninQuantity()) ? 1 : one.getSigninQuantity() + 1;
one.setHandQuantity(i);
one.setSigninQuantity(i2);
if (one1 != null) {
distributionAsyncService.updateBillStock(one1.getId());
}
one.setOrderStatus(OrderStatusConstant.qianshou.getValue());
//修改订单状态
// distributionAsyncService.updateOrderSelfPickup(one.getId());
//修改备货订单状态
}
//修改在库数量
if (ObjectUtils.isNotNull(one.getHandQuantity()) && one.getHandQuantity() > 0) {
int i = one.getHandQuantity() - 1;
int i2 = ObjectUtils.isNull(one.getSigninQuantity()) ? 1 : one.getSigninQuantity() + 1;
// distributionStockArticleService.update(Wrappers.<DistributionStockArticleEntity>update()
// .eq("id", one.getId())
// .set("hand_quantity", i)
// .set("signin_quantity", i2)
// );
one.setHandQuantity(i);
one.setSigninQuantity(i2);
}
// 修改订单状态
distributionStockArticleService.updateById(one);
// 修改订单状态
distributionStockArticleService.updateById(one);
//修改包件状态
distributionAsyncService.getSelfPickup(distributionParcelListEntity.getId());
distributionBillLadingScan.setParcelListId(distributionParcelListEntity.getId());
distributionBillLadingScan.setPacketBarCode(String.valueOf(coding));
//订单
distributionBillLadingScan.setStockArticleId(one.getId());
distributionBillLadingScan.setQuantity(1);
distributionBillLadingScan.setBillLadingId(Long.parseLong((String) billLadingId));
//包件解脱
// try {
// warehouseUpdownTypeClient.downPackageOrDelTray((String) coding, myCurrentWarehouse.getId(),"签收下架解托");
// } catch (Exception e) {
// log.info("自提签收包件解托报错:" + e.getMessage());
// }
//修改包件状态
distributionAsyncService.getSelfPickup(distributionParcelListEntity.getId());
distributionBillLadingScan.setParcelListId(distributionParcelListEntity.getId());
distributionBillLadingScan.setPacketBarCode(String.valueOf(coding));
//订单
distributionBillLadingScan.setStockArticleId(one.getId());
distributionBillLadingScan.setQuantity(1);
distributionBillLadingScan.setBillLadingId(Long.parseLong((String) billLadingId));
}
});
}
});
if (n.get()) {
distributionBillLadingScanService.save(distributionBillLadingScan);
} else {
return Resp.scanFail("当前订单,包件不存在!!", "当前订单,包件不存在!!");
if (n.get()) {
distributionBillLadingScanService.save(distributionBillLadingScan);
} else {
return Resp.scanFail("当前订单,包件不存在!!", "当前订单,包件不存在!!");
}
}
}
}
//判断当前自提任务完成没有
String a = String.valueOf(billLadingId);
distributionAsyncService.getStockUPstate(Long.parseLong(a));
}
//判断当前自提任务完成没有
String a = String.valueOf(billLadingId);
distributionAsyncService.getStockUPstate(Long.parseLong(a));
log.info(coding + " > > 签收成功!!");
return Resp.scanSuccess("签收成功", "签收成功");
log.info(coding + " > > 签收成功!!");
return Resp.scanSuccess("签收成功", "签收成功");
}
}catch (Exception e){
log.error("自提扫描异常",e);
return Resp.scanFail("系统异常!", "系统异常,请联系管理员");
}
}
/**

11
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/ServiceNumServiceImpl.java

@ -21,6 +21,7 @@ import com.logpm.oldproject.entity.ServiceNumEntity;
import com.logpm.oldproject.mapper.ServiceNumMapper;
import com.logpm.oldproject.service.IServiceNumService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
@ -32,6 +33,7 @@ import java.util.Objects;
* @author BladeX
* @since 2023-05-10
*/
@Slf4j
@Service
@AllArgsConstructor
public class ServiceNumServiceImpl implements IServiceNumService {
@ -40,9 +42,14 @@ public class ServiceNumServiceImpl implements IServiceNumService {
@Override
public Boolean addServiceNum(List<ServiceNumEntity> serviceNum) {
if(!Objects.isNull(serviceNum)&&serviceNum.size()>0){
return serviceNumMapper.addAll(serviceNum);
try{
if(!Objects.isNull(serviceNum)&& !serviceNum.isEmpty()){
return serviceNumMapper.addAll(serviceNum);
}
}catch (Exception e){
log.error(">>>> addServiceNum",e);
}
return true;
}

Loading…
Cancel
Save