Merge pull request '修正租户id为Long问题' (#3) from school into master

Reviewed-on: #3
master
董哲奇 6 days ago
commit 7de4b04ccf

@ -86,6 +86,7 @@ public class BusinessScCourseTypeService {
public APIResponse addScCourseType(ScCourseType scCourseType) { public APIResponse addScCourseType(ScCourseType scCourseType) {
LoginUser loginUser = SecurityUtils.getLoginUser(); LoginUser loginUser = SecurityUtils.getLoginUser();
scCourseType.setCreateUser(loginUser.getUserId()); scCourseType.setCreateUser(loginUser.getUserId());
scCourseType.setTenantId(loginUser.getNowTenantId());
boolean addScCourseType = scCourseTypeService.save(scCourseType); boolean addScCourseType = scCourseTypeService.save(scCourseType);
if (addScCourseType) { if (addScCourseType) {
return APIResponse.toOkResponse(); return APIResponse.toOkResponse();

@ -25,12 +25,12 @@ public class ScCommissionPlansController {
@PostMapping("list") @PostMapping("list")
public AjaxResult list(@RequestBody Map<String,Object> params){ public AjaxResult list(@RequestBody Map<String,Object> params){
RespPage<ScCommissionPlans> page = new RespPage<>((Integer) params.get("pageNum"), (Integer) params.get("pageSize")); RespPage<ScCommissionPlans> page = new RespPage<>((Integer) params.get("pageNum"), (Integer) params.get("pageSize"));
service.page(page, Wrappers.<ScCommissionPlans>lambdaQuery() RespPage<ScCommissionPlans> page1 = service.page(page, Wrappers.<ScCommissionPlans>lambdaQuery()
.eq(StrUtil.isNotEmpty((CharSequence) params.get("planName")), .eq(StrUtil.isNotEmpty((CharSequence) params.get("planName")),
ScCommissionPlans::getPlanName, params.get("planName")) ScCommissionPlans::getPlanName, params.get("planName"))
.eq(ObjectUtil.isNotEmpty(params.get("isActive")), ScCommissionPlans::getIsActive, params.get("isActive")) .eq(ObjectUtil.isNotEmpty(params.get("isActive")), ScCommissionPlans::getIsActive, params.get("isActive"))
); );
return AjaxResult.success(); return AjaxResult.success(page1);
} }
@PostMapping("saveOrEdit") @PostMapping("saveOrEdit")

@ -0,0 +1,30 @@
package cn.xluobo.business.sc.salary.repo.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
/**
*
*/
@Getter
@Setter
@TableName("sc_commission_info")
public class CommissionInfo {
@TableId(type = IdType.AUTO)
private Integer id;
private Integer tenantId;
private Long schoolId;
private String schoolName;
private Integer courseId;
private Integer courseName;
}

@ -14,7 +14,7 @@ public class ReqUpdateUserRole implements Serializable {
private Long userId; private Long userId;
private Long tenantId; private String tenantId;
/** /**
* Id * Id

@ -30,6 +30,6 @@ public class SysUserDept {
* *
*/ */
@TableField("tenant_id") @TableField("tenant_id")
private Long tenantId; private String tenantId;
} }

@ -19,5 +19,5 @@ public class SysUserTenant implements Serializable {
private Long userId; private Long userId;
@TableField("tenant_id") @TableField("tenant_id")
private Long tenantId; private String tenantId;
} }

@ -16,7 +16,7 @@ import java.util.List;
*/ */
public interface ISysRoleMapper extends BaseMapper<SysRole> { public interface ISysRoleMapper extends BaseMapper<SysRole> {
List<SysRole> selectUserRoleList(@Param("userId")Long userId, @Param("tenantId")Long tenantId); List<SysRole> selectUserRoleList(@Param("userId")Long userId, @Param("tenantId")String tenantId);
/** /**
* Id * Id
@ -25,5 +25,5 @@ public interface ISysRoleMapper extends BaseMapper<SysRole> {
* @param tenantId * @param tenantId
* @return * @return
*/ */
List<String> selectUserRoleTreeIdList(@Param("userId")Long userId, @Param("tenantId")Long tenantId); List<String> selectUserRoleTreeIdList(@Param("userId")Long userId, @Param("tenantId")String tenantId);
} }

@ -24,6 +24,6 @@ public interface ISysRoleMenuService extends IService<SysRoleMenu> {
* @return * @return
*/ */
@CacheEvict(value = "USER_PERMISSION_META", allEntries = true) @CacheEvict(value = "USER_PERMISSION_META", allEntries = true)
void updateRoleMenu(SysRole sysRole, Long nowTenantId); void updateRoleMenu(SysRole sysRole, String nowTenantId);
} }

@ -15,7 +15,7 @@ import java.util.List;
*/ */
public interface ISysRoleService extends IService<SysRole> { public interface ISysRoleService extends IService<SysRole> {
List<SysRole> selectUserRoleList(Long userId, Long tenantId); List<SysRole> selectUserRoleList(Long userId, String tenantId);
/** /**
* *
@ -43,7 +43,7 @@ public interface ISysRoleService extends IService<SysRole> {
* @param tenantId * @param tenantId
* @return * @return
*/ */
List<String> selectUserRoleTreeIdList(Long userId, Long tenantId); List<String> selectUserRoleTreeIdList(Long userId, String tenantId);
/** /**
* *

@ -23,7 +23,7 @@ import java.util.List;
public class ISysRoleMenuServiceImpl extends ServiceImpl<ISysRoleMenuMapper, SysRoleMenu> implements ISysRoleMenuService { public class ISysRoleMenuServiceImpl extends ServiceImpl<ISysRoleMenuMapper, SysRoleMenu> implements ISysRoleMenuService {
@Override @Override
public void updateRoleMenu(SysRole sysRole, Long nowTenantId) { public void updateRoleMenu(SysRole sysRole, String nowTenantId) {
//角色菜单关系 //角色菜单关系
UpdateWrapper uw = new UpdateWrapper<>(); UpdateWrapper uw = new UpdateWrapper<>();
uw.eq("role_id",sysRole.getRoleId()); uw.eq("role_id",sysRole.getRoleId());

@ -21,7 +21,7 @@ import java.util.List;
public class ISysRoleServiceImpl extends ServiceImpl<ISysRoleMapper, SysRole> implements ISysRoleService { public class ISysRoleServiceImpl extends ServiceImpl<ISysRoleMapper, SysRole> implements ISysRoleService {
@Override @Override
public List<SysRole> selectUserRoleList(Long userId, Long tenantId) { public List<SysRole> selectUserRoleList(Long userId, String tenantId) {
return baseMapper.selectUserRoleList(userId, tenantId); return baseMapper.selectUserRoleList(userId, tenantId);
} }
@ -62,7 +62,7 @@ public class ISysRoleServiceImpl extends ServiceImpl<ISysRoleMapper, SysRole> im
} }
@Override @Override
public List<String> selectUserRoleTreeIdList(Long userId, Long tenantId) { public List<String> selectUserRoleTreeIdList(Long userId, String tenantId) {
return baseMapper.selectUserRoleTreeIdList(userId, tenantId); return baseMapper.selectUserRoleTreeIdList(userId, tenantId);
} }

@ -20,6 +20,6 @@ public interface ISysTagService extends com.baomidou.mybatisplus.extension.servi
* @param tenantId * @param tenantId
* @param userId * @param userId
*/ */
void autoCreateTag(String[] tags, String tagType, Long tenantId, Long userId); void autoCreateTag(String[] tags, String tagType, String tenantId, Long userId);
} }

@ -19,7 +19,7 @@ import org.springframework.stereotype.Service;
public class SysTagServiceImpl extends ServiceImpl<SysTagMapper, SysTag> implements ISysTagService { public class SysTagServiceImpl extends ServiceImpl<SysTagMapper, SysTag> implements ISysTagService {
@Override @Override
public void autoCreateTag(String[] tags, String tagType, Long tenantId, Long userId) { public void autoCreateTag(String[] tags, String tagType, String tenantId, Long userId) {
for (String tag : tags) { for (String tag : tags) {
QueryWrapper qw = new QueryWrapper(); QueryWrapper qw = new QueryWrapper();
qw.eq("tenant_id", tenantId); qw.eq("tenant_id", tenantId);

@ -33,7 +33,7 @@ public class WechatCpAccount implements Serializable {
* *
*/ */
@TableField("tenant_id") @TableField("tenant_id")
private Long tenantId; private String tenantId;
/** /**
* *

@ -66,7 +66,7 @@ public class WechatCpSyncService {
* *
*/ */
@Async @Async
public void syncSelfWechatCpContact(Long tenantId) { public void syncSelfWechatCpContact(String tenantId) {
try { try {
TenantContextHolder.setTenant(tenantId); TenantContextHolder.setTenant(tenantId);
@ -95,7 +95,7 @@ public class WechatCpSyncService {
* *
*/ */
@Async @Async
public void syncSelfWechatCpTag(Long tenantId) { public void syncSelfWechatCpTag(String tenantId) {
try { try {
TenantContextHolder.setTenant(tenantId); TenantContextHolder.setTenant(tenantId);
@ -135,7 +135,7 @@ public class WechatCpSyncService {
* @param tenantId * @param tenantId
*/ */
@Async @Async
public void syncSelfWechatCpUser(Long tenantId) { public void syncSelfWechatCpUser(String tenantId) {
try { try {
TenantContextHolder.setTenant(tenantId); TenantContextHolder.setTenant(tenantId);

@ -8,7 +8,7 @@ import org.apache.commons.lang3.StringUtils;
* *
*/ */
public class TenantContextHolder { public class TenantContextHolder {
private static ThreadLocal<Long> tenantThreadLocal = new ThreadLocal<>(); private static ThreadLocal<String> tenantThreadLocal = new ThreadLocal<>();
/** /**
* remove() * remove()
@ -16,12 +16,12 @@ public class TenantContextHolder {
* remove() , getTenant()tenantThreadLocal(线) * remove() , getTenant()tenantThreadLocal(线)
* @param scheme * @param scheme
*/ */
public static final void setTenant(Long scheme) { public static final void setTenant(String scheme) {
tenantThreadLocal.set(scheme); tenantThreadLocal.set(scheme);
} }
public static final Long getTenant() { public static final String getTenant() {
Long tenantId = tenantThreadLocal.get(); String tenantId = tenantThreadLocal.get();
if (ObjectUtil.isEmpty(tenantId)) { if (ObjectUtil.isEmpty(tenantId)) {
return SecurityUtils.getLoginUser().getNowTenantId(); return SecurityUtils.getLoginUser().getNowTenantId();
} }

@ -66,7 +66,7 @@ public class LoginUser implements UserDetails
@Getter @Getter
@Setter @Setter
private Long nowTenantId; private String nowTenantId;
/** /**
* *

Loading…
Cancel
Save