出入库信息与采购计划修改

scpwxyy
yewj 7 months ago
parent 1a01e1f080
commit 628bffd89c

@ -1428,41 +1428,41 @@ public class CtqyyClient extends CommonHttpClient {
*/
@Override
public BaseResponse getThrOrders(UdiwmsThrOrderRequest udiwmsThrOrderRequest) {
PageSimpleResponse<ThrOrderResponse> pageSimpleResponse = new PageSimpleResponse<>();
PageSimpleResponse<IoCollectOrder> pageSimpleResponse = new PageSimpleResponse<>();
if (udiwmsThrOrderRequest.getBusType().equals(BusTypeConstant.CGJH001.getBusType())) {
LambdaQueryWrapper<VYpzsPlanInfo> wrapper = new LambdaQueryWrapper<>();
//补充其他查询条件
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<ThrOrderResponse> thrOrderResponses = new ArrayList<>();
List<IoCollectOrder> thrOrderResponses = 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);
ThrOrderResponse thrOrderResponse = new ThrOrderResponse();
IoCollectOrder thrOrderResponse = new IoCollectOrder();
thrOrderResponse.setBillNo(planInfo.getCGDBH());
// thrOrderResponse.setBilldate(planInfo.getSCQYMC());
thrOrderResponse.setCorpId(planInfo.getSCQYBM());
thrOrderResponse.setCorpName(planInfo.getSCQYMC());
thrOrderResponse.setThirdPartyDate(1);
// thrOrderResponse.setBilldate(planInfo.());
thrOrderResponse.setBillTime(new Date());
thrOrderResponse.setFromCorp(planInfo.getSCQYBM());
thrOrderResponse.setFromCorpName(planInfo.getSCQYMC());
thrOrderResponse.setCreateTime(new Date());
thrOrderResponse.setUpdateTime(new Date());
List<ThrOrderDetailEntity> detailList = new ArrayList<>();
List<IoCollectOrderBiz> detailList = new ArrayList<>();
value.forEach(entity -> {
ThrOrderDetailEntity detail = new ThrOrderDetailEntity();
detail.setProductId(entity.getYPBM());
detail.setProductName(entity.getYPMC());
IoCollectOrderBiz detail = new IoCollectOrderBiz();
detail.setThrCode(entity.getYPBM());
detail.setCpmctymc(entity.getYPMC());
detail.setBatchNo(entity.getYPBM());
detail.setSpec(entity.getGGMC());
detail.setCount(String.valueOf(entity.getZHB()));
detail.setGgxh(entity.getGGMC());
detail.setCount(entity.getGMSL());
detail.setOrderIdFk(thrOrderResponse.getBillNo());
detail.setPrice(entity.getTPJG());
detail.setMeasureUnit(entity.getBZDW());
detailList.add(detail);
});
thrOrderResponse.setDetailList(detailList);
thrOrderResponse.setBizList(detailList);
thrOrderResponses.add(thrOrderResponse);
});
}
@ -1472,38 +1472,38 @@ public class CtqyyClient extends CommonHttpClient {
LambdaQueryWrapper<VYpzsIoInfo> wrapper = new LambdaQueryWrapper<>();
//补充其他查询条件
wrapper.eq(StrUtil.isNotBlank(udiwmsThrOrderRequest.getBillNo()), VYpzsIoInfo::getPHYSIC_CODE, udiwmsThrOrderRequest.getBillNo());
wrapper.eq(StrUtil.isNotBlank(udiwmsThrOrderRequest.getBusType()), VYpzsIoInfo::getSORT_NAME, BusTypeConstant.valueOf(udiwmsThrOrderRequest.getBusType()).getName());
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<ThrOrderResponse> thrOrderResponses = new ArrayList<>();
List<IoCollectOrder> thrOrderResponses = 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);
ThrOrderResponse thrOrderResponse = new ThrOrderResponse();
thrOrderResponse.setBillNo(info.getPHYSIC_CODE());
thrOrderResponse.setBilldate(DateUtil.formatDate(info.getKEEP_BOOK_TIME(), "yyyy-MM-dd HH:mm:ss"));
thrOrderResponse.setCorpId(info.getCONSIGNOR());
thrOrderResponse.setCorpName(info.getCONSIGNOR_NAME());
thrOrderResponse.setThirdPartyDate(1);
thrOrderResponse.setCreateTime(new Date());
thrOrderResponse.setUpdateTime(new Date());
List<ThrOrderDetailEntity> detailList = new ArrayList<>();
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<>();
value.forEach(entity -> {
ThrOrderDetailEntity detail = new ThrOrderDetailEntity();
detail.setProductId(null);
detail.setProductName(null);
IoCollectOrderBiz detail = new IoCollectOrderBiz();
detail.setThrCode(entity.getPHYSIC_CODE());
detail.setCpmctymc(entity.getPHYSIC_NAME());
detail.setBatchNo(entity.getBATCH_NO());
detail.setSpec(null);
detail.setCount(String.valueOf(entity.getQUANTITY()));
detail.setOrderIdFk(thrOrderResponse.getBillNo());
detail.setPrice(entity.getRETAIL_PRICE());
detail.setCount(entity.getQUANTITY());
detail.setOrderIdFk(info.getPHYSIC_CODE());
detail.setMeasureUnit(entity.getPACK_UNIT1());
detailList.add(detail);
});
thrOrderResponse.setDetailList(detailList);
thrOrderResponses.add(thrOrderResponse);
collectOrder.setBizList(detailList);
thrOrderResponses.add(collectOrder);
});
}
pageSimpleResponse.setTotal(page.getTotal());

@ -193,5 +193,7 @@ public class UdiwmsThrOrderRequest extends ListPageRequest {
private String busType;
private Long workPlaceCode;
}

Loading…
Cancel
Save