Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev-warehouse
pref_mail@163.com 2 years ago
parent
commit
15633d4c60
  1. 11
      blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java
  2. 2
      blade-gateway/src/main/resources/bootstrap.yml
  3. 10
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockEntity.java
  4. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupOrderListVO.java
  5. 4
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupStockListInfoVO.java
  6. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupStockListVO.java
  7. 5
      blade-service/logpm-distribution/pom.xml
  8. 43
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionBillLadingAppController.java
  9. 163
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java
  10. 99
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/config/RabbitMqConfiguration.java
  11. 23
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/BillLadingAppDTO.java
  12. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/StockupDTO.java
  13. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  14. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  15. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationStocklistMapper.java
  16. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.java
  17. 15
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml
  18. 13
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java
  19. 54
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/DistributionErrorQueueHandler.java
  20. 45
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/StockupScanHandler.java
  21. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java
  22. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockService.java
  23. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java
  24. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java
  25. 63
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  26. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  27. 19
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java
  28. 81
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockServiceImpl.java
  29. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  30. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
  31. 26
      blade-service/logpm-distribution/src/main/resources/application-dev.yml

11
blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java

@ -52,4 +52,15 @@ public interface RabbitConstant {
String WAREHOUSE_ERROR_EXCHANGE = "warehouse_error_exchange";
String WAREHOUSE_ERROR_ROUTING = "warehouse_error_routing";
//----------------------distribution---------------------
//备货消费失败队列
String DISTRIBUTION_ERROR_QUEUE = "distribution_error_queue";
String DISTRIBUTION_ERROR_EXCHANGE = "distribution_error_exchange";
String DISTRIBUTION_ERROR_ROUTING = "distribution_error_routing";
String STOCKUP_SCAN_QUEUE = "stockup_scan_queue";
String STOCKUP_SCAN_EXCHANGE = "stockup_scan_exchange";
String STOCKUP_SCAN_ROUTING = "stockup_scan_routing";
}

2
blade-gateway/src/main/resources/bootstrap.yml

@ -1,5 +1,5 @@
server:
port: 9999
port: 8888
spring:
cloud:
gateway:

10
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockEntity.java

@ -18,10 +18,9 @@ package com.logpm.distribution.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
@ -113,6 +112,10 @@ public class DistributionStockEntity extends TenantEntity {
*/
@ApiModelProperty(value = "在库包件ID")
private Long parcelListId;
@ApiModelProperty(value = "订单自编号")
private String orderSelfNumbering;
/**
* 预约ID
*/
@ -139,6 +142,7 @@ public class DistributionStockEntity extends TenantEntity {
@ApiModelProperty(value = "配送编号")
private Long deliveryListCode;
@ApiModelProperty(value = "备货区")
private String stockupArea;
}

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupOrderListVO.java

@ -13,7 +13,7 @@ public class DistributionStockupOrderListVO implements Serializable {
private String allocation;//库位
private String orderCode;//订单编号
private String stockArticleid;//订单ID
private Long stockArticleId;//订单ID
private String pallet;//托盘

4
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupStockListInfoVO.java

@ -11,7 +11,7 @@ public class DistributionStockupStockListInfoVO implements Serializable {
private Long reservationId;//预约单id
private Long stockListId;//库存品id
private Long stockListId;//库存品id
private String customer;//客户
@ -30,6 +30,6 @@ public class DistributionStockupStockListInfoVO implements Serializable {
private String unit;//单位
private List<StockListInfoListVO> list = new ArrayList<>();
private List<StockListInfoListVO> stockList = new ArrayList<>();
}

3
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupStockListVO.java

@ -7,6 +7,7 @@ import java.io.Serializable;
@Data
public class DistributionStockupStockListVO implements Serializable {
private Long stockListId;
private String allocation;//货位
@ -21,4 +22,6 @@ public class DistributionStockupStockListVO implements Serializable {
private Integer realNum;//实际数量
private String trayName;//托盘信息
}

5
blade-service/logpm-distribution/pom.xml

@ -57,6 +57,11 @@
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
</dependency>
<!--mq-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
</dependencies>
<build>

43
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionBillLadingAppController.java

@ -18,6 +18,7 @@ package com.logpm.distribution.appcontroller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.distribution.dto.app.BillLadingAppDTO;
import com.logpm.distribution.service.IDistrilbutionBillLadingService;
import com.logpm.distribution.vo.DistrilbutionBillLadingAppVO;
import com.logpm.distribution.vo.app.DistrilbutionAppBillLadingOrderMainVO;
@ -29,14 +30,7 @@ import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.system.feign.IDictBizClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.Map;
import org.springframework.web.bind.annotation.*;
/**
* 自提列表信息 app控制器
@ -53,35 +47,40 @@ public class DistributionBillLadingAppController extends BladeController {
private final IDistrilbutionBillLadingService distrilbutionBillLadingService;
private final IDictBizClient dictBizClient;
/**
* 备货信息表 分页列表
* 自提信息表 分页列表
*/
@GetMapping("/pageList")
@ResponseBody
@PostMapping("/pageList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "分页列表", notes = "传入stockupDTO")
public R<IPage<DistrilbutionBillLadingAppVO>> pageList(@ApiIgnore @RequestParam Map<String, Object> distrilbutionBillLading, Query query) {
IPage<DistrilbutionBillLadingAppVO> pages = distrilbutionBillLadingService.pageListApp(Condition.getPage(query), distrilbutionBillLading);
public R<IPage<DistrilbutionBillLadingAppVO>> pageList(@RequestBody BillLadingAppDTO billLadingAppDTO) {
Query query = new Query();
query.setCurrent(billLadingAppDTO.getCurrent());
query.setSize(billLadingAppDTO.getSize());
IPage<DistrilbutionBillLadingAppVO> pages = distrilbutionBillLadingService.pageListApp(Condition.getPage(query), billLadingAppDTO);
return R.data(pages);
}
@GetMapping("/orderList")
@ResponseBody
@PostMapping("/orderList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "订单列表", notes = "传入stockupDTO")
public R<DistrilbutionAppBillLadingOrderMainVO> orderList(@ApiIgnore @RequestParam Map<String, Object> distrilbutionBillLading) {
Integer orderStatus = (Integer) distrilbutionBillLading.get("orderStatus");//订单状态
Long billLadingId = (Long) distrilbutionBillLading.get("billLadingId");//自提单id
public R<DistrilbutionAppBillLadingOrderMainVO> orderList(@RequestBody BillLadingAppDTO billLadingAppDTO) {
Integer orderStatus = billLadingAppDTO.getOrderStatus();//订单状态
Long billLadingId = billLadingAppDTO.getBillLadingId();//自提单id
DistrilbutionAppBillLadingOrderMainVO vo = distrilbutionBillLadingService.selectOrderList(billLadingId,orderStatus);
return R.data(vo);
}
@GetMapping("/detailList")
@ResponseBody
@PostMapping("/detailList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "包件列表", notes = "传入stockupDTO")
public R<DistrilbutionBillLadingAppVO> detailList(@ApiIgnore @RequestParam Map<String, Object> distrilbutionBillLading) {
Integer scanStatus = (Integer) distrilbutionBillLading.get("scanStatus");//扫描状态
Long billLadingId = (Long) distrilbutionBillLading.get("billLadingId");//自提单id
String orderSelfNumbering = (String) distrilbutionBillLading.get("orderSelfNumbering");//自提单id
public R<DistrilbutionBillLadingAppVO> detailList(@RequestBody BillLadingAppDTO billLadingAppDTO) {
Integer scanStatus = billLadingAppDTO.getScanStatus();//扫描状态
Long billLadingId = billLadingAppDTO.getBillLadingId();//自提单id
String orderSelfNumbering = billLadingAppDTO.getOrderSelfNumbering();//自提单id
DistrilbutionBillLadingAppVO vo = distrilbutionBillLadingService.selectDetailList(billLadingId,scanStatus,orderSelfNumbering);
return R.data(vo);
}

163
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java

@ -20,23 +20,24 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.distribution.dto.app.StockupDTO;
import com.logpm.distribution.entity.DistributionReservationEntity;
import com.logpm.distribution.entity.DistributionStockEntity;
import com.logpm.distribution.service.IDistributionReservationService;
import com.logpm.distribution.service.IDistributionStockService;
import com.logpm.distribution.service.IDistributionStockupService;
import com.logpm.distribution.vo.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 备货信息表 app控制器
@ -55,21 +56,27 @@ public class DistributionStockupAppController extends BladeController {
private final IDistributionReservationService distributionReservationService;
private final IDistributionStockService distributionStockService;
private final RabbitTemplate rabbitTemplate;
/**
* 备货信息表 分页列表
*/
@GetMapping("/pageList")
@ResponseBody
@PostMapping("/pageList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "分页列表", notes = "传入stockupDTO")
public R<IPage<DistributionStockupListVO>> pageList(StockupDTO stockupDTO) {
public R<IPage<DistributionStockupListVO>> pageList(@RequestBody StockupDTO stockupDTO) {
IPage<DistributionStockupListVO> pages = distributionStockupService.selectStockupPage(stockupDTO);
return R.data(pages);
}
@GetMapping("/orderList")
@ResponseBody
@PostMapping("/orderList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "客户订单列表", notes = "传入stockupDTO")
public R<Map<String,Object>> orderList(StockupDTO stockupDTO) {
public R<Map<String,Object>> orderList(@RequestBody StockupDTO stockupDTO) {
Integer orderStatus = stockupDTO.getOrderStatus();
Map<String,Object> map = new HashMap<>();
Long reservationId = stockupDTO.getReservationId();
@ -110,36 +117,43 @@ public class DistributionStockupAppController extends BladeController {
}
@GetMapping("/orderInfo")
@ResponseBody
@PostMapping("/orderInfo")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "客户订单列表", notes = "传入stockupDTO")
public R orderInfo(StockupDTO stockupDTO) {
public R orderInfo(@RequestBody StockupDTO stockupDTO) {
log.info("##############orderInfo: {}",stockupDTO);
Long reservationId = stockupDTO.getReservationId();//预约单id
String orderCode = stockupDTO.getOrderCode();//订单编号
Long stockArticleId = stockupDTO.getStockArticleId();//订单id
String descriptionGoods = stockupDTO.getDescriptionGoods();//物料名称
Long stockListId = stockupDTO.getStockListId();//库存品id
Integer orderStatus = stockupDTO.getOrderStatus();//1 客户订单 2库存品
String allocation = stockupDTO.getAllocation();//库位
String pallet = stockupDTO.getPallet();//托盘
String sku = stockupDTO.getSku();
String cargoNorms = stockupDTO.getCargoNorms();//规格
String cargoUnit = stockupDTO.getCargoUnit();//单位
String allocation = stockupDTO.getAllocation();
String pallet = stockupDTO.getPallet();
if(orderStatus.equals(1)){
//查询客户订单详情
if(!StringUtil.hasLength(orderCode)){
log.warn("##############orderInfo: 订单编号为空 orderCode={}",orderCode);
return R.fail("订单编号为空");
if(Objects.isNull(stockArticleId)){
log.warn("##############orderInfo: 订单id为空 stockArticleId={}",stockArticleId);
return R.fail("订单id为空");
}
if(StringUtil.isBlank(allocation)){
log.warn("##############orderInfo: 库位为空 allocation={}",allocation);
return R.fail("库位为空");
}
if(StringUtil.isBlank(pallet)){
log.warn("##############orderInfo: 托盘为空 pallet={}",pallet);
return R.fail("托盘为空");
}
DistributionStockupOrderInfoVO infoVO = distributionStockupService.selectOrderInfo(reservationId,stockArticleId,allocation,pallet);
return R.data(infoVO);
}else if(orderStatus.equals(2)){
if(!StringUtil.hasLength(descriptionGoods)){
log.warn("##############orderInfo: 物料名称为空 descriptionGoods={}",descriptionGoods);
return R.fail("物料名称为空");
if(Objects.isNull(stockListId)){
log.warn("##############orderInfo: 库存品id为空 stockListId={}",stockListId);
return R.fail("库存品id为空");
}
DistributionStockupStockListInfoVO infoVO = distributionStockupService.selectStockListInfo(reservationId,descriptionGoods,allocation,pallet,sku,cargoNorms,cargoUnit);
DistributionStockupStockListInfoVO infoVO = distributionStockupService.selectStockListInfo(reservationId,stockListId);
return R.data(infoVO);
}else{
log.warn("##############orderInfo: 未知的查询类型 orderStatus={}",orderStatus);
@ -147,6 +161,103 @@ public class DistributionStockupAppController extends BladeController {
}
}
@ResponseBody
@PostMapping("/stockupScan")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "备货扫描", notes = "传入stockupDTO")
public R stockupScan(@RequestBody StockupDTO stockupDTO) {
Integer scanType = stockupDTO.getScanType();//扫码类型
if(scanType == 1){
//包件扫描
String orderCode = stockupDTO.getOrderCode();//订单自编号
String packetBarCode = stockupDTO.getPacketBarCode();//包件码
String stockupArea = stockupDTO.getStockupArea();//备货区
Long reservationId = stockupDTO.getReservationId();//预约单id
if(StringUtil.isBlank(orderCode)){
log.warn("##################stockupScan: 包件扫码,订单自编号为空");
return R.fail("包件扫码:订单自编号不能为空");
}
if(StringUtil.isBlank(packetBarCode)){
log.warn("##################stockupScan: 包件扫码,包件码为空");
return R.fail("包件扫码:包件码不能为空");
}
if(StringUtil.isBlank(stockupArea)){
log.warn("##################stockupScan: 包件扫码,备货区为空");
return R.fail("包件扫码:备货区不能为空");
}
if(Objects.isNull(reservationId)){
log.warn("##################stockupScan: 包件扫码,预约单id为空");
return R.fail("包件扫码:预约单id不能为空");
}
//先保存扫码包件信息,后续由队列来出来余下补充信息
DistributionStockEntity entity = new DistributionStockEntity();
entity.setOrderSelfNumbering(orderCode);
entity.setCoding(packetBarCode);
entity.setStockupArea(stockupArea);
entity.setReservationId(reservationId);
entity.setConditions(0);
distributionStockService.save(entity);
Map<String, Object> map = new HashMap<>();
map.put("messageId", CommonUtil.getUUID());
map.put("scanType", scanType);
map.put("logId", entity.getId());
map.put("messageData", entity);
map.put("createTime", new Date().getTime());
//将消息携带绑定键值
rabbitTemplate.convertAndSend(RabbitConstant.STOCKUP_SCAN_EXCHANGE, RabbitConstant.STOCKUP_SCAN_ROUTING, map);
return R.success("扫码成功");
}else if(scanType == 2){
//库存品扫描
Long reservationId = stockupDTO.getReservationId();
Long stockListId = stockupDTO.getStockListId();
String packetBarCode = stockupDTO.getPacketBarCode();
String stockupArea = stockupDTO.getStockupArea();//备货区
if(StringUtil.isBlank(packetBarCode)){
log.warn("##################stockupScan: 库存品扫码,包件码为空");
return R.fail("库存品扫码:包件码不能为空");
}
if(StringUtil.isBlank(stockupArea)){
log.warn("##################stockupScan: 库存品扫码,备货区为空");
return R.fail("库存品扫码:备货区不能为空");
}
if(Objects.isNull(stockListId)){
log.warn("##################stockupScan: 库存品扫码,库存品id为空");
return R.fail("库存品扫码:库存品id不能为空");
}
if(Objects.isNull(reservationId)){
log.warn("##################stockupScan: 库存品扫码,预约单id为空");
return R.fail("库存品扫码:预约单id不能为空");
}
//先保存扫码包件信息,后续由队列来出来余下补充信息
DistributionStockEntity entity = new DistributionStockEntity();
entity.setCoding(packetBarCode);
entity.setStockupArea(stockupArea);
entity.setReservationId(reservationId);
entity.setStockListId(stockListId);
entity.setConditions(0);
distributionStockService.save(entity);
Map<String, Object> map = new HashMap<>();
map.put("messageId", CommonUtil.getUUID());
map.put("scanType", scanType);
map.put("logId", entity.getId());
map.put("messageData", entity);
map.put("createTime", new Date().getTime());
//将消息携带绑定键值
rabbitTemplate.convertAndSend(RabbitConstant.STOCKUP_SCAN_EXCHANGE, RabbitConstant.STOCKUP_SCAN_ROUTING, map);
return R.success("扫码成功");
}else{
log.warn("###################stockupScan: 未知的扫码类型 scanType={}",scanType);
return R.fail("未知的扫码类型");
}
}
}

99
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/config/RabbitMqConfiguration.java

@ -0,0 +1,99 @@
package com.logpm.distribution.config;
import com.alibaba.nacos.shaded.com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant;
import org.springframework.amqp.core.*;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.rabbit.retry.MessageRecoverer;
import org.springframework.amqp.rabbit.retry.RepublishMessageRecoverer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.Map;
/**
* RabbitMQ配置主要是配置队列如果提前存在该队列可以省略本配置类
*
* @author yangkai.shen
*/
@Slf4j
@Configuration
public class RabbitMqConfiguration {
@Bean
public RabbitTemplate createRabbitTemplate(ConnectionFactory connectionFactory){
RabbitTemplate template = new RabbitTemplate();
template.setConnectionFactory(connectionFactory);
template.setMandatory(true);
template.setConfirmCallback(new RabbitTemplate.ConfirmCallback() {
@Override
public void confirm(CorrelationData correlationData, boolean b, String s) {
System.out.println("确认回调-相关数据:"+correlationData);
System.out.println("确认回调-确认情况:"+b);
System.out.println("确认回调-原因:"+s);
}
});
template.setReturnsCallback(new RabbitTemplate.ReturnsCallback() {
@Override
public void returnedMessage(ReturnedMessage returnedMessage) {
System.out.println("返回回调-消息:"+returnedMessage.getMessage());
System.out.println("返回回调-回应码:"+returnedMessage.getReplyCode());
System.out.println("返回回调-回应信息:"+returnedMessage.getReplyText());
System.out.println("返回回调-交换机:"+returnedMessage.getExchange());
System.out.println("返回回调-路由键:"+returnedMessage.getRoutingKey());
}
});
return template;
}
@Bean
public DirectExchange distributionErrorMessageExchange(){
return new DirectExchange(RabbitConstant.DISTRIBUTION_ERROR_EXCHANGE);
}
@Bean
public Queue distributionErrorQueue(){
return new Queue(RabbitConstant.DISTRIBUTION_ERROR_QUEUE, true);
}
@Bean
public Binding distributionErrorBinding(Queue distributionErrorQueue, DirectExchange distributionErrorMessageExchange){
return BindingBuilder.bind(distributionErrorQueue).to(distributionErrorMessageExchange).with(RabbitConstant.DISTRIBUTION_ERROR_ROUTING);
}
/**
* 消费失败队列
* @param rabbitTemplate
* @return
*/
@Bean
public MessageRecoverer republishMessageRecoverer(RabbitTemplate rabbitTemplate){
return new RepublishMessageRecoverer(rabbitTemplate, RabbitConstant.DISTRIBUTION_ERROR_EXCHANGE, RabbitConstant.DISTRIBUTION_ERROR_ROUTING);
}
/**
* 备货扫码任务队列
*/
@Bean
public Queue stockupScanQueue() {
return new Queue(RabbitConstant.STOCKUP_SCAN_QUEUE, true);
}
@Bean
public CustomExchange stockupScanExchange() {
Map<String, Object> args = Maps.newHashMap();
args.put("x-delayed-type", "direct");
return new CustomExchange(RabbitConstant.STOCKUP_SCAN_EXCHANGE, "x-delayed-message", true, false, args);
}
@Bean
public Binding stockupScanBinding(Queue stockupScanQueue, CustomExchange stockupScanExchange) {
return BindingBuilder.bind(stockupScanQueue).to(stockupScanExchange).with(RabbitConstant.STOCKUP_SCAN_ROUTING).noargs();
}
}

23
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/BillLadingAppDTO.java

@ -0,0 +1,23 @@
package com.logpm.distribution.dto.app;
import lombok.Data;
import java.io.Serializable;
@Data
public class BillLadingAppDTO implements Serializable {
private Integer current;
private Integer size;
private String pickUpTime;//提货时间
private Integer orderStatus;//订单状态
private Long billLadingId;//自提单id
private Integer scanStatus;//扫码类型
private String orderSelfNumbering;//订单自编码
}

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/StockupDTO.java

@ -13,7 +13,7 @@ public class StockupDTO implements Serializable {
private Integer status;//0未完成 1已完成
@ApiModelProperty("当前页")
private Integer currentPage;
private Integer current;
@ApiModelProperty("每页的数量")
private Integer size;
@ -38,4 +38,9 @@ public class StockupDTO implements Serializable {
private Long userId;//当前操作人
//扫码参数
private Integer scanType;//备货扫码类型 1 包件 2库存品
private String packetBarCode;//包件码
private String stockupArea;//备货区
private Long stockListId;//库存品id
}

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

@ -56,13 +56,15 @@
1 goodsType,
IF(t.id is null,0,1) isScan,
s.id scanId
from logpm_distribution_reservation_package ldrp
from logpm_distribution_reservation ldr
left join logpm_distribution_reservation_package ldrp on ldr.id = ldrp.reservation_id and ldrp.is_deleted = 0
left join logpm_distribution_parcel_list ldpl on ldrp.parce_list_id = ldpl.id and ldpl.is_deleted = 0
left join logpm_distribution_stock s on s.parcel_list_id = ldpl.id and s.is_deleted = 0
where ldpl.stock_article_id = #{stockArticleId}
and ldr.id = #{reservationId}
and CONCAT(ldpl.cargo_title,'-',ldpl.shelf_title,'-',ldpl.goods_allocation) = #{allocation}
and ldpl.pallet = #{pallet}
and ldrp.is_deleted = 0
and ldr.is_deleted = 0
</select>
<select id="selectWarehouseAreaByReservationId" resultType="String">

9
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml

@ -168,7 +168,7 @@
<select id="selectStockupOrderList" resultType="com.logpm.distribution.vo.DistributionStockupOrderListVO">
select CONCAT(ldpl.cargo_title,'-',ldpl.shelf_title,'-',ldpl.goods_allocation) allocation,
ldrs.stock_article_code orderCode,
ldrs.stock_article_id stockArticleid,
ldrs.stock_article_id stockArticleId,
ldpl.pallet pallet,
count(ldpl.id) planNum,
count(s.id) scanNum
@ -188,23 +188,26 @@
</select>
<select id="selectStockupStockList" resultType="com.logpm.distribution.vo.DistributionStockupStockListVO">
select ldst.storage_location allocation,
select ldst.id stockListId,
ldst.storage_location allocation,
ldst.description_goods materialName,
ldst.sku sku,
ldst.cargo_norms cargoNorms,
ldrs.reservation_num planNum,
ldst.cargo_unit cargoUnit,
ldst.tray_name trayName,
count(ldss.id) realNum
from logpm_distribution_reservation_stocklist ldrs
left join logpm_distribution_stock_list ldst on ldst.id = ldrs.stocklist_id and ldst.is_deleted = 0
left join logpm_distribution_stock s on s.stock_list_id = ldst.id and s.is_deleted = 0
where ldrs.reservation_id = #{reservationId}
and ldrs.is_deleted = 0
group by ldst.storage_location,
group by ldst.id,ldst.storage_location,
ldst.description_goods,
ldst.sku,
ldst.cargo_norms,
ldrs.reservation_num,
ldst.tray_name,
ldst.cargo_unit
</select>

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

@ -22,6 +22,7 @@ import com.logpm.distribution.excel.DistributionReservationStocklistExcel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -31,6 +32,7 @@ import java.util.List;
* @author TJJ
* @since 2023-06-28
*/
@Mapper
public interface DistributionReservationStocklistMapper extends BaseMapper<DistributionReservationStocklistEntity> {
/**

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.java

@ -56,11 +56,14 @@ public interface DistributionStockListMapper extends BaseMapper<DistributionStoc
IPage<DistributionStockListVO> pageOwn(IPage page,@Param("param") DistributionStockListEntity distributionStockListEntity);
DistributionStockupStockListInfoVO selectStockListInfo(@Param("reservationId") Long reservationId, @Param("descriptionGoods") String descriptionGoods, @Param("allocation") String allocation, @Param("pallet") String pallet, @Param("sku") String sku, @Param("cargoNorms") String cargoNorms, @Param("cargoUnit") String cargoUnit);
DistributionStockupStockListInfoVO selectStockListInfo(@Param("reservationId") Long reservationId, @Param("stockListId") Long stockListId);
List<String> selectWarehouseAreaByReservationId(@Param("reservationId") Long reservationId);
List<String> selectPalletByReservationId(@Param("reservationId") Long reservationId);
List<StockListInfoListVO> selectStockListInfoList(@Param("reservationId") Long reservationId, @Param("descriptionGoods") String descriptionGoods, @Param("allocation") String allocation, @Param("pallet") String pallet, @Param("sku") String sku, @Param("cargoNorms") String cargoNorms, @Param("cargoUnit") String cargoUnit);
List<StockListInfoListVO> selectStockListInfoList(@Param("reservationId") Long reservationId, @Param("stockListId") Long stockListId);
Integer submitQuantityByStockListId(@Param("num") int num, @Param("stockListId") Long stockListId);
}

15
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml

@ -123,12 +123,7 @@
left join logpm_distribution_stock s on s.stock_list_id = ldsl.id and s.is_deleted = 0
where ldr.is_deleted = 0
and ldr.id = #{reservationId}
and ldsl.description_goods = #{descriptionGoods}
and ldsl.storage_location = #{allocation}
and ldsl.tray_name = #{pallet}
and ldsl.sku = #{sku}
and ldsl.cargo_norms = #{cargoNorms}
and ldsl.cargo_unit = #{cargoUnit}
and ldrs.stocklist_id = #{stockListId}
group by ldr.id,
ldsl.id,
ldr.consignee,
@ -181,4 +176,12 @@
group by sl.tray_name
</select>
<update id="submitQuantityByStockListId" >
update logpm_distribution_stock_list
set quantity_stock = quantity_stock - #{num},
quantity_occupied = quantity_occupied - #{num},
outbound_quantity = outbound_quantity + #{num}
where id = #{stockListId}
</update>
</mapper>

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

@ -16,18 +16,19 @@
*/
package com.logpm.distribution.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.dto.DistrilbutionBillLadingDTO;
import com.logpm.distribution.dto.app.BillLadingAppDTO;
import com.logpm.distribution.entity.DistrilbutionBillLadingEntity;
import com.logpm.distribution.excel.DistrilbutionBillLadingExcel;
import com.logpm.distribution.vo.DistrilbutionBillLadingAppVO;
import com.logpm.distribution.vo.DistrilbutionBillLadingVO;
import com.logpm.distribution.excel.DistrilbutionBillLadingExcel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.vo.app.DistrilbutionAppBillLadingDetailVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 提货单 Mapper 接口
@ -57,7 +58,7 @@ public interface DistrilbutionBillLadingMapper extends BaseMapper<DistrilbutionB
IPage<DistrilbutionBillLadingVO> pageList(IPage<Object> page, @Param("param") DistrilbutionBillLadingDTO distrilbutionBillLadingDTO);
IPage<DistrilbutionBillLadingAppVO> pageListApp(IPage<Object> page, @Param("param") Map<String, Object> distrilbutionBillLading);
IPage<DistrilbutionBillLadingAppVO> pageListApp(IPage<Object> page, @Param("param") BillLadingAppDTO billLadingAppDTO);
DistrilbutionBillLadingAppVO selectDataByBillLadingId(@Param("billLadingId") Long billLadingId);

54
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/DistributionErrorQueueHandler.java

@ -0,0 +1,54 @@
package com.logpm.distribution.receiver;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.logpm.distribution.entity.DistributionStockEntity;
import com.logpm.distribution.service.IDistributionStockService;
import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.util.Map;
/**
* 异常消息队列 处理器
*
* @author zhy
*/
@Slf4j
@RabbitListener(queues = RabbitConstant.DISTRIBUTION_ERROR_QUEUE)
@Component
public class DistributionErrorQueueHandler {
private IDistributionStockService distributionStockService;
@RabbitHandler
public void distributionErrorHandler(Map map, Message message, Channel channel) {
// 如果手动ACK,消息会被监听消费,但是消息在队列中依旧存在,如果 未配置 acknowledge-mode 默认是会在消费完毕后自动ACK掉
final long deliveryTag = message.getMessageProperties().getDeliveryTag();
try {
Long logId = (Long) map.get("logId");
UpdateWrapper<DistributionStockEntity> updateWrapper = new UpdateWrapper<>();
updateWrapper.set("conditions",2)
.eq("id",logId);
boolean updateFlag = distributionStockService.update(updateWrapper);
if(updateFlag){
channel.basicAck(deliveryTag, false);
}else{
channel.basicReject(deliveryTag,true);
}
} catch (IOException e) {
try {
// 处理失败,重新压入MQ
channel.basicReject(deliveryTag,true);
} catch (IOException e1) {
e1.printStackTrace();
}
}
}
}

45
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/StockupScanHandler.java

@ -0,0 +1,45 @@
package com.logpm.distribution.receiver;
import com.logpm.distribution.entity.DistributionStockEntity;
import com.logpm.distribution.service.IDistributionStockService;
import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Map;
/**
* 获取订单数据 处理器
*
* @author yangkai.shen
*/
@Slf4j
@RabbitListener(queues = RabbitConstant.STOCKUP_SCAN_QUEUE)
@Component
public class StockupScanHandler {
@Autowired
private IDistributionStockService distributionStockService;
@RabbitHandler
public void stockupScanHandler(Map map, Message message, Channel channel){
log.info("##################stockupScanHandler: 处理补全扫码作业其他数据");
Integer scanType = (Integer) map.get("scanType");
DistributionStockEntity distributionStockEntity = (DistributionStockEntity) map.get("messageData");
//根据扫码类型处理不同的数据
if(scanType == 1){
distributionStockService.repairPackageScanInfo(distributionStockEntity);
}else if(scanType == 2){
distributionStockService.repairStockListScanInfo(distributionStockEntity);
}else{
log.warn("################stockupScanHandler: 未知的扫码类型 scanType={}",scanType);
}
}
}

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

@ -80,12 +80,13 @@ public interface IDistributionStockListService extends BaseService<DistributionS
IPage<DistributionStockListVO> pageOwn(IPage<Object> page, Map<String, Object> distributionStockList);
DistributionStockupStockListInfoVO selectStockListInfo(Long reservationId, String descriptionGoods, String allocation, String pallet, String sku, String cargoNorms, String cargoUnit);
DistributionStockupStockListInfoVO selectStockListInfo(Long reservationId, Long stockListId);
List<String> selectWarehouseAreaByReservationId(Long reservationId);
List<String> selectPalletByReservationId(Long reservationId);
List<StockListInfoListVO> selectStockListInfoList(Long reservationId, String descriptionGoods, String allocation, String pallet, String sku, String cargoNorms, String cargoUnit);
List<StockListInfoListVO> selectStockListInfoList(Long reservationId, Long stockListId);
Integer submitQuantityByStockListId(int num, Long stockListId);
}

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

@ -50,4 +50,10 @@ public interface IDistributionStockService extends BaseService<DistributionStock
List<DistributionStockExcel> exportDistributionStock(Wrapper<DistributionStockEntity> queryWrapper);
Integer selectRealNum(Long reservationId);
void repairPackageScanInfo(DistributionStockEntity distributionStockEntity);
void repairStockListScanInfo(DistributionStockEntity distributionStockEntity);
}

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

@ -80,7 +80,7 @@ public interface IDistributionStockupService extends BaseService<DistributionSto
*/
IPage<DistributionStockupVO> detailReservationOwn(IPage<Object> page,Long id);
DistributionStockupStockListInfoVO selectStockListInfo(Long reservationId, String descriptionGoods, String allocation, String pallet, String sku, String cargoNorms, String cargoUnit);
DistributionStockupStockListInfoVO selectStockListInfo(Long reservationId, Long stockListId);
/**
* 订单详细

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

@ -17,14 +17,16 @@
package com.logpm.distribution.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.dto.DistrilbutionBillLadingDTO;
import com.logpm.distribution.dto.app.BillLadingAppDTO;
import com.logpm.distribution.entity.DistrilbutionBillLadingEntity;
import com.logpm.distribution.excel.DistrilbutionBillLadingExcel;
import com.logpm.distribution.vo.DistrilbutionBillLadingAppVO;
import com.logpm.distribution.vo.DistrilbutionBillLadingVO;
import com.logpm.distribution.excel.DistrilbutionBillLadingExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.vo.app.DistrilbutionAppBillLadingOrderMainVO;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
import java.util.Map;
@ -57,7 +59,7 @@ public interface IDistrilbutionBillLadingService extends BaseService<Distrilbuti
IPage<DistrilbutionBillLadingVO> pageList(IPage<Object> page, Map<String, Object> distrilbutionBillLading);
IPage<DistrilbutionBillLadingAppVO> pageListApp(IPage<Object> page, Map<String, Object> distrilbutionBillLading);
IPage<DistrilbutionBillLadingAppVO> pageListApp(IPage<Object> page, BillLadingAppDTO billLadingAppDTO);
DistrilbutionAppBillLadingOrderMainVO selectOrderList(Long billLadingId, Integer orderStatus);

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

@ -26,7 +26,6 @@ import com.logpm.distribution.excel.DistributionReservationExcel;
import com.logpm.distribution.mapper.*;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.*;
import lombok.AllArgsConstructor;
import org.springblade.common.serviceConstant.ServiceConstant;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
@ -34,8 +33,9 @@ import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.RandomType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
@ -55,46 +55,65 @@ import java.util.stream.Collectors;
* @since 2023-06-12
*/
@Service
@AllArgsConstructor
public class DistributionReservationServiceImpl extends BaseServiceImpl<DistributionReservationMapper, DistributionReservationEntity> implements IDistributionReservationService {
private final DistributionReservationMapper distributionReservationMapper;
@Autowired
private DistributionReservationMapper distributionReservationMapper;
private final IDistributionStockupService distributionStockupService;
@Lazy
@Autowired
private IDistributionStockupService distributionStockupService;
private final DistributionStockupMapper distributionStockupMapper;
@Autowired
private DistributionStockupMapper distributionStockupMapper;
private final IDistributionStockupInfoService distributionStockupInfoService;
@Autowired
private IDistributionStockupInfoService distributionStockupInfoService;
private final IDistributionStockArticleService distributionStockArticleService;
@Autowired
private IDistributionStockArticleService distributionStockArticleService;
private final IDistributionStockListService distributionStockListService;
@Autowired
private IDistributionStockListService distributionStockListService;
private final IDistributionDeliveryListService distributionDeliveryListService;
@Autowired
private IDistributionDeliveryListService distributionDeliveryListService;
private final IDistributionDeliverySelfService distributionDeliverySelfService;
@Autowired
private IDistributionDeliverySelfService distributionDeliverySelfService;
private final IDistributionDeliveryTripartiteService distributionDeliveryTripartiteService;
@Autowired
private IDistributionDeliveryTripartiteService distributionDeliveryTripartiteService;
private final IDistributionReservationStockarticleService distributionReservationStockarticleService;
@Autowired
private IDistributionReservationStockarticleService distributionReservationStockarticleService;
private final DistributionReservationStockarticleMapper distributionReservationStockarticleMapper;
@Autowired
private DistributionReservationStockarticleMapper distributionReservationStockarticleMapper;
private final IDistributionReservationStocklistService distributionReservationStocklistService;
@Autowired
private IDistributionReservationStocklistService distributionReservationStocklistService;
private final DistributionReservationStocklistMapper distributionReservationStocklistMapper;
@Autowired
private DistributionReservationStocklistMapper distributionReservationStocklistMapper;
private final DistributionReservationPackageMapper distributionReservationPackageMapper;
@Autowired
private DistributionReservationPackageMapper distributionReservationPackageMapper;
private final IDistributionReservationPackageService distributionReservationPackageService;
@Autowired
private IDistributionReservationPackageService distributionReservationPackageService;
private final IDistributionParcelListService distributionParcelListService;
@Autowired
private IDistributionParcelListService distributionParcelListService;
private final IDistributionLoadscaninvnService distributionLoadscaninvnService;
@Autowired
private IDistributionLoadscaninvnService distributionLoadscaninvnService;
private final IDistributionLoadscanService distributionLoadscanService;
// @Autowired
// private IDistributionLoadscanService distributionLoadscanService;
private final IDistributionSignforService distributionSignforService;
@Autowired
private IDistributionSignforService distributionSignforService;
@Override

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

@ -62,7 +62,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
private final DistributionDeliveryListMapper distributionDeliveryListMapper;
private final IDistributionStockService distributionStockService;
// private final IDistributionStockService distributionStockService;
private final IDistributionAddvalueService distributionAddvalueService;

19
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java

@ -20,15 +20,12 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basic.feign.IBasicTenantCodeClient;
import com.logpm.distribution.dto.DistributionStockListDTO;
import com.logpm.distribution.entity.DistributionStockListEntity;
import com.logpm.distribution.entity.DistributionUnpackingDetailsEntity;
import com.logpm.distribution.excel.DistributionStockListExcel;
import com.logpm.distribution.mapper.DistributionStockListMapper;
import com.logpm.distribution.service.IDistributionParcelDetailsService;
import com.logpm.distribution.service.IDistributionStockListService;
import com.logpm.distribution.service.IDistributionStockService;
import com.logpm.distribution.service.IDistributionUnpackingDetailsService;
import com.logpm.distribution.vo.DistributionStockArticleVO;
import com.logpm.distribution.vo.DistributionStockListVO;
@ -58,9 +55,6 @@ import java.util.concurrent.atomic.AtomicReference;
@AllArgsConstructor
public class DistributionStockListServiceImpl extends BaseServiceImpl<DistributionStockListMapper, DistributionStockListEntity> implements IDistributionStockListService {
private final IDistributionParcelDetailsService distributionParcelDetailsService;
private final IDistributionStockService distributionStockService;
private final IBasicTenantCodeClient basicTenantCodeClient;
private final IDistributionUnpackingDetailsService distributionUnpackingDetailsService;
@ -234,8 +228,8 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
}
@Override
public DistributionStockupStockListInfoVO selectStockListInfo(Long reservationId, String descriptionGoods, String allocation, String pallet, String sku, String cargoNorms, String cargoUnit) {
return baseMapper.selectStockListInfo(reservationId,descriptionGoods,allocation,pallet,sku,cargoNorms,cargoUnit);
public DistributionStockupStockListInfoVO selectStockListInfo(Long reservationId, Long stockListId) {
return baseMapper.selectStockListInfo(reservationId,stockListId);
}
@Override
@ -249,8 +243,13 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
}
@Override
public List<StockListInfoListVO> selectStockListInfoList(Long reservationId, String descriptionGoods, String allocation, String pallet, String sku, String cargoNorms, String cargoUnit) {
return baseMapper.selectStockListInfoList(reservationId,descriptionGoods,allocation,pallet,sku,cargoNorms,cargoUnit);
public List<StockListInfoListVO> selectStockListInfoList(Long reservationId, Long stockListId) {
return baseMapper.selectStockListInfoList(reservationId,stockListId);
}
@Override
public Integer submitQuantityByStockListId(int num, Long stockListId) {
return baseMapper.submitQuantityByStockListId(num,stockListId);
}
}

81
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockServiceImpl.java

@ -16,16 +16,27 @@
*/
package com.logpm.distribution.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionReservationEntity;
import com.logpm.distribution.entity.DistributionStockEntity;
import com.logpm.distribution.vo.DistributionStockVO;
import com.logpm.distribution.entity.DistributionStockListEntity;
import com.logpm.distribution.excel.DistributionStockExcel;
import com.logpm.distribution.mapper.DistributionStockMapper;
import com.logpm.distribution.service.IDistributionParcelListService;
import com.logpm.distribution.service.IDistributionReservationService;
import com.logpm.distribution.service.IDistributionStockListService;
import com.logpm.distribution.service.IDistributionStockService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.vo.DistributionStockVO;
import lombok.extern.log4j.Log4j2;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
/**
* 库存品详情信息 服务实现类
@ -33,9 +44,20 @@ import java.util.List;
* @author cyz
* @since 2023-06-26
*/
@Log4j2
@Service
public class DistributionStockServiceImpl extends BaseServiceImpl<DistributionStockMapper, DistributionStockEntity> implements IDistributionStockService {
@Autowired
private IDistributionParcelListService distributionParcelListService;
@Autowired
private IDistributionReservationService distributionReservationService;
@Autowired
private IDistributionStockListService distributionStockListService;
@Override
public IPage<DistributionStockVO> selectDistributionStockPage(IPage<DistributionStockVO> page, DistributionStockVO distributionStock) {
return page.setRecords(baseMapper.selectDistributionStockPage(page, distributionStock));
@ -56,4 +78,55 @@ public class DistributionStockServiceImpl extends BaseServiceImpl<DistributionSt
return baseMapper.selectRealNum(reservationId);
}
@Override
public void repairPackageScanInfo(DistributionStockEntity distributionStockEntity) {
String coding = distributionStockEntity.getCoding();
Long reservationId = distributionStockEntity.getReservationId();
log.info("#############repairPackageScanInfo: 补全包件扫码信息开始 coding={}",coding);
//查询包件信息
QueryWrapper<DistributionParcelListEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("packet_bar_code",coding);
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getOne(queryWrapper);//包件信息
DistributionReservationEntity reservationEntity = distributionReservationService.getById(reservationId);
if(!Objects.isNull(parcelListEntity)){
String cargoTitle = parcelListEntity.getCargoTitle();//货区
String shelfTitle = parcelListEntity.getShelfTitle();//货位
String goodsAllocation = parcelListEntity.getGoodsAllocation();//货架
distributionStockEntity.setGoodsAllocation(cargoTitle+"-"+shelfTitle+"-"+goodsAllocation);
distributionStockEntity.setStockArticle(parcelListEntity.getStockArticleId());
distributionStockEntity.setGoodsName(parcelListEntity.getFirsts());
distributionStockEntity.setParcelListId(parcelListEntity.getId());
distributionStockEntity.setReservationCode(reservationEntity.getReservationCode());
}
distributionStockEntity.setConditions(1);
baseMapper.updateById(distributionStockEntity);
log.info("#############repairPackageScanInfo: 补全包件扫码信息完成 coding={}",coding);
}
@Override
public void repairStockListScanInfo(DistributionStockEntity distributionStockEntity) {
Long stockListId = distributionStockEntity.getStockListId();
Long reservationId = distributionStockEntity.getReservationId();
log.info("#############repairPackageScanInfo: 补全库存品扫码信息完成 stockListId={}",stockListId);
//查询包件信息
QueryWrapper<DistributionStockListEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id",stockListId);
DistributionStockListEntity stockListEntity = distributionStockListService.getOne(queryWrapper);//包件信息
DistributionReservationEntity reservationEntity = distributionReservationService.getById(reservationId);
if(!Objects.isNull(stockListEntity)){
distributionStockEntity.setGoodsAllocation(stockListEntity.getStorageLocation());
distributionStockEntity.setGoodsName(stockListEntity.getDescriptionGoods());
distributionStockEntity.setUnpackingQuantity(stockListEntity.getUnpackingQuantity());
distributionStockEntity.setUnit(stockListEntity.getCargoUnit());
distributionStockEntity.setReservationCode(reservationEntity.getReservationCode());
}
distributionStockEntity.setConditions(1);
baseMapper.updateById(distributionStockEntity);
//扣减
distributionStockListService.submitQuantityByStockListId(1,stockListId);
log.info("#############repairPackageScanInfo: 补全包件扫码信息完成 stockListId={}",stockListId);
}
}

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

@ -115,7 +115,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
@Override
public IPage<DistributionStockupListVO> selectStockupPage(StockupDTO stockupDTO) {
IPage<Object> page = new Page<>();
page.setCurrent(stockupDTO.getCurrentPage());
page.setCurrent(stockupDTO.getCurrent());
page.setSize(stockupDTO.getSize());
stockupDTO.setUserId(AuthUtil.getUserId());
@ -382,15 +382,15 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}
@Override
public DistributionStockupStockListInfoVO selectStockListInfo(Long reservationId, String descriptionGoods, String allocation, String pallet, String sku, String cargoNorms, String cargoUnit) {
public DistributionStockupStockListInfoVO selectStockListInfo(Long reservationId, Long stockListId) {
//查询客户信息
// DistributionReservationEntity reservationEntity = distributionReservationService.getById(reservationId);
//通过订单id和库位心系,托盘信息查询对应的库存品列表
DistributionStockupStockListInfoVO entity = distributionStockListService.selectStockListInfo(reservationId,descriptionGoods,allocation,pallet,sku,cargoNorms,cargoUnit);
DistributionStockupStockListInfoVO entity = distributionStockListService.selectStockListInfo(reservationId,stockListId);
List<StockListInfoListVO> list = distributionStockListService.selectStockListInfoList(reservationId,descriptionGoods,allocation,pallet,sku,cargoNorms,cargoUnit);
entity.setList(list);
List<StockListInfoListVO> list = distributionStockListService.selectStockListInfoList(reservationId,stockListId);
entity.setStockList(list);
return entity;

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

@ -25,11 +25,11 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.distribution.dto.DistrilbutionBillLadingDTO;
import com.logpm.distribution.dto.app.BillLadingAppDTO;
import com.logpm.distribution.entity.*;
import com.logpm.distribution.excel.DistrilbutionBillLadingExcel;
import com.logpm.distribution.mapper.DistrilbutionBillLadingMapper;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.DistributionStockupVO;
import com.logpm.distribution.vo.DistrilbutionBillLadingAppVO;
import com.logpm.distribution.vo.DistrilbutionBillLadingVO;
import com.logpm.distribution.vo.app.DistrilbutionAppBillLadingDetailVO;
@ -232,8 +232,8 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
@Override
public IPage<DistrilbutionBillLadingAppVO> pageListApp(IPage<Object> page, Map<String, Object> distrilbutionBillLading) {
IPage<DistrilbutionBillLadingAppVO> pageList = baseMapper.pageListApp(page, distrilbutionBillLading);
public IPage<DistrilbutionBillLadingAppVO> pageListApp(IPage<Object> page, BillLadingAppDTO billLadingAppDTO) {
IPage<DistrilbutionBillLadingAppVO> pageList = baseMapper.pageListApp(page, billLadingAppDTO);
List<DistrilbutionBillLadingAppVO> records = pageList.getRecords();
for (DistrilbutionBillLadingAppVO vo:records){
//有可能存在多个订单所以需要拆分

26
blade-service/logpm-distribution/src/main/resources/application-dev.yml

@ -10,6 +10,32 @@ server:
# password: ${blade.datasource.dev.password}
spring:
#rabbitmq配置
rabbitmq:
host: 192.168.2.100
port: 5672
username: admin
password: admin
#虚拟host 可以不设置,使用server默认host
virtual-host: /
#确认消息已发送到队列(Queue)
publisher-returns: true
publisher-confirm-type: correlated
# 手动提交消息
listener:
simple:
acknowledge-mode: auto
default-requeue-rejected: false
retry:
enabled: true # 开启消费者失败重试
initial-interval: 1000 # 初识的失败等待时长为1秒
multiplier: 1 # 失败的等待时长倍数,下次等待时长 = multiplier * last-interval
max-attempts: 3 # 最大重试次数
stateless: true # true无状态;false有状态。如果业务中包含事务,这里改为false
direct:
acknowledge-mode: manual
template:
mandatory: true
#排除DruidDataSourceAutoConfigure
autoconfigure:
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure

Loading…
Cancel
Save