1、阿里单据拉取参数(还差一些对照)

2、产品选入问题
dev_unify
qiuyt 7 months ago
parent 38f66bc445
commit d2c006cf43

@ -1,4 +1,4 @@
package com.glxp.api.entity.thrsys; package com.glxp.api.entity.alihealth;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -7,7 +7,7 @@ import lombok.Data;
import java.util.Date; import java.util.Date;
@Data @Data
public class ThirdAliSearchbill { public class AliKytSearchbill {
private String billType; private String billType;
private String billCode; private String billCode;
private String fromUserId; private String fromUserId;

@ -0,0 +1,57 @@
package com.glxp.api.req.alihealth;
import com.glxp.api.req.alihealth.AlihealthKytCommonParametersReqeust;
import lombok.Data;
@Data
public class AlihealthLsydListupoutReqeust extends AlihealthKytCommonParametersReqeust {
/**
* ID
*/
private String ref_ent_id;
/**
*
*/
private String begin_date;
/**
*
*/
private String end_date;
/**
*
*/
private String from_user_id;
/**
*
*/
private String produce_batch_no;
/**
* ID
*/
private String drug_ent_base_info_id;
/**
*
*/
private String bill_type;
/**
*
*/
private String physic_type;
/**
*
*/
private String status;
/**
*
*/
private String bill_code;
private Integer cur_page;
private Integer page_size;
public AlihealthLsydListupoutReqeust(){
this.setMethod("alibaba.alihealth.drugtrace.top.lsyd.listupout");
}
}

@ -3,9 +3,7 @@ package com.glxp.api.res.alihealth;
import cn.hutool.json.JSONArray; import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.glxp.api.entity.collect.RelCodeBatch; import com.glxp.api.entity.alihealth.AliKytSearchbill;
import com.glxp.api.entity.thrsys.ThirdAliDrug;
import com.glxp.api.entity.thrsys.ThirdAliSearchbill;
import lombok.Data; import lombok.Data;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
@ -40,37 +38,37 @@ public class AlihealthKytSearchbillResponse extends AlihealthKytCommonParameter
} }
} }
public List<ThirdAliSearchbill> disposeThirdAliSearchbill(String customerId){ public List<AliKytSearchbill> disposeThirdAliSearchbill(String customerId){
List<ThirdAliSearchbill> list = new ArrayList<>(); List<AliKytSearchbill> list = new ArrayList<>();
List<JSONObject> jsonArray = (List) this.getBill_chk_in_out_do(); List<JSONObject> jsonArray = (List) this.getBill_chk_in_out_do();
if (jsonArray != null && jsonArray.size() > 0) { if (jsonArray != null && jsonArray.size() > 0) {
for (JSONObject jsonObject : jsonArray) { for (JSONObject jsonObject : jsonArray) {
if (!Objects.isNull(jsonObject)) { if (!Objects.isNull(jsonObject)) {
ThirdAliSearchbill thirdAliSearchbill = new ThirdAliSearchbill(); AliKytSearchbill aliKytSearchbill = new AliKytSearchbill();
thirdAliSearchbill.setBillType(jsonObject.getStr("bill_type")); aliKytSearchbill.setBillType(jsonObject.getStr("bill_type"));
thirdAliSearchbill.setBillCode(jsonObject.getStr("bill_code")); aliKytSearchbill.setBillCode(jsonObject.getStr("bill_code"));
thirdAliSearchbill.setFromUserId(jsonObject.getStr("from_user_id")); aliKytSearchbill.setFromUserId(jsonObject.getStr("from_user_id"));
thirdAliSearchbill.setRefUserName(jsonObject.getStr("ref_user_name"));; aliKytSearchbill.setRefUserName(jsonObject.getStr("ref_user_name"));;
thirdAliSearchbill.setRefUserId(jsonObject.getStr("ref_user_id")); aliKytSearchbill.setRefUserId(jsonObject.getStr("ref_user_id"));
thirdAliSearchbill.setProduceDate(jsonObject.getStr("produce_date")); aliKytSearchbill.setProduceDate(jsonObject.getStr("produce_date"));
thirdAliSearchbill.setUploadFileName(jsonObject.getStr("upload_file_name")); aliKytSearchbill.setUploadFileName(jsonObject.getStr("upload_file_name"));
thirdAliSearchbill.setFromUserName(jsonObject.getStr("from_user_name")); aliKytSearchbill.setFromUserName(jsonObject.getStr("from_user_name"));
thirdAliSearchbill.setToUserId(jsonObject.getStr("to_user_id")); aliKytSearchbill.setToUserId(jsonObject.getStr("to_user_id"));
thirdAliSearchbill.setProduceEntId(jsonObject.getStr("produce_ent_id")); aliKytSearchbill.setProduceEntId(jsonObject.getStr("produce_ent_id"));
thirdAliSearchbill.setBillTime(jsonObject.getStr("bill_time")); aliKytSearchbill.setBillTime(jsonObject.getStr("bill_time"));
thirdAliSearchbill.setUserRoleType(jsonObject.getStr("user_role_type")); aliKytSearchbill.setUserRoleType(jsonObject.getStr("user_role_type"));
thirdAliSearchbill.setProcessDate(jsonObject.getStr("process_date")); aliKytSearchbill.setProcessDate(jsonObject.getStr("process_date"));
thirdAliSearchbill.setBillId(jsonObject.getStr("bill_id")); aliKytSearchbill.setBillId(jsonObject.getStr("bill_id"));
thirdAliSearchbill.setToUserName(jsonObject.getStr("to_user_name")); aliKytSearchbill.setToUserName(jsonObject.getStr("to_user_name"));
thirdAliSearchbill.setAgentUserName(jsonObject.getStr("agent_user_name")); aliKytSearchbill.setAgentUserName(jsonObject.getStr("agent_user_name"));
thirdAliSearchbill.setAgentRefUserId(jsonObject.getStr("agent_ref_user_id")); aliKytSearchbill.setAgentRefUserId(jsonObject.getStr("agent_ref_user_id"));
thirdAliSearchbill.setBillTypeName(jsonObject.getStr("bill_type_name")); aliKytSearchbill.setBillTypeName(jsonObject.getStr("bill_type_name"));
thirdAliSearchbill.setToRefUserId(jsonObject.getStr("to_ref_user_id")); aliKytSearchbill.setToRefUserId(jsonObject.getStr("to_ref_user_id"));
thirdAliSearchbill.setFromRefUserId(jsonObject.getStr("from_ref_user_id")); aliKytSearchbill.setFromRefUserId(jsonObject.getStr("from_ref_user_id"));
thirdAliSearchbill.setErpId("customerId"); aliKytSearchbill.setErpId(customerId);
thirdAliSearchbill.setCreateTime(new Date()); aliKytSearchbill.setCreateTime(new Date());
thirdAliSearchbill.setUpdateTime(new Date()); aliKytSearchbill.setUpdateTime(new Date());
list.add(thirdAliSearchbill); list.add(aliKytSearchbill);
} }
} }

@ -0,0 +1,43 @@
package com.glxp.api.res.alihealth;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import java.util.Objects;
@Data
public class AlihealthLsydListupoutResponse extends AlihealthKytCommonParametersResponse {
private JSONArray bill_up_out_detail_do;
private Integer total_num;
public AlihealthLsydListupoutResponse(String json) {
// 初始化请求的值
cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(json);
JSONObject jsonObjectResult = null;
for (String s : jsonObject.keySet()) {
jsonObjectResult = jsonObject.getJSONObject(s).getJSONObject("result");
}
AlihealthKytCommonParametersResponse alihealthKytCommonParametersResponse = JSONUtil.toBean(jsonObjectResult.toString(),
AlihealthKytCommonParametersResponse.class);
BeanUtils.copyProperties(alihealthKytCommonParametersResponse, this);
if (StringUtils.isNotEmpty(this.getMsg_info())
&& this.getMsg_info().equals("调用成功")
) {
this.disposeResult(jsonObjectResult);
}
}
public void disposeResult(JSONObject jsonObjectResult) {
JSONObject jsonObjectModel = jsonObjectResult.getJSONObject("model");
if (!Objects.isNull(jsonObjectModel)) {
this.setTotal_num(jsonObjectModel.getInt("total_num"));
this.setBill_up_out_detail_do(jsonObjectModel.getJSONObject("result_list").getJSONArray("bill_up_out_detail_do"));
}
}
}

@ -418,18 +418,7 @@ public class UdiContrastService {
for (int i = 0; i < thirdAliDrugList.size(); i++) { for (int i = 0; i < thirdAliDrugList.size(); i++) {
ThirdAliDrug thirdAliDrug = thirdAliDrugList.get(i); ThirdAliDrug thirdAliDrug = thirdAliDrugList.get(i);
List<Integer> integers = new ArrayList<>();
if (StrUtil.isNotEmpty(thirdAliDrug.getPackRatio())) {
integers = DimaUtil.calculateLevels(thirdAliDrug.getPackRatio());
}
udiProductEntity.setPackLevel(thirdAliDrug.getPackLevel());
try {
udiProductEntity.setBhxjsl(integers.get(IntUtil.value(thirdAliDrug.getPackLevel()) - 1));
} catch (IndexOutOfBoundsException e) {
e.printStackTrace();
Log.error("计算包装级别出错" + thirdAliDrug.getPackLevel() + "---" + integers + "-----" + thirdAliDrug.toString());
udiProductEntity.setBhxjsl(0);
}
udiProductEntity.setNameCode(thirdAliDrug.getNameCode()); udiProductEntity.setNameCode(thirdAliDrug.getNameCode());
@ -447,14 +436,25 @@ public class UdiContrastService {
udiProductEntity.setPackUnit(thirdAliDrug.getPackUnitName()); udiProductEntity.setPackUnit(thirdAliDrug.getPackUnitName());
//设置最小产品数量 //设置最小产品数量
// udiProductEntity.setBhxjsl(ybDrug.getFactor()); // udiProductEntity.setBhxjsl(ybDrug.getFactor());
//设置包装级别
udiProductEntity.setPackLevel(1 + "");
//生产厂家 //生产厂家
udiProductEntity.setManufactory(thirdAliDrug.getManufacturer()); udiProductEntity.setManufactory(thirdAliDrug.getManufacturer());
//商品条码 essentialDrugMarkName sptm //商品条码 essentialDrugMarkName sptm
// udiProductEntity.setSptm(ybDrug.getBusinessLicense()); // udiProductEntity.setSptm(ybDrug.getBusinessLicense());
udiProductEntity.setPrepnUnit(thirdAliDrug.getPrepnUnitName()); udiProductEntity.setPrepnUnit(thirdAliDrug.getPrepnUnitName());
List<Integer> integers = new ArrayList<>();
if (StrUtil.isNotEmpty(thirdAliDrug.getPackRatio())) {
integers = DimaUtil.calculateLevels(thirdAliDrug.getPackRatio());
}
udiProductEntity.setPackLevel(thirdAliDrug.getPackLevel());
try {
udiProductEntity.setBhxjsl(integers.get(IntUtil.value(thirdAliDrug.getPackLevel()) - 1));
} catch (IndexOutOfBoundsException e) {
e.printStackTrace();
Log.error("计算包装级别出错" + thirdAliDrug.getPackLevel() + "---" + integers + "-----" + thirdAliDrug.toString());
udiProductEntity.setBhxjsl(0);
}
if (IntUtil.value(thirdAliDrug.getPackLevel()) == 1) { if (IntUtil.value(thirdAliDrug.getPackLevel()) == 1) {
udiProductEntity.setXjdw(ybDrug.getMinUnit()); udiProductEntity.setXjdw(ybDrug.getMinUnit());
if (DimaUtil.trMinCount(thirdAliDrug.getBzgg()) != null) { if (DimaUtil.trMinCount(thirdAliDrug.getBzgg()) != null) {

@ -5,7 +5,7 @@ import cn.hutool.http.HttpUtil;
import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.entity.thrsys.ThirdAliDrug; import com.glxp.api.entity.thrsys.ThirdAliDrug;
import com.glxp.api.entity.thrsys.ThirdAliSearchbill; import com.glxp.api.entity.alihealth.AliKytSearchbill;
import com.glxp.api.req.alihealth.AlihealthKytCommonParametersReqeust; import com.glxp.api.req.alihealth.AlihealthKytCommonParametersReqeust;
import com.glxp.api.req.alihealth.AlihealthKytDrugrescodeReqeust; import com.glxp.api.req.alihealth.AlihealthKytDrugrescodeReqeust;
import com.glxp.api.req.alihealth.AlihealthKytSearchbillReqeust; import com.glxp.api.req.alihealth.AlihealthKytSearchbillReqeust;
@ -92,7 +92,7 @@ public class AlihealthUtils {
return ResultVOUtils.error("阿里健康接口调用失败===用户找不到或者key和秘钥为空"); return ResultVOUtils.error("阿里健康接口调用失败===用户找不到或者key和秘钥为空");
} }
if (alihealthKytDrugrescodeResponse.judgeCall()) { if (alihealthKytDrugrescodeResponse.judgeCall()) {
List<ThirdAliSearchbill> list = alihealthKytDrugrescodeResponse.disposeThirdAliSearchbill(alihealthKytThirdAliSearchbillInsertReqeust.getErpId()); List<AliKytSearchbill> list = alihealthKytDrugrescodeResponse.disposeThirdAliSearchbill(alihealthKytThirdAliSearchbillInsertReqeust.getErpId());
return ResultVOUtils.success(list); return ResultVOUtils.success(list);
} else { } else {
return ResultVOUtils.error("阿里健康接口调用失败===" + alihealthKytDrugrescodeResponse.getMsg_info()); return ResultVOUtils.error("阿里健康接口调用失败===" + alihealthKytDrugrescodeResponse.getMsg_info());

Loading…
Cancel
Save