Browse Source

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

master
zhenghaoyu 4 days ago
parent
commit
0831d8d22b
  1. 15
      blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java
  2. 50
      blade-biz-common/src/main/java/org/springblade/common/model/TripartiteVO.java
  3. 9
      blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/oupai/vo/OpFactoryPackageDataVO.java
  4. 10
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordServiceImpl.java
  5. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSplitOrderTaskController.java
  6. 26
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java
  7. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSplitOrderTaskService.java
  8. 139
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java
  9. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/vo/DistributionSplitOrderAllTaskVO.java
  10. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/vo/DistributionSplitOrderTaskVO.java
  11. 68
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/job/AdvanceJob.java
  12. 2
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/MqWorkerServiceImpl.java
  13. 3
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/mapper/FactoryPackageMapper.xml
  14. 12
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.xml
  15. 3
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/TrunklinePickupMapper.xml
  16. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java
  17. 9
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
  18. 19
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java
  19. 213
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  20. 11
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java
  21. 16
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

15
blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java

@ -142,6 +142,21 @@ public abstract class FanoutConstants {
}
/**
* 备货节点
*
* @see org.springblade.common.model.StockUpVO
**/
interface tripartite {
String EXCHANGE = "fanout.trunkline.tripartite" + ModuleNameConstant.DEVAUTH;
interface QUEUE {
String SIGN = "fanout.trunkline.tripartite.sign" + ModuleNameConstant.DEVAUTH;
}
}
}

50
blade-biz-common/src/main/java/org/springblade/common/model/TripartiteVO.java

@ -0,0 +1,50 @@
package org.springblade.common.model;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@Data
public class TripartiteVO implements Serializable {
/** 发车批次号 */
private String carsNo ;
/** 司机id */
private Long driverId ;
/** 司机名称 */
private String driverName ;
/** 司机电话 */
private String driverMobile ;
/** 副驾id */
private Long assistantId ;
/** 副驾i名称 */
private String assistantName ;
/** 副驾i电话 */
private String assistantMobile ;
/** 车辆id */
private Long carId ;
/** 送货方式:1=自提,2=送货 */
private String deliveryType ;
/** 客户类型:1=商场,2=C端客户[多选] */
private String customerType ;
/** 承运商id */
private Long carrierId ;
/** 承运商名称 */
private String carrierName ;
/** 承运单号 */
private String carrierOrderCode ;
/** 承运时间 */
private Date carrierTime ;
/** 车牌号 */
private String carNumber ;
private List<PackageData> packageDataList;
}

9
blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/oupai/vo/OpFactoryPackageDataVO.java

@ -41,6 +41,15 @@ public class OpFactoryPackageDataVO implements Serializable {
*/
private String pushStatus;
/**
* 业务员模式
*
* 经销商
*
* 干仓配 不进行数据回传
*/
private String businessModel;

10
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordServiceImpl.java

@ -339,6 +339,16 @@ public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl<Aftersa
currentStockArticleEntity.setIncomingNum(enterNum);
Long orderId = stockArticleClient.addData(currentStockArticleEntity);
if(!Objects.isNull(orderId)){
if(orderId.equals(0L)){
log.warn("################dealAbnormal: 订单信息保存失败 orderCode={} warehouseId={}",orderCode,warehouseId);
throw new CustomerException(405,"订单信息保存失败");
}
if(orderId.equals(1L)){
log.warn("################dealAbnormal: 订单信息正在更新 orderCode={} warehouseId={}",orderCode,warehouseId);
throw new CustomerException(405,"订单信息正在更新,请稍后重试");
}
List<TrunklineScanZeroDetailEntity> updateScanZeroDetailEntityList = new ArrayList<>();
List<DistributionParcelNumberEntity> addParcelNumberEntityList = new ArrayList<>();
List<AftersalesAbnormalRecordZeroDetailEntity> updateRecordZeroDetailList = new ArrayList<>();

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSplitOrderTaskController.java

@ -6,6 +6,7 @@ import com.logpm.distribution.dto.splitOrder.*;
import com.logpm.distribution.entity.DistributionSplitOrderAllTaskEntity;
import com.logpm.distribution.entity.DistributionSplitOrderTaskEntity;
import com.logpm.distribution.service.IDistributionSplitOrderTaskService;
import com.logpm.distribution.vo.DistributionSplitOrderAllTaskVO;
import com.logpm.distribution.vo.SplitPackageOrderVO;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
@ -30,7 +31,7 @@ public class DistributionSplitOrderTaskController {
}
@GetMapping("/all-task-list")
public R<IPage<DistributionSplitOrderAllTaskEntity>> allTaskList(Query query, DistributionSplitAllTaskSearchDTO distributionSplitAllTaskSearchDTO) {
public R<IPage<DistributionSplitOrderAllTaskVO>> allTaskList(Query query, DistributionSplitAllTaskSearchDTO distributionSplitAllTaskSearchDTO) {
return distributionSplitOrderTaskService.allTaskList(query, distributionSplitAllTaskSearchDTO);
}

26
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java

@ -38,6 +38,7 @@ import org.springblade.common.exception.CustomerException;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.redis.cache.BladeRedis;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
@ -59,6 +60,7 @@ public class DistributionStockArticleClient implements IDistributionStockArticle
private final IDistributionStockArticleService distributionStockArticleService;
private final IDistributionParcelListService distributionParcelListService;
private final BladeRedis bladeRedis;
@Override
@GetMapping(TOP)
@ -73,13 +75,37 @@ public class DistributionStockArticleClient implements IDistributionStockArticle
@Override
@PostMapping(API_PREFIX + "/addData")
public Long addData(DistributionStockArticleEntity distributionStockArticleEntity) {
String orderCode = distributionStockArticleEntity.getOrderCode();
Long warehouseId = distributionStockArticleEntity.getWarehouseId();
String key = orderCode + warehouseId;
Boolean exists = bladeRedis.exists(key);
if(exists){
String idStr = bladeRedis.get(key);
if("1".equals(idStr)){
return 1L;
}else{
return Long.valueOf(idStr);
}
}else{
bladeRedis.setEx(key,"1",30L);
DistributionStockArticleEntity distributionStockArticle = distributionStockArticleService.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
if(ObjectUtils.isNotEmpty(distributionStockArticle)){
bladeRedis.setEx(key,distributionStockArticle.getId(),30L);
return distributionStockArticle.getId();
}else{
boolean saveFlag = distributionStockArticleService.save(distributionStockArticleEntity);
if(saveFlag){
bladeRedis.setEx(key,distributionStockArticleEntity.getId(),30L);
return distributionStockArticleEntity.getId();
}else{
return 0L;
}
}
}
}
@Override
@GetMapping(API_PREFIX + "/findByAdvanceId")

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

@ -6,6 +6,7 @@ import com.logpm.distribution.dto.splitOrder.DistributionSplitAllTaskSearchDTO;
import com.logpm.distribution.dto.splitOrder.DistributionSplitTaskSearchDTO;
import com.logpm.distribution.entity.DistributionSplitOrderAllTaskEntity;
import com.logpm.distribution.entity.DistributionSplitOrderTaskEntity;
import com.logpm.distribution.vo.DistributionSplitOrderAllTaskVO;
import com.logpm.distribution.vo.SplitPackageOrderVO;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.support.Query;
@ -32,7 +33,7 @@ public interface IDistributionSplitOrderTaskService extends BaseService<Distribu
* @param distributionSplitAllTaskSearchDTO
* @return
*/
R<IPage<DistributionSplitOrderAllTaskEntity>> allTaskList(Query query, DistributionSplitAllTaskSearchDTO distributionSplitAllTaskSearchDTO);
R<IPage<DistributionSplitOrderAllTaskVO>> allTaskList(Query query, DistributionSplitAllTaskSearchDTO distributionSplitAllTaskSearchDTO);
/**
* 创建任务

139
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java

@ -1,11 +1,13 @@
package com.logpm.distribution.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.SerializationUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.logpm.distribution.bean.Resp;
import com.logpm.distribution.dto.splitOrder.DistributionSplitAllTaskSearchDTO;
import com.logpm.distribution.dto.splitOrder.DistributionSplitTaskSearchDTO;
import com.logpm.distribution.entity.DistributionParcelListEntity;
@ -21,6 +23,7 @@ import com.logpm.distribution.service.IDistributionSplitOrderDetailService;
import com.logpm.distribution.service.IDistributionSplitOrderLogService;
import com.logpm.distribution.service.IDistributionSplitOrderTaskService;
import com.logpm.distribution.service.IDistributionStockArticleService;
import com.logpm.distribution.vo.DistributionSplitOrderAllTaskVO;
import com.logpm.distribution.vo.SplitPackageOrderVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -37,15 +40,15 @@ import org.springblade.core.redis.lock.LockType;
import org.springblade.core.redis.lock.RedisLockClient;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.system.entity.User;
import org.springblade.system.feign.IUserClient;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@Service
@AllArgsConstructor
@ -58,6 +61,7 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
private final IDistributionSplitOrderDetailService distributionSplitOrderDetailService;
private final IDistributionSplitOrderLogService distributionSplitOrderLogService;
private final RedisLockClient redisLockClient;
private final IUserClient iUserClient;
@Override
@ -112,23 +116,22 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
return R.fail("订单"+ distributionStockArticle.getOrderCode() +"不允许拆单");
}
long packageAllowCount = distributionParcelListService.count(
Wrappers.<DistributionParcelListEntity>lambdaQuery()
.in(DistributionParcelListEntity::getStockArticleId, stockArticleId)
.ne(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiqianshou.getValue())
.eq(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.daiyuyue.getValue())
.eq(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.weizhuancghe.getValue())
.eq(DistributionParcelListEntity::getOrderPackageFreezeStatus, OrderPackageFreezeStatusConstant.weidongjie.getValue())
.eq(DistributionParcelListEntity::getIsTransfer, 0)
);
long packageAllCount = distributionParcelListService.count(
Wrappers.<DistributionParcelListEntity>lambdaQuery()
.in(DistributionParcelListEntity::getStockArticleId, stockArticleId)
);
long packageAllowCount = getSplitOrderAllowCount(stockArticleId);
long packageAllCount = getSplitOrderAllCount(stockArticleId);
if (packageAllowCount == 0 || packageAllCount == 1) {
return R.fail("订单"+ distributionStockArticle.getOrderCode() +"包件数量不足,不允许拆单");
}
boolean exists = exists(
Wrappers.<DistributionSplitOrderTaskEntity>lambdaQuery()
.eq(DistributionSplitOrderTaskEntity::getStockArticleId, stockArticleId)
.eq(DistributionSplitOrderTaskEntity::getState, OrderSplitStateConstant.InProgress.getValue())
);
if (exists) {
return R.fail("订单"+ distributionStockArticle.getOrderCode() +"正在拆单中,不允许重复拆单");
}
taskLock(stockArticleId, () -> {
String allTaskNo = getAllTaskNo();
DistributionSplitOrderAllTaskEntity allTask = new DistributionSplitOrderAllTaskEntity();
@ -254,12 +257,12 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
return R.fail("提交包件包含不属于当前拆单订单的包件");
}
int addNumber = packageCodes.size();
try {
List<DistributionSplitOrderDetailEntity> existsList = distributionSplitOrderDetailService.list(Wrappers.<DistributionSplitOrderDetailEntity>lambdaQuery()
.in(DistributionSplitOrderDetailEntity::getOrderPackageCode, packageCodes)
);
int addNumber = packageCodes.size();
if (!existsList.isEmpty()) {
if (existsList.stream().anyMatch(detail -> !detail.getSplitOrderTaskId().equals(taskId) && detail.getState().equals(OrderPackageSplitStateConstant.finish.getValue()))) {
return R.fail("提交包件包含其他拆单任务的包件");
@ -318,7 +321,7 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
log.error("添加包件系统错误", e);
throw new CustomerException("系统错误");
}
return R.success("success");
return Resp.scanSuccess("操作成功", addNumber == 0 ? "重复扫描" : task.getNumber() + "件");
}
@Deprecated
@ -723,6 +726,7 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
* @param taskId
* @return
*/
@Transactional
@Override
public R<String> cancelTask(Long taskId) {
DistributionSplitOrderTaskEntity task = getById(taskId);
@ -735,12 +739,7 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
}
try {
task.setState(OrderSplitStateConstant.cancel.getValue());
updateById(task);
distributionSplitOrderLogService.record(task, "撤消拆单任务", AuthUtil.getUser().getUserName());
cancelTask(task);
} catch (Exception e) {
if (e instanceof CustomerException) {
throw new CustomerException(e.getMessage());
@ -752,11 +751,29 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
return R.success("操作成功");
}
public void cancelTask(DistributionSplitOrderTaskEntity task){
task.setState(OrderSplitStateConstant.cancel.getValue());
updateById(task);
distributionSplitOrderDetailService.update(
Wrappers.<DistributionSplitOrderDetailEntity>lambdaUpdate()
.eq(DistributionSplitOrderDetailEntity::getSplitOrderTaskId, task.getId())
.set(DistributionSplitOrderDetailEntity::getState, OrderPackageSplitStateConstant.cancel.getValue())
.set(DistributionSplitOrderDetailEntity::getCancelUser, AuthUtil.getUser().getUserId())
.set(DistributionSplitOrderDetailEntity::getCancelUsername, AuthUtil.getUser().getUserName())
);
distributionSplitOrderLogService.record(task, "撤消拆单任务", AuthUtil.getUser().getUserName());
}
@Transactional
@Override
public R<String> cancelAllTask(Long allTaskId) {
DistributionSplitOrderAllTaskEntity allTask = distributionSplitOrderAllTaskService.getById(allTaskId);
if (!allTask.getState().equals(OrderSplitAllTaskStateConstant.finish.getValue())) {
return R.fail("拆单总任务已完成,无法操作");
return R.fail("拆单总任务完成,无法操作");
}
if (!list(Wrappers.<DistributionSplitOrderTaskEntity>lambdaQuery()
@ -766,8 +783,19 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
return R.fail("拆单总任务中存在已完成拆单任务,无法操作");
}
List<DistributionSplitOrderTaskEntity> list = list(
Wrappers.<DistributionSplitOrderTaskEntity>lambdaQuery()
.eq(DistributionSplitOrderTaskEntity::getSplitOrderAllTaskId, allTaskId)
);
long finishCount = list.stream().filter(task -> task.getState().equals(OrderSplitStateConstant.finish.getValue())).count();
if (finishCount > 0) {
return R.fail("拆单任务中存在已完成拆单任务,无法操作");
}
allTask.setState(OrderSplitAllTaskStateConstant.cancel.getValue());
distributionSplitOrderAllTaskService.updateById(allTask);
list.forEach(this::cancelTask);
return R.success("success");
}
@ -780,11 +808,11 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
return R.fail("拆单总任务已完成或已取消,无法操作");
}
DistributionSplitOrderTaskEntity existsInProgress = getOne(Wrappers.<DistributionSplitOrderTaskEntity>lambdaQuery()
boolean existsInProgress = exists(Wrappers.<DistributionSplitOrderTaskEntity>lambdaQuery()
.eq(DistributionSplitOrderTaskEntity::getSplitOrderAllTaskId, allTaskId)
.eq(DistributionSplitOrderTaskEntity::getState, OrderSplitStateConstant.InProgress.getValue())
);
if (existsInProgress != null) {
if (existsInProgress) {
return R.fail("拆单总任务中存在未完成拆单任务,无法操作");
}
@ -836,8 +864,9 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
}
@Override
public R<IPage<DistributionSplitOrderAllTaskEntity>> allTaskList(Query query, DistributionSplitAllTaskSearchDTO distributionSplitAllTaskSearchDTO) {
public R<IPage<DistributionSplitOrderAllTaskVO>> allTaskList(Query query, DistributionSplitAllTaskSearchDTO distributionSplitAllTaskSearchDTO) {
IPage<DistributionSplitOrderAllTaskEntity> page = Condition.getPage(query);
IPage<DistributionSplitOrderAllTaskVO> pageResult = Condition.getPage(query);
LambdaQueryWrapper<DistributionSplitOrderAllTaskEntity> queryWrapper = Wrappers.lambdaQuery();
@ -878,16 +907,29 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
}
if (splitOrderAllTaskId == 0) {
return R.data(page);
return R.data(pageResult);
}
queryWrapper.eq(DistributionSplitOrderAllTaskEntity::getId, splitOrderAllTaskId);
}
List<DistributionSplitOrderAllTaskEntity> list = distributionSplitOrderAllTaskService.list(page, queryWrapper);
page.setRecords(list);
return R.data(page);
String createUserIds = list.stream().map((d) -> d.getCreateUser() + "").collect(Collectors.joining(","));
List<User> users = iUserClient.userInfoByIds(AuthUtil.getTenantId(), String.join(",", createUserIds)).getData();
Map<Long, User> userMap = users.stream().collect(Collectors.toMap(User::getId, u -> u));
List<DistributionSplitOrderAllTaskVO> listVo = list.stream().map(d -> {
DistributionSplitOrderAllTaskVO vo = new DistributionSplitOrderAllTaskVO();
BeanUtil.copyProperties(d, vo);
vo.setCreateUserName(userMap.get(d.getCreateUser()).getName());
return vo;
}).collect(Collectors.toList());
pageResult.setRecords(listVo);
pageResult.setPages(page.getPages());
pageResult.setTotal(page.getTotal());
return R.data(pageResult);
}
@Override
@ -906,16 +948,35 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
return R.data(res);
}
public long getSplitOrderAllowCount(Long stockArticleId) {
return distributionParcelListService.count(
Wrappers.<DistributionParcelListEntity>lambdaQuery()
.in(DistributionParcelListEntity::getStockArticleId, stockArticleId)
.ne(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiqianshou.getValue())
.eq(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.daiyuyue.getValue())
.eq(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.weizhuancghe.getValue())
.eq(DistributionParcelListEntity::getOrderPackageFreezeStatus, OrderPackageFreezeStatusConstant.weidongjie.getValue())
.eq(DistributionParcelListEntity::getIsTransfer, 0)
);
}
@Override
public R<String> checkOrderCode(String orderCode) {
DistributionSplitOrderAllTaskEntity exists = distributionSplitOrderAllTaskService.getOne(
Wrappers.<DistributionSplitOrderAllTaskEntity>lambdaQuery()
.eq(DistributionSplitOrderAllTaskEntity::getOrderCode, orderCode)
public long getSplitOrderAllCount(Long stockArticleId) {
return distributionParcelListService.count(
Wrappers.<DistributionParcelListEntity>lambdaQuery()
.in(DistributionParcelListEntity::getStockArticleId, stockArticleId)
);
}
return R.success(exists == null ? "" : exists.getNo());
@Override
public R<String> checkOrderCode(String orderCode) {
DistributionStockArticleEntity distributionStockArticle = distributionStockArticleService.getOne(Wrappers.<DistributionStockArticleEntity>lambdaQuery()
.eq(DistributionStockArticleEntity::getOrderCode, orderCode));
long splitOrderAllCount = getSplitOrderAllCount(distributionStockArticle.getId());
long splitOrderAllowCount = getSplitOrderAllowCount(distributionStockArticle.getId());
if (splitOrderAllowCount == 0 || splitOrderAllCount == 1) {
return R.success("该订单无法拆单");
}
return R.success("");
}
@Override

11
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/vo/DistributionSplitOrderAllTaskVO.java

@ -0,0 +1,11 @@
package com.logpm.distribution.vo;
import com.logpm.distribution.entity.DistributionSplitOrderAllTaskEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
@Data
public class DistributionSplitOrderAllTaskVO extends DistributionSplitOrderAllTaskEntity {
private String createUserName;
}

11
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/vo/DistributionSplitOrderTaskVO.java

@ -0,0 +1,11 @@
package com.logpm.distribution.vo;
import com.logpm.distribution.entity.DistributionSplitOrderTaskEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
@Data
public class DistributionSplitOrderTaskVO extends DistributionSplitOrderTaskEntity {
private String createUserName;
}

68
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/job/AdvanceJob.java

@ -1,9 +1,10 @@
package com.logpm.factorydata.jinpai.job;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.factorydata.base.feign.IFactoryDataBaseClient;
import com.logpm.factorydata.feign.IFactoryDataClient;
import com.logpm.factorydata.jinpai.entity.DeliveryNoteEntity;
import com.logpm.factorydata.jinpai.entity.OrderInfoEntity;
import com.logpm.factorydata.jinpai.entity.PackageInfoEntity;
@ -14,9 +15,9 @@ 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.annotations.LogpmAsync;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@ -62,6 +63,21 @@ public class AdvanceJob {
// 将数据封装到packageInfoEntityMap中 其中omsExtOrderNo为key
packageInfoEntityMap.computeIfAbsent(entity.getOmsExtOrderNo(), k -> new ArrayList<>()).add(entity);
}
}
List<OrderInfoEntity> orders = orderInfoService.list(Wrappers.<OrderInfoEntity>lambdaQuery().eq(OrderInfoEntity::getReserve1, "0"));
if (CollUtil.isNotEmpty(orders)) {
for (OrderInfoEntity order : orders) {
orderInfoSet.add(order.getOmsExtOrderNo());
}
}
List<OrderInfoEntity> orderInfoEntities = orderInfoService.list(Wrappers.<OrderInfoEntity>lambdaQuery().in(OrderInfoEntity::getOmsExtOrderNo, orderInfoSet));
if (CollUtil.isNotEmpty(orderInfoEntities)) {
for (OrderInfoEntity entity : orderInfoEntities) {
String omsExtOrderNo = entity.getOmsExtOrderNo();
orderInfoEntityMap.put(omsExtOrderNo, entity);
deliveryNoteSet.add(entity.getOrderId());
}
}
// 根据订单数据查询出所有订单明细和包件信息
List<DeliveryNoteEntity> deliveryNoteEntities = deliveryNoteService.list(Wrappers.<DeliveryNoteEntity>lambdaQuery().in(DeliveryNoteEntity::getOrderId, deliveryNoteSet));
if (CollUtil.isNotEmpty(deliveryNoteEntities)) {
@ -69,14 +85,56 @@ public class AdvanceJob {
deliveryNoteEntityMap.put(entity.getOrderId(), entity);
}
}
List<OrderInfoEntity> orderInfoEntities = orderInfoService.list(Wrappers.<OrderInfoEntity>lambdaQuery().in(OrderInfoEntity::getOmsExtOrderNo, orderInfoSet));
// 处理无包条的情况
if (CollUtil.isNotEmpty(orderInfoEntities)) {
for (OrderInfoEntity entity : orderInfoEntities) {
orderInfoEntityMap.put(entity.getOmsExtOrderNo(), entity);
String omsExtOrderNo = entity.getOmsExtOrderNo();
String goodsNumber = entity.getGoodsNumber();
if (!packageInfoEntityMap.containsKey(omsExtOrderNo)) {
// 订单没有包件,生成包件
if (StrUtil.isNotEmpty(goodsNumber)) {
Integer anInt = Convert.toInt(goodsNumber);
if (anInt > 0) {
// 创建包件
List<PackageInfoEntity> packageInfoEntities = new ArrayList<>();
for (int i = 0; i < anInt; i++) {
PackageInfoEntity packageInfoEntity = new PackageInfoEntity();
packageInfoEntity.setOrderId(entity.getOrderId());
packageInfoEntity.setOmsExtOrderNo(omsExtOrderNo);
packageInfoEntity.setGoodsNum(entity.getGoodsNumber());
packageInfoEntity.setBoxType1(entity.getGoodsType());
packageInfoEntity.setBoxType2(entity.getGoodsType());
packageInfoEntity.setBoxType3(entity.getGoodsType());
packageInfoEntity.setExtBoxCode(deliveryNoteEntityMap.get(entity.getOrderId()).getOmsExtYsId() + omsExtOrderNo + "-" + i);
String goodsVolume = entity.getGoodsVolume();
if (StrUtil.isNotEmpty(goodsVolume)) {
BigDecimal div = NumberUtil.div(Convert.toBigDecimal(goodsVolume), Convert.toBigDecimal(anInt), 4);
packageInfoEntity.setGoodsVolume(Convert.toStr(div));
}
packageInfoEntities.add(packageInfoEntity);
}
packageInfoEntityMap.put(omsExtOrderNo, packageInfoEntities);
}
}
}
}
}
// 组装数据,然后生成暂存单
deliveryNoteService.buildAdvancePull(packageInfoEntityMap, deliveryNoteEntityMap, orderInfoEntityMap);
if (CollUtil.isNotEmpty(orderInfoEntities)) {
// 修改包件的发送状态 TODO 后面修改为暂存单消费完成之后回调更新状态
List<OrderInfoEntity> updatePackageList = new ArrayList<>();
for (OrderInfoEntity entity : orderInfoEntities) {
OrderInfoEntity updateEntity = new OrderInfoEntity();
updateEntity.setReserve1("1");
updateEntity.setId(entity.getId());
updatePackageList.add(updateEntity);
}
if (CollUtil.isNotEmpty(updatePackageList)) {
orderInfoService.updateBatchById(updatePackageList);
}
}
if (CollUtil.isNotEmpty(list)) {
// 修改包件的发送状态 TODO 后面修改为暂存单消费完成之后回调更新状态
List<PackageInfoEntity> updatePackageList = new ArrayList<>();
for (PackageInfoEntity entity : list) {

2
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/MqWorkerServiceImpl.java

@ -307,6 +307,8 @@ public class MqWorkerServiceImpl implements MqWorkerService {
OrderInfoEntity deliveryNoteEntity = new OrderInfoEntity();
BeanUtil.copyProperties(vo, deliveryNoteEntity);
deliveryNoteEntity.setLogId(ObjectUtil.isNotEmpty(logEntity.getId()) ? logEntity.getId().toString() : null);
// 是否推送
deliveryNoteEntity.setReserve1("0");
entities.add(deliveryNoteEntity);
}
if (CollUtil.isNotEmpty(entities)) {

3
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/mapper/FactoryPackageMapper.xml

@ -22,7 +22,8 @@
ofp.first_class_name,
ofp.second_class_name,
ofp.third_class_name,
ofp.push_status
ofp.push_status,
ofo.business_model
FROM
op_factory_package ofp
LEFT JOIN op_factory_order ofo ON ofo.id = ofp.order_id

12
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.xml

@ -958,6 +958,12 @@
<if test="param.settlementStatus != null">
and lww.settlement_status = #{param.settlementStatus}
</if>
<if test="param.startTime != null ">
and lww.document_making_time &gt;= #{param.startTime}
</if>
<if test="param.endTime != null ">
and lww.document_making_time &lt;= #{param.endTime}
</if>
GROUP BY lww.id
order by lww.create_time desc
</select>
@ -1251,6 +1257,12 @@
<if test="param.settlementStatus != null">
and lww.settlement_status = #{param.settlementStatus}
</if>
<if test="param.startTime != null ">
and lww.document_making_time &gt;= #{param.startTime}
</if>
<if test="param.endTime != null ">
and lww.document_making_time &lt;= #{param.endTime}
</if>
GROUP BY lww.id
order by lww.create_time desc
</select>

3
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/TrunklinePickupMapper.xml

@ -248,7 +248,7 @@
</sql>
<select id="b2BDeliveryTimelinessPage" resultType="com.logpm.report.vo.trunklinebillloading.B2BDeliverTimelinessVO">
select
select * from (select
<if test="query.businessLineRange == null or query.businessLineRange == ''">
'全部' businessLine,
</if>
@ -407,6 +407,7 @@
</if>
</trim>
</if>
) t
</select>
<select id="efficiencyCostPage"

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java

@ -1096,6 +1096,9 @@ public class CarsLoadController {
carsLoadService.unloadByLoadId(loadCarsDTO);
try{
//同步一次系统无编码数据
carsLoadService.syncNoSystemData(loadId, myCurrentWarehouse.getId(), myCurrentWarehouse.getName());
carsLoadService.sendStationArrivedEnter(loadCarsDTO);
}catch (Exception e){

9
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

@ -6193,6 +6193,15 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
if (Objects.isNull(orderId)) {
log.warn("#################createStockArticle: 保存订单信息失败 orderCode={}", distributionStockArticleEntity.getOrderCode());
throw new CustomerException(405, "保存订单信息失败");
}else{
if(orderId.equals(0L)){
log.warn("################createStockArticle: 订单信息保存失败 orderCode={} warehouseId={}",distributionStockArticleEntity.getOrderCode(),distributionStockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息保存失败");
}
if(orderId.equals(1L)){
log.warn("################dealAbnocreateStockArticlermal: 订单信息正在更新 orderCode={} warehouseId={}",distributionStockArticleEntity.getOrderCode(),distributionStockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息正在更新,请稍后重试");
}
}
List<WarehouseWayBillDetail> wayBillDetailList = warehouseWaybillDetailClient.findByWaybillId(warehouseWaybill.getId());

19
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java

@ -233,6 +233,16 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
if (Objects.isNull(orderId)) {
log.warn("##############saveOrderAndPackage: 订单信息有误 orderId={}", orderId);
throw new CustomerException(405, "订单信息有误");
}else{
if(orderId.equals(0L)){
log.warn("################saveOrderAndPackage: 订单信息保存失败 orderCode={} warehouseId={}",stockArticleEntity.getOrderCode(),stockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息保存失败");
}
if(orderId.equals(1L)){
log.warn("################saveOrderAndPackage: 订单信息正在更新 orderCode={} warehouseId={}",stockArticleEntity.getOrderCode(),stockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息正在更新,请稍后重试");
}
}
log.info("#############saveOrderAndPackage: 订单信息保存成功 orderId={}", orderId);
@ -582,6 +592,15 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
if (Objects.isNull(orderId)) {
log.warn("##############saveOrderAndPackage: 订单信息有误 orderId={}", orderId);
throw new CustomerException(405, "订单信息有误");
}else{
if(orderId.equals(0L)){
log.warn("################saveOrderAndPackage: 订单信息保存失败 orderCode={} warehouseId={}",stockArticleEntity.getOrderCode(),stockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息保存失败");
}
if(orderId.equals(1L)){
log.warn("################saveOrderAndPackage: 订单信息正在更新 orderCode={} warehouseId={}",stockArticleEntity.getOrderCode(),stockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息正在更新,请稍后重试");
}
}
stockArticleClient.updateAllOrderTotalNum(orderCode, total);

213
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -54,12 +54,18 @@ import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;
import org.springblade.common.annotations.RepeatSubmit;
import org.springblade.common.constant.*;
import org.springblade.common.constant.broadcast.FanoutConstants;
import org.springblade.common.constant.carsload.CarsLoadLogTypeConstant;
import org.springblade.common.enums.BizOperationEnums;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.model.NodeFanoutMsg;
import org.springblade.common.model.PackageData;
import org.springblade.common.model.TripartiteVO;
import org.springblade.common.utils.CommonUtil;
import org.springblade.common.utils.QRCodeUtil;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
@ -1347,6 +1353,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
newStockArticleEntity.setWarehouseEntryTimeEnd(date);
Long orderId = distributionStockArticleClient.addData(newStockArticleEntity);
if (orderId != 0) {
if(orderId.equals(1L)){
log.warn("################unloadByLoadId: 订单信息正在更新 orderCode={} warehouseId={}",stockArticleEntity.getOrderCode(),stockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息正在更新,请稍后重试");
}
Integer isTransfer = 1;
List<DistributionParcelListVO> parcelListEntityList = distributionParcelListClient.findEntityVOListByOrderCode(orderCode, fromWarehouseId);
@ -1516,8 +1528,6 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
String content = "包件在 " + warehouseEntity.getName() + "卸车确认";
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseEntity.getName(), node.getCode(), content);
//同步一次系统无编码数据
syncNoSystemData(loadId, warehouseId, warehouseEntity.getName());
} catch (Exception e) {
log.warn("###############unloadPackage: 存入异常列表记录失败");
@ -5203,6 +5213,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
newStockArticleEntity.setWarehouseEntryTimeEnd(date);
Long orderId = distributionStockArticleClient.addData(newStockArticleEntity);
if (orderId != 0) {
if(orderId.equals(1L)){
log.warn("################zeroUnloadEnter: 订单信息正在更新 orderCode={} warehouseId={}",stockArticleEntity.getOrderCode(),stockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息正在更新,请稍后重试");
}
Integer isTransfer = 1;
List<DistributionParcelListVO> parcelListEntityList = distributionParcelListClient.findEntityVOListByOrderCode(orderCode, fromWarehouseId);
@ -5751,6 +5765,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
if(NumberUtil.equals(orderId,0)){
log.warn("################111111: 保存失败");
throw new CustomerException(405,"保存失败");
}else{
if(orderId.equals(1L)){
log.warn("################updateParcelListToWarehouse: 订单信息正在更新 orderCode={} warehouseId={}",stockArticleEntity.getOrderCode(),stockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息正在更新,请稍后重试");
}
}
}else{
stockArticleEntity.setGenre(1);
@ -7630,6 +7649,15 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
newStockArticleEntity.setAllocation(null);
newStockArticleEntity.setTrays(null);
orderId = distributionStockArticleClient.addData(newStockArticleEntity);
if(orderId.equals(0L)){
log.warn("################batchUnload: 订单信息保存失败 orderCode={} warehouseId={}",stockArticleEntity.getOrderCode(),stockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息保存失败");
}
if(orderId.equals(1L)){
log.warn("################batchUnload: 订单信息正在更新 orderCode={} warehouseId={}",stockArticleEntity.getOrderCode(),stockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息正在更新,请稍后重试");
}
finalOrderCodes.put(e, orderId);
}
@ -7751,6 +7779,14 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
newStockArticleEntity.setAllocation(null);
newStockArticleEntity.setTrays(null);
orderId = distributionStockArticleClient.addData(newStockArticleEntity);
if(orderId.equals(0L)){
log.warn("################batchUnload: 订单信息保存失败 orderCode={} warehouseId={}",stockArticleEntity.getOrderCode(),stockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息保存失败");
}
if(orderId.equals(1L)){
log.warn("################batchUnload: 订单信息正在更新 orderCode={} warehouseId={}",stockArticleEntity.getOrderCode(),stockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息正在更新,请稍后重试");
}
finalOrderCodes1.put(e, orderId);
}
@ -9716,6 +9752,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
// 推送签收数据给工厂
sendFactorySignTriparite(warehouseId, orderPackageCodes, warehouseEntity);
List<PackageData> packageDataList = new ArrayList<>();
List<TrunklineCarsLoadScanEntity> loadScanEntityList = trunklineCarsLoadScanService.findListByIds(loadScanIds);
//把loadScanEntityList中所有元素通过type进行分组
Map<Integer, List<TrunklineCarsLoadScanEntity>> map = loadScanEntityList.stream().collect(Collectors.groupingBy(TrunklineCarsLoadScanEntity::getType));
@ -9727,30 +9765,107 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
List<String> scanCodes = trunklineCarsLoadScanEntities.stream().map(TrunklineCarsLoadScanEntity::getScanCode).collect(Collectors.toList());
//TODO 暂时注释
// carsLoadAsyncService.sendReportPackageSignData(AuthUtil.getNickName(),AuthUtil.getUserId(),warehouseId,warehouseName,carsLoadEntity,scanCodes);
// FindParamterDTO findParamterDTO = new FindParamterDTO();
// findParamterDTO.setOrderPackageCodeList(scanCodes);
// findParamterDTO.setWarehouseId(warehouseId);
// List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListClient.findListByOrderPackageCodeList(findParamterDTO);
// parcelListEntityList.forEach(parcelListEntity -> {
// PackageData packageData = new PackageData();
// packageData.setWaybillNumber(parcelListEntity.getWaybillNumber());
// packageData.setBrand(parcelListEntity.getBrandName());
// packageData.setPackageCode(parcelListEntity.getOrderPackageCode());
// packageData.setMaterialCode(parcelListEntity.getMaterialCode());
// packageData.setMaterialName(parcelListEntity.getMaterialName());
// packageData.setNumber(1);
// packageData.setOrderCode(parcelListEntity.getOrderCode());
// packageData.setPackageType(PackageTypeEnums.CMP);
// packageDataList.add(packageData);
// });
}else{
trunklineCarsLoadScanEntities.forEach(carsLoadScanEntity -> {
Long scanId = carsLoadScanEntity.getId();
List<TrunklineScanZeroDetailVO> zeroDetailVOList = scanZeroDetailService.findListByCarsLoadScanId(scanId);
//把zeroDetailList中所有元素的packageId放入一个List
List<Long> packageIds = zeroDetailVOList.stream().map(TrunklineScanZeroDetailEntity::getPackageId).collect(Collectors.toList());
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListClient.findListByIds(packageIds);
//把parcelListEntityList转成以id为key的Map
Map<Long, DistributionParcelListEntity> parcelListMap = parcelListEntityList.stream().collect(Collectors.toMap(DistributionParcelListEntity::getId, Function.identity()));
List<TrunklineScanZeroDetailEntity> zeroDetailList = new ArrayList<>();
zeroDetailVOList.forEach(zeroDetailVO -> {
TrunklineScanZeroDetailEntity entity = new TrunklineScanZeroDetailEntity();
BeanUtil.copy(zeroDetailVO, entity);
zeroDetailList.add(entity);
// Long packageId = zeroDetailVO.getPackageId();
// DistributionParcelListEntity parcelList = parcelListMap.get(packageId);
// if(!Objects.isNull(parcelList)){
// PackageData packageData = new PackageData();
// packageData.setWaybillNumber(parcelList.getWaybillNumber());
// packageData.setBrand(parcelList.getBrandName());
// packageData.setProductId(zeroDetailVO.getGoodsId());
// packageData.setProductName(zeroDetailVO.getGoodsName());
// packageData.setNumber(zeroDetailVO.getUnloadNum());
// packageData.setOrderCode(parcelList.getOrderCode());
// packageData.setPackageType(PackageTypeEnums.LTL);
// packageDataList.add(packageData);
// }
});
//TODO 暂时注释
// carsLoadAsyncService.sendReportZeroPackageSignData(AuthUtil.getUserId(), AuthUtil.getNickName(), warehouseId, warehouseName, zeroDetailList, carsLoadScanEntity, carsLoadEntity);
});
}
});
// NodeFanoutMsg<TripartiteVO> tripartiteVONodeFanoutMsg = buildNodeFanoutMessage(carsLoadEntity, packageDataList, warehouseId);
// if(!Objects.isNull(tripartiteVONodeFanoutMsg)){
// rabbitTemplate.convertAndSend(FanoutConstants.trunkline.tripartite.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(tripartiteVONodeFanoutMsg));
// }
return R.success("签收成功");
}
private NodeFanoutMsg<TripartiteVO> buildNodeFanoutMessage(TrunklineCarsLoadEntity carsLoadEntity, List<PackageData> packageDataList,Long warehouseId) {
try {
BladeUser user = AuthUtil.getUser();
NodeFanoutMsg<TripartiteVO> nodeFanoutMsg = new NodeFanoutMsg<TripartiteVO>();
nodeFanoutMsg.setBizOperation(BizOperationEnums.ADD);
nodeFanoutMsg.setNode(WorkNodeEnums.SIGN_TRIPARTITE_TRANSFER_DEPART);
BasicdataWarehouseEntity entityWarehouse = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
if (entityWarehouse != null) {
nodeFanoutMsg.setWarehouse(entityWarehouse.getName());
}
nodeFanoutMsg.setWarehouseId(warehouseId);
nodeFanoutMsg.setOperator(user.getNickName());
nodeFanoutMsg.setOperatorTime(new Date());
TripartiteVO tripartiteVO = new TripartiteVO();
BeanUtil.copy(carsLoadEntity, tripartiteVO);
// ReservationVO reservationVO = distributionReservationService.getReservationVO(reservationEntity);
tripartiteVO.setPackageDataList(packageDataList);
nodeFanoutMsg.setMain(tripartiteVO);
nodeFanoutMsg.setTenantId(AuthUtil.getTenantId());
return nodeFanoutMsg;
} catch (Exception e) {
log.warn("三方中转签收:发送三方中转签收节点消息失败", e);
}
return null;
}
private void sendFactorySignTriparite(Long warehouseId, List<String> orderPackageCodes, BasicdataWarehouseEntity warehouseEntity) {
try {
FindParamterDTO paramterDTO = new FindParamterDTO();
@ -10107,6 +10222,14 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
newEntity.setAllocation(null);
newEntity.setTrays(null);
Long orderId = distributionStockArticleClient.addData(newEntity);
if(orderId.equals(0L)){
log.warn("################getDistributionStockArticle: 订单信息保存失败 orderCode={} warehouseId={}",newEntity.getOrderCode(),newEntity.getWarehouseId());
throw new CustomerException(405,"订单信息保存失败");
}
if(orderId.equals(1L)){
log.warn("################getDistributionStockArticle: 订单信息正在更新 orderCode={} warehouseId={}",newEntity.getOrderCode(),newEntity.getWarehouseId());
throw new CustomerException(405,"订单信息正在更新,请稍后重试");
}
newEntity.setId(orderId);
return newEntity;
}
@ -11896,7 +12019,17 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
currentStockArticleEntity.setIncomingNum(0);
currentStockArticleEntity.setAllocation(null);
currentStockArticleEntity.setTrays(null);
currentStockArticleEntity.setWarehouseEntryTime(new Date());
currentStockArticleEntity.setWarehouseEntryTimeEnd(new Date());
currentOrderId = distributionStockArticleClient.addData(currentStockArticleEntity);
if(currentOrderId.equals(0L)){
log.warn("################unloadPackage: 订单信息保存失败 orderCode={} warehouseId={}",currentStockArticleEntity.getOrderCode(),currentStockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息保存失败");
}
if(currentOrderId.equals(1L)){
log.warn("################unloadPackage: 订单信息正在更新 orderCode={} warehouseId={}",currentStockArticleEntity.getOrderCode(),currentStockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息正在更新,请稍后重试");
}
currentStockArticleEntity.setId(currentOrderId);
} else {
currentOrderId = currentStockArticleEntity.getId();
@ -12109,7 +12242,17 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
currentStockArticleEntity.setGenre(1);
currentStockArticleEntity.setAllocation(null);
currentStockArticleEntity.setTrays(null);
currentStockArticleEntity.setWarehouseEntryTime(new Date());
currentStockArticleEntity.setWarehouseEntryTimeEnd(new Date());
currentOrderId = distributionStockArticleClient.addData(currentStockArticleEntity);
if(currentOrderId.equals(0L)){
log.warn("################unloadPackage: 订单信息保存失败 orderCode={} warehouseId={}",currentStockArticleEntity.getOrderCode(),currentStockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息保存失败");
}
if(currentOrderId.equals(1L)){
log.warn("################unloadPackage: 订单信息正在更新 orderCode={} warehouseId={}",currentStockArticleEntity.getOrderCode(),currentStockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息正在更新,请稍后重试");
}
currentStockArticleEntity.setId(currentOrderId);
} else {
currentOrderId = currentStockArticleEntity.getId();
@ -12281,7 +12424,17 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
stockArticleEntity.setIncomingNum(0);
stockArticleEntity.setAllocation(null);
stockArticleEntity.setTrays(null);
stockArticleEntity.setWarehouseEntryTime(new Date());
stockArticleEntity.setWarehouseEntryTimeEnd(new Date());
currentOrderId = distributionStockArticleClient.addData(stockArticleEntity);
if(currentOrderId.equals(0L)){
log.warn("################unloadPackage: 订单信息保存失败 orderCode={} warehouseId={}",stockArticleEntity.getOrderCode(),stockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息保存失败");
}
if(currentOrderId.equals(1L)){
log.warn("################unloadPackage: 订单信息正在更新 orderCode={} warehouseId={}",stockArticleEntity.getOrderCode(),stockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息正在更新,请稍后重试");
}
stockArticleEntity.setId(currentOrderId);
} else {
currentOrderId = stockArticleEntity.getId();
@ -12379,7 +12532,18 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
newStockArticle.setWarehouse(basicdataWarehouseEntity.getName());
newStockArticle.setAllocation(null);
newStockArticle.setTrays(null);
newStockArticle.setWarehouseEntryTime(new Date());
newStockArticle.setWarehouseEntryTimeEnd(new Date());
orderId = distributionStockArticleClient.addData(newStockArticle);
if(orderId.equals(0L)){
log.warn("################unloadPackage: 订单信息保存失败 orderCode={} warehouseId={}",newStockArticle.getOrderCode(),newStockArticle.getWarehouseId());
throw new CustomerException(405,"订单信息保存失败");
}
if(orderId.equals(1L)){
log.warn("################unloadPackage: 订单信息正在更新 orderCode={} warehouseId={}",newStockArticle.getOrderCode(),newStockArticle.getWarehouseId());
throw new CustomerException(405,"订单信息正在更新,请稍后重试");
}
} else {
orderId = newStockArticle.getId();
}
@ -12744,7 +12908,17 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
currentStockArticleEntity.setTransferQuantity(0);
currentStockArticleEntity.setSigninQuantity(0);
currentStockArticleEntity.setIncomingNum(0);
currentStockArticleEntity.setWarehouseEntryTime(new Date());
currentStockArticleEntity.setWarehouseEntryTimeEnd(new Date());
currentOrderId = distributionStockArticleClient.addData(currentStockArticleEntity);
if(currentOrderId.equals(0L)){
log.warn("################unloadPackageNoXz: 订单信息保存失败 orderCode={} warehouseId={}",currentStockArticleEntity.getOrderCode(),currentStockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息保存失败");
}
if(currentOrderId.equals(1L)){
log.warn("################unloadPackageNoXz: 订单信息正在更新 orderCode={} warehouseId={}",currentStockArticleEntity.getOrderCode(),currentStockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息正在更新,请稍后重试");
}
currentStockArticleEntity.setId(currentOrderId);
} else {
currentOrderId = currentStockArticleEntity.getId();
@ -12891,7 +13065,17 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
currentStockArticleEntity.setTransferQuantity(0);
currentStockArticleEntity.setSigninQuantity(0);
currentStockArticleEntity.setIncomingNum(0);
currentStockArticleEntity.setWarehouseEntryTime(new Date());
currentStockArticleEntity.setWarehouseEntryTimeEnd(new Date());
currentOrderId = distributionStockArticleClient.addData(currentStockArticleEntity);
if(currentOrderId.equals(0L)){
log.warn("################unloadPackageNoXz: 订单信息保存失败 orderCode={} warehouseId={}",currentStockArticleEntity.getOrderCode(),currentStockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息保存失败");
}
if(currentOrderId.equals(1L)){
log.warn("################unloadPackageNoXz: 订单信息正在更新 orderCode={} warehouseId={}",currentStockArticleEntity.getOrderCode(),currentStockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息正在更新,请稍后重试");
}
currentStockArticleEntity.setId(currentOrderId);
} else {
currentOrderId = currentStockArticleEntity.getId();
@ -13054,7 +13238,17 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
stockArticleEntity.setIncomingNum(0);
stockArticleEntity.setAllocation(null);
stockArticleEntity.setTrays(null);
stockArticleEntity.setWarehouseEntryTime(new Date());
stockArticleEntity.setWarehouseEntryTimeEnd(new Date());
currentOrderId = distributionStockArticleClient.addData(stockArticleEntity);
if(currentOrderId.equals(0L)){
log.warn("################unloadPackageNoXz: 订单信息保存失败 orderCode={} warehouseId={}",stockArticleEntity.getOrderCode(),stockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息保存失败");
}
if(currentOrderId.equals(1L)){
log.warn("################unloadPackageNoXz: 订单信息正在更新 orderCode={} warehouseId={}",stockArticleEntity.getOrderCode(),stockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息正在更新,请稍后重试");
}
stockArticleEntity.setId(currentOrderId);
} else {
currentOrderId = stockArticleEntity.getId();
@ -13149,7 +13343,17 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
newStockArticle.setWarehouse(basicdataWarehouseEntity.getName());
newStockArticle.setAllocation(null);
newStockArticle.setTrays(null);
newStockArticle.setWarehouseEntryTime(new Date());
newStockArticle.setWarehouseEntryTimeEnd(new Date());
orderId = distributionStockArticleClient.addData(newStockArticle);
if(orderId.equals(0L)){
log.warn("################unloadPackageNoXz: 订单信息保存失败 orderCode={} warehouseId={}",newStockArticle.getOrderCode(),newStockArticle.getWarehouseId());
throw new CustomerException(405,"订单信息保存失败");
}
if(orderId.equals(1L)){
log.warn("################unloadPackageNoXz: 订单信息正在更新 orderCode={} warehouseId={}",newStockArticle.getOrderCode(),newStockArticle.getWarehouseId());
throw new CustomerException(405,"订单信息正在更新,请稍后重试");
}
} else {
orderId = newStockArticle.getId();
}
@ -13849,6 +14053,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
newStockArticleEntity.setCarsLoadNum(0);
Long orderId = distributionStockArticleClient.addData(newStockArticleEntity);
if (orderId != 0) {
if(orderId.equals(1L)){
log.warn("################unloadZeroWithTray: 订单信息正在更新 orderCode={} warehouseId={}",newStockArticleEntity.getOrderCode(),newStockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息正在更新,请稍后重试");
}
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListClient.findEntityListByOrderCode(orderCode, fromWarehouseId);
List<DistributionParcelNumberEntity> ls = new ArrayList<>();
for (DistributionParcelListEntity parcelListEntity : parcelListEntityList) {

11
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

@ -4877,10 +4877,15 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
id = distributionStockArticleClient.addData(distributionStockArticleEntity);
distributionStockArticleEntity.setId(id);
if (id == 0) {
log.warn("#################handleDataToPlatform: 保存订单信息失败 orderCode={}", orderCode);
throw new CustomerException(405, "保存订单信息失败");
if(id.equals(0L)){
log.warn("################handleDataToPlatform: 订单信息保存失败 orderCode={} warehouseId={}",distributionStockArticleEntity.getOrderCode(),distributionStockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息保存失败");
}
if(id.equals(1L)){
log.warn("################handleDataToPlatform: 订单信息正在更新 orderCode={} warehouseId={}",distributionStockArticleEntity.getOrderCode(),distributionStockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息正在更新,请稍后重试");
}
} else {
id = distributionStockArticleEntity.getId();
distributionStockArticleEntity.setTotalNumber(total);

16
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

@ -285,9 +285,13 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
distributionStockArticleEntity.setDescriptionGoods(sb.toString());
id = distributionStockArticleClient.addData(distributionStockArticleEntity);
if (id == 0) {
log.warn("#################createStockArticle: 保存订单信息失败 orderSelfNum={}", waybillNo);
throw new CustomerException(405, "保存订单信息失败");
if(id.equals(0L)){
log.warn("################createStockArticle: 订单信息保存失败 orderCode={} warehouseId={}",distributionStockArticleEntity.getOrderCode(),distributionStockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息保存失败");
}
if(id.equals(1L)){
log.warn("################createStockArticle: 订单信息正在更新 orderCode={} warehouseId={}",distributionStockArticleEntity.getOrderCode(),distributionStockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息正在更新,请稍后重试");
}
//第一次生成订单也要生成包件信息
@ -460,6 +464,12 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
log.warn("###########splitOrder: 保存新订单数据失败");
throw new CustomerException(405, "保存新订单数据失败");
} else {
if(aLong.equals(1L)){
log.warn("################splitOrder: 订单信息正在更新 orderCode={} warehouseId={}",distributionStockArticleEntity.getOrderCode(),distributionStockArticleEntity.getWarehouseId());
throw new CustomerException(405,"订单信息正在更新,请稍后重试");
}
List<DistributionParcelNumberEntity> parcelNumberList = new ArrayList<>();
for (ProductDTO productDTO : products) {
String productName = productDTO.getProductName();

Loading…
Cancel
Save