fix:优化需求单下推逻辑,允许局部成功

This commit is contained in:
zhangzq
2026-08-01 13:59:21 +08:00
parent 5c367ca7f9
commit dc2780efd5
4 changed files with 24 additions and 15 deletions

View File

@@ -82,7 +82,6 @@ public class PmDemandController {
@PostMapping("/push")
@Log("需求单下发")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<Object> push(@RequestBody List<PmDemandDto> pmDemandDtos) {
pmDemandService.pushDemand(pmDemandDtos);
return ResponseData.build();

View File

@@ -260,11 +260,9 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
.map(PmDemandDto::getId).collect(Collectors.toList())));
}
if (!CollectionUtils.isEmpty(zdDemands)) {
wmsToZDWmdService.syncDemandOrder(zdDemands);
//直接增加对应库存并做库存记录
for (PmDemandDto zdDemand : zdDemands) {
List<AddInvParam> addInvParams = new ArrayList<>();
List<InFinishParam> inFinishParams = new ArrayList<>();
for (PmDemandDto zdDemand : zdDemands) {
Structattr structattr = iStructattrService.getOne(new LambdaQueryWrapper<Structattr>()
.eq(Structattr::getSect_code, zdDemand.getTargetHouseCode())
.isNotNull(Structattr::getStoragevehicle_code)
@@ -284,13 +282,24 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
BeanUtils.copyProperties(addInvParam,inFinishParam);
inFinishParam.setRemark("中鼎需求单变动");
inFinishParams.add(inFinishParam);
}
List<PmDemandDto> zd = new ArrayList<>();
zd.add(zdDemand);
wmsToZDWmdService.syncDemandOrder(zd);
try {
iStInventoryService.changeInventory(InventoryChangeType.ADD_INV, addInvParams);
iStInventoryService.changeInventory(InventoryChangeType.IN_FINISH, inFinishParams);
this.update(new LambdaUpdateWrapper<PmDemand>()
.set(PmDemand::getStatus,DemandStatus.FINISH.getValue())
.in(PmDemand::getId,zdDemands.stream()
.map(PmDemandDto::getId).collect(Collectors.toList())));
}catch (Exception ex){
log.error("回传中鼎成功,WMS库存变动失败"+ex.getMessage());
this.update(new LambdaUpdateWrapper<PmDemand>()
.set(PmDemand::getStatus,DemandStatus.CANCEL.getValue())
.in(PmDemand::getId,zdDemands.stream()
.map(PmDemandDto::getId).collect(Collectors.toList())));
}
}
}
}

View File

@@ -261,6 +261,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
}
}
@Override
@Transactional
public String saveBill(JSONObject map) {
//明细
JSONArray array = map.getJSONArray("tableData");

View File

@@ -64,7 +64,7 @@
</el-table-column>
<el-table-column prop="requestId" label="出入库单号" min-width="140" />
<el-table-column prop="sn" label="序列码" min-width="140" />
<el-table-column prop="status" label="回传状态" width="100" >
<el-table-column prop="status" label="回传状态" width="100">
<template slot-scope="scope">
<el-tag :type="statusTagType(scope.row.status)" size="mini">{{ statusLabel(scope.row.status) }}</el-tag>
</template>
@@ -130,8 +130,8 @@
</el-table-column>
<el-table-column prop="materialno" label="物料编号" min-width="120" />
<el-table-column prop="unitno" label="单位编号" min-width="100" />
<el-table-column prop="qty" label="数量" min-width="100" />
<el-table-column prop="baseqty" label="基础数量" min-width="100" />
<el-table-column prop="qty" label="工单扣减数量" min-width="100" />
<el-table-column prop="baseqty" label="bom数量" min-width="100" />
<el-table-column prop="warehouseno" label="仓库编号" min-width="120" />
<el-table-column prop="easQty" label="eas库存" min-width="120" />
<el-table-column prop="updateTime" label="更新时间" min-width="120" />
@@ -242,7 +242,7 @@ export default {
},
handleSelectionChange(val, row) {
if (val.length == 1) {
if (val[0].status === '0' || val[0].status === '2' ){
if (val[0].status === '0' || val[0].status === '2') {
this.uploadFlag = false
}
} else {