Browse Source

Merge branch 'dev' into pre-production

master
pref_mail@163.com 9 months ago
parent
commit
de55c8044a
  1. 274
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceDetailEntity.java
  2. 2
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAbnormalPackageMapper.java
  3. 7
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAbnormalPackageMapper.xml
  4. 15
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalPackageServiceImpl.java
  5. 28
      blade-service/logpm-factory/src/main/java/com/logpm/factory/aspect/AsyncAnnotationAspect.java
  6. 1
      blade-service/logpm-factory/src/main/java/com/logpm/factory/config/ExecutorConfig.java
  7. 21
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/AdvanceOrderListener.java

274
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceDetailEntity.java

@ -15,110 +15,178 @@ import java.math.BigDecimal;
@EqualsAndHashCode(callSuper = true)
public class TrunklineAdvanceDetailEntity extends TenantEntity {
/** 预留1 */
@ApiModelProperty(name = "预留1",notes = "")
private String reserve1 ;
/** 预留2 */
@ApiModelProperty(name = "预留2",notes = "")
private String reserve2 ;
/** 预留3 */
@ApiModelProperty(name = "预留3",notes = "")
private String reserve3 ;
/** 预留4 */
@ApiModelProperty(name = "预留4",notes = "")
private String reserve4 ;
/** 预留5 */
@ApiModelProperty(name = "预留5",notes = "")
private String reserve5 ;
/** 仓库id */
@ApiModelProperty(name = "仓库id",notes = "")
private Long warehouseId ;
/** 仓库名称 */
@ApiModelProperty(name = "仓库名称",notes = "")
private String warehouseName ;
/** 仓库id */
@ApiModelProperty(name = "导入仓库id",notes = "")
private Long incomingWarehouseId ;
/** 仓库名称 */
@ApiModelProperty(name = "导入仓库名称",notes = "")
private String incomingWarehouseName ;
/** 暂存单id */
@ApiModelProperty(name = "暂存单id",notes = "")
private Long advanceId ;
/** 订单自编号 */
@ApiModelProperty(name = "订单自编号",notes = "")
private String orderCode ;
/** 品牌 */
@ApiModelProperty(name = "品牌",notes = "")
private String brand ;
/** 订单来源 */
@ApiModelProperty(name = "订单来源",notes = "")
private String systemType ;
/** 一级品类名称 */
@ApiModelProperty(name = "一级品类名称",notes = "")
private String firstPackName ;
/** 一级品类编码 */
@ApiModelProperty(name = "一级品类编码",notes = "")
private String firstPackCode ;
/** 二级品类名称 */
@ApiModelProperty(name = "二级品类名称",notes = "")
private String secondPackName ;
/** 二级品类编码 */
@ApiModelProperty(name = "二级品类编码",notes = "")
private String secondPackCode ;
/** 三级品类名称 */
@ApiModelProperty(name = "三级品类名称",notes = "")
private String thirdPackName ;
/** 三级品类编码 */
@ApiModelProperty(name = "三级品类编码",notes = "")
private String thirdPackCode ;
/** 基地名称 */
@ApiModelProperty(name = "基地名称",notes = "")
private String siteName ;
/** 基地编码 */
@ApiModelProperty(name = "基地编码",notes = "")
private String siteCode ;
/** 数量 */
@ApiModelProperty(name = "数量",notes = "")
private Integer quantity ;
/** 包件码 */
@ApiModelProperty(name = "包件码",notes = "")
private String orderPackageCode ;
/** 车次号 */
@ApiModelProperty(name = "车次号",notes = "")
private String trainNumber ;
/** 服务号 */
@ApiModelProperty(name = "服务号",notes = "")
private String serviceNum ;
/** 运单id */
@ApiModelProperty(name = "运单id",notes = "")
private Long waybillId ;
/** 运单号 */
@ApiModelProperty(name = "运单号",notes = "")
private String waybillNo ;
/** 包件状态 */
@ApiModelProperty(name = "包件状态 0未入库 1已入库",notes = "")
private String packageStatus ;
/**
* 预留1 金牌包条重复时设置为1
*/
@ApiModelProperty(name = "预留1", notes = "")
private String reserve1;
/**
* 预留2
*/
@ApiModelProperty(name = "预留2", notes = "")
private String reserve2;
/**
* 预留3
*/
@ApiModelProperty(name = "预留3", notes = "")
private String reserve3;
/**
* 预留4
*/
@ApiModelProperty(name = "预留4", notes = "")
private String reserve4;
/**
* 预留5
*/
@ApiModelProperty(name = "预留5", notes = "")
private String reserve5;
/**
* 仓库id
*/
@ApiModelProperty(name = "仓库id", notes = "")
private Long warehouseId;
/**
* 仓库名称
*/
@ApiModelProperty(name = "仓库名称", notes = "")
private String warehouseName;
/**
* 仓库id
*/
@ApiModelProperty(name = "导入仓库id", notes = "")
private Long incomingWarehouseId;
/**
* 仓库名称
*/
@ApiModelProperty(name = "导入仓库名称", notes = "")
private String incomingWarehouseName;
/**
* 暂存单id
*/
@ApiModelProperty(name = "暂存单id", notes = "")
private Long advanceId;
/**
* 订单自编号
*/
@ApiModelProperty(name = "订单自编号", notes = "")
private String orderCode;
/**
* 品牌
*/
@ApiModelProperty(name = "品牌", notes = "")
private String brand;
/**
* 订单来源
*/
@ApiModelProperty(name = "订单来源", notes = "")
private String systemType;
/**
* 一级品类名称
*/
@ApiModelProperty(name = "一级品类名称", notes = "")
private String firstPackName;
/**
* 一级品类编码
*/
@ApiModelProperty(name = "一级品类编码", notes = "")
private String firstPackCode;
/**
* 二级品类名称
*/
@ApiModelProperty(name = "二级品类名称", notes = "")
private String secondPackName;
/**
* 二级品类编码
*/
@ApiModelProperty(name = "二级品类编码", notes = "")
private String secondPackCode;
/**
* 三级品类名称
*/
@ApiModelProperty(name = "三级品类名称", notes = "")
private String thirdPackName;
/**
* 三级品类编码
*/
@ApiModelProperty(name = "三级品类编码", notes = "")
private String thirdPackCode;
/**
* 基地名称
*/
@ApiModelProperty(name = "基地名称", notes = "")
private String siteName;
/**
* 基地编码
*/
@ApiModelProperty(name = "基地编码", notes = "")
private String siteCode;
/**
* 数量
*/
@ApiModelProperty(name = "数量", notes = "")
private Integer quantity;
/**
* 包件码
*/
@ApiModelProperty(name = "包件码", notes = "")
private String orderPackageCode;
/**
* 车次号
*/
@ApiModelProperty(name = "车次号", notes = "")
private String trainNumber;
/**
* 服务号
*/
@ApiModelProperty(name = "服务号", notes = "")
private String serviceNum;
/**
* 运单id
*/
@ApiModelProperty(name = "运单id", notes = "")
private Long waybillId;
/**
* 运单号
*/
@ApiModelProperty(name = "运单号", notes = "")
private String waybillNo;
/**
* 包件状态
*/
@ApiModelProperty(name = "包件状态 0未入库 1已入库", notes = "")
private String packageStatus;
/** 物料id */
@ApiModelProperty(name = "物料id",notes = "")
private Long materialId ;
/** 物料编码 */
@ApiModelProperty(name = "物料编码",notes = "")
private String materialCode ;
/** 物料名称 */
@ApiModelProperty(name = "物料名称",notes = "")
private String materialName ;
/** 重量 */
@ApiModelProperty(name = "重量",notes = "")
private BigDecimal weight ;
/** 体积 */
@ApiModelProperty(name = "体积",notes = "")
private BigDecimal volume ;
/** 计价方式 1件 2方 3公斤 */
@ApiModelProperty(name = "计价方式 1件 2方 3公斤",notes = "")
private Integer chargeType ;
@ApiModelProperty(name = "例放补进",notes = "")
/**
* 物料id
*/
@ApiModelProperty(name = "物料id", notes = "")
private Long materialId;
/**
* 物料编码
*/
@ApiModelProperty(name = "物料编码", notes = "")
private String materialCode;
/**
* 物料名称
*/
@ApiModelProperty(name = "物料名称", notes = "")
private String materialName;
/**
* 重量
*/
@ApiModelProperty(name = "重量", notes = "")
private BigDecimal weight;
/**
* 体积
*/
@ApiModelProperty(name = "体积", notes = "")
private BigDecimal volume;
/**
* 计价方式 1件 2方 3公斤
*/
@ApiModelProperty(name = "计价方式 1件 2方 3公斤", notes = "")
private Integer chargeType;
@ApiModelProperty(name = "例放补进", notes = "")
private String supple;
@ApiModelProperty(name = "货运清单号")
private String manifest;

2
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAbnormalPackageMapper.java

@ -58,7 +58,7 @@ public interface AftersalesAbnormalPackageMapper extends BaseMapper<AftersalesAb
* @param aftersalesAbnormalPackageEntity
* @return
*/
List<AftersalesAbnormalPackageVO> getAbnormalPackage(@Param("param") AftersalesAbnormalPackageEntity aftersalesAbnormalPackageEntity);
List<AftersalesAbnormalPackageVO> getAbnormalPackage(@Param("param") AftersalesAbnormalPackageEntity aftersalesAbnormalPackageEntity,@Param("warehouseIds")List<Long> warehouseIds);
List<AftersalesTrunklineVO> getTrunklines(@Param("orderPackageCode") String orderPackageCode);
List<AftersalesDeliverVO> getDeliver(@Param("orderPackageCode") String orderPackageCode);

7
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAbnormalPackageMapper.xml

@ -49,7 +49,12 @@
<where>
ldpl. is_deleted = 0
<if test="param.packageCode != null and param.packageCode != ''"> and ldpl.order_package_code =#{param.packageCode } </if>
<if test="param.warehouseId != null and param.warehouseId != ''"> and ldpl.warehouse_id =#{param.warehouseId } </if>
<if test="warehouseIds !=null ">
and ldpl.warehouse_id in
<foreach collection="warehouseIds" item="id" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
</where>
</select>
<select id="getTrunklines" resultType="com.logpm.aftersales.vo.AftersalesTrunklineVO">

15
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalPackageServiceImpl.java

@ -37,6 +37,8 @@ import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -76,14 +78,19 @@ public class AftersalesAbnormalPackageServiceImpl extends BaseServiceImpl<Afters
*/
@Override
public List<AftersalesAbnormalPackageVO> getAbnormalPackage(Map<String, Object> aftersalesAbnormalPackage, IPage<Object> page) {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
List<Long> warehouseIds = new ArrayList<>();
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
AftersalesAbnormalPackageEntity aftersalesAbnormalPackageEntity = JSONObject.parseObject(JSONObject.toJSONString(aftersalesAbnormalPackage), AftersalesAbnormalPackageEntity.class);
if(ObjectUtils.isNotNull(myCurrentWarehouse)){
aftersalesAbnormalPackageEntity.setWarehouseId(myCurrentWarehouse.getId());
warehouseIds.add(myCurrentWarehouse.getId());
}else{
// 获取全部仓库
for (BasicdataWarehouseEntity basicdataWarehouseEntity : warehouseClient.getMyWarehouseList()) {
warehouseIds.add(basicdataWarehouseEntity.getId());
}
}
List<AftersalesAbnormalPackageVO> abnormalPackage = baseMapper.getAbnormalPackage(aftersalesAbnormalPackageEntity);
List<AftersalesAbnormalPackageVO> abnormalPackage = baseMapper.getAbnormalPackage(aftersalesAbnormalPackageEntity,warehouseIds);
abnormalPackage.forEach(i ->{
if (ObjectUtils.isNotNull(i.getPackageCode())){
i.setTrunklines( baseMapper.getTrunklines(i.getPackageCode()));

28
blade-service/logpm-factory/src/main/java/com/logpm/factory/aspect/AsyncAnnotationAspect.java

@ -43,6 +43,34 @@ import java.util.Objects;
public class AsyncAnnotationAspect {
private final BladeRedis bladeRedis;
private final Environment environment;
@Around("@annotation(org.springframework.scheduling.annotation.Async)")
public Object logAroundAsyncMethods(ProceedingJoinPoint joinPoint) throws Throwable {
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
Method method = signature.getMethod();
Async myAsync = method.getAnnotation(Async.class);
String annotationValue = myAsync.value();
if(StringUtil.isNotBlank(annotationValue) && annotationValue.equals("asyncExecutor")){
// 在方法执行前的操作
String tenantId = AuthUtil.getTenantId();
DynamicDataSourceContextHolder.push(tenantId);
// 执行原方法
Object result = joinPoint.proceed();
// 在方法执行后的操作
DynamicDataSourceContextHolder.poll();
return result;
}else{
return joinPoint.proceed();
}
}
/**
* 该方法为一个切面用于对标记了@RabbitListener注解的方法进行增强主要增加了日志记录和数据源上下文处理的功能
*

1
blade-service/logpm-factory/src/main/java/com/logpm/factory/config/ExecutorConfig.java

@ -64,6 +64,7 @@ public class ExecutorConfig {
}
RequestContextHolder.setRequestAttributes(context);
String tenantId1 = AuthUtil.getTenantId();
log.info(">>>>>>>>>>>>>>>> decorate {}",tenantId1);
runnable.run();
} finally {

21
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/AdvanceOrderListener.java

@ -9,6 +9,7 @@ import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.factorydata.enums.BrandEnums;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.entity.TrunklineDetailProductEntity;
@ -124,7 +125,25 @@ public class AdvanceOrderListener {
TrunklineAdvanceDetailEntity advanceDetailEntity = JSONUtil.toBean(detail, TrunklineAdvanceDetailEntity.class);
if (ObjectUtil.isNotNull(advanceDetailEntity)) {
if (CollUtil.isNotEmpty(packageCodeSet) && packageCodeSet.contains(advanceDetailEntity.getOrderPackageCode())) {
continue;
// 金牌如果是重复包条,则单独处理
if (ObjectUtil.equal(advanceEntity.getBrand(), BrandEnums.JP.getValue())) {
// 金牌按DD单号+包条确定唯一值
List<TrunklineAdvanceDetailEntity> list = advanceDetailService.list(Wrappers.<TrunklineAdvanceDetailEntity>lambdaQuery()
.eq(TrunklineAdvanceDetailEntity::getOrderPackageCode, advanceDetailEntity.getOrderPackageCode())
.eq(TrunklineAdvanceDetailEntity::getOrderCode, advanceEntity.getOrderCode())
);
if (CollUtil.isNotEmpty(list)) {
// 订单+包件重复则不处理这条数据
log.error("金牌,订单+包条码重复,订单:{},包条码:{}", advanceEntity.getOrderCode(), advanceDetailEntity.getOrderPackageCode());
continue;
} else {
// 包件码重复,订单+包件不重复,设置预留字段1 为 1
advanceDetailEntity.setReserve1("1");
}
} else {
log.error("非金牌,包条码重复,包条码:{}", advanceDetailEntity.getOrderPackageCode());
continue;
}
}
advanceDetailEntity.setAdvanceId(advanceEntity.getId());
// 设置发货时间为当前时间

Loading…
Cancel
Save