diff --git a/Cpop-Oam/Cpop-Oam-Web/Oam-DockerD-Dockerfile b/Cpop-Oam/Cpop-Oam-Web/Oam-DockerD-Dockerfile deleted file mode 100644 index 12c4a5c..0000000 --- a/Cpop-Oam/Cpop-Oam-Web/Oam-DockerD-Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM openjdk:8-jdk -LABEL authors="Lost" -RUN mkdir -p /root/Cpop-Oam/ -ADD ./target/Cpop-Oam-Web.jar /root/Cpop-Oam/Cpop-Oam-Web.jar -ENTRYPOINT ["sh", "-c", "java -jar /root/Cpop-Oam/Cpop-Oam-Web.jar --spring.profiles.active=dockerD,core,jambox,pay"] \ No newline at end of file diff --git a/Cpop-Oam/Cpop-Oam-Web/Oam-System-Test b/Cpop-Oam/Cpop-Oam-Web/Oam-System-Test new file mode 100644 index 0000000..cd9130d --- /dev/null +++ b/Cpop-Oam/Cpop-Oam-Web/Oam-System-Test @@ -0,0 +1,6 @@ +FROM openjdk:17-oracle +LABEL authors="Lost" +RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone +RUN mkdir -p /root/Cpop-Oam/ +ADD ./target/Cpop-Oam-Web.jar /root/Cpop-Oam/Cpop-Oam-Web.jar +ENTRYPOINT ["sh", "-c", "java -Xms256m -Xmx512m -jar /root/Cpop-Oam/Cpop-Oam-Web.jar --spring.profiles.active=test,pay"] \ No newline at end of file diff --git a/Cpop-Oam/Cpop-Oam-Web/src/main/resources/application-dev.yml b/Cpop-Oam/Cpop-Oam-Web/src/main/resources/application-dev.yml index daa8158..a7abf7c 100644 --- a/Cpop-Oam/Cpop-Oam-Web/src/main/resources/application-dev.yml +++ b/Cpop-Oam/Cpop-Oam-Web/src/main/resources/application-dev.yml @@ -5,6 +5,7 @@ cpop: jwt: #白名单 white-list: /profile/**,/backstage/login,/doc.html,/webjars/**,/favicon.ico,/v3/api-docs/**,/swagger-ui.html,/swagger-ui/**,/sysCommon/miniSyncBrandAndStore,/easyLearn/callback/*/*,/easyLearn/*,/mini/cardTemplate/*,/website/**,/backstage/wxCp/*,/callback/wxCp/*/registerCode,/callback/easyLearn/**,/cloudCallback/*,/mini/summit/* + #拦截 gateway: rsa-keypair: # 公钥文件 diff --git a/Cpop-Oam/Cpop-Oam-Web/src/main/resources/application-test.yml b/Cpop-Oam/Cpop-Oam-Web/src/main/resources/application-test.yml index 91e190c..792f738 100644 --- a/Cpop-Oam/Cpop-Oam-Web/src/main/resources/application-test.yml +++ b/Cpop-Oam/Cpop-Oam-Web/src/main/resources/application-test.yml @@ -1,101 +1,94 @@ # 项目相关配置 cpop: # 文件路径 示例( Windows配置W:/WorkSpace/java/uploadPath,Linux配置 /home/baseFramework/uploadPath) - profile: /root/cpop-union/cpop-mall/upload + profile: /root/Cpop-Oam/upload jwt: #白名单 - whiteList: /websocket/*,/login,/doc.html,/webjars/**,/favicon.ico,/v2/api-docs/**,/swagger-resources,/sysCommon/miniSyncBrandAndStore,/easyLearn/callback/*/*,/easyLearn/*,/mini/cardTemplate/*,/website/**,/backstage/wxCp/*,/callback/wxCp/*/registerCode,/callback/easyLearn/**,/mini/summit/* + white-list: /profile/**,/backstage/login,/doc.html,/webjars/**,/favicon.ico,/v3/api-docs/**,/swagger-ui.html,/swagger-ui/**,/sysCommon/miniSyncBrandAndStore,/easyLearn/callback/*/*,/easyLearn/*,/mini/cardTemplate/*,/website/**,/backstage/wxCp/*,/callback/wxCp/*/registerCode,/callback/easyLearn/**,/cloudCallback/*,/mini/summit/* #拦截 gateway: rsa-keypair: # 公钥文件 - publicKeyFile: /root/jambox-union/jambox-oam/script/secretKey/publicKey + publicKeyFile: /root/Cpop-Oam/keypair/publicKey # 公钥文件 - privateKeyFile: /root/jambox-union/jambox-oam/script/secretKey/privateKey + privateKeyFile: /root/Cpop-Oam/keypair/privateKey # DataSource Config spring: application: name: Cpop-Oam-Test - #redis配置 - redis: - #地址 - host: gz-crs-lv77ii2t.sql.tencentcdb.com - #端口 - port: 27714 - #数据库 - database: 1 - #密码 - password: Cpop2022@ - #连接超时 - timeout: 5000 - jedis: - pool: - # - min-idle: 8 - # - max-idle: 16 - # - max-active: 16 - # - max-wait: -1ms - client-type: jedis data: - mongodb: - host: localhost - port: 27017 - database: rock-blade + #redis配置 + redis: + #地址 + host: gz-crs-lv77ii2t.sql.tencentcdb.com + #端口 + port: 27714 + #数据库 + database: 2 + #密码 + password: Cpop2022@ + #连接超时 + timeout: 5000 + jedis: + pool: + min-idle: 0 + max-idle: 16 + max-active: 16 + max-wait: -1ms + client-type: jedis server: - port: 8420 + port: 9420 servlet: context-path: /Cpop-Oam +# mongo-plus +mongo-plus: + data: + mongodb: + #ip + host: 1panel.cpopsz.com + #端口 + port: 27017 + #数据库名 + database: cpop_test + #用户名,没有可不填(若账号中出现@,!等等符号,不需要再进行转码!!!) + username: mongo_kBXjhm + #密码,同上(若密码中出现@,!等等符号,不需要再进行转码!!!) + password: mongo_7RF4Zj + #验证数据库 admin + authentication-database: admin + connect-timeout-m-s: 50000 + #Mybatis-Flex mybatis-flex: configuration: log-impl: org.apache.ibatis.logging.stdout.StdOutImpl datasource: oam: - url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/cpop_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 - username: root - password: Customer0401 + url: jdbc:mysql://bj-cynosdbmysql-grp-anccz88g.sql.tencentcdb.com:24808/cpop_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: cpop_test + password: zkrK3nT8TzsJABwr jambox: - url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/jambox_test?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true - username: root - password: Customer0401 + url: jdbc:mysql://bj-cynosdbmysql-grp-anccz88g.sql.tencentcdb.com:24808/cpop_test?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true + username: cpop_test + password: zkrK3nT8TzsJABwr # springdoc-openapi项目配置 +springdoc: + swagger-ui: + path: /swagger-ui.html + tags-sorter: alpha + operations-sorter: alpha + api-docs: + path: /v3/api-docs + group-configs: + - group: '系统后台' + paths-to-match: '/**' + packages-to-scan: com.cpop.oam.business.controller.backstage +# knife4j的增强配置,不需要增强可以不配 knife4j: enable: true - openapi: - title: Cpop-OAM开发API - description: PuPu-OAM开发API - email: - concat: DB - url: https://api.jamboxsys.com - version: 1.0.0 - license: Apache 2.0 - license-url: https://stackoverflow.com/ - terms-of-service-url: https://api.jamboxsys.com - group: - #系统 - system: - group-name: Oam - api-rule: package - api-rule-resources: - - com.cpop.oam - -#微信支付 -wx: - pay: - # p12证书的位置,可以指定绝对路径,也可以指定类路径(以classpath:开头) - keyPath: /root/cpop-union/cpop-oam/script/secretKey/wxPay_cert.p12 - # 私钥证书 - privateKeyPath: /root/cpop-union/cpop-oam/script/secretKey/wxPay_key.pem - # 私钥文件 - privateCertPath: /root/cpop-union/cpop-oam/script/secretKey/wxPay_cert.pem - # 先学后付用户签约通知地址 - learn-now-pay-later-user-sign-plan-notify-url: https://test.cpopsz.com/oam/Cpop-Oam/callback/easyLearn/learnNowPayLaterUserSignPlanNotify - # 先学后付用户核销通知地址 - learn-now-pay-later-service-order-notify-url: https://test.cpopsz.com/oam/Cpop-Oam/callback/easyLearn/userServiceOrderSuccess \ No newline at end of file + setting: + language: zh_cn \ No newline at end of file diff --git a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/JamboxDataSourceTests.java b/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/JamboxDataSourceTests.java index 2a3aa22..5a1a8ec 100644 --- a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/JamboxDataSourceTests.java +++ b/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/JamboxDataSourceTests.java @@ -1,7 +1,5 @@ package com.cpop.oam.web; -import com.cpop.core.utils.SpringUtils; -import com.cpop.system.business.service.BrandService; import com.mybatisflex.core.datasource.DataSourceKey; import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.core.row.Db; @@ -9,7 +7,7 @@ import com.mybatisflex.core.row.Row; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import static com.cpop.system.business.entity.table.BrandTableDef.BRAND; +import static com.cpop.oam.business.entity.table.BrandTableDef.BRAND; /** * @author DB @@ -34,7 +32,6 @@ public class JamboxDataSourceTests { } finally { DataSourceKey.clear(); } - - SpringUtils.getBean(BrandService.class).queryChain().where(BRAND.ID.eq("134483921482485760")).one(); + //SpringUtils.getBean(BrandService.class).queryChain().where(BRAND.ID.eq("134483921482485760")).one(); } } diff --git a/Cpop-Oam/pom.xml b/Cpop-Oam/pom.xml index 4eb6580..744a183 100644 --- a/Cpop-Oam/pom.xml +++ b/Cpop-Oam/pom.xml @@ -19,14 +19,15 @@ com.cpop Cpop-Core - - com.cpop - Cpop-System - com.cpop Cpop-Pay + + + com.cpop + Cpop-Api + com.github.binarywang @@ -41,6 +42,16 @@ org.springframework spring-test + + + com.tencentcloudapi + tencentcloud-sdk-java + + + + com.qcloud + cos_api + diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/WxOpenAddToTemplateBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/WxOpenAddToTemplateBo.java new file mode 100644 index 0000000..a2b22ea --- /dev/null +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/WxOpenAddToTemplateBo.java @@ -0,0 +1,31 @@ +package com.cpop.oam.business.bo; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * @author DB + * @version 1.0.0 + * @since 2024-05-08 14:14 + */ +@Data +@Accessors(chain = true) +@Schema(description = "开发平台添加模板") +public class WxOpenAddToTemplateBo { + + /** + * 草稿id + */ + @NotNull(message = "草稿id不能为空") + @Schema(description = "草稿id",requiredMode = Schema.RequiredMode.REQUIRED) + private Long draftId; + + /** + * 模板类型 + */ + @NotNull(message = "模板类型不能为空") + @Schema(description = "模板类型",requiredMode = Schema.RequiredMode.REQUIRED) + private Integer templateType; +} diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/WxOpenMaCodeCommitBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/WxOpenMaCodeCommitBo.java index 8d17b9d..3753817 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/WxOpenMaCodeCommitBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/WxOpenMaCodeCommitBo.java @@ -6,7 +6,6 @@ import jakarta.validation.constraints.NotNull; import lombok.Data; - /** * @author DB * @since 2023/10/10 17:14 @@ -29,13 +28,6 @@ public class WxOpenMaCodeCommitBo { @Schema(description = "代码库中的代码模板 ID",requiredMode = Schema.RequiredMode.REQUIRED) private Long templateId; - /** - * 为了方便第三方平台的开发者引入 extAppid 的开发调试工作 - */ - @NotBlank(message = "extJson不能为空") - @Schema(description = "该参数则是用于控制ext.json配置文件的内容",requiredMode = Schema.RequiredMode.REQUIRED) - private String extJson; - /** * 代码版本号,开发者可自定义 */ @@ -49,4 +41,11 @@ public class WxOpenMaCodeCommitBo { @NotBlank(message = "代码描述不能为空") @Schema(description = "代码描述,开发者可自定义",requiredMode = Schema.RequiredMode.REQUIRED) private String userDesc; + + /** + * 代码库中的代码模板 ID + */ + @NotNull(message = "代码库中的代码模板类型不能为空") + @Schema(description = "代码库中的代码模板类型",requiredMode = Schema.RequiredMode.REQUIRED) + private Integer templateType; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageBrandManagerController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageBrandManagerController.java index d3e5dc7..b286d5f 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageBrandManagerController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageBrandManagerController.java @@ -4,24 +4,26 @@ import com.cpop.core.base.entity.R; import com.cpop.oam.business.bo.BrandManagerBo; import com.cpop.oam.business.bo.BrandManagerPageBo; import com.cpop.oam.business.bo.StoreListByBrandBo; +import com.cpop.oam.business.entity.table.StoreTableDef; import com.cpop.oam.business.service.BrandManagerService; -import com.cpop.system.business.entity.table.StoreTableDef; -import com.cpop.system.business.service.BrandService; -import com.cpop.system.business.service.StoreService; -import com.cpop.system.business.vo.BrandListVo; +import com.cpop.oam.business.vo.BrandListVo; import com.cpop.oam.business.vo.BrandManagePageVo; -import com.cpop.system.business.vo.StoreListByBrandVo; +import com.cpop.oam.business.vo.StoreListByBrandVo; +import com.mybatisflex.core.datasource.DataSourceKey; import com.mybatisflex.core.paginate.Page; -import com.mybatisflex.core.query.QueryWrapper; +import com.mybatisflex.core.row.DbChain; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import org.springframework.beans.factory.annotation.Autowired; import java.util.List; +import java.util.concurrent.atomic.AtomicReference; + +import static com.cpop.oam.business.entity.table.BrandTableDef.BRAND; +import static com.cpop.oam.business.entity.table.StoreTableDef.STORE; -import static com.cpop.system.business.entity.table.BrandTableDef.BRAND; /** * 品牌管理员表 控制层。 @@ -37,12 +39,6 @@ public class BackstageBrandManagerController { @Autowired private BrandManagerService brandManageService; - @Autowired - private BrandService brandService; - - @Autowired - private StoreService storeService; - /** * 查询品牌管理员分页 * @author DB @@ -66,8 +62,15 @@ public class BackstageBrandManagerController { @Operation(summary = "查询品牌列表") @GetMapping("/getBrandList") public R> getBrandList(String query) { - List list = brandService.listAs(QueryWrapper.create().and(BRAND.BRAND_NAME.like(query)), BrandListVo.class); - return R.ok(list); + AtomicReference> list = new AtomicReference<>(); + try { + DataSourceKey.use("jambox", () -> { + list.set(DbChain.table(BRAND).and(BRAND.BRAND_NAME.like(query)).listAs(BrandListVo.class)); + }); + } finally { + DataSourceKey.clear(); + } + return R.ok(list.get()); } /** @@ -79,8 +82,15 @@ public class BackstageBrandManagerController { @Operation(summary = "根据品牌查询校区列表") @PostMapping("/getStoreListByBrand") public R> getCampusListByBrand(@RequestBody StoreListByBrandBo bo) { - List vos = storeService.listAs(QueryWrapper.create().and(StoreTableDef.STORE.BRAND_ID.in(bo.getBrandIds())), StoreListByBrandVo.class); - return R.ok(vos); + AtomicReference> vos = new AtomicReference<>(); + try { + DataSourceKey.use("jambox", () -> { + vos.set(DbChain.table(STORE).and(StoreTableDef.STORE.BRAND_ID.in(bo.getBrandIds())).listAs(StoreListByBrandVo.class)); + }); + } finally { + DataSourceKey.clear(); + } + return R.ok(vos.get()); } /** diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageDataImportController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageDataImportController.java index f2b7609..fce4f6b 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageDataImportController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageDataImportController.java @@ -6,13 +6,13 @@ import com.cpop.oam.business.bo.DataImportBo; import com.cpop.oam.business.bo.DataImportPageBo; import com.cpop.oam.business.dto.DataImportDto; import com.cpop.oam.business.service.DataImportService; +import com.cpop.oam.business.vo.BrandListVo; import com.cpop.oam.business.vo.DataImportPageVo; import com.cpop.oam.business.vo.StoreListVo; -import com.cpop.system.business.service.BrandService; -import com.cpop.system.business.service.StoreService; -import com.cpop.system.business.vo.BrandListVo; -import com.cpop.system.business.vo.SysFileVo; +import com.cpop.oam.business.vo.SysFileVo; +import com.mybatisflex.core.datasource.DataSourceKey; import com.mybatisflex.core.paginate.Page; +import com.mybatisflex.core.row.DbChain; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; @@ -27,9 +27,10 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; +import java.util.concurrent.atomic.AtomicReference; -import static com.cpop.system.business.entity.table.BrandTableDef.BRAND; -import static com.cpop.system.business.entity.table.StoreTableDef.STORE; +import static com.cpop.oam.business.entity.table.BrandTableDef.BRAND; +import static com.cpop.oam.business.entity.table.StoreTableDef.STORE; /** * oam-数据导入表 控制层。 @@ -45,12 +46,6 @@ public class BackstageDataImportController { @Autowired private DataImportService dataImportService; - @Autowired - private BrandService brandService; - - @Autowired - private StoreService storeService; - /** * 数据导入分页查询 * @author DB @@ -75,8 +70,15 @@ public class BackstageDataImportController { @Operation(summary = "获取品牌列表") @GetMapping("/getBrandList") public R> getBrandList(@Parameter(description = "品牌名") String brandName) { - List list = brandService.queryChain().and(BRAND.BRAND_NAME.like(brandName)).listAs(BrandListVo.class); - return R.ok(list); + AtomicReference> list = new AtomicReference<>(); + try { + DataSourceKey.use("jambox", () -> { + list.set(DbChain.table(BRAND).and(BRAND.BRAND_NAME.like(brandName)).listAs(BrandListVo.class)); + }); + } finally { + DataSourceKey.clear(); + } + return R.ok(list.get()); } /** @@ -89,8 +91,15 @@ public class BackstageDataImportController { @Operation(summary = "获取校区/店铺列表") @GetMapping("/getStoreList") public R> getStoreList(@Parameter(description = "品牌id") String brandId) { - List list = storeService.queryChain().and(STORE.BRAND_ID.eq(brandId)).listAs(StoreListVo.class); - return R.ok(list); + AtomicReference> list = new AtomicReference<>(); + try { + DataSourceKey.use("jambox", () -> { + list.set(DbChain.table(STORE).and(STORE.BRAND_ID.like(brandId)).listAs(StoreListVo.class)); + }); + } finally { + DataSourceKey.clear(); + } + return R.ok(list.get()); } /** diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageLoginController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageLoginController.java index bd0ccdf..500aa78 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageLoginController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageLoginController.java @@ -15,8 +15,8 @@ import com.cpop.core.utils.ip.IpUtils; import com.cpop.oam.business.bo.LoginForm; import com.cpop.oam.business.service.LoginService; import com.cpop.oam.business.vo.loginInfo.SysStaffLoginInfo; -import com.cpop.system.business.vo.LoginUserInfoVo; -import com.cpop.system.business.vo.MenuRouteVo; +import com.cpop.oam.business.vo.LoginUserInfoVo; +import com.cpop.oam.business.vo.MenuRouteVo; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageMenuController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageMenuController.java index 2298c4a..61fc763 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageMenuController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageMenuController.java @@ -1,10 +1,10 @@ package com.cpop.oam.business.controller.backstage; import com.cpop.core.base.entity.R; -import com.cpop.system.business.bo.MenuBo; -import com.cpop.system.business.bo.MenuListBo; +import com.cpop.oam.business.bo.MenuBo; +import com.cpop.oam.business.bo.MenuListBo; import com.cpop.oam.business.service.MenuService; -import com.cpop.system.business.vo.MenuVo; +import com.cpop.oam.business.vo.MenuVo; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageRoleController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageRoleController.java index 7d0aa37..e9ae724 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageRoleController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageRoleController.java @@ -1,14 +1,14 @@ package com.cpop.oam.business.controller.backstage; import com.cpop.core.base.entity.R; -import com.cpop.system.business.bo.MenuListBo; -import com.cpop.system.business.bo.RoleBo; -import com.cpop.system.business.bo.RolePageBo; -import com.cpop.system.business.bo.RoleStatusBo; +import com.cpop.oam.business.bo.MenuListBo; +import com.cpop.oam.business.bo.RoleBo; +import com.cpop.oam.business.bo.RolePageBo; +import com.cpop.oam.business.bo.RoleStatusBo; import com.cpop.oam.business.service.MenuService; import com.cpop.oam.business.service.RoleService; -import com.cpop.system.business.vo.MenuVo; -import com.cpop.system.business.vo.RolePageVo; +import com.cpop.oam.business.vo.MenuVo; +import com.cpop.oam.business.vo.RolePageVo; import com.mybatisflex.core.paginate.Page; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageSysCommonController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageSysCommonController.java index f6e7136..b083506 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageSysCommonController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageSysCommonController.java @@ -3,7 +3,7 @@ package com.cpop.oam.business.controller.backstage; import com.cpop.core.base.entity.R; import com.cpop.core.utils.file.FileUploadUtils; import com.cpop.core.utils.file.FileUtils; -import com.cpop.system.business.vo.SysFileVo; +import com.cpop.oam.business.vo.SysFileVo; import com.cpop.oam.framework.handler.tencentCos.TencentCosHandler; import com.qcloud.cos.model.UploadResult; import io.swagger.v3.oas.annotations.Operation; diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageTaskDemandController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageTaskDemandController.java index 293cbe7..b8ce1a5 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageTaskDemandController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageTaskDemandController.java @@ -8,10 +8,10 @@ import com.cpop.oam.business.service.TaskDemandService; import com.cpop.oam.business.vo.StoreListVo; import com.cpop.oam.business.vo.TaskDemandPageVo; import com.cpop.oam.business.vo.TaskDemandUrgentVo; -import com.cpop.system.business.service.BrandService; -import com.cpop.system.business.service.StoreService; -import com.cpop.system.business.vo.BrandListVo; +import com.cpop.oam.business.vo.BrandListVo; +import com.mybatisflex.core.datasource.DataSourceKey; import com.mybatisflex.core.paginate.Page; +import com.mybatisflex.core.row.DbChain; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; @@ -20,9 +20,10 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import java.util.List; +import java.util.concurrent.atomic.AtomicReference; -import static com.cpop.system.business.entity.table.BrandTableDef.BRAND; -import static com.cpop.system.business.entity.table.StoreTableDef.STORE; +import static com.cpop.oam.business.entity.table.BrandTableDef.BRAND; +import static com.cpop.oam.business.entity.table.StoreTableDef.STORE; /** * OAM-任务-需求表 控制层。 @@ -38,12 +39,6 @@ public class BackstageTaskDemandController { @Autowired private TaskDemandService taskDemandService; - @Autowired - private BrandService brandService; - - @Autowired - private StoreService storeService; - /** * 工单模块-需求-需求分页列表 * @author DB @@ -105,8 +100,15 @@ public class BackstageTaskDemandController { @Operation(summary = "工单模块-工单提交-获取品牌列表") @GetMapping("/getBrandList") public R> getBrandList(@Parameter(description = "品牌名") String brandName) { - List list = brandService.queryChain().and(BRAND.BRAND_NAME.like(brandName)).listAs(BrandListVo.class); - return R.ok(list); + AtomicReference> list = new AtomicReference<>(); + try { + DataSourceKey.use("jambox", () -> { + list.set(DbChain.table(BRAND).and(BRAND.BRAND_NAME.like(brandName)).listAs(BrandListVo.class)); + }); + } finally { + DataSourceKey.clear(); + } + return R.ok(list.get()); } /** @@ -118,8 +120,15 @@ public class BackstageTaskDemandController { @Operation(summary = "工单模块-工单提交-获取校区/店铺列表") @GetMapping("/getStoreList") public R> getStoreList(@Parameter(description = "品牌id") String brandId) { - List list = storeService.queryChain().and(STORE.BRAND_ID.eq(brandId)).listAs(StoreListVo.class); - return R.ok(list); + AtomicReference> list = new AtomicReference<>(); + try { + DataSourceKey.use("jambox", () -> { + list.set(DbChain.table(STORE).and(STORE.BRAND_ID.like(brandId)).listAs(StoreListVo.class)); + }); + } finally { + DataSourceKey.clear(); + } + return R.ok(list.get()); } /** diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageTaskWorkOrderController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageTaskWorkOrderController.java index 0842418..c5a7713 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageTaskWorkOrderController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageTaskWorkOrderController.java @@ -7,10 +7,9 @@ import com.cpop.oam.business.bo.TaskWorkOrderBo; import com.cpop.oam.business.bo.TaskWorkOrderRecordBo; import com.cpop.oam.business.service.TaskWorkOrderService; import com.cpop.oam.business.vo.*; -import com.cpop.system.business.service.BrandService; -import com.cpop.system.business.service.StoreService; -import com.cpop.system.business.vo.BrandListVo; +import com.mybatisflex.core.datasource.DataSourceKey; import com.mybatisflex.core.paginate.Page; +import com.mybatisflex.core.row.DbChain; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; @@ -21,9 +20,10 @@ import org.springframework.web.bind.annotation.*; import java.time.LocalDate; import java.util.List; +import java.util.concurrent.atomic.AtomicReference; -import static com.cpop.system.business.entity.table.BrandTableDef.BRAND; -import static com.cpop.system.business.entity.table.StoreTableDef.STORE; +import static com.cpop.oam.business.entity.table.BrandTableDef.BRAND; +import static com.cpop.oam.business.entity.table.StoreTableDef.STORE; /** * 工单模块 @@ -38,12 +38,6 @@ public class BackstageTaskWorkOrderController { @Autowired private TaskWorkOrderService taskWorkOrderService; - @Autowired - private BrandService brandService; - - @Autowired - private StoreService storeService; - /** * 工单模块-工单提交-接收/处理/暂停中 * @author DB @@ -181,9 +175,16 @@ public class BackstageTaskWorkOrderController { */ @Operation(summary = "工单模块-工单提交-获取品牌列表") @GetMapping("/getBrandList") - public R> getBrandList(@Parameter(description ="品牌名") String brandName) { - List list = brandService.queryChain().and(BRAND.BRAND_NAME.like(brandName)).listAs(BrandListVo.class); - return R.ok(list); + public R> getBrandList(@Parameter(description = "品牌名") String brandName) { + AtomicReference> list = new AtomicReference<>(); + try { + DataSourceKey.use("jambox", () -> { + list.set(DbChain.table(BRAND).and(BRAND.BRAND_NAME.like(brandName)).listAs(BrandListVo.class)); + }); + } finally { + DataSourceKey.clear(); + } + return R.ok(list.get()); } /** @@ -195,8 +196,15 @@ public class BackstageTaskWorkOrderController { @Operation(summary = "工单模块-工单提交-获取校区/店铺列表") @GetMapping("/getStoreList") public R> getStoreList(@Parameter(description ="品牌id") String brandId) { - List list = storeService.queryChain().and(STORE.BRAND_ID.eq(brandId)).listAs(StoreListVo.class); - return R.ok(list); + AtomicReference> list = new AtomicReference<>(); + try { + DataSourceKey.use("jambox", () -> { + list.set(DbChain.table(STORE).and(STORE.BRAND_ID.like(brandId)).listAs(StoreListVo.class)); + }); + } finally { + DataSourceKey.clear(); + } + return R.ok(list.get()); } /** diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageWxCpController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageWxCpController.java index 00bb29c..aefffd8 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageWxCpController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageWxCpController.java @@ -4,7 +4,7 @@ import com.cpop.core.base.entity.R; import com.cpop.oam.business.service.OamWxCpService; import com.cpop.oam.business.vo.WxCpLoginVo; import com.cpop.oam.framework.config.wxCp.WxCpConfiguration; -import com.cpop.system.business.vo.LoginUserInfoVo; +import com.cpop.oam.business.vo.LoginUserInfoVo; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.servlet.http.HttpServletRequest; diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageWxOpenController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageWxOpenController.java index 4ed1ad4..9f2d65e 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageWxOpenController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageWxOpenController.java @@ -6,26 +6,27 @@ import com.cpop.core.base.entity.R; import com.cpop.core.base.exception.ServiceException; import com.cpop.core.utils.SqlUtils; import com.cpop.core.utils.StringUtils; +import com.cpop.oam.business.bo.WxOpenAddToTemplateBo; import com.cpop.oam.business.bo.WxOpenMaCodeCommitBo; import com.cpop.oam.business.bo.WxOpenMaTrialQrCodeBo; import com.cpop.oam.business.service.WxOpenMiniService; import com.cpop.oam.business.vo.WxOpenMiniVo; -import com.cpop.oam.framework.config.wxOpen.WechatOpenProperties; -import com.cpop.oam.framework.handler.wxOpen.WxOpenService; +import com.cpop.oam.framework.handler.wxOpen.WxOpenHandler; import com.mybatisflex.core.paginate.Page; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.extern.slf4j.Slf4j; import me.chanjar.weixin.common.api.WxConsts; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.mp.bean.kefu.WxMpKefuMessage; import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; import me.chanjar.weixin.open.bean.WxOpenMaCodeTemplate; +import me.chanjar.weixin.open.bean.ma.WxMaOpenCommitExtInfo; +import me.chanjar.weixin.open.bean.ma.WxMaOpenCommitStandardExt; import me.chanjar.weixin.open.bean.message.WxOpenMaSubmitAuditMessage; import me.chanjar.weixin.open.bean.message.WxOpenXmlMessage; import me.chanjar.weixin.open.bean.result.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -37,7 +38,9 @@ import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.util.Base64; +import java.util.Comparator; import java.util.List; +import java.util.stream.Collectors; /** * @author DB @@ -47,15 +50,11 @@ import java.util.List; @RestController @Tag(name = "微信开放平台模块") @RequestMapping("/backstage/wxOpen") +@Slf4j public class BackstageWxOpenController { - private final Logger logger = LoggerFactory.getLogger(this.getClass()); - @Autowired - private WxOpenService wxOpenService; - - @Autowired - private WechatOpenProperties properties; + private WxOpenHandler wxOpenService; @Autowired private WxOpenMiniService wxOpenMiniService; @@ -84,26 +83,21 @@ public class BackstageWxOpenController { try { wxOpenService.getWxOpenComponentService().route(inMessage); } catch (WxErrorException e) { - this.logger.error("wxOpen:receiveTicket", e); + log.error("wxOpen:receiveTicket", e); } return "success"; } /** - * @Description: 获取授权链接 + * 获取授权链接 * @return R - * @Author DB - * @Date: 2023/6/14 21:47 + * @author DB + * @since 2023/6/14 21:47 */ @Operation(summary = "获取授权链接") @GetMapping("/getAuthorizedLink") - public R getAuthorizedLink() { - String preAuthUrl; - try { - preAuthUrl = wxOpenService.getWxOpenComponentService().getPreAuthUrl(properties.getAuthorizedLink()); - } catch (WxErrorException e) { - throw new ServiceException(e.getMessage()); - } + public R getAuthorizedLink() throws WxErrorException { + String preAuthUrl = wxOpenService.getWxOpenComponentService().getPreAuthUrl(wxOpenService.getWechatOpenProperties().getAuthorizedLink()); return R.ok(preAuthUrl); } @@ -120,7 +114,7 @@ public class BackstageWxOpenController { try { return wxOpenService.getWxOpenComponentService().getQueryAuth(authorizationCode); } catch (WxErrorException e) { - logger.error("gotoPreAuthUrl", e); + log.error("gotoPreAuthUrl", e); throw new ServiceException(e.getMessage()); } } @@ -174,7 +168,7 @@ public class BackstageWxOpenController { wxOpenService.getWxOpenComponentService().getWxMpServiceByAppid(appId).getKefuService().sendKefuMessage(kefuMessage); } } catch (WxErrorException e) { - logger.error("callback", e); + log.error("callback", e); } }else{ WxMpXmlOutMessage outMessage = wxOpenService.getWxOpenMessageRouter().route(inMessage, appId); @@ -196,7 +190,7 @@ public class BackstageWxOpenController { @GetMapping("/bindOpenAccount/{appid}") public R bindOpenAccount(@PathVariable String appid) { try { - wxOpenService.getWxOpenComponentService().bindOpenAccount(appid, WxConsts.AppIdType.MINI_TYPE, properties.getComponentAppId()); + wxOpenService.getWxOpenComponentService().bindOpenAccount(appid, WxConsts.AppIdType.MINI_TYPE, wxOpenService.getWechatOpenProperties().getComponentAppId()); } catch (WxErrorException e) { throw new ServiceException(e.getMessage()); } @@ -214,7 +208,7 @@ public class BackstageWxOpenController { @GetMapping("/unbindOpenAccount/{appid}") public R unbindOpenAccount(@PathVariable String appid) { try { - wxOpenService.getWxOpenComponentService().unbindOpenAccount(appid, WxConsts.AppIdType.MINI_TYPE, properties.getComponentAppId()); + wxOpenService.getWxOpenComponentService().unbindOpenAccount(appid, WxConsts.AppIdType.MINI_TYPE, wxOpenService.getWechatOpenProperties().getComponentAppId()); } catch (WxErrorException e) { throw new ServiceException(e.getMessage()); } @@ -290,7 +284,7 @@ public class BackstageWxOpenController { public R commit(@RequestBody @Validated WxOpenMaCodeCommitBo bo) { try { wxOpenService.getWxOpenComponentService().getWxMaServiceByAppid(bo.getAuthorizerAppid()) - .codeCommit(bo.getTemplateId(),bo.getUserVersion(),bo.getUserDesc(),bo.getExtJson()); + .codeCommit(bo.getTemplateId(), bo.getUserVersion(), bo.getUserDesc(), bo.getTemplateType() == 0 ? WxMaOpenCommitExtInfo.INSTANCE() : new WxMaOpenCommitStandardExt()); } catch (WxErrorException e) { throw new ServiceException(e.getMessage()); } @@ -331,10 +325,9 @@ public class BackstageWxOpenController { */ @Operation(summary = "提交代码审核") @PostMapping("/submitAudit/{authorizerAppid}") - public R submitAudit(@PathVariable String authorizerAppid ,@RequestBody WxOpenMaSubmitAuditMessage message) { + public R submitAudit(@PathVariable String authorizerAppid) { try { - WxOpenMaSubmitAuditResult wxOpenMaSubmitAuditResult = wxOpenService.getWxOpenComponentService().getWxMaServiceByAppid(authorizerAppid) - .submitAudit(message); + WxOpenMaSubmitAuditResult wxOpenMaSubmitAuditResult = wxOpenService.getWxOpenComponentService().getWxMaServiceByAppid(authorizerAppid).submitAudit(new WxOpenMaSubmitAuditMessage()); return R.ok(wxOpenMaSubmitAuditResult); } catch (WxErrorException e) { throw new ServiceException(e.getMessage()); @@ -448,7 +441,7 @@ public class BackstageWxOpenController { * 查询最新一次审核单状态 * @return R * @author DB - * @Date: 2023/6/16 0016 17:34 + * @since 2023/6/16 0016 17:34 */ @Operation(summary = "查询最新一次审核单状态") @GetMapping("/getLatestAuditStatus/{authorizerAppid}") @@ -489,7 +482,7 @@ public class BackstageWxOpenController { public R> getTemplateList(Integer templateType) { try { List templateList = wxOpenService.getWxOpenComponentService().getTemplateList(templateType); - return R.ok(templateList); + return R.ok(templateList.stream().sorted(Comparator.comparing(WxOpenMaCodeTemplate::getCreateTime).reversed()).collect(Collectors.toList())); } catch (WxErrorException e) { throw new ServiceException(e.getMessage()); } @@ -506,7 +499,7 @@ public class BackstageWxOpenController { public R> getTemplateDraftList() { try { List templateDraftList = wxOpenService.getWxOpenComponentService().getTemplateDraftList(); - return R.ok(templateDraftList); + return R.ok(templateDraftList.stream().sorted(Comparator.comparing(WxOpenMaCodeTemplate::getCreateTime).reversed()).collect(Collectors.toList())); } catch (WxErrorException e) { throw new ServiceException(e.getMessage()); } @@ -516,14 +509,12 @@ public class BackstageWxOpenController { * 将草稿添加到模板库 * @author DB * @since 2023/10/10 18:16 - * @param draftId 草稿id - * @param templateType 模板类型 */ @Operation(summary = "将草稿添加到模板库") @PostMapping("/addToTemplate") - public R addToTemplate(@RequestParam("draftId") Long draftId, @RequestParam("templateType") Integer templateType) { + public R addToTemplate(@RequestBody @Validated WxOpenAddToTemplateBo bo) { try { - wxOpenService.getWxOpenComponentService().addToTemplate(draftId, templateType); + wxOpenService.getWxOpenComponentService().addToTemplate(bo.getDraftId(), bo.getTemplateType()); } catch (WxErrorException e) { throw new ServiceException(e.getMessage()); } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/entity/Brand.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/entity/Brand.java new file mode 100644 index 0000000..5236257 --- /dev/null +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/entity/Brand.java @@ -0,0 +1,191 @@ +package com.cpop.oam.business.entity; + +import com.cpop.core.base.entity.BaseEntity; +import com.cpop.core.base.entity.BaseInsertListener; +import com.cpop.core.base.entity.BaseUpdateListener; +import com.mybatisflex.annotation.Column; +import com.mybatisflex.annotation.Id; +import com.mybatisflex.annotation.Table; +import lombok.*; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * 系统-品牌表 实体类。 + * + * @author DB + * @since 2023-10-25 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Builder +@NoArgsConstructor +@AllArgsConstructor +@Accessors(chain = true) +@Table(value = "j_sys_brand", dataSource = "jambox", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) +public class Brand extends BaseEntity implements Serializable { + + /** + * 主键 + */ + @Id + private String id; + + /** + * 品牌名 + */ + private String brandName; + + /** + * 品牌logo + */ + private String brandLogo; + + /** + * 品牌名简称 + */ + private String simpleBrandName; + + /** + * 微信商户号 + */ + private String wxMchId; + + /** + * 微信商户名称 + */ + private String wxMchName; + + /** + * 微信商户管理员 + */ + private String wxMchAdmin; + + /** + * 授权产品(0:商城;1:先学后付次付;2:先学后付月付;3:一次性支付) + */ + private Integer authProduct; + + /** + * 小程序名 + */ + private String wxMiniName; + + /** + * 负责人 + */ + private String personChargeName; + + /** + * 负责人手机号 + */ + private String personChargePhone; + + /** + * 品牌横图 + */ + private String brandHorizontalGraph; + + /** + * 品牌长图 + */ + private String brandLongChart; + + /** + * 主色系 + */ + private String mainColor; + + /** + * 副色系 + */ + private String secondaryColor; + + /** + * 管理模式(0:全直营;1:直营+加盟;2:全加盟) + */ + private Integer manageType; + + /** + * 省 + */ + private String province; + + /** + * 市 + */ + private String city; + + /** + * 区 + */ + private String region; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 品牌地址 + */ + private String brandAddr; + + /** + * 品牌学员端二维码 + */ + private String brandWxQr; + + /** + * 总部营业执照地址 + */ + private String licenseAddr; + + /** + * 总部营业执照社会信用代码 + */ + private String licenseCreditCode; + + /** + * 总部营业执照日期 + */ + private String licenseDate; + + /** + * 总部营业执照公司名 + */ + private String licenseFirmName; + + /** + * 总部公司属性(0:个体;1:企业) + */ + private Boolean licenseStats; + + /** + * 总部营业执照法人名 + */ + private String licenseUsername; + + /** + * 总部营业执照图片地址 + */ + private String licensePicUrl; + + /** + * 是否首次登录 + */ + private Boolean perfectInformation; + + /** + * 逻辑删除(0否1是) + */ + @Column(isLogicDelete = true) + private Boolean isDelete; + +} diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/entity/Store.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/entity/Store.java new file mode 100644 index 0000000..7eae6de --- /dev/null +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/entity/Store.java @@ -0,0 +1,256 @@ +package com.cpop.oam.business.entity; + +import com.cpop.core.base.entity.BaseEntity; +import com.cpop.core.base.entity.BaseInsertListener; +import com.cpop.core.base.entity.BaseUpdateListener; +import com.mybatisflex.annotation.Column; +import com.mybatisflex.annotation.Id; +import com.mybatisflex.annotation.Table; +import lombok.*; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * 系统-店铺/校区表 实体类。 + * + * @author DB + * @since 2023-10-26 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@Builder +@NoArgsConstructor +@AllArgsConstructor +@Accessors(chain = true) +@Table(value = "j_sys_store", dataSource = "jambox", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) +public class Store extends BaseEntity implements Serializable { + + /** + * 店铺/校区id + */ + @Id + private String id; + + /** + * 品牌id + */ + private String brandId; + + /** + * 店铺/校区名 + */ + private String storeName; + + /** + * 负责人 + */ + private String personChargeName; + + /** + * 手机号 + */ + private String personChargePhone; + + /** + * 店铺/校区地址 + */ + private String storeAddr; + + /** + * 校区横图 + */ + private String storeHorizontalGraph; + + /** + * 省 + */ + private String province; + + /** + * 市 + */ + private String city; + + /** + * 区 + */ + private String region; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 校区营业执照地址 + */ + private String licenseAddr; + + /** + * 校区营业执照日期 + */ + private String licenseDate; + + /** + * 总部营业执照社会信用代码 + */ + private String licenseCreditCode; + + /** + * 校区营业执照公司名 + */ + private String licenseFirmName; + + /** + * 校区公司属性(0:个体;1:企业) + */ + private Boolean licenseStats; + + /** + * 校区营业执照法人名 + */ + private String licenseUsername; + + /** + * 校区营业执照图片地址 + */ + private String licensePicUrl; + + /** + * 微信商户名称 + */ + private String wxMchName; + + /** + * 微信商户号 + */ + private String wxMchId; + + /** + * 微信商户管理员 + */ + private String wxMchAdmin; + + /** + * 授权产品(0:商城;1:先学后付次付;2:先学后付月付;3:一次性支付) + */ + private Integer authProduct; + + /** + * 校区学员端二维码 + */ + private String storeWxQr; + + /** + * 合约内容 + */ + private String contractContent; + + /** + * 合约签名 + */ + private String contractSign; + + /** + * 开启课卡权益审批 + */ + private Boolean openCardEquityAudit; + + /** + * 开启账单变动审核 + */ + private Boolean openBillChangeAudit; + + /** + * 预创建员工权限组 + */ + private Boolean preCreateStaffPermissionGroup; + + /** + * 创建课卡类型 + */ + private Boolean preCreateCardType; + + /** + * 预创建客户类型 + */ + private Boolean preCreateCustomerType; + + /** + * 开启预约人数隐藏 + */ + private Boolean openPreCustomerNumHide; + + /** + * 开启金额隐藏 + */ + private Boolean openAmountHide; + + /** + * 开启预约排队功能 + */ + private Boolean openPreQueue; + + /** + * 开启按课次课消 + */ + private Boolean openClassTimeConsume; + + /** + * 开启自动复制课表 + */ + private Boolean openAutoCopyClassSchedule; + + /** + * 课前可预约时间 + */ + private Integer beforeClassCourseReservationTime; + + /** + * 课前不可预约时间 + */ + private Integer beforeClassNotCourseReservationTime; + + /** + * 课前取消预约时间 + */ + private Integer beforeClassCancelCourseReservationTime; + + /** + * 课前请假时间 + */ + private Integer beforeClassLeaveTime; + + /** + * 新课卡默认缓存时间 + */ + private Integer newClassCardBufferTime; + + /** + * 品牌预设模板id + */ + private String brandPreinstallTemplateId; + + /** + * 是否首次登录 + */ + private Boolean perfectInformation; + + /** + * 授权微信商户(使用品牌绑定的微信商户) + */ + private Boolean authWxMch; + + /** + * 逻辑删除(0否1是) + */ + @Column(isLogicDelete = true) + private Boolean isDelete; + +} diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/entity/StoreSign.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/entity/StoreSign.java new file mode 100644 index 0000000..e791232 --- /dev/null +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/entity/StoreSign.java @@ -0,0 +1,82 @@ +package com.cpop.oam.business.entity; + +import com.cpop.core.base.entity.BaseEntity; +import com.cpop.core.base.entity.BaseInsertListener; +import com.cpop.core.base.entity.BaseUpdateListener; +import com.mybatisflex.annotation.Column; +import com.mybatisflex.annotation.Id; +import com.mybatisflex.annotation.Table; +import lombok.*; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.time.LocalDate; + +/** + * 校区-签约表 实体类。 + * + * @author DB + * @since 2024-03-07 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@Builder +@NoArgsConstructor +@AllArgsConstructor +@Accessors(chain = true) +@Table(value = "j_sys_store_sign", dataSource = "jambox", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) +public class StoreSign extends BaseEntity implements Serializable { + + /** + * 主键 + */ + @Id + private String id; + + /** + * 校区/店铺id + */ + private String storeId; + + /** + * 签约状态(0:未签约;1:已签约;2:已过期) + */ + private Integer signStatus; + + /** + * 到期日期 + */ + private LocalDate expireDate; + + /** + * 签约员工id + */ + private String signStaffId; + + /** + * 是否流失 + */ + private Boolean isLoss; + + /** + * 流失日期 + */ + private LocalDate runOffDate; + + /** + * 流失原因 + */ + private String runOffReason; + + /** + * 签约月份 + */ + private String signMonth; + + /** + * 逻辑删除(0否1是) + */ + @Column(isLogicDelete = true) + private Boolean isDelete; + +} diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/entity/WxOpenMini.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/entity/WxOpenMini.java index 152f0f2..eacd122 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/entity/WxOpenMini.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/entity/WxOpenMini.java @@ -40,11 +40,7 @@ public class WxOpenMini extends BaseEntity implements Serializable { /** * 昵称 */ - private String nickName; - - - - + private String nickname; /** * 逻辑删除(0否1是) diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/DataImportService.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/DataImportService.java index 87d11d4..6938497 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/DataImportService.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/DataImportService.java @@ -2,15 +2,13 @@ package com.cpop.oam.business.service; import com.cpop.oam.business.bo.DataImportBo; import com.cpop.oam.business.bo.DataImportPageBo; +import com.cpop.oam.business.entity.DataImport; import com.cpop.oam.business.vo.DataImportPageVo; -import com.cpop.system.business.vo.SysFileVo; +import com.cpop.oam.business.vo.SysFileVo; import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.service.IService; -import com.cpop.oam.business.entity.DataImport; import org.springframework.web.multipart.MultipartFile; -import java.io.IOException; - /** * oam-数据导入表 服务层。 * diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/LoginService.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/LoginService.java index 3cb76c7..3e03238 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/LoginService.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/LoginService.java @@ -2,8 +2,8 @@ package com.cpop.oam.business.service; import com.cpop.oam.business.bo.LoginForm; import com.cpop.oam.business.vo.loginInfo.SysStaffLoginInfo; -import com.cpop.system.business.vo.LoginUserInfoVo; -import com.cpop.system.business.vo.MenuRouteVo; +import com.cpop.oam.business.vo.LoginUserInfoVo; +import com.cpop.oam.business.vo.MenuRouteVo; import java.util.List; import java.util.Set; diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/MenuService.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/MenuService.java index 1d389e4..279825d 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/MenuService.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/MenuService.java @@ -1,9 +1,9 @@ package com.cpop.oam.business.service; -import com.cpop.system.business.bo.MenuBo; -import com.cpop.system.business.bo.MenuListBo; -import com.cpop.system.business.vo.MenuRouteVo; -import com.cpop.system.business.vo.MenuVo; +import com.cpop.oam.business.bo.MenuBo; +import com.cpop.oam.business.bo.MenuListBo; +import com.cpop.oam.business.vo.MenuRouteVo; +import com.cpop.oam.business.vo.MenuVo; import com.mybatisflex.core.service.IService; import com.cpop.oam.business.entity.Menu; diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/RoleService.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/RoleService.java index 88b96d0..43b8194 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/RoleService.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/RoleService.java @@ -1,9 +1,9 @@ package com.cpop.oam.business.service; -import com.cpop.system.business.bo.RoleBo; -import com.cpop.system.business.bo.RolePageBo; -import com.cpop.system.business.bo.RoleStatusBo; -import com.cpop.system.business.vo.RolePageVo; +import com.cpop.oam.business.bo.RoleBo; +import com.cpop.oam.business.bo.RolePageBo; +import com.cpop.oam.business.bo.RoleStatusBo; +import com.cpop.oam.business.vo.RolePageVo; import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.service.IService; import com.cpop.oam.business.entity.Role; diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/BrandManagerServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/BrandManagerServiceImpl.java index fb90cc3..2baeb42 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/BrandManagerServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/BrandManagerServiceImpl.java @@ -17,8 +17,8 @@ import org.springframework.transaction.annotation.Transactional; import static com.cpop.oam.business.entity.table.BrandManagerStoreTableDef.BRAND_MANAGER_STORE; import static com.cpop.oam.business.entity.table.BrandManagerTableDef.BRAND_MANAGER; -import static com.cpop.system.business.entity.table.BrandTableDef.BRAND; -import static com.cpop.system.business.entity.table.StoreTableDef.STORE; +import static com.cpop.oam.business.entity.table.BrandTableDef.BRAND; +import static com.cpop.oam.business.entity.table.StoreTableDef.STORE; import static com.mybatisflex.core.query.QueryMethods.distinct; import static com.mybatisflex.core.query.QueryMethods.groupConcat; diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/BusinessServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/BusinessServiceImpl.java index 2903733..b4dcc1e 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/BusinessServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/BusinessServiceImpl.java @@ -25,12 +25,11 @@ import com.cpop.oam.business.vo.BusinessInfoPageVo; import com.cpop.oam.business.vo.BusinessPageVo; import com.cpop.oam.business.vo.BusinessUnSignPageVo; import com.cpop.oam.business.vo.PersonBusinessInfoVo; -import com.cpop.system.business.entity.Store; -import com.cpop.system.business.entity.StoreSign; -import com.cpop.system.business.service.StoreService; -import com.cpop.system.business.service.StoreSignService; +import com.mybatisflex.core.datasource.DataSourceKey; import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.query.QueryWrapper; +import com.mybatisflex.core.row.DbChain; +import com.mybatisflex.core.row.RowKey; import com.mybatisflex.spring.service.impl.ServiceImpl; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -48,15 +47,15 @@ import java.util.List; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; +import static com.cpop.oam.business.entity.table.BrandTableDef.BRAND; import static com.cpop.oam.business.entity.table.BusinessDetailTableDef.BUSINESS_DETAIL; import static com.cpop.oam.business.entity.table.BusinessStaffTableDef.BUSINESS_STAFF; import static com.cpop.oam.business.entity.table.BusinessTableDef.BUSINESS; import static com.cpop.oam.business.entity.table.ClueTableDef.CLUE; import static com.cpop.oam.business.entity.table.SignGoalTableDef.SIGN_GOAL; import static com.cpop.oam.business.entity.table.StaffTableDef.STAFF; -import static com.cpop.system.business.entity.table.BrandTableDef.BRAND; -import static com.cpop.system.business.entity.table.StoreSignTableDef.STORE_SIGN; -import static com.cpop.system.business.entity.table.StoreTableDef.STORE; +import static com.cpop.oam.business.entity.table.StoreSignTableDef.STORE_SIGN; +import static com.cpop.oam.business.entity.table.StoreTableDef.STORE; /** * Oam-事务表 服务层实现。 @@ -163,10 +162,16 @@ public class BusinessServiceImpl extends ServiceImpl i BusinessStaff businessStaff = BeanUtils.mapToClass(item, BusinessStaff.class); businessStaff.setBusinessId(businessId).setSurplusQuantity(businessDistributeDataList.size()).setStaffId(item.getStaffId()); businessStaffService.save(businessStaff); - List businessDetails = SpringUtils.getBean(StoreService.class).queryChain() - .select(STORE.BRAND_ID, STORE.ID.as(BusinessDetail::getStoreId)) - .where(STORE.ID.in(businessDistributeDataList.stream().map(BusinessDistributeDto::getStoreId).collect(Collectors.toSet()))) - .listAs(BusinessDetail.class); + List businessDetails; + try { + DataSourceKey.use("jambox"); + businessDetails = DbChain.table(STORE) + .select(STORE.BRAND_ID, STORE.ID.as(BusinessDetail::getStoreId)) + .where(STORE.ID.in(businessDistributeDataList.stream().map(BusinessDistributeDto::getStoreId).collect(Collectors.toSet()))) + .listAs(BusinessDetail.class); + } finally { + DataSourceKey.clear(); + } if (businessDetails.size() != businessDistributeDataList.size()) { throw new ServiceException("校区查询匹配失败,请核实数据后重新提交"); } @@ -255,7 +260,13 @@ public class BusinessServiceImpl extends ServiceImpl i } else { businessDetail = new BusinessDetail(); //获取校区数据 - Store store = SpringUtils.getBean(StoreService.class).getById(bo.getStoreId()); + Store store; + try { + DataSourceKey.use("jambox"); + store = DbChain.table(STORE).where(STORE.ID.eq(bo.getStoreId())).oneAs(Store.class); + } finally { + DataSourceKey.clear(); + } //获取事务员工 BusinessStaff businessStaff = SpringUtils.getBean(BusinessStaffService.class).getOne(QueryWrapper.create() .where(BUSINESS_STAFF.BUSINESS_ID.eq(bo.getBusinessId())) @@ -363,8 +374,12 @@ public class BusinessServiceImpl extends ServiceImpl i storeSign.setStoreId(id); storeSign.setSignStaffId(session.getString("id")); storeSign.setSignMonth(LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM"))); - StoreSignService storeSignService = SpringUtils.getBean(StoreSignService.class); - storeSignService.save(storeSign); + try { + DataSourceKey.use("jambox"); + DbChain.table(STORE_SIGN).setId(RowKey.SNOW_FLAKE_ID).save(storeSign); + } finally { + DataSourceKey.clear(); + } //线索归档 ClueService clueService = SpringUtils.getBean(ClueService.class); Clue clue = clueService.queryChain().where(CLUE.STORE_ID.eq(id)).one(); diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/CluePutOffServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/CluePutOffServiceImpl.java index 08cf4a8..7afca49 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/CluePutOffServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/CluePutOffServiceImpl.java @@ -21,9 +21,9 @@ import org.springframework.transaction.annotation.Transactional; import static com.cpop.oam.business.entity.table.CluePutOffTableDef.CLUE_PUT_OFF; import static com.cpop.oam.business.entity.table.ClueTableDef.CLUE; import static com.cpop.oam.business.entity.table.StaffTableDef.STAFF; -import static com.cpop.system.business.entity.table.BrandTableDef.BRAND; -import static com.cpop.system.business.entity.table.StoreSignTableDef.STORE_SIGN; -import static com.cpop.system.business.entity.table.StoreTableDef.STORE; +import static com.cpop.oam.business.entity.table.BrandTableDef.BRAND; +import static com.cpop.oam.business.entity.table.StoreSignTableDef.STORE_SIGN; +import static com.cpop.oam.business.entity.table.StoreTableDef.STORE; import static com.mybatisflex.core.query.QueryMethods.dateDiff; import static com.mybatisflex.core.query.QueryMethods.now; diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/ClueServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/ClueServiceImpl.java index 25fc6c8..05c699f 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/ClueServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/ClueServiceImpl.java @@ -20,12 +20,13 @@ import com.cpop.oam.business.vo.ClueUpdateVo; import com.cpop.oam.business.vo.PersonSignGoalVo; import com.cpop.oam.framework.constant.OamRedisConstant; import com.cpop.oam.business.entity.DictData; -import com.cpop.system.business.entity.Store; +import com.cpop.oam.business.entity.Store; import com.cpop.oam.business.service.DictDataService; -import com.cpop.system.business.service.StoreService; +import com.mybatisflex.core.datasource.DataSourceKey; import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.query.QueryOrderBy; import com.mybatisflex.core.query.QueryWrapper; +import com.mybatisflex.core.row.DbChain; import com.mybatisflex.spring.service.impl.ServiceImpl; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -46,9 +47,9 @@ import static com.cpop.oam.business.entity.table.ClueUpdateTableDef.CLUE_UPDATE; import static com.cpop.oam.business.entity.table.SignAreaTableDef.SIGN_AREA; import static com.cpop.oam.business.entity.table.SignGoalTableDef.SIGN_GOAL; import static com.cpop.oam.business.entity.table.StaffTableDef.STAFF; -import static com.cpop.system.business.entity.table.BrandTableDef.BRAND; -import static com.cpop.system.business.entity.table.StoreSignTableDef.STORE_SIGN; -import static com.cpop.system.business.entity.table.StoreTableDef.STORE; +import static com.cpop.oam.business.entity.table.BrandTableDef.BRAND; +import static com.cpop.oam.business.entity.table.StoreSignTableDef.STORE_SIGN; +import static com.cpop.oam.business.entity.table.StoreTableDef.STORE; import static com.mybatisflex.core.query.QueryMethods.*; /** @@ -285,8 +286,13 @@ public class ClueServiceImpl extends ServiceImpl implements Cl @Transactional(rollbackFor = Exception.class) public void clueUpdate(ClueUpdateBo bo) { Clue clue = this.getById(bo.getClueId()); - StoreService storeService = SpringUtils.getBean(StoreService.class); - Store store = storeService.getById(clue.getStoreId()); + Store store; + try { + DataSourceKey.use("jambox"); + store = DbChain.table(STORE).where(STORE.ID.eq(clue.getStoreId())).oneAs(Store.class); + } finally { + DataSourceKey.clear(); + } ClueUpdate clueUpdate = BeanUtils.mapToClass(bo,ClueUpdate.class); clueUpdate.setOldPersonCharge(store.getPersonChargeName()) .setOldPhone(store.getPersonChargePhone()) @@ -307,7 +313,12 @@ public class ClueServiceImpl extends ServiceImpl implements Cl .setPersonChargeName(bo.getNewPersonCharge()) .setPersonChargePhone(bo.getNewPhone()) .setStoreAddr(bo.getNewStoreAddr()); - storeService.updateById(store); + try { + DataSourceKey.use("jambox"); + DbChain.table(STORE).update(store); + } finally { + DataSourceKey.clear(); + } } /** @@ -331,7 +342,13 @@ public class ClueServiceImpl extends ServiceImpl implements Cl clueUpdateVo.setRecordVos(recordVos); //获取现有校区数据 Clue clue = this.getById(clueId); - Store store = SpringUtils.getBean(StoreService.class).getById(clue.getStoreId()); + Store store; + try { + DataSourceKey.use("jambox"); + store = DbChain.table(STORE).where(STORE.ID.eq(clue.getStoreId())).oneAs(Store.class); + } finally { + DataSourceKey.clear(); + } clueUpdateVo.setStoreName(store.getStoreName()) .setPhone(store.getPersonChargePhone()) .setPersonCharge(store.getPersonChargeName()) diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DataImportServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DataImportServiceImpl.java index 4ce9dc8..7018f14 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DataImportServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DataImportServiceImpl.java @@ -24,7 +24,7 @@ import com.cpop.oam.business.mapper.DataImportMapper; import com.cpop.oam.business.service.DataImportService; import com.cpop.oam.business.vo.DataImportPageVo; import com.cpop.oam.framework.constant.OamRedisConstant; -import com.cpop.system.business.vo.SysFileVo; +import com.cpop.oam.business.vo.SysFileVo; import com.cpop.oam.framework.handler.tencentCos.TencentCosHandler; import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.query.QueryWrapper; @@ -44,8 +44,8 @@ import java.util.concurrent.locks.Lock; import static com.alibaba.excel.cache.Ehcache.BATCH_COUNT; import static com.cpop.oam.business.entity.table.DataImportTableDef.DATA_IMPORT; -import static com.cpop.system.business.entity.table.BrandTableDef.BRAND; -import static com.cpop.system.business.entity.table.StoreTableDef.STORE; +import static com.cpop.oam.business.entity.table.BrandTableDef.BRAND; +import static com.cpop.oam.business.entity.table.StoreTableDef.STORE; /** * oam-数据导入表 服务层实现。 diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/LoginServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/LoginServiceImpl.java index ed2a998..885c4af 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/LoginServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/LoginServiceImpl.java @@ -18,8 +18,8 @@ import com.cpop.oam.business.service.StaffService; import com.cpop.oam.business.vo.loginInfo.SysStaffLoginInfo; import com.cpop.oam.business.entity.Menu; import com.cpop.oam.business.service.MenuService; -import com.cpop.system.business.vo.LoginUserInfoVo; -import com.cpop.system.business.vo.MenuRouteVo; +import com.cpop.oam.business.vo.LoginUserInfoVo; +import com.cpop.oam.business.vo.MenuRouteVo; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/MenuServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/MenuServiceImpl.java index 8f4e967..6cc9fa5 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/MenuServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/MenuServiceImpl.java @@ -7,13 +7,13 @@ import com.cpop.core.base.exception.ServiceException; import com.cpop.core.constant.Constants; import com.cpop.core.utils.StringUtils; import com.cpop.core.utils.bean.BeanUtils; -import com.cpop.system.business.bo.MenuBo; -import com.cpop.system.business.bo.MenuListBo; +import com.cpop.oam.business.bo.MenuBo; +import com.cpop.oam.business.bo.MenuListBo; import com.cpop.oam.business.entity.Menu; import com.cpop.oam.business.mapper.MenuMapper; import com.cpop.oam.business.service.MenuService; -import com.cpop.system.business.vo.MenuRouteVo; -import com.cpop.system.business.vo.MenuVo; +import com.cpop.oam.business.vo.MenuRouteVo; +import com.cpop.oam.business.vo.MenuVo; import com.cpop.oam.framework.enums.InitRoleEnum; import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.spring.service.impl.ServiceImpl; diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/RoleServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/RoleServiceImpl.java index f584ad2..1eb7008 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/RoleServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/RoleServiceImpl.java @@ -8,12 +8,12 @@ import com.cpop.core.utils.bean.BeanUtils; import com.cpop.oam.framework.enums.InitRoleEnum; import com.cpop.core.utils.SpringUtils; import com.cpop.core.utils.SqlUtils; -import com.cpop.system.business.bo.RoleBo; -import com.cpop.system.business.bo.RolePageBo; -import com.cpop.system.business.bo.RoleStatusBo; +import com.cpop.oam.business.bo.RoleBo; +import com.cpop.oam.business.bo.RolePageBo; +import com.cpop.oam.business.bo.RoleStatusBo; import com.cpop.oam.business.entity.RoleMenu; import com.cpop.oam.business.service.RoleMenuService; -import com.cpop.system.business.vo.RolePageVo; +import com.cpop.oam.business.vo.RolePageVo; import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.spring.service.impl.ServiceImpl; diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskDemandServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskDemandServiceImpl.java index 3140e72..f9bd3f0 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskDemandServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskDemandServiceImpl.java @@ -44,8 +44,8 @@ import static com.cpop.core.base.table.table.UserTableDef.USER; import static com.cpop.oam.business.entity.table.StaffTableDef.STAFF; import static com.cpop.oam.business.entity.table.TaskDemandTableDef.TASK_DEMAND; import static com.cpop.oam.business.entity.table.TaskTableDef.TASK; -import static com.cpop.system.business.entity.table.BrandTableDef.BRAND; -import static com.cpop.system.business.entity.table.StoreTableDef.STORE; +import static com.cpop.oam.business.entity.table.BrandTableDef.BRAND; +import static com.cpop.oam.business.entity.table.StoreTableDef.STORE; /** * OAM-任务-需求表 服务层实现。 diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskWorkOrderServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskWorkOrderServiceImpl.java index 9a53ec5..ee3eede 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskWorkOrderServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskWorkOrderServiceImpl.java @@ -25,6 +25,7 @@ import com.mybatisflex.core.datasource.DataSourceKey; import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.core.row.DbChain; +import com.mybatisflex.core.row.Row; import com.mybatisflex.spring.service.impl.ServiceImpl; import lombok.extern.slf4j.Slf4j; import org.quartz.*; @@ -42,6 +43,7 @@ import java.time.ZoneId; import java.time.format.DateTimeFormatter; import java.time.temporal.TemporalAdjusters; import java.util.*; +import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; import static com.cpop.core.base.table.table.UserTableDef.USER; @@ -51,8 +53,8 @@ import static com.cpop.oam.business.entity.table.TaskStaffGroupTableDef.TASK_STA import static com.cpop.oam.business.entity.table.TaskTableDef.TASK; import static com.cpop.oam.business.entity.table.TaskWorkOrderRecordTableDef.TASK_WORK_ORDER_RECORD; import static com.cpop.oam.business.entity.table.TaskWorkOrderTableDef.TASK_WORK_ORDER; -import static com.cpop.system.business.entity.table.BrandTableDef.BRAND; -import static com.cpop.system.business.entity.table.StoreTableDef.STORE; +import static com.cpop.oam.business.entity.table.BrandTableDef.BRAND; +import static com.cpop.oam.business.entity.table.StoreTableDef.STORE; import static com.mybatisflex.core.query.QueryMethods.dateFormat; /** @@ -113,37 +115,35 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl queryChain().select(STAFF.NAME.as(TaskWorkOrderReceiveDealPauseDto::getPauseStaffName)) .from(STAFF) - .where(STAFF.ID.eq(StringUtils.isNotBlank(pauseStaff.getPauseStaffId()) ? pauseStaff.getPauseStaffId() : "-1"))), - // 品牌 - item -> item.field(TaskWorkOrderReceiveDealPauseDto::getBrandName).prevent(true) - .queryWrapper(brandName -> { - DbChain jambox; - try { - jambox = DataSourceKey.use("jambox", () -> DbChain.table(BRAND).select(BRAND.BRAND_NAME.as(TaskWorkOrderReceiveDealPauseDto::getBrandName)) - .from(BRAND) - .where(BRAND.ID.eq(StringUtils.isNotBlank(brandName.getBrandId()) ? brandName.getBrandId() : "-1"))); - } finally { - DataSourceKey.clear(); - } - return jambox; - }), - // 校区 - item -> item.field(TaskWorkOrderReceiveDealPauseDto::getStoreName).prevent(true) - .queryWrapper(storeName -> { - DbChain jambox; - try { - jambox = DataSourceKey.use("jambox", () -> DbChain.table(STORE).select(STORE.STORE_NAME.as(TaskWorkOrderReceiveDealPauseDto::getStoreName)) - .from(STORE) - .where(STORE.ID.eq(StringUtils.isNotBlank(storeName.getStoreId()) ? storeName.getStoreId() : "-1"))); - } finally { - DataSourceKey.clear(); - } - return jambox; - }) + .where(STAFF.ID.eq(StringUtils.isNotBlank(pauseStaff.getPauseStaffId()) ? pauseStaff.getPauseStaffId() : "-1"))) ); + if (dtoList.isEmpty()){ + return new TaskWorkOrderReceiveDealPauseVo(); + } + //跨库数据查询 + AtomicReference> storeAndBrandMap = new AtomicReference<>(); + try { + DataSourceKey.use("jambox", () -> { + storeAndBrandMap.set(DbChain.table(STORE) + .select(BRAND.ID.as("brandId"), BRAND.BRAND_NAME.as("storeName"), STORE.ID.as("storeId"), STORE.STORE_NAME.as("brandName")) + .from(STORE) + .leftJoin(BRAND).on(BRAND.ID.eq(STORE.BRAND_ID)) + .where(STORE.ID.in(dtoList.stream().map(TaskWorkOrderReceiveDealPauseDto::getStoreId).toList())) + .list() + .stream().collect(Collectors.toMap(row -> row.getString("storeId"), row -> row))); + }); + } finally { + DataSourceKey.clear(); + } + dtoList.forEach(item->{ + Row row = storeAndBrandMap.get().get(item.getStoreId()); + if (row != null){ + item.setStoreName(row.getString("storeName")); + item.setBrandName(row.getString("brandName")); + } + }); // 分组过滤 - Map> taskStatusMap = - dtoList.stream().collect(Collectors.groupingBy(TaskWorkOrderReceiveDealPauseDto::getTaskStatus)); + Map> taskStatusMap = dtoList.stream().collect(Collectors.groupingBy(TaskWorkOrderReceiveDealPauseDto::getTaskStatus)); TaskWorkOrderReceiveDealPauseVo taskWorkOrderReceiveDealPauseVo = new TaskWorkOrderReceiveDealPauseVo(); taskStatusMap.forEach((key, value) -> { switch (key) { @@ -222,7 +222,7 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl item.field(TaskWorkOrderPageVo::getFinishStaffName) - .queryWrapper(finishStaff -> queryChain().select(STAFF.NAME.as("finishStaffName")) + .queryWrapper(finishStaff -> queryChain().select(STAFF.NAME.as(TaskWorkOrderPageVo::getFinishStaffName)) .from(STAFF) .where(STAFF.ID.eq(finishStaff.getFinishStaffId())))); } @@ -820,7 +820,7 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl item.field(TaskWorkOrderPersonVo::getRecordStaffName) - .queryWrapper(recordStaff -> queryChain().select(STAFF.NAME.as("recordStaffName")) + .queryWrapper(recordStaff -> queryChain().select(STAFF.NAME.as(TaskWorkOrderPersonVo::getRecordStaffName)) .from(STAFF) .where(STAFF.ID.eq(recordStaff.getRecordStaffId())))); } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/WxOpenMiniServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/WxOpenMiniServiceImpl.java index 5934c0a..25da4c1 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/WxOpenMiniServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/WxOpenMiniServiceImpl.java @@ -39,7 +39,7 @@ public class WxOpenMiniServiceImpl extends ServiceImpl wxOpenMiniVos = JSONArray.parseArray(JSON.toJSONString(authorizerList.getList()), WxOpenMiniVo.class); if (!wxOpenMiniVos.isEmpty()){ Map appletMap = this.list(QueryWrapper.create().where(WX_OPEN_MINI.APPID.in(wxOpenMiniVos.stream().map(WxOpenMiniVo::getAuthorizerAppid).collect(Collectors.toSet())))) - .stream().collect(Collectors.toMap(WxOpenMini::getAppid, WxOpenMini::getNickName)); + .stream().collect(Collectors.toMap(WxOpenMini::getAppid, WxOpenMini::getNickname)); wxOpenMiniVos.forEach(item->{ item.setNickName(appletMap.get(item.getAuthorizerAppid())); }); @@ -61,7 +61,7 @@ public class WxOpenMiniServiceImpl extends ServiceImpl { + logger.info("\n接收到 {} 公众号请求消息,内容:{}", wxMpService.getWxMpConfigStorage().getAppId(), wxMpXmlMessage); + return null; + }).next(); + } + + @NotNull + private WxOpenInRedisConfigStorage getWxOpenInRedisConfigStorage() { + WxOpenInRedisConfigStorage inRedisConfigStorage; + inRedisConfigStorage = new WxOpenInRedisConfigStorage(new RedisTemplateWxRedisOps(stringRedisTemplate), null); + inRedisConfigStorage.setComponentAppId(wechatOpenProperties.getComponentAppId()); + inRedisConfigStorage.setComponentAppSecret(wechatOpenProperties.getComponentSecret()); + inRedisConfigStorage.setComponentToken(wechatOpenProperties.getComponentToken()); + inRedisConfigStorage.setComponentAesKey(wechatOpenProperties.getComponentAesKey()); + return inRedisConfigStorage; + } + + +} diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/framework/handler/wxOpen/WxOpenService.java b/Cpop-Oam/src/main/java/com/cpop/oam/framework/handler/wxOpen/WxOpenService.java deleted file mode 100644 index 186408e..0000000 --- a/Cpop-Oam/src/main/java/com/cpop/oam/framework/handler/wxOpen/WxOpenService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.cpop.oam.framework.handler.wxOpen; - -import com.cpop.oam.framework.config.wxOpen.WechatOpenProperties; -import jakarta.annotation.PostConstruct; -import lombok.Getter; -import me.chanjar.weixin.open.api.impl.WxOpenInRedisTemplateConfigStorage; -import me.chanjar.weixin.open.api.impl.WxOpenMessageRouter; -import me.chanjar.weixin.open.api.impl.WxOpenServiceImpl; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.stereotype.Service; - -/** - * @author DB - * @createTime 2023/10/27 9:30 - * @description - */ -@Service -@EnableConfigurationProperties({WechatOpenProperties.class}) -public class WxOpenService extends WxOpenServiceImpl { - - private final Logger logger = LoggerFactory.getLogger(getClass()); - - @Autowired - private WechatOpenProperties wxOpenProperties; - - @Getter - private WxOpenMessageRouter wxOpenMessageRouter; - - @Autowired - private StringRedisTemplate stringRedisTemplate; - - @PostConstruct - public void init() { - WxOpenInRedisTemplateConfigStorage inRedisConfigStorage = new WxOpenInRedisTemplateConfigStorage(stringRedisTemplate, "Cpop:sdk:wxOpen:"); - inRedisConfigStorage.setComponentAppId(wxOpenProperties.getComponentAppId()); - inRedisConfigStorage.setComponentAppSecret(wxOpenProperties.getComponentSecret()); - inRedisConfigStorage.setComponentToken(wxOpenProperties.getComponentToken()); - inRedisConfigStorage.setComponentAesKey(wxOpenProperties.getComponentAesKey()); - setWxOpenConfigStorage(inRedisConfigStorage); - wxOpenMessageRouter = new WxOpenMessageRouter(this); - wxOpenMessageRouter.rule().handler((wxMpXmlMessage, map, wxMpService, wxSessionManager) -> { - logger.info("\n接收到 {} 公众号请求消息,内容:{}", wxMpService.getWxMpConfigStorage().getAppId(), wxMpXmlMessage); - return null; - }).next(); - } - -} -