| @@ -285,30 +285,34 @@ public class WxProjectConfigController extends BaseController { | |||||
| wxAppinfoService.saveOrUpdate(wxAppinfo); | wxAppinfoService.saveOrUpdate(wxAppinfo); | ||||
| WxAuthorizerInfo wxAuthorizerInfo = new WxAuthorizerInfo(); | |||||
| WxAuthorizerInfo wxAuthorizerInfo = wxAuthorizerInfoService.getByAppId(wxAppinfo.getAppId()); | |||||
| if(wxAuthorizerInfo == null){ | |||||
| wxAuthorizerInfo = new WxAuthorizerInfo(); | |||||
| } | |||||
| wxAuthorizerInfo.updateTenantInfo(wxAppinfo); | wxAuthorizerInfo.updateTenantInfo(wxAppinfo); | ||||
| wxAuthorizerInfo.setType(wxAppinfo.getType()); | wxAuthorizerInfo.setType(wxAppinfo.getType()); | ||||
| wxAuthorizerInfo.setAuthorizerAppid(wxAppinfo.getAppId()); | wxAuthorizerInfo.setAuthorizerAppid(wxAppinfo.getAppId()); | ||||
| if(wxAppinfo.getId() == null && wxAuthorizerInfo.getAuthorizationStatus() == null){ | |||||
| if(wxAuthorizerInfo.getAuthorizationStatus() == null){ | |||||
| wxAuthorizerInfo.setAuthorizationStatus(0);//授权状态,0为已授权,1为已取消授权 | wxAuthorizerInfo.setAuthorizationStatus(0);//授权状态,0为已授权,1为已取消授权 | ||||
| wxAuthorizerInfo.setAuthTime(new Date()); | wxAuthorizerInfo.setAuthTime(new Date()); | ||||
| } | } | ||||
| if(wxAppinfo.getId() == null && wxAuthorizerInfo.getBaseStatus() == null){ | |||||
| if(wxAuthorizerInfo.getBaseStatus() == null){ | |||||
| wxAuthorizerInfo.setBaseStatus(0);//微信基础版本设置状态,0为已设置,1为设置失败 | wxAuthorizerInfo.setBaseStatus(0);//微信基础版本设置状态,0为已设置,1为设置失败 | ||||
| wxAuthorizerInfo.setBaseTime(new Date()); | wxAuthorizerInfo.setBaseTime(new Date()); | ||||
| } | } | ||||
| if(wxAppinfo.getId() == null && wxAuthorizerInfo.getDomainStatus() == null){ | |||||
| if(wxAuthorizerInfo.getDomainStatus() == null){ | |||||
| wxAuthorizerInfo.setDomainStatus(0);//服务器域名设置状态,0为已设置,1为设置失败 | wxAuthorizerInfo.setDomainStatus(0);//服务器域名设置状态,0为已设置,1为设置失败 | ||||
| wxAuthorizerInfo.setDomainTime(new Date()); | wxAuthorizerInfo.setDomainTime(new Date()); | ||||
| } | } | ||||
| if(wxAppinfo.getId() == null && wxAuthorizerInfo.getWebdomainStatus() == null){ | |||||
| if(wxAuthorizerInfo.getWebdomainStatus() == null){ | |||||
| wxAuthorizerInfo.setWebdomainStatus(0);//服务器业务域名设置状态,0为已设置,1为设置失败 | wxAuthorizerInfo.setWebdomainStatus(0);//服务器业务域名设置状态,0为已设置,1为设置失败 | ||||
| wxAuthorizerInfo.setWebdomainTime(new Date()); | wxAuthorizerInfo.setWebdomainTime(new Date()); | ||||
| } | } | ||||
| if(wxAppinfo.getId() == null && StringUtils.isBlank(wxAuthorizerInfo.getRefreshToken())){ | |||||
| if(StringUtils.isBlank(wxAuthorizerInfo.getRefreshToken())){ | |||||
| wxAuthorizerInfo.setRefreshToken(""); | wxAuthorizerInfo.setRefreshToken(""); | ||||
| } | } | ||||
| if(wxAppinfo.getId() == null && StringUtils.isBlank(wxAuthorizerInfo.getAccessToken())){ | |||||
| if(StringUtils.isBlank(wxAuthorizerInfo.getAccessToken())){ | |||||
| wxAuthorizerInfo.setAccessToken(""); | wxAuthorizerInfo.setAccessToken(""); | ||||
| } | } | ||||
| wxAuthorizerInfoService.saveOrUpdate(wxAuthorizerInfo); | wxAuthorizerInfoService.saveOrUpdate(wxAuthorizerInfo); | ||||
| @@ -24,6 +24,12 @@ update wx_c_user_basic_info set tenant_id = concat(",",final_tenant_id,","); | |||||
| ALTER TABLE `wx_c_user` | |||||
| MODIFY COLUMN `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '租户ID' AFTER `id`, | |||||
| MODIFY COLUMN `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID' AFTER `tenant_id`, | |||||
| MODIFY COLUMN `open_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '微信openId' AFTER `parent_tenant_id`, | |||||
| MODIFY COLUMN `union_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '微信unionId' AFTER `open_id`, | |||||
| MODIFY COLUMN `user_id` bigint(20) DEFAULT NULL COMMENT '用户ID' AFTER `active_time`; | |||||
| @@ -87,6 +87,7 @@ public class WxMsgValidationcodeController extends BaseController { | |||||
| user.setVerifyCodePhone(phone); | user.setVerifyCodePhone(phone); | ||||
| user.setUpdateDate(new Date()); | user.setUpdateDate(new Date()); | ||||
| wxCUserService.saveOrUpdate(user); | wxCUserService.saveOrUpdate(user); | ||||
| wxCUserService.delForUserIdOnly(user.getId(),user.getUserId(),user.getTenantId()); | |||||
| // wxCUserService.assureUserIdOnly(user.getId(),); | // wxCUserService.assureUserIdOnly(user.getId(),); | ||||
| wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_PHONE,user); | wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_PHONE,user); | ||||
| @@ -681,6 +681,7 @@ public class WxUserGrantController extends BaseController { | |||||
| user.setUserId(userBasicId); | user.setUserId(userBasicId); | ||||
| } | } | ||||
| wxCUserService.saveOrUpdate(user); | wxCUserService.saveOrUpdate(user); | ||||
| wxCUserService.delForUserIdOnly(user.getId(),user.getUserId(),user.getTenantId()); | |||||
| wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_PHONE, user); | wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_PHONE, user); | ||||
| } | } | ||||
| @@ -72,6 +72,9 @@ public class WxCouponChannelVo extends WxCouponChannel implements Serializable { | |||||
| @io.swagger.annotations.ApiModelProperty(value="内容类型(0:小程序页面类型,1:富文本类型)",name="contentType") | @io.swagger.annotations.ApiModelProperty(value="内容类型(0:小程序页面类型,1:富文本类型)",name="contentType") | ||||
| private Integer contentType; | private Integer contentType; | ||||
| @TableField(exist = false) | |||||
| private String detail; | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private String salePriceStr; | private String salePriceStr; | ||||
| @@ -8,6 +8,7 @@ import com.iformall.domain.dto.WxCUserBasicInfoDto; | |||||
| import com.iformall.domain.po.WxCUser; | import com.iformall.domain.po.WxCUser; | ||||
| import com.iformall.domain.po.base.BaseCUserEntity; | import com.iformall.domain.po.base.BaseCUserEntity; | ||||
| import com.iformall.domain.vo.UserCountVo; | import com.iformall.domain.vo.UserCountVo; | ||||
| import org.apache.ibatis.annotations.Param; | |||||
| public interface WxCUserMapper extends CommonMapper<WxCUser, Long> { | public interface WxCUserMapper extends CommonMapper<WxCUser, Long> { | ||||
| @@ -30,4 +31,6 @@ public interface WxCUserMapper extends CommonMapper<WxCUser, Long> { | |||||
| List<Map<String, Object>> checkCountByTenantOpenId(); | List<Map<String, Object>> checkCountByTenantOpenId(); | ||||
| void updateUserId(WxCUser user); | void updateUserId(WxCUser user); | ||||
| void delForUserIdOnly(@Param("id")Long id, @Param("userId")Long userId,@Param("tenantId")String tenantId); | |||||
| } | } | ||||
| @@ -139,4 +139,6 @@ public interface WxCUserService { | |||||
| int addCredit(WxCUser wxCUser, EnumScoreType enumScoreType); | int addCredit(WxCUser wxCUser, EnumScoreType enumScoreType); | ||||
| void updateUserId(WxCUser user); | void updateUserId(WxCUser user); | ||||
| void delForUserIdOnly(Long id, Long userId, String tenantId); | |||||
| } | } | ||||
| @@ -344,5 +344,10 @@ public class WxCUserServiceImpl implements WxCUserService { | |||||
| wxCUserMapper.updateUserId(user); | wxCUserMapper.updateUserId(user); | ||||
| } | } | ||||
| @Override | |||||
| public void delForUserIdOnly(Long id, Long userId, String tenantId) { | |||||
| wxCUserMapper.delForUserIdOnly(id,userId,tenantId); | |||||
| } | |||||
| } | } | ||||
| @@ -1001,7 +1001,7 @@ | |||||
| 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 | ||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and cubi.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%') | |||||
| and cubi.`tenant_id` like concat('%,', #{tenantId},',%') | |||||
| </if> | </if> | ||||
| </select> | </select> | ||||
| @@ -370,4 +370,13 @@ | |||||
| where id = #{id} | where id = #{id} | ||||
| </update> | </update> | ||||
| <update id="delForUserIdOnly"> | |||||
| update wx_c_user set update_date=now(), | |||||
| tenant_id = IF(tenant_id is null ,null,CONCAT(tenant_id,"_del")), | |||||
| parent_tenant_id = IF(parent_tenant_id is null ,null,CONCAT(parent_tenant_id,"_del")), | |||||
| open_id = IF(open_id is null ,null,CONCAT(open_id,"_del")), | |||||
| union_id = IF(union_id is null ,null,CONCAT(union_id,"_del")) | |||||
| where user_id = #{userId} and tenant_id = #{tenantId} and id != #{id} | |||||
| </update> | |||||
| </mapper> | </mapper> | ||||
| @@ -152,7 +152,7 @@ | |||||
| <sql id="CouponChannelVoColumns"> | <sql id="CouponChannelVoColumns"> | ||||
| <include refid="allColumns" />, | <include refid="allColumns" />, | ||||
| c.remain_inventory,c.inventory,c.cover_img,c.sub_title,c.sale_price, | |||||
| c.remain_inventory,c.inventory,c.cover_img,c.sub_title,c.sale_price,c.detail, | |||||
| c.use_price,c.price,c.unit,c.use_limit_quantity,c.send_type,c.support_transfer,c.press_limit_num,c.auto_refund,c.conditions, | c.use_price,c.price,c.unit,c.use_limit_quantity,c.send_type,c.support_transfer,c.press_limit_num,c.auto_refund,c.conditions, | ||||
| c.valid_type,c.valid_start_date,c.valid_end_date,c.valid_days,c.credit_price,c.content_type,c.source_type | c.valid_type,c.valid_start_date,c.valid_end_date,c.valid_days,c.credit_price,c.content_type,c.source_type | ||||
| </sql> | </sql> | ||||
| @@ -181,6 +181,7 @@ | |||||
| <result column="use_price" jdbcType="INTEGER" property="usePrice"/> | <result column="use_price" jdbcType="INTEGER" property="usePrice"/> | ||||
| <result column="price" jdbcType="INTEGER" property="price"/> | <result column="price" jdbcType="INTEGER" property="price"/> | ||||
| <result column="unit" jdbcType="INTEGER" property="unit"/> | <result column="unit" jdbcType="INTEGER" property="unit"/> | ||||
| <result column="detail" jdbcType="VARCHAR" property="detail"/> | |||||
| <result column="use_limit_quantity" jdbcType="INTEGER" property="useLimitQuantity"/> | <result column="use_limit_quantity" jdbcType="INTEGER" property="useLimitQuantity"/> | ||||
| <result column="send_type" jdbcType="INTEGER" property="sendType"/> | <result column="send_type" jdbcType="INTEGER" property="sendType"/> | ||||
| <result column="support_transfer" jdbcType="INTEGER" property="supportTransfer"/> | <result column="support_transfer" jdbcType="INTEGER" property="supportTransfer"/> | ||||