|
|
@ -80,10 +80,11 @@ import java.util.stream.Collectors;
|
|
|
|
@Slf4j
|
|
|
|
@Slf4j
|
|
|
|
@Service(value = "100011HttpClient")
|
|
|
|
@Service(value = "100011HttpClient")
|
|
|
|
public class CtqyyClient extends CommonHttpClient {
|
|
|
|
public class CtqyyClient extends CommonHttpClient {
|
|
|
|
private final String[] buyType_3501 = {"24"};
|
|
|
|
// 目前只有3505调通过上传医保 其他先不配置怕自动上传出问题
|
|
|
|
private final String[] buyType_3502 = {"SC72889572632899", "6", "5", "4", "1", "16", "12", "28", "35"};
|
|
|
|
private final String[] buyType_3501 = {};
|
|
|
|
|
|
|
|
private final String[] buyType_3502 = { };
|
|
|
|
private final String[] buyType_3505 = {"QXCF001", "YPCF002"};
|
|
|
|
private final String[] buyType_3505 = {"QXCF001", "YPCF002"};
|
|
|
|
private final String[] buyType_3506 = {"YPTH001"};
|
|
|
|
private final String[] buyType_3506 = {};
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
AuthWarehouseUserMapper authWarehouseUserMapper;
|
|
|
|
AuthWarehouseUserMapper authWarehouseUserMapper;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
@ -2090,9 +2091,12 @@ public class CtqyyClient extends CommonHttpClient {
|
|
|
|
if (StrUtil.isNotBlank(code)) {
|
|
|
|
if (StrUtil.isNotBlank(code)) {
|
|
|
|
List<RelCodeDetail> relCodeDetailList = relCodeDetailService.getAllNext(code);
|
|
|
|
List<RelCodeDetail> relCodeDetailList = relCodeDetailService.getAllNext(code);
|
|
|
|
if (relCodeDetailList != null && relCodeDetailList.size() > 0) {
|
|
|
|
if (relCodeDetailList != null && relCodeDetailList.size() > 0) {
|
|
|
|
DrugInfoRequest request = new DrugInfoRequest();
|
|
|
|
for (RelCodeDetail relCodeDetail : relCodeDetailList) {
|
|
|
|
request.setDrug_trac_codg(code);
|
|
|
|
DrugInfoRequest request = new DrugInfoRequest();
|
|
|
|
drugTraceList.add(request);
|
|
|
|
request.setDrug_trac_codg(relCodeDetail.getCurCode());
|
|
|
|
|
|
|
|
drugTraceList.add(request);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2174,9 +2178,12 @@ public class CtqyyClient extends CommonHttpClient {
|
|
|
|
if (StrUtil.isNotBlank(code)) {
|
|
|
|
if (StrUtil.isNotBlank(code)) {
|
|
|
|
List<RelCodeDetail> relCodeDetailList = relCodeDetailService.getAllNext(code);
|
|
|
|
List<RelCodeDetail> relCodeDetailList = relCodeDetailService.getAllNext(code);
|
|
|
|
if (relCodeDetailList != null && relCodeDetailList.size() > 0) {
|
|
|
|
if (relCodeDetailList != null && relCodeDetailList.size() > 0) {
|
|
|
|
DrugInfoRequest request = new DrugInfoRequest();
|
|
|
|
for (RelCodeDetail relCodeDetail : relCodeDetailList) {
|
|
|
|
request.setDrug_trac_codg(code);
|
|
|
|
DrugInfoRequest request = new DrugInfoRequest();
|
|
|
|
drugTraceList.add(request);
|
|
|
|
request.setDrug_trac_codg(relCodeDetail.getCurCode());
|
|
|
|
|
|
|
|
drugTraceList.add(request);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2208,46 +2215,73 @@ public class CtqyyClient extends CommonHttpClient {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public BaseResponse optionUploadCollectOrder3502(IoCollectOrder ioCollectOrder) {
|
|
|
|
public BaseResponse optionUploadCollectOrder3502(IoCollectOrder ioCollectOrder) {
|
|
|
|
|
|
|
|
// List<CollectOrderBizResponse> bizList = ioCollectOrder.getCollectOrderBizResponseList();
|
|
|
|
List<CollectOrderBizResponse> bizList = ioCollectOrder.getCollectOrderBizResponseList();
|
|
|
|
List<CollectOrderBizResponse> bizList = ioCollectOrder.getCollectOrderBizResponseList();
|
|
|
|
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(bizList)) {
|
|
|
|
if (CollUtil.isNotEmpty(bizList)) {
|
|
|
|
List<CollectOrderBizResponse> collectOrderBizResponseList = ioCollectOrder.getCollectOrderBizResponseList();
|
|
|
|
|
|
|
|
List<Kcbg3502Request> kcbg3502Requests = new ArrayList<>();
|
|
|
|
List<Kcbg3502Request> kcbg3502Requests = new ArrayList<>();
|
|
|
|
for (CollectOrderBizResponse collectOrderBizResponse : collectOrderBizResponseList) {
|
|
|
|
for (CollectOrderBizResponse item : bizList) {
|
|
|
|
BasicUdirelEntity basicUdirelEntity = basicUdirelDao.selectById(collectOrderBizResponse.getRelId());
|
|
|
|
BasicUdirelEntity basicUdirelEntity = basicUdirelDao.selectById(item.getRelId());
|
|
|
|
String itemCode = basicUdirelEntity.getMainId();
|
|
|
|
String itemCode = basicUdirelEntity.getMainId();
|
|
|
|
for (CollectOrderBizResponse item : bizList) {
|
|
|
|
// for (CollectOrderBizResponse item : collectOrderBizResponseList) {
|
|
|
|
if (item.getYbbm().equals(itemCode)) {
|
|
|
|
// if (item.getYbbm().equals(itemCode)) {
|
|
|
|
String[] codes = collectOrderBizResponse.getFinishUdiCode().split(",");
|
|
|
|
String[] codes = item.getFinishUdiCode().split(",");
|
|
|
|
List<DrugInfoRequest> drugTraceList = new ArrayList<>();
|
|
|
|
String nameCode = item.getNameCode();
|
|
|
|
// 遍历fruits数组
|
|
|
|
BasicProductsEntity basicProductsEntity = basicProductsDao.selectOne(
|
|
|
|
for (String code : codes) {
|
|
|
|
new QueryWrapper<BasicProductsEntity>().eq("nameCode",nameCode).last("limit 1")
|
|
|
|
if (StrUtil.isNotBlank(code)) {
|
|
|
|
);
|
|
|
|
List<RelCodeDetail> relCodeDetailList = relCodeDetailService.getAllNext(code);
|
|
|
|
if(Objects.isNull(basicProductsEntity)){
|
|
|
|
if (relCodeDetailList != null && relCodeDetailList.size() > 0) {
|
|
|
|
return ResultVOUtils.error(500,"产品为空请检查");
|
|
|
|
DrugInfoRequest request = new DrugInfoRequest();
|
|
|
|
}
|
|
|
|
request.setDrug_trac_codg(code);
|
|
|
|
Integer packLevel = Integer.valueOf(basicProductsEntity.getPackLevel());
|
|
|
|
drugTraceList.add(request);
|
|
|
|
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) {
|
|
|
|
|
|
|
|
for (RelCodeDetail relCodeDetail : relCodeDetailList) {
|
|
|
|
|
|
|
|
codeList.add(relCodeDetail.getCurCode());
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// 级别为2的产品码不可能只有一个
|
|
|
|
|
|
|
|
if(packLevel >1 && codeList.size() <2){
|
|
|
|
|
|
|
|
return ResultVOUtils.error(500,"大包装码关联关系拉取不到请检查"+code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// TODO: 2024/9/10 字段未完全正确对应
|
|
|
|
|
|
|
|
Kcbg3502Request kcbg3502Request = Kcbg3502Request.builder()
|
|
|
|
|
|
|
|
.med_list_codg(item.getYbbm())
|
|
|
|
|
|
|
|
.inv_chg_type("108")
|
|
|
|
|
|
|
|
.fixmedins_hilist_id(item.getThrCode())
|
|
|
|
|
|
|
|
.fixmedins_hilist_name(item.getCpmctymc())
|
|
|
|
|
|
|
|
.fixmedins_bchno("0000")
|
|
|
|
|
|
|
|
.pric("0")
|
|
|
|
|
|
|
|
.cnt(item.getActCount())
|
|
|
|
|
|
|
|
.rx_flag("1")
|
|
|
|
|
|
|
|
.inv_chg_time(item.getUpdateTime())
|
|
|
|
|
|
|
|
.inv_chg_opter_name(ioCollectOrder.getCreateUser())
|
|
|
|
|
|
|
|
.memo(item.getRemark())
|
|
|
|
|
|
|
|
.trdn_flag("0")
|
|
|
|
|
|
|
|
.drugtracinfo(drugTraceList).build();
|
|
|
|
|
|
|
|
kcbg3502Requests.add(kcbg3502Request);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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("108")
|
|
|
|
|
|
|
|
.fixmedins_hilist_id(item.getThrCode())
|
|
|
|
|
|
|
|
.fixmedins_hilist_name(item.getCpmctymc())
|
|
|
|
|
|
|
|
.fixmedins_bchno("0000")
|
|
|
|
|
|
|
|
.pric("0")
|
|
|
|
|
|
|
|
.cnt(item.getActCount())
|
|
|
|
|
|
|
|
.rx_flag("1")
|
|
|
|
|
|
|
|
.inv_chg_time(item.getUpdateTime())
|
|
|
|
|
|
|
|
.inv_chg_opter_name(ioCollectOrder.getCreateUser())
|
|
|
|
|
|
|
|
.memo(item.getRemark())
|
|
|
|
|
|
|
|
.trdn_flag("0")
|
|
|
|
|
|
|
|
.drugtracinfo(drugTraceList).build();
|
|
|
|
|
|
|
|
kcbg3502Requests.add(kcbg3502Request);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
BaseKcbg3502Request baseKcbg3502Request = new BaseKcbg3502Request();
|
|
|
|
BaseKcbg3502Request baseKcbg3502Request = new BaseKcbg3502Request();
|
|
|
|
baseKcbg3502Request.setInvinfoDetail(kcbg3502Requests);
|
|
|
|
baseKcbg3502Request.setInvinfoDetail(kcbg3502Requests);
|
|
|
@ -2281,9 +2315,12 @@ public class CtqyyClient extends CommonHttpClient {
|
|
|
|
if (StrUtil.isNotBlank(code)) {
|
|
|
|
if (StrUtil.isNotBlank(code)) {
|
|
|
|
List<RelCodeDetail> relCodeDetailList = relCodeDetailService.getAllNext(code);
|
|
|
|
List<RelCodeDetail> relCodeDetailList = relCodeDetailService.getAllNext(code);
|
|
|
|
if (relCodeDetailList != null && relCodeDetailList.size() > 0) {
|
|
|
|
if (relCodeDetailList != null && relCodeDetailList.size() > 0) {
|
|
|
|
DrugInfoRequest request = new DrugInfoRequest();
|
|
|
|
for (RelCodeDetail relCodeDetail : relCodeDetailList) {
|
|
|
|
request.setDrug_trac_codg(code);
|
|
|
|
DrugInfoRequest request = new DrugInfoRequest();
|
|
|
|
drugTraceList.add(request);
|
|
|
|
request.setDrug_trac_codg(relCodeDetail.getCurCode());
|
|
|
|
|
|
|
|
drugTraceList.add(request);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|