| @@ -104,7 +104,7 @@ public class WxCUserBasicInfoController extends BaseController { | |||||
| private void setUserInfoTag(WxCUserBasicInfo info) { | private void setUserInfoTag(WxCUserBasicInfo info) { | ||||
| if (info.getTagId() != null) { | if (info.getTagId() != null) { | ||||
| WxCUserTags uTag = wxCUserTagsService.getById(info.getTagId()); | |||||
| WxCUserTags uTag = wxCUserTagsService.getById(info.getTagId(),info.getFinalTenantId()); | |||||
| if (uTag != null && StringUtils.isNotBlank(uTag.getTags())) { | if (uTag != null && StringUtils.isNotBlank(uTag.getTags())) { | ||||
| List<Long> ids = JSONObject.parseArray(uTag.getTags(), Long.class); | List<Long> ids = JSONObject.parseArray(uTag.getTags(), Long.class); | ||||
| info.setTagsList(wxCUserTagsService.findTagList(ifParentUpdateTenantInfo(), ids)); | info.setTagsList(wxCUserTagsService.findTagList(ifParentUpdateTenantInfo(), ids)); | ||||
| @@ -62,7 +62,7 @@ public class WxCUserTagsController extends BaseController { | |||||
| @SystemControllerLog(description = "会员首页-标签-删除") | @SystemControllerLog(description = "会员首页-标签-删除") | ||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| logger.debug("[" + getIpAddr() + "] WxCUserTagsController::delete"); | logger.debug("[" + getIpAddr() + "] WxCUserTagsController::delete"); | ||||
| wxCUserTagsService.deleteById(id); | |||||
| wxCUserTagsService.deleteById(id,getTenantInfo().getFinalTenantId()); | |||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @@ -72,7 +72,7 @@ public class WxCUserTagsController extends BaseController { | |||||
| @SystemControllerLog(description = "会员首页-标签-查询") | @SystemControllerLog(description = "会员首页-标签-查询") | ||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| logger.debug("[" + getIpAddr() + "] WxCUserTagsController::findById"); | logger.debug("[" + getIpAddr() + "] WxCUserTagsController::findById"); | ||||
| return new ResultData(Result.SUCCESS, "查询成功", wxCUserTagsService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxCUserTagsService.getById(id,getTenantInfo().getFinalTenantId())); | |||||
| } | } | ||||
| @@ -35,9 +35,6 @@ public class TenantEntity extends BaseEntity { | |||||
| } | } | ||||
| } | } | ||||
| @TableField(exist = false) | |||||
| protected String finalTenantId; | |||||
| public String getFinalTenantId() { | public String getFinalTenantId() { | ||||
| if (!StringUtils.isBlank(parentTenantId)) { | if (!StringUtils.isBlank(parentTenantId)) { | ||||
| return parentTenantId; | return parentTenantId; | ||||
| @@ -11,10 +11,14 @@ import org.apache.ibatis.annotations.Param; | |||||
| public interface WxCUserTagsMapper extends CommonMapper<WxCUserTags, String> { | public interface WxCUserTagsMapper extends CommonMapper<WxCUserTags, String> { | ||||
| WxCUserTags selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | |||||
| List<WxCUserTags> findList(WxCUserTags wxCUserTags); | List<WxCUserTags> findList(WxCUserTags wxCUserTags); | ||||
| long countUser(@Param("tagIds")String tagIds,@Param("tenantId")String tenantId, | long countUser(@Param("tagIds")String tagIds,@Param("tenantId")String tenantId, | ||||
| @Param("startTime")Date startTime,@Param("endTime")Date endTime); | @Param("startTime")Date startTime,@Param("endTime")Date endTime); | ||||
| void updateNewId(CUserTagNewIdVo record); | void updateNewId(CUserTagNewIdVo record); | ||||
| int deleteById(@Param("id")Long id,@Param("tenantId")String tenantId); | |||||
| } | } | ||||
| @@ -26,7 +26,7 @@ public interface WxCUserTagsService { | |||||
| * @param id | * @param id | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| WxCUserTags getById(Long id); | |||||
| WxCUserTags getById(Long id,String tenantId); | |||||
| /** | /** | ||||
| * 保存或更新实体 | * 保存或更新实体 | ||||
| @@ -40,14 +40,14 @@ public interface WxCUserTagsService { | |||||
| * | * | ||||
| * @param id | * @param id | ||||
| */ | */ | ||||
| void deleteById(Long id); | |||||
| void deleteById(Long id,String tenantId); | |||||
| long countUser(TenantEntity tenantEntity, Long tagId, Date startTime, Date endTime ); | long countUser(TenantEntity tenantEntity, Long tagId, Date startTime, Date endTime ); | ||||
| List<WxTags> findTagList(TenantEntity tenantEntity, List<Long> tagIds); | List<WxTags> findTagList(TenantEntity tenantEntity, List<Long> tagIds); | ||||
| List<WxTags> assignTags(List<Long> tagIdList, WxCUserBasicInfo user); | |||||
| List<WxTags> assignTags(List<Long> tagIdList,WxCUserBasicInfo user); | |||||
| List<WxTags> triggerAssignTags(EnumAssignTagsTrigger trigger, Object obj); | List<WxTags> triggerAssignTags(EnumAssignTagsTrigger trigger, Object obj); | ||||
| void updateTagByUserId(Long cUserId,TenantEntity tenantinfo, List<Long> tags); | void updateTagByUserId(Long cUserId,TenantEntity tenantinfo, List<Long> tags); | ||||
| @@ -63,8 +63,8 @@ public class WxCUserTagsServiceImpl implements WxCUserTagsService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public WxCUserTags getById(Long id) { | |||||
| return wxCUserTagsMapper.selectById(id); | |||||
| public WxCUserTags getById(Long id,String tenantId) { | |||||
| return wxCUserTagsMapper.selectById(id,tenantId); | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -82,8 +82,8 @@ public class WxCUserTagsServiceImpl implements WxCUserTagsService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public void deleteById(Long id) { | |||||
| wxCUserTagsMapper.deleteById(id); | |||||
| public void deleteById(Long id,String tenantId) { | |||||
| wxCUserTagsMapper.deleteById(id,tenantId); | |||||
| } | } | ||||
| @@ -761,7 +761,7 @@ public class WxCUserTagsServiceImpl implements WxCUserTagsService { | |||||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(cUserId,tenantinfo.getFinalTenantId()); | WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(cUserId,tenantinfo.getFinalTenantId()); | ||||
| WxCUserTags userTags = null; | WxCUserTags userTags = null; | ||||
| if (wxCUserBasicInfo.getTagId() != null) { | if (wxCUserBasicInfo.getTagId() != null) { | ||||
| userTags = getById(wxCUserBasicInfo.getTagId()); | |||||
| userTags = getById(wxCUserBasicInfo.getTagId(),wxCUserBasicInfo.getFinalTenantId()); | |||||
| } else { | } else { | ||||
| userTags = new WxCUserTags(); | userTags = new WxCUserTags(); | ||||
| userTags.setTags("[]"); | userTags.setTags("[]"); | ||||
| @@ -62,6 +62,14 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | <if test=" null != sortColumns">order by ${sortColumns}</if> | ||||
| </sql> | </sql> | ||||
| <select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap"> | |||||
| select <include refid="allColumns"/> from wx_c_user_tags where id = #{id} and tenant_id = #{tenantId} | |||||
| </select> | |||||
| <delete id="deleteById" parameterType="java.util.HashMap"> | |||||
| delete from wx_c_user_tags where id = #{id} and tenant_id = #{tenantId} | |||||
| </delete> | |||||
| <select id="findList" parameterType="com.iformall.domain.po.WxCUserTags" resultMap="BaseResultMap"> | <select id="findList" parameterType="com.iformall.domain.po.WxCUserTags" resultMap="BaseResultMap"> | ||||
| select | select | ||||