Browse Source

Merge remote-tracking branch 'origin/dev' into pre-production

pre-production
汤建军 2 months ago
parent
commit
9afac28aa8
  1. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java
  2. 24
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  3. 28
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverAddListener.java
  4. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverListener.java
  5. 20
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java

@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.dto.DistributionStockArticleOweDTO; import com.logpm.distribution.dto.DistributionStockArticleOweDTO;
import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionStockArticleEntity; import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.excel.DistributionStockArticleExcel;
import com.logpm.distribution.vo.*; import com.logpm.distribution.vo.*;
import com.logpm.distribution.vo.app.queryOrderVO; import com.logpm.distribution.vo.app.queryOrderVO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -54,7 +55,7 @@ public interface DistributionStockArticleMapper extends BaseMapper<DistributionS
* @param * @param
* @return * @return
*/ */
List<DistributionStockArticleEntity> exportDistributionStockArticle(@Param("param") Map<String, Object> paramMap); List<DistributionStockArticleExcel> exportDistributionStockArticle(@Param("param") Map<String, Object> paramMap);
void addHandQuantity(@Param("id") Long id,@Param("num") int num); void addHandQuantity(@Param("id") Long id,@Param("num") int num);

24
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml

@ -899,14 +899,15 @@
WHERE ldsa.id = #{stockArticleId} AND ldpl.is_transfer = 0 WHERE ldsa.id = #{stockArticleId} AND ldpl.is_transfer = 0
</select> </select>
<select id="exportDistributionStockArticle" <select id="exportDistributionStockArticle"
resultType="com.logpm.distribution.entity.DistributionStockArticleEntity"> resultType="com.logpm.distribution.excel.DistributionStockArticleExcel">
select ldsa.id, SELECT
ldsa.id,
ldsa.tenant_id, ldsa.tenant_id,
ldsa.create_user, ldsa.create_user,
ldsa.create_time, ldsa.create_time,
ldsa.update_user, ldsa.update_user,
ldsa.update_time, ldsa.update_time,
ldsa.status, ldsa.STATUS,
ldsa.is_deleted, ldsa.is_deleted,
ldsa.create_dept, ldsa.create_dept,
ldsa.incoming_num, ldsa.incoming_num,
@ -963,7 +964,7 @@
ldsa.available_quantity, ldsa.available_quantity,
ldsa.is_have_data, ldsa.is_have_data,
ldsa.stock_article_code, ldsa.stock_article_code,
group_concat(DISTINCT ldpl.dealer_name) as dealerName, group_concat( DISTINCT ldpl.dealer_name ) AS dealerName,
ldsa.dealer_code, ldsa.dealer_code,
ldsa.train_number, ldsa.train_number,
ldsa.factory_train, ldsa.factory_train,
@ -974,14 +975,22 @@
ldsa.accept_warehouse_id, ldsa.accept_warehouse_id,
ldsa.accept_warehouse_name, ldsa.accept_warehouse_name,
ldsa.order_delivery_status, ldsa.order_delivery_status,
group_concat(DISTINCT ldpl.pallet ) as trays, group_concat( DISTINCT ldpl.pallet ) AS trays,
group_concat(DISTINCT ldpl.goods_allocation) as allocation group_concat( DISTINCT ldpl.goods_allocation ) AS allocation,
IF(ldsa.total_number > 0 AND ldsa.incoming_num > 0,ldsa.total_number - ldsa.incoming_num,0) AS unreceivedQuantity,
CASE ldsa.is_zero
WHEN 0 THEN '否'
WHEN 1 THEN '是'
ELSE
'未知'
END isZeroString
from logpm_distribution_stock_article ldsa from logpm_distribution_stock_article ldsa
left join logpm_distribution_parcel_list ldpl on ldsa.id = ldpl.stock_article_id left join logpm_distribution_parcel_list ldpl on ldsa.id = ldpl.stock_article_id
<where> <where>
ldsa.is_deleted = 0 and ldsa.order_status IN ( '10', '20', '30', '40', '50', '60', '70' ) ldsa.is_deleted = 0 and ldsa.order_status IN ( '10', '20', '30', '40', '50', '60', '70' )
and ldsa.hand_quantity > 0 and ldsa.hand_quantity > 0
and ldsa.genre = '1' and ldsa.genre = '1'
AND ldpl.is_transfer = 0
<if test="param.warehouseId != null and param.warehouseId != ''"> <if test="param.warehouseId != null and param.warehouseId != ''">
and ldsa.warehouse_id = #{param.warehouseId} and ldsa.warehouse_id = #{param.warehouseId}
</if> </if>
@ -999,6 +1008,9 @@
<if test="param.typeService != null and param.typeService != ''">and ldsa.type_service = <if test="param.typeService != null and param.typeService != ''">and ldsa.type_service =
#{param.typeService} #{param.typeService}
</if> </if>
<if test="param.brand != null and param.brand != ''">and ldsa.brand
like CONCAT(#{param.brand},'%')
</if>
<if test="param.consigneeUnit != null and param.consigneeUnit != ''">and ldsa.consignee_unit = <if test="param.consigneeUnit != null and param.consigneeUnit != ''">and ldsa.consignee_unit =
#{param.consigneeUnit} #{param.consigneeUnit}
</if> </if>

28
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverAddListener.java

@ -23,7 +23,9 @@ import com.logpm.distribution.service.IDistributionStockArticleService;
import com.logpm.distribution.service.IDistributionStockListInfoService; import com.logpm.distribution.service.IDistributionStockListInfoService;
import com.logpm.distribution.service.IDistributionStockListService; import com.logpm.distribution.service.IDistributionStockListService;
import com.logpm.distribution.service.IQualityDeliverService; import com.logpm.distribution.service.IQualityDeliverService;
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
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;
@ -34,6 +36,7 @@ import org.jetbrains.annotations.Nullable;
import org.springblade.common.enums.BizOperationEnums; import org.springblade.common.enums.BizOperationEnums;
import org.springblade.common.enums.PackageTypeEnums; import org.springblade.common.enums.PackageTypeEnums;
import org.springblade.core.redis.cache.BladeRedis; import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.secure.utils.AuthUtil;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -87,6 +90,9 @@ public class QualityDeliverAddListener implements ReportService {
@Resource @Resource
private DistributionProperties destinationProperties; private DistributionProperties destinationProperties;
@Resource
private ITrunklineWaybillOrderClient waybillOrderClient;
@Transactional @Transactional
public void buildReport(String msg) { public void buildReport(String msg) {
ReportQualityDeliverDTO bean = JSONUtil.toBean(msg, ReportQualityDeliverDTO.class); ReportQualityDeliverDTO bean = JSONUtil.toBean(msg, ReportQualityDeliverDTO.class);
@ -265,6 +271,7 @@ public class QualityDeliverAddListener implements ReportService {
private void buildCmpBasicInfo(QualityDeliverEntity qualityDeliverEntity, DistributionParcelListEntity parcelListEntity) { private void buildCmpBasicInfo(QualityDeliverEntity qualityDeliverEntity, DistributionParcelListEntity parcelListEntity) {
if (ObjectUtil.isNotEmpty(parcelListEntity)) { if (ObjectUtil.isNotEmpty(parcelListEntity)) {
String orderCode = parcelListEntity.getOrderCode();
// 品牌 // 品牌
qualityDeliverEntity.setBrandName(parcelListEntity.getBrandName()); qualityDeliverEntity.setBrandName(parcelListEntity.getBrandName());
// 商场id // 商场id
@ -303,6 +310,8 @@ public class QualityDeliverAddListener implements ReportService {
qualityDeliverEntity.setEndWarehouseInTime(parcelListEntity.getWarehouseEntryTimeEnd()); qualityDeliverEntity.setEndWarehouseInTime(parcelListEntity.getWarehouseEntryTimeEnd());
// 构建运单相关信息 // 构建运单相关信息
buildWaybillInfo(qualityDeliverEntity, waybillNumber); buildWaybillInfo(qualityDeliverEntity, waybillNumber);
// 设置订单运单总数
buildOrderWaybillNumber(qualityDeliverEntity, orderCode, waybillNumber);
} }
// 暂存单查询结算品类 // 暂存单查询结算品类
// TrunklineAdvanceDetailEntity advanceDetailEntity = advanceDetailClient.findEntityByOrderPackageCode(qualityDeliverEntity.getOrderPackageCode()); // TrunklineAdvanceDetailEntity advanceDetailEntity = advanceDetailClient.findEntityByOrderPackageCode(qualityDeliverEntity.getOrderPackageCode());
@ -316,6 +325,22 @@ public class QualityDeliverAddListener implements ReportService {
buildOrderInfo(qualityDeliverEntity, qualityDeliverEntity.getWarehouseId(), qualityDeliverEntity.getOrderCode()); buildOrderInfo(qualityDeliverEntity, qualityDeliverEntity.getWarehouseId(), qualityDeliverEntity.getOrderCode());
} }
private void buildOrderWaybillNumber(QualityDeliverEntity qualityDeliverEntity, String orderCode, String waybillNumber) {
if (StrUtil.isNotEmpty(orderCode) && StrUtil.isNotEmpty(waybillNumber)) {
String key = AuthUtil.getTenantId() + ":" + "logpm-distribution:" + "OrderWaybill:" + orderCode + "_" + waybillNumber;
Integer totalNumber = redisCache.get(key);
if (ObjectUtil.isNotEmpty(totalNumber)) {
qualityDeliverEntity.setOrderWaybillNumber(totalNumber);
} else {
TrunklineWaybillOrderEntity entityByWaybillNoAndOrderCode = waybillOrderClient.findEntityByWaybillNoAndOrderCode(waybillNumber, orderCode);
if (ObjectUtil.isNotEmpty(entityByWaybillNoAndOrderCode)) {
qualityDeliverEntity.setOrderWaybillNumber(entityByWaybillNoAndOrderCode.getTotalNumber());
}
redisCache.setEx(key, entityByWaybillNoAndOrderCode.getTotalNumber(), 60L);
}
}
}
private void buildOrderInfo(QualityDeliverEntity qualityDeliverEntity, Long warehouseId, String orderCode) { private void buildOrderInfo(QualityDeliverEntity qualityDeliverEntity, Long warehouseId, String orderCode) {
DistributionStockArticleEntity stockArticleEntity = getDistributionStockArticleEntity(warehouseId, orderCode); DistributionStockArticleEntity stockArticleEntity = getDistributionStockArticleEntity(warehouseId, orderCode);
if (ObjectUtil.isNotEmpty(stockArticleEntity)) { if (ObjectUtil.isNotEmpty(stockArticleEntity)) {
@ -342,6 +367,9 @@ public class QualityDeliverAddListener implements ReportService {
} }
private DistributionStockArticleEntity getDistributionStockArticleEntity(Long warehouseId, String orderCode) { private DistributionStockArticleEntity getDistributionStockArticleEntity(Long warehouseId, String orderCode) {
if (StrUtil.isEmpty(orderCode)) {
return null;
}
String key = "report:qualityDeliver:stockArticle:" + warehouseId + "_" + orderCode; String key = "report:qualityDeliver:stockArticle:" + warehouseId + "_" + orderCode;
String obj = redisCache.get(key); String obj = redisCache.get(key);
if (StrUtil.isNotEmpty(obj)) { if (StrUtil.isNotEmpty(obj)) {

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverListener.java

@ -287,8 +287,8 @@ public class QualityDeliverListener implements ReportService {
} }
private void buildCmpBasicInfo(QualityDeliverEntity qualityDeliverEntity, DistributionParcelListEntity parcelListEntity) { private void buildCmpBasicInfo(QualityDeliverEntity qualityDeliverEntity, DistributionParcelListEntity parcelListEntity) {
String orderCode = qualityDeliverEntity.getOrderCode();
if (ObjectUtil.isNotEmpty(parcelListEntity)) { if (ObjectUtil.isNotEmpty(parcelListEntity)) {
String orderCode = parcelListEntity.getOrderCode();
// 品牌 // 品牌
qualityDeliverEntity.setBrandName(parcelListEntity.getBrandName()); qualityDeliverEntity.setBrandName(parcelListEntity.getBrandName());
// 商场id // 商场id
@ -330,6 +330,8 @@ public class QualityDeliverListener implements ReportService {
// 设置订单运单总数 // 设置订单运单总数
buildOrderWaybillNumber(qualityDeliverEntity, orderCode, waybillNumber); buildOrderWaybillNumber(qualityDeliverEntity, orderCode, waybillNumber);
// 构建订单相关信息
buildOrderInfo(qualityDeliverEntity, qualityDeliverEntity.getWarehouseId(), orderCode);
} }
// 暂存单查询结算品类 // 暂存单查询结算品类
// TrunklineAdvanceDetailEntity advanceDetailEntity = advanceDetailClient.findEntityByOrderPackageCode(qualityDeliverEntity.getOrderPackageCode()); // TrunklineAdvanceDetailEntity advanceDetailEntity = advanceDetailClient.findEntityByOrderPackageCode(qualityDeliverEntity.getOrderPackageCode());
@ -339,8 +341,6 @@ public class QualityDeliverListener implements ReportService {
// qualityDeliverEntity.setRevenueCategoryId(advanceDetailEntity.getIncomeCategoryId()); // qualityDeliverEntity.setRevenueCategoryId(advanceDetailEntity.getIncomeCategoryId());
// qualityDeliverEntity.setRevenueCategory(advanceDetailEntity.getIncomeCategoryName()); // qualityDeliverEntity.setRevenueCategory(advanceDetailEntity.getIncomeCategoryName());
// } // }
// 构建订单相关信息
buildOrderInfo(qualityDeliverEntity, qualityDeliverEntity.getWarehouseId(), orderCode);
} }
private void buildOrderWaybillNumber(QualityDeliverEntity qualityDeliverEntity, String orderCode, String waybillNumber) { private void buildOrderWaybillNumber(QualityDeliverEntity qualityDeliverEntity, String orderCode, String waybillNumber) {
@ -354,7 +354,7 @@ public class QualityDeliverListener implements ReportService {
if (ObjectUtil.isNotEmpty(entityByWaybillNoAndOrderCode)) { if (ObjectUtil.isNotEmpty(entityByWaybillNoAndOrderCode)) {
qualityDeliverEntity.setOrderWaybillNumber(entityByWaybillNoAndOrderCode.getTotalNumber()); qualityDeliverEntity.setOrderWaybillNumber(entityByWaybillNoAndOrderCode.getTotalNumber());
} }
redisCache.set(key, entityByWaybillNoAndOrderCode.getTotalNumber()); redisCache.setEx(key, entityByWaybillNoAndOrderCode.getTotalNumber(), 30L);
} }
} }
} }

20
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java

@ -189,26 +189,10 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
paramMap.put("tenantId", tenantId); paramMap.put("tenantId", tenantId);
paramMap.put("orderIds", idArr); paramMap.put("orderIds", idArr);
List<DistributionStockArticleEntity> list = baseMapper.exportDistributionStockArticle(paramMap); List<DistributionStockArticleExcel> list = baseMapper.exportDistributionStockArticle(paramMap);
List<DistributionStockArticleExcel> excelList = new ArrayList<>();
//
list.forEach(li -> {
DistributionStockArticleVO distributionStockArticleVO = buildVo(li);
DistributionStockArticleExcel excel = new DistributionStockArticleExcel();
assert distributionStockArticleVO != null;
if (distributionStockArticleVO.getTotalNumber() != null &&
distributionStockArticleVO.getIncomingNum() != null) {
distributionStockArticleVO.setUnreceivedQuantity(
distributionStockArticleVO.getTotalNumber() - distributionStockArticleVO.getIncomingNum()
);
}
BeanUtil.copyProperties(distributionStockArticleVO, excel);
excel.setIsZeroString("1".equals(distributionStockArticleVO.getIsZero()) ? "是" : "否");
excelList.add(excel);
});
return excelList; return list;
} }
@Override @Override

Loading…
Cancel
Save