调用阿里关联关系优化

选入药品查国家库加厂商条件查询
dev_unify
qiuyt 6 months ago
parent 1192f815da
commit 30f6bca31e

@ -45,6 +45,7 @@ public class AlihealthBusController extends BaseController {
private String alihealthUrl;
@Value("${UDI_SERVER_URL}")
private String udiUrl;
@PostMapping("/spms/alihealth/relCodeInsert")
@Log(title = "阿里健康自动赋码关联关系", businessType = BusinessType.OTHER)
public BaseResponse relCodeInsert(@RequestBody AlihealthRelCodeInsertReqeust alihealthRelCodeInsertReqeust) {
@ -99,6 +100,10 @@ public class AlihealthBusController extends BaseController {
if (com.glxp.api.util.StringUtils.isNotEmpty(alihealthKytDrugrescodeReqeust.getApproval_licence_no())) {
map.put("approvalNum", alihealthKytDrugrescodeReqeust.getApproval_licence_no());
}
if (com.glxp.api.util.StringUtils.isNotEmpty(alihealthThirdAliDrugInsertReqeust.getManufactory())) {
map.put("manufacturer", alihealthThirdAliDrugInsertReqeust.getManufactory());
}
List<ThirdAliDrug> thirdAliDrugsListGjk = null;
@ -148,7 +153,6 @@ public class AlihealthBusController extends BaseController {
}
@Resource
AlihealthBusService alihealthBusService;
@Resource
@ -156,6 +160,7 @@ public class AlihealthBusController extends BaseController {
/**
*
*
* @param aliYljgSearchbillReqeust
* @return
*/
@ -200,6 +205,7 @@ public class AlihealthBusController extends BaseController {
/**
*
*
* @param aliYljgSearchbillReqeust
* @return
*/

@ -47,7 +47,6 @@ public class AlihealthKytCommonParametersReqeust {
// */
// private boolean simplify;
public AlihealthKytCommonParametersReqeust(){
this.timestamp = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
this.v = "2.0";
this.sign_method = "md5";
this.format = "json";

@ -55,18 +55,28 @@ public class AlihealthYljgSinglerelationResponse extends AlihealthKytCommonParam
this.setProduce_info_list(codeRelationDto.getJSONObject("produce_info_list"));
}
}
public List<RelCodeBatch> disposeRelCodeBatch(String customerId){
public List<RelCodeBatch> disposeRelCodeBatch(String customerId,String code){
JSONArray jsonArrayBaseInfoDto = this.getBase_infos_dto().getJSONObject("base_info_list").getJSONArray("base_info_dto");
JSONObject jsonObject = (JSONObject) jsonArrayBaseInfoDto.get(0);
// RelCodeBatch relCodeBatch = new RelCodeBatch();
List<Map<String, String>> jsonArray = (List) this.getCode_relation_list().get("code_info");
List<String> list = new ArrayList<>();
Collections.reverse(jsonArray);
if (jsonArray != null && jsonArray.size() > 0) {
for (Map<String, String> map : jsonArray) {
// 倒叙判断级别 进行处理小查大就不加对象了
if((map.get("code").equals(code) && "1".equals(map.get("code_pack_level")))
|| map.get("code").equals(code)
){
continue;
}
list.add(map.get("parent_code"));
}
}
// 循环判断获取父级编码
Set<String> set = new HashSet<>(list);
List<RelCodeBatch> batchList = new ArrayList<>();
for (String parentCode : set) {
@ -76,7 +86,12 @@ public class AlihealthYljgSinglerelationResponse extends AlihealthKytCommonParam
Integer twoLevelCount = 0;
Integer threeLevelCount = 0;
for (Map<String, String> map : jsonArray) {
if(map.get("parent_code").equals("86540770000062502347") && map.get("code").equals("86193260002250549251")){
System.out.println();
}
if(parentCode.equals(map.get("code")) && StringUtils.isNotEmpty(map.get("parent_code"))){
relCodeBatch.setParentCode(map.get("parent_code"));
}
if(!parentCode.equals(map.get("code")) && parentCode.equals(map.get("parent_code"))){
switch (map.get("code_pack_level")) {
case "1":
@ -111,7 +126,6 @@ public class AlihealthYljgSinglerelationResponse extends AlihealthKytCommonParam
relCodeBatch.setUpdateUser(customerId);
relCodeBatch.setUploadFlagUp(0);
relCodeBatch.setUploadFlagDown(0);
relCodeBatch.setParentCode(null);
relCodeBatch.setErpId(customerId);
relCodeBatch.setOneLevelCount(oneLevelCount);

@ -338,6 +338,10 @@ public class UdiContrastService {
if (StringUtils.isNotEmpty(udiProductEntity.getZczbhhzbapzbh())) {
map.put("approvalNum", udiProductEntity.getZczbhhzbapzbh());
}
if (StringUtils.isNotEmpty(udiProductEntity.getManufactory())) {
map.put("manufacturer", udiProductEntity.getManufactory());
}
List<ThirdAliDrug> thirdAliDrugsListGjk = null;

@ -714,7 +714,7 @@ public class RelCodeBatchService extends ServiceImpl<RelCodeBatchMapper, RelCode
if (baseResponse.getCode() == 20000) {
AlihealthYljgSinglerelationResponse alihealthKytSinglerelationResponse = baseResponse.getData();
// 返回的码关联关系进行插入
List<RelCodeBatch> batchList = alihealthKytSinglerelationResponse.disposeRelCodeBatch(erpId);
List<RelCodeBatch> batchList = alihealthKytSinglerelationResponse.disposeRelCodeBatch(erpId,code);
for (RelCodeBatch relCodeBatch : batchList) {
RelCodeBatch relCodeBatchOne = relCodeBatchService.getOne(new QueryWrapper<RelCodeBatch>().eq("curCode", relCodeBatch.getCurCode())
.last("limit 1")

Loading…
Cancel
Save