采购计划、出入信息

scpwxyy
zane 7 months ago
parent c09594fafc
commit 56d919effa

@ -1435,39 +1435,49 @@ public class CtqyyClient extends CommonHttpClient {
wrapper.eq(StrUtil.isNotBlank(udiwmsThrOrderRequest.getBillNo()), VYpzsPlanInfo::getCGDBH, udiwmsThrOrderRequest.getBillNo());
IPage<VYpzsPlanInfo> page = vYpzsPlanInfoMapper.selectPage(new Page<VYpzsPlanInfo>(udiwmsThrOrderRequest.getPage(), udiwmsThrOrderRequest.getLimit()), wrapper);
List<VYpzsPlanInfo> planInfos = page.getRecords();
List<IoCollectOrder> thrOrderResponses = new ArrayList<>();
List<IoCollectOrder> ioCollectOrders = new ArrayList<>();
if (CollUtil.isNotEmpty(planInfos)) {
//数据处理以thr_orderthr_order_detail 主子返回
Map<String, List<VYpzsPlanInfo>> groupedByBz = planInfos.stream()
.collect(Collectors.groupingBy(VYpzsPlanInfo::getCGDBH));
groupedByBz.forEach((key, value) -> {
VYpzsPlanInfo planInfo = value.get(0);
IoCollectOrder thrOrderResponse = new IoCollectOrder();
thrOrderResponse.setBillNo(planInfo.getCGDBH());
// thrOrderResponse.setBilldate(planInfo.());
thrOrderResponse.setBillTime(new Date());
thrOrderResponse.setFromCorp(planInfo.getSCQYBM());
thrOrderResponse.setFromCorpName(planInfo.getSCQYMC());
thrOrderResponse.setCreateTime(new Date());
thrOrderResponse.setUpdateTime(new Date());
List<IoCollectOrderBiz> detailList = new ArrayList<>();
StringBuilder errorMsg = new StringBuilder();
IoCollectOrder ioCollectOrder = new IoCollectOrder();
ioCollectOrder.setBillNo(planInfo.getCGDBH());
// ioCollectOrder.setBilldate(planInfo.());
ioCollectOrder.setBillTime(new Date());
ioCollectOrder.setFromCorp(planInfo.getSCQYBM());
ioCollectOrder.setFromCorpName(planInfo.getSCQYMC());
ioCollectOrder.setCreateTime(new Date());
ioCollectOrder.setUpdateTime(new Date());
ioCollectOrder.setSplitStatus(0);
ioCollectOrder.setTagStatus(0);
List<IoCollectOrderBiz> bizList = new ArrayList<>();
value.forEach(entity -> {
IoCollectOrderBiz detail = new IoCollectOrderBiz();
detail.setThrCode(entity.getYPBM());
detail.setCpmctymc(entity.getYPMC());
detail.setBatchNo(entity.getYPBM());
detail.setGgxh(entity.getGGMC());
detail.setCount(entity.getGMSL());
detail.setOrderIdFk(thrOrderResponse.getBillNo());
detail.setMeasureUnit(entity.getBZDW());
detailList.add(detail);
IoCollectOrderBiz collectOrderBiz = new IoCollectOrderBiz();
BasicUdirelEntity basicUdirelEntity = basicUdirelDao.selectOne(new LambdaQueryWrapper<BasicUdirelEntity>().eq(BasicUdirelEntity::getMainId, entity.getYPBM()));
if (basicUdirelEntity != null) {
collectOrderBiz.setRelId(basicUdirelEntity.getId());
} else {
errorMsg.append(entity.getYPMC()).append("字典未对照").append(";");
}
collectOrderBiz.setThrCode(entity.getYPBM());
collectOrderBiz.setCpmctymc(entity.getYPMC());
collectOrderBiz.setBatchNo(entity.getYPBM());
collectOrderBiz.setGgxh(entity.getGGMC());
collectOrderBiz.setCount(entity.getGMSL());
collectOrderBiz.setOrderIdFk(ioCollectOrder.getBillNo());
collectOrderBiz.setMeasureUnit(entity.getBZDW());
collectOrderBiz.setTagStatus(1);
collectOrderBiz.setUnTagCount(0);
bizList.add(collectOrderBiz);
});
thrOrderResponse.setBizList(detailList);
thrOrderResponses.add(thrOrderResponse);
ioCollectOrder.setBizList(bizList);
ioCollectOrders.add(ioCollectOrder);
});
}
pageSimpleResponse.setTotal(page.getTotal());
pageSimpleResponse.setList(thrOrderResponses);
pageSimpleResponse.setList(ioCollectOrders);
} else {
LambdaQueryWrapper<VYpzsIoInfo> wrapper = new LambdaQueryWrapper<>();
//补充其他查询条件
@ -1475,41 +1485,55 @@ public class CtqyyClient extends CommonHttpClient {
wrapper.eq(StrUtil.isNotBlank(udiwmsThrOrderRequest.getBusType()), VYpzsIoInfo::getIO_SORT, udiwmsThrOrderRequest.getBusType());
Page<VYpzsIoInfo> page = vYpzsIoInfoMapper.selectPage(new Page<VYpzsIoInfo>(udiwmsThrOrderRequest.getPage(), udiwmsThrOrderRequest.getLimit()), wrapper);
List<VYpzsIoInfo> ioInfos = page.getRecords();
List<IoCollectOrder> thrOrderResponses = new ArrayList<>();
List<IoCollectOrder> ioCollectOrders = new ArrayList<>();
if (CollUtil.isNotEmpty(ioInfos)) {
//数据处理以thr_orderthr_order_detail 主子返回
Map<String, List<VYpzsIoInfo>> groupedByPhysicCode = ioInfos.stream()
.collect(Collectors.groupingBy(VYpzsIoInfo::getPHYSIC_CODE));
groupedByPhysicCode.forEach((key, value) -> {
VYpzsIoInfo info = value.get(0);
IoCollectOrder collectOrder = new IoCollectOrder();
collectOrder.setBillNo(info.getPHYSIC_CODE());
collectOrder.setBillTime(DateUtil.parseDate(info.getKEEP_BOOK_TIME()));
collectOrder.setFromCorp(info.getCONSIGNOR());
collectOrder.setFromCorpName(info.getCONSIGNOR_NAME());
collectOrder.setBusType(udiwmsThrOrderRequest.getBusType());
collectOrder.setWorkPlaceCode(udiwmsThrOrderRequest.getWorkPlaceCode());
collectOrder.setCreateTime(new Date());
collectOrder.setUpdateTime(new Date());
List<IoCollectOrderBiz> detailList = new ArrayList<>();
StringBuilder errorMsg = new StringBuilder();
IoCollectOrder ioCollectOrder = new IoCollectOrder();
ioCollectOrder.setBillNo(info.getPHYSIC_CODE());
ioCollectOrder.setBillTime(DateUtil.parseDate(info.getKEEP_BOOK_TIME()));
ioCollectOrder.setFromCorp(info.getCONSIGNOR());
ioCollectOrder.setFromCorpName(info.getCONSIGNOR_NAME());
ioCollectOrder.setBusType(udiwmsThrOrderRequest.getBusType());
ioCollectOrder.setWorkPlaceCode(udiwmsThrOrderRequest.getWorkPlaceCode());
ioCollectOrder.setCreateTime(new Date());
ioCollectOrder.setUpdateTime(new Date());
ioCollectOrder.setSplitStatus(0);
ioCollectOrder.setTagStatus(0);
List<IoCollectOrderBiz> bizList = new ArrayList<>();
value.forEach(entity -> {
IoCollectOrderBiz detail = new IoCollectOrderBiz();
detail.setThrCode(entity.getPHYSIC_CODE());
detail.setCpmctymc(entity.getPHYSIC_NAME());
detail.setBatchNo(entity.getBATCH_NO());
detail.setCount(entity.getQUANTITY());
detail.setYbbm(entity.getCOUNTRY_CODE());
detail.setOrderIdFk(info.getPHYSIC_CODE());
detail.setMeasureUnit(entity.getPACK_UNIT1());
detail.setGgxh(entity.getPACK_SPEC() + ":" + entity.getPHYSIC_UNIT());
detailList.add(detail);
IoCollectOrderBiz collectOrderBiz = new IoCollectOrderBiz();
BasicUdirelEntity basicUdirelEntity = basicUdirelDao.selectOne(new LambdaQueryWrapper<BasicUdirelEntity>().eq(BasicUdirelEntity::getMainId, entity.getPHYSIC_CODE()));
if (basicUdirelEntity != null) {
collectOrderBiz.setRelId(basicUdirelEntity.getId());
} else {
errorMsg.append(entity.getPHYSIC_NAME()).append("字典未对照").append(";");
}
collectOrderBiz.setThrCode(entity.getPHYSIC_CODE());
collectOrderBiz.setCpmctymc(entity.getPHYSIC_NAME());
collectOrderBiz.setBatchNo(entity.getBATCH_NO());
collectOrderBiz.setCount(entity.getQUANTITY());
collectOrderBiz.setYbbm(entity.getCOUNTRY_CODE());
collectOrderBiz.setOrderIdFk(info.getPHYSIC_CODE());
collectOrderBiz.setMeasureUnit(entity.getPACK_UNIT1());
collectOrderBiz.setGgxh(entity.getPACK_SPEC() + ":" + entity.getPHYSIC_UNIT());
collectOrderBiz.setTagStatus(1);
collectOrderBiz.setUnTagCount(0);
bizList.add(collectOrderBiz);
});
collectOrder.setBizList(detailList);
thrOrderResponses.add(collectOrder);
if (StrUtil.isNotBlank(errorMsg)) {
ioCollectOrder.setErrorMsg(errorMsg.toString());
ioCollectOrder.setTagStatus(4);
}
ioCollectOrder.setBizList(bizList);
ioCollectOrders.add(ioCollectOrder);
});
}
pageSimpleResponse.setTotal(page.getTotal());
pageSimpleResponse.setList(thrOrderResponses);
pageSimpleResponse.setList(ioCollectOrders);
}
return ResultVOUtils.success(pageSimpleResponse);
}

Loading…
Cancel
Save