Browse Source

1.时效报表bug修复

2.审核运单逻辑优化
fix-sign
zhenghaoyu 2 months ago
parent
commit
ee58c6ba75
  1. 2
      blade-service/logpm-report/src/main/resources/application-prod.yml
  2. 19
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillCheckListener.java
  3. 7
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
  4. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  5. 15
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWaybillController.java
  6. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java
  7. 4
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml
  8. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java
  9. 24
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java
  10. 22
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java
  11. 12
      blade-service/logpm-warehouse/src/main/resources/luascript/resubmit.lua

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

@ -22,6 +22,8 @@ spring:
proxy-filters:
- sqlLogInterceptor
query-timeout: 60000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
#设置默认的数据源或者数据源组,默认值即为master
primary: master
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.json.JSONObject;
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.statistics.entity.*;
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.feign.ITrunklineAdvanceClient;
import com.logpm.trunkline.feign.ITrunklineAdvanceDetailClient;
import com.logpm.trunkline.feign.ITrunklineWaybillOrderClient;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
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.RabbitListener;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.*;
@ -52,6 +51,7 @@ public class WaybillCheckListener {
private final IStatisticsDistributionPackageService distributionPackageService;
private final IStatisticsBalanceOrderInfoService balanceOrderInfoService;
private final IDistributionParcelListClient distributionParcelListClient;
private final IBasicdataClientClient basicdataClientClient;
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = FanoutConstants.trunkline.CHECKWAYBILL.QUEUE.CHECKWAYBILL_INCOMINGDATA),
@ -200,6 +200,10 @@ public class WaybillCheckListener {
Long consigneeId = waybillEntity.getConsigneeId();
String consignee = waybillEntity.getConsignee();
Integer serviceType = waybillEntity.getServiceType();
BasicdataClientEntity basicdataClient = basicdataClientClient.findEntityById(consigneeId);
if(!Objects.isNull(basicdataClient)){
serviceType=basicdataClient.getTypeService();
}
String payWay = waybillEntity.getPayWay();
Long departureWarehouseId = waybillEntity.getDepartureWarehouseId();
String departureWarehouseName = waybillEntity.getDepartureWarehouseName();
@ -482,6 +486,10 @@ public class WaybillCheckListener {
Long consigneeId = waybillEntity.getConsigneeId();
String consignee = waybillEntity.getConsignee();
Integer serviceType = waybillEntity.getServiceType();
BasicdataClientEntity basicdataClient = basicdataClientClient.findEntityById(consigneeId);
if(!Objects.isNull(basicdataClient)){
serviceType=basicdataClient.getTypeService();
}
String payWay = waybillEntity.getPayWay();
Long departureWarehouseId = waybillEntity.getDepartureWarehouseId();
String departureWarehouseName = waybillEntity.getDepartureWarehouseName();
@ -491,6 +499,8 @@ public class WaybillCheckListener {
Integer pickupCompleteOrNot = waybillEntity.getPickupCompleteOrNot();
Date signTime = waybillEntity.getSignTime();
//单价计算
// BigDecimal pickupFee = Objects.isNull(waybillEntity.getPickupFee())?BigDecimal.ZERO:waybillEntity.getPickupFee();
BigDecimal warehouseManagementFee = Objects.isNull(waybillEntity.getWarehouseManagementFee()) ? BigDecimal.ZERO : waybillEntity.getWarehouseManagementFee();
@ -546,6 +556,7 @@ public class WaybillCheckListener {
//保存订单信息
List<StatisticsOrderInfoEntity> orderInfoEntities = new ArrayList<>();
Integer finalServiceType = serviceType;
advanceEntities.forEach(advanceEntity -> {
StatisticsOrderInfoEntity orderInfoEntity = new StatisticsOrderInfoEntity();
orderInfoEntity.setOrderCode(advanceEntity.getOrderCode());
@ -555,7 +566,7 @@ public class WaybillCheckListener {
orderInfoEntity.setBrand(brand);
orderInfoEntity.setConsigneeId(consigneeId);
orderInfoEntity.setConsignee(consignee);
orderInfoEntity.setTypeService(serviceType);
orderInfoEntity.setTypeService(finalServiceType);
orderInfoEntity.setSignDate(signTime);
orderInfoEntity.setSignStatus(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);

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);
if(CollUtil.isNotEmpty(zeroList)){
zeroList.forEach(loadZeroListVO -> {
String waybillNo = loadZeroListVO.getWaybillNo();
String orderCode = loadZeroListVO.getOrderCode();
@ -10972,6 +10973,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
});
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);
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>
<update id="updateWaybillTypeService" >
update logpm_warehouse_waybill set service_type = #{serviceType} where id = #{waybillId}
</update>
</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);
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.springframework.beans.factory.annotation.Autowired;
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.transaction.annotation.Transactional;
@ -1060,6 +1063,13 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
@Override
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<>();
qw.eq("association_value", orderPackageCode);
@ -1762,9 +1772,19 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
log.info("#########saveTrayType: 存入打托方式 trayType={},trayCode={}", trayType, 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(exists){
if (result == 1) {
log.warn("#########orderScanOrderPackageCode: 托盘正在保存打托方式 trayCode={} warehouseId={}", trayCode, warehouseId);
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) {
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