fix:优化需求单下推逻辑,允许局部成功
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -261,6 +261,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
}
|
||||
}
|
||||
@Override
|
||||
@Transactional
|
||||
public String saveBill(JSONObject map) {
|
||||
//明细
|
||||
JSONArray array = map.getJSONArray("tableData");
|
||||
|
||||
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user