diff --git a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/config/YudaoMybatisAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/config/YudaoMybatisAutoConfiguration.java index 1df9d35b..145a3299 100644 --- a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/config/YudaoMybatisAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/config/YudaoMybatisAutoConfiguration.java @@ -20,8 +20,11 @@ import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; +import org.springframework.core.io.Resource; +import org.springframework.core.io.support.PathMatchingResourcePatternResolver; import javax.sql.DataSource; +import java.util.Arrays; import java.util.Map; /** @@ -32,6 +35,7 @@ import java.util.Map; @MapperScans({ @MapperScan(basePackages ={"co.yixiang.**.service.mapper", "co.yixiang.config"},sqlSessionFactoryRef = "shangcheng"), + @MapperScan(basePackages = {"com.zsw.erp.datasource.mappers"},sqlSessionFactoryRef = "erp"), @MapperScan(value = "${yudao.info.base-package}", annotationClass = Mapper.class, lazyInitialization = "${mybatis.lazy-initialization:false}") // Mapper 懒加载,目前仅用于单元测试 }) @@ -69,6 +73,21 @@ public class YudaoMybatisAutoConfiguration { return getSqlSessionFactory(factory); } + @Bean("erp") + public SqlSessionFactory erpSqlSessionFactory(DynamicDataSourceProvider dynamicDataSourceProvider) throws Exception { + MybatisSqlSessionFactoryBean factory = new MybatisSqlSessionFactoryBean(); + Resource[] resources = new PathMatchingResourcePatternResolver().getResources("classpath*:/erp_mapper/*.xml"); + Arrays.stream(resources).forEach(resource -> { + log.info("erp mapper:{}",resource.getFilename()); + }); + factory.setMapperLocations(resources); + Map map = dynamicDataSourceProvider.loadDataSources(); + DataSource dataSource = map.get("erp"); + factory.setDataSource(map.get("erp")); + return getSqlSessionFactory(factory); + } + + private SqlSessionFactory getSqlSessionFactory(MybatisSqlSessionFactoryBean factory) throws Exception { GlobalConfig globalConfig = new GlobalConfig(); GlobalConfig.DbConfig dbConfig = new GlobalConfig.DbConfig(); diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/authentication/MultiUserDetailsAuthenticationProvider.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/authentication/MultiUserDetailsAuthenticationProvider.java index 972c3408..c0908f6f 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/authentication/MultiUserDetailsAuthenticationProvider.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/authentication/MultiUserDetailsAuthenticationProvider.java @@ -143,6 +143,7 @@ public class MultiUserDetailsAuthenticationProvider extends AbstractUserDetailsA if (request.getRequestURI().startsWith(properties.getAdminApi().getPrefix()) || request.getRequestURI().startsWith("/common/") || request.getRequestURI().startsWith("/bxg") + || request.getRequestURI().startsWith("/erp") || request.getRequestURI().startsWith("/api/upload") ) { return UserTypeEnum.ADMIN; diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/YudaoSwaggerAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/YudaoSwaggerAutoConfiguration.java index d4553cfa..e45f2967 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/YudaoSwaggerAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/YudaoSwaggerAutoConfiguration.java @@ -49,6 +49,7 @@ public class YudaoSwaggerAutoConfiguration { return new Docket(DocumentationType.SWAGGER_2) // 用来创建该 API 的基本信息,展示在文档的页面中(自定义展示的信息) .apiInfo(apiInfo(properties)) + .groupName("管理系统") // 设置扫描指定 package 包下的 .select() .apis(basePackage(properties.getBasePackage())) @@ -75,7 +76,7 @@ public class YudaoSwaggerAutoConfiguration { .build(); pars.add(ticketPar.build()); return new Docket(DocumentationType.SWAGGER_2) - .groupName("ADMIN") + .groupName("商城后台") .enable(true) .apiInfo(apiInfo(properties)) .select() @@ -103,7 +104,7 @@ public class YudaoSwaggerAutoConfiguration { .build(); pars.add(ticketPar.build()); return new Docket(DocumentationType.SWAGGER_2) - .groupName("APP") + .groupName("商城前台") .enable(true) .apiInfo(apiInfo(properties)) .select() @@ -132,7 +133,7 @@ public class YudaoSwaggerAutoConfiguration { .build(); pars.add(ticketPar.build()); return new Docket(DocumentationType.SWAGGER_2) - .groupName("TOOL") + .groupName("电商工具") .enable(true) .apiInfo(apiInfo(properties)) .select() @@ -146,6 +147,34 @@ public class YudaoSwaggerAutoConfiguration { .securityContexts(securityContexts()); } + @Bean("ERP") + @SuppressWarnings("all") + public Docket createErpApi() { + SwaggerProperties properties = swaggerProperties(); + ParameterBuilder ticketPar = new ParameterBuilder(); + List pars = new ArrayList<>(); + ticketPar.name("token").description("token") + .modelRef(new ModelRef("string")) + .parameterType("header") + .defaultValue("token" + " ") + .required(true) + .build(); + pars.add(ticketPar.build()); + return new Docket(DocumentationType.SWAGGER_2) + .groupName("进销存") + .enable(true) + .apiInfo(apiInfo(properties)) + .select() + .apis(RequestHandlerSelectors.basePackage("com.zsw.erp")) + .paths(PathSelectors.regex("/error.*").negate()) + .build() + .globalOperationParameters(pars) + //添加登陆认证 + .securitySchemes(securitySchemes()) + .globalRequestParameters(globalRequestParameters()) + .securityContexts(securityContexts()); + } + // ========== apiInfo ========== /** diff --git a/yudao-server/src/main/java/cn/iocoder/yudao/server/YudaoServerApplication.java b/yudao-server/src/main/java/cn/iocoder/yudao/server/YudaoServerApplication.java index d7abdcff..b287ed2f 100644 --- a/yudao-server/src/main/java/cn/iocoder/yudao/server/YudaoServerApplication.java +++ b/yudao-server/src/main/java/cn/iocoder/yudao/server/YudaoServerApplication.java @@ -4,7 +4,10 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SuppressWarnings("SpringComponentScan") // 忽略 IDEA 无法识别 ${yudao.info.base-package} -@SpringBootApplication(scanBasePackages = {"${yudao.info.base-package}.server", "${yudao.info.base-package}.module","co.yixiang"}) +@SpringBootApplication(scanBasePackages = { + "${yudao.info.base-package}.server", "${yudao.info.base-package}.module", + "co.yixiang", "com.zsw.erp" +}) public class YudaoServerApplication { public static void main(String[] args) { diff --git a/yudao-server/src/main/resources/application-local.yaml b/yudao-server/src/main/resources/application-local.yaml index 51be165b..d9242442 100644 --- a/yudao-server/src/main/resources/application-local.yaml +++ b/yudao-server/src/main/resources/application-local.yaml @@ -60,6 +60,12 @@ spring: driver-class-name: com.mysql.jdbc.Driver username: root password: root + erp: # 进销存 + name: erp + url: jdbc:mysql://192.168.10.250:3306/${spring.datasource.dynamic.datasource.erp.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT + driver-class-name: com.mysql.jdbc.Driver + username: root + password: root # farm: # 农场数据源 # name: zsw-farm # url: jdbc:mysql://192.168.10.129:3306/${spring.datasource.dynamic.datasource.farm.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT @@ -225,4 +231,5 @@ justauth: cache: type: REDIS prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE:: - timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟 \ No newline at end of file + timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟 + diff --git a/zsw-bxg/src/main/java/co/yixiang/app/modules/shop/rest/IndexController.java b/zsw-bxg/src/main/java/co/yixiang/app/modules/shop/rest/BxgIndexController.java similarity index 99% rename from zsw-bxg/src/main/java/co/yixiang/app/modules/shop/rest/IndexController.java rename to zsw-bxg/src/main/java/co/yixiang/app/modules/shop/rest/BxgIndexController.java index 7133f88e..3f2d7250 100644 --- a/zsw-bxg/src/main/java/co/yixiang/app/modules/shop/rest/IndexController.java +++ b/zsw-bxg/src/main/java/co/yixiang/app/modules/shop/rest/BxgIndexController.java @@ -63,7 +63,7 @@ import java.util.Map; @RestController @RequiredArgsConstructor(onConstructor = @__(@Autowired)) @Api(value = "首页模块", tags = "商城:首页模块") -public class IndexController { +public class BxgIndexController { private final YxAppVersionService appVersionService; private final YxSystemGroupDataService systemGroupDataService; private final YxStoreProductService storeProductService; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponIssueUserServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponIssueUserServiceImpl.java index 3fb13e65..b74a0324 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponIssueUserServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponIssueUserServiceImpl.java @@ -17,8 +17,6 @@ import co.yixiang.modules.activity.service.dto.YxStoreCouponIssueUserDto; import co.yixiang.modules.activity.service.dto.YxStoreCouponIssueUserQueryCriteria; import co.yixiang.modules.activity.service.mapper.YxStoreCouponIssueUserMapper; import co.yixiang.utils.FileUtil; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.github.pagehelper.PageInfo; import lombok.AllArgsConstructor; import org.springframework.data.domain.Pageable; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/canvas/service/impl/StoreCanvasServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/canvas/service/impl/StoreCanvasServiceImpl.java index 250131aa..5c1d4aef 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/canvas/service/impl/StoreCanvasServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/canvas/service/impl/StoreCanvasServiceImpl.java @@ -12,10 +12,8 @@ import co.yixiang.modules.canvas.domain.StoreCanvas; import co.yixiang.common.service.impl.BaseServiceImpl; import lombok.AllArgsConstructor; import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.ValidationUtil; import co.yixiang.utils.FileUtil; import co.yixiang.modules.canvas.service.StoreCanvasService; import co.yixiang.modules.canvas.service.dto.StoreCanvasDto; @@ -28,7 +26,6 @@ import org.springframework.transaction.annotation.Transactional; //import org.springframework.cache.annotation.CacheConfig; //import org.springframework.cache.annotation.CacheEvict; //import org.springframework.cache.annotation.Cacheable; -import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import java.util.List; import java.util.Map; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/customer/service/impl/YxStoreCustomerServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/customer/service/impl/YxStoreCustomerServiceImpl.java index 1b2b9b65..764ec92b 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/customer/service/impl/YxStoreCustomerServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/customer/service/impl/YxStoreCustomerServiceImpl.java @@ -12,10 +12,8 @@ import co.yixiang.modules.customer.domain.YxStoreCustomer; import co.yixiang.common.service.impl.BaseServiceImpl; import lombok.AllArgsConstructor; import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.ValidationUtil; import co.yixiang.utils.FileUtil; import co.yixiang.modules.customer.service.YxStoreCustomerService; import co.yixiang.modules.customer.service.dto.YxStoreCustomerDto; @@ -28,7 +26,6 @@ import org.springframework.transaction.annotation.Transactional; //import org.springframework.cache.annotation.CacheConfig; //import org.springframework.cache.annotation.CacheEvict; //import org.springframework.cache.annotation.Cacheable; -import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import java.util.List; import java.util.Map; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/mp/service/impl/YxArticleServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/mp/service/impl/YxArticleServiceImpl.java index 1485f6f6..0cc09439 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/mp/service/impl/YxArticleServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/mp/service/impl/YxArticleServiceImpl.java @@ -23,7 +23,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Value; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/mp/service/impl/YxWechatLiveGoodsServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/mp/service/impl/YxWechatLiveGoodsServiceImpl.java index 07e2ec7a..9bd1eff0 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/mp/service/impl/YxWechatLiveGoodsServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/mp/service/impl/YxWechatLiveGoodsServiceImpl.java @@ -19,7 +19,6 @@ import co.yixiang.common.utils.QueryHelpPlus; import co.yixiang.dozer.service.IGenerator; import co.yixiang.enums.LiveGoodsEnum; import co.yixiang.exception.BadRequestException; -import co.yixiang.modules.mp.service.dto.WxMaLiveInfo; import co.yixiang.modules.mp.service.mapper.YxWechatLiveGoodsMapper; import co.yixiang.modules.mp.domain.YxWechatLiveGoods; import co.yixiang.modules.mp.service.YxWechatLiveGoodsService; @@ -32,7 +31,6 @@ import lombok.extern.slf4j.Slf4j; import me.chanjar.weixin.common.api.WxConsts; import me.chanjar.weixin.common.bean.result.WxMediaUploadResult; import me.chanjar.weixin.common.error.WxErrorException; -import org.springframework.beans.factory.annotation.Value; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/mp/service/impl/YxWechatLiveServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/mp/service/impl/YxWechatLiveServiceImpl.java index e1b8f69a..be7dfd5c 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/mp/service/impl/YxWechatLiveServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/mp/service/impl/YxWechatLiveServiceImpl.java @@ -16,7 +16,6 @@ import cn.hutool.json.JSONUtil; import co.yixiang.common.service.impl.BaseServiceImpl; import co.yixiang.common.utils.QueryHelpPlus; import co.yixiang.dozer.service.IGenerator; -import co.yixiang.enums.ShopCommonEnum; import co.yixiang.exception.BadRequestException; import co.yixiang.modules.mp.domain.YxWechatLiveGoods; import co.yixiang.modules.mp.service.YxWechatLiveGoodsService; @@ -26,8 +25,6 @@ import co.yixiang.modules.mp.service.mapper.YxWechatLiveMapper; import co.yixiang.modules.mp.vo.WechatLiveVo; import co.yixiang.modules.mp.domain.YxWechatLive; import co.yixiang.modules.mp.config.WxMaConfiguration; -import co.yixiang.modules.product.domain.YxStoreProduct; -import co.yixiang.modules.product.vo.YxStoreProductQueryVo; import co.yixiang.utils.FileUtil; import co.yixiang.utils.OrderUtil; import co.yixiang.utils.StringUtils; @@ -44,7 +41,6 @@ import me.chanjar.weixin.common.enums.WxType; import me.chanjar.weixin.common.error.WxError; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.common.util.json.GsonParser; -import org.springframework.beans.factory.annotation.Value; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/order/rest/StoreOrderController.java b/zsw-bxg/src/main/java/co/yixiang/modules/order/rest/StoreOrderController.java index e5a0afb5..eda4cc76 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/order/rest/StoreOrderController.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/order/rest/StoreOrderController.java @@ -36,7 +36,6 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Value; import org.springframework.data.domain.Pageable; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/product/rest/StoreProductRuleController.java b/zsw-bxg/src/main/java/co/yixiang/modules/product/rest/StoreProductRuleController.java index 893f6f41..9026925f 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/product/rest/StoreProductRuleController.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/product/rest/StoreProductRuleController.java @@ -13,7 +13,6 @@ import co.yixiang.logging.aop.log.Log; import co.yixiang.modules.aop.ForbidSubmit; import co.yixiang.modules.product.domain.YxStoreProductRule; import co.yixiang.modules.product.service.YxStoreProductRuleService; -import co.yixiang.modules.product.service.dto.YxStoreProductRuleDto; import co.yixiang.modules.product.service.dto.YxStoreProductRuleQueryCriteria; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/product/service/impl/YxStoreProductRuleServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/product/service/impl/YxStoreProductRuleServiceImpl.java index caa65201..7dcebe30 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/product/service/impl/YxStoreProductRuleServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/product/service/impl/YxStoreProductRuleServiceImpl.java @@ -13,7 +13,6 @@ import co.yixiang.common.utils.QueryHelpPlus; import co.yixiang.dozer.service.IGenerator; import co.yixiang.modules.product.domain.YxStoreProductRule; import co.yixiang.modules.product.service.YxStoreProductRuleService; -import co.yixiang.modules.product.service.dto.YxStoreProductRuleDto; import co.yixiang.modules.product.service.dto.YxStoreProductRuleQueryCriteria; import co.yixiang.modules.product.service.mapper.YxStoreProductRuleMapper; import co.yixiang.utils.FileUtil; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/sales/StoreAfterSalesController.java b/zsw-bxg/src/main/java/co/yixiang/modules/sales/StoreAfterSalesController.java index b5c87fcc..1a8aaf0e 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/sales/StoreAfterSalesController.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/sales/StoreAfterSalesController.java @@ -1,7 +1,5 @@ package co.yixiang.modules.sales; -import co.yixiang.annotation.AnonymousAccess; -import co.yixiang.domain.PageResult; import co.yixiang.dozer.service.IGenerator; import co.yixiang.logging.aop.log.Log; import co.yixiang.modules.mp.service.WeixinPayService; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/shop/service/impl/YxAppVersionServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/shop/service/impl/YxAppVersionServiceImpl.java index 67eb312d..1220debd 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/shop/service/impl/YxAppVersionServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/shop/service/impl/YxAppVersionServiceImpl.java @@ -12,10 +12,8 @@ import co.yixiang.modules.shop.domain.YxAppVersion; import co.yixiang.common.service.impl.BaseServiceImpl; import lombok.AllArgsConstructor; import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.ValidationUtil; import co.yixiang.utils.FileUtil; import co.yixiang.modules.shop.service.YxAppVersionService; import co.yixiang.modules.shop.service.dto.YxAppVersionDto; @@ -28,7 +26,6 @@ import org.springframework.transaction.annotation.Transactional; //import org.springframework.cache.annotation.CacheConfig; //import org.springframework.cache.annotation.CacheEvict; //import org.springframework.cache.annotation.Cacheable; -import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import java.util.List; import java.util.Map; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/shop/service/impl/YxMaterialServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/shop/service/impl/YxMaterialServiceImpl.java index 5b42a2b6..00788961 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/shop/service/impl/YxMaterialServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/shop/service/impl/YxMaterialServiceImpl.java @@ -15,7 +15,7 @@ import co.yixiang.modules.shop.domain.YxMaterial; import co.yixiang.modules.shop.service.YxMaterialService; import co.yixiang.modules.shop.service.dto.YxMaterialDto; import co.yixiang.modules.shop.service.dto.YxMaterialQueryCriteria; -import co.yixiang.modules.shop.service.mapper.MaterialMapper; +import co.yixiang.modules.shop.service.mapper.YxMaterialMapper; import com.github.pagehelper.PageInfo; import lombok.AllArgsConstructor; import org.springframework.data.domain.Pageable; @@ -35,7 +35,7 @@ import java.util.Map; @Service @AllArgsConstructor @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxMaterialServiceImpl extends BaseServiceImpl implements YxMaterialService { +public class YxMaterialServiceImpl extends BaseServiceImpl implements YxMaterialService { private final IGenerator generator; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/shop/service/mapper/MaterialMapper.java b/zsw-bxg/src/main/java/co/yixiang/modules/shop/service/mapper/YxMaterialMapper.java similarity index 90% rename from zsw-bxg/src/main/java/co/yixiang/modules/shop/service/mapper/MaterialMapper.java rename to zsw-bxg/src/main/java/co/yixiang/modules/shop/service/mapper/YxMaterialMapper.java index 9306679d..97e66461 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/shop/service/mapper/MaterialMapper.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/shop/service/mapper/YxMaterialMapper.java @@ -17,6 +17,6 @@ import org.springframework.stereotype.Repository; * @date 2020-05-12 */ @Repository -public interface MaterialMapper extends CoreMapper { +public interface YxMaterialMapper extends CoreMapper { } diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/user/service/impl/YxUserAddressServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/user/service/impl/YxUserAddressServiceImpl.java index 293fbcaf..d44c59e5 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/user/service/impl/YxUserAddressServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/user/service/impl/YxUserAddressServiceImpl.java @@ -9,7 +9,6 @@ package co.yixiang.modules.user.service.impl; -import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; import co.yixiang.common.service.impl.BaseServiceImpl; import co.yixiang.dozer.service.IGenerator; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/user/service/impl/YxUserBillServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/user/service/impl/YxUserBillServiceImpl.java index 55c90461..370cbaae 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/user/service/impl/YxUserBillServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/user/service/impl/YxUserBillServiceImpl.java @@ -41,7 +41,6 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.math.BigDecimal; import java.util.*; -import java.util.stream.Collectors; /** diff --git a/zsw-bxg/src/main/java/co/yixiang/tools/service/impl/QiNiuServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/tools/service/impl/QiNiuServiceImpl.java index 2ac06c6f..e5845442 100644 --- a/zsw-bxg/src/main/java/co/yixiang/tools/service/impl/QiNiuServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/tools/service/impl/QiNiuServiceImpl.java @@ -25,7 +25,6 @@ import com.qiniu.storage.UploadManager; import com.qiniu.storage.model.DefaultPutRet; import com.qiniu.storage.model.FileInfo; import com.qiniu.util.Auth; -import org.springframework.beans.factory.annotation.Value; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; diff --git a/zsw-erp/pom.xml b/zsw-erp/pom.xml index ff640d8c..f822bb76 100644 --- a/zsw-erp/pom.xml +++ b/zsw-erp/pom.xml @@ -23,9 +23,9 @@ - com.zsw - pos-spi - 1.0-SNAPSHOT + cn.iocoder.boot + zsw-spi + 1.6.2-snapshot @@ -40,46 +40,55 @@ yudao-module-system-impl 1.6.2-snapshot + cn.iocoder.boot yudao-spring-boot-starter-biz-weixin ${revision} + cn.iocoder.boot yudao-common ${revision} + cn.iocoder.boot yudao-spring-boot-starter-biz-pay ${revision} + cn.iocoder.boot yudao-spring-boot-starter-mybatis ${revision} + cn.iocoder.boot yudao-spring-boot-starter-web ${revision} + cn.iocoder.boot yudao-spring-boot-starter-redis ${revision} + cn.iocoder.boot yudao-spring-boot-starter-security ${revision} + cn.iocoder.boot yudao-spring-boot-starter-extension ${revision} + org.springframework.boot spring-boot-starter-websocket @@ -97,6 +106,31 @@ + + + net.sourceforge.jexcelapi + jxl + 2.6.12 + + + log4j + log4j + + + + + + net.sf.dozer + dozer-spring + 5.5.1 + + + + net.sf.dozer + dozer + 5.5.1 + + diff --git a/zsw-erp/src/main/java/com/zsw/erp/config/MvcConfigurer.java b/zsw-erp/src/main/java/com/zsw/erp/config/MvcConfigurer.java new file mode 100644 index 00000000..9f2eed1a --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/config/MvcConfigurer.java @@ -0,0 +1,15 @@ +package com.zsw.erp.config; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +@Configuration +public class MvcConfigurer implements WebMvcConfigurer { + + @Override + public void configurePathMatch(PathMatchConfigurer configurer) { + configurer.addPathPrefix("/admin-api/erp",aClass -> aClass.getPackage().getName().startsWith("com.zsw.erp")); + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/AccountController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/AccountController.java deleted file mode 100644 index 48429a67..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/controller/AccountController.java +++ /dev/null @@ -1,152 +0,0 @@ -package com.zsw.erp.controller; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.zsw.erp.datasource.entities.Account; -import com.zsw.erp.datasource.vo.AccountVo4InOutList; -import com.zsw.erp.service.account.AccountService; -import com.zsw.base.R; -import com.zsw.erp.utils.ErpInfo; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import static com.zsw.erp.utils.ResponseJsonUtil.returnJson; - - -@RestController -@RequestMapping(value = "/account") -@Api(tags = {"账户管理"}) -public class AccountController { - private Logger logger = LoggerFactory.getLogger(AccountController.class); - - @Resource - private AccountService accountService; - - /** - * 查找结算账户信息-下拉框 - * @param request - * @return - */ - @GetMapping(value = "/findBySelect") - @ApiOperation(value = "查找结算账户信息-下拉框") - public String findBySelect(HttpServletRequest request) throws Exception { - String res = null; - try { - List dataList = accountService.findBySelect(); - //存放数据json数组 - JSONArray dataArray = new JSONArray(); - if (null != dataList) { - for (Account account : dataList) { - JSONObject item = new JSONObject(); - item.put("Id", account.getId()); - //结算账户名称 - item.put("AccountName", account.getName()); - dataArray.add(item); - } - } - res = dataArray.toJSONString(); - } catch(Exception e){ - e.printStackTrace(); - res = "获取数据失败"; - } - return res; - } - - /** - * 获取所有结算账户 - * @param request - * @return - */ - @GetMapping(value = "/getAccount") - @ApiOperation(value = "获取所有结算账户") - public R getAccount(HttpServletRequest request) throws Exception { - - Map map = new HashMap(); - List accountList = accountService.getAccount(); - map.put("accountList", accountList); - return R.success(map); - } - - /** - * 账户流水信息 - * @param currentPage - * @param pageSize - * @param accountId - * @param initialAmount - * @param request - * @return - */ - @GetMapping(value = "/findAccountInOutList") - @ApiOperation(value = "账户流水信息") - public R findAccountInOutList(@RequestParam("currentPage") Integer currentPage, - @RequestParam("pageSize") Integer pageSize, - @RequestParam("accountId") Long accountId, - @RequestParam("initialAmount") BigDecimal initialAmount, - HttpServletRequest request) throws Exception{ - - Map map = new HashMap(); - List dataList = accountService.findAccountInOutList(accountId, (currentPage-1)*pageSize, pageSize); - int total = accountService.findAccountInOutListCount(accountId); - map.put("total", total); - //存放数据json数组 - JSONArray dataArray = new JSONArray(); - if (null != dataList) { - for (AccountVo4InOutList aEx : dataList) { - String timeStr = aEx.getOperTime().toString(); - BigDecimal balance = accountService.getAccountSum(accountId, timeStr, "date").add(accountService.getAccountSumByHead(accountId, timeStr, "date")) - .add(accountService.getAccountSumByDetail(accountId, timeStr, "date")).add(accountService.getManyAccountSum(accountId, timeStr, "date")).add(initialAmount); - aEx.setBalance(balance); - aEx.setAccountId(accountId); - dataArray.add(aEx); - } - } - map.put("rows", dataArray); - return R.success(map); - } - - /** - * 更新默认账户 - * @param object - * @param request - * @return - * @throws Exception - */ - @PostMapping(value = "/updateIsDefault") - @ApiOperation(value = "更新默认账户") - public String updateIsDefault(@RequestBody JSONObject object, - HttpServletRequest request) throws Exception{ - Long accountId = object.getLong("id"); - Map objectMap = new HashMap<>(); - int res = accountService.updateIsDefault(accountId); - if(res > 0) { - return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); - } else { - return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); - } - } - - /** - * 结算账户的统计 - * @param request - * @return - */ - @GetMapping(value = "/getStatistics") - @ApiOperation(value = "结算账户的统计") - public R getStatistics(@RequestParam("name") String name, - @RequestParam("serialNo") String serialNo, - HttpServletRequest request) throws Exception { - - Map map = accountService.getStatistics(name, serialNo); - return R.success(map); - } -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/BomController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/BomController.java index e3c57532..9e35260e 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/controller/BomController.java +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/BomController.java @@ -5,8 +5,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.collect.Lists; import com.zsw.base.R; import com.zsw.erp.datasource.dto.BomDto; +import com.zsw.erp.dto.bom.BomConvert; import com.zsw.erp.service.zyh.BomService; -import com.zsw.erp.utils.DozerUtils; import com.zsw.pos.product.dto.AdminStoreProductDTO; import com.zsw.pos.product.entity.Product; import com.zsw.pos.product.entity.ProductSku; @@ -29,17 +29,13 @@ import java.util.List; @RequestMapping("/bom") @Slf4j public class BomController { - - @Resource - private DozerUtils dozerUtils; - - @DubboReference +// @DubboReference private ProductService productService; - @DubboReference +// @DubboReference private ProductSkuService productSkuService; - @DubboReference +// @DubboReference private StoreService storeService; @Resource @@ -60,7 +56,7 @@ public class BomController { @GetMapping("/list") @ApiOperation("列举全部BOM") public R> list(){ - List rs = dozerUtils.convertList(bomService.list(), BomDto.class); + List rs = BomConvert.INSTANCE.convertList2Dto(bomService.list()); return R.success(rs); } diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/MaterialController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/BxgProductController.java similarity index 99% rename from zsw-erp/src/main/java/com/zsw/erp/controller/MaterialController.java rename to zsw-erp/src/main/java/com/zsw/erp/controller/BxgProductController.java index 03c935de..925ea901 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/controller/MaterialController.java +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/BxgProductController.java @@ -34,8 +34,8 @@ import static com.zsw.erp.utils.ResponseJsonUtil.returnJson; @RestController @RequestMapping(value = "/material") @Api(tags = {"商品管理"}) -public class MaterialController { - private Logger logger = LoggerFactory.getLogger(MaterialController.class); +public class BxgProductController { + private Logger logger = LoggerFactory.getLogger(BxgProductController.class); @Resource private MaterialService materialService; diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/DepotController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/DepotController.java index 3926e356..91ec0842 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/controller/DepotController.java +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/DepotController.java @@ -7,7 +7,6 @@ import com.zsw.erp.datasource.entities.DepotEx; import com.zsw.erp.datasource.entities.MaterialInitialStock; import com.zsw.erp.service.depot.DepotService; import com.zsw.erp.service.material.MaterialService; -import com.zsw.erp.service.userBusiness.UserBusinessService; import com.zsw.base.R; import com.zsw.erp.utils.ErpInfo; import io.swagger.annotations.Api; @@ -33,9 +32,6 @@ public class DepotController { @Resource private DepotService depotService; - @Resource - private UserBusinessService userBusinessService; - @Resource private MaterialService materialService; @@ -66,7 +62,6 @@ public class DepotController { JSONArray arr = new JSONArray(); try { //获取权限信息 - List ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, keyId); List dataList = depotService.findUserDepot(); //开始拼接json数据 JSONObject outer = new JSONObject(); @@ -85,10 +80,7 @@ public class DepotController { item.put("value", depot.getId()); item.put("title", depot.getName()); item.put("attributes", depot.getName()); - Boolean flag = ubValue.contains(depot.getId()); - if (flag) { - item.put("checked", true); - } + dataArray.add(item); } } diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/DepotHeadController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/DepotHeadController.java index 3a590f11..8bf769a1 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/controller/DepotHeadController.java +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/DepotHeadController.java @@ -3,6 +3,8 @@ package com.zsw.erp.controller; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DateUtil; +import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; +import cn.iocoder.yudao.module.system.service.user.AdminUserService; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.zsw.base.R; @@ -14,7 +16,7 @@ import com.zsw.erp.datasource.vo.DepotHeadVo4InDetail; import com.zsw.erp.datasource.vo.DepotHeadVo4InOutMCount; import com.zsw.erp.datasource.vo.DepotHeadVo4List; import com.zsw.erp.datasource.vo.DepotHeadVo4StatementAccount; -import com.zsw.erp.service.account.AccountService; +import com.zsw.erp.dto.depot.DepotConvert; import com.zsw.erp.service.accountHead.AccountHeadService; import com.zsw.erp.service.depot.DepotService; import com.zsw.erp.service.depotHead.DepotHeadService; @@ -54,7 +56,8 @@ public class DepotHeadController { private AccountHeadService accountHeadService; @Resource - private AccountService accountService; + private AdminUserService adminUserService; + @Resource private SupplierService supplierService; @@ -464,15 +467,15 @@ public class DepotHeadController { body.setInfo(head); List list = depotItemService.getListByHeaderId(head.getId()); - List listRs = BeanUtil.copyToList(list, DepotItemDto.class); + List listRs = DepotConvert.INSTANCE.convertList(list); body.setRows(listRs); body.setId(head.getId()); String sub = no.substring(0, 4).toUpperCase(); logger.info("sub:{}",sub); Supplier supplier = supplierService.getSupplier(head.getOrganId()); - Account acc = accountService.getAccount(head.getAccountId()); + AdminUserDO user = adminUserService.getUser(head.getAccountId()); model.addObject("supplier",supplier.getSupplier()); model.addObject("create_time", DateUtil.format(head.getCreateTime(), DatePattern.NORM_DATETIME_PATTERN)); @@ -482,7 +485,7 @@ public class DepotHeadController { model.addObject("discount_money",head.getDiscountMoney()); model.addObject("discount_last_money",head.getDiscountLastMoney()); model.addObject("other_money",head.getOtherMoney()); - model.addObject("account",acc.getName()); + model.addObject("account",user.getNickname()); model.addObject("total_price",head.getTotalPrice()); model.addObject("debt",head.getDiscountLastMoney().subtract(head.getChangeAmount())); diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/ResourceController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/ErpController.java similarity index 99% rename from zsw-erp/src/main/java/com/zsw/erp/controller/ResourceController.java rename to zsw-erp/src/main/java/com/zsw/erp/controller/ErpController.java index 436c33e0..8afdf50a 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/controller/ResourceController.java +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/ErpController.java @@ -22,7 +22,7 @@ import static com.zsw.erp.utils.ResponseJsonUtil.returnJson; @RestController @Api(tags = {"资源接口"}) -public class ResourceController { +public class ErpController { @Resource private CommonQueryManager configResourceManager; diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/SystemConfigController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/ErpSystemConfigController.java similarity index 91% rename from zsw-erp/src/main/java/com/zsw/erp/controller/SystemConfigController.java rename to zsw-erp/src/main/java/com/zsw/erp/controller/ErpSystemConfigController.java index 01f1f5c3..0b31bf87 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/controller/SystemConfigController.java +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/ErpSystemConfigController.java @@ -16,8 +16,6 @@ import com.zsw.erp.config.QiniuConfigProperty; import com.zsw.erp.datasource.entities.SystemConfig; import com.zsw.erp.service.depot.DepotService; import com.zsw.erp.service.systemConfig.SystemConfigService; -import com.zsw.erp.service.user.UserService; -import com.zsw.erp.service.userBusiness.UserBusinessService; import com.zsw.erp.utils.StringUtil; import com.zsw.erp.utils.Tools; import io.swagger.annotations.Api; @@ -53,30 +51,21 @@ import java.util.List; @RequestMapping(value = "/systemConfig") @Api(tags = {"系统参数"}) @EnableConfigurationProperties(QiniuConfigProperty.class) -public class SystemConfigController { - private Logger logger = LoggerFactory.getLogger(SystemConfigController.class); +public class ErpSystemConfigController { + private Logger logger = LoggerFactory.getLogger(ErpSystemConfigController.class); @Resource QiniuConfigProperty qiniuConfigProperty; - @Resource - private UserService userService; @Resource private DepotService depotService; - @Resource - private UserBusinessService userBusinessService; + @Resource private SystemConfigService systemConfigService; - @Value(value="${spring.servlet.multipart.max-file-size}") - private Long maxFileSize; - - @Value(value="${spring.servlet.multipart.max-request-size}") - private Long maxRequestSize; - /** * 获取当前租户的配置信息 * @param request @@ -104,13 +93,7 @@ public class SystemConfigController { @ApiOperation(value = "获取文件大小限制") public R fileSizeLimit(HttpServletRequest request) throws Exception { - Long limit = 0L; - if(maxFileSize fc = Lists.newArrayList(); - UserBusiness role = userBusinessService.getBasicData(userId, "UserRole"); - roleId = role.getValue().get(0).longValue(); - //当前用户所拥有的功能列表,格式如:[1][2][5] -// List funList = userBusinessService.getBasicData(roleId.toString(), "RoleFunctions"); -// if(funList!=null && funList.size()>0){ -// fc = funList.get(0).getValue(); -// } -// List dataList = functionService.getRoleFunction(pNumber); - List dataList; - if (roleId == 1L){ - logger.info("当前是系统管理员,给予全部菜单和权限。"); - dataList = functionService.getRoleFunction(pNumber); - fc = functionService.getFunction().stream().map(Function::getId).collect(Collectors.toList()); - }else{ - dataList = functionService.getRoleFunction(pNumber); - UserBusiness fun = userBusinessService.getBasicData(roleId, "RoleFunctions"); - fc = fun.getValue().stream().map(Number::longValue).collect(Collectors.toList()); - } - - if (dataList.size() != 0) { - dataArray = getMenuByFunction(dataList, fc); - //增加首页菜单项 - JSONObject homeItem = new JSONObject(); - homeItem.set("id", 0); - homeItem.set("text", "首页"); - homeItem.set("icon", "home"); - homeItem.set("url", "/dashboard/analysis"); - homeItem.set("component", "/layouts/TabLayout"); - dataArray.add(0,homeItem); - } - } catch (DataAccessException e) { - logger.error(">>>>>>>>>>>>>>>>>>>查找异常", e); - } - return dataArray; - } - - public JSONArray getMenuByFunction(List dataList, List fc) throws Exception { - - dataList = dataList.stream() - .filter(function -> fc.contains(function.getId())) - .collect(Collectors.toList()); - - JSONArray dataArray = new JSONArray(); - for (Function function : dataList) { - JSONObject item = new JSONObject(); - List newList = functionService.getRoleFunction(function.getNumber()); - item.set("id", function.getId()); - item.set("text", function.getName()); - item.set("icon", function.getIcon()); - item.set("url", function.getUrl()); - item.set("component", function.getComponent()); - if (newList.size()>0) { - JSONArray childrenArr = getMenuByFunction(newList, fc); - if(childrenArr.size()>0) { - item.put("children", childrenArr); - dataArray.add(item); - } - } else { - if (fc.contains(function.getId())) { - dataArray.add(item); - } - } - } - return dataArray; - } - - /** - * 角色对应功能显示 - * @param request - * @return - */ - @GetMapping(value = "/findRoleFunction") - @ApiOperation(value = "角色对应功能显示") - public JSONArray findRoleFunction(@RequestParam("UBType") String type, @RequestParam("UBKeyId") Long keyId, - HttpServletRequest request)throws Exception { - JSONArray arr = new JSONArray(); - try { - List dataListFun = functionService.findRoleFunction("0"); - //开始拼接json数据 - JSONObject outer = new JSONObject(); - outer.set("id", 0); - outer.set("key", 0); - outer.set("value", 0); - outer.set("title", "功能列表"); - outer.set("attributes", "功能列表"); - //存放数据json数组 - JSONArray dataArray = new JSONArray(); - if (null != dataListFun) { - //根据条件从列表里面移除"系统管理" - List dataList = new ArrayList<>(); - for (Function fun : dataListFun) { - String token = request.getHeader("X-Access-Token"); - Long tenantId = Tools.getTenantIdByToken(token); - if (tenantId!=0L) { - if(!("系统管理").equals(fun.getName())) { - dataList.add(fun); - } - } else { - //超管 - dataList.add(fun); - } - } - dataArray = getFunctionList(dataList, type, keyId); - outer.set("children", dataArray); - } - arr.add(outer); - } catch (Exception e) { - e.printStackTrace(); - } - return arr; - } - - public JSONArray getFunctionList(List dataList, String type, Long keyId) throws Exception { - JSONArray dataArray = new JSONArray(); - //获取权限信息 - List ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, keyId); - if (null != dataList) { - for (Function function : dataList) { - JSONObject item = new JSONObject(); - item.set("id", function.getId()); - item.set("key", function.getId()); - item.set("value", function.getId()); - item.set("title", function.getName()); - item.set("attributes", function.getName()); - List funList = functionService.findRoleFunction(function.getNumber()); - if(funList.size()>0) { - JSONArray funArr = getFunctionList(funList, type, keyId); - item.set("children", funArr); - } else { - if (ubValue == null){ - item.set("checked", false); - }else { - Boolean flag = ubValue.contains(function.getId()); - item.set("checked", flag); - } - } - dataArray.add(item); - } - } - return dataArray; - } - - /** - * 根据id列表查找功能信息 - * @param roleId - * @param request - * @return - */ - @GetMapping(value = "/findRoleFunctionsById") - @ApiOperation(value = "根据id列表查找功能信息") - public R findByIds(@RequestParam("roleId") Long roleId, - HttpServletRequest request)throws Exception { - - UserBusiness ub = userBusinessService.getBasicData(roleId, "RoleFunctions"); - //按钮 - Map btnMap = new HashMap<>(); - List btnStr = ub.getBtnStr(); - if(ObjectUtil.isNotEmpty(btnStr)) { - for(BtnDto obj: btnStr) { - if(obj.getFunId()!=null && obj.getBtnStr()!=null) { - btnMap.put(obj.getFunId(), obj.getBtnStr()); - } - } - } - //菜单 - List funIds = ub.getValue().stream().map(Number::longValue).collect(Collectors.toList()); - List dataList = functionService.findByIds(funIds); - JSONObject outer = new JSONObject(); - outer.set("total", dataList.size()); - //存放数据json数组 - JSONArray dataArray = new JSONArray(); - if (ObjectUtil.isNotEmpty(dataList)) { - for (Function function : dataList) { - JSONObject item = new JSONObject(); - item.set("id", function.getId()); - item.set("name", function.getName()); - item.set("pushBtn", function.getPushBtn()); - item.set("btnStr", ObjectUtil.isEmpty(btnMap.get(function.getId()))?"":btnMap.get(function.getId())); - dataArray.add(item); - } - } - outer.set("rows", dataArray); - return R.success(outer); - } -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/IndexController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/IndexController.java deleted file mode 100644 index c425761f..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/controller/IndexController.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.zsw.erp.controller; - -import com.zsw.base.R; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class IndexController { - - @RequestMapping("/") - public R index(){ - return R.success("","欢迎访问回乡进销存系统"); - } -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/PlatformConfigController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/PlatformConfigController.java deleted file mode 100644 index 01b6c05c..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/controller/PlatformConfigController.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.zsw.erp.controller; - -import com.alibaba.fastjson.JSONObject; -import com.zsw.erp.datasource.entities.PlatformConfig; -import com.zsw.erp.service.platformConfig.PlatformConfigService; -import com.zsw.erp.service.user.UserService; -import com.zsw.base.R; -import com.zsw.erp.utils.ErpInfo; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.HashMap; -import java.util.Map; - -import static com.zsw.erp.utils.ResponseJsonUtil.returnJson; - - -@RestController -@RequestMapping(value = "/platformConfig") -@Api(tags = {"平台参数"}) -public class PlatformConfigController { - private Logger logger = LoggerFactory.getLogger(PlatformConfigController.class); - - @Value("${demonstrate.open}") - private boolean demonstrateOpen; - - @Resource - private PlatformConfigService platformConfigService; - - @Resource - private UserService userService; - - private static final String TEST_USER = "jsh"; - - /** - * 获取平台名称 - * @param request - * @return - */ - @GetMapping(value = "/getPlatform/name") - @ApiOperation(value = "获取平台名称") - public String getPlatformName(HttpServletRequest request)throws Exception { - String res; - try { - String platformKey = "platform_name"; - PlatformConfig platformConfig = platformConfigService.getPlatformConfigByKey(platformKey); - res = platformConfig.getPlatformValue(); - } catch(Exception e){ - e.printStackTrace(); - res = "ERP系统"; - } - return res; - } - - /** - * 获取官方网站地址 - * @param request - * @return - */ - @GetMapping(value = "/getPlatform/url") - @ApiOperation(value = "获取官方网站地址") - public String getPlatformUrl(HttpServletRequest request)throws Exception { - String res; - try { - String platformKey = "platform_url"; - PlatformConfig platformConfig = platformConfigService.getPlatformConfigByKey(platformKey); - res = platformConfig.getPlatformValue(); - } catch(Exception e){ - e.printStackTrace(); - res = "#"; - } - return res; - } - - /** - * 根据platformKey更新platformValue - * @param object - * @param request - * @return - */ - @PostMapping(value = "/updatePlatformConfigByKey") - @ApiOperation(value = "根据platformKey更新platformValue") - public String updatePlatformConfigByKey(@RequestBody JSONObject object, - HttpServletRequest request)throws Exception { - Map objectMap = new HashMap<>(); - String platformKey = object.getString("platformKey"); - String platformValue = object.getString("platformValue"); - int res = platformConfigService.updatePlatformConfigByKey(platformKey, platformValue); - if(res > 0) { - return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); - } else { - return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); - } - } - - /** - * 根据platformKey查询信息 - * @param platformKey - * @param request - * @return - */ - @GetMapping(value = "/getPlatformConfigByKey") - @ApiOperation(value = "根据platformKey查询信息") - public R getPlatformConfigByKey(@RequestParam("platformKey") String platformKey, - HttpServletRequest request)throws Exception { - - PlatformConfig platformConfig = platformConfigService.getPlatformConfigByKey(platformKey); - return R.success(platformConfig); - } -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/RoleController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/RoleController.java deleted file mode 100644 index 3d734dec..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/controller/RoleController.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.zsw.erp.controller; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.zsw.erp.datasource.entities.Role; -import com.zsw.erp.service.role.RoleService; -import com.zsw.erp.service.userBusiness.UserBusinessService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - - -@RestController -@RequestMapping(value = "/role") -@Api(tags = {"角色管理"}) -public class RoleController { - private Logger logger = LoggerFactory.getLogger(RoleController.class); - - @Resource - private RoleService roleService; - - @Resource - private UserBusinessService userBusinessService; - - /** - * 角色对应应用显示 - * @param request - * @return - */ - @GetMapping(value = "/findUserRole") - @ApiOperation(value = "查询用户的角色") - public JSONArray findUserRole(@RequestParam("UBType") String type, @RequestParam("UBKeyId") Long keyId, - HttpServletRequest request)throws Exception { - JSONArray arr = new JSONArray(); - try { - //获取权限信息 - List ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, keyId); - List dataList = roleService.findUserRole(); - if (null != dataList) { - for (Role role : dataList) { - JSONObject item = new JSONObject(); - item.put("id", role.getId()); - item.put("text", role.getName()); - Boolean flag = ubValue.contains(role.getId()); - if (flag) { - item.put("checked", true); - } - arr.add(item); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - return arr; - } - - @GetMapping(value = "/allList") - @ApiOperation(value = "查询全部角色列表") - public List allList(HttpServletRequest request)throws Exception { - return roleService.allList(); - } -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/SupplierController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/SupplierController.java index 0dc86b16..81296d9e 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/controller/SupplierController.java +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/SupplierController.java @@ -8,9 +8,8 @@ import com.zsw.erp.datasource.entities.Supplier; import com.zsw.erp.dto.supplier.SupplierVo; import com.zsw.erp.service.supplier.SupplierService; import com.zsw.erp.service.systemConfig.SystemConfigService; -import com.zsw.erp.service.tenant.TenantService; -import com.zsw.erp.service.user.UserService; -import com.zsw.erp.service.userBusiness.UserBusinessService; +import cn.iocoder.yudao.framework.security.core.LoginUser; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import com.zsw.base.R; import com.zsw.erp.utils.ErpInfo; import com.zsw.erp.utils.ExportExecUtil; @@ -41,17 +40,10 @@ public class SupplierController { @Resource private SupplierService supplierService; - @Resource - private UserBusinessService userBusinessService; - @Resource private SystemConfigService systemConfigService; - @Resource - private UserService userService; - @Resource - private TenantService tenantService; @GetMapping(value = "/checkIsNameAndTypeExist") @ApiOperation(value = "检查名称和类型是否存在") @@ -162,19 +154,15 @@ public class SupplierController { } //2、获取客户信息 String type = "UserCustomer"; - Long userId = userService.getUserId(request); - List ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, userId); + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); List customerList = supplierService.findBySelectCus(); if (null != customerList) { boolean customerFlag = systemConfigService.getCustomerFlag(); for (Supplier supplier : customerList) { JSONObject item = new JSONObject(); - Boolean flag = ubValue.contains(supplier.getId()); - if (!customerFlag || flag) { - item.put("id", supplier.getId()); - item.put("supplier", supplier.getSupplier() + "[客户]"); //客户名称 - dataArray.add(item); - } + item.put("id", supplier.getId()); + item.put("supplier", supplier.getSupplier() + "[客户]"); //客户名称 + dataArray.add(item); } } arr = dataArray; @@ -248,7 +236,6 @@ public class SupplierController { JSONArray arr = new JSONArray(); try { //获取权限信息 - List ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, keyId); List dataList = supplierService.findUserCustomer(); //开始拼接json数据 JSONObject outer = new JSONObject(); @@ -267,10 +254,7 @@ public class SupplierController { item.put("value", supplier.getId()); item.put("title", supplier.getSupplier()); item.put("attributes", supplier.getSupplier()); - Boolean flag = ubValue.contains(supplier.getId()); - if (flag) { - item.put("checked", true); - } + item.put("checked", true); dataArray.add(item); } } diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/TenantController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/TenantController.java deleted file mode 100644 index b3559572..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/controller/TenantController.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.zsw.erp.controller; - -import com.alibaba.fastjson.JSONObject; -import com.zsw.erp.service.tenant.TenantService; -import com.zsw.erp.utils.ErpInfo; -import com.zsw.erp.utils.ResponseCode; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.HashMap; -import java.util.Map; - -import static com.zsw.erp.utils.ResponseJsonUtil.returnJson; -import static com.zsw.erp.utils.ResponseJsonUtil.success; - - -@RestController -@RequestMapping(value = "/tenant") -@Api(tags = {"租户管理"}) -public class TenantController { - private Logger logger = LoggerFactory.getLogger(TenantController.class); - - @Resource - private TenantService tenantService; - - /** - * 批量设置状态-启用或者禁用 - * @param jsonObject - * @param request - * @return - */ - @PostMapping(value = "/batchSetStatus") - @ApiOperation(value = "批量设置状态") - public String batchSetStatus(@RequestBody JSONObject jsonObject, - HttpServletRequest request)throws Exception { - Boolean status = jsonObject.getBoolean("status"); - String ids = jsonObject.getString("ids"); - Map objectMap = new HashMap<>(); - int res = tenantService.batchSetStatus(status, ids); - if(res > 0) { - return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); - } else { - return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); - } - } - - @GetMapping("/listAllTenant") - @ApiOperation("列举全部租户") - public ResponseCode listAllTenant() throws Exception { - return success(tenantService.getTenant()); - } -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/TestController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/TestController.java deleted file mode 100644 index 0bcb5b61..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/controller/TestController.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.zsw.erp.controller; - -import com.zsw.base.R; -import com.zsw.jwt.model.TenantAuthInfo; -import com.zsw.pos.authority.dto.auth.LoginParamDTO; -import com.zsw.pos.oauth.service.LoginService; -import lombok.extern.slf4j.Slf4j; -import org.apache.dubbo.config.annotation.DubboReference; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@Slf4j -@Validated -public class TestController { - - @DubboReference - private LoginService loginService; - - @GetMapping("/test/login") - public R test(@RequestParam String username, @RequestParam String password){ - - LoginParamDTO dto = new LoginParamDTO(); - dto.setAccount(username); - dto.setPassword(password); - dto.setGrantType("password"); - R rs = loginService.grant(dto); - log.debug("login result : {}",rs.getData()); - return rs; - } - -} - diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/UserBusinessController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/UserBusinessController.java deleted file mode 100644 index 7d66f5a9..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/controller/UserBusinessController.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.zsw.erp.controller; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.google.common.collect.Lists; -import com.zsw.erp.datasource.dto.BtnStrDto; -import com.zsw.erp.datasource.entities.UserBusiness; -import com.zsw.erp.service.user.UserService; -import com.zsw.erp.service.userBusiness.UserBusinessService; -import com.zsw.base.R; -import com.zsw.erp.utils.ErpInfo; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import static com.zsw.erp.utils.ResponseJsonUtil.returnJson; - - -@RestController -@RequestMapping(value = "/userBusiness") -@Api(tags = {"用户角色模块的关系"}) -public class UserBusinessController { - private Logger logger = LoggerFactory.getLogger(UserBusinessController.class); - - @Resource - private UserBusinessService userBusinessService; - @Resource - private UserService userService; - - /** - * 获取信息 - * @param keyId - * @param type - * @param request - * @return - * @throws Exception - */ - @GetMapping(value = "/getBasicData") - @ApiOperation(value = "获取信息") - public R getBasicData(@RequestParam(value = "KeyId") Long keyId, - @RequestParam(value = "Type") String type, - HttpServletRequest request)throws Exception { - - UserBusiness list = userBusinessService.getBasicData(keyId, type); - Map mapData = new HashMap(); - mapData.put("userBusinessList", Lists.newArrayList(list)); - return R.success(mapData); - } - - /** - * 校验存在 - * @param type - * @param keyId - * @param request - * @return - * @throws Exception - */ - @GetMapping(value = "/checkIsValueExist") - @ApiOperation(value = "校验存在") - public String checkIsValueExist(@RequestParam(value ="type", required = false) String type, - @RequestParam(value ="keyId", required = false) String keyId, - HttpServletRequest request)throws Exception { - Map objectMap = new HashMap(); - Long id = userBusinessService.checkIsValueExist(type, keyId); - if(id != null) { - objectMap.put("id", id); - } else { - objectMap.put("id", null); - } - return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); - } - - /** - * 更新角色的按钮权限 - * @param jsonObject - * @param request - * @return - */ - @PostMapping(value = "/updateBtnStr") - @ApiOperation(value = "更新角色的按钮权限") - public R updateBtnStr(@RequestBody BtnStrDto dto, - HttpServletRequest request)throws Exception { - - String roleId = dto.getRoleId(); -// JSONArray btnStrArray = jsonObject.getJSONArray("btnStr"); -// List btnStr = btnStrArray.toJavaList(BtnDto.class); - String keyId = roleId; - String type = "RoleFunctions"; - int back = userBusinessService.updateBtnStr(keyId, type, dto.getBtnStr()); - if(back > 0) { - return R.success("成功"); - }else { - return R.fail("更新失败"); - } - } -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/UserController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/UserController.java deleted file mode 100644 index 302f735a..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/controller/UserController.java +++ /dev/null @@ -1,483 +0,0 @@ -package com.zsw.erp.controller; - -import cn.hutool.core.date.*; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.jwt.*; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.zsw.erp.constants.BusinessConstants; -import com.zsw.erp.constants.ExceptionConstants; -import com.zsw.erp.datasource.entities.BtnDto; -import com.zsw.erp.datasource.dto.UserLoginDto; -import com.zsw.erp.datasource.entities.Tenant; -import com.zsw.erp.datasource.entities.User; -import com.zsw.erp.datasource.entities.UserEx; -import com.zsw.erp.datasource.vo.TreeNodeEx; -import com.zsw.erp.exception.BusinessParamCheckingException; -import com.zsw.erp.service.inventorySeason.InventorySeasonService; -import com.zsw.erp.service.log.LogService; -import com.zsw.erp.service.redis.RedisService; -import com.zsw.erp.service.tenant.TenantService; -import com.zsw.erp.service.user.UserService; -import com.zsw.base.R; -import com.zsw.erp.utils.*; -import com.zsw.jwt.model.AuthInfo; -import com.zsw.jwt.model.TenantAuthInfo; -import com.zsw.pos.authority.dto.auth.LoginParamDTO; -import com.zsw.pos.oauth.service.LoginService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.apache.dubbo.config.annotation.DubboReference; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.time.temporal.ChronoUnit; -import java.util.*; - -import static com.zsw.erp.utils.ResponseJsonUtil.returnJson; - - -@RestController -@RequestMapping(value = "/user") -@Api(tags = {"用户管理"}) -public class UserController { - private Logger logger = LoggerFactory.getLogger(UserController.class); - - @Value("${manage.roleId}") - private Integer manageRoleId; - - @Value("${demonstrate.open}") - private boolean demonstrateOpen; - - @Resource - private UserService userService; - - @Resource - private TenantService tenantService; - - @Resource - private LogService logService; - - @Resource - private RedisService redisService; - - @Resource - private InventorySeasonService inventorySeasonService; - - @DubboReference - private LoginService loginService; - - @Value("${tenant.userNumLimit}") - private Integer systemLimit; - - private static final String TEST_USER = "jsh"; - private static String SUCCESS = "操作成功"; - private static String ERROR = "操作失败"; - private static final String HTTP = "http://"; - private static final String CODE_OK = "200"; - private static final String BASE_CHECK_CODES = "qwertyuiplkjhgfdsazxcvbnmQWERTYUPLKJHGFDSAZXCVBNM1234567890"; - - @PostMapping(value = "/login") - @ApiOperation(value = "登录") - public R login(@RequestBody User userParam, - HttpServletRequest request)throws Exception { - logger.info("============用户登录 login 方法调用开始=============="); - String msgTip = ""; - User user=null; - - String loginName = userParam.getLoginName().trim(); - String password = userParam.getPassword().trim(); - - String posTenantCode = null; - JWTPayload payload = new JWTPayload(); - - // 登录zsw-admin - LoginParamDTO dto = new LoginParamDTO(); - dto.setAccount(loginName); - dto.setPassword(password); - R result = loginService.grant(dto); - logger.error("result:{}",result); - if (result.getIsSuccess()){ - // 检查系统里是否存在租户和账户 没有准备走注册流程 - posTenantCode = result.getData().getTenantCode(); - // 在这里带了太多的门店ID - payload.setPayload("loginName",loginName); - payload.setPayload("tenantId",posTenantCode); - } - - //获取用户状态 - //int userStatus = -1; - redisService.deleteObjectBySession(request,"userId"); - UserLoginDto loginDto = userService.validateUser(loginName, password); - - switch (loginDto.getUserStatus()) { - case ExceptionCodeConstants.UserExceptionCode.USER_NOT_EXIST: - msgTip = "user is not exist"; - if (posTenantCode != null){ - // 用户不存在 但是用户不存在 可能报错。 - UserEx ex = new UserEx(); - ex.setLoginName(loginName); - ex.setPassword(password); - ex.setTenantId(Long.parseLong(posTenantCode)); - LocalDateTime time = LocalDateTimeUtil.offset(LocalDateTime.now(), 10, ChronoUnit.YEARS); - DateTimeFormatter formater = DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN); - String t = time.format(formater); - ex.setExpireTime(t); - user = this.registerUser(ex,request); - payload.setPayload("userId",user.getId()); - payload.setPayload("loginName",loginName); - payload.setPayload("tenantId",posTenantCode); - msgTip = "user can login"; - } - break; - case ExceptionCodeConstants.UserExceptionCode.USER_PASSWORD_ERROR: - msgTip = "user password error"; - break; - case ExceptionCodeConstants.UserExceptionCode.BLACK_USER: - msgTip = "user is black"; - break; - case ExceptionCodeConstants.UserExceptionCode.USER_ACCESS_EXCEPTION: - msgTip = "access service error"; - break; - case ExceptionCodeConstants.UserExceptionCode.BLACK_TENANT: - msgTip = "tenant is black"; - break; - case ExceptionCodeConstants.UserExceptionCode.EXPIRE_TENANT: - msgTip = "tenant is expire"; - break; - case ExceptionCodeConstants.UserExceptionCode.USER_CONDITION_FIT: - msgTip = "user can login"; - user = loginDto.getUser(); - payload.setPayload("userId",user.getId()); - payload.setPayload("loginName",loginName); - payload.setPayload("tenantId",user.getTenantId()); - break; - default: - break; - } - - // 1个月过期 - DateTime exAt = DateUtil.offset(new Date(), DateField.MONTH, 1); - payload.setExpiresAt(exAt); - String token = JWTUtil.createToken(payload.getClaimsJson(), "88888888".getBytes(StandardCharsets.UTF_8)); - - Map data = new HashMap(); - data.put("msgTip", msgTip); - if(user!=null){ - redisService.storageObjectBySession(token,"userId",user.getId()); - String roleType = userService.getRoleTypeByUserId(user.getId()); //角色类型 - if (roleType == null){ - logger.error("角色错误!"); - } - redisService.storageObjectBySession(token,"roleType",roleType); - redisService.storageObjectBySession(token,"clientIp", Tools.getLocalIp(request)); - logService.insertLogWithUserId(user.getId(), user.getTenantId(), "用户", - new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_LOGIN).append(user.getLoginName()).toString(), - ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); - List btnStrArr = userService.getBtnStrArrById(user.getId()); - data.put("token", token); - data.put("user", user); - LocalUser.setTenantId(user.getTenantId()); - LocalUser.setUserId(user.getId()); - data.put("season",inventorySeasonService.getNow()); - //用户的按钮权限 - if(!"admin".equals(user.getLoginName())){ - data.put("userBtn", btnStrArr); - } - data.put("roleType", roleType); - logger.info("===============用户登录 login 方法调用结束==============="); - return R.success(data); - }else{ - return R.fail("用户名或者密码错误"); - } - - - } - - @GetMapping(value = "/getUserSession") - @ApiOperation(value = "获取用户信息") - public R getSessionUser(HttpServletRequest request)throws Exception { - Map data = new HashMap<>(); - Long userId = Long.parseLong(redisService.getObjectFromSessionByKey(request,"userId").toString()); - User user = userService.getUser(userId); - user.setPassword(null); - data.put("user", user); - return R.success(data); - } - - @GetMapping(value = "/logout") - @ApiOperation(value = "退出") - public R logout(HttpServletRequest request, HttpServletResponse response)throws Exception { - redisService.deleteObjectBySession(request,"userId"); - return R.success(); - } - - @PostMapping(value = "/resetPwd") - @ApiOperation(value = "重置密码") - public String resetPwd(@RequestBody JSONObject jsonObject, - HttpServletRequest request) throws Exception { - Map objectMap = new HashMap<>(); - Long id = jsonObject.getLong("id"); - String password = "123456"; - String md5Pwd = Tools.md5Encryp(password); - int update = userService.resetPwd(md5Pwd, id); - if(update > 0) { - return returnJson(objectMap, SUCCESS, ErpInfo.OK.code); - } else { - return returnJson(objectMap, ERROR, ErpInfo.ERROR.code); - } - } - - @PutMapping(value = "/updatePwd") - @ApiOperation(value = "更新密码") - public String updatePwd(@RequestBody JSONObject jsonObject, HttpServletRequest request)throws Exception { - Integer flag = 0; - Map objectMap = new HashMap(); - try { - String info = ""; - Long userId = jsonObject.getLong("userId"); - String oldpwd = jsonObject.getString("oldpassword"); - String password = jsonObject.getString("password"); - User user = userService.getUser(userId); - //必须和原始密码一致才可以更新密码 - if(demonstrateOpen && user.getLoginName().equals(TEST_USER)){ - flag = 3; //jsh用户不能修改密码 - info = "jsh用户不能修改密码"; - } else if (oldpwd.equalsIgnoreCase(user.getPassword())) { - user.setPassword(password); - flag = userService.updateUserByObj(user); //1-成功 - info = "修改成功"; - } else { - flag = 2; //原始密码输入错误 - info = "原始密码输入错误"; - } - objectMap.put("status", flag); - if(flag > 0) { - return returnJson(objectMap, info, ErpInfo.OK.code); - } else { - return returnJson(objectMap, ERROR, ErpInfo.ERROR.code); - } - } catch (Exception e) { - logger.error(">>>>>>>>>>>>>修改用户ID为 : " + jsonObject.getLong("userId") + "密码信息失败", e); - flag = 3; - objectMap.put("status", flag); - return returnJson(objectMap, ERROR, ErpInfo.ERROR.code); - } - } - - /** - * 获取全部用户数据列表 - * @param request - * @return - */ - @GetMapping(value = "/getAllList") - @ApiOperation(value = "获取全部用户数据列表") - public R getAllList(HttpServletRequest request)throws Exception { - - Map data = new HashMap(); - List dataList = userService.getUser(); - if(dataList!=null) { - data.put("userList", dataList); - } - return R.success(data); - } - - /** - * 用户列表,用于用户下拉框 - * @param request - * @return - * @throws Exception - */ - @GetMapping(value = "/getUserList") - @ApiOperation(value = "用户列表") - public JSONArray getUserList(HttpServletRequest request)throws Exception { - JSONArray dataArray = new JSONArray(); - try { - List dataList = userService.getUser(); - if (null != dataList) { - for (User user : dataList) { - JSONObject item = new JSONObject(); - item.put("id", user.getId()); - item.put("userName", user.getUsername()); - dataArray.add(item); - } - } - } catch(Exception e){ - e.printStackTrace(); - } - return dataArray; - } - - /** - * create by: cjl - * description: - * 新增用户及机构和用户关系 - * create time: 2019/3/8 16:06 - * @Param: beanJson - * @return java.lang.Object - */ - @PostMapping("/addUser") - @ApiOperation(value = "新增用户") - @ResponseBody - public Object addUser(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception{ - JSONObject result = ExceptionConstants.standardSuccess(); - // 系统的人数限制 - Object limit = redisService.getObjectFromSessionByKey(request, "userNumLimit"); - Long userNumLimit = ObjectUtil.isNotEmpty(limit) - ? Long.parseLong(limit.toString()) - : systemLimit; - Long count = userService.countUser(null,null); - if(count>= userNumLimit) { - throw new BusinessParamCheckingException(ExceptionConstants.USER_OVER_LIMIT_FAILED_CODE, - ExceptionConstants.USER_OVER_LIMIT_FAILED_MSG); - } else { - UserEx ue= JSONObject.parseObject(obj.toJSONString(), UserEx.class); - userService.addUserAndOrgUserRel(ue, request); - } - return result; - } - - /** - * create by: cjl - * description: - * 修改用户及机构和用户关系 - * create time: 2019/3/8 16:06 - * @Param: beanJson - * @return java.lang.Object - */ - @PutMapping("/updateUser") - @ApiOperation(value = "修改用户") - @ResponseBody - public Object updateUser(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception{ - JSONObject result = ExceptionConstants.standardSuccess(); - UserEx ue= JSONObject.parseObject(obj.toJSONString(), UserEx.class); - userService.updateUserAndOrgUserRel(ue, request); - return result; - } - - /** - * 注册用户 - * @param ue - * @return - * @throws Exception - */ - @PostMapping(value = "/registerUser") - @ApiOperation(value = "注册用户") - public UserEx registerUser(@RequestBody UserEx ue, - HttpServletRequest request)throws Exception{ - logger.error("用户注册开始..."); - JSONObject result = ExceptionConstants.standardSuccess(); - ue.setUsername(ue.getLoginName()); - userService.checkUserNameAndLoginName(ue); //检查用户名和登录名 - ue = userService.registerUser(ue,manageRoleId,request); - return ue; - } - - /** - * 获取机构用户树 - * @return - * @throws Exception - */ - @RequestMapping("/getOrganizationUserTree") - @ApiOperation(value = "获取机构用户树") - public JSONArray getOrganizationUserTree()throws Exception{ - JSONArray arr=new JSONArray(); - List organizationUserTree= userService.getOrganizationUserTree(); - if(organizationUserTree!=null&&organizationUserTree.size()>0){ - for(TreeNodeEx node:organizationUserTree){ - String str=JSON.toJSONString(node); - JSONObject obj=JSON.parseObject(str); - arr.add(obj) ; - } - } - return arr; - } - - /** - * 获取当前用户的角色类型 - * @param request - * @return - */ - @GetMapping("/getRoleTypeByCurrentUser") - @ApiOperation(value = "获取当前用户的角色类型") - public R getRoleTypeByCurrentUser(HttpServletRequest request) { - - Map data = new HashMap(); - String roleType = redisService.getObjectFromSessionByKey(request,"roleType").toString(); - data.put("roleType", roleType); - return R.success(data); - } - - /** - * 获取随机校验码 - * @param response - * @param key - * @return - */ - @GetMapping(value = "/randomImage/{key}") - @ApiOperation(value = "获取随机校验码") - public R randomImage(HttpServletResponse response,@PathVariable String key) throws IOException { - - Map data = new HashMap<>(); - String codeNum = Tools.getCharAndNum(4); - String base64 = RandImageUtil.generate(codeNum); - data.put("codeNum", codeNum); - data.put("base64", base64); - return R.success(data); - } - - /** - * 批量设置状态-启用或者禁用 - * @param jsonObject - * @param request - * @return - */ - @PostMapping(value = "/batchSetStatus") - @ApiOperation(value = "批量设置状态") - public String batchSetStatus(@RequestBody JSONObject jsonObject, - HttpServletRequest request)throws Exception { - Byte status = jsonObject.getByte("status"); - String ids = jsonObject.getString("ids"); - Map objectMap = new HashMap<>(); - int res = userService.batchSetStatus(status, ids); - if(res > 0) { - return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); - } else { - return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); - } - } - - /** - * 获取当前用户的用户数量和租户信息 - * @param request - * @return - */ - @GetMapping(value = "/infoWithTenant") - @ApiOperation(value = "获取当前用户的用户数量和租户信息") - public R randomImage(HttpServletRequest request){ - - Map data = new HashMap<>(); - Long userId = Long.parseLong(redisService.getObjectFromSessionByKey(request,"userId").toString()); - User user = userService.getUser(userId); - //获取当前用户数 - Long userCurrentNum = userService.countUser(null, null); - Tenant tenant = tenantService.getTenantByTenantId(user.getTenantId()); - data.put("type", tenant.getType()); //租户类型,0免费租户,1付费租户 - data.put("expireTime", Tools.parseDateToStr(tenant.getExpireTime())); - data.put("userCurrentNum", userCurrentNum); - data.put("userNumLimit", tenant.getUserNumLimit()); - return R.success(data); - } -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/dto/UserLoginDto.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/dto/UserLoginDto.java deleted file mode 100644 index da4e775d..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/datasource/dto/UserLoginDto.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.zsw.erp.datasource.dto; - -import com.zsw.erp.datasource.entities.User; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -public class UserLoginDto { - - private Integer userStatus; - - private User user; - - public static UserLoginDto buildStatus(Integer status){ - return UserLoginDto.builder().userStatus(status).build(); - } -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotItemVo4WithInfoEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotItemVo4WithInfoEx.java index 15ad7115..256bcf42 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotItemVo4WithInfoEx.java +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotItemVo4WithInfoEx.java @@ -1,7 +1,10 @@ package com.zsw.erp.datasource.entities; +import lombok.Data; + import java.math.BigDecimal; +@Data public class DepotItemVo4WithInfoEx extends DepotItem{ private Long MId; @@ -48,179 +51,4 @@ public class DepotItemVo4WithInfoEx extends DepotItem{ private String barCode; - public Long getMId() { - return MId; - } - - public void setMId(Long MId) { - this.MId = MId; - } - - public String getMName() { - return MName; - } - - public void setMName(String MName) { - this.MName = MName; - } - - public String getMModel() { - return MModel; - } - - public void setMModel(String MModel) { - this.MModel = MModel; - } - - public String getMaterialUnit() { - return MaterialUnit; - } - - public void setMaterialUnit(String materialUnit) { - MaterialUnit = materialUnit; - } - - public String getMColor() { - return MColor; - } - - public void setMColor(String MColor) { - this.MColor = MColor; - } - - public String getMStandard() { - return MStandard; - } - - public void setMStandard(String MStandard) { - this.MStandard = MStandard; - } - - public String getMMfrs() { - return MMfrs; - } - - public void setMMfrs(String MMfrs) { - this.MMfrs = MMfrs; - } - - public String getMOtherField1() { - return MOtherField1; - } - - public void setMOtherField1(String MOtherField1) { - this.MOtherField1 = MOtherField1; - } - - public String getMOtherField2() { - return MOtherField2; - } - - public void setMOtherField2(String MOtherField2) { - this.MOtherField2 = MOtherField2; - } - - public String getMOtherField3() { - return MOtherField3; - } - - public void setMOtherField3(String MOtherField3) { - this.MOtherField3 = MOtherField3; - } - - public String getEnableSerialNumber() { - return enableSerialNumber; - } - - public void setEnableSerialNumber(String enableSerialNumber) { - this.enableSerialNumber = enableSerialNumber; - } - - public String getEnableBatchNumber() { - return enableBatchNumber; - } - - public void setEnableBatchNumber(String enableBatchNumber) { - this.enableBatchNumber = enableBatchNumber; - } - - public String getDepotName() { - return DepotName; - } - - public void setDepotName(String depotName) { - DepotName = depotName; - } - - public String getAnotherDepotName() { - return AnotherDepotName; - } - - public void setAnotherDepotName(String anotherDepotName) { - AnotherDepotName = anotherDepotName; - } - - public Long getUnitId() { - return UnitId; - } - - public void setUnitId(Long unitId) { - UnitId = unitId; - } - - public String getUnitName() { - return unitName; - } - - public void setUnitName(String unitName) { - this.unitName = unitName; - } - - public Integer getRatio() { - return ratio; - } - - public void setRatio(Integer ratio) { - this.ratio = ratio; - } - - public String getOtherUnit() { - return otherUnit; - } - - public void setOtherUnit(String otherUnit) { - this.otherUnit = otherUnit; - } - - public BigDecimal getPresetPriceOne() { - return presetPriceOne; - } - - public void setPresetPriceOne(BigDecimal presetPriceOne) { - this.presetPriceOne = presetPriceOne; - } - - public String getPriceStrategy() { - return priceStrategy; - } - - public void setPriceStrategy(String priceStrategy) { - this.priceStrategy = priceStrategy; - } - - public BigDecimal getPurchaseDecimal() { - return purchaseDecimal; - } - - public void setPurchaseDecimal(BigDecimal purchaseDecimal) { - this.purchaseDecimal = purchaseDecimal; - } - - public String getBarCode() { - return barCode; - } - - public void setBarCode(String barCode) { - this.barCode = barCode; - } } \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/InventorySeason.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/InventorySeason.java index b0cc02bf..bdf71609 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/InventorySeason.java +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/InventorySeason.java @@ -1,5 +1,8 @@ package com.zsw.erp.datasource.entities; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; import lombok.Data; import java.time.LocalDateTime; diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Role.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Role.java deleted file mode 100644 index 7d0f16a9..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Role.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.zsw.erp.datasource.entities; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; - -public class Role { - @TableId(type = IdType.AUTO) - private Long id; - - private String name; - - private String type; - - private String value; - - private String description; - - private Long tenantId; - - private String deleteFlag; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value == null ? null : value.trim(); - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description == null ? null : description.trim(); - } - - public Long getTenantId() { - return tenantId; - } - - public void setTenantId(Long tenantId) { - this.tenantId = tenantId; - } - - public String getDeleteFlag() { - return deleteFlag; - } - - public void setDeleteFlag(String deleteFlag) { - this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); - } -} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/RoleExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/RoleExample.java deleted file mode 100644 index f2ca2c03..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/RoleExample.java +++ /dev/null @@ -1,669 +0,0 @@ -package com.zsw.erp.datasource.entities; - -import java.util.ArrayList; -import java.util.List; - -public class RoleExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - public RoleExample() { - oredCriteria = new ArrayList<>(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList<>(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andNameIsNull() { - addCriterion("name is null"); - return (Criteria) this; - } - - public Criteria andNameIsNotNull() { - addCriterion("name is not null"); - return (Criteria) this; - } - - public Criteria andNameEqualTo(String value) { - addCriterion("name =", value, "name"); - return (Criteria) this; - } - - public Criteria andNameNotEqualTo(String value) { - addCriterion("name <>", value, "name"); - return (Criteria) this; - } - - public Criteria andNameGreaterThan(String value) { - addCriterion("name >", value, "name"); - return (Criteria) this; - } - - public Criteria andNameGreaterThanOrEqualTo(String value) { - addCriterion("name >=", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLessThan(String value) { - addCriterion("name <", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLessThanOrEqualTo(String value) { - addCriterion("name <=", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLike(String value) { - addCriterion("name like", value, "name"); - return (Criteria) this; - } - - public Criteria andNameNotLike(String value) { - addCriterion("name not like", value, "name"); - return (Criteria) this; - } - - public Criteria andNameIn(List values) { - addCriterion("name in", values, "name"); - return (Criteria) this; - } - - public Criteria andNameNotIn(List values) { - addCriterion("name not in", values, "name"); - return (Criteria) this; - } - - public Criteria andNameBetween(String value1, String value2) { - addCriterion("name between", value1, value2, "name"); - return (Criteria) this; - } - - public Criteria andNameNotBetween(String value1, String value2) { - addCriterion("name not between", value1, value2, "name"); - return (Criteria) this; - } - - public Criteria andTypeIsNull() { - addCriterion("type is null"); - return (Criteria) this; - } - - public Criteria andTypeIsNotNull() { - addCriterion("type is not null"); - return (Criteria) this; - } - - public Criteria andTypeEqualTo(String value) { - addCriterion("type =", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotEqualTo(String value) { - addCriterion("type <>", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeGreaterThan(String value) { - addCriterion("type >", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeGreaterThanOrEqualTo(String value) { - addCriterion("type >=", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLessThan(String value) { - addCriterion("type <", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLessThanOrEqualTo(String value) { - addCriterion("type <=", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLike(String value) { - addCriterion("type like", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotLike(String value) { - addCriterion("type not like", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeIn(List values) { - addCriterion("type in", values, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotIn(List values) { - addCriterion("type not in", values, "type"); - return (Criteria) this; - } - - public Criteria andTypeBetween(String value1, String value2) { - addCriterion("type between", value1, value2, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotBetween(String value1, String value2) { - addCriterion("type not between", value1, value2, "type"); - return (Criteria) this; - } - - public Criteria andValueIsNull() { - addCriterion("value is null"); - return (Criteria) this; - } - - public Criteria andValueIsNotNull() { - addCriterion("value is not null"); - return (Criteria) this; - } - - public Criteria andValueEqualTo(String value) { - addCriterion("value =", value, "value"); - return (Criteria) this; - } - - public Criteria andValueNotEqualTo(String value) { - addCriterion("value <>", value, "value"); - return (Criteria) this; - } - - public Criteria andValueGreaterThan(String value) { - addCriterion("value >", value, "value"); - return (Criteria) this; - } - - public Criteria andValueGreaterThanOrEqualTo(String value) { - addCriterion("value >=", value, "value"); - return (Criteria) this; - } - - public Criteria andValueLessThan(String value) { - addCriterion("value <", value, "value"); - return (Criteria) this; - } - - public Criteria andValueLessThanOrEqualTo(String value) { - addCriterion("value <=", value, "value"); - return (Criteria) this; - } - - public Criteria andValueLike(String value) { - addCriterion("value like", value, "value"); - return (Criteria) this; - } - - public Criteria andValueNotLike(String value) { - addCriterion("value not like", value, "value"); - return (Criteria) this; - } - - public Criteria andValueIn(List values) { - addCriterion("value in", values, "value"); - return (Criteria) this; - } - - public Criteria andValueNotIn(List values) { - addCriterion("value not in", values, "value"); - return (Criteria) this; - } - - public Criteria andValueBetween(String value1, String value2) { - addCriterion("value between", value1, value2, "value"); - return (Criteria) this; - } - - public Criteria andValueNotBetween(String value1, String value2) { - addCriterion("value not between", value1, value2, "value"); - return (Criteria) this; - } - - public Criteria andDescriptionIsNull() { - addCriterion("description is null"); - return (Criteria) this; - } - - public Criteria andDescriptionIsNotNull() { - addCriterion("description is not null"); - return (Criteria) this; - } - - public Criteria andDescriptionEqualTo(String value) { - addCriterion("description =", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionNotEqualTo(String value) { - addCriterion("description <>", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionGreaterThan(String value) { - addCriterion("description >", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionGreaterThanOrEqualTo(String value) { - addCriterion("description >=", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionLessThan(String value) { - addCriterion("description <", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionLessThanOrEqualTo(String value) { - addCriterion("description <=", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionLike(String value) { - addCriterion("description like", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionNotLike(String value) { - addCriterion("description not like", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionIn(List values) { - addCriterion("description in", values, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionNotIn(List values) { - addCriterion("description not in", values, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionBetween(String value1, String value2) { - addCriterion("description between", value1, value2, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionNotBetween(String value1, String value2) { - addCriterion("description not between", value1, value2, "description"); - return (Criteria) this; - } - - public Criteria andTenantIdIsNull() { - addCriterion("tenant_id is null"); - return (Criteria) this; - } - - public Criteria andTenantIdIsNotNull() { - addCriterion("tenant_id is not null"); - return (Criteria) this; - } - - public Criteria andTenantIdEqualTo(Long value) { - addCriterion("tenant_id =", value, "tenantId"); - return (Criteria) this; - } - - public Criteria andTenantIdNotEqualTo(Long value) { - addCriterion("tenant_id <>", value, "tenantId"); - return (Criteria) this; - } - - public Criteria andTenantIdGreaterThan(Long value) { - addCriterion("tenant_id >", value, "tenantId"); - return (Criteria) this; - } - - public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { - addCriterion("tenant_id >=", value, "tenantId"); - return (Criteria) this; - } - - public Criteria andTenantIdLessThan(Long value) { - addCriterion("tenant_id <", value, "tenantId"); - return (Criteria) this; - } - - public Criteria andTenantIdLessThanOrEqualTo(Long value) { - addCriterion("tenant_id <=", value, "tenantId"); - return (Criteria) this; - } - - public Criteria andTenantIdIn(List values) { - addCriterion("tenant_id in", values, "tenantId"); - return (Criteria) this; - } - - public Criteria andTenantIdNotIn(List values) { - addCriterion("tenant_id not in", values, "tenantId"); - return (Criteria) this; - } - - public Criteria andTenantIdBetween(Long value1, Long value2) { - addCriterion("tenant_id between", value1, value2, "tenantId"); - return (Criteria) this; - } - - public Criteria andTenantIdNotBetween(Long value1, Long value2) { - addCriterion("tenant_id not between", value1, value2, "tenantId"); - return (Criteria) this; - } - - public Criteria andDeleteFlagIsNull() { - addCriterion("delete_flag is null"); - return (Criteria) this; - } - - public Criteria andDeleteFlagIsNotNull() { - addCriterion("delete_flag is not null"); - return (Criteria) this; - } - - public Criteria andDeleteFlagEqualTo(String value) { - addCriterion("delete_flag =", value, "deleteFlag"); - return (Criteria) this; - } - - public Criteria andDeleteFlagNotEqualTo(String value) { - addCriterion("delete_flag <>", value, "deleteFlag"); - return (Criteria) this; - } - - public Criteria andDeleteFlagGreaterThan(String value) { - addCriterion("delete_flag >", value, "deleteFlag"); - return (Criteria) this; - } - - public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { - addCriterion("delete_flag >=", value, "deleteFlag"); - return (Criteria) this; - } - - public Criteria andDeleteFlagLessThan(String value) { - addCriterion("delete_flag <", value, "deleteFlag"); - return (Criteria) this; - } - - public Criteria andDeleteFlagLessThanOrEqualTo(String value) { - addCriterion("delete_flag <=", value, "deleteFlag"); - return (Criteria) this; - } - - public Criteria andDeleteFlagLike(String value) { - addCriterion("delete_flag like", value, "deleteFlag"); - return (Criteria) this; - } - - public Criteria andDeleteFlagNotLike(String value) { - addCriterion("delete_flag not like", value, "deleteFlag"); - return (Criteria) this; - } - - public Criteria andDeleteFlagIn(List values) { - addCriterion("delete_flag in", values, "deleteFlag"); - return (Criteria) this; - } - - public Criteria andDeleteFlagNotIn(List values) { - addCriterion("delete_flag not in", values, "deleteFlag"); - return (Criteria) this; - } - - public Criteria andDeleteFlagBetween(String value1, String value2) { - addCriterion("delete_flag between", value1, value2, "deleteFlag"); - return (Criteria) this; - } - - public Criteria andDeleteFlagNotBetween(String value1, String value2) { - addCriterion("delete_flag not between", value1, value2, "deleteFlag"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/User.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/User.java deleted file mode 100644 index e9a77b46..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/User.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.zsw.erp.datasource.entities; - -import lombok.Data; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; - -@Data -public class User { - @TableId(type = IdType.AUTO) - private Long id; - - private String username; - - private String loginName; - - private String password; - - private String position; - - private String department; - - private String email; - - private String phonenum; - - private Byte ismanager; - - private Byte isystem; - - private Byte status; - - private String description; - - private String remark; - - private Long tenantId; - -} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/UserBusiness.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/UserBusiness.java deleted file mode 100644 index dd3328ca..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/UserBusiness.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.zsw.erp.datasource.entities; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; -import com.zsw.erp.config.ArrayListTypeHandler; -import lombok.Data; - -import java.io.Serializable; -import java.util.List; - -@Data -@TableName(autoResultMap = true) -public class UserBusiness implements Serializable { - @TableId(type = IdType.AUTO) - private Long id; - - private String type; - - private String keyId; - - @TableField(value = "`value`",typeHandler = JacksonTypeHandler.class) - private List value; - - @TableField(value = "`btn_str`",typeHandler = ArrayListTypeHandler.class) - private List btnStr; - - private Long tenantId; - - private String deleteFlag; - -} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/UserBusinessExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/UserBusinessExample.java deleted file mode 100644 index 3bf3a42d..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/UserBusinessExample.java +++ /dev/null @@ -1,669 +0,0 @@ -package com.zsw.erp.datasource.entities; - -import java.util.ArrayList; -import java.util.List; - -public class UserBusinessExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - public UserBusinessExample() { - oredCriteria = new ArrayList<>(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList<>(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andTypeIsNull() { - addCriterion("type is null"); - return (Criteria) this; - } - - public Criteria andTypeIsNotNull() { - addCriterion("type is not null"); - return (Criteria) this; - } - - public Criteria andTypeEqualTo(String value) { - addCriterion("type =", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotEqualTo(String value) { - addCriterion("type <>", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeGreaterThan(String value) { - addCriterion("type >", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeGreaterThanOrEqualTo(String value) { - addCriterion("type >=", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLessThan(String value) { - addCriterion("type <", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLessThanOrEqualTo(String value) { - addCriterion("type <=", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLike(String value) { - addCriterion("type like", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotLike(String value) { - addCriterion("type not like", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeIn(List values) { - addCriterion("type in", values, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotIn(List values) { - addCriterion("type not in", values, "type"); - return (Criteria) this; - } - - public Criteria andTypeBetween(String value1, String value2) { - addCriterion("type between", value1, value2, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotBetween(String value1, String value2) { - addCriterion("type not between", value1, value2, "type"); - return (Criteria) this; - } - - public Criteria andKeyIdIsNull() { - addCriterion("key_id is null"); - return (Criteria) this; - } - - public Criteria andKeyIdIsNotNull() { - addCriterion("key_id is not null"); - return (Criteria) this; - } - - public Criteria andKeyIdEqualTo(String value) { - addCriterion("key_id =", value, "keyId"); - return (Criteria) this; - } - - public Criteria andKeyIdNotEqualTo(String value) { - addCriterion("key_id <>", value, "keyId"); - return (Criteria) this; - } - - public Criteria andKeyIdGreaterThan(String value) { - addCriterion("key_id >", value, "keyId"); - return (Criteria) this; - } - - public Criteria andKeyIdGreaterThanOrEqualTo(String value) { - addCriterion("key_id >=", value, "keyId"); - return (Criteria) this; - } - - public Criteria andKeyIdLessThan(String value) { - addCriterion("key_id <", value, "keyId"); - return (Criteria) this; - } - - public Criteria andKeyIdLessThanOrEqualTo(String value) { - addCriterion("key_id <=", value, "keyId"); - return (Criteria) this; - } - - public Criteria andKeyIdLike(String value) { - addCriterion("key_id like", value, "keyId"); - return (Criteria) this; - } - - public Criteria andKeyIdNotLike(String value) { - addCriterion("key_id not like", value, "keyId"); - return (Criteria) this; - } - - public Criteria andKeyIdIn(List values) { - addCriterion("key_id in", values, "keyId"); - return (Criteria) this; - } - - public Criteria andKeyIdNotIn(List values) { - addCriterion("key_id not in", values, "keyId"); - return (Criteria) this; - } - - public Criteria andKeyIdBetween(String value1, String value2) { - addCriterion("key_id between", value1, value2, "keyId"); - return (Criteria) this; - } - - public Criteria andKeyIdNotBetween(String value1, String value2) { - addCriterion("key_id not between", value1, value2, "keyId"); - return (Criteria) this; - } - - public Criteria andValueIsNull() { - addCriterion("value is null"); - return (Criteria) this; - } - - public Criteria andValueIsNotNull() { - addCriterion("value is not null"); - return (Criteria) this; - } - - public Criteria andValueEqualTo(String value) { - addCriterion("value =", value, "value"); - return (Criteria) this; - } - - public Criteria andValueNotEqualTo(String value) { - addCriterion("value <>", value, "value"); - return (Criteria) this; - } - - public Criteria andValueGreaterThan(String value) { - addCriterion("value >", value, "value"); - return (Criteria) this; - } - - public Criteria andValueGreaterThanOrEqualTo(String value) { - addCriterion("value >=", value, "value"); - return (Criteria) this; - } - - public Criteria andValueLessThan(String value) { - addCriterion("value <", value, "value"); - return (Criteria) this; - } - - public Criteria andValueLessThanOrEqualTo(String value) { - addCriterion("value <=", value, "value"); - return (Criteria) this; - } - - public Criteria andValueLike(String value) { - addCriterion("value like", value, "value"); - return (Criteria) this; - } - - public Criteria andValueNotLike(String value) { - addCriterion("value not like", value, "value"); - return (Criteria) this; - } - - public Criteria andValueIn(List values) { - addCriterion("value in", values, "value"); - return (Criteria) this; - } - - public Criteria andValueNotIn(List values) { - addCriterion("value not in", values, "value"); - return (Criteria) this; - } - - public Criteria andValueBetween(String value1, String value2) { - addCriterion("value between", value1, value2, "value"); - return (Criteria) this; - } - - public Criteria andValueNotBetween(String value1, String value2) { - addCriterion("value not between", value1, value2, "value"); - return (Criteria) this; - } - - public Criteria andBtnStrIsNull() { - addCriterion("btn_str is null"); - return (Criteria) this; - } - - public Criteria andBtnStrIsNotNull() { - addCriterion("btn_str is not null"); - return (Criteria) this; - } - - public Criteria andBtnStrEqualTo(String value) { - addCriterion("btn_str =", value, "btnStr"); - return (Criteria) this; - } - - public Criteria andBtnStrNotEqualTo(String value) { - addCriterion("btn_str <>", value, "btnStr"); - return (Criteria) this; - } - - public Criteria andBtnStrGreaterThan(String value) { - addCriterion("btn_str >", value, "btnStr"); - return (Criteria) this; - } - - public Criteria andBtnStrGreaterThanOrEqualTo(String value) { - addCriterion("btn_str >=", value, "btnStr"); - return (Criteria) this; - } - - public Criteria andBtnStrLessThan(String value) { - addCriterion("btn_str <", value, "btnStr"); - return (Criteria) this; - } - - public Criteria andBtnStrLessThanOrEqualTo(String value) { - addCriterion("btn_str <=", value, "btnStr"); - return (Criteria) this; - } - - public Criteria andBtnStrLike(String value) { - addCriterion("btn_str like", value, "btnStr"); - return (Criteria) this; - } - - public Criteria andBtnStrNotLike(String value) { - addCriterion("btn_str not like", value, "btnStr"); - return (Criteria) this; - } - - public Criteria andBtnStrIn(List values) { - addCriterion("btn_str in", values, "btnStr"); - return (Criteria) this; - } - - public Criteria andBtnStrNotIn(List values) { - addCriterion("btn_str not in", values, "btnStr"); - return (Criteria) this; - } - - public Criteria andBtnStrBetween(String value1, String value2) { - addCriterion("btn_str between", value1, value2, "btnStr"); - return (Criteria) this; - } - - public Criteria andBtnStrNotBetween(String value1, String value2) { - addCriterion("btn_str not between", value1, value2, "btnStr"); - return (Criteria) this; - } - - public Criteria andTenantIdIsNull() { - addCriterion("tenant_id is null"); - return (Criteria) this; - } - - public Criteria andTenantIdIsNotNull() { - addCriterion("tenant_id is not null"); - return (Criteria) this; - } - - public Criteria andTenantIdEqualTo(Long value) { - addCriterion("tenant_id =", value, "tenantId"); - return (Criteria) this; - } - - public Criteria andTenantIdNotEqualTo(Long value) { - addCriterion("tenant_id <>", value, "tenantId"); - return (Criteria) this; - } - - public Criteria andTenantIdGreaterThan(Long value) { - addCriterion("tenant_id >", value, "tenantId"); - return (Criteria) this; - } - - public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { - addCriterion("tenant_id >=", value, "tenantId"); - return (Criteria) this; - } - - public Criteria andTenantIdLessThan(Long value) { - addCriterion("tenant_id <", value, "tenantId"); - return (Criteria) this; - } - - public Criteria andTenantIdLessThanOrEqualTo(Long value) { - addCriterion("tenant_id <=", value, "tenantId"); - return (Criteria) this; - } - - public Criteria andTenantIdIn(List values) { - addCriterion("tenant_id in", values, "tenantId"); - return (Criteria) this; - } - - public Criteria andTenantIdNotIn(List values) { - addCriterion("tenant_id not in", values, "tenantId"); - return (Criteria) this; - } - - public Criteria andTenantIdBetween(Long value1, Long value2) { - addCriterion("tenant_id between", value1, value2, "tenantId"); - return (Criteria) this; - } - - public Criteria andTenantIdNotBetween(Long value1, Long value2) { - addCriterion("tenant_id not between", value1, value2, "tenantId"); - return (Criteria) this; - } - - public Criteria andDeleteFlagIsNull() { - addCriterion("delete_flag is null"); - return (Criteria) this; - } - - public Criteria andDeleteFlagIsNotNull() { - addCriterion("delete_flag is not null"); - return (Criteria) this; - } - - public Criteria andDeleteFlagEqualTo(String value) { - addCriterion("delete_flag =", value, "deleteFlag"); - return (Criteria) this; - } - - public Criteria andDeleteFlagNotEqualTo(String value) { - addCriterion("delete_flag <>", value, "deleteFlag"); - return (Criteria) this; - } - - public Criteria andDeleteFlagGreaterThan(String value) { - addCriterion("delete_flag >", value, "deleteFlag"); - return (Criteria) this; - } - - public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { - addCriterion("delete_flag >=", value, "deleteFlag"); - return (Criteria) this; - } - - public Criteria andDeleteFlagLessThan(String value) { - addCriterion("delete_flag <", value, "deleteFlag"); - return (Criteria) this; - } - - public Criteria andDeleteFlagLessThanOrEqualTo(String value) { - addCriterion("delete_flag <=", value, "deleteFlag"); - return (Criteria) this; - } - - public Criteria andDeleteFlagLike(String value) { - addCriterion("delete_flag like", value, "deleteFlag"); - return (Criteria) this; - } - - public Criteria andDeleteFlagNotLike(String value) { - addCriterion("delete_flag not like", value, "deleteFlag"); - return (Criteria) this; - } - - public Criteria andDeleteFlagIn(List values) { - addCriterion("delete_flag in", values, "deleteFlag"); - return (Criteria) this; - } - - public Criteria andDeleteFlagNotIn(List values) { - addCriterion("delete_flag not in", values, "deleteFlag"); - return (Criteria) this; - } - - public Criteria andDeleteFlagBetween(String value1, String value2) { - addCriterion("delete_flag between", value1, value2, "deleteFlag"); - return (Criteria) this; - } - - public Criteria andDeleteFlagNotBetween(String value1, String value2) { - addCriterion("delete_flag not between", value1, value2, "deleteFlag"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/UserEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/UserEx.java deleted file mode 100644 index 2446c9a5..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/UserEx.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.zsw.erp.datasource.entities; - -import com.baomidou.mybatisplus.annotation.TableField; -import lombok.Data; - -/** - * Description - * - * @Author: cjl - * @Date: 2019/3/8 15:12 - */ -@Data -public class UserEx extends User{ - //机构简称 - private String orgAbr; - //机构id - private Long orgaId; - //用户在部门中排序 - private String userBlngOrgaDsplSeq; - //机构用户关联关系id - private Long orgaUserRelId; - - private Long roleId; - - private String roleName; - - private String userType; - - private Integer userNumLimit; - - private String expireTime; - - @TableField(exist = false) - private Long storeId; - -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/UserExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/UserExample.java deleted file mode 100644 index 7af69dae..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/UserExample.java +++ /dev/null @@ -1,1129 +0,0 @@ -package com.zsw.erp.datasource.entities; - -import java.util.ArrayList; -import java.util.List; - -public class UserExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - public UserExample() { - oredCriteria = new ArrayList<>(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList<>(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andUsernameIsNull() { - addCriterion("username is null"); - return (Criteria) this; - } - - public Criteria andUsernameIsNotNull() { - addCriterion("username is not null"); - return (Criteria) this; - } - - public Criteria andUsernameEqualTo(String value) { - addCriterion("username =", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameNotEqualTo(String value) { - addCriterion("username <>", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameGreaterThan(String value) { - addCriterion("username >", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameGreaterThanOrEqualTo(String value) { - addCriterion("username >=", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameLessThan(String value) { - addCriterion("username <", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameLessThanOrEqualTo(String value) { - addCriterion("username <=", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameLike(String value) { - addCriterion("username like", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameNotLike(String value) { - addCriterion("username not like", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameIn(List values) { - addCriterion("username in", values, "username"); - return (Criteria) this; - } - - public Criteria andUsernameNotIn(List values) { - addCriterion("username not in", values, "username"); - return (Criteria) this; - } - - public Criteria andUsernameBetween(String value1, String value2) { - addCriterion("username between", value1, value2, "username"); - return (Criteria) this; - } - - public Criteria andUsernameNotBetween(String value1, String value2) { - addCriterion("username not between", value1, value2, "username"); - return (Criteria) this; - } - - public Criteria andLoginNameIsNull() { - addCriterion("login_name is null"); - return (Criteria) this; - } - - public Criteria andLoginNameIsNotNull() { - addCriterion("login_name is not null"); - return (Criteria) this; - } - - public Criteria andLoginNameEqualTo(String value) { - addCriterion("login_name =", value, "loginName"); - return (Criteria) this; - } - - public Criteria andLoginNameNotEqualTo(String value) { - addCriterion("login_name <>", value, "loginName"); - return (Criteria) this; - } - - public Criteria andLoginNameGreaterThan(String value) { - addCriterion("login_name >", value, "loginName"); - return (Criteria) this; - } - - public Criteria andLoginNameGreaterThanOrEqualTo(String value) { - addCriterion("login_name >=", value, "loginName"); - return (Criteria) this; - } - - public Criteria andLoginNameLessThan(String value) { - addCriterion("login_name <", value, "loginName"); - return (Criteria) this; - } - - public Criteria andLoginNameLessThanOrEqualTo(String value) { - addCriterion("login_name <=", value, "loginName"); - return (Criteria) this; - } - - public Criteria andLoginNameLike(String value) { - addCriterion("login_name like", value, "loginName"); - return (Criteria) this; - } - - public Criteria andLoginNameNotLike(String value) { - addCriterion("login_name not like", value, "loginName"); - return (Criteria) this; - } - - public Criteria andLoginNameIn(List values) { - addCriterion("login_name in", values, "loginName"); - return (Criteria) this; - } - - public Criteria andLoginNameNotIn(List values) { - addCriterion("login_name not in", values, "loginName"); - return (Criteria) this; - } - - public Criteria andLoginNameBetween(String value1, String value2) { - addCriterion("login_name between", value1, value2, "loginName"); - return (Criteria) this; - } - - public Criteria andLoginNameNotBetween(String value1, String value2) { - addCriterion("login_name not between", value1, value2, "loginName"); - return (Criteria) this; - } - - public Criteria andPasswordIsNull() { - addCriterion("password is null"); - return (Criteria) this; - } - - public Criteria andPasswordIsNotNull() { - addCriterion("password is not null"); - return (Criteria) this; - } - - public Criteria andPasswordEqualTo(String value) { - addCriterion("password =", value, "password"); - return (Criteria) this; - } - - public Criteria andPasswordNotEqualTo(String value) { - addCriterion("password <>", value, "password"); - return (Criteria) this; - } - - public Criteria andPasswordGreaterThan(String value) { - addCriterion("password >", value, "password"); - return (Criteria) this; - } - - public Criteria andPasswordGreaterThanOrEqualTo(String value) { - addCriterion("password >=", value, "password"); - return (Criteria) this; - } - - public Criteria andPasswordLessThan(String value) { - addCriterion("password <", value, "password"); - return (Criteria) this; - } - - public Criteria andPasswordLessThanOrEqualTo(String value) { - addCriterion("password <=", value, "password"); - return (Criteria) this; - } - - public Criteria andPasswordLike(String value) { - addCriterion("password like", value, "password"); - return (Criteria) this; - } - - public Criteria andPasswordNotLike(String value) { - addCriterion("password not like", value, "password"); - return (Criteria) this; - } - - public Criteria andPasswordIn(List values) { - addCriterion("password in", values, "password"); - return (Criteria) this; - } - - public Criteria andPasswordNotIn(List values) { - addCriterion("password not in", values, "password"); - return (Criteria) this; - } - - public Criteria andPasswordBetween(String value1, String value2) { - addCriterion("password between", value1, value2, "password"); - return (Criteria) this; - } - - public Criteria andPasswordNotBetween(String value1, String value2) { - addCriterion("password not between", value1, value2, "password"); - return (Criteria) this; - } - - public Criteria andPositionIsNull() { - addCriterion("position is null"); - return (Criteria) this; - } - - public Criteria andPositionIsNotNull() { - addCriterion("position is not null"); - return (Criteria) this; - } - - public Criteria andPositionEqualTo(String value) { - addCriterion("position =", value, "position"); - return (Criteria) this; - } - - public Criteria andPositionNotEqualTo(String value) { - addCriterion("position <>", value, "position"); - return (Criteria) this; - } - - public Criteria andPositionGreaterThan(String value) { - addCriterion("position >", value, "position"); - return (Criteria) this; - } - - public Criteria andPositionGreaterThanOrEqualTo(String value) { - addCriterion("position >=", value, "position"); - return (Criteria) this; - } - - public Criteria andPositionLessThan(String value) { - addCriterion("position <", value, "position"); - return (Criteria) this; - } - - public Criteria andPositionLessThanOrEqualTo(String value) { - addCriterion("position <=", value, "position"); - return (Criteria) this; - } - - public Criteria andPositionLike(String value) { - addCriterion("position like", value, "position"); - return (Criteria) this; - } - - public Criteria andPositionNotLike(String value) { - addCriterion("position not like", value, "position"); - return (Criteria) this; - } - - public Criteria andPositionIn(List values) { - addCriterion("position in", values, "position"); - return (Criteria) this; - } - - public Criteria andPositionNotIn(List values) { - addCriterion("position not in", values, "position"); - return (Criteria) this; - } - - public Criteria andPositionBetween(String value1, String value2) { - addCriterion("position between", value1, value2, "position"); - return (Criteria) this; - } - - public Criteria andPositionNotBetween(String value1, String value2) { - addCriterion("position not between", value1, value2, "position"); - return (Criteria) this; - } - - public Criteria andDepartmentIsNull() { - addCriterion("department is null"); - return (Criteria) this; - } - - public Criteria andDepartmentIsNotNull() { - addCriterion("department is not null"); - return (Criteria) this; - } - - public Criteria andDepartmentEqualTo(String value) { - addCriterion("department =", value, "department"); - return (Criteria) this; - } - - public Criteria andDepartmentNotEqualTo(String value) { - addCriterion("department <>", value, "department"); - return (Criteria) this; - } - - public Criteria andDepartmentGreaterThan(String value) { - addCriterion("department >", value, "department"); - return (Criteria) this; - } - - public Criteria andDepartmentGreaterThanOrEqualTo(String value) { - addCriterion("department >=", value, "department"); - return (Criteria) this; - } - - public Criteria andDepartmentLessThan(String value) { - addCriterion("department <", value, "department"); - return (Criteria) this; - } - - public Criteria andDepartmentLessThanOrEqualTo(String value) { - addCriterion("department <=", value, "department"); - return (Criteria) this; - } - - public Criteria andDepartmentLike(String value) { - addCriterion("department like", value, "department"); - return (Criteria) this; - } - - public Criteria andDepartmentNotLike(String value) { - addCriterion("department not like", value, "department"); - return (Criteria) this; - } - - public Criteria andDepartmentIn(List values) { - addCriterion("department in", values, "department"); - return (Criteria) this; - } - - public Criteria andDepartmentNotIn(List values) { - addCriterion("department not in", values, "department"); - return (Criteria) this; - } - - public Criteria andDepartmentBetween(String value1, String value2) { - addCriterion("department between", value1, value2, "department"); - return (Criteria) this; - } - - public Criteria andDepartmentNotBetween(String value1, String value2) { - addCriterion("department not between", value1, value2, "department"); - return (Criteria) this; - } - - public Criteria andEmailIsNull() { - addCriterion("email is null"); - return (Criteria) this; - } - - public Criteria andEmailIsNotNull() { - addCriterion("email is not null"); - return (Criteria) this; - } - - public Criteria andEmailEqualTo(String value) { - addCriterion("email =", value, "email"); - return (Criteria) this; - } - - public Criteria andEmailNotEqualTo(String value) { - addCriterion("email <>", value, "email"); - return (Criteria) this; - } - - public Criteria andEmailGreaterThan(String value) { - addCriterion("email >", value, "email"); - return (Criteria) this; - } - - public Criteria andEmailGreaterThanOrEqualTo(String value) { - addCriterion("email >=", value, "email"); - return (Criteria) this; - } - - public Criteria andEmailLessThan(String value) { - addCriterion("email <", value, "email"); - return (Criteria) this; - } - - public Criteria andEmailLessThanOrEqualTo(String value) { - addCriterion("email <=", value, "email"); - return (Criteria) this; - } - - public Criteria andEmailLike(String value) { - addCriterion("email like", value, "email"); - return (Criteria) this; - } - - public Criteria andEmailNotLike(String value) { - addCriterion("email not like", value, "email"); - return (Criteria) this; - } - - public Criteria andEmailIn(List values) { - addCriterion("email in", values, "email"); - return (Criteria) this; - } - - public Criteria andEmailNotIn(List values) { - addCriterion("email not in", values, "email"); - return (Criteria) this; - } - - public Criteria andEmailBetween(String value1, String value2) { - addCriterion("email between", value1, value2, "email"); - return (Criteria) this; - } - - public Criteria andEmailNotBetween(String value1, String value2) { - addCriterion("email not between", value1, value2, "email"); - return (Criteria) this; - } - - public Criteria andPhonenumIsNull() { - addCriterion("phonenum is null"); - return (Criteria) this; - } - - public Criteria andPhonenumIsNotNull() { - addCriterion("phonenum is not null"); - return (Criteria) this; - } - - public Criteria andPhonenumEqualTo(String value) { - addCriterion("phonenum =", value, "phonenum"); - return (Criteria) this; - } - - public Criteria andPhonenumNotEqualTo(String value) { - addCriterion("phonenum <>", value, "phonenum"); - return (Criteria) this; - } - - public Criteria andPhonenumGreaterThan(String value) { - addCriterion("phonenum >", value, "phonenum"); - return (Criteria) this; - } - - public Criteria andPhonenumGreaterThanOrEqualTo(String value) { - addCriterion("phonenum >=", value, "phonenum"); - return (Criteria) this; - } - - public Criteria andPhonenumLessThan(String value) { - addCriterion("phonenum <", value, "phonenum"); - return (Criteria) this; - } - - public Criteria andPhonenumLessThanOrEqualTo(String value) { - addCriterion("phonenum <=", value, "phonenum"); - return (Criteria) this; - } - - public Criteria andPhonenumLike(String value) { - addCriterion("phonenum like", value, "phonenum"); - return (Criteria) this; - } - - public Criteria andPhonenumNotLike(String value) { - addCriterion("phonenum not like", value, "phonenum"); - return (Criteria) this; - } - - public Criteria andPhonenumIn(List values) { - addCriterion("phonenum in", values, "phonenum"); - return (Criteria) this; - } - - public Criteria andPhonenumNotIn(List values) { - addCriterion("phonenum not in", values, "phonenum"); - return (Criteria) this; - } - - public Criteria andPhonenumBetween(String value1, String value2) { - addCriterion("phonenum between", value1, value2, "phonenum"); - return (Criteria) this; - } - - public Criteria andPhonenumNotBetween(String value1, String value2) { - addCriterion("phonenum not between", value1, value2, "phonenum"); - return (Criteria) this; - } - - public Criteria andIsmanagerIsNull() { - addCriterion("ismanager is null"); - return (Criteria) this; - } - - public Criteria andIsmanagerIsNotNull() { - addCriterion("ismanager is not null"); - return (Criteria) this; - } - - public Criteria andIsmanagerEqualTo(Byte value) { - addCriterion("ismanager =", value, "ismanager"); - return (Criteria) this; - } - - public Criteria andIsmanagerNotEqualTo(Byte value) { - addCriterion("ismanager <>", value, "ismanager"); - return (Criteria) this; - } - - public Criteria andIsmanagerGreaterThan(Byte value) { - addCriterion("ismanager >", value, "ismanager"); - return (Criteria) this; - } - - public Criteria andIsmanagerGreaterThanOrEqualTo(Byte value) { - addCriterion("ismanager >=", value, "ismanager"); - return (Criteria) this; - } - - public Criteria andIsmanagerLessThan(Byte value) { - addCriterion("ismanager <", value, "ismanager"); - return (Criteria) this; - } - - public Criteria andIsmanagerLessThanOrEqualTo(Byte value) { - addCriterion("ismanager <=", value, "ismanager"); - return (Criteria) this; - } - - public Criteria andIsmanagerIn(List values) { - addCriterion("ismanager in", values, "ismanager"); - return (Criteria) this; - } - - public Criteria andIsmanagerNotIn(List values) { - addCriterion("ismanager not in", values, "ismanager"); - return (Criteria) this; - } - - public Criteria andIsmanagerBetween(Byte value1, Byte value2) { - addCriterion("ismanager between", value1, value2, "ismanager"); - return (Criteria) this; - } - - public Criteria andIsmanagerNotBetween(Byte value1, Byte value2) { - addCriterion("ismanager not between", value1, value2, "ismanager"); - return (Criteria) this; - } - - public Criteria andIsystemIsNull() { - addCriterion("isystem is null"); - return (Criteria) this; - } - - public Criteria andIsystemIsNotNull() { - addCriterion("isystem is not null"); - return (Criteria) this; - } - - public Criteria andIsystemEqualTo(Byte value) { - addCriterion("isystem =", value, "isystem"); - return (Criteria) this; - } - - public Criteria andIsystemNotEqualTo(Byte value) { - addCriterion("isystem <>", value, "isystem"); - return (Criteria) this; - } - - public Criteria andIsystemGreaterThan(Byte value) { - addCriterion("isystem >", value, "isystem"); - return (Criteria) this; - } - - public Criteria andIsystemGreaterThanOrEqualTo(Byte value) { - addCriterion("isystem >=", value, "isystem"); - return (Criteria) this; - } - - public Criteria andIsystemLessThan(Byte value) { - addCriterion("isystem <", value, "isystem"); - return (Criteria) this; - } - - public Criteria andIsystemLessThanOrEqualTo(Byte value) { - addCriterion("isystem <=", value, "isystem"); - return (Criteria) this; - } - - public Criteria andIsystemIn(List values) { - addCriterion("isystem in", values, "isystem"); - return (Criteria) this; - } - - public Criteria andIsystemNotIn(List values) { - addCriterion("isystem not in", values, "isystem"); - return (Criteria) this; - } - - public Criteria andIsystemBetween(Byte value1, Byte value2) { - addCriterion("isystem between", value1, value2, "isystem"); - return (Criteria) this; - } - - public Criteria andIsystemNotBetween(Byte value1, Byte value2) { - addCriterion("isystem not between", value1, value2, "isystem"); - return (Criteria) this; - } - - public Criteria andStatusIsNull() { - addCriterion("Status is null"); - return (Criteria) this; - } - - public Criteria andStatusIsNotNull() { - addCriterion("Status is not null"); - return (Criteria) this; - } - - public Criteria andStatusEqualTo(Byte value) { - addCriterion("Status =", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotEqualTo(Byte value) { - addCriterion("Status <>", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThan(Byte value) { - addCriterion("Status >", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThanOrEqualTo(Byte value) { - addCriterion("Status >=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThan(Byte value) { - addCriterion("Status <", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThanOrEqualTo(Byte value) { - addCriterion("Status <=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusIn(List values) { - addCriterion("Status in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotIn(List values) { - addCriterion("Status not in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusBetween(Byte value1, Byte value2) { - addCriterion("Status between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotBetween(Byte value1, Byte value2) { - addCriterion("Status not between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andDescriptionIsNull() { - addCriterion("description is null"); - return (Criteria) this; - } - - public Criteria andDescriptionIsNotNull() { - addCriterion("description is not null"); - return (Criteria) this; - } - - public Criteria andDescriptionEqualTo(String value) { - addCriterion("description =", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionNotEqualTo(String value) { - addCriterion("description <>", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionGreaterThan(String value) { - addCriterion("description >", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionGreaterThanOrEqualTo(String value) { - addCriterion("description >=", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionLessThan(String value) { - addCriterion("description <", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionLessThanOrEqualTo(String value) { - addCriterion("description <=", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionLike(String value) { - addCriterion("description like", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionNotLike(String value) { - addCriterion("description not like", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionIn(List values) { - addCriterion("description in", values, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionNotIn(List values) { - addCriterion("description not in", values, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionBetween(String value1, String value2) { - addCriterion("description between", value1, value2, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionNotBetween(String value1, String value2) { - addCriterion("description not between", value1, value2, "description"); - return (Criteria) this; - } - - public Criteria andRemarkIsNull() { - addCriterion("remark is null"); - return (Criteria) this; - } - - public Criteria andRemarkIsNotNull() { - addCriterion("remark is not null"); - return (Criteria) this; - } - - public Criteria andRemarkEqualTo(String value) { - addCriterion("remark =", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkNotEqualTo(String value) { - addCriterion("remark <>", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkGreaterThan(String value) { - addCriterion("remark >", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkGreaterThanOrEqualTo(String value) { - addCriterion("remark >=", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkLessThan(String value) { - addCriterion("remark <", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkLessThanOrEqualTo(String value) { - addCriterion("remark <=", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkLike(String value) { - addCriterion("remark like", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkNotLike(String value) { - addCriterion("remark not like", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkIn(List values) { - addCriterion("remark in", values, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkNotIn(List values) { - addCriterion("remark not in", values, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkBetween(String value1, String value2) { - addCriterion("remark between", value1, value2, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkNotBetween(String value1, String value2) { - addCriterion("remark not between", value1, value2, "remark"); - return (Criteria) this; - } - - public Criteria andTenantIdIsNull() { - addCriterion("tenant_id is null"); - return (Criteria) this; - } - - public Criteria andTenantIdIsNotNull() { - addCriterion("tenant_id is not null"); - return (Criteria) this; - } - - public Criteria andTenantIdEqualTo(Long value) { - addCriterion("tenant_id =", value, "tenantId"); - return (Criteria) this; - } - - public Criteria andTenantIdNotEqualTo(Long value) { - addCriterion("tenant_id <>", value, "tenantId"); - return (Criteria) this; - } - - public Criteria andTenantIdGreaterThan(Long value) { - addCriterion("tenant_id >", value, "tenantId"); - return (Criteria) this; - } - - public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { - addCriterion("tenant_id >=", value, "tenantId"); - return (Criteria) this; - } - - public Criteria andTenantIdLessThan(Long value) { - addCriterion("tenant_id <", value, "tenantId"); - return (Criteria) this; - } - - public Criteria andTenantIdLessThanOrEqualTo(Long value) { - addCriterion("tenant_id <=", value, "tenantId"); - return (Criteria) this; - } - - public Criteria andTenantIdIn(List values) { - addCriterion("tenant_id in", values, "tenantId"); - return (Criteria) this; - } - - public Criteria andTenantIdNotIn(List values) { - addCriterion("tenant_id not in", values, "tenantId"); - return (Criteria) this; - } - - public Criteria andTenantIdBetween(Long value1, Long value2) { - addCriterion("tenant_id between", value1, value2, "tenantId"); - return (Criteria) this; - } - - public Criteria andTenantIdNotBetween(Long value1, Long value2) { - addCriterion("tenant_id not between", value1, value2, "tenantId"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/LogMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/ErpLogMapper.java similarity index 95% rename from zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/LogMapper.java rename to zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/ErpLogMapper.java index 9d5582ac..ee9b1665 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/LogMapper.java +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/ErpLogMapper.java @@ -5,7 +5,7 @@ import com.zsw.erp.datasource.entities.LogExample; import java.util.List; import org.apache.ibatis.annotations.Param; -public interface LogMapper { +public interface ErpLogMapper { long countByExample(LogExample example); int deleteByExample(LogExample example); diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/SystemConfigMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/ErpSystemConfigMapper.java similarity index 93% rename from zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/SystemConfigMapper.java rename to zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/ErpSystemConfigMapper.java index aeb4ce52..45215f52 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/SystemConfigMapper.java +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/ErpSystemConfigMapper.java @@ -8,7 +8,7 @@ import java.util.List; import org.apache.ibatis.annotations.Param; -public interface SystemConfigMapper extends BaseMapper { +public interface ErpSystemConfigMapper extends BaseMapper { long countByExample(SystemConfigExample example); int deleteByExample(SystemConfigExample example); diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/RoleMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/RoleMapper.java deleted file mode 100644 index 70dda1b4..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/RoleMapper.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.zsw.erp.datasource.mappers; - -import com.baomidou.mybatisplus.annotation.InterceptorIgnore; -import com.zsw.erp.datasource.entities.Role; -import com.zsw.erp.datasource.entities.RoleExample; -import java.util.List; -import org.apache.ibatis.annotations.Param; - -public interface RoleMapper { - long countByExample(RoleExample example); - - int deleteByExample(RoleExample example); - - int deleteByPrimaryKey(Long id); - - int insert(Role record); - - int insertSelective(Role record); - - List selectByExample(RoleExample example); - - @InterceptorIgnore - Role selectByPrimaryKey(Long id); - - int updateByExampleSelective(@Param("record") Role record, @Param("example") RoleExample example); - - int updateByExample(@Param("record") Role record, @Param("example") RoleExample example); - - int updateByPrimaryKeySelective(Role record); - - int updateByPrimaryKey(Role record); -} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/RoleMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/RoleMapperEx.java deleted file mode 100644 index e647218d..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/RoleMapperEx.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.zsw.erp.datasource.mappers; - -import com.zsw.erp.datasource.entities.Role; -import org.apache.ibatis.annotations.Param; - -import java.util.Date; -import java.util.List; - -public interface RoleMapperEx { - - List selectByConditionRole( - @Param("name") String name, - @Param("offset") Integer offset, - @Param("rows") Integer rows); - - Long countsByRole( - @Param("name") String name); - - int batchDeleteRoleByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); -} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/TenantMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/TenantMapper.java deleted file mode 100644 index ae5a1450..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/TenantMapper.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.zsw.erp.datasource.mappers; - -import com.baomidou.mybatisplus.annotation.InterceptorIgnore; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.zsw.erp.datasource.entities.Tenant; -import com.zsw.erp.datasource.entities.TenantExample; -import java.util.List; - -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -@Repository -public interface TenantMapper extends BaseMapper { - long countByExample(TenantExample example); - - int deleteByExample(TenantExample example); - - int deleteByPrimaryKey(Long id); - - List selectByExample(TenantExample example); - - @InterceptorIgnore(tenantLine = "true") - Tenant selectByPrimaryKey(Long id); - - int updateByExampleSelective(@Param("record") Tenant record, @Param("example") TenantExample example); - - int updateByExample(@Param("record") Tenant record, @Param("example") TenantExample example); - - int updateByPrimaryKeySelective(Tenant record); - - int updateByPrimaryKey(Tenant record); -} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/TenantMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/TenantMapperEx.java deleted file mode 100644 index 34ad1e96..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/TenantMapperEx.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.zsw.erp.datasource.mappers; - -import com.zsw.erp.datasource.entities.TenantEx; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -public interface TenantMapperEx { - - List selectByConditionTenant( - @Param("loginName") String loginName, - @Param("type") String type, - @Param("enabled") String enabled, - @Param("offset") Integer offset, - @Param("rows") Integer rows); - - Long countsByTenant( - @Param("loginName") String loginName, - @Param("type") String type, - @Param("enabled") String enabled); -} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UserBusinessMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UserBusinessMapper.java deleted file mode 100644 index c2a556c0..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UserBusinessMapper.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.zsw.erp.datasource.mappers; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.zsw.erp.datasource.entities.UserBusiness; -import com.zsw.erp.datasource.entities.UserBusinessExample; - -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -@Repository -public interface UserBusinessMapper extends BaseMapper { - -} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UserBusinessMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UserBusinessMapperEx.java deleted file mode 100644 index d1e97067..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UserBusinessMapperEx.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.zsw.erp.datasource.mappers; - -import org.apache.ibatis.annotations.Param; - -import java.util.Date; - -/** - * Description - * - * @Author: qiankunpingtai - * @Date: 2019/3/29 15:09 - */ -public interface UserBusinessMapperEx { - - int batchDeleteUserBusinessByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); - -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UserMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UserMapper.java deleted file mode 100644 index 239ae92a..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UserMapper.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.zsw.erp.datasource.mappers; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.zsw.erp.datasource.entities.User; -import com.zsw.erp.datasource.entities.UserExample; -import java.util.List; - -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -@Repository -public interface UserMapper extends BaseMapper { - long countByExample(UserExample example); - - int deleteByExample(UserExample example); - - int deleteByPrimaryKey(Long id); - - List selectByExample(UserExample example); - - User selectByPrimaryKey(Long id); - - int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example); - - int updateByExample(@Param("record") User record, @Param("example") UserExample example); - - int updateByPrimaryKeySelective(User record); - - int updateByPrimaryKey(User record); -} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UserMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UserMapperEx.java deleted file mode 100644 index 99d9f688..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UserMapperEx.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.zsw.erp.datasource.mappers; - -import com.zsw.erp.datasource.entities.User; -import com.zsw.erp.datasource.entities.UserEx; -import com.zsw.erp.datasource.vo.TreeNodeEx; -import org.apache.ibatis.annotations.Param; - -import java.util.List; -import java.util.Map; - -public interface UserMapperEx { - - List selectByConditionUser( - @Param("userName") String userName, - @Param("loginName") String loginName, - @Param("offset") Integer offset, - @Param("rows") Integer rows); - - Long countsByUser( - @Param("userName") String userName, - @Param("loginName") String loginName); - - List getUserListByUserNameOrLoginName(@Param("userName") String userName, - @Param("loginName") String loginName); - - int batDeleteOrUpdateUser(@Param("ids") String ids[], @Param("status") byte status); - - List getNodeTree(); - List getNextNodeTree(Map parameterMap); -} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/dto/bom/BomConvert.java b/zsw-erp/src/main/java/com/zsw/erp/dto/bom/BomConvert.java new file mode 100644 index 00000000..47741472 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/dto/bom/BomConvert.java @@ -0,0 +1,19 @@ +package com.zsw.erp.dto.bom; + +import cn.iocoder.yudao.module.system.controller.admin.CpUser.vo.CpUserRespVO; +import cn.iocoder.yudao.module.system.convert.auth.AuthConvert; +import cn.iocoder.yudao.module.system.dal.dataobject.CpUser.CpUserDO; +import com.zsw.erp.datasource.dto.BomDto; +import com.zsw.erp.datasource.entities.Bom; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +import java.util.List; + +@Mapper +public interface BomConvert { + + BomConvert INSTANCE = Mappers.getMapper(BomConvert.class); + + List convertList2Dto(List list); +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/dto/depot/DepotConvert.java b/zsw-erp/src/main/java/com/zsw/erp/dto/depot/DepotConvert.java new file mode 100644 index 00000000..d30b8660 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/dto/depot/DepotConvert.java @@ -0,0 +1,18 @@ +package com.zsw.erp.dto.depot; + +import com.zsw.erp.datasource.dto.DepotItemDto; +import com.zsw.erp.datasource.entities.DepotItem; +import com.zsw.erp.dto.bom.BomConvert; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +import java.util.List; + +@Mapper +public interface DepotConvert { + + DepotConvert INSTANCE = Mappers.getMapper(DepotConvert.class); + + List convertList(List list); + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/account/AccountComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/account/AccountComponent.java deleted file mode 100644 index 5143c5af..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/service/account/AccountComponent.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.zsw.erp.service.account; - -import com.alibaba.fastjson.JSONObject; -import com.zsw.erp.service.ICommonQuery; -import com.zsw.erp.utils.Constants; -import com.zsw.erp.utils.QueryUtils; -import com.zsw.erp.utils.StringUtil; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; -import java.util.Map; - -@Service(value = "account_component") -@AccountResource -public class AccountComponent implements ICommonQuery { - - @Resource - private AccountService accountService; - - @Override - public Object selectOne(Long id) throws Exception { - return accountService.getAccount(id); - } - - @Override - public List select(Map map)throws Exception { - return getAccountList(map); - } - - private List getAccountList(Map map) throws Exception{ - String search = map.get(Constants.SEARCH); - String name = StringUtil.getInfo(search, "name"); - String serialNo = StringUtil.getInfo(search, "serialNo"); - String remark = StringUtil.getInfo(search, "remark"); - String order = QueryUtils.order(map); - return accountService.select(name, serialNo, remark, QueryUtils.offset(map), QueryUtils.rows(map)); - } - - @Override - public Long counts(Map map) throws Exception{ - String search = map.get(Constants.SEARCH); - String name = StringUtil.getInfo(search, "name"); - String serialNo = StringUtil.getInfo(search, "serialNo"); - String remark = StringUtil.getInfo(search, "remark"); - return accountService.countAccount(name, serialNo, remark); - } - - @Override - public int insert(JSONObject obj, HttpServletRequest request) throws Exception{ - return accountService.insertAccount(obj, request); - } - - @Override - public int update(JSONObject obj, HttpServletRequest request)throws Exception { - return accountService.updateAccount(obj, request); - } - - @Override - public int delete(Long id, HttpServletRequest request)throws Exception { - return accountService.deleteAccount(id, request); - } - - @Override - public int deleteBatch(String ids, HttpServletRequest request)throws Exception { - return accountService.batchDeleteAccount(ids, request); - } - - @Override - public int checkIsNameExist(Long id, String name)throws Exception { - return accountService.checkIsNameExist(id, name); - } - -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/account/AccountResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/account/AccountResource.java deleted file mode 100644 index 3dea5a6f..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/service/account/AccountResource.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.zsw.erp.service.account; - -import com.zsw.erp.service.ResourceInfo; - -import java.lang.annotation.*; - - -@ResourceInfo(value = "account") -@Inherited -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -public @interface AccountResource { -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/account/AccountService.java b/zsw-erp/src/main/java/com/zsw/erp/service/account/AccountService.java deleted file mode 100644 index 37608904..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/service/account/AccountService.java +++ /dev/null @@ -1,575 +0,0 @@ -package com.zsw.erp.service.account; - -import com.alibaba.fastjson.JSONObject; -import com.zsw.erp.constants.BusinessConstants; -import com.zsw.erp.constants.ExceptionConstants; -import com.zsw.erp.datasource.vo.AccountVo4InOutList; -import com.zsw.erp.datasource.vo.AccountVo4List; -import com.zsw.erp.exception.BusinessRunTimeException; -import com.zsw.erp.exception.BoomException; -import com.zsw.erp.service.log.LogService; -import com.zsw.erp.service.user.UserService; -import com.zsw.erp.utils.StringUtil; -import com.zsw.erp.utils.Tools; -import com.zsw.erp.datasource.entities.*; -import com.zsw.erp.datasource.mappers.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.dao.DataAccessException; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.math.BigDecimal; -import java.text.DecimalFormat; -import java.util.*; - -@Service -public class AccountService { - private Logger logger = LoggerFactory.getLogger(AccountService.class); - - @Resource - private AccountMapper accountMapper; - - @Resource - private AccountMapperEx accountMapperEx; - - @Resource - private DepotHeadMapper depotHeadMapper; - @Resource - private DepotHeadMapperEx depotHeadMapperEx; - - @Resource - private AccountHeadMapper accountHeadMapper; - @Resource - private AccountHeadMapperEx accountHeadMapperEx; - - @Resource - private AccountItemMapper accountItemMapper; - @Resource - private AccountItemMapperEx accountItemMapperEx; - @Resource - private LogService logService; - @Resource - private UserService userService; - - public Account getAccount(long id) throws Exception{ - return accountMapper.selectByPrimaryKey(id); - } - - public List getAccountListByIds(String ids)throws Exception { - List idList = StringUtil.strToLongList(ids); - List list = new ArrayList<>(); - try{ - AccountExample example = new AccountExample(); - example.createCriteria().andIdIn(idList); - list = accountMapper.selectByExample(example); - }catch(Exception e){ - BoomException.readFail(e); - } - return list; - } - - public List getAccount() throws Exception{ - AccountExample example = new AccountExample(); - example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); - List list=null; - try{ - list=accountMapper.selectByExample(example); - }catch(Exception e){ - BoomException.readFail(e); - } - return list; - } - - public List getAccountByParam(String name, String serialNo) { - List list=null; - try{ - list=accountMapperEx.getAccountByParam(name, serialNo); - }catch(Exception e){ - BoomException.readFail(e); - } - return list; - } - - public List select(String name, String serialNo, String remark, int offset, int rows) throws Exception{ - List resList = new ArrayList(); - List list=null; - try{ - list = accountMapperEx.selectByConditionAccount(name, serialNo, remark, offset, rows); - }catch(Exception e){ - BoomException.readFail(e); - } - String timeStr = Tools.getCurrentMonth(); - if (null != list && null !=timeStr) { - for (AccountVo4List al : list) { - DecimalFormat df = new DecimalFormat(".##"); - BigDecimal thisMonthAmount = getAccountSum(al.getId(), timeStr, "month").add(getAccountSumByHead(al.getId(), timeStr, "month")).add(getAccountSumByDetail(al.getId(), timeStr, "month")).add(getManyAccountSum(al.getId(), timeStr, "month")); - String thisMonthAmountFmt = "0"; - if ((thisMonthAmount.compareTo(BigDecimal.ZERO))!=0) { - thisMonthAmountFmt = df.format(thisMonthAmount); - } - al.setThisMonthAmount(thisMonthAmountFmt); //本月发生额 - BigDecimal currentAmount = getAccountSum(al.getId(), "", "month").add(getAccountSumByHead(al.getId(), "", "month")).add(getAccountSumByDetail(al.getId(), "", "month")).add(getManyAccountSum(al.getId(), "", "month")) .add(al.getInitialAmount()) ; - al.setCurrentAmount(currentAmount); - resList.add(al); - } - } - return resList; - } - - public Long countAccount(String name, String serialNo, String remark)throws Exception { - Long result=null; - try{ - result=accountMapperEx.countsByAccount(name, serialNo, remark); - }catch(Exception e){ - BoomException.readFail(e); - } - return result; - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int insertAccount(JSONObject obj, HttpServletRequest request)throws Exception { - Account account = JSONObject.parseObject(obj.toJSONString(), Account.class); - if(account.getInitialAmount() == null) { - account.setInitialAmount(BigDecimal.ZERO); - } - account.setIsDefault(false); - int result=0; - try{ - result = accountMapper.insertSelective(account); - logService.insertLog("账户", - new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(account.getName()).toString(), request); - }catch(Exception e){ - BoomException.writeFail(e); - } - return result; - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int updateAccount(JSONObject obj, HttpServletRequest request)throws Exception { - Account account = JSONObject.parseObject(obj.toJSONString(), Account.class); - int result=0; - try{ - result = accountMapper.updateByPrimaryKeySelective(account); - logService.insertLog("账户", - new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(account.getName()).toString(), request); - }catch(Exception e){ - BoomException.writeFail(e); - } - return result; - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int deleteAccount(Long id, HttpServletRequest request) throws Exception{ - return batchDeleteAccountByIds(id.toString()); - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int batchDeleteAccount(String ids, HttpServletRequest request)throws Exception { - return batchDeleteAccountByIds(ids); - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int batchDeleteAccountByIds(String ids) throws Exception{ - int result=0; - String [] idArray=ids.split(","); - //校验财务主表 jsh_accounthead - List accountHeadList=null; - try{ - accountHeadList = accountHeadMapperEx.getAccountHeadListByAccountIds(idArray); - }catch(Exception e){ - BoomException.readFail(e); - } - if(accountHeadList!=null&&accountHeadList.size()>0){ - logger.error("异常码[{}],异常提示[{}],参数,AccountIds[{}]", - ExceptionConstants.DELETE_FORCE_CONFIRM_CODE,ExceptionConstants.DELETE_FORCE_CONFIRM_MSG,ids); - throw new BusinessRunTimeException(ExceptionConstants.DELETE_FORCE_CONFIRM_CODE, - ExceptionConstants.DELETE_FORCE_CONFIRM_MSG); - } - //校验财务子表 jsh_accountitem - List accountItemList=null; - try{ - accountItemList = accountItemMapperEx.getAccountItemListByAccountIds(idArray); - }catch(Exception e){ - BoomException.readFail(e); - } - if(accountItemList!=null&&accountItemList.size()>0){ - logger.error("异常码[{}],异常提示[{}],参数,AccountIds[{}]", - ExceptionConstants.DELETE_FORCE_CONFIRM_CODE,ExceptionConstants.DELETE_FORCE_CONFIRM_MSG,ids); - throw new BusinessRunTimeException(ExceptionConstants.DELETE_FORCE_CONFIRM_CODE, - ExceptionConstants.DELETE_FORCE_CONFIRM_MSG); - } - //校验单据主表 jsh_depot_head - List depotHeadList =null; - try{ - depotHeadList = depotHeadMapperEx.getDepotHeadListByAccountIds(idArray); - }catch(Exception e){ - BoomException.readFail(e); - } - if(depotHeadList!=null&&depotHeadList.size()>0){ - logger.error("异常码[{}],异常提示[{}],参数,AccountIds[{}]", - ExceptionConstants.DELETE_FORCE_CONFIRM_CODE,ExceptionConstants.DELETE_FORCE_CONFIRM_MSG,ids); - throw new BusinessRunTimeException(ExceptionConstants.DELETE_FORCE_CONFIRM_CODE, - ExceptionConstants.DELETE_FORCE_CONFIRM_MSG); - } - //记录日志 - StringBuffer sb = new StringBuffer(); - sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); - List list = getAccountListByIds(ids); - for(Account account: list){ - sb.append("[").append(account.getName()).append("]"); - } - logService.insertLog("账户", sb.toString(), - ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); - User userInfo=userService.getCurrentUser(); - //校验通过执行删除操作 - try{ - result = accountMapperEx.batchDeleteAccountByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); - }catch(Exception e){ - BoomException.writeFail(e); - } - return result; - } - - public int checkIsNameExist(Long id, String name)throws Exception { - AccountExample example = new AccountExample(); - example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); - List list=null; - try{ - list = accountMapper.selectByExample(example); - }catch(Exception e){ - BoomException.readFail(e); - } - return list==null?0:list.size(); - } - - public List findBySelect()throws Exception { - AccountExample example = new AccountExample(); - example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); - example.setOrderByClause("id desc"); - List list=null; - try{ - list = accountMapper.selectByExample(example); - }catch(Exception e){ - BoomException.readFail(e); - } - return list; - } - - /** - * 单个账户的金额求和-入库和出库 - * - * @param id - * @return - */ - public BigDecimal getAccountSum(Long id, String timeStr, String type) throws Exception{ - BigDecimal accountSum = BigDecimal.ZERO; - try { - DepotHeadExample example = new DepotHeadExample(); - if (!timeStr.equals("")) { - Date bTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); - Date eTime = StringUtil.getDateByString(Tools.lastDayOfMonth(timeStr) + BusinessConstants.DAY_LAST_TIME, null); - Date mTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); - if (type.equals("month")) { - example.createCriteria().andAccountIdEqualTo(id).andPayTypeNotEqualTo("预付款") - .andOperTimeGreaterThanOrEqualTo(bTime).andOperTimeLessThanOrEqualTo(eTime) - .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); - } else if (type.equals("date")) { - example.createCriteria().andAccountIdEqualTo(id).andPayTypeNotEqualTo("预付款") - .andOperTimeLessThanOrEqualTo(mTime).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); - } - } else { - example.createCriteria().andAccountIdEqualTo(id).andPayTypeNotEqualTo("预付款") - .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); - } - List dataList=null; - try{ - dataList = depotHeadMapper.selectByExample(example); - }catch(Exception e){ - BoomException.readFail(e); - } - if (dataList != null) { - for (DepotHead depotHead : dataList) { - if(depotHead.getChangeAmount()!=null) { - accountSum = accountSum .add(depotHead.getChangeAmount()) ; - } - } - } - } catch (DataAccessException e) { - logger.error(">>>>>>>>>查找进销存信息异常", e); - } - return accountSum; - } - - /** - * 单个账户的金额求和-收入、支出、转账的单据表头的合计 - * - * @param id - * @return - */ - public BigDecimal getAccountSumByHead(Long id, String timeStr, String type) throws Exception{ - BigDecimal accountSum = BigDecimal.ZERO; - try { - AccountHeadExample example = new AccountHeadExample(); - if (!timeStr.equals("")) { - Date bTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); - Date eTime = StringUtil.getDateByString(Tools.lastDayOfMonth(timeStr) + BusinessConstants.DAY_LAST_TIME, null); - Date mTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); - if (type.equals("month")) { - example.createCriteria().andAccountIdEqualTo(id) - .andBillTimeGreaterThanOrEqualTo(bTime).andBillTimeLessThanOrEqualTo(eTime) - .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); - } else if (type.equals("date")) { - example.createCriteria().andAccountIdEqualTo(id) - .andBillTimeLessThanOrEqualTo(mTime) - .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); - } - } else { - example.createCriteria().andAccountIdEqualTo(id) - .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); - } - List dataList=null; - try{ - dataList = accountHeadMapper.selectByExample(example); - }catch(Exception e){ - BoomException.readFail(e); - } - if (dataList != null) { - for (AccountHead accountHead : dataList) { - if(accountHead.getChangeAmount()!=null) { - accountSum = accountSum.add(accountHead.getChangeAmount()); - } - } - } - } catch (DataAccessException e) { - logger.error(">>>>>>>>>查找进销存信息异常", e); - } - return accountSum; - } - - /** - * 单个账户的金额求和-收款、付款、转账、收预付款的单据明细的合计 - * - * @param id - * @return - */ - public BigDecimal getAccountSumByDetail(Long id, String timeStr, String type)throws Exception { - BigDecimal accountSum =BigDecimal.ZERO ; - try { - AccountHeadExample example = new AccountHeadExample(); - if (!timeStr.equals("")) { - Date bTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); - Date eTime = StringUtil.getDateByString(Tools.lastDayOfMonth(timeStr) + BusinessConstants.DAY_LAST_TIME, null); - Date mTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); - if (type.equals("month")) { - example.createCriteria().andBillTimeGreaterThanOrEqualTo(bTime).andBillTimeLessThanOrEqualTo(eTime) - .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); - } else if (type.equals("date")) { - example.createCriteria().andBillTimeLessThanOrEqualTo(mTime) - .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); - } - } - List dataList=null; - try{ - dataList = accountHeadMapper.selectByExample(example); - }catch(Exception e){ - BoomException.readFail(e); - } - if (dataList != null) { - String ids = ""; - for (AccountHead accountHead : dataList) { - ids = ids + accountHead.getId() + ","; - } - if (!ids.equals("")) { - ids = ids.substring(0, ids.length() - 1); - } - AccountItemExample exampleAi = new AccountItemExample(); - if (!ids.equals("")) { - List idList = StringUtil.strToLongList(ids); - exampleAi.createCriteria().andAccountIdEqualTo(id).andHeaderIdIn(idList) - .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); - List dataListOne = accountItemMapper.selectByExample(exampleAi); - if (dataListOne != null) { - for (AccountItem accountItem : dataListOne) { - if(accountItem.getEachAmount()!=null) { - accountSum = accountSum.add(accountItem.getEachAmount()); - } - } - } - } - } - } catch (DataAccessException e) { - logger.error(">>>>>>>>>查找进销存信息异常", e); - } catch (Exception e) { - logger.error(">>>>>>>>>异常信息:", e); - } - return accountSum; - } - - /** - * 单个账户的金额求和-多账户的明细合计 - * - * @param id - * @return - */ - public BigDecimal getManyAccountSum(Long id, String timeStr, String type)throws Exception { - BigDecimal accountSum = BigDecimal.ZERO; - try { - DepotHeadExample example = new DepotHeadExample(); - if (!timeStr.equals("")) { - Date bTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); - Date eTime = StringUtil.getDateByString(Tools.lastDayOfMonth(timeStr) + BusinessConstants.DAY_LAST_TIME, null); - Date mTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); - if (type.equals("month")) { - example.createCriteria().andAccountIdListLike("%" +id.toString() + "%") - .andOperTimeGreaterThanOrEqualTo(bTime).andOperTimeLessThanOrEqualTo(eTime) - .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); - } else if (type.equals("date")) { - example.createCriteria().andAccountIdListLike("%" +id.toString() + "%") - .andOperTimeLessThanOrEqualTo(mTime) - .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); - } - } else { - example.createCriteria().andAccountIdListLike("%" +id.toString() + "%") - .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); - } - List dataList=null; - try{ - dataList = depotHeadMapper.selectByExample(example); - }catch(Exception e){ - BoomException.readFail(e); - } - if (dataList != null) { - for (DepotHead depotHead : dataList) { - String accountIdList = depotHead.getAccountIdList(); - String accountMoneyList = depotHead.getAccountMoneyList(); - if(StringUtil.isNotEmpty(accountIdList) && StringUtil.isNotEmpty(accountMoneyList)) { - accountIdList = accountIdList.replace("[", "").replace("]", "").replace("\"", ""); - accountMoneyList = accountMoneyList.replace("[", "").replace("]", "").replace("\"", ""); - String[] aList = accountIdList.split(","); - String[] amList = accountMoneyList.split(","); - for (int i = 0; i < aList.length; i++) { - if (aList[i].toString().equals(id.toString())) { - if(amList!=null && amList.length>0) { - accountSum = accountSum.add(new BigDecimal(amList[i])); - } - } - } - } - } - } - } catch (DataAccessException e) { - logger.error(">>>>>>>>>查找信息异常", e); - } - return accountSum; - } - - public List findAccountInOutList(Long accountId, Integer offset, Integer rows) throws Exception{ - List list=null; - try{ - list = accountMapperEx.findAccountInOutList(accountId, offset, rows); - }catch(Exception e){ - BoomException.readFail(e); - } - return list; - } - - public int findAccountInOutListCount(Long accountId) throws Exception{ - int result=0; - try{ - result = accountMapperEx.findAccountInOutListCount(accountId); - }catch(Exception e){ - BoomException.readFail(e); - } - return result; - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int updateIsDefault(Long accountId) throws Exception{ - int result=0; - try{ - //全部取消默认 - Account allAccount = new Account(); - allAccount.setIsDefault(false); - AccountExample allExample = new AccountExample(); - allExample.createCriteria(); - accountMapper.updateByExampleSelective(allAccount, allExample); - //给指定账户设为默认 - Account account = new Account(); - account.setIsDefault(true); - AccountExample example = new AccountExample(); - example.createCriteria().andIdEqualTo(accountId); - accountMapper.updateByExampleSelective(account, example); - logService.insertLog("账户",BusinessConstants.LOG_OPERATION_TYPE_EDIT+accountId, - ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); - result = 1; - }catch(Exception e){ - BoomException.writeFail(e); - } - return result; - } - - public Map getAccountMap() throws Exception { - List accountList = getAccount(); - Map accountMap = new HashMap<>(); - for(Account account : accountList){ - accountMap.put(account.getId(), account.getName()); - } - return accountMap; - } - - public String getAccountStrByIdAndMoney(Map accountMap, String accountIdList, String accountMoneyList){ - StringBuffer sb = new StringBuffer(); - List idList = StringUtil.strToLongList(accountIdList); - List moneyList = StringUtil.strToLongList(accountMoneyList); - for (int i = 0; i < idList.size(); i++) { - Long id = idList.get(i); - BigDecimal money = BigDecimal.valueOf(moneyList.get(i)).abs(); - sb.append(accountMap.get(id) + "(" + money + "元) "); - } - return sb.toString(); - } - - public Map getStatistics(String name, String serialNo) { - Map map = new HashMap<>(); - try { - List list = getAccountByParam(name, serialNo); - String timeStr = Tools.getCurrentMonth(); - BigDecimal allMonthAmount = BigDecimal.ZERO; - BigDecimal allCurrentAmount = BigDecimal.ZERO; - if (null != list && null !=timeStr) { - for (Account a : list) { - BigDecimal monthAmount = getAccountSum(a.getId(), timeStr, "month").add(getAccountSumByHead(a.getId(), timeStr, "month")) - .add(getAccountSumByDetail(a.getId(), timeStr, "month")).add(getManyAccountSum(a.getId(), timeStr, "month")); - BigDecimal currentAmount = getAccountSum(a.getId(), "", "month").add(getAccountSumByHead(a.getId(), "", "month")) - .add(getAccountSumByDetail(a.getId(), "", "month")).add(getManyAccountSum(a.getId(), "", "month")).add(a.getInitialAmount()); - allMonthAmount = allMonthAmount.add(monthAmount); - allCurrentAmount = allCurrentAmount.add(currentAmount); - } - } - map.put("allCurrentAmount", priceFormat(allCurrentAmount)); //当前总金额 - map.put("allMonthAmount", priceFormat(allMonthAmount)); //本月发生额 - } catch (Exception e) { - BoomException.readFail(e); - } - return map; - } - - /** - * 价格格式化 - * @param price - * @return - */ - private String priceFormat(BigDecimal price) { - String priceFmt = "0"; - DecimalFormat df = new DecimalFormat(".##"); - if ((price.compareTo(BigDecimal.ZERO))!=0) { - priceFmt = df.format(price); - } - return priceFmt; - } -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/accountHead/AccountHeadService.java b/zsw-erp/src/main/java/com/zsw/erp/service/accountHead/AccountHeadService.java index c1582ba0..90fa6660 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/service/accountHead/AccountHeadService.java +++ b/zsw-erp/src/main/java/com/zsw/erp/service/accountHead/AccountHeadService.java @@ -1,5 +1,7 @@ package com.zsw.erp.service.accountHead; +import cn.iocoder.yudao.framework.security.core.LoginUser; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import com.alibaba.fastjson.JSONObject; import com.zsw.erp.constants.BusinessConstants; import com.zsw.erp.constants.ExceptionConstants; @@ -12,13 +14,11 @@ import com.zsw.erp.service.accountItem.AccountItemService; import com.zsw.erp.service.log.LogService; import com.zsw.erp.service.orgaUserRel.OrgaUserRelService; import com.zsw.erp.service.supplier.SupplierService; -import com.zsw.erp.service.user.UserService; import com.zsw.erp.utils.StringUtil; import com.zsw.erp.utils.Tools; import com.zsw.erp.datasource.entities.AccountHead; import com.zsw.erp.datasource.entities.AccountHeadExample; import com.zsw.erp.datasource.entities.AccountHeadVo4ListEx; -import com.zsw.erp.datasource.entities.User; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; @@ -46,8 +46,7 @@ public class AccountHeadService { private OrgaUserRelService orgaUserRelService; @Resource private AccountItemService accountItemService; - @Resource - private UserService userService; + @Resource private SupplierService supplierService; @Resource @@ -139,7 +138,7 @@ public class AccountHeadService { */ private String[] getCreatorArray(String roleType) throws Exception { String creator = ""; - User user = userService.getCurrentUser(); + LoginUser user = SecurityFrameworkUtils.getLoginUser(); if(BusinessConstants.ROLE_TYPE_PRIVATE.equals(roleType)) { creator = user.getId().toString(); } else if(BusinessConstants.ROLE_TYPE_THIS_ORG.equals(roleType)) { @@ -157,7 +156,7 @@ public class AccountHeadService { AccountHead accountHead = JSONObject.parseObject(obj.toJSONString(), AccountHead.class); int result=0; try{ - User userInfo=userService.getCurrentUser(); + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); accountHead.setCreator(userInfo==null?null:userInfo.getId()); result = accountHeadMapper.insertSelective(accountHead); logService.insertLog("财务", @@ -204,7 +203,7 @@ public class AccountHeadService { String.format(ExceptionConstants.ACCOUNT_HEAD_UN_AUDIT_DELETE_FAILED_MSG)); } } - User userInfo=userService.getCurrentUser(); + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); String [] idArray=ids.split(","); //删除主表 accountItemMapperEx.batchDeleteAccountItemByHeadIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); @@ -263,7 +262,7 @@ public class AccountHeadService { @Transactional(value = "transactionManager", rollbackFor = Exception.class) public void addAccountHeadAndDetail(String beanJson, String rows, HttpServletRequest request) throws Exception { AccountHead accountHead = JSONObject.parseObject(beanJson, AccountHead.class); - User userInfo=userService.getCurrentUser(); + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); accountHead.setCreator(userInfo==null?null:userInfo.getId()); accountHead.setStatus(BusinessConstants.BILLS_STATUS_UN_AUDIT); accountHeadMapper.insertSelective(accountHead); diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/accountItem/AccountItemService.java b/zsw-erp/src/main/java/com/zsw/erp/service/accountItem/AccountItemService.java index d676acb7..2274d5a5 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/service/accountItem/AccountItemService.java +++ b/zsw-erp/src/main/java/com/zsw/erp/service/accountItem/AccountItemService.java @@ -1,12 +1,14 @@ package com.zsw.erp.service.accountItem; +import cn.iocoder.yudao.framework.security.core.LoginUser; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; +import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.zsw.erp.constants.BusinessConstants; import com.zsw.erp.constants.ExceptionConstants; import com.zsw.erp.datasource.entities.AccountItem; import com.zsw.erp.datasource.entities.AccountItemExample; -import com.zsw.erp.datasource.entities.User; import com.zsw.erp.datasource.mappers.AccountItemMapper; import com.zsw.erp.datasource.mappers.AccountItemMapperEx; import com.zsw.erp.datasource.vo.AccountItemVo4List; @@ -14,7 +16,6 @@ import com.zsw.erp.exception.BusinessRunTimeException; import com.zsw.erp.exception.BoomException; import com.zsw.erp.service.depotHead.DepotHeadService; import com.zsw.erp.service.log.LogService; -import com.zsw.erp.service.user.UserService; import com.zsw.erp.utils.StringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -39,8 +40,7 @@ public class AccountItemService { private AccountItemMapperEx accountItemMapperEx; @Resource private LogService logService; - @Resource - private UserService userService; + @Resource private DepotHeadService depotHeadService; @@ -245,11 +245,12 @@ public class AccountItemService { logService.insertLog("财务明细", new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(), ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); - User userInfo=userService.getCurrentUser(); + String [] idArray=ids.split(","); int result=0; try{ - result = accountItemMapperEx.batchDeleteAccountItemByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + result = accountItemMapperEx.batchDeleteAccountItemByIds(new Date(),loginUser.getId(),idArray); }catch(Exception e){ BoomException.writeFail(e); } diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/depot/DepotService.java b/zsw-erp/src/main/java/com/zsw/erp/service/depot/DepotService.java index d6df8225..3b8bf138 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/service/depot/DepotService.java +++ b/zsw-erp/src/main/java/com/zsw/erp/service/depot/DepotService.java @@ -1,5 +1,7 @@ package com.zsw.erp.service.depot; +import cn.iocoder.yudao.framework.security.core.LoginUser; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -14,8 +16,6 @@ import com.zsw.erp.exception.BusinessRunTimeException; import com.zsw.erp.exception.BoomException; import com.zsw.erp.service.log.LogService; import com.zsw.erp.service.systemConfig.SystemConfigService; -import com.zsw.erp.service.user.UserService; -import com.zsw.erp.service.userBusiness.UserBusinessService; import com.zsw.erp.utils.StringUtil; import com.zsw.erp.datasource.entities.*; import org.slf4j.Logger; @@ -38,12 +38,10 @@ public class DepotService extends ServiceImpl { private DepotMapper depotMapper; @Resource private DepotMapperEx depotMapperEx; - @Resource - private UserService userService; + @Resource private SystemConfigService systemConfigService; - @Resource - private UserBusinessService userBusinessService; + @Resource private LogService logService; @Resource @@ -121,23 +119,6 @@ public class DepotService extends ServiceImpl { depot.setType(0); depot.setIsDefault(false); result=depotMapper.insert(depot); - //新增仓库时给当前用户自动授权 - Long userId = userService.getUserId(request); - Long depotId = getIdByName(depot.getName()); - //String ubKey = "[" + depotId + "]"; - UserBusiness ubInfo = userBusinessService.getBasicData(userId, "UserDepot"); - if(ubInfo == null) { - ubInfo = new UserBusiness(); - ubInfo.setType("UserDepot"); - ubInfo.setKeyId(userId.toString()); - ArrayList l = Lists.newArrayList(); - l.add(depotId); - ubInfo.setValue(l); - userBusinessService.insertUserBusiness(ubInfo, request); - } else { - ubInfo.getValue().add(depotId); - userBusinessService.updateUserBusiness(ubInfo, request); - } logService.insertLog("仓库", new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(depot.getName()).toString(), request); }catch(Exception e){ @@ -196,7 +177,7 @@ public class DepotService extends ServiceImpl { } logService.insertLog("仓库", sb.toString(), ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); - User userInfo=userService.getCurrentUser(); + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); //校验通过执行删除操作 try{ result = depotMapperEx.batchDeleteDepotByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); @@ -274,7 +255,6 @@ public class DepotService extends ServiceImpl { public JSONArray findDepotByCurrentUser() throws Exception { JSONArray arr = new JSONArray(); String type = "UserDepot"; - Long userId = userService.getCurrentUser().getId(); List dataList = findUserDepot(); //开始拼接json数据 if (null != dataList) { diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/depotHead/DepotHeadService.java b/zsw-erp/src/main/java/com/zsw/erp/service/depotHead/DepotHeadService.java index 811a5c9e..3f79b7d7 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/service/depotHead/DepotHeadService.java +++ b/zsw-erp/src/main/java/com/zsw/erp/service/depotHead/DepotHeadService.java @@ -1,5 +1,9 @@ package com.zsw.erp.service.depotHead; +import cn.iocoder.yudao.framework.security.core.LoginUser; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; +import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO; +import cn.iocoder.yudao.module.system.service.tenant.TenantService; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.zsw.erp.constants.BusinessConstants; @@ -14,7 +18,6 @@ import com.zsw.erp.datasource.vo.DepotHeadVo4List; import com.zsw.erp.datasource.vo.DepotHeadVo4StatementAccount; import com.zsw.erp.exception.BusinessRunTimeException; import com.zsw.erp.exception.BoomException; -import com.zsw.erp.service.account.AccountService; import com.zsw.erp.service.accountItem.AccountItemService; import com.zsw.erp.service.depot.DepotService; import com.zsw.erp.service.depotItem.DepotItemService; @@ -24,8 +27,6 @@ import com.zsw.erp.service.person.PersonService; import com.zsw.erp.service.redis.RedisService; import com.zsw.erp.service.serialNumber.SerialNumberService; import com.zsw.erp.service.supplier.SupplierService; -import com.zsw.erp.service.tenant.TenantService; -import com.zsw.erp.service.user.UserService; import com.zsw.erp.utils.StringUtil; import com.zsw.erp.utils.Tools; import org.slf4j.Logger; @@ -58,9 +59,6 @@ public class DepotHeadService extends ServiceImpl { @Resource private DepotHeadMapperEx depotHeadMapperEx; - @Resource - private UserService userService; - @Resource private DepotService depotService; @@ -80,7 +78,8 @@ public class DepotHeadService extends ServiceImpl { private PersonService personService; @Resource - private AccountService accountService; + private TenantService tenantService; + @Resource @Lazy @@ -95,8 +94,6 @@ public class DepotHeadService extends ServiceImpl { @Resource private RedisService redisService; - @Resource - private TenantService tenantService; public DepotHead getDepotHead(long id) throws Exception { DepotHead result = null; @@ -130,17 +127,17 @@ public class DepotHeadService extends ServiceImpl { String[] creatorArray = getCreatorArray(roleType); String[] statusArray = StringUtil.isNotEmpty(status) ? status.split(",") : null; Map personMap = personService.getPersonMap(); - Map accountMap = accountService.getAccountMap(); beginTime = Tools.parseDayToTime(beginTime, BusinessConstants.DAY_FIRST_TIME); endTime = Tools.parseDayToTime(endTime, BusinessConstants.DAY_LAST_TIME); list = depotHeadMapperEx.selectByConditionDepotHead(type, subType, creatorArray, statusArray, number, linkNumber, beginTime, endTime, materialParam, organId, creator, depotId, depotArray, offset, rows,startTime); if (null != list) { for (DepotHeadVo4List dh : list) { - if (accountMap != null && StringUtil.isNotEmpty(dh.getAccountIdList()) && StringUtil.isNotEmpty(dh.getAccountMoneyList())) { - String accountStr = accountService.getAccountStrByIdAndMoney(accountMap, dh.getAccountIdList(), dh.getAccountMoneyList()); - dh.setAccountName(accountStr); - } + // 这段代码是什么意思 单据全表 +// if (accountMap != null && StringUtil.isNotEmpty(dh.getAccountIdList()) && StringUtil.isNotEmpty(dh.getAccountMoneyList())) { +// String accountStr = accountService.getAccountStrByIdAndMoney(accountMap, dh.getAccountIdList(), dh.getAccountMoneyList()); +// dh.setAccountName(accountStr); +// } if (dh.getAccountIdList() != null) { String accountidlistStr = dh.getAccountIdList().replace("[", "").replace("]", "").replaceAll("\"", ""); dh.setAccountIdList(accountidlistStr); @@ -229,7 +226,7 @@ public class DepotHeadService extends ServiceImpl { */ public String getCreatorByRoleType(String roleType) { String creator = ""; - User user = userService.getCurrentUser(); + LoginUser user = SecurityFrameworkUtils.getLoginUser(); if (BusinessConstants.ROLE_TYPE_PRIVATE.equals(roleType)) { creator = user.getId().toString(); } else if (BusinessConstants.ROLE_TYPE_THIS_ORG.equals(roleType)) { @@ -294,7 +291,7 @@ public class DepotHeadService extends ServiceImpl { sb.append("[").append(depotHead.getNumber()).append("]"); //只有未审核的单据才能被删除 if ("0".equals(depotHead.getStatus())) { - User userInfo = userService.getCurrentUser(); + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); //删除出库数据回收序列号 if (BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType()) && !BusinessConstants.SUB_TYPE_TRANSFER.equals(depotHead.getSubType())) { @@ -366,7 +363,7 @@ public class DepotHeadService extends ServiceImpl { */ @Transactional(value = "transactionManager", rollbackFor = Exception.class) public int batchDeleteDepotHeadByIds(String ids) throws Exception { - User userInfo = userService.getCurrentUser(); + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); String[] idArray = ids.split(","); int result = 0; try { @@ -654,14 +651,14 @@ public class DepotHeadService extends ServiceImpl { List list = null; try { Map personMap = personService.getPersonMap(); - Map accountMap = accountService.getAccountMap(); + list = depotHeadMapperEx.getDetailByNumber(number); if (null != list) { for (DepotHeadVo4List dh : list) { - if (accountMap != null && StringUtil.isNotEmpty(dh.getAccountIdList()) && StringUtil.isNotEmpty(dh.getAccountMoneyList())) { - String accountStr = accountService.getAccountStrByIdAndMoney(accountMap, dh.getAccountIdList(), dh.getAccountMoneyList()); - dh.setAccountName(accountStr); - } +// if (accountMap != null && StringUtil.isNotEmpty(dh.getAccountIdList()) && StringUtil.isNotEmpty(dh.getAccountMoneyList())) { +// String accountStr = accountService.getAccountStrByIdAndMoney(accountMap, dh.getAccountIdList(), dh.getAccountMoneyList()); +// dh.setAccountName(accountStr); +// } if (dh.getAccountIdList() != null) { String accountidlistStr = dh.getAccountIdList().replace("[", "").replace("]", "").replaceAll("\"", ""); dh.setAccountIdList(accountidlistStr); @@ -681,7 +678,8 @@ public class DepotHeadService extends ServiceImpl { } dh.setOperTimeStr(getCenternTime(dh.getOperTime())); dh.setMaterialsList(findMaterialsListByHeaderId(dh.getId())); - dh.setCreatorName(userService.getUser(dh.getCreator()).getUsername()); + LoginUser user = SecurityFrameworkUtils.getLoginUser(); + dh.setCreatorName(user.getUsername()); resList.add(dh); } } @@ -719,7 +717,7 @@ public class DepotHeadService extends ServiceImpl { } } //判断用户是否已经登录过,登录过不再处理 - User userInfo = userService.getCurrentUser(); + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); depotHead.setCreator(userInfo == null ? null : userInfo.getId()); depotHead.setCreateTime(new Timestamp(System.currentTimeMillis())); depotHead.setStatus(BusinessConstants.BILLS_STATUS_UN_AUDIT); @@ -742,8 +740,8 @@ public class DepotHeadService extends ServiceImpl { // 租户供应链订单 if (depotHead.getTargetType()){ // 将发起人设置为 租户编号 - Tenant tenant = tenantService.getTenant(depotHead.getOrganId()); - depotHead.setOrganId(tenant.getTenantId()); + TenantDO tenant = tenantService.getTenant(depotHead.getOrganId()); + depotHead.setOrganId(tenant.getId()); } try { diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/depotItem/DepotItemService.java b/zsw-erp/src/main/java/com/zsw/erp/service/depotItem/DepotItemService.java index fa00f4e6..6df81c5b 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/service/depotItem/DepotItemService.java +++ b/zsw-erp/src/main/java/com/zsw/erp/service/depotItem/DepotItemService.java @@ -1,6 +1,8 @@ package com.zsw.erp.service.depotItem; import cn.hutool.core.util.ObjectUtil; +import cn.iocoder.yudao.framework.security.core.LoginUser; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -22,7 +24,6 @@ import com.zsw.erp.service.log.LogService; import com.zsw.erp.service.material.MaterialService; import com.zsw.erp.service.serialNumber.SerialNumberService; import com.zsw.erp.service.systemConfig.SystemConfigService; -import com.zsw.erp.service.user.UserService; import com.zsw.erp.utils.QueryUtils; import com.zsw.erp.utils.StringUtil; import com.zsw.erp.utils.Tools; @@ -61,8 +62,7 @@ public class DepotItemService { private DepotHeadMapper depotHeadMapper; @Resource SerialNumberService serialNumberService; - @Resource - private UserService userService; + @Resource private SystemConfigService systemConfigService; @Resource @@ -323,7 +323,7 @@ public class DepotItemService { //查询单据主表信息 DepotHead depotHead = depotHeadMapper.selectByPrimaryKey(headerId); //获得当前操作人 - User userInfo = userService.getCurrentUser(); + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); //首先回收序列号,如果是调拨,不用处理序列号 // 如果是出库 计算当前出库的加权金额 用于后续统计和扣除金额 。 if (BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType()) diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/functions/FunctionComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/functions/FunctionComponent.java deleted file mode 100644 index 3831ef78..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/service/functions/FunctionComponent.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.zsw.erp.service.functions; - -import com.alibaba.fastjson.JSONObject; -import com.zsw.erp.service.ICommonQuery; -import com.zsw.erp.utils.Constants; -import com.zsw.erp.utils.QueryUtils; -import com.zsw.erp.utils.StringUtil; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; -import java.util.Map; - -@Service(value = "function_component") -@FunctionResource -public class FunctionComponent implements ICommonQuery { - - @Resource - private FunctionService functionService; - - @Override - public Object selectOne(Long id) throws Exception { - return functionService.getFunction(id); - } - - @Override - public List select(Map map)throws Exception { - return getFunctionsList(map); - } - - private List getFunctionsList(Map map) throws Exception{ - String search = map.get(Constants.SEARCH); - String name = StringUtil.getInfo(search, "name"); - String type = StringUtil.getInfo(search, "type"); - String order = QueryUtils.order(map); - return functionService.select(name, type, QueryUtils.offset(map), QueryUtils.rows(map)); - } - - @Override - public Long counts(Map map) throws Exception{ - String search = map.get(Constants.SEARCH); - String name = StringUtil.getInfo(search, "name"); - String type = StringUtil.getInfo(search, "type"); - return functionService.countFunction(name, type); - } - - @Override - public int insert(JSONObject obj, HttpServletRequest request)throws Exception { - return functionService.insertFunction(obj, request); - } - - @Override - public int update(JSONObject obj, HttpServletRequest request)throws Exception { - return functionService.updateFunction(obj, request); - } - - @Override - public int delete(Long id, HttpServletRequest request)throws Exception { - return functionService.deleteFunction(id, request); - } - - @Override - public int deleteBatch(String ids, HttpServletRequest request)throws Exception { - return functionService.batchDeleteFunction(ids, request); - } - - @Override - public int checkIsNameExist(Long id, String name)throws Exception { - return functionService.checkIsNameExist(id, name); - } - -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/functions/FunctionResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/functions/FunctionResource.java deleted file mode 100644 index dfc956eb..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/service/functions/FunctionResource.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.zsw.erp.service.functions; - -import com.zsw.erp.service.ResourceInfo; - -import java.lang.annotation.*; - - -@ResourceInfo(value = "function") -@Inherited -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -public @interface FunctionResource { -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/functions/FunctionService.java b/zsw-erp/src/main/java/com/zsw/erp/service/functions/FunctionService.java deleted file mode 100644 index 4a56765b..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/service/functions/FunctionService.java +++ /dev/null @@ -1,211 +0,0 @@ -package com.zsw.erp.service.functions; - -import com.alibaba.fastjson.JSONObject; -import com.zsw.erp.constants.BusinessConstants; -import com.zsw.erp.datasource.entities.Function; -import com.zsw.erp.datasource.entities.FunctionExample; -import com.zsw.erp.datasource.entities.User; -import com.zsw.erp.datasource.mappers.FunctionMapper; -import com.zsw.erp.datasource.mappers.FunctionMapperEx; -import com.zsw.erp.exception.BoomException; -import com.zsw.erp.service.log.LogService; -import com.zsw.erp.service.user.UserService; -import com.zsw.erp.utils.StringUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -@Service -public class FunctionService { - private Logger logger = LoggerFactory.getLogger(FunctionService.class); - - @Resource - private FunctionMapper functionsMapper; - - @Resource - private FunctionMapperEx functionMapperEx; - @Resource - private UserService userService; - @Resource - private LogService logService; - - public Function getFunction(long id)throws Exception { - Function result=null; - try{ - result=functionsMapper.selectByPrimaryKey(id); - }catch(Exception e){ - BoomException.readFail(e); - } - return result; - } - - public List getFunctionListByIds(String ids)throws Exception { - List idList = StringUtil.strToLongList(ids); - List list = new ArrayList<>(); - try{ - FunctionExample example = new FunctionExample(); - example.createCriteria().andIdIn(idList); - list = functionsMapper.selectByExample(example); - }catch(Exception e){ - BoomException.readFail(e); - } - return list; - } - - public List getFunction()throws Exception { - FunctionExample example = new FunctionExample(); - example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); - List list=null; - try{ - list=functionsMapper.selectByExample(example); - }catch(Exception e){ - BoomException.readFail(e); - } - return list; - } - - public List select(String name, String type, int offset, int rows)throws Exception { - List list=null; - try{ - list= functionMapperEx.selectByConditionFunction(name, type, offset, rows); - }catch(Exception e){ - BoomException.readFail(e); - } - return list; - } - - public Long countFunction(String name, String type)throws Exception { - Long result=null; - try{ - result= functionMapperEx.countsByFunction(name, type); - }catch(Exception e){ - BoomException.readFail(e); - } - return result; - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int insertFunction(JSONObject obj, HttpServletRequest request)throws Exception { - Function functions = JSONObject.parseObject(obj.toJSONString(), Function.class); - int result=0; - try{ - result=functionsMapper.insert(functions); - logService.insertLog("功能", - new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(functions.getName()).toString(),request); - }catch(Exception e){ - BoomException.writeFail(e); - } - return result; - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int updateFunction(JSONObject obj, HttpServletRequest request) throws Exception{ - Function functions = JSONObject.parseObject(obj.toJSONString(), Function.class); - int result=0; - try{ - result=functionsMapper.updateByPrimaryKeySelective(functions); - logService.insertLog("功能", - new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(functions.getName()).toString(), request); - }catch(Exception e){ - BoomException.writeFail(e); - } - return result; - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int deleteFunction(Long id, HttpServletRequest request)throws Exception { - return batchDeleteFunctionByIds(id.toString()); - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int batchDeleteFunction(String ids, HttpServletRequest request)throws Exception { - return batchDeleteFunctionByIds(ids); - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int batchDeleteFunctionByIds(String ids)throws Exception { - StringBuffer sb = new StringBuffer(); - sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); - List list = getFunctionListByIds(ids); - for(Function functions: list){ - sb.append("[").append(functions.getName()).append("]"); - } - logService.insertLog("功能", sb.toString(), - ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); - User userInfo=userService.getCurrentUser(); - String [] idArray=ids.split(","); - int result=0; - try{ - result = functionMapperEx.batchDeleteFunctionByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); - }catch(Exception e){ - BoomException.writeFail(e); - } - return result; - } - - public int checkIsNameExist(Long id, String name)throws Exception { - FunctionExample example = new FunctionExample(); - example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); - List list=null; - try{ - list = functionsMapper.selectByExample(example); - }catch(Exception e){ - BoomException.readFail(e); - } - return list==null?0:list.size(); - } - - // 菜单到下级菜单 - public List getRoleFunction(String pNumber)throws Exception { - FunctionExample example = new FunctionExample(); - example.createCriteria() - .andEnabledEqualTo(true) - .andParentNumberEqualTo(pNumber) - .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); - example.setOrderByClause("Sort"); - List list=null; - try{ - list = functionsMapper.selectByExample(example); - }catch(Exception e){ - BoomException.readFail(e); - } - return list; - } - - public List findRoleFunction(String pnumber)throws Exception{ - FunctionExample example = new FunctionExample(); - example.createCriteria().andEnabledEqualTo(true).andParentNumberEqualTo(pnumber) - .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); - example.setOrderByClause("Sort"); - List list=null; - try{ - list =functionsMapper.selectByExample(example); - }catch(Exception e){ - BoomException.readFail(e); - } - return list; - } - - public List findByIds(List functionsIds)throws Exception{ - FunctionExample example = new FunctionExample(); - example.createCriteria().andEnabledEqualTo(true).andIdIn(functionsIds).andPushBtnIsNotNull().andPushBtnNotEqualTo("") - .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); - example.setOrderByClause("Sort asc"); - List list=null; - try{ - list =functionsMapper.selectByExample(example); - }catch(Exception e){ - BoomException.readFail(e); - } - return list; - } -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/inOutItem/InOutItemService.java b/zsw-erp/src/main/java/com/zsw/erp/service/inOutItem/InOutItemService.java index 980ff6de..77138faf 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/service/inOutItem/InOutItemService.java +++ b/zsw-erp/src/main/java/com/zsw/erp/service/inOutItem/InOutItemService.java @@ -9,12 +9,12 @@ import com.zsw.erp.datasource.mappers.InOutItemMapperEx; import com.zsw.erp.exception.BusinessRunTimeException; import com.zsw.erp.exception.BoomException; import com.zsw.erp.service.log.LogService; -import com.zsw.erp.service.user.UserService; +import cn.iocoder.yudao.framework.security.core.LoginUser; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import com.zsw.erp.utils.StringUtil; import com.zsw.erp.datasource.entities.AccountItem; import com.zsw.erp.datasource.entities.InOutItem; import com.zsw.erp.datasource.entities.InOutItemExample; -import com.zsw.erp.datasource.entities.User; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; @@ -37,8 +37,7 @@ public class InOutItemService { @Resource private InOutItemMapperEx inOutItemMapperEx; - @Resource - private UserService userService; + @Resource private LogService logService; @Resource @@ -163,7 +162,7 @@ public class InOutItemService { } logService.insertLog("收支项目", sb.toString(), ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); - User userInfo=userService.getCurrentUser(); + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); try{ result=inOutItemMapperEx.batchDeleteInOutItemByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); }catch(Exception e){ diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/inventorySeason/InventorySeasonService.java b/zsw-erp/src/main/java/com/zsw/erp/service/inventorySeason/InventorySeasonService.java index d5041c89..39f0e203 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/service/inventorySeason/InventorySeasonService.java +++ b/zsw-erp/src/main/java/com/zsw/erp/service/inventorySeason/InventorySeasonService.java @@ -12,9 +12,9 @@ import com.zsw.erp.datasource.entities.MaterialInitialStock; import com.zsw.erp.datasource.mappers.InventorySeasonMapper; import com.zsw.erp.datasource.mappers.MaterialInitialStockMapper; import com.zsw.erp.service.materialCurrentStock.MaterialCurrentStockService; -import com.zsw.erp.service.user.UserService; +import cn.iocoder.yudao.framework.security.core.LoginUser; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import com.zsw.erp.utils.Constants; -import com.zsw.erp.utils.LocalUser; import io.swagger.annotations.ApiOperation; import io.swagger.models.auth.In; import org.springframework.beans.factory.annotation.Autowired; @@ -36,8 +36,6 @@ public class InventorySeasonService extends ServiceImpl list=null; try{ - list=logMapper.selectByExample(example); + list= erpLogMapper.selectByExample(example); }catch(Exception e){ BoomException.readFail(e); } @@ -99,7 +96,7 @@ public class LogService { Log log = JSONObject.parseObject(obj.toJSONString(), Log.class); int result=0; try{ - result=logMapper.insertSelective(log); + result= erpLogMapper.insertSelective(log); }catch(Exception e){ BoomException.writeFail(e); } @@ -111,7 +108,7 @@ public class LogService { Log log = JSONObject.parseObject(obj.toJSONString(), Log.class); int result=0; try{ - result=logMapper.updateByPrimaryKeySelective(log); + result= erpLogMapper.updateByPrimaryKeySelective(log); }catch(Exception e){ BoomException.writeFail(e); } @@ -122,7 +119,7 @@ public class LogService { public int deleteLog(Long id, HttpServletRequest request)throws Exception { int result=0; try{ - result=logMapper.deleteByPrimaryKey(id); + result= erpLogMapper.deleteByPrimaryKey(id); }catch(Exception e){ BoomException.writeFail(e); } @@ -136,7 +133,7 @@ public class LogService { example.createCriteria().andIdIn(idList); int result=0; try{ - result=logMapper.deleteByExample(example); + result= erpLogMapper.deleteByExample(example); }catch(Exception e){ BoomException.writeFail(e); } @@ -145,8 +142,8 @@ public class LogService { public void insertLog(String moduleName, String content, HttpServletRequest request) { try{ - Long userId = userService.getUserId(request); - if(userId!=null) { + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); + if(userInfo!=null) { String clientIp = getLocalIp(request); String createTime = Tools.getNow3(); Long count = logMapperEx.getCountByIpAndDate(moduleName, clientIp, createTime); @@ -155,14 +152,14 @@ public class LogService { redisService.deleteObjectByKeyAndIp("clientIp", clientIp, "userId"); } else { Log log = new Log(); - log.setUserId(userId); + log.setUserId(userInfo.getId()); log.setOperation(moduleName); log.setClientIp(getLocalIp(request)); log.setCreateTime(new Date()); Byte status = 0; log.setStatus(status); log.setContent(content); - logMapper.insertSelective(log); + erpLogMapper.insertSelective(log); } } }catch(Exception e){ @@ -182,7 +179,7 @@ public class LogService { log.setStatus(status); log.setContent(content); log.setTenantId(tenantId); - logMapper.insertSelective(log); + erpLogMapper.insertSelective(log); } }catch(Exception e){ BoomException.writeFail(e); diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/material/MaterialService.java b/zsw-erp/src/main/java/com/zsw/erp/service/material/MaterialService.java index e259df9b..cc70da7f 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/service/material/MaterialService.java +++ b/zsw-erp/src/main/java/com/zsw/erp/service/material/MaterialService.java @@ -5,6 +5,8 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.ObjectUtil; +import cn.iocoder.yudao.framework.security.core.LoginUser; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; @@ -26,7 +28,6 @@ import com.zsw.erp.service.materialCategory.MaterialCategoryService; import com.zsw.erp.service.redis.RedisService; import com.zsw.erp.service.sequence.SequenceService; import com.zsw.erp.service.unit.UnitService; -import com.zsw.erp.service.user.UserService; import com.zsw.base.R; import com.zsw.erp.utils.StringUtil; import com.zsw.erp.datasource.entities.*; @@ -64,8 +65,6 @@ public class MaterialService { @Resource private LogService logService; @Resource - private UserService userService; - @Resource private DepotItemMapperEx depotItemMapperEx; @Resource @Lazy @@ -340,7 +339,7 @@ public class MaterialService { } logService.insertLog("商品", sb.toString(), ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); - User userInfo = userService.getCurrentUser(); + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); //校验通过执行删除操作 try { //逻辑删除商品 @@ -676,7 +675,7 @@ public class MaterialService { materialMapper.updateByPrimaryKeySelective(material); } //给商品新增条码与价格相关信息 - User user = userService.getCurrentUser(); + LoginUser user = SecurityFrameworkUtils.getLoginUser(); JSONObject materialExObj = m.getMaterialExObj(); if (StringUtil.isExist(materialExObj.get("basic"))) { String basicStr = materialExObj.getString("basic"); @@ -685,8 +684,8 @@ public class MaterialService { basicMaterialExtend.setDefaultFlag("1"); basicMaterialExtend.setCreateTime(new Date()); basicMaterialExtend.setUpdateTime(System.currentTimeMillis()); - basicMaterialExtend.setCreateSerial(user.getLoginName()); - basicMaterialExtend.setUpdateSerial(user.getLoginName()); + basicMaterialExtend.setCreateSerial(user.getUsername()); + basicMaterialExtend.setUpdateSerial(user.getUsername()); Long meId = materialExtendService.selectIdByMaterialIdAndDefaultFlag(mId, "1"); if (meId == 0L) { materialExtendMapper.insertSelective(basicMaterialExtend); diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/materialCategory/MaterialCategoryService.java b/zsw-erp/src/main/java/com/zsw/erp/service/materialCategory/MaterialCategoryService.java index b85fa6a6..da869377 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/service/materialCategory/MaterialCategoryService.java +++ b/zsw-erp/src/main/java/com/zsw/erp/service/materialCategory/MaterialCategoryService.java @@ -10,12 +10,12 @@ import com.zsw.erp.datasource.vo.TreeNode; import com.zsw.erp.exception.BusinessRunTimeException; import com.zsw.erp.exception.BoomException; import com.zsw.erp.service.log.LogService; -import com.zsw.erp.service.user.UserService; +import cn.iocoder.yudao.framework.security.core.LoginUser; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import com.zsw.erp.utils.StringUtil; import com.zsw.erp.datasource.entities.Material; import com.zsw.erp.datasource.entities.MaterialCategory; import com.zsw.erp.datasource.entities.MaterialCategoryExample; -import com.zsw.erp.datasource.entities.User; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; @@ -37,8 +37,7 @@ public class MaterialCategoryService { private MaterialCategoryMapper materialCategoryMapper; @Resource private MaterialCategoryMapperEx materialCategoryMapperEx; - @Resource - private UserService userService; + @Resource private LogService logService; @Resource @@ -196,7 +195,7 @@ public class MaterialCategoryService { //更新时间 Date updateDate =new Date(); //更新人 - User userInfo=userService.getCurrentUser(); + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); Long updater=userInfo==null?null:userInfo.getId(); String strArray[]=ids.split(","); if(strArray.length<1){ @@ -280,7 +279,7 @@ public class MaterialCategoryService { checkMaterialCategorySerialNo(mc); //数据状态新增时默认设置为启用 Date date=new Date(); - User userInfo=userService.getCurrentUser(); + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); //创建时间 mc.setCreateTime(date); //更新时间 @@ -308,7 +307,7 @@ public class MaterialCategoryService { //更新时间 mc.setUpdateTime(new Date()); //更新人 - User userInfo=userService.getCurrentUser(); + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); int result=0; try{ result= materialCategoryMapperEx.editMaterialCategory(mc); diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/materialExtend/MaterialExtendService.java b/zsw-erp/src/main/java/com/zsw/erp/service/materialExtend/MaterialExtendService.java index d5239bf3..5bd8eac5 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/service/materialExtend/MaterialExtendService.java +++ b/zsw-erp/src/main/java/com/zsw/erp/service/materialExtend/MaterialExtendService.java @@ -8,7 +8,7 @@ import com.zsw.erp.constants.BusinessConstants; import com.zsw.erp.constants.ExceptionConstants; import com.zsw.erp.datasource.entities.MaterialExtend; import com.zsw.erp.datasource.entities.MaterialExtendExample; -import com.zsw.erp.datasource.entities.User; + import com.zsw.erp.datasource.mappers.MaterialExtendMapper; import com.zsw.erp.datasource.mappers.MaterialExtendMapperEx; import com.zsw.erp.datasource.vo.MaterialExtendVo4List; @@ -16,7 +16,8 @@ import com.zsw.erp.exception.BusinessRunTimeException; import com.zsw.erp.exception.BoomException; import com.zsw.erp.service.log.LogService; import com.zsw.erp.service.redis.RedisService; -import com.zsw.erp.service.user.UserService; +import cn.iocoder.yudao.framework.security.core.LoginUser; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import com.zsw.erp.utils.StringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -43,8 +44,7 @@ public class MaterialExtendService { private MaterialExtendMapperEx materialExtendMapperEx; @Resource private LogService logService; - @Resource - private UserService userService; + @Resource private RedisService redisService; @@ -230,12 +230,12 @@ public class MaterialExtendService { @Transactional(value = "transactionManager", rollbackFor = Exception.class) public int insertMaterialExtend(MaterialExtend materialExtend)throws Exception { - User user = userService.getCurrentUser(); + LoginUser user = SecurityFrameworkUtils.getLoginUser(); materialExtend.setDeleteFlag(BusinessConstants.DELETE_FLAG_EXISTS); materialExtend.setCreateTime(new Date()); materialExtend.setUpdateTime(new Date().getTime()); - materialExtend.setCreateSerial(user.getLoginName()); - materialExtend.setUpdateSerial(user.getLoginName()); + materialExtend.setCreateSerial(user.getUsername()); + materialExtend.setUpdateSerial(user.getUsername()); int result =0; try{ result= materialExtendMapper.insertSelective(materialExtend); @@ -247,9 +247,9 @@ public class MaterialExtendService { @Transactional(value = "transactionManager", rollbackFor = Exception.class) public int updateMaterialExtend(MaterialExtend MaterialExtend) throws Exception{ - User user = userService.getCurrentUser(); + LoginUser user = SecurityFrameworkUtils.getLoginUser(); MaterialExtend.setUpdateTime(System.currentTimeMillis()); - MaterialExtend.setUpdateSerial(user.getLoginName()); + MaterialExtend.setUpdateSerial(user.getUsername()); int res =0; try{ res= materialExtendMapper.updateByPrimaryKeySelective(MaterialExtend); @@ -292,9 +292,9 @@ public class MaterialExtendService { materialExtend.setId(id); materialExtend.setDeleteFlag(BusinessConstants.DELETE_FLAG_DELETED); Long userId = Long.parseLong(redisService.getObjectFromSessionByKey(request,"userId").toString()); - User user = userService.getUser(userId); + LoginUser user = SecurityFrameworkUtils.getLoginUser(); materialExtend.setUpdateTime(new Date().getTime()); - materialExtend.setUpdateSerial(user.getLoginName()); + materialExtend.setUpdateSerial(user.getUsername()); try{ result= materialExtendMapper.updateByPrimaryKeySelective(materialExtend); }catch(Exception e){ diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/materialProperty/MaterialPropertyService.java b/zsw-erp/src/main/java/com/zsw/erp/service/materialProperty/MaterialPropertyService.java index 85a1dad4..3c36d23a 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/service/materialProperty/MaterialPropertyService.java +++ b/zsw-erp/src/main/java/com/zsw/erp/service/materialProperty/MaterialPropertyService.java @@ -4,12 +4,13 @@ import com.alibaba.fastjson.JSONObject; import com.zsw.erp.constants.BusinessConstants; import com.zsw.erp.datasource.entities.MaterialProperty; import com.zsw.erp.datasource.entities.MaterialPropertyExample; -import com.zsw.erp.datasource.entities.User; + import com.zsw.erp.datasource.mappers.MaterialPropertyMapper; import com.zsw.erp.datasource.mappers.MaterialPropertyMapperEx; import com.zsw.erp.exception.BoomException; import com.zsw.erp.service.log.LogService; -import com.zsw.erp.service.user.UserService; +import cn.iocoder.yudao.framework.security.core.LoginUser; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; @@ -31,8 +32,7 @@ public class MaterialPropertyService { @Resource private MaterialPropertyMapperEx materialPropertyMapperEx; - @Resource - private UserService userService; + @Resource private LogService logService; @@ -121,7 +121,7 @@ public class MaterialPropertyService { logService.insertLog("商品属性", new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(), ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); - User userInfo=userService.getCurrentUser(); + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); String [] idArray=ids.split(","); int result=0; try{ diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/msg/MsgService.java b/zsw-erp/src/main/java/com/zsw/erp/service/msg/MsgService.java index 94355c9c..bf0d5e87 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/service/msg/MsgService.java +++ b/zsw-erp/src/main/java/com/zsw/erp/service/msg/MsgService.java @@ -6,13 +6,14 @@ import com.zsw.erp.constants.ExceptionConstants; import com.zsw.erp.datasource.entities.Msg; import com.zsw.erp.datasource.entities.MsgEx; import com.zsw.erp.datasource.entities.MsgExample; -import com.zsw.erp.datasource.entities.User; + import com.zsw.erp.datasource.mappers.MsgMapper; import com.zsw.erp.datasource.mappers.MsgMapperEx; import com.zsw.erp.exception.BusinessRunTimeException; import com.zsw.erp.service.depotHead.DepotHeadService; import com.zsw.erp.service.log.LogService; -import com.zsw.erp.service.user.UserService; +import cn.iocoder.yudao.framework.security.core.LoginUser; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import com.zsw.erp.utils.StringUtil; import com.zsw.erp.utils.Tools; import org.slf4j.Logger; @@ -42,8 +43,7 @@ public class MsgService { @Resource private DepotHeadService depotHeadService; - @Resource - private UserService userService; + @Resource private LogService logService; @@ -79,8 +79,8 @@ public class MsgService { public List select(String name, int offset, int rows)throws Exception { List list=null; try{ - User userInfo = userService.getCurrentUser(); - if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); + if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getUsername())) { list = msgMapperEx.selectByConditionMsg(name, offset, rows); if (null != list) { for (MsgEx msgEx : list) { @@ -102,8 +102,8 @@ public class MsgService { public Long countMsg(String name)throws Exception { Long result=null; try{ - User userInfo = userService.getCurrentUser(); - if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); + if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getUsername())) { result = msgMapperEx.countsByMsg(name); } }catch(Exception e){ @@ -120,8 +120,8 @@ public class MsgService { Msg msg = JSONObject.parseObject(obj.toJSONString(), Msg.class); int result=0; try{ - User userInfo = userService.getCurrentUser(); - if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); + if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getUsername())) { msg.setCreateTime(new Date()); msg.setStatus("1"); result=msgMapper.insertSelective(msg); @@ -231,8 +231,8 @@ public class MsgService { public List getMsgByStatus(String status)throws Exception { List resList=new ArrayList<>(); try{ - User userInfo = userService.getCurrentUser(); - if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); + if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getUsername())) { MsgExample example = new MsgExample(); example.createCriteria().andStatusEqualTo(status).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); List list = msgMapper.selectByExample(example); @@ -280,8 +280,8 @@ public class MsgService { public Long getMsgCountByStatus(String status)throws Exception { Long result=null; try{ - User userInfo=userService.getCurrentUser(); - if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); + if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getUsername())) { result = msgMapperEx.getMsgCountByStatus(status, userInfo.getId()); } }catch(Exception e){ @@ -296,8 +296,8 @@ public class MsgService { public Integer getMsgCountByType(String type)throws Exception { int msgCount = 0; try{ - User userInfo = userService.getCurrentUser(); - if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); + if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getUsername())) { MsgExample example = new MsgExample(); example.createCriteria().andTypeEqualTo(type).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); List list = msgMapper.selectByExample(example); @@ -315,8 +315,8 @@ public class MsgService { @Transactional(value = "transactionManager", rollbackFor = Exception.class) public void readAllMsg() throws Exception{ try{ - User userInfo = userService.getCurrentUser(); - if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); + if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getUsername())) { Msg msg = new Msg(); msg.setStatus("2"); MsgExample example = new MsgExample(); diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/orgaUserRel/OrgaUserRelService.java b/zsw-erp/src/main/java/com/zsw/erp/service/orgaUserRel/OrgaUserRelService.java index cfa4d3ff..4366111f 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/service/orgaUserRel/OrgaUserRelService.java +++ b/zsw-erp/src/main/java/com/zsw/erp/service/orgaUserRel/OrgaUserRelService.java @@ -4,13 +4,14 @@ import com.alibaba.fastjson.JSONObject; import com.zsw.erp.constants.BusinessConstants; import com.zsw.erp.datasource.entities.OrgaUserRel; import com.zsw.erp.datasource.entities.OrgaUserRelExample; -import com.zsw.erp.datasource.entities.User; + import com.zsw.erp.datasource.mappers.OrgaUserRelMapper; import com.zsw.erp.datasource.mappers.OrgaUserRelMapperEx; import com.zsw.erp.exception.BoomException; import com.zsw.erp.service.log.LogService; import com.zsw.erp.service.organization.OrganizationService; -import com.zsw.erp.service.user.UserService; +import cn.iocoder.yudao.framework.security.core.LoginUser; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import com.zsw.erp.utils.StringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -37,8 +38,7 @@ public class OrgaUserRelService { private OrgaUserRelMapper orgaUserRelMapper; @Resource private OrgaUserRelMapperEx orgaUserRelMapperEx; - @Resource - private UserService userService; + @Resource private OrganizationService organizationService; @Resource @@ -110,7 +110,7 @@ public class OrgaUserRelService { @Transactional(value = "transactionManager", rollbackFor = Exception.class) public OrgaUserRel addOrgaUserRel(OrgaUserRel orgaUserRel) throws Exception{ Date date = new Date(); - User userInfo=userService.getCurrentUser(); + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); //创建时间 if(orgaUserRel.getCreateTime()==null){ orgaUserRel.setCreateTime(date); @@ -149,7 +149,7 @@ public class OrgaUserRelService { */ @Transactional(value = "transactionManager", rollbackFor = Exception.class) public OrgaUserRel updateOrgaUserRel(OrgaUserRel orgaUserRel) throws Exception{ - User userInfo=userService.getCurrentUser(); + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); //更新时间 if(orgaUserRel.getUpdateTime()==null){ orgaUserRel.setUpdateTime(new Date()); diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/organization/OrganizationService.java b/zsw-erp/src/main/java/com/zsw/erp/service/organization/OrganizationService.java index d56a423c..38bf9373 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/service/organization/OrganizationService.java +++ b/zsw-erp/src/main/java/com/zsw/erp/service/organization/OrganizationService.java @@ -5,14 +5,15 @@ import com.zsw.erp.constants.BusinessConstants; import com.zsw.erp.constants.ExceptionConstants; import com.zsw.erp.datasource.entities.Organization; import com.zsw.erp.datasource.entities.OrganizationExample; -import com.zsw.erp.datasource.entities.User; + import com.zsw.erp.datasource.mappers.OrganizationMapper; import com.zsw.erp.datasource.mappers.OrganizationMapperEx; import com.zsw.erp.datasource.vo.TreeNode; import com.zsw.erp.exception.BusinessRunTimeException; import com.zsw.erp.exception.BoomException; import com.zsw.erp.service.log.LogService; -import com.zsw.erp.service.user.UserService; +import cn.iocoder.yudao.framework.security.core.LoginUser; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import com.zsw.erp.utils.StringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -41,8 +42,7 @@ public class OrganizationService { private OrganizationMapper organizationMapper; @Resource private OrganizationMapperEx organizationMapperEx; - @Resource - private UserService userService; + @Resource private LogService logService; @@ -113,7 +113,7 @@ public class OrganizationService { } logService.insertLog("机构", sb.toString(), ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); - User userInfo=userService.getCurrentUser(); + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); String [] idArray=ids.split(","); int result=0; List organList = organizationMapperEx.getOrganizationByParentIds(idArray); @@ -149,7 +149,7 @@ public class OrganizationService { ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); //新增时间 Date date=new Date(); - User userInfo=userService.getCurrentUser(); + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); org.setCreateTime(date); //修改时间 org.setUpdateTime(date); @@ -180,7 +180,7 @@ public class OrganizationService { ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); //修改时间 org.setUpdateTime(new Date()); - User userInfo=userService.getCurrentUser(); + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); /** * 修改的时候检测机构编号是否已存在 * */ diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/person/PersonService.java b/zsw-erp/src/main/java/com/zsw/erp/service/person/PersonService.java index 03817511..ada4db8d 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/service/person/PersonService.java +++ b/zsw-erp/src/main/java/com/zsw/erp/service/person/PersonService.java @@ -10,7 +10,8 @@ import com.zsw.erp.datasource.mappers.PersonMapperEx; import com.zsw.erp.exception.BusinessRunTimeException; import com.zsw.erp.exception.BoomException; import com.zsw.erp.service.log.LogService; -import com.zsw.erp.service.user.UserService; +import cn.iocoder.yudao.framework.security.core.LoginUser; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import com.zsw.erp.utils.StringUtil; import com.zsw.erp.datasource.entities.AccountHead; import com.zsw.erp.datasource.entities.DepotHead; @@ -36,8 +37,7 @@ public class PersonService { @Resource private PersonMapperEx personMapperEx; - @Resource - private UserService userService; + @Resource private LogService logService; @Resource diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/role/RoleComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/role/RoleComponent.java deleted file mode 100644 index 6ba0a490..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/service/role/RoleComponent.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.zsw.erp.service.role; - -import com.alibaba.fastjson.JSONObject; -import com.zsw.erp.service.ICommonQuery; -import com.zsw.erp.utils.Constants; -import com.zsw.erp.utils.QueryUtils; -import com.zsw.erp.utils.StringUtil; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; -import java.util.Map; - -@Service(value = "role_component") -@RoleResource -public class RoleComponent implements ICommonQuery { - - @Resource - private RoleService roleService; - - @Override - public Object selectOne(Long id) throws Exception { - return roleService.getRole(id); - } - - @Override - public List select(Map map)throws Exception { - return getRoleList(map); - } - - private List getRoleList(Map map) throws Exception{ - String search = map.get(Constants.SEARCH); - String name = StringUtil.getInfo(search, "name"); - return roleService.select(name, QueryUtils.offset(map), QueryUtils.rows(map)); - } - - @Override - public Long counts(Map map) throws Exception{ - String search = map.get(Constants.SEARCH); - String name = StringUtil.getInfo(search, "name"); - return roleService.countRole(name); - } - - @Override - public int insert(JSONObject obj, HttpServletRequest request)throws Exception { - return roleService.insertRole(obj, request); - } - - @Override - public int update(JSONObject obj, HttpServletRequest request)throws Exception { - return roleService.updateRole(obj, request); - } - - @Override - public int delete(Long id, HttpServletRequest request)throws Exception { - return roleService.deleteRole(id, request); - } - - @Override - public int deleteBatch(String ids, HttpServletRequest request)throws Exception { - return roleService.batchDeleteRole(ids, request); - } - - @Override - public int checkIsNameExist(Long id, String name)throws Exception { - return roleService.checkIsNameExist(id, name); - } - -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/role/RoleResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/role/RoleResource.java deleted file mode 100644 index 3fb6ef82..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/service/role/RoleResource.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.zsw.erp.service.role; - -import com.zsw.erp.service.ResourceInfo; - -import java.lang.annotation.*; - - -@ResourceInfo(value = "role") -@Inherited -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -public @interface RoleResource { -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/role/RoleService.java b/zsw-erp/src/main/java/com/zsw/erp/service/role/RoleService.java deleted file mode 100644 index c1606edb..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/service/role/RoleService.java +++ /dev/null @@ -1,184 +0,0 @@ -package com.zsw.erp.service.role; - -import com.alibaba.fastjson.JSONObject; -import com.zsw.erp.constants.BusinessConstants; -import com.zsw.erp.datasource.entities.Role; -import com.zsw.erp.datasource.entities.RoleExample; -import com.zsw.erp.datasource.entities.User; -import com.zsw.erp.datasource.mappers.RoleMapper; -import com.zsw.erp.datasource.mappers.RoleMapperEx; -import com.zsw.erp.exception.BoomException; -import com.zsw.erp.service.log.LogService; -import com.zsw.erp.service.user.UserService; -import com.zsw.erp.utils.StringUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -@Service -public class RoleService { - private Logger logger = LoggerFactory.getLogger(RoleService.class); - @Resource - private RoleMapper roleMapper; - - @Resource - private RoleMapperEx roleMapperEx; - @Resource - private LogService logService; - @Resource - private UserService userService; - - public Role getRole(long id)throws Exception { - Role result=null; - try{ - result=roleMapper.selectByPrimaryKey(id); - }catch(Exception e){ - BoomException.readFail(e); - } - return result; - } - - public List getRoleListByIds(String ids)throws Exception { - List idList = StringUtil.strToLongList(ids); - List list = new ArrayList<>(); - try{ - RoleExample example = new RoleExample(); - example.createCriteria().andIdIn(idList); - list = roleMapper.selectByExample(example); - }catch(Exception e){ - BoomException.readFail(e); - } - return list; - } - - public List allList()throws Exception { - RoleExample example = new RoleExample(); - example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); - List list=null; - try{ - list=roleMapper.selectByExample(example); - }catch(Exception e){ - BoomException.readFail(e); - } - return list; - } - - public List select(String name, int offset, int rows)throws Exception { - List list=null; - try{ - list=roleMapperEx.selectByConditionRole(name, offset, rows); - }catch(Exception e){ - BoomException.readFail(e); - } - return list; - } - - public Long countRole(String name)throws Exception { - Long result=null; - try{ - result=roleMapperEx.countsByRole(name); - }catch(Exception e){ - BoomException.readFail(e); - } - return result; - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int insertRole(JSONObject obj, HttpServletRequest request)throws Exception { - Role role = JSONObject.parseObject(obj.toJSONString(), Role.class); - int result=0; - try{ - result=roleMapper.insertSelective(role); - logService.insertLog("角色", - new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(role.getName()).toString(), request); - }catch(Exception e){ - BoomException.writeFail(e); - } - return result; - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int updateRole(JSONObject obj, HttpServletRequest request) throws Exception{ - Role role = JSONObject.parseObject(obj.toJSONString(), Role.class); - int result=0; - try{ - result=roleMapper.updateByPrimaryKeySelective(role); - logService.insertLog("角色", - new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(role.getName()).toString(), request); - }catch(Exception e){ - BoomException.writeFail(e); - } - return result; - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int deleteRole(Long id, HttpServletRequest request)throws Exception { - return batchDeleteRoleByIds(id.toString()); - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int batchDeleteRole(String ids, HttpServletRequest request) throws Exception{ - return batchDeleteRoleByIds(ids); - } - - public int checkIsNameExist(Long id, String name) throws Exception{ - RoleExample example = new RoleExample(); - example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); - List list =null; - try{ - list=roleMapper.selectByExample(example); - }catch(Exception e){ - BoomException.readFail(e); - } - return list==null?0:list.size(); - } - - public List findUserRole()throws Exception{ - RoleExample example = new RoleExample(); - example.setOrderByClause("Id"); - example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); - List list=null; - try{ - list=roleMapper.selectByExample(example); - }catch(Exception e){ - BoomException.readFail(e); - } - return list; - } - /** - * create by: qiankunpingtai - * 逻辑删除角色信息 - * create time: 2019/3/28 15:44 - * @Param: ids - * @return int - */ - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int batchDeleteRoleByIds(String ids) throws Exception{ - StringBuffer sb = new StringBuffer(); - sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); - List list = getRoleListByIds(ids); - for(Role role: list){ - sb.append("[").append(role.getName()).append("]"); - } - logService.insertLog("角色", sb.toString(), - ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); - User userInfo=userService.getCurrentUser(); - String [] idArray=ids.split(","); - int result=0; - try{ - result=roleMapperEx.batchDeleteRoleByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); - }catch(Exception e){ - BoomException.writeFail(e); - } - return result; - } -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/serialNumber/SerialNumberService.java b/zsw-erp/src/main/java/com/zsw/erp/service/serialNumber/SerialNumberService.java index a07c29f5..3551bd26 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/service/serialNumber/SerialNumberService.java +++ b/zsw-erp/src/main/java/com/zsw/erp/service/serialNumber/SerialNumberService.java @@ -1,5 +1,7 @@ package com.zsw.erp.service.serialNumber; +import cn.iocoder.yudao.framework.security.core.LoginUser; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import com.alibaba.fastjson.JSONObject; import com.zsw.erp.constants.BusinessConstants; import com.zsw.erp.constants.ExceptionConstants; @@ -7,7 +9,6 @@ import com.zsw.erp.exception.BusinessRunTimeException; import com.zsw.erp.exception.BoomException; import com.zsw.erp.service.log.LogService; import com.zsw.erp.service.material.MaterialService; -import com.zsw.erp.service.user.UserService; import com.zsw.erp.utils.StringUtil; import com.zsw.erp.datasource.entities.*; import com.zsw.erp.datasource.mappers.MaterialMapper; @@ -48,8 +49,6 @@ public class SerialNumberService { @Resource private MaterialService materialService; @Resource - private UserService userService; - @Resource private LogService logService; @@ -110,7 +109,7 @@ public class SerialNumberService { Date date=new Date(); serialNumberEx.setCreateTime(date); serialNumberEx.setUpdateTime(date); - User userInfo=userService.getCurrentUser(); + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); serialNumberEx.setCreator(userInfo==null?null:userInfo.getId()); serialNumberEx.setUpdater(userInfo==null?null:userInfo.getId()); result = serialNumberMapperEx.addSerialNumber(serialNumberEx); @@ -130,7 +129,7 @@ public class SerialNumberService { serialNumberEx.setMaterialId(getSerialNumberMaterialIdByBarCode(serialNumberEx.getMaterialCode())); Date date=new Date(); serialNumberEx.setUpdateTime(date); - User userInfo=userService.getCurrentUser(); + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); serialNumberEx.setUpdater(userInfo==null?null:userInfo.getId()); result = serialNumberMapperEx.updateSerialNumber(serialNumberEx); logService.insertLog("序列号", @@ -169,7 +168,7 @@ public class SerialNumberService { } logService.insertLog("序列号", sb.toString(), ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); - User userInfo=userService.getCurrentUser(); + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); String [] idArray=ids.split(","); int result=0; try{ @@ -265,7 +264,7 @@ public class SerialNumberService { * @Param: List * @return void */ - public void checkAndUpdateSerialNumber(DepotItem depotItem, String outBillNo,User userInfo, String snList) throws Exception{ + public void checkAndUpdateSerialNumber(DepotItem depotItem, String outBillNo,LoginUser userInfo, String snList) throws Exception{ if(depotItem!=null){ sellSerialNumber(depotItem.getMaterialId(), outBillNo, snList,userInfo); } @@ -285,7 +284,7 @@ public class SerialNumberService { * @Param: Count 卖出或者赎回的数量 */ @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int sellSerialNumber(Long materialId, String outBillNo, String snList, User user) throws Exception{ + public int sellSerialNumber(Long materialId, String outBillNo, String snList, LoginUser user) throws Exception{ int result=0; try{ String [] snArray=snList.split(","); @@ -308,7 +307,7 @@ public class SerialNumberService { * @return com.jsh.erp.datasource.entities.SerialNumberEx */ @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int cancelSerialNumber(Long materialId, String outBillNo,int count,User user) throws Exception{ + public int cancelSerialNumber(Long materialId, String outBillNo, int count, LoginUser user) throws Exception{ int result=0; try{ result = serialNumberMapperEx.cancelSerialNumber(materialId,outBillNo,count,new Date(),user==null?null:user.getId()); @@ -338,7 +337,7 @@ public class SerialNumberService { Long materialId = getSerialNumberMaterialIdByBarCode(materialCode); List list = null; //当前用户 - User userInfo = userService.getCurrentUser(); + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); Long userId = userInfo == null ? null : userInfo.getId(); Date date = null; Long million = null; @@ -412,7 +411,7 @@ public class SerialNumberService { Date date = new Date(); serialNumber.setCreateTime(date); serialNumber.setUpdateTime(date); - User userInfo = userService.getCurrentUser(); + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); serialNumber.setCreator(userInfo == null ? null : userInfo.getId()); serialNumber.setUpdater(userInfo == null ? null : userInfo.getId()); serialNumber.setInBillNo(inBillNo); diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/supplier/SupplierService.java b/zsw-erp/src/main/java/com/zsw/erp/service/supplier/SupplierService.java index 6e5d6fde..8e848d74 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/service/supplier/SupplierService.java +++ b/zsw-erp/src/main/java/com/zsw/erp/service/supplier/SupplierService.java @@ -14,8 +14,8 @@ import com.zsw.erp.service.accountHead.AccountHeadService; import com.zsw.erp.service.depotHead.DepotHeadService; import com.zsw.erp.service.log.LogService; import com.zsw.erp.service.systemConfig.SystemConfigService; -import com.zsw.erp.service.user.UserService; -import com.zsw.erp.service.userBusiness.UserBusinessService; +import cn.iocoder.yudao.framework.security.core.LoginUser; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import com.zsw.base.R; import com.zsw.erp.utils.ExcelUtils; import com.zsw.erp.utils.StringUtil; @@ -50,8 +50,7 @@ public class SupplierService { private SupplierMapperEx supplierMapperEx; @Resource private LogService logService; - @Resource - private UserService userService; + @Resource private AccountHeadMapperEx accountHeadMapperEx; @Resource @@ -64,8 +63,6 @@ public class SupplierService { private AccountHeadService accountHeadService; @Resource private SystemConfigService systemConfigService; - @Resource - private UserBusinessService userBusinessService; public Supplier getSupplier(long id)throws Exception { Supplier result=null; @@ -154,23 +151,6 @@ public class SupplierService { supplier.setEnabled(true); result=supplierMapper.insertSelective(supplier); //新增客户时给当前用户自动授权 - if("客户".equals(supplier.getType())) { - Long userId = userService.getUserId(request); - Supplier sInfo = supplierMapperEx.getSupplierByNameAndType(supplier.getSupplier(), supplier.getType()); - UserBusiness ubInfo = userBusinessService.getBasicData(userId, "UserCustomer"); - if(ubInfo ==null ) { - ubInfo = new UserBusiness(); - ubInfo.setType("UserCustomer"); - ubInfo.setKeyId(userId.toString()); - ArrayList l = Lists.newArrayList(); - l.add(sInfo.getId()); - ubInfo.setValue(l); - userBusinessService.insertUserBusiness(ubInfo, request); - } else { - ubInfo.getValue().add(sInfo.getId()); - userBusinessService.updateUserBusiness(ubInfo, request); - } - } logService.insertLog("商家", new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(supplier.getSupplier()).toString(),request); }catch(Exception e){ @@ -248,7 +228,7 @@ public class SupplierService { } logService.insertLog("商家", sb.toString(), ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); - User userInfo=userService.getCurrentUser(); + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); //校验通过执行删除操作 try{ result = supplierMapperEx.batchDeleteSupplierByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/systemConfig/SystemConfigService.java b/zsw-erp/src/main/java/com/zsw/erp/service/systemConfig/SystemConfigService.java index fb39cac3..4d3f5700 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/service/systemConfig/SystemConfigService.java +++ b/zsw-erp/src/main/java/com/zsw/erp/service/systemConfig/SystemConfigService.java @@ -1,17 +1,17 @@ package com.zsw.erp.service.systemConfig; import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.annotation.InterceptorIgnore; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.zsw.erp.constants.BusinessConstants; import com.zsw.erp.datasource.entities.SystemConfig; -import com.zsw.erp.datasource.entities.User; -import com.zsw.erp.datasource.mappers.SystemConfigMapper; + +import com.zsw.erp.datasource.mappers.ErpSystemConfigMapper; import com.zsw.erp.datasource.mappers.SystemConfigMapperEx; import com.zsw.erp.exception.BoomException; import com.zsw.erp.service.log.LogService; -import com.zsw.erp.service.user.UserService; +import cn.iocoder.yudao.framework.security.core.LoginUser; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; @@ -30,25 +30,24 @@ public class SystemConfigService { private Logger logger = LoggerFactory.getLogger(SystemConfigService.class); @Resource - private SystemConfigMapper systemConfigMapper; + private ErpSystemConfigMapper erpSystemConfigMapper; @Resource private SystemConfigMapperEx systemConfigMapperEx; - @Resource - private UserService userService; + @Resource private LogService logService; public SystemConfig getSystemConfig(long id){ - return systemConfigMapper.selectById(id); + return erpSystemConfigMapper.selectById(id); } public SystemConfig getSystemConfigByTenentId(Long tenantId){ - return systemConfigMapper.selectByTenantId(tenantId); + return erpSystemConfigMapper.selectByTenantId(tenantId); } public List getSystemConfig(){ - return systemConfigMapper.selectList(Wrappers.emptyWrapper()); + return erpSystemConfigMapper.selectList(Wrappers.emptyWrapper()); } public List select(String companyName, int offset, int rows)throws Exception { List list=null; @@ -75,13 +74,10 @@ public class SystemConfigService { SystemConfig systemConfig = JSONObject.parseObject(obj.toJSONString(), SystemConfig.class); int result=0; try{ - if(userService.checkIsTestUser()) { - result=-1; - } else { - result=systemConfigMapper.insert(systemConfig); - logService.insertLog("系统配置", - new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(systemConfig.getCompanyName()).toString(), request); - } + // 测试用户返回-1 + result= erpSystemConfigMapper.insert(systemConfig); + logService.insertLog("系统配置", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(systemConfig.getCompanyName()).toString(), request); }catch(Exception e){ BoomException.writeFail(e); } @@ -93,13 +89,9 @@ public class SystemConfigService { SystemConfig systemConfig = JSONObject.parseObject(obj.toJSONString(), SystemConfig.class); int result=0; try{ - if(userService.checkIsTestUser()) { - result=-1; - } else { - result = systemConfigMapper.updateByPrimaryKeySelective(systemConfig); - logService.insertLog("系统配置", - new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(systemConfig.getCompanyName()).toString(), request); - } + result = erpSystemConfigMapper.updateByPrimaryKeySelective(systemConfig); + logService.insertLog("系统配置", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(systemConfig.getCompanyName()).toString(), request); }catch(Exception e){ BoomException.writeFail(e); } @@ -121,15 +113,11 @@ public class SystemConfigService { logService.insertLog("系统配置", new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(), ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); - User userInfo=userService.getCurrentUser(); + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); String [] idArray=ids.split(","); int result=0; try{ - if(userService.checkIsTestUser()) { - result=-1; - } else { - result = systemConfigMapperEx.batchDeleteSystemConfigByIds(new Date(), userInfo == null ? null : userInfo.getId(), idArray); - } + result = systemConfigMapperEx.batchDeleteSystemConfigByIds(new Date(), userInfo == null ? null : userInfo.getId(), idArray); }catch(Exception e){ BoomException.writeFail(e); } @@ -141,7 +129,7 @@ public class SystemConfigService { .eq(SystemConfig::getCompanyName, name) .ne(SystemConfig::getId, id) .eq(SystemConfig::getDepotFlag, BusinessConstants.DELETE_FLAG_EXISTS); - return systemConfigMapper.selectCount(wrappers); + return erpSystemConfigMapper.selectCount(wrappers); } /** diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/tenant/TenantComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/tenant/TenantComponent.java deleted file mode 100644 index 5ef44c63..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/service/tenant/TenantComponent.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.zsw.erp.service.tenant; - -import cn.hutool.json.JSONUtil; -import com.alibaba.fastjson.JSONObject; -import com.zsw.erp.datasource.entities.Tenant; -import com.zsw.erp.service.ICommonQuery; -import com.zsw.erp.utils.Constants; -import com.zsw.erp.utils.QueryUtils; -import com.zsw.erp.utils.StringUtil; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; -import java.util.Map; - -@Service(value = "tenant_component") -@TenantResource -public class TenantComponent implements ICommonQuery { - - @Resource - private TenantService tenantService; - - @Override - public Object selectOne(Long id) throws Exception { - return tenantService.getTenant(id); - } - - @Override - public List select(Map map)throws Exception { - return getTenantList(map); - } - - private List getTenantList(Map map)throws Exception { - String search = map.get(Constants.SEARCH); - String loginName = StringUtil.getInfo(search, "loginName"); - String type = StringUtil.getInfo(search, "type"); - String enabled = StringUtil.getInfo(search, "enabled"); - return tenantService.select(loginName, type, enabled, QueryUtils.offset(map), QueryUtils.rows(map)); - } - - @Override - public Long counts(Map map)throws Exception { - String search = map.get(Constants.SEARCH); - String loginName = StringUtil.getInfo(search, "loginName"); - String type = StringUtil.getInfo(search, "type"); - String enabled = StringUtil.getInfo(search, "enabled"); - return tenantService.countTenant(loginName, type, enabled); - } - - @Override - public int insert(JSONObject obj, HttpServletRequest request)throws Exception { - Tenant tenant = JSONUtil.toBean(obj.toJSONString(), Tenant.class); - return tenantService.insertTenant(tenant, request); - } - - @Override - public int update(JSONObject obj, HttpServletRequest request)throws Exception { - Tenant tenant = JSONUtil.toBean(obj.toJSONString(), Tenant.class); - return tenantService.updateTenant(tenant, request); - } - - @Override - public int delete(Long id, HttpServletRequest request)throws Exception { - return tenantService.deleteTenant(id, request); - } - - @Override - public int deleteBatch(String ids, HttpServletRequest request)throws Exception { - return tenantService.batchDeleteTenant(ids, request); - } - - @Override - public int checkIsNameExist(Long id, String name)throws Exception { - return tenantService.checkIsNameExist(id, name); - } - -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/tenant/TenantResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/tenant/TenantResource.java deleted file mode 100644 index 02b58363..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/service/tenant/TenantResource.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.zsw.erp.service.tenant; - -import com.zsw.erp.service.ResourceInfo; - -import java.lang.annotation.*; - - -@ResourceInfo(value = "tenant") -@Inherited -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -public @interface TenantResource { -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/tenant/TenantService.java b/zsw-erp/src/main/java/com/zsw/erp/service/tenant/TenantService.java deleted file mode 100644 index afd0d284..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/service/tenant/TenantService.java +++ /dev/null @@ -1,182 +0,0 @@ -package com.zsw.erp.service.tenant; - -import com.alibaba.fastjson.JSONObject; -import com.zsw.erp.constants.BusinessConstants; -import com.zsw.erp.datasource.mappers.TenantMapper; -import com.zsw.erp.datasource.mappers.TenantMapperEx; -import com.zsw.erp.exception.BoomException; -import com.zsw.erp.service.log.LogService; -import com.zsw.erp.utils.StringUtil; -import com.zsw.erp.utils.Tools; -import com.zsw.erp.datasource.entities.Tenant; -import com.zsw.erp.datasource.entities.TenantEx; -import com.zsw.erp.datasource.entities.TenantExample; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Lazy; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.*; - -@Service -public class TenantService { - private Logger logger = LoggerFactory.getLogger(TenantService.class); - - @Resource - private TenantMapper tenantMapper; - - @Resource - private TenantMapperEx tenantMapperEx; - - @Resource - @Lazy - private LogService logService; - - @Value("${tenant.userNumLimit}") - private Integer userNumLimit; - - @Value("${tenant.tryDayLimit}") - private Integer tryDayLimit; - - public Tenant getTenant(long id)throws Exception { - Tenant result=null; - try{ - result=tenantMapper.selectByPrimaryKey(id); - }catch(Exception e){ - BoomException.readFail(e); - } - return result; - } - - public List getTenant(){ - TenantExample example = new TenantExample(); - List list=null; - try{ - list=tenantMapper.selectByExample(example); - }catch(Exception e){ - BoomException.readFail(e); - } - return list; - } - - public List select(String loginName, String type, String enabled, int offset, int rows)throws Exception { - List list= new ArrayList<>(); - try{ - list = tenantMapperEx.selectByConditionTenant(loginName, type, enabled, offset, rows); - if (null != list) { - for (TenantEx tenantEx : list) { - tenantEx.setCreateTimeStr(Tools.getCenternTime(tenantEx.getCreateTime())); - tenantEx.setExpireTimeStr(Tools.getCenternTime(tenantEx.getExpireTime())); - } - } - }catch(Exception e){ - BoomException.readFail(e); - } - return list; - } - - public Long countTenant(String loginName, String type, String enabled)throws Exception { - Long result=null; - try{ - result=tenantMapperEx.countsByTenant(loginName, type, enabled); - }catch(Exception e){ - BoomException.readFail(e); - } - return result; - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int insertTenant(Tenant tenant, HttpServletRequest request)throws Exception { - tenant.setCreateTime(new Date()); - if(tenant.getUserNumLimit()==null) { - tenant.setUserNumLimit(userNumLimit); //默认用户限制数量 - } - if(tenant.getExpireTime()==null) { - tenant.setExpireTime(Tools.addDays(new Date(), tryDayLimit)); //租户允许试用的天数 - } - return tenantMapper.insert(tenant); - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int updateTenant(Tenant tenant, HttpServletRequest request)throws Exception { - return tenantMapper.updateById(tenant); - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int deleteTenant(Long id, HttpServletRequest request)throws Exception { - int result=0; - try{ - result= tenantMapper.deleteByPrimaryKey(id); - }catch(Exception e){ - BoomException.writeFail(e); - } - return result; - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int batchDeleteTenant(String ids, HttpServletRequest request)throws Exception { - List idList = StringUtil.strToLongList(ids); - TenantExample example = new TenantExample(); - example.createCriteria().andIdIn(idList); - int result=0; - try{ - result= tenantMapper.deleteByExample(example); - }catch(Exception e){ - BoomException.writeFail(e); - } - return result; - } - - public int checkIsNameExist(Long id, String name)throws Exception { - TenantExample example = new TenantExample(); - example.createCriteria().andIdNotEqualTo(id).andLoginNameEqualTo(name); - List list=null; - try{ - list= tenantMapper.selectByExample(example); - }catch(Exception e){ - BoomException.readFail(e); - } - return list==null?0:list.size(); - } - - public Tenant getTenantByTenantId(long tenantId) { - Tenant tenant = new Tenant(); - TenantExample example = new TenantExample(); - example.createCriteria().andTenantIdEqualTo(tenantId); - List list = tenantMapper.selectByExample(example); - if(list.size()>0) { - tenant = list.get(0); - } - return tenant; - } - - public int batchSetStatus(Boolean status, String ids)throws Exception { - int result=0; - try{ - String statusStr =""; - if(status) { - statusStr ="批量启用"; - } else { - statusStr ="批量禁用"; - } - logService.insertLog("用户", - new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(ids).append("-").append(statusStr).toString(), - ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); - List idList = StringUtil.strToLongList(ids); - Tenant tenant = new Tenant(); - tenant.setEnabled(status); - TenantExample example = new TenantExample(); - example.createCriteria().andIdIn(idList); - result = tenantMapper.updateByExampleSelective(tenant, example); - }catch(Exception e){ - BoomException.writeFail(e); - } - return result; - } -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/unit/UnitService.java b/zsw-erp/src/main/java/com/zsw/erp/service/unit/UnitService.java index 8f4507f7..507004ba 100644 --- a/zsw-erp/src/main/java/com/zsw/erp/service/unit/UnitService.java +++ b/zsw-erp/src/main/java/com/zsw/erp/service/unit/UnitService.java @@ -9,12 +9,13 @@ import com.zsw.erp.datasource.mappers.UnitMapperEx; import com.zsw.erp.exception.BusinessRunTimeException; import com.zsw.erp.exception.BoomException; import com.zsw.erp.service.log.LogService; -import com.zsw.erp.service.user.UserService; +import cn.iocoder.yudao.framework.security.core.LoginUser; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import com.zsw.erp.utils.StringUtil; import com.zsw.erp.datasource.entities.Material; import com.zsw.erp.datasource.entities.Unit; import com.zsw.erp.datasource.entities.UnitExample; -import com.zsw.erp.datasource.entities.User; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; @@ -38,8 +39,7 @@ public class UnitService { @Resource private UnitMapperEx unitMapperEx; - @Resource - private UserService userService; + @Resource private LogService logService; @Resource @@ -189,7 +189,7 @@ public class UnitService { } logService.insertLog("计量单位", sb.toString(), ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); - User userInfo = userService.getCurrentUser(); + LoginUser userInfo = SecurityFrameworkUtils.getLoginUser(); //校验通过执行删除操作 try { result = unitMapperEx.batchDeleteUnitByIds(new Date(), userInfo == null ? null : userInfo.getId(), idArray); diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/user/UserComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/user/UserComponent.java deleted file mode 100644 index aeaa3994..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/service/user/UserComponent.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.zsw.erp.service.user; - -import com.alibaba.fastjson.JSONObject; -import com.zsw.erp.service.ICommonQuery; -import com.zsw.erp.utils.Constants; -import com.zsw.erp.utils.QueryUtils; -import com.zsw.erp.utils.StringUtil; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.*; - -@Service(value = "user_component") -@UserResource -public class UserComponent implements ICommonQuery { - - @Resource - private UserService userService; - - @Override - public Object selectOne(Long id) throws Exception { - return userService.getUser(id); - } - - @Override - public List select(Map map)throws Exception { - return getUserList(map); - } - - private List getUserList(Map map)throws Exception { - String search = map.get(Constants.SEARCH); - String userName = StringUtil.getInfo(search, "userName"); - String loginName = StringUtil.getInfo(search, "loginName"); - String order = QueryUtils.order(map); - String filter = QueryUtils.filter(map); - return userService.select(userName, loginName, QueryUtils.offset(map), QueryUtils.rows(map)); - } - - @Override - public Long counts(Map map)throws Exception { - String search = map.get(Constants.SEARCH); - String userName = StringUtil.getInfo(search, "userName"); - String loginName = StringUtil.getInfo(search, "loginName"); - return userService.countUser(userName, loginName); - } - - @Override - public int insert(JSONObject obj, HttpServletRequest request)throws Exception { - return userService.insertUser(obj, request); - } - - @Override - public int update(JSONObject obj, HttpServletRequest request)throws Exception { - return userService.updateUser(obj, request); - } - - @Override - public int delete(Long id, HttpServletRequest request)throws Exception { - return userService.deleteUser(id, request); - } - - @Override - public int deleteBatch(String ids, HttpServletRequest request)throws Exception { - return userService.batchDeleteUser(ids, request); - } - - @Override - public int checkIsNameExist(Long id, String name)throws Exception { - return userService.checkIsNameExist(id, name); - } - -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/user/UserResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/user/UserResource.java deleted file mode 100644 index 02fabb74..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/service/user/UserResource.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.zsw.erp.service.user; - -import com.zsw.erp.service.ResourceInfo; - -import java.lang.annotation.*; - - -@ResourceInfo(value = "user") -@Inherited -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -public @interface UserResource { -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/user/UserService.java b/zsw-erp/src/main/java/com/zsw/erp/service/user/UserService.java deleted file mode 100644 index 0f7b0b3e..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/service/user/UserService.java +++ /dev/null @@ -1,815 +0,0 @@ -package com.zsw.erp.service.user; - -import cn.hutool.core.date.DatePattern; -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.crypto.SecureUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.google.common.collect.Lists; -import com.zsw.erp.datasource.entities.BtnDto; -import com.zsw.erp.datasource.dto.UserLoginDto; -import com.zsw.erp.service.redis.RedisService; -import com.zsw.erp.service.role.RoleService; -import com.zsw.erp.constants.BusinessConstants; -import com.zsw.erp.constants.ExceptionConstants; -import com.zsw.erp.datasource.entities.*; -import com.zsw.erp.datasource.mappers.UserMapper; -import com.zsw.erp.datasource.mappers.UserMapperEx; -import com.zsw.erp.datasource.vo.TreeNodeEx; -import com.zsw.erp.exception.BusinessRunTimeException; -import com.zsw.erp.exception.BoomException; -import com.zsw.erp.service.orgaUserRel.OrgaUserRelService; -import com.zsw.erp.service.userBusiness.UserBusinessService; -import com.zsw.erp.utils.LocalUser; -import org.springframework.context.annotation.Lazy; -import org.springframework.util.StringUtils; -import com.alibaba.fastjson.JSONObject; -import com.zsw.erp.service.log.LogService; -import com.zsw.erp.service.tenant.TenantService; -import com.zsw.erp.utils.ExceptionCodeConstants; -import com.zsw.erp.utils.StringUtil; -import com.zsw.erp.utils.Tools; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.security.NoSuchAlgorithmException; -import java.util.ArrayList; -import java.util.List; - -@Service -public class UserService { - private Logger logger = LoggerFactory.getLogger(UserService.class); - - private static final String TEST_USER = "jsh"; - - @Value("${demonstrate.open}") - private boolean demonstrateOpen; - - @Resource - private UserMapper userMapper; - - @Resource - private UserMapperEx userMapperEx; - @Resource - @Lazy - private OrgaUserRelService orgaUserRelService; - @Resource - @Lazy - private LogService logService; - @Resource - private TenantService tenantService; - @Resource - private UserBusinessService userBusinessService; - @Resource - @Lazy - private RoleService roleService; - @Resource - private RedisService redisService; - - public User getUser(long id) { - User result=null; - result=userMapper.selectByPrimaryKey(id); - return result; - } - - public List getUserListByIds(String ids)throws Exception { - List idList = StringUtil.strToLongList(ids); - List list = new ArrayList<>(); - try{ - UserExample example = new UserExample(); - example.createCriteria().andIdIn(idList); - list = userMapper.selectByExample(example); - }catch(Exception e){ - BoomException.readFail(e); - } - return list; - } - - public List getUser()throws Exception { - UserExample example = new UserExample(); - example.createCriteria().andStatusEqualTo(BusinessConstants.USER_STATUS_NORMAL); - List list=null; - try{ - list=userMapper.selectByExample(example); - }catch(Exception e){ - BoomException.readFail(e); - } - return list; - } - - public List select(String userName, String loginName, int offset, int rows)throws Exception { - List list=null; - try{ - list=userMapperEx.selectByConditionUser(userName, loginName, offset, rows); - for(UserEx ue: list){ - String userType = ""; - if(demonstrateOpen && TEST_USER.equals(ue.getLoginName())){ - userType = "演示用户"; - } else { - if (ue.getId().equals(ue.getTenantId())) { - userType = "租户"; - } else if(ue.getTenantId() == null){ - userType = "超管"; - } else { - userType = "普通"; - } - } - ue.setUserType(userType); - } - }catch(Exception e){ - BoomException.readFail(e); - } - return list; - } - - public Long countUser(String userName, String loginName) { - Long result=null; - try{ - result=userMapperEx.countsByUser(userName, loginName); - }catch(Exception e){ - BoomException.readFail(e); - } - return result; - } - /** - * create by: cjl - * description: - * 添加事务控制 - * create time: 2019/1/11 14:30 - * @Param: beanJson -  * @Param: request - * @return int - */ - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int insertUser(JSONObject obj, HttpServletRequest request)throws Exception { - User user = JSONObject.parseObject(obj.toJSONString(), User.class); - String password = "123456"; - //因密码用MD5加密,需要对密码进行转化 - try { - password = Tools.md5Encryp(password); - user.setPassword(password); - } catch (NoSuchAlgorithmException e) { - e.printStackTrace(); - logger.error(">>>>>>>>>>>>>>转化MD5字符串错误 :" + e.getMessage()); - } - int result=0; - try{ - result=userMapper.insert(user); - logService.insertLog("用户", - new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(user.getLoginName()).toString(), request); - }catch(Exception e){ - BoomException.writeFail(e); - } - return result; - } - /** - * create by: cjl - * description: - * 添加事务控制 - * create time: 2019/1/11 14:31 - * @Param: beanJson -  * @Param: id - * @return int - */ - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int updateUser(JSONObject obj, HttpServletRequest request) throws Exception{ - User user = JSONObject.parseObject(obj.toJSONString(), User.class); - int result=0; - try{ - result=userMapper.updateByPrimaryKeySelective(user); - logService.insertLog("用户", - new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(user.getLoginName()).toString(), request); - }catch(Exception e){ - BoomException.writeFail(e); - } - return result; - } - /** - * create by: cjl - * description: - * 添加事务控制 - * create time: 2019/1/11 14:32 - * @Param: user - * @return int - */ - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int updateUserByObj(User user) throws Exception{ - logService.insertLog("用户", - new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(user.getId()).toString(), - ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); - int result=0; - try{ - result=userMapper.updateByPrimaryKeySelective(user); - }catch(Exception e){ - BoomException.writeFail(e); - } - return result; - } - /** - * create by: cjl - * description: - * 添加事务控制 - * create time: 2019/1/11 14:33 - * @Param: md5Pwd -  * @Param: id - * @return int - */ - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int resetPwd(String md5Pwd, Long id) throws Exception{ - int result=0; - logService.insertLog("用户", - new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), - ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); - User u = getUser(id); - String loginName = u.getLoginName(); - if("admin".equals(loginName)){ - logger.info("禁止重置超管密码"); - } else { - User user = new User(); - user.setId(id); - user.setPassword(md5Pwd); - try{ - result=userMapper.updateByPrimaryKeySelective(user); - }catch(Exception e){ - BoomException.writeFail(e); - } - } - return result; - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int deleteUser(Long id, HttpServletRequest request)throws Exception { - return batDeleteUser(id.toString()); - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int batchDeleteUser(String ids, HttpServletRequest request)throws Exception { - return batDeleteUser(ids); - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int batDeleteUser(String ids) throws Exception{ - int result=0; - StringBuffer sb = new StringBuffer(); - sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); - List list = getUserListByIds(ids); - for(User user: list){ - if(demonstrateOpen && user.getLoginName().equals(TEST_USER)){ - logger.error("异常码[{}],异常提示[{}],参数,ids:[{}]", - ExceptionConstants.USER_LIMIT_DELETE_CODE,ExceptionConstants.USER_LIMIT_DELETE_MSG,ids); - throw new BusinessRunTimeException(ExceptionConstants.USER_LIMIT_DELETE_CODE, - ExceptionConstants.USER_LIMIT_DELETE_MSG); - } - if(user.getId().equals(user.getTenantId())) { - logger.error("异常码[{}],异常提示[{}],参数,ids:[{}]", - ExceptionConstants.USER_LIMIT_TENANT_DELETE_CODE,ExceptionConstants.USER_LIMIT_TENANT_DELETE_MSG,ids); - throw new BusinessRunTimeException(ExceptionConstants.USER_LIMIT_TENANT_DELETE_CODE, - ExceptionConstants.USER_LIMIT_TENANT_DELETE_MSG); - } - sb.append("[").append(user.getLoginName()).append("]"); - } - logService.insertLog("用户", sb.toString(), - ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); - String idsArray[]=ids.split(","); - try{ - result=userMapperEx.batDeleteOrUpdateUser(idsArray,BusinessConstants.USER_STATUS_DELETE); - }catch(Exception e){ - BoomException.writeFail(e); - } - if(result<1){ - logger.error("异常码[{}],异常提示[{}],参数,ids:[{}]", - ExceptionConstants.USER_DELETE_FAILED_CODE,ExceptionConstants.USER_DELETE_FAILED_MSG,ids); - throw new BusinessRunTimeException(ExceptionConstants.USER_DELETE_FAILED_CODE, - ExceptionConstants.USER_DELETE_FAILED_MSG); - } - return result; - } - - public UserLoginDto validateUser(String loginName, String password) { - /**默认是可以登录的*/ - try { - User user = userMapper.selectOne(Wrappers.lambdaQuery().eq(User::getLoginName, loginName)); - if (user == null) { - //return UserLoginDto.builder().userStatus(ExceptionCodeConstants.UserExceptionCode.USER_NOT_EXIST).build(); - return UserLoginDto.buildStatus(ExceptionCodeConstants.UserExceptionCode.USER_NOT_EXIST); - } else { - if(user.getStatus()!=0) { - return UserLoginDto.buildStatus(ExceptionCodeConstants.UserExceptionCode.BLACK_USER); - } - Long tenantId = user.getTenantId(); - Tenant tenant = tenantService.getTenantByTenantId(tenantId); - if(tenant!=null) { - if(tenant.getEnabled()!=null && !tenant.getEnabled()) { - return UserLoginDto.buildStatus(ExceptionCodeConstants.UserExceptionCode.BLACK_TENANT); - } - if(tenant.getExpireTime()!=null && tenant.getExpireTime().getTime()>>>>>>>访问验证用户姓名是否存在后台信息异常", e); - return UserLoginDto.buildStatus(ExceptionCodeConstants.UserExceptionCode.USER_ACCESS_EXCEPTION); - } - try { - LambdaQueryWrapper wrap = Wrappers.lambdaQuery().eq(User::getLoginName, loginName) - .eq(User::getPassword, SecureUtil.md5(password)) - .eq(User::getStatus, BusinessConstants.USER_STATUS_NORMAL); - User user = userMapper.selectOne(wrap); - if (null == user) { - return UserLoginDto.buildStatus(ExceptionCodeConstants.UserExceptionCode.USER_PASSWORD_ERROR); - } - UserLoginDto dto = UserLoginDto.buildStatus(ExceptionCodeConstants.UserExceptionCode.USER_CONDITION_FIT); - dto.setUser(user); - return dto; - } catch (Exception e) { - logger.error(">>>>>>>>>>访问验证用户密码后台信息异常", e); - return UserLoginDto.buildStatus(ExceptionCodeConstants.UserExceptionCode.USER_ACCESS_EXCEPTION); - } - } - - public User getUserByLoginName(String loginName)throws Exception { - UserExample example = new UserExample(); - example.createCriteria().andLoginNameEqualTo(loginName).andStatusEqualTo(BusinessConstants.USER_STATUS_NORMAL); - List list=null; - try{ - list= userMapper.selectByExample(example); - }catch(Exception e){ - BoomException.readFail(e); - } - User user =null; - if(list!=null&&list.size()>0){ - user = list.get(0); - } - return user; - } - - public int checkIsNameExist(Long id, String name)throws Exception { - UserExample example = new UserExample(); - List userStatus=new ArrayList(); - userStatus.add(BusinessConstants.USER_STATUS_DELETE); - userStatus.add(BusinessConstants.USER_STATUS_BANNED); - example.createCriteria().andIdNotEqualTo(id).andLoginNameEqualTo(name).andStatusNotIn(userStatus); - List list=null; - try{ - list= userMapper.selectByExample(example); - }catch(Exception e){ - BoomException.readFail(e); - } - return list==null?0:list.size(); - } - /** - * create by: cjl - * description: - * 获取当前用户信息 - * create time: 2019/1/24 10:01 - * @Param: - * @return com.jsh.erp.datasource.entities.User - */ - public User getCurrentUser(){ - Long userId = LocalUser.getUserId(); - return getUser(userId); - } - - /** - * 检查当前用户是否是演示用户 - * @return - */ - public Boolean checkIsTestUser() throws Exception{ - Boolean result = false; - try { - if (demonstrateOpen) { - User user = getCurrentUser(); - if (TEST_USER.equals(user.getLoginName())) { - result = true; - } - } - } catch (Exception e) { - BoomException.readFail(e); - } - return result; - } - - /** - * 根据用户名查询id - * @param loginName - * @return - */ - public Long getIdByLoginName(String loginName) { - Long userId = 0L; - UserExample example = new UserExample(); - example.createCriteria().andLoginNameEqualTo(loginName).andStatusEqualTo(BusinessConstants.USER_STATUS_NORMAL); - List list = userMapper.selectByExample(example); - if(list!=null) { - userId = list.get(0).getId(); - } - return userId; - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public void addUserAndOrgUserRel(UserEx ue, HttpServletRequest request) throws Exception{ - if(BusinessConstants.DEFAULT_MANAGER.equals(ue.getLoginName())) { - throw new BusinessRunTimeException(ExceptionConstants.USER_NAME_LIMIT_USE_CODE, - ExceptionConstants.USER_NAME_LIMIT_USE_MSG); - } else { - logService.insertLog("用户", - BusinessConstants.LOG_OPERATION_TYPE_ADD, - ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); - //检查用户名和登录名 - checkUserNameAndLoginName(ue); - //新增用户信息 - ue= this.addUser(ue); - if(ue==null){ - logger.error("异常码[{}],异常提示[{}],参数,[{}]", - ExceptionConstants.USER_ADD_FAILED_CODE,ExceptionConstants.USER_ADD_FAILED_MSG); - throw new BusinessRunTimeException(ExceptionConstants.USER_ADD_FAILED_CODE, - ExceptionConstants.USER_ADD_FAILED_MSG); - } - //用户id,根据用户名查询id - Long userId = getIdByLoginName(ue.getLoginName()); - if(ue.getRoleId()!=null){ - UserBusiness userBusiness = new UserBusiness(); - userBusiness.setType("UserRole"); - userBusiness.setKeyId(userId.toString()); - userBusiness.setValue(Lists.newArrayList(ue.getRoleId())); - userBusinessService.insertUserBusiness(userBusiness, request); - } - if(ue.getOrgaId()==null){ - //如果没有选择机构,就不建机构和用户的关联关系 - return; - } - //新增用户和机构关联关系 - OrgaUserRel oul=new OrgaUserRel(); - //机构id - oul.setOrgaId(ue.getOrgaId()); - oul.setUserId(userId); - //用户在机构中的排序 - oul.setUserBlngOrgaDsplSeq(ue.getUserBlngOrgaDsplSeq()); - oul=orgaUserRelService.addOrgaUserRel(oul); - if(oul==null){ - logger.error("异常码[{}],异常提示[{}],参数,[{}]", - ExceptionConstants.ORGA_USER_REL_ADD_FAILED_CODE,ExceptionConstants.ORGA_USER_REL_ADD_FAILED_MSG); - throw new BusinessRunTimeException(ExceptionConstants.ORGA_USER_REL_ADD_FAILED_CODE, - ExceptionConstants.ORGA_USER_REL_ADD_FAILED_MSG); - } - } - } - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public UserEx addUser(UserEx ue) throws Exception{ - /** - * 新增用户默认设置 - * 1、密码默认123456 - * 2是否系统自带默认为非系统自带 - * 3是否管理者默认为员工 - * 4默认用户状态为正常 - * */ - ue.setPassword(Tools.md5Encryp(BusinessConstants.USER_DEFAULT_PASSWORD)); - ue.setIsystem(BusinessConstants.USER_NOT_SYSTEM); - if(ue.getIsmanager()==null){ - ue.setIsmanager(BusinessConstants.USER_NOT_MANAGER); - } - ue.setStatus(BusinessConstants.USER_STATUS_NORMAL); - int result=0; - try{ - result= userMapper.insert(ue); - }catch(Exception e){ - BoomException.writeFail(e); - } - if(result>0){ - return ue; - } - return null; - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public UserEx registerUser(UserEx ue, Integer manageRoleId, HttpServletRequest request) throws Exception{ - /** - * create by: qiankunpingtai - * create time: 2019/4/9 18:00 - * 多次创建事务,事物之间无法协同,应该在入口处创建一个事务以做协调 - */ - if(BusinessConstants.DEFAULT_MANAGER.equals(ue.getLoginName())) { - throw new BusinessRunTimeException(ExceptionConstants.USER_NAME_LIMIT_USE_CODE, - ExceptionConstants.USER_NAME_LIMIT_USE_MSG); - } else { - ue.setPassword(SecureUtil.md5(ue.getPassword())); - ue.setIsystem(BusinessConstants.USER_NOT_SYSTEM); - if (ue.getIsmanager() == null) { - ue.setIsmanager(BusinessConstants.USER_NOT_MANAGER); - } - ue.setStatus(BusinessConstants.USER_STATUS_NORMAL); - int result=0; - try{ - result= userMapper.insert(ue); - Long userId = getIdByLoginName(ue.getLoginName()); - ue.setId(userId); - }catch(Exception e){ - BoomException.writeFail(e); - } - //更新租户id - User user = new User(); - user.setId(ue.getId()); - user.setTenantId(ue.getTenantId()); - this.updateUserTenant(user); - //新增用户与角色的关系 - UserBusiness userBusiness = new UserBusiness(); - userBusiness.setType("UserRole"); - userBusiness.setKeyId(ue.getId().toString()); - userBusiness.setValue(Lists.newArrayList(manageRoleId)); - userBusiness.setTenantId(ue.getTenantId() != null ? ue.getTenantId() :ue.getId()); - userBusinessService.insertUserBusiness(userBusiness, null); - //创建租户信息 - Tenant tenant = new Tenant(); - tenant.setTenantId(ue.getTenantId() != null ? ue.getTenantId() :ue.getId()); - tenant.setLoginName(ue.getLoginName()); - tenant.setUserNumLimit(ue.getUserNumLimit()); - tenant.setExpireTime(DateUtil.parse(ue.getExpireTime(), DatePattern.NORM_DATETIME_PATTERN)); - tenant.setRemark(ue.getRemark()); - tenantService.insertTenant(tenant, request); - logger.info("===============创建租户信息完成==============="); - if (result > 0) { - return ue; - } - return null; - } - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public void updateUserTenant(User user) throws Exception{ - UserExample example = new UserExample(); - example.createCriteria().andIdEqualTo(user.getId()); - try{ - userMapper.updateByPrimaryKeySelective(user); - }catch(Exception e){ - BoomException.writeFail(e); - } - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public void updateUserAndOrgUserRel(UserEx ue, HttpServletRequest request) throws Exception{ - if(BusinessConstants.DEFAULT_MANAGER.equals(ue.getLoginName())) { - throw new BusinessRunTimeException(ExceptionConstants.USER_NAME_LIMIT_USE_CODE, - ExceptionConstants.USER_NAME_LIMIT_USE_MSG); - } else { - if(demonstrateOpen && ue.getLoginName().equals(TEST_USER)){ - logger.error("异常码[{}],异常提示[{}],参数,obj:[{}]", - ExceptionConstants.USER_LIMIT_UPDATE_CODE,ExceptionConstants.USER_LIMIT_UPDATE_MSG, TEST_USER); - throw new BusinessRunTimeException(ExceptionConstants.USER_LIMIT_UPDATE_CODE, - ExceptionConstants.USER_LIMIT_UPDATE_MSG); - } - logService.insertLog("用户", - new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(ue.getId()).toString(), - ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); - //检查用户名和登录名 - checkUserNameAndLoginName(ue); - //更新用户信息 - ue = this.updateUser(ue); - if (ue == null) { - logger.error("异常码[{}],异常提示[{}],参数,[{}]", - ExceptionConstants.USER_EDIT_FAILED_CODE, ExceptionConstants.USER_EDIT_FAILED_MSG); - throw new BusinessRunTimeException(ExceptionConstants.USER_EDIT_FAILED_CODE, - ExceptionConstants.USER_EDIT_FAILED_MSG); - } - if(ue.getRoleId()!=null){ - UserBusiness ub = userBusinessService.getBasicData(ue.getId(), "UserRole"); - Long ubId = userBusinessService.checkIsValueExist("UserRole", ue.getId().toString()); - if(ubId!=null) { - ub.setValue(Lists.newArrayList(ue.getRoleId())); - userBusinessService.updateUserBusiness(ub, request); - } else { - ub = new UserBusiness(); - ub.setType("UserRole"); - ub.setKeyId(ue.getId().toString()); - ub.setValue(Lists.newArrayList(ue.getRoleId())); - userBusinessService.insertUserBusiness(ub, request); - } - } - if (ue.getOrgaId() == null) { - //如果没有选择机构,就不建机构和用户的关联关系 - return; - } - //更新用户和机构关联关系 - OrgaUserRel oul = new OrgaUserRel(); - //机构和用户关联关系id - oul.setId(ue.getOrgaUserRelId()); - //机构id - oul.setOrgaId(ue.getOrgaId()); - //用户id - oul.setUserId(ue.getId()); - //用户在机构中的排序 - oul.setUserBlngOrgaDsplSeq(ue.getUserBlngOrgaDsplSeq()); - if (oul.getId() != null) { - //已存在机构和用户的关联关系,更新 - oul = orgaUserRelService.updateOrgaUserRel(oul); - } else { - //不存在机构和用户的关联关系,新建 - oul = orgaUserRelService.addOrgaUserRel(oul); - } - if (oul == null) { - logger.error("异常码[{}],异常提示[{}],参数,[{}]", - ExceptionConstants.ORGA_USER_REL_EDIT_FAILED_CODE, ExceptionConstants.ORGA_USER_REL_EDIT_FAILED_MSG); - throw new BusinessRunTimeException(ExceptionConstants.ORGA_USER_REL_EDIT_FAILED_CODE, - ExceptionConstants.ORGA_USER_REL_EDIT_FAILED_MSG); - } - } - } - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public UserEx updateUser(UserEx ue)throws Exception{ - int result =0; - try{ - result=userMapper.updateByPrimaryKeySelective(ue); - }catch(Exception e){ - BoomException.writeFail(e); - } - if(result>0){ - return ue; - } - return null; - } - /** - * create by: cjl - * description: - * 检查用户名称和登录名不能重复 - * create time: 2019/3/12 11:36 - * @Param: userEx - * @return void - */ - public void checkUserNameAndLoginName(UserEx userEx)throws Exception{ - List list=null; - if(userEx==null){ - return; - } - Long userId=userEx.getId(); - //检查登录名 - if(!StringUtils.isEmpty(userEx.getLoginName())){ - String loginName=userEx.getLoginName(); - list=this.getUserListByloginName(loginName); - if(list!=null&&list.size()>0){ - if(list.size()>1){ - //超过一条数据存在,该登录名已存在 - logger.error("异常码[{}],异常提示[{}],参数,loginName:[{}]", - ExceptionConstants.USER_LOGIN_NAME_ALREADY_EXISTS_CODE,ExceptionConstants.USER_LOGIN_NAME_ALREADY_EXISTS_MSG,loginName); - throw new BusinessRunTimeException(ExceptionConstants.USER_LOGIN_NAME_ALREADY_EXISTS_CODE, - ExceptionConstants.USER_LOGIN_NAME_ALREADY_EXISTS_MSG); - } - //一条数据,新增时抛出异常,修改时和当前的id不同时抛出异常 - if(list.size()==1){ - if(userId==null||(userId!=null&&!userId.equals(list.get(0).getId()))){ - logger.error("异常码[{}],异常提示[{}],参数,loginName:[{}]", - ExceptionConstants.USER_LOGIN_NAME_ALREADY_EXISTS_CODE,ExceptionConstants.USER_LOGIN_NAME_ALREADY_EXISTS_MSG,loginName); - throw new BusinessRunTimeException(ExceptionConstants.USER_LOGIN_NAME_ALREADY_EXISTS_CODE, - ExceptionConstants.USER_LOGIN_NAME_ALREADY_EXISTS_MSG); - } - } - - } - } - //检查用户名 - if(!StringUtils.isEmpty(userEx.getUsername())){ - String userName=userEx.getUsername(); - list=this.getUserListByUserName(userName); - if(list!=null&&list.size()>0){ - if(list.size()>1){ - //超过一条数据存在,该用户名已存在 - logger.error("异常码[{}],异常提示[{}],参数,userName:[{}]", - ExceptionConstants.USER_USER_NAME_ALREADY_EXISTS_CODE,ExceptionConstants.USER_USER_NAME_ALREADY_EXISTS_MSG,userName); - throw new BusinessRunTimeException(ExceptionConstants.USER_USER_NAME_ALREADY_EXISTS_CODE, - ExceptionConstants.USER_USER_NAME_ALREADY_EXISTS_MSG); - } - //一条数据,新增时抛出异常,修改时和当前的id不同时抛出异常 - if(list.size()==1){ - if(userId==null||(userId!=null&&!userId.equals(list.get(0).getId()))){ - logger.error("异常码[{}],异常提示[{}],参数,userName:[{}]", - ExceptionConstants.USER_USER_NAME_ALREADY_EXISTS_CODE,ExceptionConstants.USER_USER_NAME_ALREADY_EXISTS_MSG,userName); - throw new BusinessRunTimeException(ExceptionConstants.USER_USER_NAME_ALREADY_EXISTS_CODE, - ExceptionConstants.USER_USER_NAME_ALREADY_EXISTS_MSG); - } - } - - } - } - - } - /** - * 通过用户名获取用户列表 - * */ - public List getUserListByUserName(String userName)throws Exception{ - List list =null; - try{ - list=userMapperEx.getUserListByUserNameOrLoginName(userName,null); - }catch(Exception e){ - BoomException.readFail(e); - } - return list; - } - /** - * 通过登录名获取用户列表 - * */ - public List getUserListByloginName(String loginName){ - List list =null; - try{ - list=userMapperEx.getUserListByUserNameOrLoginName(null,loginName); - }catch(Exception e){ - BoomException.readFail(e); - } - return list; - } - - public List getOrganizationUserTree()throws Exception { - List list =null; - try{ - list=userMapperEx.getNodeTree(); - }catch(Exception e){ - BoomException.readFail(e); - } - return list; - } - - /** - * 根据用户id查询角色类型 - * @param userId - * @return - */ - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public String getRoleTypeByUserId(long userId) throws Exception { - if (userId == 1L || userId == 2L){ - return "全部数据"; - } - UserBusiness ub = userBusinessService.getBasicData(userId, "UserRole"); - List values = ub.getValue(); - Role role = roleService.getRole(values.get(0).longValue()); - if(role!=null) { - return role.getType(); - } else { - return null; - } - } - - /** - * 获取用户id - * @param request - * @return - */ - public Long getUserId(HttpServletRequest request) throws Exception{ - Object userIdObj = redisService.getObjectFromSessionByKey(request,"userId"); - Long userId = null; - if(userIdObj != null) { - userId = Long.parseLong(userIdObj.toString()); - } - return userId; - } - - /** - * 用户的按钮权限 - * @param userId - * @return - * @throws Exception - */ - public List getBtnStrArrById(Long userId) { - UserBusiness ub = userBusinessService.getBasicData(userId, "UserRole"); - List roleValue = ub.getValue(); - if(ObjectUtil.isNotEmpty(roleValue)){ - UserBusiness fun = userBusinessService.getBasicData(roleValue.get(0).longValue(), "RoleFunctions"); - return fun.getBtnStr(); - } - return null; - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int batchSetStatus(Byte status, String ids)throws Exception { - int result=0; - List list = getUserListByIds(ids); - for(User user: list) { - if (demonstrateOpen && user.getLoginName().equals(TEST_USER)) { - logger.error("异常码[{}],异常提示[{}],参数,obj:[{}]", - ExceptionConstants.USER_LIMIT_UPDATE_CODE, ExceptionConstants.USER_LIMIT_UPDATE_MSG, TEST_USER); - throw new BusinessRunTimeException(ExceptionConstants.USER_LIMIT_UPDATE_CODE, - ExceptionConstants.USER_LIMIT_UPDATE_MSG); - } - } - String statusStr =""; - if(status == 0) { - statusStr ="批量启用"; - } else if(status == 2) { - statusStr ="批量禁用"; - } - logService.insertLog("用户", - new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(ids).append("-").append(statusStr).toString(), - ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); - List idList = StringUtil.strToLongList(ids); - User user = new User(); - user.setStatus(status); - UserExample example = new UserExample(); - example.createCriteria().andIdIn(idList); - result = userMapper.updateByExampleSelective(user, example); - return result; - } -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/userBusiness/UserBusinessComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/userBusiness/UserBusinessComponent.java deleted file mode 100644 index c7d083bb..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/service/userBusiness/UserBusinessComponent.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.zsw.erp.service.userBusiness; - -import cn.hutool.json.JSONUtil; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.zsw.erp.constants.BusinessConstants; -import com.zsw.erp.datasource.entities.UserBusiness; -import com.zsw.erp.service.ICommonQuery; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; -import java.util.Map; - -@Service(value = "userBusiness_component") -@UserBusinessResource -public class UserBusinessComponent implements ICommonQuery { - - @Resource - private UserBusinessService userBusinessService; - - @Override - public Object selectOne(Long id) throws Exception { - return userBusinessService.getUserBusiness(id); - } - - @Override - public List select(Map map)throws Exception { - return getUserBusinessList(map); - } - - private List getUserBusinessList(Map map)throws Exception { - return null; - } - - @Override - public Long counts(Map map)throws Exception { - return BusinessConstants.DEFAULT_LIST_NULL_NUMBER; - } - - @Override - public int insert(JSONObject obj, HttpServletRequest request) throws Exception { - return userBusinessService.insertUserBusiness(JSON.parseObject(obj.toJSONString(),UserBusiness.class), request); - } - - @Override - public int update(JSONObject obj, HttpServletRequest request)throws Exception { - return userBusinessService.updateUserBusiness(JSON.parseObject(obj.toJSONString(),UserBusiness.class), request); - } - - @Override - public int delete(Long id, HttpServletRequest request)throws Exception { - return userBusinessService.deleteUserBusiness(id, request); - } - - @Override - public int deleteBatch(String ids, HttpServletRequest request)throws Exception { - return userBusinessService.batchDeleteUserBusiness(ids, request); - } - - @Override - public int checkIsNameExist(Long id, String name)throws Exception { - return userBusinessService.checkIsNameExist(id, name); - } - -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/userBusiness/UserBusinessResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/userBusiness/UserBusinessResource.java deleted file mode 100644 index 500ab84f..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/service/userBusiness/UserBusinessResource.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.zsw.erp.service.userBusiness; - -import com.zsw.erp.service.ResourceInfo; - -import java.lang.annotation.*; - - -@ResourceInfo(value = "userBusiness") -@Inherited -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -public @interface UserBusinessResource { -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/userBusiness/UserBusinessService.java b/zsw-erp/src/main/java/com/zsw/erp/service/userBusiness/UserBusinessService.java deleted file mode 100644 index d5b8dba2..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/service/userBusiness/UserBusinessService.java +++ /dev/null @@ -1,163 +0,0 @@ -package com.zsw.erp.service.userBusiness; - -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.google.common.collect.Lists; -import com.zsw.erp.constants.BusinessConstants; -import com.zsw.erp.datasource.entities.BtnDto; -import com.zsw.erp.datasource.mappers.UserBusinessMapper; -import com.zsw.erp.datasource.mappers.UserBusinessMapperEx; -import com.zsw.erp.exception.BoomException; -import com.zsw.erp.service.log.LogService; -import com.zsw.erp.service.user.UserService; -import com.zsw.erp.utils.Tools; -import com.zsw.erp.datasource.entities.User; -import com.zsw.erp.datasource.entities.UserBusiness; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.context.annotation.Lazy; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.*; -import java.util.stream.Collectors; - -@Service -public class UserBusinessService { - private Logger logger = LoggerFactory.getLogger(UserBusinessService.class); - - @Resource - private UserBusinessMapper userBusinessMapper; - @Resource - private UserBusinessMapperEx userBusinessMapperEx; - @Resource - private LogService logService; - @Resource - @Lazy - private UserService userService; - - - public UserBusiness getUserBusiness(long id)throws Exception { - return userBusinessMapper.selectById(id); - } - - public List getUserBusiness(){ - return userBusinessMapper.selectList(Wrappers.lambdaQuery() - .eq(UserBusiness::getDeleteFlag,BusinessConstants.DELETE_FLAG_EXISTS)); - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int insertUserBusiness(UserBusiness userBusiness, HttpServletRequest request) throws Exception { - int result=0; - try{ - String token = ""; - if(request!=null) { - token = request.getHeader("X-Access-Token"); - Long tenantId = Tools.getTenantIdByToken(token); - if(tenantId!=0L) { - userBusiness.setTenantId(tenantId); - } - } - result=userBusinessMapper.insert(userBusiness); - logService.insertLog("关联关系", BusinessConstants.LOG_OPERATION_TYPE_ADD, request); - }catch(Exception e){ - BoomException.writeFail(e); - } - return result; - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int updateUserBusiness(UserBusiness userBusiness, HttpServletRequest request) throws Exception { - int result=0; - try{ - result = userBusinessMapper.updateById(userBusiness); - logService.insertLog("关联关系", BusinessConstants.LOG_OPERATION_TYPE_EDIT, request); - }catch(Exception e){ - BoomException.writeFail(e); - } - return result; - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int deleteUserBusiness(Long id, HttpServletRequest request)throws Exception { - return batchDeleteUserBusinessByIds(id.toString()); - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int batchDeleteUserBusiness(String ids, HttpServletRequest request)throws Exception { - return batchDeleteUserBusinessByIds(ids); - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int batchDeleteUserBusinessByIds(String ids) throws Exception{ - logService.insertLog("关联关系", - new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(), - ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); - User userInfo=userService.getCurrentUser(); - String [] idArray=ids.split(","); - int result=0; - try{ - result= userBusinessMapperEx.batchDeleteUserBusinessByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); - }catch(Exception e){ - BoomException.writeFail(e); - } - return result; - } - - public int checkIsNameExist(Long id, String name)throws Exception { - return 1; - } - - public UserBusiness getBasicData(Long keyId, String type){ - return userBusinessMapper.selectOne(Wrappers.lambdaQuery() - .eq(UserBusiness::getType, type) - .eq(UserBusiness::getKeyId,keyId) - .eq(UserBusiness::getDeleteFlag, BusinessConstants.DELETE_FLAG_EXISTS)); - } - - public List getListBy(String keyId, String type){ - return userBusinessMapper.selectList(Wrappers.lambdaQuery() - .eq(UserBusiness::getKeyId,keyId) - .eq(UserBusiness::getType,type) - .eq(UserBusiness::getDeleteFlag,BusinessConstants.DELETE_FLAG_EXISTS)); - } - - public List getUBValueByTypeAndKeyId(String type, Long keyId) throws Exception { - List list = Lists.newArrayList(); - UserBusiness ubList = getBasicData(keyId, type); - if (ubList == null){ - return null; - } - return ubList.getValue().stream().map(Number::longValue).collect(Collectors.toList()); - } - - public Long checkIsValueExist(String type, String keyId)throws Exception { - UserBusiness business = userBusinessMapper.selectOne(Wrappers.lambdaQuery() - .eq(UserBusiness::getKeyId,keyId) - .eq(UserBusiness::getType,type) - .eq(UserBusiness::getDeleteFlag,BusinessConstants.DELETE_FLAG_EXISTS)); - return business==null ? null : business.getId(); - } - - @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int updateBtnStr(String keyId, String type, List btnStr) throws Exception{ - logService.insertLog("关联关系", - new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append("角色的按钮权限").toString(), - ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); - UserBusiness userBusiness = new UserBusiness(); - userBusiness.setBtnStr(btnStr); - int result=0; - try{ - result= userBusinessMapper.update(userBusiness, - Wrappers.lambdaUpdate() - .eq(UserBusiness::getType,type) - .eq(UserBusiness::getKeyId,keyId)); - }catch(Exception e){ - BoomException.writeFail(e); - } - return result; - } -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/utils/DozerUtils.java b/zsw-erp/src/main/java/com/zsw/erp/utils/DozerUtils.java deleted file mode 100644 index 41bb9730..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/utils/DozerUtils.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.zsw.erp.utils; - -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.extra.spring.EnableSpringUtil; -import com.github.dozermapper.core.Mapper; -import com.github.dozermapper.core.DozerBeanMapperBuilder; -import lombok.experimental.UtilityClass; -import org.springframework.stereotype.Component; - -import java.util.Collection; -import java.util.List; -import java.util.stream.Collectors; - -@Component -public class DozerUtils { - - private final Mapper mapper; - - public DozerUtils() { - mapper = DozerBeanMapperBuilder.buildDefault(); - } - - public T convert(Object source, Class targetClass){ - return mapper.map(source,targetClass); - } - - public List convertList(Collection source, Class targetClass){ - if (ObjectUtil.isEmpty(source)){ - return null; - } - return source.stream() - .filter(ObjectUtil::isNotEmpty) - .map(e -> mapper.map(e, targetClass)) - .collect(Collectors.toList()); - } - -} diff --git a/zsw-erp/src/main/java/com/zsw/erp/utils/LocalUser.java b/zsw-erp/src/main/java/com/zsw/erp/utils/LocalUser.java deleted file mode 100644 index 4146cd55..00000000 --- a/zsw-erp/src/main/java/com/zsw/erp/utils/LocalUser.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.zsw.erp.utils; - -import com.zsw.erp.datasource.entities.User; -import lombok.extern.slf4j.Slf4j; - -import java.util.HashMap; -import java.util.Map; - -public class LocalUser { - - private static final ThreadLocal> THREAD_LOCAL = new ThreadLocal<>(); - - public static Map getLocalMap() { - Map map = THREAD_LOCAL.get(); - if (map == null) { - map = new HashMap<>(10); - THREAD_LOCAL.set(map); - } - return map; - } - public static void setUser(User user){ - Map map = getLocalMap(); - map.put("user",user); - } - - public static User getUser(){ - Map map = getLocalMap(); - Object user = map.get("user"); - if (user == null){ - return null; - } - return (User)user; - } - - - - public static void setTenantId(Long tenantId) { - Map map = getLocalMap(); - if (tenantId == null){ - return; - } - map.put("tenantId",tenantId); - } - - public static Long getTenantId(){ - Map map = getLocalMap(); - Object rs = map.get("tenantId"); - if (rs == null){ - return 0L; - }else{ - return Long.valueOf(rs.toString()); - } - } - - public static void setStoreId(Long storeId){ - Map map = getLocalMap(); - if (storeId == null){ - return; - } - map.put("storeId",storeId); - } - - public static Long getStoreId(){ - Map map = getLocalMap(); - Object rs = map.getOrDefault("storeId", 0L); - return Long.valueOf(rs.toString()); - } - - public static void setLoginName(String loginName){ - Map map = getLocalMap(); - map.put("loginName",loginName); - } - - public static String getLoginName(){ - Map map = getLocalMap(); - return map.get("loginName").toString(); - } - - public static void setUserId(Long userId) { - Map map = getLocalMap(); - map.put("userId",userId); - } - - public static Long getUserId(){ - Map map = getLocalMap(); - return Long.valueOf(map.get("userId").toString()); - } - - public static void setSeasonId(Long seasonId) { - Map map = getLocalMap(); - map.put("seasonId",seasonId); - } - - public static Long getSeasonId(){ - Map map = getLocalMap(); - return Long.valueOf(map.get("seasonId").toString()); - } - - public static void remove(){ - THREAD_LOCAL.remove(); - } - -} diff --git a/zsw-erp/src/main/resources/mappper_xml/AccountHeadMapper.xml b/zsw-erp/src/main/resources/erp_mapper/AccountHeadMapper.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/AccountHeadMapper.xml rename to zsw-erp/src/main/resources/erp_mapper/AccountHeadMapper.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/AccountHeadMapperEx.xml b/zsw-erp/src/main/resources/erp_mapper/AccountHeadMapperEx.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/AccountHeadMapperEx.xml rename to zsw-erp/src/main/resources/erp_mapper/AccountHeadMapperEx.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/AccountItemMapper.xml b/zsw-erp/src/main/resources/erp_mapper/AccountItemMapper.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/AccountItemMapper.xml rename to zsw-erp/src/main/resources/erp_mapper/AccountItemMapper.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/AccountItemMapperEx.xml b/zsw-erp/src/main/resources/erp_mapper/AccountItemMapperEx.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/AccountItemMapperEx.xml rename to zsw-erp/src/main/resources/erp_mapper/AccountItemMapperEx.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/AccountMapper.xml b/zsw-erp/src/main/resources/erp_mapper/AccountMapper.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/AccountMapper.xml rename to zsw-erp/src/main/resources/erp_mapper/AccountMapper.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/AccountMapperEx.xml b/zsw-erp/src/main/resources/erp_mapper/AccountMapperEx.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/AccountMapperEx.xml rename to zsw-erp/src/main/resources/erp_mapper/AccountMapperEx.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/DepotHeadMapper.xml b/zsw-erp/src/main/resources/erp_mapper/DepotHeadMapper.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/DepotHeadMapper.xml rename to zsw-erp/src/main/resources/erp_mapper/DepotHeadMapper.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/DepotHeadMapperEx.xml b/zsw-erp/src/main/resources/erp_mapper/DepotHeadMapperEx.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/DepotHeadMapperEx.xml rename to zsw-erp/src/main/resources/erp_mapper/DepotHeadMapperEx.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/DepotItemMapper.xml b/zsw-erp/src/main/resources/erp_mapper/DepotItemMapper.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/DepotItemMapper.xml rename to zsw-erp/src/main/resources/erp_mapper/DepotItemMapper.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/DepotItemMapperEx.xml b/zsw-erp/src/main/resources/erp_mapper/DepotItemMapperEx.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/DepotItemMapperEx.xml rename to zsw-erp/src/main/resources/erp_mapper/DepotItemMapperEx.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/DepotMapper.xml b/zsw-erp/src/main/resources/erp_mapper/DepotMapper.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/DepotMapper.xml rename to zsw-erp/src/main/resources/erp_mapper/DepotMapper.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/DepotMapperEx.xml b/zsw-erp/src/main/resources/erp_mapper/DepotMapperEx.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/DepotMapperEx.xml rename to zsw-erp/src/main/resources/erp_mapper/DepotMapperEx.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/FunctionMapper.xml b/zsw-erp/src/main/resources/erp_mapper/FunctionMapper.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/FunctionMapper.xml rename to zsw-erp/src/main/resources/erp_mapper/FunctionMapper.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/FunctionMapperEx.xml b/zsw-erp/src/main/resources/erp_mapper/FunctionMapperEx.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/FunctionMapperEx.xml rename to zsw-erp/src/main/resources/erp_mapper/FunctionMapperEx.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/InOutItemMapper.xml b/zsw-erp/src/main/resources/erp_mapper/InOutItemMapper.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/InOutItemMapper.xml rename to zsw-erp/src/main/resources/erp_mapper/InOutItemMapper.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/InOutItemMapperEx.xml b/zsw-erp/src/main/resources/erp_mapper/InOutItemMapperEx.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/InOutItemMapperEx.xml rename to zsw-erp/src/main/resources/erp_mapper/InOutItemMapperEx.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/LogMapper.xml b/zsw-erp/src/main/resources/erp_mapper/LogMapper.xml similarity index 99% rename from zsw-erp/src/main/resources/mappper_xml/LogMapper.xml rename to zsw-erp/src/main/resources/erp_mapper/LogMapper.xml index c5ce7e2e..e2665516 100644 --- a/zsw-erp/src/main/resources/mappper_xml/LogMapper.xml +++ b/zsw-erp/src/main/resources/erp_mapper/LogMapper.xml @@ -1,6 +1,6 @@ - + diff --git a/zsw-erp/src/main/resources/mappper_xml/LogMapperEx.xml b/zsw-erp/src/main/resources/erp_mapper/LogMapperEx.xml similarity index 95% rename from zsw-erp/src/main/resources/mappper_xml/LogMapperEx.xml rename to zsw-erp/src/main/resources/erp_mapper/LogMapperEx.xml index 8d81cc5f..19eb8590 100644 --- a/zsw-erp/src/main/resources/mappper_xml/LogMapperEx.xml +++ b/zsw-erp/src/main/resources/erp_mapper/LogMapperEx.xml @@ -1,7 +1,7 @@ - + diff --git a/zsw-erp/src/main/resources/mappper_xml/MaterialAttributeMapper.xml b/zsw-erp/src/main/resources/erp_mapper/MaterialAttributeMapper.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/MaterialAttributeMapper.xml rename to zsw-erp/src/main/resources/erp_mapper/MaterialAttributeMapper.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/MaterialAttributeMapperEx.xml b/zsw-erp/src/main/resources/erp_mapper/MaterialAttributeMapperEx.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/MaterialAttributeMapperEx.xml rename to zsw-erp/src/main/resources/erp_mapper/MaterialAttributeMapperEx.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/MaterialCategoryMapper.xml b/zsw-erp/src/main/resources/erp_mapper/MaterialCategoryMapper.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/MaterialCategoryMapper.xml rename to zsw-erp/src/main/resources/erp_mapper/MaterialCategoryMapper.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/MaterialCategoryMapperEx.xml b/zsw-erp/src/main/resources/erp_mapper/MaterialCategoryMapperEx.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/MaterialCategoryMapperEx.xml rename to zsw-erp/src/main/resources/erp_mapper/MaterialCategoryMapperEx.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/MaterialCurrentStockMapper.xml b/zsw-erp/src/main/resources/erp_mapper/MaterialCurrentStockMapper.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/MaterialCurrentStockMapper.xml rename to zsw-erp/src/main/resources/erp_mapper/MaterialCurrentStockMapper.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/MaterialExtendMapper.xml b/zsw-erp/src/main/resources/erp_mapper/MaterialExtendMapper.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/MaterialExtendMapper.xml rename to zsw-erp/src/main/resources/erp_mapper/MaterialExtendMapper.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/MaterialExtendMapperEx.xml b/zsw-erp/src/main/resources/erp_mapper/MaterialExtendMapperEx.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/MaterialExtendMapperEx.xml rename to zsw-erp/src/main/resources/erp_mapper/MaterialExtendMapperEx.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/MaterialInitialStockMapper.xml b/zsw-erp/src/main/resources/erp_mapper/MaterialInitialStockMapper.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/MaterialInitialStockMapper.xml rename to zsw-erp/src/main/resources/erp_mapper/MaterialInitialStockMapper.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/MaterialMapper.xml b/zsw-erp/src/main/resources/erp_mapper/MaterialMapper.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/MaterialMapper.xml rename to zsw-erp/src/main/resources/erp_mapper/MaterialMapper.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/MaterialMapperEx.xml b/zsw-erp/src/main/resources/erp_mapper/MaterialMapperEx.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/MaterialMapperEx.xml rename to zsw-erp/src/main/resources/erp_mapper/MaterialMapperEx.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/MaterialPropertyMapper.xml b/zsw-erp/src/main/resources/erp_mapper/MaterialPropertyMapper.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/MaterialPropertyMapper.xml rename to zsw-erp/src/main/resources/erp_mapper/MaterialPropertyMapper.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/MaterialPropertyMapperEx.xml b/zsw-erp/src/main/resources/erp_mapper/MaterialPropertyMapperEx.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/MaterialPropertyMapperEx.xml rename to zsw-erp/src/main/resources/erp_mapper/MaterialPropertyMapperEx.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/MsgMapper.xml b/zsw-erp/src/main/resources/erp_mapper/MsgMapper.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/MsgMapper.xml rename to zsw-erp/src/main/resources/erp_mapper/MsgMapper.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/MsgMapperEx.xml b/zsw-erp/src/main/resources/erp_mapper/MsgMapperEx.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/MsgMapperEx.xml rename to zsw-erp/src/main/resources/erp_mapper/MsgMapperEx.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/OrgaUserRelMapper.xml b/zsw-erp/src/main/resources/erp_mapper/OrgaUserRelMapper.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/OrgaUserRelMapper.xml rename to zsw-erp/src/main/resources/erp_mapper/OrgaUserRelMapper.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/OrgaUserRelMapperEx.xml b/zsw-erp/src/main/resources/erp_mapper/OrgaUserRelMapperEx.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/OrgaUserRelMapperEx.xml rename to zsw-erp/src/main/resources/erp_mapper/OrgaUserRelMapperEx.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/OrganizationMapper.xml b/zsw-erp/src/main/resources/erp_mapper/OrganizationMapper.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/OrganizationMapper.xml rename to zsw-erp/src/main/resources/erp_mapper/OrganizationMapper.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/OrganizationMapperEx.xml b/zsw-erp/src/main/resources/erp_mapper/OrganizationMapperEx.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/OrganizationMapperEx.xml rename to zsw-erp/src/main/resources/erp_mapper/OrganizationMapperEx.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/PersonMapper.xml b/zsw-erp/src/main/resources/erp_mapper/PersonMapper.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/PersonMapper.xml rename to zsw-erp/src/main/resources/erp_mapper/PersonMapper.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/PersonMapperEx.xml b/zsw-erp/src/main/resources/erp_mapper/PersonMapperEx.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/PersonMapperEx.xml rename to zsw-erp/src/main/resources/erp_mapper/PersonMapperEx.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/PlatformConfigMapper.xml b/zsw-erp/src/main/resources/erp_mapper/PlatformConfigMapper.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/PlatformConfigMapper.xml rename to zsw-erp/src/main/resources/erp_mapper/PlatformConfigMapper.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/PlatformConfigMapperEx.xml b/zsw-erp/src/main/resources/erp_mapper/PlatformConfigMapperEx.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/PlatformConfigMapperEx.xml rename to zsw-erp/src/main/resources/erp_mapper/PlatformConfigMapperEx.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/SequenceMapperEx.xml b/zsw-erp/src/main/resources/erp_mapper/SequenceMapperEx.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/SequenceMapperEx.xml rename to zsw-erp/src/main/resources/erp_mapper/SequenceMapperEx.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/SerialNumberMapper.xml b/zsw-erp/src/main/resources/erp_mapper/SerialNumberMapper.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/SerialNumberMapper.xml rename to zsw-erp/src/main/resources/erp_mapper/SerialNumberMapper.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/SerialNumberMapperEx.xml b/zsw-erp/src/main/resources/erp_mapper/SerialNumberMapperEx.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/SerialNumberMapperEx.xml rename to zsw-erp/src/main/resources/erp_mapper/SerialNumberMapperEx.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/SupplierMapper.xml b/zsw-erp/src/main/resources/erp_mapper/SupplierMapper.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/SupplierMapper.xml rename to zsw-erp/src/main/resources/erp_mapper/SupplierMapper.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/SupplierMapperEx.xml b/zsw-erp/src/main/resources/erp_mapper/SupplierMapperEx.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/SupplierMapperEx.xml rename to zsw-erp/src/main/resources/erp_mapper/SupplierMapperEx.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/SystemConfigMapper.xml b/zsw-erp/src/main/resources/erp_mapper/SystemConfigMapper.xml similarity index 99% rename from zsw-erp/src/main/resources/mappper_xml/SystemConfigMapper.xml rename to zsw-erp/src/main/resources/erp_mapper/SystemConfigMapper.xml index b6241fe3..726fdb2e 100644 --- a/zsw-erp/src/main/resources/mappper_xml/SystemConfigMapper.xml +++ b/zsw-erp/src/main/resources/erp_mapper/SystemConfigMapper.xml @@ -1,6 +1,6 @@ - + diff --git a/zsw-erp/src/main/resources/mappper_xml/SystemConfigMapperEx.xml b/zsw-erp/src/main/resources/erp_mapper/SystemConfigMapperEx.xml similarity index 94% rename from zsw-erp/src/main/resources/mappper_xml/SystemConfigMapperEx.xml rename to zsw-erp/src/main/resources/erp_mapper/SystemConfigMapperEx.xml index 5bb37084..a343c027 100644 --- a/zsw-erp/src/main/resources/mappper_xml/SystemConfigMapperEx.xml +++ b/zsw-erp/src/main/resources/erp_mapper/SystemConfigMapperEx.xml @@ -1,7 +1,7 @@ - select * FROM jsh_system_config where 1=1 diff --git a/zsw-erp/src/main/resources/mappper_xml/UnitMapper.xml b/zsw-erp/src/main/resources/erp_mapper/UnitMapper.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/UnitMapper.xml rename to zsw-erp/src/main/resources/erp_mapper/UnitMapper.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/UnitMapperEx.xml b/zsw-erp/src/main/resources/erp_mapper/UnitMapperEx.xml similarity index 100% rename from zsw-erp/src/main/resources/mappper_xml/UnitMapperEx.xml rename to zsw-erp/src/main/resources/erp_mapper/UnitMapperEx.xml diff --git a/zsw-erp/src/main/resources/mappper_xml/RoleMapper.xml b/zsw-erp/src/main/resources/mappper_xml/RoleMapper.xml deleted file mode 100644 index e5c2edde..00000000 --- a/zsw-erp/src/main/resources/mappper_xml/RoleMapper.xml +++ /dev/null @@ -1,243 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - id, name, type, value, description, tenant_id, delete_flag - - - - - delete from jsh_role - where id = #{id,jdbcType=BIGINT} - - - delete from jsh_role - - - - - - insert into jsh_role (id, name, type, - value, description, tenant_id, - delete_flag) - values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, - #{value,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, - #{deleteFlag,jdbcType=VARCHAR}) - - - insert into jsh_role - - - id, - - - name, - - - type, - - - value, - - - description, - - - tenant_id, - - - delete_flag, - - - - - #{id,jdbcType=BIGINT}, - - - #{name,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{value,jdbcType=VARCHAR}, - - - #{description,jdbcType=VARCHAR}, - - - #{tenantId,jdbcType=BIGINT}, - - - #{deleteFlag,jdbcType=VARCHAR}, - - - - - - update jsh_role - - - id = #{record.id,jdbcType=BIGINT}, - - - name = #{record.name,jdbcType=VARCHAR}, - - - type = #{record.type,jdbcType=VARCHAR}, - - - value = #{record.value,jdbcType=VARCHAR}, - - - description = #{record.description,jdbcType=VARCHAR}, - - - tenant_id = #{record.tenantId,jdbcType=BIGINT}, - - - delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, - - - - - - - - update jsh_role - set id = #{record.id,jdbcType=BIGINT}, - name = #{record.name,jdbcType=VARCHAR}, - type = #{record.type,jdbcType=VARCHAR}, - value = #{record.value,jdbcType=VARCHAR}, - description = #{record.description,jdbcType=VARCHAR}, - tenant_id = #{record.tenantId,jdbcType=BIGINT}, - delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} - - - - - - update jsh_role - - - name = #{name,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - value = #{value,jdbcType=VARCHAR}, - - - description = #{description,jdbcType=VARCHAR}, - - - tenant_id = #{tenantId,jdbcType=BIGINT}, - - - delete_flag = #{deleteFlag,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=BIGINT} - - - update jsh_role - set name = #{name,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - value = #{value,jdbcType=VARCHAR}, - description = #{description,jdbcType=VARCHAR}, - tenant_id = #{tenantId,jdbcType=BIGINT}, - delete_flag = #{deleteFlag,jdbcType=VARCHAR} - where id = #{id,jdbcType=BIGINT} - - \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/RoleMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/RoleMapperEx.xml deleted file mode 100644 index 009a4301..00000000 --- a/zsw-erp/src/main/resources/mappper_xml/RoleMapperEx.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - update jsh_role - set delete_flag='1' - where 1=1 - and id in ( - - #{id} - - ) - - \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/TenantMapper.xml b/zsw-erp/src/main/resources/mappper_xml/TenantMapper.xml deleted file mode 100644 index 2ded3e05..00000000 --- a/zsw-erp/src/main/resources/mappper_xml/TenantMapper.xml +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - id, tenant_id, login_name, user_num_limit, type, enabled, create_time, expire_time, - remark - - - - - delete from jsh_tenant - where id = #{id,jdbcType=BIGINT} - - - delete from jsh_tenant - - - - - - - update jsh_tenant - - - id = #{record.id,jdbcType=BIGINT}, - - - tenant_id = #{record.tenantId,jdbcType=BIGINT}, - - - login_name = #{record.loginName,jdbcType=VARCHAR}, - - - user_num_limit = #{record.userNumLimit,jdbcType=INTEGER}, - - - type = #{record.type,jdbcType=VARCHAR}, - - - enabled = #{record.enabled,jdbcType=BIT}, - - - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - - - expire_time = #{record.expireTime,jdbcType=TIMESTAMP}, - - - remark = #{record.remark,jdbcType=VARCHAR}, - - - - - - - - update jsh_tenant - set id = #{record.id,jdbcType=BIGINT}, - tenant_id = #{record.tenantId,jdbcType=BIGINT}, - login_name = #{record.loginName,jdbcType=VARCHAR}, - user_num_limit = #{record.userNumLimit,jdbcType=INTEGER}, - type = #{record.type,jdbcType=VARCHAR}, - enabled = #{record.enabled,jdbcType=BIT}, - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - expire_time = #{record.expireTime,jdbcType=TIMESTAMP}, - remark = #{record.remark,jdbcType=VARCHAR} - - - - - - update jsh_tenant - - - tenant_id = #{tenantId,jdbcType=BIGINT}, - - - login_name = #{loginName,jdbcType=VARCHAR}, - - - user_num_limit = #{userNumLimit,jdbcType=INTEGER}, - - - type = #{type,jdbcType=VARCHAR}, - - - enabled = #{enabled,jdbcType=BIT}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - expire_time = #{expireTime,jdbcType=TIMESTAMP}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=BIGINT} - - - update jsh_tenant - set tenant_id = #{tenantId,jdbcType=BIGINT}, - login_name = #{loginName,jdbcType=VARCHAR}, - user_num_limit = #{userNumLimit,jdbcType=INTEGER}, - type = #{type,jdbcType=VARCHAR}, - enabled = #{enabled,jdbcType=BIT}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - expire_time = #{expireTime,jdbcType=TIMESTAMP}, - remark = #{remark,jdbcType=VARCHAR} - where id = #{id,jdbcType=BIGINT} - - \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/TenantMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/TenantMapperEx.xml deleted file mode 100644 index 559f9456..00000000 --- a/zsw-erp/src/main/resources/mappper_xml/TenantMapperEx.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/UserBusinessMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/UserBusinessMapperEx.xml deleted file mode 100644 index 2ac49f67..00000000 --- a/zsw-erp/src/main/resources/mappper_xml/UserBusinessMapperEx.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - update jsh_user_business - set delete_flag='1' - where 1=1 - and id in ( - - #{id} - - ) - - - \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/UserMapper.xml b/zsw-erp/src/main/resources/mappper_xml/UserMapper.xml deleted file mode 100644 index d3b0f49f..00000000 --- a/zsw-erp/src/main/resources/mappper_xml/UserMapper.xml +++ /dev/null @@ -1,250 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - id, username, login_name, password, position, department, email, phonenum, ismanager, - isystem, Status, description, remark, tenant_id - - - - - delete from jsh_user - where id = #{id,jdbcType=BIGINT} - - - delete from jsh_user - - - - - - - update jsh_user - - - id = #{record.id,jdbcType=BIGINT}, - - - username = #{record.username,jdbcType=VARCHAR}, - - - login_name = #{record.loginName,jdbcType=VARCHAR}, - - - password = #{record.password,jdbcType=VARCHAR}, - - - position = #{record.position,jdbcType=VARCHAR}, - - - department = #{record.department,jdbcType=VARCHAR}, - - - email = #{record.email,jdbcType=VARCHAR}, - - - phonenum = #{record.phonenum,jdbcType=VARCHAR}, - - - ismanager = #{record.ismanager,jdbcType=TINYINT}, - - - isystem = #{record.isystem,jdbcType=TINYINT}, - - - Status = #{record.status,jdbcType=TINYINT}, - - - description = #{record.description,jdbcType=VARCHAR}, - - - remark = #{record.remark,jdbcType=VARCHAR}, - - - tenant_id = #{record.tenantId,jdbcType=BIGINT}, - - - - - - - - update jsh_user - set id = #{record.id,jdbcType=BIGINT}, - username = #{record.username,jdbcType=VARCHAR}, - login_name = #{record.loginName,jdbcType=VARCHAR}, - password = #{record.password,jdbcType=VARCHAR}, - position = #{record.position,jdbcType=VARCHAR}, - department = #{record.department,jdbcType=VARCHAR}, - email = #{record.email,jdbcType=VARCHAR}, - phonenum = #{record.phonenum,jdbcType=VARCHAR}, - ismanager = #{record.ismanager,jdbcType=TINYINT}, - isystem = #{record.isystem,jdbcType=TINYINT}, - Status = #{record.status,jdbcType=TINYINT}, - description = #{record.description,jdbcType=VARCHAR}, - remark = #{record.remark,jdbcType=VARCHAR}, - tenant_id = #{record.tenantId,jdbcType=BIGINT} - - - - - - update jsh_user - - - username = #{username,jdbcType=VARCHAR}, - - - login_name = #{loginName,jdbcType=VARCHAR}, - - - password = #{password,jdbcType=VARCHAR}, - - - position = #{position,jdbcType=VARCHAR}, - - - department = #{department,jdbcType=VARCHAR}, - - - email = #{email,jdbcType=VARCHAR}, - - - phonenum = #{phonenum,jdbcType=VARCHAR}, - - - ismanager = #{ismanager,jdbcType=TINYINT}, - - - isystem = #{isystem,jdbcType=TINYINT}, - - - Status = #{status,jdbcType=TINYINT}, - - - description = #{description,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - tenant_id = #{tenantId,jdbcType=BIGINT}, - - - where id = #{id,jdbcType=BIGINT} - - - update jsh_user - set username = #{username,jdbcType=VARCHAR}, - login_name = #{loginName,jdbcType=VARCHAR}, - password = #{password,jdbcType=VARCHAR}, - position = #{position,jdbcType=VARCHAR}, - department = #{department,jdbcType=VARCHAR}, - email = #{email,jdbcType=VARCHAR}, - phonenum = #{phonenum,jdbcType=VARCHAR}, - ismanager = #{ismanager,jdbcType=TINYINT}, - isystem = #{isystem,jdbcType=TINYINT}, - Status = #{status,jdbcType=TINYINT}, - description = #{description,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - tenant_id = #{tenantId,jdbcType=BIGINT} - where id = #{id,jdbcType=BIGINT} - - \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/UserMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/UserMapperEx.xml deleted file mode 100644 index 3e3d6145..00000000 --- a/zsw-erp/src/main/resources/mappper_xml/UserMapperEx.xml +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - - - - - - - update jsh_user - set status=#{status} - where id in ( - - #{id} - - ) - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/zsw-spi/pom.xml b/zsw-spi/pom.xml index 7531d348..bf597dc0 100644 --- a/zsw-spi/pom.xml +++ b/zsw-spi/pom.xml @@ -3,73 +3,43 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - yudao-dependencies cn.iocoder.boot + yudao ${revision} 4.0.0 zsw-spi - pom + jar ${project.artifactId} - - - - org.apache.maven.plugins - maven-compiler-plugin - - 8 - 8 - - - - - \ No newline at end of file diff --git a/zsw-spi/src/main/java/com/zsw/base/entity/Entity.java b/zsw-spi/src/main/java/com/zsw/base/entity/Entity.java index 43ab8de8..3c68ac67 100644 --- a/zsw-spi/src/main/java/com/zsw/base/entity/Entity.java +++ b/zsw-spi/src/main/java/com/zsw/base/entity/Entity.java @@ -21,7 +21,6 @@ import java.time.LocalDateTime; */ @Getter @Setter -@Builder @Accessors(chain = true) @ToString(callSuper = true) public class Entity extends SuperEntity {