feat: 阿里采购送货单的业务对接

dev_unify
chenhc 4 months ago
parent d4dce20a19
commit 3e00e28df1

@ -1,5 +1,6 @@
package com.glxp.api.controller.alihealth;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
@ -31,9 +32,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@RestController
@ -162,7 +162,28 @@ public class AlihealthBusController extends BaseController {
String customerId = getCustomerId();
aliYljgSearchbillReqeust.setErpId(customerId);
List<AliYljgSearchbill> list = alihealthBusService.aliYljgSearchbillPage(aliYljgSearchbillReqeust);
PageInfo<AliYljgSearchbill> pageInfo = new PageInfo<>(list);
List<AliYljgSearchbill> listResp = new ArrayList<>();
if (CollUtil.isEmpty(list)){
PageInfo<AliYljgSearchbill> pageInfo = new PageInfo<>(listResp);
return ResultVOUtils.page(pageInfo);
}
// 使用 groupingBy 进行分组
Map<String, List<AliYljgSearchbill>> groupedByMultipleFields = list.stream()
.collect(Collectors.groupingBy(
bill -> bill.getBillCode()
));
// 遍历分组结果
for (Map.Entry<String, List<AliYljgSearchbill>> entry : groupedByMultipleFields.entrySet()) {
List<AliYljgSearchbill> group = entry.getValue();
if (!group.isEmpty()) {
// 添加每个分组中的第一个对象到新列表
listResp.add(group.get(0));
}
}
PageInfo<AliYljgSearchbill> pageInfo = new PageInfo<>(listResp);
return ResultVOUtils.page(pageInfo);
}

@ -754,12 +754,13 @@ public class IoOrderDetailBizController extends BaseController {
addBizProductReqeust.setSupId(udiRelevanceResponse.getSupId());
addBizProductReqeust.setDatas(null);
IoOrderEntity ioOrderEntity = null;
IoOrderEntity ioOrderEntity = addBizProductReqeust.getOrderEntity();
for (int i = 0; i < aliYljgBillDetailDrugList.size(); i++) {
AliYljgBillDetailDrug aliYljgBillDetailDrug = aliYljgBillDetailDrugList.get(i);
addBizProductReqeust.setBatchNo(aliYljgBillDetailDrug.getProduceBatchNo());
addBizProductReqeust.setProductDate(aliYljgBillDetailDrug.getProduceDate());
addBizProductReqeust.setExpireDate(aliYljgBillDetailDrug.getProduceDate());
addBizProductReqeust.setOrderEntity(ioOrderEntity);
BaseResponse response = orderDetailBizService.addBizProduct(addBizProductReqeust);
if (response.getCode() != 20000){
return response;

@ -14,7 +14,7 @@ public class AddOrderRequest {
private String invCode;
private String billNo;
private Long customerId;
private boolean outChangeEnable;
private Boolean outChangeEnable;
private boolean ignoreExpire;
private boolean ignoreRecentExpire;
private boolean ignoreCode;

Loading…
Cancel
Save