Browse Source

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

test
caoyizhong 2 years ago
parent
commit
8c78ac4f76
  1. 2
      blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java
  2. 4
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockListEntity.java
  3. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupStockListVO.java
  4. 1
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistrilbutionAppBillLadingOrderVO.java
  5. 2
      blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/mt/entity/MtPushData.java
  6. 5
      blade-service/logpm-distribution/pom.xml
  7. 16
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java
  8. 45
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  9. 12
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml
  10. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.java
  11. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.xml
  12. 12
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml
  13. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml
  14. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  15. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
  16. 27
      blade-service/logpm-distribution/src/main/resources/application-test.yml
  17. 45
      blade-service/logpm-distribution/src/test/com/logpm/distribution/MyTest.java
  18. 60
      blade-service/logpm-distribution/src/test/com/logpm/distribution/launch/DistributionLauncherServiceImpl.java
  19. 8
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/IMtFactoryOrderMainService.java
  20. 10
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryOrderMainServiceImpl.java
  21. 1
      blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/ReceiveInfoHandler.java
  22. 9
      blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/UnloadCarComHandler.java
  23. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/receiver/WaybillDataHandler.java

2
blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java

@ -8,7 +8,7 @@ public interface ModuleNameConstant {
/** /**
* 如果不需要 "" * 如果不需要 ""
*/ */
public static final String DEVAUTH =""; public static final String DEVAUTH ="-zhy";
/** /**
* 工厂对接服务名称 * 工厂对接服务名称

4
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockListEntity.java

@ -20,10 +20,8 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springblade.core.tenant.mp.TenantEntity; import org.springblade.core.tenant.mp.TenantEntity;
import java.util.Date; import java.util.Date;
@ -39,8 +37,6 @@ import java.util.List;
@TableName("logpm_distribution_stock_list") @TableName("logpm_distribution_stock_list")
@ApiModel(value = "DistributionStockList对象", description = "库存品管理") @ApiModel(value = "DistributionStockList对象", description = "库存品管理")
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
public class DistributionStockListEntity extends TenantEntity { public class DistributionStockListEntity extends TenantEntity {
/** /**

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

@ -24,4 +24,6 @@ public class DistributionStockupStockListVO implements Serializable {
private String trayName;//托盘信息 private String trayName;//托盘信息
private Integer unpack;//是否拆包 0 没有 1 拆了
} }

1
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistrilbutionAppBillLadingOrderVO.java

@ -34,6 +34,7 @@ public class DistrilbutionAppBillLadingOrderVO implements Serializable {
private String orderSelfNumbering; private String orderSelfNumbering;
private Integer orderStatus;//状态 private Integer orderStatus;//状态
private String orderStatusStr;//状态
private Integer planNum;//自提件数 private Integer planNum;//自提件数
private Integer signedNum;//签收总数 private Integer signedNum;//签收总数

2
blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/mt/entity/MtPushData.java

@ -44,7 +44,7 @@ public class MtPushData extends BaseEntity {
* 关联主键 * 关联主键
*/ */
@ApiModelProperty(name = "关联主键", notes = "") @ApiModelProperty(name = "关联主键", notes = "")
private Double refId; private Long refId;
/** /**
* 关联编码 * 关联编码
*/ */

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

@ -62,6 +62,11 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId> <artifactId>spring-boot-starter-amqp</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-core-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>

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

@ -68,6 +68,22 @@ public class DistributionStockupAppController extends BladeController {
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@ApiOperation(value = "分页列表", notes = "传入stockupDTO") @ApiOperation(value = "分页列表", notes = "传入stockupDTO")
public R<IPage<DistributionStockupListVO>> pageList(@RequestBody StockupDTO stockupDTO) { public R<IPage<DistributionStockupListVO>> pageList(@RequestBody StockupDTO stockupDTO) {
Integer current = stockupDTO.getCurrent();
Integer size = stockupDTO.getSize();
Integer status = stockupDTO.getStatus();
if(Objects.isNull(current)){
log.info("#################pageList: 当前页码不能为空");
return R.fail(401,"当前页码不能为空");
}
if(Objects.isNull(size)){
log.info("#################pageList: 每页条数不能为空");
return R.fail(401,"每页条数不能为空");
}
if(Objects.isNull(status)){
log.info("#################pageList: 查询状态不能为空");
return R.fail(401,"查询状态不能为空");
}
IPage<DistributionStockupListVO> pages = distributionStockupService.selectStockupPage(stockupDTO); IPage<DistributionStockupListVO> pages = distributionStockupService.selectStockupPage(stockupDTO);
return R.data(pages); return R.data(pages);
} }

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

@ -183,7 +183,7 @@
ldpl.shelf_title, ldpl.shelf_title,
ldpl.goods_allocation, ldpl.goods_allocation,
ldrs.stock_article_code, ldrs.stock_article_code,
ldrs.ldrs.stock_article_id, ldrs.stock_article_id,
ldpl.pallet ldpl.pallet
</select> </select>
@ -196,36 +196,39 @@
ldrs.reservation_num planNum, ldrs.reservation_num planNum,
ldst.cargo_unit cargoUnit, ldst.cargo_unit cargoUnit,
ldst.tray_name trayName, ldst.tray_name trayName,
ldst.unpack unpack,
count(ldss.id) realNum count(ldss.id) realNum
from logpm_distribution_reservation_stocklist ldrs 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_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 left join logpm_distribution_stock ldss on ldss.stock_list_id = ldst.id and ldss.is_deleted = 0
where ldrs.reservation_id = #{reservationId} where ldrs.reservation_id = #{reservationId}
and ldrs.is_deleted = 0 and ldrs.is_deleted = 0
group by ldst.id,ldst.storage_location, group by ldst.id,
ldst.description_goods, ldst.storage_location,
ldst.sku, ldst.description_goods,
ldst.cargo_norms, ldst.sku,
ldrs.reservation_num, ldst.cargo_norms,
ldst.tray_name, ldrs.reservation_num,
ldst.cargo_unit ldst.cargo_unit,
ldst.tray_name,
ldst.unpack
</select> </select>
<select id="selectOrderNumByReservationId" resultType="Integer"> <select id="selectOrderNumByReservationId" resultType="Integer">
select count(rs.id) select count(ldrs.id)
from logpm_distribution_reservation r from logpm_distribution_reservation ldr
left join logpm_distribution_reservation_stockarticle rs on rs.reservation_id = r.id and rs.is_deleted = 0 left join logpm_distribution_reservation_stockarticle ldrs on ldrs.reservation_id = ldr.id and ldrs.is_deleted = 0
where r.is_deleted = 0 where ldr.is_deleted = 0
and r.id = #{reservationId} and ldr.id = #{reservationId}
</select> </select>
<select id="selectPlanNum" resultType="Integer"> <select id="selectPlanNum" resultType="Integer">
select count(rs.id)+count(rp.id) select count(ldrs.id)+count(ldrp.id)
from logpm_distribution_reservation r from logpm_distribution_reservation ldr
left join logpm_distribution_reservation_package rp on rp.reservation_id = r.id and rp.is_deleted = 0 left join logpm_distribution_reservation_package ldrp on ldrp.reservation_id = ldr.id and ldrp.is_deleted = 0
left join logpm_distribution_reservation_stocklist rs on rs.reservation_id = r.id and rs.is_deleted = 0 left join logpm_distribution_reservation_stocklist ldrs on ldrs.reservation_id = ldr.id and ldrs.is_deleted = 0
where r.is_deleted = 0 where ldr.is_deleted = 0
and r.id = #{reservationId} and ldr.id = #{reservationId}
</select> </select>
<select id="getReservationInfo" resultType="com.logpm.distribution.vo.DistributionReservationVO"> <select id="getReservationInfo" resultType="com.logpm.distribution.vo.DistributionReservationVO">
SELECT DISTINCT SELECT DISTINCT

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

@ -159,21 +159,21 @@
<select id="selectWarehouseAreaByReservationId" resultType="String"> <select id="selectWarehouseAreaByReservationId" resultType="String">
select sl.storage_location select sl.storage_location
from logpm_distribution_reservation ldr from logpm_distribution_reservation ldr
left join logpm_distribution_reservation_stocklist rs on rs.reservation_id = ldr.id and rs.is_deleted = 0 left join logpm_distribution_reservation_stocklist ldrs on ldrs.reservation_id = ldr.id and ldrs.is_deleted = 0
left join logpm_distribution_stock_list sl on sl.id = rs.stocklist_id and sl.is_deleted = 0 left join logpm_distribution_stock_list sl on sl.id = ldrs.stocklist_id and sl.is_deleted = 0
where ldr.id = #{reservationId} where ldr.id = #{reservationId}
and ldr.is_deleted = 0 and ldr.is_deleted = 0
group by sl.storage_location group by sl.storage_location
</select> </select>
<select id="selectPalletByReservationId" resultType="String"> <select id="selectPalletByReservationId" resultType="String">
select sl.tray_name select ldsl.tray_name
from logpm_distribution_reservation ldr from logpm_distribution_reservation ldr
left join logpm_distribution_reservation_stocklist rs on rs.reservation_id = ldr.id and rs.is_deleted = 0 left join logpm_distribution_reservation_stocklist ldrs on ldrs.reservation_id = ldr.id and ldrs.is_deleted = 0
left join logpm_distribution_stock_list sl on sl.id = rs.stocklist_id and sl.is_deleted = 0 left join logpm_distribution_stock_list ldsl on ldsl.id = ldrs.stocklist_id and ldsl.is_deleted = 0
where ldr.id = #{reservationId} where ldr.id = #{reservationId}
and ldr.is_deleted = 0 and ldr.is_deleted = 0
group by sl.tray_name group by ldsl.tray_name
</select> </select>
<update id="submitQuantityByStockListId" > <update id="submitQuantityByStockListId" >

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

@ -16,13 +16,14 @@
*/ */
package com.logpm.distribution.mapper; package com.logpm.distribution.mapper;
import com.logpm.distribution.entity.DistributionStockEntity;
import com.logpm.distribution.vo.DistributionStockVO;
import com.logpm.distribution.excel.DistributionStockExcel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.entity.DistributionStockEntity;
import com.logpm.distribution.excel.DistributionStockExcel;
import com.logpm.distribution.vo.DistributionStockVO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
/** /**

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.xml

@ -39,11 +39,11 @@
</select> </select>
<select id="selectRealNum" resultType="Integer"> <select id="selectRealNum" resultType="Integer">
select count(s.id) select count(lds.id)
from logpm_distribution_stock s from logpm_distribution_stock lds
left join logpm_distribution_reservation r on r.id = s.reservation_id and r.is_deleted = 0 left join logpm_distribution_reservation ldr on ldr.id = lds.reservation_id and ldr.is_deleted = 0
where s.is_deleted = 0 where lds.is_deleted = 0
and r.id = #{reservationId} and ldr.id = #{reservationId}
</select> </select>

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

@ -70,20 +70,14 @@
select ldr.id reservationId, select ldr.id reservationId,
ldr.delivery_type typeService, ldr.delivery_type typeService,
ldr.consignee customer, ldr.consignee customer,
lds.stockup_area stockupArea, lds.stockup_area stockupArea
from logpm_distribution_reservation ldr from logpm_distribution_reservation ldr
left join logpm_distribution_stockup_info ldsi on ldsi.reservation_id = ldr.id left join logpm_distribution_stockup_info ldsi on ldsi.reservation_id = ldr.id
left join logpm_distribution_stockup lds on ldsi.stockup_id = lds.id left join logpm_distribution_stockup lds on ldsi.stockup_id = lds.id
-- left join logpm_distribution_reservation_package ldrp on ldrp.reservation_id = ldr.id
-- left join logpm_distribution_parcel_list ldpl on ldpl.id = ldrp.parce_list_id
-- left join logpm_distribution_reservation_stocklist ldrs on ldrs.reservation_id = ldr.id
-- left join logpm_distribution_reservation_stockarticle ldrst on ldrst.reservation_id = ldr.id
-- left join logpm_distribution_stockup_scan ldss on ldss.reservation_id = ldr.id and ldss.stock_list_id = ldrs.id and ldss.package_type = 2
-- left join logpm_distribution_stockup_scan ldss1 on ldss1.reservation_id = ldr.id and ldss1.parcel_list_id = ldrs.id and ldss.package_type = 2
<where> <where>
<if test="param.stockupDate != null and param.stockupDate != '' "> and DATE_FORMAT(lds.stockup_date,'%Y-%m-%d') = #{param.stockupDate}</if> <if test="param.stockupDate != null and param.stockupDate != '' "> and DATE_FORMAT(lds.stockup_date,'%Y-%m-%d') = #{param.stockupDate}</if>
<if test="param.status != null and param.status = 0 "> and lds.stockup_status in (2.3) </if> <if test="param.status != null and param.status == 0 "> and lds.stockup_status in (1,2,3) </if>
<if test="param.status != null and param.status = 1 "> and lds.stockup_status = 4 </if> <if test="param.status != null and param.status == 1 "> and lds.stockup_status = 4 </if>
and lds.is_deleted = 0 and lds.is_deleted = 0
and lds.forklift_id = #{param.userId} and lds.forklift_id = #{param.userId}
</where> </where>

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

@ -94,8 +94,8 @@
pl.order_self_numbering orderSelfNumbering, pl.order_self_numbering orderSelfNumbering,
pl.packet_bar_code packetBarCode, pl.packet_bar_code packetBarCode,
case case
when bls.id is null then 0 when bls.id is null then 1
else 1 else 2
end scanStatus, end scanStatus,
0 errorStatus 0 errorStatus
from logpm_distribution_parcel_list pl from logpm_distribution_parcel_list pl
@ -106,10 +106,10 @@
<if test="orderSelfNumbering != null and orderSelfNumbering !=''"> <if test="orderSelfNumbering != null and orderSelfNumbering !=''">
and pl.order_self_numbering like ${orderSelfNumbering} and pl.order_self_numbering like ${orderSelfNumbering}
</if> </if>
<if test="scanStatus != null and scanStatus=0"> <if test="scanStatus != null and scanStatus=1">
and bls.id is null and bls.id is null
</if> </if>
<if test="scanStatus != null and scanStatus=1"> <if test="scanStatus != null and scanStatus=2">
and bls.id is not null and bls.id is not null
</if> </if>
</where> </where>

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

@ -133,7 +133,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
String allocation = dealwithAllocation(packageAllocation,stockListAllocation); String allocation = dealwithAllocation(packageAllocation,stockListAllocation);
//查询托盘信息 //查询托盘信息
//1.查询包件托盘信息 //1.查询包件托盘信息`
List<String> packagePallet = distributionParcelListService.selectPalletByReservationId(reservationId); List<String> packagePallet = distributionParcelListService.selectPalletByReservationId(reservationId);
//2.查询库存品托盘信息 //2.查询库存品托盘信息
List<String> stockListPallet = distributionStockListService.selectPalletByReservationId(reservationId); List<String> stockListPallet = distributionStockListService.selectPalletByReservationId(reservationId);
@ -190,6 +190,9 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
set.addAll(packagePallet); set.addAll(packagePallet);
for (String pallet:stockListPallet){ for (String pallet:stockListPallet){
if(StringUtil.isBlank(pallet)){
continue;
}
//因为库存品的数据可能会有拼接 //因为库存品的数据可能会有拼接
String[] split = pallet.split(","); String[] split = pallet.split(",");
set.addAll(Arrays.asList(split)); set.addAll(Arrays.asList(split));
@ -208,10 +211,14 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
} }
private String dealwithAllocation(List<String> packageAllocation, List<String> stockListAllocation) { private String dealwithAllocation(List<String> packageAllocation, List<String> stockListAllocation) {
Set<String> set = new HashSet<>(); Set<String> set = new HashSet<>();
set.addAll(packageAllocation); set.addAll(packageAllocation);
for (String allocation:stockListAllocation){ for (String allocation:stockListAllocation){
if(StringUtil.isBlank(allocation)){
continue;
}
//因为库存品的数据可能会有拼接 //因为库存品的数据可能会有拼接
String[] split = allocation.split(","); String[] split = allocation.split(",");
set.addAll(Arrays.asList(split)); set.addAll(Arrays.asList(split));

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

@ -370,6 +370,14 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
conpleteNum++; conpleteNum++;
} }
if(pn == sn){
vo.setOrderStatusStr("齐套");
}else if(sn<pn && sn > 0){
vo.setOrderStatusStr("部分扫");
}else if(sn == 0){
vo.setOrderStatusStr("未扫");
}
//0 全部 1 齐套 2部分扫 3未扫 //0 全部 1 齐套 2部分扫 3未扫
if(orderStatus == 0){ if(orderStatus == 0){
l.add(vo); l.add(vo);
@ -378,7 +386,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
l.add(vo); l.add(vo);
} }
}else if(orderStatus == 2){ }else if(orderStatus == 2){
if(sn<pn){ if(sn<pn && sn > 0){
l.add(vo); l.add(vo);
} }
}else if(orderStatus == 3){ }else if(orderStatus == 3){

27
blade-service/logpm-distribution/src/main/resources/application-test.yml

@ -10,6 +10,33 @@ server:
# password: ${blade.datasource.dev.password} # password: ${blade.datasource.dev.password}
spring: spring:
#rabbitmq配置
rabbitmq:
host: 172.16.128.146
port: 5672
username: admin
password: Slwk@123654
#虚拟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 #排除DruidDataSourceAutoConfigure
autoconfigure: autoconfigure:
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure

45
blade-service/logpm-distribution/src/test/com/logpm/distribution/MyTest.java

@ -0,0 +1,45 @@
//package com.logpm.distribution;
//
//
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.logpm.distribution.dto.app.StockupDTO;
//import com.logpm.distribution.entity.DistributionBillLadingScanEntity;
//import com.logpm.distribution.service.*;
//import org.junit.jupiter.api.Test;
//import org.junit.jupiter.api.extension.ExtendWith;
//import org.springblade.core.test.BladeBootTest;
//import org.springblade.core.test.BladeSpringExtension;
//import org.springframework.beans.factory.annotation.Autowired;
//
//import java.util.List;
//
//import static org.springblade.common.constant.ModuleNameConstant.APPLICATION_DISTRIBUTION_NAME;
//
//@ExtendWith(BladeSpringExtension.class)
//@BladeBootTest(appName = APPLICATION_DISTRIBUTION_NAME, enableLoader = true)
//public class MyTest {
//
//
// @Autowired
// private IDistributionStockupService distributionStockupService;
//
// @Autowired
// private IDistributionReservationService distributionReservationService;
//
// @Autowired
// private IDistributionParcelListService distributionParcelListService;
//
// @Autowired
// private IDistributionStockListService distributionStockListService;
//
//
// @Test
// public void te(){
//
// Long id =1682676882390781953L;
// List<String> packageAllocation = distributionParcelListService.selectWarehouseAreaByReservationId(id);
// //2.通过预约单查询所有库存品的库位信息
// List<String> stockListAllocation = distributionStockListService.selectWarehouseAreaByReservationId(id);
// }
//
//}

60
blade-service/logpm-distribution/src/test/com/logpm/distribution/launch/DistributionLauncherServiceImpl.java

@ -0,0 +1,60 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.distribution.launch;
import org.springblade.core.auto.service.AutoService;
import org.springblade.core.launch.constant.NacosConstant;
import org.springblade.core.launch.service.LauncherService;
import org.springblade.core.launch.utils.PropsUtil;
import org.springframework.boot.builder.SpringApplicationBuilder;
import java.util.Properties;
/**
* 启动参数拓展
*
* @author Chill
*/
@AutoService(LauncherService.class)
public class DistributionLauncherServiceImpl implements LauncherService {
@Override
public void launcher(SpringApplicationBuilder builder, String appName, String profile, boolean isLocalDev) {
Properties props = System.getProperties();
// 开启多数据源
PropsUtil.setProperty(props, "spring.datasource.dynamic.enabled", "true");
// 指定注册配置信息
PropsUtil.setProperty(props, "spring.cloud.nacos.config.extension-configs[0].data-id", NacosConstant.dataId("factory", profile));
PropsUtil.setProperty(props, "spring.cloud.nacos.config.extension-configs[0].group", NacosConstant.NACOS_CONFIG_GROUP);
PropsUtil.setProperty(props, "spring.cloud.nacos.config.extension-configs[0].refresh", NacosConstant.NACOS_CONFIG_REFRESH);
// 指定注册IP
// PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.ip", "127.0.0.1");
// 指定注册端口
// PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.port", "8200");
// 自定义命名空间
// PropsUtil.setProperty(props, "spring.cloud.nacos.config.namespace", LauncherConstant.NACOS_NAMESPACE);
// PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.namespace", LauncherConstant.NACOS_NAMESPACE);
// 自定义分组
// PropsUtil.setProperty(props, "spring.cloud.nacos.config.group", NacosConstant.NACOS_CONFIG_GROUP);
// PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.group", NacosConstant.NACOS_CONFIG_GROUP);
}
@Override
public int getOrder() {
return 20;
}
}

8
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/IMtFactoryOrderMainService.java

@ -3,7 +3,6 @@ package com.logpm.factory.mt.service;
import com.logpm.factory.mt.entity.MtFactoryOrderMain; import com.logpm.factory.mt.entity.MtFactoryOrderMain;
import com.logpm.factory.snm.vo.MTOrderPackageRelationVO; import com.logpm.factory.snm.vo.MTOrderPackageRelationVO;
import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
import java.util.List; import java.util.List;
@ -11,6 +10,13 @@ public interface IMtFactoryOrderMainService extends BaseService<MtFactoryOrderMa
List<MTOrderPackageRelationVO> mtOrderPackageRelation(); List<MTOrderPackageRelationVO> mtOrderPackageRelation();
/**
* 根基发货单编号查询
* @param invoiceOrderCode
* @return
*/
List<MtFactoryOrderMain> findMtFactoryOrderMainByInvoiceOrderCode(String invoiceOrderCode);

10
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryOrderMainServiceImpl.java

@ -1,12 +1,12 @@
package com.logpm.factory.mt.service.impl; package com.logpm.factory.mt.service.impl;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.logpm.factory.mt.entity.MtFactoryOrderMain; import com.logpm.factory.mt.entity.MtFactoryOrderMain;
import com.logpm.factory.mt.mapper.MtFactoryOrderMainMapper; import com.logpm.factory.mt.mapper.MtFactoryOrderMainMapper;
import com.logpm.factory.mt.service.IMtFactoryOrderMainService; import com.logpm.factory.mt.service.IMtFactoryOrderMainService;
import com.logpm.factory.snm.vo.MTOrderPackageRelationVO; import com.logpm.factory.snm.vo.MTOrderPackageRelationVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
@ -22,6 +22,12 @@ public class MtFactoryOrderMainServiceImpl extends BaseServiceImpl<MtFactoryOrde
return mtFactoryOrderMainMapper.mtOrderPackageRelation(); return mtFactoryOrderMainMapper.mtOrderPackageRelation();
} }
@Override
public List<MtFactoryOrderMain> findMtFactoryOrderMainByInvoiceOrderCode(String invoiceOrderCode) {
LambdaQueryChainWrapper lambdaQueryChainWrapper = new LambdaQueryChainWrapper(MtFactoryOrderMain.class);
lambdaQueryChainWrapper.eq("invoice_order_code", invoiceOrderCode);
List<MtFactoryOrderMain> ls = mtFactoryOrderMainMapper.selectList(lambdaQueryChainWrapper);
return ls;
}
} }

1
blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/ReceiveInfoHandler.java

@ -44,7 +44,6 @@ public class ReceiveInfoHandler {
@Autowired @Autowired
private IMtFactoryOrderMainService mtFactoryOrderMainService; private IMtFactoryOrderMainService mtFactoryOrderMainService;
private Integer retryCount = 1;
@RabbitHandler @RabbitHandler
public void receiveInfoHandler(Map map, Message message, Channel channel) throws IOException, NoSuchAlgorithmException { public void receiveInfoHandler(Map map, Message message, Channel channel) throws IOException, NoSuchAlgorithmException {

9
blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/UnloadCarComHandler.java

@ -3,6 +3,7 @@ package com.logpm.factory.receiver;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.logpm.factory.comfac.dto.UnloadCarDTO; import com.logpm.factory.comfac.dto.UnloadCarDTO;
import com.logpm.factory.mt.entity.MtFactoryOrderMain;
import com.logpm.factory.mt.entity.MtPackageInfo; import com.logpm.factory.mt.entity.MtPackageInfo;
import com.logpm.factory.mt.entity.MtPushData; import com.logpm.factory.mt.entity.MtPushData;
import com.logpm.factory.mt.service.IMtFactoryDataService; import com.logpm.factory.mt.service.IMtFactoryDataService;
@ -132,7 +133,15 @@ public class UnloadCarComHandler {
mtPushData.setPushStatus(1);// 推送状态 mtPushData.setPushStatus(1);// 推送状态
mtPushData.setRefCode(carNum); mtPushData.setRefCode(carNum);
mtPushData.setRefType(1);// 订单主表 mtPushData.setRefType(1);// 订单主表
// todo 这里需要查询主推送单的 ID // todo 这里需要查询主推送单的 ID
List<MtFactoryOrderMain> mtFactoryOrderMainList = mtFactoryOrderMainService.findMtFactoryOrderMainByInvoiceOrderCode(carNum);
if(mtFactoryOrderMainList.size()>0){
mtFactoryOrderMainList.get(0);
mtPushData.setRefId(mtFactoryOrderMainList.get(0).getId());
}
// 插入推送数据 // 插入推送数据
mtPushDataService.save(mtPushData); mtPushDataService.save(mtPushData);

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/receiver/WaybillDataHandler.java

@ -22,7 +22,7 @@ import java.util.Objects;
*/ */
@Slf4j @Slf4j
@AllArgsConstructor @AllArgsConstructor
@RabbitListener(queues = RabbitConstant.WAYBILL_DATA_TEST_QUEUE) @RabbitListener(queues = RabbitConstant.WAYBILL_DATA_QUEUE)
@Component @Component
public class WaybillDataHandler { public class WaybillDataHandler {

Loading…
Cancel
Save