Browse Source

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

training
pref_mail@163.com 1 year ago
parent
commit
c08b81d4a6
  1. 5
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/TaskTrayVO.java
  2. 12
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java
  3. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java
  4. 121
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  5. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java
  6. 20
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/wrapper/TaskQuestVOWrapper.java

5
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/TaskTrayVO.java

@ -14,6 +14,11 @@ public class TaskTrayVO {
*/
@ApiModelProperty(value = "托盘码")
private String trayCode;
/**
* 托盘名称
*/
@ApiModelProperty(value = "托盘名称")
private String trayName;
/**
* 托盘Id

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

@ -841,7 +841,7 @@ public class DistributionStockupAppController extends BladeController {
@ApiOperationSupport(order = 1)
@ApiOperation(value = "备货扫描", notes = "传入stockupDTO")
public R stockupScan(@RequestBody StockupDTO stockupDTO) {
Integer scanType = stockupDTO.getScanType();//扫码类型
Integer scanType = stockupDTO.getScanType();//扫码类型 1 包件 2库存品
//手动
// TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition);
// try{
@ -854,9 +854,11 @@ public class DistributionStockupAppController extends BladeController {
}
lock.lock(5, TimeUnit.SECONDS);
if (scanType == 1) {
//包件
return stockupScanByCustom(stockupDTO);
} else if (scanType == 2) {
//库存平
R fail = stockupScanByStock(stockupDTO);
if (fail != null) return fail;
@ -913,8 +915,10 @@ public class DistributionStockupAppController extends BladeController {
if (ObjectUtils.isNull(stockListId)) {
// 通过扫码的二维码 查询其对应的库存存信息
if (stockupDTO.getStockPrint() == 1) {
//1 原有包条
byId = distributionStockListService.selectStockInforByOrderPackageCode(stockupDTO.getPacketBarCode());
} else {
// 2打印处理的扫码
byId = disStockOrdercodeRecoService.selectStockOrdercodeRecoListByCode(stockupDTO.getPacketBarCode());
}
stockupDTO.setStockListId(byId.getId());
@ -975,7 +979,11 @@ public class DistributionStockupAppController extends BladeController {
return Resp.scanFail("当前货位没有该包件信息!!", "当前货位没有该包件信息!!");
}
}
//校验 修改库存品数据
R r1 = distributionStockupService.handlingPackages(stockupDTO);
if(r1.getCode() != 200){
Resp.scanFail(r1.getMsg(),r1.getMsg());
}
Integer i = distributionStockupService.selectPackagePrint(stockupDTO);
switch (i) {
case 1:

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

@ -267,4 +267,10 @@ public interface IDistributionStockupService extends BaseService<DistributionSto
StockConfigInfoVO stockConfigList(StockupDTO stockupDTO);
/**
* 处理背货有包件库存品信息
* @param stockupDTO
*/
R handlingPackages(StockupDTO stockupDTO);
}

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

@ -2254,7 +2254,6 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
//不一样
return 10;
}
//绑定码
disStockListDetail.setStockPackageCode(stockupDTO.getPacketBarCode());
disStockListDetail.setId(list1.get(0).getId());
@ -2920,4 +2919,124 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
return stockConfigInfoVO;
}
/**
* 处理背货有包件库存品信息
* @param stockupDTO
*/
@Override
public R handlingPackages(StockupDTO stockupDTO) {
//查询包件是不是属于该货位
WarehouseUpdownGoodsEntity warehouseUpdownGoods = new WarehouseUpdownGoodsEntity();
warehouseUpdownGoods.setAllocationId(stockupDTO.getAllocationId());
warehouseUpdownGoods.setAssociationType("3");
warehouseUpdownGoods.setAssociationValue(stockupDTO.getPacketBarCode());
warehouseUpdownGoods.setWarehouseId(stockupDTO.getWarehouseId());
List<WarehouseUpdownGoodsEntity> locationStockListInformation = warehouseUpdownGoodsClient.getLocationStockListInformation(warehouseUpdownGoods);
if(locationStockListInformation.isEmpty() || ObjectUtils.isNull(locationStockListInformation)){
//不是该货位库存品包件信息;
return R.fail("不是该货位库存品包件信息");
}
//查询属于那个批次的库存品
DistributionParcelListEntity byId = distributionParcelListService.getById(locationStockListInformation.get(0).getAssociationId());
if(ObjectUtils.isNull(byId)){
return R.fail("订单信息不存在!");
}
DistributionStockListEntity distributionStockListEntity = distributionStockListMapper.selectOne(Wrappers.<DistributionStockListEntity>query().lambda()
.eq(DistributionStockListEntity::getIncomingBatch, byId.getOrderCode())
.eq(DistributionStockListEntity::getWarehouseId,stockupDTO.getWarehouseId())
);
if(ObjectUtils.isNull(distributionStockListEntity)){
return R.fail("该包件不是库存品!");
}
//查询该预约的库存品信息
List<DistributionReservationStocklistEntity> list = distributionReservationStocklistService.list(Wrappers.<DistributionReservationStocklistEntity>query().lambda()
.eq(ObjectUtils.isNotNull(stockupDTO.getReservationId()), DistributionReservationStocklistEntity::getReservationId, stockupDTO.getReservationId())
.apply("stock_list_status in (1,3)")
);
if(ObjectUtils.isNull(list)){
return R.fail("没有需要备货的库存品信息!");
}
Optional<DistributionReservationStocklistEntity> first = list.stream().filter(i -> i.getStocklistId().equals(distributionStockListEntity.getId())).findFirst();
if(first.isPresent()){
//没有一样的库存品数据
return R.fail("没有一样的库存品数据");
}
//判断数量是否可以直接备货
DistributionReservationStocklistEntity reservationStocklistEntity1 = first.get();
if(reservationStocklistEntity1.getRealityNum() > reservationStocklistEntity1.getReservationNum()){
return R.success("可以直接备货!");
}
List<DistributionReservationStocklistEntity> keYi = new ArrayList<>(); //可以操作的库存品
//取出一样的库存品信息
list.forEach( i -> {
DistributionStockListEntity distributionStockListEntity1 = distributionStockListMapper.selectById(i.getStocklistId());
if(distributionStockListEntity1.getDescriptionGoods().equals(distributionStockListEntity.getDescriptionGoods())
&& distributionStockListEntity1.getCargoNumber().equals(distributionStockListEntity.getCargoNumber())
&& i.getRealityNum() > i.getReservationNum() ){
keYi.add(i);
}
});
if(keYi.isEmpty()){
return R.fail("没有可以操作的库存品数据");
}
//获取数据
List<Long> collect1 = keYi.stream().map(DistributionReservationStocklistEntity::getStocklistId).collect(Collectors.toList());
//查询早期的库存品数据
List<DistributionStockListEntity> distributionStockListEntities = distributionStockListMapper.selectList(Wrappers.<DistributionStockListEntity>query().lambda()
.in(DistributionStockListEntity::getId, collect1)
.orderByAsc(DistributionStockListEntity::getCreateTime)
);
//修改可以修改的库存平
Optional<DistributionReservationStocklistEntity> collect2 = keYi.stream().filter(i -> i.getStocklistId().equals(distributionStockListEntities.get(0).getId())).findFirst();
if(!collect2.isPresent()){
DistributionReservationStocklistEntity distributionReservationStocklistEntity = collect2.get();
Integer reservationNum = distributionReservationStocklistEntity.getReservationNum() - 1;
//减少其他一样的库存品数据
DistributionReservationStocklistEntity j = new DistributionReservationStocklistEntity();//减少
j.setId(distributionReservationStocklistEntity.getId());
j.setReservationNum(reservationNum);
distributionReservationStocklistService.updateById(j);
//修改待备货的数量
DistributionReservationStocklistEntity y = new DistributionReservationStocklistEntity();//要
y.setId(reservationStocklistEntity1.getId());
y.setReservationNum(reservationStocklistEntity1.getReservationNum()+1);
distributionReservationStocklistService.updateById(y);
//修改库存品备货记录表
List<DisStockListDetailEntity> list1 = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
.eq(DisStockListDetailEntity::getReservationId, stockupDTO.getReservationId())
.eq(DisStockListDetailEntity::getStockListId, distributionReservationStocklistEntity.getStocklistId())
.isNull(DisStockListDetailEntity::getStockPackageCode)
);
if(list1.isEmpty()){
return R.fail("可用数据为空!");
}
//修改第一条数据
DisStockListDetailEntity disStockListDetail = new DisStockListDetailEntity();
disStockListDetail.setId(list1.get(0).getId());
disStockListDetail.setStockListId(reservationStocklistEntity1.getStocklistId());
disStockListDetailService.updateById(disStockListDetail);
//判断是否取消预约库存品数据
if(distributionReservationStocklistEntity.getRealityNum() == 0) {
if(reservationNum == 0){
//取消当前库存品预约数据
DistributionReservationStocklistEntity q = new DistributionReservationStocklistEntity();//取消
q.setId(distributionReservationStocklistEntity.getId());
q.setStockListStatus("2");
distributionReservationStocklistService.updateById(q);
}
}
//回复冻结数量
DistributionStockListEntity distributionStockList = new DistributionStockListEntity();
distributionStockList.setId(distributionReservationStocklistEntity.getStocklistId());
distributionStockList.setQuantityStock(distributionStockListEntity.getQuantityStock() + 1);
distributionStockList.setQuantityOccupied(distributionStockListEntity.getQuantityOccupied() -1);
distributionStockListMapper.updateById(distributionStockList);
}
return R.success("成功!!");
}
}

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

@ -1610,6 +1610,11 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
.forEach((k, v) -> {
TaskTrayVO taskTrayVO = new TaskTrayVO();
taskTrayVO.setTrayId(Long.valueOf(k));
//查询托盘信息
List<BasicdataTrayEntity> trayEntityList = basicdataTrayClient.getTrayEntityList(k);
if(ObjectUtils.isNotNull(trayEntityList)){
taskTrayVO.setTrayName(trayEntityList.get(0).getPalletName());
}
AtomicReference<Integer> num = new AtomicReference<>(0); //总数
AtomicReference<Integer> unTotal = new AtomicReference<>(0); //盘点数
List<QuestDetailVO> list2 = new ArrayList<>();

20
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/wrapper/TaskQuestVOWrapper.java

@ -17,6 +17,7 @@
package com.logpm.warehouse.wrapper;
import cn.hutool.core.util.ObjectUtil;
import com.logpm.warehouse.vo.TaskQuestVO;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.core.mp.support.BaseEntityWrapper;
@ -25,6 +26,9 @@ import org.springblade.core.tool.utils.SpringUtil;
import org.springblade.system.cache.DictBizCache;
import org.springblade.system.entity.User;
import org.springblade.system.feign.IUserClient;
import org.springblade.system.feign.IUserSearchClient;
import java.util.List;
/**
@ -34,6 +38,8 @@ import org.springblade.system.feign.IUserClient;
* @since 2023-10-12
*/
public class TaskQuestVOWrapper extends BaseEntityWrapper<TaskQuestVO, TaskQuestVO> {
IUserSearchClient userSearchClient = SpringUtil.getBean(IUserSearchClient.class) ;
IUserClient userCliient = SpringUtil.getBean(IUserClient.class);
public static TaskQuestVOWrapper build() {
return new TaskQuestVOWrapper();
@ -41,8 +47,18 @@ public class TaskQuestVOWrapper extends BaseEntityWrapper<TaskQuestVO, TaskQuest
@Override
public TaskQuestVO entityVO(TaskQuestVO taskQuest) {
taskQuest.setOperatorName(userCliient.userInfoById(taskQuest.getCreateUser()).getData().getName());
taskQuest.setQuestStatusName(DictBizCache.getValue(DictBizConstant.WAREHOUSE_QUEST_STATUS, taskQuest.getQuestStatus()));
if(ObjectUtil.isNotNull(taskQuest.getCreateUser())){
R<List<User>> listR = userSearchClient.listByUser(String.valueOf(taskQuest.getCreateUser()));
// R<User> userR = userCliient.userInfoById(taskQuest.getCreateUser());
if( !listR.getData().isEmpty() && ObjectUtil.isNotNull(listR.getData()) && ObjectUtil.isNotNull(listR.getData().get(0)) ){
String name = listR.getData().get(0).getName();
taskQuest.setOperatorName(name);
}
}
if(ObjectUtil.isNotNull(taskQuest.getQuestStatus())){
taskQuest.setQuestStatusName(DictBizCache.getValue(DictBizConstant.WAREHOUSE_QUEST_STATUS, taskQuest.getQuestStatus()));
}
return taskQuest;
}

Loading…
Cancel
Save