Browse Source

Merge branch 'dev' into pre-production

master
汤建军 10 months ago
parent
commit
e04e970ca6
  1. 12
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillLadingEntity.java
  2. 8
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistrilbutionBillLadingClient.java
  3. 5
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillLadingViewVO.java
  4. 6
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml
  5. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistrilbutionBillLadingClient.java
  6. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  7. 26
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml
  8. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java
  9. 107
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  10. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  11. 63
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
  12. 81
      blade-service/logpm-factory/src/main/java/com/logpm/factory/jobhandler/MengTianPushDataJob.java
  13. 10
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/MtPushDataMapper.java
  14. 32
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/MtPushDataMapper.xml
  15. 15
      blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java

12
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillLadingEntity.java

@ -161,6 +161,18 @@ public class DistrilbutionBillLadingEntity extends TenantEntity {
@ApiModelProperty(value = "备货库存品数量")
private Integer reserveQuantity;
/**
* 审核人ID
*/
@ApiModelProperty(value = "审核人ID")
private Long examineUserId;
/**
* 审核人名称
*/
@ApiModelProperty(value = "审核人名称")
private String examineUserName;

8
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistrilbutionBillLadingClient.java

@ -54,4 +54,12 @@ public interface IDistrilbutionBillLadingClient {
*/
@GetMapping(TOP+"/clerkBillCheckPushData")
Boolean clerkBillCheckPushData(@RequestParam("id")Long id);
/**
* 推送信息至工厂
* @param ids
* @return
*/
@GetMapping(TOP+"/sendFactorySignforInfo")
Boolean sendFactorySignforInfo(@RequestParam("ids")String ids);
}

5
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillLadingViewVO.java

@ -20,6 +20,11 @@ public class DistrilbutionBillLadingViewVO {
private String consigneeUnit;
private String customerName;
private String customerTelephone;
private Integer planNum;
private Integer realNum;
private String signforUserName;
private String examineTime;
private String examineUserName;
//图片集合
private List<DistributionPrintEntity> printList;

6
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml

@ -154,12 +154,6 @@
<if test="param.typeServiceName != null and param.typeServiceName != ''">
AND lbc.type_ervice = #{param.typeServiceName}
</if>
<!-- <if test="param.contractStartTime != null and param.contractStartTime != ''">-->
<!-- AND DATE_FORMAT(lbc.contract_start_time,, '%Y-%m-%d') > DATE_FORMAT(#{param.contractStartTime}, '%Y-%m-%d')-->
<!-- </if>-->
<!-- <if test="param.contractEntTime != null and param.contractEntTime != ''">-->
<!-- AND DATE_FORMAT(lbc.contract_ent_time,, '%Y-%m-%d') &lt; DATE_FORMAT(#{param.contractEntTime}, '%Y-%m-%d')-->
<!-- </if>-->
<if test="param.brandName != null and param.brandName != ''">
AND t.aaa LIKE CONCAT('%', #{param.brandName}, '%')
</if>

11
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistrilbutionBillLadingClient.java

@ -18,6 +18,7 @@ package com.logpm.distribution.feign;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.entity.DistrilbutionBillLadingEntity;
import com.logpm.distribution.service.IDistributionAsyncService;
import com.logpm.distribution.service.IDistrilbutionBillLadingService;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.BladePage;
@ -40,6 +41,8 @@ public class DistrilbutionBillLadingClient implements IDistrilbutionBillLadingCl
private final IDistrilbutionBillLadingService distrilbutionBillLadingService;
private final IDistributionAsyncService distributionAsyncService;
@Override
@GetMapping(TOP)
public BladePage<DistrilbutionBillLadingEntity> top(Integer current, Integer size) {
@ -55,4 +58,12 @@ public class DistrilbutionBillLadingClient implements IDistrilbutionBillLadingCl
return distrilbutionBillLadingService.clerkBillCheckPushData(id);
}
@Override
public Boolean sendFactorySignforInfo(String ids) {
for (String string : ids.split(",")) {
distributionAsyncService.sendFactorySignforInfo(string);
}
return null;
}
}

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

@ -342,7 +342,7 @@
<select id="getOrderNoList" resultType="com.logpm.distribution.vo.DistributionStockArticleQRCodeVO">
select ldsa.id,ldsa.order_code,ldsa.mall_name ,ldsa.customer_name ,ldsa.customer_telephone ,
ldsa.customer_address ,ldsa.sending,ldpl.waybill_number waybillNumber,
ldsa.accept_warehouse_name as objective ,ldsa.send_warehouse_name departureStation,ldsa.dealer_name
ldpl.accept_warehouse_name as objective ,ldpl.send_warehouse_name departureStation,ldsa.dealer_name
dealerName,ldsa.dealer_code dealerCode,ldsa.total_number totalNumber,
CONCAT_WS('/', IFNULL(ldpl.firsts, ''), IFNULL(ldpl.second, ''), IFNULL(ldpl.third_product, '')) AS category,
CONCAT_WS( '',IFNULL(ldpl.material_name, '')) AS materialName ,ldpl.order_package_code

26
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml

@ -626,7 +626,31 @@
IFNULL(ldbl.consignee,GROUP_CONCAT(
DISTINCT ANY_VALUE ( ldsa.consignee_person ))) AS customerName,
GROUP_CONCAT(
DISTINCT ANY_VALUE ( ldsa.consignee_mobile )) AS customerTelephone
DISTINCT ANY_VALUE ( ldsa.consignee_mobile )) AS customerTelephone,
( SELECT IFNULL( SUM( packet_number ), 0 ) FROM logpm_distrilbution_bill_package WHERE bill_lading_id = ldbl.id AND is_deleted = 0 AND packet_bar_status != 2 ) + (
SELECT
IFNULL( SUM( quantity ), 0 )
FROM
logpm_distribution_reservation_zero_package
WHERE
reservation_id = ldbl.id
AND is_deleted = 0
AND type = 3
AND zero_package_status
) +(
SELECT
IFNULL( sum( num ), 0 )
FROM
logpm_dis_stock_list_detail
WHERE
reservation_id = ldbl.id
AND is_deleted = 0
AND stock_package_status != 2
) AS planNum ,
(SELECT IFNULL(sum(quantity),0) FROM logpm_distribution_bill_lading_scan WHERE bill_lading_id = ldbl.id AND is_deleted = 0 ) AS realNum,
(SELECT GROUP_CONCAT(DISTINCT scan_user) FROM logpm_distribution_bill_lading_scan WHERE bill_lading_id = ldbl.id AND is_deleted = 0 GROUP BY bill_lading_id) AS signforUserName,
IF(ldbl.conditions = 30,ldbl.update_time,'') AS examineTime,
ldbl.examine_user_name AS examineUserName
FROM
logpm_distrilbution_bill_lading ldbl
LEFT JOIN logpm_distrilbution_bill_stock ldbs ON ldbl.id = ldbs.bill_lading_id

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java

@ -1,5 +1,6 @@
package com.logpm.distribution.service;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.business.entity.DistributionBusinessPreOrderEntity;
import com.logpm.distribution.dto.DistributionStockArticleDTO;
@ -20,6 +21,7 @@ import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import org.springblade.common.annotations.ChangeAsync;
import org.springblade.core.secure.BladeUser;
import java.security.NoSuchAlgorithmException;
import java.util.List;
/**
@ -341,4 +343,10 @@ public interface IDistributionAsyncService {
* @param reservationIds
*/
void recordsReservationDeliveryLog(String reservationIds,BasicdataWarehouseEntity warehouse,BladeUser user,String trainNumber,Integer node,String content);
/**
* 自提推送工厂
* @param s
*/
void sendFactorySignforInfo(String s);
}

107
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java

@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.business.entity.DistributionBusinessPreOrderEntity;
@ -20,28 +21,7 @@ import com.logpm.distribution.dto.DistributionStockArticleDTO;
import com.logpm.distribution.dto.app.DistrilbutionloadingscanDTO;
import com.logpm.distribution.dto.app.StockupDTO;
import com.logpm.distribution.dto.app.StockupZeroDTO;
import com.logpm.distribution.entity.DisStockListDetailEntity;
import com.logpm.distribution.entity.DistributionBillLadingScanEntity;
import com.logpm.distribution.entity.DistributionDeliveryDetailsEntity;
import com.logpm.distribution.entity.DistributionDeliveryListEntity;
import com.logpm.distribution.entity.DistributionLoadscanEntity;
import com.logpm.distribution.entity.DistributionLoadscaninvnEntity;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionParcelNumberEntity;
import com.logpm.distribution.entity.DistributionReservationEntity;
import com.logpm.distribution.entity.DistributionReservationPackageEntity;
import com.logpm.distribution.entity.DistributionReservationStockarticleEntity;
import com.logpm.distribution.entity.DistributionReservationStocklistEntity;
import com.logpm.distribution.entity.DistributionReservationZeroPackageEntity;
import com.logpm.distribution.entity.DistributionSignforEntity;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.entity.DistributionStockEntity;
import com.logpm.distribution.entity.DistributionStockListEntity;
import com.logpm.distribution.entity.DistributionStockupEntity;
import com.logpm.distribution.entity.DistributionStockupInfoEntity;
import com.logpm.distribution.entity.DistrilbutionBillLadingEntity;
import com.logpm.distribution.entity.DistrilbutionBillPackageEntity;
import com.logpm.distribution.entity.DistrilbutionBillStockEntity;
import com.logpm.distribution.entity.*;
import com.logpm.distribution.mapper.DistributionBillLadingScanMapper;
import com.logpm.distribution.mapper.DistributionDeliveryDetailsMapper;
import com.logpm.distribution.mapper.DistributionDeliveryListMapper;
@ -125,13 +105,9 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;
import java.security.NoSuchAlgorithmException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
@ -200,6 +176,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
private final ISysClient sysClient;
private final ITrunklinePackageTrackLogClient trunklinePackageTrackLogClient;
private final IDistributionPrintService distributionPrintService;
@ -3020,6 +2997,80 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
}
@Override
public void sendFactorySignforInfo(String s) {
try {
MtReceiveDTO mtReceiveDTO = new MtReceiveDTO();
List<DistrilbutionBillStockEntity> list = distrilbutionBillStockService.list(Wrappers.<DistrilbutionBillStockEntity>query().lambda()
.eq(DistrilbutionBillStockEntity::getBillLadingId, s)
.apply("order_status in ( '1' , '3')")
);
List<MtReceiveContentDTO> mtReceiveContentDTOList = new ArrayList<>();
List<String> consigneePerson = new ArrayList<>();
for (DistrilbutionBillStockEntity distrilbutionBillStock : list) {
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(distrilbutionBillStock.getStockArticleId());
List<MtReceiveContentDTO> mtReceiveContentDTOS = handlePushFactorySignforInfo(stockArticleEntity, s);
if (!mtReceiveContentDTOS.isEmpty()) {
mtReceiveContentDTOList.addAll(mtReceiveContentDTOS);
}
consigneePerson.add(stockArticleEntity.getConsigneePerson());
}
mtReceiveDTO.setSendTaskId(s);
mtReceiveDTO.setReceiver(consigneePerson.stream().distinct().collect(Collectors.joining(",")));
mtReceiveDTO.setReceiveContentList(mtReceiveContentDTOList);
List<MtReceiveImagesDTO> mtReceiveImagesDTOS = new ArrayList<>();
List<DistributionPrintEntity> list1 = distributionPrintService.list(Wrappers.<DistributionPrintEntity>query().lambda()
.eq(DistributionPrintEntity::getBillLadingId, s)
);
for (DistributionPrintEntity distributionPrintEntity : list1) {
MtReceiveImagesDTO mtReceiveImagesDTO = new MtReceiveImagesDTO();
if (!distributionPrintEntity.getSite().contains("blob")){
mtReceiveImagesDTO.setImage(distributionPrintEntity.getSite());
mtReceiveImagesDTOS.add(mtReceiveImagesDTO);
}
}
orderMainClinet.sendReceiveInfoByNewSystem(mtReceiveDTO);
}catch (Exception e){
log.error("回传工厂数据失败", e);
}
}
private List<MtReceiveContentDTO> handlePushFactorySignforInfo(DistributionStockArticleEntity stockArticleEntity, String s) {
//其他品牌用","拼接
String brand = "梦天";
List<String> list = Arrays.asList(brand.split(","));
List<MtReceiveContentDTO> mtReceiveContentDTOS = new ArrayList<>();
if (list.isEmpty()) {
Iterator<String> iterator = list.iterator();
while (iterator.hasNext()){
String next = iterator.next();
if (stockArticleEntity.getBrand().contains(next)){
//查询此订单所有签收信息
List<DistributionBillLadingScanEntity> ladingScanEntities = distributionBillLadingScanMapper.selectList(Wrappers.<DistributionBillLadingScanEntity>query().lambda()
.eq(DistributionBillLadingScanEntity::getBillLadingId, s)
.eq(DistributionBillLadingScanEntity::getStockArticleId, stockArticleEntity.getId())
);
//处理数据构建
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.sss");
if (!ladingScanEntities.isEmpty()) {
for (DistributionBillLadingScanEntity ladingScanEntity : ladingScanEntities) {
MtReceiveContentDTO mtReceiveContentDTO = new MtReceiveContentDTO();
mtReceiveContentDTO.setWarehouse(stockArticleEntity.getWarehouse()+"");
mtReceiveContentDTO.setOrderCode(stockArticleEntity.getOrderCode());
mtReceiveContentDTO.setUnitNo(ladingScanEntity.getPacketBarCode());
mtReceiveContentDTO.setOperateDate(simpleDateFormat.format(ladingScanEntity.getCreateTime()));
mtReceiveContentDTO.setWaybillNumber(stockArticleEntity.getWaybillNumber());
}
}
}
}
}
return mtReceiveContentDTOS;
}
private JSONObject handleLogJSONObject(BasicdataWarehouseEntity warehouse, BladeUser user, String orderPackageCode, String content, Integer node) {
JSONObject trunklinePackageTrackLog = new JSONObject();
trunklinePackageTrackLog.put("tenantId",user.getTenantId());

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

@ -783,7 +783,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleMapper.selectById(parcelListEntity.getStockArticleId());
if (shangpeiFlag) {
List<DistributionReservationEntity> reservationEntities = reservationEntityList.stream().filter(r -> Func.isNotEmpty(r.getConsignee()) && r.getConsignee().equals(stockArticleEntity.getCustomerName()) && r.getDeliveryAddress().equals(stockArticleEntity.getCustomerAddress()) && r.getDeliveryPhone().equals(stockArticleEntity.getCustomerTelephone()) && r.getMallName().equals(stockArticleEntity.getMallName())).collect(Collectors.toList());
List<DistributionReservationEntity> reservationEntities = reservationEntityList.stream().filter(r -> Func.isNotEmpty(r.getConsignee()) && r.getConsignee().equals(stockArticleEntity.getCustomerName()) && r.getDeliveryAddress().equals(stockArticleEntity.getCustomerAddress()) && r.getDeliveryPhone().equals(stockArticleEntity.getCustomerTelephone()) && r.getMallName().equals(stockArticleEntity.getMallName()) && r.getId().equals(distrilbutionloadingscanDTO.getReservationId())).collect(Collectors.toList());
//查看是否存在满足条件的预约单
//存在多个,操作人指定具体客户即可
if (!reservationEntities.isEmpty()) {
@ -805,7 +805,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
shangpeiFlag = reservationEntityList.stream().allMatch(r -> r.getDeliveryType().equals(DistributionTypeConstant.shangpei.getValue()));
if (shangpeiFlag) {
List<DistributionReservationEntity> reservationEntities = reservationEntityList.stream().filter(r -> r.getReceivingUnit().equals(stockArticleEntity.getConsigneeUnit()) && r.getMallName().equals(stockArticleEntity.getMallName())).collect(Collectors.toList());
List<DistributionReservationEntity> reservationEntities = reservationEntityList.stream().filter(r -> r.getReceivingUnit().equals(stockArticleEntity.getConsigneeUnit()) && r.getMallName().equals(stockArticleEntity.getMallName()) && r.getId().equals(distrilbutionloadingscanDTO.getReservationId())).collect(Collectors.toList());
//查询是否满足商配异常装车
boolean flag = reservationEntityList.stream().anyMatch(r -> r.getReceivingUnit().equals(stockArticleEntity.getConsigneeUnit()) && r.getMallName().equals(stockArticleEntity.getMallName()));
if (reservationEntities.size() == 1) {

63
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

@ -50,6 +50,9 @@ import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.*;
import com.logpm.distribution.vo.app.*;
import com.logpm.distribution.wrapper.DistributionStockArticleWrapper;
import com.logpm.factory.mt.dto.MtReceiveContentDTO;
import com.logpm.factory.mt.dto.MtReceiveDTO;
import com.logpm.factory.mt.dto.MtReceiveImagesDTO;
import com.logpm.factorydata.enums.BrandEnums;
import com.logpm.factorydata.util.FactoryDataMessageSender;
import com.logpm.factorydata.vo.NodePushMsg;
@ -62,6 +65,7 @@ import com.logpm.trunkline.feign.ITrunklinePackageTrackLogClient;
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
import lombok.extern.log4j.Log4j2;
import org.apache.logging.log4j.util.Strings;
import org.jetbrains.annotations.NotNull;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.Inventory.InventoryStockUpStatusConstant;
import org.springblade.common.constant.RabbitConstant;
@ -96,6 +100,7 @@ import org.springblade.system.feign.IUserClient;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -646,14 +651,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
);
if (!Func.isEmpty(parcelListEntities)) {
for (DistributionParcelListEntity parcelListEntity : parcelListEntities) {
DistrilbutionBillPackageEntity billPackageEntity = new DistrilbutionBillPackageEntity();
billPackageEntity.setBillLadingId(distrilbutionBillLading.getId());
billPackageEntity.setPacketBarStatus(1);
billPackageEntity.setBillType("1");
billPackageEntity.setPacketNumber(parcelListEntity.getQuantity());
billPackageEntity.setParceListId(parcelListEntity.getId());
billPackageEntity.setStockArticleId(parcelListEntity.getStockArticleId());
billPackageEntity.setPacketBarCode(parcelListEntity.getOrderPackageCode());
DistrilbutionBillPackageEntity billPackageEntity = getDistrilbutionBillPackageEntity(distrilbutionBillLading, parcelListEntity);
packageEntityList.add(billPackageEntity);
packageIds.add(parcelListEntity.getId());
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getNickName()+"计划自提,操作方式:新增订单系统默认可用包件,自提批次号:"+distrilbutionBillLading.getPickupBatch();
@ -678,14 +676,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
);
if (!Func.isEmpty(parcelListEntities)) {
for (DistributionParcelListEntity parcelListEntity : parcelListEntities) {
DistrilbutionBillPackageEntity billPackageEntity = new DistrilbutionBillPackageEntity();
billPackageEntity.setBillLadingId(distrilbutionBillLading.getId());
billPackageEntity.setPacketBarStatus(1);
billPackageEntity.setBillType("1");
billPackageEntity.setPacketNumber(parcelListEntity.getQuantity());
billPackageEntity.setParceListId(parcelListEntity.getId());
billPackageEntity.setStockArticleId(parcelListEntity.getStockArticleId());
billPackageEntity.setPacketBarCode(parcelListEntity.getOrderPackageCode());
DistrilbutionBillPackageEntity billPackageEntity = getDistrilbutionBillPackageEntity(distrilbutionBillLading, parcelListEntity);
packageEntityList.add(billPackageEntity);
packageIds.add(parcelListEntity.getId());
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getNickName()+"计划自提,操作方式:新增订单系统默认可用包件,自提批次号:"+distrilbutionBillLading.getPickupBatch();
@ -872,6 +863,19 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
return true;
}
@NotNull
private static DistrilbutionBillPackageEntity getDistrilbutionBillPackageEntity(DistrilbutionBillLadingDTO distrilbutionBillLading, DistributionParcelListEntity parcelListEntity) {
DistrilbutionBillPackageEntity billPackageEntity = new DistrilbutionBillPackageEntity();
billPackageEntity.setBillLadingId(distrilbutionBillLading.getId());
billPackageEntity.setPacketBarStatus(1);
billPackageEntity.setBillType("1");
billPackageEntity.setPacketNumber(parcelListEntity.getQuantity());
billPackageEntity.setParceListId(parcelListEntity.getId());
billPackageEntity.setStockArticleId(parcelListEntity.getStockArticleId());
billPackageEntity.setPacketBarCode(parcelListEntity.getOrderPackageCode());
return billPackageEntity;
}
@Override
public boolean signImages(DistrilbutionBillLadingDTO distrilbutionBillLading) {
@ -2816,20 +2820,6 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
} else {
i.setEsauInventoryNum(-1);
}
// if (i.getQuantity().equals(i.getDeliveryNum())) {
//已备货
// List<DistributionBillLadingScanEntity> list = distributionBillLadingScanService.list(Wrappers.<DistributionBillLadingScanEntity>query().lambda()
// .eq(DistributionBillLadingScanEntity::getBillLadingId, distrilbutionBillLadingEntity.getId())
// .eq(DistributionBillLadingScanEntity::getMaterialType, '1')
// );
// i.setEsauInventoryNum(list.size());
// } else {
//没有备货完成
// i.setEsauInventoryNum(-1);
// }
});
mainVO.setInventoryList(inventory);
return mainVO;
@ -3220,6 +3210,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
return false;
}
Set<Long> parcelListIds = new HashSet<>();
try {
for (int i = 0; i < split.length; i++) {
String s = split[i];
@ -3240,6 +3231,8 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
DistrilbutionBillLadingEntity billLadingEntity = new DistrilbutionBillLadingEntity();
billLadingEntity.setConditions(BillLadingStatusConstant.yiqianshou.getValue());
billLadingEntity.setId(Long.parseLong(s));
billLadingEntity.setExamineUserName(AuthUtil.getNickName());
billLadingEntity.setExamineUserId(AuthUtil.getUserId());
this.updateById(billLadingEntity);
//完成备货状态
distributionStockupInfoService.maintenanceStockUp(Long.parseLong(s), 2);
@ -3271,6 +3264,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
// .or(ew -> ew.eq(DistrilbutionBillStockEntity::getBillLadingId, s).apply(DistrilbutionBillStockEntity::getOrderStatus, "2"))
);
if (!list.isEmpty()) {
list.forEach(li -> {
DistributionStockArticleEntity stockArticleEntity = new DistributionStockArticleEntity();
stockArticleEntity.setId(li.getStockArticleId());
@ -3290,12 +3284,18 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue());
}
distributionStockArticleService.updateById(stockArticleEntity);
});
distributionAsyncService.sendFactorySignforInfo(s);
}
//处理库存品签收数据
updateStock(s);
// 回传老系统自提数据
sendOldSystem(Long.parseLong(s));
}
@ -3307,7 +3307,6 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
// 回传工厂数据
sendFactory(myCurrentWarehouse, parcelListIds);
return true;
}

81
blade-service/logpm-factory/src/main/java/com/logpm/factory/jobhandler/MengTianPushDataJob.java

@ -0,0 +1,81 @@
package com.logpm.factory.jobhandler;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.logpm.factory.mt.dto.MtReceiveContentDTO;
import com.logpm.factory.mt.dto.MtReceiveDTO;
import com.logpm.factory.mt.dto.MtReceiveImagesDTO;
import com.logpm.factory.mt.mapper.MtPushDataMapper;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author zhaoqiaobo
* @create 2024-04-02
*/
@AllArgsConstructor
@Component
@Slf4j
public class MengTianPushDataJob {
private final MtPushDataMapper mtPushDataMapper;
private final RabbitTemplate rabbitTemplate;
/**
* 定时扫描梦天手动数据
*
* @param param
* @return
* @throws Exception
*/
@XxlJob("mengTianCustomPushNodeData")
public ReturnT<String> pushDataJob(String param) throws Exception {
List<JSONObject> js = this.mtPushDataMapper.customPushNodeData();
if (CollUtil.isEmpty(js)) {
return ReturnT.SUCCESS;
}
MtReceiveDTO dto = new MtReceiveDTO();
String sendTaskId = js.get(0).getStr("sendTaskId");
if (StrUtil.isNotEmpty(sendTaskId)) {
dto.setSendTaskId(sendTaskId);
dto.setReceiver(js.get(0).getStr("receiver"));
// js 按sendTaskId 和 receiver分组
List<MtReceiveContentDTO> mtReceiveContentDTOS = js.stream().map(j -> {
MtReceiveContentDTO contentDTO = new MtReceiveContentDTO();
contentDTO.setWaybillNumber(j.getStr("waybillNumber"));
contentDTO.setUnitNo(j.getStr("unitNo"));
contentDTO.setOperateDate(j.getStr("operateDate"));
contentDTO.setWarehouse(j.getStr("warehouse"));
contentDTO.setWarehouseCode(j.getStr("warehouseCode"));
contentDTO.setOrderCode(j.getStr("orderCode"));
contentDTO.setInvoiceOrderCode(j.getStr("invoiceOrderCode"));
return contentDTO;
}).collect(Collectors.toList());
dto.setReceiveContentList(mtReceiveContentDTOS);
List<MtReceiveImagesDTO> images = mtPushDataMapper.customPushNodeDataImage(sendTaskId);
dto.setReceiveImagesList(images);
Map<String, Object> map = new HashMap<>();
String mes = com.alibaba.fastjson.JSONObject.toJSONString(dto);
map.put("messageData", mes);
log.info("梦天手动回推签收数据:{}", JSONUtil.toJsonStr(map));
rabbitTemplate.convertAndSend(RabbitConstant.MT_BUSINESS_DATA_CLERK_CHECK_2_FACTORY_EXCHANGE, RabbitConstant.MT_BUSINESS_DATA_CLERK_CHECK_2_FACTORY_ROUTING, map);
mtPushDataMapper.customPushNodeDataSended(sendTaskId);
}
return ReturnT.SUCCESS;
}
}

10
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/MtPushDataMapper.java

@ -1,7 +1,17 @@
package com.logpm.factory.mt.mapper;
import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factory.mt.dto.MtReceiveImagesDTO;
import com.logpm.factory.mt.entity.MtPushData;
import java.util.List;
public interface MtPushDataMapper extends BaseMapper<MtPushData> {
List<JSONObject> customPushNodeData();
List<MtReceiveImagesDTO> customPushNodeDataImage(String sendTaskId);
void customPushNodeDataSended(String sendTaskId);
}

32
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/MtPushDataMapper.xml

@ -1,9 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.factory.mt.mapper.MtPushDataMapper">
<select id="customPushNodeData" resultType="cn.hutool.json.JSONObject">
select t1.sendTaskId,
t1.receiver,
t1.orderCode,
t1.unitNo,
t1.operateDate,
t1.warehouseCode,
t1.warehouse,
t1.invoiceOrderCode,
t1.waybillNumber
from mt_custom_push_data_package t1
join (select t.sendTaskId
from mt_custom_push_data_package t
where t.sendStatus = 0
group by t.sendTaskId limit 1) t2
on t1.sendTaskId = t2.sendTaskId
</select>
<select id="customPushNodeDataImage" resultType="com.logpm.factory.mt.dto.MtReceiveImagesDTO">
select image
from mt_custom_push_data_image
where sendTaskId = #{sendTaskId}
</select>
<update id="customPushNodeDataSended">
update mt_custom_push_data_package
set sendStatus = 1
where sendTaskId = #{sendTaskId}
</update>
</mapper>

15
blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java

@ -243,6 +243,21 @@ public class DistributionDatarepair {
/**
* 推送自提签收信息至工厂
* @return
*/
@XxlJob("sendFactorySignforInfo")
public ReturnT<String> sendFactorySignforInfo(String params) {
// 得到当前仓库所有的签收任务
Boolean b =distrilbutionBillLadingClient.sendFactorySignforInfo(params);
return ReturnT.SUCCESS;
}

Loading…
Cancel
Save