fix:倒冲领料定时器;

opt:pda显示优化;需求单报错提示单据号;
This commit is contained in:
zhaoyf
2026-08-07 17:13:04 +08:00
parent 648fb179ed
commit fc566f7de4
4 changed files with 32 additions and 13 deletions

View File

@@ -9,7 +9,9 @@ import org.nl.wms.ext_manage.purchase.service.EasToWmsService;
import org.nl.wms.ext_manage.purchase.service.InboundEasSyncService;
import org.nl.wms.ext_manage.purchase.service.dto.BillChangeDto;
import org.nl.wms.pm_manage.purchase.service.PurchaseService;
import org.nl.wms.pm_manage.purchase.service.dao.Purchasedtl;
import org.nl.wms.pm_manage.purchase.service.dao.Purchasemst;
import org.nl.wms.pm_manage.purchase.service.dao.mapper.PurchasedtlMapper;
import org.nl.wms.pm_manage.purchase.service.dao.mapper.PurchasemstMapper;
import org.nl.wms.pm_manage.purchase.service.enums.PurchaseBillStatus;
import org.springframework.beans.factory.annotation.Autowired;
@@ -25,6 +27,8 @@ public class EasToWmsServiceImpl implements EasToWmsService {
private PurchaseService purchaseService;
@Autowired
private PurchasemstMapper purchasemstMapper;
@Autowired
private PurchasedtlMapper purchasedtlMapper;
@Override
public JSONObject billChangeHandler(BillChangeDto billChangeDto) {
@@ -35,11 +39,16 @@ public class EasToWmsServiceImpl implements EasToWmsService {
//更新单据
final Purchasemst one = purchasemstMapper.selectOne(new LambdaQueryWrapper<Purchasemst>()
.eq(Purchasemst::getBill_id, billId));
if (one!=null && one.getBill_status().equals(PurchaseBillStatus.EXECUTING.getCode())){
if (one!=null){
if (one.getBill_status().equals(PurchaseBillStatus.EXECUTING.getCode())){
throw new BadRequestException("EAS单据同步失败当前单据在WMS系统中已经执行 " + billId);
}
purchasemstMapper.delete(new LambdaQueryWrapper<Purchasemst>()
.eq(Purchasemst::getBill_id, billId));
purchasedtlMapper.delete(new LambdaQueryWrapper<Purchasedtl>()
.eq(Purchasedtl::getBill_id, billId));
}
Purchasemst purchasemst = new Purchasemst();
purchasemst.setBill_id(billChangeDto.getBillid());
purchasemst.setStatus(billChangeDto.getStatus());

View File

@@ -178,6 +178,7 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
final List<OutBoundDis> result = new ArrayList<>();
for (IOStorInvDis source : invDis) {
IOStorInv ioStorInv = ioStorInvMapper.selectById(source.getIostorinv_id());
MdMeMaterialbase materialbase = iMdMeMaterialbaseService.getByCode(source.getMaterial_code());
OutBoundDis target = new OutBoundDis();
// 字段映射(注意下划线命名转驼峰命名)
target.setBillCode(ioStorInv.getBill_code());
@@ -186,7 +187,7 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
target.setSectName(source.getSect_name());
target.setStructCode(source.getStruct_code());
target.setStoragevehicleCode(source.getStoragevehicle_code());
target.setMaterialCode(source.getMaterial_code());
target.setMaterialCode(materialbase.getMaterial_name());
target.setUnitName(source.getQty_unit_name());
target.setWorkStatus(source.getWork_status());
target.setPlanQty(source.getPlan_qty());

View File

@@ -289,21 +289,29 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
if (CollectionUtils.isEmpty(pmDemandDtos)){
throw new BadRequestException("下推失败,请求数据不能为空");
}
final int disCount = this.count(new LambdaQueryWrapper<PmDemand>()
List<PmDemand> disList = this.list(new LambdaQueryWrapper<PmDemand>()
.in(PmDemand::getId, pmDemandDtos.stream().map(PmDemandDto::getId).collect(Collectors.toList()))
.eq(PmDemand::getStatus,DemandStatus.DIS.getValue())
.eq(PmDemand::getStatus, DemandStatus.DIS.getValue())
.ne(PmDemand::getIs_deleted, 1));
if (disCount<pmDemandDtos.size()){
throw new BadRequestException("下推失败,单据状态不为已分配不能下推");
if (disList.size()<pmDemandDtos.size()){
String collect = pmDemandDtos.stream()
.map(PmDemandDto::getWorkOrder)
.filter(workOrder -> disList.stream()
.noneMatch(i -> Objects.equals(i.getWork_order(), workOrder)))
.collect(Collectors.joining(","));
throw new BadRequestException("下推失败,单据"+collect+"状态不为已分配不能下推");
}
int allWorkCount = this.count(new LambdaQueryWrapper<PmDemand>()
List<PmDemand> allWorkDemand = this.list(new LambdaQueryWrapper<PmDemand>()
.in(PmDemand::getWork_order, pmDemandDtos.stream()
.map(PmDemandDto::getWorkOrder)
.distinct()
.collect(Collectors.toList()))
.ne(PmDemand::getIs_deleted, 1));
if (pmDemandDtos.size() < allWorkCount){
throw new BadRequestException("存在未勾选完全的工单");
if (pmDemandDtos.size() < allWorkDemand.size()){
String collect = allWorkDemand.stream().map(PmDemand::getWork_order)
.filter(workOrder -> pmDemandDtos.stream().noneMatch(i -> !Objects.equals(i.getWorkOrder(), workOrder)))
.collect(Collectors.joining(","));
throw new BadRequestException("存在未勾选完全的工单" + collect);
}
// 一次性分成两组
Param zdStorParam = iSysParamService.findByCode(EXTConstant.ZD_STOR_SET);
@@ -480,7 +488,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
final List<PmDemand> needAllcation = new ArrayList<>();
for (PmDemand pmDemand : pmDemands) {
if (!pmDemand.getStatus().equals(DemandStatus.CREATE.getValue())){
throw new BadRequestException("当前单子不是生成状态无法勾选");
throw new BadRequestException("当前单子"+pmDemand.getWork_order()+"不是生成状态无法勾选");
}
final List<DemandInventryDto> demandInventryDtos = this.queryInventory(pmDemand.getSku_code());
final Map<String, DemandInventryDto> inventryDtoMap = demandInventryDtos.stream().collect(Collectors.toMap(DemandInventryDto::getHouseCode, Function.identity()));

View File

@@ -31,6 +31,7 @@ public class ReceiveReturnAutoTask {
.eq(ReceiveOutReturn::getStatus, StockReturnStatusEnum.TODO.getCode())
.or()
.eq(ReceiveOutReturn::getStatus, StockReturnStatusEnum.FAIL.getCode())
.orderByDesc(ReceiveOutReturn::getUpdateTime)
.last("limit 5"));
log.info("========>倒冲领料定时回传列表:{}", list.stream().map(ReceiveOutReturn::getBillno).collect(Collectors.joining(",")));
for (ReceiveOutReturn item : list) {