Browse Source

Merge branch 'refs/heads/dev' into chenglong

dist.1.3.0
chenlong 8 months ago
parent
commit
dc7694cd4a
  1. 45
      blade-biz-common/src/main/java/org/springblade/common/enums/BrandEnums.java
  2. 31
      blade-biz-common/src/main/java/org/springblade/common/enums/PackageTypeEnums.java
  3. 59
      blade-biz-common/src/main/java/org/springblade/common/model/NodeFanoutMsg.java
  4. 49
      blade-biz-common/src/main/java/org/springblade/common/model/PackageData.java
  5. 13
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/ZeroNumVO.java
  6. 2
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java
  7. 9
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java
  8. 10
      blade-service/logpm-business/src/main/java/com/logpm/business/controller/DistributionBusinessPreOrderController.java
  9. 21
      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/api/DistributionSignforAppController.java
  11. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java
  12. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java
  13. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java
  14. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  15. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/BillLadingScanDataQueueHandler.java
  16. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  17. 18
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  18. 15
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  19. 70
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  20. 25
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
  21. 7
      blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java
  22. 12
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java
  23. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java
  24. 10
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml
  25. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java
  26. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineWaybillOrderService.java
  27. 6
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java
  28. 294
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  29. 9
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillOrderServiceImpl.java
  30. 51
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/TaskQuestController.java
  31. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWaybillController.java
  32. 3
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/QuestDetailDTO.java
  33. 109
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/excel/QuestContrastPackageExcelVO.java
  34. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.java
  35. 81
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml
  36. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java
  37. 19
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java
  38. 10
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownStockupAreaServiceImpl.java
  39. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java

45
blade-biz-common/src/main/java/org/springblade/common/enums/BrandEnums.java

@ -0,0 +1,45 @@
package org.springblade.common.enums;
import cn.hutool.core.util.EnumUtil;
import lombok.Getter;
import java.io.Serializable;
/**
* 定义工厂枚举
*
* @author zhaoqiaobo
* @create 2024-03-20 16:08
*/
@Getter
public enum BrandEnums implements Serializable {
ZB(1, "志邦"),
SNM(2, "诗尼曼"),
PAN(3, "皮阿诺"),
MTMM(4, "梦天"),
OP(5, "欧派"),
SFY(6, "索菲亚"),
JP(7, "金牌"),
OLO(8, "我乐"),
MHJ(9, "曼好家"),
LINSY(10, "林氏家居"),
;
private final Integer code;
private final String value;
BrandEnums(Integer code, String value) {
this.code = code;
this.value = value;
}
public static BrandEnums getByCode(Integer code) {
return EnumUtil.getBy(BrandEnums::getCode, code);
}
public static BrandEnums getByValue(String val) {
return EnumUtil.getBy(BrandEnums::getValue, val);
}
}

31
blade-biz-common/src/main/java/org/springblade/common/enums/PackageTypeEnums.java

@ -0,0 +1,31 @@
package org.springblade.common.enums;
import org.springblade.common.model.IDict;
/**
* 包件类型枚举
*
* @author zhaoqiaobo
* @create 2024-03-20 16:08
*/
public enum PackageTypeEnums implements IDict<Integer> {
/**
* 订制品
*/
CMP(1, "订制品"),
/**
* 零担
*/
LTL(2, "零担"),
/**
* 库存品
*/
INV(3, "库存品"),
;
PackageTypeEnums(Integer code, String value) {
init(code, value);
}
}

59
blade-biz-common/src/main/java/org/springblade/common/model/NodeFanoutMsg.java

@ -0,0 +1,59 @@
package org.springblade.common.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springblade.common.constant.WorkNodeEnums;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* 节点广播消息
* 用于节点操作触发消息发送广播通知
*
* @author zhaoqiaobo
* @create 2024-03-18 0:45
*/
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
public class NodeFanoutMsg implements Serializable {
/**
* 作业节点
*/
private WorkNodeEnums node;
/**
* 操作人
*/
private String operator;
/**
* 操作时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private Date operatorTime;
/**
* 当前仓
*/
private String warehouse;
/**
* 主单数据
* {"boId":"业务id","":""}
*/
private Object main;
/**
* 内容
*/
private List<PackageData> details;
}

49
blade-biz-common/src/main/java/org/springblade/common/model/PackageData.java

@ -0,0 +1,49 @@
package org.springblade.common.model;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springblade.common.enums.BrandEnums;
import org.springblade.common.enums.PackageTypeEnums;
import java.io.Serializable;
/**
* 提送数据
*
* @author zhaoqiaobo
* @create 2024-03-18 0:45
*/
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PackageData implements Serializable {
/**
* 包件码
*/
private String packageCode;
/**
* 订单号
*/
private String orderCode;
/**
* 运单号
*/
private String waybillNumber;
/**
* 数量
*/
private String number;
/**
* 包件类型 订制品库存品零担
*/
private PackageTypeEnums packageType;
/**
* 品牌
*/
private BrandEnums brand;
}

13
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/ZeroNumVO.java

@ -0,0 +1,13 @@
package com.logpm.trunkline.vo;
import lombok.Data;
import java.io.Serializable;
@Data
public class ZeroNumVO implements Serializable {
private String waybillNo;
private Integer num;
}

2
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java

@ -470,7 +470,7 @@ public class AftersalesWorkOrderController extends BladeController {
return R.fail(s.getMessage());
}catch (Exception e){
log.error("客服操作确定修改》》》{}",e.getMessage());
return R.fail("系统异常!!");
return R.fail("系统错误:"+e.getMessage());
}
}

9
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java

@ -47,6 +47,7 @@ import org.springblade.common.annotations.LogpmAsync;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.DictTimeoutEnum;
import org.springblade.common.constant.aftersales.*;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.BladeUser;
@ -2405,17 +2406,17 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
// 安全性校验:确保用户信息不为空
BladeUser user = AuthUtil.getUser();
if (user == null) {
throw new RuntimeException("用户信息获取失败");
throw new CustomerException("用户信息获取失败");
}
// 参数合法性校验:校验aftersalesAppeal不为空
if (aftersalesAppeal == null) {
throw new IllegalArgumentException("申诉信息不能为空");
throw new CustomerException("申诉信息不能为空");
}
// 参数合法性校验:校验申诉类型不为空且为预期值
String typesOf = aftersalesAppeal.getTypesOf();
if (!ObjectUtils.isNotNull(typesOf) || !("2".equals(typesOf) || "3".equals(typesOf))) {
throw new IllegalArgumentException("无效的申诉类型");
throw new CustomerException("无效的申诉类型");
}
// 设置处理人信息和处理时间
@ -2443,7 +2444,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
} catch (Exception e) {
log.error("处理申诉信息时发生异常", e);
// 异常处理:记录日志或抛出自定义异常
throw new RuntimeException("处理申诉信息时发生异常", e);
throw new CustomerException("处理申诉信息时发生异常");
}
}

10
blade-service/logpm-business/src/main/java/com/logpm/business/controller/DistributionBusinessPreOrderController.java

@ -62,13 +62,13 @@ public class DistributionBusinessPreOrderController extends BladeController {
@ApiOperationSupport(order = 2)
@ApiOperation(value = "页面ID", notes = "传入distributionDeliveryList")
public R<Boolean> inOrder(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
// try {
try {
Boolean isSuccess = distributionIBusinessPreOrderService.inOrder(ids);
return R.data(isSuccess);
// }catch (Exception e){
// log.error("预入库信息入库失败",e);
// return R.fail(500,e.getMessage());
// }
}catch (Exception e){
log.error("预入库信息入库失败",e);
return R.fail(500,e.getMessage());
}
}

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

@ -12,6 +12,7 @@ import com.logpm.distribution.vo.app.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
@ -28,6 +29,7 @@ import java.util.List;
*/
@RestController
@AllArgsConstructor
@Slf4j
@RequestMapping("/app/delivery")
@Api(value = "配送管理", tags = "配送管理App接口")
public class DistributionDeliveryAppController {
@ -142,7 +144,8 @@ public class DistributionDeliveryAppController {
msg = distributionDeliveryListService.loadingscan(distrilbutionloadingscanDTO);
}catch (Exception e){
e.printStackTrace();
msg = R.fail(e.getMessage());
log.error(e.getMessage());
}
return msg;
@ -155,7 +158,13 @@ public class DistributionDeliveryAppController {
@ApiOperationSupport(order = 6)
@ApiOperation(value = "装车扫描", notes = "传入DistrilbutionloadingscanDTO")
public R zeroLoading(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
R msg = distributionDeliveryListService.zeroLoading(distrilbutionloadingscanDTO);
R msg = null;
try {
msg = distributionDeliveryListService.zeroLoading(distrilbutionloadingscanDTO);
} catch (Exception e) {
msg = R.fail(e.getMessage());
log.error(e.getMessage());
}
return msg;
}
@ -200,7 +209,13 @@ public class DistributionDeliveryAppController {
@ApiOperationSupport(order = 8)
@ApiOperation(value = "装车扫描(取消)", notes = "传入DistrilbutionloadingscanDTO")
public R loadingscanoff(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
R msg = distributionDeliveryListService.loadingscanoff(distrilbutionloadingscanDTO);
R msg = null;
try {
msg = distributionDeliveryListService.loadingscanoff(distrilbutionloadingscanDTO);
} catch (Exception e) {
msg = R.fail(e.getMessage());
log.error(e.getMessage());
}
return msg;
}

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

@ -161,7 +161,10 @@ public class DistributionSignforAppController {
orderPackageCodes = orderPackageCodes + "," + packageCode;
}
}
updownTypeClient.downPackageOrDelTray(orderPackageCodes, myCurrentWarehouse.getId(), "签收下架解托");
if(StringUtils.isNotBlank(orderPackageCodes)){
updownTypeClient.downPackageOrDelTray(orderPackageCodes, myCurrentWarehouse.getId(), "签收下架解托");
}
}
return r;

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java

@ -487,13 +487,15 @@ public class DistributionDeliveryListController extends BladeController {
orderPackageCodes = orderPackageCodes + "," + packageCode;
}
}
warehouseUpdownTypeClient.downPackageOrDelTray(orderPackageCodes,myCurrentWarehouse.getId(),"签收下架解托");
if(StringUtils.isNotBlank(orderPackageCodes)){
warehouseUpdownTypeClient.downPackageOrDelTray(orderPackageCodes,myCurrentWarehouse.getId(),"签收下架解托");
}
}
return r;
}catch (Exception e){
log.error("#############signforPC:",e);
return R.fail("签收失败");
return R.fail("签收失败"+e.getMessage());
}
}

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java

@ -178,8 +178,14 @@ public class DistributionReservationController extends BladeController {
@ApiOperationSupport(order = 4)
@ApiOperation(value = "新增", notes = "传入distrbutionReservation")
public R autonomouslySave(@Valid @RequestBody DistributionReservationDTO distributionReservationDTO) {
R result = reservationService.insertAutonomouslyReservation(distributionReservationDTO);
return result;
try{
R result = reservationService.insertAutonomouslyReservation(distributionReservationDTO);
return result;
}catch (Exception e){
return R.fail(e.getMessage());
}
}
/**

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java

@ -324,7 +324,9 @@ public class DistributionSignforController extends BladeController {
orderPackageCodes = orderPackageCodes + "," +packageCode;
}
}
updownTypeClient.downPackageOrDelTray(orderPackageCodes,myCurrentWarehouse.getId(),"文员一键签收下架解托");
if(StringUtils.isNotBlank(orderPackageCodes)){
updownTypeClient.downPackageOrDelTray(orderPackageCodes,myCurrentWarehouse.getId(),"文员一键签收下架解托");
}
}catch (Exception e){
log.error("##############oneclick: 更新包件下架状态失败 packageCodes={}",packageCodes);
}

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

@ -897,7 +897,7 @@
FROM logpm_distribution_stock_article AS ldsa
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldsa.id = ldpl.stock_article_id
LEFT JOIN logpm_distribution_parcel_number AS ldpn ON ldpn.parcel_list_id = ldpl.id
WHERE ldsa.id = #{stockArticleId}
WHERE ldsa.id = #{stockArticleId} AND ldpl.is_transfer = 0
</select>
<select id="exportDistributionStockArticle"
resultType="com.logpm.distribution.entity.DistributionStockArticleEntity">
@ -1197,10 +1197,10 @@
WHERE
ldpl.order_package_reservation_status = 10
and ldpl.conditions != 2
and ldpl.is_transfer = 0
and ldpl.order_package_freeze_status = 10
AND ldpl.order_package_loading_status = 10 AND order_package_status IN (10,20)
and ldpl.stock_article_id = #{param.id} and ldpl.warehouse_id = #{warehouseId}
and ldpl.conditions !=2
<if test="param.waybillNumber != null and param.waybillNumber != ''">
and ldpl.waybill_number like concat('%',#{param.waybillNumber},'%')
</if>

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/BillLadingScanDataQueueHandler.java

@ -1,6 +1,7 @@
package com.logpm.distribution.receiver;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
import com.rabbitmq.client.Channel;
import lombok.AllArgsConstructor;
@ -32,7 +33,9 @@ public class BillLadingScanDataQueueHandler {
String coding = Objects.toString(o);
Long warehouseId = (Long) warehouseIdObj;
warehouseUpdownTypeClient.downPackageOrDelTray(coding, warehouseId, "签收下架解托");
if(StringUtils.isNotBlank(coding)){
warehouseUpdownTypeClient.downPackageOrDelTray(coding, warehouseId, "签收下架解托");
}
}else{
log.warn("自提订单扫描数据接收失败");

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

@ -161,7 +161,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
public Boolean getSelfPickup(Long id) {
DistributionParcelListEntity entity = new DistributionParcelListEntity();
entity.setId(id);
entity.setOrderPackageStatus(OrderStatusConstant.bufenqianshou.getValue());
entity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue());
return distributionParcelListService.updateById(entity);
}
@ -1388,7 +1388,9 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
}
String collect = updatePackageList.stream().map(DistributionParcelListEntity::getOrderPackageCode).collect(Collectors.joining(","));
warehouseUpdownTypeClient.downPackageOrDelTray(collect, warehouseId, "装车下架解托");
if(StringUtils.isNotBlank(collect)){
warehouseUpdownTypeClient.downPackageOrDelTray(collect, warehouseId, "装车下架解托");
}
// 进行批量下架
}

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

@ -779,7 +779,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
info.put("orderPackageCode", parcelListEntity.getOrderPackageCode());
info.put("warehouseId", myCurrentWarehouse.getId());
warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "扫描装车进行下架、解托");
if(StringUtils.isNotBlank(parcelListEntity.getOrderPackageCode())){
warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "扫描装车进行下架、解托");
}
Map<String, Object> map = new HashMap();
String distrilbutionloadingscanDTOJson = JSONObject.toJSONString(distrilbutionloadingscanDTO);
@ -2919,6 +2921,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
.eq(DistributionParcelListEntity::getStockArticleId, s.getId())
.ne(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.yizhuangche.getValue())
.ne(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.yiyueyue.getValue())
.eq(DistributionParcelListEntity::getIsTransfer, 0)
.notIn(DistributionParcelListEntity::getOrderPackageStatus, new String[]{OrderPackageStatusConstant.yichuku.getValue(), OrderPackageStatusConstant.yiqianshou.getValue()})
);
if (Func.isEmpty(distributionParcelListEntities)) {
@ -3184,7 +3187,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//添加该订单下可操作包件至计划中
//没有进行包件选择 默认添加可配送的所有包件
//添加订单下的所有在库订单的包件
List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getStockArticleId, s.getId()).ne(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.yizhuangche.getValue()).ne(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.yiyueyue.getValue()).notIn(DistributionParcelListEntity::getOrderPackageStatus, new String[]{OrderPackageStatusConstant.yichuku.getValue(), OrderPackageStatusConstant.yiqianshou.getValue()}));
List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getStockArticleId, s.getId())
.eq(DistributionParcelListEntity::getIsTransfer, 0)
.ne(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.yizhuangche.getValue())
.ne(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.yiyueyue.getValue())
.notIn(DistributionParcelListEntity::getOrderPackageStatus, new String[]{OrderPackageStatusConstant.yichuku.getValue(), OrderPackageStatusConstant.yiqianshou.getValue()}));
if (Func.isEmpty(distributionParcelListEntities)) {
log.error("##############添加空订单");
throw new RuntimeException(s.getOrderCode() + "无可用包件!!!");
@ -7908,7 +7916,11 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), user);
//包件解托下架
warehouseUpdownTypeClient.downPackageOrDelTray(packageObj.getOrderPackageCode(), warehouseId, "签收下架解托");
if(StringUtils.isNotBlank(packageObj.getOrderPackageCode())){
warehouseUpdownTypeClient.downPackageOrDelTray(packageObj.getOrderPackageCode(), warehouseId, "签收下架解托");
}
content = "包件在" + entityWarehouseId.getName() + "由" + distributionLoadscanEntity.getSigningUser() + "扫描签收,签收方式:司机未进行装车,由商家端进行签收,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
}
}

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

@ -55,6 +55,7 @@ import org.springblade.common.constant.signing.SignforStatusConstant;
import org.springblade.common.constant.stockup.StockAssignStatusConstant;
import org.springblade.common.constant.stockup.StockupStatusConstant;
import org.springblade.common.constant.stockup.StockupTypeConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.serviceConstant.ServiceConstant;
import org.springblade.common.utils.AddressUtil;
import org.springblade.common.utils.CommonUtil;
@ -1489,6 +1490,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
.ne(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.yizhuangche.getValue())
.ne(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.yiyueyue.getValue())
.eq(DistributionParcelListEntity::getConditions, 1)
.eq(DistributionParcelListEntity::getIsTransfer, 0)
.notIn(DistributionParcelListEntity::getOrderPackageStatus, new String[]{OrderPackageStatusConstant.yichuku.getValue(), OrderPackageStatusConstant.yiqianshou.getValue()}));
distributionParcelListEntities.forEach(dp -> {
if (!dp.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) {
@ -2173,6 +2175,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
.ne(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.yizhuangche.getValue())
.ne(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.yiyueyue.getValue())
.ne(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.yizhuangche.getValue())
.eq(DistributionParcelListEntity::getIsTransfer, 0)
.ne(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiqianshou.getValue()));
if (Func.isEmpty(distributionParcelListEntities)) {
log.error("#########################此订单下包件列表查询为空:{}", s.getOrderCode());
@ -2947,10 +2950,11 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
.ne(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.yizhuangche.getValue())
.ne(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.yiyueyue.getValue())
.eq(DistributionParcelListEntity::getConditions, 1)
.eq(DistributionParcelListEntity::getIsTransfer, 0)
.notIn(DistributionParcelListEntity::getOrderPackageStatus, new String[]{OrderPackageStatusConstant.yichuku.getValue(), OrderPackageStatusConstant.yiqianshou.getValue()}));
if (Func.isEmpty(distributionParcelListEntities)) {
log.error("#########################无可用包件,订单ID为‘;:{}", s.getId());
throw new RuntimeException(s.getOrderCode() + "无可用包件!!!");
throw new CustomerException(s.getOrderCode() + "无可用包件!!!");
}
List<Long> packageIds = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList());
packageLockIds.addAll(packageIds);
@ -2981,6 +2985,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
});
} else {
//维护选中的包件信息
List<Long> packageIds = packageList.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList());
packageLockIds.addAll(packageIds);
@ -3040,7 +3045,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
boolean inputFlag = parcelNumberVOS.stream().allMatch(zero -> zero.getReservationNum() <= 0);
if (inputFlag) {
//判断零担品类录入是否都为0
throw new RuntimeException(s.getOrderCode() + "此零担订单数量录入错误!!!");
throw new CustomerException(s.getOrderCode() + "此零担订单数量录入错误!!!");
}
//存在零担订单的包件信息
parcelNumberVOS.forEach(p -> {
@ -3073,7 +3078,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
if (!list.isEmpty()) {
int sum = list.stream().mapToInt(DistributionParcelNumberVO::getHandQuantity).sum();
if (sum == 0) {
throw new RuntimeException(s.getOrderCode() + "此零担订单无在库数量!!!");
throw new CustomerException(s.getOrderCode() + "此零担订单无在库数量!!!");
}
list.forEach(l -> {
if (l.getHandQuantity() > 0) {
@ -3120,7 +3125,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
if (b) {
log.error("###############预约新增订单同时操作");
//当前操作包件存在于缓存中,此次操作无效
throw new RuntimeException(s.getOrderCode() + "正在操作,请刷新后尝试");
throw new CustomerException(s.getOrderCode() + "正在操作,请刷新后尝试");
} else {
packageLockIds.addAll(a);
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + s.getOrderCode(), packageLockIds, 60L);
@ -3141,7 +3146,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
DistributionStockListEntity stockListEntity = distributionStockListService.getById(i.getId());
int keyongshuliang = stockListEntity.getQuantityStock() - stockListEntity.getQuantityOccupied();
if (i.getReservationNum() > keyongshuliang) {
throw new RuntimeException("库存品库内数量不足!!!");
throw new CustomerException("库存品库内数量不足!!!");
}
if (Func.isNotBlank(i.getServiceNumber())) {
serviceNumber.add(i.getServiceNumber());

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

@ -2633,7 +2633,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), AuthUtil.getUser());
//下架解托
warehouseUpdownTypeClient.downPackageOrDelTray(loadscanEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
if(StringUtils.isNotBlank(loadscanEntity.getOrderPackageCode())){
warehouseUpdownTypeClient.downPackageOrDelTray(loadscanEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
}
//维护订单状态
String content = "包件在" + myCurrentWarehouse.getName() + "由" + loadscanEntity.getSigningUser() + "扫描签收,装车方式:扫描装车,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + distributionReservationEntity.getReservationCode();
JSONObject trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), deliveryListEntity.getId().toString(), parcelListEntity.getWarehouseEntryTimeEnd());
@ -2711,8 +2713,14 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
Integer j = distributionSignforMapper.updateSignforByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), AuthUtil.getUser());
//包件解托下架
warehouseUpdownTypeClient.downPackageOrDelTray(collect.get(0).getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
if(StringUtils.isNotBlank(collect.get(0).getOrderPackageCode())){
//包件解托下架
warehouseUpdownTypeClient.downPackageOrDelTray(collect.get(0).getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
}
packageLockIds.add(distributionLoadscanEntity.getPackageId());
String content = "包件在" + myCurrentWarehouse.getName() + "由" + distributionLoadscanEntity.getSigningUser() + "扫描签收,装车方式:补录装车,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + distributionReservationEntity.getReservationCode();
@ -2995,8 +3003,14 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
Integer j = distributionSignforMapper.updateSignforNum(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), AuthUtil.getUser());
//下架解托
warehouseUpdownTypeClient.downPackageOrDelTray(distributionLoadscanEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
if(StringUtils.isNotBlank(distributionLoadscanEntity.getOrderPackageCode())){
//下架解托
warehouseUpdownTypeClient.downPackageOrDelTray(distributionLoadscanEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
}
content = "包件在" + myCurrentWarehouse.getName() + "由" + AuthUtil.getNickName() + "后台签收,装车方式:扫描装车,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + distributionReservationEntity.getReservationCode();
try {
trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), distributionLoadscanEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), deliveryListEntity.getId().toString(), parcelListEntity.getWarehouseEntryTimeEnd());
@ -3119,7 +3133,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
} else {
//一个客户下出现重复包条码
log.error("############出现重复包条码:{}", collect);
throw new RuntimeException("包件数据异常,请联系管理员!!!");
throw new CustomerException("包件数据异常,请联系管理员!!!");
}
}
trunklinePackageTrackLogClient.addPackageTrackLog(aaa);
@ -3132,7 +3146,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
boolean flag = a.stream().anyMatch(any -> packageLockIds.contains(any));
if (flag) {
//正在操作,请稍后重试
throw new RuntimeException("该包件正在被操作,请稍后再试!!!");
throw new CustomerException("该包件正在被操作,请稍后再试!!!");
} else {
packageLockIds.addAll(a);
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + deliveryListEntity.getTrainNumber() + "orderPackageCode:", packageLockIds, 60L);
@ -3146,8 +3160,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//维护配送任务
distributionDeliveryListService.maintenanceDeliveryInfo(distrilbutionloadingscanDTO.getDeliveryId());
return R.data(orderpackages, "签收成功");
} catch (RuntimeException e) {
log.error("签收异常", e);
} catch (Exception e) {
LogError logError = new LogError();
logError.setMessage(e.getMessage());
logClient.saveErrorLog(logError);
@ -3405,8 +3419,15 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//进行签收数量的修改
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//修改签收数量
//包件下架解托
warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
if(StringUtils.isNotBlank(parcelListEntity.getOrderPackageCode())){
//包件下架解托
warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
}
List<JSONObject> jsonObjects = new ArrayList<>();
JSONObject jsonObject = new JSONObject();
jsonObject.put("code", distributionLoadscanEntity.getOrderPackageCode());
@ -3489,7 +3510,14 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscanEntity.setIsAbnormalLoading(2);
distributionLoadscanEntity.setIsAbnormalSigning(2);
distributionLoadscanEntity.setAbnormalNote("异常签收");
warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
if(StringUtils.isNotBlank(parcelListEntity.getOrderPackageCode())){
warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
}
if (Func.isEmpty(loadscanEntity)) {
loadingId = distributionLoadscanEntity.getId();
distributionLoadscanService.save(distributionLoadscanEntity);
@ -6519,6 +6547,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//还需要配送的出库人、配送人、操作人信息
R<User> userR = userClient.userInfoById(delivery.getAdministratorsId());
if (Func.isNotEmpty(delivery)) {
if ("1".equals(delivery.getKind())) {
//自主配送
@ -6537,13 +6566,14 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (Func.isNotEmpty(distributionDeliveryTripartiteEntity)) {
delivery.setOutName(distributionDeliveryTripartiteEntity.getDriverName());
delivery.setOutPhone(distributionDeliveryTripartiteEntity.getDriverPhone());
}
}
R<User> userR = userClient.userInfoById(delivery.getAdministratorsId());
if (Func.isNotEmpty(userR)) {
User user = userR.getData();
delivery.setAdministratorsName(user.getName());
delivery.setAdministratorsPhone(user.getPhone());
}
DistributionStockupEntity distributionStockupEntity = distributionReservationMapper.selectStockup(distributionSignforEntity.getReservationId());
if (Func.isNotEmpty(distributionStockupEntity)) {
@ -6556,6 +6586,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//查询客户信息
List<SignPushDataContactDTO> customer = distributionReservationMapper.selectPushOldCustomer(distributionSignforEntity.getReservationId());
if (customer.size()>1){
resultMap.put("result", false);
resultMap.put("msg", "存在多个signfor信息 >>>ReservationId():"+distributionSignforEntity.getReservationId());
}
if (Func.isNotEmpty(customer)) {
//查询客户订单
List<SignPushDataUnitDTO> signPushDataUnitDTOS = new ArrayList<>();
@ -6607,6 +6641,16 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
buildReservationNameAndPhone(customer);
//完成客户信息添加
delivery.setSignPushDataContactDTOs(customer);
if (Objects.isNull(delivery.getOutPhone())){
Long signUserId = customer.get(0).getSignUserId();
R<User> signforUser = userClient.userInfoById(signUserId);
if (Objects.equals(signforUser.getCode() , 200)){
delivery.setOutPhone(signforUser.getData().getPhone());
}else {
resultMap.put("result", false);
resultMap.put("msg", "外协查询签收人电话失败:"+customer.get(0).getSignUserId());
}
}
}
}

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

@ -1193,7 +1193,10 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
}
if (Func.isNotEmpty(builder)){
String string = builder.deleteCharAt(builder.length() - 1).toString();
warehouseUpdownTypeClient.downPackageOrDelTray(string, myCurrentWarehouse.getId(), "签收下架解托");
if(StringUtils.isNotBlank(string)){
warehouseUpdownTypeClient.downPackageOrDelTray(string, myCurrentWarehouse.getId(), "签收下架解托");
}
}
if (!logList.isEmpty()) {
trunklinePackageTrackLogClient.addPackageTrackLog(logList);
@ -3350,6 +3353,9 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
//查询订单包件数量签收的信息
DistributionStockArticleEntity one = distributionStockArticleEntityList.stream().filter(s -> s.getId().equals(so.getStockArticleId())).findFirst().orElse(null);
DistributionStockArticleEntity upObj =new DistributionStockArticleEntity();
upObj.setId(so.getStockArticleId());
List<DistributionBillLadingScanEntity> list2 = new ArrayList<>();
for (DistributionBillLadingScanEntity distributionBillLadingScanEntity : distributionBillLadingScanEntities) {
@ -3358,7 +3364,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
}
}
one.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue());
upObj.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue());
//判断当前签收数 修改订单和备货订单状态
if (one.getTotalNumber().equals(list2.size() + 1)) {
@ -3375,19 +3381,19 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
if (one1 != null) {
distributionAsyncService.updateBillStock(one1.getId());
}
one.setOrderStatus(OrderStatusConstant.qianshou.getValue());
upObj.setOrderStatus(OrderStatusConstant.qianshou.getValue());
}
//修改在库数量
if (ObjectUtils.isNotNull(one.getHandQuantity()) && one.getHandQuantity() > 0) {
int i = one.getHandQuantity() - 1;
int i2 = ObjectUtils.isNull(one.getSigninQuantity()) ? 1 : one.getSigninQuantity() + 1;
one.setHandQuantity(i);
one.setSigninQuantity(i2);
upObj.setHandQuantity(i);
upObj.setSigninQuantity(i2);
}
// 修改订单状态
distributionStockArticleService.updateById(one);
distributionStockArticleService.updateById(upObj);
//修改包件状态
distributionAsyncService.getSelfPickup(distributionParcelListEntity.getId());
@ -3427,7 +3433,12 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
distributionBillLadingScanService.save(distributionBillLadingScan);
//进行下架解托
warehouseUpdownTypeClient.downPackageOrDelTray(distributionBillLadingScan.getPacketBarCode(),myCurrentWarehouse.getId(),"自提下架解托");
if(StringUtils.isNotBlank(distributionBillLadingScan.getPacketBarCode())){
warehouseUpdownTypeClient.downPackageOrDelTray(distributionBillLadingScan.getPacketBarCode(),myCurrentWarehouse.getId(),"自提下架解托");
}
String content = "包件在" + myCurrentWarehouse.getName() + "由" + AuthUtil.getNickName() + "扫描签收,自提任务号:" + billLadingEntity.getPickupBatch() ;
//日志记录
List<JSONObject> logList = new ArrayList<>();

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

@ -16,6 +16,7 @@ import com.xxl.job.core.handler.annotation.XxlJob;
import io.jsonwebtoken.lang.Objects;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.tool.utils.Func;
@ -111,8 +112,10 @@ public class DistributionDatarepair {
packageMap.forEach((k, v) -> {
String orderPackageCodes = v.stream().map(DistributionParcelListEntity::getOrderPackageCode).collect(Collectors.joining(","));
stringBuffer.append("仓库:" + k).append("包件解托" + orderPackageCodes);
;
warehouseUpdownTypeClient.downPackageOrDelTray(orderPackageCodes, k, "签收下架解托");
if(StringUtils.isNotBlank(orderPackageCodes)){
warehouseUpdownTypeClient.downPackageOrDelTray(orderPackageCodes, k, "签收下架解托");
}
});
}
log.info("执行包件下架操作>>>>>>>>>>>>>" + stringBuffer.toString());

12
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java

@ -35,6 +35,7 @@ import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import com.logpm.warehouse.feign.IWarehouseWaybillDetailClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.TenantNum;
import org.springblade.common.constant.order.*;
@ -347,15 +348,20 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
distributionParcelListClient.update(parcelListEntity);
distributionStockArticleClient.updateOrderInfo(orderCode,warehouseId);
warehouseUpdownTypeClient.downPackageOrDelTray(orderPackageCode,warehouseId,"系统出库下架解托");
if(StringUtils.isNotBlank(orderPackageCode)){
// warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
warehouseUpdownTypeClient.downPackageOrDelTray(orderPackageCode,warehouseId,"系统出库下架解托");
}
}
}
@Override
public void dealWithPackageUpdown(String orderPackageCode, Long allocationId,Long warehouseId) {
warehouseUpdownTypeClient.downPackageOrDelTray(orderPackageCode,warehouseId,"系统下架解托");
if(StringUtils.isNotBlank(orderPackageCode)){
warehouseUpdownTypeClient.downPackageOrDelTray(orderPackageCode,warehouseId,"系统下架解托");
warehouseUpdownTypeClient.upShelfPackage(orderPackageCode,allocationId,warehouseId,"系统上架");
}
warehouseUpdownTypeClient.upShelfPackage(orderPackageCode,allocationId,warehouseId,"系统上架");
}

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java

@ -169,4 +169,6 @@ public interface TrunklineCarsLoadScanMapper extends BaseMapper<TrunklineCarsLoa
void updateFinalNodeIdByLoadIdAndWarehouseIdAndOrderCodeAndWaybillNo(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId, @Param("orderCode") String orderCode, @Param("waybillNo") String waybillNo, @Param("finalNodeId") Long finalNodeId, @Param("finalNodeName") String finalNodeName);
List<TrunklineCarsLoadScanEntity> findAbnormalZeroScanList(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId);
List<ZeroNumVO> findZeroStartNum(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId);
}

10
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml

@ -903,4 +903,14 @@
and scan_status = '1'
</update>
<select id="findZeroStartNum" resultType="com.logpm.trunkline.vo.ZeroNumVO">
select waybill_no waybillNo,
sum(num) num
from logpm_trunkline_cars_load_scan
where load_id = #{loadId}
and warehouse_id = #{warehouseId}
group by waybill_no
</select>
</mapper>

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java

@ -164,4 +164,6 @@ public interface ITrunklineCarsLoadScanService extends BaseService<TrunklineCars
void updateFinalNodeIdByLoadIdAndWarehouseIdAndOrderCodeAndWaybillNo(Long loadId, Long warehouseId, String orderCode, String waybillNo, Long finalNodeId,String finalNodeName);
List<TrunklineCarsLoadScanEntity> findAbnormalZeroScanList(Long loadId, Long warehouseId);
List<ZeroNumVO> findZeroStartNum(Long loadId, Long warehouseId);
}

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

@ -25,4 +25,5 @@ public interface ITrunklineWaybillOrderService extends BaseService<TrunklineWayb
void deleteByWaybillNo(String waybillNo);
TrunklineWaybillOrderEntity findEntityByWaybillNoAndOrderCode(String waybillNo, String orderCode);
}

6
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java

@ -16,6 +16,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -398,4 +399,9 @@ public class TrunklineCarsLoadScanServiceImpl extends BaseServiceImpl<TrunklineC
return baseMapper.findAbnormalZeroScanList(loadId,warehouseId);
}
@Override
public List<ZeroNumVO> findZeroStartNum(Long loadId, Long warehouseId) {
return baseMapper.findZeroStartNum(loadId,warehouseId);
}
}

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

@ -51,6 +51,7 @@ import com.logpm.warehouse.feign.IWarehouseWaybillDetailClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
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.carsload.CarsLoadLogTypeConstant;
@ -368,6 +369,51 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
try {
//查询零担发车件数
List<ZeroNumVO> zeroNumVOList = trunklineCarsLoadScanService.findZeroStartNum(loadId,warehouseId);
if(CollUtil.isNotEmpty(zeroNumVOList)){
zeroNumVOList.forEach(zeroNumVO -> {
String waybillNo = zeroNumVO.getWaybillNo();
Integer num = zeroNumVO.getNum();
WarehouseWaybillEntity waybill = warehouseWaybillClient.findByWaybillNo(waybillNo);
Integer totalCount = waybill.getTotalCount();
Integer waybillStatusInt = Integer.parseInt(waybill.getWaybillStatus());
TrunklineWaybillOrderEntity waybillOrderEntity = trunklineWaybillOrderService.findEntityByWaybillNoAndOrderCode(waybillNo,waybillNo);
if(!Objects.isNull(waybillOrderEntity)){
Integer handleNumber = waybillOrderEntity.getHandleNumber();
if(Objects.isNull(handleNumber)){
handleNumber = 0;
}
int i = handleNumber + num;
if(waybillStatusInt < 30){
if(totalCount == i){
waybill.setWaybillStatus("40");
waybillOrderEntity.setHandleNumber(i);
warehouseWaybillClient.updateEntity(waybill);
trunklineWaybillOrderService.updateById(waybillOrderEntity);
}else{
waybill.setWaybillStatus("30");
waybillOrderEntity.setHandleNumber(i);
warehouseWaybillClient.updateEntity(waybill);
trunklineWaybillOrderService.updateById(waybillOrderEntity);
}
}else if(waybillStatusInt == 30){
if(totalCount == i){
waybill.setWaybillStatus("40");
waybillOrderEntity.setHandleNumber(i);
warehouseWaybillClient.updateEntity(waybill);
trunklineWaybillOrderService.updateById(waybillOrderEntity);
}else{
waybillOrderEntity.setHandleNumber(i);
trunklineWaybillOrderService.updateById(waybillOrderEntity);
}
}
}
});
}
//更新关联订单数据的发车数量
trunklineCarsOrderService.updateStartNumByLoadIdAndWarehouseId(loadId, warehouseId);
//删除没有装车的计划数据
@ -755,6 +801,41 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
try {
//查询零担发车件数
List<ZeroNumVO> zeroNumVOList = trunklineCarsLoadScanService.findZeroStartNum(loadId,warehouseId);
if(CollUtil.isNotEmpty(zeroNumVOList)){
zeroNumVOList.forEach(zeroNumVO -> {
String waybillNo = zeroNumVO.getWaybillNo();
Integer num = zeroNumVO.getNum();
WarehouseWaybillEntity waybill = warehouseWaybillClient.findByWaybillNo(waybillNo);
Integer totalCount = waybill.getTotalCount();
Integer waybillStatusInt = Integer.parseInt(waybill.getWaybillStatus());
TrunklineWaybillOrderEntity waybillOrderEntity = trunklineWaybillOrderService.findEntityByWaybillNoAndOrderCode(waybillNo,waybillNo);
if(!Objects.isNull(waybillOrderEntity)){
Integer handleNumber = waybillOrderEntity.getHandleNumber();
if(waybillStatusInt == 40 || waybillStatusInt == 30){
if(Objects.isNull(handleNumber)){
handleNumber = 0;
}
int i = handleNumber - num;
if(i==0){
waybill.setWaybillStatus("20");
waybillOrderEntity.setHandleNumber(totalCount);
}else{
waybill.setWaybillStatus("30");
waybillOrderEntity.setHandleNumber(i);
}
warehouseWaybillClient.updateEntity(waybill);
trunklineWaybillOrderService.updateById(waybillOrderEntity);
}
}
});
}
//更新关联订单数据的发车数量
trunklineCarsOrderService.updateStartNumToPlanNumByLoadIdAndWarehouseId(loadId, warehouseId);
@ -1003,6 +1084,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
Long nowWarehouseId = carsLoadEntity.getNowWarehouseId();//当前节点id
String carsNo = carsLoadEntity.getCarsNo();
if (!warehouseId.equals(nowWarehouseId)) {
log.warn("#############cancelArriveCarByLoadId: 配载未到达当前仓 loadId={} nowWarehouseId={}", loadId, nowWarehouseId);
@ -1182,30 +1264,41 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
distributionParcelNumberClient.addBatch(ls);
if(isTransfer == 0){
QueryWrapper<TrunklineWaybillOrderEntity> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.eq("waybill_no",stockArticleEntity.getWaybillNumber())
.eq("order_code",stockArticleEntity.getWaybillNumber());
TrunklineWaybillOrderEntity one = trunklineWaybillOrderService.getOne(queryWrapper1);
if(!Objects.isNull(one)){
WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillNo(stockArticleEntity.getWaybillNumber());
Integer totalCount = waybillEntity.getTotalCount();
Integer waybillStatusInt = Integer.parseInt(waybillEntity.getWaybillStatus());
if(waybillStatusInt <= 30){
Integer handleNumber = one.getHandleNumber();
int total = handleNumber + unloadNum;
if(total < totalCount){
waybillEntity.setWaybillStatus("50");
one.setHandleNumber(total);
}else{
waybillEntity.setWaybillStatus("60");
one.setHandleNumber(totalCount);
}
warehouseWaybillClient.updateEntity(waybillEntity);
trunklineWaybillOrderService.updateById(one);
}
}
}
// if(isTransfer == 0){
// //查询零担发车件数
// List<ZeroNumVO> zeroNumVOList = trunklineCarsLoadScanService.findZeroStartNum(loadId,warehouseId);
// if(CollUtil.isNotEmpty(zeroNumVOList)){
// zeroNumVOList.forEach(zeroNumVO -> {
// String waybillNo = zeroNumVO.getWaybillNo();
// Integer num = zeroNumVO.getNum();
// WarehouseWaybillEntity waybill = warehouseWaybillClient.findByWaybillNo(waybillNo);
// Integer totalCount = waybill.getTotalCount();
// Integer waybillStatusInt = Integer.parseInt(waybill.getWaybillStatus());
// TrunklineWaybillOrderEntity waybillOrderEntity = trunklineWaybillOrderService.findEntityByWaybillNoAndOrderCode(waybillNo,waybillNo);
// if(!Objects.isNull(waybillOrderEntity)){
// Integer handleNumber = waybillOrderEntity.getHandleNumber();
// if(waybillStatusInt <= 40){
// if(Objects.isNull(handleNumber)){
// handleNumber = 0;
// }
// int i = handleNumber - num;
// if(i==0){
// waybill.setWaybillStatus("20");
// waybillOrderEntity.setHandleNumber(totalCount);
// }else{
// waybill.setWaybillStatus("30");
// waybillOrderEntity.setHandleNumber(i);
// }
//
// warehouseWaybillClient.updateEntity(waybill);
// trunklineWaybillOrderService.updateById(waybillOrderEntity);
// }
//
// }
//
// });
// }
// }
}
} else {
Integer hQuantity = newStockArticleEntity.getHandQuantity() + unloadNum;
@ -1231,38 +1324,77 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
newStockArticleEntity.setIncomingNum(incomingNum);
distributionStockArticleClient.saveOrUpdate(newStockArticleEntity);
String waybillNumber = newStockArticleEntity.getWaybillNumber();
WarehouseWaybillEntity warehouseWaybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNumber);
Long destinationWarehouseId = warehouseWaybillEntity.getDestinationWarehouseId();
if(warehouseId.equals(destinationWarehouseId)){
QueryWrapper<TrunklineWaybillOrderEntity> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.eq("waybill_no",stockArticleEntity.getWaybillNumber())
.eq("order_code",stockArticleEntity.getWaybillNumber());
TrunklineWaybillOrderEntity one = trunklineWaybillOrderService.getOne(queryWrapper1);
if(!Objects.isNull(one)){
Integer totalCount = warehouseWaybillEntity.getTotalCount();
Integer waybillStatusInt = Integer.parseInt(warehouseWaybillEntity.getWaybillStatus());
if(waybillStatusInt <= 30){
Integer handleNumber = one.getHandleNumber();
int total = handleNumber + unloadNum;
if(total < totalCount){
warehouseWaybillEntity.setWaybillStatus("50");
one.setHandleNumber(total);
}else{
warehouseWaybillEntity.setWaybillStatus("60");
one.setHandleNumber(totalCount);
}
warehouseWaybillClient.updateEntity(warehouseWaybillEntity);
trunklineWaybillOrderService.updateById(one);
}
}
}
// String waybillNumber = newStockArticleEntity.getWaybillNumber();
// WarehouseWaybillEntity warehouseWaybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNumber);
// Long destinationWarehouseId = warehouseWaybillEntity.getDestinationWarehouseId();
// if(warehouseId.equals(destinationWarehouseId)){
// QueryWrapper<TrunklineWaybillOrderEntity> queryWrapper1 = new QueryWrapper<>();
// queryWrapper1.eq("waybill_no",stockArticleEntity.getWaybillNumber())
// .eq("order_code",stockArticleEntity.getWaybillNumber());
// TrunklineWaybillOrderEntity one = trunklineWaybillOrderService.getOne(queryWrapper1);
// if(!Objects.isNull(one)){
// Integer totalCount = warehouseWaybillEntity.getTotalCount();
// Integer waybillStatusInt = Integer.parseInt(warehouseWaybillEntity.getWaybillStatus());
// if(waybillStatusInt <= 30){
// Integer handleNumber = one.getHandleNumber();
// int total = handleNumber + unloadNum;
// if(total < totalCount){
// warehouseWaybillEntity.setWaybillStatus("50");
// one.setHandleNumber(total);
// }else{
// warehouseWaybillEntity.setWaybillStatus("60");
// one.setHandleNumber(totalCount);
// }
// warehouseWaybillClient.updateEntity(warehouseWaybillEntity);
// trunklineWaybillOrderService.updateById(one);
// }
// }
// }
}
}
}
}
});
WarehouseWaybillEntity warehouseWaybillEntity = warehouseWaybillClient.findByWaybillNo(orderCode);
String waybillNo = warehouseWaybillEntity.getWaybillNo();
Long waybillId = warehouseWaybillEntity.getId();
int unloadNum = orderCodeList.stream().mapToInt(TrunklineCarsLoadScanEntity::getUnloadNum).sum();
Long destinationWarehouseId = warehouseWaybillEntity.getDestinationWarehouseId();
if(warehouseId.equals(destinationWarehouseId)){
QueryWrapper<TrunklineWaybillOrderEntity> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.eq("waybill_no",orderCode)
.eq("order_code",orderCode);
TrunklineWaybillOrderEntity one = trunklineWaybillOrderService.getOne(queryWrapper1);
if(!Objects.isNull(one)){
Integer handleNumber = one.getHandleNumber();
Integer totalCount = warehouseWaybillEntity.getTotalCount();
Integer waybillStatusInt = Integer.parseInt(warehouseWaybillEntity.getWaybillStatus());
int total = handleNumber + unloadNum;
if(waybillStatusInt < 50){
if(total != totalCount){
warehouseWaybillEntity.setWaybillStatus("50");
one.setHandleNumber(total);
warehouseWaybillClient.updateEntity(warehouseWaybillEntity);
trunklineWaybillOrderService.updateById(one);
}else{
warehouseWaybillEntity.setWaybillStatus("60");
one.setHandleNumber(total);
warehouseWaybillClient.updateEntity(warehouseWaybillEntity);
trunklineWaybillOrderService.updateById(one);
}
}else if(waybillStatusInt == 50){
if(total == totalCount){
warehouseWaybillEntity.setWaybillStatus("60");
one.setHandleNumber(total);
warehouseWaybillClient.updateEntity(warehouseWaybillEntity);
trunklineWaybillOrderService.updateById(one);
}
}
}
}
});
}
@ -2649,7 +2781,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
remark = "有数据,不在当前仓,异常装车";
audio = "包件未入库";
updownTypeClient.downPackageOrDelTray(orderPackageCode, fromWarehouseId, "干线装车下架解托");
if(StringUtils.isNotBlank(orderPackageCode)){
updownTypeClient.downPackageOrDelTray(orderPackageCode, fromWarehouseId, "干线装车下架解托");
}
}
} else {
@ -2735,7 +2870,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
distributionParcelListClient.updateOrderPackageCodeById(packageId, "60");
distributionStockArticleClient.submitHandleNumByOrderId(1, articleId);
if (StringUtil.isBlank(trayCode)) {
if (StringUtil.isBlank(trayCode) && StringUtil.isBlank(orderPackageCode)) {
updownTypeClient.downPackageOrDelTray(orderPackageCode, warehouseId, "干线装车下架解托");
}
}
@ -6663,7 +6798,6 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
});
DistributionStockArticleEntity updateStockArticle = new DistributionStockArticleEntity();
updateStockArticle.setId(distributionStockArticle.getId());
updateStockArticle.setHandQuantity(distributionStockArticle.getHandQuantity()+num);
@ -6687,6 +6821,34 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
updateStockArticle.setId(distributionStockArticle.getId());
updateStockArticle.setHandQuantity(distributionStockArticle.getHandQuantity()+num);
updateStockArticleList.add(updateStockArticle);
if(warehouseId.equals(fromWarehouseId)){
Long waybillId = distributionStockArticle.getWaybillId();
String waybillNo = distributionStockArticle.getWaybillNumber();
WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNo);
QueryWrapper<TrunklineWaybillOrderEntity> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.eq("waybill_id",waybillId)
.eq("order_code",waybillNo);
TrunklineWaybillOrderEntity one = trunklineWaybillOrderService.getOne(queryWrapper1);
if(!Objects.isNull(one)){
Integer totalCount = waybillEntity.getTotalCount();
Integer waybillStatusInt = Integer.parseInt(waybillEntity.getWaybillStatus());
if(waybillStatusInt <= 40){
Integer handleNumber = one.getHandleNumber();
int total = handleNumber - num;
if(total == 0){
waybillEntity.setWaybillStatus("20");
one.setHandleNumber(total);
}else{
waybillEntity.setWaybillStatus("30");
one.setHandleNumber(totalCount);
}
warehouseWaybillClient.updateEntity(waybillEntity);
trunklineWaybillOrderService.updateById(one);
}
}
}
}
});
}
@ -7279,7 +7441,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
distributionParcelListClient.update(distributionParcelListEntity);
}
updownTypeClient.downPackageOrDelTray(orderPackageCode, nowWarehouseId, "干线卸车下架解托");
if(StringUtils.isNotBlank(orderPackageCode)){
updownTypeClient.downPackageOrDelTray(orderPackageCode, nowWarehouseId, "干线卸车下架解托");
}
}
}else{
//需要补装车扫记录
@ -7454,13 +7618,13 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
distributionParcelListClient.update(distributionParcelListEntity);
}
updownTypeClient.downPackageOrDelTray(orderPackageCode, wid, "干线卸车下架解托");
if(StringUtils.isNotBlank(orderPackageCode)){
updownTypeClient.downPackageOrDelTray(orderPackageCode, wid, "干线卸车下架解托");
}
}
//无装车记录异常日志记录
try {
carsLoadAsyncService.abnormalListUnloadByLoadIdAndWarehouseId(loadId, warehouseId, warehouseName, loadScanId, AuthUtil.getTenantId(), AuthUtil.getUserId(), AuthUtil.getNickName(), Func.firstLong(AuthUtil.getDeptId()));
} catch (Exception e) {
log.warn("###############unloadPackage: 存入异常列表记录失败");
@ -7970,7 +8134,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
distributionParcelListClient.update(distributionParcelListEntity);
}
updownTypeClient.downPackageOrDelTray(orderPackageCode, nowWarehouseId, "干线卸车下架解托");
if(StringUtils.isNotBlank(orderPackageCode)){
updownTypeClient.downPackageOrDelTray(orderPackageCode, nowWarehouseId, "干线卸车下架解托");
}
}
}else{
//需要补装车扫记录
@ -8134,7 +8300,13 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
distributionParcelListClient.update(distributionParcelListEntity);
}
updownTypeClient.downPackageOrDelTray(orderPackageCode, wid, "干线卸车下架解托");
if(StringUtils.isNotBlank(orderPackageCode)){
updownTypeClient.downPackageOrDelTray(orderPackageCode, wid, "干线卸车下架解托");
}
}
//无装车记录异常日志记录
@ -8181,7 +8353,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
trayName = trayEntity.getPalletName();
}
if (unbindTray == 1) {
updownTypeClient.downPackageOrDelTray(orderPackageCode, fromWarehouseId, "干线卸车下架解托");
if(StringUtils.isNotBlank(orderPackageCode)){
updownTypeClient.downPackageOrDelTray(orderPackageCode, fromWarehouseId, "干线卸车下架解托");
}
}
trunklineCarsLoadScanService.updateById(carsLoadScanEntity);

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

@ -1,5 +1,6 @@
package com.logpm.trunkline.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
import com.logpm.trunkline.mapper.TrunklineWaybillOrderMapper;
@ -54,4 +55,12 @@ public class TrunklineWaybillOrderServiceImpl extends BaseServiceImpl<TrunklineW
public void deleteByWaybillNo(String waybillNo) {
baseMapper.deleteByWaybillNo(waybillNo);
}
@Override
public TrunklineWaybillOrderEntity findEntityByWaybillNoAndOrderCode(String waybillNo, String orderCode) {
QueryWrapper<TrunklineWaybillOrderEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("waybill_no",waybillNo)
.eq("order_code",orderCode);
return baseMapper.selectOne(queryWrapper);
}
}

51
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/TaskQuestController.java

@ -25,6 +25,7 @@ import com.logpm.warehouse.dto.TaskQuestDTO;
import com.logpm.warehouse.dto.TaskSearchDTO;
import com.logpm.warehouse.entity.TaskQuestEntity;
import com.logpm.warehouse.excel.QuestContrastExcel;
import com.logpm.warehouse.excel.QuestContrastPackageExcelVO;
import com.logpm.warehouse.excel.TaskQueryDataExcel;
import com.logpm.warehouse.excel.TaskQuestExcel;
import com.logpm.warehouse.service.ITaskQuestService;
@ -49,13 +50,18 @@ import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.cache.UserCache;
import org.springblade.system.entity.User;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* 盘点任务 控制器
@ -210,6 +216,51 @@ public class TaskQuestController extends BladeController {
}
@GetMapping("/export-allDataWithPackage")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "导出全部数据明细维度", notes = "传入questDetailDTO")
public void exportAllDataWithPackage(QuestDetailDTO questDetailDTO, HttpServletResponse response){
String questNum = questDetailDTO.getQuestNum();
List<QuestContrastPackageExcelVO> list = taskQuestService.exportAllDataWithPackage(questDetailDTO);
ExcelUtil.export(response, "盘点任务【"+questNum+"】数据" + DateUtil.time(), "盘点明细数据表", list, QuestContrastPackageExcelVO.class);
}
@GetMapping("/export-panDataWithPackage")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "导出已盘数据明细维度", notes = "传入questDetailDTO")
public void exportPanDataWithPackage(QuestDetailDTO questDetailDTO, HttpServletResponse response){
String questNum = questDetailDTO.getQuestNum();
List<QuestContrastPackageExcelVO> ls = new ArrayList();
List<QuestContrastPackageExcelVO> list = taskQuestService.exportPanDataWithPackage(questDetailDTO);
//提取出list中inventoryUser为空的元素
List<QuestContrastPackageExcelVO> inventoryUserEmptyList = list.stream()
.filter(item -> item.getInventoryUser() == null)
.collect(Collectors.toList());
//把list中所有元素通过inventoryUser进行分组
Map<Long, List<QuestContrastPackageExcelVO>> groupedByInventoryUser = list.stream().filter(item -> !Objects.isNull(item.getInventoryUser()))
.collect(Collectors.groupingBy(QuestContrastPackageExcelVO::getInventoryUser));
groupedByInventoryUser.keySet().forEach(inventoryUser -> {
List<QuestContrastPackageExcelVO> questContrastPackageExcelVOS = groupedByInventoryUser.get(inventoryUser);
User user = UserCache.getUser(inventoryUser);
if(!Objects.isNull(user)){
questContrastPackageExcelVOS.forEach(questContrastPackageExcelVO -> {
questContrastPackageExcelVO.setInventoryUserStr(user.getName());
});
}
ls.addAll(questContrastPackageExcelVOS);
});
ls.addAll(inventoryUserEmptyList);
ExcelUtil.export(response, "盘点任务【"+questNum+"】数据" + DateUtil.time(), "盘点明细数据表", ls, QuestContrastPackageExcelVO.class);
}
/**
* 导出数据
*/

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWaybillController.java

@ -402,7 +402,7 @@ public class WarehouseWaybillController extends BladeController {
Map<String,List<PrintPreviewVO>> printPreviewVOS = warehouseWaybillService.printBatch(ids, tempId);
return R.data(printPreviewVOS);
} catch (Exception e) {
throw new RuntimeException(e);
return R.fail(e.getMessage());
}
}

3
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/QuestDetailDTO.java

@ -53,7 +53,4 @@ public class QuestDetailDTO extends QuestDetailEntity {
private String endTime;// 结束时间
}

109
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/excel/QuestContrastPackageExcelVO.java

@ -0,0 +1,109 @@
package com.logpm.warehouse.excel;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class QuestContrastPackageExcelVO implements Serializable {
@ColumnWidth(20)
@ExcelProperty(value = "订单号")
private String orderCode;
@ColumnWidth(20)
@ExcelProperty(value = "运单号")
private String waybillNumber;
@ColumnWidth(20)
@ExcelProperty(value = "盘点方式")
private String questType;
@ColumnWidth(20)
@ExcelProperty(value = "盘点对象")
private String questTarget;
@ColumnWidth(20)
@ExcelProperty(value = "盘点状态")
private String questStatus;
@ColumnWidth(20)
@ExcelProperty(value = "包件码")
private String orderPackageCode;
@ColumnWidth(20)
@ExcelProperty(value = "品类名称")
private String categoryName;
@ColumnWidth(20)
@ExcelProperty(value = "在库数量")
private Integer stockNum;
@ColumnWidth(20)
@ExcelProperty(value = "物料编码")
private String materialCode;
@ColumnWidth(20)
@ExcelProperty(value = "物料名称")
private String materialName;
@ColumnWidth(20)
@ExcelProperty(value = "一级品类")
private String firsts;
@ColumnWidth(20)
@ExcelProperty(value = "二级品类")
private String seconds;
@ColumnWidth(20)
@ExcelProperty(value = "三级品类")
private String thirdProduct;
@ColumnWidth(20)
@ExcelProperty(value = "商场名称")
private String marketName;
@ColumnWidth(20)
@ExcelProperty(value = "批次号")
private String incomingBatch;
@ColumnWidth(20)
@ExcelProperty(value = "发站仓名称")
private String sendWarehouseName;
@ColumnWidth(20)
@ExcelProperty(value = "品牌")
private String brandName;
@ColumnWidth(20)
@ExcelProperty(value = "原有托盘")
private String trayName;
@ColumnWidth(20)
@ExcelProperty(value = "原有库位")
private String positionCode;
@ColumnWidth(20)
@ExcelProperty(value = "新托盘")
private String newTrayName;
@ColumnWidth(20)
@ExcelProperty(value = "新库位")
private String groundingPositionCode;
@ColumnWidth(20)
@ExcelProperty(value = "盘点时间")
private Date inventoryTime;
@ExcelIgnore
private Long inventoryUser;
@ColumnWidth(20)
@ExcelProperty(value = "盘点人")
private String inventoryUserStr;
}

5
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.java

@ -23,6 +23,7 @@ import com.logpm.warehouse.entity.QuestDetailChildEntity;
import com.logpm.warehouse.entity.QuestDetailEntity;
import com.logpm.warehouse.entity.TaskQuestEntity;
import com.logpm.warehouse.entity.WarehouseTrayEntity;
import com.logpm.warehouse.excel.QuestContrastPackageExcelVO;
import com.logpm.warehouse.excel.TaskQueryDataExcel;
import com.logpm.warehouse.vo.*;
import com.logpm.warehouse.excel.TaskQuestExcel;
@ -198,4 +199,8 @@ public interface TaskQuestMapper extends BaseMapper<TaskQuestEntity> {
List<QuestDetailEntity> findIsChangeData(@Param("questNum") String questNum);
Integer findStockNum(@Param("questDetailId") Long questDetailId, @Param("tableName") String tableName);
List<QuestContrastPackageExcelVO> exportAllDataWithPackage(@Param("param") QuestDetailDTO questDetailDTO);
List<QuestContrastPackageExcelVO> exportPanDataWithPackage(@Param("param") QuestDetailDTO questDetailDTO);
}

81
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml

@ -707,4 +707,85 @@
</select>
<select id="exportAllDataWithPackage" resultType="com.logpm.warehouse.excel.QuestContrastPackageExcelVO">
select order_code orderCode,
waybill_number waybillNumber,
order_package_code orderPackageCode,
material_code materialCode,
material_name materialName,
firsts firsts,
`second` seconds,
third_product thirdProduct,
case when quest_type = 1 then '随机'
when quest_type = 2 then '库位'
when quest_type = 3 then '订单'
when quest_type = 4 then '托盘'
else '未知'
end questType,
case when quest_target = 1 then '订制品'
when quest_target = 2 then '零担'
when quest_target = 3 then '库存品'
else '未知'
end questTarget,
case when quest_status = 1 then '已盘点'
when quest_status = 3 then '已排除'
else '未盘点'
end questStatus,
category_name categoryName,
brand_name brandName,
market_name marketName,
stock_num stockNum,
incoming_batch incomingBatch,
send_warehouse_name sendWarehouseName,
tray_name trayName,
position_code positionCode,
new_tray_name newTrayName,
grounding_position_code groundingPositionCode,
inventory_time inventoryTime,
inventory_user inventoryUser
from ${param.questNum}
where is_deleted = 0
</select>
<select id="exportPanDataWithPackage" resultType="com.logpm.warehouse.excel.QuestContrastPackageExcelVO">
select order_code orderCode,
waybill_number waybillNumber,
order_package_code orderPackageCode,
material_code materialCode,
material_name materialName,
firsts firsts,
`second` seconds,
third_product thirdProduct,
case when quest_type = 1 then '随机'
when quest_type = 2 then '库位'
when quest_type = 3 then '订单'
when quest_type = 4 then '托盘'
else '未知'
end questType,
case when quest_target = 1 then '订制品'
when quest_target = 2 then '零担'
when quest_target = 3 then '库存品'
else '未知'
end questTarget,
case when quest_status = 1 then '已盘点'
when quest_status = 3 then '已排除'
else '未盘点'
end questStatus,
category_name categoryName,
brand_name brandName,
market_name marketName,
stock_num stockNum,
incoming_batch incomingBatch,
send_warehouse_name sendWarehouseName,
tray_name trayName,
position_code positionCode,
new_tray_name newTrayName,
IFNULL(grounding_position_code,position_code) groundingPositionCode,
inventory_time inventoryTime,
inventory_user inventoryUser
from ${param.questNum}
where is_deleted = 0
AND quest_status = 1
</select>
</mapper>

5
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java

@ -26,6 +26,7 @@ import com.logpm.warehouse.entity.QuestDetailChildEntity;
import com.logpm.warehouse.entity.QuestDetailEntity;
import com.logpm.warehouse.entity.TaskQuestEntity;
import com.logpm.warehouse.excel.QuestContrastExcel;
import com.logpm.warehouse.excel.QuestContrastPackageExcelVO;
import com.logpm.warehouse.excel.TaskQueryDataExcel;
import com.logpm.warehouse.excel.TaskQuestExcel;
import com.logpm.warehouse.vo.*;
@ -305,4 +306,8 @@ public interface ITaskQuestService extends BaseService<TaskQuestEntity> {
List<QuestDetailEntity> findIsChangeData(String questNum);
Integer findStockNum(Long questDetailId, String tableName);
List<QuestContrastPackageExcelVO> exportAllDataWithPackage(QuestDetailDTO questDetailDTO);
List<QuestContrastPackageExcelVO> exportPanDataWithPackage(QuestDetailDTO questDetailDTO);
}

19
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

@ -39,6 +39,7 @@ import com.logpm.warehouse.dto.TaskQuestDTO;
import com.logpm.warehouse.dto.TaskSearchDTO;
import com.logpm.warehouse.entity.*;
import com.logpm.warehouse.excel.QuestContrastExcel;
import com.logpm.warehouse.excel.QuestContrastPackageExcelVO;
import com.logpm.warehouse.excel.TaskQueryDataExcel;
import com.logpm.warehouse.excel.TaskQuestExcel;
import com.logpm.warehouse.mapper.TaskQuestMapper;
@ -49,7 +50,6 @@ import com.logpm.warehouse.vo.*;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.jetbrains.annotations.Nullable;
import org.mapstruct.factory.Mappers;
import org.springblade.common.cache.CacheNames;
import org.springblade.common.constant.RedisKeyConstant;
import org.springblade.common.constant.common.IsOrNoConstant;
@ -1009,9 +1009,9 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
BeanUtil.copyProperties(i, questDetailVO);
if (StringUtil.isNotBlank(questDetailVO.getGroundingPositionCode())) {
questDetailVO.setPositionCode(questDetailVO.getGroundingPositionCode());
}
// if (StringUtil.isNotBlank(questDetailVO.getGroundingPositionCode())) {
// questDetailVO.setPositionCode(questDetailVO.getGroundingPositionCode());
// }
if (!i.getQuestStatus().equals(0)) {
R<List<User>> listR = userSearchClient.listByUser(String.valueOf(i.getUpdateUser()));
if (ObjectUtils.isNotNull(listR.getData())) {
@ -1021,7 +1021,6 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
if (user != null) {
questDetailVO.setInventoryPerson(user.getName());
}
}
}
questDetailVO.setInventoryDate(i.getUpdateTime());
@ -3492,6 +3491,16 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
return baseMapper.findStockNum(questDetailId, tableName);
}
@Override
public List<QuestContrastPackageExcelVO> exportAllDataWithPackage(QuestDetailDTO questDetailDTO) {
return baseMapper.exportAllDataWithPackage(questDetailDTO);
}
@Override
public List<QuestContrastPackageExcelVO> exportPanDataWithPackage(QuestDetailDTO questDetailDTO) {
return baseMapper.exportPanDataWithPackage(questDetailDTO);
}
private String getQuestNum(String warehouseCode) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
// return "PDRW_" + warehouseCode + "_" + simpleDateFormat.format(new Date()) + String.format("%03d", new Random().nextInt(900) + 100);

10
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownStockupAreaServiceImpl.java

@ -250,7 +250,7 @@ public class WarehouseUpdownStockupAreaServiceImpl extends BaseServiceImpl<Wareh
//查询备货库位
String stockUpAllocationId = distributionStockClient.getCargoStockUpAllocationId(code, warehouseId, taskId);
if (Func.isEmpty(stockUpAllocationId)) {
log.error(method + "无上架库位ID,stockUpAllocationId:{}", stockUpAllocationId);
log.warn(method + "无上架库位ID,stockUpAllocationId:{}", stockUpAllocationId);
return;
// throw new RuntimeException("无上架记录");
}
@ -261,7 +261,7 @@ public class WarehouseUpdownStockupAreaServiceImpl extends BaseServiceImpl<Wareh
.eq(WarehouseUpdownStockupAreaEntity::getAllocationId, stockUpAllocationId)
);
if (warehouseUpdownStockupAreaEntityList.isEmpty()) {
log.error(method + "无上架记录AssociationValue:{},warehouseId:{}", code, warehouseId);
log.warn(method + "无上架记录AssociationValue:{},warehouseId:{}", code, warehouseId);
// throw new RuntimeException("无上架记录");
return;
@ -269,10 +269,10 @@ public class WarehouseUpdownStockupAreaServiceImpl extends BaseServiceImpl<Wareh
if (warehouseUpdownStockupAreaEntityList.size() > 1) {
boolean flag = warehouseUpdownStockupAreaEntityList.stream().anyMatch(item -> !item.getAssociationType().equals("3"));
if (flag) {
log.error(method + "多条上架记录AssociationValue:{},warehouseId:{}", code, warehouseId);
log.warn(method + "多条上架记录AssociationValue:{},warehouseId:{}", code, warehouseId);
throw new RuntimeException("多条上架记录");
} else {
log.info(method + "零担备货库位存在多条上架记录AssociationValue:{},warehouseId:{}", code, warehouseId);
log.warn(method + "零担备货库位存在多条上架记录AssociationValue:{},warehouseId:{}", code, warehouseId);
}
}
WarehouseUpdownStockupAreaEntity warehouseUpdownStockupArea = warehouseUpdownStockupAreaEntityList.get(0);
@ -297,7 +297,7 @@ public class WarehouseUpdownStockupAreaServiceImpl extends BaseServiceImpl<Wareh
AtomicInteger a = new AtomicInteger(num);
if (i < 0) {
log.info(method + "零担备货库位下架备货库位数量不足下架,库位总数sum:{},下架数量num:{}", sum, num);
throw new RuntimeException("备货库位在库数不足");
throw new CustomerException("备货库位在库数不足");
}
Iterator<WarehouseUpdownStockupAreaEntity> iterator = warehouseUpdownStockupAreaEntityList.iterator();
while (iterator.hasNext()){

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java

@ -237,7 +237,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
int i1 = next.getActualReceipt() - i.getActualReceipt();
if (i1 < 0) {
log.info("入库单进行预计数量修改,已入库数量:{},目标修改数量:{}", i.getActualReceipt(), next.getActualReceipt());
throw new RuntimeException("请输入正确的入库数量");
throw new CustomerException("请输入正确的入库数量");
}
//添加库存品
addInventory(i1, warehouseWarehousingEntryDTO, i);

Loading…
Cancel
Save