Browse Source

Merge branch 'dev' into pre-production

pre-production
zhaoqiaobo 2 months ago
parent
commit
688c2ca5ee
  1. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  2. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  3. 2
      blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mapper/FactoryNodeOrderMapper.xml
  4. 2
      blade-service/logpm-report/src/main/resources/application-prod.yml
  5. 19
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillCheckListener.java
  6. 7
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
  7. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  8. 15
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWaybillController.java
  9. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java
  10. 4
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml
  11. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java
  12. 24
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java
  13. 22
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java
  14. 12
      blade-service/logpm-warehouse/src/main/resources/luascript/resubmit.lua

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -3295,7 +3295,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (Func.isEmpty(list)) { if (Func.isEmpty(list)) {
log.error("###########################预约包件查询错误:{}", list); log.error("###########################预约包件查询错误:{}", list);
log.error("###########################查询错误预约Id:{}", reservationEntity.getId()); log.error("###########################查询错误预约Id:{}", reservationEntity.getId());
throw new RuntimeException(reservationEntity.getId()+"订单信息错误:"+s.getId()); throw new RuntimeException(s.getOrderCode()+"订单信息错误");
} }
//list 对这个集合 按照getParceListId 进行分组 //list 对这个集合 按照getParceListId 进行分组
Map<String, List<DistributionReservationPackageEntity>> oldPackageList = list.stream().collect(Collectors.groupingBy(DistributionReservationPackageEntity::getPacketBarCode)); Map<String, List<DistributionReservationPackageEntity>> oldPackageList = list.stream().collect(Collectors.groupingBy(DistributionReservationPackageEntity::getPacketBarCode));

9
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

@ -5992,7 +5992,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
} }
} }
return R.fail("取消成功"+sum+"件"); return Resp.scanSuccess("取消成功"+sum+"件","取消成功"+sum+"件");
} }
private List<DistributionAppStockUpZeroOrderDetailVO> handleStockupBillZeroOrder(DistrilbutionBillLadingEntity billLadingEntity) { private List<DistributionAppStockUpZeroOrderDetailVO> handleStockupBillZeroOrder(DistrilbutionBillLadingEntity billLadingEntity) {
@ -6553,6 +6553,9 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
.eq(DistrilbutionBillPackageEntity::getPacketBarCode, packetBarCode) .eq(DistrilbutionBillPackageEntity::getPacketBarCode, packetBarCode)
.ne(DistrilbutionBillPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue()) .ne(DistrilbutionBillPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue())
); );
if(packageEntityList.isEmpty()){
return Resp.scanFail("不在此备货计划中","不在此备货计划中");
}
if (packageEntityList.size() > 1) { if (packageEntityList.size() > 1) {
return Resp.scanFail("当前包件计划重复", "当前包件计划重复"); return Resp.scanFail("当前包件计划重复", "当前包件计划重复");
} }
@ -6653,8 +6656,8 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
.eq(DistributionReservationPackageEntity::getPacketBarCode, packetBarCode) .eq(DistributionReservationPackageEntity::getPacketBarCode, packetBarCode)
.ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue()) .ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue())
); );
if (!packageEntityList.isEmpty()) { if (packageEntityList.isEmpty()) {
return Resp.scanFail("无此备货计划","无此备货计划"); return Resp.scanFail("不在此备货计划中","不在此备货计划中");
} }
if (packageEntityList.size() > 1) { if (packageEntityList.size() > 1) {
return Resp.scanFail("当前包件计划重复", "当前包件计划重复"); return Resp.scanFail("当前包件计划重复", "当前包件计划重复");

2
blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mapper/FactoryNodeOrderMapper.xml

@ -28,7 +28,7 @@
select * select *
from olo_delivery_note from olo_delivery_note
where where
(flag is null or flag = 'A') (flag is null or flag = 'A' or flag = '')
and shipment_type_desc != '快递' and shipment_type_desc != '快递'
and shipment_type_desc != '包车' and shipment_type_desc != '包车'
and shipment_no = #{shipmentCode} and shipment_no = #{shipmentCode}

2
blade-service/logpm-report/src/main/resources/application-prod.yml

@ -22,6 +22,8 @@ spring:
proxy-filters: proxy-filters:
- sqlLogInterceptor - sqlLogInterceptor
query-timeout: 60000 query-timeout: 60000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
#设置默认的数据源或者数据源组,默认值即为master #设置默认的数据源或者数据源组,默认值即为master
primary: master primary: master
datasource: datasource:

19
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillCheckListener.java

@ -5,7 +5,8 @@ import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient; import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.feign.IBasicdataClientClient;
import com.logpm.distribution.feign.IDistributionParcelListClient; import com.logpm.distribution.feign.IDistributionParcelListClient;
import com.logpm.statistics.entity.*; import com.logpm.statistics.entity.*;
import com.logpm.statistics.service.*; import com.logpm.statistics.service.*;
@ -14,7 +15,6 @@ import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity; import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.feign.ITrunklineAdvanceClient; import com.logpm.trunkline.feign.ITrunklineAdvanceClient;
import com.logpm.trunkline.feign.ITrunklineAdvanceDetailClient; import com.logpm.trunkline.feign.ITrunklineAdvanceDetailClient;
import com.logpm.trunkline.feign.ITrunklineWaybillOrderClient;
import com.logpm.warehouse.entity.WarehouseWayBillDetail; import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import com.logpm.warehouse.entity.WarehouseWaybillEntity; import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseWaybillClient; import com.logpm.warehouse.feign.IWarehouseWaybillClient;
@ -30,7 +30,6 @@ import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding; import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.*;
@ -52,6 +51,7 @@ public class WaybillCheckListener {
private final IStatisticsDistributionPackageService distributionPackageService; private final IStatisticsDistributionPackageService distributionPackageService;
private final IStatisticsBalanceOrderInfoService balanceOrderInfoService; private final IStatisticsBalanceOrderInfoService balanceOrderInfoService;
private final IDistributionParcelListClient distributionParcelListClient; private final IDistributionParcelListClient distributionParcelListClient;
private final IBasicdataClientClient basicdataClientClient;
@RabbitListener(bindings = @QueueBinding( @RabbitListener(bindings = @QueueBinding(
value = @Queue(name = FanoutConstants.trunkline.CHECKWAYBILL.QUEUE.CHECKWAYBILL_INCOMINGDATA), value = @Queue(name = FanoutConstants.trunkline.CHECKWAYBILL.QUEUE.CHECKWAYBILL_INCOMINGDATA),
@ -200,6 +200,10 @@ public class WaybillCheckListener {
Long consigneeId = waybillEntity.getConsigneeId(); Long consigneeId = waybillEntity.getConsigneeId();
String consignee = waybillEntity.getConsignee(); String consignee = waybillEntity.getConsignee();
Integer serviceType = waybillEntity.getServiceType(); Integer serviceType = waybillEntity.getServiceType();
BasicdataClientEntity basicdataClient = basicdataClientClient.findEntityById(consigneeId);
if(!Objects.isNull(basicdataClient)){
serviceType=basicdataClient.getTypeService();
}
String payWay = waybillEntity.getPayWay(); String payWay = waybillEntity.getPayWay();
Long departureWarehouseId = waybillEntity.getDepartureWarehouseId(); Long departureWarehouseId = waybillEntity.getDepartureWarehouseId();
String departureWarehouseName = waybillEntity.getDepartureWarehouseName(); String departureWarehouseName = waybillEntity.getDepartureWarehouseName();
@ -482,6 +486,10 @@ public class WaybillCheckListener {
Long consigneeId = waybillEntity.getConsigneeId(); Long consigneeId = waybillEntity.getConsigneeId();
String consignee = waybillEntity.getConsignee(); String consignee = waybillEntity.getConsignee();
Integer serviceType = waybillEntity.getServiceType(); Integer serviceType = waybillEntity.getServiceType();
BasicdataClientEntity basicdataClient = basicdataClientClient.findEntityById(consigneeId);
if(!Objects.isNull(basicdataClient)){
serviceType=basicdataClient.getTypeService();
}
String payWay = waybillEntity.getPayWay(); String payWay = waybillEntity.getPayWay();
Long departureWarehouseId = waybillEntity.getDepartureWarehouseId(); Long departureWarehouseId = waybillEntity.getDepartureWarehouseId();
String departureWarehouseName = waybillEntity.getDepartureWarehouseName(); String departureWarehouseName = waybillEntity.getDepartureWarehouseName();
@ -491,6 +499,8 @@ public class WaybillCheckListener {
Integer pickupCompleteOrNot = waybillEntity.getPickupCompleteOrNot(); Integer pickupCompleteOrNot = waybillEntity.getPickupCompleteOrNot();
Date signTime = waybillEntity.getSignTime(); Date signTime = waybillEntity.getSignTime();
//单价计算 //单价计算
// BigDecimal pickupFee = Objects.isNull(waybillEntity.getPickupFee())?BigDecimal.ZERO:waybillEntity.getPickupFee(); // BigDecimal pickupFee = Objects.isNull(waybillEntity.getPickupFee())?BigDecimal.ZERO:waybillEntity.getPickupFee();
BigDecimal warehouseManagementFee = Objects.isNull(waybillEntity.getWarehouseManagementFee()) ? BigDecimal.ZERO : waybillEntity.getWarehouseManagementFee(); BigDecimal warehouseManagementFee = Objects.isNull(waybillEntity.getWarehouseManagementFee()) ? BigDecimal.ZERO : waybillEntity.getWarehouseManagementFee();
@ -546,6 +556,7 @@ public class WaybillCheckListener {
//保存订单信息 //保存订单信息
List<StatisticsOrderInfoEntity> orderInfoEntities = new ArrayList<>(); List<StatisticsOrderInfoEntity> orderInfoEntities = new ArrayList<>();
Integer finalServiceType = serviceType;
advanceEntities.forEach(advanceEntity -> { advanceEntities.forEach(advanceEntity -> {
StatisticsOrderInfoEntity orderInfoEntity = new StatisticsOrderInfoEntity(); StatisticsOrderInfoEntity orderInfoEntity = new StatisticsOrderInfoEntity();
orderInfoEntity.setOrderCode(advanceEntity.getOrderCode()); orderInfoEntity.setOrderCode(advanceEntity.getOrderCode());
@ -555,7 +566,7 @@ public class WaybillCheckListener {
orderInfoEntity.setBrand(brand); orderInfoEntity.setBrand(brand);
orderInfoEntity.setConsigneeId(consigneeId); orderInfoEntity.setConsigneeId(consigneeId);
orderInfoEntity.setConsignee(consignee); orderInfoEntity.setConsignee(consignee);
orderInfoEntity.setTypeService(serviceType); orderInfoEntity.setTypeService(finalServiceType);
orderInfoEntity.setSignDate(signTime); orderInfoEntity.setSignDate(signTime);
orderInfoEntity.setSignStatus(0); orderInfoEntity.setSignStatus(0);
orderInfoEntity.setSyncFeeStatus(0); orderInfoEntity.setSyncFeeStatus(0);

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

@ -916,8 +916,11 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
} }
//修改暂存单明细的结算品类 //修改暂存单明细的结算品类
advanceDetailService.updateBatchById(updateAdvanceDetailList); //把updateAdvanceDetailList分成每300条一组
List<List<TrunklineAdvanceDetailEntity>> updateAdvanceDetailListList = CollUtil.split(updateAdvanceDetailList, 300);
updateAdvanceDetailListList.forEach(updateAdvanceDetailList1 -> {
advanceDetailService.updateBatchById(updateAdvanceDetailList1);
});
trunklineWaybillPackageService.updateWaybillStatus(waybillEntity); trunklineWaybillPackageService.updateWaybillStatus(waybillEntity);

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -10951,6 +10951,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//查询已装车的零担 //查询已装车的零担
List<LoadZeroListVO> zeroList = trunklineCarsOrderService.findZeroList(loadId, warehouseId); List<LoadZeroListVO> zeroList = trunklineCarsOrderService.findZeroList(loadId, warehouseId);
if(CollUtil.isNotEmpty(zeroList)){
zeroList.forEach(loadZeroListVO -> { zeroList.forEach(loadZeroListVO -> {
String waybillNo = loadZeroListVO.getWaybillNo(); String waybillNo = loadZeroListVO.getWaybillNo();
String orderCode = loadZeroListVO.getOrderCode(); String orderCode = loadZeroListVO.getOrderCode();
@ -10972,6 +10973,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}); });
loadZeroListVO.setZeroPackageList(ls); loadZeroListVO.setZeroPackageList(ls);
}); });
}
//查询异常列表 //查询异常列表

15
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWaybillController.java

@ -438,4 +438,19 @@ public class WarehouseWaybillController extends BladeController {
} }
@PostMapping("/updateWaybillTypeService")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "修改运单的服务类型 ")
public R updateWaybillTypeService(@RequestBody WarehouseWaybillDTO waybillDTO) {
try {
log.info(">>>>>>>>>>>>>>>>>> updateWaybillTypeService: waybillDTO={}",waybillDTO);
return warehouseWaybillService.updateWaybillTypeService(waybillDTO);
} catch (Exception e) {
return R.fail(e.getMessage());
}
}
} }

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java

@ -83,4 +83,6 @@ public interface WarehouseWaybillMapper extends BaseMapper<WarehouseWaybillEntit
void updateWaybillCondigneeIdToNull(@Param("waybillId") Long waybillId); void updateWaybillCondigneeIdToNull(@Param("waybillId") Long waybillId);
List<WarehouseWaybillEntity> findWaybillVOByOrderCode(@Param("orderCode") String orderCode); List<WarehouseWaybillEntity> findWaybillVOByOrderCode(@Param("orderCode") String orderCode);
void updateWaybillTypeService(@Param("serviceType") Integer serviceType, @Param("waybillId") Long id);
} }

4
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml

@ -1286,4 +1286,8 @@
update logpm_warehouse_waybill set consignee_id = null where id = #{waybillId} update logpm_warehouse_waybill set consignee_id = null where id = #{waybillId}
</update> </update>
<update id="updateWaybillTypeService" >
update logpm_warehouse_waybill set service_type = #{serviceType} where id = #{waybillId}
</update>
</mapper> </mapper>

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java

@ -95,4 +95,6 @@ public interface IWarehouseWaybillService extends BaseService<WarehouseWaybillEn
void updateWaybillCondigneeIdToNull(Long waybillId); void updateWaybillCondigneeIdToNull(Long waybillId);
List<WarehouseWaybillEntity> findWaybillVOByOrderCode(String orderCode); List<WarehouseWaybillEntity> findWaybillVOByOrderCode(String orderCode);
R updateWaybillTypeService(WarehouseWaybillDTO waybillDTO);
} }

24
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

@ -62,6 +62,9 @@ import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.cache.DictBizCache; import org.springblade.system.cache.DictBizCache;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.core.io.ClassPathResource;
import org.springframework.data.redis.core.script.DefaultRedisScript;
import org.springframework.scripting.support.ResourceScriptSource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -1060,6 +1063,13 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
@Override @Override
public R orderScanOrderPackageCodeSyncJd(Long trayId,String trayType, String trayCode,String trayName, String orderPackageCode, Long warehouseId) { public R orderScanOrderPackageCodeSyncJd(Long trayId,String trayType, String trayCode,String trayName, String orderPackageCode, Long warehouseId) {
// String key = "orderScanOrderPackageCodeSyncJd:"+trayCode;
// Boolean exists = redis.exists(key);
// if(exists){
// log.warn("#########orderScanOrderPackageCodeSyncJd: 托盘正在被操作 trayCode={} warehouseId={}", trayCode, warehouseId);
// return R.fail(4001, "托盘信息正在更新,请重试");
// }
// redis.setEx(key,1,1L);
QueryWrapper<WarehouseTrayGoodsEntity> qw = new QueryWrapper<>(); QueryWrapper<WarehouseTrayGoodsEntity> qw = new QueryWrapper<>();
qw.eq("association_value", orderPackageCode); qw.eq("association_value", orderPackageCode);
@ -1762,9 +1772,19 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
log.info("#########saveTrayType: 存入打托方式 trayType={},trayCode={}", trayType, trayCode); log.info("#########saveTrayType: 存入打托方式 trayType={},trayCode={}", trayType, trayCode);
String key = "saveTrayTypeNew:"+trayCode; String key = "saveTrayTypeNew:"+trayCode;
String value = "1";
Long expireTime = 5L;
DefaultRedisScript<Long> redisScript = new DefaultRedisScript<>();
redisScript.setScriptSource(new ResourceScriptSource(new ClassPathResource("luascript/resubmit.lua")));
redisScript.setResultType(Long.class);
List<String> keys = Collections.singletonList(key);
List<String> args = Arrays.asList(value, String.valueOf(expireTime));
Long result = redis.getRedisTemplate().execute(redisScript, keys, args);
Boolean exists = redis.exists(key); if (result == 1) {
if(exists){
log.warn("#########orderScanOrderPackageCode: 托盘正在保存打托方式 trayCode={} warehouseId={}", trayCode, warehouseId); log.warn("#########orderScanOrderPackageCode: 托盘正在保存打托方式 trayCode={} warehouseId={}", trayCode, warehouseId);
throw new CustomerException(405, "托盘信息正在更新,请重试"); throw new CustomerException(405, "托盘信息正在更新,请重试");
} }

22
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

@ -1234,4 +1234,26 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
public List<WarehouseWaybillEntity> findWaybillVOByOrderCode(String orderCode) { public List<WarehouseWaybillEntity> findWaybillVOByOrderCode(String orderCode) {
return baseMapper.findWaybillVOByOrderCode(orderCode); return baseMapper.findWaybillVOByOrderCode(orderCode);
} }
@Override
public R updateWaybillTypeService(WarehouseWaybillDTO waybillDTO) {
Long id = waybillDTO.getId();
Integer serviceType = waybillDTO.getServiceType();
WarehouseWaybillEntity warehouseWaybillEntity = baseMapper.selectById(id);
if(Objects.isNull(warehouseWaybillEntity)){
log.warn("###########updateWaybillTypeService: 运单信息为空");
return R.fail(405,"运单信息为空");
}
Integer checkStatus = warehouseWaybillEntity.getCheckStatus();
if(checkStatus.equals(1)){
log.warn("###########updateWaybillTypeService: 运单已审核");
return R.fail(405,"运单已审核");
}
baseMapper.updateWaybillTypeService(serviceType,id);
return R.success("修改成功");
}
} }

12
blade-service/logpm-warehouse/src/main/resources/luascript/resubmit.lua

@ -0,0 +1,12 @@
local key = KEYS[1]
local value = ARGV[1]
local expireTime = tonumber(ARGV[2])
local exists = redis.call("EXISTS", key)
if exists == 1 then
return 1
end
redis.call("SETEX", key, expireTime, value)
return 0
Loading…
Cancel
Save