diff --git a/jshERP-boot/src/main/java/com/jsh/erp/config/TenantConfig.java b/jshERP-boot/src/main/java/com/jsh/erp/config/TenantConfig.java index 6db85afd..d9812cb4 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/config/TenantConfig.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/config/TenantConfig.java @@ -55,8 +55,8 @@ public class TenantConfig { if (tenantId!=0L) { // 这里可以判断是否过滤表 if ("jsh_material_property".equals(tableName) || "jsh_sequence".equals(tableName) - || "jsh_user_business".equals(tableName) || "jsh_function".equals(tableName) - || "jsh_platform_config".equals(tableName) || "jsh_tenant".equals(tableName)) { + || "jsh_function".equals(tableName) || "jsh_platform_config".equals(tableName) + || "jsh_tenant".equals(tableName)) { res = true; } else { res = false; @@ -85,6 +85,8 @@ public class TenantConfig { return true; } else if ("com.jsh.erp.datasource.mappers.LogMapperEx.insertLogWithUserId".equals(ms.getId())) { return true; + } else if ("com.jsh.erp.datasource.mappers.UserBusinessMapperEx.getBasicDataByKeyIdAndType".equals(ms.getId())) { + return true; } return false; } diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/UserBusinessController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/UserBusinessController.java index 45f301e2..4d043351 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/controller/UserBusinessController.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/UserBusinessController.java @@ -1,14 +1,10 @@ package com.jsh.erp.controller; import com.alibaba.fastjson.JSONObject; -import com.jsh.erp.constants.ExceptionConstants; import com.jsh.erp.datasource.entities.UserBusiness; -import com.jsh.erp.exception.BusinessRunTimeException; -import com.jsh.erp.service.user.UserService; import com.jsh.erp.service.userBusiness.UserBusinessService; import com.jsh.erp.utils.BaseResponseInfo; import com.jsh.erp.utils.ErpInfo; -import com.jsh.erp.utils.StringUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -34,8 +30,6 @@ public class UserBusinessController { @Resource private UserBusinessService userBusinessService; - @Resource - private UserService userService; /** * 获取信息 diff --git a/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/UserBusinessMapperEx.java b/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/UserBusinessMapperEx.java index d1396672..eb8c2b16 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/UserBusinessMapperEx.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/UserBusinessMapperEx.java @@ -1,8 +1,12 @@ package com.jsh.erp.datasource.mappers; +import com.jsh.erp.datasource.entities.UserBusiness; import org.apache.ibatis.annotations.Param; -import java.util.Date; /** +import java.util.Date; +import java.util.List; + +/** * Description * * @Author: qiankunpingtai @@ -12,4 +16,7 @@ public interface UserBusinessMapperEx { int batchDeleteUserBusinessByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); + List getBasicDataByKeyIdAndType( + @Param("keyId") String keyId, + @Param("type") String type); } diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/userBusiness/UserBusinessService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/userBusiness/UserBusinessService.java index 8b45cd9b..a23821ee 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/userBusiness/UserBusinessService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/userBusiness/UserBusinessService.java @@ -2,16 +2,14 @@ package com.jsh.erp.service.userBusiness; import com.alibaba.fastjson.JSONObject; import com.jsh.erp.constants.BusinessConstants; -import com.jsh.erp.datasource.entities.*; +import com.jsh.erp.datasource.entities.User; +import com.jsh.erp.datasource.entities.UserBusiness; +import com.jsh.erp.datasource.entities.UserBusinessExample; import com.jsh.erp.datasource.mappers.UserBusinessMapper; import com.jsh.erp.datasource.mappers.UserBusinessMapperEx; import com.jsh.erp.exception.JshException; -import com.jsh.erp.service.CommonQueryManager; -import com.jsh.erp.service.functions.FunctionService; import com.jsh.erp.service.log.LogService; import com.jsh.erp.service.user.UserService; -import com.jsh.erp.utils.StringUtil; -import com.jsh.erp.utils.Tools; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; @@ -21,7 +19,8 @@ import org.springframework.web.context.request.ServletRequestAttributes; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; -import java.util.*; +import java.util.Date; +import java.util.List; @Service public class UserBusinessService { @@ -36,12 +35,6 @@ public class UserBusinessService { @Resource private UserService userService; - @Resource - private FunctionService functionService; - - @Resource - private CommonQueryManager configResourceManager; - public UserBusiness getUserBusiness(long id)throws Exception { UserBusiness result=null; try{ @@ -69,14 +62,6 @@ public class UserBusinessService { UserBusiness userBusiness = JSONObject.parseObject(obj.toJSONString(), UserBusiness.class); int result=0; try{ - String token = ""; - if(request!=null) { - token = request.getHeader("X-Access-Token"); - Long tenantId = Tools.getTenantIdByToken(token); - if(tenantId!=0L) { - userBusiness.setTenantId(tenantId); - } - } String value = userBusiness.getValue(); String newValue = value.replaceAll(",","\\]\\["); newValue = newValue.replaceAll("\\[0\\]","").replaceAll("\\[\\]",""); @@ -139,23 +124,7 @@ public class UserBusinessService { public List getBasicData(String keyId, String type)throws Exception{ List list=null; try{ - UserBusinessExample example = new UserBusinessExample(); - example.createCriteria().andKeyIdEqualTo(keyId).andTypeEqualTo(type) - .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); - list= userBusinessMapper.selectByExample(example); - }catch(Exception e){ - JshException.readFail(logger, e); - } - return list; - } - - public List getListBy(String keyId, String type)throws Exception{ - List list=null; - try{ - UserBusinessExample example = new UserBusinessExample(); - example.createCriteria().andKeyIdEqualTo(keyId).andTypeEqualTo(type) - .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); - list= userBusinessMapper.selectByExample(example); + list= userBusinessMapperEx.getBasicDataByKeyIdAndType(keyId, type); }catch(Exception e){ JshException.readFail(logger, e); } diff --git a/jshERP-boot/src/main/resources/mapper_xml/UserBusinessMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/UserBusinessMapperEx.xml index 10752ecb..e5cd26ae 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/UserBusinessMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/UserBusinessMapperEx.xml @@ -12,4 +12,10 @@ ) + + \ No newline at end of file