New file |
| | |
| | | package com.consum.base.cache; |
| | | |
| | | import com.consum.base.Constants; |
| | | import com.consum.base.FinOrgCacheProvider; |
| | | import com.consum.base.service.FinOrgServiceImpl; |
| | | import com.consum.model.po.FinSysOrg; |
| | | import com.walker.cache.AbstractCacheProvider; |
| | | import com.walker.cache.Cache; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 本地运维机构缓存定义。 |
| | | * <p>注意:只有在测试开发中使用该对象,生产环境请配置为Redis方式。</p> |
| | | * @author 时克英 |
| | | * @date 2023-07-05 |
| | | */ |
| | | public class LocalFinOrgCache extends AbstractCacheProvider<FinSysOrg> implements FinOrgCacheProvider { |
| | | |
| | | @Override |
| | | public FinSysOrg get(String orgCode) { |
| | | return this.getCacheData(orgCode); |
| | | } |
| | | |
| | | @Override |
| | | public void save(FinSysOrg e) { |
| | | this.putCacheData(e.getOrgCode(), e); |
| | | } |
| | | |
| | | @Override |
| | | public void update(FinSysOrg e) { |
| | | this.updateCacheData(e.getOrgCode(), e); |
| | | } |
| | | |
| | | @Override |
| | | public void remove(String orgCode) { |
| | | this.removeCacheData(orgCode); |
| | | } |
| | | |
| | | @Override |
| | | protected int loadDataToCache(Cache cache) { |
| | | List<FinSysOrg> hosts = this.finOrgService.selectAll(new FinSysOrg()); |
| | | if(!StringUtils.isEmptyList(hosts)){ |
| | | for(FinSysOrg h : hosts){ |
| | | cache.put(h.getOrgCode(), h); |
| | | } |
| | | return hosts.size(); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public String getProviderName() { |
| | | return Constants.CACHE_NAME_FIN_ORG; |
| | | } |
| | | |
| | | @Override |
| | | public Class<?> getProviderType() { |
| | | return FinSysOrg.class; |
| | | } |
| | | |
| | | public void setFinOrgService(FinOrgServiceImpl finOrgService) { |
| | | this.finOrgService = finOrgService; |
| | | } |
| | | |
| | | private FinOrgServiceImpl finOrgService; |
| | | } |
New file |
| | |
| | | package com.consum.base.cache; |
| | | |
| | | import com.consum.base.Constants; |
| | | import com.consum.base.FinSysTenantCacheProvider; |
| | | import com.consum.base.service.FinSysTenantServiceImpl; |
| | | import com.consum.model.po.FinSysTenant; |
| | | import com.walker.cache.AbstractCacheProvider; |
| | | import com.walker.cache.Cache; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 区划缓存 |
| | | * @作者:power |
| | | * @时间:2023/7/20 20:25 |
| | | */ |
| | | public class LocalFinSysTenantCache extends AbstractCacheProvider<FinSysTenant> implements FinSysTenantCacheProvider { |
| | | @Override |
| | | public FinSysTenant get(String code) { |
| | | return this.getCacheData(code); |
| | | } |
| | | |
| | | @Override |
| | | public void save(FinSysTenant e) { |
| | | this.putCacheData(e.getCode(), e); |
| | | } |
| | | |
| | | @Override |
| | | public void update(FinSysTenant e) { |
| | | this.updateCacheData(e.getCode(), e); |
| | | } |
| | | |
| | | @Override |
| | | public void remove(String code) { |
| | | this.removeCacheData(code); |
| | | } |
| | | |
| | | @Override |
| | | public FinSysTenant getById(String id) { |
| | | throw new UnsupportedOperationException("本地缓存方法暂时无需实现!"); |
| | | } |
| | | |
| | | @Override |
| | | public List<FinSysTenant> selectAll() { |
| | | return this.finSysTenantService.selectAll(new FinSysTenant()); |
| | | } |
| | | |
| | | @Override |
| | | protected int loadDataToCache(Cache cache) { |
| | | List<FinSysTenant> hosts = this.finSysTenantService.selectAll(new FinSysTenant()); |
| | | if(!StringUtils.isEmptyList(hosts)){ |
| | | for(FinSysTenant h : hosts){ |
| | | cache.put(h.getCode(), h); |
| | | } |
| | | return hosts.size(); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public String getProviderName() { |
| | | return Constants.CACHE_NAME_FIN_TENANT; |
| | | } |
| | | |
| | | @Override |
| | | public Class<?> getProviderType() { |
| | | return FinSysTenant.class; |
| | | } |
| | | |
| | | public void setFinSysTenantService(FinSysTenantServiceImpl finSysTenantService) { |
| | | this.finSysTenantService = finSysTenantService; |
| | | } |
| | | |
| | | private FinSysTenantServiceImpl finSysTenantService; |
| | | } |
New file |
| | |
| | | package com.consum.base.cache; |
| | | |
| | | import com.consum.base.Constants; |
| | | import com.consum.base.FinSysTenantUserCacheProvider; |
| | | import com.consum.base.service.FinSysTenantUserServiceImpl; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.walker.cache.AbstractCacheProvider; |
| | | import com.walker.cache.Cache; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | |
| | | import java.util.List; |
| | | |
| | | public class LocalFinSysTenantUserCache extends AbstractCacheProvider<FinSysTenantUser> implements FinSysTenantUserCacheProvider { |
| | | |
| | | @Override |
| | | public FinSysTenantUser get(String userId) { |
| | | return this.getCacheData(userId); |
| | | } |
| | | |
| | | @Override |
| | | public void save(FinSysTenantUser e) { |
| | | this.putCacheData(String.valueOf(e.getSysUserId()), e); |
| | | } |
| | | |
| | | @Override |
| | | public void update(FinSysTenantUser e) { |
| | | this.updateCacheData(String.valueOf(e.getSysUserId()), e); |
| | | } |
| | | |
| | | @Override |
| | | public void remove(String userId) { |
| | | this.removeCacheData(userId); |
| | | } |
| | | |
| | | @Override |
| | | public FinSysTenantUser getByUserId(String userId) { |
| | | return this.getCacheData(userId); |
| | | } |
| | | |
| | | @Override |
| | | protected int loadDataToCache(Cache cache) { |
| | | List<FinSysTenantUser> hosts = this.finSysTenantUserService.selectAll(new FinSysTenantUser()); |
| | | if(!StringUtils.isEmptyList(hosts)){ |
| | | for(FinSysTenantUser h : hosts){ |
| | | cache.put(String.valueOf(h.getSysUserId()), h); |
| | | } |
| | | return hosts.size(); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public String getProviderName() { |
| | | return Constants.CACHE_NAME_FIN_TENANT_USER; |
| | | } |
| | | |
| | | @Override |
| | | public Class<?> getProviderType() { |
| | | return FinSysTenantUser.class; |
| | | } |
| | | |
| | | public void setFinSysTenantUserService(FinSysTenantUserServiceImpl finSysTenantUserService) { |
| | | this.finSysTenantUserService = finSysTenantUserService; |
| | | } |
| | | |
| | | private FinSysTenantUserServiceImpl finSysTenantUserService; |
| | | } |
New file |
| | |
| | | package com.consum.base.cache; |
| | | |
| | | import com.consum.base.Constants; |
| | | import com.consum.base.TokenCacheProvider; |
| | | import com.consum.base.pojo.TokenVo; |
| | | import com.walker.cache.AbstractCacheProvider; |
| | | import com.walker.cache.Cache; |
| | | |
| | | public class LocalTokenCache extends AbstractCacheProvider<TokenVo> implements TokenCacheProvider { |
| | | |
| | | @Override |
| | | public TokenVo get(String userCode) { |
| | | return this.getCacheData(userCode); |
| | | } |
| | | |
| | | @Override |
| | | public void save(TokenVo e) { |
| | | this.putCacheData(e.getToken(), e); |
| | | } |
| | | |
| | | @Override |
| | | public void update(TokenVo e) { |
| | | this.updateCacheData(e.getToken().toString(), e); |
| | | } |
| | | |
| | | @Override |
| | | public void remove(String userCode) { |
| | | this.removeCacheData(userCode); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | protected int loadDataToCache(Cache cache) { |
| | | //List<FinSysUser> hosts = this.finUserService.selectAll(new FinSysUser()); |
| | | //if(!StringUtils.isEmptyList(hosts)){ |
| | | // for(FinSysUser h : hosts){ |
| | | // cache.put(h.getOriginCode(), h); |
| | | // } |
| | | // return hosts.size(); |
| | | //} |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public String getProviderName() { |
| | | return Constants.CACHE_NAME_FIN_USER; |
| | | } |
| | | |
| | | @Override |
| | | public Class<?> getProviderType() { |
| | | return TokenVo.class; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.consum.base.cache; |
| | | |
| | | import com.consum.base.Constants; |
| | | import com.consum.base.FinOrgCacheProvider; |
| | | import com.consum.base.service.FinOrgServiceImpl; |
| | | import com.consum.model.po.FinSysOrg; |
| | | import com.walker.support.redis.cache.RedisCacheProvider; |
| | | |
| | | /** |
| | | * Redis实现的运维系统机构定义。 |
| | | * @author 时克英 |
| | | * @date 2023-07-05 |
| | | */ |
| | | public class RedisFinOrgCache extends RedisCacheProvider<FinSysOrg> implements FinOrgCacheProvider { |
| | | |
| | | public RedisFinOrgCache(){ |
| | | this.setUseRedis(true); |
| | | this.setLoadPage(false); |
| | | } |
| | | |
| | | @Override |
| | | public FinSysOrg get(String orgCode) { |
| | | FinSysOrg finSysOrg = this.getCacheData(orgCode); |
| | | if(finSysOrg == null){ |
| | | finSysOrg = this.finOrgService.queryOneByCode(orgCode); |
| | | if(finSysOrg == null){ |
| | | logger.warn("从数据库未查询到机构,无法缓存,orgCode = {}", orgCode); |
| | | return null; |
| | | } |
| | | this.putCacheData(orgCode, finSysOrg); |
| | | } |
| | | return finSysOrg; |
| | | } |
| | | |
| | | @Override |
| | | public void save(FinSysOrg e) { |
| | | this.putCacheData(e.getOrgCode(), e); |
| | | } |
| | | |
| | | @Override |
| | | public void update(FinSysOrg e) { |
| | | this.updateCacheData(e.getOrgCode(), e); |
| | | } |
| | | |
| | | @Override |
| | | public void remove(String orgCode) { |
| | | this.removeCacheData(orgCode); |
| | | } |
| | | |
| | | @Override |
| | | public String getProviderName() { |
| | | return Constants.CACHE_NAME_FIN_ORG; |
| | | } |
| | | |
| | | @Override |
| | | public Class<?> getProviderType() { |
| | | return FinSysOrg.class; |
| | | } |
| | | |
| | | public void setFinOrgService(FinOrgServiceImpl finOrgService) { |
| | | this.finOrgService = finOrgService; |
| | | } |
| | | |
| | | private FinOrgServiceImpl finOrgService; |
| | | |
| | | } |
New file |
| | |
| | | package com.consum.base.cache; |
| | | |
| | | import com.consum.base.Constants; |
| | | import com.consum.base.FinSysTenantCacheProvider; |
| | | import com.consum.base.service.FinSysTenantServiceImpl; |
| | | import com.consum.model.po.FinSysTenant; |
| | | import com.walker.infrastructure.ApplicationRuntimeException; |
| | | import com.walker.infrastructure.utils.JsonUtils; |
| | | import com.walker.support.redis.cache.RedisCacheProvider; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 区划缓存 |
| | | * @作者:power |
| | | * @时间:2023/7/20 20:35 |
| | | */ |
| | | public class RedisFinSysTenantCache extends RedisCacheProvider<FinSysTenant> implements FinSysTenantCacheProvider { |
| | | public RedisFinSysTenantCache(){ |
| | | this.setUseRedis(true); |
| | | this.setLoadPage(false); |
| | | } |
| | | @Override |
| | | public FinSysTenant get(String code) { |
| | | FinSysTenant finSysTenant = this.getCacheData(code); |
| | | if(finSysTenant == null){ |
| | | finSysTenant = this.finSysTenantService.queryOneByCode(code); |
| | | if(finSysTenant == null){ |
| | | logger.warn("从数据库未查询到区划,无法缓存,code = {}", code); |
| | | return null; |
| | | } |
| | | |
| | | // 2023-07-26,时克英,区划相对固定,无需设置失效时间,让他永远存储吧。 |
| | | // this.putCacheData(code, finSysTenant,7200); |
| | | this.putCacheData(code, finSysTenant); |
| | | } |
| | | return finSysTenant; |
| | | } |
| | | |
| | | @Override |
| | | public void save(FinSysTenant e) { |
| | | this.putCacheData(e.getCode(), e); |
| | | } |
| | | |
| | | @Override |
| | | public void update(FinSysTenant e) { |
| | | this.updateCacheData(e.getCode(), e); |
| | | } |
| | | |
| | | @Override |
| | | public void remove(String code) { |
| | | this.removeCacheData(code); |
| | | } |
| | | |
| | | @Override |
| | | public FinSysTenant getById(String id) { |
| | | FinSysTenant finSysTenant = this.getCacheData(id); |
| | | if(finSysTenant == null){ |
| | | finSysTenant = this.finSysTenantService.get(new FinSysTenant(Long.parseLong(id))); |
| | | if(finSysTenant == null){ |
| | | logger.warn("从数据库未查询到区划,无法缓存,id = {}", id); |
| | | return null; |
| | | } |
| | | this.putCacheData(finSysTenant.getId().toString(), finSysTenant); |
| | | } |
| | | return finSysTenant; |
| | | } |
| | | |
| | | @Override |
| | | public List<FinSysTenant> selectAll() { |
| | | List<FinSysTenant> allTree = new ArrayList<>(); |
| | | FinSysTenant temp = null; |
| | | for(String value : this.getCache().getIterator(null)) { |
| | | try { |
| | | temp = JsonUtils.jsonStringToObject(value, FinSysTenant.class); |
| | | } catch (Exception ex) { |
| | | throw new ApplicationRuntimeException("redis存储'EbProductBrand'解析错吴:"+ value,ex); |
| | | } |
| | | allTree.add(temp); |
| | | } |
| | | return allTree; |
| | | } |
| | | |
| | | @Override |
| | | public String getProviderName() { |
| | | return Constants.CACHE_NAME_FIN_TENANT; |
| | | } |
| | | |
| | | @Override |
| | | public Class<?> getProviderType() { |
| | | return FinSysTenant.class; |
| | | } |
| | | |
| | | public void setFinSysTenantService(FinSysTenantServiceImpl finSysTenantService) { |
| | | this.finSysTenantService = finSysTenantService; |
| | | } |
| | | |
| | | private FinSysTenantServiceImpl finSysTenantService; |
| | | } |
New file |
| | |
| | | package com.consum.base.cache; |
| | | |
| | | |
| | | import com.consum.base.Constants; |
| | | import com.consum.base.FinSysTenantUserCacheProvider; |
| | | import com.consum.base.service.FinSysTenantUserServiceImpl; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.walker.support.redis.cache.RedisCacheProvider; |
| | | |
| | | /** |
| | | * Redis实现的后台登录用户 |
| | | * @author 王涵 |
| | | * @date 2023-07-18 |
| | | */ |
| | | public class RedisFinSysTenantUserCache extends RedisCacheProvider<FinSysTenantUser> implements FinSysTenantUserCacheProvider { |
| | | |
| | | public RedisFinSysTenantUserCache(){ |
| | | this.setUseRedis(true); |
| | | this.setLoadPage(false); |
| | | } |
| | | |
| | | @Override |
| | | public FinSysTenantUser get(String userId) { |
| | | FinSysTenantUser finSysTenantUser = this.getCacheData(userId); |
| | | if(finSysTenantUser == null){ |
| | | finSysTenantUser = this.finSysTenantUserService.queryOneByUserId(userId); |
| | | if(finSysTenantUser == null){ |
| | | logger.warn("从数据库未查询到用户,无法缓存,userId = {}", userId); |
| | | return null; |
| | | } |
| | | this.putCacheData(userId, finSysTenantUser); |
| | | } |
| | | return finSysTenantUser; |
| | | } |
| | | |
| | | @Override |
| | | public void save(FinSysTenantUser e) { |
| | | this.putCacheData(String.valueOf(e.getSysUserId()), e); |
| | | this.putCacheData(String.valueOf(e.getId()), e); |
| | | } |
| | | |
| | | @Override |
| | | public void update(FinSysTenantUser e) { |
| | | this.updateCacheData(String.valueOf(e.getSysUserId()), e); |
| | | this.updateCacheData(String.valueOf(e.getId()), e); |
| | | } |
| | | |
| | | @Override |
| | | public void remove(String userId) { |
| | | this.removeCacheData(userId); |
| | | } |
| | | |
| | | @Override |
| | | public FinSysTenantUser getByUserId(String userId) { |
| | | FinSysTenantUser finSysTenantUser = this.getCacheData(userId); |
| | | if(finSysTenantUser == null){ |
| | | finSysTenantUser = this.finSysTenantUserService.queryOneById(userId); |
| | | if(finSysTenantUser == null){ |
| | | logger.warn("从数据库未查询到用户,无法缓存,userId = {}", userId); |
| | | return null; |
| | | } |
| | | this.putCacheData(userId, finSysTenantUser); |
| | | } |
| | | return finSysTenantUser; |
| | | } |
| | | |
| | | @Override |
| | | public String getProviderName() { |
| | | return Constants.CACHE_NAME_FIN_TENANT_USER; |
| | | } |
| | | |
| | | @Override |
| | | public Class<?> getProviderType() { |
| | | return FinSysTenantUser.class; |
| | | } |
| | | |
| | | public void setFinSysTenantUserService(FinSysTenantUserServiceImpl finSysTenantUserService) { |
| | | this.finSysTenantUserService = finSysTenantUserService; |
| | | } |
| | | |
| | | private FinSysTenantUserServiceImpl finSysTenantUserService; |
| | | } |
New file |
| | |
| | | package com.consum.base.config; |
| | | |
| | | import com.consum.base.FinOrgCacheProvider; |
| | | import com.consum.base.FinSysTenantCacheProvider; |
| | | import com.consum.base.FinSysTenantUserCacheProvider; |
| | | import com.consum.base.TokenCacheProvider; |
| | | import com.consum.base.cache.LocalFinOrgCache; |
| | | import com.consum.base.cache.LocalFinSysTenantCache; |
| | | import com.consum.base.cache.LocalFinSysTenantUserCache; |
| | | import com.consum.base.cache.LocalTokenCache; |
| | | import com.consum.base.service.FinOrgServiceImpl; |
| | | import com.consum.base.service.FinSysTenantServiceImpl; |
| | | import com.consum.base.service.FinSysTenantUserServiceImpl; |
| | | import com.iplatform.base.config.CacheConfiguration; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | @Configuration |
| | | @ConditionalOnProperty(prefix = "iplatform.cache", name = "redis-enabled", havingValue = "false", matchIfMissing = true) |
| | | public class LocalFinCacheConfig extends CacheConfiguration { |
| | | |
| | | /** |
| | | * 配置业务机构缓存。 |
| | | * @param finOrgService |
| | | * @return |
| | | * @date 2023-07-05 |
| | | */ |
| | | @Bean |
| | | public FinOrgCacheProvider finOrgCacheProvider(FinOrgServiceImpl finOrgService){ |
| | | LocalFinOrgCache cache = new LocalFinOrgCache(); |
| | | cache.setFinOrgService(finOrgService); |
| | | return cache; |
| | | } |
| | | |
| | | /** |
| | | * @Description 配置平台登录用户缓存 |
| | | * @Author wh |
| | | * @Date 2023/7/18 13:36 |
| | | */ |
| | | @Bean |
| | | public FinSysTenantUserCacheProvider finSysTenantUserCacheProvider(FinSysTenantUserServiceImpl finSysTenantUserService){ |
| | | LocalFinSysTenantUserCache cache = new LocalFinSysTenantUserCache(); |
| | | cache.setFinSysTenantUserService(finSysTenantUserService); |
| | | return cache; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 江南登录用户缓存 |
| | | * @return |
| | | */ |
| | | @Bean |
| | | public TokenCacheProvider tokenCacheProvider(){ |
| | | LocalTokenCache cache = new LocalTokenCache(); |
| | | return cache; |
| | | } |
| | | |
| | | /** |
| | | * 配置业务机构缓存。 |
| | | * @param finSysTenantService |
| | | * @return |
| | | * @date 2023-07-05 |
| | | */ |
| | | @Bean |
| | | public FinSysTenantCacheProvider finSysTenantCacheProvider(FinSysTenantServiceImpl finSysTenantService){ |
| | | LocalFinSysTenantCache cache = new LocalFinSysTenantCache(); |
| | | cache.setFinSysTenantService(finSysTenantService); |
| | | return cache; |
| | | } |
| | | } |
New file |
| | |
| | | package com.consum.base.config; |
| | | |
| | | import com.consum.base.FinOrgCacheProvider; |
| | | import com.consum.base.FinSysTenantCacheProvider; |
| | | import com.consum.base.FinSysTenantUserCacheProvider; |
| | | import com.consum.base.TokenCacheProvider; |
| | | import com.consum.base.cache.RedisFinOrgCache; |
| | | import com.consum.base.cache.RedisFinSysTenantCache; |
| | | import com.consum.base.cache.RedisFinSysTenantUserCache; |
| | | import com.consum.base.cache.RedisTokenCache; |
| | | import com.consum.base.service.FinOrgServiceImpl; |
| | | import com.consum.base.service.FinSysTenantServiceImpl; |
| | | import com.consum.base.service.FinSysTenantUserServiceImpl; |
| | | import com.iplatform.base.config.CacheConfiguration; |
| | | import com.walker.support.redis.RedisHelper; |
| | | import com.walker.support.redis.cache.RedisCacheProvider; |
| | | import org.springframework.boot.autoconfigure.AutoConfigureAfter; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | @Configuration |
| | | @ConditionalOnProperty(prefix = "iplatform.cache", name = "redis-enabled", havingValue = "true", matchIfMissing = false) |
| | | @ConditionalOnClass({RedisCacheProvider.class}) |
| | | @AutoConfigureAfter(RedisAutoConfiguration.class) |
| | | public class RedisFinCacheConfig extends CacheConfiguration { |
| | | |
| | | /** |
| | | * Redis实现的业务机构缓存配置。 |
| | | * @param redisHelper |
| | | * @param finOrgService |
| | | * @return |
| | | * @date 2023-07-05 |
| | | */ |
| | | @Bean |
| | | public FinOrgCacheProvider finOrgCacheProvider(RedisHelper redisHelper, FinOrgServiceImpl finOrgService){ |
| | | RedisFinOrgCache cache = new RedisFinOrgCache(); |
| | | cache.setRedisHelper(redisHelper); |
| | | cache.setFinOrgService(finOrgService); |
| | | return cache; |
| | | } |
| | | |
| | | /** |
| | | * @Description 配置平台登录用户缓存 |
| | | * @Author wh |
| | | * @Date 2023/7/18 13:38 |
| | | */ |
| | | @Bean |
| | | public FinSysTenantUserCacheProvider finSysTenantUserCacheProvider(RedisHelper redisHelper, FinSysTenantUserServiceImpl finSysTenantUserService){ |
| | | RedisFinSysTenantUserCache cache = new RedisFinSysTenantUserCache(); |
| | | cache.setRedisHelper(redisHelper); |
| | | cache.setFinSysTenantUserService(finSysTenantUserService); |
| | | return cache; |
| | | } |
| | | |
| | | /** |
| | | * @Description 配置平台登录用户缓存 |
| | | * @Author wh |
| | | * @Date 2023/7/18 13:38 |
| | | */ |
| | | @Bean |
| | | public TokenCacheProvider tokenCacheProvider(RedisHelper redisHelper){ |
| | | RedisTokenCache cache = new RedisTokenCache(); |
| | | cache.setRedisHelper(redisHelper); |
| | | return cache; |
| | | } |
| | | |
| | | /** |
| | | * Redis实现的业务机构缓存配置。 |
| | | * @param redisHelper |
| | | * @param finSysTenantService |
| | | * @return |
| | | * @date 2023-07-05 |
| | | */ |
| | | @Bean |
| | | public FinSysTenantCacheProvider finSysTenantCacheProvider(RedisHelper redisHelper, FinSysTenantServiceImpl finSysTenantService){ |
| | | RedisFinSysTenantCache cache = new RedisFinSysTenantCache(); |
| | | cache.setRedisHelper(redisHelper); |
| | | cache.setFinSysTenantService(finSysTenantService); |
| | | return cache; |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * @Description 根据节点id删除节点(逻辑删除) |
| | | * @Description 根据id删除物品分类 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/23 |
| | | */ |
New file |
| | |
| | | package com.consum.base.controller; |
| | | |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.pojo.BaseCategoryParam; |
| | | import com.consum.base.service.BaseCategoryServiceImpl; |
| | | import com.consum.base.service.BaseGoodsModelsServiceImpl; |
| | | import com.consum.base.service.BaseGoodsTemplateServiceImpl; |
| | | import com.consum.model.po.BaseCategory; |
| | | import com.consum.model.po.BaseGoodsModels; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.web.ResponseValue; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description 规格型号 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/25 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/pc/base/goods/models") |
| | | public class BaseGoodsModelsController extends BaseController { |
| | | |
| | | @Autowired |
| | | private BaseGoodsModelsServiceImpl baseGoodsModelsService; |
| | | |
| | | /** |
| | | * @Description 规格列表查询(根据物品id查询规格型号) |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/25 |
| | | */ |
| | | @GetMapping("/list") |
| | | public ResponseValue queryList(Long goodsTemplatesId) { |
| | | S_user_core currentUser = this.getCurrentUser(); |
| | | if (currentUser == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | if (goodsTemplatesId == null) { |
| | | return ResponseValue.error("物品id不存在"); |
| | | } |
| | | GenericPager<BaseGoodsModels> pager = this.baseGoodsModelsService.queryList(goodsTemplatesId); |
| | | return ResponseValue.success(pager); |
| | | } |
| | | |
| | | /** |
| | | * @Description 新增 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/23 |
| | | */ |
| | | @PostMapping("/add") |
| | | public ResponseValue add(@RequestBody BaseGoodsModels models) { |
| | | if (models.getGoodsTemplatesId() == null || StringUtils.isEmpty(models.getModelName()) || StringUtils.isEmpty(models.getUnit()) || models.getStates() == null) { |
| | | return ResponseValue.error("参数错误"); |
| | | } |
| | | //判断同一物品模板id下的 规格型号名称是否重复 |
| | | BaseGoodsModels baseGoodsModels = this.baseGoodsModelsService.getByModelNameAndGoodsTemplatesId(models); |
| | | if (baseGoodsModels != null) { |
| | | return ResponseValue.error("规格型号名称已存在"); |
| | | } |
| | | |
| | | int result = this.baseGoodsModelsService.add(models); |
| | | if (result > 0) return ResponseValue.success(1); |
| | | return ResponseValue.error("新增失败!"); |
| | | } |
| | | |
| | | /** |
| | | * 修改状态 |
| | | * @author 卢庆阳 |
| | | * @date 2023/10/25 |
| | | */ |
| | | @PostMapping("/updStatus") |
| | | public ResponseValue updateStatus(@RequestBody BaseGoodsModels models) { |
| | | if (models == null || models.getId() == null || models.getStates() == null) { |
| | | return ResponseValue.error("参数错误"); |
| | | } |
| | | |
| | | int num = this.baseGoodsModelsService.updateStatus(models); |
| | | return num > 0 ? ResponseValue.success(1) : ResponseValue.error("修改失败!"); |
| | | } |
| | | |
| | | /** |
| | | * @Description 根据id删除规格型号 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/25 |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public ResponseValue updateById(@RequestBody BaseGoodsModels models) { |
| | | if (models.getId() == null) { |
| | | return ResponseValue.error("规格型号id为空"); |
| | | } |
| | | int num = this.baseGoodsModelsService.updateById(models); |
| | | |
| | | return num > 0 ? ResponseValue.success(1) : ResponseValue.error("删除失败!"); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | return num > 0 ? ResponseValue.success(1) : ResponseValue.error("编辑失败!"); |
| | | } |
| | | |
| | | /** |
| | | * 修改状态 |
| | | * @author 卢庆阳 |
| | | * @date 2023/10/25 |
| | | */ |
| | | //TODO 物品的禁用或删除,不影响已经采购入过库的物品信息。 |
| | | @PostMapping("/updStatus") |
| | | public ResponseValue updateStatus(@RequestBody BaseGoodsTemplate goodsTemplate) { |
| | | if (goodsTemplate == null || goodsTemplate.getId() == null || goodsTemplate.getStates() == null) { |
| | | return ResponseValue.error("参数错误"); |
| | | } |
| | | |
| | | int num = this.baseGoodsTemplateService.updateStatus(goodsTemplate); |
| | | return num > 0 ? ResponseValue.success(1) : ResponseValue.error("修改失败!"); |
| | | } |
| | | |
| | | /** |
| | | * @Description 根据物品id删除物品 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/25 |
| | | */ |
| | | //TODO 物品的禁用或删除,不影响已经采购入过库的物品信息。 |
| | | @DeleteMapping("/del") |
| | | public ResponseValue updateById(@RequestBody BaseGoodsTemplate goodsTemplate) { |
| | | if (goodsTemplate.getId() == null) { |
| | | return ResponseValue.error("物品id为空"); |
| | | } |
| | | int num = this.baseGoodsTemplateService.updateById(goodsTemplate,this.getCurrentUser()); |
| | | |
| | | return num > 0 ? ResponseValue.success(1) : ResponseValue.error("删除失败!"); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | package com.consum.base.controller; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.alibaba.excel.exception.ExcelDataConvertException; |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.pojo.FinSysTenantParam; |
| | | import com.consum.base.pojo.FinSysTenantSearchParam; |
| | | import com.consum.base.service.FinSysTenantServiceImpl; |
| | | import com.consum.base.service.FinSysTenantUserServiceImpl; |
| | | import com.consum.base.util.FinSysTenantUtils; |
| | | import com.consum.model.po.FinSysTenant; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.model.vo.FinSysTenantUserResult; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.tree.TreeNode; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.web.ResponseValue; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.core.io.ClassPathResource; |
| | | import org.springframework.core.io.InputStreamResource; |
| | | import org.springframework.core.io.Resource; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.HashMap; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.net.URLEncoder; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @Description 系统机构 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/23 |
| | | * @Description 区划 |
| | | * @Author wh |
| | | * @Date 2023/7/13 19:51 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/pc/fin/sys/tenant") |
| | | public class FinSysTenantController extends BaseController { |
| | | |
| | | @Autowired |
| | | private FinSysTenantServiceImpl finSysTenantService; |
| | | |
| | | @Autowired |
| | | private FinSysTenantUserServiceImpl finSysTenantUserService; |
| | | |
| | | @Autowired |
| | | public FinSysTenantController(FinSysTenantServiceImpl finSysTenantService) { |
| | | this.finSysTenantService = finSysTenantService; |
| | | } |
| | | |
| | | @Value("${iplatform.file.file-root}") |
| | | private String filePath; |
| | | |
| | | private boolean multiRoot = true; |
| | | private TreeNode dummyRoot = null; |
| | | private Map<Long, TreeNode> rootMap = new TreeMap(); |
| | | private Map<Long, TreeNode> childMap = new TreeMap(); |
| | | private long defaultParentId = 0L; |
| | | |
| | | /** |
| | | * 添加机构 |
| | | * @author 卢庆阳 |
| | | * @date 2023/10/4 |
| | | * @Description 获取区划树 |
| | | * @Author wh |
| | | * @Date 2023/7/11 11:15 |
| | | */ |
| | | @PostMapping("/add") |
| | | public ResponseValue add(@RequestBody FinSysTenantParam param){ |
| | | if (param == null) { |
| | | return ResponseValue.error("参数为空"); |
| | | @GetMapping("/select/tree_fin_tenant") |
| | | public ResponseValue listOrgRootTree() { |
| | | List<FinSysTenant> finSysTenantList = null; |
| | | FinSysTenantUser finSysTenantUser = new FinSysTenantUser(); |
| | | finSysTenantUser.setSysUserId(this.getCurrentUser().getId()); |
| | | List<FinSysTenantUser> finSysTenantUserList = finSysTenantUserService.select(finSysTenantUser); |
| | | FinSysTenantUser user = null; // 系统用户 |
| | | FinSysTenant finSysTenant1 = null; |
| | | List<TreeNode> treeRootList = null; // 数列表 |
| | | FinSysTenant finSysTenant = new FinSysTenant(); |
| | | // 获取地区父级 |
| | | finSysTenantList = this.finSysTenantService.queryForTree(); |
| | | // 根据登陆人id获取系统用户,如果有系统用户时 |
| | | if (finSysTenantUserList.size() > 0) { |
| | | // 获取当前用户信息 |
| | | user = finSysTenantUserList.get(0); |
| | | String tenantId = user.getTenantId(); |
| | | finSysTenant.setId(new Long(tenantId)); |
| | | // 查询区域 |
| | | List<FinSysTenant> select = finSysTenantService.select(finSysTenant); |
| | | if (select.size() > 0) { |
| | | finSysTenant1 = select.get(0); |
| | | } |
| | | } |
| | | if (StringUtils.isEmpty(param.getCode())) { |
| | | return ResponseValue.error("机构编号为空"); |
| | | } |
| | | if (StringUtils.isEmpty(param.getName())) { |
| | | return ResponseValue.error("机构名称为空"); |
| | | } |
| | | if (param.getParentId() == null) { |
| | | return ResponseValue.error("上级机构不存在"); |
| | | } |
| | | //根据机构id查询机构 |
| | | FinSysTenant sysTenant = this.finSysTenantService.selectByTenantId(param.getCode()); |
| | | if (sysTenant != null) { |
| | | return ResponseValue.error("机构编号已存在"); |
| | | } |
| | | String parentIdStr = param.getParentId() + ""; |
| | | int lv = parentIdStr.length() / 3 + 1; |
| | | if (lv > 4) { |
| | | return ResponseValue.error("不能创建支局以下机构"); |
| | | if (finSysTenant1 != null) { |
| | | if (finSysTenant1.getLv() != 1 && finSysTenant1.getParentId() != 0 && user != null) { |
| | | rootMap.clear(); |
| | | this.childMap.clear(); |
| | | this.defaultParentId = new Long(user.getTenantId()); |
| | | // 根据父级获取子集 |
| | | setEntityList(finSysTenantList); |
| | | treeRootList = getTreeRootList(); |
| | | } else { |
| | | treeRootList = FinSysTenantUtils.getFinSysTenantTree(finSysTenantList); |
| | | } |
| | | } else { |
| | | treeRootList = FinSysTenantUtils.getFinSysTenantTree(finSysTenantList); |
| | | } |
| | | |
| | | int num = this.finSysTenantService.addSysTenant(param,this.getCurrentUser(),lv); |
| | | if(num>0) return ResponseValue.success(1); |
| | | return ResponseValue.error("插入失败!"); |
| | | if (StringUtils.isEmptyList(treeRootList)) { |
| | | logger.error("未找到任何顶级区划树列表: treeNodeList = null"); |
| | | } else { |
| | | logger.debug(treeRootList.toString()); |
| | | } |
| | | return ResponseValue.success(treeRootList); |
| | | } |
| | | |
| | | /** |
| | | * @Description 分页列表查询 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/24 |
| | | * @Description 分页列表查询 |
| | | * @Author llb |
| | | * @Date 2023/7/14 13:59 |
| | | */ |
| | | // @RequestMapping("/select/list") |
| | | @RequestMapping("/select/list") |
| | | public ResponseValue allocatedList(FinSysTenantSearchParam param) { |
| | | FinSysTenantUser sysInfo = getSysInfo(); |
| | |
| | | return ResponseValue.success(pager); |
| | | } |
| | | |
| | | } |
| | | /** |
| | | * @Author :power |
| | | * @Date : 2023/7/20 10:58 查询项目配置中 参与范围 (省/地市;地市) 该方法应是全局可见 |
| | | */ |
| | | @GetMapping("/project/selectTreeServingByProject") |
| | | public ResponseValue selectTreeServingByProject() { |
| | | // 省进入 查询 省和地市 ;地市进入 查询自己地市 |
| | | // TODO Long.valueOf(getSysInfo().getTenantId()) |
| | | FinSysTenant finSysTenant = |
| | | this.finSysTenantService.get(new FinSysTenant(Long.valueOf(getSysInfo().getTenantId()))); |
| | | if (finSysTenant.getLv() == 3) { |
| | | return ResponseValue.error("县区级别无法查看"); |
| | | } |
| | | List<FinSysTenant> finSysTenantList = |
| | | this.finSysTenantService.queryTreeById(finSysTenant.getId(), finSysTenant.getLv()); |
| | | List<TreeNode> treeNodeList = new ArrayList<>(); |
| | | // 省查本身及以下 市查本级 县无权查看 |
| | | if (finSysTenant.getLv() == 1) { |
| | | treeNodeList = FinSysTenantUtils.getFinSysTenantTree(finSysTenantList); |
| | | if (StringUtils.isEmptyList(treeNodeList)) { |
| | | logger.error("未找到任何顶级区划树列表: treeNodeList = null"); |
| | | } else { |
| | | logger.debug(treeNodeList.toString()); |
| | | } |
| | | } else { |
| | | TreeNode treeNode = new TreeNode(finSysTenantList.get(0).getId(), finSysTenantList.get(0).getName(), |
| | | new ArrayList<>(), finSysTenantList.get(0).getParentId(), finSysTenantList.get(0).getCode()); |
| | | treeNodeList.add(treeNode); |
| | | } |
| | | return ResponseValue.success(treeNodeList); |
| | | } |
| | | |
| | | /** |
| | | * @Author :power |
| | | * @Date : 2023/7/20 16:33 项目配置 - 范围 - 查询县区 (省查询所有 地市查询自己管辖) |
| | | */ |
| | | @GetMapping("/project/selectCounty") |
| | | public ResponseValue selectCounty() { |
| | | // 省进入 查询 省和地市 ;地市进入 查询自己地市 |
| | | // TODO Long.valueOf(getSysInfo().getTenantId()) |
| | | FinSysTenant finSysTenant = |
| | | this.finSysTenantService.get(new FinSysTenant(Long.valueOf(getSysInfo().getTenantId()))); |
| | | if (finSysTenant.getLv() == 3) { |
| | | return ResponseValue.error("县区级别无法查看"); |
| | | } |
| | | Map<Long, List<FinSysTenant>> finSysTenantList = |
| | | this.finSysTenantService.queryCountyByCityCode(finSysTenant.getId(), finSysTenant.getLv()); |
| | | return ResponseValue.success(finSysTenantList); |
| | | } |
| | | |
| | | public void setEntityList(List<FinSysTenant> datas) { |
| | | |
| | | if (!StringUtils.isEmptyList(datas)) { |
| | | TreeNode node = null; |
| | | Iterator var3 = datas.iterator(); |
| | | |
| | | while (var3.hasNext()) { |
| | | Object obj = var3.next(); |
| | | node = this.toTreeNode((FinSysTenant) obj); |
| | | |
| | | if (node.getId() == this.defaultParentId) { |
| | | this.rootMap.put(node.getId(), node); |
| | | } else if (node.getParentId() == this.defaultParentId) { |
| | | this.childMap.put(node.getId(), node); |
| | | } |
| | | } |
| | | |
| | | if (this.rootMap.size() == 0) { |
| | | throw new IllegalArgumentException("未找到根节点。"); |
| | | } else { |
| | | if (this.childMap != null && this.childMap.size() > 0) { |
| | | this.mountTree(this.childMap); |
| | | } |
| | | |
| | | if (this.dummyRoot != null) { |
| | | var3 = this.rootMap.values().iterator(); |
| | | |
| | | while (var3.hasNext()) { |
| | | TreeNode n = (TreeNode) var3.next(); |
| | | n.setParentId(this.defaultParentId); |
| | | this.dummyRoot.addChild(n); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void mountTree(Map<Long, TreeNode> childMap) { |
| | | TreeNode _node = null; |
| | | Iterator i = childMap.values().iterator(); |
| | | |
| | | while (i.hasNext()) { |
| | | _node = (TreeNode) i.next(); |
| | | this.mountMiddleNode(_node, childMap); |
| | | } |
| | | |
| | | } |
| | | |
| | | private void mountMiddleNode(TreeNode currentNode, Map<Long, TreeNode> childMap) { |
| | | TreeNode _parentNode = (TreeNode) this.rootMap.get(currentNode.getParentId()); |
| | | if (_parentNode == null) { |
| | | _parentNode = (TreeNode) childMap.get(currentNode.getId()); |
| | | if (_parentNode == null) { |
| | | throw new NullPointerException("parent node not found, current: " + currentNode); |
| | | } |
| | | |
| | | _parentNode.addChild(currentNode); |
| | | this.mountMiddleNode(_parentNode, childMap); |
| | | } else if (_parentNode.getId() == this.defaultParentId) { |
| | | _parentNode.addChild(currentNode); |
| | | } |
| | | |
| | | } |
| | | |
| | | protected TreeNode toTreeNode(FinSysTenant entity) { |
| | | TreeNode treeNode = |
| | | new TreeNode(entity.getId(), entity.getName(), (List) null, entity.getParentId(), entity.getCode()); |
| | | return treeNode; |
| | | } |
| | | |
| | | public List<TreeNode> getTreeRootList() { |
| | | if (!this.multiRoot) { |
| | | throw new IllegalStateException("存在多个根节点,请调用方法:getTreeRoot()."); |
| | | } else { |
| | | List<TreeNode> list = new ArrayList(); |
| | | Iterator var2 = this.rootMap.values().iterator(); |
| | | |
| | | while (var2.hasNext()) { |
| | | TreeNode node = (TreeNode) var2.next(); |
| | | list.add(node); |
| | | } |
| | | return list; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @Description 不分页查询 |
| | | */ |
| | | @RequestMapping("/select/allList") |
| | | public ResponseValue allList(FinSysTenantSearchParam param) { |
| | | StringBuilder whStr = new StringBuilder("where 1=1 and status = 1 and is_delete = 0 "); |
| | | HashMap parameter = new HashMap<>(); |
| | | if (param.getFirstZmS() != null && !param.getFirstZmS().equals("")) { |
| | | whStr.append(" and name is not null and("); |
| | | String upperCase = param.getFirstZmS().toUpperCase(); |
| | | whStr.append("instr(:upperFirstZmS,F_PINYIN( SUBSTR(name, 1, 1)))>0 or instr(:upperFirstZmS2,SUBSTR(name, 1, 1))>0"); |
| | | parameter.put("upperFirstZmS", upperCase); |
| | | parameter.put("upperFirstZmS2", upperCase); |
| | | whStr.append(")"); |
| | | } |
| | | whStr.append(" order by lv asc, F_PINYIN( SUBSTR(name, 1, 1)) ASC "); |
| | | List<FinSysTenant> select = this.finSysTenantService.select(new FinSysTenant(), whStr.toString(), parameter); |
| | | return ResponseValue.success(select); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除 |
| | | * @author 卢庆阳 |
| | | * @date 2023/10/4 |
| | | */ |
| | | @PostMapping("/del") |
| | | public ResponseValue del(@RequestBody FinSysTenantParam param) { |
| | | if (param.getId() == null) { |
| | | return ResponseValue.error("机构id为空"); |
| | | } |
| | | int num =this.finSysTenantService.updateById(param,this.getSysInfo()); |
| | | return num>0 ? ResponseValue.success(1):ResponseValue.error("删除失败!"); |
| | | } |
| | | |
| | | /** |
| | | * 添加机构 |
| | | * @author 卢庆阳 |
| | | * @date 2023/10/4 |
| | | */ |
| | | @PostMapping("/add") |
| | | public ResponseValue add(@RequestBody FinSysTenantParam param){ |
| | | if (param == null) { |
| | | return ResponseValue.error("参数为空"); |
| | | } |
| | | if (StringUtils.isEmpty(param.getCode())) { |
| | | return ResponseValue.error("机构编号为空"); |
| | | } |
| | | if (StringUtils.isEmpty(param.getName())) { |
| | | return ResponseValue.error("机构名称为空"); |
| | | } |
| | | FinSysTenant finSysTenant = this.finSysTenantService.selectByTenantId(param.getCode()); |
| | | if (finSysTenant != null) { |
| | | return ResponseValue.error("机构编号已存在"); |
| | | } |
| | | String parentIdStr = param.getParentId() + ""; |
| | | int lv = parentIdStr.length() / 3 + 1; |
| | | if (lv > 4) { |
| | | return ResponseValue.error("不能创建支局以下机构"); |
| | | } |
| | | int num = this.finSysTenantService.addFinSysTenant(param,this.getSysInfo(),lv); |
| | | if(num>0) return ResponseValue.success(1); |
| | | return ResponseValue.error("插入失败!"); |
| | | } |
| | | |
| | | @GetMapping("getImportTemplate") |
| | | public ResponseEntity<InputStreamResource> getImportTemplate() throws IOException { |
| | | // 从当前项目资源目录获取文件 |
| | | Resource resource = new ClassPathResource("import/机构导入模板.xls"); |
| | | // 获取文件输入流 |
| | | InputStream inputStream = resource.getInputStream(); |
| | | // 设置HTTP响应头 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.setContentType(MediaType.APPLICATION_OCTET_STREAM); |
| | | String encodedFilename = URLEncoder.encode("机构导入模板.xls", "UTF-8"); |
| | | headers.setContentDispositionFormData("attachment", encodedFilename); |
| | | // 创建InputStreamResource对象,将文件输入流包装起来 |
| | | InputStreamResource resourceToDownload = new InputStreamResource(inputStream); |
| | | // 返回带有文件输入流的ResponseEntity对象 |
| | | return ResponseEntity |
| | | .status(HttpStatus.OK) |
| | | .headers(headers) |
| | | .body(resourceToDownload); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @return 获取项目导入的模板 |
| | | * @throws IOException |
| | | */ |
| | | @GetMapping("getProjectImportTemplate") |
| | | public ResponseEntity<InputStreamResource> getProjectImportTemplate() throws IOException { |
| | | // 从当前项目资源目录获取文件 |
| | | Resource resource = new ClassPathResource("import/项目导入模板.xls"); |
| | | // 获取文件输入流 |
| | | InputStream inputStream = resource.getInputStream(); |
| | | // 设置HTTP响应头 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.setContentType(MediaType.APPLICATION_OCTET_STREAM); |
| | | String encodedFilename = URLEncoder.encode("项目导入模板.xls", "UTF-8"); |
| | | headers.setContentDispositionFormData("attachment", encodedFilename); |
| | | // 创建InputStreamResource对象,将文件输入流包装起来 |
| | | InputStreamResource resourceToDownload = new InputStreamResource(inputStream); |
| | | // 返回带有文件输入流的ResponseEntity对象 |
| | | return ResponseEntity |
| | | .status(HttpStatus.OK) |
| | | .headers(headers) |
| | | .body(resourceToDownload); |
| | | } |
| | | |
| | | |
| | | @PostMapping("import") |
| | | public ResponseValue upload(@RequestParam Long pid, MultipartFile file) throws IOException { |
| | | String originalFilename = file.getOriginalFilename(); |
| | | if (!"xls".equals(originalFilename.substring(originalFilename.lastIndexOf(".") + 1))){ |
| | | return ResponseValue.error("文件格式有误!"); |
| | | } |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | if (sysInfo==null){ |
| | | return ResponseValue.error("当前登录用户为空"); |
| | | } |
| | | String parentIdStr = pid + ""; |
| | | int lv = parentIdStr.length() / 3 + 1; |
| | | if (lv > 3) { |
| | | return ResponseValue.error("不能创建县(区)级以下机构"); |
| | | } |
| | | |
| | | EasyExcel.read(file.getInputStream(), FinSysTenantParam.class, new AnalysisEventListener<FinSysTenantParam>() { |
| | | LinkedList<FinSysTenantParam> finSysTenantParams = new LinkedList<>(); |
| | | @Override |
| | | public void invoke(FinSysTenantParam finSysTenantParam, AnalysisContext analysisContext) { |
| | | if (StringUtils.isEmpty(finSysTenantParam.getCode())||finSysTenantParam.getCode().length()>20){ |
| | | IllegalStateException exception = new IllegalStateException("第" + analysisContext.readSheetHolder().getRowIndex() + "行,机构编号不能为空或长度大于20"); |
| | | throw exception; |
| | | } |
| | | if (null!=finSysTenantService.selectByTenantId(finSysTenantParam.getCode())){ |
| | | throw new IllegalStateException("第" + analysisContext.readSheetHolder().getRowIndex() + "行,机构编号已存在"); |
| | | } |
| | | if (StringUtils.isEmpty(finSysTenantParam.getName())||finSysTenantParam.getName().length()>100){ |
| | | IllegalStateException exception = new IllegalStateException("第" + analysisContext.readSheetHolder().getRowIndex() + "行,机构名称不能为空或长度大于100"); |
| | | throw exception; |
| | | } |
| | | finSysTenantParam.setParentId(pid); |
| | | finSysTenantParam.setStatus(1); |
| | | finSysTenantParam.setSummary("系统导入"); |
| | | finSysTenantParams.add(finSysTenantParam); |
| | | } |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext analysisContext) { |
| | | finSysTenantService.insertFinSysTenantBatch(finSysTenantParams,sysInfo,lv); |
| | | } |
| | | |
| | | @Override |
| | | public void onException(Exception exception, AnalysisContext context) { |
| | | // 如果是某一个单元格的转换异常 能获取到具体行号 |
| | | if (exception instanceof ExcelDataConvertException) { |
| | | ExcelDataConvertException excelDataConvertException = (ExcelDataConvertException)exception; |
| | | logger.error("第{}行,第{}列解析异常,数据为:{}",excelDataConvertException.getRowIndex(), |
| | | excelDataConvertException.getColumnIndex()+1, excelDataConvertException.getCellData().getStringValue()); |
| | | throw new IllegalStateException("第"+(excelDataConvertException.getRowIndex()+1)+"行,第"+(excelDataConvertException.getColumnIndex()+1)+"列解析异常,异常数据为:[ "+excelDataConvertException.getCellData().getStringValue()+" ]"); |
| | | } |
| | | if (exception instanceof IllegalStateException){ |
| | | throw (IllegalStateException)exception; |
| | | } |
| | | |
| | | } |
| | | |
| | | }).doReadAll(); |
| | | |
| | | return ResponseValue.success("导入成功!",1); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * @author 卢庆阳 |
| | | * @date 2023/10/6 |
| | | */ |
| | | @PostMapping("/edit") |
| | | public ResponseValue edit(@RequestBody FinSysTenant finSysTenant) { |
| | | Long id = finSysTenant.getId(); |
| | | if (id == null || id.longValue() <= 0) { |
| | | return ResponseValue.error("编辑的机构不存在"); |
| | | } |
| | | FinSysTenantUser sysInfo = getSysInfo(); |
| | | if (sysInfo == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | // FinSysTenant finSysTenant1 = this.finSysTenantService.selectByTenantId(sysInfo.getTenantCode()); |
| | | // if (finSysTenant1.getLv() != 1) { |
| | | // return ResponseValue.error("暂无修改权限"); |
| | | // } |
| | | int num = this.finSysTenantService.updateFinSysTenant(finSysTenant,this.getSysInfo()); |
| | | return num>0 ? ResponseValue.success(1):ResponseValue.error("编辑失败!"); |
| | | } |
| | | |
| | | /** |
| | | * @Description 根据OrgCode获取上级及本级人员ID。可能是省市县 |
| | | * @Author wh |
| | | * @Date 2023/10/4 15:37 |
| | | */ |
| | | @GetMapping("getUserByOrgId") |
| | | public ResponseValue getUserByOrgCode(Long orgId) { |
| | | if (orgId == null) { |
| | | return ResponseValue.error("机构不能为空"); |
| | | } |
| | | ArrayList<FinSysTenantUserResult> finSysTenantUserResults = new ArrayList<>(); |
| | | // 本级 |
| | | FinSysTenant finSysTenant = this.finSysTenantService.get(new FinSysTenant(orgId)); |
| | | if (finSysTenant.getLv() == 1) { |
| | | // 省 |
| | | List<FinSysTenantUser> finSysTenantUserList = this.finSysTenantUserService.getByOrgId(orgId); |
| | | if (!StringUtils.isEmptyList(finSysTenantUserList)) { |
| | | FinSysTenantUserResult finSysTenantUserResult = new FinSysTenantUserResult(); |
| | | finSysTenantUserResult.setOrgId(finSysTenant.getId()); |
| | | finSysTenantUserResult.setOrgName(finSysTenant.getName()); |
| | | finSysTenantUserResult.setUserList(finSysTenantUserList); |
| | | finSysTenantUserResults.add(finSysTenantUserResult); |
| | | } |
| | | } |
| | | if (finSysTenant.getLv() == 2) { |
| | | // 市 |
| | | List<FinSysTenantUser> finSysTenantUserList2 = this.finSysTenantUserService.getByOrgId(orgId); |
| | | if (!StringUtils.isEmptyList(finSysTenantUserList2)) { |
| | | FinSysTenantUserResult finSysTenantUserResult = new FinSysTenantUserResult(); |
| | | finSysTenantUserResult.setOrgId(finSysTenant.getId()); |
| | | finSysTenantUserResult.setOrgName(finSysTenant.getName()); |
| | | finSysTenantUserResult.setUserList(finSysTenantUserList2); |
| | | finSysTenantUserResults.add(finSysTenantUserResult); |
| | | } |
| | | // 省 |
| | | FinSysTenant finSysTenant1 = this.finSysTenantService.get(new FinSysTenant(finSysTenant.getParentId())); |
| | | List<FinSysTenantUser> finSysTenantUserList = this.finSysTenantUserService.getByOrgId(finSysTenant1.getId()); |
| | | if (!StringUtils.isEmptyList(finSysTenantUserList)) { |
| | | FinSysTenantUserResult finSysTenantUserResult = new FinSysTenantUserResult(); |
| | | finSysTenantUserResult.setOrgId(finSysTenant1.getId()); |
| | | finSysTenantUserResult.setOrgName(finSysTenant1.getName()); |
| | | finSysTenantUserResult.setUserList(finSysTenantUserList); |
| | | finSysTenantUserResults.add(finSysTenantUserResult); |
| | | } |
| | | } |
| | | if (finSysTenant.getLv() == 3) { |
| | | // 县 |
| | | List<FinSysTenantUser> finSysTenantUserList3 = this.finSysTenantUserService.getByOrgId(orgId); |
| | | if (!StringUtils.isEmptyList(finSysTenantUserList3)) { |
| | | FinSysTenantUserResult finSysTenantUserResult = new FinSysTenantUserResult(); |
| | | finSysTenantUserResult.setOrgId(finSysTenant.getId()); |
| | | finSysTenantUserResult.setOrgName(finSysTenant.getName()); |
| | | finSysTenantUserResult.setUserList(finSysTenantUserList3); |
| | | finSysTenantUserResults.add(finSysTenantUserResult); |
| | | } |
| | | // 市 |
| | | FinSysTenant finSysTenant2 = this.finSysTenantService.get(new FinSysTenant(finSysTenant.getParentId())); |
| | | List<FinSysTenantUser> finSysTenantUserList2 = this.finSysTenantUserService.getByOrgId(finSysTenant2.getId()); |
| | | if (!StringUtils.isEmptyList(finSysTenantUserList2)) { |
| | | FinSysTenantUserResult finSysTenantUserResult = new FinSysTenantUserResult(); |
| | | finSysTenantUserResult.setOrgId(finSysTenant2.getId()); |
| | | finSysTenantUserResult.setOrgName(finSysTenant2.getName()); |
| | | finSysTenantUserResult.setUserList(finSysTenantUserList2); |
| | | finSysTenantUserResults.add(finSysTenantUserResult); |
| | | } |
| | | // 省 |
| | | FinSysTenant finSysTenant1 = this.finSysTenantService.get(new FinSysTenant(finSysTenant2.getParentId())); |
| | | List<FinSysTenantUser> finSysTenantUserList = this.finSysTenantUserService.getByOrgId(finSysTenant1.getId()); |
| | | if (!StringUtils.isEmptyList(finSysTenantUserList)) { |
| | | FinSysTenantUserResult finSysTenantUserResult = new FinSysTenantUserResult(); |
| | | finSysTenantUserResult.setOrgId(finSysTenant1.getId()); |
| | | finSysTenantUserResult.setOrgName(finSysTenant1.getName()); |
| | | finSysTenantUserResult.setUserList(finSysTenantUserList); |
| | | finSysTenantUserResults.add(finSysTenantUserResult); |
| | | } |
| | | } |
| | | return ResponseValue.success(finSysTenantUserResults); |
| | | } |
| | | } |
New file |
| | |
| | | package com.consum.base.controller; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.alibaba.excel.exception.ExcelDataConvertException; |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.pojo.FinSysTenantUserSearchParam; |
| | | import com.consum.base.pojo.FinSysTenantUserUpdParam; |
| | | import com.consum.base.service.FinSysTenantServiceImpl; |
| | | import com.consum.base.service.FinSysTenantUserServiceImpl; |
| | | import com.consum.model.po.FinSysTenant; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.iplatform.base.ArgumentsConstants; |
| | | import com.iplatform.base.service.DeptServiceImpl; |
| | | import com.iplatform.base.service.RoleServiceImpl; |
| | | import com.iplatform.base.service.UserServiceImpl; |
| | | import com.iplatform.base.util.PlatformRSAUtils; |
| | | import com.iplatform.core.util.AESUtils; |
| | | import com.iplatform.model.po.S_config; |
| | | import com.iplatform.model.po.S_dept; |
| | | import com.iplatform.model.po.S_role; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.*; |
| | | import com.walker.web.ResponseValue; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @Description 系统用户 |
| | | * @Author wh |
| | | * @Date 2023/7/17 14:16 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/pc/fin/sys/tenant/user") |
| | | public class FinSysTenantUserController extends BaseController { |
| | | |
| | | private String roleName; |
| | | |
| | | private FinSysTenantUserServiceImpl finSysTenantUserService; |
| | | |
| | | private UserServiceImpl userService; |
| | | |
| | | private DeptServiceImpl deptService; |
| | | |
| | | private FinSysTenantServiceImpl finSysTenantService; |
| | | |
| | | private RoleServiceImpl roleService; |
| | | |
| | | |
| | | @Autowired |
| | | public void setUserService(UserServiceImpl userService) { |
| | | this.userService = userService; |
| | | } |
| | | |
| | | private S_config sConfig; |
| | | |
| | | @Autowired |
| | | public FinSysTenantUserController(FinSysTenantServiceImpl finSysTenantService, FinSysTenantUserServiceImpl finSysTenantUserService, RoleServiceImpl roleService) { |
| | | this.finSysTenantUserService = finSysTenantUserService; |
| | | this.finSysTenantService = finSysTenantService; |
| | | this.roleService = roleService; |
| | | } |
| | | |
| | | /** |
| | | * @Description 分页列表查询 |
| | | * @Author wh |
| | | * @Date 2023/7/11 13:59 |
| | | */ |
| | | @RequestMapping("/select/list") |
| | | public ResponseValue allocatedList(FinSysTenantUserSearchParam param) { |
| | | if (param.getTenantCode() == 0) { |
| | | FinSysTenantUser user = new FinSysTenantUser(); |
| | | Long id = this.getCurrentUser().getId(); |
| | | user.setSysUserId(id); |
| | | List<FinSysTenantUser> select = finSysTenantUserService.select(user); |
| | | if (select.size() > 0) { |
| | | param.setTenantCode(new Long(select.get(0).getTenantCode())); |
| | | } |
| | | } |
| | | GenericPager<FinSysTenantUser> pager = this.finSysTenantUserService.queryAllPageUser(param); |
| | | |
| | | List<FinSysTenantUser> datas = pager.getDatas(); |
| | | if (datas.size() > 0) { |
| | | for (FinSysTenantUser finSysTenantUser : datas) { |
| | | if (finSysTenantUser.getUserPhone() != null) { |
| | | // 解密并脱敏 |
| | | String tel = null; |
| | | try { |
| | | tel = AESUtils.decryptStrAES(finSysTenantUser.getUserPhone(), PlatformRSAUtils.AES_KEY); |
| | | } catch (Exception e) { |
| | | logger.error("解密手机号失败,原因:" + e); |
| | | tel = null; |
| | | } |
| | | if (StringUtils.isNotEmpty(tel)) { |
| | | finSysTenantUser.setUserPhone(PhoneNumberUtils.maskMobile(tel)); |
| | | } else { |
| | | finSysTenantUser.setUserPhone(""); |
| | | } |
| | | } else { |
| | | finSysTenantUser.setUserPhone(""); |
| | | } |
| | | |
| | | // 循环去查角色 |
| | | Long sysUserId = finSysTenantUser.getSysUserId(); |
| | | if (sysUserId != null) { |
| | | List<S_role> list = finSysTenantUserService.getByUserId(sysUserId); |
| | | String roleStr = ""; |
| | | for (S_role s_role : list) { |
| | | roleStr = roleStr + s_role.getRole_name() + " "; |
| | | } |
| | | finSysTenantUser.setRoleStr(roleStr); |
| | | } |
| | | |
| | | //循环查询运维商id |
| | | if (finSysTenantUser.getSupplierId() != null) { |
| | | finSysTenantUser.setIsSupplier("是"); |
| | | } else { |
| | | finSysTenantUser.setIsSupplier("否"); |
| | | } |
| | | } |
| | | } |
| | | return ResponseValue.success(pager); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @Description 新增 |
| | | * @Author wh |
| | | * @Date 2023/7/17 15:56 |
| | | */ |
| | | @PostMapping("/add") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ResponseValue add(@RequestBody FinSysTenantUser user) { |
| | | if (user == null) { |
| | | return ResponseValue.error("参数为空"); |
| | | } |
| | | //根据员工编号查询,如果存在则提示 |
| | | if (finSysTenantUserService.getByUserCode(user.getUserCode()) != null && finSysTenantUserService.getByUserCode(user.getUserCode()) > 0) { |
| | | return ResponseValue.error("员工编号重复"); |
| | | } |
| | | if (user.getTenantId() == null || "".equals(user.getTenantId()) || new Integer(user.getTenantId()) == 0) { |
| | | return ResponseValue.error("添加时请选择区县"); |
| | | } |
| | | if (user.getTenantCode() == null || "".equals(user.getTenantCode()) || new Integer(user.getTenantCode()) == 0) { |
| | | return ResponseValue.error("添加时请选择区县"); |
| | | } |
| | | //插入系统用户 |
| | | user.setId(NumberGenerator.getLongSequenceNumber()); |
| | | user.setCreateTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | user.setCreateBy(this.getCurrentUser().getUser_name()); |
| | | user.setUpdateTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | user.setUpdateBy(this.getCurrentUser().getUser_name()); |
| | | //user.setStatus(1);// 0禁用 1启用 |
| | | user.setIsDelete(0);// 是否删除 0是 1否 |
| | | user.setSysUserId(NumberGenerator.getLongSequenceNumber()); |
| | | // 加密手机号 |
| | | String key = PlatformRSAUtils.AES_KEY; |
| | | String pwdPhone = ""; |
| | | if (user.getUserPhone() != null) { |
| | | pwdPhone = AESUtils.encryptStrAES(user.getUserPhone(), key); |
| | | } |
| | | user.setUserPhone(pwdPhone); |
| | | user.setIsDelete(1); |
| | | //怎么获取左侧机构树数据 |
| | | user.setSysDeptId(3L); //对应平台机构id 默认为平台管理 |
| | | this.finSysTenantUserService.insert(user); |
| | | // 插入平台用户 |
| | | S_user_core userCore = new S_user_core(); |
| | | userCore.setId(user.getSysUserId()); |
| | | userCore.setDept_id(3L); //部门id,目前写死 |
| | | userCore.setOrg_id(user.getSysDeptId()); //机构id |
| | | userCore.setOrg_id(1L); |
| | | userCore.setUser_name(user.getUserCode()); //用户账号 |
| | | userCore.setNick_name(user.getUserName()); |
| | | //用户类型 先默认设置为2 |
| | | userCore.setUser_type(2); |
| | | userCore.setPhonenumber(pwdPhone); |
| | | userCore.setSex(user.getSex().toString()); |
| | | //初始化密码 123456 |
| | | String pws = this.getArgumentVariable(ArgumentsConstants.KEY_SECURITY_PASSWORD_INIT).getStringValue(); |
| | | userCore.setPassword(pws); |
| | | // 平台用户表和系统用户 表状态相反 |
| | | if (user.getStatus() == 0) { |
| | | user.setStatus(1); |
| | | } else { |
| | | user.setStatus(0); |
| | | } |
| | | userCore.setStatus(user.getStatus()); |
| | | userCore.setDel_flag(0); |
| | | userCore.setCreate_by(this.getCurrentUser().getUser_name()); |
| | | userCore.setCreate_time(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | userCore.setRemark(user.getRemark()); |
| | | userCore.setType(1); |
| | | userCore.setBind_client_id("0"); |
| | | userCore.setBind_wechat(0); |
| | | userCore.setModify_pwd(0); |
| | | userCore.setBind_mobile(0); |
| | | userCore.setBind_mail(0); |
| | | userCore.setProfile_id(0L); |
| | | userCore.setIs_wechat_public(0); |
| | | userCore.setIs_wechat_routine(0); |
| | | userCore.setIs_wechat_ios(0); |
| | | userCore.setIs_wechat_android(0); |
| | | userCore.setIs_logoff(0); |
| | | userCore.setLogoff_time(0L); |
| | | userCore.setIs_sms(0); |
| | | //管理员类型:1= 平台超管, 2=商户超管, 3=系统管理员,4=商户管理员 |
| | | userCore.setType(1); |
| | | //商户id,0-平台 |
| | | userCore.setMer_id(0L); |
| | | this.userService.insert(userCore); |
| | | // 插入平台机构 |
| | | //少角色id |
| | | List<Long> roleList = user.getRoleList(); //机构id 多个 |
| | | if (!CollectionUtils.isEmpty(roleList)) { |
| | | Long sysUserId = user.getSysUserId(); //用户id |
| | | this.finSysTenantUserService.execInsertRoleUserList(roleList, sysUserId); |
| | | } |
| | | // this.getFinCustomerCache().remove(); |
| | | return ResponseValue.success(1); |
| | | } |
| | | |
| | | |
| | | |
| | | public static class ImportUserParam{ |
| | | @ExcelProperty("用户姓名") |
| | | private String userName; |
| | | @ExcelProperty("用户编号") |
| | | private String userCode; |
| | | @ExcelProperty("手机号") |
| | | private String userPhone; |
| | | @ExcelProperty("性别(1男,2女)") |
| | | private Integer sex; |
| | | @ExcelProperty("电子邮箱") |
| | | private String email; |
| | | @ExcelProperty("顺序号") |
| | | private Long seq; |
| | | @ExcelProperty("角色名称") |
| | | private String roleName; |
| | | |
| | | public String getUserName() { |
| | | return userName; |
| | | } |
| | | public void setUserName(String userName) { |
| | | this.userName = userName; |
| | | } |
| | | public String getUserCode() { |
| | | return userCode; |
| | | } |
| | | public void setUserCode(String userCode) { |
| | | this.userCode = userCode; |
| | | } |
| | | public String getUserPhone() { |
| | | return userPhone; |
| | | } |
| | | public void setUserPhone(String userPhone) { |
| | | this.userPhone = userPhone; |
| | | } |
| | | public Integer getSex() { |
| | | return sex; |
| | | } |
| | | public void setSex(Integer sex) { |
| | | this.sex = sex; |
| | | } |
| | | public String getEmail() { |
| | | return email; |
| | | } |
| | | public void setEmail(String email) { |
| | | this.email = email; |
| | | } |
| | | public Long getSeq() { |
| | | return seq; |
| | | } |
| | | public void setSeq(Long seq) { |
| | | this.seq = seq; |
| | | } |
| | | public String getRoleName() { |
| | | return roleName; |
| | | } |
| | | public void setRoleName(String roleName) { |
| | | this.roleName = roleName; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @Description 批量导入用户 |
| | | * @Author jlq |
| | | * @Date 2023/10/12 15:56 |
| | | */ |
| | | @PostMapping("/import") |
| | | public ResponseValue importUser(@RequestParam String tenantId,@RequestParam String tenantCode,MultipartFile file) throws IOException { |
| | | String originalFilename = file.getOriginalFilename(); |
| | | if (!"xls".equals(originalFilename.substring(originalFilename.lastIndexOf(".") + 1))){ |
| | | return ResponseValue.error("文件格式有误!"); |
| | | } |
| | | S_user_core currentUser = this.getCurrentUser(); |
| | | if (currentUser==null){ |
| | | return ResponseValue.error("当前登录用户为空"); |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(tenantId)||StringUtils.isEmpty(tenantCode)){ |
| | | return ResponseValue.error("添加时请选择区县"); |
| | | } |
| | | |
| | | List<S_role> roles = this.roleService.select(new S_role()); |
| | | ArrayList<FinSysTenantUser> finSysTenantUsers = new ArrayList<>(); |
| | | |
| | | EasyExcel.read(file.getInputStream(), ImportUserParam.class, new AnalysisEventListener<ImportUserParam>(){ |
| | | @Override |
| | | public void invoke(ImportUserParam data, AnalysisContext context) { |
| | | if (StringUtils.isEmpty(data.getUserName()) || StringUtils.isEmpty(data.getUserCode()) || StringUtils.isEmpty(data.getUserPhone()) || null==data.getSex() |
| | | || StringUtils.isEmpty(data.getEmail()) || null==data.getSeq() || StringUtils.isEmpty(data.getRoleName())){ |
| | | throw new ImportUserParamVerifyException("单元格不能为空!"); |
| | | } |
| | | //根据员工编号查询,如果存在则提示 |
| | | if ( finSysTenantUserService.getByUserCode(data.getUserCode()) > 0) { |
| | | throw new ImportUserParamVerifyException("员工编号为空或已存在!"); |
| | | } |
| | | if (data.getSex()<1&&data.getSex()>0){ |
| | | throw new ImportUserParamVerifyException("性别码只能为 0 或 1"); |
| | | } |
| | | FinSysTenantUser user = new FinSysTenantUser(); |
| | | user.setUserName(data.getUserName()); |
| | | user.setUserCode(data.getUserCode()); |
| | | user.setUserPhone(data.getUserPhone()); |
| | | user.setSex(data.getSex()); |
| | | user.setEmail(data.getEmail()); |
| | | user.setSeq(data.getSeq()); |
| | | user.setTenantId(tenantId); |
| | | user.setTenantCode(tenantCode); |
| | | //设置角色 |
| | | Optional<S_role> sRole = roles.stream().filter(role -> role.getRole_name().equals(data.getRoleName())).findFirst(); |
| | | user.setRoleList(Arrays.asList(sRole.orElse(new S_role()).getRole_id())); |
| | | |
| | | user.setId(NumberGenerator.getLongSequenceNumber()); |
| | | user.setCreateTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | user.setCreateBy(currentUser.getUser_name()); |
| | | user.setUpdateTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | user.setUpdateBy(currentUser.getUser_name()); |
| | | user.setStatus(1);// 0禁用 1启用 |
| | | user.setIsDelete(0);// 是否删除 0是 1否 |
| | | user.setSysUserId(NumberGenerator.getLongSequenceNumber()); |
| | | user.setRemark("批量导入"); |
| | | // 加密手机号 |
| | | String key = PlatformRSAUtils.AES_KEY; |
| | | String pwdPhone = AESUtils.encryptStrAES(data.getUserPhone(), key); |
| | | user.setUserPhone(pwdPhone); |
| | | |
| | | user.setIsDelete(1); |
| | | //怎么获取左侧机构树数据 |
| | | user.setSysDeptId(3L); //对应平台机构id 默认为平台管理 |
| | | finSysTenantUsers.add(user); |
| | | } |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext context) { |
| | | |
| | | } |
| | | @Override |
| | | public void onException(Exception exception, AnalysisContext context) throws Exception { |
| | | if (exception!=null){ |
| | | // 如果是某一个单元格的转换异常 能获取到具体行号 封装时异常 |
| | | if (exception instanceof ExcelDataConvertException) { |
| | | ExcelDataConvertException excelDataConvertException = (ExcelDataConvertException)exception; |
| | | logger.error("第{}行,第{}列解析异常,数据为:{}",excelDataConvertException.getRowIndex(), |
| | | excelDataConvertException.getColumnIndex()+1, excelDataConvertException.getCellData().getStringValue()); |
| | | throw new IllegalStateException("第"+(excelDataConvertException.getRowIndex()+1)+"行,第"+(excelDataConvertException.getColumnIndex()+1)+"列解析异常,异常数据为:[ "+excelDataConvertException.getCellData().getStringValue()+" ]"); |
| | | } |
| | | if (exception instanceof ImportUserParamVerifyException){ |
| | | throw new IllegalStateException("第"+context.readSheetHolder().getRowIndex()+"行, 解析错误:[ "+ exception.getMessage()+" ]"); |
| | | } |
| | | throw exception; |
| | | } |
| | | } |
| | | }).sheet().doRead(); |
| | | |
| | | insertUserAndUserCoreBatch(finSysTenantUsers); |
| | | |
| | | return ResponseValue.success(); |
| | | } |
| | | |
| | | /** |
| | | * 批量插入用户表和平台用户表 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void insertUserAndUserCoreBatch(List<FinSysTenantUser> finSysTenantUsers){ |
| | | ArrayList<S_user_core> sUserCores = new ArrayList<>(); |
| | | for (FinSysTenantUser user : finSysTenantUsers) { |
| | | // 插入平台用户 |
| | | S_user_core userCore = new S_user_core(); |
| | | userCore.setId(user.getSysUserId()); |
| | | userCore.setDept_id(3L); //部门id,目前写死 |
| | | userCore.setOrg_id(user.getSysDeptId()); //机构id |
| | | userCore.setOrg_id(1L); |
| | | userCore.setUser_name(user.getUserCode()); //用户账号 |
| | | userCore.setNick_name(user.getUserName()); |
| | | //用户类型 先默认设置为2 |
| | | userCore.setUser_type(2); |
| | | userCore.setPhonenumber(user.getUserPhone()); |
| | | userCore.setSex(user.getSex().toString()); |
| | | //初始化密码 123456 |
| | | String pws = this.getArgumentVariable(ArgumentsConstants.KEY_SECURITY_PASSWORD_INIT).getStringValue(); |
| | | userCore.setPassword(pws); |
| | | // 平台用户表和系统用户 表状态相反 |
| | | if (user.getStatus() == 0) { |
| | | user.setStatus(1); |
| | | } else { |
| | | user.setStatus(0); |
| | | } |
| | | userCore.setStatus(user.getStatus()); |
| | | userCore.setDel_flag(0); |
| | | userCore.setCreate_by(this.getCurrentUser().getUser_name()); |
| | | userCore.setCreate_time(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | userCore.setRemark(user.getRemark()); |
| | | userCore.setType(1); |
| | | userCore.setBind_client_id("0"); |
| | | userCore.setBind_wechat(0); |
| | | userCore.setModify_pwd(0); |
| | | userCore.setBind_mobile(0); |
| | | userCore.setBind_mail(0); |
| | | userCore.setProfile_id(0L); |
| | | userCore.setIs_wechat_public(0); |
| | | userCore.setIs_wechat_routine(0); |
| | | userCore.setIs_wechat_ios(0); |
| | | userCore.setIs_wechat_android(0); |
| | | userCore.setIs_logoff(0); |
| | | userCore.setLogoff_time(0L); |
| | | userCore.setIs_sms(0); |
| | | //管理员类型:1= 平台超管, 2=商户超管, 3=系统管理员,4=商户管理员 |
| | | userCore.setType(1); |
| | | //商户id,0-平台 |
| | | userCore.setMer_id(0L); |
| | | sUserCores.add(userCore); |
| | | } |
| | | //保存用户信息 |
| | | this.finSysTenantUserService.insertBatch(finSysTenantUsers); |
| | | //保存平台用户信息 |
| | | this.userService.insertBatch(sUserCores); |
| | | //保存角色权限信息 |
| | | this.finSysTenantUserService.execInsertRoleUserList(finSysTenantUsers); |
| | | } |
| | | |
| | | public static class ImportUserParamVerifyException extends RuntimeException{ |
| | | public ImportUserParamVerifyException(){super();} |
| | | public ImportUserParamVerifyException(String message){super(message);} |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @Description 编辑 |
| | | * @Author wh |
| | | * @Date 2023/7/17 14:33 |
| | | */ |
| | | @PostMapping("/update") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ResponseValue update(@RequestBody FinSysTenantUser user) { |
| | | if (user == null) { |
| | | return ResponseValue.error("参数为空"); |
| | | } |
| | | String key = PlatformRSAUtils.AES_KEY; |
| | | String pwdPhone = ""; |
| | | if (user.getUserPhone() != null) { |
| | | pwdPhone = AESUtils.encryptStrAES(user.getUserPhone(), key); |
| | | } |
| | | user.setUserPhone(pwdPhone); |
| | | // 1.更新系统用户 FIN_SYS_TENANT_USER |
| | | finSysTenantUserService.update(user); |
| | | // 2.更新平台用户 S_USER_CORE |
| | | S_user_core userCore = new S_user_core(); |
| | | userCore.setId(user.getSysUserId()); |
| | | userCore.setUpdate_by(this.getCurrentUser().getUser_name()); |
| | | userCore.setUpdate_time(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | // 平台用户表和系统用户 表状态相反 |
| | | if (user.getStatus() == 0) { |
| | | user.setStatus(1); |
| | | } else { |
| | | user.setStatus(0); |
| | | } |
| | | userCore.setStatus(user.getStatus()); |
| | | if (user.getSex() != null) { |
| | | userCore.setSex(user.getSex().toString()); |
| | | } |
| | | userCore.setRemark(user.getRemark()); |
| | | userCore.setNick_name(user.getUserName()); |
| | | // 加密手机号 |
| | | userCore.setPhonenumber(user.getUserPhone()); |
| | | this.userService.update(userCore); |
| | | // 3. 更新角色配置 S_ROLE_USER |
| | | // 1. 根据 user.getSysUserId() 查询 |
| | | List<S_role> list = finSysTenantUserService.getByUserId(user.getSysUserId()); //已有的权限 |
| | | List<Long> roleList = user.getRoleList(); //选择的权限 |
| | | //先删除再添加 |
| | | if (list != null && list.size() > 0) { |
| | | finSysTenantUserService.execDelRoleUserList(user.getSysUserId()); |
| | | } |
| | | if (roleList != null && roleList.size() > 0) { |
| | | finSysTenantUserService.execInsertRoleUserList(roleList, user.getSysUserId()); |
| | | } |
| | | this.getFinSysTenantUserCache().remove(user.getSysUserId() + ""); |
| | | return ResponseValue.success(1); |
| | | } |
| | | |
| | | /** |
| | | * @Description 状态修改/逻辑删除 |
| | | * @Author wh |
| | | * @Date 2023/7/17 14:35 |
| | | */ |
| | | @PostMapping("/updateStatus") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ResponseValue updateStatus(@RequestBody FinSysTenantUser user) { |
| | | if (user == null) { |
| | | return ResponseValue.error("参数为空"); |
| | | } |
| | | // 1.更新系统用户 FIN_SYS_TENANT_USER 应该是查询 然后只改状态 |
| | | List<FinSysTenantUser> select = finSysTenantUserService.select(new FinSysTenantUser(user.getId())); |
| | | if (select == null || select.size() == 0) { |
| | | return ResponseValue.error("用户不存在"); |
| | | } |
| | | FinSysTenantUser finSysTenantUser = select.get(0); |
| | | finSysTenantUser.setStatus(user.getStatus()); |
| | | finSysTenantUserService.update(finSysTenantUser); |
| | | // 2.更新平台用户 S_USER_CORE |
| | | S_user_core userCore = new S_user_core(); |
| | | userCore.setId(user.getSysUserId()); |
| | | userCore.setUpdate_by(this.getCurrentUser().getUser_name()); |
| | | userCore.setUpdate_time(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | // 平台用户表和系统用户 表状态相反 |
| | | if (user.getStatus() == 0) { |
| | | user.setStatus(1); |
| | | } else { |
| | | user.setStatus(0); |
| | | } |
| | | userCore.setStatus(user.getStatus()); |
| | | this.userService.update(userCore); |
| | | return ResponseValue.success(1); |
| | | } |
| | | |
| | | /** |
| | | * @Description 密码初始化 |
| | | * @Author wh |
| | | * @Date 2023/7/17 14:36 |
| | | */ |
| | | @PostMapping("/defaultPassword") |
| | | public ResponseValue defaultPassword(@RequestBody FinSysTenantUser finSysTenantUser) { |
| | | if (finSysTenantUser == null) { |
| | | return ResponseValue.error("用户信息不存在"); |
| | | } |
| | | //初始化密码 123456 |
| | | String stringValue = this.getArgumentVariable(ArgumentsConstants.KEY_SECURITY_PASSWORD_INIT).getStringValue();// 密文 |
| | | // 1. 修改用户表 |
| | | //用户表id |
| | | Long sysUserId = finSysTenantUser.getSysUserId(); |
| | | S_user_core userCore = new S_user_core(); |
| | | userCore.setId(sysUserId); |
| | | userCore.setPassword(stringValue); |
| | | userCore.setModify_pwd(0); |
| | | userService.update(userCore); |
| | | // 2. 修改平台用户(不用修改) |
| | | return ResponseValue.success(1); |
| | | } |
| | | |
| | | /** |
| | | * @Description 根据id获取用户信息 |
| | | * @Author wh |
| | | * @Date 2023/7/17 14:38 |
| | | */ |
| | | @GetMapping("/detail") |
| | | public ResponseValue detail(Long id) { |
| | | if (id == null || id.longValue() <= 0) { |
| | | return ResponseValue.error("用户信息不存在"); |
| | | } |
| | | |
| | | FinSysTenantUser finSysTenantUser = this.finSysTenantUserService.get(new FinSysTenantUser(id)); |
| | | if (finSysTenantUser == null) { |
| | | return ResponseValue.error("用户信息不存在"); |
| | | } |
| | | String s = AESUtils.decryptStrAES(finSysTenantUser.getUserPhone(), PlatformRSAUtils.AES_KEY); |
| | | |
| | | finSysTenantUser.setUserPhone(s); |
| | | Long sysUserId = finSysTenantUser.getSysUserId(); |
| | | List<S_role> list = finSysTenantUserService.getByUserId(sysUserId); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("list", list); |
| | | map.put("data", finSysTenantUser); |
| | | return ResponseValue.success(map); |
| | | } |
| | | |
| | | /** |
| | | * 得到 当前登录用户的信息 |
| | | * 增加 父类机构的code |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping("/getCurInfo") |
| | | public ResponseValue getCurInfo() { |
| | | |
| | | FinSysTenantUser sysInfo = getSysInfo(); |
| | | if (sysInfo != null || sysInfo.getLv() > 0) { |
| | | // 解密手机号 |
| | | String key = PlatformRSAUtils.AES_KEY; |
| | | String userPhone = sysInfo.getUserPhone(); |
| | | if (userPhone != null) { |
| | | sysInfo.setUserPhone(AESUtils.decryptStrAES(userPhone, key)); |
| | | } |
| | | |
| | | // 查询 用户角色 TODO 临时解决 将来放配置文件中 |
| | | List<S_role> list = finSysTenantUserService.getByUserId(sysInfo.getSysUserId()); //已有的权限 |
| | | for (S_role s_role : list) { |
| | | if (s_role.getRole_id() != null && s_role.getRole_id().equals(1690961420053L)) { |
| | | sysInfo.setKfStatus(1); |
| | | } |
| | | } |
| | | |
| | | // 查询父类的orgcode 需要将自己的org先查出来 再根据parentid 查父类 |
| | | String tenantId = sysInfo.getTenantId(); |
| | | if (tenantId != null && !tenantId.equals("")) { |
| | | List<FinSysTenant> select = finSysTenantService.select(new FinSysTenant(Long.valueOf(tenantId))); |
| | | if (select != null && select.size() > 0) { |
| | | FinSysTenant finSysTenant = select.get(0); |
| | | if (finSysTenant != null && finSysTenant.getParentId() != null) { |
| | | List<FinSysTenant> parents = finSysTenantService.select(new FinSysTenant(finSysTenant.getParentId())); |
| | | if (parents != null && parents.size() > 0) { |
| | | sysInfo.setParentCode(parents.get(0).getCode()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | return ResponseValue.success(sysInfo); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 更新角色权限 |
| | | * |
| | | * @param user |
| | | * @return |
| | | */ |
| | | @PostMapping("/updRole") |
| | | public ResponseValue updRole(@RequestBody FinSysTenantUser user) { |
| | | if (user == null) { |
| | | return ResponseValue.error("参数为空"); |
| | | } |
| | | // 1. 根据 user.getSysUserId() 查询 |
| | | List<S_role> list = finSysTenantUserService.getByUserId(user.getSysUserId()); //已有的权限 |
| | | List<Long> roleList = user.getRoleList(); //选择的权限 |
| | | //先删除再添加 |
| | | if (list != null && list.size() > 0) { |
| | | finSysTenantUserService.execDelRoleUserList(user.getSysUserId()); |
| | | } |
| | | if (roleList != null && roleList.size() > 0) { |
| | | finSysTenantUserService.execInsertRoleUserList(roleList, user.getSysUserId()); |
| | | } |
| | | return ResponseValue.success(1); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @Description 新增 |
| | | * @Author llb |
| | | * @Date 2023/7/17 15:56 |
| | | */ |
| | | @PostMapping("/addSupplier") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ResponseValue addSupplier(@RequestBody FinSysTenantUser user) { |
| | | if (user == null) { |
| | | return ResponseValue.error("参数为空"); |
| | | } |
| | | // 获取运维管理 |
| | | List<S_dept> depts = this.finSysTenantUserService.selectDept(roleName); |
| | | if (depts == null || depts.size() == 0) { |
| | | return ResponseValue.error(roleName + "的角色不存在"); |
| | | } |
| | | //根据员工编号查询,如果存在则提示 |
| | | if (finSysTenantUserService.getByUserCode(user.getUserCode()) != null && finSysTenantUserService.getByUserCode(user.getUserCode()) > 0) { |
| | | return ResponseValue.error("员工编号重复"); |
| | | } |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | //插入系统用户 |
| | | user.setId(NumberGenerator.getLongSequenceNumber()); |
| | | user.setCreateTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | user.setCreateBy(this.getCurrentUser().getUser_name()); |
| | | user.setUpdateTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | user.setUpdateBy(this.getCurrentUser().getUser_name()); |
| | | user.setIsDelete(0);// 是否删除 0是 1否 |
| | | user.setSysUserId(NumberGenerator.getLongSequenceNumber()); |
| | | user.setIsDelete(1); |
| | | user.setLv(sysInfo.getLv()); |
| | | user.setTenantCode(sysInfo.getTenantCode()); |
| | | user.setTenantId(sysInfo.getTenantId()); |
| | | user.setSysDeptId(2l); //运维管理 |
| | | // 加密手机号 |
| | | String key = PlatformRSAUtils.AES_KEY; |
| | | String userPhone = user.getUserPhone(); |
| | | String pwdPhone = ""; |
| | | if (userPhone != null) { |
| | | pwdPhone = AESUtils.encryptStrAES(userPhone, key); |
| | | user.setUserPhone(pwdPhone); |
| | | } |
| | | |
| | | this.finSysTenantUserService.insert(user); |
| | | // 插入平台用户 |
| | | S_user_core userCore = new S_user_core(); |
| | | userCore.setId(user.getSysUserId()); |
| | | userCore.setDept_id(depts.get(0).getId()); //部门 |
| | | userCore.setOrg_id(1L); |
| | | //userCore.setUser_name(); //用户账号 |
| | | userCore.setUser_name(user.getUserCode()); //用户账号 |
| | | userCore.setNick_name(user.getUserName()); |
| | | //用户类型 先默认设置为2 |
| | | userCore.setUser_type(2); |
| | | |
| | | userCore.setPhonenumber(userPhone); |
| | | //初始化密码 123456 |
| | | String pws = this.getArgumentVariable(ArgumentsConstants.KEY_SECURITY_PASSWORD_INIT).getStringValue(); |
| | | userCore.setPassword(pws); |
| | | if (user.getStatus() == 0) { |
| | | userCore.setStatus(1); |
| | | } else { |
| | | userCore.setStatus(0); |
| | | } |
| | | userCore.setDel_flag(0); |
| | | userCore.setCreate_by(this.getCurrentUser().getCreate_by()); |
| | | userCore.setCreate_time(DateUtils.getDateTimeNumber()); |
| | | userCore.setRemark(user.getRemark()); |
| | | userCore.setType(1); |
| | | userCore.setBind_client_id("0"); |
| | | userCore.setBind_wechat(0); |
| | | userCore.setModify_pwd(0); |
| | | userCore.setBind_mobile(0); |
| | | userCore.setBind_mail(0); |
| | | userCore.setProfile_id(0L); |
| | | userCore.setIs_wechat_public(0); |
| | | userCore.setIs_wechat_routine(0); |
| | | userCore.setIs_wechat_ios(0); |
| | | userCore.setIs_wechat_android(0); |
| | | userCore.setIs_logoff(0); |
| | | userCore.setLogoff_time(0L); |
| | | userCore.setIs_sms(0); |
| | | //管理员类型:1= 平台超管, 2=商户超管, 3=系统管理员,4=商户管理员 |
| | | userCore.setType(2); |
| | | //商户id,0-平台 |
| | | userCore.setMer_id(0L); |
| | | this.userService.insert(userCore); |
| | | // 插入平台机构 |
| | | //少角色id |
| | | List<Long> roleList = user.getRoleList(); //机构id 多个 |
| | | Long sysUserId = user.getSysUserId(); //用户id |
| | | this.finSysTenantUserService.execInsertRoleUserList(roleList, sysUserId); |
| | | return ResponseValue.success(1); |
| | | } |
| | | |
| | | private Set<String> picFormatArr = new HashSet<String>() {{ |
| | | add(".pjp"); |
| | | add(".svgz"); |
| | | add(".jxl"); |
| | | add(".jpeg"); |
| | | add(".ico"); |
| | | add(".avif"); |
| | | add(".tif"); |
| | | add(".gif"); |
| | | add(".jfif"); |
| | | add(".jpg"); |
| | | add(".svg"); |
| | | add(".png"); |
| | | add(".xbm"); |
| | | add(".pjpeg"); |
| | | add(".bmp"); |
| | | add(".webp"); |
| | | }}; |
| | | |
| | | @PostMapping("/updatePerson") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ResponseValue updatePerson(@RequestBody FinSysTenantUser user) { |
| | | if (user == null) { |
| | | return ResponseValue.error("参数为空"); |
| | | } |
| | | FinSysTenantUser sysInfo = getSysInfo(); |
| | | if (sysInfo == null) { |
| | | return ResponseValue.error("用户信息不存在"); |
| | | } |
| | | String avatar = user.getAvatar(); |
| | | if (!picFormatArr.contains(avatar.substring(avatar.lastIndexOf(".")))) { |
| | | return ResponseValue.error("头像格式不允许"); |
| | | } |
| | | FinSysTenantUser updUser = new FinSysTenantUser(); |
| | | updUser.setId(sysInfo.getId()); |
| | | updUser.setAvatar(user.getAvatar()); |
| | | updUser.setEmail(user.getEmail()); |
| | | updUser.setUserName(user.getUserName()); |
| | | updUser.setSex(user.getSex()); |
| | | String pwdPhone = ""; |
| | | if (user.getUserPhone() != null) { |
| | | String key = PlatformRSAUtils.AES_KEY; |
| | | pwdPhone = AESUtils.encryptStrAES(user.getUserPhone(), key); |
| | | } |
| | | updUser.setUserPhone(pwdPhone); |
| | | // 1.更新系统用户 FIN_SYS_TENANT_USER |
| | | finSysTenantUserService.update(updUser); |
| | | // 2.更新平台用户 S_USER_CORE |
| | | S_user_core userCore = new S_user_core(); |
| | | userCore.setId(sysInfo.getSysUserId()); |
| | | userCore.setUpdate_by(this.getCurrentUser().getUser_name()); |
| | | userCore.setUpdate_time(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | userCore.setNick_name(updUser.getUserName()); |
| | | userCore.setEmail(updUser.getEmail()); |
| | | // 加密手机号 |
| | | userCore.setPhonenumber(updUser.getUserPhone()); |
| | | this.userService.update(userCore); |
| | | this.getFinSysTenantUserCache().remove(String.valueOf(sysInfo.getSysUserId())); |
| | | this.getUserCacheProvider().removeUser(sysInfo.getSysUserId()); |
| | | return ResponseValue.success(1); |
| | | } |
| | | |
| | | /** |
| | | * @Description 修改密码 |
| | | */ |
| | | @PostMapping("/updatePassword") |
| | | public ResponseValue updatePassword(@RequestBody FinSysTenantUserUpdParam param) { |
| | | String oldMixPd = param.getOldMixPd(); |
| | | String newMixPd = param.getNewMixPd(); |
| | | String btnMixPd = param.getBtnMixPd(); |
| | | //校验参数 |
| | | if (StringUtils.isEmpty(oldMixPd) || StringUtils.isEmpty(newMixPd) || StringUtils.isEmpty(btnMixPd)) { |
| | | return ResponseValue.error("信息不能为空!"); |
| | | } |
| | | FinSysTenantUser sysInfo = getSysInfo(); |
| | | if (sysInfo == null) { |
| | | return ResponseValue.error("用户信息不存在"); |
| | | } |
| | | //校验俩次输入的密码 |
| | | btnMixPd = PlatformRSAUtils.getRsaDecryptValue(btnMixPd, PlatformRSAUtils.PRIK); |
| | | newMixPd = PlatformRSAUtils.getRsaDecryptValue(newMixPd, PlatformRSAUtils.PRIK); |
| | | if (!newMixPd.equals(btnMixPd)) { |
| | | return ResponseValue.error("新密码与确认密码不一致!"); |
| | | } |
| | | // 数字+字母+特殊符合,最少8位 |
| | | if (StringUtils.isEmpty(btnMixPd) || btnMixPd.length() < 8 || btnMixPd.length() > 12) { |
| | | return ResponseValue.error("密码级别过低,请输入:8-12个字符"); |
| | | } |
| | | String validatePasswordRule = this.validatePasswordRule(btnMixPd); |
| | | if (validatePasswordRule != null) { |
| | | return ResponseValue.error(validatePasswordRule); |
| | | } |
| | | //用户表id |
| | | Long sysUserId = sysInfo.getSysUserId(); |
| | | S_user_core queryU = new S_user_core(); |
| | | queryU.setId(sysUserId); |
| | | S_user_core queryUserInfo = userService.get(queryU); |
| | | if (queryUserInfo == null) { |
| | | return ResponseValue.error("用户信息不存在"); |
| | | } |
| | | oldMixPd = PlatformRSAUtils.getRsaDecryptValue(oldMixPd, PlatformRSAUtils.PRIK); |
| | | //校验老密码 |
| | | if (!this.matchesPassword(oldMixPd, queryUserInfo.getPassword())) { |
| | | return ResponseValue.error("旧密码输入有误!"); |
| | | } |
| | | if (oldMixPd.equalsIgnoreCase(btnMixPd)) { |
| | | return ResponseValue.error("新密码不能与旧密码相同!"); |
| | | } |
| | | //更新数据库 |
| | | // 1. 修改用户表 |
| | | queryU.setPassword(this.encryptPassword(btnMixPd)); |
| | | queryU.setModify_pwd(1); |
| | | userService.update(queryU); |
| | | // 2. 修改平台用户(不用修改) |
| | | return ResponseValue.success(1); |
| | | } |
| | | } |
New file |
| | |
| | | package com.consum.base.pojo; |
| | | |
| | | import com.walker.web.param.ParamRequest; |
| | | |
| | | public class FinSysTenantUserSearchParam extends ParamRequest { |
| | | |
| | | // 用户姓名 |
| | | private String userName; |
| | | |
| | | private String userCode; |
| | | |
| | | // 供应商id |
| | | private Long supplierId; |
| | | |
| | | private Integer status; |
| | | |
| | | private Long projectId; |
| | | |
| | | |
| | | private String roleId; |
| | | |
| | | // 用户手机号 |
| | | private String userPhone; |
| | | |
| | | // 区域号 |
| | | private long tenantCode; |
| | | |
| | | // 1 是财政用户 2 是客服 |
| | | private Integer type; |
| | | |
| | | // 绑定CTI客服 |
| | | private Integer ctiStatus; |
| | | |
| | | private Long startTime; |
| | | |
| | | private Long endTime; |
| | | |
| | | private Long userId; |
| | | |
| | | private Long sysUserId; |
| | | |
| | | public Long getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(Long userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public Long getSysUserId() { |
| | | return sysUserId; |
| | | } |
| | | |
| | | public void setSysUserId(Long sysUserId) { |
| | | this.sysUserId = sysUserId; |
| | | } |
| | | |
| | | public Long getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(Long startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public Long getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(Long endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | |
| | | public Integer getCtiStatus() { |
| | | return ctiStatus; |
| | | } |
| | | |
| | | public void setCtiStatus(Integer ctiStatus) { |
| | | this.ctiStatus = ctiStatus; |
| | | } |
| | | |
| | | public Long getProjectId() { |
| | | return projectId; |
| | | } |
| | | |
| | | public void setProjectId(Long projectId) { |
| | | this.projectId = projectId; |
| | | } |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getRoleId() { |
| | | return roleId; |
| | | } |
| | | |
| | | public void setRoleId(String roleId) { |
| | | this.roleId = roleId; |
| | | } |
| | | |
| | | public String getUserCode() { |
| | | return userCode; |
| | | } |
| | | |
| | | |
| | | public Integer getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(Integer status) { |
| | | this.status = status; |
| | | } |
| | | public void setUserCode(String userCode) { |
| | | this.userCode = userCode; |
| | | } |
| | | |
| | | public long getTenantCode() { |
| | | return tenantCode; |
| | | } |
| | | |
| | | public void setTenantCode(long tenantCode) { |
| | | this.tenantCode = tenantCode; |
| | | } |
| | | |
| | | public String getUserName() { |
| | | return userName; |
| | | } |
| | | |
| | | public void setUserName(String userName) { |
| | | this.userName = userName; |
| | | } |
| | | |
| | | public String getUserPhone() { |
| | | return userPhone; |
| | | } |
| | | |
| | | public void setUserPhone(String userPhone) { |
| | | this.userPhone = userPhone; |
| | | } |
| | | |
| | | |
| | | public Long getSupplierId() { |
| | | return supplierId; |
| | | } |
| | | |
| | | public void setSupplierId(Long supplierId) { |
| | | this.supplierId = supplierId; |
| | | } |
| | | } |
New file |
| | |
| | | package com.consum.base.pojo; |
| | | |
| | | import com.walker.web.param.ParamRequest; |
| | | |
| | | /** |
| | | * @ClassName FinSysTenantUserUpdParam |
| | | * @Author cy |
| | | * @Date 2023/9/6 |
| | | * @Description |
| | | * @Version 1.0 |
| | | **/ |
| | | public class FinSysTenantUserUpdParam extends ParamRequest { |
| | | private String oldMixPd; |
| | | private String newMixPd; |
| | | private String btnMixPd; |
| | | |
| | | public String getOldMixPd() { |
| | | return oldMixPd; |
| | | } |
| | | |
| | | public void setOldMixPd(String oldMixPd) { |
| | | this.oldMixPd = oldMixPd; |
| | | } |
| | | |
| | | public String getNewMixPd() { |
| | | return newMixPd; |
| | | } |
| | | |
| | | public void setNewMixPd(String newMixPd) { |
| | | this.newMixPd = newMixPd; |
| | | } |
| | | |
| | | public String getBtnMixPd() { |
| | | return btnMixPd; |
| | | } |
| | | |
| | | public void setBtnMixPd(String btnMixPd) { |
| | | this.btnMixPd = btnMixPd; |
| | | } |
| | | } |
| | |
| | | if (param.getStates() != null) { |
| | | sql.append(" and status =:status "); |
| | | paramts.put("status", param.getStates()); |
| | | } else { |
| | | sql.append(" and states !=3 "); |
| | | } |
| | | sql.append(" ORDER BY ORDER_NUMBER,CREATE_TIME DESC "); |
| | | return selectSplit(sql.toString(), paramts, new BaseCategory()); |
| | |
| | | } |
| | | |
| | | /** |
| | | * @Description 根据节点id删除节点(逻辑删除) |
| | | * @Description 根据id删除物品分类 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/23 |
| | | */ |
| | |
| | | package com.consum.base.service; |
| | | |
| | | import com.consum.base.Constants; |
| | | import com.consum.base.util.IdUtil; |
| | | import com.consum.model.po.BaseCategory; |
| | | import com.consum.model.po.BaseGoodsModels; |
| | | import com.consum.model.po.BaseGoodsTemplate; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.DateUtils; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.HashMap; |
| | | |
| | | /** |
| | | * @Description 物品模板 |
| | |
| | | @Service |
| | | public class BaseGoodsModelsServiceImpl extends BaseServiceImpl { |
| | | |
| | | /** |
| | | * @Description 规格列表查询(根据物品id查询规格型号) |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/25 |
| | | */ |
| | | public GenericPager<BaseGoodsModels> queryList(Long goodsTemplatesId) { |
| | | StringBuilder sql = new StringBuilder("SELECT * FROM base_goods_models WHERE 1 = 1 "); |
| | | HashMap<String, Object> paramts = new HashMap<>(); |
| | | |
| | | //物品模板id |
| | | sql.append(" and goods_templates_id =:goods_templates_id "); |
| | | paramts.put("goods_templates_id", goodsTemplatesId); |
| | | |
| | | sql.append(" and states !=3 ORDER BY CREATE_TIME DESC "); |
| | | return selectSplit(sql.toString(), paramts, new BaseGoodsModels()); |
| | | } |
| | | |
| | | /** |
| | | * @Description 根据 型号名称和物品模板id 查询规格型号 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/25 |
| | | */ |
| | | public BaseGoodsModels getByModelNameAndGoodsTemplatesId(BaseGoodsModels models) { |
| | | StringBuilder sql = new StringBuilder("SELECT * FROM base_goods_models WHERE 1 = 1 "); |
| | | HashMap<String, Object> paramts = new HashMap<>(); |
| | | |
| | | //规格型号名称 |
| | | sql.append(" and MODEL_NAME =:MODEL_NAME "); |
| | | paramts.put("MODEL_NAME", models.getModelName()); |
| | | //物品模板id |
| | | sql.append(" and GOODS_TEMPLATES_ID =:GOODS_TEMPLATES_ID "); |
| | | paramts.put("GOODS_TEMPLATES_ID", models.getGoodsTemplatesId()); |
| | | |
| | | return this.get(sql.toString(), paramts, new BaseGoodsModels()); |
| | | } |
| | | |
| | | /** |
| | | * @Description 新增 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/23 |
| | | */ |
| | | public int add(BaseGoodsModels models) { |
| | | models.setId(IdUtil.generateId()); |
| | | models.setCreateTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | return this.insert(models); |
| | | } |
| | | |
| | | /** |
| | | * 修改状态 |
| | | * @author 卢庆阳 |
| | | * @date 2023/10/25 |
| | | */ |
| | | public int updateStatus(BaseGoodsModels models) { |
| | | return this.update(models); |
| | | } |
| | | |
| | | /** |
| | | * @Description 根据id删除规格型号 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/25 |
| | | */ |
| | | public int updateById(BaseGoodsModels models) { |
| | | models.setStates(Constants.STATES_DELETED); |
| | | return this.update(models); |
| | | } |
| | | } |
| | |
| | | if (param.getStates() != null) { |
| | | sql.append(" and states =:states "); |
| | | paramts.put("states", param.getStates()); |
| | | } else { |
| | | sql.append(" and states !=3 "); |
| | | } |
| | | sql.append(" ORDER BY CREATE_DATE DESC "); |
| | | |
| | |
| | | |
| | | return this.get(sql.toString(), paramts, new BaseGoodsTemplate()); |
| | | } |
| | | |
| | | /** |
| | | * 修改状态 |
| | | * @author 卢庆阳 |
| | | * @date 2023/10/25 |
| | | */ |
| | | public int updateStatus(BaseGoodsTemplate goodsTemplate) { |
| | | return this.update(goodsTemplate); |
| | | } |
| | | |
| | | /** |
| | | * @Description 根据物品id删除物品 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/25 |
| | | */ |
| | | public int updateById(BaseGoodsTemplate goodsTemplate, S_user_core currentUser) { |
| | | goodsTemplate.setStates(Constants.STATES_DELETED); |
| | | //删除时间 |
| | | goodsTemplate.setDTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | //删除人id和删除人姓名 |
| | | goodsTemplate.setDUserId(currentUser.getId()); |
| | | goodsTemplate.setDUserName(currentUser.getUser_name()); |
| | | return this.update(goodsTemplate); |
| | | } |
| | | } |
New file |
| | |
| | | package com.consum.base.service; |
| | | |
| | | import com.consum.model.po.FinSysOrg; |
| | | import com.iplatform.model.po.S_dept; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class FinOrgServiceImpl extends BaseServiceImpl { |
| | | |
| | | private static final String QUERY_SYS_ORG_BY_TENANT_ID = "select * from FIN_SYS_ORG where TENANT_ID = ?"; |
| | | private static final String QUERY_TREE_ALL = "select * from FIN_SYS_ORG where org_type = ? order by parent_id, LV ASC"; |
| | | private static final String QUERY_TREE_ONE = "select * from FIN_SYS_ORG where org_type = ? and parent_id = ? order by parent_id, LV ASC"; |
| | | private static final String QUERY_SYS_ORG_BY_ORGID = "SELECT * FROM FIN_SYS_ORG WHERE PARENT_ID IN (\n" + |
| | | "SELECT PARENT_ID FROM FIN_SYS_ORG where ID = ? AND ORG_TYPE = ?) ORDER BY ORG_CODE ASC"; |
| | | |
| | | /** |
| | | * 根据机构代码,查询唯一机构对象。 |
| | | * @param orgCode |
| | | * @return |
| | | * @date 2023-07-05 |
| | | */ |
| | | public FinSysOrg queryOneByCode(String orgCode){ |
| | | FinSysOrg org = new FinSysOrg(); |
| | | org.setOrgCode(orgCode); |
| | | List<FinSysOrg> orgList = this.select(org); |
| | | if(!StringUtils.isEmptyList(orgList)){ |
| | | return orgList.get(0); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 批量写入新的机构集合。 |
| | | * @param finSysOrgList |
| | | * @date 2023-07-05 |
| | | */ |
| | | public List<S_dept> execBatchInsertOrgList(List<FinSysOrg> finSysOrgList){ |
| | | if(StringUtils.isEmptyList(finSysOrgList)){ |
| | | return null; |
| | | } |
| | | List<S_dept> deptList = new ArrayList<>(finSysOrgList.size()); |
| | | for(FinSysOrg e : finSysOrgList){ |
| | | deptList.add(this.acquirePlatformDept(e)); |
| | | } |
| | | this.insertBatch(deptList); |
| | | this.insertBatch(finSysOrgList); |
| | | return deptList; |
| | | } |
| | | |
| | | private S_dept acquirePlatformDept(FinSysOrg finSysOrg){ |
| | | S_dept dept = new S_dept(); |
| | | dept.setId(Long.valueOf(finSysOrg.getId())); // FinSysOrg 的id 和partentId 这里改成String类型了 |
| | | dept.setDept_name(finSysOrg.getName()); |
| | | dept.setOrder_num(finSysOrg.getOrderNum()); |
| | | dept.setOrg_type(finSysOrg.getOrgType()); |
| | | dept.setCreate_time(finSysOrg.getCreateTime()); |
| | | |
| | | if(finSysOrg.getParentId() != null){ |
| | | //if(finSysOrg.getParentId().longValue() == 0){ |
| | | if(finSysOrg.getParentId() == null){ |
| | | // 父节点不存在, |
| | | dept.setAncestors("0"); |
| | | } else { |
| | | dept.setAncestors(String.valueOf(finSysOrg.getParentId())); |
| | | } |
| | | dept.setOrg_id(Long.valueOf(finSysOrg.getParentId())); |
| | | dept.setParent_id(Long.valueOf(finSysOrg.getParentId())); |
| | | } else { |
| | | dept.setAncestors("0"); |
| | | dept.setOrg_id(dept.getId()); |
| | | dept.setParent_id(0L); |
| | | } |
| | | return dept; |
| | | } |
| | | |
| | | /** |
| | | * @Description 查询机构树 |
| | | * @Author wh |
| | | * @Date 2023/7/11 11:32 |
| | | */ |
| | | public List<FinSysOrg> queryOrgListForTree(int orgType, Long parentId) { |
| | | if (parentId <= 0) { |
| | | // 展示全部节点 |
| | | return this.select(QUERY_TREE_ALL, new Object[]{orgType}, new FinSysOrg()); |
| | | } else { |
| | | // 显示指定下级 |
| | | return this.select(QUERY_TREE_ONE, new Object[]{orgType, parentId}, new FinSysOrg()); |
| | | } |
| | | } |
| | | |
| | | public List<FinSysOrg> getAllSysOrgByPhone(String orgId, Integer orgType) { |
| | | return this.select(QUERY_SYS_ORG_BY_ORGID, new Object[]{orgId, orgType}, new FinSysOrg()); |
| | | } |
| | | |
| | | public List<FinSysOrg> getByTenantId(String tenantId) { |
| | | return this.select(QUERY_SYS_ORG_BY_TENANT_ID, new Object[]{tenantId}, new FinSysOrg()); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.consum.base.pojo.FinSysTenantParam; |
| | | import com.consum.model.po.FinSysTenant; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.walker.infrastructure.utils.CollectionUtils; |
| | | import com.walker.infrastructure.utils.DateUtils; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Description 系统机构 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/23 |
| | | */ |
| | | @Service |
| | | public class FinSysTenantServiceImpl extends BaseServiceImpl { |
| | | |
| | | private static final String QUERY_BY_PARENT_CODE = "SELECT * FROM fin_sys_tenant WHERE CODE = ?"; |
| | | private static final String QUERY_TREE_ALL = "select * from FIN_SYS_TENANT where is_delete = 0 and status = 1 order by parent_id, LV ASC"; |
| | | private static final String QUERY_TREE_BY_CODE = "SELECT * FROM FIN_SYS_TENANT "; |
| | | private static final String QUERY_BY_PARENT_ID = "SELECT * FROM FIN_SYS_TENANT WHERE parent_id = ?"; |
| | | private static final String QUERY_BY_PARENT_CODE = "SELECT * FROM FIN_SYS_TENANT WHERE CODE = ?"; |
| | | private static final String QUERY_LIST_BY_CITY_CODE = "SELECT ID, NAME, CODE, CASE WHEN LV = 2 THEN ID ELSE PARENT_ID END AS PARENT_ID, LV, TENANT_TYPE, BELONG_PROVINCE FROM FIN_SYS_TENANT "; |
| | | private static final String QUERY_LIST_BY_PARENT_ID = "SELECT * FROM FIN_SYS_TENANT WHERE PARENT_ID = ? ORDER BY LV ASC"; |
| | | |
| | | /** |
| | | * @Description 根据机构id查询机构 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/23 |
| | | * @Author :power |
| | | * @Date : 2023/7/20 20:41 |
| | | * 获取区划信息 主要用于缓存 |
| | | */ |
| | | public FinSysTenant selectByTenantId(String code) { |
| | | List<FinSysTenant> select = this.select(QUERY_BY_PARENT_CODE, new Object[]{code}, new FinSysTenant()); |
| | | public FinSysTenant queryOneByCode(String code) { |
| | | FinSysTenant tenant = new FinSysTenant(); |
| | | tenant.setCode(code); |
| | | List<FinSysTenant> tenantList = this.select(tenant); |
| | | if (!StringUtils.isEmptyList(tenantList)) { |
| | | return tenantList.get(0); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | private static final String QUERY_LV2_ALL = "SELECT * FROM FIN_SYS_TENANT WHERE LV < 3 ORDER BY CODE ASC"; |
| | | |
| | | public List<FinSysTenant> queryForTree() { |
| | | // 展示全部节点 |
| | | return this.select(QUERY_TREE_ALL, new Object[]{}, new FinSysTenant()); |
| | | } |
| | | |
| | | /** |
| | | * @Author :power |
| | | * @Date : 2023/7/20 16:34 |
| | | * 根据id 查询下级所有节点 地市查询自己 省查询所有地市 |
| | | */ |
| | | public List<FinSysTenant> queryTreeById(Long id, Integer lv) { |
| | | if (lv == 3) { |
| | | return new ArrayList<>(); |
| | | } |
| | | Map<String, Object> parameter = new HashMap<>(5); |
| | | StringBuilder sql = new StringBuilder(QUERY_TREE_BY_CODE); |
| | | if (id != null && lv == 1) { |
| | | sql.append(" WHERE PARENT_ID = :orgId OR ID = :orgId"); |
| | | parameter.put("orgId", id); |
| | | } |
| | | if (id != null && lv == 2) { |
| | | sql.append(" WHERE ID = :orgId"); |
| | | parameter.put("orgId", id); |
| | | } |
| | | return this.select(sql.toString(), parameter, new FinSysTenant()); |
| | | } |
| | | |
| | | /** |
| | | * @Author :power |
| | | * @Date : 2023/7/21 14:46 |
| | | * 特殊数据 禁止其他接口使用 |
| | | */ |
| | | public Map<Long, List<FinSysTenant>> queryCountyByCityCode(Long id, Integer lv) { |
| | | Map<String, Object> parameter = new HashMap<>(5); |
| | | StringBuilder sql = new StringBuilder(QUERY_LIST_BY_CITY_CODE); |
| | | if (id != null && (lv == 2 || lv == 3)) { |
| | | sql.append(" WHERE LV >= 2 "); |
| | | sql.append(" AND (PARENT_ID = :orgId OR ID = :orgId ) "); |
| | | parameter.put("orgId", id); |
| | | } else { |
| | | sql.append(" WHERE LV > 1 "); |
| | | sql.append(" AND PARENT_ID IS NOT NULL "); |
| | | } |
| | | sql.append(" ORDER BY PARENT_ID ,ID "); |
| | | List<FinSysTenant> list = this.select(sql.toString(), parameter, new FinSysTenant()); |
| | | // return list.stream().filter(tenant -> Objects.nonNull(tenant.getParentId())).collect(Collectors.groupingBy(FinSysTenant::getParentId)); |
| | | return list.stream().collect(Collectors.groupingBy(FinSysTenant::getParentId)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @Description 查询所有的市级带河南省的区划 |
| | | * @Author wh |
| | | * @Date 2023/7/20 15:29 |
| | | */ |
| | | public List<FinSysTenant> selectByLV2() { |
| | | return this.select(QUERY_LV2_ALL, new Object[]{}, new FinSysTenant()); |
| | | } |
| | | |
| | | /** |
| | | * @Description 根据父级id获取下级列表 |
| | | * @Author wh |
| | | * @Date 2023/7/25 13:53 |
| | | */ |
| | | public List<FinSysTenant> getByParentId(Long parentId) { |
| | | return this.select(QUERY_LIST_BY_PARENT_ID, new Object[]{parentId}, new FinSysTenant()); |
| | | } |
| | | |
| | | /** |
| | | * @Description 根据区划CODE查询区划信息 |
| | | * @Author wh |
| | | * @Date 2023/9/11 19:16 |
| | | */ |
| | | public FinSysTenant selectByParentId(String parentId) { |
| | | List<FinSysTenant> select = this.select(QUERY_BY_PARENT_ID, new Object[]{parentId}, new FinSysTenant()); |
| | | if (StringUtils.isEmptyList(select)) { |
| | | return null; |
| | | } else { |
| | | return select.get(0); |
| | | } |
| | | } |
| | | |
| | | public FinSysTenant selectByTenantId(String tenantCode) { |
| | | List<FinSysTenant> select = this.select(QUERY_BY_PARENT_CODE, new Object[]{tenantCode}, new FinSysTenant()); |
| | | if (StringUtils.isEmptyList(select)) { |
| | | return null; |
| | | } else { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * @author 卢庆阳 |
| | | * @date 2023/10/4 |
| | | */ |
| | | public int updateById(FinSysTenantParam param, FinSysTenantUser sysInfo) { |
| | | FinSysTenant finSysTenant = new FinSysTenant(); |
| | | finSysTenant.setTempId(param.getId()); |
| | | finSysTenant.setStatus(0); |
| | | finSysTenant.setIsDelete(1); |
| | | finSysTenant.setModified(getCurrentDate()); |
| | | finSysTenant.setUpdateTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | finSysTenant.setUpdateBy(sysInfo.getUserName()); |
| | | return this.update(finSysTenant); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 添加机构 |
| | | * @author 卢庆阳 |
| | | * @date 2023/10/4 |
| | | */ |
| | | public int addSysTenant(FinSysTenantParam param, S_user_core currentUser, int lv) { |
| | | FinSysTenant sysTenant = new FinSysTenant(); |
| | | public int addFinSysTenant(FinSysTenantParam param, FinSysTenantUser sysInfo, int lv) { |
| | | FinSysTenant finSysTenant = new FinSysTenant(); |
| | | |
| | | //id和tempId |
| | | StringBuilder sql = new StringBuilder("SELECT max(id) FROM fin_sys_tenant WHERE 1=1"); |
| | |
| | | } else { |
| | | id = param.getParentId() * 1000 + 1; |
| | | } |
| | | sysTenant.setTempId(id); |
| | | sysTenant.setId(id); |
| | | sysTenant.setStatus(param.getStatus()); |
| | | finSysTenant.setTempId(id); |
| | | finSysTenant.setId(id); |
| | | finSysTenant.setStatus(param.getStatus()); |
| | | |
| | | sysTenant.setParentId(param.getParentId()); |
| | | sysTenant.setCode(param.getCode()); |
| | | sysTenant.setName(param.getName()); |
| | | sysTenant.setCreateTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | sysTenant.setSummary(param.getSummary()); |
| | | sysTenant.setCreateBy(currentUser.getUser_name()); |
| | | finSysTenant.setParentId(param.getParentId()); |
| | | finSysTenant.setCode(param.getCode()); |
| | | //设置详细地址及经纬度 |
| | | finSysTenant.setName(param.getName()); |
| | | finSysTenant.setCreateTime3(getCurrentDate()); |
| | | finSysTenant.setCreateTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | finSysTenant.setSummary(param.getSummary()); |
| | | finSysTenant.setCreateBy(sysInfo.getUserName()); |
| | | //设置各层级id及名称 |
| | | sysTenant.setLv(lv); |
| | | setLvIdAndName(param, sysTenant, id, lv); |
| | | finSysTenant.setLv(lv); |
| | | setLvIdAndName(param, finSysTenant, id, lv); |
| | | |
| | | return this.insert(sysTenant); |
| | | return this.insert(finSysTenant); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @author 卢庆阳 |
| | | * @date 2023/10/4 |
| | | */ |
| | | private void setLvIdAndName(FinSysTenantParam param, FinSysTenant sysTenant, long id, int lv) { |
| | | private void setLvIdAndName(FinSysTenantParam param, FinSysTenant finSysTenant, long id, int lv) { |
| | | if (lv == 2) { //新增市级机构 |
| | | //查询上一级 - 省级 |
| | | FinSysTenant finSysTenant1 = this.get(new FinSysTenant(param.getParentId())); |
| | | if (finSysTenant1 != null) { |
| | | sysTenant.setLv1Id(finSysTenant1.getId()); |
| | | sysTenant.setLv1Name(finSysTenant1.getName()); |
| | | sysTenant.setLv2Id(id); |
| | | sysTenant.setLv2Name(param.getName()); |
| | | finSysTenant.setLv1Id(finSysTenant1.getId()); |
| | | finSysTenant.setLv1Name(finSysTenant1.getName()); |
| | | finSysTenant.setLv2Id(id); |
| | | finSysTenant.setLv2Name(param.getName()); |
| | | } |
| | | } else if (lv == 3) { //新增县级机构 |
| | | //查询上一级 - 市级 |
| | |
| | | //查询上一级 - 省级 |
| | | FinSysTenant finSysTenant1 = this.get(new FinSysTenant(finSysTenant2.getParentId())); |
| | | |
| | | sysTenant.setLv1Id(finSysTenant1.getId()); |
| | | sysTenant.setLv1Name(finSysTenant1.getName()); |
| | | sysTenant.setLv2Id(finSysTenant2.getId()); |
| | | sysTenant.setLv2Name(finSysTenant2.getName()); |
| | | sysTenant.setLv3Id(id); |
| | | sysTenant.setLv3Name(param.getName()); |
| | | finSysTenant.setLv1Id(finSysTenant1.getId()); |
| | | finSysTenant.setLv1Name(finSysTenant1.getName()); |
| | | finSysTenant.setLv2Id(finSysTenant2.getId()); |
| | | finSysTenant.setLv2Name(finSysTenant2.getName()); |
| | | finSysTenant.setLv3Id(id); |
| | | finSysTenant.setLv3Name(param.getName()); |
| | | } |
| | | } else if (lv == 4) { //新增支局机构 |
| | | //查询上一级 - 县级 |
| | |
| | | //查询上一级 - 省级 |
| | | FinSysTenant sysTenant1 = this.get(new FinSysTenant(finSysTenant2.getParentId())); |
| | | if (sysTenant1 != null) { |
| | | sysTenant.setLv1Id(sysTenant1.getId()); |
| | | sysTenant.setLv1Name(sysTenant1.getName()); |
| | | sysTenant.setLv2Id(finSysTenant2.getId()); |
| | | sysTenant.setLv2Name(finSysTenant2.getName()); |
| | | sysTenant.setLv3Id(finSysTenant3.getId()); |
| | | sysTenant.setLv3Name(finSysTenant3.getName()); |
| | | sysTenant.setLv4Id(id); |
| | | sysTenant.setLv4Name(param.getName()); |
| | | finSysTenant.setLv1Id(sysTenant1.getId()); |
| | | finSysTenant.setLv1Name(sysTenant1.getName()); |
| | | finSysTenant.setLv2Id(finSysTenant2.getId()); |
| | | finSysTenant.setLv2Name(finSysTenant2.getName()); |
| | | finSysTenant.setLv3Id(finSysTenant3.getId()); |
| | | finSysTenant.setLv3Name(finSysTenant3.getName()); |
| | | finSysTenant.setLv4Id(id); |
| | | finSysTenant.setLv4Name(param.getName()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 批量添加机构 |
| | | * @author jlq |
| | | * @date 2023/10/9 |
| | | */ |
| | | public void insertFinSysTenantBatch(List<FinSysTenantParam> params, FinSysTenantUser sysInfo, int lv){ |
| | | for (FinSysTenantParam param : params) { |
| | | addFinSysTenant(param,sysInfo,lv); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取当前日期 |
| | | * |
| | | * @author 卢庆阳 |
| | | * @date 2023/10/4 |
| | | */ |
| | | private Date getCurrentDate() { |
| | | Date currentDate = new Date(); |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String formattedDate = dateFormat.format(currentDate); |
| | | try { |
| | | Date convertedDate = dateFormat.parse(formattedDate); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return currentDate; |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * @author 卢庆阳 |
| | | * @date 2023/10/6 |
| | | */ |
| | | public int updateFinSysTenant(FinSysTenant finSysTenant, FinSysTenantUser sysInfo) { |
| | | Integer lv = finSysTenant.getLv(); |
| | | if (lv == 1) { |
| | | finSysTenant.setLv1Name(finSysTenant.getName()); |
| | | } else if (lv == 2) { |
| | | finSysTenant.setLv2Name(finSysTenant.getName()); |
| | | } else { |
| | | finSysTenant.setLv3Name(finSysTenant.getName()); |
| | | } |
| | | finSysTenant.setModified(getCurrentDate()); |
| | | finSysTenant.setUpdateTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | finSysTenant.setUpdateBy(sysInfo.getUserName()); |
| | | return this.update(finSysTenant); |
| | | } |
| | | } |
New file |
| | |
| | | package com.consum.base.service; |
| | | |
| | | import com.consum.base.pojo.FinSysTenantUserSearchParam; |
| | | import com.consum.model.po.FinSysOrg; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.iplatform.base.util.PlatformRSAUtils; |
| | | import com.iplatform.core.util.AESUtils; |
| | | import com.iplatform.model.po.S_dept; |
| | | import com.iplatform.model.po.S_role; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class FinSysTenantUserServiceImpl extends BaseServiceImpl { |
| | | |
| | | private static final String SQL_GET_USER = "SELECT * FROM fin_sys_tenant_user WHERE IS_DELETE = 1 AND `STATUS` = 1 AND TENANT_ID = ?"; |
| | | private static final String SQL_QH_PAGE_USER_PREFIX = "select fstu.* from FIN_SYS_TENANT_USER fstu where fstu.IS_DELETE = 1 "; |
| | | private static final String SQL_QH_PAGE_USER_PREFIX_NEW = "select fstu.* from FIN_SYS_TENANT_USER fstu where IS_DELETE = 1 and status=1 "; |
| | | private static final String SQL_TENANT_USER = "select fstu.*, fst.TENANT_NAME, fst.LV from FIN_SYS_TENANT_USER fstu\n" + |
| | | "left join (SELECT CODE, NAME AS TENANT_NAME, LV FROM FIN_SYS_TENANT) fst ON fstu.TENANT_CODE = fst.CODE\n" + |
| | | "where fstu.SYS_USER_ID = ?"; |
| | | private static final String SQL_TENANT_USER_BY_USER_ID = "select * from FIN_SYS_TENANT_USER where SYS_USER_ID = ? AND STATUS = 1"; |
| | | private static final String SQL_INSERT_ROLE_USER="insert into s_role_user(user_id, role_id, org_id) values(?,?,0)"; |
| | | |
| | | private static final String SQL_DELETE_ROLE_USER="DELETE FROM S_ROLE_USER WHERE USER_ID =?"; |
| | | |
| | | private static final String SQL_SELECT_USER_CODE="SELECT * FROM FIN_SYS_TENANT_USER where 1 = 1 "; |
| | | |
| | | private static final String SQL_SELECT_USER_ID="SELECT * FROM S_ROLE where 1=1 "; |
| | | private static final String SQL_DEPT_ROLES = "select * from s_dept where status=0 and del_flag=0"; |
| | | |
| | | private static final String SQL_FIN_SYS_ORG = "SELECT * from FIN_SYS_ORG where ID=?"; |
| | | |
| | | |
| | | private static final String SQL_TENANT_KF_USER = "select fstu.*, sru.USER_ID from FIN_SYS_TENANT_USER fstu\n" + |
| | | "left join (select USER_ID FROM S_ROLE_USER WHERE ROLE_ID = '1690961420053') sru ON fstu.SYS_USER_ID = sru.USER_ID\n" + |
| | | "WHERE IS_DELETE = 1 AND STATUS = 1 AND sru.USER_ID is NOT NULL AND TENANT_CODE = ?"; |
| | | |
| | | private static final String SQL_TEAM_KF_USER = "select fstu.*, sru.USER_ID,FST2.CODE as PARENT_Code from FIN_SYS_TENANT_USER fstu\n" + |
| | | " left join (select USER_ID FROM S_ROLE_USER WHERE ROLE_ID = 2) sru ON fstu.SYS_USER_ID = sru.USER_ID\n" + |
| | | " LEFT JOIN FIN_SYS_TENANT FST ON FST.CODE = fstu.TENANT_CODE \n" + |
| | | " LEFT JOIN FIN_SYS_TENANT FST2 ON FST2.ID = FST.PARENT_ID \n" + |
| | | " WHERE IS_DELETE = 1 AND STATUS = 1 AND sru.USER_ID is NOT NULL AND fstu.ID != ?"; |
| | | |
| | | /** |
| | | * @Description 分页查询系统用户 |
| | | * @Author wh |
| | | * @Date 2023/7/17 14:26 |
| | | */ |
| | | public GenericPager<FinSysTenantUser> queryAllPageUser(FinSysTenantUserSearchParam param) { |
| | | Map<String, Object> parameter = new HashMap<>(5); |
| | | StringBuilder sql = new StringBuilder(SQL_QH_PAGE_USER_PREFIX); |
| | | if(param.getTenantCode() > 0){ |
| | | sql.append(" and fstu.TENANT_CODE =:tenantCode"); |
| | | parameter.put("tenantCode", param.getTenantCode()); |
| | | } |
| | | if(param.getSupplierId() !=null ){ |
| | | sql.append(" and fstu.supplier_Id =:supplier_Id"); |
| | | parameter.put("supplier_Id", param.getSupplierId()); |
| | | } |
| | | if(StringUtils.isNotEmpty(param.getUserName())){ |
| | | sql.append(" and USER_NAME like :userName"); |
| | | parameter.put("userName", StringUtils.CHAR_PERCENT + param.getUserName() + StringUtils.CHAR_PERCENT); |
| | | } |
| | | if(StringUtils.isNotEmpty(param.getUserCode())){ |
| | | sql.append(" and USER_CODE like :USER_CODE"); |
| | | parameter.put("USER_CODE", StringUtils.CHAR_PERCENT + param.getUserCode() + StringUtils.CHAR_PERCENT); |
| | | } |
| | | // if(StringUtils.isNotEmpty(param.getUserCode())){ |
| | | // sql.append(" and user_code like :user_code"); |
| | | // parameter.put("user_code", StringUtils.CHAR_PERCENT + param.getUserCode() + StringUtils.CHAR_PERCENT); |
| | | // } |
| | | if(param.getStatus()!=null){ |
| | | sql.append(" and status =:status"); |
| | | parameter.put("status", param.getStatus()); |
| | | } |
| | | |
| | | // if(param.getRoleId()!=null &&!param.getRoleId().equals("")){ |
| | | // sql.append(" and fstu.SYS_USER_ID in (select user_id from s_role_user where role_id = :role_id)"); |
| | | // parameter.put("role_id", param.getRoleId()); |
| | | // } |
| | | |
| | | |
| | | if(StringUtils.isNotEmpty(param.getUserPhone())){ |
| | | sql.append(" and USER_PHONE =:userPhone"); |
| | | try { |
| | | // 加密手机号 |
| | | String key = PlatformRSAUtils.AES_KEY; |
| | | parameter.put("userPhone", AESUtils.encryptStrAES(param.getUserPhone(), key)); |
| | | } catch (Exception e) { |
| | | log.error("手机号加密失败, 原因是:" + e.getMessage()); |
| | | parameter.put("userPhone", ""); |
| | | } |
| | | } |
| | | |
| | | // 这里是选择人员加的 |
| | | if(param.getType()!=null){ |
| | | // 1 是财政用户 2 供应商 他俩的区别就是 供应商id是否为空 |
| | | if(param.getType()==1){ |
| | | sql.append(" and fstu.supplier_Id is null "); |
| | | } |
| | | |
| | | if(param.getType()==2){ |
| | | //这里是 查的供应商 供应商id 已经在上面加过了 |
| | | } |
| | | } |
| | | // 绑定CTI客服 |
| | | if (param.getCtiStatus() != null) { |
| | | if (param.getCtiStatus() == 1) { |
| | | sql.append(" and fstu.AGENT_JID is not null "); |
| | | } else { |
| | | sql.append(" and fstu.AGENT_JID is null "); |
| | | } |
| | | } |
| | | sql.append(" ORDER BY SEQ asc ,CREATE_TIME desc"); |
| | | return this.selectSplit(sql.toString(), parameter, new FinSysTenantUser()); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * @Description 分页查询系统用户 |
| | | * @Author wh |
| | | * @Date 2023/7/17 14:26 |
| | | */ |
| | | public GenericPager<FinSysTenantUser> queryAllPageUserNew(FinSysTenantUserSearchParam param) { |
| | | Map<String, Object> parameter = new HashMap<>(5); |
| | | StringBuilder sql = new StringBuilder(SQL_QH_PAGE_USER_PREFIX_NEW); |
| | | if(param.getTenantCode() > 0){ |
| | | sql.append(" and fstu.TENANT_CODE =:tenantCode"); |
| | | parameter.put("tenantCode", param.getTenantCode()); |
| | | } |
| | | if(param.getSupplierId() !=null ){ |
| | | sql.append(" and fstu.supplier_Id =:supplier_Id"); |
| | | parameter.put("supplier_Id", param.getSupplierId()); |
| | | } |
| | | if(StringUtils.isNotEmpty(param.getUserName())){ |
| | | sql.append(" and USER_NAME like :userName"); |
| | | parameter.put("userName", StringUtils.CHAR_PERCENT + param.getUserName() + StringUtils.CHAR_PERCENT); |
| | | } |
| | | if(StringUtils.isNotEmpty(param.getUserCode())){ |
| | | sql.append(" and user_code like :user_code"); |
| | | parameter.put("user_code", StringUtils.CHAR_PERCENT + param.getUserCode() + StringUtils.CHAR_PERCENT); |
| | | } |
| | | if(param.getStatus()!=null){ |
| | | sql.append(" and status like :status"); |
| | | parameter.put("status", param.getStatus()); |
| | | } |
| | | |
| | | if(param.getRoleId()!=null &&!param.getRoleId().equals("")){ |
| | | sql.append(" and fstu.SYS_USER_ID in (select user_id from s_role_user where role_id = :role_id)"); |
| | | parameter.put("role_id", param.getRoleId()); |
| | | } |
| | | |
| | | |
| | | if(StringUtils.isNotEmpty(param.getUserPhone())){ |
| | | sql.append(" and USER_PHONE =:userPhone"); |
| | | try { |
| | | // 加密手机号 |
| | | String key = PlatformRSAUtils.AES_KEY; |
| | | parameter.put("userPhone", AESUtils.encryptStrAES(param.getUserPhone(), key)); |
| | | } catch (Exception e) { |
| | | log.error("手机号加密失败, 原因是:" + e.getMessage()); |
| | | parameter.put("userPhone", ""); |
| | | } |
| | | } |
| | | |
| | | // 这里是选择人员加的 |
| | | if(param.getType()!=null){ |
| | | // 1 是财政用户 2 供应商 他俩的区别就是 供应商id是否为空 |
| | | if(param.getType()==1){ |
| | | sql.append(" and fstu.supplier_Id is null "); |
| | | } |
| | | |
| | | if(param.getType()==2){ |
| | | //这里是 查的供应商 供应商id 已经在上面加过了 |
| | | } |
| | | } |
| | | sql.append(" ORDER BY SEQ asc ,CREATE_TIME desc"); |
| | | return this.selectSplit(sql.toString(), parameter, new FinSysTenantUser()); |
| | | } |
| | | |
| | | public FinSysTenantUser queryOneById(String id) { |
| | | FinSysTenantUser finSysTenantUser = new FinSysTenantUser(); |
| | | finSysTenantUser.setId(Long.valueOf(id)); |
| | | List<FinSysTenantUser> finSysTenantUserList = this.select(finSysTenantUser); |
| | | if(!StringUtils.isEmptyList(finSysTenantUserList)){ |
| | | return finSysTenantUserList.get(0); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public FinSysTenantUser queryOneByUserId(String userId) { |
| | | List<FinSysTenantUser> finSysTenantUserList = this.select(SQL_TENANT_USER, new Object[]{userId}, new FinSysTenantUser()); |
| | | if (finSysTenantUserList.size() > 0) { |
| | | return finSysTenantUserList.get(0); |
| | | } else { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 批量添加角色对应的用户。 |
| | | * @param roleIdList |
| | | * @param userId |
| | | */ |
| | | public void execInsertRoleUserList(List<Long> roleIdList, Long userId){ |
| | | List<Object[]> parameters = new ArrayList<>(); |
| | | Object[] one = null; |
| | | for(long roleId : roleIdList){ |
| | | one = new Object[2]; |
| | | one[0] = userId; |
| | | one[1] = roleId; |
| | | parameters.add(one); |
| | | } |
| | | this.execBatchUpdate(SQL_INSERT_ROLE_USER, parameters); |
| | | } |
| | | |
| | | /** |
| | | * 批量添加角色对应的用户。支持同时多个用户 |
| | | */ |
| | | public void execInsertRoleUserList(List<FinSysTenantUser> finSysTenantUsers){ |
| | | List<Object[]> parameters = new ArrayList<>(); |
| | | for (FinSysTenantUser finSysTenantUser : finSysTenantUsers) { |
| | | Object[] one = null; |
| | | for(long roleId : finSysTenantUser.getRoleList()){ |
| | | one = new Object[2]; |
| | | one[0] = finSysTenantUser.getSysUserId(); |
| | | one[1] = roleId; |
| | | parameters.add(one); |
| | | } |
| | | } |
| | | |
| | | this.execBatchUpdate(SQL_INSERT_ROLE_USER, parameters); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除用户角色 |
| | | * @param userId |
| | | */ |
| | | public void execDelRoleUserList(Long userId){ |
| | | List<Object[]> parameters = new ArrayList<>(); |
| | | Object[] one = new Object[1]; |
| | | one[0]=userId; |
| | | parameters.add(one); |
| | | this.execBatchUpdate(SQL_DELETE_ROLE_USER, parameters); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据userCode查询重复。 |
| | | * @param userCode 用户登录标识 |
| | | * @return |
| | | */ |
| | | public Integer getByUserCode(String userCode){ |
| | | Map<String, Object> parameter = new HashMap<>(); |
| | | StringBuilder sql = new StringBuilder(SQL_SELECT_USER_CODE); |
| | | sql.append("and USER_CODE= :userCode"); |
| | | parameter.put("userCode", userCode); |
| | | sql.append(" limit 1"); |
| | | List<FinSysTenantUser> select = this.select(sql.toString(), parameter, new FinSysTenantUser()); |
| | | Integer flag=0; |
| | | if (select!=null && select.size() >0){ |
| | | flag=select.size(); |
| | | } |
| | | return flag; |
| | | } |
| | | |
| | | /** |
| | | * 根据USERID查询角色 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | public List<S_role> getByUserId(Long userId){ |
| | | Map<String, Object> parameter = new HashMap<>(); |
| | | StringBuilder sql = new StringBuilder(SQL_SELECT_USER_ID); |
| | | sql.append("and ROLE_ID IN (SELECT DISTINCT(ROLE_ID) FROM S_ROLE_USER WHERE USER_ID= :userId )"); |
| | | parameter.put("userId", userId); |
| | | List<S_role> select = this.select(sql.toString(), parameter, new S_role()); |
| | | return select; |
| | | } |
| | | |
| | | public List<S_dept> selectDept(String deptName) { |
| | | StringBuilder sqlStr=new StringBuilder(SQL_DEPT_ROLES); |
| | | Map<String, Object> paramts = new HashMap<>(); |
| | | sqlStr.append(" and dept_name =:dept_name"); |
| | | paramts.put("dept_name",deptName); |
| | | List<S_dept> orgDeptList = this.select(sqlStr.toString(), paramts, new S_dept()); |
| | | return orgDeptList; |
| | | } |
| | | |
| | | /** |
| | | * @Description 获取客服 |
| | | * @Author wh |
| | | * @Date 2023/7/19 10:12 |
| | | */ |
| | | public List<FinSysTenantUser> selectKF(String tenantCode) { |
| | | // 查询角色为客服且机构和当前请求用户一致的 |
| | | return this.select(SQL_TENANT_KF_USER, new Object[]{tenantCode}, new FinSysTenantUser()); |
| | | } |
| | | // public FinSysTenantUser selectKF(String tenantCode) { |
| | | // // 查询角色为客服且机构和当前请求用户一致的 |
| | | // List<FinSysTenantUser> finSysTenantUserList = this.select(SQL_TENANT_KF_USER, new Object[]{tenantCode}, new FinSysTenantUser()); |
| | | // if (finSysTenantUserList.size() > 0) { |
| | | // return finSysTenantUserList.get(0); |
| | | // } else { |
| | | // return null; |
| | | // } |
| | | // } |
| | | |
| | | /** |
| | | * @Description 获取所有客服信息,不包含自己 |
| | | * @Author wh |
| | | * @Date 2023/7/20 15:33 |
| | | */ |
| | | public List<FinSysTenantUser> selectTeamKF(Long id) { |
| | | // 查询角色为客服且机构和当前请求用户一致的 |
| | | List<FinSysTenantUser> finSysTenantUserList = this.select(SQL_TEAM_KF_USER, new Object[]{id}, new FinSysTenantUser()); |
| | | return finSysTenantUserList; |
| | | } |
| | | |
| | | /** |
| | | * 根据机构id查询机构 |
| | | * @param orgId |
| | | * @return |
| | | */ |
| | | public List<FinSysOrg> selectFinSysOrg(String orgId) { |
| | | List<FinSysOrg> select = this.select(SQL_FIN_SYS_ORG, new Object[]{orgId}, new FinSysOrg()); |
| | | return select; |
| | | } |
| | | |
| | | public FinSysTenantUser queryBySysUserId(Long userId) { |
| | | List<FinSysTenantUser> select = this.select(SQL_TENANT_USER_BY_USER_ID, new Object[]{userId}, new FinSysTenantUser()); |
| | | if (StringUtils.isEmptyList(select)) { |
| | | return null; |
| | | } else { |
| | | return select.get(0); |
| | | } |
| | | } |
| | | |
| | | private static final String SQL_GET_ALL_USER = "select DISTINCT( fstu.sys_user_id), fstu.USER_NAME as USER_Name, fstu.id as Id from (\n" + |
| | | "SELECT DISTINCT(CREATE_BY), EVENT_MANAGE_ID FROM FIN_EVENT_MANAGE_RECORD) femr LEFT JOIN FIN_SYS_TENANT_USER fstu ON femr.CREATE_BY = fstu.ID\n" + |
| | | "LEFT JOIN FIN_EVENT_MANAGE fem ON fem.id = femr.EVENT_MANAGE_ID WHERE USER_NAME is not NULL "; |
| | | |
| | | /** |
| | | * @Description 查询数据统计的信息 |
| | | * @Author wh |
| | | * @Date 2023/9/5 11:53 |
| | | * */ |
| | | public List<FinSysTenantUser> getStatics(FinSysTenantUserSearchParam finSysTenantUserSearchParam) { |
| | | Map<String, Object> parameters = new HashMap<>(10); |
| | | StringBuilder sql = new StringBuilder(SQL_GET_ALL_USER); |
| | | sql.append(" and fem.PROJECT_ID = :projectId"); |
| | | parameters.put("projectId", finSysTenantUserSearchParam.getProjectId()); |
| | | if (StringUtils.isNotEmpty(finSysTenantUserSearchParam.getUserName())) { |
| | | sql.append(" and fstu.USER_NAME like :userName"); |
| | | parameters.put("userName", StringUtils.CHAR_PERCENT + finSysTenantUserSearchParam.getUserName() + StringUtils.CHAR_PERCENT); |
| | | } |
| | | if(finSysTenantUserSearchParam.getStartTime() != null && finSysTenantUserSearchParam.getStartTime() > 0){ |
| | | sql.append(" and fem.create_time >= :startTime"); |
| | | parameters.put("startTime", finSysTenantUserSearchParam.getStartTime()); |
| | | } |
| | | if(finSysTenantUserSearchParam.getEndTime() != null && finSysTenantUserSearchParam.getEndTime() > 0){ |
| | | sql.append(" and fem.create_time <= :endTime"); |
| | | parameters.put("endTime", finSysTenantUserSearchParam.getEndTime()); |
| | | } |
| | | sql.append(" ORDER BY ID DESC"); |
| | | return this.select(sql.toString(), parameters, new FinSysTenantUser()); |
| | | } |
| | | |
| | | /** |
| | | * @Description 根据OrgId获取用户信息 |
| | | * @Author wh |
| | | * @Date 2023/10/4 15:49 |
| | | */ |
| | | public List<FinSysTenantUser> getByOrgId(Long orgId) { |
| | | return this.select(SQL_GET_USER, new Object[]{orgId}, new FinSysTenantUser()); |
| | | } |
| | | } |
New file |
| | |
| | | package com.consum.base.support; |
| | | |
| | | import com.consum.model.po.FinSysTenant; |
| | | import com.walker.infrastructure.tree.AbstractTreeGenerator; |
| | | import com.walker.infrastructure.tree.TreeNode; |
| | | |
| | | import java.util.List; |
| | | |
| | | public class FinSysTenantGenerator extends AbstractTreeGenerator<FinSysTenant> { |
| | | |
| | | public FinSysTenantGenerator(String dummyRootName) { |
| | | super(dummyRootName); |
| | | this.setMultiRoot(true); |
| | | } |
| | | |
| | | protected TreeNode toTreeNode(FinSysTenant entity) { |
| | | TreeNode treeNode = new TreeNode(entity.getId(), entity.getName(), (List) null, entity.getParentId(), entity.getCode()); |
| | | return treeNode; |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.consum.base.support; |
| | | |
| | | import com.consum.model.po.FinSysTenantRegion; |
| | | import com.walker.infrastructure.tree.AbstractTreeGenerator; |
| | | import com.walker.infrastructure.tree.TreeNode; |
| | | |
| | | import java.util.List; |
| | | |
| | | public class FinSysTenantGeneratorTow extends AbstractTreeGenerator<FinSysTenantRegion> { |
| | | |
| | | public FinSysTenantGeneratorTow(String dummyRootName) { |
| | | super(dummyRootName); |
| | | this.setMultiRoot(true); |
| | | } |
| | | |
| | | protected TreeNode toTreeNode(FinSysTenantRegion entity) { |
| | | TreeNode treeNode = new TreeNode(entity.getId(), entity.getName(), (List) null, entity.getParentId(), entity.getCode()); |
| | | return treeNode; |
| | | } |
| | | } |
| | | |
| | |
| | | //package com.consum.base.util; |
| | | // |
| | | //import com.consum.model.po.FinSysTenant; |
| | | //import com.walker.infrastructure.tree.TreeNode; |
| | | // |
| | | //import java.util.List; |
| | | // |
| | | ///** |
| | | // * @Description 区划节点 |
| | | // * @Author wh |
| | | // * @Date 2023/7/11 11:26 |
| | | // */ |
| | | //public class FinSysTenantUtils { |
| | | // |
| | | // public FinSysTenantUtils() { |
| | | // } |
| | | // |
| | | // public static final List<TreeNode> getFinSysTenantTree(List<FinSysTenant> finSysTenantList) { |
| | | // FinSysTenantGenerator finSysTenantGenerator = new FinSysTenantGenerator((String)null); |
| | | // finSysTenantGenerator.setEntityList(finSysTenantList); |
| | | // List<TreeNode> treeNodeList = finSysTenantGenerator.getTreeRootList(); |
| | | // return treeNodeList; |
| | | // } |
| | | // |
| | | // |
| | | //} |
| | | package com.consum.base.util; |
| | | |
| | | import com.consum.base.support.FinSysTenantGenerator; |
| | | import com.consum.base.support.FinSysTenantGeneratorTow; |
| | | import com.consum.model.po.FinSysTenant; |
| | | import com.consum.model.po.FinSysTenantRegion; |
| | | import com.walker.infrastructure.tree.TreeNode; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description 区划节点 |
| | | * @Author wh |
| | | * @Date 2023/7/11 11:26 |
| | | */ |
| | | public class FinSysTenantUtils { |
| | | |
| | | public FinSysTenantUtils() { |
| | | } |
| | | |
| | | public static final List<TreeNode> getFinSysTenantTree(List<FinSysTenant> finSysTenantList) { |
| | | FinSysTenantGenerator finSysTenantGenerator = new FinSysTenantGenerator((String)null); |
| | | finSysTenantGenerator.setEntityList(finSysTenantList); |
| | | List<TreeNode> treeNodeList = finSysTenantGenerator.getTreeRootList(); |
| | | return treeNodeList; |
| | | } |
| | | |
| | | public static final List<TreeNode> getFinSysTenantTreeTow(List<FinSysTenantRegion> finSysTenantList) { |
| | | FinSysTenantGeneratorTow finSysTenantGenerator = new FinSysTenantGeneratorTow((String)null); |
| | | finSysTenantGenerator.setEntityList(finSysTenantList); |
| | | List<TreeNode> treeNodeList = finSysTenantGenerator.getTreeRootList(); |
| | | return treeNodeList; |
| | | } |
| | | } |
| | |
| | | @JsonIgnore |
| | | protected boolean isset_createDate = false; |
| | | |
| | | private Integer type = null; |
| | | private Long dTime = null; |
| | | @JsonIgnore |
| | | protected boolean isset_type = false; |
| | | protected boolean isset_dTime = false; |
| | | |
| | | private Long dUserId = null; |
| | | @JsonIgnore |
| | | protected boolean isset_dUserId = false; |
| | | |
| | | private String dUserName = null; |
| | | @JsonIgnore |
| | | protected boolean isset_dUserName = false; |
| | | |
| | | /** |
| | | * 默认构造函数 |
| | |
| | | return this.createDate == null; |
| | | } |
| | | |
| | | public Integer getType() { |
| | | return this.type; |
| | | public Long getDTime() { |
| | | return this.dTime; |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | this.isset_type = true; |
| | | public void setDTime(Long dTime) { |
| | | this.dTime = dTime; |
| | | this.isset_dTime = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyType() { |
| | | return this.type == null; |
| | | public boolean isEmptyDTime() { |
| | | return this.dTime == null; |
| | | } |
| | | |
| | | public Long getDUserId() { |
| | | return this.dUserId; |
| | | } |
| | | |
| | | public void setDUserId(Long dUserId) { |
| | | this.dUserId = dUserId; |
| | | this.isset_dUserId = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyDUserId() { |
| | | return this.dUserId == null; |
| | | } |
| | | |
| | | public String getDUserName() { |
| | | return this.dUserName; |
| | | } |
| | | |
| | | public void setDUserName(String dUserName) { |
| | | this.dUserName = dUserName; |
| | | this.isset_dUserName = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyDUserName() { |
| | | return this.dUserName == null || this.dUserName.length() == 0; |
| | | } |
| | | |
| | | /** |
| | |
| | | .append("agencyId=").append(this.agencyId) |
| | | .append("agencyName=").append(this.agencyName) |
| | | .append("createDate=").append(this.createDate) |
| | | .append("type=").append(this.type) |
| | | .append("dTime=").append(this.dTime) |
| | | .append("dUserId=").append(this.dUserId) |
| | | .append("dUserName=").append(this.dUserName) |
| | | .toString(); |
| | | } |
| | | |
| | |
| | | if (this.isset_createDate) { |
| | | base_goods_template.setCreateDate(this.getCreateDate()); |
| | | } |
| | | if (this.isset_type) { |
| | | base_goods_template.setType(this.getType()); |
| | | if (this.isset_dTime) { |
| | | base_goods_template.setDTime(this.getDTime()); |
| | | } |
| | | if (this.isset_dUserId) { |
| | | base_goods_template.setDUserId(this.getDUserId()); |
| | | } |
| | | if (this.isset_dUserName) { |
| | | base_goods_template.setDUserName(this.getDUserName()); |
| | | } |
| | | return base_goods_template; |
| | | } |
| | |
| | | public static final String AgencyId = "agency_id"; |
| | | public static final String AgencyName = "agency_name"; |
| | | public static final String CreateDate = "create_date"; |
| | | public static final String Type = "type"; |
| | | public static final String DTime = "d_time"; |
| | | public static final String DUserId = "d_user_id"; |
| | | public static final String DUserName = "d_user_name"; |
| | | |
| | | /** |
| | | * 默认构造函数 |
| | |
| | | if (baseGoodsTemplate.isset_createDate) { |
| | | this.setCreateDate(baseGoodsTemplate.getCreateDate()); |
| | | } |
| | | if (baseGoodsTemplate.isset_type) { |
| | | this.setType(baseGoodsTemplate.getType()); |
| | | if (baseGoodsTemplate.isset_dTime) { |
| | | this.setDTime(baseGoodsTemplate.getDTime()); |
| | | } |
| | | if (baseGoodsTemplate.isset_dUserId) { |
| | | this.setDUserId(baseGoodsTemplate.getDUserId()); |
| | | } |
| | | if (baseGoodsTemplate.isset_dUserName) { |
| | | this.setDUserName(baseGoodsTemplate.getDUserName()); |
| | | } |
| | | // 去掉,2022-09-07 |
| | | // this.setDatabaseName_(base_goods_template.getDatabaseName_()); |
| | |
| | | ib.set(AgencyId, this.getAgencyId(), this.isset_agencyId); |
| | | ib.set(AgencyName, this.getAgencyName(), this.isset_agencyName); |
| | | ib.set(CreateDate, this.getCreateDate(), this.isset_createDate); |
| | | ib.set(Type, this.getType(), this.isset_type); |
| | | ib.set(DTime, this.getDTime(), this.isset_dTime); |
| | | ib.set(DUserId, this.getDUserId(), this.isset_dUserId); |
| | | ib.set(DUserName, this.getDUserName(), this.isset_dUserName); |
| | | return ib.genMapSql(); |
| | | } |
| | | |
| | |
| | | ub.set(AgencyId, this.getAgencyId(), this.isset_agencyId); |
| | | ub.set(AgencyName, this.getAgencyName(), this.isset_agencyName); |
| | | ub.set(CreateDate, this.getCreateDate(), this.isset_createDate); |
| | | ub.set(Type, this.getType(), this.isset_type); |
| | | ub.set(DTime, this.getDTime(), this.isset_dTime); |
| | | ub.set(DUserId, this.getDUserId(), this.isset_dUserId); |
| | | ub.set(DUserName, this.getDUserName(), this.isset_dUserName); |
| | | ub.where(this.getPkName_(), this.getPkValue_()); |
| | | return ub.genMapSql(); |
| | | } |
| | |
| | | ub.set(AgencyId, this.getAgencyId(), this.isset_agencyId); |
| | | ub.set(AgencyName, this.getAgencyName(), this.isset_agencyName); |
| | | ub.set(CreateDate, this.getCreateDate(), this.isset_createDate); |
| | | ub.set(Type, this.getType(), this.isset_type); |
| | | ub.set(DTime, this.getDTime(), this.isset_dTime); |
| | | ub.set(DUserId, this.getDUserId(), this.isset_dUserId); |
| | | ub.set(DUserName, this.getDUserName(), this.isset_dUserName); |
| | | return ub.genMapSql(where, parameters); |
| | | } |
| | | |
| | |
| | | ub.set(AgencyId, this.getAgencyId(), this.isset_agencyId); |
| | | ub.set(AgencyName, this.getAgencyName(), this.isset_agencyName); |
| | | ub.set(CreateDate, this.getCreateDate(), this.isset_createDate); |
| | | ub.set(Type, this.getType(), this.isset_type); |
| | | ub.set(DTime, this.getDTime(), this.isset_dTime); |
| | | ub.set(DUserId, this.getDUserId(), this.isset_dUserId); |
| | | ub.set(DUserName, this.getDUserName(), this.isset_dUserName); |
| | | return ub.genArraySql(where, parameters); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getSelectSql_(String where, Map<String, Object> parameters) { |
| | | return new SqlAndParameters<>("select id, goods_code, goods_name, classification, states, category_id, f_agency_id, s_agency_id, t_agency_id, parent_agency_id, agency_level, agency_id, agency_name, create_date, type from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>("select id, goods_code, goods_name, classification, states, category_id, f_agency_id, s_agency_id, t_agency_id, parent_agency_id, agency_level, agency_id, agency_name, create_date, d_time, d_user_id, d_user_name from " + this.getTableName_() + " " + where, parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) { |
| | | return new SqlAndParameters<>("select id, goods_code, goods_name, classification, states, category_id, f_agency_id, s_agency_id, t_agency_id, parent_agency_id, agency_level, agency_id, agency_name, create_date, type from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>("select id, goods_code, goods_name, classification, states, category_id, f_agency_id, s_agency_id, t_agency_id, parent_agency_id, agency_level, agency_id, agency_name, create_date, d_time, d_user_id, d_user_name from " + this.getTableName_() + " " + where, parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | base_goods_template.setCreateDate(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, BaseGoodsTemplate_mapper.Type); |
| | | columnIndex = resultSetUtils.findColumn(rs, BaseGoodsTemplate_mapper.DTime); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | base_goods_template.setType(null); |
| | | base_goods_template.setDTime(null); |
| | | } else { |
| | | base_goods_template.setType(rs.getInt(columnIndex)); |
| | | base_goods_template.setDTime(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, BaseGoodsTemplate_mapper.DUserId); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | base_goods_template.setDUserId(null); |
| | | } else { |
| | | base_goods_template.setDUserId(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, BaseGoodsTemplate_mapper.DUserName); |
| | | if (columnIndex > 0) { |
| | | base_goods_template.setDUserName(rs.getString(columnIndex)); |
| | | } |
| | | return base_goods_template; |
| | | } |
| | | } |
New file |
| | |
| | | |
| | | package com.consum.model.po; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonAutoDetect; |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import com.walker.jdbc.BasePo; |
| | | |
| | | /** |
| | | * 表名:FIN_SYS_TENANT_REGION * |
| | | * @author genrator |
| | | */ |
| | | @JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) |
| | | public class FinSysTenantRegion extends BasePo<FinSysTenantRegion> { |
| | | // 序列化版本号 |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | // 主键 |
| | | private Long tempId = null; |
| | | @JsonIgnore |
| | | protected boolean isset_tempId = false; |
| | | |
| | | // 属性列表 |
| | | private Long id = null; |
| | | @JsonIgnore |
| | | protected boolean isset_id = false; |
| | | |
| | | private Long parentId = null; |
| | | @JsonIgnore |
| | | protected boolean isset_parentId = false; |
| | | |
| | | private String code = null; |
| | | @JsonIgnore |
| | | protected boolean isset_code = false; |
| | | |
| | | private String financeOrgCode = null; |
| | | @JsonIgnore |
| | | protected boolean isset_financeOrgCode = false; |
| | | |
| | | private String name = null; |
| | | @JsonIgnore |
| | | protected boolean isset_name = false; |
| | | |
| | | private Long lv1Id = null; |
| | | @JsonIgnore |
| | | protected boolean isset_lv1Id = false; |
| | | |
| | | private String lv1Name = null; |
| | | @JsonIgnore |
| | | protected boolean isset_lv1Name = false; |
| | | |
| | | private Long lv2Id = null; |
| | | @JsonIgnore |
| | | protected boolean isset_lv2Id = false; |
| | | |
| | | private String lv2Name = null; |
| | | @JsonIgnore |
| | | protected boolean isset_lv2Name = false; |
| | | |
| | | private Long lv3Id = null; |
| | | @JsonIgnore |
| | | protected boolean isset_lv3Id = false; |
| | | |
| | | private String lv3Name = null; |
| | | @JsonIgnore |
| | | protected boolean isset_lv3Name = false; |
| | | |
| | | private Long lv4Id = null; |
| | | @JsonIgnore |
| | | protected boolean isset_lv4Id = false; |
| | | |
| | | private String lv4Name = null; |
| | | @JsonIgnore |
| | | protected boolean isset_lv4Name = false; |
| | | |
| | | private Long lv5Id = null; |
| | | @JsonIgnore |
| | | protected boolean isset_lv5Id = false; |
| | | |
| | | private String lv5Name = null; |
| | | @JsonIgnore |
| | | protected boolean isset_lv5Name = false; |
| | | |
| | | private Integer lv = null; |
| | | @JsonIgnore |
| | | protected boolean isset_lv = false; |
| | | |
| | | private Integer orderNum = null; |
| | | @JsonIgnore |
| | | protected boolean isset_orderNum = false; |
| | | |
| | | private java.util.Date createTime3 = null; |
| | | @JsonIgnore |
| | | protected boolean isset_createTime3 = false; |
| | | |
| | | private java.util.Date modified = null; |
| | | @JsonIgnore |
| | | protected boolean isset_modified = false; |
| | | |
| | | private String summary = null; |
| | | @JsonIgnore |
| | | protected boolean isset_summary = false; |
| | | |
| | | private String address = null; |
| | | @JsonIgnore |
| | | protected boolean isset_address = false; |
| | | |
| | | private String lng = null; |
| | | @JsonIgnore |
| | | protected boolean isset_lng = false; |
| | | |
| | | private String lat = null; |
| | | @JsonIgnore |
| | | protected boolean isset_lat = false; |
| | | |
| | | private Integer openStatus = null; |
| | | @JsonIgnore |
| | | protected boolean isset_openStatus = false; |
| | | |
| | | private java.util.Date openTime = null; |
| | | @JsonIgnore |
| | | protected boolean isset_openTime = false; |
| | | |
| | | private Integer status = null; |
| | | @JsonIgnore |
| | | protected boolean isset_status = false; |
| | | |
| | | private Integer isDelete = null; |
| | | @JsonIgnore |
| | | protected boolean isset_isDelete = false; |
| | | |
| | | private String path = null; |
| | | @JsonIgnore |
| | | protected boolean isset_path = false; |
| | | |
| | | private String venueName = null; |
| | | @JsonIgnore |
| | | protected boolean isset_venueName = false; |
| | | |
| | | private Long cityId = null; |
| | | @JsonIgnore |
| | | protected boolean isset_cityId = false; |
| | | |
| | | private String orgPhoto = null; |
| | | @JsonIgnore |
| | | protected boolean isset_orgPhoto = false; |
| | | |
| | | private String shortName = null; |
| | | @JsonIgnore |
| | | protected boolean isset_shortName = false; |
| | | |
| | | private Integer tenantType = null; |
| | | @JsonIgnore |
| | | protected boolean isset_tenantType = false; |
| | | |
| | | private String createBy = null; |
| | | @JsonIgnore |
| | | protected boolean isset_createBy = false; |
| | | |
| | | private Long createTime = null; |
| | | @JsonIgnore |
| | | protected boolean isset_createTime = false; |
| | | |
| | | private String updateBy = null; |
| | | @JsonIgnore |
| | | protected boolean isset_updateBy = false; |
| | | |
| | | private Long updateTime = null; |
| | | @JsonIgnore |
| | | protected boolean isset_updateTime = false; |
| | | |
| | | private Integer belongProvince = null; |
| | | @JsonIgnore |
| | | protected boolean isset_belongProvince = false; |
| | | |
| | | /** |
| | | * 默认构造函数 |
| | | */ |
| | | public FinSysTenantRegion() { |
| | | } |
| | | |
| | | /** |
| | | * 根据主键构造对象 |
| | | */ |
| | | public FinSysTenantRegion(Long tempId) { |
| | | this.setTempId(tempId); |
| | | } |
| | | |
| | | /** |
| | | * 设置主键值 |
| | | */ |
| | | @Override |
| | | public void setPkValue(Object value) { |
| | | this.setTempId((Long) value); |
| | | } |
| | | |
| | | public Long getTempId() { |
| | | return this.tempId; |
| | | } |
| | | |
| | | public void setTempId(Long tempId) { |
| | | this.tempId = tempId; |
| | | this.isset_tempId = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyTempId() { |
| | | return this.tempId == null; |
| | | } |
| | | |
| | | public Long getId() { |
| | | return this.id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | this.isset_id = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyId() { |
| | | return this.id == null; |
| | | } |
| | | |
| | | public Long getParentId() { |
| | | return this.parentId; |
| | | } |
| | | |
| | | public void setParentId(Long parentId) { |
| | | this.parentId = parentId; |
| | | this.isset_parentId = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyParentId() { |
| | | return this.parentId == null; |
| | | } |
| | | |
| | | public String getCode() { |
| | | return this.code; |
| | | } |
| | | |
| | | public void setCode(String code) { |
| | | this.code = code; |
| | | this.isset_code = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyCode() { |
| | | return this.code == null || this.code.length() == 0; |
| | | } |
| | | |
| | | public String getFinanceOrgCode() { |
| | | return this.financeOrgCode; |
| | | } |
| | | |
| | | public void setFinanceOrgCode(String financeOrgCode) { |
| | | this.financeOrgCode = financeOrgCode; |
| | | this.isset_financeOrgCode = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyFinanceOrgCode() { |
| | | return this.financeOrgCode == null || this.financeOrgCode.length() == 0; |
| | | } |
| | | |
| | | public String getName() { |
| | | return this.name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | this.isset_name = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyName() { |
| | | return this.name == null || this.name.length() == 0; |
| | | } |
| | | |
| | | public Long getLv1Id() { |
| | | return this.lv1Id; |
| | | } |
| | | |
| | | public void setLv1Id(Long lv1Id) { |
| | | this.lv1Id = lv1Id; |
| | | this.isset_lv1Id = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyLv1Id() { |
| | | return this.lv1Id == null; |
| | | } |
| | | |
| | | public String getLv1Name() { |
| | | return this.lv1Name; |
| | | } |
| | | |
| | | public void setLv1Name(String lv1Name) { |
| | | this.lv1Name = lv1Name; |
| | | this.isset_lv1Name = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyLv1Name() { |
| | | return this.lv1Name == null || this.lv1Name.length() == 0; |
| | | } |
| | | |
| | | public Long getLv2Id() { |
| | | return this.lv2Id; |
| | | } |
| | | |
| | | public void setLv2Id(Long lv2Id) { |
| | | this.lv2Id = lv2Id; |
| | | this.isset_lv2Id = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyLv2Id() { |
| | | return this.lv2Id == null; |
| | | } |
| | | |
| | | public String getLv2Name() { |
| | | return this.lv2Name; |
| | | } |
| | | |
| | | public void setLv2Name(String lv2Name) { |
| | | this.lv2Name = lv2Name; |
| | | this.isset_lv2Name = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyLv2Name() { |
| | | return this.lv2Name == null || this.lv2Name.length() == 0; |
| | | } |
| | | |
| | | public Long getLv3Id() { |
| | | return this.lv3Id; |
| | | } |
| | | |
| | | public void setLv3Id(Long lv3Id) { |
| | | this.lv3Id = lv3Id; |
| | | this.isset_lv3Id = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyLv3Id() { |
| | | return this.lv3Id == null; |
| | | } |
| | | |
| | | public String getLv3Name() { |
| | | return this.lv3Name; |
| | | } |
| | | |
| | | public void setLv3Name(String lv3Name) { |
| | | this.lv3Name = lv3Name; |
| | | this.isset_lv3Name = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyLv3Name() { |
| | | return this.lv3Name == null || this.lv3Name.length() == 0; |
| | | } |
| | | |
| | | public Long getLv4Id() { |
| | | return this.lv4Id; |
| | | } |
| | | |
| | | public void setLv4Id(Long lv4Id) { |
| | | this.lv4Id = lv4Id; |
| | | this.isset_lv4Id = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyLv4Id() { |
| | | return this.lv4Id == null; |
| | | } |
| | | |
| | | public String getLv4Name() { |
| | | return this.lv4Name; |
| | | } |
| | | |
| | | public void setLv4Name(String lv4Name) { |
| | | this.lv4Name = lv4Name; |
| | | this.isset_lv4Name = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyLv4Name() { |
| | | return this.lv4Name == null || this.lv4Name.length() == 0; |
| | | } |
| | | |
| | | public Long getLv5Id() { |
| | | return this.lv5Id; |
| | | } |
| | | |
| | | public void setLv5Id(Long lv5Id) { |
| | | this.lv5Id = lv5Id; |
| | | this.isset_lv5Id = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyLv5Id() { |
| | | return this.lv5Id == null; |
| | | } |
| | | |
| | | public String getLv5Name() { |
| | | return this.lv5Name; |
| | | } |
| | | |
| | | public void setLv5Name(String lv5Name) { |
| | | this.lv5Name = lv5Name; |
| | | this.isset_lv5Name = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyLv5Name() { |
| | | return this.lv5Name == null || this.lv5Name.length() == 0; |
| | | } |
| | | |
| | | public Integer getLv() { |
| | | return this.lv; |
| | | } |
| | | |
| | | public void setLv(Integer lv) { |
| | | this.lv = lv; |
| | | this.isset_lv = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyLv() { |
| | | return this.lv == null; |
| | | } |
| | | |
| | | public Integer getOrderNum() { |
| | | return this.orderNum; |
| | | } |
| | | |
| | | public void setOrderNum(Integer orderNum) { |
| | | this.orderNum = orderNum; |
| | | this.isset_orderNum = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyOrderNum() { |
| | | return this.orderNum == null; |
| | | } |
| | | |
| | | public java.util.Date getCreateTime3() { |
| | | return this.createTime3; |
| | | } |
| | | |
| | | public void setCreateTime3(java.util.Date createTime3) { |
| | | this.createTime3 = createTime3; |
| | | this.isset_createTime3 = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyCreateTime3() { |
| | | return this.createTime3 == null; |
| | | } |
| | | |
| | | public java.util.Date getModified() { |
| | | return this.modified; |
| | | } |
| | | |
| | | public void setModified(java.util.Date modified) { |
| | | this.modified = modified; |
| | | this.isset_modified = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyModified() { |
| | | return this.modified == null; |
| | | } |
| | | |
| | | public String getSummary() { |
| | | return this.summary; |
| | | } |
| | | |
| | | public void setSummary(String summary) { |
| | | this.summary = summary; |
| | | this.isset_summary = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptySummary() { |
| | | return this.summary == null || this.summary.length() == 0; |
| | | } |
| | | |
| | | public String getAddress() { |
| | | return this.address; |
| | | } |
| | | |
| | | public void setAddress(String address) { |
| | | this.address = address; |
| | | this.isset_address = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyAddress() { |
| | | return this.address == null || this.address.length() == 0; |
| | | } |
| | | |
| | | public String getLng() { |
| | | return this.lng; |
| | | } |
| | | |
| | | public void setLng(String lng) { |
| | | this.lng = lng; |
| | | this.isset_lng = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyLng() { |
| | | return this.lng == null || this.lng.length() == 0; |
| | | } |
| | | |
| | | public String getLat() { |
| | | return this.lat; |
| | | } |
| | | |
| | | public void setLat(String lat) { |
| | | this.lat = lat; |
| | | this.isset_lat = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyLat() { |
| | | return this.lat == null || this.lat.length() == 0; |
| | | } |
| | | |
| | | public Integer getOpenStatus() { |
| | | return this.openStatus; |
| | | } |
| | | |
| | | public void setOpenStatus(Integer openStatus) { |
| | | this.openStatus = openStatus; |
| | | this.isset_openStatus = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyOpenStatus() { |
| | | return this.openStatus == null; |
| | | } |
| | | |
| | | public java.util.Date getOpenTime() { |
| | | return this.openTime; |
| | | } |
| | | |
| | | public void setOpenTime(java.util.Date openTime) { |
| | | this.openTime = openTime; |
| | | this.isset_openTime = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyOpenTime() { |
| | | return this.openTime == null; |
| | | } |
| | | |
| | | public Integer getStatus() { |
| | | return this.status; |
| | | } |
| | | |
| | | public void setStatus(Integer status) { |
| | | this.status = status; |
| | | this.isset_status = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyStatus() { |
| | | return this.status == null; |
| | | } |
| | | |
| | | public Integer getIsDelete() { |
| | | return this.isDelete; |
| | | } |
| | | |
| | | public void setIsDelete(Integer isDelete) { |
| | | this.isDelete = isDelete; |
| | | this.isset_isDelete = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyIsDelete() { |
| | | return this.isDelete == null; |
| | | } |
| | | |
| | | public String getPath() { |
| | | return this.path; |
| | | } |
| | | |
| | | public void setPath(String path) { |
| | | this.path = path; |
| | | this.isset_path = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyPath() { |
| | | return this.path == null || this.path.length() == 0; |
| | | } |
| | | |
| | | public String getVenueName() { |
| | | return this.venueName; |
| | | } |
| | | |
| | | public void setVenueName(String venueName) { |
| | | this.venueName = venueName; |
| | | this.isset_venueName = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyVenueName() { |
| | | return this.venueName == null || this.venueName.length() == 0; |
| | | } |
| | | |
| | | public Long getCityId() { |
| | | return this.cityId; |
| | | } |
| | | |
| | | public void setCityId(Long cityId) { |
| | | this.cityId = cityId; |
| | | this.isset_cityId = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyCityId() { |
| | | return this.cityId == null; |
| | | } |
| | | |
| | | public String getOrgPhoto() { |
| | | return this.orgPhoto; |
| | | } |
| | | |
| | | public void setOrgPhoto(String orgPhoto) { |
| | | this.orgPhoto = orgPhoto; |
| | | this.isset_orgPhoto = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyOrgPhoto() { |
| | | return this.orgPhoto == null || this.orgPhoto.length() == 0; |
| | | } |
| | | |
| | | public String getShortName() { |
| | | return this.shortName; |
| | | } |
| | | |
| | | public void setShortName(String shortName) { |
| | | this.shortName = shortName; |
| | | this.isset_shortName = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyShortName() { |
| | | return this.shortName == null || this.shortName.length() == 0; |
| | | } |
| | | |
| | | public Integer getTenantType() { |
| | | return this.tenantType; |
| | | } |
| | | |
| | | public void setTenantType(Integer tenantType) { |
| | | this.tenantType = tenantType; |
| | | this.isset_tenantType = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyTenantType() { |
| | | return this.tenantType == null; |
| | | } |
| | | |
| | | public String getCreateBy() { |
| | | return this.createBy; |
| | | } |
| | | |
| | | public void setCreateBy(String createBy) { |
| | | this.createBy = createBy; |
| | | this.isset_createBy = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyCreateBy() { |
| | | return this.createBy == null || this.createBy.length() == 0; |
| | | } |
| | | |
| | | public Long getCreateTime() { |
| | | return this.createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Long createTime) { |
| | | this.createTime = createTime; |
| | | this.isset_createTime = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyCreateTime() { |
| | | return this.createTime == null; |
| | | } |
| | | |
| | | public String getUpdateBy() { |
| | | return this.updateBy; |
| | | } |
| | | |
| | | public void setUpdateBy(String updateBy) { |
| | | this.updateBy = updateBy; |
| | | this.isset_updateBy = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyUpdateBy() { |
| | | return this.updateBy == null || this.updateBy.length() == 0; |
| | | } |
| | | |
| | | public Long getUpdateTime() { |
| | | return this.updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Long updateTime) { |
| | | this.updateTime = updateTime; |
| | | this.isset_updateTime = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyUpdateTime() { |
| | | return this.updateTime == null; |
| | | } |
| | | |
| | | public Integer getBelongProvince() { |
| | | return this.belongProvince; |
| | | } |
| | | |
| | | public void setBelongProvince(Integer belongProvince) { |
| | | this.belongProvince = belongProvince; |
| | | this.isset_belongProvince = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyBelongProvince() { |
| | | return this.belongProvince == null; |
| | | } |
| | | |
| | | /** |
| | | * 重写 toString() 方法 |
| | | */ |
| | | @Override |
| | | public String toString() { |
| | | return new StringBuilder() |
| | | .append("tempId=").append(this.tempId) |
| | | .append("id=").append(this.id) |
| | | .append("parentId=").append(this.parentId) |
| | | .append("code=").append(this.code) |
| | | .append("financeOrgCode=").append(this.financeOrgCode) |
| | | .append("name=").append(this.name) |
| | | .append("lv1Id=").append(this.lv1Id) |
| | | .append("lv1Name=").append(this.lv1Name) |
| | | .append("lv2Id=").append(this.lv2Id) |
| | | .append("lv2Name=").append(this.lv2Name) |
| | | .append("lv3Id=").append(this.lv3Id) |
| | | .append("lv3Name=").append(this.lv3Name) |
| | | .append("lv4Id=").append(this.lv4Id) |
| | | .append("lv4Name=").append(this.lv4Name) |
| | | .append("lv5Id=").append(this.lv5Id) |
| | | .append("lv5Name=").append(this.lv5Name) |
| | | .append("lv=").append(this.lv) |
| | | .append("orderNum=").append(this.orderNum) |
| | | .append("createTime3=").append(this.createTime3) |
| | | .append("modified=").append(this.modified) |
| | | .append("summary=").append(this.summary) |
| | | .append("address=").append(this.address) |
| | | .append("lng=").append(this.lng) |
| | | .append("lat=").append(this.lat) |
| | | .append("openStatus=").append(this.openStatus) |
| | | .append("openTime=").append(this.openTime) |
| | | .append("status=").append(this.status) |
| | | .append("isDelete=").append(this.isDelete) |
| | | .append("path=").append(this.path) |
| | | .append("venueName=").append(this.venueName) |
| | | .append("cityId=").append(this.cityId) |
| | | .append("orgPhoto=").append(this.orgPhoto) |
| | | .append("shortName=").append(this.shortName) |
| | | .append("tenantType=").append(this.tenantType) |
| | | .append("createBy=").append(this.createBy) |
| | | .append("createTime=").append(this.createTime) |
| | | .append("updateBy=").append(this.updateBy) |
| | | .append("updateTime=").append(this.updateTime) |
| | | .append("belongProvince=").append(this.belongProvince) |
| | | .toString(); |
| | | } |
| | | |
| | | /** |
| | | * 克隆 |
| | | */ |
| | | public FinSysTenantRegion $clone() { |
| | | FinSysTenantRegion fin_sys_tenant_region = new FinSysTenantRegion(); |
| | | |
| | | // 数据库名称 |
| | | //fin_sys_tenant_region.setDatabaseName_(this.getDatabaseName_()); |
| | | |
| | | // 主键 |
| | | if (this.isset_tempId) { |
| | | fin_sys_tenant_region.setTempId(this.getTempId()); |
| | | } |
| | | // 普通属性 |
| | | if (this.isset_id) { |
| | | fin_sys_tenant_region.setId(this.getId()); |
| | | } |
| | | if (this.isset_parentId) { |
| | | fin_sys_tenant_region.setParentId(this.getParentId()); |
| | | } |
| | | if (this.isset_code) { |
| | | fin_sys_tenant_region.setCode(this.getCode()); |
| | | } |
| | | if (this.isset_financeOrgCode) { |
| | | fin_sys_tenant_region.setFinanceOrgCode(this.getFinanceOrgCode()); |
| | | } |
| | | if (this.isset_name) { |
| | | fin_sys_tenant_region.setName(this.getName()); |
| | | } |
| | | if (this.isset_lv1Id) { |
| | | fin_sys_tenant_region.setLv1Id(this.getLv1Id()); |
| | | } |
| | | if (this.isset_lv1Name) { |
| | | fin_sys_tenant_region.setLv1Name(this.getLv1Name()); |
| | | } |
| | | if (this.isset_lv2Id) { |
| | | fin_sys_tenant_region.setLv2Id(this.getLv2Id()); |
| | | } |
| | | if (this.isset_lv2Name) { |
| | | fin_sys_tenant_region.setLv2Name(this.getLv2Name()); |
| | | } |
| | | if (this.isset_lv3Id) { |
| | | fin_sys_tenant_region.setLv3Id(this.getLv3Id()); |
| | | } |
| | | if (this.isset_lv3Name) { |
| | | fin_sys_tenant_region.setLv3Name(this.getLv3Name()); |
| | | } |
| | | if (this.isset_lv4Id) { |
| | | fin_sys_tenant_region.setLv4Id(this.getLv4Id()); |
| | | } |
| | | if (this.isset_lv4Name) { |
| | | fin_sys_tenant_region.setLv4Name(this.getLv4Name()); |
| | | } |
| | | if (this.isset_lv5Id) { |
| | | fin_sys_tenant_region.setLv5Id(this.getLv5Id()); |
| | | } |
| | | if (this.isset_lv5Name) { |
| | | fin_sys_tenant_region.setLv5Name(this.getLv5Name()); |
| | | } |
| | | if (this.isset_lv) { |
| | | fin_sys_tenant_region.setLv(this.getLv()); |
| | | } |
| | | if (this.isset_orderNum) { |
| | | fin_sys_tenant_region.setOrderNum(this.getOrderNum()); |
| | | } |
| | | if (this.isset_createTime3) { |
| | | fin_sys_tenant_region.setCreateTime3(this.getCreateTime3()); |
| | | } |
| | | if (this.isset_modified) { |
| | | fin_sys_tenant_region.setModified(this.getModified()); |
| | | } |
| | | if (this.isset_summary) { |
| | | fin_sys_tenant_region.setSummary(this.getSummary()); |
| | | } |
| | | if (this.isset_address) { |
| | | fin_sys_tenant_region.setAddress(this.getAddress()); |
| | | } |
| | | if (this.isset_lng) { |
| | | fin_sys_tenant_region.setLng(this.getLng()); |
| | | } |
| | | if (this.isset_lat) { |
| | | fin_sys_tenant_region.setLat(this.getLat()); |
| | | } |
| | | if (this.isset_openStatus) { |
| | | fin_sys_tenant_region.setOpenStatus(this.getOpenStatus()); |
| | | } |
| | | if (this.isset_openTime) { |
| | | fin_sys_tenant_region.setOpenTime(this.getOpenTime()); |
| | | } |
| | | if (this.isset_status) { |
| | | fin_sys_tenant_region.setStatus(this.getStatus()); |
| | | } |
| | | if (this.isset_isDelete) { |
| | | fin_sys_tenant_region.setIsDelete(this.getIsDelete()); |
| | | } |
| | | if (this.isset_path) { |
| | | fin_sys_tenant_region.setPath(this.getPath()); |
| | | } |
| | | if (this.isset_venueName) { |
| | | fin_sys_tenant_region.setVenueName(this.getVenueName()); |
| | | } |
| | | if (this.isset_cityId) { |
| | | fin_sys_tenant_region.setCityId(this.getCityId()); |
| | | } |
| | | if (this.isset_orgPhoto) { |
| | | fin_sys_tenant_region.setOrgPhoto(this.getOrgPhoto()); |
| | | } |
| | | if (this.isset_shortName) { |
| | | fin_sys_tenant_region.setShortName(this.getShortName()); |
| | | } |
| | | if (this.isset_tenantType) { |
| | | fin_sys_tenant_region.setTenantType(this.getTenantType()); |
| | | } |
| | | if (this.isset_createBy) { |
| | | fin_sys_tenant_region.setCreateBy(this.getCreateBy()); |
| | | } |
| | | if (this.isset_createTime) { |
| | | fin_sys_tenant_region.setCreateTime(this.getCreateTime()); |
| | | } |
| | | if (this.isset_updateBy) { |
| | | fin_sys_tenant_region.setUpdateBy(this.getUpdateBy()); |
| | | } |
| | | if (this.isset_updateTime) { |
| | | fin_sys_tenant_region.setUpdateTime(this.getUpdateTime()); |
| | | } |
| | | if (this.isset_belongProvince) { |
| | | fin_sys_tenant_region.setBelongProvince(this.getBelongProvince()); |
| | | } |
| | | return fin_sys_tenant_region; |
| | | } |
| | | } |
New file |
| | |
| | | package com.consum.model.po; |
| | | |
| | | import com.walker.jdbc.BaseMapper; |
| | | import com.walker.jdbc.ResultSetUtils; |
| | | import com.walker.jdbc.SqlAndParameters; |
| | | import com.walker.jdbc.sqlgen.DeleteBuilder; |
| | | import com.walker.jdbc.sqlgen.InsertBuilder; |
| | | import com.walker.jdbc.sqlgen.SelectBuilder; |
| | | import com.walker.jdbc.sqlgen.UpdateBuilder; |
| | | import org.springframework.jdbc.core.RowMapper; |
| | | |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 表名:FIN_SYS_TENANT_REGION * |
| | | * @author genrator |
| | | */ |
| | | public class FinSysTenantRegion_mapper extends FinSysTenantRegion implements BaseMapper<FinSysTenantRegion> { |
| | | // 序列化版本号 |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public static final RowMapper<FinSysTenantRegion> ROW_MAPPER = new FinSysTenantRegionRowMapper(); |
| | | |
| | | // 主键 |
| | | public static final String TempId = "temp_id"; |
| | | // 普通属性 |
| | | public static final String Id = "id"; |
| | | public static final String ParentId = "parent_id"; |
| | | public static final String Code = "code"; |
| | | public static final String FinanceOrgCode = "finance_org_code"; |
| | | public static final String Name = "name"; |
| | | public static final String Lv1Id = "lv1_id"; |
| | | public static final String Lv1Name = "lv1_name"; |
| | | public static final String Lv2Id = "lv2_id"; |
| | | public static final String Lv2Name = "lv2_name"; |
| | | public static final String Lv3Id = "lv3_id"; |
| | | public static final String Lv3Name = "lv3_name"; |
| | | public static final String Lv4Id = "lv4_id"; |
| | | public static final String Lv4Name = "lv4_name"; |
| | | public static final String Lv5Id = "lv5_id"; |
| | | public static final String Lv5Name = "lv5_name"; |
| | | public static final String Lv = "lv"; |
| | | public static final String OrderNum = "order_num"; |
| | | public static final String CreateTime3 = "create_time3"; |
| | | public static final String Modified = "modified"; |
| | | public static final String Summary = "summary"; |
| | | public static final String Address = "address"; |
| | | public static final String Lng = "lng"; |
| | | public static final String Lat = "lat"; |
| | | public static final String OpenStatus = "open_status"; |
| | | public static final String OpenTime = "open_time"; |
| | | public static final String Status = "status"; |
| | | public static final String IsDelete = "is_delete"; |
| | | public static final String Path = "path"; |
| | | public static final String VenueName = "venue_name"; |
| | | public static final String CityId = "city_id"; |
| | | public static final String OrgPhoto = "org_photo"; |
| | | public static final String ShortName = "short_name"; |
| | | public static final String TenantType = "tenant_type"; |
| | | public static final String CreateBy = "create_by"; |
| | | public static final String CreateTime = "create_time"; |
| | | public static final String UpdateBy = "update_by"; |
| | | public static final String UpdateTime = "update_time"; |
| | | public static final String BelongProvince = "belong_province"; |
| | | |
| | | /** |
| | | * 默认构造函数 |
| | | */ |
| | | public FinSysTenantRegion_mapper(FinSysTenantRegion finSysTenantRegion) { |
| | | if (finSysTenantRegion == null) { |
| | | throw new IllegalArgumentException("po参数不允许为空!"); |
| | | } |
| | | //主键 |
| | | if (finSysTenantRegion.isset_tempId) { |
| | | this.setTempId(finSysTenantRegion.getTempId()); |
| | | } |
| | | //普通属性 |
| | | if (finSysTenantRegion.isset_id) { |
| | | this.setId(finSysTenantRegion.getId()); |
| | | } |
| | | if (finSysTenantRegion.isset_parentId) { |
| | | this.setParentId(finSysTenantRegion.getParentId()); |
| | | } |
| | | if (finSysTenantRegion.isset_code) { |
| | | this.setCode(finSysTenantRegion.getCode()); |
| | | } |
| | | if (finSysTenantRegion.isset_financeOrgCode) { |
| | | this.setFinanceOrgCode(finSysTenantRegion.getFinanceOrgCode()); |
| | | } |
| | | if (finSysTenantRegion.isset_name) { |
| | | this.setName(finSysTenantRegion.getName()); |
| | | } |
| | | if (finSysTenantRegion.isset_lv1Id) { |
| | | this.setLv1Id(finSysTenantRegion.getLv1Id()); |
| | | } |
| | | if (finSysTenantRegion.isset_lv1Name) { |
| | | this.setLv1Name(finSysTenantRegion.getLv1Name()); |
| | | } |
| | | if (finSysTenantRegion.isset_lv2Id) { |
| | | this.setLv2Id(finSysTenantRegion.getLv2Id()); |
| | | } |
| | | if (finSysTenantRegion.isset_lv2Name) { |
| | | this.setLv2Name(finSysTenantRegion.getLv2Name()); |
| | | } |
| | | if (finSysTenantRegion.isset_lv3Id) { |
| | | this.setLv3Id(finSysTenantRegion.getLv3Id()); |
| | | } |
| | | if (finSysTenantRegion.isset_lv3Name) { |
| | | this.setLv3Name(finSysTenantRegion.getLv3Name()); |
| | | } |
| | | if (finSysTenantRegion.isset_lv4Id) { |
| | | this.setLv4Id(finSysTenantRegion.getLv4Id()); |
| | | } |
| | | if (finSysTenantRegion.isset_lv4Name) { |
| | | this.setLv4Name(finSysTenantRegion.getLv4Name()); |
| | | } |
| | | if (finSysTenantRegion.isset_lv5Id) { |
| | | this.setLv5Id(finSysTenantRegion.getLv5Id()); |
| | | } |
| | | if (finSysTenantRegion.isset_lv5Name) { |
| | | this.setLv5Name(finSysTenantRegion.getLv5Name()); |
| | | } |
| | | if (finSysTenantRegion.isset_lv) { |
| | | this.setLv(finSysTenantRegion.getLv()); |
| | | } |
| | | if (finSysTenantRegion.isset_orderNum) { |
| | | this.setOrderNum(finSysTenantRegion.getOrderNum()); |
| | | } |
| | | if (finSysTenantRegion.isset_createTime3) { |
| | | this.setCreateTime3(finSysTenantRegion.getCreateTime3()); |
| | | } |
| | | if (finSysTenantRegion.isset_modified) { |
| | | this.setModified(finSysTenantRegion.getModified()); |
| | | } |
| | | if (finSysTenantRegion.isset_summary) { |
| | | this.setSummary(finSysTenantRegion.getSummary()); |
| | | } |
| | | if (finSysTenantRegion.isset_address) { |
| | | this.setAddress(finSysTenantRegion.getAddress()); |
| | | } |
| | | if (finSysTenantRegion.isset_lng) { |
| | | this.setLng(finSysTenantRegion.getLng()); |
| | | } |
| | | if (finSysTenantRegion.isset_lat) { |
| | | this.setLat(finSysTenantRegion.getLat()); |
| | | } |
| | | if (finSysTenantRegion.isset_openStatus) { |
| | | this.setOpenStatus(finSysTenantRegion.getOpenStatus()); |
| | | } |
| | | if (finSysTenantRegion.isset_openTime) { |
| | | this.setOpenTime(finSysTenantRegion.getOpenTime()); |
| | | } |
| | | if (finSysTenantRegion.isset_status) { |
| | | this.setStatus(finSysTenantRegion.getStatus()); |
| | | } |
| | | if (finSysTenantRegion.isset_isDelete) { |
| | | this.setIsDelete(finSysTenantRegion.getIsDelete()); |
| | | } |
| | | if (finSysTenantRegion.isset_path) { |
| | | this.setPath(finSysTenantRegion.getPath()); |
| | | } |
| | | if (finSysTenantRegion.isset_venueName) { |
| | | this.setVenueName(finSysTenantRegion.getVenueName()); |
| | | } |
| | | if (finSysTenantRegion.isset_cityId) { |
| | | this.setCityId(finSysTenantRegion.getCityId()); |
| | | } |
| | | if (finSysTenantRegion.isset_orgPhoto) { |
| | | this.setOrgPhoto(finSysTenantRegion.getOrgPhoto()); |
| | | } |
| | | if (finSysTenantRegion.isset_shortName) { |
| | | this.setShortName(finSysTenantRegion.getShortName()); |
| | | } |
| | | if (finSysTenantRegion.isset_tenantType) { |
| | | this.setTenantType(finSysTenantRegion.getTenantType()); |
| | | } |
| | | if (finSysTenantRegion.isset_createBy) { |
| | | this.setCreateBy(finSysTenantRegion.getCreateBy()); |
| | | } |
| | | if (finSysTenantRegion.isset_createTime) { |
| | | this.setCreateTime(finSysTenantRegion.getCreateTime()); |
| | | } |
| | | if (finSysTenantRegion.isset_updateBy) { |
| | | this.setUpdateBy(finSysTenantRegion.getUpdateBy()); |
| | | } |
| | | if (finSysTenantRegion.isset_updateTime) { |
| | | this.setUpdateTime(finSysTenantRegion.getUpdateTime()); |
| | | } |
| | | if (finSysTenantRegion.isset_belongProvince) { |
| | | this.setBelongProvince(finSysTenantRegion.getBelongProvince()); |
| | | } |
| | | // 去掉,2022-09-07 |
| | | // this.setDatabaseName_(fin_sys_tenant_region.getDatabaseName_()); |
| | | } |
| | | |
| | | /** |
| | | * 获取表名 |
| | | */ |
| | | @Override |
| | | public String getTableName_() { |
| | | String tableName = "fin_sys_tenant_region"; |
| | | /** |
| | | if (StringUtils.isNotEmpty(this.getDatabaseName_())) { |
| | | return this.getDatabaseName_() + "." + tableName; |
| | | } else { |
| | | return tableName; |
| | | } |
| | | */ |
| | | return tableName; |
| | | } |
| | | |
| | | /** |
| | | * 获取主键名称 |
| | | */ |
| | | @Override |
| | | public String getPkName_() { |
| | | return TempId; |
| | | } |
| | | |
| | | /** |
| | | * 获取主键值 |
| | | */ |
| | | @Override |
| | | public Object getPkValue_() { |
| | | return this.getTempId(); |
| | | } |
| | | |
| | | /** |
| | | * 获取插入语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getInsertSql_() { |
| | | InsertBuilder ib = new InsertBuilder(this.getTableName_()); |
| | | ib.set(TempId, this.getTempId()); |
| | | ib.set(Id, this.getId(), this.isset_id); |
| | | ib.set(ParentId, this.getParentId(), this.isset_parentId); |
| | | ib.set(Code, this.getCode(), this.isset_code); |
| | | ib.set(FinanceOrgCode, this.getFinanceOrgCode(), this.isset_financeOrgCode); |
| | | ib.set(Name, this.getName(), this.isset_name); |
| | | ib.set(Lv1Id, this.getLv1Id(), this.isset_lv1Id); |
| | | ib.set(Lv1Name, this.getLv1Name(), this.isset_lv1Name); |
| | | ib.set(Lv2Id, this.getLv2Id(), this.isset_lv2Id); |
| | | ib.set(Lv2Name, this.getLv2Name(), this.isset_lv2Name); |
| | | ib.set(Lv3Id, this.getLv3Id(), this.isset_lv3Id); |
| | | ib.set(Lv3Name, this.getLv3Name(), this.isset_lv3Name); |
| | | ib.set(Lv4Id, this.getLv4Id(), this.isset_lv4Id); |
| | | ib.set(Lv4Name, this.getLv4Name(), this.isset_lv4Name); |
| | | ib.set(Lv5Id, this.getLv5Id(), this.isset_lv5Id); |
| | | ib.set(Lv5Name, this.getLv5Name(), this.isset_lv5Name); |
| | | ib.set(Lv, this.getLv(), this.isset_lv); |
| | | ib.set(OrderNum, this.getOrderNum(), this.isset_orderNum); |
| | | ib.set(CreateTime3, this.getCreateTime3(), this.isset_createTime3); |
| | | ib.set(Modified, this.getModified(), this.isset_modified); |
| | | ib.set(Summary, this.getSummary(), this.isset_summary); |
| | | ib.set(Address, this.getAddress(), this.isset_address); |
| | | ib.set(Lng, this.getLng(), this.isset_lng); |
| | | ib.set(Lat, this.getLat(), this.isset_lat); |
| | | ib.set(OpenStatus, this.getOpenStatus(), this.isset_openStatus); |
| | | ib.set(OpenTime, this.getOpenTime(), this.isset_openTime); |
| | | ib.set(Status, this.getStatus(), this.isset_status); |
| | | ib.set(IsDelete, this.getIsDelete(), this.isset_isDelete); |
| | | ib.set(Path, this.getPath(), this.isset_path); |
| | | ib.set(VenueName, this.getVenueName(), this.isset_venueName); |
| | | ib.set(CityId, this.getCityId(), this.isset_cityId); |
| | | ib.set(OrgPhoto, this.getOrgPhoto(), this.isset_orgPhoto); |
| | | ib.set(ShortName, this.getShortName(), this.isset_shortName); |
| | | ib.set(TenantType, this.getTenantType(), this.isset_tenantType); |
| | | ib.set(CreateBy, this.getCreateBy(), this.isset_createBy); |
| | | ib.set(CreateTime, this.getCreateTime(), this.isset_createTime); |
| | | ib.set(UpdateBy, this.getUpdateBy(), this.isset_updateBy); |
| | | ib.set(UpdateTime, this.getUpdateTime(), this.isset_updateTime); |
| | | ib.set(BelongProvince, this.getBelongProvince(), this.isset_belongProvince); |
| | | return ib.genMapSql(); |
| | | } |
| | | |
| | | /** |
| | | * 获取更新语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getUpdateSql_() { |
| | | UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); |
| | | ub.set(Id, this.getId(), this.isset_id); |
| | | ub.set(ParentId, this.getParentId(), this.isset_parentId); |
| | | ub.set(Code, this.getCode(), this.isset_code); |
| | | ub.set(FinanceOrgCode, this.getFinanceOrgCode(), this.isset_financeOrgCode); |
| | | ub.set(Name, this.getName(), this.isset_name); |
| | | ub.set(Lv1Id, this.getLv1Id(), this.isset_lv1Id); |
| | | ub.set(Lv1Name, this.getLv1Name(), this.isset_lv1Name); |
| | | ub.set(Lv2Id, this.getLv2Id(), this.isset_lv2Id); |
| | | ub.set(Lv2Name, this.getLv2Name(), this.isset_lv2Name); |
| | | ub.set(Lv3Id, this.getLv3Id(), this.isset_lv3Id); |
| | | ub.set(Lv3Name, this.getLv3Name(), this.isset_lv3Name); |
| | | ub.set(Lv4Id, this.getLv4Id(), this.isset_lv4Id); |
| | | ub.set(Lv4Name, this.getLv4Name(), this.isset_lv4Name); |
| | | ub.set(Lv5Id, this.getLv5Id(), this.isset_lv5Id); |
| | | ub.set(Lv5Name, this.getLv5Name(), this.isset_lv5Name); |
| | | ub.set(Lv, this.getLv(), this.isset_lv); |
| | | ub.set(OrderNum, this.getOrderNum(), this.isset_orderNum); |
| | | ub.set(CreateTime3, this.getCreateTime3(), this.isset_createTime3); |
| | | ub.set(Modified, this.getModified(), this.isset_modified); |
| | | ub.set(Summary, this.getSummary(), this.isset_summary); |
| | | ub.set(Address, this.getAddress(), this.isset_address); |
| | | ub.set(Lng, this.getLng(), this.isset_lng); |
| | | ub.set(Lat, this.getLat(), this.isset_lat); |
| | | ub.set(OpenStatus, this.getOpenStatus(), this.isset_openStatus); |
| | | ub.set(OpenTime, this.getOpenTime(), this.isset_openTime); |
| | | ub.set(Status, this.getStatus(), this.isset_status); |
| | | ub.set(IsDelete, this.getIsDelete(), this.isset_isDelete); |
| | | ub.set(Path, this.getPath(), this.isset_path); |
| | | ub.set(VenueName, this.getVenueName(), this.isset_venueName); |
| | | ub.set(CityId, this.getCityId(), this.isset_cityId); |
| | | ub.set(OrgPhoto, this.getOrgPhoto(), this.isset_orgPhoto); |
| | | ub.set(ShortName, this.getShortName(), this.isset_shortName); |
| | | ub.set(TenantType, this.getTenantType(), this.isset_tenantType); |
| | | ub.set(CreateBy, this.getCreateBy(), this.isset_createBy); |
| | | ub.set(CreateTime, this.getCreateTime(), this.isset_createTime); |
| | | ub.set(UpdateBy, this.getUpdateBy(), this.isset_updateBy); |
| | | ub.set(UpdateTime, this.getUpdateTime(), this.isset_updateTime); |
| | | ub.set(BelongProvince, this.getBelongProvince(), this.isset_belongProvince); |
| | | ub.where(this.getPkName_(), this.getPkValue_()); |
| | | return ub.genMapSql(); |
| | | } |
| | | |
| | | /** |
| | | * 获取更新语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getUpdateSql_(String where, Map<String, Object> parameters) { |
| | | UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); |
| | | ub.set(Id, this.getId(), this.isset_id); |
| | | ub.set(ParentId, this.getParentId(), this.isset_parentId); |
| | | ub.set(Code, this.getCode(), this.isset_code); |
| | | ub.set(FinanceOrgCode, this.getFinanceOrgCode(), this.isset_financeOrgCode); |
| | | ub.set(Name, this.getName(), this.isset_name); |
| | | ub.set(Lv1Id, this.getLv1Id(), this.isset_lv1Id); |
| | | ub.set(Lv1Name, this.getLv1Name(), this.isset_lv1Name); |
| | | ub.set(Lv2Id, this.getLv2Id(), this.isset_lv2Id); |
| | | ub.set(Lv2Name, this.getLv2Name(), this.isset_lv2Name); |
| | | ub.set(Lv3Id, this.getLv3Id(), this.isset_lv3Id); |
| | | ub.set(Lv3Name, this.getLv3Name(), this.isset_lv3Name); |
| | | ub.set(Lv4Id, this.getLv4Id(), this.isset_lv4Id); |
| | | ub.set(Lv4Name, this.getLv4Name(), this.isset_lv4Name); |
| | | ub.set(Lv5Id, this.getLv5Id(), this.isset_lv5Id); |
| | | ub.set(Lv5Name, this.getLv5Name(), this.isset_lv5Name); |
| | | ub.set(Lv, this.getLv(), this.isset_lv); |
| | | ub.set(OrderNum, this.getOrderNum(), this.isset_orderNum); |
| | | ub.set(CreateTime3, this.getCreateTime3(), this.isset_createTime3); |
| | | ub.set(Modified, this.getModified(), this.isset_modified); |
| | | ub.set(Summary, this.getSummary(), this.isset_summary); |
| | | ub.set(Address, this.getAddress(), this.isset_address); |
| | | ub.set(Lng, this.getLng(), this.isset_lng); |
| | | ub.set(Lat, this.getLat(), this.isset_lat); |
| | | ub.set(OpenStatus, this.getOpenStatus(), this.isset_openStatus); |
| | | ub.set(OpenTime, this.getOpenTime(), this.isset_openTime); |
| | | ub.set(Status, this.getStatus(), this.isset_status); |
| | | ub.set(IsDelete, this.getIsDelete(), this.isset_isDelete); |
| | | ub.set(Path, this.getPath(), this.isset_path); |
| | | ub.set(VenueName, this.getVenueName(), this.isset_venueName); |
| | | ub.set(CityId, this.getCityId(), this.isset_cityId); |
| | | ub.set(OrgPhoto, this.getOrgPhoto(), this.isset_orgPhoto); |
| | | ub.set(ShortName, this.getShortName(), this.isset_shortName); |
| | | ub.set(TenantType, this.getTenantType(), this.isset_tenantType); |
| | | ub.set(CreateBy, this.getCreateBy(), this.isset_createBy); |
| | | ub.set(CreateTime, this.getCreateTime(), this.isset_createTime); |
| | | ub.set(UpdateBy, this.getUpdateBy(), this.isset_updateBy); |
| | | ub.set(UpdateTime, this.getUpdateTime(), this.isset_updateTime); |
| | | ub.set(BelongProvince, this.getBelongProvince(), this.isset_belongProvince); |
| | | return ub.genMapSql(where, parameters); |
| | | } |
| | | |
| | | /** |
| | | * 获取更新语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Object[]> getUpdateSql_(String where, Object[] parameters) { |
| | | UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); |
| | | ub.set(Id, this.getId(), this.isset_id); |
| | | ub.set(ParentId, this.getParentId(), this.isset_parentId); |
| | | ub.set(Code, this.getCode(), this.isset_code); |
| | | ub.set(FinanceOrgCode, this.getFinanceOrgCode(), this.isset_financeOrgCode); |
| | | ub.set(Name, this.getName(), this.isset_name); |
| | | ub.set(Lv1Id, this.getLv1Id(), this.isset_lv1Id); |
| | | ub.set(Lv1Name, this.getLv1Name(), this.isset_lv1Name); |
| | | ub.set(Lv2Id, this.getLv2Id(), this.isset_lv2Id); |
| | | ub.set(Lv2Name, this.getLv2Name(), this.isset_lv2Name); |
| | | ub.set(Lv3Id, this.getLv3Id(), this.isset_lv3Id); |
| | | ub.set(Lv3Name, this.getLv3Name(), this.isset_lv3Name); |
| | | ub.set(Lv4Id, this.getLv4Id(), this.isset_lv4Id); |
| | | ub.set(Lv4Name, this.getLv4Name(), this.isset_lv4Name); |
| | | ub.set(Lv5Id, this.getLv5Id(), this.isset_lv5Id); |
| | | ub.set(Lv5Name, this.getLv5Name(), this.isset_lv5Name); |
| | | ub.set(Lv, this.getLv(), this.isset_lv); |
| | | ub.set(OrderNum, this.getOrderNum(), this.isset_orderNum); |
| | | ub.set(CreateTime3, this.getCreateTime3(), this.isset_createTime3); |
| | | ub.set(Modified, this.getModified(), this.isset_modified); |
| | | ub.set(Summary, this.getSummary(), this.isset_summary); |
| | | ub.set(Address, this.getAddress(), this.isset_address); |
| | | ub.set(Lng, this.getLng(), this.isset_lng); |
| | | ub.set(Lat, this.getLat(), this.isset_lat); |
| | | ub.set(OpenStatus, this.getOpenStatus(), this.isset_openStatus); |
| | | ub.set(OpenTime, this.getOpenTime(), this.isset_openTime); |
| | | ub.set(Status, this.getStatus(), this.isset_status); |
| | | ub.set(IsDelete, this.getIsDelete(), this.isset_isDelete); |
| | | ub.set(Path, this.getPath(), this.isset_path); |
| | | ub.set(VenueName, this.getVenueName(), this.isset_venueName); |
| | | ub.set(CityId, this.getCityId(), this.isset_cityId); |
| | | ub.set(OrgPhoto, this.getOrgPhoto(), this.isset_orgPhoto); |
| | | ub.set(ShortName, this.getShortName(), this.isset_shortName); |
| | | ub.set(TenantType, this.getTenantType(), this.isset_tenantType); |
| | | ub.set(CreateBy, this.getCreateBy(), this.isset_createBy); |
| | | ub.set(CreateTime, this.getCreateTime(), this.isset_createTime); |
| | | ub.set(UpdateBy, this.getUpdateBy(), this.isset_updateBy); |
| | | ub.set(UpdateTime, this.getUpdateTime(), this.isset_updateTime); |
| | | ub.set(BelongProvince, this.getBelongProvince(), this.isset_belongProvince); |
| | | return ub.genArraySql(where, parameters); |
| | | } |
| | | |
| | | /** |
| | | * 获取删除语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getDeleteSql_() { |
| | | DeleteBuilder db = new DeleteBuilder(this.getTableName_()); |
| | | db.where(this.getPkName_(), this.getPkValue_()); |
| | | return db.genMapSql(); |
| | | } |
| | | |
| | | /** |
| | | * 获取删除语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getDeleteSql_(String where, Map<String, Object> parameters) { |
| | | DeleteBuilder db = new DeleteBuilder(this.getTableName_()); |
| | | return db.genMapSql(where, parameters); |
| | | } |
| | | |
| | | /** |
| | | * 获取删除语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Object[]> getDeleteSql_(String where, Object[] parameters) { |
| | | DeleteBuilder db = new DeleteBuilder(this.getTableName_()); |
| | | return db.genArraySql(where, parameters); |
| | | } |
| | | |
| | | /** |
| | | * 获取单行查询语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getSingleSql_() { |
| | | SelectBuilder sb = new SelectBuilder(this.getTableName_()); |
| | | sb.where(this.getPkName_(), this.getPkValue_()); |
| | | return sb.genMapSql(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取查询语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getSelectSql_(String where, Map<String, Object> parameters) { |
| | | return new SqlAndParameters<>("select temp_id, id, parent_id, code, finance_org_code, name, lv1_id, lv1_name, lv2_id, lv2_name, lv3_id, lv3_name, lv4_id, lv4_name, lv5_id, lv5_name, lv, order_num, create_time3, modified, summary, address, lng, lat, open_status, open_time, status, is_delete, path, venue_name, city_id, org_photo, short_name, tenant_type, create_by, create_time, update_by, update_time, belong_province from " + this.getTableName_() + " " + where, parameters); |
| | | } |
| | | |
| | | /** |
| | | * 获取查询语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) { |
| | | return new SqlAndParameters<>("select temp_id, id, parent_id, code, finance_org_code, name, lv1_id, lv1_name, lv2_id, lv2_name, lv3_id, lv3_name, lv4_id, lv4_name, lv5_id, lv5_name, lv, order_num, create_time3, modified, summary, address, lng, lat, open_status, open_time, status, is_delete, path, venue_name, city_id, org_photo, short_name, tenant_type, create_by, create_time, update_by, update_time, belong_province from " + this.getTableName_() + " " + where, parameters); |
| | | } |
| | | |
| | | /** |
| | | * 将resultset的一行转化为po |
| | | */ |
| | | @Override |
| | | public FinSysTenantRegion mapRow(ResultSet rs, int i) throws SQLException { |
| | | return ROW_MAPPER.mapRow(rs, i); |
| | | } |
| | | |
| | | /** |
| | | * 克隆 |
| | | */ |
| | | public FinSysTenantRegion toFinSysTenantRegion() { |
| | | return super.$clone(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * fin_sys_tenant_region RowMapper |
| | | * |
| | | * @author genrator |
| | | */ |
| | | class FinSysTenantRegionRowMapper implements RowMapper<FinSysTenantRegion> { |
| | | |
| | | @Override |
| | | public FinSysTenantRegion mapRow(ResultSet rs, int i) throws SQLException { |
| | | ResultSetUtils resultSetUtils = new ResultSetUtils(); |
| | | FinSysTenantRegion fin_sys_tenant_region = new FinSysTenantRegion(); |
| | | Integer columnIndex; |
| | | //主键 |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.TempId); |
| | | if (columnIndex > 0) { |
| | | fin_sys_tenant_region.setTempId(rs.getLong(columnIndex)); |
| | | } |
| | | //普通属性 |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.Id); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | fin_sys_tenant_region.setId(null); |
| | | } else { |
| | | fin_sys_tenant_region.setId(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.ParentId); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | fin_sys_tenant_region.setParentId(null); |
| | | } else { |
| | | fin_sys_tenant_region.setParentId(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.Code); |
| | | if (columnIndex > 0) { |
| | | fin_sys_tenant_region.setCode(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.FinanceOrgCode); |
| | | if (columnIndex > 0) { |
| | | fin_sys_tenant_region.setFinanceOrgCode(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.Name); |
| | | if (columnIndex > 0) { |
| | | fin_sys_tenant_region.setName(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.Lv1Id); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | fin_sys_tenant_region.setLv1Id(null); |
| | | } else { |
| | | fin_sys_tenant_region.setLv1Id(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.Lv1Name); |
| | | if (columnIndex > 0) { |
| | | fin_sys_tenant_region.setLv1Name(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.Lv2Id); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | fin_sys_tenant_region.setLv2Id(null); |
| | | } else { |
| | | fin_sys_tenant_region.setLv2Id(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.Lv2Name); |
| | | if (columnIndex > 0) { |
| | | fin_sys_tenant_region.setLv2Name(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.Lv3Id); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | fin_sys_tenant_region.setLv3Id(null); |
| | | } else { |
| | | fin_sys_tenant_region.setLv3Id(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.Lv3Name); |
| | | if (columnIndex > 0) { |
| | | fin_sys_tenant_region.setLv3Name(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.Lv4Id); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | fin_sys_tenant_region.setLv4Id(null); |
| | | } else { |
| | | fin_sys_tenant_region.setLv4Id(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.Lv4Name); |
| | | if (columnIndex > 0) { |
| | | fin_sys_tenant_region.setLv4Name(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.Lv5Id); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | fin_sys_tenant_region.setLv5Id(null); |
| | | } else { |
| | | fin_sys_tenant_region.setLv5Id(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.Lv5Name); |
| | | if (columnIndex > 0) { |
| | | fin_sys_tenant_region.setLv5Name(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.Lv); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | fin_sys_tenant_region.setLv(null); |
| | | } else { |
| | | fin_sys_tenant_region.setLv(rs.getInt(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.OrderNum); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | fin_sys_tenant_region.setOrderNum(null); |
| | | } else { |
| | | fin_sys_tenant_region.setOrderNum(rs.getInt(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.CreateTime3); |
| | | if (columnIndex > 0) { |
| | | fin_sys_tenant_region.setCreateTime3(rs.getDate(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.Modified); |
| | | if (columnIndex > 0) { |
| | | fin_sys_tenant_region.setModified(rs.getDate(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.Summary); |
| | | if (columnIndex > 0) { |
| | | fin_sys_tenant_region.setSummary(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.Address); |
| | | if (columnIndex > 0) { |
| | | fin_sys_tenant_region.setAddress(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.Lng); |
| | | if (columnIndex > 0) { |
| | | fin_sys_tenant_region.setLng(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.Lat); |
| | | if (columnIndex > 0) { |
| | | fin_sys_tenant_region.setLat(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.OpenStatus); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | fin_sys_tenant_region.setOpenStatus(null); |
| | | } else { |
| | | fin_sys_tenant_region.setOpenStatus(rs.getInt(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.OpenTime); |
| | | if (columnIndex > 0) { |
| | | fin_sys_tenant_region.setOpenTime(rs.getDate(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.Status); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | fin_sys_tenant_region.setStatus(null); |
| | | } else { |
| | | fin_sys_tenant_region.setStatus(rs.getInt(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.IsDelete); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | fin_sys_tenant_region.setIsDelete(null); |
| | | } else { |
| | | fin_sys_tenant_region.setIsDelete(rs.getInt(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.Path); |
| | | if (columnIndex > 0) { |
| | | fin_sys_tenant_region.setPath(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.VenueName); |
| | | if (columnIndex > 0) { |
| | | fin_sys_tenant_region.setVenueName(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.CityId); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | fin_sys_tenant_region.setCityId(null); |
| | | } else { |
| | | fin_sys_tenant_region.setCityId(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.OrgPhoto); |
| | | if (columnIndex > 0) { |
| | | fin_sys_tenant_region.setOrgPhoto(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.ShortName); |
| | | if (columnIndex > 0) { |
| | | fin_sys_tenant_region.setShortName(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.TenantType); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | fin_sys_tenant_region.setTenantType(null); |
| | | } else { |
| | | fin_sys_tenant_region.setTenantType(rs.getInt(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.CreateBy); |
| | | if (columnIndex > 0) { |
| | | fin_sys_tenant_region.setCreateBy(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.CreateTime); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | fin_sys_tenant_region.setCreateTime(null); |
| | | } else { |
| | | fin_sys_tenant_region.setCreateTime(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.UpdateBy); |
| | | if (columnIndex > 0) { |
| | | fin_sys_tenant_region.setUpdateBy(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.UpdateTime); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | fin_sys_tenant_region.setUpdateTime(null); |
| | | } else { |
| | | fin_sys_tenant_region.setUpdateTime(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantRegion_mapper.BelongProvince); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | fin_sys_tenant_region.setBelongProvince(null); |
| | | } else { |
| | | fin_sys_tenant_region.setBelongProvince(rs.getInt(columnIndex)); |
| | | } |
| | | } |
| | | return fin_sys_tenant_region; |
| | | } |
| | | } |
New file |
| | |
| | | package com.consum.model.vo; |
| | | |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | |
| | | import java.util.List; |
| | | |
| | | public class FinSysTenantUserResult { |
| | | |
| | | private String orgName; // 机构名称 |
| | | |
| | | private Long orgId;// 机构id |
| | | |
| | | private List<FinSysTenantUser> userList;// 用户List |
| | | |
| | | public String getOrgName() { |
| | | return orgName; |
| | | } |
| | | |
| | | public void setOrgName(String orgName) { |
| | | this.orgName = orgName; |
| | | } |
| | | |
| | | public Long getOrgId() { |
| | | return orgId; |
| | | } |
| | | |
| | | public void setOrgId(Long orgId) { |
| | | this.orgId = orgId; |
| | | } |
| | | |
| | | public List<FinSysTenantUser> getUserList() { |
| | | return userList; |
| | | } |
| | | |
| | | public void setUserList(List<FinSysTenantUser> userList) { |
| | | this.userList = userList; |
| | | } |
| | | } |