授权相关修改

20230922-ljl-fixBug
cxxxxxxx详 1 year ago
parent 263ae32940
commit 562fc3ffa8

@ -18,4 +18,6 @@ public interface Shop1688DsAuthService {
int updateByPrimaryKeySelective(Shop1688DsAuth record);
int updateByPrimaryKey(Shop1688DsAuth record);
Shop1688DsAuth getDetailByShopId(Long shopId);
}

@ -18,4 +18,6 @@ public interface ShopTo1688DsMemberService {
int updateByPrimaryKeySelective(ShopTo1688DsMember record);
int updateByPrimaryKey(ShopTo1688DsMember record);
ShopTo1688DsMember getDetailByShopId(Long shopId);
}

@ -46,6 +46,11 @@ public class Shop1688DsAuthServiceImpl implements Shop1688DsAuthService{
return shop1688DsAuthMapper.updateByPrimaryKey(record);
}
@Override
public Shop1688DsAuth getDetailByShopId(Long shopId) {
return shop1688DsAuthMapper.getDetailByShopId(shopId);
}
}

@ -46,6 +46,11 @@ public class ShopTo1688DsMemberServiceImpl implements ShopTo1688DsMemberService{
return shopTo1688DsMemberMapper.updateByPrimaryKey(record);
}
@Override
public ShopTo1688DsMember getDetailByShopId(Long shopId) {
return shopTo1688DsMemberMapper.getDetailByShopId(shopId);
}
}

@ -44,7 +44,7 @@ public class MemberAuthCallback extends SPIBaseService implements ExtensionServi
MemberAuthCallBackRequestDTO fields = req.getData();
log.info("receive callback: " + JSON.toJSONString(fields));
String body = fields.getBody();
// String body = "userId=gfZbbg6BSAlPMmw75xlCzQ%3D%3D&cnaliMemberId=b2b-221123084407697b20&authCode=NGNiYzEyODUtNzFhOS01ZmIwLWE5MDEtYzI3ZTAyYWFjOTA2&gmtMemberExpireTime=2023-11-13+23%3A59%3A59&type=auth";
Map<String, String> map = new HashMap<String, String>();
// ----逻辑校验----
@ -65,17 +65,26 @@ public class MemberAuthCallback extends SPIBaseService implements ExtensionServi
this.authCode = fields.getAuthCode();
log.info(map.toString());
Shop1688DsAuth shop1688DsAuth = new Shop1688DsAuth();
Shop1688DsAuth shop1688DsAuth = shop1688DsAuthService.getDetailByShopId(Long.valueOf(SecurityTool.decodeByAES(userId)));
if (Objects.isNull(shop1688DsAuth)) {
shop1688DsAuth = new Shop1688DsAuth();
shop1688DsAuthService.insert(shop1688DsAuth);
}
shop1688DsAuth.setAuthCode(authCode);
shop1688DsAuth.setShopId(Long.valueOf(SecurityTool.decodeByAES(userId)));
shop1688DsAuthService.insert(shop1688DsAuth);
shop1688DsAuthService.updateByPrimaryKey(shop1688DsAuth);
ShopTo1688DsMember shopTo1688DsMember= new ShopTo1688DsMember();
ShopTo1688DsMember shopTo1688DsMember = shopTo1688DsMemberService.getDetailByShopId(Long.valueOf(SecurityTool.decodeByAES(userId)));
if (Objects.isNull(shopTo1688DsMember)) {
shopTo1688DsMember = new ShopTo1688DsMember();
shopTo1688DsMemberService.insert(shopTo1688DsMember);
}
shopTo1688DsMember.setCnaliMemberId(cnaliMemberId);
shopTo1688DsMember.setShopId(Long.valueOf(SecurityTool.decodeByAES(userId)));
shopTo1688DsMember.setGmtExpire(gmtMemberExpireTime);
shopTo1688DsMemberService.insert(shopTo1688DsMember);
shopTo1688DsMemberService.updateByPrimaryKey(shopTo1688DsMember);
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage());
}

@ -21,4 +21,5 @@ public interface Shop1688DsAuthMapper {
int updateByPrimaryKey(Shop1688DsAuth record);
Shop1688DsAuth getDetailByShopId(Long shopId);
}

@ -22,4 +22,6 @@ public interface ShopTo1688DsMemberMapper {
int updateByPrimaryKey(ShopTo1688DsMember record);
ShopTo1688DsMember selectByShopId(Long shopId);
ShopTo1688DsMember getDetailByShopId(Long shopId);
}

@ -24,6 +24,13 @@
where shop_1688_ds_auth_id = #{shop1688DsAuthId,jdbcType=BIGINT}
</select>
<select id="getDetailByShopId" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from shop_1688_ds_auth
where shop_id = #{shopId,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from shop_1688_ds_auth
where shop_1688_ds_auth_id = #{shop1688DsAuthId,jdbcType=BIGINT}

@ -26,6 +26,12 @@
from shop_to_1688_ds_member
where shop_to_1688_ds_member_id = #{shopTo1688DsMemberId,jdbcType=BIGINT}
</select>
<select id="getDetailByShopId" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from shop_to_1688_ds_member
where shop_id = #{shopId,jdbcType=BIGINT}
</select>
<select id="selectByShopId" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />

Loading…
Cancel
Save