Browse Source

自提BUG修复、异常装车判定

dist.1.3.0
汤建军 8 months ago
parent
commit
3dcdb1752f
  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. 26
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml
  7. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java
  8. 107
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  9. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  10. 31
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
  11. 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;
}
}

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) {

31
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;
@ -97,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;
@ -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;
}

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