| @@ -1,4 +1,4 @@ | |||||
| update mall_sale_type set menus = '[1, 2, 5, 6, 8, 10, 50, 101, 102, 104, 105, 106, 108, 203, 204, 206, 207, 501, 502, 503, 504, 509, 591, 595, 601, 621, 622, 623, 624, 625, 626, 627, 901, 902]' where id=100 | |||||
| update mall_sale_type set menus = '[1, 2, 5, 6, 8, 10, 50, 101, 102, 104, 105, 106, 108, 203, 204, 206, 207, 501, 502, 503, 504, 505, 506, 507, 511, 512, 522, 523, 509, 591, 595, 601, 621, 622, 623, 624, 625, 626, 627, 901, 902]' where id=100 | |||||
| CREATE DEFINER=`root`@`%` PROCEDURE `init_after_group`(IN tenantId VARCHAR(25),IN subTenantIds VARCHAR(250)) | CREATE DEFINER=`root`@`%` PROCEDURE `init_after_group`(IN tenantId VARCHAR(25),IN subTenantIds VARCHAR(250)) | ||||
| @@ -32,3 +32,9 @@ BEGIN | |||||
| COMMIT; | COMMIT; | ||||
| END IF; | END IF; | ||||
| END; | END; | ||||
| --两张表做手动初始化 | |||||
| --wx_c_user_basic_info ---final_tenant_id | |||||
| --wx_c_user_tags ---tenant_id(同final_tenant_id) | |||||
| ---------- | |||||
| @@ -7,24 +7,33 @@ update `wx_c_user` set user_id = id where id in (select id from wx_c_user_basic_ | |||||
| ALTER TABLE `wx_c_user_basic_info` | ALTER TABLE `wx_c_user_basic_info` | ||||
| ADD COLUMN `final_tenant_id` varchar(5) NOT NULL COMMENT '归属租户ID' AFTER `parent_tenant_id`; | ADD COLUMN `final_tenant_id` varchar(5) NOT NULL COMMENT '归属租户ID' AFTER `parent_tenant_id`; | ||||
| DROP INDEX `PHONE_UNIQUE`, | |||||
| ADD UNIQUE INDEX `PHONE_UNIQUE`(`final_tenant_id`, `phone`) USING BTREE; | |||||
| update wx_c_user_basic_info set final_tenant_id = parent_tenant_id; | update wx_c_user_basic_info set final_tenant_id = parent_tenant_id; | ||||
| update wx_c_user_basic_info set final_tenant_id = tenant_id where (parent_tenant_id is null or trim(parent_tenant_id) = ""); | update wx_c_user_basic_info set final_tenant_id = tenant_id where (parent_tenant_id is null or trim(parent_tenant_id) = ""); | ||||
| DROP INDEX `PHONE_UNIQUE`, | |||||
| ADD UNIQUE INDEX `PHONE_UNIQUE`(`final_tenant_id`, `phone`) USING BTREE; | |||||
| ALTER TABLE `wx_c_user_basic_info` | ALTER TABLE `wx_c_user_basic_info` | ||||
| ADD COLUMN `login_count` int(11) DEFAULT 0 COMMENT '登陆次数' AFTER `active_time`; | ADD COLUMN `login_count` int(11) DEFAULT 0 COMMENT '登陆次数' AFTER `active_time`; | ||||
| update wx_c_user_basic_info wcubi set wcubi.login_count = (select wcu.login_count from wx_c_user wcu where wcu.id=wcubi.id); | update wx_c_user_basic_info wcubi set wcubi.login_count = (select wcu.login_count from wx_c_user wcu where wcu.id=wcubi.id); | ||||
| ALTER TABLE `wx_c_user_basic_info` | ALTER TABLE `wx_c_user_basic_info` | ||||
| ADD COLUMN `avatar_url` VARCHAR(225) DEFAULT 0 COMMENT '头像地址' AFTER `nick_name`; | ADD COLUMN `avatar_url` VARCHAR(225) DEFAULT 0 COMMENT '头像地址' AFTER `nick_name`; | ||||
| update wx_c_user_basic_info wcubi set wcubi.avatar_url = (select wcu.avatar_url from wx_c_user wcu where wcu.id=wcubi.id); | update wx_c_user_basic_info wcubi set wcubi.avatar_url = (select wcu.avatar_url from wx_c_user wcu where wcu.id=wcubi.id); | ||||
| ALTER TABLE `wx_c_user_basic_info` | |||||
| MODIFY COLUMN `phone` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '微信用户绑定的手机号' AFTER `final_tenant_id`; | |||||
| ALTER TABLE `wx_c_user_basic_info` | |||||
| MODIFY COLUMN `tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '租户ID' AFTER `id`; | |||||
| ALTER TABLE `wx_coupon_order` | ALTER TABLE `wx_coupon_order` | ||||
| ADD COLUMN `pay_vendor` SMALLINT(3) NOT NULL DEFAULT 1 COMMENT '订单渠道,EnumPayWay.class'; | ADD COLUMN `pay_vendor` SMALLINT(3) NOT NULL DEFAULT 1 COMMENT '订单渠道,EnumPayWay.class'; | ||||
| @@ -41,7 +50,5 @@ ADD COLUMN `plat` SMALLINT(3) NOT NULL DEFAULT 1 COMMENT 'app平台 1:微信 2: | |||||
| ALTER TABLE `wx_profit_sharing_receiver` | ALTER TABLE `wx_profit_sharing_receiver` | ||||
| ADD COLUMN `plat` SMALLINT(3) NOT NULL DEFAULT 1 COMMENT '平台 1:微信 2:阿里 3:头条'; | ADD COLUMN `plat` SMALLINT(3) NOT NULL DEFAULT 1 COMMENT '平台 1:微信 2:阿里 3:头条'; | ||||
| update mall_sale_type set menus = '[1, 2, 5, 6, 8, 10, 50, 101, 102, 104, 105, 106, 108, 203, 204, 206, 207, 501, 502, 503, 504, 505, 506, 507, 511, 512, 522, 523, 509, 591, 595, 601, 621, 622, 623, 624, 625, 626, 627, 901, 902]' where id=100 | |||||
| @@ -75,7 +75,7 @@ public class WxMsgValidationcodeController extends BaseController { | |||||
| if (rd.code == Result.SUCCESS) { | if (rd.code == Result.SUCCESS) { | ||||
| // 更新到basicinfo | // 更新到basicinfo | ||||
| Long userId = user.getId(); | Long userId = user.getId(); | ||||
| if (user.isBasicInfo()) { | |||||
| if (user.basicInfoIs()) { | |||||
| userId = user.getUserId(); | userId = user.getUserId(); | ||||
| } | } | ||||
| Long basicUserId = saveToBasicInfoByCUser(phone, user.getNickName(), user.getAvatarUrl(), user.getGender(), userId); | Long basicUserId = saveToBasicInfoByCUser(phone, user.getNickName(), user.getAvatarUrl(), user.getGender(), userId); | ||||
| @@ -89,7 +89,7 @@ public class WxPayOrderController extends BaseController { | |||||
| } | } | ||||
| WxCUser user = getWxCUser(); | WxCUser user = getWxCUser(); | ||||
| if (!user.isBasicInfo()) { | |||||
| if (!user.basicInfoIs()) { | |||||
| logger.error("暂未成为会员,请授权手机号"); | logger.error("暂未成为会员,请授权手机号"); | ||||
| return new ResultData(ErrorCode.USER_IS_NOT_MEMBER.getCode(), "暂未成为会员,请授权手机号"); | return new ResultData(ErrorCode.USER_IS_NOT_MEMBER.getCode(), "暂未成为会员,请授权手机号"); | ||||
| } | } | ||||
| @@ -767,7 +767,7 @@ public class WxUserGrantController extends BaseController { | |||||
| org.springframework.beans.BeanUtils.copyProperties(user, userVo); | org.springframework.beans.BeanUtils.copyProperties(user, userVo); | ||||
| userVo.setScore(0); | userVo.setScore(0); | ||||
| userVo.setCredit(0); | userVo.setCredit(0); | ||||
| if(user.isBasicInfo()){ | |||||
| if(user.basicInfoIs()){ | |||||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(user.getUserId()); | WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(user.getUserId()); | ||||
| if (wxCUserBasicInfo != null) { | if (wxCUserBasicInfo != null) { | ||||
| userVo.setScore(wxCUserBasicInfo.getPoins()); | userVo.setScore(wxCUserBasicInfo.getPoins()); | ||||
| @@ -70,7 +70,7 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter { | |||||
| if (StringUtils.isNotBlank(cUser.getParentTenantId())) { | if (StringUtils.isNotBlank(cUser.getParentTenantId())) { | ||||
| request.setAttribute(Constant.PARENT_TENANT_ID, cUser.getParentTenantId()); | request.setAttribute(Constant.PARENT_TENANT_ID, cUser.getParentTenantId()); | ||||
| } | } | ||||
| if(cUser.isBasicInfo()){ | |||||
| if(cUser.basicInfoIs()){ | |||||
| request.setAttribute(Constant.LOGIN_MEMBER_KEY, cUser.getUserId()); | request.setAttribute(Constant.LOGIN_MEMBER_KEY, cUser.getUserId()); | ||||
| } | } | ||||
| @@ -32,7 +32,7 @@ public class BaseCUserEntity extends TenantEntity { | |||||
| * 是否是会员 | * 是否是会员 | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| public boolean isBasicInfo() { | |||||
| public boolean basicInfoIs() { | |||||
| return UserUtil.CuserIsBasicInfo(this.getUserId()); | return UserUtil.CuserIsBasicInfo(this.getUserId()); | ||||
| } | } | ||||
| } | } | ||||
| @@ -233,7 +233,7 @@ public class WxMiniMaPayAdapterService extends BaseWxPayAdapterService implement | |||||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(), "微信扫码支付添加微信C端用户失败"); | throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(), "微信扫码支付添加微信C端用户失败"); | ||||
| } | } | ||||
| }else { | }else { | ||||
| if (user1.isBasicInfo()) { | |||||
| if (user1.basicInfoIs()) { | |||||
| userId = user1.getUserId(); | userId = user1.getUserId(); | ||||
| } | } | ||||
| } | } | ||||
| @@ -1011,8 +1011,8 @@ | |||||
| <select id="findImportUserCount" resultType="java.lang.Long"> | <select id="findImportUserCount" resultType="java.lang.Long"> | ||||
| SELECT count(distinct cubi.id) FROM wx_c_user_basic_info cubi | SELECT count(distinct cubi.id) FROM wx_c_user_basic_info cubi | ||||
| left join wx_c_user cu on cubi.id=cu.user_id where cu.id is null | |||||
| where 1=1 | |||||
| left join wx_c_user cu on cubi.id=cu.user_id | |||||
| where cu.id is null | |||||
| <if test=" null != finalTenantId and '' != finalTenantId"> | <if test=" null != finalTenantId and '' != finalTenantId"> | ||||
| and cubi.`final_tenant_id` = #{finalTenantId} | and cubi.`final_tenant_id` = #{finalTenantId} | ||||
| </if> | </if> | ||||
| @@ -1020,8 +1020,8 @@ | |||||
| <select id="findImportUserCount1" resultType="java.lang.Long"> | <select id="findImportUserCount1" resultType="java.lang.Long"> | ||||
| SELECT count(distinct cubi.id) FROM wx_c_user_basic_info cubi | SELECT count(distinct cubi.id) FROM wx_c_user_basic_info cubi | ||||
| left join wx_c_user cu on cubi.id=cu.user_id where cu.id is null | |||||
| where 1=1 | |||||
| left join wx_c_user cu on cubi.id=cu.user_id | |||||
| where cu.id is null | |||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and cu.`tenant_id` = #{tenantId} | and cu.`tenant_id` = #{tenantId} | ||||
| </if> | </if> | ||||
| @@ -1039,7 +1039,7 @@ | |||||
| </if> | </if> | ||||
| </select> | </select> | ||||
| <select id="findGrowUserCount1" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long"> | |||||
| <select id="findGrowUserCount1" resultType="java.lang.Long"> | |||||
| SELECT count(distinct cubi.id) FROM wx_c_user_basic_info cubi | SELECT count(distinct cubi.id) FROM wx_c_user_basic_info cubi | ||||
| left join wx_c_user cu on cubi.id=cu.user_id | left join wx_c_user cu on cubi.id=cu.user_id | ||||
| where cu.id is not null | where cu.id is not null | ||||
| @@ -251,7 +251,7 @@ | |||||
| </resultMap> | </resultMap> | ||||
| <select id="findByToken" resultMap="BaseCUserResultMap"> | <select id="findByToken" resultMap="BaseCUserResultMap"> | ||||
| select * from wx_c_user | |||||
| select id,user_id,tenant_id,parent_tenant_id,token,expire_time from wx_c_user | |||||
| where `token` = #{token} | where `token` = #{token} | ||||
| </select> | </select> | ||||