|
|
|
@ -3,13 +3,10 @@ package com.glxp.mipsdl.client.hlfyyy;
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
import cn.hutool.core.exceptions.ExceptionUtil;
|
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
|
import cn.hutool.core.util.ReflectUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import cn.hutool.http.HttpRequest;
|
|
|
|
|
import cn.hutool.http.HttpResponse;
|
|
|
|
|
import cn.hutool.http.HttpUtil;
|
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
@ -20,7 +17,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import com.fasterxml.jackson.databind.JsonNode;
|
|
|
|
|
import com.glxp.mipsdl.client.CommonHttpClient;
|
|
|
|
|
|
|
|
|
|
import com.glxp.mipsdl.client.hlfyyy.entity.InvCodeResultEntity;
|
|
|
|
@ -45,7 +41,6 @@ import com.glxp.mipsdl.entity.hlfyyy.*;
|
|
|
|
|
import com.glxp.mipsdl.entity.inout.*;
|
|
|
|
|
import com.glxp.mipsdl.entity.system.ThrYbSetupMapper;
|
|
|
|
|
import com.glxp.mipsdl.entity.thrsys.ThrCorpEntity;
|
|
|
|
|
import com.glxp.mipsdl.entity.thrsys.ThrInvWarehouseEntity;
|
|
|
|
|
import com.glxp.mipsdl.entity.thrsys.ThrProductsEntity;
|
|
|
|
|
import com.glxp.mipsdl.entity.thrsys.ThrSystemBusApiEntity;
|
|
|
|
|
import com.glxp.mipsdl.http.HttpClient;
|
|
|
|
@ -76,11 +71,6 @@ import com.glxp.mipsdl.thirddao.ctqyy.*;
|
|
|
|
|
import com.glxp.mipsdl.thirddao.hlfyyy.*;
|
|
|
|
|
import com.glxp.mipsdl.util.*;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.axis2.AxisFault;
|
|
|
|
|
import org.apache.axis2.addressing.EndpointReference;
|
|
|
|
|
import org.apache.axis2.client.Options;
|
|
|
|
|
import org.apache.axis2.rpc.client.RPCServiceClient;
|
|
|
|
|
import org.apache.ibatis.mapping.ParameterMode;
|
|
|
|
|
import org.dom4j.Document;
|
|
|
|
|
import org.dom4j.DocumentException;
|
|
|
|
|
import org.dom4j.DocumentHelper;
|
|
|
|
@ -89,8 +79,6 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.xml.namespace.QName;
|
|
|
|
|
import java.io.UnsupportedEncodingException;
|
|
|
|
|
import java.lang.reflect.Field;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.net.URLEncoder;
|
|
|
|
@ -103,7 +91,7 @@ import java.util.stream.Collectors;
|
|
|
|
|
@Service(value = "100015HttpClient")
|
|
|
|
|
public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
private final String[] buyType_3501 = {"24"};
|
|
|
|
|
private final String[] buyType_3502 = {"7", "6", "5", "4", "1", "16", "12", "28", "35"};
|
|
|
|
|
private final String[] buyType_3502 = {"SC73650724355678","7", "6", "5", "4", "1", "16", "12", "28", "35"};
|
|
|
|
|
private final String[] buyType_3505 = {"QXCF001", "YPCF002"};
|
|
|
|
|
private final String[] buyType_3506 = {"YPTH001"};
|
|
|
|
|
@Value("${DSF_XML_SQL_TYPE:MySql}")
|
|
|
|
@ -1697,7 +1685,7 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
if (matchBusType(busType, buyType_3501)) {
|
|
|
|
|
optionUploadCollectOrder3501(ioCollectOrder);
|
|
|
|
|
} else if (matchBusType(busType, buyType_3502)) {
|
|
|
|
|
optionUploadCollectOrder3502(ioCollectOrder);
|
|
|
|
|
return optionUploadCollectOrder3502(ioCollectOrder);
|
|
|
|
|
} else if (matchBusType(busType, buyType_3505)) {
|
|
|
|
|
optionUploadCollectOrder3505(ioCollectOrder);
|
|
|
|
|
} else if (matchBusType(busType, buyType_3506)) {
|
|
|
|
@ -2075,39 +2063,65 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void optionUploadCollectOrder3502(IoCollectOrder ioCollectOrder) {
|
|
|
|
|
List<IoCollectOrderBiz> bizList = ioCollectOrder.getBizList();
|
|
|
|
|
public BaseResponse optionUploadCollectOrder3502(IoCollectOrder ioCollectOrder) {
|
|
|
|
|
List<CollectOrderBizResponse> bizList = ioCollectOrder.getCollectOrderBizResponseList();
|
|
|
|
|
if (CollUtil.isNotEmpty(bizList)) {
|
|
|
|
|
List<CollectOrderBizResponse> collectOrderBizResponseList = ioCollectOrder.getCollectOrderBizResponseList();
|
|
|
|
|
List<Kcbg3502Request> kcbg3502Requests = new ArrayList<>();
|
|
|
|
|
for (CollectOrderBizResponse collectOrderBizResponse : collectOrderBizResponseList) {
|
|
|
|
|
BasicUdirelEntity basicUdirelEntity = basicUdirelDao.selectById(collectOrderBizResponse.getRelId());
|
|
|
|
|
String itemCode = basicUdirelEntity.getMainId();
|
|
|
|
|
for (IoCollectOrderBiz item : bizList) {
|
|
|
|
|
if (item.getNameCode().equals(itemCode)) {
|
|
|
|
|
for (CollectOrderBizResponse item : bizList) {
|
|
|
|
|
if (item.getYbbm().equals(itemCode)) {
|
|
|
|
|
String[] codes = collectOrderBizResponse.getFinishUdiCode().split(",");
|
|
|
|
|
String nameCode = collectOrderBizResponse.getNameCode();
|
|
|
|
|
BasicProductsEntity basicProductsEntity = basicProductsDao.selectOne(
|
|
|
|
|
new QueryWrapper<BasicProductsEntity>().eq("nameCode",nameCode).last("limit 1")
|
|
|
|
|
);
|
|
|
|
|
if(Objects.isNull(basicProductsEntity)){
|
|
|
|
|
return ResultVOUtils.error(500,"产品为空请检查");
|
|
|
|
|
}
|
|
|
|
|
Integer packLevel = Integer.valueOf(basicProductsEntity.getPackLevel());
|
|
|
|
|
List<DrugInfoRequest> drugTraceList = new ArrayList<>();
|
|
|
|
|
List<String> codeList = new ArrayList<>();
|
|
|
|
|
// 遍历fruits数组
|
|
|
|
|
for (String code : codes) {
|
|
|
|
|
if (StrUtil.isNotBlank(code)) {
|
|
|
|
|
List<RelCodeDetail> relCodeDetailList = relCodeDetailService.getAllNext(code);
|
|
|
|
|
if (relCodeDetailList != null && relCodeDetailList.size() > 0) {
|
|
|
|
|
DrugInfoRequest request = new DrugInfoRequest();
|
|
|
|
|
request.setDrug_trac_codg(code);
|
|
|
|
|
drugTraceList.add(request);
|
|
|
|
|
for (RelCodeDetail relCodeDetail : relCodeDetailList) {
|
|
|
|
|
codeList.add(relCodeDetail.getCurCode());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// 级别为2的产品码不可能只有一个
|
|
|
|
|
if(packLevel >1 && codeList.size() <2){
|
|
|
|
|
return ResultVOUtils.error(500,"大包装码关联关系拉取不到请检查");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Set<String> set = new HashSet(codeList);
|
|
|
|
|
for (String code : set) {
|
|
|
|
|
DrugInfoRequest request = new DrugInfoRequest();
|
|
|
|
|
request.setDrug_trac_codg(code);
|
|
|
|
|
drugTraceList.add(request);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(CollUtil.isEmpty(drugTraceList)){
|
|
|
|
|
return ResultVOUtils.error(500,"单据要传的码为空请检查");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TODO: 2024/9/10 字段未完全正确对应
|
|
|
|
|
Kcbg3502Request kcbg3502Request = Kcbg3502Request.builder()
|
|
|
|
|
.med_list_codg(item.getYbbm())
|
|
|
|
|
.inv_chg_type(item.getRemark7())
|
|
|
|
|
.inv_chg_type("108")
|
|
|
|
|
.fixmedins_hilist_id(item.getThrCode())
|
|
|
|
|
.fixmedins_hilist_name(item.getCpmctymc())
|
|
|
|
|
.fixmedins_bchno(item.getRemark5())
|
|
|
|
|
.pric(item.getRemark1())
|
|
|
|
|
.fixmedins_bchno("0000")
|
|
|
|
|
.pric("0")
|
|
|
|
|
.cnt(item.getActCount())
|
|
|
|
|
.rx_flag(item.getRemark6())
|
|
|
|
|
.rx_flag("1")
|
|
|
|
|
.inv_chg_time(item.getUpdateTime())
|
|
|
|
|
.inv_chg_opter_name(ioCollectOrder.getCreateUser())
|
|
|
|
|
.memo(item.getRemark())
|
|
|
|
@ -2118,13 +2132,16 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
BaseKcbg3502Request baseKcbg3502Request = new BaseKcbg3502Request();
|
|
|
|
|
baseKcbg3502Request.setSelinfoDetail(kcbg3502Requests);
|
|
|
|
|
baseKcbg3502Request.setInvinfoDetail(kcbg3502Requests);
|
|
|
|
|
String jsonStr = JSONUtil.toJsonStr(baseKcbg3502Request);
|
|
|
|
|
JSONObject dataJson = JSONObject.parseObject(jsonStr);
|
|
|
|
|
ybClient.ybPostScyh("3502A", dataJson);
|
|
|
|
|
return ybClient.ybPost("3502A", dataJson);
|
|
|
|
|
}else {
|
|
|
|
|
return ResultVOUtils.error(500,"上传医保数据为空请核实");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void optionUploadCollectOrder3506(IoCollectOrder ioCollectOrder) {
|
|
|
|
|
// List<IoCollectOrderBiz> bizList = ioCollectOrder.getBizList();
|
|
|
|
|
List<CollectOrderBizResponse> collectOrderBizResponseList = ioCollectOrder.getCollectOrderBizResponseList();
|
|
|
|
|