1、key使用阿里用户表获取

dev_unify
qiuyt 7 months ago
parent af003ea3cf
commit d6809e34f5

@ -0,0 +1,9 @@
package com.glxp.api.dao.auth;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.auth.AuthAliUser;
import com.glxp.api.entity.auth.InvSpace;
public interface AuthAliUserDao extends BaseMapperPlus<AuthAliUser, AuthAliUser, AuthAliUser> {
}

@ -0,0 +1,37 @@
package com.glxp.api.entity.auth;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AuthAliUser {
private Long id;
/**
* ID
*/
private String erpid;
/**
* KEY
*/
private String appkey;
/**
*
*/
private String appsecret;
/**
*
*/
private String refentid;
/**
* 1 2
*/
private String type;
}

@ -0,0 +1,26 @@
package com.glxp.api.service.auth;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glxp.api.dao.auth.AuthAliUserDao;
import com.glxp.api.entity.auth.AuthAliUser;
import com.glxp.api.entity.auth.SysWorkplace;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class AuthAliUserService extends ServiceImpl<AuthAliUserDao, AuthAliUser> {
@Resource
private AuthAliUserDao authAliUserDao;
public AuthAliUser getOne(){
AuthAliUser authAliUser = this.getOne(new QueryWrapper<AuthAliUser>()
.last("limit 1")
);
if(authAliUser == null){
authAliUser = new AuthAliUser();
}
return authAliUser;
}
}

@ -7,6 +7,7 @@ import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.TypeReference;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.entity.auth.AuthAliUser;
import com.glxp.api.entity.thrsys.*;
import com.glxp.api.exception.JsonException;
import com.glxp.api.http.sync.SpGetHttpClient;
@ -17,6 +18,7 @@ import com.glxp.api.req.thrsys.ThrInsDrugFeeRequest;
import com.glxp.api.req.thrsys.ThrInsMaterialFeeRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.alihealth.AlihealthKytSinglerelationResponse;
import com.glxp.api.service.auth.AuthAliUserService;
import com.glxp.api.service.thrsys.*;
import com.glxp.api.util.*;
import lombok.extern.slf4j.Slf4j;
@ -74,6 +76,8 @@ public class UdiContrastService {
YbDrugService ybDrugService;
@Resource
private SpGetHttpClient spGetHttpClient;
@Resource
private AuthAliUserService authAliUserService;
public boolean isExit(String originUuid, String mainId, String thirdSys) {
@ -353,7 +357,6 @@ public class UdiContrastService {
} else {
}
List<ThirdAliDrug> thirdAliDrugList = thirdAliDrugService.list(
new QueryWrapper<ThirdAliDrug>()
@ -363,31 +366,31 @@ public class UdiContrastService {
if (CollUtil.isNotEmpty(thirdAliDrugList)) {
} else {
AuthAliUser authAliUser = authAliUserService.getOne();
AlihealthThirdAliDrugInsertReqeust alihealthThirdAliDrugInsertReqeust = new AlihealthThirdAliDrugInsertReqeust();
alihealthThirdAliDrugInsertReqeust.setErpId("73157692795424");
alihealthThirdAliDrugInsertReqeust.setAppSecret("5231c601505706a9d49823c3dfe2cb01");
alihealthThirdAliDrugInsertReqeust.setErpId(authAliUser.getErpid());
alihealthThirdAliDrugInsertReqeust.setAppSecret(authAliUser.getAppsecret());
AlihealthKytDrugrescodeReqeust alihealthKytDrugrescodeReqeust = new AlihealthKytDrugrescodeReqeust();
alihealthKytDrugrescodeReqeust.setPhysic_name(udiProductEntity.getCpmctymc());
alihealthKytDrugrescodeReqeust.setApproval_licence_no(udiProductEntity.getZczbhhzbapzbh());
alihealthKytDrugrescodeReqeust.setPage_size(100);
alihealthKytDrugrescodeReqeust.setPage(1);
alihealthKytDrugrescodeReqeust.setApp_key("31721223");
alihealthKytDrugrescodeReqeust.setRef_ent_id("ef99b78bd9c54c1284f813149c858fb0");
alihealthKytDrugrescodeReqeust.setApp_key(authAliUser.getAppkey());
alihealthKytDrugrescodeReqeust.setRef_ent_id(authAliUser.getRefentid());
alihealthThirdAliDrugInsertReqeust.setAlihealthKytDrugrescodeReqeust(alihealthKytDrugrescodeReqeust);
try {
BaseResponse baseResponse = spGetHttpClient.thirdAliDrugList(alihealthThirdAliDrugInsertReqeust);
if (baseResponse.getCode() == 20000) {
try {
thirdAliDrugService.addOrUpdate((List) baseResponse.getData());
if (thirdAliDrugService.addOrUpdate((List) baseResponse.getData())) {
thirdAliDrugList = thirdAliDrugService.list(
new QueryWrapper<ThirdAliDrug>()
.eq(StringUtils.isNotEmpty(udiProductEntity.getCpmctymc()), "cpmctymc", udiProductEntity.getCpmctymc())
.eq(StringUtils.isNotEmpty(udiProductEntity.getZczbhhzbapzbh()), "approvalNum", udiProductEntity.getZczbhhzbapzbh())
);
}catch (Exception e){
log.info("供应商平台获取阿里和国家库码段信息出现错误===" + e.getMessage());
// udiProductEntity.setBasicPrductRemak8("供应商平台获取阿里和国家库码段信息出现错误===" + e.getMessage());
// error = "供应商平台获取阿里和国家库码段信息出现错误===" + e.getMessage();
} else {
log.info("供应商平台获取阿里和国家库码段信息===未查到产品信息");
udiProductService.insertUdiInfo(udiProductEntity);
}
@ -402,6 +405,15 @@ public class UdiContrastService {
}
} catch (Exception e) {
log.info("供应商平台获取阿里和国家库码段信息出现错误===" + e.getMessage());
// udiProductEntity.setBasicPrductRemak8("供应商平台获取阿里和国家库码段信息出现错误===" + e.getMessage());
// error = "供应商平台获取阿里和国家库码段信息出现错误===" + e.getMessage();
udiProductService.insertUdiInfo(udiProductEntity);
}
}
for (int i = 0; i < thirdAliDrugList.size(); i++) {

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glxp.api.dao.auth.AuthAliUserDao">
<resultMap id="BaseResultMap" type="com.glxp.api.entity.auth.AuthAliUser">
<!--@mbg.generated-->
<!--@Table auth_ali_user-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="erpId" jdbcType="INTEGER" property="erpid" />
<result column="appKey" jdbcType="VARCHAR" property="appkey" />
<result column="appSecret" jdbcType="VARCHAR" property="appsecret" />
<result column="refEntId" jdbcType="VARCHAR" property="refentid" />
<result column="type" jdbcType="VARCHAR" property="type" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, erpId, appKey, appSecret, refEntId, `type`
</sql>
</mapper>

@ -4885,7 +4885,7 @@ CALL Pro_Temp_ColumnWork('third_ali_drug', 'packUnitName',
CREATE TABLE IF NOT EXISTS `auth_ali_user` (
`id` bigint NOT NULL,
`erpId` int DEFAULT NULL COMMENT '第三方ID',
`erpId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '第三方ID',
`appKey` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '阿里KEY',
`appSecret` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '阿里密钥',
`refEntId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '厂家标识',
@ -4897,5 +4897,5 @@ INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `
`is_frame`,
`is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`,
`update_by`, `update_time`, `remark`)
VALUES (5242, '医保上传统计', 5210, 999, 'inout/split/tag/stats', 'collect/CollectOrderStats', NULL, 1, 0, 'C', '0', '0', NULL, '', '超级用户', '2024-11-18 17:46:08', NULL, NULL, NULL);
VALUES (6001, '医保上传统计', 5210, 999, 'inout/split/tag/stats', 'collect/CollectOrderStats', NULL, 1, 0, 'C', '0', '0', NULL, '', '超级用户', '2024-11-18 17:46:08', NULL, NULL, NULL);

Loading…
Cancel
Save