Browse Source

1.结算模块bug修复

2.开单默认送货方式
3.开单收货单位带出联系人
master
zhenghaoyu 10 months ago
parent
commit
5710649caf
  1. 3
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsDistributionPackageEntity.java
  2. 3
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadScanEntity.java
  3. 1
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/OpenOrderVO.java
  4. 4
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/SignOrderDetailVO.java
  5. 6
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/ExportWarehouseWaybillVO.java
  6. 51
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/aspect/AsyncAnnotationAspect.java
  7. 48
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/aspect/RabbitAnnotationAspect.java
  8. 28
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantStatisticsController.java
  9. 1
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/PackageFanoutListener.java
  10. 51
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillFanoutListener.java
  11. 2
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.java
  12. 2
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml
  13. 2
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsOrderInfoService.java
  14. 8
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java
  15. 34
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/OpenOrderController.java
  16. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml
  17. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml
  18. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineLoadSignOrderMapper.xml
  19. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderService.java
  20. 56
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java
  21. 34
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
  22. 13
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  23. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java
  24. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/config/InterceptorAdapterConfig.java
  25. 66
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/interceptor/ParameterCombinationInterceptor.java

3
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsDistributionPackageEntity.java

@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.math.BigDecimal;
import java.util.Date;
@Data
@TableName("logpm_statistics_distribution_package")
@ -128,5 +129,5 @@ public class StatisticsDistributionPackageEntity extends TenantEntity {
private Long orderInfoId;
private Integer isSign;//是否签收 0否 1是
private Date signTime; //签收时间
}

3
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadScanEntity.java

@ -109,6 +109,9 @@ public class TrunklineCarsLoadScanEntity extends TenantEntity {
@ApiModelProperty(name = "是否补录 0否 1是",notes = "")
private Integer isSupple ;
@ApiModelProperty(name = "签收人名称",notes = "")
private String signUserName;
/** 签收时间 */
@ApiModelProperty(name = "签收时间",notes = "")
private Date signTime;

1
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/OpenOrderVO.java

@ -55,6 +55,7 @@ public class OpenOrderVO implements Serializable {
private List<DictBiz> transportTypeList;//运输方式
private String defaultPayWay;
private String defaultDeliveryWay;//默认送货方式
private String openOrderDate;//开单时间
private String openOrderUserName;//开单人

4
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/SignOrderDetailVO.java

@ -3,6 +3,7 @@ package com.logpm.trunkline.vo;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class SignOrderDetailVO implements Serializable {
@ -21,6 +22,9 @@ public class SignOrderDetailVO implements Serializable {
private Integer type;
private Integer num;
private Integer unloadNum;
private String signUserName;
private Date signTime;
private Date unloadTime;
private String remark;
private Long signOrderId;

6
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/ExportWarehouseWaybillVO.java

@ -1,5 +1,6 @@
package com.logpm.warehouse.vo;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
@ -149,10 +150,12 @@ public class ExportWarehouseWaybillVO implements Serializable {
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date documentMakingTime;
@ExcelIgnore
private Integer pickupCompleteOrNot;
@ExcelProperty(value = "提货是否整车")
private String pickupCompleteOrNotStr;
@ExcelIgnore
private Integer trunklineCompleteOrNot;
@ExcelProperty(value = "干线是否整车")
private String trunklineCompleteOrNotStr;
@ -161,6 +164,7 @@ public class ExportWarehouseWaybillVO implements Serializable {
private String waybillStatus;
@ExcelIgnore
private Integer freezeStatus;
@ExcelProperty(value = "是否冻结")
private String freezeStatusStr;
@ -172,7 +176,7 @@ public class ExportWarehouseWaybillVO implements Serializable {
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date freezeTime;
@ExcelIgnore
private Integer abolishStatus;
@ExcelProperty(value = "是否作废")
private String abolishStatusStr;

51
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/aspect/AsyncAnnotationAspect.java

@ -0,0 +1,51 @@
package com.logpm.statistics.aspect;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.reflect.MethodSignature;
import org.springblade.common.annotations.LogpmAsync;
import org.springblade.core.secure.utils.AuthUtil;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import java.lang.reflect.Method;
@Aspect
@Component
@Slf4j
@Order(-1)
public class AsyncAnnotationAspect {
/**
* 定义一个切点匹配所有带有@LogpmAsync("asyncExecutor")注解的方法
* 注意实际上Spring Framework自带对@LogpmAsync("asyncExecutor")的处理直接这样配置可能会导致预期之外的行为
*/
@Around("@annotation(org.springblade.common.annotations.LogpmAsync)")
public Object logAroundAsyncMethods(ProceedingJoinPoint joinPoint) throws Throwable {
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
Method method = signature.getMethod();
LogpmAsync myAsync = method.getAnnotation(LogpmAsync.class);
String annotationValue = myAsync.value();
log.info(">>>>>>>>>>>>>>>>>> annotationValue={}",annotationValue);
log.info("@LogpmAsync注解的值为asyncExecutor,进行数据源切换 ");
// 在方法执行前的操作
String tenantId = AuthUtil.getTenantId();
log.info(">> tenandId {} ",tenantId);
DynamicDataSourceContextHolder.push(tenantId);
// 执行原方法
Object result = joinPoint.proceed();
// 在方法执行后的操作
DynamicDataSourceContextHolder.poll();
return result;
}
}

48
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/aspect/RabbitAnnotationAspect.java

@ -0,0 +1,48 @@
package com.logpm.statistics.aspect;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springblade.core.secure.utils.AuthUtil;
import org.springframework.stereotype.Component;
@Aspect
@Component
@Slf4j
public class RabbitAnnotationAspect {
/**
* 该方法为一个切面用于对标记了@RabbitListener注解的方法进行增强主要增加了日志记录和数据源上下文处理的功能
*
* @param joinPoint 切面的连接点表示当前被拦截的方法
* @return 返回被拦截方法的执行结果
* @throws Throwable 如果执行过程中发生异常则抛出
*/
@Around("@annotation(org.springframework.amqp.rabbit.annotation.RabbitListener)")
public Object rabbitMethods(ProceedingJoinPoint joinPoint) throws Throwable {
// 在方法执行前,获取当前租户ID并设置到数据源上下文中
String tenantId = AuthUtil.getTenantId();
DynamicDataSourceContextHolder.push(tenantId);
// 执行原方法
Object result = joinPoint.proceed();
// 在方法执行后,从数据源上下文中移除租户ID
DynamicDataSourceContextHolder.poll();
return result;
}
@Around("@annotation(org.springframework.amqp.rabbit.annotation.RabbitHandler)")
public Object rabbitHandlerMethods(ProceedingJoinPoint joinPoint) throws Throwable {
// 在方法执行前,获取当前租户ID并设置到数据源上下文中
String tenantId = AuthUtil.getTenantId();
DynamicDataSourceContextHolder.push(tenantId);
// 执行原方法
Object result = joinPoint.proceed();
// 在方法执行后,从数据源上下文中移除租户ID
DynamicDataSourceContextHolder.poll();
return result;
}
}

28
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantStatisticsController.java

@ -54,6 +54,34 @@ public class MerchantStatisticsController {
}
}
@ResponseBody
@PostMapping("/findOrderDetail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询订单详情", notes = "传入merchantStatisticsDTO")
public R findOrderDetail(@RequestBody MerchantStatisticsDTO merchantStatisticsDTO) {
String method = "############findOrderDetail: ";
log.info(method+"请求参数{}",merchantStatisticsDTO);
try{
Long orderInfoId = merchantStatisticsDTO.getOrderInfoId();
if(Objects.isNull(orderInfoId)){
log.warn(method+"请选择正确的订单 orderInfoId={}",orderInfoId);
return R.fail(405,"请选择正确的订单");
}
StatisticsOrderInfoVO statisticsOrderInfoVO = statisticsOrderInfoService.findOrderDetail(orderInfoId);
return R.data(statisticsOrderInfoVO);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
@ResponseBody
@PostMapping("/findChangesRecordList")
@ApiOperationSupport(order = 1)

1
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/PackageFanoutListener.java

@ -52,6 +52,7 @@ public class PackageFanoutListener {
Set<Long> orderInfoSet = new HashSet<>();
statisticsDistributionList.forEach(statisticsDistributionPackageEntity -> {
statisticsDistributionPackageEntity.setIsSign(1);
statisticsDistributionPackageEntity.setSignTime(new Date());
String typeService = statisticsDistributionPackageEntity.getTypeService();
if("3".equals(typeService)){
statisticsDistributionPackageEntity.setRealDeliveryFee(BigDecimal.ZERO);

51
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillFanoutListener.java

@ -19,6 +19,7 @@ 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.ArrayList;
import java.util.List;
import java.util.Map;
@ -48,6 +49,7 @@ public class WaybillFanoutListener {
Long waybillId = jsonObject.getLong("waybillId");
String waybillNo = jsonObject.getStr("waybillNo");
String typeService = jsonObject.getStr("typeService");//服务类型
Integer waybillType = jsonObject.getInt("waybillType");
List<StatisticsTrunklinePackageEntity> statisticsTrunklinePackageEntities = new ArrayList<>();
List<StatisticsWarehousePackageEntity> statisticsWarehousePackageEntities = new ArrayList<>();
@ -64,7 +66,6 @@ public class WaybillFanoutListener {
statisticsTrunklinePackageEntity.setTypeService(typeService);
statisticsTrunklinePackageEntity.setWaybillId(waybillId);
statisticsTrunklinePackageEntity.setWaybillNo(waybillNo);
Integer waybillType = json.getInt("waybillType");
if(waybillType.equals(1)){
statisticsTrunklinePackageEntity.setGoodsType(1);
}else if (waybillType.equals(2)){
@ -126,6 +127,8 @@ public class WaybillFanoutListener {
statisticsWarehousePackageEntity.setTotalNum(json.getInt("totalNum"));
statisticsWarehousePackageEntity.setTotalWeight(json.getBigDecimal("totalWeight"));
statisticsWarehousePackageEntity.setTotalVolume(json.getBigDecimal("totalVolume"));
statisticsWarehousePackageEntity.setOpenPrice(json.getBigDecimal("warehouseServiceFee"));
statisticsWarehousePackageEntity.setTotalPrice(json.getBigDecimal("warehouseServiceFee"));
statisticsWarehousePackageEntity.setWarehouseServiceFee(json.getBigDecimal("warehouseServiceFee"));
statisticsWarehousePackageEntity.setRealWarehouseServiceFee(json.getBigDecimal("warehouseServiceFee"));
statisticsWarehousePackageEntity.setWarehouseFee(json.getBigDecimal("warehouseFee"));
@ -159,6 +162,8 @@ public class WaybillFanoutListener {
statisticsDistributionPackageEntity.setTotalNum(json.getInt("totalNum"));
statisticsDistributionPackageEntity.setTotalWeight(json.getBigDecimal("totalWeight"));
statisticsDistributionPackageEntity.setTotalVolume(json.getBigDecimal("totalVolume"));
statisticsDistributionPackageEntity.setOpenPrice(json.getBigDecimal("deliveryServiceFee"));
statisticsDistributionPackageEntity.setTotalPrice(json.getBigDecimal("deliveryServiceFee"));
statisticsDistributionPackageEntity.setDeliveryServiceFee(json.getBigDecimal("deliveryServiceFee"));
statisticsDistributionPackageEntity.setRealDeliveryServiceFee(json.getBigDecimal("deliveryServiceFee"));
statisticsDistributionPackageEntity.setDeliveryFee(json.getBigDecimal("deliveryFee"));
@ -204,6 +209,9 @@ public class WaybillFanoutListener {
statisticsOrderInfoEntity.setWaybillNo(waybillNo);
statisticsOrderInfoEntity.setOrderCode(key);
statisticsOrderInfoEntity.setTypeService(typeService);
statisticsOrderInfoEntity.setSignStatus(0);
statisticsOrderInfoEntity.setConfirmStatisticsOrder(0);
statisticsOrderInfoEntity.setChangesFee(BigDecimal.ZERO);
orderInfoEntities.add(statisticsOrderInfoEntity);
});
@ -220,33 +228,46 @@ public class WaybillFanoutListener {
statisticsTrunklinePackageEntity.setOrderInfoId(orderInfoId);
});
statisticsTrunklinePackageSaveList.addAll(statisticsTrunklinePackageEntityList);
});
statisticsTrunklinePackageService.saveBatch(statisticsTrunklinePackageSaveList);
orderInfoEntities.forEach(statisticsOrderInfoEntity -> {
String orderCode = statisticsOrderInfoEntity.getOrderCode();
Long orderInfoId = statisticsOrderInfoEntity.getId();
List<StatisticsWarehousePackageEntity> statisticsWarehousePackageEntityList= warehouseMap.get(orderCode);
statisticsWarehousePackageEntityList.forEach(statisticsWarehousePackageEntity -> {
statisticsWarehousePackageEntity.setOrderInfoId(orderInfoId);
});
statisticsWarehousePackageSaveList.addAll(statisticsWarehousePackageEntityList);
});
statisticsWarehousePackageService.saveBatch(statisticsWarehousePackageSaveList);
orderInfoEntities.forEach(statisticsOrderInfoEntity -> {
String orderCode = statisticsOrderInfoEntity.getOrderCode();
Long orderInfoId = statisticsOrderInfoEntity.getId();
List<StatisticsDistributionPackageEntity> statisticsDistributionPackageEntityList= distributionMap.get(orderCode);
statisticsDistributionPackageEntityList.forEach(statisticsDistributionPackageEntity -> {
statisticsDistributionPackageEntity.setOrderInfoId(orderInfoId);
});
statisticsDistributionPackageSaveList.addAll(statisticsDistributionPackageEntityList);
});
});
statisticsTrunklinePackageService.saveBatch(statisticsTrunklinePackageSaveList);
statisticsWarehousePackageService.saveBatch(statisticsWarehousePackageSaveList);
statisticsDistributionPackageService.saveBatch(statisticsDistributionPackageSaveList);
// orderInfoEntities.forEach(statisticsOrderInfoEntity -> {
// String orderCode = statisticsOrderInfoEntity.getOrderCode();
// Long orderInfoId = statisticsOrderInfoEntity.getId();
// List<StatisticsWarehousePackageEntity> statisticsWarehousePackageEntityList= warehouseMap.get(orderCode);
// statisticsWarehousePackageEntityList.forEach(statisticsWarehousePackageEntity -> {
// statisticsWarehousePackageEntity.setOrderInfoId(orderInfoId);
// });
// statisticsWarehousePackageSaveList.addAll(statisticsWarehousePackageEntityList);
// });
//
// statisticsWarehousePackageService.saveBatch(statisticsWarehousePackageSaveList);
//
// orderInfoEntities.forEach(statisticsOrderInfoEntity -> {
// String orderCode = statisticsOrderInfoEntity.getOrderCode();
// Long orderInfoId = statisticsOrderInfoEntity.getId();
// List<StatisticsDistributionPackageEntity> statisticsDistributionPackageEntityList= distributionMap.get(orderCode);
// statisticsDistributionPackageEntityList.forEach(statisticsDistributionPackageEntity -> {
// statisticsDistributionPackageEntity.setOrderInfoId(orderInfoId);
// });
// statisticsDistributionPackageSaveList.addAll(statisticsDistributionPackageEntityList);
// });
//
// statisticsDistributionPackageService.saveBatch(statisticsDistributionPackageSaveList);
log.info("处理完成:{}", msg);
}

2
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.java

@ -16,4 +16,6 @@ public interface StatisticsOrderInfoMapper extends BaseMapper<StatisticsOrderInf
IPage<StatisticsOrderInfoVO> pageList(IPage<Object> page, @Param("param") MerchantStatisticsDTO merchantStatisticsDTO);
List<StatisticsOrderInfoVO> findStatementListByOrderInfoIds(@Param("orderInfoIds") List<Long> orderInfoIds);
StatisticsOrderInfoVO findOrderDetail(@Param("orderInfoId") Long orderInfoId);
}

2
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml

@ -104,7 +104,7 @@
left join (select ltwr.waybill_id from logpm_trunkline_waybill_return ltwr group by ltwr.waybill_id) twr on twr.waybill_id = lww.id
left join logpm_statistics_trunkline_package lstp on lstp.order_info_id = lsoi.id
left join logpm_statistics_warehouse_package lswp on lswp.order_info_id = lstp.order_info_id and lswp.order_package_code = lstp.order_package_code
left join logpm_statistics_distribution_package lsdp on lsdp.order_info_id = lswp.order_info_id = lsdp.order_package_code = lswp.order_package_code
left join logpm_statistics_distribution_package lsdp on lsdp.order_info_id = lswp.order_info_id and lsdp.order_package_code = lswp.order_package_code
left join logpm_statistics_changes_record lscr on lscr.order_info_id = lsoi.id
where 1=1
<if test="param.listType == 1">

2
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsOrderInfoService.java

@ -24,4 +24,6 @@ public interface IStatisticsOrderInfoService extends BaseService<StatisticsOrder
R addChangesRecord(ChangesRecordDTO changesRecordDTO);
R checkBalance(MerchantStatisticsDTO merchantStatisticsDTO);
StatisticsOrderInfoVO findOrderDetail(Long orderInfoId);
}

8
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java

@ -371,6 +371,14 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl<StatisticsOr
return R.success("确认成功");
}
@Override
public StatisticsOrderInfoVO findOrderDetail(Long orderInfoId) {
List<Long> orderInfoIds = new ArrayList<>();
orderInfoIds.add(orderInfoId);
List<StatisticsOrderInfoVO> statementListByOrderInfoIds = baseMapper.findStatementListByOrderInfoIds(orderInfoIds);
return statementListByOrderInfoIds.get(0);
}
private void updateOrderChangesFee(Long orderInfoId) {
StatisticsOrderInfoEntity statisticsOrderInfoEntity = baseMapper.selectById(orderInfoId);

34
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/OpenOrderController.java

@ -9,7 +9,6 @@ import com.logpm.trunkline.dto.AdvanceDTO;
import com.logpm.trunkline.dto.OpenLabelDTO;
import com.logpm.trunkline.dto.OpenOrderDTO;
import com.logpm.trunkline.dto.WaybillDetailDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.service.ICarsLoadAsyncService;
import com.logpm.trunkline.service.IOpenOrderService;
import com.logpm.trunkline.service.ITrunklineCarsLoadService;
@ -1691,4 +1690,37 @@ public class OpenOrderController {
}
@ResponseBody
@PostMapping("/findWaybillDes")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询运单目的仓", notes = "传入openOrderDTO")
public R findWaybillDes(@RequestBody OpenOrderDTO openOrderDTO) {
String method = "############findWaybillDes: ";
log.info(method + "请求参数{}", openOrderDTO);
Long departureWarehouseId = openOrderDTO.getDepartureWarehouseId();
Long consigneeId = openOrderDTO.getConsigneeId();
try{
if(Objects.isNull(departureWarehouseId)){
log.warn(method+"发站仓id为空 departureWarehouseId={}",departureWarehouseId);
return R.fail(405,"发站仓id为空");
}
if(Objects.isNull(consigneeId)){
log.warn(method+"收货单位id不能为空 consigneeId={}",consigneeId);
return R.fail(405,"收货单位id不能为空");
}
return openOrderService.findWaybillDes(departureWarehouseId,consigneeId);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
}

4
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml

@ -446,8 +446,10 @@
lww.remark remark,
ROUND(lww.total_freight/lww.total_count,2) price
from logpm_distribution_stock_article ldsa
left join logpm_warehouse_waybill lww on lww.waybill_no = ldsa.waybill_number
left join logpm_warehouse_waybill lww on lww.waybill_no = ldsa.waybill_number
where ldsa.is_zero = 1
and lww.destination_warehouse_id != #{param.warehouseId}
and ldsa.hand_quantity > 0
and ldsa.warehouse_id = #{param.warehouseId}
<if test="param.orderCodes != null and param.orderCodes.size() > 0">
and ldsa.order_code not in

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml

@ -773,7 +773,7 @@
select ltcls.*,
ltco.sign_order_id signOrderId
from logpm_trunkline_cars_load_scan ltcls
left join logpm_trunkline_cars_order ltco on ltco.waybill_id = ltcls.waybill_id and ltco.order_code = ltcls.order_code and ltcls.warehouse_id = ltco.warehouse_id
left join logpm_trunkline_cars_order ltco on ltco.waybill_id = ltcls.waybill_id and ltco.order_code = ltcls.order_code and ltcls.warehouse_id = ltco.node_id
where ltcls.scan_status = '1'
and ltcls.id in
<foreach collection="carsLoadScanIds" item="item" separator="," open="(" close=")">

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineLoadSignOrderMapper.xml

@ -66,6 +66,9 @@
ltcls.unload_num unloadNum,
ltcls.remark remak,
ltcls.load_code carsNo,
ltcls.sign_user_name signUserName,
ltcls.sign_time signTime,
ltcls.unload_time unloadTime,
ltco.sign_order_id signOrderId
from logpm_trunkline_cars_order ltco
left join logpm_trunkline_cars_load_scan ltcls on ltco.load_id = ltcls.load_id and ltco.node_id = ltcls.warehouse_id and ltcls.order_code = ltco.order_code and ltcls.waybill_no = ltco.waybill_no

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

@ -87,6 +87,8 @@ public interface IOpenOrderService {
R abolishWaybill(List<Long> waybillIds, Long warehouseId, String warehouseName, String abolishReson);
R findWaybillDes(Long departureWarehouseId, Long consigneeId);
// R findWaybillInfo(String waybillNo);
}

56
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java

@ -354,8 +354,14 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService {
BigDecimal otherFee = waybillEntity.getOtherFee();
BigDecimal otherPrice = otherFee.divide(new BigDecimal(totalCount), 2, RoundingMode.HALF_UP);
BigDecimal rebate = waybillEntity.getRebate();
if(Objects.isNull(rebate)){
rebate = BigDecimal.ZERO;
}
BigDecimal rebatePrice = rebate.divide(new BigDecimal(totalCount), 2, RoundingMode.HALF_UP);
BigDecimal thirdOperationFee = waybillEntity.getThirdOperationFee();
if(Objects.isNull(thirdOperationFee)){
thirdOperationFee = BigDecimal.ZERO;
}
BigDecimal thirdOperationPrice = thirdOperationFee.divide(new BigDecimal(totalCount), 2, RoundingMode.HALF_UP);
BigDecimal xPay = waybillEntity.getXPay();
BigDecimal xPayPrice = xPay.divide(new BigDecimal(totalCount), 2, RoundingMode.HALF_UP);
@ -395,8 +401,16 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService {
json.put("productId",advanceDetailVO.getGoodsId());
json.put("productName",goodsName);
json.put("totalNum",advanceDetailVO.getQuantity());
BigDecimal weight = advanceDetailVO.getWeight();
if(Objects.isNull(weight)){
weight = BigDecimal.ZERO;
}
json.put("totalWeight",advanceDetailVO.getWeight());
json.put("totalVolume",advanceDetailVO.getVolume());
BigDecimal volume = advanceDetailVO.getVolume();
if(Objects.isNull(volume)){
volume = BigDecimal.ZERO;
}
json.put("totalVolume",volume);
WarehouseWayBillDetail warehouseWayBillDetail = detailsMap.get(goodsName);
if(!Objects.isNull(warehouseWayBillDetail)){
@ -404,9 +418,13 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService {
if(num > 0){
json.put("freightFee",warehouseWayBillDetail.getPrice());
openPrice = openPrice.add(warehouseWayBillDetail.getPrice());
BigDecimal deliveryPrice = warehouseWayBillDetail.getDeliveryPrice();
if(Objects.isNull(deliveryPrice)){
deliveryPrice = BigDecimal.ZERO;
}
json.put("deliveryFee",warehouseWayBillDetail.getDeliveryPrice());
json.put("deliveryServiceFee",warehouseWayBillDetail.getDeliveryPrice());
openPrice = openPrice.add(warehouseWayBillDetail.getDeliveryPrice());
openPrice = openPrice.add(deliveryPrice);
warehouseWayBillDetail.setNum(num-1);
detailsMap.put(goodsName,warehouseWayBillDetail);
}
@ -434,7 +452,7 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService {
json.put("dPay",dPayPrice);
json.put("hPay",hPayPrice);
json.put("yPay",yPayPrice);
openPrice = openPrice.add(installPrice).add(insurancePrice).add(claimingPrice).add(otherPrice).add(rebatePrice).add(thirdOperationPrice).add(xPayPrice).add(dPayPrice).add(hPayPrice).add(yPayPrice);
openPrice = openPrice.add(installPrice).add(insurancePrice).add(claimingPrice).add(otherPrice).add(rebatePrice).add(thirdOperationPrice);
json.put("openPrice",openPrice);
jsonList.add(json);
});
@ -450,29 +468,41 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService {
// 使用 BigDecimal 的 add 方法来正确累加总价,确保精度
otherTotalPriceList.add(warehouseWayBillDetail.getPrice().multiply(new BigDecimal(num)));
otherTotalDeliveryPriceList.add(warehouseWayBillDetail.getDeliveryPrice().multiply(new BigDecimal(num)));
BigDecimal deliveryPrice = warehouseWayBillDetail.getDeliveryPrice();
if(Objects.isNull(deliveryPrice)){
deliveryPrice = BigDecimal.ZERO;
}
otherTotalDeliveryPriceList.add(deliveryPrice.multiply(new BigDecimal(num)));
}
});
int otherNum = atomicOtherNum.get();
BigDecimal p = BigDecimal.ZERO;
BigDecimal dp = BigDecimal.ZERO;
//otherTotalPriceList元素求和
BigDecimal otherTotalPrice = otherTotalPriceList.stream().reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal p = otherTotalPrice.divide(new BigDecimal(otherNum), 2, RoundingMode.HALF_UP);
BigDecimal otherTotalDeliveryPrice = otherTotalDeliveryPriceList.stream().reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal dp = otherTotalDeliveryPrice.divide(new BigDecimal(otherNum), 2, RoundingMode.HALF_UP);
if(otherNum > 0){
BigDecimal otherTotalPrice = otherTotalPriceList.stream().reduce(BigDecimal.ZERO, BigDecimal::add);
p = otherTotalPrice.divide(new BigDecimal(otherNum), 2, RoundingMode.HALF_UP);
BigDecimal otherTotalDeliveryPrice = otherTotalDeliveryPriceList.stream().reduce(BigDecimal.ZERO, BigDecimal::add);
dp = otherTotalDeliveryPrice.divide(new BigDecimal(otherNum), 2, RoundingMode.HALF_UP);
}
BigDecimal finalP = p;
BigDecimal finalDp = dp;
jsonList.forEach(json -> {
BigDecimal op = json.getBigDecimal("openPrice");
BigDecimal freightFee = json.getBigDecimal("freightFee");
if(Objects.isNull(freightFee)){
json.put("freightFee",p);
op = op.add(p);
json.put("freightFee", finalP);
op = op.add(finalP);
}
BigDecimal deliveryFee = json.getBigDecimal("deliveryFee");
if(Objects.isNull(deliveryFee)){
json.put("deliveryFee",dp);
json.put("deliveryServiceFee",dp);
op = op.add(dp);
json.put("deliveryFee", finalDp);
json.put("deliveryServiceFee", finalDp);
op = op.add(finalDp);
}
json.put("openPrice",op);
});

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

@ -178,6 +178,16 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
areaId = badeRegionAreaId;
}
openOrderVO.setDefaultDeliveryWay("2");
Integer typeService = basicdataClientEntity.getTypeService();
if (typeService == 1){
openOrderVO.setDefaultDeliveryWay("2");
}else if(typeService == 2){
openOrderVO.setDefaultDeliveryWay("3");
}else if(typeService == 3){
openOrderVO.setDefaultDeliveryWay("1");
}
openOrderVO.setDeparture(name);
openOrderVO.setDepartureCode(areaId);
openOrderVO.setDepartureArray(departureArray);
@ -197,9 +207,12 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
openOrderVO.setConsigneeMobile(basicdataClientEntity.getPhone());
openOrderVO.setConsigneeAddress(basicdataClientEntity.getDetailedly());
if(!Objects.isNull(advanceEntity)){
openOrderVO.setConsigneeName(advanceEntity.getConsigneePerson());
openOrderVO.setConsigneeMobile(advanceEntity.getConsigneeMobile());
openOrderVO.setConsigneeAddress(advanceEntity.getConsigneeAddress());
String consigneePerson = advanceEntity.getConsigneePerson();
if(!StringUtil.isBlank(consigneePerson)){
openOrderVO.setConsigneeName(consigneePerson);
openOrderVO.setConsigneeMobile(advanceEntity.getConsigneeMobile());
openOrderVO.setConsigneeAddress(advanceEntity.getConsigneeAddress());
}
}
List<String> destinationArray = new ArrayList<>();
@ -3128,6 +3141,21 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
return R.success("作废成功");
}
@Override
public R findWaybillDes(Long departureWarehouseId, Long consigneeId) {
Map<String,Object> map = new HashMap<>();
map.put("destinationWarehouseId",null);
map.put("destinationWarehouseName",null);
BasicdataStorageServicesEntity basicdataStorageServicesEntity = basicdataStorageServicesClient.findEntityBySendWarehouseIdAndClientId(departureWarehouseId, consigneeId);
if (!Objects.isNull(basicdataStorageServicesEntity)) {
map.put("destinationWarehouseId",basicdataStorageServicesEntity.getServeWarehouseId());
map.put("destinationWarehouseName",basicdataStorageServicesEntity.getServeWarehouseName());
}
return R.data(map);
}
private List<EditOrderMsgVO> verifyData(OpenOrderDTO openOrderDTO, WarehouseWaybillEntity waybillEntity) {
log.info("###################verifyData: 验证改单数据");
StringBuilder stringBuilder = new StringBuilder();

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

@ -2938,6 +2938,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.fail(405, "订单信息不存在");
}
BasicdataWarehouseEntity finalNode = basicdataWarehouseClient.getEntityWarehouseId(finalNodeId);
TrunklineCarsLoadScanEntity carsLoadScanEntity = new TrunklineCarsLoadScanEntity();
carsLoadScanEntity.setLoadId(loadId);
carsLoadScanEntity.setLoadCode(carsLoadEntity.getCarsNo());
@ -2955,8 +2958,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setFromWarehouseId(warehouseId);
carsLoadScanEntity.setUnloadNum(0);
carsLoadScanEntity.setFinalNodeId(finalNodeId);
if(!Objects.isNull(finalNode)){
carsLoadScanEntity.setFinalNodeName(finalNode.getName());
}
carsLoadScanEntity.setRemark("零担补录异常装车");
carsLoadScanEntity.setUnloadCheck(0);
carsLoadScanEntity.setLoadingUserName(AuthUtil.getNickName());
carsLoadScanEntity.setIsSupple(1);
trunklineCarsLoadScanService.save(carsLoadScanEntity);
@ -4065,6 +4072,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setUnloadNum(1);
carsLoadScanEntity.setSignTime(date);
carsLoadScanEntity.setSignAbnormal(1);
carsLoadScanEntity.setSignUserName(AuthUtil.getNickName());
carsLoadScanEntity.setSignOrderId(signOrderId);
carsLoadScanEntity.setUnloadTime(date);
carsLoadScanEntity.setRemark("无数据签收");
@ -4107,6 +4115,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setUnloadNum(1);
carsLoadScanEntity.setSignTime(date);
carsLoadScanEntity.setSignAbnormal(1);
carsLoadScanEntity.setSignUserName(AuthUtil.getNickName());
carsLoadScanEntity.setSignOrderId(signOrderId);
carsLoadScanEntity.setUnloadTime(date);
carsLoadScanEntity.setRemark("有数据异常签收");
@ -4168,6 +4177,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setScanStatus("3");
carsLoadScanEntity.setUnloadNum(1);
carsLoadScanEntity.setSignTime(date);
carsLoadScanEntity.setSignUserName(AuthUtil.getNickName());
carsLoadScanEntity.setSignOrderId(signOrderId);
carsLoadScanEntity.setUnloadTime(date);
trunklineCarsLoadScanService.updateById(carsLoadScanEntity);
@ -4325,7 +4335,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
if (!list.isEmpty()) {
//排除list中scanStatus = 1的数据
list = list.stream().filter(e -> !"1".equals(e.getScanStatus())).collect(Collectors.toList());
list = list.stream().filter(e -> "1".equals(e.getScanStatus())).collect(Collectors.toList());
List<String> orderPackageCodes = new ArrayList<>();
@ -4340,6 +4350,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
entity.setScanStatus("3");
entity.setUnloadNum(t.getNum());
entity.setSignTime(date);
entity.setSignUserName(AuthUtil.getNickName());
entity.setUnloadTime(date);
if (entity.getType().equals(1)) {
String scanCode = entity.getScanCode();

5
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java

@ -15,6 +15,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.annotations.RepeatSubmit;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.StringUtil;
@ -184,6 +185,7 @@ public class WarehouseUpdownTypeApiController {
}
@RepeatSubmit
@ResponseBody
@PostMapping("/upShelfOrder")
@ApiOperationSupport(order = 1)
@ -224,6 +226,7 @@ public class WarehouseUpdownTypeApiController {
}
@RepeatSubmit
@ResponseBody
@PostMapping("/upShelfPackage")
@ApiOperationSupport(order = 1)
@ -263,6 +266,7 @@ public class WarehouseUpdownTypeApiController {
}
@RepeatSubmit
@ResponseBody
@PostMapping("/upShelfTray")
@ApiOperationSupport(order = 1)
@ -428,6 +432,7 @@ public class WarehouseUpdownTypeApiController {
}
}
@RepeatSubmit
@ResponseBody
@PostMapping("/upShelfStockList")
@ApiOperationSupport(order = 1)

5
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/config/InterceptorAdapterConfig.java

@ -1,6 +1,7 @@
package com.logpm.warehouse.config;
import com.logpm.warehouse.config.interceptor.LocalServerLoginAccountsInterceptor;
import com.logpm.warehouse.interceptor.ParameterCombinationInterceptor;
import lombok.AllArgsConstructor;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.redis.lock.RedisLockClient;
@ -23,5 +24,9 @@ public class InterceptorAdapterConfig implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry interceptorRegistry) {
interceptorRegistry.addInterceptor(new LocalServerLoginAccountsInterceptor(redis,environment,redisLockClient)).addPathPatterns("/oldpush/**").order(1);
interceptorRegistry.addInterceptor(new ParameterCombinationInterceptor())
.addPathPatterns("/**");
}
}

66
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/interceptor/ParameterCombinationInterceptor.java

@ -0,0 +1,66 @@
package com.logpm.warehouse.interceptor;
import org.apache.commons.codec.digest.DigestUtils;
import org.springblade.common.annotations.RepeatSubmit;
import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
import java.util.stream.Collectors;
@Component
public class ParameterCombinationInterceptor implements HandlerInterceptor {
private static final ThreadLocal<String> PROCESSED_REQUEST_HASH = new ThreadLocal<>();
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
if (handler instanceof HandlerMethod) {
HandlerMethod hm = (HandlerMethod) handler;
RepeatSubmit annotation = hm.getMethodAnnotation(RepeatSubmit.class);
if (annotation != null) {
// 计算当前请求参数的MD5哈希值
String currentRequestHash = calculateRequestHash(request.getParameterMap());
// 检查是否已处理过相同参数组合的请求
if (PROCESSED_REQUEST_HASH.get() != null && PROCESSED_REQUEST_HASH.get().equals(currentRequestHash)) {
// 阻止重复提交
response.sendError(HttpServletResponse.SC_CONFLICT, "Duplicate submit detected");
return false;
}
// 保存当前请求的哈希值
PROCESSED_REQUEST_HASH.set(currentRequestHash);
}
}
return true;
}
@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
// 清理当前请求的哈希值
PROCESSED_REQUEST_HASH.remove();
}
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
// 可选清理操作,postHandle中已处理
}
/**
* 计算请求参数的MD5哈希值
* @param parameters 请求参数Map
* @return 参数哈希值字符串
*/
private String calculateRequestHash(Map<String, String[]> parameters) {
// 将参数按key排序并拼接为字符串
String sortedParams = parameters.entrySet().stream()
.sorted(Map.Entry.comparingByKey())
.map(entry -> entry.getKey() + "=" + String.join(",", entry.getValue()))
.collect(Collectors.joining("&"));
// 计算并返回MD5摘要
return DigestUtils.md5Hex(sortedParams);
}
}
Loading…
Cancel
Save