Browse Source

Merge branch 'dev' into pre-production

master
pref_mail@163.com 10 months ago
parent
commit
af6df72472
  1. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionReservationClient.java
  2. 12
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionSignforStockArticleVO.java
  3. 6
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsDistributionPackageEntity.java
  4. 6
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsTrunklinePackageEntity.java
  5. 6
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsWarehousePackageEntity.java
  6. 33
      blade-service/logpm-business/src/main/java/com/logpm/business/receiver/BusinessInOrderDataQueueHandler.java
  7. 8
      blade-service/logpm-business/src/main/java/com/logpm/business/service/IBusinessPreOrderService.java
  8. 45
      blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessPreOrderServiceImpl.java
  9. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionDeliveryAppController.java
  10. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionReservationClient.java
  11. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  12. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  13. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml
  14. 34
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  15. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  16. 124
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  17. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  18. 3
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillFanoutListener.java
  19. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionReservationClient.java

@ -61,6 +61,8 @@ public interface IDistributionReservationClient {
*/
@GetMapping(TOP+"/getReservationList")
List<DistributionReservationEntity> getReservationList(@RequestParam("reservationIds") String reservationIds);
@GetMapping(TOP+"/getReservationByCodeAndWarehouseId")
DistributionReservationEntity getReservationByCodeAndWarehouseId(@RequestParam("reservationCode") String reservationCode,@RequestParam("warehouseId") String warehouseId);
/**

12
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionSignforStockArticleVO.java

@ -266,6 +266,18 @@ public class DistributionSignforStockArticleVO implements Serializable {
@ApiModelProperty(value = "签收时间")
private Date signinTime;
/**
* 签收ID
*/
@ApiModelProperty(value = "签收ID")
private Date signforId;
/**
* 配送ID
*/
@ApiModelProperty(value = "配送ID")
private Date deliveryId;
/**
* 创建时间

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

@ -84,6 +84,12 @@ public class StatisticsDistributionPackageEntity extends TenantEntity {
@ApiModelProperty(value = "品类名称")
private String productName;
/**
* 品类名称
*/
@ApiModelProperty(value = "品类Id")
private String productId;
/**
* 件数
*/

6
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsTrunklinePackageEntity.java

@ -83,6 +83,12 @@ public class StatisticsTrunklinePackageEntity extends TenantEntity {
@ApiModelProperty(value = "品类名称")
private String productName;
/**
* 品类名称
*/
@ApiModelProperty(value = "品类id")
private String productId;
/**
* 件数
*/

6
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsWarehousePackageEntity.java

@ -84,6 +84,12 @@ public class StatisticsWarehousePackageEntity extends TenantEntity {
@ApiModelProperty(value = "品类名称")
private String productName;
/**
* 品类名称
*/
@ApiModelProperty(value = "品类id")
private String productId;
/**
* 件数
*/

33
blade-service/logpm-business/src/main/java/com/logpm/business/receiver/BusinessInOrderDataQueueHandler.java

@ -1,16 +1,23 @@
package com.logpm.business.receiver;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.logpm.business.service.IBusinessPreOrderService;
import com.logpm.distribution.entity.DistributionReservationEntity;
import com.logpm.distribution.feign.IDistributionReservationClient;
import com.rabbitmq.client.Channel;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.core.tool.api.R;
import org.springblade.system.entity.Tenant;
import org.springblade.system.feign.ISysClient;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
/**
@ -23,7 +30,8 @@ import java.util.Map;
public class BusinessInOrderDataQueueHandler {
private final IBusinessPreOrderService businessPreOrderService;
private final IDistributionReservationClient distributionReservationClient;
private final ISysClient sysClient;
@RabbitHandler
public void businessInOrderDataHandler(Map map, Message message, Channel channel) {
// 获取
@ -35,7 +43,9 @@ public class BusinessInOrderDataQueueHandler {
String vehicleName = o.getString("vehicleName");
String driverName = o.getString("driverName");
String userName = o.getString("userName");
// 当前作业仓库
Long warehouseId = o.getLong("warehouseId");
// 作业
String tenantId = o.getString("tenantId");
//验证参数是否为null或者空串
@ -59,9 +69,26 @@ public class BusinessInOrderDataQueueHandler {
log.error("driverName is null");
return;
}
// 判断目标租户
DistributionReservationEntity reservationByCodeAndWarehouseId = distributionReservationClient.getReservationByCodeAndWarehouseId(reservationCode, warehouseId.toString());
// 判断是否存在租户
R<List<Tenant>> tenantList = sysClient.getTenantList();
Tenant tenant = null;
if (tenantList.isSuccess()) {
List<Tenant> data = tenantList.getData();
for (Tenant datum : data) {
if (datum.getTenantType() == 2 && datum.getTenantName().equals(reservationByCodeAndWarehouseId.getMallName().trim())) {
tenant = datum;
break;
}
}
}
if(!ObjectUtil.isEmpty(tenant)){
// 如果师傅签收 以师傅签收的车次为准
businessPreOrderService.scanOrderPackageCodeByMaster(orderPackageCode, reservationCode, distrCarNumber, vehicleName, driverName, userName, warehouseId,tenant.getTenantId(),tenant.getTenantName(),tenantId);
}
// 如果师傅签收 以师傅签收的车次为准
businessPreOrderService.scanOrderPackageCodeByMaster(orderPackageCode, reservationCode, distrCarNumber, vehicleName, driverName, userName, warehouseId, tenantId);
}

8
blade-service/logpm-business/src/main/java/com/logpm/business/service/IBusinessPreOrderService.java

@ -10,6 +10,7 @@ import com.logpm.trunkline.dto.InComingDTO;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
import org.springblade.system.entity.Tenant;
import java.util.List;
import java.util.Map;
@ -88,8 +89,9 @@ public interface IBusinessPreOrderService extends BaseService<BusinessPreOrderEn
* @param driverName 司机名称
* @param vehicleName 车牌号码
* @param warehouseId 当前作业仓库ID
* @param tenantId 当前作业的租户
* @param tenantId 目标租户
* @param userName 作业用户
* @param sourceTenantId 来源租户
* @return
*/
R scanOrderPackageCodeByMaster(String orderPackageCode,
@ -99,7 +101,9 @@ public interface IBusinessPreOrderService extends BaseService<BusinessPreOrderEn
String driverName,
String userName,
Long warehouseId,
String tenantId
String tenantId,
String tenantName,
String sourceTenantId
);
}

45
blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessPreOrderServiceImpl.java

@ -23,6 +23,7 @@ import com.logpm.trunkline.feign.IInComingClient;
import com.logpm.trunkline.feign.ITrunklineAdvanceDetailClient;
import lombok.AllArgsConstructor;
import org.jetbrains.annotations.Nullable;
import org.springblade.common.annotations.ChangeAsync;
import org.springblade.common.constant.IncomingTypeEnum;
import org.springblade.common.constant.RedisKeyConstant;
import org.springblade.common.exception.CustomerException;
@ -169,13 +170,12 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
private R inOrderWarehourseByFeign(BusinessSanDTO businessSanDTO) {
InComingDTO inComingDTO = new InComingDTO();
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
inComingDTO.setOrderPackageCode(businessSanDTO.getOrderPackageCode());
inComingDTO.setIncomingType(IncomingTypeEnum.LINE_INCOMING.getCode());
inComingDTO.setWarehouseId(myCurrentWarehouse.getId());
inComingDTO.setTrayCode(businessSanDTO.getTrayCode());
inComingDTO.setTrayType(businessSanDTO.getTrayType());
inComingDTO.setWarehouseName(myCurrentWarehouse.getName());
inComingDTO.setWarehouseName(businessSanDTO.getWarehouseName());
inComingDTO.setWarehouseId(businessSanDTO.getWarehouseId());
R r = inComingClient.incomingPackageByTaryCode(inComingDTO);
return r;
@ -187,6 +187,9 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
try {
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
businessSanDTO.setWarehouseId(myCurrentWarehouse.getId());
businessSanDTO.setWarehouseName(myCurrentWarehouse.getName());
String orderPackageCode = businessSanDTO.getOrderPackageCode();
String distrCarNumber = businessSanDTO.getDistrCarNumber();
@ -466,6 +469,7 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
}
@ChangeAsync
@Override
public R scanOrderPackageCodeByMaster(String orderPackageCode,
String reservationCode,
@ -474,7 +478,16 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
String driverName,
String userName,
Long warehouseId,
String tenantId) {
String tenantId,
String tenantName,
String sourceTenantId) {
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.findByName(tenantName + "仓");
if(ObjectUtils.isNull(warehouseEntity)){
return R.fail("仓库信息不存在");
}
// 判断当前的包条码是否和当前作业的车次相同
LambdaQueryWrapper<BusinessPreOrderEntity> queryWrapper1 = new LambdaQueryWrapper<>();
@ -484,14 +497,22 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
BusinessPreOrderEntity data =null;
if (list1.isEmpty()) {
// 新增改车次的预入库信息
DistributionParcelListEntity byPacketBarCodeAndWarehouseId = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, warehouseId);
data = BeanUtil.copy(byPacketBarCodeAndWarehouseId, BusinessPreOrderEntity.class);
TrunklineAdvanceDetailEntity entityByOrderPackageCode = trunklineAdvanceDetailClient.findEntityByOrderPackageCode(orderPackageCode);
data = BeanUtil.copy(entityByOrderPackageCode, BusinessPreOrderEntity.class);
data.setWaybillNumber(entityByOrderPackageCode.getWaybillNo());
data.setFirsts(entityByOrderPackageCode.getFirstPackName());
data.setSecond(entityByOrderPackageCode.getSecondPackName());
data.setThirdProduct(entityByOrderPackageCode.getThirdPackName());
data.setBrandName(entityByOrderPackageCode.getBrand());
data.setConditions(1);
data.setInWarehouse(0);
data.setDriverName(driverName);
data.setVehicleName(vehicleName);
data.setDistrCarNumber(distrCarNumber);
data.setFromTenantId(tenantId);
data.setFromTenantId(sourceTenantId);
data.setOperationStatus(0);
data.setInWarehouse(1);
data.setId(null);
data.setTenantId(null);
data.setReservationCode(reservationCode);
@ -513,9 +534,15 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
}
// 通过目标租户确认 目标租户对应的仓库
BusinessSanDTO businessSanDTO = new BusinessSanDTO();
businessSanDTO.setOrderPackageCode(data.getOrderPackageCode());
R r = inOrderWarehourse(businessSanDTO);
businessSanDTO.setDistrCarNumber(distrCarNumber);
businessSanDTO.setInWarehouseException(0);
businessSanDTO.setWarehouseName(warehouseEntity.getName());
businessSanDTO.setWarehouseId(warehouseEntity.getId());
R r = inOrderWarehourseByFeign(businessSanDTO);
return r;
}

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

@ -137,7 +137,13 @@ public class DistributionDeliveryAppController {
@ApiOperationSupport(order = 6)
@ApiOperation(value = "装车扫描", notes = "传入DistrilbutionloadingscanDTO")
public R loadingscan(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
R msg = distributionDeliveryListService.loadingscan(distrilbutionloadingscanDTO);
R msg = null;
try{
msg = distributionDeliveryListService.loadingscan(distrilbutionloadingscanDTO);
}catch (Exception e){
e.printStackTrace();
}
return msg;
}

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionReservationClient.java

@ -60,6 +60,11 @@ public class DistributionReservationClient implements IDistributionReservationCl
return reservationService.getRetentionReservationList(reservationIds);
}
@Override
public DistributionReservationEntity getReservationByCodeAndWarehouseId(String reservationCode, String warehouseId) {
return reservationService.selectByReservationCode(reservationCode);
}
/**
* @param warehouseId
* @return

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

@ -543,7 +543,7 @@
LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id and lwtg.association_type = '3'
LEFT JOIN logpm_warehouse_tray lwt on lwtg.tray_id = lwt.id
<where>
ldsi.stockup_id =#{id} and ldpl.order_package_code is not null and ldsi.stock_status != 4
ldsi.stockup_id =#{id} and ldpl.order_package_code is not null and ldsi.stock_status != 4 AND ldrp.packet_bar_status != 2
</where>
</select>
<select id="getPageVOList" resultType="com.logpm.distribution.entity.DistributionParcelListEntity">

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

@ -1492,7 +1492,9 @@
lds.sjsigning_time AS sjsigningTime,
lddl.train_number AS trainNumber,
lddl.vehicle_name AS vehicleName,
lddl.driver_name AS driverName
lddl.driver_name AS driverName,
lds.id AS signforId,
lds.delivery_id AS deliveryId
FROM
logpm_distribution_reservation_stockarticle AS ldrs
LEFT JOIN logpm_distribution_reservation AS ldr ON ldrs.reservation_id = ldr.id

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml

@ -1020,6 +1020,7 @@
ldsi.stockup_id = #{ id }
AND ldsi.is_deleted = 0
AND ldsi.stock_status != 4
AND ldrs.stock_article_status != 2
</where>
</select>

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

@ -577,6 +577,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
@Transactional(isolation = Isolation.READ_COMMITTED, rollbackFor = Exception.class)
// synchronized
public R loadingscan(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
//查询该包件是否能够从库存品包件表中查到
String now = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
@ -642,6 +644,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (Func.isEmpty(parcelList)) {
return Resp.scanFail("系统无编码", "系统无编码");
}
if (parcelList.getConditions().equals(2)) {
return Resp.scanFail("此包件不是订制品", "此包件不是订制品");
}
if (!Objects.isNull(parcelList)) {
if (OrderPackageStatusConstant.yiqianshou.getValue().equals(parcelList.getOrderPackageStatus())) {
return Resp.scanFail("包件已签收", "包件已签收");
@ -787,21 +792,17 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
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()) && r.getId().equals(distrilbutionloadingscanDTO.getReservationId())).collect(Collectors.toList());
//查看是否存在满足条件的预约单
reservationEntities = reservationEntities.stream().filter(r -> r.getReceivingUnit().equals(stockArticleEntity.getConsigneeUnit()) && r.getMallName().equals(stockArticleEntity.getMallName())).collect(Collectors.toList());
boolean flag = reservationEntityList.stream().anyMatch(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()));
//存在多个,操作人指定具体客户即可
if (!reservationEntities.isEmpty() && reservationEntities.size() == 1) {
if (Func.isEmpty(distrilbutionloadingscanDTO.getReservationId())) {
log.info("异常装车未指定客户");
return Resp.scanFail("请指定客户进行异常装车", "请指定客户进行异常装车");
}
if ( reservationEntities.size() == 1 && flag) {
return R.fail(5000, "异常装车");
// return Resp.scanFail("装车失败","程序出错,请联系彪桑");
} else {
if (parcelListEntity.getConditions() == 2) {
return Resp.scanFail("此包件不是订制品", "此包件不是订制品");
} else {
if (flag){
if (reservationEntities.isEmpty()){
return Resp.scanFail("请指定客户进行异常装车", "请指定客户进行异常装车");
}
}else {
return Resp.scanFail("窜货", "窜货");
}
}
@ -810,15 +811,18 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (shangpeiFlag) {
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 = reservationEntities.stream().anyMatch(r -> r.getReceivingUnit().equals(stockArticleEntity.getConsigneeUnit()) && r.getMallName().equals(stockArticleEntity.getMallName()));
if (flag){
boolean flag = reservationEntityList.stream().anyMatch(r -> r.getReceivingUnit().equals(stockArticleEntity.getConsigneeUnit()) && r.getMallName().equals(stockArticleEntity.getMallName()));
if (reservationEntities.size() == 1 && flag){
return R.fail(5000, "异常装车");
}else {
if (Func.isEmpty(distrilbutionloadingscanDTO.getReservationId())){
return Resp.scanFail("请指定客户进行异常装车", "请指定客户进行异常装车");
if (flag){
if (reservationEntities.isEmpty()){
return Resp.scanFail("请指定客户进行异常装车", "请指定客户进行异常装车");
}
}else {
return Resp.scanFail("窜货", "窜货");
}
}
} else {

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

@ -2589,7 +2589,12 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//查询备货任务
DistributionStockupEntity stockupEntity = distributionStockupMapper.selectById(distributionStockupInfoEntities.get(0).getStockupId());
if (Func.isNotEmpty(stockupEntity)) {
if (stockupEntity.getAssignStatus().equals(StockAssignStatusConstant.weizhipai.getValue())) {
//查询此备货任务有多少
List<DistributionStockupInfoEntity> entityList = distributionStockupInfoService.list(Wrappers.<DistributionStockupInfoEntity>query().lambda()
.eq(DistributionStockupInfoEntity::getStockupId, stockupEntity.getId())
.ne(DistributionStockupInfoEntity::getStockStatus, "4")
);
if (stockupEntity.getAssignStatus().equals(StockAssignStatusConstant.weizhipai.getValue()) && entityList.size() == 1) {
//物理删除关于预约的所有信息
distributionReservationStocklistMapper.deleteReservationStocklist(reservationEntity.getId());
distributionReservationPackageMapper.deleteReservationPackage(reservationEntity.getId());

124
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -16,6 +16,8 @@
*/
package com.logpm.distribution.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -43,6 +45,7 @@ import com.logpm.distribution.vo.app.*;
import com.logpm.distribution.wrapper.DistributionParcelListAppWrapper;
import com.logpm.distribution.wrapper.DistributionParcelListWrapper;
import com.logpm.distribution.wrapper.DistributionStockArticleWrapper;
import com.logpm.factory.comfac.dto.OrderStatusDTO;
import com.logpm.oldproject.dto.SignPushDataContactDTO;
import com.logpm.oldproject.dto.SignPushDataDTO;
import com.logpm.oldproject.dto.SignPushDataUnitDTO;
@ -2665,6 +2668,14 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionDeliveryListService.maintenanceDeliveryInfo(distrilbutionloadingscanDTO.getDeliveryId());
trunklinePackageTrackLogClient.addPackageTrackLog(aaa);
// 推送
sendMessage(distrilbutionloadingscanDTO.getBarcode(), distributionReservationEntity.getReservationCode(),
deliveryListEntity.getTrainNumber(),deliveryListEntity.getVehicleName(),deliveryListEntity.getDriverName(),
AuthUtil.getUserName(),myCurrentWarehouse.getId(),AuthUtil.getTenantId());
return Resp.scanSuccessWithData("签收成功", str, orderPackageCodes);
} catch (Exception e) {
log.error(">>>>> 签收异常报错", e);
@ -2672,6 +2683,49 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
}
/**
*
* @param orderPackageCode
* @param reservationCode
* @param distrCarNumber
* @param vehicleName
* @param driverName
* @param userName
* @param warehouseId
* @param tenantId 当前的租户
*
*/
private void sendMessage(String orderPackageCode,
String reservationCode,
String distrCarNumber,
String vehicleName,
String driverName,
String userName,
Long warehouseId,
String tenantId
){
try {
JSONObject jsonObject = new JSONObject();
jsonObject.put("orderPackageCode",orderPackageCode);
jsonObject.put("reservationCode",reservationCode);
jsonObject.put("distrCarNumber",distrCarNumber);
jsonObject.put("vehicleName",vehicleName);
jsonObject.put("driverName",driverName);
jsonObject.put("userName",userName);
jsonObject.put("warehouseId",warehouseId);
jsonObject.put("tenantId",tenantId);
// 发送入库消息
Map mapState = new HashMap();
mapState.put("messageId", CommonUtil.getUUID());
mapState.put("createTime", System.currentTimeMillis());
Map<String, Object> map = new HashMap<>();
map.put("messageData", jsonObject);
rabbitTemplate.convertAndSend(RabbitConstant.BUSINESS_IN_CONVERSION_DATA_EXCHANGE, RabbitConstant.BUSINESS_IN_CONVERSION_DATA_ROUTING, map);
} catch (Exception e) {
log.error("签收商家推送:{}", e);
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public R signforPC(DistrilbutionAppsignforDTO distrilbutionloadingscanDTO) {
@ -3704,8 +3758,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Override
public List<DistributionAppStockArticleVO> getAppDeliveryorderListPage(DistributionAppDeliveryListDTO distributionDeliveryList) {
List<DistributionAppStockArticleVO> orderVos = new ArrayList<>();
if (Func.isEmpty(distributionDeliveryList.getReservationId())) {
log.error("参数缺失reservationId:{}", distributionDeliveryList.getReservationId());
return orderVos;
}
//查询该客户装车
@ -3731,32 +3787,40 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
Map<Long, List<DistributionReservationStockarticleEntity>> reservationOrderMap = reservationStockarticleEntityList.stream().collect(Collectors.groupingBy(DistributionReservationStockarticleEntity::getStockArticleId));
Map<Long, List<DistributionLoadscanEntity>> loadingOrderMap = distributionLoadscanEntities.stream().collect(Collectors.groupingBy(DistributionLoadscanEntity::getOrderId));
List<DistributionAppStockArticleVO> orderVos = new ArrayList<>();
if (Func.isNotEmpty(orderIds)) {
orderIds = orderIds.stream().distinct().collect(Collectors.toList());
for (Long orderId : orderIds) {
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(orderId);
DistributionAppStockArticleVO distributionAppStockArticleVO = Func.copy(stockArticleEntity, DistributionAppStockArticleVO.class);
distributionAppStockArticleVO.setTotalNumber(stockArticleEntity.getTotalNumber());
distributionAppStockArticleVO.setStockArticleId(stockArticleEntity.getId());
distributionAppStockArticleVO.setLoadingNub(0);
List<DistributionStockArticleEntity> distributionStockArticleEntities = distributionStockArticleService.listByIds(orderIds);
List<DistributionReservationStockarticleEntity> reservationOrders = distributionReservationStockarticleService.list(Wrappers.<DistributionReservationStockarticleEntity>query().lambda()
.eq(DistributionReservationStockarticleEntity::getReservationId, distributionDeliveryList.getReservationId())
.in(DistributionReservationStockarticleEntity::getStockArticleId, orderIds)
.ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue())
);
for (DistributionStockArticleEntity distributionStockArticleEntity : distributionStockArticleEntities) {
// DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(orderId);
DistributionAppStockArticleVO distributionAppStockArticleVO = Func.copy(distributionStockArticleEntity, DistributionAppStockArticleVO.class);
assert distributionAppStockArticleVO != null;
distributionAppStockArticleVO.setLoadingNub(0);
distributionAppStockArticleVO.setSignforNub(0);
distributionAppStockArticleVO.setReservationNum(0);
//查询预约该订单计划数量
DistributionReservationStockarticleEntity reservationOrder = distributionReservationStockarticleService.getOne(Wrappers.<DistributionReservationStockarticleEntity>query().lambda()
.eq(DistributionReservationStockarticleEntity::getReservationId, distributionDeliveryList.getReservationId())
.eq(DistributionReservationStockarticleEntity::getStockArticleId, orderId)
.ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue())
);
DistributionReservationStockarticleEntity reservationOrder = findReservationOrders(reservationOrders, distributionStockArticleEntity.getId());
if (Func.isNotEmpty(reservationOrder)) {
distributionAppStockArticleVO.setReservationNum(reservationOrder.getReservationNum());
}
if (stockArticleEntity.getIsZero().equals(IsOrNoConstant.no.getValue())) {
if (distributionStockArticleEntity.getIsZero().equals(IsOrNoConstant.no.getValue())) {
//判断此订单是是否是异常装车
if (Func.isEmpty(reservationOrderMap.get(orderId))) {
if (Func.isEmpty(reservationOrderMap.get(distributionStockArticleEntity.getId()))) {
//不存在计划之中的订单装车
List<DistributionLoadscanEntity> loadscanEntityList = loadingOrderMap.get(orderId);
List<DistributionLoadscanEntity> loadscanEntityList = loadingOrderMap.get(distributionStockArticleEntity.getId());
List<Long> abnormalPackageIds = loadscanEntityList.stream().map(DistributionLoadscanEntity::getPackageId).collect(Collectors.toList());
List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListService.listByIds(abnormalPackageIds);
List<DistributionAppParcelListVO> distributionAppParcelListVOS = DistributionParcelListAppWrapper.build().listVO(distributionParcelListEntities);
@ -3778,7 +3842,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//查询此预约该订单下的包件信息
List<DistributionReservationPackageEntity> reservationPackage = distributionReservationPackageService.list(Wrappers.<DistributionReservationPackageEntity>query().lambda()
.eq(DistributionReservationPackageEntity::getReservationId, distributionDeliveryList.getReservationId())
.eq(DistributionReservationPackageEntity::getStockArticleId, orderId)
.eq(DistributionReservationPackageEntity::getStockArticleId, distributionStockArticleEntity.getId())
.ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue())
);
List<Long> packageIds = new ArrayList<>();
@ -3788,8 +3852,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
Map<Long, DistributionLoadscanEntity> collect = null;
if (Func.isNotEmpty(loadingOrderMap.get(orderId))) {
List<DistributionLoadscanEntity> loadscanEntityList = loadingOrderMap.get(orderId);
if (Func.isNotEmpty(loadingOrderMap.get(distributionStockArticleEntity.getId()))) {
List<DistributionLoadscanEntity> loadscanEntityList = loadingOrderMap.get(distributionStockArticleEntity.getId());
List<Long> loadingPackageIds = loadscanEntityList.stream().map(DistributionLoadscanEntity::getPackageId).collect(Collectors.toList());
packageIds.addAll(loadingPackageIds);
collect = loadscanEntityList.stream().collect(Collectors.toMap(DistributionLoadscanEntity::getPackageId, Function.identity(), (k1, k2) -> k2));
@ -3801,11 +3865,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
List<DistributionAppParcelListVO> packageVOS = new ArrayList<>();
if (Func.isNotEmpty(packageIds)) {
packageIds = packageIds.stream().distinct().collect(Collectors.toList());
for (Long packageId : packageIds) {
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(packageId);
List<DistributionParcelListEntity> parcelListEntitys = distributionParcelListService.listByIds(packageIds);
for (DistributionParcelListEntity parcelListEntity : parcelListEntitys) {
// DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(packageId);
DistributionAppParcelListVO distributionAppParcelListVO = DistributionParcelListAppWrapper.build().entityVO(parcelListEntity);
if (Func.isNotEmpty(collect)) {
DistributionLoadscanEntity distributionLoadscanEntity = collect.get(packageId);
DistributionLoadscanEntity distributionLoadscanEntity = collect.get(parcelListEntity.getId());
if (Func.isNotEmpty(distributionLoadscanEntity)) {
distributionAppParcelListVO.setMaterialName(parcelListEntity.getMaterialName());
if (distributionLoadscanEntity.getIsAbnormalLoading().equals(2)) {
@ -3832,16 +3898,16 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
List<DistributionReservationZeroPackageEntity> reservationZeroPackageEntityList = distributionReservationZeroPackageService.list(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda()
.eq(DistributionReservationZeroPackageEntity::getReservationId, distributionDeliveryList.getReservationId())
.eq(DistributionReservationZeroPackageEntity::getStockArticleId, orderId)
.eq(DistributionReservationZeroPackageEntity::getStockArticleId, distributionStockArticleEntity.getId())
.ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue()));
if (Func.isNotEmpty(reservationZeroPackageEntityList)) {
int reservationTotal = reservationZeroPackageEntityList.stream().mapToInt(DistributionReservationZeroPackageEntity::getQuantity).sum();
distributionAppStockArticleVO.setReservationNum(reservationTotal);
List<DistributionParcelNumberVO> parcelNumberVOS = distributionReservationMapper.selectReservationZeroOrderDetail(orderId, Long.parseLong(distributionDeliveryList.getReservationId()));
List<DistributionParcelNumberVO> parcelNumberVOS = distributionReservationMapper.selectReservationZeroOrderDetail(distributionStockArticleEntity.getId(), Long.parseLong(distributionDeliveryList.getReservationId()));
distributionAppStockArticleVO.setSignforNub(0);
if (Func.isNotEmpty(parcelNumberVOS)) {
parcelNumberVOS.forEach(p -> {
DistributionLoadscanEntity loadscanEntity = distributionLoadscanService.getOne(Wrappers.<DistributionLoadscanEntity>query().lambda().eq(DistributionLoadscanEntity::getReservationId, distributionDeliveryList.getReservationId()).eq(DistributionLoadscanEntity::getOrderId, orderId).eq(DistributionLoadscanEntity::getPackageId, p.getParcelListId()).ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()));
DistributionLoadscanEntity loadscanEntity = distributionLoadscanService.getOne(Wrappers.<DistributionLoadscanEntity>query().lambda().eq(DistributionLoadscanEntity::getReservationId, distributionDeliveryList.getReservationId()).eq(DistributionLoadscanEntity::getOrderId, distributionStockArticleEntity.getId()).eq(DistributionLoadscanEntity::getPackageId, p.getParcelListId()).ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()));
p.setLoadingNum(0);
p.setSigningNum(0);
if (Func.isNotEmpty(loadscanEntity)) {
@ -3866,6 +3932,16 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
/**
* 寻找预约单中订单
* @param reservationOrders
* @param id
* @return
*/
private DistributionReservationStockarticleEntity findReservationOrders(List<DistributionReservationStockarticleEntity> reservationOrders , Long id) {
return reservationOrders.stream().filter(f -> f.getStockArticleId().equals(id)).findFirst().orElse(null);
}
// Map<Long, List<DistributionLoadscanEntity>> orderMap = distributionLoadscanEntities.stream().collect(Collectors.groupingBy(DistributionLoadscanEntity::getOrderId));
// List<DistributionAppStockArticleVO> distributionAppStockArticleVOS = new ArrayList<>();

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

@ -310,8 +310,6 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
//商 市
return baseMapper.pageList(page, distributionStockupEntity);
}
}
@Override

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

@ -87,6 +87,7 @@ public class WaybillFanoutListener {
statisticsTrunklinePackageEntity.setOrderCode(json.getStr("orderCode"));
statisticsTrunklinePackageEntity.setOrderPackageCode(json.getStr("orderPackageCode"));
statisticsTrunklinePackageEntity.setProductName(json.getStr("productName"));
statisticsTrunklinePackageEntity.setProductId(json.getStr("productId"));
statisticsTrunklinePackageEntity.setTotalNum(json.getInt("totalNum"));
statisticsTrunklinePackageEntity.setTotalWeight(totalWeight);
statisticsTrunklinePackageEntity.setTotalVolume(totalVolume);
@ -135,6 +136,7 @@ public class WaybillFanoutListener {
statisticsWarehousePackageEntity.setOrderCode(json.getStr("orderCode"));
statisticsWarehousePackageEntity.setOrderPackageCode(json.getStr("orderPackageCode"));
statisticsWarehousePackageEntity.setProductName(json.getStr("productName"));
statisticsWarehousePackageEntity.setProductId(json.getStr("productId"));
statisticsWarehousePackageEntity.setTotalNum(json.getInt("totalNum"));
statisticsWarehousePackageEntity.setTotalWeight(totalWeight);
statisticsWarehousePackageEntity.setTotalVolume(totalVolume);
@ -170,6 +172,7 @@ public class WaybillFanoutListener {
statisticsDistributionPackageEntity.setOrderCode(json.getStr("orderCode"));
statisticsDistributionPackageEntity.setOrderPackageCode(json.getStr("orderPackageCode"));
statisticsDistributionPackageEntity.setProductName(json.getStr("productName"));
statisticsDistributionPackageEntity.setProductId(json.getStr("productId"));
statisticsDistributionPackageEntity.setTotalNum(json.getInt("totalNum"));
statisticsDistributionPackageEntity.setTotalWeight(totalWeight);
statisticsDistributionPackageEntity.setTotalVolume(totalVolume);

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

@ -552,6 +552,7 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService {
json.put("orderPackageCode",detail.getProductName());
json.put("orderCode",waybillNo);
json.put("productName",detail.getProductName());
json.put("productId",detail.getProductId());
json.put("totalNum",num);
json.put("totalWeight",detail.getWeight());
json.put("totalVolume",detail.getVolume());

Loading…
Cancel
Save