Browse Source

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

training
0.0 1 year ago
parent
commit
73916e315e
  1. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/StockListInfoListVO.java
  2. 10
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseUpdownGoodsClient.java
  3. 30
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java
  4. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml
  5. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml
  6. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java
  7. 79
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  8. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  9. 91
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
  10. 16
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseUpdownGoodsClient.java

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

@ -3,11 +3,14 @@ package com.logpm.distribution.vo;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class StockListInfoListVO implements Serializable {
private String packageCode;
private String name;
private Date createTime;
}

10
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseUpdownGoodsClient.java

@ -17,9 +17,12 @@
package com.logpm.warehouse.feign;
import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity;
import org.springblade.common.constant.ModuleNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
/**
@ -35,6 +38,7 @@ public interface IWarehouseUpdownGoodsClient {
String API_PREFIX = "updownGoods/client";
String TOP = API_PREFIX + "/top";
String SELECTSTOCKLISTOWE = API_PREFIX + "/selectStockListOwe";
// /**
// *查询包条
@ -63,4 +67,10 @@ public interface IWarehouseUpdownGoodsClient {
*/
@GetMapping(TOP + "/selectCountByArea")
Integer selectCountByArea(@RequestParam("ids") String ids);
/**
*查询某个库存品所在的库位
*/
@PostMapping(SELECTSTOCKLISTOWE)
Long selectStockListOwe(@RequestBody WarehouseUpdownGoodsEntity updownGoodsEntity);
}

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

@ -16,6 +16,8 @@
*/
package com.logpm.distribution.appcontroller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@ -26,12 +28,16 @@ import com.logpm.distribution.dto.app.StockupDTO;
import com.logpm.distribution.entity.*;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.*;
import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity;
import com.logpm.warehouse.feign.IWarehouseUpdownGoodsClient;
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.stockup.StockupStatusConstant;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.secure.utils.AuthUtil;
@ -67,6 +73,8 @@ public class DistributionStockupAppController extends BladeController {
private final IDistributionStockArticleService distributionStockArticleService;
private final IDistributionParcelListService distributionParcelListService;
private final IDistributionReservationPackageService distributionReservationPackageService;
private final IWarehouseUpdownTypeClient warehouseUpdownTypeClient;
private final IWarehouseUpdownGoodsClient warehouseUpdownGoodsClient;
private final RabbitTemplate rabbitTemplate;
private final IDistributionStockListService iDistributionStockListService;
@ -130,7 +138,6 @@ public class DistributionStockupAppController extends BladeController {
/**
* 对象转map
* @param object
* @return
* @throws IllegalAccessException
*/
public static Map<String, Object> convertObjectToMap(Object object) throws IllegalAccessException {
@ -424,6 +431,11 @@ public class DistributionStockupAppController extends BladeController {
.eq(DistributionParcelListEntity::getOrderCode, stockupDTO.getOrderCode())
);
entity.setParcelListId(one.getId());
//修改包件备货状态
one.setOrderPackageStockupStatus(StockupStatusConstant.yibeihuo.getValue());
//todo 待下架操作
warehouseUpdownTypeClient.downPackage(stockupDTO.getPacketBarCode());
distributionParcelListService.updateById(one);
}else{
entity.setReservationId(reservationId);
}
@ -521,6 +533,22 @@ public class DistributionStockupAppController extends BladeController {
if(ObjectUtils.isNotNull(byId.getMarketId())){
entity.setMarketId(byId.getMarketId());
entity.setMaterialId(byId.getMaterialId());
//查询库位id
WarehouseUpdownGoodsEntity updownGoods = new WarehouseUpdownGoodsEntity();
updownGoods.setAssociationId(byId.getId());
updownGoods.setMarketId(byId.getMarketId());
updownGoods.setIncomingBatch(byId.getIncomingBatch());
Long l = warehouseUpdownGoodsClient.selectStockListOwe(updownGoods);
//todo 待下架操作
JSONObject jsonObject = new JSONObject();
jsonObject.put("marketId",byId.getMarketId());
jsonObject.put("materialCode",byId.getMarketCode());
jsonObject.put("incomingBatch",byId.getIncomingBatch());
jsonObject.put("enterNum",1);
jsonObject.put("allocationId",l);
List<JSONObject> list = new ArrayList<>();
list.add(jsonObject);
warehouseUpdownTypeClient.downStock(list);
}
entity.setConditions("0");
entity.setType(2);

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

@ -220,22 +220,22 @@
</select>
<select id="selectStockListInfoSelfList" resultType="com.logpm.distribution.vo.StockListInfoListVO">
select lds.coding packageCode,
lds.goods_name name
select DISTINCT lds.coding packageCode,
lds.goods_name name,
lds.create_time createTime
from logpm_distribution_delivery_details lddd
LEFT JOIN logpm_distribution_stock_list ldsl on lddd.stock_list_id = ldsl.id
LEFT JOIN logpm_distribution_stock lds on lds.stock_list_id = ldsl.id
<where>
lddd.is_deleted = 0 and lddd.stocklist_id = #{stockListId} and lddd.bill_lading_id = #{reservationId}
lddd.is_deleted = 0 and lds.stock_list_id = #{stockListId} and lds.bill_lading_id = #{reservationId}
</where>
</select>
<select id="selectStockListInfoList" resultType="com.logpm.distribution.vo.StockListInfoListVO">
select
s.coding packageCode,
s.goods_name name,
ldsl.
s.goods_name name
from logpm_distribution_reservation ldr
left join logpm_distribution_reservation_stocklist ldrs on ldrs.reservation_id = ldr.id and ldrs.is_deleted = 0 and ldrs.stock_list_status in (1,3)

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

@ -245,7 +245,7 @@
from logpm_distrilbution_bill_stock
where bill_lading_id = ldsi.reservation_id and order_status in (1,2) ) orderNum,
(
select COUNT(DISTINCT ldbs.id)
select COUNT(DISTINCT ldpl.id)
from logpm_distrilbution_bill_stock ldbs
LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.stock_article_id = ldbs.stock_article_id
where ldbs.bill_lading_id = ldsi.reservation_id

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

@ -128,4 +128,9 @@ public interface IDistributionAsyncService {
* @param deliveryId
*/
void changeMarketDeliveryListStatus(String barcode, Long deliveryId);
/**
* 自提签收判断是否完成
*/
void getStockUPstate(Long billLadingId);
}

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

@ -58,7 +58,9 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
private final DistributionStockupInfoMapper distributionStockupInfoMapper;
private final DistributionReservationStockarticleMapper distributionReservationStockarticleMapper;
private final DistributionReservationStocklistMapper distributionReservationStocklistMapper;
private final DistributionBillLadingScanMapper distributionBillLadingScanMapper;
private final DistrilbutionBillStockMapper distrilbutionBillStockMapper;
private final DistrilbutionBillLadingMapper distrilbutionBillLadingMapper;
private final DistributionDeliveryDetailsMapper distributionDeliveryDetailsMapper;
private final DistributionParcelListMapper distributionParcelListMapper;
private final IDisStockListDetailService disStockListDetailService;
@ -394,6 +396,83 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
//修改整体的预约状态
//修改整体的配送计划状态
//
}
/**
* 自提签收片段是否签收完全
*/
@Async
@Override
@Transactional(rollbackFor = Exception.class)
public void getStockUPstate(Long billLadingId) {
//查询订单数
List<DistrilbutionBillStockEntity> list = distrilbutionBillStockService.list(Wrappers.<DistrilbutionBillStockEntity>query().lambda()
.eq(DistrilbutionBillStockEntity::getBillLadingId, billLadingId)
.apply("order_status in (1,2)")
);
AtomicReference<Integer> pack = new AtomicReference<>(0); // 包件数量
AtomicReference<Integer> packys = new AtomicReference<>(0); // 包件以扫数量
boolean apj = false;
if(list.size() > 0){
//查询包件数量
list.forEach(i ->{
List<DistributionParcelListEntity> list1 = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getStockArticleId, i.getStockArticleId())
);
//查询扫码数量
List<DistributionBillLadingScanEntity> list2 = distributionBillLadingScanMapper.selectList(Wrappers.<DistributionBillLadingScanEntity>query().lambda()
.eq(DistributionBillLadingScanEntity::getBillLadingId, billLadingId)
.eq(DistributionBillLadingScanEntity::getStockArticleId, i.getStockArticleId())
);
pack.set(pack.get()+list1.size());
packys.set(packys.get() + list2.size());
});
if(pack.get() .equals( packys.get()) ){
apj = true;
}
}else{
apj = true;
}
//查询库存品数
List<DistributionDeliveryDetailsEntity> list1 = distributionDeliveryDetailsService.list(Wrappers.<DistributionDeliveryDetailsEntity>query().lambda()
.eq(DistributionDeliveryDetailsEntity::getBillLadingId, billLadingId)
);
//
AtomicReference<Integer> kcq = new AtomicReference<>(0); // 库存全部数量
AtomicReference<Integer> kcs = new AtomicReference<>(0); // 库存以扫数量
boolean kc = false;
if(list1.size() > 0){
list1.forEach( i -> {
//查询以扫数量
List<DistributionBillLadingScanEntity> list2 = distributionBillLadingScanMapper.selectList(Wrappers.<DistributionBillLadingScanEntity>query().lambda()
.eq(DistributionBillLadingScanEntity::getBillLadingId, billLadingId)
.eq(DistributionBillLadingScanEntity::getStockListId, i.getStockListId())
);
kcq.set(kcq.get()+i.getQuantity());
kcs.set(kcs.get()+list2.size());
});
if(kcq.get().equals(kcs.get())){
kc = true;
}
}else{
kc = true;
}
if(apj && kc){
//完成
//已完成
//修改提货任务状态
DistrilbutionBillLadingEntity billLadingEntity = new DistrilbutionBillLadingEntity();
billLadingEntity.setId(billLadingId);
billLadingEntity.setConditions("20");
distrilbutionBillLadingMapper.updateById(billLadingEntity);
}
}
@Async

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

@ -40,6 +40,8 @@ import com.logpm.warehouse.feign.IWarehouseTaryAllocationClient;
import com.logpm.warehouse.feign.IWarehouseTrayGoodsClient;
import org.springblade.common.constant.CodeDesEnum;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.order.OrderStockupStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStockupStatusConstant;
import org.springblade.common.constant.stocklist.StockLockingStatusConstant;
import org.springblade.common.constant.stocklist.StockSignfoStatusConstant;
import org.springblade.common.constant.stocklist.StockStatusConstant;
@ -1092,6 +1094,14 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
if (!list1.isEmpty()) {
switch (stockupDTO.getStockPrint()) {
case 1:
//查询包件码有没有操作
List<DistributionParcelListEntity> list = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getOrderPackageCode, stockupDTO.getPacketBarCode())
.eq(DistributionParcelListEntity::getOrderPackageStockupStatus, OrderPackageStockupStatusConstant.daibeihuo.getValue())
);
if(list.isEmpty()){
return 7;
}
//绑定码
disStockListDetail.setStockPackageCode(stockupDTO.getPacketBarCode());
disStockListDetail.setId(list1.get(0).getId());

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

@ -16,6 +16,7 @@
*/
package com.logpm.distribution.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -130,13 +131,13 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
this.updateById(distrilbutionBillLading);
//修改图片
List<DistributionPrintEntity> printEntityList = distributionPrintService.list(Wrappers.<DistributionPrintEntity>query().lambda().eq(DistributionPrintEntity::getBillLadingId, distrilbutionBillLading.getId()));
if (printEntityList.size() > 0) {
if (!printEntityList.isEmpty()) {
if (distrilbutionBillLading.getMark()) {
//要删除
List<Long> collect = printEntityList.stream().map(DistributionPrintEntity::getId).collect(Collectors.toList());
distributionPrintService.deleteLogic(collect);
//操作图片
if (distrilbutionBillLading.getPrintList().size() > 0) {
if (!distrilbutionBillLading.getPrintList().isEmpty()) {
addPrint(distrilbutionBillLading);
}
}
@ -145,7 +146,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
List<DistributionDeliveryChargeEntity> list = distributionDeliveryChargeService.list(Wrappers.<DistributionDeliveryChargeEntity>query().lambda()
.eq(DistributionDeliveryChargeEntity::getBillLading, distrilbutionBillLading.getId())
);
if (list.size() > 0) {
if (!list.isEmpty()) {
list.forEach(i -> {
String s = distrilbutionBillLading.getFei().get(i.getCost());
if (StringUtils.isNotBlank(s)) {
@ -162,19 +163,19 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
});
}
//修改订单数据
if (distrilbutionBillLading.getStockArticleList().size() > 0) {
if (!distrilbutionBillLading.getStockArticleList().isEmpty()) {
boolean order = getOrder(distrilbutionBillLading.getStockArticleList(), distrilbutionBillLading.getId());
if (!order) {
throw new ServiceException("修改失败!!");
}
}
//修改库存品
if (distrilbutionBillLading.getStockDTOList().size() > 0) {
if (!distrilbutionBillLading.getStockDTOList().isEmpty()) {
//全部库存品数据
List<DistributionDeliveryDetailsEntity> listDetails = distributionDeliveryDetailsService.list(Wrappers.<DistributionDeliveryDetailsEntity>query().lambda()
.eq(DistributionDeliveryDetailsEntity::getBillLadingId, distrilbutionBillLading.getId())
);
if (listDetails.size() > 0) {
if (!listDetails.isEmpty()) {
List<Long> ids = new ArrayList<>();
//有
//修改
@ -199,7 +200,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
distributionDeliveryDetailsService.updateById(deliveryDetails);
Integer inventoryQuantity = next.getInventoryQuantity(); //修改数量
Integer quantity = i.getQuantity();//原来的数量
Integer num = 0;
int num = 0;
if (inventoryQuantity > quantity) {
num = inventoryQuantity - quantity; //多 添加了数量
@ -937,8 +938,8 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
Object billLadingId = distrilbutionBillLading.get("id"); //提货ID
Object coding = distrilbutionBillLading.get("coding"); //包条码
Object type = distrilbutionBillLading.get("type"); //类型 2 订单 1 库存品
if (Func.isNull(billLadingId) || Func.isNull(coding) || Func.isNull(type)) {
return (Resp) R.fail(3000, "参数不完整,你干啥呢!!");
if (Func.isNull(billLadingId) || ObjectUtil.isEmpty(coding) || Func.isNull(type)) {
return Resp.scanFail("3000", "参数不完整,你干啥呢!!");
} else {
DistrilbutionBillLadingEntity billLadingEntity1 = baseMapper.selectById((Serializable) billLadingId);
if(ObjectUtils.isNotNull(billLadingEntity1) && billLadingEntity1.getConditions().equals("20")){
@ -1041,76 +1042,8 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
}
//判断当前自提任务完成没有
//查询订单数
List<DistrilbutionBillStockEntity> list = distrilbutionBillStockService.list(Wrappers.<DistrilbutionBillStockEntity>query().lambda()
.eq(DistrilbutionBillStockEntity::getBillLadingId, billLadingId)
.apply("order_status in (1,2)")
);
AtomicReference<Integer> pake = new AtomicReference<>(0); // 包件数量
AtomicReference<Integer> pakeys = new AtomicReference<>(0); // 包件以扫数量
boolean apj = false;
if(list.size() > 0){
//查询包件数量
list.forEach(i ->{
List<DistributionParcelListEntity> list1 = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getStockArticleId, i.getStockArticleId())
);
int size = list1.size();
pake.set(pake.get() + size);
//查询扫码数量
List<DistributionBillLadingScanEntity> list2 = distributionBillLadingScanService.list(Wrappers.<DistributionBillLadingScanEntity>query().lambda()
.eq(DistributionBillLadingScanEntity::getBillLadingId, billLadingId)
.eq(DistributionBillLadingScanEntity::getStockArticleId, i.getStockArticleId())
);
int size2 = list2.size();
pakeys.set(pakeys.get() + size2);
});
if(pake.get().equals(pakeys.get()+1)){
//订单完成备货
apj = true;
}
}else{
//订单完成备货
apj = true;
}
//查询库存品数
List<DistributionDeliveryDetailsEntity> list1 = distributionDeliveryDetailsService.list(Wrappers.<DistributionDeliveryDetailsEntity>query().lambda()
.eq(DistributionDeliveryDetailsEntity::getBillLadingId, billLadingId)
);
//
AtomicReference<Integer> kcq = new AtomicReference<>(0); // 库存全部数量
AtomicReference<Integer> kcs = new AtomicReference<>(0); // 库存以扫数量
boolean kc = false;
if(list1.size() > 0){
list1.forEach( i -> {
//查询以扫数量
List<DistributionBillLadingScanEntity> list2 = distributionBillLadingScanService.list(Wrappers.<DistributionBillLadingScanEntity>query().lambda()
.eq(DistributionBillLadingScanEntity::getBillLadingId, billLadingId)
.eq(DistributionBillLadingScanEntity::getStockListId, i.getStockListId())
);
kcq.set(kcq.get()+i.getQuantity());//全部数量
int size = list2.size();
kcs.set(kcs.get()+size);//以扫数量
});
//多个
if(kcq.get() == (kcs.get()+1)){
kc=true;
}
}else{
kc = true;
}
if(apj && kc){
//完成
//已完成
//修改提货任务状态
DistrilbutionBillLadingEntity billLadingEntity = new DistrilbutionBillLadingEntity();
String bill = (String) billLadingId;
billLadingEntity.setId(Long.valueOf(bill));
billLadingEntity.setConditions("20");
baseMapper.updateById(billLadingEntity);
}
String a= String.valueOf(billLadingId);
distributionAsyncService.getStockUPstate(Long.parseLong(a));
/*long count = list.stream().filter(e -> e.getConditions().equals("2")).count(); // 订 已签收的数

16
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseUpdownGoodsClient.java

@ -1,12 +1,16 @@
package com.logpm.warehouse.feign;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity;
import com.logpm.warehouse.service.IWarehouseUpdownGoodsService;
import lombok.AllArgsConstructor;
import org.springblade.core.tenant.annotation.NonDS;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.sql.Wrapper;
@NonDS
@ApiIgnore
@RestController
@ -45,4 +49,16 @@ public class WarehouseUpdownGoodsClient implements IWarehouseUpdownGoodsClient {
public Integer selectCountByArea(String ids) {
return warehouseUpdownGoodsService.selectCountByArea(ids);
}
@Override
public Long selectStockListOwe(WarehouseUpdownGoodsEntity updownGoodsEntity) {
WarehouseUpdownGoodsEntity one = warehouseUpdownGoodsService.getOne(Wrappers.<WarehouseUpdownGoodsEntity>query().lambda()
.eq(WarehouseUpdownGoodsEntity::getAssociationId, updownGoodsEntity.getAssociationId())
.eq(WarehouseUpdownGoodsEntity::getMarketId,updownGoodsEntity.getMarketId())
.eq(WarehouseUpdownGoodsEntity::getIncomingBatch,updownGoodsEntity.getIncomingBatch())
.eq(WarehouseUpdownGoodsEntity::getAssociationType,"4")
);
return one.getAllocationId();
}
}

Loading…
Cancel
Save