From 69dbc94b48a437474ea0c47c4a3fa562c64bcd84 Mon Sep 17 00:00:00 2001 From: DB <2502523450@qq.com> Date: Tue, 23 Apr 2024 14:39:14 +0800 Subject: [PATCH] =?UTF-8?q?Java8->Java17(=E4=B8=80)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/entity/website/BusinessData.java | 3 - .../mini/business/entity/MiniUserMidSys.java | 6 +- .../java/com/cpop/oam/web/CpopApiTests.java | 13 - .../java/com/cpop/oam/web/CpopClueTests.java | 55 - .../java/com/cpop/oam/web/CpopCoreTests.java | 117 -- .../com/cpop/oam/web/CpopDataSyncTests.java | 74 +- .../oam/web/CpopEasyLearnDataAnalyseTest.java | 10 +- .../com/cpop/oam/web/CpopEasyLearnTest.java | 86 +- .../com/cpop/oam/web/CpopImportTests.java | 1640 ----------------- .../cpop/oam/web/CpopOldDataSyncTests.java | 52 +- .../java/com/cpop/oam/web/CpopWxCpTests.java | 498 ----- .../bo/AgreeOrRejectEnforceFinishBo.java | 9 +- .../cpop/oam/business/bo/ClueFollowUpBo.java | 18 +- .../cpop/oam/business/bo/CluePutOffBo.java | 18 +- .../cpop/oam/business/bo/ClueUpdateBo.java | 17 +- .../java/com/cpop/oam/business/bo/DeptBo.java | 28 +- .../com/cpop/oam/business/bo/DeptListBo.java | 18 +- .../java/com/cpop/oam/business/bo/DutyBo.java | 24 +- .../com/cpop/oam/business/bo/DutyListBo.java | 13 +- .../business/bo/EnforceFinishWorkOrderBo.java | 11 +- .../bo/FinanceReimburseAuditPageBo.java | 13 +- .../business/bo/FinanceReimbursePageBo.java | 13 +- .../oam/business/bo/ModifyUserPasswordBo.java | 18 +- .../oam/business/bo/OperationStatusBo.java | 13 +- .../cpop/oam/business/bo/PutOffAuditBo.java | 13 +- .../business/bo/ReimburseApplicationBo.java | 24 +- .../cpop/oam/business/bo/ReimbursePayBo.java | 18 +- .../oam/business/bo/ReimburseRejectBo.java | 14 +- .../oam/business/bo/ReimburseStatusBo.java | 12 +- .../cpop/oam/business/bo/ReimburseTypeBo.java | 11 +- .../com/cpop/oam/business/bo/SignGoalBo.java | 37 +- .../oam/business/bo/SignGoalConfigInfoBo.java | 12 +- .../com/cpop/oam/business/bo/StaffBo.java | 44 +- .../com/cpop/oam/business/bo/StaffPageBo.java | 17 +- .../cpop/oam/business/bo/SysConfigInfoBo.java | 18 +- .../oam/business/bo/TaskArchivingPagBo.java | 17 +- .../oam/business/bo/TaskAuditCommentsBo.java | 21 +- .../oam/business/bo/TaskDailyPaperBo.java | 5 +- .../cpop/oam/business/bo/TaskDemandBo.java | 18 +- .../oam/business/bo/TaskDemandPageBo.java | 13 +- .../oam/business/bo/TaskDemandUrgentBo.java | 7 +- .../com/cpop/oam/business/bo/TaskItemBo.java | 15 +- .../cpop/oam/business/bo/TaskIterationBo.java | 15 +- .../business/bo/TaskMonthStatisticsBo.java | 15 +- .../cpop/oam/business/bo/TaskProgressBo.java | 13 +- .../oam/business/bo/TaskStaffGroupBo.java | 25 +- .../business/bo/TaskWorkOrderRecordBo.java | 13 +- .../cpop/oam/business/bo/TransferTaskBo.java | 15 +- .../bo/{SysUserLogBo.java => UserLogBo.java} | 26 +- .../BackstageBusinessController.java | 6 +- .../BackstageCloudDataController.java | 168 +- .../backstage/BackstageClueController.java | 107 +- .../BackstageDataImportController.java | 37 +- .../backstage/BackstageDeptController.java | 47 +- .../backstage/BackstageDutyController.java | 62 +- .../BackstageFinanceReimburseController.java | 107 +- .../backstage/BackstageOamMallController.java | 53 +- .../backstage/BackstagePutOffController.java | 11 +- .../BackstageSignGoalController.java | 64 +- .../backstage/BackstageStaffController.java | 107 +- .../BackstageStorePlugController.java | 27 +- .../BackstageSysConfigController.java | 19 +- .../BackstageTaskDemandController.java | 46 +- .../BackstageTaskTechnologyController.java | 91 +- .../oam/business/service/StaffService.java | 14 +- .../service/impl/BusinessServiceImpl.java | 100 +- .../service/impl/CluePutOffServiceImpl.java | 23 +- .../service/impl/ClueServiceImpl.java | 95 +- .../service/impl/CommonServiceImpl.java | 54 +- .../service/impl/DeptServiceImpl.java | 13 +- .../service/impl/DutyServiceImpl.java | 20 +- .../impl/FinanceReimburseServiceImpl.java | 48 +- .../service/impl/SignGoalServiceImpl.java | 2 +- .../service/impl/StaffServiceImpl.java | 214 +-- .../service/impl/TaskDemandServiceImpl.java | 37 +- .../impl/TaskWorkOrderServiceImpl.java | 93 +- .../oam/business/vo/ClueFollowUpRecordVo.java | 13 +- .../com/cpop/oam/business/vo/CluePageVo.java | 54 +- .../cpop/oam/business/vo/CluePutOffVo.java | 23 +- .../cpop/oam/business/vo/ClueRecordVo.java | 11 +- .../cpop/oam/business/vo/ClueUpdateVo.java | 37 +- .../cpop/oam/business/vo/ConfigInfoVo.java | 17 +- .../oam/business/vo/DataImportPageVo.java | 19 +- .../java/com/cpop/oam/business/vo/DeptVo.java | 32 +- .../com/cpop/oam/business/vo/DutyListVo.java | 24 +- .../vo/FinanceReimburseAuditPageVo.java | 32 +- .../business/vo/FinanceReimbursePageVo.java | 32 +- .../vo/FinanceReimburseRecordListVo.java | 16 +- .../vo/FinanceReimburseTypeListVo.java | 13 +- ...perationLogVo.java => OperationLogVo.java} | 34 +- .../oam/business/vo/PersonSignGoalVo.java | 13 +- .../oam/business/vo/PersonTaskPageVo.java | 32 +- .../oam/business/vo/PutOffAuditPageVo.java | 35 +- .../vo/ReimbursePersonStatisticVo.java | 12 +- .../java/com/cpop/oam/business/vo/RoleVo.java | 23 +- .../oam/business/vo/SignGoalConfigInfoVo.java | 11 +- .../cpop/oam/business/vo/SignGoalPageVo.java | 64 +- .../com/cpop/oam/business/vo/StaffInfoVo.java | 31 +- .../com/cpop/oam/business/vo/StaffPageVo.java | 44 +- .../com/cpop/oam/business/vo/StoreListVo.java | 4 +- .../oam/business/vo/TaskArchivingPagVo.java | 33 +- .../oam/business/vo/TaskDemandPageVo.java | 51 +- .../oam/business/vo/TaskDemandUrgentVo.java | 17 +- .../vo/TaskIndividualGpaDetailVo.java | 12 +- .../oam/business/vo/TaskIndividualGpaVo.java | 14 +- .../oam/business/vo/TaskStaffGroupVo.java | 17 +- .../business/vo/TaskToBeClaimedPageVo.java | 26 +- .../business/vo/TaskWorkOrderPersonVo.java | 25 +- .../vo/TaskWorkOrderRecordListVo.java | 23 +- 109 files changed, 1477 insertions(+), 4237 deletions(-) delete mode 100644 Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopClueTests.java delete mode 100644 Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopCoreTests.java delete mode 100644 Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopImportTests.java delete mode 100644 Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopWxCpTests.java rename Cpop-Oam/src/main/java/com/cpop/oam/business/bo/{SysUserLogBo.java => UserLogBo.java} (51%) rename Cpop-Oam/src/main/java/com/cpop/oam/business/vo/{SysOperationLogVo.java => OperationLogVo.java} (59%) diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/BusinessData.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/BusinessData.java index 276f58e..4af94b2 100644 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/BusinessData.java +++ b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/BusinessData.java @@ -7,9 +7,6 @@ import com.mybatisflex.annotation.Column; import com.mybatisflex.annotation.Id; import com.mybatisflex.annotation.Table; import java.io.Serializable; -import java.time.LocalDateTime; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import lombok.*; import lombok.experimental.Accessors; diff --git a/Cpop-Mini/src/main/java/com/cpop/mini/business/entity/MiniUserMidSys.java b/Cpop-Mini/src/main/java/com/cpop/mini/business/entity/MiniUserMidSys.java index 3db3866..5cfa21e 100644 --- a/Cpop-Mini/src/main/java/com/cpop/mini/business/entity/MiniUserMidSys.java +++ b/Cpop-Mini/src/main/java/com/cpop/mini/business/entity/MiniUserMidSys.java @@ -5,13 +5,11 @@ import com.cpop.core.base.entity.BaseInsertListener; import com.cpop.core.base.entity.BaseUpdateListener; import com.mybatisflex.annotation.Id; import com.mybatisflex.annotation.Table; -import java.io.Serializable; -import java.time.LocalDateTime; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import lombok.*; import lombok.experimental.Accessors; +import java.io.Serializable; + /** * 小程序用户-系统用户中间表 实体类。 * diff --git a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopApiTests.java b/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopApiTests.java index 1691c32..21cd1d7 100644 --- a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopApiTests.java +++ b/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopApiTests.java @@ -63,17 +63,4 @@ public class CpopApiTests { System.out.println(geocoder); } - /** - * 新增租户 - * @author DB - * @since 2024/2/28 - */ - @Test - public void insertTenant() throws IOException, IllegalAccessException { - com.alibaba.fastjson2.JSONObject jsonObject = SpringUtils.getBean(CpopSignatureUtils.class).sendSignaturePost("http://localhost:9440/Jambox-System/api/tenant/insertTenant", - new ApiTenantRequest().setName("测试租户").setIsSuper(false), "100"); - System.out.println(jsonObject); - } - - } diff --git a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopClueTests.java b/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopClueTests.java deleted file mode 100644 index 546207f..0000000 --- a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopClueTests.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.cpop.oam.web; - -import com.alibaba.fastjson.JSONObject; -import com.cpop.api.tencent.location.handler.TencentLocationHandler; -import com.cpop.core.utils.SpringUtils; -import com.mybatisflex.core.query.QueryWrapper; -import com.mybatisflex.core.row.Db; -import com.mybatisflex.core.row.Row; -import com.mybatisflex.core.row.RowKey; -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -import java.time.LocalDateTime; - -/** - * @author DB - * @version 1.0.0 - * @since 2024-02-21 14:44 - */ -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) -public class CpopClueTests { - - @Test - public void insertClue() { - LocalDateTime now = LocalDateTime.now(); - //添加线索以及 - Row clue = Row.ofKey(RowKey.SNOW_FLAKE_ID); - clue.set("store_id","81892317270687744"); - //校区城市 - JSONObject geocoder = SpringUtils.getBean(TencentLocationHandler.class).geocoder("113.93041", "22.53332", "UGLBZ-LBF3I-ETCGO-UUH5X-QDV45-3LFKA"); - if (geocoder.getInteger("status") == 0){ - clue.set("city",geocoder.getJSONObject("result").getJSONObject("ad_info").getString("city")); - } - clue.set("clue_status",0); - clue.set("create_time", now); - clue.set("update_time", now); - LoginUser loginUser = SecurityUtils.getInstance().getLoginUser(); - clue.set("create_user_id", loginUser == null ? "1" : loginUser.getUserId()); - clue.set("update_user_id", loginUser == null ? "1" : loginUser.getUserId()); - Db.insert("cp_oam_clue",clue); - //录入记录 - Row clueRecord = Row.ofKey(RowKey.SNOW_FLAKE_ID); - clueRecord.set("clue_id",clue.getString("id")); - clueRecord.set("record_type",0); - clueRecord.set("record_content", "机构负责人" + "测试" + "创建线索"); - clueRecord.set("record_staff_id", "1"); - clueRecord.set("create_time", now); - clueRecord.set("update_time", now); - clueRecord.set("create_user_id", loginUser == null ? "1" : loginUser.getUserId()); - clueRecord.set("update_user_id", loginUser == null ? "1" : loginUser.getUserId()); - Db.insert("cp_oam_clue_record",clueRecord); - } - - -} diff --git a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopCoreTests.java b/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopCoreTests.java deleted file mode 100644 index 3083b49..0000000 --- a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopCoreTests.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.cpop.oam.web; - -import cn.hutool.core.util.IdUtil; -import com.cpop.core.base.enums.OperationLogEnum; -import com.cpop.core.base.enums.UserType; -import com.cpop.core.utils.RsaUtils; -import com.cpop.core.utils.SpringUtils; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; - -import java.util.Map; - -/** - * @author DB - * @Description: RockBlade核心功能测试 - * @create 2023-08-27 11:11 - */ -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) -public class CpopCoreTests { - - @Autowired - private CoreService coreService; - - @Autowired - private RsaUtils rsaUtils; - - /** - * @Description: 添加操作日志 - * @param - * @return - * @Author DB - * @Date: 2023/8/27 11:11 - */ - @Test - public void insertOperationLog() { - LoginUser loginUser = new LoginUser(); - loginUser.setIpAddr("localhost") - .setUserId("1") - .setUserName("RockBlade"); - coreService.insertOperationLog(200, OperationLogEnum.SYSTEM_LOGIN, loginUser, null); - } - - /** - * @Description: 根据用户名获取用户信息 - * @param - * @return - * @Author DB - * @Date: 2023/8/27 23:46 - */ - @Test - public void loadUserByUsername() { - System.out.println(coreService.getSysUserByUsername("RockBlade", UserType.OAM_USER)); - } - - /** - * 初始化密钥对 - */ - @Test - public void initKeyPair() { - Map keyPairMap = rsaUtils.initKeyPair(); - String publicKey = keyPairMap.get("publicKey"); - String privateKey = keyPairMap.get("privateKey"); - System.out.println("公钥:"); - System.out.println(publicKey); - System.out.println(); - System.out.println("私钥:"); - System.out.println(privateKey); - System.out.println(); - String source = "jambox5772"; - System.out.println("待加密字符串:"+source); - System.out.println(); - String strEncrypt = rsaUtils.encrypt(source); - System.out.println("加密后的字符串:"); - System.out.println(strEncrypt); - System.out.println(); - String strDecrypt = rsaUtils.decrypt(strEncrypt); - System.out.println("解密后的字符串:"); - System.out.println(strDecrypt); - //加密 - String encode = SpringUtils.getBean(PasswordEncoder.class).encode("Admin@123"); - System.out.println("encode加密:"+encode); - } - - /** - * 初始化密钥对 - */ - @Test - public void initPublicOrPrivateKey() { - String snowflakeNextIdStr = IdUtil.getSnowflakeNextIdStr(); - String baseKeyRepository = "E:\\KeyRepository\\"; - String publicKeyFile = baseKeyRepository + "publicKey" + snowflakeNextIdStr; - String privateKeyFile = baseKeyRepository + "privateKey" + snowflakeNextIdStr; - Map keyPairMap = rsaUtils.initKeyPair(publicKeyFile, privateKeyFile); - String publicKey = keyPairMap.get("publicKey"); - String privateKey = keyPairMap.get("privateKey"); - System.out.println("公钥:"); - System.out.println(publicKey); - System.out.println(); - System.out.println("私钥:"); - System.out.println(privateKey); - System.out.println(); - String source = "Admin@123"; - System.out.println("待加密字符串:" + source); - System.out.println(); - String strEncrypt = rsaUtils.encrypt(source); - System.out.println("加密后的字符串:"); - System.out.println(strEncrypt); - System.out.println(); - String strDecrypt = rsaUtils.decrypt(strEncrypt); - System.out.println("解密后的字符串:"); - System.out.println(strDecrypt); - //加密 - String encode = SpringUtils.getBean(PasswordEncoder.class).encode("Admin@123"); - System.out.println("encode加密:" + encode); - } -} diff --git a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopDataSyncTests.java b/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopDataSyncTests.java index c464b63..54277c2 100644 --- a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopDataSyncTests.java +++ b/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopDataSyncTests.java @@ -1,52 +1,7 @@ package com.cpop.oam.web; -import com.cpop.api.cloudDb.core.dto.CloudStoreActiveDto; -import com.cpop.api.cloudDb.handler.CloudStoreHandler; -import com.cpop.common.utils.StringUtils; -import com.cpop.common.utils.bean.BeanUtils; -import com.cpop.core.utils.SpringUtils; -import com.cpop.jambox.business.entity.*; -import com.cpop.jambox.business.service.*; -import com.cpop.oam.business.entity.Clue; -import com.cpop.oam.business.entity.Task; -import com.cpop.oam.business.entity.TaskWorkOrder; -import com.cpop.oam.business.mapper.TaskWorkOrderMapper; -import com.cpop.oam.business.service.ClueService; -import com.cpop.oam.business.service.TaskService; -import com.cpop.system.business.entity.Store; -import com.cpop.system.business.entity.StoreSign; -import com.cpop.system.business.mapper.StoreMapper; -import com.cpop.system.business.service.StoreService; -import com.cpop.system.business.service.StoreSignService; -import com.mybatisflex.core.datasource.DataSourceKey; -import com.mybatisflex.core.query.QueryWrapper; -import com.mybatisflex.core.row.Db; -import com.mybatisflex.core.row.DbChain; -import com.mybatisflex.core.row.Row; -import com.mybatisflex.core.row.RowUtil; -import com.mybatisflex.core.update.UpdateChain; -import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; -import org.springframework.transaction.annotation.Transactional; - -import java.time.Duration; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import static com.cpop.jambox.business.entity.table.StoreExtendTableDef.STORE_EXTEND; -import static com.cpop.oam.business.entity.table.TaskTableDef.TASK; -import static com.cpop.oam.business.entity.table.TaskWorkOrderTableDef.TASK_WORK_ORDER; -import static com.cpop.system.business.entity.table.StoreSignTableDef.STORE_SIGN; -import static com.cpop.system.business.entity.table.StoreTableDef.STORE; -import static com.mybatisflex.core.query.QueryMethods.count; -import static com.mybatisflex.core.query.QueryMethods.max; /** * @author DB @@ -55,6 +10,7 @@ import static com.mybatisflex.core.query.QueryMethods.max; */ @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @ActiveProfiles(profiles = {"prod", "core", "pay"}) +@Deprecated public class CpopDataSyncTests { /** @@ -62,7 +18,7 @@ public class CpopDataSyncTests { * @author DB * @since 2024/1/16 */ - @Test + /*@Test public void syncStoreInfo(){ List rowList; try { @@ -89,11 +45,11 @@ public class CpopDataSyncTests { SpringUtils.getBean(StoreService.class).updateBatch(storeList); } - /** + *//** * 同步课卡模板 * @author DB * @since 2024/1/17 - */ + *//* @Test public void syncCardTemplate(){ List rowList; @@ -212,14 +168,14 @@ public class CpopDataSyncTests { } } - /** + *//** * 同步校区签约 * @author DB * @since 2024/1/18 - */ + *//* @Test public void syncOldStoreSignData() { - /*List rowList; + *//*List rowList; try { DataSourceKey.use("jambox"); rowList = DbChain.table("OAM_data_sign") @@ -256,7 +212,7 @@ public class CpopDataSyncTests { } } storeSigns.add(storeSign); - });*/ + });*//* SpringUtils.getBean(StoreService.class).updateChain() .set(STORE.SIGN_ID, null) @@ -288,9 +244,9 @@ public class CpopDataSyncTests { System.out.println(input.replaceAll(pattern, "")); } - /** + *//** * 同步校区签约数据 - */ + *//* @Test public void syncStoreSignData(){ List list = SpringUtils.getBean(StoreSignService.class).list(); @@ -304,11 +260,11 @@ public class CpopDataSyncTests { SpringUtils.getBean(StoreService.class).updateBatch(stores); } - /** + *//** * 删除没有云校区的数据 * @author DB * @since 2024/1/23 - */ + *//* @Test public void removeNotHaveCloudStore() { StoreService storeService = SpringUtils.getBean(StoreService.class); @@ -383,11 +339,11 @@ public class CpopDataSyncTests { SpringUtils.getBean(ClueService.class).saveBatch(clues); } - /** + *//** * 导入校区活跃数 * @author DB * @since 2024/4/12 - */ + *//* @Test @Transactional(rollbackFor = Exception.class) public void importStoreActiveData(){ @@ -403,5 +359,5 @@ public class CpopDataSyncTests { SpringUtils.getBean(StoreActiveService.class).saveBatch(storeActives); } } - } + }*/ } diff --git a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopEasyLearnDataAnalyseTest.java b/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopEasyLearnDataAnalyseTest.java index 96c378e..c574485 100644 --- a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopEasyLearnDataAnalyseTest.java +++ b/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopEasyLearnDataAnalyseTest.java @@ -1,6 +1,5 @@ package com.cpop.oam.web; -import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.cpop.api.cloudDb.core.constant.CloudDbUrl; import com.cpop.core.utils.SpringUtils; @@ -9,8 +8,10 @@ import com.github.binarywang.wxpay.bean.result.WxPayOrderQueryResult; import com.github.binarywang.wxpay.exception.WxPayException; import com.github.binarywang.wxpay.service.WxPayService; import com.mybatisflex.core.datasource.DataSourceKey; -import com.mybatisflex.core.query.QueryWrapper; -import com.mybatisflex.core.row.*; +import com.mybatisflex.core.row.Db; +import com.mybatisflex.core.row.DbChain; +import com.mybatisflex.core.row.Row; +import com.mybatisflex.core.row.RowKey; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; @@ -39,6 +40,7 @@ public class CpopEasyLearnDataAnalyseTest{ */ @Test public void insertLearnNowPayLaterData() throws WxPayException { + //TODO:查询数据 try { //查询旧表 DataSourceKey.use("jambox"); @@ -56,7 +58,7 @@ public class CpopEasyLearnDataAnalyseTest{ .list(); List insertList = new ArrayList<>(); list.forEach(item->{ - WxPayService wxPayService = wxPayHandler.getWxPayService(null, item.getString("subMchId")); + WxPayService wxPayService = wxPayHandler.getServiceWxPayService(); try { WxPayOrderQueryResult wxPayOrderQueryResult = wxPayService.queryOrder(item.getString("transactionId"), null); String[] split = wxPayOrderQueryResult.getAttach().split("\\|"); diff --git a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopEasyLearnTest.java b/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopEasyLearnTest.java index 6b6b9d9..90a9189 100644 --- a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopEasyLearnTest.java +++ b/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopEasyLearnTest.java @@ -1,58 +1,10 @@ package com.cpop.oam.web; -import cn.binarywang.wx.miniapp.api.WxMaQrcodeService; -import cn.binarywang.wx.miniapp.api.WxMaService; -import com.alibaba.fastjson.JSONObject; -import com.cpop.common.utils.StringUtils; -import com.cpop.system.framework.enums.OrderSource; -import com.cpop.core.base.exception.ServiceException; -import com.cpop.core.utils.SpringUtils; -import com.cpop.core.utils.file.FileUtils; -import com.cpop.jambox.business.entity.EasyLearnOrder; -import com.cpop.jambox.business.entity.StoreExtend; -import com.cpop.jambox.business.service.EasyLearnOrderService; -import com.cpop.jambox.business.service.StoreExtendService; -import com.cpop.jambox.framework.constant.JamboxCloudUrl; import com.cpop.pay.framewok.config.wxPay.WxPayProperties; import com.cpop.pay.framewok.handler.wxPay.WxPayHandler; -import com.github.binarywang.wxpay.bean.payscore.*; -import com.github.binarywang.wxpay.bean.profitsharing.request.ProfitSharingBillV3Request; -import com.github.binarywang.wxpay.bean.profitsharing.request.ProfitSharingRequest; -import com.github.binarywang.wxpay.bean.profitsharing.result.ProfitSharingResult; -import com.github.binarywang.wxpay.bean.request.WxPayApplyTradeBillV3Request; -import com.github.binarywang.wxpay.bean.request.WxPayOrderQueryRequest; -import com.github.binarywang.wxpay.bean.request.WxPayPartnerOrderCloseV3Request; -import com.github.binarywang.wxpay.bean.result.WxPayApplyBillV3Result; -import com.github.binarywang.wxpay.bean.result.WxPayOrderQueryResult; -import com.github.binarywang.wxpay.config.WxPayConfig; -import com.github.binarywang.wxpay.exception.WxPayException; -import com.github.binarywang.wxpay.service.ProfitSharingService; -import com.github.binarywang.wxpay.service.WxPayService; -import com.mybatisflex.core.query.QueryWrapper; -import com.mybatisflex.core.row.Db; -import com.mybatisflex.core.row.DbChain; -import com.mybatisflex.core.row.Row; -import com.mybatisflex.core.row.RowKey; -import com.qcloud.cos.model.UploadResult; -import me.chanjar.weixin.common.error.WxErrorException; -import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; -import org.springframework.web.client.RestTemplate; -import org.springframework.web.multipart.MultipartFile; - -import java.io.*; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import static com.cpop.jambox.business.entity.table.EasyLearnOrderTableDef.EASY_LEARN_ORDER; -import static com.cpop.jambox.business.entity.table.StoreExtendTableDef.STORE_EXTEND; /** * @author DB @@ -61,33 +13,31 @@ import static com.cpop.jambox.business.entity.table.StoreExtendTableDef.STORE_EX */ @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @ActiveProfiles({"dev", "core", "jambox", "pay"}) +@Deprecated public class CpopEasyLearnTest { - @Autowired - private WxPayService wxPayService; - @Autowired private WxPayProperties wxPayProperties; @Autowired private WxPayHandler wxPayHandler; - /** +/* *//** * 关闭订单一次性支付 * @author DB * @since 2023/12/29 - */ + *//* @Test public void finishOncePay() throws WxPayException { String outTradeNo = "97973645262987264"; - /*String transactionId = "4200002093202312282215936862"; + *//*String transactionId = "4200002093202312282215936862"; ProfitSharingFinishRequest profitSharingFinishRequest = new ProfitSharingFinishRequest(); profitSharingFinishRequest.setTransactionId(transactionId); profitSharingFinishRequest.setOutOrderNo(outTradeNo); profitSharingFinishRequest.setDescription("结束分账"); profitSharingFinishRequest.setSubMchId("1661323640"); //结束分账 - wxPayService.getProfitSharingService().profitSharingFinish(profitSharingFinishRequest);*/ + wxPayService.getProfitSharingService().profitSharingFinish(profitSharingFinishRequest);*//* //完结订单 WxPayConfig wxPayConfig = wxPayService.getConfig(); wxPayConfig.setSubMchId("1661323640"); @@ -95,11 +45,11 @@ public class CpopEasyLearnTest { wxPayService.closeOrder(outTradeNo); } - /** + *//** * 放心学一次性支付 * @author DB * @since 2023/12/29 - */ + *//* @Test public void easyLearnOncePay(){ String orderId = "97976926051770368"; @@ -139,14 +89,14 @@ public class CpopEasyLearnTest { .where(EASY_LEARN_ORDER.ID.eq(orderId)).update(); } - /** + *//** * 构建分账请求参数 * @author DB * @since 2023/12/28 * @param orderId 订单号 * @param orderSource 订单来源 * @return ProfitSharingRequest - */ + *//* private ProfitSharingRequest buildProfitSharingRequest(String orderId, OrderSource orderSource, Integer totalFee, String subMchId, String transactionId) { LocalDateTime now = LocalDateTime.now(); Double ceil = Math.ceil(totalFee * orderSource.getRate()); @@ -178,14 +128,14 @@ public class CpopEasyLearnTest { return profitSharingRequest; } - /** + *//** * 微信支付分账 * @author DB * @since 2023/11/03 11:09 * @param profitSharingRequest 请求参数 * @param wxPayService 微信服务类 * @param flag 标记 - */ + *//* private void wxPayProfitSharing(ProfitSharingRequest profitSharingRequest, WxPayService wxPayService, Integer flag, OrderSource orderSource) { try { ProfitSharingResult profitSharingResult = wxPayService.getProfitSharingService().profitSharing(profitSharingRequest); @@ -217,11 +167,11 @@ public class CpopEasyLearnTest { } } - /** + *//** * 关闭服务商订单 * @author DB * @since 2024/1/12 - */ + *//* @Test public void closePartnerOrderV3() throws WxPayException { WxPayService wxPayService= wxPayHandler.getWxPayService(); @@ -231,11 +181,11 @@ public class CpopEasyLearnTest { wxPayService.closePartnerOrderV3(wxPayPartnerOrderCloseV3Request); } - /** + *//** * 查询未完结订单 * @author DB * @since 2024/1/19 - */ + *//* @Test public void downloadBill() throws WxPayException { WxPayService wxPayService = wxPayHandler.getWxPayService(null, "1663310469"); @@ -354,11 +304,11 @@ public class CpopEasyLearnTest { } } - /** + *//** * 创建微信太阳码 * @author DB * @since 2024/1/23 - */ + *//* @Test public void createMiniQrCode() throws WxErrorException, IOException { // 获取当前执行环境 @@ -410,7 +360,7 @@ public class CpopEasyLearnTest { || ((codePoint >= 0x20) && (codePoint <= 0xD7FF)) || ((codePoint >= 0xE000) && (codePoint <= 0xFFFD)) || ((codePoint >= 0x10000) && (codePoint <= 0x10FFFF)); - } + }*/ } diff --git a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopImportTests.java b/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopImportTests.java deleted file mode 100644 index fe36781..0000000 --- a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopImportTests.java +++ /dev/null @@ -1,1640 +0,0 @@ -package com.cpop.oam.web; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; -import com.cpop.core.mapper.UserMapper; -import com.cpop.core.utils.StringUtils; -import com.cpop.core.utils.bean.BeanUtils; -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.system.framework.enums.InitRoleEnum; -import com.cpop.core.base.table.User; -import com.cpop.core.utils.RsaUtils; -import com.cpop.core.utils.SpringUtils; -import com.cpop.jambox.business.entity.*; -import com.cpop.jambox.business.service.*; -import com.cpop.oam.business.bo.StaffBo; -import com.cpop.oam.business.entity.*; -import com.cpop.oam.business.service.*; -import com.cpop.oam.business.vo.StaffInfoVo; -import com.cpop.system.business.entity.Store; -import com.cpop.system.business.entity.StoreRenew; -import com.cpop.system.business.entity.StoreSign; -import com.cpop.system.business.service.*; -import com.mybatisflex.core.FlexGlobalConfig; -import com.mybatisflex.core.datasource.DataSourceKey; -import com.mybatisflex.core.datasource.FlexDataSource; -import com.mybatisflex.core.query.QueryWrapper; -import com.mybatisflex.core.row.Db; -import com.mybatisflex.core.row.DbChain; -import com.mybatisflex.core.row.Row; -import com.mybatisflex.core.row.RowUtil; -import com.zaxxer.hikari.HikariDataSource; -import lombok.Data; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.ActiveProfiles; - -import java.io.*; -import java.time.LocalDate; -import java.util.*; -import java.util.stream.Collectors; - -import static com.cpop.core.base.table.table.SysUserTableDef.USER; -import static com.cpop.core.base.table.table.UserTableDef.USER; -import static com.cpop.jambox.business.entity.table.BrandExtendTableDef.BRAND_EXTEND; -import static com.cpop.jambox.business.entity.table.StoreExtendTableDef.STORE_EXTEND; -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.StoreTableDef.STORE; - -/** - * @author DB - * @createTime 2023/11/27 17:24 - * @description 导入数据 - */ -@Slf4j -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) -@ActiveProfiles(profiles = {"dev", "core"}) -public class CpopImportTests { - - /** - * @descriptions 导入品牌 - * @author DB - * @date 2023/11/27 17:26 - * @return: void - */ - @Test - public void importBrandJson() throws IOException { - /*String brandFileUrl = "C:\\Users\\Administrator\\Desktop\\brand.json"; - List filterList = new ArrayList<>(); - filterList.add("b00064a760d0c4f121b0835d09b909ca"); - filterList.add("41ae62ef621ee0f909da5583399ff318"); - filterList.add("0122a5876468513f0d42569d389e8264"); - filterList.add("0ab5303b62c68da00d302cc2079b7fbe"); - filterList.add("41ae62ef6228587e0b430c3a16483a9a"); - filterList.add("ac1268b164d1d20700080aae1703ecf8"); - filterList.add("def1da45654259bc090e5054208e9b9c"); - List jsonBrands = JSONArray.parseArray(readJson(brandFileUrl), JsonBrand.class); - //过滤已存在的品牌 - List filterBrand = jsonBrands.stream().filter(item -> !filterList.contains(item.getBrandCloudId())).collect(Collectors.toList()); - //打印 - Map brandJsonBrandMap = new HashMap<>(); - filterBrand.forEach(item -> { - Brand brand = new Brand(); - brand.setSourceType(SourceType.JAMBOX.toString()).setBrandName(item.getBrandName()); - BrandExtend brandExtend = new BrandExtend(); - brandExtend.setBrandCloudId(item.getBrandCloudId()); - brandJsonBrandMap.put(brandExtend, brand); - }); - SpringUtils.getBean(BrandService.class).saveBatch(brandJsonBrandMap.values()); - //批量插入拓展信息 - brandJsonBrandMap.forEach((key, value) -> { - key.setBrandId(value.getId()); - }); - SpringUtils.getBean(BrandExtendService.class).saveBatch(brandJsonBrandMap.keySet());*/ - //更新商户号 - try { - //查询旧表 - DataSourceKey.use("jambox"); - List rowList = DbChain.table("j_merchant_info") - .select("jmi.wx_mch_id as wxMchId") - .select("tbi.brand_id as brandCloudId") - .from("j_merchant_info").as("jmi") - .leftJoin("t_brand_info").as("tbi").on("tbi.id = jmi.main_id") - .where("jmi.main_type = 1") - .list(); - log.info(JSONArray.toJSONString(rowList)); - } finally { - DataSourceKey.clear(); - } - } - - /** - * @descriptions 导入校区 - * @author DB - * @date 2023/11/27 17:26 - * @return: void - */ - @Test - public void importStoreJson() throws IOException { - String storeFileUrl = "C:\\Users\\Administrator\\Desktop\\store.json"; - List filterList = Db.selectListByQuery(STORE_EXTEND.getTableName(), QueryWrapper.create().select(STORE_EXTEND.STORE_CLOUD_ID)) - .stream().map(item -> item.getString("storeCloudId")).collect(Collectors.toList()); - List jsonStores = JSONArray.parseArray(readJson(storeFileUrl), JsonStore.class); - //过滤已存在的品牌 - List filterStore = jsonStores.stream() - .filter(item -> !filterList.contains(item.getBrandCloudId()) && - //品牌不为null和空 - null != item.getBrandCloudId() && StringUtils.isNotBlank(item.getBrandCloudId())).collect(Collectors.toList()); - //打印 - Map storeExtendStoreMap = new HashMap<>(); - //获取所有品牌 - List brandRowList = DbChain.table(BRAND).select(BRAND.ID, BRAND_EXTEND.BRAND_CLOUD_ID) - .from(BRAND) - .leftJoin(BRAND_EXTEND).on(BRAND_EXTEND.BRAND_ID.eq(BRAND.ID)).list(); - Map brandCloudIdMap = brandRowList.stream().collect(Collectors.toMap(item -> item.getString("brandCloudId"), item -> item)); - filterStore.forEach(item -> { - //只插入能找到品牌的校区 - if (null != brandCloudIdMap.get(item.brandCloudId)){ - StoreExtend storeExtend = new StoreExtend(); - storeExtend.setStoreCloudId(item.getStoreCloudId()); - Store store = new Store(); - store.setSourceType("JAMBOX") - .setStoreName(item.getName()) - .setBrandId(brandCloudIdMap.get(item.brandCloudId).getString("id")); - storeExtendStoreMap.put(storeExtend,store); - } - }); - //插入校区 - SpringUtils.getBean(StoreService.class).saveBatch(storeExtendStoreMap.values()); - storeExtendStoreMap.forEach((key, value) -> { - key.setStoreId(value.getId()); - }); - //插入拓展 - SpringUtils.getBean(StoreExtendService.class).saveBatch(storeExtendStoreMap.keySet()); - } - - /** - * 更新导入的旧数据 - * @author DB - * @since 2023/12/08 - */ - @Test - public void updateImportData() { - List rowList = null; - try { - //查询旧表 - DataSourceKey.use("jambox"); - rowList = DbChain.table("t_mechanism_info") - .select("tmi.store_id as storeCloudId") - .select("tmi.charge_name as personCharge") - .select("tmi.charge_phone as phone") - .select("tmi.address as storeAddr") - .select("tmi.test as isTest") - .select("ifnull(date_format(tsm.end_time,'%Y-%m-%d'),null) as expireDate") - .select("if(tmi.clue_id is null,0,1) as haveCounselor") - .select("if(of.activation is null,0,of.activation) as haveActive") - .from("t_mechanism_info").as("tmi") - .leftJoin("OAM_finance").as("of").on("of.clue_id LIKE tmi.clue_id") - .leftJoin("t_signContract_mechanism").as("tsm").on("tsm.store_id = tmi.store_id") - .list(); - } finally { - DataSourceKey.clear(); - } - //以云id换id - Map cloudToIdMap = SpringUtils.getBean(StoreExtendService.class).list() - .stream().collect(Collectors.toMap(StoreExtend::getStoreCloudId, StoreExtend::getStoreId)); - //用迭代器 - Iterator iterator = rowList.iterator(); - while (iterator.hasNext()) { - Row next = iterator.next(); - if (StringUtils.isBlank(cloudToIdMap.get(next.getString("storeCloudId")))) { - iterator.remove(); - } else { - next.set("id", cloudToIdMap.get(next.getString("storeCloudId"))); - if (StringUtils.isBlank(next.getString("id"))){ - iterator.remove(); - } - } - } - List entityList = RowUtil.toEntityList(rowList, Store.class); - entityList.forEach(item->{ - if (StringUtils.isBlank(item.getId())){ - log.error(item.toString()); - } - }); - SpringUtils.getBean(StoreService.class).updateBatch(entityList); - } - - /** - * 导入品牌管理员 - * @author DB - * @since 2023/12/08 - */ - @Test - public void importBrandManage() throws IOException { - String brandManagerFileUrl = "C:\\Users\\Administrator\\Desktop\\brandManager.json"; - List jsonBrands = JSONArray.parseArray(readJson(brandManagerFileUrl), JsonBrandManager.class); - List brandManagers = BeanUtils.mapToList(jsonBrands, BrandManager.class); - SpringUtils.getBean(BrandManagerService.class).saveBatch(brandManagers); - Map brandManagerMap = brandManagers.stream().collect(Collectors.toMap(BrandManager::getBrandManagerCloudId, BrandManager::getId)); - //中间表数据 - Map brandMap = SpringUtils.getBean(BrandExtendService.class).list() - .stream().collect(Collectors.toMap(BrandExtend::getBrandCloudId, BrandExtend::getBrandId)); - Map storMap = SpringUtils.getBean(StoreExtendService.class).list() - .stream().collect(Collectors.toMap(StoreExtend::getStoreCloudId, StoreExtend::getStoreId)); - List brandManagerStores = new ArrayList<>(); - jsonBrands.forEach(item->{ - if (item.getStoreCloudIds() != null && !item.getStoreCloudIds().isEmpty()) { - item.getStoreCloudIds().forEach(inner -> { - BrandManagerStore brandManagerStore = new BrandManagerStore(); - brandManagerStore.setBrandId(brandMap.get(item.getBrandCloudId())) - .setBrandManagerId(brandManagerMap.get(item.getBrandManagerCloudId())) - .setStoreId(storMap.get(inner)); - brandManagerStores.add(brandManagerStore); - }); - } else { - if (StringUtils.isNotBlank(item.getBrandCloudId())) { - BrandManagerStore brandManagerStore = new BrandManagerStore(); - brandManagerStore.setBrandId(brandMap.get(item.getBrandCloudId())).setBrandManagerId(brandManagerMap.get(item.getBrandManagerCloudId())); - brandManagerStores.add(brandManagerStore); - } - } - }); - SpringUtils.getBean(BrandManagerStoreService.class).saveBatch(brandManagerStores); - } - - /** - * 批量修改校区是否是测试校区 - * @author DB - * @since 2023/12/12 - */ - @Test - public void batchUpdateStoreIsTest() { - List storeCloudIds; - try { - DataSourceKey.use("jambox"); - List rowList = DbChain.table("t_mechanism_info").select("store_id").where("test = 0").and("deleted = 1").list(); - storeCloudIds = RowUtil.toEntityList(rowList, String.class); - //批量修改 - } finally { - DataSourceKey.clear(); - } - if (storeCloudIds != null) { - Set storeSet = SpringUtils.getBean(StoreExtendService.class).queryChain().where(STORE_EXTEND.STORE_CLOUD_ID.in(storeCloudIds)).list() - .stream().map(StoreExtend::getId).collect(Collectors.toSet()); - SpringUtils.getBean(StoreService.class).updateChain().set(STORE.IS_TEST,false).where(STORE.ID.in(storeSet)).update(); - } - } - - /** - * 批量导入校区营业执照 - * @author DB - * @since 2023/12/12 - */ - @Test - public void batchImportStoreLicense() { - List rowList; - try { - DataSourceKey.use("jambox"); - rowList = DbChain.table("t_mechanism_info").select("store_id as storeCloudId", "reg_addr as licenseAddr", "str_to_date(reg_date,'%Y年%m月%d') as licenseDate", "reg_Name as licenseName", - "ness_license_id as licenseCode", "corp_name as licenseUserName", "reg_pic as licensePicUrl") - .where("reg_addr is not null") - .list(); - } finally { - DataSourceKey.clear(); - } - //获取校区信息 - Map storeMap = SpringUtils.getBean(StoreExtendService.class).queryChain() - .where(STORE_EXTEND.STORE_CLOUD_ID.in(rowList.stream().map(item -> item.getString("storeCloudId")).collect(Collectors.toSet()))) - .list() - .stream().collect(Collectors.toMap(StoreExtend::getStoreCloudId, StoreExtend::getStoreId)); - rowList.forEach(item -> { - item.set("storeId", storeMap.get(item.getString("storeCloudId"))); - System.out.println(item.toString()); - }); - List licenseList = RowUtil.toEntityList(rowList, StoreLicense.class).stream().filter(item->item.getStoreId() != null).collect(Collectors.toList()); - SpringUtils.getBean(StoreLicenseService.class).saveBatch(licenseList); - } - - /** - * 批量修改校区创建时间 - * @author DB - * @since 2023/12/13 - */ - @Test - public void batchUpdateStoreCreateTime() { - List rowList; - try { - DataSourceKey.use("jambox"); - rowList = DbChain.table("t_mechanism_info").select("store_id as storeCloudId", "creation_time as createTime") - .and("deleted = 1") - .list(); - } finally { - DataSourceKey.clear(); - } - //获取所有校区数据 - StoreExtendService storeExtendService = SpringUtils.getBean(StoreExtendService.class); - Map storeExtendMap = storeExtendService.list().stream().collect(Collectors.toMap(StoreExtend::getStoreCloudId, StoreExtend::getStoreId)); - rowList.forEach(item -> { - item.set("id", storeExtendMap.get(item.getString("storeCloudId"))); - }); - List storeList = RowUtil.toEntityList(rowList, Store.class).stream().filter(item -> item.getId() != null).collect(Collectors.toList()); - SpringUtils.getBean(StoreService.class).updateBatch(storeList); - } - - /** - * 导入校区签约数据 - * @author DB - * @since 2023/12/13 - */ - @Test - public void importStoreSignData() { - List rowList; - try { - DataSourceKey.use("jambox"); - rowList = DbChain.table("t_mechanism_info") - .select("tmi.store_id as storeCloudId","tmi.clue_id") - .select("date_format(tsm.end_time,'%Y-%m-%d') as expireDate") - .from("t_mechanism_info").as("tmi") - .leftJoin("t_signContract_mechanism").as("tsm").on("tsm.store_id = tmi.store_id") - .and("tmi.deleted = 1") - .list(); - } finally { - DataSourceKey.clear(); - } - //获取校区 - Map storeMap = SpringUtils.getBean(StoreExtendService.class).list().stream().collect(Collectors.toMap(StoreExtend::getStoreCloudId, StoreExtend::getStoreId)); - rowList.forEach(item->{ - item.set("storeId",storeMap.get(item.getString("storeCloudId"))); - }); - List entityList = RowUtil.toEntityList(rowList, StoreSign.class); - Set filterStoreList = entityList.stream().filter(item -> item.getStoreId() != null && item.getExpireDate() != null).collect(Collectors.toSet()); - SpringUtils.getBean(StoreSignService.class).saveBatch(filterStoreList); - } - - /** - * 导入校区续费 - * @author DB - * @since 2023/12/14 - */ - @Test - public void importStoreRenew() { - List rowList; - try { - DataSourceKey.use("jambox"); - rowList = DbChain.table("OAM_clue_renew") - .select("tmi.store_id as storeCloudId") - .select("ocr.remarks as renewDesc","ocr.price as renewAmount","date_format(ocr.creation_time,'%Y-%m-%d') as renewDate") - .from("OAM_clue_renew").as("ocr") - .leftJoin("t_mechanism_info").as("tmi").on("tmi.mechanism_id = ocr.mechanism_id") - .list(); - } finally { - DataSourceKey.clear(); - } - - //获取校区 - Map storeMap = SpringUtils.getBean(StoreExtendService.class).list().stream().collect(Collectors.toMap(StoreExtend::getStoreCloudId, StoreExtend::getStoreId)); - rowList.forEach(item->{ - item.set("storeId",storeMap.get(item.getString("storeCloudId"))); - }); - List entityList = RowUtil.toEntityList(rowList, StoreRenew.class); - Set filterStoreList = entityList.stream().filter(item -> item.getStoreId() != null ).collect(Collectors.toSet()); - SpringUtils.getBean(StoreRenewService.class).saveBatch(filterStoreList); - - /*getTestDynamicDataSource(); - try { - DataSourceKey.use("dev"); - //获取校区 - Map storeMap = SpringUtils.getBean(StoreExtendService.class).list().stream().collect(Collectors.toMap(StoreExtend::getStoreCloudId, StoreExtend::getStoreId)); - rowList.forEach(item->{ - item.set("storeId",storeMap.get(item.getString("storeCloudId"))); - }); - List entityList = RowUtil.toEntityList(rowList, StoreRenew.class); - Set filterStoreList = entityList.stream().filter(item -> item.getStoreId() != null ).collect(Collectors.toSet()); - SpringUtils.getBean(StoreRenewService.class).saveBatch(filterStoreList); - } finally { - DataSourceKey.clear(); - }*/ - } - - /** - * 导入旧数币订单数据 - * @author DB - * @since 2023/12/14 - */ - @Test - public void importOldSudaOrderData() { - List rowList; - try { - //数币订单 - DataSourceKey.use("jambox"); - rowList = DbChain.table("j_commodity_ticket") - .select("tbi.brand_id as brandCloudId","jct.store_id as storeCloudId","jct.wx_order_id as outOrderNo") - .select("jct.name as customerName","jct.phone as customerPhone") - .select("jct.price as totalAmount","jct.price as totalPayAmount") - .from("j_commodity_ticket").as("jct") - .leftJoin("t_brand_info").as("tbi").on("tbi.id = jct.brand_id") - .where("jct.deleted = 1") - .and("jct.pay_status = 'PAY'") - .and("jct.is_suda = 1") - .list(); - } finally { - DataSourceKey.clear(); - } - //获取校区 - Map storeMap = SpringUtils.getBean(StoreExtendService.class).list().stream().collect(Collectors.toMap(StoreExtend::getStoreCloudId, StoreExtend::getStoreId)); - Map brandMap = SpringUtils.getBean(BrandExtendService.class).list().stream().collect(Collectors.toMap(BrandExtend::getBrandCloudId, BrandExtend::getBrandId)); - rowList.forEach(item->{ - item.set("orderType",3); - item.set("brandId",brandMap.get(item.getString("brandCloudId"))); - item.set("storeId",storeMap.get(item.getString("storeCloudId"))); - }); - - List entityList = RowUtil.toEntityList(rowList, EasyLearnOrder.class); - SpringUtils.getBean(EasyLearnOrderService.class).saveBatch(entityList); - - /*getTestDynamicDataSource(); - try { - DataSourceKey.use("dev"); - //获取校区 - Map storeMap = SpringUtils.getBean(StoreExtendService.class).list().stream().collect(Collectors.toMap(StoreExtend::getStoreCloudId, StoreExtend::getStoreId)); - Map brandMap = SpringUtils.getBean(BrandExtendService.class).list().stream().collect(Collectors.toMap(BrandExtend::getBrandCloudId, BrandExtend::getBrandId)); - rowList.forEach(item->{ - item.set("orderType",3); - item.set("brandId",brandMap.get(item.getString("brandCloudId"))); - item.set("storeId",storeMap.get(item.getString("storeCloudId"))); - }); - DataSourceKey.use("dev"); - List entityList = RowUtil.toEntityList(rowList, EasyLearnOrder.class); - SpringUtils.getBean(EasyLearnOrderService.class).saveBatch(entityList); - }finally { - DataSourceKey.clear(); - }*/ - } - - /** - * 导入旧微信支付数据 - * @author DB - * @since 2023/12/14 - */ - @Test - public void importOldWxPayOrderData() { - List rowList; - try { - //数币订单 - DataSourceKey.use("jambox"); - rowList = DbChain.table("j_commodity_ticket") - .select("tbi.brand_id as brandCloudId","jct.store_id as storeCloudId","jct.wx_order_id as outOrderNo") - .select("jct.name as customerName","jct.phone as customerPhone") - .select("jct.price as totalAmount","jct.price as totalPayAmount") - .select("jwpp.is_month as isMonth","jwpp.class_hour as periodNumber","jwpp.sub_merch_id as subMchId") - .from("j_commodity_ticket").as("jct") - .leftJoin("t_brand_info").as("tbi").on("tbi.id = jct.brand_id") - .leftJoin("j_wechat_pay_plan").as("jwpp").on("jwpp.template_id = jct.commodity_id") - .where("jct.deleted = 1") - .and("jct.pay_status = 'PAY'") - .and("jct.ticket_type = 1") - .list(); - } finally { - DataSourceKey.clear(); - } - System.out.println(JSON.toJSONString(rowList)); - /*getTestDynamicDataSource(); - try { - //获取校区 - Map storeMap = SpringUtils.getBean(StoreExtendService.class).list().stream().collect(Collectors.toMap(StoreExtend::getStoreCloudId, StoreExtend::getStoreId)); - Map brandMap = SpringUtils.getBean(BrandExtendService.class).list().stream().collect(Collectors.toMap(BrandExtend::getBrandCloudId, BrandExtend::getBrandId)); - rowList.forEach(item->{ - item.set("orderType",3); - item.set("brandId",brandMap.get(item.getString("brandCloudId"))); - item.set("storeId",storeMap.get(item.getString("storeCloudId"))); - }); - DataSourceKey.use("dev"); - List entityList = RowUtil.toEntityList(rowList, EasyLearnOrdre.class); - SpringUtils.getBean(EasyLearnOrdreService.class).saveBatch(entityList); - }finally { - DataSourceKey.clear(); - }*/ - } - - /** - * 导入校区插件 - * @author DB - * @since 2023/12/29 - */ - @Test - public void importStorePlug(){ - List rowList; - try { - //数币订单 - DataSourceKey.use("jambox"); - rowList = DbChain.table("t_application_mechanism") - .select("store_id as storeCloudId", "char_tag as plugTag", "remarks","creation_time as createTime","deleted as isOpen") - .list(); - } finally { - DataSourceKey.clear(); - } - //获取所有校区 - Map storeCloudToStore = SpringUtils.getBean(StoreExtendService.class).list().stream().collect(Collectors.toMap(StoreExtend::getStoreCloudId, StoreExtend::getStoreId)); - rowList.forEach(item -> { - item.put("storeId", storeCloudToStore.get(item.getString("storeCloudId"))); - item.set("isOpen", !item.getBoolean("isOpen")); - }); - List filterRow = rowList.stream().filter(item -> item.getString("storeId") != null).collect(Collectors.toList()); - List entityList = RowUtil.toEntityList(filterRow, StorePlug.class); - SpringUtils.getBean(StorePlugService.class).saveBatch(entityList); - } - - private static final String URL = "jdbc:mysql://localhost:3306/cpop_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8"; - /** - * 数据库用户名 - */ - private static final String USERNAME = "root"; - /** - * 数据库密码 - */ - private static final String PASSWORD = "root"; - - private void getTestDynamicDataSource() { - FlexDataSource flexDataSource = FlexGlobalConfig.getDefaultConfig().getDataSource(); - //新的数据源 - HikariDataSource dataSource = new HikariDataSource(); - dataSource.setJdbcUrl(URL); - dataSource.setUsername(USERNAME); - dataSource.setPassword(PASSWORD); - flexDataSource.addDataSource("dev", dataSource); - } - - @Data - private class JsonBrandManager implements Serializable { - - /** - * 云品牌id - */ - @JSONField(name = "_brandid") - private String brandCloudId; - - /** - * 云校区id集合 - */ - @JSONField(name = "store") - private List storeCloudIds; - - /** - * 手机号 - */ - private String phone; - - /** - * 姓名 - */ - private String name; - - /** - * 云id - */ - @JSONField(name = "_id") - private String brandManagerCloudId; - - } - - /** - * json格式品牌 - */ - @Data - private class JsonBrand implements Serializable{ - - /** - * 品牌名 - */ - @JSONField(name = "name") - private String brandName; - - /** - * 云品牌id - */ - @JSONField(name = "_id") - private String brandCloudId; - - } - - /** - * json格式店铺/校区 - */ - @Data - private class JsonStore implements Serializable { - - /** - * 校区名 - */ - @JSONField(name = "name") - private String name; - - /** - * 云校区id - */ - @JSONField(name = "_id") - private String storeCloudId; - - /** - * 云品牌id - */ - @JSONField(name = "_brandid") - private String brandCloudId; - } - - @Data - private class UpdateStore implements Serializable { - - /** - * 云校区id - */ - private String storeCloudId; - - /** - * 店铺/校区地址 - */ - private String storeAddr; - - /** - * 负责人 - */ - private String personCharge; - - /** - * 手机号 - */ - private String phone; - - /** - * 到期日期 - */ - private LocalDate expireDate; - - /** - * 是否有顾问 - */ - private Boolean haveCounselor; - - /** - * 是否激活 - */ - private Boolean haveActive; - } - - /** - * 读取json文件数据 - * - * @param jsonPath json文件路径 - * @return 字符串 - */ - public String readJson(String jsonPath) throws IOException { - File jsonFile = new File(jsonPath); - FileReader fileReader = new FileReader(jsonFile); - BufferedReader reader = new BufferedReader(fileReader); - StringBuilder sb = new StringBuilder(); - while (true) { - int ch = reader.read(); - if (ch != -1) { - sb.append((char) ch); - } else { - break; - } - } - fileReader.close(); - reader.close(); - return sb.toString(); - } - - /** - * 导入旧员工数据 - * @author DB - * @since 2024/01/02 - */ - @Test - public void importOldStaffData(){ - //获取已有的员工数据 - List rows = Db.selectListByQuery(QueryWrapper.create() - .select(STAFF.ID) - .select(USER.PHONE_NUMBER) - .from(STAFF) - .leftJoin(USER).on(USER.ID.eq(STAFF.USER_ID))); - System.out.println(rows); - List rowList; - try { - DataSourceKey.use("jambox"); - rowList = DbChain.table("OAM_staff") - .select("qy_id as wxCpUserId", "name", "phone as phoneNumber", "type", "avatar_url as avatar", "plaintext as password") - .from("OAM_staff") - .where("deleted = 1") - .notIn("phone", rows.stream().map(item -> item.getString("phoneNumber")).collect(Collectors.toList())) - .list(); - } finally { - DataSourceKey.clear(); - } - StaffService staffService = SpringUtils.getBean(StaffService.class); - RsaUtils rsaUtils = SpringUtils.getBean(RsaUtils.class); - rowList.forEach(item->{ - String encrypt = rsaUtils.encrypt(item.getString("password")); - // 创建员工 - StaffBo staffBo = new StaffBo(); - // 读取用户通用信息 - staffBo.setUserName(item.getString("phoneNumber")) - .setName(item.getString("name")) - .setPhoneNumber(item.getString("phoneNumber")) - .setSex(true) - .setStatus(true) - .setStaffType(1) - .setWxCpUserId(item.getString("wxCpUserId")) - .setPassword(encrypt) - // 设置部门 - .setDeptId("82682906627141632") - // 区分技术员工和运营员工 - .setRoleId(InitRoleEnum.WX_CP_INIT_OPERATION_ROLE.getId()); - // 保存员工 - staffService.insertStaff(staffBo); - }); - } - - /** - * 导入旧值班数据 - * @author DB - * @since 2024/01/02 - */ - @Test - public void importOldDutyData() { - List rowList; - //获取旧员工数据 - Map oldStaffPhone; - try { - DataSourceKey.use("jambox"); - rowList = DbChain.table("OAM_staff") - .select("after_sales", "iteration", "duty_time") - .from("OAM_duty") - .where("deleted = 1") - .list(); - //获取旧员工数据 - oldStaffPhone = DbChain.table("OAM_staff") - .select("staff_id", "phone") - .from("OAM_staff") - .where("deleted = 1") - .list().stream().collect(Collectors.toMap(item -> item.getString("staffId"), item -> item.getString("phone"))); - } finally { - DataSourceKey.clear(); - } - //获取现有所有员工 - Map staffMap = SpringUtils.getBean(StaffService.class).listAs(QueryWrapper.create() - .select(STAFF.ID, STAFF.NAME) - .select(USER.PHONE_NUMBER.as(StaffInfoVo::getPhoneNumber)) - .from(STAFF) - .leftJoin(USER).on(USER.ID.eq(STAFF.USER_ID)), - StaffInfoVo.class).stream().collect(Collectors.toMap(StaffInfoVo::getPhoneNumber, item -> item)); - rowList.forEach(item -> { - StaffInfoVo afterSales = staffMap.get(oldStaffPhone.get(item.getString("afterSales"))); - StaffInfoVo iteration = staffMap.get(oldStaffPhone.get(item.getString("iteration"))); - if (afterSales != null && iteration != null){ - item.put("serviceStaffId",afterSales.getId()); - item.put("technologyStaffId",iteration.getId()); - } else { - item.put("serviceStaffId","97819551034630144"); - item.put("technologyStaffId","97819551034630144"); - } - //时间戳转日期 - item.put("dutyDate", item.getLocalDateTime("dutyTime").toLocalDate()); - }); - List entityList = RowUtil.toEntityList(rowList, Duty.class); - SpringUtils.getBean(DutyService.class).saveBatch(entityList.stream().filter(item->item.getServiceStaffId()!=null).collect(Collectors.toList())); - } - - /** - * 导入旧数据记录 - * @author DB - * @since 2024/01/02 - */ - @Test - public void importOldDataImport(){ - List rowList; - try { - DataSourceKey.use("jambox"); - rowList = DbChain.table("OAM_upload") - .select("ou.file_url", "ou.empty_tag as isClear", "ou.status as importStatus", "ou.remarks", "tmi.store_id as storeCloudId","ou.creation_time as createTime") - .from("OAM_upload").as("ou") - .where("ou.deleted = 1") - .leftJoin("t_mechanism_info").as("tmi").on("tmi.mechanism_id = ou.mechanism_id") - .list(); - } finally { - DataSourceKey.clear(); - } - //查询校区 - Map cloudToStore = SpringUtils.getBean(StoreExtendService.class).list().stream().collect(Collectors.toMap(StoreExtend::getStoreCloudId, StoreExtend::getStoreId)); - Map storeMap = SpringUtils.getBean(StoreService.class).queryChain().list().stream().collect(Collectors.toMap(Store::getId, item -> item)); - rowList.forEach(item -> { - String storeId = cloudToStore.get(item.getString("storeCloudId")); - if (StringUtils.isNotBlank(storeId)) { - item.put("storeId", storeId); - item.put("brandId", storeMap.get(storeId).getBrandId()); - item.put("sourceType", "JAMBOX"); - } - }); - List filterList = rowList.stream().filter(item -> StringUtils.isNotBlank(item.getString("storeId"))).collect(Collectors.toList()); - List entityList = RowUtil.toEntityList(filterList, DataImport.class); - SpringUtils.getBean(DataImportService.class).saveBatch(entityList); - } - - /** - * 财务报销旧数据导入 - * @author DB - * @since 2024/01/03 - */ - @Test - public void financeReimburseOldDataImport(){ - //报销类型 - //List typeRowList; - List recordRowList; - List stageRowList; - try { - DataSourceKey.use("jambox"); - - //报销记录 - recordRowList = DbChain.table("OAM_finance_reimbursement") - .select("ofr.id as updateUserId", "os.phone", "ofr.status", "ofr.type_id", "ofr.report_date", "ofr.remarks", "ofr.price", "ofr.annex as attachmentUrl") - .from("OAM_finance_reimbursement").as("ofr") - .leftJoin("OAM_staff").as("os").on("os.staff_id = ofr.staff_id") - .where("ofr.deleted = 1") - .list(); - //报销阶段 - stageRowList = DbChain.table("OAM_finance_reimbursement_stage") - .select("finance_reimbursement_id", "stage_amount", "payment_time") - .from("OAM_finance_reimbursement_stage") - .where("deleted = 1") - .list(); - } finally { - DataSourceKey.clear(); - } - //获取现有所有员工 - Map staffMap = SpringUtils.getBean(StaffService.class).listAs(QueryWrapper.create() - .select(STAFF.ID, STAFF.NAME, STAFF.USER_ID) - .select(USER.PHONE_NUMBER.as(StaffInfoVo::getPhoneNumber)) - .from(STAFF) - .leftJoin(USER).on(USER.ID.eq(STAFF.USER_ID)), - StaffInfoVo.class).stream().collect(Collectors.toMap(StaffInfoVo::getPhoneNumber, item -> item)); - List filterRecordRowList = recordRowList.stream() - .filter(item -> StringUtils.isNotBlank(item.getString("phone")) && staffMap.get(item.getString("phone")) != null) - .collect(Collectors.toList()); - filterRecordRowList.forEach(item->{ - //文件上传地址格式调整 - if (StringUtils.isNotBlank(item.getString("attachmentUrl"))) { - Map map = new HashMap<>(); - map.put("name", "旧数据无名字"); - map.put("url", item.getString("attachmentUrl")); - List> maps = new ArrayList<>(); - maps.add(map); - item.set("attachmentUrl", JSONArray.toJSONString(maps)); - } - StaffInfoVo staffInfoVo = staffMap.get(item.getString("phone")); - item.set("staffId", staffInfoVo.getId()); - }); - List financeReimburses = RowUtil.toEntityList(filterRecordRowList, FinanceReimburse.class); - SpringUtils.getBean(FinanceReimburseService.class).saveBatch(financeReimburses); - //获取所有员工 - Map oldReimburseIdMap = SpringUtils.getBean(FinanceReimburseService.class).list().stream().collect(Collectors.toMap(BaseEntity::getUpdateUserId, item -> item)); - stageRowList.forEach(item -> { - if (oldReimburseIdMap.get(item.getString("financeReimbursementId")) != null){ - item.set("financeReimburseId", oldReimburseIdMap.get(item.getString("financeReimbursementId")).getId()); - } - }); - List financeReimburseStages = RowUtil.toEntityList(stageRowList, FinanceReimburseStage.class); - SpringUtils.getBean(FinanceReimburseStageService.class).saveBatch(financeReimburseStages); - } - - /** - * 迭代旧数据 - * @author DB - * @since 2024/01/03 - */ - @Test - public void iterationOldDataImport(){ - List rowList; - List staffRowList; - try { - DataSourceKey.use("jambox"); - rowList = DbChain.table("OAM_iteration") - .select("iteration_id as updateUserId", "system_name as subject", "staff_id", "enclosure as attachmentUrl", "content as taskContent", - "DATE_FORMAT(estimate_time,'%Y-%m-%d') as expectedCompletionDate", "status", "grade as taskRating", "remarks as remark") - .select("creation_time as createTime", "last_modification_date as updateTime", "creation_by") - .from("OAM_iteration") - .where("deleted = 1") - .list(); - staffRowList = DbChain.table("OAM_staff") - .select("staff_id", "phone") - .from("OAM_staff") - .where("deleted = 1") - .list(); - } finally { - DataSourceKey.clear(); - } - //获取旧员工id - Map oldStaffMap = staffRowList.stream().collect(Collectors.toMap(item -> item.getString("staffId"), item -> item.getString("phone"))); - //获取现有所有员工 - Map staffMap = SpringUtils.getBean(StaffService.class).listAs(QueryWrapper.create() - .select(STAFF.ID, STAFF.NAME, STAFF.USER_ID) - .select(USER.PHONE_NUMBER.as(StaffInfoVo::getPhoneNumber)) - .from(STAFF) - .leftJoin(USER).on(USER.ID.eq(STAFF.USER_ID)), - StaffInfoVo.class).stream().collect(Collectors.toMap(StaffInfoVo::getPhoneNumber, item -> item)); - rowList.forEach(item -> { - //所有任务预设为迭代任务 - item.put("taskType", 0); - //负责员工不为空 - if (StringUtils.isNotBlank(item.getString("staffId")) && oldStaffMap.get(item.getString("staffId")) != null) { - if (staffMap.get(oldStaffMap.get(item.getString("staffId"))) != null) { - item.put("responsibleStaffId", staffMap.get(oldStaffMap.get(item.getString("staffId"))).getId()); - } else { - item.put("responsibleStaffId", "97819551034630144"); - } - } else { - item.put("responsibleStaffId", "97819551034630144"); - } - //记录员工为创建人 - if (StringUtils.isNotBlank(item.getString("creationBy")) && oldStaffMap.get(item.getString("creationBy")) != null) { - String createStaffPhone = oldStaffMap.get(item.getString("creationBy")); - if (staffMap.get(createStaffPhone) != null) { - item.put("recordStaffId", staffMap.get(createStaffPhone).getId()); - } else { - item.put("recordStaffId", "97819551034630144"); - } - } else { - item.put("recordStaffId", "97819551034630144"); - } - if (StringUtils.isNotBlank(item.getString("creationBy")) && oldStaffMap.get(item.getString("creationBy")) != null) { - String createStaffPhone = oldStaffMap.get(item.getString("creationBy")); - if (staffMap.get(createStaffPhone) != null) { - item.put("createUserId", staffMap.get(createStaffPhone).getUserId()); - } else { - item.put("createUserId", "fb8bc1dcee4040b7b27feaf2789aeef1"); - } - } else { - item.put("createUserId", "fb8bc1dcee4040b7b27feaf2789aeef1"); - } - //文件上传地址格式调整 - if (StringUtils.isNotBlank(item.getString("attachmentUrl"))) { - Map map = new HashMap<>(); - map.put("name", "旧数据无名字"); - map.put("url", item.getString("attachmentUrl")); - List> maps = new ArrayList<>(); - maps.add(map); - item.set("attachmentUrl", JSONArray.toJSONString(maps)); - } - //获取任务状态 - getTaskStatus(item.getInt("status"), item); - //评级 - if (StringUtils.isNotBlank(item.getString("taskRating"))){ - //获取任务权重 - getTaskWeight(item); - } - }); - List entityList = RowUtil.toEntityList(rowList, Task.class); - SpringUtils.getBean(TaskService.class).saveBatch(entityList); - } - - /** - * 绩点 - * @author DB - * @since 2024/01/03 - */ - @Test - public void taskStaffOldDataImport() { - List rowList; - List staffRowList; - try { - DataSourceKey.use("jambox"); - rowList = DbChain.table("OAM_iteration_scale") - .select("iteration_id", "scale as gradePoint", "staff_id", "remarks as remark") - .select("creation_time as createTime", "last_modification_date as updateTime", "creation_by", "last_modified") - .from("OAM_iteration_scale") - .where("deleted = 1") - .list(); - staffRowList = DbChain.table("OAM_staff") - .select("staff_id", "phone") - .from("OAM_staff") - .where("deleted = 1") - .list(); - } finally { - DataSourceKey.clear(); - } - //获取旧员工id - Map oldStaffMap = staffRowList.stream().collect(Collectors.toMap(item -> item.getString("staffId"), item -> item.getString("phone"))); - //获取所有任务 - Map taskMap = SpringUtils.getBean(TaskService.class).list().stream().collect(Collectors.toMap(BaseEntity::getUpdateUserId, Task::getId)); - //获取现有所有员工 - Map staffMap = SpringUtils.getBean(StaffService.class).listAs(QueryWrapper.create() - .select(STAFF.ID, STAFF.NAME, STAFF.USER_ID) - .select(USER.PHONE_NUMBER.as(StaffInfoVo::getPhoneNumber)) - .from(STAFF) - .leftJoin(USER).on(USER.ID.eq(STAFF.USER_ID)), - StaffInfoVo.class).stream().collect(Collectors.toMap(StaffInfoVo::getPhoneNumber, item -> item)); - rowList.forEach(item -> { - //员工 - if (StringUtils.isNotBlank(item.getString("staffId")) && oldStaffMap.get(item.getString("staffId")) != null) { - if (staffMap.get(oldStaffMap.get(item.getString("staffId"))) != null) { - item.set("staffId", staffMap.get(oldStaffMap.get(item.getString("staffId"))).getId()); - } else { - item.put("staffId", "97819551034630144"); - } - } else { - item.put("staffId", "97819551034630144"); - } - item.put("taskId",taskMap.get(item.getString("iterationId"))); - if (StringUtils.isNotBlank(item.getString("creationBy")) && oldStaffMap.get(item.getString("creationBy")) != null) { - String createStaffPhone = oldStaffMap.get(item.getString("creationBy")); - if (staffMap.get(createStaffPhone) != null) { - item.put("createUserId", staffMap.get(createStaffPhone).getUserId()); - }else { - item.put("createUserId", "fb8bc1dcee4040b7b27feaf2789aeef1"); - } - } else { - item.put("createUserId", "fb8bc1dcee4040b7b27feaf2789aeef1"); - } - if (StringUtils.isNotBlank(item.getString("creationBy")) && oldStaffMap.get(item.getString("creationBy")) != null) { - String createStaffPhone = oldStaffMap.get(item.getString("creationBy")); - if (staffMap.get(createStaffPhone) != null) { - item.put("createUserId", staffMap.get(createStaffPhone).getUserId()); - }else { - item.put("createUserId", "fb8bc1dcee4040b7b27feaf2789aeef1"); - } - } else { - item.put("createUserId", "fb8bc1dcee4040b7b27feaf2789aeef1"); - } - if (StringUtils.isNotBlank(item.getString("lastModified")) && oldStaffMap.get(item.getString("lastModified")) != null) { - String updateStaffPhone = oldStaffMap.get(item.getString("lastModified")); - if (staffMap.get(updateStaffPhone) != null) { - item.put("updateUserId", staffMap.get(updateStaffPhone).getUserId()); - } else { - item.put("updateUserId", "fb8bc1dcee4040b7b27feaf2789aeef1"); - } - } else { - item.put("updateUserId", "fb8bc1dcee4040b7b27feaf2789aeef1"); - } - }); - List entityList = RowUtil.toEntityList(rowList, TaskStaffGroup.class); - SpringUtils.getBean(TaskStaffGroupService.class).saveBatch(entityList); - } - - /** - * 获取任务状态 - * @author DB - * @since 2024/1/4 - * @param status 旧状态值 - * @param row 插入 - */ - private void getTaskStatus(Integer status, Row row) { - switch (status) { - //待领取 - case 0: - //有评级 - if (StringUtils.isNotBlank(row.getString("taskRating"))){ - row.put("taskStatus",1); - } else { - row.put("taskStatus",0); - } - row.put("taskItem",0); - break; - //进行中 - case 1: - case 2: - row.put("taskStatus",2); - row.put("taskItem",1); - row.put("taskProgress","0,1,2,3,4"); - row.put("taskReceiptTime",row.getLocalDateTime("createTime")); - break; - //带部署 - case 3: - row.put("taskStatus", 8); - row.put("taskItem", 2); - row.put("taskProgress", "0,1,2,3,4"); - row.put("testToFinishUrl",row.getString("attachmentUrl")); - row.put("toTestTime",row.getLocalDateTime("updateTime")); - row.put("taskReceiptTime",row.getLocalDateTime("createTime")); - row.put("completion_date",row.getLocalDateTime("updateTime").toLocalDate()); - break; - //已归档 - default: - row.put("taskStatus", 9); - row.put("taskItem", 3); - row.put("taskProgress", "0,1,2,3,4"); - row.put("testToFinishUrl",row.getString("attachmentUrl")); - row.put("toDeployTime",row.getLocalDateTime("updateTime")); - row.put("toTestTime",row.getLocalDateTime("updateTime")); - row.put("taskReceiptTime",row.getLocalDateTime("createTime")); - row.put("completion_date",row.getLocalDateTime("updateTime").toLocalDate()); - break; - } - } - - private Integer getTaskWeight(Row row){ - switch (row.getString("taskRating")){ - case "A": - row.put("taskWeight",200); - return 200; - case "B": - row.put("taskWeight",100); - return 100; - case "C": - row.put("taskWeight",80); - return 80; - case "D": - row.put("taskWeight",40); - return 40; - case "E": - row.put("taskWeight",20); - return 20; - default: - row.put("taskWeight",10); - return 10; - } - } - - private LocalDate taskRatingToDate(String rating,LocalDate startDate){ - switch (rating){ - case "A": - return startDate.plusDays(30); - case "B": - return startDate.plusDays(21); - case "C": - return startDate.plusDays(15); - case "D": - return startDate.plusDays(7); - case "E": - return startDate.plusDays(3); - default: - return startDate.plusDays(1); - } - } - - @Test - public void demandOldDataImport(){ - List rowList; - List staffRowList; - try { - DataSourceKey.use("jambox"); - //报销阶段 - rowList = DbChain.table("OAM_demand") - .select("tmi.store_id as storeCloudId", "od.iteration_id", "od.type", "od.content as taskContent", "od.file_url as attachmentUrl", "od.status", - "od.remarks", "od.grade as taskRating", "od.sign_pic", "od.sign_url as payQrCode", "od.payment as prepayment", "od.price as payable", "od.wx_order_id", "od.sign_agree") - .select("od.creation_time as createTime", "od.last_modification_date as updateTime", "od.creation_by", "od.last_modified") - .from("OAM_demand").as("od") - .leftJoin("t_mechanism_info").as("tmi").on("tmi.mechanism_id = od.mechanism_id") - .leftJoin("OAM_iteration").as("oi").on("oi.iteration_id = od.iteration_id") - .where("od.deleted = 1") - .list(); - staffRowList = DbChain.table("OAM_staff") - .select("staff_id", "phone") - .from("OAM_staff") - .where("deleted = 1") - .list(); - } finally { - DataSourceKey.clear(); - } - //获取旧员工id - Map oldStaffMap = staffRowList.stream().collect(Collectors.toMap(item -> item.getString("staffId"), item -> item.getString("phone"))); - //获取现有所有员工 - Map staffMap = SpringUtils.getBean(StaffService.class).listAs(QueryWrapper.create() - .select(STAFF.ID, STAFF.NAME,STAFF.USER_ID) - .select(USER.PHONE_NUMBER.as(StaffInfoVo::getPhoneNumber)) - .from(STAFF) - .leftJoin(USER).on(USER.ID.eq(STAFF.USER_ID)), - StaffInfoVo.class).stream().collect(Collectors.toMap(StaffInfoVo::getPhoneNumber, item -> item)); - //查询校区 - Map cloudToStore = SpringUtils.getBean(StoreExtendService.class).list().stream().collect(Collectors.toMap(StoreExtend::getStoreCloudId, StoreExtend::getStoreId)); - Map storeMap = SpringUtils.getBean(StoreService.class).queryChain().list().stream().collect(Collectors.toMap(Store::getId, item -> item)); - TaskService taskService = SpringUtils.getBean(TaskService.class); - //获取所有任务 - Map taskMap = taskService.list().stream().collect(Collectors.toMap(BaseEntity::getUpdateUserId, item->item)); - //是否有任务 - List notHaveTask = rowList.stream().filter(item -> StringUtils.isBlank(item.getString("iteration_id"))).collect(Collectors.toList()); - //更新 - notHaveTask.forEach(item -> { - //是否有评级 - Task task = new Task(); - task.setCreateTime(item.getLocalDateTime("createTime")); - task.setUpdateTime(item.getLocalDateTime("updateTime")); - if (StringUtils.isNotBlank(item.getString("creationBy")) && oldStaffMap.get(item.getString("creationBy")) != null) { - String createStaffPhone = oldStaffMap.get(item.getString("creationBy")); - if (staffMap.get(createStaffPhone) != null) { - item.put("createUserId", staffMap.get(createStaffPhone).getUserId()); - task.setCreateUserId(staffMap.get(createStaffPhone).getUserId()); - task.setUpdateUserId(staffMap.get(createStaffPhone).getUserId()); - } else { - item.put("createUserId", "fb8bc1dcee4040b7b27feaf2789aeef1"); - task.setCreateUserId("fb8bc1dcee4040b7b27feaf2789aeef1"); - task.setUpdateUserId("fb8bc1dcee4040b7b27feaf2789aeef1"); - } - } else { - item.put("createUserId", "fb8bc1dcee4040b7b27feaf2789aeef1"); - task.setCreateUserId("fb8bc1dcee4040b7b27feaf2789aeef1"); - task.setUpdateUserId("fb8bc1dcee4040b7b27feaf2789aeef1"); - } - if (StringUtils.isNotBlank(item.getString("lastModified")) && oldStaffMap.get(item.getString("lastModified")) != null) { - String updateStaffPhone = oldStaffMap.get(item.getString("lastModified")); - if (staffMap.get(updateStaffPhone) != null) { - item.put("updateUserId", staffMap.get(updateStaffPhone).getUserId()); - }else { - item.put("updateUserId", "fb8bc1dcee4040b7b27feaf2789aeef1"); - } - } else { - item.put("updateUserId", "fb8bc1dcee4040b7b27feaf2789aeef1"); - } - //文件上传地址格式调整 - if (StringUtils.isNotBlank(item.getString("attachmentUrl"))) { - Map map = new HashMap<>(); - map.put("name", "旧数据无名字"); - map.put("url", item.getString("attachmentUrl")); - List> maps = new ArrayList<>(); - maps.add(map); - item.set("attachmentUrl", JSONArray.toJSONString(maps)); - } - //记录员工为创建人 - if (StringUtils.isNotBlank(item.getString("creationBy")) && oldStaffMap.get(item.getString("creationBy")) != null) { - String createStaffPhone = oldStaffMap.get(item.getString("creationBy")); - if (staffMap.get(createStaffPhone) != null) { - task.setRecordStaffId(staffMap.get(createStaffPhone).getId()); - }else { - task.setRecordStaffId("97819551034630144"); - } - } else { - task.setRecordStaffId("97819551034630144"); - } - if (StringUtils.isBlank(item.getString("taskRating"))) { - // 默认待审核 - task.setTaskStatus(0).setTaskItem(0).setTaskType(1).setSubject("果酱盒子").setTaskContent(item.getString("taskContent")); - } else if (item.getBoolean("status")) { - //已完成 - task.setTaskStatus(9).setTaskItem(3).setTaskType(1).setSubject("果酱盒子").setTaskContent(item.getString("taskContent")); - task.setTaskRating(item.getString("taskRating")).setTaskWeight(getTaskWeight(item)); - //通用 - task.setToDeployTime(item.getLocalDateTime("updateTime")).setToTestTime(item.getLocalDateTime("updateTime")) - .setTaskReceiptTime(item.getLocalDateTime("createTime")).setCompletionDate(item.getLocalDateTime("updateTime").toLocalDate()) - .setAttachmentUrl(item.getString("attachmentUrl")).setTestToFinishUrl(item.getString("attachmentUrl")) - .setExpectedCompletionDate(taskRatingToDate(item.getString("taskRating"), item.getLocalDateTime("createTime").toLocalDate())); - } else { - //未完成 - task.setTaskStatus(1).setTaskItem(0).setTaskType(1).setSubject("果酱盒子").setTaskContent(item.getString("taskContent")); - task.setTaskRating(item.getString("taskRating")).setTaskWeight(getTaskWeight(item)).setTaskReceiptTime(item.getLocalDateTime("createTime")) - .setAttachmentUrl(item.getString("attachmentUrl")); - } - taskService.save(task); - item.set("taskId", task.getId()); - if (storeMap.get(cloudToStore.get(item.getString("storeCloudId"))) != null){ - item.set("storeId", storeMap.get(cloudToStore.get(item.getString("storeCloudId"))).getId()); - item.set("brandId", storeMap.get(cloudToStore.get(item.getString("storeCloudId"))).getBrandId()); - } - }); - List updateTasks = new ArrayList<>(); - List haveTask = rowList.stream().filter(item -> StringUtils.isNotBlank(item.getString("iteration_id"))).collect(Collectors.toList()); - haveTask.forEach(item->{ - //是否有评级 - Task task = new Task(); - task.setCreateTime(item.getLocalDateTime("createTime")); - task.setUpdateTime(item.getLocalDateTime("updateTime")); - if (StringUtils.isNotBlank(item.getString("creationBy")) && oldStaffMap.get(item.getString("creationBy")) != null) { - String createStaffPhone = oldStaffMap.get(item.getString("creationBy")); - if (staffMap.get(createStaffPhone) != null) { - item.put("createUserId", staffMap.get(createStaffPhone).getUserId()); - task.setCreateUserId(staffMap.get(createStaffPhone).getUserId()); - task.setUpdateUserId(staffMap.get(createStaffPhone).getUserId()); - } else { - item.put("createUserId", "fb8bc1dcee4040b7b27feaf2789aeef1"); - task.setCreateUserId("fb8bc1dcee4040b7b27feaf2789aeef1"); - task.setUpdateUserId("fb8bc1dcee4040b7b27feaf2789aeef1"); - } - } else { - item.put("createUserId", "fb8bc1dcee4040b7b27feaf2789aeef1"); - task.setCreateUserId("fb8bc1dcee4040b7b27feaf2789aeef1"); - task.setUpdateUserId("fb8bc1dcee4040b7b27feaf2789aeef1"); - } - if (StringUtils.isNotBlank(item.getString("lastModified")) && oldStaffMap.get(item.getString("lastModified")) != null) { - String updateStaffPhone = oldStaffMap.get(item.getString("lastModified")); - if (staffMap.get(updateStaffPhone) != null) { - item.put("updateUserId", staffMap.get(updateStaffPhone).getUserId()); - } else { - item.put("updateUserId", "fb8bc1dcee4040b7b27feaf2789aeef1"); - } - } else { - item.put("updateUserId", "fb8bc1dcee4040b7b27feaf2789aeef1"); - } - //文件上传地址格式调整 - if (StringUtils.isNotBlank(item.getString("attachmentUrl"))) { - Map map = new HashMap<>(); - map.put("name", "旧数据无名字"); - map.put("url", item.getString("attachmentUrl")); - List> maps = new ArrayList<>(); - maps.add(map); - item.set("attachmentUrl", JSONArray.toJSONString(maps)); - } - //记录员工为创建人 - if (StringUtils.isNotBlank(item.getString("creationBy")) && oldStaffMap.get(item.getString("creationBy")) != null) { - String createStaffPhone = oldStaffMap.get(item.getString("creationBy")); - if (staffMap.get(createStaffPhone) != null) { - task.setRecordStaffId(staffMap.get(createStaffPhone).getId()); - }else { - task.setRecordStaffId("97819551034630144"); - } - } else { - task.setRecordStaffId("97819551034630144"); - } - if (taskMap.get(item.getString("iterationId")) != null) { - //是否有评级 - if (StringUtils.isBlank(item.getString("taskRating"))) { - // 默认待审核 - task.setId(taskMap.get(item.getString("iterationId")).getId()).setTaskStatus(0).setTaskItem(0).setTaskType(1).setSubject("果酱盒子").setTaskContent(item.getString("taskContent")); - } else if (item.getBoolean("status")) { - //已完成 - task.setId(taskMap.get(item.getString("iterationId")).getId()).setTaskStatus(9).setTaskItem(3).setTaskType(1) - .setSubject("果酱盒子").setTaskContent(item.getString("taskContent")); - task.setTaskRating(item.getString("taskRating")).setTaskWeight(getTaskWeight(item)); - //通用 - task.setToDeployTime(item.getLocalDateTime("updateTime")).setToTestTime(item.getLocalDateTime("updateTime")) - .setTaskReceiptTime(item.getLocalDateTime("createTime")).setCompletionDate(item.getLocalDateTime("updateTime").toLocalDate()) - .setAttachmentUrl(item.getString("attachmentUrl")).setTestToFinishUrl(item.getString("attachmentUrl")) - .setExpectedCompletionDate(taskRatingToDate(item.getString("taskRating"), item.getLocalDateTime("createTime").toLocalDate())); - } else { - //未完成 - task.setId(taskMap.get(item.getString("iterationId")).getId()).setTaskStatus(1).setTaskItem(0).setTaskType(1).setSubject("果酱盒子").setTaskContent(item.getString("taskContent")); - task.setTaskRating(item.getString("taskRating")).setTaskWeight(getTaskWeight(item)) - .setAttachmentUrl(item.getString("attachmentUrl")); - } - updateTasks.add(task); - } else { - //是否有评级 - if (StringUtils.isBlank(item.getString("taskRating"))) { - // 默认待审核 - task.setTaskStatus(0).setTaskItem(0).setTaskType(1).setSubject("果酱盒子").setTaskContent(item.getString("taskContent")); - } else if (item.getBoolean("status")) { - //已完成 - task.setTaskStatus(9).setTaskItem(3).setTaskType(1).setSubject("果酱盒子").setTaskContent(item.getString("taskContent")); - task.setTaskRating(item.getString("taskRating")).setTaskWeight(getTaskWeight(item)); - //通用 - task.setToDeployTime(item.getLocalDateTime("updateTime")).setToTestTime(item.getLocalDateTime("updateTime")) - .setTaskReceiptTime(item.getLocalDateTime("createTime")).setCompletionDate(item.getLocalDateTime("updateTime").toLocalDate()) - .setAttachmentUrl(item.getString("attachmentUrl")).setTestToFinishUrl(item.getString("attachmentUrl")) - .setExpectedCompletionDate(taskRatingToDate(item.getString("taskRating"), item.getLocalDateTime("createTime").toLocalDate())); - } else { - //未完成 - task.setTaskStatus(1).setTaskItem(0).setTaskType(1).setSubject("果酱盒子").setTaskContent(item.getString("taskContent")); - task.setTaskRating(item.getString("taskRating")).setTaskWeight(getTaskWeight(item)).setTaskReceiptTime(item.getLocalDateTime("createTime")) - .setAttachmentUrl(item.getString("attachmentUrl")); - } - taskService.save(task); - } item.set("taskId", task.getId()); - if (storeMap.get(cloudToStore.get(item.getString("storeCloudId"))) != null){ - item.set("storeId", storeMap.get(cloudToStore.get(item.getString("storeCloudId"))).getId()); - item.set("brandId", storeMap.get(cloudToStore.get(item.getString("storeCloudId"))).getBrandId()); - } - }); - taskService.updateBatch(updateTasks); - SpringUtils.getBean(TaskDemandService.class).saveBatch(RowUtil.toEntityList(rowList, TaskDemand.class)); - } - - /** - * 工单旧数据导入 - * @author DB - * @since 2024/01/03 - */ - @Test - public void workOrderOldDataImport(){ - List rowList; - List staffRowList; - try { - DataSourceKey.use("jambox"); - rowList = DbChain.table("OAM_work") - .select("tmi.store_id as storeCloudId","ow.work_id as updateUserId", "ow.suspend_time", "ow.system_name", "ow.content as taskContent", "ow.phone as phoneNumber", "ow.file_url as attachmentUrl", - "ow.status", "ow.receive", "ow.receive_time", "ow.remarks as remark","TIMESTAMPDIFF(MINUTE, ow.creation_time, receive_time) as receivingTime", - "ow.last_modification_date as finishTime") - .select("ow.creation_time as createTime", "ow.last_modification_date as updateTime", "ow.creation_by", "ow.last_modified") - .from("OAM_work").as("ow") - .leftJoin("t_mechanism_info").as("tmi").on("tmi.mechanism_id = ow.mechanism_id") - .where("ow.deleted = 1") - .list(); - staffRowList = DbChain.table("OAM_staff") - .select("staff_id", "phone") - .from("OAM_staff") - .where("deleted = 1") - .list(); - } finally { - DataSourceKey.clear(); - } - //获取旧员工id - Map oldStaffMap = staffRowList.stream().collect(Collectors.toMap(item -> item.getString("staffId"), item -> item.getString("phone"))); - //查询校区 - Map cloudToStore = SpringUtils.getBean(StoreExtendService.class).list().stream().collect(Collectors.toMap(StoreExtend::getStoreCloudId, StoreExtend::getStoreId)); - Map storeMap = SpringUtils.getBean(StoreService.class).queryChain().list().stream().collect(Collectors.toMap(Store::getId, item -> item)); - //获取现有所有员工 - Map staffMap = SpringUtils.getBean(StaffService.class).listAs(QueryWrapper.create() - .select(STAFF.ID, STAFF.NAME,STAFF.USER_ID) - .select(USER.PHONE_NUMBER.as(StaffInfoVo::getPhoneNumber)) - .from(STAFF) - .leftJoin(USER).on(USER.ID.eq(STAFF.USER_ID)), - StaffInfoVo.class).stream().collect(Collectors.toMap(StaffInfoVo::getPhoneNumber, item -> item)); - TaskService taskService = SpringUtils.getBean(TaskService.class); - List taskWorkOrders = new ArrayList<>(); - rowList.forEach(item->{ - Task task = new Task(); - //负责员工不为空 - if (StringUtils.isNotBlank(item.getString("receive")) && oldStaffMap.get(item.getString("receive")) != null) { - if (staffMap.get(oldStaffMap.get(item.getString("receive"))) != null) { - task.setResponsibleStaffId(staffMap.get(oldStaffMap.get(item.getString("receive"))).getId()); - } else { - task.setResponsibleStaffId("97819551034630144"); - } - } else { - task.setResponsibleStaffId("97819551034630144"); - } - //记录员工为创建人 - if (StringUtils.isNotBlank(item.getString("creationBy")) && oldStaffMap.get(item.getString("creationBy")) != null) { - String createStaffPhone = oldStaffMap.get(item.getString("creationBy")); - if (staffMap.get(createStaffPhone) != null) { - task.setRecordStaffId(staffMap.get(createStaffPhone).getId()); - task.setCreateUserId(staffMap.get(createStaffPhone).getUserId()); - task.setUpdateUserId(staffMap.get(createStaffPhone).getUserId()); - }else { - task.setRecordStaffId("97819551034630144"); - task.setCreateUserId("fb8bc1dcee4040b7b27feaf2789aeef1"); - task.setUpdateUserId("fb8bc1dcee4040b7b27feaf2789aeef1"); - } - } else { - task.setRecordStaffId("97819551034630144"); - task.setCreateUserId("fb8bc1dcee4040b7b27feaf2789aeef1"); - task.setUpdateUserId("fb8bc1dcee4040b7b27feaf2789aeef1"); - } - task.setCreateTime(item.getLocalDateTime("createTime")); - task.setUpdateTime(item.getLocalDateTime("updateTime")); - task.setTaskItem(3).setTaskStatus(9).setTaskReceiptTime(item.getLocalDateTime("receiveTime")) - .setTaskType(2).setTaskRating("N").setTaskContent(item.getString("taskContent")).setCreateUserId("1"); - taskService.save(task); - TaskWorkOrder workOrder = new TaskWorkOrder(); - String storeId = cloudToStore.get(item.getString("storeCloudId")); - if (StringUtils.isNotBlank(storeId)) { - workOrder.setStoreId(storeId).setBrandId(storeMap.get(storeId).getBrandId()); - } - workOrder.setTaskId(task.getId()).setPhoneNumber(item.getString("phoneNumber")).setReceivingTime(item.getInt("receivingTime")) - .setFinishTime(item.getLocalDateTime("finishTime")); - //记录员工为创建人 - if (StringUtils.isNotBlank(item.getString("creationBy")) && oldStaffMap.get(item.getString("creationBy")) != null) { - String createStaffPhone = oldStaffMap.get(item.getString("creationBy")); - if (staffMap.get(createStaffPhone) != null) { - workOrder.setCreateUserId(staffMap.get(createStaffPhone).getUserId()); - workOrder.setFinishStaffId(staffMap.get(createStaffPhone).getId()); - }else { - workOrder.setCreateUserId("fb8bc1dcee4040b7b27feaf2789aeef1"); - workOrder.setFinishStaffId("97819551034630144"); - } - } else { - workOrder.setCreateUserId("fb8bc1dcee4040b7b27feaf2789aeef1"); - workOrder.setFinishStaffId("97819551034630144"); - } - workOrder.setCreateTime(item.getLocalDateTime("createTime")); - workOrder.setUpdateTime(item.getLocalDateTime("updateTime")); - workOrder.setUpdateUserId(item.getString("updateUserId")); - taskWorkOrders.add(workOrder); - }); - SpringUtils.getBean(TaskWorkOrderService.class).saveBatch(taskWorkOrders); - } - - /** - * 工单旧数据导入 - */ - @Test - public void workOrderRecordOldDataImport() { - List rowList; - List staffRowList; - try { - DataSourceKey.use("jambox"); - rowList = DbChain.table("OAM_work_record") - .select("work_id", "content as recordText", "file_url as attachmentUrl") - .select("creation_time as createTime", "creation_time as updateTime", "creation_by") - .from("OAM_work_record") - .where("deleted = 1") - .list(); - staffRowList = DbChain.table("OAM_staff") - .select("staff_id", "phone") - .from("OAM_staff") - .where("deleted = 1") - .list(); - } finally { - DataSourceKey.clear(); - } - //获取旧员工id - Map oldStaffMap = staffRowList.stream().collect(Collectors.toMap(item -> item.getString("staffId"), item -> item.getString("phone"))); - //获取现有所有员工 - Map staffMap = SpringUtils.getBean(StaffService.class).listAs(QueryWrapper.create() - .select(STAFF.ID, STAFF.NAME,STAFF.USER_ID) - .select(USER.PHONE_NUMBER.as(StaffInfoVo::getPhoneNumber)) - .from(STAFF) - .leftJoin(USER).on(USER.ID.eq(STAFF.USER_ID)), - StaffInfoVo.class).stream().collect(Collectors.toMap(StaffInfoVo::getPhoneNumber, item -> item)); - //获取所有工单 - Map workOrderMap = SpringUtils.getBean(TaskWorkOrderService.class).list().stream().filter(item->StringUtils.isNotBlank(item.getUpdateUserId())) - .collect(Collectors.toMap(BaseEntity::getUpdateUserId, TaskWorkOrder::getId)); - rowList.forEach(item->{ - //记录员工为创建人 - if (StringUtils.isNotBlank(item.getString("creationBy")) && oldStaffMap.get(item.getString("creationBy")) != null) { - String createStaffPhone = oldStaffMap.get(item.getString("creationBy")); - if (staffMap.get(createStaffPhone) != null) { - item.put("recordStaffId", staffMap.get(createStaffPhone).getId()); - item.put("createUserId", staffMap.get(createStaffPhone).getUserId()); - item.put("updateUserid", staffMap.get(createStaffPhone).getUserId()); - }else { - item.put("recordStaffId", "97819551034630144"); - item.put("createUserId", "fb8bc1dcee4040b7b27feaf2789aeef1"); - item.put("updateUserid", "fb8bc1dcee4040b7b27feaf2789aeef1"); - } - } else { - item.put("recordStaffId", "97819551034630144"); - item.put("createUserId", "fb8bc1dcee4040b7b27feaf2789aeef1"); - item.put("updateUserid", "fb8bc1dcee4040b7b27feaf2789aeef1"); - } - if (StringUtils.isNotBlank(item.getString("attachmentUrl"))){ - Map map = new HashMap<>(); - map.put("name", "旧数据无名字"); - map.put("url", item.getString("attachmentUrl")); - List> maps = new ArrayList<>(); - maps.add(map); - item.set("attachmentUrl", JSONArray.toJSONString(maps)); - } - item.set("taskWorkOrderId",workOrderMap.get(item.getString("workId"))); - }); - SpringUtils.getBean(TaskWorkOrderRecordService.class).saveBatch(RowUtil.toEntityList(rowList,TaskWorkOrderRecord.class)); - } - - /** - * 导入插件数据 - * @author DB - * @since 2024/1/5 - */ - @Test - public void importPlugData(){ - List rowList; - try { - DataSourceKey.use("jambox"); - rowList = DbChain.table("t_application_info") - .select("application as name", "char_tag as plugTag", "pic as picUrl") - .select("top as orderNo", "tag as remark", "if(status = '即将上线',0,1) as status") - .from("t_application_info") - .where("deleted = 1") - .list(); - } finally { - DataSourceKey.clear(); - } - List entityList = RowUtil.toEntityList(rowList, Plug.class); - SpringUtils.getBean(PlugService.class).saveBatch(entityList); - } - - @Test - public void batchUpdateStaffPassword(){ - List cpSysUser = DbChain.table("cp_USER") - .select("id","phone_number") - .where("user_type = 'OAM_USER'") - .and("is_delete = 0") - .list(); - List entityList = RowUtil.toEntityList(cpSysUser, User.class); - //加密 - RsaUtils rsaUtils = SpringUtils.getBean(RsaUtils.class); - entityList.forEach(item -> { - if (!StringUtils.equals("1", item.getId())) { - String lastFourChars = "jambox" + item.getPhoneNumber().substring(item.getPhoneNumber().length() - 4); - item.setRsaPassword(rsaUtils.encrypt(lastFourChars)); - } - }); - Db.executeBatch(entityList, UserMapper.class, UserMapper::update); - } - - /** - * 同步品牌与校区数据 - * @author DB - * @since 2024/1/8 - */ - @Test - public void syncBrandAndStoreData() { - BrandService brandService = SpringUtils.getBean(BrandService.class); - for (int i = 2207; i < 2317; i++) { - brandService.importJamboxBrand(String.valueOf(i)); - //导入营业执照相关信息 - } - } - - /** - * 更新报销上传文件 - * @author DB - * @since 2024/1/8 - */ - @Test - public void updateReimburseUploadFileData() { - FinanceReimburseService financeReimburseService = SpringUtils.getBean(FinanceReimburseService.class); - List list = financeReimburseService.list(); - List updateEnetyList = new ArrayList<>(); - list.forEach(item -> { - if (StringUtils.isNotBlank(item.getAttachmentUrl())){ - JSONArray jsonArray = JSONArray.parseArray(item.getAttachmentUrl()); - JSONObject jsonObject = JSONObject.parseObject(jsonArray.get(0).toString()); - String[] split = jsonObject.getString("url").split(","); - if (split.length > 1) { - List> urls = new ArrayList<>(); - for (int i = 0; i < split.length; i++) { - Map map = new HashMap<>(); - map.put("name", "旧数据无名字"); - map.put("url", split[i]); - urls.add(map); - } - item.setAttachmentUrl(JSONArray.toJSONString(urls)); - updateEnetyList.add(item); - } - } - }); - financeReimburseService.updateBatch(updateEnetyList); - } - -} diff --git a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopOldDataSyncTests.java b/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopOldDataSyncTests.java index 68ee6f4..581fe78 100644 --- a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopOldDataSyncTests.java +++ b/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopOldDataSyncTests.java @@ -1,48 +1,11 @@ package com.cpop.oam.web; -import com.alibaba.fastjson.JSONObject; -import com.cpop.common.utils.StringUtils; -import com.cpop.system.framework.enums.OrderSource; -import com.cpop.core.utils.SpringUtils; -import com.cpop.jambox.business.entity.*; -import com.cpop.jambox.business.service.*; import com.cpop.pay.framewok.handler.wxPay.WxPayHandler; -import com.cpop.system.business.entity.Store; -import com.cpop.system.business.service.StoreService; -import com.github.binarywang.wxpay.bean.payscore.PartnerUserSignPlanEntity; -import com.github.binarywang.wxpay.bean.payscore.PayScorePlanDetailResult; -import com.github.binarywang.wxpay.bean.payscore.WxPartnerPayScoreSignPlanResult; -import com.github.binarywang.wxpay.bean.profitsharing.result.ProfitSharingV3Result; -import com.github.binarywang.wxpay.bean.request.WxPayPartnerOrderQueryV3Request; -import com.github.binarywang.wxpay.bean.result.WxPayOrderQueryResult; -import com.github.binarywang.wxpay.bean.result.WxPayPartnerOrderQueryV3Result; -import com.github.binarywang.wxpay.exception.WxPayException; -import com.github.binarywang.wxpay.service.WxPayService; -import com.mybatisflex.annotation.KeyType; -import com.mybatisflex.core.datasource.DataSourceKey; -import com.mybatisflex.core.query.QueryWrapper; -import com.mybatisflex.core.row.*; import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import static com.cpop.jambox.business.entity.table.EasyLearnOrderExtendTableDef.EASY_LEARN_ORDER_EXTEND; -import static com.cpop.jambox.business.entity.table.EasyLearnOrderTableDef.EASY_LEARN_ORDER; -import static com.cpop.jambox.business.entity.table.StoreExtendTableDef.STORE_EXTEND; -import static com.cpop.system.business.entity.table.StoreTableDef.STORE; -import static com.cpop.system.business.entity.table.WxPayScoreTableDef.WX_PAY_SCORE; - /** * 旧数据同步 * @author DB @@ -52,16 +15,17 @@ import static com.cpop.system.business.entity.table.WxPayScoreTableDef.WX_PAY_SC @Slf4j @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @ActiveProfiles(profiles = {"prod","core","pay"}) +@Deprecated public class CpopOldDataSyncTests { @Autowired private WxPayHandler wxPayHandler; - /** +/* *//** * 同步旧校区数据 * @author DB * @since 2024/1/11 - */ + *//* @Test public void syncOldStoreData(){ List rowList = null; @@ -90,11 +54,11 @@ public class CpopOldDataSyncTests { SpringUtils.getBean(StoreService.class).updateBatch(RowUtil.toEntityList(filterList, Store.class)); } - /** + *//** * 同步旧数据一次一次支付 * @author DB * @since 2024/1/12 - */ + *//* @Test public void syncOldEasyLearnPayScorePlanData() { List rowList = null; @@ -300,11 +264,11 @@ public class CpopOldDataSyncTests { } } - /** + *//** * 导入到旧库,已核销的数据 * @author DB * @since 2024/1/12 - */ + *//* @Test public void importEasyLearnDataToOldDataBase(){ List brandList = null; @@ -438,6 +402,6 @@ public class CpopOldDataSyncTests { } catch (WxPayException e) { throw new RuntimeException(e); } - } + }*/ } diff --git a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopWxCpTests.java b/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopWxCpTests.java deleted file mode 100644 index 19dc1b6..0000000 --- a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopWxCpTests.java +++ /dev/null @@ -1,498 +0,0 @@ -package com.cpop.oam.web; - -import cn.hutool.poi.excel.ExcelDateUtil; -import cn.hutool.poi.excel.ExcelUtil; -import com.alibaba.excel.EasyExcel; -import com.alibaba.excel.annotation.ExcelProperty; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; -import com.cpop.common.utils.StringUtils; -import com.cpop.common.utils.bean.BeanUtils; -import com.cpop.core.base.enums.UserType; -import com.cpop.core.base.exception.ServiceException; -import com.cpop.core.base.table.SysUser; -import com.cpop.core.utils.SpringUtils; -import com.cpop.core.utils.uuid.IdUtils; -import com.cpop.oam.business.entity.Dept; -import com.cpop.oam.business.entity.Staff; -import com.cpop.oam.business.entity.StaffMidDept; -import com.cpop.oam.business.service.DeptService; -import com.cpop.oam.business.service.StaffMidDeptService; -import com.cpop.oam.business.service.StaffService; -import com.cpop.oam.framework.config.wxCp.WxCpConfiguration; -import com.mybatisflex.core.row.Db; -import lombok.Data; -import lombok.extern.slf4j.Slf4j; -import me.chanjar.weixin.common.error.WxErrorException; -import me.chanjar.weixin.cp.api.WxCpExternalContactService; -import me.chanjar.weixin.cp.api.WxCpService; -import me.chanjar.weixin.cp.bean.WxCpDepart; -import me.chanjar.weixin.cp.bean.WxCpUser; -import me.chanjar.weixin.cp.bean.export.WxCpExportRequest; -import me.chanjar.weixin.cp.bean.export.WxCpExportResult; -import me.chanjar.weixin.cp.bean.external.WxCpUserExternalGroupChatInfo; -import me.chanjar.weixin.cp.bean.external.WxCpUserExternalGroupChatList; -import me.chanjar.weixin.cp.bean.external.contact.WxCpExternalContactBatchInfo; -import me.chanjar.weixin.cp.bean.user.WxCpDeptUserResult; -import org.apache.commons.codec.binary.Base64; -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.http.ResponseEntity; -import org.springframework.web.client.RestTemplate; - -import javax.crypto.Cipher; -import javax.crypto.spec.IvParameterSpec; -import javax.crypto.spec.SecretKeySpec; -import java.io.File; -import java.util.*; -import java.util.concurrent.atomic.AtomicReference; -import java.util.stream.Collectors; - -/** - * @author DB - * @createTime 2023/10/12 15:19 - * @description 企业微信Api测试 - */ -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) -@Slf4j -public class CpopWxCpTests { - - /** - * @descriptions 获取成员ID列表 - * @author DB - * @date 2023/10/12 15:33 - * @return: void - */ - @Test - public void userListId() { - try { - WxCpDeptUserResult userListId = WxCpConfiguration.getCpService(1000024).getUserService().getUserListId("", 100); - System.out.println(userListId); - } catch (WxErrorException e) { - throw new ServiceException(e.getMessage()); - } - } - - /** - * 根据手机号获取用户id - */ - @Test - public void getUserId() { - try { - String userId = WxCpConfiguration.getCpService(1000024).getUserService().getUserId("17728500831"); - System.out.println(userId); - } catch (WxErrorException e) { - throw new RuntimeException(e); - } - } - - /** - * 根据用户id获取用户 - */ - @Test - public void getUser() { - try { - WxCpUser user = WxCpConfiguration.getCpService(1000024).getUserService().getById("XiaoKanTianSeMuKanYun"); - System.out.println(user); - } catch (WxErrorException e) { - throw new RuntimeException(e); - } - } - - /** - * 获取部门列表 - */ - @Test - public void getDepartmentList() { - try { - List wxCpDeparts = WxCpConfiguration.getCpService(1000000).getDepartmentService().simpleList(1L); - System.out.println(wxCpDeparts); - } catch (WxErrorException e) { - throw new RuntimeException(e); - } - } - - @Test - public void getDeptById() { - try { - WxCpDepart wxCpDepart = WxCpConfiguration.getCpService(1000024).getDepartmentService().get(1L); - System.out.println(wxCpDepart); - } catch (WxErrorException e) { - throw new RuntimeException(e); - } - } - - /** - * 导出部门 - */ - @Test - public void exportDept() { - try { - WxCpExportRequest request = new WxCpExportRequest(); - request.setEncodingAesKey("DLSzfHVUZN3O9WhtL07RBXUoooqC2bjEJYwep8k8ojt"); - String jabId = WxCpConfiguration.getCpService(1000024).getExportService().department(request); - System.out.println(jabId); - } catch (WxErrorException e) { - throw new RuntimeException(e); - } - } - - /** - * @descriptions 获取导出结果 - * @author DB - * @date 2023/10/13 16:18 - * @return: void - */ - @Test - public void getExportResult() throws WxErrorException { - //jobid_dFssU8d6nirNJjOHwoxoPV23OzWH6edwrb__ilftwyA - WxCpExportResult result = WxCpConfiguration.getCpService(1000024).getExportService().getResult("jobid__qH9HAsRGgeErUVEaJA1UnOFpjuL7CQddh11dYtDE6s"); - System.out.println(result); - } - - /** - * @descriptions 解密导出数据 - * @author DB - * @date 2023/10/13 16:49 - * @return: void - */ - @Test - public void decryptExportData(){ - String result = getDecryptExportData("DLSzfHVUZN3O9WhtL07RBXUoooqC2bjEJYwep8k8ojt", "https://szfront.wxwork.qq.com:443/downloadobject?fileid=080112043133303122093131343535363239362a0131322463396566396533662d626332392d346666622d623033652d623034626633343633656539388004421453e8114eb1942bcda5dfca7c8457534c237ab95448015802600768b8177207333030303030308a010b6170706c69636174696f6e90018ffba3a9069a0100a001d5b703&weixinnum=2519320458&authkey=7008001005186022606b8b2cec47b7d5c6a502d671c77f8b35bfb4908f7cc912258e5c54554a0485f9b61c484bb3f5c56fc823c2b3aefed8b319fd113a0220b6297a7879c4a3d50313c6bc91b004c50efd6d2849165eb511f52b8027d3f34de5e970d95291af935be7&filename=data_0.json"); - if (result != null) { - System.out.println(result.substring(0, result.lastIndexOf("}") + 1)); - } - } - - public final String getDecryptExportData(String aesKey, String url) { - RestTemplate restTemplate = new RestTemplate(); - ResponseEntity responseEntity = restTemplate.getForEntity(url, byte[].class); - if (responseEntity.getBody() == null) { - return null; - } - byte[] key = Base64.decodeBase64(aesKey + "="); - byte[] original = null; - try { - // 设置解密模式为AES的CBC模式 - Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding"); - SecretKeySpec keySpec = new SecretKeySpec(key, "AES"); - IvParameterSpec iv = new IvParameterSpec(Arrays.copyOfRange(key, 0, 16)); - cipher.init(Cipher.DECRYPT_MODE, keySpec, iv); - original = cipher.doFinal(responseEntity.getBody()); - } catch (Exception e) { - log.error("", e); - } - assert original != null; - return new String(original); - } - - /** - * @descriptions 导入部门 - * @author DB - * @date 2023/10/13 16:54 - * @return: void - */ - @Test - public void importDept() { - //将导出数据转换 - String result = getDecryptExportData("DLSzfHVUZN3O9WhtL07RBXUoooqC2bjEJYwep8k8ojt", "https://szfront.wxwork.qq.com:443/downloadobject?fileid=080112043133303122093131343535363239362a0131322463396566396533662d626332392d346666622d623033652d623034626633343633656539388004421453e8114eb1942bcda5dfca7c8457534c237ab95448015802600768b8177207333030303030308a010b6170706c69636174696f6e90018ffba3a9069a0100a001d5b703&weixinnum=2519320458&authkey=7008001005186022606b8b2cec47b7d5c6a502d671c77f8b35bfb4908f7cc912258e5c54554a0485f9b61c484bb3f5c56fc823c2b3aefed8b319fd113a0220b6297a7879c4a3d50313c6bc91b004c50efd6d2849165eb511f52b8027d3f34de5e970d95291af935be7&filename=data_0.json"); - //导出集合 - List exportDeptList = JSONObject.parseObject(result).getJSONArray("department").toJavaList(ExportDept.class); - //转换部门 - List list = new ArrayList<>(); - exportDeptList.forEach(item -> { - Dept dept = new Dept(); - dept.setWxCpId(item.getId()) - .setWxCpParentId(item.getParentId()) - .setOrderNo(item.getOrder()) - .setName(item.getName()); - list.add(dept); - }); - //批量导入数据 - DeptService deptService = SpringUtils.getBean(DeptService.class); - deptService.saveBatch(list); - //同步父id - Map deptMap = list.stream().collect(Collectors.toMap(Dept::getWxCpId, item -> item)); - list.forEach(item->{ - if (null != deptMap.get(item.getWxCpParentId())){ - item.setParentId(deptMap.get(item.getWxCpParentId()).getId()); - } - }); - //批量更新 - deptService.updateBatch(list); - } - - /** - * 导出部门数据 - */ - @Data - public class ExportDept { - - /** - * 部门id - */ - private Long id; - - /** - * 部门名 - */ - private String name; - - /** - * 父部门id - */ - @JSONField(name = "parentid") - private Long parentId; - - /** - * 排序 - */ - private Integer order; - } - - @Test - public void getUserList() throws WxErrorException { - WxCpExportRequest request = new WxCpExportRequest(); - request.setEncodingAesKey("DLSzfHVUZN3O9WhtL07RBXUoooqC2bjEJYwep8k8ojt"); - String jobId = WxCpConfiguration.getCpService(1000024).getExportService().user(request); - System.out.println(jobId); - } - - /** - * @descriptions 导出员工 - * @author DB - * @date 2023/10/16 9:20 - * @return: void - */ - @Test - public void importStaffList() throws WxErrorException { - //https://szfront.wxwork.qq.com:443/downloadobject?fileid=080112043133303122093131343535363239362a0131322464333430383931612d386139312d346262652d616231302d62353464653065383035316138a03b42149c55bf3c6169f900ae391370dd348245dd7308a548015802600768b8177207333030303030308a010b6170706c69636174696f6e900197a4b2a9069a0100a0019cdf03&weixinnum=2909765272&authkey=700800100918602260b996bf284cb359495885b1480d4065832650ca9911785379ca2fe340691640e9e97f18aa5e0df436f97b866f7364f9ea4b81497eca584fedd26dca5fb1afdbcf42508abe97ef4529ec213ade2dac789a350500807294c0c941157438264a30c7&filename=data_0.json - String result = getDecryptExportData("DLSzfHVUZN3O9WhtL07RBXUoooqC2bjEJYwep8k8ojt", "https://szfront.wxwork.qq.com:443/downloadobject?fileid=080112043133303122093131343535363239362a0131322464333430383931612d386139312d346262652d616231302d62353464653065383035316138a03b42149c55bf3c6169f900ae391370dd348245dd7308a548015802600768b8177207333030303030308a010b6170706c69636174696f6e900197a4b2a9069a0100a0019cdf03&weixinnum=2909765272&authkey=700800100918602260b996bf284cb359495885b1480d4065832650ca9911785379ca2fe340691640e9e97f18aa5e0df436f97b866f7364f9ea4b81497eca584fedd26dca5fb1afdbcf42508abe97ef4529ec213ade2dac789a350500807294c0c941157438264a30c7&filename=data_0.json"); - JSONArray department = JSONObject.parseObject(result).getJSONArray("userlist"); - //转换员工,用户 - List staffList = new ArrayList<>(); - List sysUserList = new ArrayList<>(); - List exportUsers = department.toJavaList(ExportUser.class); - //获取当前创建人员信息 - LoginUser loginUser = SecurityUtils.getInstance().getLoginUser(); - Map userMapStaff = new HashMap<>(); - AtomicReference flag = new AtomicReference<>(0); - exportUsers.forEach(item -> { - //创建用户 - SysUser sysUser = new SysUser(); - sysUser.setId(IdUtils.fastSimpleUUID()); - sysUser.setPassword("$2a$10$6CA0M3iyO8u8zSVtmufYGO3KfLvjaE5fxdHCqTQ2NpxYH/Dxi/fBu") - .setNickName(item.getAlias()) - .setStatus(item.getStatus()) - .setUserType(UserType.OAM_USER.toString()); - sysUser.setCreateUserId(loginUser == null ? "1" : loginUser.getUserId()); - sysUser.setUpdateUserId(loginUser == null ? "1" : loginUser.getUserId()); - sysUserList.add(sysUser); - //转换员工 - Staff staff = BeanUtils.mapToClass(item, Staff.class); - staff.setName(item.getName()) - //默认售后人员,由管理人员修改 - .setStaffType(1) - //设置角色信息 - //.setRoleId() - .setWxCpUserId(item.getWxCpUserId()); - //放入一个map集合中 - userMapStaff.put(flag.get(), staff); - flag.getAndSet(flag.get() + 1); - }); - Db.executeBatch(sysUserList, CoreMapper.class, CoreMapper::insertSysUser); - for (int i = 0; i < sysUserList.size(); i++) { - SysUser sysUser = sysUserList.get(i); - Staff staff = userMapStaff.get(i); - staff.setUserId(sysUser.getId()); - staffList.add(staff); - } - SpringUtils.getBean(StaffService.class).saveBatch(staffList); - //导入用户信息分组 - Map exportUserMap = exportUsers.stream().collect(Collectors.toMap(ExportUser::getWxCpUserId, item -> item)); - //获取所有部门信息 - Map deptMap = SpringUtils.getBean(DeptService.class).list().stream().collect(Collectors.toMap(Dept::getWxCpId, item -> item)); - List staffMidDeptList = new ArrayList<>(); - //设置中间部门表信息 - staffList.forEach(item->{ - ExportUser exportUser = exportUserMap.get(item.getWxCpUserId()); - exportUser.getDepartment().forEach(innerItem->{ - StaffMidDept staffMidDept = new StaffMidDept(); - staffMidDept.setDeptId(deptMap.get(innerItem).getId()); - staffMidDept.setStaffId(item.getId()); - staffMidDeptList.add(staffMidDept); - }); - }); - SpringUtils.getBean(StaffMidDeptService.class).getMapper().insertBatch(staffMidDeptList); - } - - /** - * 导入用户 - */ - @Data - public class ExportUser { - - /** - * 成员名称 - */ - private String name; - - /** - * 别名 - */ - private String alias; - - /** - * 座机 - */ - private String telephone; - - /** - * 职位名称 - */ - private String position; - - /** - * 成员所属部门id列表 - */ - private List department; - - /** - * 表示在所在的部门内是否为部门负责人 - */ - @JSONField(name = "is_leader_in_dept") - private List isLeaderInDept; - - /** - * 企业微信用户id - */ - @JSONField(name = "userid") - private String wxCpUserId; - - /** - * 是否启用 - */ - private Boolean status; - - /** - * 部门排序 - */ - private List order; - } - - /** - * 获取线索 - * @author DB - * @since 2024/2/18 - */ - @Test - public void getClueList() throws WxErrorException { - WxCpService cpService = WxCpConfiguration.getCpService(1000024); - WxCpExternalContactService externalContactService = cpService.getExternalContactService(); - String[] userIds = {"YiHaiNan","ChenShuJie","ChenWei","GuTingTing","9106a48341c538f2f634343241c7e37a","LanShengYao","LiMei","LiuYe","MaYaLan","NiXuMei","PanYanXia","YangTingHong","ZhangCongTang","ZhaoSuMin"}; - List externalData = getExternalData(null,externalContactService, null, userIds); - List exportClueDataList = new ArrayList<>(); - externalData.forEach(item->{ - ExportClueData exportClueData = new ExportClueData(); - exportClueData.setType(item.getExternalContact().getType() == 1 ? "微信用户" : "企业微信用户"); - exportClueData.setUserid(item.getFollowInfo().getUserId()); - exportClueData.setName(item.getExternalContact().getName()); - exportClueData.setExternalUserid(item.getExternalContact().getExternalUserId()); - exportClueDataList.add(exportClueData); - }); - List filterExportClueDataList = new ArrayList<>(); - exportClueDataList.stream().collect(Collectors.groupingBy(ExportClueData::getExternalUserid)) - .forEach((key, value) ->{ - if(value.size() > 1){ - filterExportClueDataList.add(value.get(0)); - } - }); - Map externalUserMap = filterExportClueDataList.stream().collect(Collectors.toMap(ExportClueData::getExternalUserid, item -> item)); - WxCpUserExternalGroupChatList wxCpUserExternalGroupChatList = externalContactService.listGroupChat(1000, null, 0, userIds); - wxCpUserExternalGroupChatList.getGroupChatList().forEach(item->{ - try { - WxCpUserExternalGroupChatInfo groupChatInfo = externalContactService.getGroupChat(item.getChatId(), 1); - WxCpUserExternalGroupChatInfo.GroupChat groupChat = groupChatInfo.getGroupChat(); - List collect = groupChat.getMemberList().stream().map(WxCpUserExternalGroupChatInfo.GroupMember::getUserId).collect(Collectors.toList()); - collect.forEach(inner->{ - ExportClueData exportClueData = externalUserMap.get(inner); - if (exportClueData != null){ - exportClueData.setGroupName(groupChatInfo.getGroupChat().getName()); - } - }); - } catch (WxErrorException e) { - throw new RuntimeException(e); - } - }); - File file = new File("D:\\Lost\\桌面\\线索池数据.xlsx"); - EasyExcel.write(file, ExportClueData.class) - .sheet("已知线索池") - .doWrite(() -> { - // 分页查询数据 - return filterExportClueDataList; - }); - } - - private List getExternalData(List allExternalContactList, WxCpExternalContactService externalContactService, String nextCursor, String[] userIds) throws WxErrorException { - WxCpExternalContactBatchInfo contactDetailBatch = externalContactService.getContactDetailBatch(userIds, nextCursor, null); - List externalContactList = contactDetailBatch.getExternalContactList(); - if (allExternalContactList != null){ - allExternalContactList.addAll(externalContactList); - } else { - allExternalContactList = externalContactList; - } - if (StringUtils.isNotBlank(contactDetailBatch.getNextCursor())) { - return getExternalData(allExternalContactList, externalContactService, contactDetailBatch.getNextCursor(), userIds); - } else { - return allExternalContactList; - } - } - - @Data - public class ExportClueData{ - - /** - * 联系人名称 - */ - @ExcelProperty(value = "联系人名称") - private String name; - - /** - * 客户群名 - */ - @ExcelProperty(value = "客户群名") - private String groupName; - - /** - * 联系人类型 - */ - @ExcelProperty(value = "联系人类型") - private String type; - - /** - * 联系人userid - */ - @ExcelProperty(value = "联系人userid") - @JSONField(name = "external_userid") - private String externalUserid; - - /** - * 系统微信用户id - */ - @ExcelProperty(value = "系统微信用户id") - private String userid; - - /** - * 校区名 - */ - @ExcelProperty(value = "校区名") - private String storeName; - - /** - * 校区id - */ - @ExcelProperty(value = "校区id") - private String storeId; - } -} diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/AgreeOrRejectEnforceFinishBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/AgreeOrRejectEnforceFinishBo.java index 072a4db..0305576 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/AgreeOrRejectEnforceFinishBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/AgreeOrRejectEnforceFinishBo.java @@ -1,7 +1,6 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; @@ -12,18 +11,18 @@ import lombok.experimental.Accessors; */ @Data @Accessors(chain = true) -@ApiModel(value = "AgreeOrRejectEnforceFinishBo对象") +@Schema(description = "AgreeOrRejectEnforceFinishBo对象") public class AgreeOrRejectEnforceFinishBo { /** * 工单id */ - @ApiModelProperty(value = "工单id") + @Schema(description = "工单id") private String id; /** * 同意或拒绝 */ - @ApiModelProperty(value = "同意或拒绝") + @Schema(description = "同意或拒绝") private Boolean agreeOrReject; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ClueFollowUpBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ClueFollowUpBo.java index 34619aa..de32fae 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ClueFollowUpBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ClueFollowUpBo.java @@ -1,13 +1,11 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; import lombok.Data; import lombok.experimental.Accessors; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; - /** * @author DB * @version 1.0.0 @@ -15,33 +13,33 @@ import javax.validation.constraints.NotNull; */ @Data @Accessors(chain = true) -@ApiModel(value = "线索跟进请求对象") +@Schema(description = "线索跟进请求对象") public class ClueFollowUpBo { /** * 线索id */ @NotBlank(message = "线索id不能为空") - @ApiModelProperty(value = "线索id",required = true) + @Schema(description = "线索id",required = true) private String clueId; /** * 记录内容 */ @NotBlank(message = "记录内容不能为空") - @ApiModelProperty(value = "记录内容",required = true) + @Schema(description = "记录内容",required = true) private String recordContent; /** * 记录文件地址 */ - @ApiModelProperty(value = "记录文件地址") + @Schema(description = "记录文件地址") private String recordFileUrl; /** * 更进状态(0:待跟进、1:已歇业、2:无法联系、3:无意向、4:已拜访、5:跟进中、6:已成交 */ @NotNull(message = "跟进状态不能为空") - @ApiModelProperty(value = "更进状态(0:待跟进、1:已歇业、2:无法联系、3:无意向、4:已拜访、5:跟进中、6:已成交",required = true) + @Schema(description = "更进状态(0:待跟进、1:已歇业、2:无法联系、3:无意向、4:已拜访、5:跟进中、6:已成交",required = true) private Integer followStatus; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/CluePutOffBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/CluePutOffBo.java index eb0abfe..3766721 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/CluePutOffBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/CluePutOffBo.java @@ -1,13 +1,11 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; import lombok.Data; import lombok.experimental.Accessors; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.sql.Date; import java.time.LocalDate; /** @@ -17,35 +15,35 @@ import java.time.LocalDate; */ @Data @Accessors(chain = true) -@ApiModel(value = "校区延期请求对象") +@Schema(description = "校区延期请求对象") public class CluePutOffBo { /** * 线索id */ @NotBlank(message = "线索id不能为空") - @ApiModelProperty(value = "线索id",required = true) + @Schema(description = "线索id",requiredMode = Schema.RequiredMode.REQUIRED) private String clueId; /** * 延期原因 */ @NotBlank(message = "延期原因不能为空") - @ApiModelProperty(value = "延期原因",required = true) + @Schema(description = "延期原因",requiredMode = Schema.RequiredMode.REQUIRED) private String putOffReason; /** * 延期文件路径 */ @NotBlank(message = "延期文件路径不能为空") - @ApiModelProperty(value = "延期文件路径",required = true) + @Schema(description = "延期文件路径",requiredMode = Schema.RequiredMode.REQUIRED) private String putOffFileUrl; /** * 延期到期日期 */ @NotNull(message = "不能为空") - @ApiModelProperty(value = "延期到期日期",required = true) + @Schema(description = "延期到期日期",requiredMode = Schema.RequiredMode.REQUIRED) private LocalDate putOffDate; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ClueUpdateBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ClueUpdateBo.java index 8dcd9b8..032ac26 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ClueUpdateBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ClueUpdateBo.java @@ -1,11 +1,10 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; import lombok.Data; import lombok.experimental.Accessors; -import javax.validation.constraints.NotBlank; /** * @author DB @@ -14,35 +13,35 @@ import javax.validation.constraints.NotBlank; */ @Data @Accessors(chain = true) -@ApiModel(value = "线索更新请求对象") +@Schema(description = "线索更新请求对象") public class ClueUpdateBo { /** * 线索id */ @NotBlank(message = "线索id不能为空") - @ApiModelProperty(value = "线索id",required = true) + @Schema(description = "线索id",requiredMode = Schema.RequiredMode.REQUIRED) private String clueId; /** * 新校区名 */ @NotBlank(message = "校区名不能为空") - @ApiModelProperty(value = "校区名",required = true) + @Schema(description = "校区名",requiredMode = Schema.RequiredMode.REQUIRED) private String newStoreName; /** * 新负责人 */ @NotBlank(message = "负责人不能为空") - @ApiModelProperty(value = "负责人",required = true) + @Schema(description = "负责人",requiredMode = Schema.RequiredMode.REQUIRED) private String newPersonCharge; /** * 新手机号 */ @NotBlank(message = "手机号不能为空") - @ApiModelProperty(value = "手机号",required = true) + @Schema(description = "手机号",requiredMode = Schema.RequiredMode.REQUIRED) private String newPhone; @@ -50,7 +49,7 @@ public class ClueUpdateBo { * 新校区地址 */ @NotBlank(message = "校区地址不能为空") - @ApiModelProperty(value = "校区地址",required = true) + @Schema(description = "校区地址",requiredMode = Schema.RequiredMode.REQUIRED) private String newStoreAddr; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/DeptBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/DeptBo.java index ca05a97..ea4cd7d 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/DeptBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/DeptBo.java @@ -1,11 +1,9 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; -import java.io.Serializable; /** * 部门表Bo @@ -15,63 +13,61 @@ import java.io.Serializable; */ @Data @Accessors(chain = true) -@ApiModel(value = "SysDept对象", description = "部门表") -public class DeptBo implements Serializable { - - private static final long serialVersionUID = 1L; +@Schema(description = "部门表") +public class DeptBo { /** * 部门id */ - @ApiModelProperty("部门id") + @Schema(description ="部门id") private String id; /** * 父部门id */ - @ApiModelProperty("父部门id") + @Schema(description ="父部门id") private String parentId; /** * 部门名称 */ - @ApiModelProperty(value = "部门名称",required = true) + @Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED) private String name; /** * 排序 */ - @ApiModelProperty(value = "排序",required = true) + @Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED) private Integer orderNo; /** * 负责人 */ - @ApiModelProperty("负责人") + @Schema(description ="负责人") private String leader; /** * 电话 */ - @ApiModelProperty("电话") + @Schema(description ="电话") private String phone; /** * 邮箱 */ - @ApiModelProperty("邮箱") + @Schema(description ="邮箱") private String email; /** * 部门状态:1正常,0停用 */ - @ApiModelProperty(value = "部门状态:1正常,0停用",required = true) + @Schema(description = "部门状态:1正常,0停用", requiredMode = Schema.RequiredMode.REQUIRED) private Boolean status; /** * 备注 */ - @ApiModelProperty("备注") + @Schema(description ="备注") private String remark; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/DeptListBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/DeptListBo.java index e95615f..0484d89 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/DeptListBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/DeptListBo.java @@ -1,33 +1,27 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; -import java.io.Serializable; - /** * @author DB - * @Description: - * @create 2023-05-09 20:51 + * @since 2023-05-09 20:51 */ @Data @Accessors(chain = true) -@ApiModel(value = "SysDeptListBo对象", description = "部门树查询参数对象") -public class DeptListBo implements Serializable { - - private static final long serialVersionUID = 1L; +@Schema(description = "部门树查询参数对象") +public class DeptListBo { /** * 部门名称 */ - @ApiModelProperty("部门名称") + @Schema(description ="部门名称") private String name; /** * 部门状态:0正常,1停用 */ - @ApiModelProperty("部门状态:0正常,1停用") + @Schema(description ="部门状态:0正常,1停用") private Boolean status; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/DutyBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/DutyBo.java index 411a470..6fec08a 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/DutyBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/DutyBo.java @@ -1,13 +1,11 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotEmpty; import lombok.Data; import lombok.experimental.Accessors; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotEmpty; -import java.io.Serializable; import java.util.List; /** @@ -18,42 +16,40 @@ import java.util.List; */ @Data @Accessors(chain = true) -@ApiModel(value = "Duty对象", description = "值班表") -public class DutyBo implements Serializable { - - private static final long serialVersionUID = 1L; +@Schema(description = "值班表") +public class DutyBo { /** * 主键 */ - @ApiModelProperty("主键") + @Schema(description ="主键") private String id; /** * 服务员工id */ @NotBlank(message = "服务员工id不能为空") - @ApiModelProperty(value = "服务员工id",required = true) + @Schema(description = "服务员工id", requiredMode = Schema.RequiredMode.REQUIRED) private String serviceStaffId; /** * 技术员工id */ @NotBlank(message = "技术员工id不能为空") - @ApiModelProperty(value = "技术员工id",required = true) + @Schema(description = "技术员工id", requiredMode = Schema.RequiredMode.REQUIRED) private String technologyStaffId; /** * 值班日期 */ @NotEmpty(message = "值班日期不能为空") - @ApiModelProperty(value = "值班日期",required = true) + @Schema(description = "值班日期", requiredMode = Schema.RequiredMode.REQUIRED) private List dutyDate; /** * 备注 */ - @ApiModelProperty("备注") + @Schema(description ="备注") private String remark; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/DutyListBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/DutyListBo.java index 0291518..b226ab4 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/DutyListBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/DutyListBo.java @@ -1,12 +1,9 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; -import java.io.Serializable; - /** * Description: * date: 2023/5/11 11:43 @@ -15,15 +12,13 @@ import java.io.Serializable; */ @Data @Accessors(chain = true) -@ApiModel(value = "Duty对象", description = "值班表") -public class DutyListBo implements Serializable { - - private static final long serialVersionUID = 1L; +@Schema(description = "值班表") +public class DutyListBo { /** * 值班月份 */ - @ApiModelProperty("值班月份") + @Schema(description = "值班月份") private String dutyMoth; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/EnforceFinishWorkOrderBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/EnforceFinishWorkOrderBo.java index 11cf358..c679bd3 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/EnforceFinishWorkOrderBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/EnforceFinishWorkOrderBo.java @@ -1,11 +1,10 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; import lombok.Data; import lombok.experimental.Accessors; -import javax.validation.constraints.NotBlank; /** * @author DB @@ -14,20 +13,20 @@ import javax.validation.constraints.NotBlank; */ @Data @Accessors(chain = true) -@ApiModel(value = "EnforceFinishWorkOrderBo对象", description = "强制办结工单") +@Schema(description = "强制办结工单") public class EnforceFinishWorkOrderBo { /** * 工单id */ @NotBlank(message = "工单id不能为空") - @ApiModelProperty(value = "工单id", required = true) + @Schema(description = "工单id", requiredMode = Schema.RequiredMode.REQUIRED) private String id; /** * 强制办结原因 */ @NotBlank(message = "强制办结原因不能为空") - @ApiModelProperty(value = "强制办结原因", required = true) + @Schema(description = "强制办结原因", requiredMode = Schema.RequiredMode.REQUIRED) private String enforceFinishReason; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/FinanceReimburseAuditPageBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/FinanceReimburseAuditPageBo.java index 81c12f3..747f6b0 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/FinanceReimburseAuditPageBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/FinanceReimburseAuditPageBo.java @@ -1,7 +1,6 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; @@ -14,24 +13,24 @@ import java.io.Serializable; */ @Data @Accessors(chain = true) -@ApiModel(value = "FinanceReimburseAuditPageBo对象", description = "财务报销审核请求参数") -public class FinanceReimburseAuditPageBo implements Serializable { +@Schema(description = "财务报销审核请求参数") +public class FinanceReimburseAuditPageBo { /** * 状态:0:审批中;1:下款中;2:已下发-1:驳回 */ - @ApiModelProperty(value = "状态:0:审批中;1:下款中;2:已下发-1:驳回") + @Schema(description = "状态:0:审批中;1:下款中;2:已下发-1:驳回") private Integer status; /** * 申请类型 */ - @ApiModelProperty(value = "申请类型") + @Schema(description = "申请类型") private String typeId; /** * 查询 */ - @ApiModelProperty(value = "查询") + @Schema(description = "查询") private String query; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/FinanceReimbursePageBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/FinanceReimbursePageBo.java index 72e146c..32e4b7c 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/FinanceReimbursePageBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/FinanceReimbursePageBo.java @@ -1,12 +1,9 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; -import java.io.Serializable; - /** * @author DB * @createTime 2023/09/20 16:43 @@ -14,19 +11,19 @@ import java.io.Serializable; */ @Data @Accessors(chain = true) -@ApiModel(value = "FinanceReimbursePageBo对象", description = "财务报销请求参数") -public class FinanceReimbursePageBo implements Serializable { +@Schema(description = "财务报销请求参数") +public class FinanceReimbursePageBo { /** * 状态:0:审批中;1:下款中;2:已下发-1:驳回 */ - @ApiModelProperty(value = "状态:0:审批中;1:下款中;2:已下发-1:驳回") + @Schema(description = "状态:0:审批中;1:下款中;2:已下发-1:驳回") private Integer status; /** * 申请类型 */ - @ApiModelProperty(value = "申请类型") + @Schema(description = "申请类型") private String typeId; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ModifyUserPasswordBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ModifyUserPasswordBo.java index 0946da1..f6c0b7a 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ModifyUserPasswordBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ModifyUserPasswordBo.java @@ -1,12 +1,10 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; import lombok.Data; import lombok.experimental.Accessors; -import javax.validation.constraints.NotBlank; -import java.io.Serializable; /** * Description: 修改用户密码bo @@ -16,29 +14,27 @@ import java.io.Serializable; */ @Data @Accessors(chain = true) -@ApiModel(value = "ModifyUserPasswordBo对象", description = "修改用户密码bo") -public class ModifyUserPasswordBo implements Serializable { - - private static final long serialVersionUID = 1L; +@Schema( description = "修改用户密码bo") +public class ModifyUserPasswordBo { /** * 用户id */ @NotBlank(message = "用户id不能为空") - @ApiModelProperty(value = "用户id",required = true) + @Schema(description = "用户id",requiredMode = Schema.RequiredMode.REQUIRED) private String userId; /** * 旧密码 */ @NotBlank(message = "旧密码不能为空") - @ApiModelProperty(value = "旧密码",required = true) + @Schema(description = "旧密码",requiredMode = Schema.RequiredMode.REQUIRED) private String oldPassword; /** * 新密码 */ @NotBlank(message = "新密码不能为空") - @ApiModelProperty(value = "新密码",required = true) + @Schema(description = "新密码",requiredMode = Schema.RequiredMode.REQUIRED) private String newPassword; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/OperationStatusBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/OperationStatusBo.java index 2941ad0..9d9cfc2 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/OperationStatusBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/OperationStatusBo.java @@ -1,12 +1,11 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; import lombok.Data; import lombok.experimental.Accessors; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; /** * @author DB @@ -15,20 +14,20 @@ import javax.validation.constraints.NotNull; */ @Data @Accessors(chain = true) -@ApiModel(value = "OperationStatusBo对象") +@Schema(description = "OperationStatusBo对象") public class OperationStatusBo { /** * 员工id */ @NotBlank(message = "员工id不能为空") - @ApiModelProperty(value = "员工id",required = true) + @Schema(description = "员工id",requiredMode = Schema.RequiredMode.REQUIRED) private String id; /** * 操作状态 */ @NotNull(message = "操作状态不能为空") - @ApiModelProperty(value = "操作状态",required = true) + @Schema(description = "操作状态",requiredMode = Schema.RequiredMode.REQUIRED) private Boolean isOperation; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/PutOffAuditBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/PutOffAuditBo.java index 96ae791..528a58b 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/PutOffAuditBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/PutOffAuditBo.java @@ -1,12 +1,11 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; import lombok.Data; import lombok.experimental.Accessors; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; /** * @author DB @@ -15,20 +14,20 @@ import javax.validation.constraints.NotNull; */ @Data @Accessors(chain = true) -@ApiModel(value = "延期审核请求对象") +@Schema(description = "延期审核请求对象") public class PutOffAuditBo { /** * 主键 */ @NotBlank(message = "主键不能为空") - @ApiModelProperty(value = "主键",required = true) + @Schema(description = "主键",requiredMode = Schema.RequiredMode.REQUIRED) private String id; /** * 审核结果 */ @NotNull(message = "审核结果不能为空") - @ApiModelProperty(value = "审核结果",required = true) + @Schema(description = "审核结果",requiredMode = Schema.RequiredMode.REQUIRED) private Boolean auditResult; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ReimburseApplicationBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ReimburseApplicationBo.java index c26a145..eed1122 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ReimburseApplicationBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ReimburseApplicationBo.java @@ -1,14 +1,12 @@ package com.cpop.oam.business.bo; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; import lombok.Data; import lombok.experimental.Accessors; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.io.Serializable; import java.math.BigDecimal; import java.sql.Date; @@ -19,21 +17,21 @@ import java.sql.Date; */ @Data @Accessors(chain = true) -@ApiModel(value = "ReimburseStatusBo", description = "报销申请请求参数") -public class ReimburseApplicationBo implements Serializable { +@Schema(description = "报销申请请求参数") +public class ReimburseApplicationBo { /** * 申请类型 */ @NotBlank(message = "申请类型不能为空") - @ApiModelProperty(value = "申请类型",required = true) + @Schema(description = "申请类型",requiredMode = Schema.RequiredMode.REQUIRED) private String typeId; /** * 报销日期 */ @NotNull(message = "报销日期不能为空") - @ApiModelProperty(value = "报销日期",required = true) + @Schema(description = "报销日期",requiredMode = Schema.RequiredMode.REQUIRED) @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date reportDate; @@ -41,26 +39,26 @@ public class ReimburseApplicationBo implements Serializable { * 申请说明 */ @NotBlank(message = "申请说明不能为空") - @ApiModelProperty(value = "申请说明",required = true) + @Schema(description = "申请说明",requiredMode = Schema.RequiredMode.REQUIRED) private String remarks; /** * 申请金额 */ @NotNull(message = "申请金额不能为空") - @ApiModelProperty(value = "申请金额",required = true) + @Schema(description = "申请金额",requiredMode = Schema.RequiredMode.REQUIRED) private BigDecimal price; /** * 附件 */ - @ApiModelProperty(value = "附件") + @Schema(description = "附件") private String attachmentUrl; /** * 报销申请id */ - @ApiModelProperty(value = "报销申请id") + @Schema(description = "报销申请id") private String id; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ReimbursePayBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ReimbursePayBo.java index 12f2ea9..cb08828 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ReimbursePayBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ReimbursePayBo.java @@ -1,13 +1,11 @@ package com.cpop.oam.business.bo; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; import lombok.Data; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.io.Serializable; import java.math.BigDecimal; import java.time.LocalDateTime; @@ -17,28 +15,28 @@ import java.time.LocalDateTime; * @description */ @Data -@ApiModel(value = "报销下款") -public class ReimbursePayBo implements Serializable { +@Schema(description = "报销下款") +public class ReimbursePayBo { /** * 主键 */ @NotBlank(message = "主键不能为空") - @ApiModelProperty(value = "主键",required = true) + @Schema(description = "主键",requiredMode = Schema.RequiredMode.REQUIRED) private String id; /** * 下发金额 */ @NotNull(message = "下发金额不能为空") - @ApiModelProperty(value = "下发金额",required = true) + @Schema(description = "下发金额",requiredMode = Schema.RequiredMode.REQUIRED) private BigDecimal stageAmount; /** * 下款时间 */ @NotNull(message = "下款时间不能为空") - @ApiModelProperty(value = "下款时间",required = true) + @Schema(description = "下款时间",requiredMode = Schema.RequiredMode.REQUIRED) @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") private LocalDateTime paymentTime; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ReimburseRejectBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ReimburseRejectBo.java index a76ea7b..2592575 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ReimburseRejectBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ReimburseRejectBo.java @@ -1,11 +1,9 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; import lombok.Data; -import javax.validation.constraints.NotBlank; -import java.io.Serializable; /** * @author DB @@ -13,20 +11,20 @@ import java.io.Serializable; * @description */ @Data -@ApiModel(value = "报销驳回") -public class ReimburseRejectBo implements Serializable { +@Schema(description = "报销驳回") +public class ReimburseRejectBo { /** * 主键 */ @NotBlank(message = "主键不能为空") - @ApiModelProperty(value = "主键") + @Schema(description = "主键") private String id; /** * 驳回原因 */ @NotBlank(message = "驳回原因不能为空") - @ApiModelProperty(value = "驳回原因") + @Schema(description = "驳回原因") private String rejectReason; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ReimburseStatusBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ReimburseStatusBo.java index b5bd554..bd835d8 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ReimburseStatusBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ReimburseStatusBo.java @@ -1,12 +1,10 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotEmpty; import lombok.Data; import lombok.experimental.Accessors; -import javax.validation.constraints.NotEmpty; -import java.io.Serializable; import java.util.List; /** @@ -16,13 +14,13 @@ import java.util.List; */ @Data @Accessors(chain = true) -@ApiModel(value = "ReimburseStatusBo", description = "") -public class ReimburseStatusBo implements Serializable { +@Schema(description = "报销状态bo") +public class ReimburseStatusBo { /** * 更新状态ids */ @NotEmpty(message = "更新状态ids不能为空") - @ApiModelProperty(value = "更新状态ids", required = true) + @Schema(description = "更新状态ids", requiredMode = Schema.RequiredMode.REQUIRED) private List ids; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ReimburseTypeBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ReimburseTypeBo.java index 581032f..df82d7b 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ReimburseTypeBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ReimburseTypeBo.java @@ -1,10 +1,9 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; import lombok.Data; -import javax.validation.constraints.NotBlank; -import java.io.Serializable; /** * @author DB @@ -12,18 +11,18 @@ import java.io.Serializable; * @description */ @Data -public class ReimburseTypeBo implements Serializable { +public class ReimburseTypeBo { /** * 主键 */ - @ApiModelProperty("主键") + @Schema(description = "主键") private String id; /** * 报销类型 */ @NotBlank(message = "报销类型不能为空") - @ApiModelProperty(value = "报销类型",required = true) + @Schema(description = "报销类型",requiredMode = Schema.RequiredMode.REQUIRED) private String typeName; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/SignGoalBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/SignGoalBo.java index 4f16163..938aeb2 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/SignGoalBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/SignGoalBo.java @@ -1,11 +1,10 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotEmpty; import lombok.Data; import lombok.experimental.Accessors; -import javax.validation.constraints.NotEmpty; import java.util.List; /** @@ -15,98 +14,98 @@ import java.util.List; */ @Data @Accessors(chain = true) -@ApiModel(value = "SignGoalBo对象", description = "签约指标") +@Schema(description = "签约指标") public class SignGoalBo { /** * 主键 */ - @ApiModelProperty(value = "主键") + @Schema(description = "主键") private String id; /** * 员工id */ - @ApiModelProperty(value = "员工id") + @Schema(description = "员工id") private String staffId; /** * 签约区域集合 */ @NotEmpty(message = "签约区域集合不能为空") - @ApiModelProperty(value = "签约区域集合") + @Schema(description = "签约区域集合") private List signAreaList; /** * 一月目标 */ - @ApiModelProperty(value = "一月目标") + @Schema(description = "一月目标") private Integer janGoal; /** * 二月目标 */ - @ApiModelProperty(value = "二月目标") + @Schema(description = "二月目标") private Integer febGoal; /** * 三月目标 */ - @ApiModelProperty(value = "三月目标") + @Schema(description = "三月目标") private Integer marGoal; /** * 四月目标 */ - @ApiModelProperty(value = "四月目标") + @Schema(description = "四月目标") private Integer aprGoal; /** * 五月目标 */ - @ApiModelProperty(value = "五月目标") + @Schema(description = "五月目标") private Integer mayGoal; /** * 六月目标 */ - @ApiModelProperty(value = "六月目标") + @Schema(description = "六月目标") private Integer junGoal; /** * 七月目标 */ - @ApiModelProperty(value = "七月目标") + @Schema(description = "七月目标") private Integer julGoal; /** * 八月目标 */ - @ApiModelProperty(value = "八月目标") + @Schema(description = "八月目标") private Integer augGoal; /** * 九月目标 */ - @ApiModelProperty(value = "九月目标") + @Schema(description = "九月目标") private Integer sepGoal; /** * 十月目标 */ - @ApiModelProperty(value = "十月目标") + @Schema(description = "十月目标") private Integer octGoal; /** * 十一月目标 */ - @ApiModelProperty(value = "十一月目标") + @Schema(description = "十一月目标") private Integer novGoal; /** * 十二月目标 */ - @ApiModelProperty(value = "十二月目标") + @Schema(description = "十二月目标") private Integer decGoal; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/SignGoalConfigInfoBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/SignGoalConfigInfoBo.java index ee1163b..b4ed4fb 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/SignGoalConfigInfoBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/SignGoalConfigInfoBo.java @@ -1,12 +1,10 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; import lombok.Data; import lombok.experimental.Accessors; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; /** * @author DB @@ -15,20 +13,20 @@ import javax.validation.constraints.NotNull; */ @Data @Accessors(chain = true) -@ApiModel(value = "SignGoalConfigInfoBo对象", description = "签约指标配置信息") +@Schema(description = "签约指标配置信息") public class SignGoalConfigInfoBo { /** * 跟进间隔 */ @NotNull(message = "跟进间隔不能为空") - @ApiModelProperty(value = "跟进间隔",required = true) + @Schema(description = "跟进间隔",requiredMode = Schema.RequiredMode.REQUIRED) private String followUpInterval; /** * 签约间隔 */ @NotNull(message = "签约间隔不能为空") - @ApiModelProperty(value = "签约间隔",required = true) + @Schema(description = "签约间隔",requiredMode = Schema.RequiredMode.REQUIRED) private String signInterval; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/StaffBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/StaffBo.java index 28f86f3..4120c15 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/StaffBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/StaffBo.java @@ -1,14 +1,12 @@ package com.cpop.oam.business.bo; import com.cpop.core.anno.StringArrayConvert; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; import lombok.Data; import lombok.experimental.Accessors; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.io.Serializable; /** * 员工表Bo @@ -18,22 +16,20 @@ import java.io.Serializable; */ @Data @Accessors(chain = true) -@ApiModel(value = "Staff对象", description = "员工表") -public class StaffBo implements Serializable { - - private static final long serialVersionUID = 1L; +@Schema(description = "员工表") +public class StaffBo { /** * 主键 */ - @ApiModelProperty("主键") + @Schema(description ="主键") private String id; /** * 姓名不能为空 */ @NotBlank(message = "姓名不能为空") - @ApiModelProperty("姓名") + @Schema(description ="姓名") private String name; /** @@ -41,86 +37,86 @@ public class StaffBo implements Serializable { */ @StringArrayConvert @NotBlank(message = "部门不能为空") - @ApiModelProperty(value = "部门id",required = true) + @Schema(description = "部门id",requiredMode = Schema.RequiredMode.REQUIRED) private String deptId; /** * 用户id */ - @ApiModelProperty("用户id") + @Schema(description ="用户id") private String userId; /** * 员工类型(0:技术人员;1:售后人员;2:管理人员) */ @NotNull(message = "员工类型不能为空") - @ApiModelProperty(value = "员工类型(0:技术人员;1:售后人员;2:管理人员)",required = true) + @Schema(description = "员工类型(0:技术人员;1:售后人员;2:管理人员)",requiredMode = Schema.RequiredMode.REQUIRED) private Integer staffType; /** * 用户名 */ @NotBlank(message = "用户名不能为空") - @ApiModelProperty(value = "用户名",required = true) + @Schema(description = "用户名",requiredMode = Schema.RequiredMode.REQUIRED) private String userName; /** * 密码 */ @NotBlank(message = "密码不能为空") - @ApiModelProperty(value = "密码",required = true) + @Schema(description = "密码",requiredMode = Schema.RequiredMode.REQUIRED) private String password; /** * 昵称 */ - @ApiModelProperty(value = "昵称") + @Schema(description = "昵称") private String nickName; /** * 邮箱 */ - @ApiModelProperty(value = "邮箱") + @Schema(description = "邮箱") private String email; /** * 手机号 */ @NotBlank(message = "手机号不能为空") - @ApiModelProperty(value = "手机号",required = true) + @Schema(description = "手机号",requiredMode = Schema.RequiredMode.REQUIRED) private String phoneNumber; /** * 性别(0:男;1:女) */ @NotNull(message = "性别不能为空") - @ApiModelProperty(value = "性别(0:男;1:女)",required = true) + @Schema(description = "性别(0:男;1:女)",requiredMode = Schema.RequiredMode.REQUIRED) private Boolean sex; /** * 头像 */ - @ApiModelProperty(value = "头像") + @Schema(description = "头像") private String avatar; /** * 状态(0:停用;1:启用) */ @NotNull(message = "状态不能为空") - @ApiModelProperty(value = "状态(0:停用;1:启用)",required = true) + @Schema(description = "状态(0:停用;1:启用)",requiredMode = Schema.RequiredMode.REQUIRED) private Boolean status; /** * 角色id */ @NotBlank(message = "角色id不能为空") - @ApiModelProperty(value = "角色id",required = true) + @Schema(description = "角色id",requiredMode = Schema.RequiredMode.REQUIRED) private String roleId; /** * 企业微信用户id */ - @ApiModelProperty(value = "企业微信用户id",required = true) + @Schema(description = "企业微信用户id",requiredMode = Schema.RequiredMode.REQUIRED) private String wxCpUserId; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/StaffPageBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/StaffPageBo.java index f2533e0..f9549f8 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/StaffPageBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/StaffPageBo.java @@ -1,12 +1,9 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; -import java.io.Serializable; - /** * Description: * date: 2023/5/11 15:23 @@ -15,26 +12,24 @@ import java.io.Serializable; */ @Data @Accessors(chain = true) -@ApiModel(value = "系统用户", description = "系统用户(员工)") -public class StaffPageBo implements Serializable { - - private static final long serialVersionUID = 1L; +@Schema(description = "系统用户(员工)") +public class StaffPageBo { /** * 姓名 */ - @ApiModelProperty("姓名") + @Schema(description ="姓名") private String name; /** * 部门id */ - @ApiModelProperty("部门id") + @Schema(description ="部门id") private String deptId; /** * 员工类型 */ - @ApiModelProperty("员工类型") + @Schema(description ="员工类型") private Integer staffType; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/SysConfigInfoBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/SysConfigInfoBo.java index 7d45ec3..a0407bd 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/SysConfigInfoBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/SysConfigInfoBo.java @@ -1,12 +1,10 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; import lombok.Data; import lombok.experimental.Accessors; -import javax.validation.constraints.NotBlank; -import java.io.Serializable; /** * @author: DB @@ -15,30 +13,28 @@ import java.io.Serializable; */ @Data @Accessors(chain = true) -@ApiModel(value = "SysConfigInfoBo对象", description = "系统配置信息") -public class SysConfigInfoBo implements Serializable { - - private static final long serialVersionUID = 1L; +@Schema(description = "系统配置信息") +public class SysConfigInfoBo { /** * 任务审核员工手机号 */ @NotBlank(message = "任务审核员工手机号不能为空") - @ApiModelProperty(value = "任务审核员工手机号", required = true) + @Schema(description = "任务审核员工手机号", requiredMode = Schema.RequiredMode.REQUIRED) private String auditStaffPhone; /** * 核销管理员工手机号 */ @NotBlank(message = "核销管理员工手机号不能为空") - @ApiModelProperty(value = "核销管理员工手机号", required = true) + @Schema(description = "核销管理员工手机号", requiredMode = Schema.RequiredMode.REQUIRED) private String cancelAfterVerificationStaffPhone; /** * 测试员工手机号 */ @NotBlank(message = "测试员工手机号不能为空") - @ApiModelProperty(value = "测试员工手机号", required = true) + @Schema(description = "测试员工手机号", requiredMode = Schema.RequiredMode.REQUIRED) private String testStaffPhone; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskArchivingPagBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskArchivingPagBo.java index dedc638..caa4dfd 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskArchivingPagBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskArchivingPagBo.java @@ -1,14 +1,9 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import io.swagger.annotations.ApiParam; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; import lombok.Data; import lombok.experimental.Accessors; -import org.springframework.web.bind.annotation.RequestParam; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; /** * @author DB @@ -17,25 +12,25 @@ import javax.validation.constraints.NotNull; */ @Data @Accessors(chain = true) -@ApiModel(value = "TaskArchivingPagBo") +@Schema(description = "TaskArchivingPagBo") public class TaskArchivingPagBo { /** * 主体 */ - @ApiModelProperty("主体") + @Schema(description ="主体") private String subject; /** * 任务内容 */ - @ApiModelProperty("任务内容") + @Schema(description ="任务内容") private String taskContent; /** * 是否已归档 */ @NotNull(message = "不能为空") - @ApiModelProperty(value = "任务内容",required = true) + @Schema(description = "任务内容",requiredMode = Schema.RequiredMode.REQUIRED) Boolean isFinish; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskAuditCommentsBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskAuditCommentsBo.java index 1d8e2a8..1ef50de 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskAuditCommentsBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskAuditCommentsBo.java @@ -1,14 +1,11 @@ package com.cpop.oam.business.bo; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; import lombok.Data; import lombok.experimental.Accessors; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.time.LocalDate; /** * 任务审核对象 @@ -18,33 +15,33 @@ import java.time.LocalDate; */ @Data @Accessors(chain = true) -@ApiModel(value = "TaskAudit对象", description = "任务审核对象") +@Schema(description = "任务审核对象") public class TaskAuditCommentsBo { /** * 主键 */ @NotBlank(message = "主键不能为空") - @ApiModelProperty(value = "主键", required = true) + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED) private String id; /** * 是否通过 */ @NotNull(message = "是否通过不能为空") - @ApiModelProperty(value = "是否通过", required = true) + @Schema(description = "是否通过", requiredMode = Schema.RequiredMode.REQUIRED) private Boolean isPass; /** * 任务评级(0:A;1:B;2:C;3:D;4:E) */ - @ApiModelProperty("任务评级") + @Schema(description ="任务评级") private String taskRating; /** * 任务权重 */ - @ApiModelProperty("任务权重(任务绩点)") + @Schema(description ="任务权重(任务绩点)") private Integer taskWeight; public void setTaskWeight(String taskWeight) { @@ -54,7 +51,7 @@ public class TaskAuditCommentsBo { /** * 备注(不通过时可以写入备注) */ - @ApiModelProperty("备注(不通过时可以写入备注)") + @Schema(description ="备注(不通过时可以写入备注)") private String remark; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskDailyPaperBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskDailyPaperBo.java index be30dba..f0792c4 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskDailyPaperBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskDailyPaperBo.java @@ -1,7 +1,6 @@ package com.cpop.oam.business.bo; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; import org.springframework.format.annotation.DateTimeFormat; @@ -15,7 +14,7 @@ import java.time.LocalDate; */ @Data @Accessors(chain = true) -@ApiModel(value = "任务日报对象", description = "任务日报对象") +@Schema(description = "任务日报对象") public class TaskDailyPaperBo { /** diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskDemandBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskDemandBo.java index 5795410..d19a206 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskDemandBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskDemandBo.java @@ -1,12 +1,10 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; import lombok.Data; import lombok.experimental.Accessors; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; /** * OAM-任务-需求表Bo @@ -16,40 +14,40 @@ import javax.validation.constraints.NotNull; */ @Data @Accessors(chain = true) -@ApiModel(value = "TaskDemand对象", description = "OAM-任务-需求表") +@Schema(description = "OAM-任务-需求表") public class TaskDemandBo { /** * 主键 */ - @ApiModelProperty("主键") + @Schema(description = "主键") private String id; /** * 品牌id */ @NotBlank(message = "品牌不能为空") - @ApiModelProperty(value = "品牌id", required = true) + @Schema(description = "品牌id", requiredMode = Schema.RequiredMode.REQUIRED) private String brandId; /** * 校区id */ @NotBlank(message = "校区不能为空") - @ApiModelProperty(value = "校区id", required = true) + @Schema(description = "校区id", requiredMode = Schema.RequiredMode.REQUIRED) private String storeId; /** * 任务内容 */ @NotBlank(message = "任务内容不能为空") - @ApiModelProperty(value = "任务内容", required = true) + @Schema(description = "任务内容", requiredMode = Schema.RequiredMode.REQUIRED) private String taskContent; /** * 附件地址 */ - @ApiModelProperty("附件地址") + @Schema(description = "附件地址") private String attachmentUrl; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskDemandPageBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskDemandPageBo.java index 4e8f4eb..0df2431 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskDemandPageBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskDemandPageBo.java @@ -1,12 +1,9 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; -import java.io.Serializable; - /** * Description: * date: 2023/5/30 15:44 @@ -15,25 +12,25 @@ import java.io.Serializable; */ @Data @Accessors(chain = true) -@ApiModel(value = "SysDept对象", description = "部门表") +@Schema(description = "部门表") public class TaskDemandPageBo { /** * 任务内容 */ - @ApiModelProperty("任务内容") + @Schema(description ="任务内容") private String taskContent; /** * 品牌或校区 */ - @ApiModelProperty("品牌或校区") + @Schema(description ="品牌或校区") private String brandOrStore; /** * 任务状态 */ - @ApiModelProperty(value = "任务查询状态(待评估:0;待领取:1;处理中:2;已解决:3)", required = true) + @Schema(description = "任务查询状态(待评估:0;待领取:1;处理中:2;已解决:3)", requiredMode = Schema.RequiredMode.REQUIRED) private Integer taskStatus; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskDemandUrgentBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskDemandUrgentBo.java index b1cb2a8..982854e 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskDemandUrgentBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskDemandUrgentBo.java @@ -1,7 +1,6 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; @@ -13,13 +12,13 @@ import lombok.experimental.Accessors; */ @Data @Accessors(chain = true) -@ApiModel(value = "TaskDemandUrgentBo对象") +@Schema(description = "TaskDemandUrgentBo对象") public class TaskDemandUrgentBo { /** * 需求id */ - @ApiModelProperty("需求id") + @Schema(description ="需求id") private String id; diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskItemBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskItemBo.java index dc023e9..8fb3f6e 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskItemBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskItemBo.java @@ -1,12 +1,11 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; import lombok.Data; import lombok.experimental.Accessors; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; /** * Description: @@ -16,26 +15,26 @@ import javax.validation.constraints.NotNull; */ @Data @Accessors(chain = true) -@ApiModel(value = "Task项对象", description = "Task项对象") +@Schema(description = "Task项对象") public class TaskItemBo { /** * 主键 */ @NotBlank(message = "主键不能为空") - @ApiModelProperty(value = "主键",required = true) + @Schema(description = "主键",requiredMode = Schema.RequiredMode.REQUIRED) private String id; /** * 任务项(0:待开发;1:待测试:2:待部署;3:已归档) */ @NotNull(message = "任务项不能为空") - @ApiModelProperty(value = "任务项(0:待开发;1:待测试:2:待部署;3:已归档;-1:逾期)",required = true) + @Schema(description = "任务项(0:待开发;1:待测试:2:待部署;3:已归档;-1:逾期)",requiredMode = Schema.RequiredMode.REQUIRED) private Integer taskItem; /** * 测试转部署文件路径 */ - @ApiModelProperty(value = "测试转部署文件路径") + @Schema(description = "测试转部署文件路径") private String testToFinishUrl; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskIterationBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskIterationBo.java index 0868d4d..3dcd98c 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskIterationBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskIterationBo.java @@ -1,10 +1,9 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; import lombok.Data; import lombok.experimental.Accessors; -import javax.validation.constraints.NotBlank; /** * Task迭代对象 @@ -14,30 +13,30 @@ import javax.validation.constraints.NotBlank; */ @Data @Accessors(chain = true) -@ApiModel(value = "Task迭代对象") +@Schema(description = "Task迭代对象") public class TaskIterationBo { /** * 主键 */ - @ApiModelProperty("主键") + @Schema(description ="主键") private String id; /** * 任务主体 */ @NotBlank(message = "任务主体不能为空") - @ApiModelProperty(value = "任务主体", required = true) + @Schema(description = "任务主体", requiredMode = Schema.RequiredMode.REQUIRED) private String subject; /**任务内容 */ @NotBlank(message = "任务内容不能为空") - @ApiModelProperty(value = "任务内容", required = true) + @Schema(description = "任务内容", requiredMode = Schema.RequiredMode.REQUIRED) private String taskContent; /** * 附件地址 */ - @ApiModelProperty("附件地址") + @Schema(description ="附件地址") private String attachmentUrl; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskMonthStatisticsBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskMonthStatisticsBo.java index fdf2840..52940a0 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskMonthStatisticsBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskMonthStatisticsBo.java @@ -1,12 +1,9 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; -import java.io.Serializable; - /** * Description: * date: 2023/5/15 16:21 @@ -15,20 +12,18 @@ import java.io.Serializable; */ @Data @Accessors(chain = true) -@ApiModel(value = "Task列表返回对象", description = "OAM-任务表") -public class TaskMonthStatisticsBo implements Serializable { - - private static final long serialVersionUID = 1L; +@Schema(description = "OAM-任务表") +public class TaskMonthStatisticsBo { /** * 主要负责员工id */ - @ApiModelProperty("技术员工id") + @Schema(description ="技术员工id") private String technologyStaffId; /** * 任务月份 */ - @ApiModelProperty("任务月份") + @Schema(description ="任务月份") private String taskMoth; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskProgressBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskProgressBo.java index 6074f0f..9cc3118 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskProgressBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskProgressBo.java @@ -1,13 +1,12 @@ package com.cpop.oam.business.bo; import com.cpop.core.anno.StringArrayConvert; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; import lombok.Data; import lombok.experimental.Accessors; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; /** * @author DB @@ -16,21 +15,21 @@ import javax.validation.constraints.NotNull; */ @Data @Accessors(chain = true) -@ApiModel(value = "Task进度对象", description = "Task进度对象") +@Schema(description = "Task进度对象") public class TaskProgressBo { /** * 主键 */ @NotBlank(message = "主键不能为空") - @ApiModelProperty(value = "主键",required = true) + @Schema(description = "主键",requiredMode = Schema.RequiredMode.REQUIRED) private String id; /** * 任务进度(0:开发文档;1:原型涉及;2:UI涉及;3:前端开发;4:后端开发) */ @NotNull(message = "任务进度不能为空") - @ApiModelProperty(value = "任务进度(0:开发文档;1:原型涉及;2:UI涉及;3:前端开发;4:后端开发)",required = true) + @Schema(description = "任务进度(0:开发文档;1:原型涉及;2:UI涉及;3:前端开发;4:后端开发)",requiredMode = Schema.RequiredMode.REQUIRED) @StringArrayConvert private String taskProgress; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskStaffGroupBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskStaffGroupBo.java index 132487b..3d5b8b9 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskStaffGroupBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskStaffGroupBo.java @@ -1,14 +1,13 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; import lombok.Data; import lombok.experimental.Accessors; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.io.Serializable; /** * OAM-任务-关联员工任务组表Bo @@ -18,29 +17,27 @@ import java.io.Serializable; */ @Data @Accessors(chain = true) -@ApiModel(value = "TaskStaffGroup对象", description = "OAM-任务-关联员工任务组表") -public class TaskStaffGroupBo implements Serializable { - - private static final long serialVersionUID = 1L; +@Schema(description = "OAM-任务-关联员工任务组表") +public class TaskStaffGroupBo { /** * 主键 */ - @ApiModelProperty("主键") + @Schema(description ="主键") private String id; /** * 任务id */ @NotBlank(message = "任务id不能为空") - @ApiModelProperty(value = "任务id", required = true) + @Schema(description = "任务id", requiredMode = Schema.RequiredMode.REQUIRED) private String taskId; /** * 员工id */ @NotBlank(message = "员工id不能为空") - @ApiModelProperty(value = "员工id", required = true) + @Schema(description = "员工id", requiredMode = Schema.RequiredMode.REQUIRED) private String staffId; /** @@ -48,7 +45,7 @@ public class TaskStaffGroupBo implements Serializable { */ @Min(value = 0) @NotNull(message = "绩点不能为空") - @ApiModelProperty(value = "绩点", required = true) + @Schema(description = "绩点", requiredMode = Schema.RequiredMode.REQUIRED) private Integer gradePoint; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskWorkOrderRecordBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskWorkOrderRecordBo.java index ffd4221..8f5338b 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskWorkOrderRecordBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TaskWorkOrderRecordBo.java @@ -1,11 +1,10 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; import lombok.Data; import lombok.experimental.Accessors; -import javax.validation.constraints.NotBlank; /** * TaskWorkOrderRecord对象 @@ -15,27 +14,27 @@ import javax.validation.constraints.NotBlank; */ @Data @Accessors(chain = true) -@ApiModel(value = "TaskWorkOrderRecord对象", description = "任务-工单-记录表") +@Schema(description = "任务-工单-记录表") public class TaskWorkOrderRecordBo { /** * 任务工单id */ @NotBlank(message = "任务工单id不能为空") - @ApiModelProperty(value = "任务工单id", required = true) + @Schema(description = "任务工单id", requiredMode = Schema.RequiredMode.REQUIRED) private String taskWorkOrderId; /** * 记录内容 */ @NotBlank(message = "记录内容不能为空") - @ApiModelProperty(value = "记录内容", required = true) + @Schema(description = "记录内容", requiredMode = Schema.RequiredMode.REQUIRED) private String recordText; /** * 附件地址 */ - @ApiModelProperty(value = "附件地址", required = true) + @Schema(description = "附件地址", requiredMode = Schema.RequiredMode.REQUIRED) private String attachmentUrl; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TransferTaskBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TransferTaskBo.java index b4d32b8..ce6707e 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TransferTaskBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/TransferTaskBo.java @@ -1,13 +1,10 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; import lombok.Data; import lombok.experimental.Accessors; -import javax.validation.constraints.NotBlank; -import java.io.Serializable; - /** * Description: * date: 2023/5/29 16:00 @@ -16,27 +13,27 @@ import java.io.Serializable; */ @Data @Accessors(chain = true) -@ApiModel(value = "Task转交对象", description = "Task转交对象") +@Schema(description = "Task转交对象") public class TransferTaskBo { /** * 主键 */ @NotBlank(message = "主键不能为空") - @ApiModelProperty(value = "主键",required = true) + @Schema(description = "主键",requiredMode = Schema.RequiredMode.REQUIRED) private String id; /** * 原负责人 */ @NotBlank(message = "原负责人不能为空") - @ApiModelProperty(value = "原负责人",required = true) + @Schema(description = "原负责人",requiredMode = Schema.RequiredMode.REQUIRED) private String responsibleStaffId; /** * 新负责人 */ @NotBlank(message = "新负责人不能为空") - @ApiModelProperty(value = "新负责人",required = true) + @Schema(description = "新负责人",requiredMode = Schema.RequiredMode.REQUIRED) private String newResponsibleStaffId; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/SysUserLogBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/UserLogBo.java similarity index 51% rename from Cpop-Oam/src/main/java/com/cpop/oam/business/bo/SysUserLogBo.java rename to Cpop-Oam/src/main/java/com/cpop/oam/business/bo/UserLogBo.java index 1f79f14..8934660 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/SysUserLogBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/UserLogBo.java @@ -1,12 +1,10 @@ package com.cpop.oam.business.bo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; import lombok.Data; import lombok.experimental.Accessors; -import javax.validation.constraints.NotBlank; -import java.io.Serializable; /** * @author: DB @@ -15,51 +13,49 @@ import java.io.Serializable; */ @Data @Accessors(chain = true) -@ApiModel(value = "SysUserLogeBo对象", description = "用户操作日志分页请求参数") -public class SysUserLogBo implements Serializable { - - private static final long serialVersionUID = 1L; +@Schema(description = "用户操作日志分页请求参数") +public class UserLogBo { /** * 操作用户 */ - @ApiModelProperty("操作用户") + @Schema(description ="操作用户") private String operationUserName; /** * 操作终端的IP地址 */ - @ApiModelProperty("操作终端的IP地址") + @Schema(description ="操作终端的IP地址") private String devIp; /** * 结果 -1:失败 1:成功 */ - @ApiModelProperty("结果 -1:失败 1:成功") + @Schema(description ="结果 -1:失败 1:成功") private Integer result; /** * 日志级别,0-提示,1-一般,2-危险,3-高危 */ - @ApiModelProperty("日志级别,0-提示,1-一般,2-危险,3-高危") + @Schema(description ="日志级别,0-提示,1-一般,2-危险,3-高危") private Integer level; /** * 行为类别,1-一般行为,2-异常行为 */ - @ApiModelProperty("行为类别,1-一般行为,2-异常行为") + @Schema(description ="行为类别,1-一般行为,2-异常行为") private Integer actionType; /** * 时间字段 */ - @ApiModelProperty("时间字段") + @Schema(description ="时间字段") private String fieldTime; /** * 用户id */ @NotBlank(message = "用户id不能为空") - @ApiModelProperty(value = "用户id",required = true) + @Schema(description = "用户id",requiredMode = Schema.RequiredMode.REQUIRED) private String userId; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageBusinessController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageBusinessController.java index 9f01fab..ed16022 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageBusinessController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageBusinessController.java @@ -26,7 +26,7 @@ import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; -import static com.cpop.core.base.table.table.SysUserTableDef.SYS_USER; +import static com.cpop.core.base.table.table.UserTableDef.USER; import static com.cpop.oam.business.entity.table.StaffTableDef.STAFF; /** @@ -99,9 +99,9 @@ public class BackstageBusinessController { @Operation(summary = "获取市场部员工") public R> getBusinessStaff() { List list = SpringUtils.getBean(StaffService.class).queryChain() - .leftJoin(SYS_USER).on(SYS_USER.ID.eq(STAFF.USER_ID)) + .leftJoin(USER).on(USER.ID.eq(STAFF.USER_ID)) .where(STAFF.STAFF_TYPE.eq(1)) - .and(SYS_USER.STATUS.eq(1)) + .and(USER.STATUS.eq(1)) .listAs(StaffVo.class); return R.ok(list); } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageCloudDataController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageCloudDataController.java index b1c592b..d35f33d 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageCloudDataController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageCloudDataController.java @@ -4,9 +4,9 @@ import com.cpop.api.cloudDb.core.dto.*; import com.cpop.api.cloudDb.handler.*; import com.cpop.core.base.entity.R; import com.mybatisflex.core.paginate.Page; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.RestController; * @since 2024-01-09 16:01 */ @RestController -@Api(tags = "云数据查询接口") +@Tag(name = "云数据查询接口") @RequestMapping("/backstage/cloudData") public class BackstageCloudDataController { @@ -53,14 +53,14 @@ public class BackstageCloudDataController { * @param customerId 客户id * @return R> */ - @ApiOperation("获取客户分页") + @Operation(summary = "获取客户分页") @GetMapping("/getCustomerPage") - public R> getCustomerPage(@ApiParam("分页参数") @RequestParam("page") Integer page, - @ApiParam("分页参数") @RequestParam("pageSize") Integer pageSize, - @ApiParam("开始日期") @RequestParam(value = "startDate", required = false) String startDate, - @ApiParam("结束日期") @RequestParam(value = "endDate", required = false) String endDate, - @ApiParam("校区Id") @RequestParam("storeId") String storeId, - @ApiParam("客户id") @RequestParam(value = "customerId", required = false) String customerId) { + public R> getCustomerPage(@Parameter(description = "分页参数") @RequestParam("page") Integer page, + @Parameter(description = "分页参数") @RequestParam("pageSize") Integer pageSize, + @Parameter(description = "开始日期") @RequestParam(value = "startDate", required = false) String startDate, + @Parameter(description = "结束日期") @RequestParam(value = "endDate", required = false) String endDate, + @Parameter(description = "校区Id") @RequestParam("storeId") String storeId, + @Parameter(description = "客户id") @RequestParam(value = "customerId", required = false) String customerId) { Page pageList = cloudCustomerStudentHandler.getCustomerPage(page, pageSize, startDate, endDate, storeId, customerId); return R.ok(pageList); } @@ -77,15 +77,15 @@ public class BackstageCloudDataController { * @param customerId 客户id * @return R> */ - @ApiOperation("获取学员分页") + @Operation(summary = "获取学员分页") @GetMapping("/getStudentPage") - public R> getStudentPage(@ApiParam("分页参数") @RequestParam("page") Integer page, - @ApiParam("分页参数") @RequestParam("pageSize") Integer pageSize, - @ApiParam("开始日期") @RequestParam(value = "startDate", required = false) String startDate, - @ApiParam("结束日期") @RequestParam(value = "endDate", required = false) String endDate, - @ApiParam("校区Id") @RequestParam("storeId") String storeId, - @ApiParam("客户id") @RequestParam(value = "customerId", required = false) String customerId, - @ApiParam("学员id") @RequestParam(value = "studentId", required = false) String studentId) { + public R> getStudentPage(@Parameter(description = "分页参数") @RequestParam("page") Integer page, + @Parameter(description = "分页参数") @RequestParam("pageSize") Integer pageSize, + @Parameter(description = "开始日期") @RequestParam(value = "startDate", required = false) String startDate, + @Parameter(description = "结束日期") @RequestParam(value = "endDate", required = false) String endDate, + @Parameter(description = "校区Id") @RequestParam("storeId") String storeId, + @Parameter(description = "客户id") @RequestParam(value = "customerId", required = false) String customerId, + @Parameter(description = "学员id") @RequestParam(value = "studentId", required = false) String studentId) { Page studentPage = cloudCustomerStudentHandler.getStudentPage(page, pageSize, startDate, endDate, storeId, customerId, studentId); return R.ok(studentPage); } @@ -102,15 +102,15 @@ public class BackstageCloudDataController { * @param courseId 课程id * @return R> */ - @ApiOperation("获取课程分页") + @Operation(summary = "获取课程分页") @GetMapping("/getCoursePage") - public R> getCoursePage(@ApiParam("分页参数") @RequestParam("page") Integer page, - @ApiParam("分页参数") @RequestParam("pageSize") Integer pageSize, - @ApiParam("开始日期") @RequestParam(value = "startDate", required = false) String startDate, - @ApiParam("结束日期") @RequestParam(value = "endDate", required = false) String endDate, - @ApiParam("校区Id") @RequestParam("storeId") String storeId, - @ApiParam("课程id") @RequestParam(value = "courseId", required = false) String courseId, - @ApiParam("班id") @RequestParam(value = "classId", required = false) String classId) { + public R> getCoursePage(@Parameter(description = "分页参数") @RequestParam("page") Integer page, + @Parameter(description = "分页参数") @RequestParam("pageSize") Integer pageSize, + @Parameter(description = "开始日期") @RequestParam(value = "startDate", required = false) String startDate, + @Parameter(description = "结束日期") @RequestParam(value = "endDate", required = false) String endDate, + @Parameter(description = "校区Id") @RequestParam("storeId") String storeId, + @Parameter(description = "课程id") @RequestParam(value = "courseId", required = false) String courseId, + @Parameter(description = "班id") @RequestParam(value = "classId", required = false) String classId) { Page coursePage = cloudCourseHandler.getCoursePage(page, pageSize, startDate, endDate, storeId, courseId, classId); return R.ok(coursePage); } @@ -129,16 +129,16 @@ public class BackstageCloudDataController { * @param courseId 课程id * @return R */ - @ApiOperation("获取学员上课") + @Operation(summary = "获取学员上课") @GetMapping("/getCourseStudentList") - public R getCourseStudentList(@ApiParam("客户id") @RequestParam(value = "customerId", required = false) String customerId, - @ApiParam("学员id") @RequestParam(value = "studentId", required = false) String studentId, - @ApiParam("课卡id") @RequestParam(value = "cardId", required = false) String cardId, - @ApiParam("教室id") @RequestParam(value = "classId", required = false) String classId, - @ApiParam("开始日期") @RequestParam(value = "startDate", required = false) String startDate, - @ApiParam("结束日期") @RequestParam(value = "endDate", required = false) String endDate, - @ApiParam("校区Id") @RequestParam("storeId") String storeId, - @ApiParam("课程id") @RequestParam(value = "courseId", required = false) String courseId) { + public R getCourseStudentList(@Parameter(description = "客户id") @RequestParam(value = "customerId", required = false) String customerId, + @Parameter(description = "学员id") @RequestParam(value = "studentId", required = false) String studentId, + @Parameter(description = "课卡id") @RequestParam(value = "cardId", required = false) String cardId, + @Parameter(description = "教室id") @RequestParam(value = "classId", required = false) String classId, + @Parameter(description = "开始日期") @RequestParam(value = "startDate", required = false) String startDate, + @Parameter(description = "结束日期") @RequestParam(value = "endDate", required = false) String endDate, + @Parameter(description = "校区Id") @RequestParam("storeId") String storeId, + @Parameter(description = "课程id") @RequestParam(value = "courseId", required = false) String courseId) { CloudCourseStudentListDto studentListDto = cloudCourseHandler.getCourseStudentList(customerId, studentId, cardId, classId, startDate, endDate, storeId, courseId); return R.ok(studentListDto); } @@ -155,14 +155,14 @@ public class BackstageCloudDataController { * @param classId 教室id * @return R> */ - @ApiOperation("获取班级分页") + @Operation(summary = "获取班级分页") @GetMapping("/getClassPage") - public R> getClassPage(@ApiParam("分页参数") @RequestParam("page") Integer page, - @ApiParam("分页参数") @RequestParam("pageSize") Integer pageSize, - @ApiParam("开始日期") @RequestParam(value = "startDate", required = false) String startDate, - @ApiParam("结束日期") @RequestParam(value = "endDate", required = false) String endDate, - @ApiParam("校区Id") @RequestParam("storeId") String storeId, - @ApiParam("教室id") @RequestParam(value = "classId", required = false) String classId) { + public R> getClassPage(@Parameter(description = "分页参数") @RequestParam("page") Integer page, + @Parameter(description = "分页参数") @RequestParam("pageSize") Integer pageSize, + @Parameter(description = "开始日期") @RequestParam(value = "startDate", required = false) String startDate, + @Parameter(description = "结束日期") @RequestParam(value = "endDate", required = false) String endDate, + @Parameter(description = "校区Id") @RequestParam("storeId") String storeId, + @Parameter(description = "教室id") @RequestParam(value = "classId", required = false) String classId) { Page classPage = cloudClassHandler.getClassPage(page, pageSize, startDate, endDate, storeId, classId); return R.ok(classPage); } @@ -180,14 +180,14 @@ public class BackstageCloudDataController { * @param classId 教室id * @return R> */ - @ApiOperation("获取班级学员分页") + @Operation(summary = "获取班级学员分页") @GetMapping("/getClassStudentPage") - public R> getClassStudentPage(@ApiParam("分页参数") @RequestParam("page") Integer page, - @ApiParam("分页参数") @RequestParam("pageSize") Integer pageSize, - @ApiParam("开始日期") @RequestParam(value = "startDate", required = false) String startDate, - @ApiParam("结束日期") @RequestParam(value = "endDate", required = false) String endDate, - @ApiParam("校区Id") @RequestParam("storeId") String storeId, - @ApiParam("教室id") @RequestParam(value = "classId", required = false) String classId) { + public R> getClassStudentPage(@Parameter(description = "分页参数") @RequestParam("page") Integer page, + @Parameter(description = "分页参数") @RequestParam("pageSize") Integer pageSize, + @Parameter(description = "开始日期") @RequestParam(value = "startDate", required = false) String startDate, + @Parameter(description = "结束日期") @RequestParam(value = "endDate", required = false) String endDate, + @Parameter(description = "校区Id") @RequestParam("storeId") String storeId, + @Parameter(description = "教室id") @RequestParam(value = "classId", required = false) String classId) { Page classStudentPage = cloudClassHandler.getClassStudentPage(page, pageSize, startDate, endDate, storeId, classId); return R.ok(classStudentPage); } @@ -206,16 +206,16 @@ public class BackstageCloudDataController { * @param orderId 订单id * @return R> */ - @ApiOperation("获取订单分页") + @Operation(summary = "获取订单分页") @GetMapping("/getOrderPage") - public R> getOrderPage(@ApiParam("分页参数") @RequestParam("page") Integer page, - @ApiParam("分页参数") @RequestParam("pageSize") Integer pageSize, - @ApiParam("开始日期") @RequestParam(value = "startDate", required = false) String startDate, - @ApiParam("结束日期") @RequestParam(value = "endDate", required = false) String endDate, - @ApiParam("校区Id") @RequestParam("storeId") String storeId, - @ApiParam("客户id") @RequestParam(value = "customerId", required = false) String customerId, - @ApiParam("课卡id") @RequestParam(value = "cardId", required = false) String cardId, - @ApiParam("订单id") @RequestParam(value = "orderId", required = false) String orderId) { + public R> getOrderPage(@Parameter(description = "分页参数") @RequestParam("page") Integer page, + @Parameter(description = "分页参数") @RequestParam("pageSize") Integer pageSize, + @Parameter(description = "开始日期") @RequestParam(value = "startDate", required = false) String startDate, + @Parameter(description = "结束日期") @RequestParam(value = "endDate", required = false) String endDate, + @Parameter(description = "校区Id") @RequestParam("storeId") String storeId, + @Parameter(description = "客户id") @RequestParam(value = "customerId", required = false) String customerId, + @Parameter(description = "课卡id") @RequestParam(value = "cardId", required = false) String cardId, + @Parameter(description = "订单id") @RequestParam(value = "orderId", required = false) String orderId) { Page orderPage = cloudOrderHandler.getOrderPage(page, pageSize, startDate, endDate, storeId, customerId, cardId, orderId); return R.ok(orderPage); } @@ -235,17 +235,17 @@ public class BackstageCloudDataController { * @param cardStatus 课卡状态 * @return R> */ - @ApiOperation("获取课卡分页") + @Operation(summary = "获取课卡分页") @GetMapping("/getClassCardPage") - public R> getClassCardPage(@ApiParam("分页参数") @RequestParam("page") Integer page, - @ApiParam("分页参数") @RequestParam("pageSize") Integer pageSize, - @ApiParam("开始日期") @RequestParam(value = "startDate", required = false) String startDate, - @ApiParam("结束日期") @RequestParam(value = "endDate", required = false) String endDate, - @ApiParam("校区Id") @RequestParam("storeId") String storeId, - @ApiParam("客户id") @RequestParam(value = "customerId", required = false) String customerId, - @ApiParam("课卡id") @RequestParam(value = "cardId", required = false) String cardId, - @ApiParam("课卡类型") @RequestParam(value = "cardType", required = false) String cardType, - @ApiParam("课卡状态") @RequestParam(value = "cardStatus", required = false) Integer cardStatus) { + public R> getClassCardPage(@Parameter(description = "分页参数") @RequestParam("page") Integer page, + @Parameter(description = "分页参数") @RequestParam("pageSize") Integer pageSize, + @Parameter(description = "开始日期") @RequestParam(value = "startDate", required = false) String startDate, + @Parameter(description = "结束日期") @RequestParam(value = "endDate", required = false) String endDate, + @Parameter(description = "校区Id") @RequestParam("storeId") String storeId, + @Parameter(description = "客户id") @RequestParam(value = "customerId", required = false) String customerId, + @Parameter(description = "课卡id") @RequestParam(value = "cardId", required = false) String cardId, + @Parameter(description = "课卡类型") @RequestParam(value = "cardType", required = false) String cardType, + @Parameter(description = "课卡状态") @RequestParam(value = "cardStatus", required = false) Integer cardStatus) { Page classCardPage = cloudClassCardHandler.getClassCardPage(page, pageSize, startDate, endDate, storeId, customerId, cardId, cardType, cardStatus); return R.ok(classCardPage); } @@ -263,15 +263,15 @@ public class BackstageCloudDataController { * @param cardId 课卡id * @return R> */ - @ApiOperation("获取课卡记录分页") + @Operation(summary = "获取课卡记录分页") @GetMapping("/getClassCardRecordPage") - public R> getClassCardRecordPage(@ApiParam("分页参数") @RequestParam("page") Integer page, - @ApiParam("分页参数") @RequestParam("pageSize") Integer pageSize, - @ApiParam("开始日期") @RequestParam(value = "startDate", required = false) String startDate, - @ApiParam("结束日期") @RequestParam(value = "endDate", required = false) String endDate, - @ApiParam("校区Id") @RequestParam("storeId") String storeId, - @ApiParam("客户id") @RequestParam(value = "customerId", required = false) String customerId, - @ApiParam("课卡id") @RequestParam(value = "cardId", required = false) String cardId) { + public R> getClassCardRecordPage(@Parameter(description = "分页参数") @RequestParam("page") Integer page, + @Parameter(description = "分页参数") @RequestParam("pageSize") Integer pageSize, + @Parameter(description = "开始日期") @RequestParam(value = "startDate", required = false) String startDate, + @Parameter(description = "结束日期") @RequestParam(value = "endDate", required = false) String endDate, + @Parameter(description = "校区Id") @RequestParam("storeId") String storeId, + @Parameter(description = "客户id") @RequestParam(value = "customerId", required = false) String customerId, + @Parameter(description = "课卡id") @RequestParam(value = "cardId", required = false) String cardId) { Page classCardRecordPage = cloudClassCardHandler.getClassCardRecordPage(page, pageSize, startDate, endDate, storeId, customerId, cardId); return R.ok(classCardRecordPage); } @@ -288,14 +288,14 @@ public class BackstageCloudDataController { * @param staffId 员工id * @return R> */ - @ApiOperation("获取班级分页") + @Operation(summary = "获取班级分页") @GetMapping("/getStoreStaffPage") - public R> getStoreStaffPage(@ApiParam("分页参数") @RequestParam("page") Integer page, - @ApiParam("分页参数") @RequestParam("pageSize") Integer pageSize, - @ApiParam("开始日期") @RequestParam(value = "startDate", required = false) String startDate, - @ApiParam("结束日期") @RequestParam(value = "endDate", required = false) String endDate, - @ApiParam("校区Id") @RequestParam("storeId") String storeId, - @ApiParam("员工id") @RequestParam(value = "staffId", required = false) String staffId) { + public R> getStoreStaffPage(@Parameter(description = "分页参数") @RequestParam("page") Integer page, + @Parameter(description = "分页参数") @RequestParam("pageSize") Integer pageSize, + @Parameter(description = "开始日期") @RequestParam(value = "startDate", required = false) String startDate, + @Parameter(description = "结束日期") @RequestParam(value = "endDate", required = false) String endDate, + @Parameter(description = "校区Id") @RequestParam("storeId") String storeId, + @Parameter(description = "员工id") @RequestParam(value = "staffId", required = false) String staffId) { Page storeStaffPage = cloudStaffHandler.getStoreStaffPage(page, pageSize, startDate, endDate, storeId, staffId); return R.ok(storeStaffPage); } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageClueController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageClueController.java index 1fdec20..6b4ca90 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageClueController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageClueController.java @@ -6,27 +6,26 @@ import com.cpop.oam.business.bo.ClueFollowUpBo; import com.cpop.oam.business.bo.CluePutOffBo; import com.cpop.oam.business.bo.ClueUpdateBo; import com.cpop.oam.business.service.ClueRecordService; +import com.cpop.oam.business.service.ClueService; import com.cpop.oam.business.service.StaffService; import com.cpop.oam.business.vo.*; import com.cpop.system.business.entity.DictData; import com.cpop.system.business.service.DictDataService; import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.query.QueryWrapper; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +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 com.cpop.oam.business.service.ClueService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; import java.util.*; import java.util.stream.Collectors; -import static com.cpop.core.base.table.table.SysUserTableDef.SYS_USER; +import static com.cpop.core.base.table.table.UserTableDef.USER; import static com.cpop.oam.business.entity.table.ClueRecordTableDef.CLUE_RECORD; import static com.cpop.oam.business.entity.table.StaffTableDef.STAFF; -import static com.mybatisflex.core.query.QueryMethods.distinct; /** * 线索表 控制层。 @@ -35,7 +34,7 @@ import static com.mybatisflex.core.query.QueryMethods.distinct; * @since 2024-02-19 */ @RestController -@Api(tags = "线索接口") +@Tag(name = "线索接口") @RequestMapping("/backstage/clue") public class BackstageClueController { @@ -51,16 +50,16 @@ public class BackstageClueController { * @since 2024/2/19 * @return R> */ - @ApiOperation("个人线索分页") + @Operation(summary = "个人线索分页") @GetMapping("/getPersonCluePage") - public R> getPersonCluePage(@ApiParam(value = "线索状态") @RequestParam(value = "clueStatus", required = false) Integer clueStatus, - @ApiParam(value = "地区") @RequestParam(value = "city", required = false) String city, - @ApiParam(value = "品牌") @RequestParam(value = "brandId", required = false) String brandId, - @ApiParam(value = "校区") @RequestParam(value = "storeId", required = false) String storeId, - @ApiParam(value = "负责人或手机号") @RequestParam(value = "chargeOrPhone", required = false) String chargeOrPhone, - @ApiParam(value = "员工id") @RequestParam(value = "staffId", required = false) String staffId, - @ApiParam(value = "签约月份") @RequestParam(value = "signMonth", required = false) String signMonth, - @ApiParam(value = "更进状态") @RequestParam(value = "followStatus", required = false) Integer followStatus) { + public R> getPersonCluePage(@Parameter(description = "线索状态") @RequestParam(value = "clueStatus", required = false) Integer clueStatus, + @Parameter(description = "地区") @RequestParam(value = "city", required = false) String city, + @Parameter(description = "品牌") @RequestParam(value = "brandId", required = false) String brandId, + @Parameter(description = "校区") @RequestParam(value = "storeId", required = false) String storeId, + @Parameter(description = "负责人或手机号") @RequestParam(value = "chargeOrPhone", required = false) String chargeOrPhone, + @Parameter(description = "员工id") @RequestParam(value = "staffId", required = false) String staffId, + @Parameter(description = "签约月份") @RequestParam(value = "signMonth", required = false) String signMonth, + @Parameter(description = "更进状态") @RequestParam(value = "followStatus", required = false) Integer followStatus) { Page pageVo = clueService.getPersonCluePage(clueStatus, city, brandId, storeId, chargeOrPhone, staffId, signMonth,followStatus); return R.ok(pageVo); } @@ -72,10 +71,10 @@ public class BackstageClueController { * @param signMonth 签约月份 * @return R */ - @ApiOperation("获取个人签约目标") + @Operation(summary = "获取个人签约目标") @GetMapping("/getPersonSignGoal") - public R getPersonSignGoal(@ApiParam(value = "签约月份") @RequestParam(value = "signMonth", required = false) String signMonth, - @ApiParam(value = "员工id") @RequestParam(value = "staffId", required = false) String staffId) { + public R getPersonSignGoal(@Parameter(description = "签约月份") @RequestParam(value = "signMonth", required = false) String signMonth, + @Parameter(description = "员工id") @RequestParam(value = "staffId", required = false) String staffId) { PersonSignGoalVo vo = clueService.getPersonSignGoal(signMonth, staffId); return R.ok(vo); } @@ -87,7 +86,7 @@ public class BackstageClueController { * @param bo 请求对象 * @return R */ - @ApiOperation("线索跟进") + @Operation(summary = "线索跟进") @PostMapping("/clueFollowUp") public R clueFollowUp(@Validated @RequestBody ClueFollowUpBo bo) { clueService.clueFollowUp(bo); @@ -101,9 +100,9 @@ public class BackstageClueController { * @param clueId 线索id * @return R> */ - @ApiOperation("线索跟进记录") + @Operation(summary = "线索跟进记录") @GetMapping("/getClueFollowUpRecord") - public R> getClueFollowUpRecord(@ApiParam(value = "线索id") @RequestParam(value = "clueId") String clueId) { + public R> getClueFollowUpRecord(@Parameter(description = "线索id") @RequestParam(value = "clueId") String clueId) { List vos = clueRecordService.listAs(QueryWrapper.create() .select(CLUE_RECORD.CREATE_TIME, CLUE_RECORD.RECORD_CONTENT, CLUE_RECORD.RECORD_FILE_URL) .select(STAFF.NAME.as(ClueFollowUpRecordVo::getStaffName)) @@ -122,9 +121,9 @@ public class BackstageClueController { * @param clueId 线索id * @return R> */ - @ApiOperation("线索记录") + @Operation(summary = "线索记录") @GetMapping("/getClueRecordList") - public R> getClueRecordList(@ApiParam(value = "线索id") @RequestParam(value = "clueId") String clueId) { + public R> getClueRecordList(@Parameter(description = "线索id") @RequestParam(value = "clueId") String clueId) { List vos = clueRecordService.listAs(QueryWrapper.create() .select(CLUE_RECORD.CREATE_TIME, CLUE_RECORD.RECORD_CONTENT,CLUE_RECORD.RECORD_TYPE) .and(CLUE_RECORD.CLUE_ID.eq(clueId)) @@ -140,7 +139,7 @@ public class BackstageClueController { * @param bo 请求对象 * @return R */ - @ApiOperation("线索更新") + @Operation(summary = "线索更新") @PostMapping("/clueUpdate") public R clueUpdate(@Validated @RequestBody ClueUpdateBo bo) { clueService.clueUpdate(bo); @@ -154,9 +153,9 @@ public class BackstageClueController { * @param clueId 线索id * @return R> */ - @ApiOperation("线索更新记录") + @Operation(summary = "线索更新记录") @GetMapping("/getClueUpdateRecord") - public R getClueUpdateRecord(@ApiParam(value = "线索id") @RequestParam(value = "clueId") String clueId) { + public R getClueUpdateRecord(@Parameter(description = "线索id") @RequestParam(value = "clueId") String clueId) { ClueUpdateVo vo = clueService.getClueUpdateRecord(clueId); return R.ok(vo); } @@ -168,7 +167,7 @@ public class BackstageClueController { * @param bo 请求对象 * @return R */ - @ApiOperation("线索延期") + @Operation(summary = "线索延期") @PostMapping("/cluePutOff") public R cluePutOff(@Validated @RequestBody CluePutOffBo bo) { clueService.cluePutOff(bo); @@ -182,9 +181,9 @@ public class BackstageClueController { * @param clueId 线索id * @return R> */ - @ApiOperation("线索延期记录") + @Operation(summary = "线索延期记录") @GetMapping("/getCluePutOffRecord") - public R> getCluePutOffRecord(@ApiParam(value = "线索id") @RequestParam(value = "clueId") String clueId) { + public R> getCluePutOffRecord(@Parameter(description = "线索id") @RequestParam(value = "clueId") String clueId) { List vos = clueService.getCluePutOffRecord(clueId); return R.ok(vos); } @@ -196,9 +195,9 @@ public class BackstageClueController { * @param id 线索id * @return R */ - @ApiOperation("线索脱离") + @Operation(summary = "线索脱离") @PutMapping("/clueDetachment/{id}") - public R clueDetachment(@PathVariable @ApiParam(value = "线索id") String id) { + public R clueDetachment(@PathVariable @Parameter(description = "线索id") String id) { clueService.clueDetachment(id); return R.ok(); } @@ -209,12 +208,12 @@ public class BackstageClueController { * @since 2024/2/19 * @return R> */ - @ApiOperation("地区线索分页") + @Operation(summary = "地区线索分页") @GetMapping("/getAreaCluePage") - public R> getAreaCluePage(@ApiParam(value = "地区") @RequestParam(value = "city", required = false) String city, - @ApiParam(value = "品牌") @RequestParam(value = "brandId", required = false) String brandId, - @ApiParam(value = "校区") @RequestParam(value = "storeId", required = false) String storeId, - @ApiParam(value = "负责人或手机号") @RequestParam(value = "chargeOrPhone", required = false) String chargeOrPhone) { + public R> getAreaCluePage(@Parameter(description = "地区") @RequestParam(value = "city", required = false) String city, + @Parameter(description = "品牌") @RequestParam(value = "brandId", required = false) String brandId, + @Parameter(description = "校区") @RequestParam(value = "storeId", required = false) String storeId, + @Parameter(description = "负责人或手机号") @RequestParam(value = "chargeOrPhone", required = false) String chargeOrPhone) { Page pageVo = clueService.getAreaCluePage( city, brandId, storeId, chargeOrPhone); return R.ok(pageVo); } @@ -225,12 +224,12 @@ public class BackstageClueController { * @since 2024/2/19 * @return R> */ - @ApiOperation("公共线索分页") + @Operation(summary = "公共线索分页") @GetMapping("/getPublicCluePage") - public R> getPublicCluePage(@ApiParam(value = "地区") @RequestParam(value = "city", required = false) String city, - @ApiParam(value = "品牌") @RequestParam(value = "brandId", required = false) String brandId, - @ApiParam(value = "校区") @RequestParam(value = "storeId", required = false) String storeId, - @ApiParam(value = "负责人或手机号") @RequestParam(value = "chargeOrPhone", required = false) String chargeOrPhone) { + public R> getPublicCluePage(@Parameter(description = "地区") @RequestParam(value = "city", required = false) String city, + @Parameter(description = "品牌") @RequestParam(value = "brandId", required = false) String brandId, + @Parameter(description = "校区") @RequestParam(value = "storeId", required = false) String storeId, + @Parameter(description = "负责人或手机号") @RequestParam(value = "chargeOrPhone", required = false) String chargeOrPhone) { Page pageVo = clueService.getPublicCluePage( city, brandId, storeId, chargeOrPhone); return R.ok(pageVo); } @@ -242,9 +241,9 @@ public class BackstageClueController { * @param id 线索id * @return R */ - @ApiOperation("线索领取") + @Operation(summary = "线索领取") @PutMapping("/clueCollection/{id}") - public R clueCollection(@PathVariable @ApiParam(value = "线索id") String id) { + public R clueCollection(@PathVariable @Parameter(description = "线索id") String id) { clueService.clueCollection(id); return R.ok(); } @@ -255,12 +254,12 @@ public class BackstageClueController { * @since 2024/2/19 * @return R> */ - @ApiOperation("我的开发分页") + @Operation(summary = "我的开发分页") @GetMapping("/getMyDevCluePage") - public R> getMyDevCluePage(@ApiParam(value = "地区") @RequestParam(value = "city", required = false) String city, - @ApiParam(value = "品牌") @RequestParam(value = "brandId", required = false) String brandId, - @ApiParam(value = "校区") @RequestParam(value = "storeId", required = false) String storeId, - @ApiParam(value = "负责人或手机号") @RequestParam(value = "chargeOrPhone", required = false) String chargeOrPhone) { + public R> getMyDevCluePage(@Parameter(description = "地区") @RequestParam(value = "city", required = false) String city, + @Parameter(description = "品牌") @RequestParam(value = "brandId", required = false) String brandId, + @Parameter(description = "校区") @RequestParam(value = "storeId", required = false) String storeId, + @Parameter(description = "负责人或手机号") @RequestParam(value = "chargeOrPhone", required = false) String chargeOrPhone) { Page pageVo = clueService.getMyDevCluePage( city, brandId, storeId, chargeOrPhone); return R.ok(pageVo); } @@ -271,7 +270,7 @@ public class BackstageClueController { * @since 2024/2/27 * @return R> */ - @ApiOperation("获取区域列表") + @Operation(summary = "获取区域列表") @GetMapping("/getAreaList") public R>> getAreaList() { List dictDataByDictType = SpringUtils.getBean(DictDataService.class).getDictDataByDictType("oam_clue_area") @@ -297,12 +296,12 @@ public class BackstageClueController { * @return R> */ @GetMapping("/getMarketStaff") - @ApiOperation("获取市场部员工") + @Operation(summary = "获取市场部员工") public R> getBusinessStaff() { List list = SpringUtils.getBean(StaffService.class).queryChain() - .leftJoin(SYS_USER).on(SYS_USER.ID.eq(STAFF.USER_ID)) + .leftJoin(USER).on(USER.ID.eq(STAFF.USER_ID)) .where(STAFF.STAFF_TYPE.in(1, 2)) - .and(SYS_USER.STATUS.eq(1)) + .and(USER.STATUS.eq(1)) .listAs(StaffVo.class); return R.ok(list); } 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 2674bcc..f2b7609 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 @@ -13,17 +13,18 @@ import com.cpop.system.business.service.StoreService; import com.cpop.system.business.vo.BrandListVo; import com.cpop.system.business.vo.SysFileVo; import com.mybatisflex.core.paginate.Page; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; -import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; @@ -37,7 +38,7 @@ import static com.cpop.system.business.entity.table.StoreTableDef.STORE; * @since 2023-12-10 */ @RestController -@Api(tags = "数据导入接口") +@Tag(name = "数据导入接口") @RequestMapping("/backstage/dataImport") public class BackstageDataImportController { @@ -58,7 +59,7 @@ public class BackstageDataImportController { * @return R> */ @GetMapping("/getDataImportPage") - @ApiOperation("数据导入分页查询") + @Operation(summary = "数据导入分页查询") public R> getDataImportPage(DataImportPageBo bo) { Page page = dataImportService.getDataImportPage(bo); return R.ok(page); @@ -71,9 +72,9 @@ public class BackstageDataImportController { * @author DB * @since 2023-11-30 17:59:29 */ - @ApiOperation("获取品牌列表") + @Operation(summary = "获取品牌列表") @GetMapping("/getBrandList") - public R> getBrandList(@ApiParam("品牌名") String brandName) { + public R> getBrandList(@Parameter(description = "品牌名") String brandName) { List list = brandService.queryChain().and(BRAND.BRAND_NAME.like(brandName)).listAs(BrandListVo.class); return R.ok(list); } @@ -85,9 +86,9 @@ public class BackstageDataImportController { * @author DB * @since 2023-11-30 18:00:08 */ - @ApiOperation("获取校区/店铺列表") + @Operation(summary = "获取校区/店铺列表") @GetMapping("/getStoreList") - public R> getStoreList(@ApiParam("品牌id") String brandId) { + 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); } @@ -100,7 +101,7 @@ public class BackstageDataImportController { * @return boolean */ @PostMapping("/insertDataImport") - @ApiOperation("新增数据导入") + @Operation(summary = "新增数据导入") public R insertDataImport(@RequestBody @Validated DataImportBo bo) { dataImportService.insertDataImport(bo); return R.ok(); @@ -113,8 +114,8 @@ public class BackstageDataImportController { * @return {@code true} 删除成功,{@code false} 删除失败 */ @DeleteMapping("/removeById/{id}") - @ApiOperation("根据主键删除未导入数据记录") - public R removeById(@PathVariable @ApiParam("数据导入主键") String id) { + @Operation(summary = "根据主键删除未导入数据记录") + public R removeById(@PathVariable @Parameter(description = "数据导入主键") String id) { dataImportService.removeById(id); return R.ok(); } @@ -126,7 +127,7 @@ public class BackstageDataImportController { * @param file 文件 * @return R */ - @ApiOperation("检查上传的文件") + @Operation(summary = "检查上传的文件") @PostMapping("/checkImportData") public R checkImportData(@RequestParam("file") MultipartFile file){ SysFileVo sysFileVo = dataImportService.checkImportData(file); @@ -139,9 +140,9 @@ public class BackstageDataImportController { * @since 2023/12/10 * @return R */ - @ApiOperation("立即导入") + @Operation(summary = "立即导入") @PutMapping("/importNow/{id}") - public R importNow(@PathVariable @ApiParam("数据导入主键") String id) { + public R importNow(@PathVariable @Parameter(description = "数据导入主键") String id) { dataImportService.importNow(id); return R.ok(); } @@ -152,14 +153,14 @@ public class BackstageDataImportController { * @since 2023/12/10 * @param response 响应 */ - @ApiOperation("模板下载") + @Operation(summary = "模板下载") @GetMapping("/download") public void download(HttpServletResponse response) throws IOException { // 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); response.setCharacterEncoding("utf-8"); // 这里URLEncoder.encode可以防止中文乱码 当然和easyExcel没有关系 - String fileName = URLEncoder.encode("数据导入模板", "UTF-8").replaceAll("\\+", "%20"); + String fileName = URLEncoder.encode("数据导入模板", StandardCharsets.UTF_8).replaceAll("\\+", "%20"); response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); EasyExcel.write(response.getOutputStream(), DataImportDto.class).sheet("模板").doWrite(new ArrayList<>()); } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageDeptController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageDeptController.java index 5f1f588..7bf1164 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageDeptController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageDeptController.java @@ -1,14 +1,13 @@ package com.cpop.oam.business.controller.backstage; -import com.cpop.oam.business.service.DeptService; -import com.cpop.oam.business.vo.DeptVo; import com.cpop.core.base.entity.R; import com.cpop.oam.business.bo.DeptBo; import com.cpop.oam.business.bo.DeptListBo; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import com.cpop.oam.business.service.DeptService; +import com.cpop.oam.business.vo.DeptVo; +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.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -21,7 +20,7 @@ import java.util.List; * @since 2023-09-08 */ @RestController -@Api(tags = "系统部门模块") +@Tag(name = "系统部门模块") @RequestMapping("/backstage/dept") public class BackstageDeptController { @@ -29,14 +28,13 @@ public class BackstageDeptController { private DeptService deptService; /** - * @Description: 查询部门树列表 + * 查询部门树列表 * @param bo 请求参数 * @return R> - * @Author DB - * @Date: 2023/5/9 20:45 + * @author DB + * @since 2023/5/9 20:45 */ - @PreAuthorize("@aps.hasPermission('system:dept:list')") - @ApiOperation("查询部门树列表") + @Operation(summary = "查询部门树列表") @GetMapping("/getDeptTreeList") public R> getDeptTreeList(DeptListBo bo) { List list = deptService.getDeptTreeList(bo); @@ -44,14 +42,13 @@ public class BackstageDeptController { } /** - * @Description: 新增部门 + * 新增部门 * @param bo 请求参数 * @return R - * @Author DB - * @Date: 2023/5/9 20:47 + * @author DB + * @since 2023/5/9 20:47 */ - @PreAuthorize("@aps.hasPermission('system:dept:insert')") - @ApiOperation("新增部门") + @Operation(summary = "新增部门") @PostMapping("/insertDept") public R insertDept(@Validated @RequestBody DeptBo bo) { deptService.insertDept(bo); @@ -59,14 +56,13 @@ public class BackstageDeptController { } /** - * @Description: 修改部门 + * 修改部门 * @param bo 请求参数 * @return R - * @Author DB - * @Date: 2023/5/9 20:47 + * @author DB + * @since 2023/5/9 20:47 */ - @PreAuthorize("@aps.hasPermission('system:dept:update')") - @ApiOperation("修改部门") + @Operation(summary = "修改部门") @PutMapping("/updateDept") public R updateDept(@Validated @RequestBody DeptBo bo) { deptService.updateDept(bo); @@ -74,13 +70,12 @@ public class BackstageDeptController { } /** - * @Description: 删除部门 + * 删除部门 * @param id 主键 - * @Author DB - * @Date: 2023/5/9 20:48 + * @author DB + * @since 2023/5/9 20:48 */ - @PreAuthorize("@aps.hasPermission('system:dept:remove')") - @ApiOperation("删除部门") + @Operation(summary = "删除部门") @DeleteMapping("/removeDept/{id}") public R removeDept(@PathVariable String id) { deptService.removeDept(id); diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageDutyController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageDutyController.java index 5870f99..a4643c4 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageDutyController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageDutyController.java @@ -8,16 +8,15 @@ import com.cpop.oam.business.service.StaffService; import com.cpop.oam.business.vo.DutyListVo; import com.cpop.oam.business.vo.StaffVo; import com.mybatisflex.core.query.QueryWrapper; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +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.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import java.util.List; -import static com.cpop.core.base.table.table.SysUserTableDef.SYS_USER; +import static com.cpop.core.base.table.table.UserTableDef.USER; import static com.cpop.oam.business.entity.table.StaffTableDef.STAFF; /** @@ -27,7 +26,7 @@ import static com.cpop.oam.business.entity.table.StaffTableDef.STAFF; * @since 2023-09-14 */ @RestController -@Api(tags = "值班日历模块") +@Tag(name = "值班日历模块") @RequestMapping("/backstage/duty") public class BackstageDutyController { @@ -38,14 +37,13 @@ public class BackstageDutyController { private StaffService staffService; /** - * @Description: 查询值班列表(当月) + * 查询值班列表(当月) * @param bo 请求参数 - * @return: R> - * @Author: DB - * @Date: 2023/5/11 16:39 + * @return R> + * @author DB + * @since 2023/5/11 16:39 **/ - @PreAuthorize("@aps.hasPermission('dutyCalendar:duty:list')") - @ApiOperation("查询值班列表(当月)") + @Operation(summary = "查询值班列表(当月)") @GetMapping("/getDutyList") public R> getDutyList(DutyListBo bo) { List list = dutyService.getDutyList(bo); @@ -53,14 +51,13 @@ public class BackstageDutyController { } /** - * @Description: 新增值班 + * 新增值班 * @param bo 请求参数 - * @return: R - * @Author: DB - * @Date: 2023/5/18 9:50 + * @return R + * @author DB + * @since 2023/5/18 9:50 **/ - @PreAuthorize("@aps.hasPermission('dutyCalendar:duty:management')") - @ApiOperation("新增值班") + @Operation(summary = "新增值班") @PostMapping("/insertDuty") public R insertDuty(@RequestBody @Validated DutyBo bo) { dutyService.insertDuty(bo); @@ -68,14 +65,13 @@ public class BackstageDutyController { } /** - * @descriptions 删除值班信息 + * 删除值班信息 * @author DB - * @date 2023/09/14 18:16 + * @since 2023/09/14 18:16 * @param dutyDate 值班日期 * @return com.pupu.core.base.R */ - @PreAuthorize("@aps.hasPermission('dutyCalendar:duty:management')") - @ApiOperation("删除值班信息") + @Operation(summary = "删除值班信息") @DeleteMapping("/removeDutyByDate/{dutyDate}") public R removeDutyByDate(@PathVariable String dutyDate) { dutyService.removeDutyByDate(dutyDate); @@ -83,12 +79,12 @@ public class BackstageDutyController { } /** - * @Description: 查询服务员工列表 - * @return: R> - * @Author: DB - * @Date: 2023/5/11 17:49 + * 查询服务员工列表 + * @return R> + * @author DB + * @since 2023/5/11 17:49 **/ - @ApiOperation("查询服务员工列表") + @Operation(summary = "查询服务员工列表") @GetMapping("/getServiceStaffList") public R> getServiceStaffList() { List list = staffService.getServiceStaffList(); @@ -96,21 +92,21 @@ public class BackstageDutyController { } /** - * @Description: 查询技术员工列表 - * @return: R> - * @Author: DB - * @Date: 2023/5/11 17:50 + * 查询技术员工列表 + * @return R> + * @author DB + * @since 2023/5/11 17:50 **/ - @ApiOperation("查询技术员工列表") + @Operation(summary = "查询技术员工列表") @GetMapping("/getTechnologyStaffList") public R> getTechnologyStaffList() { List list = staffService.listAs(QueryWrapper.create() .select(STAFF.ID, STAFF.NAME, STAFF.USER_ID, STAFF.STAFF_TYPE) .from(STAFF) - .leftJoin(SYS_USER).on(SYS_USER.ID.eq(STAFF.USER_ID)) + .leftJoin(USER).on(USER.ID.eq(STAFF.USER_ID)) .where(STAFF.STAFF_TYPE.eq(0)) //不查询停用的员工 - .and(SYS_USER.STATUS.eq(true)), + .and(USER.STATUS.eq(true)), StaffVo.class); return R.ok(list); } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageFinanceReimburseController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageFinanceReimburseController.java index 63e5530..29ea9fb 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageFinanceReimburseController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageFinanceReimburseController.java @@ -1,7 +1,7 @@ package com.cpop.oam.business.controller.backstage; -import com.cpop.common.utils.bean.BeanUtils; import com.cpop.core.base.entity.R; +import com.cpop.core.utils.bean.BeanUtils; import com.cpop.oam.business.bo.*; import com.cpop.oam.business.entity.FinanceReimburseType; import com.cpop.oam.business.service.FinanceReimburseService; @@ -10,10 +10,9 @@ import com.cpop.oam.business.service.FinanceReimburseTypeService; import com.cpop.oam.business.vo.*; import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.query.QueryWrapper; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +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.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -29,7 +28,7 @@ import static com.cpop.oam.business.entity.table.FinanceReimburseTableDef.FINANC * @since 2023-09-20 */ @RestController -@Api(tags = "财务报销模块") +@Tag(name = "财务报销模块") @RequestMapping("/backstage/financeReimburse") public class BackstageFinanceReimburseController { @@ -43,14 +42,13 @@ public class BackstageFinanceReimburseController { private FinanceReimburseStageService financeReimburseStageService; /** - * @Description: 财务报销模块-报销分页列表 + * 财务报销模块-报销分页列表 * @param bo 请求参数 - * @return: R> - * @Author: DB - * @Date: 2023/5/30 15:44 + * @return R> + * @author DB + * @since 2023/5/30 15:44 **/ - @PreAuthorize("@aps.hasPermission('financial:application:list')") - @ApiOperation("财务报销模块-报销申请分页列表") + @Operation(summary = "财务报销模块-报销申请分页列表") @GetMapping("/getFinanceReimbursePage") public R> getFinanceReimbursePage(FinanceReimbursePageBo bo) { Page pageVo = financeReimburseService.getFinanceReimbursePage(bo); @@ -58,12 +56,12 @@ public class BackstageFinanceReimburseController { } /** - * @Description: 财务报销模块-报销类型列表 - * @return: R> - * @Author: DB - * @Date: 2023/5/30 15:44 + * 财务报销模块-报销类型列表 + * @return R> + * @author DB + * @since 2023/5/30 15:44 **/ - @ApiOperation("财务报销模块-报销类型列表") + @Operation(summary = "财务报销模块-报销类型列表") @GetMapping("/getFinanceReimburseTypeList") public R> getFinanceReimburseTypeList() { List list = financeReimburseTypeService.listAs(QueryWrapper.create(), FinanceReimburseTypeListVo.class); @@ -71,13 +69,13 @@ public class BackstageFinanceReimburseController { } /** - * @descriptions 新增报销申请 + * 新增报销申请 * @author DB - * @date 2023/09/21 15:55 + * @since 2023/09/21 15:55 * @param bo 请求参数 * @return com.pupu.core.base.R */ - @ApiOperation("新增报销申请") + @Operation(summary = "新增报销申请") @PostMapping("/insertReimburseApplication") public R insertReimburseApplication(@RequestBody @Validated ReimburseApplicationBo bo) { financeReimburseService.insertReimburseApplication(bo); @@ -91,7 +89,7 @@ public class BackstageFinanceReimburseController { * @param bo 请求 * @return R */ - @ApiOperation("修改报销申请") + @Operation(summary = "修改报销申请") @PutMapping("/updateReimburseApplication") public R updateReimburseApplication(@RequestBody @Validated ReimburseApplicationBo bo) { financeReimburseService.updateReimburseApplication(bo); @@ -105,8 +103,7 @@ public class BackstageFinanceReimburseController { * @author DB * @since : 2023/5/30 15:44 **/ - @PreAuthorize("@aps.hasPermission('financial:audit:list')") - @ApiOperation("财务报销模块-报销审核分页列表") + @Operation(summary = "财务报销模块-报销审核分页列表") @GetMapping("/getReimburseAuditPage") public R> getReimburseAuditPage(FinanceReimburseAuditPageBo bo) { Page pageVo = financeReimburseService.getReimburseAuditPage(bo); @@ -114,12 +111,12 @@ public class BackstageFinanceReimburseController { } /** - * @Description: 修改报销状态 + * 修改报销状态 * @param bo 请求参数 - * @Author: DB - * @Date: 2023/5/10 16:01 + * @author DB + * @since 2023/5/10 16:01 **/ - @ApiOperation("修改报销状态") + @Operation(summary = "修改报销状态") @PutMapping("/updateReimburseStatus") public R updateReimburseStatus(@RequestBody @Validated ReimburseStatusBo bo) { financeReimburseService.updateReimburseStatus(bo); @@ -127,13 +124,13 @@ public class BackstageFinanceReimburseController { } /** - * @descriptions 新增报销类型 + * 新增报销类型 * @author DB - * @date 2023/09/21 15:55 + * @since 2023/09/21 15:55 * @param bo 请求参数 * @return com.pupu.core.base.R */ - @ApiOperation("新增报销类型") + @Operation(summary = "新增报销类型") @PostMapping("/insertReimburseType") public R insertReimburseApplication(@RequestBody @Validated ReimburseTypeBo bo) { financeReimburseTypeService.save(BeanUtils.mapToClass(bo, FinanceReimburseType.class)); @@ -141,13 +138,13 @@ public class BackstageFinanceReimburseController { } /** - * @descriptions 修改报销类型 + * 修改报销类型 * @author DB - * @date 2023/09/08 15:20 + * @since 2023/09/08 15:20 * @param bo 请求参数 * @return com.jambox.core.base.R */ - @ApiOperation("修改报销类型") + @Operation(summary = "修改报销类型") @PutMapping("/updateReimburseType") public R updateReimburseType(@RequestBody @Validated ReimburseTypeBo bo) { financeReimburseTypeService.updateById(BeanUtils.mapToClass(bo, FinanceReimburseType.class)); @@ -155,13 +152,13 @@ public class BackstageFinanceReimburseController { } /** - * @descriptions 删除报销类型 + * 删除报销类型 * @author DB - * @date 2023/09/12 16:57 + * @since 2023/09/12 16:57 * @param id 主键 * @return com.jambox.core.base.R */ - @ApiOperation("删除报销类型") + @Operation(summary = "删除报销类型") @DeleteMapping("/removeReimburseTypeById/{id}") public R removeReimburseTypeById(@PathVariable String id) { financeReimburseTypeService.removeById(id); @@ -169,23 +166,23 @@ public class BackstageFinanceReimburseController { } /** - * @Description: 财务报销模块-个人报销统计 - * @return: R> - * @Author: DB - * @Date: 2023/5/30 15:44 + * 财务报销模块-个人报销统计 + * @return R> + * @author DB + * @since 2023/5/30 15:44 **/ - @ApiOperation("财务报销模块-个人报销统计") + @Operation(summary = "财务报销模块-个人报销统计") @GetMapping("/getPersonStatistic") public R getPersonStatistic() { return R.ok(financeReimburseService.getPersonStatistic()); } /** - * @Description: 审核员工申请报销 - * @Author: DB - * @Date: 2023/5/10 16:01 + * 审核员工申请报销 + * @author DB + * @since 2023/5/10 16:01 **/ - @ApiOperation("审核员工申请报销") + @Operation(summary = "审核员工申请报销") @PutMapping("/auditReimburseApplication/{id}") public R auditReimburseApplication(@PathVariable String id) { financeReimburseService.updateChain().set(FINANCE_REIMBURSE.STATUS, 1).where(FINANCE_REIMBURSE.ID.eq(id)).update(); @@ -193,13 +190,13 @@ public class BackstageFinanceReimburseController { } /** - * @descriptions 报销驳回 + * 报销驳回 * @author DB - * @date 2023/09/08 15:20 + * @since 2023/09/08 15:20 * @param bo 请求参数 * @return com.jambox.core.base.R */ - @ApiOperation("报销驳回") + @Operation(summary = "报销驳回") @PutMapping("/reimburseReject") public R reimburseReject(@RequestBody @Validated ReimburseRejectBo bo) { financeReimburseService.updateChain() @@ -211,13 +208,13 @@ public class BackstageFinanceReimburseController { } /** - * @descriptions 报销下款 + * 报销下款 * @author DB - * @date 2023/09/08 15:20 + * @since 2023/09/08 15:20 * @param bo 请求参数 * @return com.jambox.core.base.R */ - @ApiOperation("报销下款") + @Operation(summary = "报销下款") @PutMapping("/reimbursePay") public R reimbursePay(@RequestBody @Validated ReimbursePayBo bo) { financeReimburseService.reimbursePay(bo); @@ -225,13 +222,13 @@ public class BackstageFinanceReimburseController { } /** - * @Description: 财务报销模块-报销分页列表 + * 财务报销模块-报销分页列表 * @param id 报销主键 - * @return: R> - * @Author: DB - * @Date: 2023/5/30 15:44 + * @return R> + * @author DB + * @since 2023/5/30 15:44 **/ - @ApiOperation("财务报销模块-报销详情记录列表") + @Operation(summary = "财务报销模块-报销详情记录列表") @GetMapping("/getReimburseRecordList/{id}") public R> getReimburseRecordList(@PathVariable String id) { List list = financeReimburseStageService.listAs(QueryWrapper.create() diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageOamMallController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageOamMallController.java index e19d4a0..5e3be77 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageOamMallController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageOamMallController.java @@ -4,15 +4,13 @@ import com.cpop.core.base.entity.R; import com.cpop.core.utils.SpringUtils; import com.cpop.oam.business.bo.MallStaffBo; import com.cpop.oam.business.service.OamMallService; -import com.cpop.system.business.vo.BrandListVo; import com.cpop.oam.business.vo.MallStaffPageVo; import com.cpop.system.business.service.BrandService; +import com.cpop.system.business.vo.BrandListVo; import com.mybatisflex.core.paginate.Page; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -20,26 +18,25 @@ import java.util.List; /** * @author DB - * @createTime 2023/11/09 14:40 - * @description + * @since 2023/11/09 14:40 */ @RestController -@Api(tags = "商城管理模块") +@Tag(name = "商城管理模块") @RequestMapping("/backstage/oamMall") +@Deprecated(since = "1.1.0") public class BackstageOamMallController { + @Autowired private OamMallService oamMallService; /** - * @descriptions 查询商城管理员分页列表 + * 查询商城管理员分页列表 * @author DB - * @date 2023/11/09 15:33 + * @since 2023/11/09 15:33 * @param brandIds 品牌id集合 * @param name 姓名 - * @return: com.cpop.core.base.entity.R> + * @return com.cpop.core.base.entity.R> */ - @PreAuthorize("@aps.hasPermission('mall:admin:list')") - @ApiOperation("查询商城管理员分页列表") @GetMapping("/getMallStaffPage") public R> getMallStaffPage(String brandIds, String name) { Page page = oamMallService.getMallStaffPage(brandIds, name); @@ -47,12 +44,11 @@ public class BackstageOamMallController { } /** - * @descriptions 查询品牌列表 + * 查询品牌列表 * @author DB - * @date 2023/11/10 11:45 - * @return: com.cpop.core.base.entity.R> + * @since 2023/11/10 11:45 + * @return com.cpop.core.base.entity.R> */ - @ApiOperation("查询品牌列表") @GetMapping("/getBrandList") public R> getBrandList() { List list = SpringUtils.getBean(BrandService.class).queryChain().listAs(BrandListVo.class); @@ -60,29 +56,27 @@ public class BackstageOamMallController { } /** - * @descriptions 用户名是否存在 + * 用户名是否存在 * @author DB - * @date 2023/11/10 12:03 + * @since 2023/11/10 12:03 * @param username 用户名 * @param id id * @param userType 用户类型 - * @return: com.cpop.core.base.entity.R + * @return com.cpop.core.base.entity.R */ - @ApiOperation("用户名是否存在") @GetMapping("/isAccountExist") - public R isAccountExist(@ApiParam("用户名") String username, @ApiParam("userId") String id, @ApiParam("用户类型") String userType) { - SpringUtils.getBean(CoreService.class).isAccountExist(username, id, userType); + public R isAccountExist(@Parameter(description = "用户名") String username, @Parameter(description = "userId") String id, @Parameter(description = "用户类型") String userType) { + //SpringUtils.getBean(UserService.class).isAccountExist(username, id, userType); return R.ok(); } /** - * @descriptions 新增管理员 + * 新增管理员 * @author DB - * @date 2023/09/08 14:04 + * @since 2023/09/08 14:04 * @param bo 请求参数 * @return com.jambox.core.base.R */ - @ApiOperation("新增管理员") @PostMapping("/insertAdmin") public R insertAdmin(@RequestBody @Validated MallStaffBo bo) { oamMallService.insertAdmin(bo); @@ -90,13 +84,12 @@ public class BackstageOamMallController { } /** - * @descriptions 删除管理员 + * 删除管理员 * @author DB - * @date 2023/11/10 14:33 + * @since 2023/11/10 14:33 * @param id 主键 - * @return: com.cpop.core.base.entity.R + * @return com.cpop.core.base.entity.R */ - @ApiOperation("删除管理员") @DeleteMapping("/removeAdmin/{id}") public R removeAdmin(@PathVariable String id) { oamMallService.removeAdmin(id); diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstagePutOffController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstagePutOffController.java index 32aa97e..469a3e5 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstagePutOffController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstagePutOffController.java @@ -5,9 +5,8 @@ import com.cpop.oam.business.bo.PutOffAuditBo; import com.cpop.oam.business.service.CluePutOffService; import com.cpop.oam.business.vo.PutOffAuditPageVo; import com.mybatisflex.core.paginate.Page; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; +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.*; @@ -17,7 +16,7 @@ import org.springframework.web.bind.annotation.*; * @version 1.0.0 * @since 2024-02-21 13:40 */ -@Api(tags = "延期审核接口") +@Tag(name = "延期审核接口") @RestController @RequestMapping("/backstage/putOff") public class BackstagePutOffController { @@ -31,7 +30,7 @@ public class BackstagePutOffController { * @since 2024/2/19 * @return R> */ - @ApiOperation("延期审核分页") + @Operation(summary = "延期审核分页") @GetMapping("/getPutOffAuditPage") public R> getPutOffAuditPage() { Page pageVo = cluePutOffService.getPutOffAuditPage(); @@ -45,7 +44,7 @@ public class BackstagePutOffController { * @param bo 通过与驳回 * @return R */ - @ApiOperation("延期审核选择") + @Operation(summary = "延期审核选择") @PutMapping("/putOffAuditSelect") public R putOffAuditSelect(@RequestBody @Validated PutOffAuditBo bo) { cluePutOffService.putOffAuditSelect(bo); diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageSignGoalController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageSignGoalController.java index 48a6bcd..150c033 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageSignGoalController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageSignGoalController.java @@ -1,15 +1,18 @@ package com.cpop.oam.business.controller.backstage; -import com.cpop.common.utils.StringUtils; -import com.cpop.common.utils.bean.BeanUtils; import com.cpop.core.base.entity.R; import com.cpop.core.base.exception.ServiceException; -import com.cpop.core.base.table.SysConfig; +import com.cpop.core.base.table.Config; +import com.cpop.core.service.ConfigService; import com.cpop.core.service.RedisService; import com.cpop.core.utils.SpringUtils; -import com.cpop.oam.business.bo.*; +import com.cpop.core.utils.StringUtils; +import com.cpop.core.utils.bean.BeanUtils; +import com.cpop.oam.business.bo.SignGoalBo; +import com.cpop.oam.business.bo.SignGoalConfigInfoBo; import com.cpop.oam.business.service.CommonService; import com.cpop.oam.business.service.SignAreaService; +import com.cpop.oam.business.service.SignGoalService; import com.cpop.oam.business.vo.SignGoalConfigInfoVo; import com.cpop.oam.business.vo.SignGoalPageVo; import com.cpop.oam.framework.constant.OamConfigKey; @@ -17,27 +20,18 @@ import com.cpop.oam.framework.enums.OamConfigEnum; import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.core.row.DbChain; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; -import com.cpop.oam.business.service.SignGoalService; -import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; import java.lang.reflect.Field; import java.util.Arrays; import java.util.HashMap; import java.util.Map; -import static com.cpop.core.base.table.table.SysConfigTableDef.SYS_CONFIG; +import static com.cpop.core.base.table.table.ConfigTableDef.CONFIG; import static com.cpop.oam.business.entity.table.SignAreaTableDef.SIGN_AREA; /** @@ -47,7 +41,7 @@ import static com.cpop.oam.business.entity.table.SignAreaTableDef.SIGN_AREA; * @since 2024-02-19 */ @RestController -@Api(tags = "签约目标接口") +@Tag(name = "签约目标接口") @RequestMapping("/backstage/signGoal") public class BackstageSignGoalController { @@ -60,7 +54,7 @@ public class BackstageSignGoalController { * @since 2024/2/19 * @return R> */ - @ApiOperation("签约指标分页") + @Operation(summary = "签约指标分页") @GetMapping("/getSignGoalPage") public R> getSignGoalPage() { Page pageVo = signGoalService.getSignGoalPage(); @@ -74,10 +68,10 @@ public class BackstageSignGoalController { * @param bo 请求参数 * @return R */ - @ApiOperation("设置签约间隔配置信息") + @Operation(summary = "设置签约间隔配置信息") @PutMapping("/setSignConfigInfo") public R setSignConfigInfo(@RequestBody @Validated SignGoalConfigInfoBo bo) { - CoreService coreService = SpringUtils.getBean(CoreService.class); + ConfigService configService = SpringUtils.getBean(ConfigService.class); CommonService commonService = SpringUtils.getBean(CommonService.class); // 遍历属性名与值 try { @@ -86,17 +80,15 @@ public class BackstageSignGoalController { // 获取枚举 OamConfigEnum sysConfigEnum = OamConfigEnum.matchField(field.getName()); if (null != sysConfigEnum) { - SysConfig sysConfig = new SysConfig(); + Config sysConfig = new Config(); sysConfig.setConfigName(sysConfigEnum.getName()) .setConfigKey(sysConfigEnum.getKey()) .setConfigValue(field.get(bo).toString()); // 修改 - if (DbChain.table(SYS_CONFIG) - .where(SYS_CONFIG.CONFIG_KEY.eq(sysConfig.getConfigKey())) - .count() > 0) { - coreService.updateConfig(sysConfig); + if (DbChain.table(CONFIG).where(CONFIG.CONFIG_KEY.eq(sysConfig.getConfigKey())).count() > 0) { + configService.updateById(sysConfig); } else { - coreService.insertConfig(sysConfig); + configService.save(sysConfig); } // 更新缓存 SpringUtils.getBean(RedisService.class).setCacheObject(commonService.getCacheKey(sysConfigEnum.getKey()), sysConfig.getConfigValue()); @@ -114,11 +106,11 @@ public class BackstageSignGoalController { * @since 2024/2/19 * @return R */ - @ApiOperation("获取签约间隔配置信息") + @Operation(summary = "获取签约间隔配置信息") @GetMapping("/getSignConfigInfo") public R getSignConfigInfo() { RedisService redisService = SpringUtils.getBean(RedisService.class); - CoreService coreService = SpringUtils.getBean(CoreService.class); + ConfigService configService = SpringUtils.getBean(ConfigService.class); CommonService commonService = SpringUtils.getBean(CommonService.class); Map configMap = new HashMap<>(8); Arrays.asList(OamConfigKey.SIGN_GOAL).forEach(item -> { @@ -129,11 +121,11 @@ public class BackstageSignGoalController { configMap.put(sysConfigEnum.getField(), cacheInfo); } else { // 查询系统 - SysConfig sysConfig = coreService.selectConfigByKey(item); - if (null != sysConfig) { + Config config = configService.getById(item); + if (null != config) { // 获取枚举 OamConfigEnum sysConfigEnum = OamConfigEnum.matchKey(item); - configMap.put(sysConfigEnum.getField(), sysConfig.getConfigValue()); + configMap.put(sysConfigEnum.getField(), config.getConfigValue()); } } }); @@ -149,7 +141,7 @@ public class BackstageSignGoalController { * @param bo 请求参数 * @return R */ - @ApiOperation("新增签约指标") + @Operation(summary = "新增签约指标") @PostMapping("/insertSignGoal") public R insertSignGoal(@RequestBody @Validated SignGoalBo bo) { signGoalService.insertSignGoal(bo); @@ -163,7 +155,7 @@ public class BackstageSignGoalController { * @param bo 请求参数 * @return R */ - @ApiOperation("修改签约指标") + @Operation(summary = "修改签约指标") @PutMapping("/updateSignGoal") public R updateSignGoal(@RequestBody @Validated SignGoalBo bo) { signGoalService.updateSignGoal(bo); @@ -177,7 +169,7 @@ public class BackstageSignGoalController { * @param id 主键 * @return R */ - @ApiOperation("删除签约指标") + @Operation(summary = "删除签约指标") @DeleteMapping("/removeSignGoal/{id}") public R removeSignGoal(@PathVariable String id) { signGoalService.removeById(id); diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageStaffController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageStaffController.java index 540d358..fb89844 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageStaffController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageStaffController.java @@ -1,10 +1,6 @@ package com.cpop.oam.business.controller.backstage; -import com.cpop.system.framework.enums.InitRoleEnum; -import com.cpop.system.business.service.RoleService; -import com.mybatisflex.core.paginate.Page; -import com.mybatisflex.core.query.QueryWrapper; -import com.cpop.common.constant.Constants; +import cn.dev33.satoken.stp.StpUtil; import com.cpop.core.anno.OperationLog; import com.cpop.core.base.entity.R; import com.cpop.core.base.enums.OperationLogEnum; @@ -13,10 +9,13 @@ import com.cpop.oam.business.bo.*; import com.cpop.oam.business.service.DeptService; import com.cpop.oam.business.service.StaffService; import com.cpop.oam.business.vo.*; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import com.cpop.system.business.service.RoleService; +import com.cpop.system.framework.enums.InitRoleEnum; +import com.mybatisflex.core.paginate.Page; +import com.mybatisflex.core.query.QueryWrapper; +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.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -32,7 +31,7 @@ import static com.cpop.system.business.entity.table.RoleTableDef.ROLE; * @since 2023-09-07 */ @RestController -@Api(tags = "员工账号管理模块") +@Tag(name = "员工账号管理模块") @RequestMapping("/backstage/staff") public class BackstageStaffController { @@ -43,14 +42,13 @@ public class BackstageStaffController { private DeptService deptService; /** - * @descriptions 查询员工分页列表 + * 查询员工分页列表 * @author DB - * @date 2023/09/07 18:07 + * @since 2023/09/07 18:07 * @param bo 请求参数 * @return R> */ - @PreAuthorize("@aps.hasPermission('system:account:list')") - @ApiOperation("查询员工分页列表") + @Operation(summary = "查询员工分页列表") @GetMapping("/getStaffPageList") public R> getStaffPageList(StaffPageBo bo) { Page pageVo = staffService.getStaffPageList(bo); @@ -58,15 +56,14 @@ public class BackstageStaffController { } /** - * @descriptions 新增员工 + * 新增员工 * @author DB - * @date 2023/09/08 14:04 + * @since 2023/09/08 14:04 * @param bo 请求参数 * @return com.jambox.core.base.R */ - @PreAuthorize("@aps.hasPermission('system:account:insert')") @OperationLog(operationLogEnumType= OperationLogEnum.INSERT_OAM_STAFF) - @ApiOperation("新增员工") + @Operation(summary = "新增员工") @PostMapping("/insertStaff") public R insertStaff(@RequestBody @Validated StaffBo bo) { staffService.insertStaff(bo); @@ -74,15 +71,14 @@ public class BackstageStaffController { } /** - * @descriptions 修改员工 + * 修改员工 * @author DB - * @date 2023/09/08 15:20 + * @since 2023/09/08 15:20 * @param bo 请求参数 * @return com.jambox.core.base.R */ - @PreAuthorize("@aps.hasPermission('system:account:update')") @OperationLog(operationLogEnumType= OperationLogEnum.UPDATE_OAM_STAFF) - @ApiOperation("修改员工") + @Operation(summary = "修改员工") @PutMapping("/updateStaff") public R updateStaff(@RequestBody @Validated StaffBo bo) { staffService.updateStaff(bo); @@ -90,15 +86,14 @@ public class BackstageStaffController { } /** - * @descriptions 删除员工 + * 删除员工 * @author DB - * @date 2023/09/12 16:57 + * @since 2023/09/12 16:57 * @param id 主键 * @return com.jambox.core.base.R */ - @PreAuthorize("@aps.hasPermission('system:account:remove')") @OperationLog(operationLogEnumType= OperationLogEnum.REMOVE_OAM_STAFF) - @ApiOperation("删除员工") + @Operation(summary = "删除员工") @DeleteMapping("/removeStaffById/{id}") public R removeStaffById(@PathVariable String id) { staffService.removeStaffById(id); @@ -106,13 +101,13 @@ public class BackstageStaffController { } /** - * @descriptions 查询部门树列表 + * 查询部门树列表 * @author DB - * @date 2023/09/08 18:19 + * @since 2023/09/08 18:19 * @param bo 请求参数 * @return com.jambox.core.base.R> */ - @ApiOperation("查询部门树列表") + @Operation(summary = "查询部门树列表") @GetMapping("/getDeptTreeList") public R> getDeptTreeList(DeptListBo bo) { List list = deptService.getDeptTreeList(bo); @@ -121,28 +116,27 @@ public class BackstageStaffController { /** * 获取所有角色信息 */ - @ApiOperation("获取所有角色信息") + @Operation(summary = "获取所有角色信息") @GetMapping("/getAllRoleList") public R> getAllSysRoleList() { - LoginUser loginUser = SecurityUtils.getInstance().getLoginUser(); List list = SpringUtils.getBean(RoleService.class).listAs(QueryWrapper.create() .where(ROLE.STATUS.eq(true)) .and(ROLE.ID.ne(InitRoleEnum.SUPER_OAM_ROLE.getId())) - .and(ROLE.USER_TYPE.eq(loginUser.getUserType())) + .and(ROLE.USER_TYPE.eq(StpUtil.getSession().get("userType"))) .orderBy(ROLE.ORDER_NO.asc()) , RoleVo.class); return R.ok(list); } /** - * @Description: 用户名是否存在 + * 用户名是否存在 * @param username 用户名 * @param id 主键 - * @return: R - * @Author: DB - * @Date: 2023/5/11 10:09 + * @return R + * @author DB + * @since 2023/5/11 10:09 **/ - @ApiOperation("用户名是否存在") + @Operation(summary = "用户名是否存在") @GetMapping("/isAccountExist") public R isAccountExist(String username, String id) { staffService.isAccountExist(username, id); @@ -150,14 +144,13 @@ public class BackstageStaffController { } /** - * @Description: 获取员工信息 - * @param id - * @return: R - * @Author: DB - * @Date: 2023/5/17 10:33 + * 获取员工信息 + * @param id 主键 + * @return R + * @author DB + * @since 2023/5/17 10:33 **/ - @PreAuthorize("@aps.hasPermission('system:account:info')") - @ApiOperation("获取员工信息") + @Operation(summary = "获取员工信息") @GetMapping("/getStaffInfo/{id}") public R getStaffInfo(@PathVariable String id) { StaffInfoVo staffInfo = staffService.getStaffInfo(id); @@ -165,30 +158,28 @@ public class BackstageStaffController { } /** - * @Description: 获取用户操作日志分页 + * 获取用户操作日志分页 * @param bo 请求参数 - * @return: R> - * @Author: DB - * @Date: 2023/5/12 14:30 + * @return R> + * @author DB + * @since 2023/5/12 14:30 **/ - @PreAuthorize("@aps.hasPermission('system:account:list')") - @ApiOperation("获取用户操作日志分页") + @Operation(summary = "获取用户操作日志分页") @GetMapping("/getUserLogList") - public R> getUserLogList(@Validated SysUserLogBo bo) { - Page list = staffService.getUserLogList(bo); + public R> getUserLogList(@Validated UserLogBo bo) { + Page list = staffService.getUserLogList(bo); return R.ok(list); } /** - * @Description: 修改系统用户密码 + * 修改系统用户密码 * @param bo 请求参数 - * @return: AjaxResult - * @Author: DB - * @Date: 2023/5/12 16:00 + * @return AjaxResult + * @author DB + * @since 2023/5/12 16:00 **/ - @PreAuthorize("@aps.hasPermission('system:account:update')") @OperationLog(operationLogEnumType= OperationLogEnum.MODIFY_OAM_STAFF_PASSWORD) - @ApiOperation("修改系统用户密码") + @Operation(summary = "修改系统用户密码") @PutMapping("/modifyUserPassword") public R modifyUserPassword(@Validated @RequestBody ModifyUserPasswordBo bo) { staffService.modifyUserPassword(bo); @@ -202,7 +193,7 @@ public class BackstageStaffController { * @param bo 请求参数 * @return R */ - @ApiOperation("修改运维状态") + @Operation(summary = "修改运维状态") @PutMapping("/changeOperationStatus") public R changeOperationStatus(@Validated @RequestBody OperationStatusBo bo) { staffService.changeOperationStatus(bo); diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageStorePlugController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageStorePlugController.java index 5f3854c..43cf81b 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageStorePlugController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageStorePlugController.java @@ -1,7 +1,7 @@ package com.cpop.oam.business.controller.backstage; -import com.cpop.common.utils.bean.BeanUtils; import com.cpop.core.base.entity.R; +import com.cpop.core.utils.bean.BeanUtils; import com.cpop.jambox.business.bo.PlugBo; import com.cpop.jambox.business.entity.StorePlug; import com.cpop.jambox.business.service.PlugService; @@ -12,9 +12,9 @@ import com.cpop.jambox.business.vo.StorePlugListVo; import com.cpop.oam.business.bo.ChangePlugOpenBo; import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.query.QueryWrapper; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +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.*; @@ -31,8 +31,9 @@ import static com.cpop.jambox.business.entity.table.StorePlugTableDef.STORE_PLUG * @since 2023-12-29 */ @RestController -@Api(tags = "校区-插件记录表接口") +@Tag(name = "校区-插件记录表接口") @RequestMapping("/backstage/storePlug") +@Deprecated(since = "1.1.0") public class BackstageStorePlugController { @Autowired @@ -48,7 +49,7 @@ public class BackstageStorePlugController { * @return R> */ @GetMapping("/getPlugPage") - @ApiOperation("查询插件分页") + @Operation(summary = "查询插件分页") public R> getPlugPage() { Page page = plugService.getPlugPage(); return R.ok(page); @@ -62,7 +63,7 @@ public class BackstageStorePlugController { * @return R */ @GetMapping("/getPlugById/{id}") - @ApiOperation("查询插件详情") + @Operation(summary = "查询插件详情") public R getPlugById(@PathVariable String id) { PlugVo vo = plugService.getOneAs(QueryWrapper.create().where(PLUG.ID.eq(id)), PlugVo.class); return R.ok(vo); @@ -75,7 +76,7 @@ public class BackstageStorePlugController { * @param bo 请求参数 * @return R */ - @ApiOperation("新增插件") + @Operation(summary = "新增插件") @PostMapping("/insertPlug") public R insertPlug(@RequestBody @Validated PlugBo bo) { plugService.insertPlug(bo); @@ -89,7 +90,7 @@ public class BackstageStorePlugController { * @param bo 请求参数 * @return R */ - @ApiOperation("修改插件") + @Operation(summary = "修改插件") @PutMapping("/updatePlug") public R updateStaff(@RequestBody @Validated PlugBo bo) { plugService.updatePlug(bo); @@ -103,7 +104,7 @@ public class BackstageStorePlugController { * @param id 主键 * @return R */ - @ApiOperation("删除插件") + @Operation(summary = "删除插件") @DeleteMapping("/removePlugById/{id}") public R removeStaffById(@PathVariable String id) { plugService.removeById(id); @@ -117,8 +118,8 @@ public class BackstageStorePlugController { * @param storeId storeId */ @GetMapping("/getStorePlugList") - @ApiOperation("查询校区插件列表") - public R> getStorePlugList(@ApiParam("品牌id") String brandId, @ApiParam("校区id") String storeId) { + @Operation(summary = "查询校区插件列表") + public R> getStorePlugList(@Parameter(description = "品牌id") String brandId, @Parameter(description = "校区id") String storeId) { List list = storePlugService.getStorePlugList(brandId, storeId); return R.ok(list); } @@ -127,7 +128,7 @@ public class BackstageStorePlugController { * 插件开启与关闭 */ @PutMapping("/changePlugOpen") - @ApiOperation("插件开启与关闭") + @Operation(summary = "插件开启与关闭") public R changePlugOpen(@RequestBody @Validated ChangePlugOpenBo bo) { StorePlug storePlug = BeanUtils.mapToClass(bo, StorePlug.class); if (bo.getIsOpen()){ diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageSysConfigController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageSysConfigController.java index 577a101..1e4624a 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageSysConfigController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageSysConfigController.java @@ -6,10 +6,9 @@ import com.cpop.core.base.enums.OperationLogEnum; import com.cpop.oam.business.bo.SysConfigInfoBo; import com.cpop.oam.business.service.CommonService; import com.cpop.oam.business.vo.ConfigInfoVo; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +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.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -18,7 +17,7 @@ import org.springframework.web.bind.annotation.*; * @createTime 2023/09/13 12:00 * @description */ -@Api(tags = "系统配置模块") +@Tag(name = "系统配置模块") @RestController @RequestMapping("/backstage/sysConfig") public class BackstageSysConfigController { @@ -32,8 +31,7 @@ public class BackstageSysConfigController { * @author DB * @Date: 2023/7/7 0007 16:27 */ - @PreAuthorize("@aps.hasPermission('system:config:list')") - @ApiOperation("获取系统配置信息") + @Operation(summary = "获取系统配置信息") @GetMapping("/getSysConfigInfo") public R getSysConfigInfo() { ConfigInfoVo vo = commonService.getSysConfigInfo(); @@ -42,13 +40,12 @@ public class BackstageSysConfigController { /** * @param bo 请求参数 - * @Description: 设置系统配置信息 - * @return: R - * @Author: DB - * @Date: 2023/5/11 15:48 + * 设置系统配置信息 + * @author DB + * @since 2023/5/11 15:48 **/ @OperationLog(operationLogEnumType = OperationLogEnum.UPDATE_OAM_CONFIG) - @ApiOperation("设置系统配置信息") + @Operation(summary = "设置系统配置信息") @PutMapping("/setSysConfigInfo") public R setSysConfigInfo(@RequestBody @Validated SysConfigInfoBo bo) { commonService.setSysConfigInfo(bo); 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 b3d214d..293cbe7 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 @@ -5,18 +5,17 @@ import com.cpop.oam.business.bo.TaskDemandBo; import com.cpop.oam.business.bo.TaskDemandPageBo; import com.cpop.oam.business.bo.TaskDemandUrgentBo; import com.cpop.oam.business.service.TaskDemandService; -import com.cpop.oam.business.vo.TaskDemandUrgentVo; -import com.cpop.system.business.vo.BrandListVo; 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.mybatisflex.core.paginate.Page; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -32,7 +31,7 @@ import static com.cpop.system.business.entity.table.StoreTableDef.STORE; * @since 2023-09-18 */ @RestController -@Api(tags = "工单模块-需求") +@Tag(name = "工单模块-需求") @RequestMapping("/backstage/taskDemand") public class BackstageTaskDemandController { @@ -51,8 +50,7 @@ public class BackstageTaskDemandController { * @param bo 查询参数 * @since 2023-11-30 17:26:24 */ - @PreAuthorize("@aps.hasPermission('oamTask:taskDemand:list')") - @ApiOperation("工单模块-需求-需求分页列表") + @Operation(summary = "工单模块-需求-需求分页列表") @GetMapping("/getTaskDemandPage") public R> getTaskDemandPage(TaskDemandPageBo bo) { Page pageVo = taskDemandService.getTaskDemandPage(bo); @@ -65,10 +63,9 @@ public class BackstageTaskDemandController { * @param bo 请求参数 * @since 2023-11-30 17:27:24 */ - @ApiOperation("工单模块-需求-新增需求") + @Operation(summary = "工单模块-需求-新增需求") @PostMapping("/insertDemandTask") - public R insertDemandTask(@RequestBody @Validated - TaskDemandBo bo) { + public R insertDemandTask(@RequestBody @Validated TaskDemandBo bo) { taskDemandService.insertTaskDemand(bo); return R.ok(); } @@ -79,10 +76,9 @@ public class BackstageTaskDemandController { * @param bo 请求参数 * @since 2023-11-30 18:26:42 */ - @ApiOperation("工单模块-需求-修改需求") + @Operation(summary = "工单模块-需求-修改需求") @PutMapping("/updateDemandTask") - public R updateDemandTask(@RequestBody @Validated - TaskDemandBo bo) { + public R updateDemandTask(@RequestBody @Validated TaskDemandBo bo) { taskDemandService.updateDemandTask(bo); return R.ok(); } @@ -93,10 +89,9 @@ public class BackstageTaskDemandController { * @param demandId 需求id * @since 2023-11-30 20:30:54 */ - @ApiOperation("工单模块-需求-删除需求") + @Operation(summary = "工单模块-需求-删除需求") @DeleteMapping("/removeDemandTask/{demandId}") - public R removeDemandTask(@PathVariable @ApiParam(value = "需求id") - String demandId) { + public R removeDemandTask(@PathVariable @Parameter(description = "需求id") String demandId) { taskDemandService.removeDemandTask(demandId); return R.ok(); } @@ -107,12 +102,10 @@ public class BackstageTaskDemandController { * @param brandName 品牌名 * @since 2023-11-30 17:59:29 */ - @ApiOperation("工单模块-工单提交-获取品牌列表") + @Operation(summary = "工单模块-工单提交-获取品牌列表") @GetMapping("/getBrandList") - public R> getBrandList(@ApiParam("品牌名") - String brandName) { - List list = - brandService.queryChain().and(BRAND.BRAND_NAME.like(brandName)).listAs(BrandListVo.class); + public R> getBrandList(@Parameter(description = "品牌名") String brandName) { + List list = brandService.queryChain().and(BRAND.BRAND_NAME.like(brandName)).listAs(BrandListVo.class); return R.ok(list); } @@ -122,10 +115,9 @@ public class BackstageTaskDemandController { * @param brandId 品牌id * @since 2023-11-30 18:00:08 */ - @ApiOperation("工单模块-工单提交-获取校区/店铺列表") + @Operation(summary = "工单模块-工单提交-获取校区/店铺列表") @GetMapping("/getStoreList") - public R> getStoreList(@ApiParam("品牌id") - String brandId) { + 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); } @@ -137,7 +129,7 @@ public class BackstageTaskDemandController { * @param bo 请求参数 * @return R */ - @ApiOperation("工单模块-需求-需求加急") + @Operation(summary = "工单模块-需求-需求加急") @PutMapping("/demandUrgent") public R demandUrgent(@RequestBody @Validated TaskDemandUrgentBo bo) { TaskDemandUrgentVo vo = taskDemandService.demandUrgent(bo); diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageTaskTechnologyController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageTaskTechnologyController.java index 8863a68..5c0123c 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageTaskTechnologyController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageTaskTechnologyController.java @@ -8,12 +8,11 @@ import com.cpop.oam.business.service.TaskStaffGroupService; import com.cpop.oam.business.service.TaskWorkOrderService; import com.cpop.oam.business.vo.*; import com.mybatisflex.core.paginate.Page; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.format.annotation.DateTimeFormat; -import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -27,7 +26,7 @@ import java.util.List; * @since 2023-09-15 */ @RestController -@Api(tags = "技术模块-技术") +@Tag(name = "技术模块-技术") @RequestMapping("/backstage/taskTechnology") public class BackstageTaskTechnologyController { @@ -49,8 +48,7 @@ public class BackstageTaskTechnologyController { * @author DB * @since 2023-11-30 19:41:32 */ - @PreAuthorize("@aps.hasPermission('oamTask:technology:list')") - @ApiOperation("技术模块-今日事务-获取个人工单列表") + @Operation(summary = "技术模块-今日事务-获取个人工单列表") @GetMapping("/getPersonWorkOrder") public R> getPersonWorkOrder() { List list = taskWorkOrderService.getPersonWorkOrder(); @@ -64,9 +62,9 @@ public class BackstageTaskTechnologyController { * @author DB * @since 2023-11-29 11:25:28 */ - @ApiOperation("技术模块-今日事务-工单记录列表") + @Operation(summary = "技术模块-今日事务-工单记录列表") @GetMapping("/getWorkOrderRecordList/{workOrderId}") - public R> getWorkOrderRecordList(@PathVariable @ApiParam("工单id") String workOrderId) { + public R> getWorkOrderRecordList(@PathVariable @Parameter(description = ("工单id")) String workOrderId) { List list = taskWorkOrderService.getWorkOrderRecordList(workOrderId); return R.ok(list); } @@ -78,7 +76,7 @@ public class BackstageTaskTechnologyController { * @author DB * @since 2023-11-29 11:33:35 */ - @ApiOperation("技术模块-今日事务-新增工单记录") + @Operation(summary = "技术模块-今日事务-新增工单记录") @PostMapping("/insertWorkOrderRecord") public R insertWorkOrderRecord(@RequestBody @Validated TaskWorkOrderRecordBo bo) { //是否是第一个 @@ -93,8 +91,7 @@ public class BackstageTaskTechnologyController { * @author DB * @since 2023-11-30 21:11:47 */ - @PreAuthorize("@aps.hasPermission('oamTask:technology:list')") - @ApiOperation("技术模块-任务归档-获取任务归档分页") + @Operation(summary = "技术模块-任务归档-获取任务归档分页") @GetMapping("/getTaskArchivingPage") public R> getTaskArchivingPage(TaskArchivingPagBo bo) { Page page = taskService.getTaskArchivingPage(bo); @@ -108,10 +105,9 @@ public class BackstageTaskTechnologyController { * @author DB * @since 2023-11-30 21:49:05 */ - @PreAuthorize("@aps.hasPermission('oamTask:technology:deploy')") - @ApiOperation("技术模块-任务归档-设置任务归档") + @Operation(summary = "技术模块-任务归档-设置任务归档") @PutMapping("/setTaskArchiving/{taskId}") - public R setTaskArchiving(@PathVariable @ApiParam("任务id") String taskId) { + public R setTaskArchiving(@PathVariable @Parameter(description = ("任务id")) String taskId) { taskService.setTaskArchiving(taskId); return R.ok(); } @@ -125,13 +121,11 @@ public class BackstageTaskTechnologyController { * @author DB * @since 2023-11-30 22:21:58 */ - @PreAuthorize("@aps.hasPermission('oamTask:technology:list')") - @ApiOperation("技术模块-任务领取-获取领取任务分页") + @Operation(summary = "技术模块-任务领取-获取领取任务分页") @GetMapping("/getToBeClaimedPage") - public R> getToBeClaimedPage(@ApiParam(value = "主体") - String subject, @ApiParam(value = "任务内容") - String taskContent, @RequestParam("taskGetStatus") @ApiParam(value = "任务领取状态(0:待领取;1:待评估;2:审核不通过)", required = true) - Integer taskGetStatus) { + public R> getToBeClaimedPage(@Parameter(description = "主体") String subject, + @Parameter(description = "任务内容") String taskContent, + @RequestParam("taskGetStatus") @Parameter(description = "任务领取状态(0:待领取;1:待评估;2:审核不通过)", required = true) Integer taskGetStatus) { Page list = taskService.getToBeClaimedPage(subject, taskContent, taskGetStatus); return R.ok(list); } @@ -143,11 +137,9 @@ public class BackstageTaskTechnologyController { * @author DB * @since 2023-12-01 09:45:08 */ - //@PreAuthorize("@aps.hasPermission('oamTask:iterateTask:insert')") - @ApiOperation("技术模块-任务领取-新增迭代任务") + @Operation(summary = "技术模块-任务领取-新增迭代任务") @PostMapping("/insertIterationTask") - public R insertIterationTask(@RequestBody @Validated - TaskIterationBo bo) { + public R insertIterationTask(@RequestBody @Validated TaskIterationBo bo) { taskService.insertIterationTask(bo); return R.ok(); } @@ -159,10 +151,9 @@ public class BackstageTaskTechnologyController { * @author DB * @since 2023-12-01 10:15:28 */ - //@PreAuthorize("@aps.hasPermission('oamTask:iterateTask:update')") - @ApiOperation("技术模块-任务领取-技术人员领取任务") + @Operation(summary = "技术模块-任务领取-技术人员领取任务") @PutMapping("/claimTask/{id}") - public R claimTask(@PathVariable @ApiParam("任务id") String id) { + public R claimTask(@PathVariable @Parameter(description = "任务id") String id) { taskService.claimTask(id); return R.ok(); } @@ -174,8 +165,7 @@ public class BackstageTaskTechnologyController { * @author DB * @since 2023-12-01 10:35:31 */ - @PreAuthorize("@aps.hasPermission('oamTask:technology:audit')") - @ApiOperation("技术模块-任务领取-任务审核") + @Operation(summary = "技术模块-任务领取-任务审核") @PutMapping("/setTaskAuditComments") public R setTaskAuditComments(@RequestBody @Validated TaskAuditCommentsBo bo) { taskService.setTaskAuditComments(bo); @@ -189,12 +179,11 @@ public class BackstageTaskTechnologyController { * @author DB * @since 2023/12/04 */ - @PreAuthorize("@aps.hasPermission('oamTask:technology:list')") - @ApiOperation("技术模块-今日事务-个人任务分页列表") + @Operation(summary = "技术模块-今日事务-个人任务分页列表") @GetMapping("/getPersonTaskPage") - public R> getPersonTaskPage(@RequestParam(value = "staffId", required = false) @ApiParam("员工id") String staffId, - @RequestParam(value = "startDate", required = false) @ApiParam("开始日期") @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate startDate, - @RequestParam(value = "endDate", required = false) @ApiParam("结束日期") @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate endDate) { + public R> getPersonTaskPage(@RequestParam(value = "staffId", required = false) @Parameter(description = ("员工id")) String staffId, + @RequestParam(value = "startDate", required = false) @Parameter(description = "开始日期") @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate startDate, + @RequestParam(value = "endDate", required = false) @Parameter(description = ("结束日期")) @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate endDate) { Page list = taskService.getPersonTaskPage(staffId, startDate, endDate); return R.ok(list); } @@ -207,7 +196,7 @@ public class BackstageTaskTechnologyController { * @author DB * @since 2023/12/04 */ - @ApiOperation("技术模块-今日事务-任务成员组列表") + @Operation(summary = "技术模块-今日事务-任务成员组列表") @GetMapping("/getTaskStaffGroupList/{taskId}") public R> getTaskStaffGroupList(@PathVariable String taskId) { List list = taskStaffGroupService.getTaskStaffGroupList(taskId); @@ -221,7 +210,7 @@ public class BackstageTaskTechnologyController { * @author DB * @since 2023/12/04 */ - @ApiOperation("技术模块-今日事务-查询技术员工列表") + @Operation(summary = "技术模块-今日事务-查询技术员工列表") @GetMapping("/getTechnologyStaffList") public R> getTechnologyStaffList() { List list = staffService.getTechnologyStaffList(); @@ -236,7 +225,7 @@ public class BackstageTaskTechnologyController { * @author DB * @since 2023/12/04 */ - @ApiOperation("技术模块-今日事务-新增任务小组成员") + @Operation(summary = "技术模块-今日事务-新增任务小组成员") @PostMapping("/insertTaskStaffGroup") public R insertTaskStaffGroup(@RequestBody @Validated TaskStaffGroupBo bo) { taskStaffGroupService.insertTaskStaffGroup(bo); @@ -251,7 +240,7 @@ public class BackstageTaskTechnologyController { * @author DB * @since 2023/12/04 */ - @ApiOperation("技术模块-今日事务-修改任务负责人") + @Operation(summary = "技术模块-今日事务-修改任务负责人") @PutMapping("/updateTaskResponsibleStaff") public R updateTaskResponsibleStaff(@RequestBody @Validated TransferTaskBo bo) { taskService.updateTaskResponsibleStaff(bo); @@ -266,7 +255,7 @@ public class BackstageTaskTechnologyController { * @author DB * @since 2023/12/04 */ - @ApiOperation("技术模块-今日事务-修改员工任务绩点") + @Operation(summary = "技术模块-今日事务-修改员工任务绩点") @PutMapping("/updateStaffGradePoint") public R updateStaffGradePoint(@RequestBody @Validated TaskStaffGroupBo bo) { taskStaffGroupService.updateStaffGradePoint(bo); @@ -281,7 +270,7 @@ public class BackstageTaskTechnologyController { * @author DB * @since 2023/12/04 */ - @ApiOperation("技术模块-今日事务-删除成员组") + @Operation(summary = "技术模块-今日事务-删除成员组") @DeleteMapping("/removeTaskStaffGroup/{id}") public R removeTaskStaffGroup(@PathVariable String id) { taskStaffGroupService.removeTaskStaffGroupById(id); @@ -296,7 +285,7 @@ public class BackstageTaskTechnologyController { * @author DB * @since 2023/12/04 */ - @ApiOperation("技术模块-今日事务-更新任务进度") + @Operation(summary = "技术模块-今日事务-更新任务进度") @PutMapping("/updateTaskProgress") public R updateTaskProgress(@RequestBody @Validated TaskProgressBo bo) { taskService.updateTaskProgress(bo); @@ -311,7 +300,7 @@ public class BackstageTaskTechnologyController { * @author DB * @since 2023/12/04 */ - @ApiOperation("技术模块-今日事务-转交任务") + @Operation(summary = "技术模块-今日事务-转交任务") @PutMapping("/updateTaskItem") public R updateTaskItem(@RequestBody @Validated TaskItemBo bo) { taskService.updateTaskItem(bo); @@ -326,8 +315,7 @@ public class BackstageTaskTechnologyController { * @author DB * @since 2023/12/04 */ - @PreAuthorize("@aps.hasPermission('oamTask:technology:list')") - @ApiOperation("技术模块-数据统计-获取月度任务统计列表") + @Operation(summary = "技术模块-数据统计-获取月度任务统计列表") @GetMapping("/getTaskMonthStatistics") public R getTaskMonthStatistics(TaskMonthStatisticsBo bo) { return R.ok(taskService.getTaskMonthStatistics(bo)); @@ -340,7 +328,7 @@ public class BackstageTaskTechnologyController { * @author DB * @since 2023/12/05 */ - @ApiOperation("技术模块-数据统计-获取任务日报") + @Operation(summary = "技术模块-数据统计-获取任务日报") @GetMapping("/getTaskDailyPaper") public R getTaskDailyPaper(TaskDailyPaperBo bo) { String dailyPaper = taskService.getTaskDailyPaper(bo); @@ -354,12 +342,11 @@ public class BackstageTaskTechnologyController { * @author DB * @since 2023/12/05 */ - @PreAuthorize("@aps.hasPermission('oamTask:technology:list')") - @ApiOperation("技术模块-今日事务-个人绩点") + @Operation(summary = "技术模块-今日事务-个人绩点") @GetMapping("/getIndividualGpa") - public R getIndividualGpa(@RequestParam(value = "staffId", required = false) @ApiParam("员工id") String staffId, - @RequestParam(value = "startDate", required = false) @ApiParam("开始日期") @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate startDate, - @RequestParam(value = "endDate", required = false) @ApiParam("结束日期") @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate endDate) { + public R getIndividualGpa(@RequestParam(value = "staffId", required = false) @Parameter(description = "员工id") String staffId, + @RequestParam(value = "startDate", required = false) @Parameter(description = ("开始日期")) @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate startDate, + @RequestParam(value = "endDate", required = false) @Parameter(description = ("结束日期")) @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate endDate) { TaskIndividualGpaVo vo = taskService.getIndividualGpa(staffId, startDate, endDate); return R.ok(vo); } @@ -372,7 +359,7 @@ public class BackstageTaskTechnologyController { * @return R */ @PutMapping("/enforceFinishWorkOrder") - @ApiOperation("强制办结工单") + @Operation(summary = "强制办结工单") public R enforceFinishWorkOrder(@RequestBody @Validated EnforceFinishWorkOrderBo bo) { taskWorkOrderService.enforceFinishWorkOrder(bo); return R.ok(); diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/StaffService.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/StaffService.java index 37b05e0..cb35db3 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/StaffService.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/StaffService.java @@ -1,16 +1,14 @@ package com.cpop.oam.business.service; -import com.cpop.core.base.table.SysUser; +import com.cpop.core.base.table.User; import com.cpop.oam.business.bo.*; -import com.mybatisflex.core.paginate.Page; -import com.mybatisflex.core.service.IService; import com.cpop.oam.business.entity.Staff; +import com.cpop.oam.business.vo.OperationLogVo; import com.cpop.oam.business.vo.StaffInfoVo; import com.cpop.oam.business.vo.StaffPageVo; import com.cpop.oam.business.vo.StaffVo; -import com.cpop.oam.business.vo.SysOperationLogVo; -import me.chanjar.weixin.cp.api.WxCpService; -import me.chanjar.weixin.cp.bean.message.WxCpXmlMessage; +import com.mybatisflex.core.paginate.Page; +import com.mybatisflex.core.service.IService; import java.util.List; @@ -38,7 +36,7 @@ public interface StaffService extends IService { * @date 2023/09/08 14:12 * @param bo 请求参数 */ - SysUser insertStaff(StaffBo bo); + User insertStaff(StaffBo bo); /** * @descriptions 修改员工 @@ -82,7 +80,7 @@ public interface StaffService extends IService { * @Author: DB * @Date: 2023/5/12 14:30 **/ - Page getUserLogList(SysUserLogBo bo); + Page getUserLogList(UserLogBo bo); /** * @Description: 修改系统用户密码 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 2f83a7f..2903733 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 @@ -1,17 +1,18 @@ package com.cpop.oam.business.service.impl; +import cn.dev33.satoken.session.SaSession; +import cn.dev33.satoken.stp.StpUtil; import com.alibaba.excel.EasyExcel; import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.read.listener.ReadListener; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import com.cpop.common.utils.DateUtils; -import com.cpop.common.utils.StringUtils; -import com.cpop.common.utils.bean.BeanUtils; import com.cpop.core.base.entity.PageDomain; import com.cpop.core.base.exception.ServiceException; import com.cpop.core.utils.SpringUtils; import com.cpop.core.utils.SqlUtils; +import com.cpop.core.utils.StringUtils; +import com.cpop.core.utils.bean.BeanUtils; import com.cpop.oam.business.bo.BusinessDisposeBo; import com.cpop.oam.business.bo.BusinessDistributeBo; import com.cpop.oam.business.bo.BusinessInfoPageBo; @@ -35,7 +36,8 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.net.ssl.HttpsURLConnection; -import java.io.*; +import java.io.IOException; +import java.io.InputStream; import java.net.URL; import java.time.LocalDate; import java.time.LocalDateTime; @@ -53,10 +55,8 @@ 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.StoreLicenseTableDef.STORE_LICENSE; import static com.cpop.system.business.entity.table.StoreSignTableDef.STORE_SIGN; import static com.cpop.system.business.entity.table.StoreTableDef.STORE; -import static com.mybatisflex.core.query.QueryMethods.distinct; /** * Oam-事务表 服务层实现。 @@ -77,14 +77,12 @@ public class BusinessServiceImpl extends ServiceImpl i @Override public Page getBusinessPage(Integer status) { PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - //查询员工 - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); + SaSession session = StpUtil.getSession(); QueryWrapper queryWrapper = QueryWrapper.create(); //运营人员 - if (loginUserInfo.getInteger("staffType") == 1) { - queryWrapper - .leftJoin(BUSINESS_STAFF).on(BUSINESS_STAFF.BUSINESS_ID.eq(BUSINESS.ID)) - .and(BUSINESS_STAFF.STAFF_ID.eq(loginUserInfo.getString("id"))); + if (session.getInt("staffType") == 1) { + queryWrapper.leftJoin(BUSINESS_STAFF).on(BUSINESS_STAFF.BUSINESS_ID.eq(BUSINESS.ID)) + .and(BUSINESS_STAFF.STAFF_ID.eq(session.getString("id"))); } return this.mapper.paginateAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()), queryWrapper.select(BUSINESS.ID, BUSINESS.BUSINESS_LEVEL, BUSINESS.BUSINESS_TYPE, BUSINESS.DESC, BUSINESS.START_DATE, BUSINESS.END_DATE, BUSINESS.ALL_SURPLUS_QUANTITY, BUSINESS.REMARK, BUSINESS.STATUS) @@ -105,8 +103,7 @@ public class BusinessServiceImpl extends ServiceImpl i @Transactional(rollbackFor = Exception.class) public void businessDistribute(BusinessDistributeBo bo) { Business business = BeanUtils.mapToClass(bo, Business.class); - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); - business.setInitiatorId(loginUserInfo.getString("id")) + business.setInitiatorId(StpUtil.getSession().getString("id")) .setStartDate(bo.getStartAndEnd().get(0)) .setEndDate(bo.getStartAndEnd().get(1)); this.save(business); @@ -206,15 +203,14 @@ public class BusinessServiceImpl extends ServiceImpl i */ private Page getButtJoint(BusinessInfoPageBo bo) { //获取当前员工信息 - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); QueryWrapper queryWrapper = QueryWrapper.create(); + SaSession session = StpUtil.getSession(); //运营人员 - if (loginUserInfo.getInteger("staffType") == 1) { - queryWrapper.and(BUSINESS_STAFF.STAFF_ID.eq(loginUserInfo.getString("id"))); + if (session.getInt("staffType") == 1) { + queryWrapper.and(BUSINESS_STAFF.STAFF_ID.eq(session.getString("id"))); } PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - return SpringUtils.getBean(BusinessDetailService.class).getMapper().paginateAs(Page.of(pageDomain.getPageNum(),pageDomain.getPageSize()), - queryWrapper + return SpringUtils.getBean(BusinessDetailService.class).getMapper().paginateAs(Page.of(pageDomain.getPageNum(),pageDomain.getPageSize()), queryWrapper //事务详情 .select(BUSINESS_DETAIL.ID, BUSINESS_DETAIL.DETAIL_STATUS, BUSINESS_DETAIL.DETAIL_DESC, BUSINESS_DETAIL.DETAIL_RECORD_TIME) //员工 @@ -222,19 +218,17 @@ public class BusinessServiceImpl extends ServiceImpl i //品牌 .select(BRAND.BRAND_NAME) //校区 - .select(STORE.STORE_NAME, STORE.PERSON_CHARGE, STORE.PHONE, STORE.ID.as(BusinessInfoPageVo::getStoreId)) - //营业执照 - .select(STORE_LICENSE.LICENSE_NAME, STORE_LICENSE.LICENSE_USER_NAME, STORE_LICENSE.LICENSE_ADDR) + .select(STORE.STORE_NAME, STORE.PERSON_CHARGE_PHONE, STORE.PERSON_CHARGE_NAME, STORE.ID.as(BusinessInfoPageVo::getStoreId), + STORE.LICENSE_FIRM_NAME,STORE.LICENSE_USERNAME,STORE.LICENSE_ADDR) .leftJoin(BUSINESS_STAFF).on(BUSINESS_STAFF.ID.eq(BUSINESS_DETAIL.BUSINESS_STAFF_ID)) .leftJoin(STAFF).on(STAFF.ID.eq(BUSINESS_STAFF.STAFF_ID)) .leftJoin(BRAND).on(BRAND.ID.eq(BUSINESS_DETAIL.BRAND_ID)) .leftJoin(STORE).on(STORE.ID.eq(BUSINESS_DETAIL.STORE_ID)) - .leftJoin(STORE_LICENSE).on(STORE_LICENSE.STORE_ID.eq(STORE.ID)) .where(BUSINESS_DETAIL.BUSINESS_ID.eq(bo.getId())) //品牌或校区名模糊查询 - .and(BRAND.BRAND_NAME.like(bo.getBrandOrStore()).or(STORE.STORE_NAME.like(bo.getBrandOrStore()))) + .and(BRAND.BRAND_NAME.likeLeft(bo.getBrandOrStore()).or(STORE.STORE_NAME.likeLeft(bo.getBrandOrStore()))) //校区地址或校区名模糊查询 - .and(STORE_LICENSE.LICENSE_NAME.like(bo.getAddrOrName()).or(STORE_LICENSE.LICENSE_ADDR.like(bo.getAddrOrName()))) + .and(STORE.LICENSE_FIRM_NAME.likeLeft(bo.getAddrOrName()).or(STORE.LICENSE_ADDR.likeLeft(bo.getAddrOrName()))) .and(BUSINESS_DETAIL.DETAIL_STATUS.eq(bo.getDetailStatus())) .and(BUSINESS_STAFF.STAFF_ID.in(bo.getStaffIds())), BusinessInfoPageVo.class); @@ -251,6 +245,7 @@ public class BusinessServiceImpl extends ServiceImpl i public void businessDispose(BusinessDisposeBo bo) { BusinessDetailService businessDetailService = SpringUtils.getBean(BusinessDetailService.class); BusinessDetail businessDetail; + SaSession session = StpUtil.getSession(); //查询当前事务 if (StringUtils.isNotBlank(bo.getId())){ businessDetail = businessDetailService.queryChain().where(BUSINESS_DETAIL.ID.eq(bo.getId())).one(); @@ -261,11 +256,10 @@ public class BusinessServiceImpl extends ServiceImpl i businessDetail = new BusinessDetail(); //获取校区数据 Store store = SpringUtils.getBean(StoreService.class).getById(bo.getStoreId()); - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); //获取事务员工 BusinessStaff businessStaff = SpringUtils.getBean(BusinessStaffService.class).getOne(QueryWrapper.create() .where(BUSINESS_STAFF.BUSINESS_ID.eq(bo.getBusinessId())) - .and(BUSINESS_STAFF.STAFF_ID.eq(loginUserInfo.getString("id")))); + .and(BUSINESS_STAFF.STAFF_ID.eq(session.getString("id")))); businessDetail.setBrandId(store.getBrandId()).setStoreId(store.getId()).setBusinessId(bo.getBusinessId()); businessDetail.setDetailStatus(bo.getDetailStatus()).setDetailDesc(bo.getDetailDesc()).setDetailRecordTime(LocalDateTime.now()) .setBusinessStaffId(businessStaff.getId()); @@ -283,11 +277,10 @@ public class BusinessServiceImpl extends ServiceImpl i } business.setAllSurplusQuantity(business.getAllSurplusQuantity() - 1); this.updateById(business); - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); SpringUtils.getBean(BusinessStaffService.class).updateChain() .setRaw(BUSINESS_STAFF.SURPLUS_QUANTITY, "surplus_quantity - 1") .where(BUSINESS_STAFF.BUSINESS_ID.eq(businessDetail.getBusinessId())) - .and(BUSINESS_STAFF.STAFF_ID.eq(loginUserInfo.getString("id"))) + .and(BUSINESS_STAFF.STAFF_ID.eq(session.getString("id"))) .update(); } @@ -303,25 +296,8 @@ public class BusinessServiceImpl extends ServiceImpl i @Override public void businessRemove(BusinessRemoveBo bo) { Business business = this.getById(bo.getBusinessId()); - if (bo.getId() == null) { - //将校区改为测试校区 - SpringUtils.getBean(StoreService.class).updateChain() - .set(STORE.IS_TEST, true) - .where(STORE.ID.eq(bo.getStoreId())) - .update(); - } else { - BusinessDetailService businessDetailService = SpringUtils.getBean(BusinessDetailService.class); - BusinessDetail businessDetail = businessDetailService.getById(bo.getId()); - //机构签约 - if (business.getBusinessType() == 1) { - //将校区改为测试校区 - SpringUtils.getBean(StoreService.class).updateChain() - .set(STORE.IS_TEST, true) - .where(STORE.ID.eq(businessDetail.getStoreId())) - .update(); - } - businessDetailService.removeById(bo.getId()); - } + BusinessDetailService businessDetailService = SpringUtils.getBean(BusinessDetailService.class); + businessDetailService.removeById(bo.getId()); //所有任务都完成 if (business.getAllSurplusQuantity() - 1 == 0) { business.setStatus(1); @@ -339,7 +315,6 @@ public class BusinessServiceImpl extends ServiceImpl i */ @Override public PersonBusinessInfoVo getPersonBusinessInfoById(String id) { - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); return this.getOneAs(QueryWrapper.create() .select(BUSINESS.BUSINESS_LEVEL,BUSINESS.BUSINESS_TYPE,BUSINESS.DESC,BUSINESS.START_DATE,BUSINESS.END_DATE,BUSINESS.REMARK) .select(STAFF.NAME.as(PersonBusinessInfoVo::getInitiatorName)) @@ -347,7 +322,7 @@ public class BusinessServiceImpl extends ServiceImpl i .leftJoin(STAFF).on(STAFF.ID.eq(BUSINESS.INITIATOR_ID)) .leftJoin(BUSINESS_STAFF).on(BUSINESS_STAFF.BUSINESS_ID.eq(BUSINESS.ID)) .where(BUSINESS.ID.eq(id)) - .and(BUSINESS_STAFF.STAFF_ID.eq(loginUserInfo.getString("id"))), + .and(BUSINESS_STAFF.STAFF_ID.eq(StpUtil.getSession().getString("id"))), PersonBusinessInfoVo.class); } @@ -363,18 +338,12 @@ public class BusinessServiceImpl extends ServiceImpl i PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); return this.pageAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()), QueryWrapper.create() - .select(STORE.ID, STORE.STORE_NAME, STORE.PERSON_CHARGE, STORE.PHONE, STORE.BRAND_ID) + .select(STORE.ID, STORE.STORE_NAME, STORE.PERSON_CHARGE_NAME, STORE.PERSON_CHARGE_PHONE, STORE.BRAND_ID,STORE.LICENSE_PIC_URL) .select(BRAND.BRAND_NAME) - .select(STORE_LICENSE.LICENSE_PIC_URL) .from(STORE) .leftJoin(BRAND).on(BRAND.ID.eq(STORE.BRAND_ID)) - .leftJoin(STORE_LICENSE).on(STORE_LICENSE.STORE_ID.eq(STORE.ID)) - .leftJoin(STORE_SIGN).on(STORE_SIGN.ID.eq(STORE.SIGN_ID)) - .where(STORE.SIGN_ID.isNull()) - .and(STORE.IS_TEST.eq(false)) - .and(STORE.STORE_NAME.like(params) - .or(STORE.PERSON_CHARGE.like(params) - .or(STORE.PHONE.eq(params)))) + .leftJoin(STORE_SIGN).on(STORE_SIGN.STORE_ID.eq(STORE.ID)) + .and(STORE.STORE_NAME.likeLeft(params).or(STORE.PERSON_CHARGE_NAME.likeLeft(params).or(STORE.PERSON_CHARGE_PHONE.eq(params)))) .and(STORE.CREATE_TIME.ge(LocalDate.parse("2023-12-01", DateTimeFormatter.ofPattern("yyyy-MM-dd")))) .orderBy(STORE.CREATE_TIME.desc()), BusinessUnSignPageVo.class); @@ -389,18 +358,13 @@ public class BusinessServiceImpl extends ServiceImpl i @Override @Transactional(rollbackFor = Exception.class) public void storeSign(String id) { - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); + SaSession session = StpUtil.getSession(); StoreSign storeSign = new StoreSign(); storeSign.setStoreId(id); - storeSign.setSignStaffId(loginUserInfo.getString("id")); + storeSign.setSignStaffId(session.getString("id")); storeSign.setSignMonth(LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM"))); StoreSignService storeSignService = SpringUtils.getBean(StoreSignService.class); storeSignService.save(storeSign); - SpringUtils.getBean(StoreService.class).updateChain() - .set(STORE.SIGN_ID,storeSign.getId()) - .set(STORE.HAVE_COUNSELOR,true) - .where(STORE.ID.eq(id)) - .update(); //线索归档 ClueService clueService = SpringUtils.getBean(ClueService.class); Clue clue = clueService.queryChain().where(CLUE.STORE_ID.eq(id)).one(); @@ -411,7 +375,7 @@ public class BusinessServiceImpl extends ServiceImpl i clueRecord.setRecordType(5) .setClueId(clue.getId()) .setRecordContent("机构签约") - .setRecordStaffId(loginUserInfo.getString("id")); + .setRecordStaffId(session.getString("id")); SpringUtils.getBean(ClueRecordServiceImpl.class).save(clueRecord); //签约目标更新 LocalDate now = LocalDate.now(); @@ -419,7 +383,7 @@ public class BusinessServiceImpl extends ServiceImpl i int year = now.getYear(); SignGoalService signGoalService = SpringUtils.getBean(SignGoalService.class); SignGoal signGoal = signGoalService.getOne(QueryWrapper.create() - .where(SIGN_GOAL.STAFF_ID.eq(loginUserInfo.getString("id"))) + .where(SIGN_GOAL.STAFF_ID.eq(session.getString("id"))) .and(SIGN_GOAL.YEAR.eq(year))); changeMonthGoal(signGoal,month); signGoalService.updateById(signGoal); 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 618fb22..bbbe29d 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 @@ -1,23 +1,20 @@ package com.cpop.oam.business.service.impl; -import com.alibaba.fastjson.JSONObject; +import cn.dev33.satoken.stp.StpUtil; import com.cpop.core.base.entity.PageDomain; import com.cpop.core.utils.SpringUtils; import com.cpop.core.utils.SqlUtils; import com.cpop.oam.business.bo.PutOffAuditBo; -import com.cpop.oam.business.entity.Clue; +import com.cpop.oam.business.entity.CluePutOff; import com.cpop.oam.business.entity.ClueRecord; +import com.cpop.oam.business.mapper.CluePutOffMapper; +import com.cpop.oam.business.service.CluePutOffService; import com.cpop.oam.business.service.ClueRecordService; -import com.cpop.oam.business.service.ClueService; import com.cpop.oam.business.vo.CluePageVo; import com.cpop.oam.business.vo.PutOffAuditPageVo; -import com.cpop.system.business.service.StoreRenewService; import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.oam.business.entity.CluePutOff; -import com.cpop.oam.business.mapper.CluePutOffMapper; -import com.cpop.oam.business.service.CluePutOffService; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -52,7 +49,7 @@ public class CluePutOffServiceImpl extends ServiceImpl implements Cl if (StringUtils.isNotBlank(staffId)) { queryWrapper.and(CLUE.RESPONSIBLE_STAFF_ID.eq(staffId)); } else { - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); - queryWrapper.and(CLUE.RESPONSIBLE_STAFF_ID.eq(loginUserInfo.getString("id"))); + queryWrapper.and(CLUE.RESPONSIBLE_STAFF_ID.eq(StpUtil.getSession().getString("id"))); } if (StringUtils.isNotBlank(city) && StringUtils.equals("其他", city)) { int year = LocalDate.now().getYear(); @@ -100,7 +103,7 @@ public class ClueServiceImpl extends ServiceImpl implements Cl queryWrapper .select(CLUE.CITY,CLUE.ID,CLUE.CREATE_TIME,CLUE.DEV_STAFF_ID,CLUE.LAST_FOLLOW_UP_TIME,CLUE.LAST_FOLLOW_UP_CONTENT,CLUE.RECEIPT_TIME,CLUE.STORE_ID,CLUE.CLUE_STATUS, CLUE.FOLLOW_STATUS) - .select(STORE.STORE_NAME,STORE.STORE_ADDR,STORE.PERSON_CHARGE,STORE.PHONE) + .select(STORE.STORE_NAME,STORE.STORE_ADDR,STORE.PERSON_CHARGE_NAME,STORE.PERSON_CHARGE_PHONE) .select(BRAND.BRAND_NAME) .select(STORE_SIGN.EXPIRE_DATE,STORE_SIGN.CREATE_TIME.as(CluePageVo::getStoreSignTime)) // 跟进间隔 @@ -116,7 +119,7 @@ public class ClueServiceImpl extends ServiceImpl implements Cl //校区 .and(CLUE.STORE_ID.eq(storeId)) .and(CLUE.FOLLOW_STATUS.eq(followStatus)) - .and(STORE.PERSON_CHARGE.likeLeft(chargeOrPhone).or(STORE.PHONE.eq(chargeOrPhone))) + .and(STORE.PERSON_CHARGE_NAME.likeLeft(chargeOrPhone).or(STORE.PERSON_CHARGE_PHONE.eq(chargeOrPhone))) .and(STORE_SIGN.SIGN_MONTH.eq(signMonth)) .orderBy(changeOrderColumn(pageDomain)), CluePageVo.class, @@ -178,9 +181,9 @@ public class ClueServiceImpl extends ServiceImpl implements Cl if (StringUtils.isNotBlank(staffId)) { queryWrapper.and(SIGN_GOAL.STAFF_ID.eq(staffId)); } else { - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); - queryWrapper.and(SIGN_GOAL.STAFF_ID.eq(loginUserInfo.getString("id"))); - staffId = loginUserInfo.getString("id"); + String id = StpUtil.getSession().getString("id"); + queryWrapper.and(SIGN_GOAL.STAFF_ID.eq(id)); + staffId = id; } SignGoalService signGoalService = SpringUtils.getBean(SignGoalService.class); if (StringUtils.isBlank(signMonth)) { @@ -258,8 +261,7 @@ public class ClueServiceImpl extends ServiceImpl implements Cl public void clueFollowUp(ClueFollowUpBo bo) { ClueRecord clueRecord = BeanUtils.mapToClass(bo, ClueRecord.class); clueRecord.setRecordType(2); - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); - clueRecord.setRecordStaffId(loginUserInfo.getString("id")); + clueRecord.setRecordStaffId(StpUtil.getSession().getString("id")); SpringUtils.getBean(ClueRecordService.class).save(clueRecord); SpringUtils.getBean(ClueService.class).updateChain() .set(CLUE.LAST_FOLLOW_UP_TIME, LocalDateTime.now()) @@ -286,24 +288,24 @@ public class ClueServiceImpl extends ServiceImpl implements Cl StoreService storeService = SpringUtils.getBean(StoreService.class); Store store = storeService.getById(clue.getStoreId()); ClueUpdate clueUpdate = BeanUtils.mapToClass(bo,ClueUpdate.class); - clueUpdate.setOldPersonCharge(store.getPersonCharge()) - .setOldPhone(store.getPhone()) + clueUpdate.setOldPersonCharge(store.getPersonChargeName()) + .setOldPhone(store.getPersonChargePhone()) .setOldStoreAddr(store.getStoreAddr()) .setOldStoreName(store.getStoreName()); - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); - clueUpdate.setUpdateStaffId(loginUserInfo.getString("id")); + String id = StpUtil.getSession().getString("id"); + clueUpdate.setUpdateStaffId(id); //保存记录 SpringUtils.getBean(ClueUpdateService.class).save(clueUpdate); ClueRecord clueRecord = new ClueRecord(); clueRecord.setClueId(bo.getClueId()) - .setRecordStaffId(loginUserInfo.getString("id")) + .setRecordStaffId(id) .setRecordType(6) .setRecordContent("校区更新"); SpringUtils.getBean(ClueRecordService.class).save(clueRecord); //更新校区 store.setStoreName(bo.getNewStoreName()) - .setPersonCharge(bo.getNewPersonCharge()) - .setPhone(bo.getNewPhone()) + .setPersonChargeName(bo.getNewPersonCharge()) + .setPersonChargePhone(bo.getNewPhone()) .setStoreAddr(bo.getNewStoreAddr()); storeService.updateById(store); } @@ -331,8 +333,8 @@ public class ClueServiceImpl extends ServiceImpl implements Cl Clue clue = this.getById(clueId); Store store = SpringUtils.getBean(StoreService.class).getById(clue.getStoreId()); clueUpdateVo.setStoreName(store.getStoreName()) - .setPhone(store.getPhone()) - .setPersonCharge(store.getPersonCharge()) + .setPhone(store.getPersonChargePhone()) + .setPersonCharge(store.getPersonChargeName()) .setStoreAddr(store.getStoreAddr()); return clueUpdateVo; } @@ -347,7 +349,6 @@ public class ClueServiceImpl extends ServiceImpl implements Cl @Transactional(rollbackFor = Exception.class) public void cluePutOff(CluePutOffBo bo) { //查询延期记录 - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); CluePutOffService cluePutOffService = SpringUtils.getBean(CluePutOffService.class); long count = cluePutOffService.count(QueryWrapper.create() .where(CLUE_PUT_OFF.AUDIT_STATUS.eq(0)) @@ -355,13 +356,13 @@ public class ClueServiceImpl extends ServiceImpl implements Cl if (count > 0) { throw new ServiceException("该线索在审核中,请勿重复提交"); } + String id = StpUtil.getSession().getString("id"); CluePutOff cluePutOff = BeanUtils.mapToClass(bo, CluePutOff.class); - cluePutOff.setAuditStatus(0) - .setPutOffStaffId(loginUserInfo.getString("id")); + cluePutOff.setAuditStatus(0).setPutOffStaffId(id); cluePutOffService.save(cluePutOff); ClueRecord clueRecord = new ClueRecord(); clueRecord.setClueId(bo.getClueId()) - .setRecordStaffId(loginUserInfo.getString("id")) + .setRecordStaffId(id) .setRecordType(7) .setRecordContent(bo.getPutOffReason()); SpringUtils.getBean(ClueRecordService.class).save(clueRecord); @@ -424,10 +425,9 @@ public class ClueServiceImpl extends ServiceImpl implements Cl .set(CLUE.RECEIPT_TIME,null) .where(CLUE.ID.eq(clue.getId())) .update(); - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); ClueRecord clueRecord = new ClueRecord(); clueRecord.setClueId(id) - .setRecordStaffId(loginUserInfo.getString("id")) + .setRecordStaffId(StpUtil.getLoginIdAsString()) .setRecordType(4) .setRecordContent("主动脱离"); SpringUtils.getBean(ClueRecordService.class).save(clueRecord); @@ -448,12 +448,11 @@ public class ClueServiceImpl extends ServiceImpl implements Cl PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); QueryWrapper queryWrapper = QueryWrapper.create(); //获取员工区域信息 - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); int year = LocalDate.now().getYear(); List cityList = SpringUtils.getBean(SignAreaService.class).queryChain() .select(distinct(SIGN_AREA.CITY)) .leftJoin(SIGN_GOAL).on(SIGN_GOAL.ID.eq(SIGN_AREA.SIGN_GOAL_ID)) - .where(SIGN_GOAL.STAFF_ID.eq(loginUserInfo.getString("id"))) + .where(SIGN_GOAL.STAFF_ID.eq(StpUtil.getLoginIdAsString())) .and(SIGN_GOAL.YEAR.eq(year)) .listAs(String.class); if (cityList == null || cityList.isEmpty()){ @@ -461,7 +460,7 @@ public class ClueServiceImpl extends ServiceImpl implements Cl } return this.mapper.paginateAs(Page.of(pageDomain.getPageNum(),pageDomain.getPageSize()), queryWrapper .select(CLUE.CITY,CLUE.ID,CLUE.CREATE_TIME,CLUE.DEV_STAFF_ID,CLUE.LAST_FOLLOW_UP_TIME,CLUE.LAST_FOLLOW_UP_CONTENT,CLUE.RECEIPT_TIME,CLUE.STORE_ID,CLUE.LAST_RECEIPT_TIME,CLUE.LAST_RECEIPT_STAFF_ID) - .select(STORE.STORE_NAME,STORE.STORE_ADDR,STORE.PERSON_CHARGE,STORE.PHONE) + .select(STORE.STORE_NAME,STORE.STORE_ADDR,STORE.PERSON_CHARGE_NAME,STORE.PERSON_CHARGE_PHONE) .select(BRAND.BRAND_NAME) .select(STORE_SIGN.EXPIRE_DATE,STORE_SIGN.CREATE_TIME.as(CluePageVo::getStoreSignTime)) // 跟进间隔 @@ -477,7 +476,7 @@ public class ClueServiceImpl extends ServiceImpl implements Cl .and(BRAND.ID.eq(brandId)) //校区 .and(CLUE.STORE_ID.eq(storeId)) - .and(STORE.PERSON_CHARGE.likeLeft(chargeOrPhone).or(STORE.PHONE.eq(chargeOrPhone))) + .and(STORE.PERSON_CHARGE_NAME.likeLeft(chargeOrPhone).or(STORE.PERSON_CHARGE_PHONE.eq(chargeOrPhone))) .and(CLUE.RESPONSIBLE_STAFF_ID.isNull()) .orderBy(CLUE.CREATE_TIME.desc()), CluePageVo.class, @@ -541,7 +540,7 @@ public class ClueServiceImpl extends ServiceImpl implements Cl }*/ return this.mapper.paginateAs(Page.of(pageDomain.getPageNum(),pageDomain.getPageSize()), queryWrapper .select(CLUE.CITY,CLUE.ID,CLUE.CREATE_TIME,CLUE.DEV_STAFF_ID,CLUE.LAST_FOLLOW_UP_TIME,CLUE.LAST_FOLLOW_UP_CONTENT,CLUE.RECEIPT_TIME,CLUE.STORE_ID,CLUE.LAST_RECEIPT_TIME,CLUE.LAST_RECEIPT_STAFF_ID) - .select(STORE.STORE_NAME,STORE.STORE_ADDR,STORE.PERSON_CHARGE,STORE.PHONE) + .select(STORE.STORE_NAME,STORE.STORE_ADDR,STORE.PERSON_CHARGE_NAME,STORE.PERSON_CHARGE_PHONE) .select(BRAND.BRAND_NAME) .select(STORE_SIGN.EXPIRE_DATE,STORE_SIGN.CREATE_TIME.as(CluePageVo::getStoreSignTime)) // 跟进间隔 @@ -556,7 +555,7 @@ public class ClueServiceImpl extends ServiceImpl implements Cl .and(BRAND.ID.eq(brandId)) //校区 .and(CLUE.STORE_ID.eq(storeId)) - .and(STORE.PERSON_CHARGE.likeLeft(chargeOrPhone).or(STORE.PHONE.eq(chargeOrPhone))) + .and(STORE.PERSON_CHARGE_NAME.likeLeft(chargeOrPhone).or(STORE.PERSON_CHARGE_PHONE.eq(chargeOrPhone))) .and(CLUE.RESPONSIBLE_STAFF_ID.isNull()) .orderBy(CLUE.CREATE_TIME.desc()), CluePageVo.class, @@ -611,24 +610,24 @@ public class ClueServiceImpl extends ServiceImpl implements Cl if (StringUtils.isNotBlank(clue.getResponsibleStaffId())){ throw new ServiceException("当前线索已被领取,请刷新页面后重试"); } - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); + String loginIdAsString = StpUtil.getLoginIdAsString(); if (StringUtils.isBlank(clue.getDevStaffId())) { - clue.setDevStaffId(loginUserInfo.getString("id")); + clue.setDevStaffId(loginIdAsString); } LocalDateTime now = LocalDateTime.now(); - String content = "员工" + loginUserInfo.getString("name") + "领取了该线索"; - clue.setResponsibleStaffId(loginUserInfo.getString("id")) + String content = "员工" + StpUtil.getSession().getString("name") + "领取了该线索"; + clue.setResponsibleStaffId(loginIdAsString) .setReceiptTime(now) .setLastFollowUpTime(now) .setLastFollowUpContent(content) - .setLastReceiptStaffId(loginUserInfo.getString("id")) + .setLastReceiptStaffId(loginIdAsString) .setLastReceiptTime(now); this.updateById(clue); //插入记录 ClueRecord clueRecord = new ClueRecord(); clueRecord.setClueId(id) .setRecordType(1) - .setRecordStaffId(loginUserInfo.getString("id")) + .setRecordStaffId(loginIdAsString) .setRecordContent(content); SpringUtils.getBean(ClueRecordService.class).save(clueRecord); }catch (Exception e) { @@ -658,7 +657,6 @@ public class ClueServiceImpl extends ServiceImpl implements Cl public Page getMyDevCluePage(String city, String brandId, String storeId, String chargeOrPhone) { PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); QueryWrapper queryWrapper = QueryWrapper.create(); - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); if (StringUtils.isNotBlank(city) && StringUtils.equals("其他", city)) { List dictValues = SpringUtils.getBean(DictDataService.class).getDictDataByDictType("oam_clue_area") .stream().map(DictData::getDictValue).collect(Collectors.toList()); @@ -673,11 +671,10 @@ public class ClueServiceImpl extends ServiceImpl implements Cl } else if (StringUtils.isNotBlank(city)) { queryWrapper.and(CLUE.CITY.eq(city)); } - return this.mapper.paginateAs(Page.of(pageDomain.getPageNum(),pageDomain.getPageSize()), - queryWrapper + return this.mapper.paginateAs(Page.of(pageDomain.getPageNum(),pageDomain.getPageSize()), queryWrapper .select(CLUE.CITY,CLUE.ID,CLUE.CREATE_TIME,CLUE.DEV_STAFF_ID,CLUE.LAST_FOLLOW_UP_TIME,CLUE.LAST_FOLLOW_UP_CONTENT,CLUE.RECEIPT_TIME,CLUE.STORE_ID,CLUE.RESPONSIBLE_STAFF_ID, CLUE.CLUE_STATUS) - .select(STORE.STORE_NAME,STORE.STORE_ADDR,STORE.PERSON_CHARGE,STORE.PHONE) + .select(STORE.STORE_NAME,STORE.STORE_ADDR,STORE.PERSON_CHARGE_NAME,STORE.PERSON_CHARGE_PHONE) .select(BRAND.BRAND_NAME) .select(STORE_SIGN.CREATE_TIME.as(CluePageVo::getStoreSignTime)) // 跟进间隔 @@ -688,12 +685,12 @@ public class ClueServiceImpl extends ServiceImpl implements Cl .leftJoin(STORE).on(STORE.ID.eq(CLUE.STORE_ID)) .leftJoin(BRAND).on(BRAND.ID.eq(STORE.BRAND_ID)) .leftJoin(STORE_SIGN).on(STORE_SIGN.STORE_ID.eq(STORE.ID)) - .and(CLUE.DEV_STAFF_ID.eq(loginUserInfo.getString("id"))) + .and(CLUE.DEV_STAFF_ID.eq(StpUtil.getLoginIdAsString())) //品牌 .and(BRAND.ID.eq(brandId)) //校区 .and(CLUE.STORE_ID.eq(storeId)) - .and(STORE.PERSON_CHARGE.likeLeft(chargeOrPhone).or(STORE.PHONE.eq(chargeOrPhone))) + .and(STORE.PERSON_CHARGE_NAME.likeLeft(chargeOrPhone).or(STORE.PERSON_CHARGE_PHONE.eq(chargeOrPhone))) .orderBy(CLUE.CREATE_TIME.desc()), CluePageVo.class, //开发员工 diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/CommonServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/CommonServiceImpl.java index 33cf2b5..e615506 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/CommonServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/CommonServiceImpl.java @@ -1,29 +1,30 @@ package com.cpop.oam.business.service.impl; -import com.mybatisflex.core.row.DbChain; -import com.cpop.common.utils.StringUtils; -import com.cpop.common.utils.bean.BeanUtils; import com.cpop.core.base.exception.ServiceException; -import com.cpop.core.base.table.SysConfig; +import com.cpop.core.base.table.Config; +import com.cpop.core.service.ConfigService; import com.cpop.core.service.RedisService; import com.cpop.core.utils.SpringUtils; +import com.cpop.core.utils.StringUtils; +import com.cpop.core.utils.bean.BeanUtils; import com.cpop.oam.business.bo.SysConfigInfoBo; import com.cpop.oam.business.service.CommonService; import com.cpop.oam.business.vo.ConfigInfoVo; import com.cpop.oam.framework.constant.OamConfigKey; import com.cpop.oam.framework.enums.OamConfigEnum; +import com.mybatisflex.core.row.DbChain; +import jakarta.annotation.PostConstruct; import org.springframework.stereotype.Service; -import javax.annotation.PostConstruct; import java.lang.reflect.Field; import java.util.*; -import static com.cpop.core.base.table.table.SysConfigTableDef.SYS_CONFIG; +import static com.cpop.core.base.table.table.ConfigTableDef.CONFIG; + /** * @author DB - * @createTime 2023/09/13 12:45 - * @description + * @since 2023/09/13 12:45 */ @Service("oamCommonService") public class CommonServiceImpl implements CommonService { @@ -47,12 +48,12 @@ public class CommonServiceImpl implements CommonService { List signGoalList = Arrays.asList(OamConfigKey.SIGN_GOAL); keys.addAll(signGoalList); // 加载OAM配置参数 - List configsList = DbChain.table(SYS_CONFIG) - .select(SYS_CONFIG.ALL_COLUMNS) - .where(SYS_CONFIG.CONFIG_KEY.in(keys)) - .listAs(SysConfig.class); + List configsList = DbChain.table(CONFIG) + .select(CONFIG.ALL_COLUMNS) + .where(CONFIG.CONFIG_KEY.in(keys)) + .listAs(Config.class); if (!configsList.isEmpty()) { - for (SysConfig config : configsList) { + for (Config config : configsList) { SpringUtils.getBean(RedisService.class) .setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); } @@ -90,15 +91,15 @@ public class CommonServiceImpl implements CommonService { } /** - * @Description: 获取系统配置信息 + * 获取系统配置信息 * @return R * @author DB - * @Date: 2023/7/7 0007 16:27 + * @since 2023/7/7 0007 16:27 */ @Override public ConfigInfoVo getSysConfigInfo() { RedisService redisService = SpringUtils.getBean(RedisService.class); - CoreService coreService = SpringUtils.getBean(CoreService.class); + ConfigService configService = SpringUtils.getBean(ConfigService.class); // 获取企业微信信息 Map configMap = new HashMap<>(8); Arrays.asList(OamConfigKey.WORK_WX_INFO).forEach(item -> { @@ -109,7 +110,7 @@ public class CommonServiceImpl implements CommonService { configMap.put(sysConfigEnum.getField(), cacheInfo); } else { // 查询系统 - SysConfig sysConfig = coreService.selectConfigByKey(item); + Config sysConfig = configService.getById(item); if (null != sysConfig) { // 获取枚举 OamConfigEnum sysConfigEnum = OamConfigEnum.matchKey(item); @@ -124,14 +125,13 @@ public class CommonServiceImpl implements CommonService { /** * @param bo 请求参数 - * @Description: 设置系统配置信息 - * @return: R - * @Author: DB - * @Date: 2023/5/11 15:48 + * 设置系统配置信息 + * @author DB + * @since 2023/5/11 15:48 **/ @Override public void setSysConfigInfo(SysConfigInfoBo bo) { - CoreService coreService = SpringUtils.getBean(CoreService.class); + ConfigService configService = SpringUtils.getBean(ConfigService.class); // 遍历属性名与值 try { for (Field field : bo.getClass().getDeclaredFields()) { @@ -139,17 +139,17 @@ public class CommonServiceImpl implements CommonService { // 获取枚举 OamConfigEnum sysConfigEnum = OamConfigEnum.matchField(field.getName()); if (null != sysConfigEnum) { - SysConfig sysConfig = new SysConfig(); + Config sysConfig = new Config(); sysConfig.setConfigName(sysConfigEnum.getName()) .setConfigKey(sysConfigEnum.getKey()) .setConfigValue(field.get(bo).toString()); // 修改 - if (DbChain.table(SYS_CONFIG) - .where(SYS_CONFIG.CONFIG_KEY.eq(sysConfig.getConfigKey())) + if (DbChain.table(CONFIG) + .where(CONFIG.CONFIG_KEY.eq(sysConfig.getConfigKey())) .count() > 0) { - coreService.updateConfig(sysConfig); + configService.updateById(sysConfig); } else { - coreService.insertConfig(sysConfig); + configService.save(sysConfig); } // 更新缓存 SpringUtils.getBean(RedisService.class) diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DeptServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DeptServiceImpl.java index 1bfb737..714ad9c 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DeptServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DeptServiceImpl.java @@ -1,7 +1,7 @@ package com.cpop.oam.business.service.impl; -import com.cpop.common.utils.StringUtils; -import com.cpop.common.utils.bean.BeanUtils; +import com.cpop.core.utils.StringUtils; +import com.cpop.core.utils.bean.BeanUtils; import com.cpop.core.base.exception.ServiceException; import com.cpop.core.utils.MessageUtils; import com.cpop.core.utils.SpringUtils; @@ -12,18 +12,11 @@ import com.cpop.oam.business.mapper.DeptMapper; import com.cpop.oam.business.service.DeptService; import com.cpop.oam.business.service.StaffMidDeptService; import com.cpop.oam.business.vo.DeptVo; -import com.cpop.oam.framework.config.wxCp.WxCpConfiguration; import com.mybatisflex.core.query.QueryWrapper; -import com.mybatisflex.core.row.RowUtil; import com.mybatisflex.spring.service.impl.ServiceImpl; -import lombok.extern.slf4j.Slf4j; -import me.chanjar.weixin.common.error.WxErrorException; -import me.chanjar.weixin.cp.api.WxCpService; -import me.chanjar.weixin.cp.bean.WxCpDepart; import org.springframework.stereotype.Service; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; import java.util.stream.Collectors; @@ -107,7 +100,7 @@ public class DeptServiceImpl extends ServiceImpl implements De * @Date: 2023/5/9 20:55 */ private boolean hasChild(List list, DeptVo t) { - return getChildList(list, t).size() > 0; + return !getChildList(list, t).isEmpty(); } /** diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DutyServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DutyServiceImpl.java index 9c03821..7b9376e 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DutyServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DutyServiceImpl.java @@ -1,10 +1,9 @@ package com.cpop.oam.business.service.impl; import com.cpop.api.tencent.wxWork.handler.WebHookSendHandler; -import com.cpop.common.utils.DateUtils; -import com.cpop.common.utils.StringUtils; import com.cpop.core.base.exception.ServiceException; import com.cpop.core.utils.SpringUtils; +import com.cpop.core.utils.StringUtils; import com.cpop.oam.business.bo.DutyBo; import com.cpop.oam.business.bo.DutyListBo; import com.cpop.oam.business.dto.StaffDto; @@ -22,14 +21,16 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.io.IOException; -import java.sql.Date; import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.time.temporal.TemporalAdjusters; -import java.util.*; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; import java.util.stream.Collectors; -import static com.cpop.core.base.table.table.SysUserTableDef.SYS_USER; +import static com.cpop.core.base.table.table.UserTableDef.USER; import static com.cpop.oam.business.entity.table.DutyTableDef.DUTY; import static com.cpop.oam.business.entity.table.StaffTableDef.STAFF; @@ -109,7 +110,8 @@ public class DutyServiceImpl extends ServiceImpl implements Du //开始日期,结束日期 String startDate = bo.getDutyDate().get(0); String endDate = bo.getDutyDate().get(1); - List dateList = DateUtils.getDatesBetweenTwoDatesT(Date.valueOf(startDate), Date.valueOf(endDate)); + //TODO: + /*List dateList = DateUtils.getDatesBetweenTwoDatesT(Date.valueOf(startDate), Date.valueOf(endDate)); //先删后存 this.remove(QueryWrapper.create().where(DUTY.DUTY_DATE.ge(startDate).and(DUTY.DUTY_DATE.le(endDate)))); List entityList = new ArrayList(); @@ -120,7 +122,7 @@ public class DutyServiceImpl extends ServiceImpl implements Du .setTechnologyStaffId(bo.getTechnologyStaffId()); entityList.add(entity); }); - this.saveBatch(entityList); + this.saveBatch(entityList);*/ } /** @@ -147,8 +149,8 @@ public class DutyServiceImpl extends ServiceImpl implements Du Duty one = this.queryChain().where(DUTY.DUTY_DATE.eq(now)).one(); if (one != null) { //获取当天技术值班人员 - StaffDto staff = DbChain.table(SYS_USER).select(SYS_USER.PHONE_NUMBER, STAFF.NAME).from(SYS_USER) - .leftJoin(STAFF).on(STAFF.USER_ID.eq(SYS_USER.ID)) + StaffDto staff = DbChain.table(USER).select(USER.PHONE_NUMBER, STAFF.NAME).from(USER) + .leftJoin(STAFF).on(STAFF.USER_ID.eq(USER.ID)) .where(STAFF.ID.eq(one.getTechnologyStaffId())).oneAs(StaffDto.class); //技术售后群提醒 try { diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/FinanceReimburseServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/FinanceReimburseServiceImpl.java index 3edd2f6..040802d 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/FinanceReimburseServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/FinanceReimburseServiceImpl.java @@ -1,15 +1,16 @@ package com.cpop.oam.business.service.impl; -import com.alibaba.fastjson.JSONObject; +import cn.dev33.satoken.stp.StpUtil; import com.cpop.api.tencent.wxWork.handler.WebHookSendHandler; -import com.cpop.common.utils.StringUtils; -import com.cpop.common.utils.bean.BeanUtils; import com.cpop.core.base.entity.PageDomain; import com.cpop.core.base.exception.ServiceException; -import com.cpop.core.base.table.SysConfig; +import com.cpop.core.base.table.Config; +import com.cpop.core.service.ConfigService; import com.cpop.core.service.RedisService; import com.cpop.core.utils.SpringUtils; import com.cpop.core.utils.SqlUtils; +import com.cpop.core.utils.StringUtils; +import com.cpop.core.utils.bean.BeanUtils; import com.cpop.oam.business.bo.*; import com.cpop.oam.business.entity.FinanceReimburse; import com.cpop.oam.business.entity.FinanceReimburseStage; @@ -36,7 +37,7 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; -import static com.cpop.core.base.table.table.SysUserTableDef.SYS_USER; +import static com.cpop.core.base.table.table.UserTableDef.USER; import static com.cpop.oam.business.entity.table.FinanceReimburseStageTableDef.FINANCE_REIMBURSE_STAGE; import static com.cpop.oam.business.entity.table.FinanceReimburseTableDef.FINANCE_REIMBURSE; import static com.cpop.oam.business.entity.table.FinanceReimburseTypeTableDef.FINANCE_REIMBURSE_TYPE; @@ -52,16 +53,15 @@ import static com.cpop.oam.business.entity.table.StaffTableDef.STAFF; public class FinanceReimburseServiceImpl extends ServiceImpl implements FinanceReimburseService { /** - * @Description: 财务报销模块-报销分页列表 + * 财务报销模块-报销分页列表 * @param bo 请求参数 - * @return: R> - * @Author: DB - * @Date: 2023/5/30 15:44 + * @return R> + * @author DB + * @since 2023/5/30 15:44 **/ @Override public Page getFinanceReimbursePage(FinanceReimbursePageBo bo) { //获取当前登陆用户信息 - LoginUser loginUser = SecurityUtils.getInstance().getLoginUser(); PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); QueryWrapper queryWrapper = QueryWrapper.create(); if (bo.getStatus()!=null){ @@ -80,9 +80,9 @@ public class FinanceReimburseServiceImpl extends ServiceImpl> - * @Author: DB - * @Date: 2023/5/30 15:44 + * @return R> + * @author DB + * @since 2023/5/30 15:44 **/ @Override public Page getReimburseAuditPage(FinanceReimburseAuditPageBo bo) { @@ -106,7 +106,7 @@ public class FinanceReimburseServiceImpl extends ServiceImpl phoneList = new ArrayList<>(); - phoneList.add(loginUserInfo.getString("phoneNumber")); + phoneList.add(StpUtil.getSession().getString("phone")); // 获取审核管理员手机号 RedisService redisService = SpringUtils.getBean(RedisService.class); CommonService commonService = SpringUtils.getBean(CommonService.class); String auditStaffPhone = redisService.getCacheObject(commonService.getCacheKey(OamConfigEnum.CANCEL_AFTER_VERIFICATION_STAFF_PHONE.getKey())); if (StringUtils.isBlank(auditStaffPhone)) { - SysConfig sysConfig = SpringUtils.getBean(CoreService.class).selectConfigByKey(commonService.getCacheKey(OamConfigEnum.AUDIT_STAFF_PHONE.getKey())); - auditStaffPhone = sysConfig.getConfigValue(); + Config config = SpringUtils.getBean(ConfigService.class).getById(commonService.getCacheKey(OamConfigEnum.AUDIT_STAFF_PHONE.getKey())); + auditStaffPhone = config.getConfigValue(); redisService.setCacheObject(commonService.getCacheKey(OamConfigEnum.AUDIT_STAFF_PHONE.getKey()), auditStaffPhone); } phoneList.add(auditStaffPhone); @@ -220,10 +219,9 @@ public class FinanceReimburseServiceImpl extends ServiceImpl list = this.list(QueryWrapper.create() - .where(FINANCE_REIMBURSE.STAFF_ID.eq(loginUserInfo.getString("id"))) - .and(FINANCE_REIMBURSE.STATUS.ne(-1))); + .where(FINANCE_REIMBURSE.STAFF_ID.eq(StpUtil.getLoginIdAsString()) + .and(FINANCE_REIMBURSE.STATUS.ne(-1)))); //统计 ReimbursePersonStatisticVo vo = new ReimbursePersonStatisticVo(); vo.setUnPay(list.stream().filter(s -> s.getStatus() != 2).map(FinanceReimburse::getPrice).reduce(BigDecimal.ZERO, BigDecimal::add)); diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/SignGoalServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/SignGoalServiceImpl.java index 4b7137f..11482e6 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/SignGoalServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/SignGoalServiceImpl.java @@ -1,6 +1,6 @@ package com.cpop.oam.business.service.impl; -import com.cpop.common.utils.bean.BeanUtils; +import com.cpop.core.utils.bean.BeanUtils; import com.cpop.core.base.entity.PageDomain; import com.cpop.core.base.exception.ServiceException; import com.cpop.core.utils.SpringUtils; diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/StaffServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/StaffServiceImpl.java index 56e53d1..451fe88 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/StaffServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/StaffServiceImpl.java @@ -1,17 +1,17 @@ package com.cpop.oam.business.service.impl; +import cn.dev33.satoken.secure.BCrypt; +import cn.dev33.satoken.stp.StpUtil; import com.alibaba.fastjson.JSONObject; -import com.cpop.common.constant.Constants; -import com.cpop.common.utils.StringUtils; -import com.cpop.common.utils.bean.BeanUtils; import com.cpop.core.base.entity.PageDomain; -import com.cpop.core.base.entity.loginInfo.OamStaffLoginInfo; import com.cpop.core.base.enums.UserType; import com.cpop.core.base.exception.ServiceException; -import com.cpop.core.base.table.SysUser; +import com.cpop.core.base.table.User; +import com.cpop.core.constant.Constants; import com.cpop.core.service.RedisService; +import com.cpop.core.service.UserService; import com.cpop.core.utils.*; -import com.cpop.core.utils.SqlUtils; +import com.cpop.core.utils.bean.BeanUtils; import com.cpop.core.utils.uuid.IdUtils; import com.cpop.jambox.framework.constant.JamboxCloudUrl; import com.cpop.oam.business.bo.*; @@ -20,10 +20,7 @@ import com.cpop.oam.business.entity.StaffMidDept; import com.cpop.oam.business.mapper.StaffMapper; import com.cpop.oam.business.service.StaffMidDeptService; import com.cpop.oam.business.service.StaffService; -import com.cpop.oam.business.vo.StaffInfoVo; -import com.cpop.oam.business.vo.StaffPageVo; -import com.cpop.oam.business.vo.StaffVo; -import com.cpop.oam.business.vo.SysOperationLogVo; +import com.cpop.oam.business.vo.*; import com.cpop.oam.framework.constant.OamConfigKey; import com.cpop.oam.framework.enums.OamConfigEnum; import com.mybatisflex.core.paginate.Page; @@ -33,7 +30,6 @@ 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.springframework.security.crypto.bcrypt.BCrypt; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.client.RestTemplate; @@ -44,8 +40,8 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import static com.cpop.core.base.table.table.SysOperationLogTableDef.SYS_OPERATION_LOG; -import static com.cpop.core.base.table.table.SysUserTableDef.SYS_USER; +import static com.cpop.core.base.table.table.OperationLogTableDef.OPERATION_LOG; +import static com.cpop.core.base.table.table.UserTableDef.USER; import static com.cpop.oam.business.entity.table.StaffMidDeptTableDef.STAFF_MID_DEPT; import static com.cpop.oam.business.entity.table.StaffTableDef.STAFF; import static com.cpop.system.business.entity.table.RoleTableDef.ROLE; @@ -63,9 +59,9 @@ import static com.mybatisflex.core.query.QueryMethods.groupConcat; public class StaffServiceImpl extends ServiceImpl implements StaffService { /** - * @descriptions 查询员工分页列表 + * 查询员工分页列表 * @author DB - * @date 2023/09/07 18:11 + * @since 2023/09/07 18:11 * @param bo 请求参数 * @return com.mybatisflex.core.paginate.Page */ @@ -76,12 +72,12 @@ public class StaffServiceImpl extends ServiceImpl implements , QueryWrapper.create() //去重 .select(distinct(STAFF.ALL_COLUMNS)) - .select(SYS_USER.USER_NAME,SYS_USER.NICK_NAME, SYS_USER.EMAIL, SYS_USER.PHONE_NUMBER, SYS_USER.SEX, SYS_USER.AVATAR, SYS_USER.STATUS, SYS_USER.PASSWORD) + .select(USER.USER_NAME,USER.NICK_NAME, USER.EMAIL, USER.PHONE_NUMBER, USER.SEX, USER.AVATAR, USER.STATUS, USER.PASSWORD) .select(ROLE.ROLE_NAME) //将部门id分组 .select(groupConcat(STAFF_MID_DEPT.DEPT_ID).as(StaffPageVo::getDeptId)) .from(STAFF) - .leftJoin(SYS_USER).on(SYS_USER.ID.eq(STAFF.USER_ID)) + .leftJoin(USER).on(USER.ID.eq(STAFF.USER_ID)) .leftJoin(ROLE).on(ROLE.ID.eq(STAFF.ROLE_ID)) //左联中间表 .leftJoin(STAFF_MID_DEPT).on(STAFF_MID_DEPT.STAFF_ID.eq(STAFF.ID)) @@ -91,46 +87,37 @@ public class StaffServiceImpl extends ServiceImpl implements .and(STAFF.STAFF_TYPE.eq(bo.getStaffType())) //部门id .and(STAFF_MID_DEPT.DEPT_ID.eq(bo.getDeptId())) - .and(SYS_USER.USER_NAME.ne(Constants.SUPER_ADMIN).or(SYS_USER.USER_NAME.isNull())) + .and(USER.USER_NAME.ne(Constants.SUPER_ADMIN).or(USER.USER_NAME.isNull())) .groupBy(STAFF.ID) , StaffPageVo.class); } /** - * @descriptions 新增员工 + * 新增员工 * @author DB - * @date 2023/09/08 14:12 + * @since 2023/09/08 14:12 * @param bo 请求参数 */ @Override @Transactional(rollbackFor = Exception.class) - public SysUser insertStaff(StaffBo bo) { + public User insertStaff(StaffBo bo) { //先添加用户信息 - SysUser sysUser; + User user; if (validatedUserInfo(bo)) { throw new ServiceException(MessageUtils.message("i18n_alert_userOrPhoneOrEmailIsExist")); } else { //用户名-手机-邮箱都需要做唯一校验 - sysUser = BeanUtils.mapToClass(bo, SysUser.class); + user = BeanUtils.mapToClass(bo, User.class); //解密与重设密码 - sysUser.setRsaPassword(bo.getPassword()); - decryptAndResetPasswords(sysUser); - sysUser.setId(IdUtils.fastSimpleUUID()); - //获取当前创建人员信息 - LoginUser loginUser = SecurityUtils.getInstance().getLoginUser(); - if (loginUser == null){ - sysUser.setCreateUserId("1"); - sysUser.setUpdateUserId("1"); - } else { - sysUser.setCreateUserId(loginUser.getUserId()); - sysUser.setUpdateUserId(loginUser.getUserId()); - } - sysUser.setUserType(UserType.OAM_USER.toString()); - SpringUtils.getBean(CoreService.class).insertSysUser(sysUser); + user.setRsaPassword(bo.getPassword()); + decryptAndResetPasswords(user); + user.setId(IdUtils.fastSimpleUUID()); + user.setUserType(UserType.OAM_USER.toString()); + SpringUtils.getBean(UserService.class).save(user); } //再添加员工信息 Staff sysStaff = BeanUtils.mapToClass(bo, Staff.class); - sysStaff.setUserId(sysUser.getId()); + sysStaff.setUserId(user.getId()); this.save(sysStaff); //批量导入部门信息 List deptList = Arrays.asList(bo.getDeptId().split(",")); @@ -141,23 +128,23 @@ public class StaffServiceImpl extends ServiceImpl implements staffMidDeptList.add(staffMidDept); }); SpringUtils.getBean(StaffMidDeptService.class).saveBatch(staffMidDeptList); - return sysUser; + return user; } /** - * @Description: 用户名-手机-邮箱都需要做唯一校验 + * 用户名-手机-邮箱都需要做唯一校验 * @param bo 请求参数 * @return Boolean 通过/未通过 - * @Author DB - * @Date: 2023/5/11 11:02 + * @author DB + * @since 2023/5/11 11:02 **/ private Boolean validatedUserInfo(StaffBo bo) { long count = this.count(QueryWrapper.create() //用户名 - .where(SYS_USER.USER_NAME.eq(bo.getUserName()).or(SYS_USER.PHONE_NUMBER.eq(bo.getPhoneNumber()))) + .where(USER.USER_NAME.eq(bo.getUserName()).or(USER.PHONE_NUMBER.eq(bo.getPhoneNumber()))) //手机号 - .and(SYS_USER.USER_TYPE.eq(UserType.OAM_USER.toString())) - .from(SYS_USER)); + .and(USER.USER_TYPE.eq(UserType.OAM_USER.toString())) + .from(USER)); if (StringUtils.isNotBlank(bo.getUserId())) { return count > 1; } else { @@ -166,22 +153,22 @@ public class StaffServiceImpl extends ServiceImpl implements } /** - * @Description: 解密与重设密码 - * @param sysUser 系统用户 - * @Author: DB - * @Date: 2023/5/11 11:03 + * 解密与重设密码 + * @param user 系统用户 + * @author DB + * @since 2023/5/11 11:03 **/ - private void decryptAndResetPasswords(SysUser sysUser) { + private void decryptAndResetPasswords(User user) { //先用rsa解密 - String password = SpringUtils.getBean(RsaUtils.class).decrypt(sysUser.getPassword()); + String password = SpringUtils.getBean(RsaUtils.class).decrypt(user.getPassword()); //再加密 - sysUser.setPassword(SpringUtils.getBean(PasswordEncoder.class).encode(password)); + user.setPassword(BCrypt.hashpw(password, BCrypt.gensalt())); } /** - * @descriptions 修改员工 + * 修改员工 * @author DB - * @date 2023/09/08 15:21 + * @since 2023/09/08 15:21 * @param bo 请求参数 */ @Override @@ -191,13 +178,11 @@ public class StaffServiceImpl extends ServiceImpl implements if (validatedUserInfo(bo)) { throw new ServiceException(MessageUtils.message("i18n_alert_userOrPhoneOrEmailIsExist")); } else { - SysUser sysUser = BeanUtils.mapToClass(bo, SysUser.class); - sysUser.setId(bo.getUserId()); + User user = BeanUtils.mapToClass(bo, User.class); + user.setId(bo.getUserId()); //密码在这里不做修改 - sysUser.setPassword(null); - sysUser.setUpdateUserId(SecurityUtils.getInstance().getLoginUser().getUserId()); - sysUser.setUpdateTime(LocalDateTime.now()); - SpringUtils.getBean(CoreService.class).updateSysUser(sysUser); + user.setPassword(null); + SpringUtils.getBean(UserService.class).updateById(user); } //再修改员工信息 Staff sysStaff = BeanUtils.mapToClass(bo, Staff.class); @@ -218,17 +203,17 @@ public class StaffServiceImpl extends ServiceImpl implements RedisService redisService = SpringUtils.getBean(RedisService.class); JSONObject jsonObject = redisService.getCacheObject(UserType.OAM_USER.getKey() + bo.getUserName()); if (jsonObject != null) { - LoginUser loginUser = jsonObject.getObject("user", LoginUser.class); - OamStaffLoginInfo staffLoginInfo = BeanUtils.mapToClass(bo, OamStaffLoginInfo.class); + //TODO:修改缓存 + /* OamStaffLoginInfo staffLoginInfo = BeanUtils.mapToClass(bo, OamStaffLoginInfo.class); loginUser.setUser(staffLoginInfo); - redisService.setCacheObject(UserType.OAM_USER.getKey() + loginUser.getUsername(), loginUser); + redisService.setCacheObject(UserType.OAM_USER.getKey() + loginUser.getUsername(), loginUser);*/ } } /** - * @descriptions 删除员工 + * 删除员工 * @author DB - * @date 2023/09/08 17:43 + * @since 2023/09/08 17:43 * @param id 主键 */ @Override @@ -239,18 +224,17 @@ public class StaffServiceImpl extends ServiceImpl implements throw new ServiceException("获取员工信息失败,请联系相关人员"); } //删除用户 - SpringUtils.getBean(CoreService.class).removeSysUserById(sysStaff.getUserId()); + SpringUtils.getBean(UserService.class).removeById(sysStaff.getUserId()); //删除员工 this.removeById(id); } /** - * @Description: 用户名是否存在 + * 用户名是否存在 * @param username 用户名 * @param id 主键 - * @return: R - * @Author: DB - * @Date: 2023/5/11 10:09 + * @author DB + * @since 2023/5/11 10:09 **/ @Override public void isAccountExist(String username, String id) { @@ -258,75 +242,73 @@ public class StaffServiceImpl extends ServiceImpl implements return; } if (this.count(QueryWrapper.create() - .where(SYS_USER.USER_NAME.eq(username)) - .and(SYS_USER.ID.ne(id))) > 0) { + .where(USER.USER_NAME.eq(username)) + .and(USER.ID.ne(id))) > 0) { throw new ServiceException(MessageUtils.message("i18n_alert_userIsExist")); } } /** - * @Description: 获取员工信息 + * 获取员工信息 * @param id 主键 - * @return: StaffInfoVo - * @Author: DB - * @Date: 2023/5/17 10:36 + * @return StaffInfoVo + * @author DB + * @since 2023/5/17 10:36 **/ @Override public StaffInfoVo getStaffInfo(String id) { return this.getOneAs(QueryWrapper.create() .select(STAFF.ALL_COLUMNS) - .select(SYS_USER.USER_NAME, SYS_USER.NICK_NAME, SYS_USER.SEX, SYS_USER.PHONE_NUMBER, SYS_USER.ID.as("userId")) + .select(USER.USER_NAME, USER.NICK_NAME, USER.SEX, USER.PHONE_NUMBER, USER.ID.as("userId")) .select(ROLE.ROLE_NAME) .from(STAFF) - .leftJoin(SYS_USER).on(SYS_USER.ID.eq(STAFF.USER_ID)) + .leftJoin(USER).on(USER.ID.eq(STAFF.USER_ID)) .leftJoin(ROLE).on(ROLE.ID.eq(STAFF.ROLE_ID)) .where(STAFF.ID.eq(id)) , StaffInfoVo.class); } /** - * @Description: 获取用户操作日志分页 + * 获取用户操作日志分页 * @param bo 请求参数 - * @return: R> - * @Author: DB - * @Date: 2023/5/12 14:30 + * @return R> + * @author DB + * @since 2023/5/12 14:30 **/ @Override - public Page getUserLogList(SysUserLogBo bo) { + public Page getUserLogList(UserLogBo bo) { QueryWrapper queryWrapper = QueryWrapper.create(); - queryWrapper.and(SYS_OPERATION_LOG.OPERATION_USER_ID.eq(bo.getUserId())) - .and(SYS_OPERATION_LOG.OPERATION_USER_NAME.like(bo.getOperationUserName())) - .and(SYS_OPERATION_LOG.DEV_IP.eq(bo.getDevIp())) - .and(SYS_OPERATION_LOG.RESULT.eq(bo.getResult())) - .and(SYS_OPERATION_LOG.LEVEL.eq(bo.getLevel())) - .and(SYS_OPERATION_LOG.ACTION_TYPE.eq(bo.getActionType())); + queryWrapper.and(OPERATION_LOG.OPERATION_USER_ID.eq(bo.getUserId())) + .and(OPERATION_LOG.OPERATION_USER_NAME.like(bo.getOperationUserName())) + .and(OPERATION_LOG.DEV_IP.eq(bo.getDevIp())) + .and(OPERATION_LOG.RESULT.eq(bo.getResult())) + .and(OPERATION_LOG.LEVEL.eq(bo.getLevel())) + .and(OPERATION_LOG.ACTION_TYPE.eq(bo.getActionType())); if (StringUtils.isNotBlank(bo.getFieldTime())){ String[] split = bo.getFieldTime().split(","); DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); - queryWrapper.and(SYS_OPERATION_LOG.CREATE_TIME.ge(LocalDateTime.parse(split[0], df))) - .and(SYS_OPERATION_LOG.CREATE_TIME.le(LocalDateTime.parse(split[1], df))); + queryWrapper.and(OPERATION_LOG.CREATE_TIME.ge(LocalDateTime.parse(split[0], df))) + .and(OPERATION_LOG.CREATE_TIME.le(LocalDateTime.parse(split[1], df))); } PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); Page page = Db.paginate("cp_sys_operation_log", pageDomain.getPageNum(), pageDomain.getPageSize(), queryWrapper); - return page.map(row -> row.toEntity(SysOperationLogVo.class)); + return page.map(row -> row.toEntity(OperationLogVo.class)); } /** - * @Description: 修改系统用户密码 + * 修改系统用户密码 * @param bo 请求参数 - * @return: AjaxResult - * @Author: DB - * @Date: 2023/5/12 16:00 + * @author DB + * @since 2023/5/12 16:00 **/ @Override public void modifyUserPassword(ModifyUserPasswordBo bo) { //只允许超级管理员或自己修改面膜 - LoginUser loginUser = SecurityUtils.getInstance().getLoginUser(); - String userName = loginUser.getUsername(); + String userName = StpUtil.getSession().getString("username"); //同数据库密码进行比较 - SysUser user = DbChain.table(SYS_USER) - .where(SYS_USER.ID.eq(bo.getUserId())) - .oneAs(SysUser.class); + User user = DbChain.table(USER) + .where(USER.ID.eq(bo.getUserId())) + .oneAs(User.class); if (!StringUtils.equals(userName, Constants.SUPER_ADMIN) || !StringUtils.equals(userName, user.getUserName())) { throw new ServiceException("非超级管理员不允许修改他人密码"); } @@ -335,9 +317,9 @@ public class StaffServiceImpl extends ServiceImpl implements String oldPassword = rsaUtils.decrypt(bo.getOldPassword()); if (BCrypt.checkpw(oldPassword, user.getPassword())) { //存入系统 - DbChain.table(SYS_USER) - .set(SYS_USER.PASSWORD,SpringUtils.getBean(PasswordEncoder.class).encode(rsaUtils.decrypt(bo.getNewPassword()))) - .where(SYS_USER.ID.eq(bo.getUserId())) + DbChain.table(USER) + .set(USER.PASSWORD,SpringUtils.getBean(BCrypt.hashpw(bo.getNewPassword(), BCrypt.gensalt()))) + .where(USER.ID.eq(bo.getUserId())) .update(); } else { throw new ServiceException(MessageUtils.message("i18n_alert_oldPasswordIsWrong")); @@ -345,20 +327,20 @@ public class StaffServiceImpl extends ServiceImpl implements } /** - * @Description: 查询服务员工列表 - * @return: R> - * @Author: DB - * @Date: 2023/5/11 17:49 + * 查询服务员工列表 + * @return R> + * @author DB + * @since 2023/5/11 17:49 **/ @Override public List getServiceStaffList() { return SpringUtils.getBean(StaffService.class).listAs(QueryWrapper.create() .select(STAFF.ID, STAFF.NAME, STAFF.USER_ID, STAFF.STAFF_TYPE) .from(STAFF) - .leftJoin(SYS_USER).on(SYS_USER.ID.eq(STAFF.USER_ID)) + .leftJoin(USER).on(USER.ID.eq(STAFF.USER_ID)) .where(STAFF.STAFF_TYPE.eq(1)) //不查询停用的员工 - .and(SYS_USER.STATUS.eq(true)), + .and(USER.STATUS.eq(true)), StaffVo.class); } @@ -375,11 +357,11 @@ public class StaffServiceImpl extends ServiceImpl implements return this.listAs(QueryWrapper.create() .select(STAFF.ID, STAFF.NAME, STAFF.USER_ID, STAFF.STAFF_TYPE) .from(STAFF) - .leftJoin(SYS_USER).on(SYS_USER.ID.eq(STAFF.USER_ID)) + .leftJoin(USER).on(USER.ID.eq(STAFF.USER_ID)) .where(STAFF.STAFF_TYPE.eq(0)) //不查询停用的员工 - .and(SYS_USER.STATUS.eq(true)) - .and(SYS_USER.PHONE_NUMBER.notIn(Arrays.asList(testStaffPhone.split(",")))), + .and(USER.STATUS.eq(true)) + .and(USER.PHONE_NUMBER.notIn(Arrays.asList(testStaffPhone.split(",")))), StaffVo.class); } @@ -393,15 +375,15 @@ public class StaffServiceImpl extends ServiceImpl implements public void changeOperationStatus(OperationStatusBo bo) { //获取用户信息 Staff staff = this.getById(bo.getId()); - SysUser sysUser = DbChain.table(SYS_USER).select(SYS_USER.PHONE_NUMBER).where(SYS_USER.ID.eq(staff.getUserId())).oneAs(SysUser.class); + User User = DbChain.table(USER).select(USER.PHONE_NUMBER).where(USER.ID.eq(staff.getUserId())).oneAs(User.class); JSONObject jsonBody = new JSONObject(); if (bo.getIsOperation()) { jsonBody.put("_type", "oamAdd"); jsonBody.put("name", staff.getName()); - jsonBody.put("phone", sysUser.getPhoneNumber()); + jsonBody.put("phone", User.getPhoneNumber()); } else { jsonBody.put("_type", "oamDel"); - jsonBody.put("phone", sysUser.getPhoneNumber()); + jsonBody.put("phone", User.getPhoneNumber()); } JSONObject jsonObject = SpringUtils.getBean(RestTemplate.class).postForObject(JamboxCloudUrl.COMMON_CARD_URL, jsonBody, JSONObject.class); assert jsonObject != null; 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 31f61c6..3140e72 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 @@ -2,18 +2,19 @@ package com.cpop.oam.business.service.impl; import cn.binarywang.wx.miniapp.api.WxMaQrcodeService; import cn.binarywang.wx.miniapp.api.WxMaService; -import com.alibaba.fastjson.JSONObject; +import cn.dev33.satoken.stp.StpUtil; import com.cpop.api.tencent.wxWork.handler.WebHookSendHandler; -import com.cpop.common.constant.Constants; -import com.cpop.common.utils.StringUtils; -import com.cpop.common.utils.bean.BeanUtils; import com.cpop.core.base.entity.PageDomain; import com.cpop.core.base.enums.UserType; import com.cpop.core.base.exception.ServiceException; -import com.cpop.core.base.table.SysConfig; +import com.cpop.core.base.table.Config; +import com.cpop.core.constant.Constants; +import com.cpop.core.service.ConfigService; import com.cpop.core.service.RedisService; import com.cpop.core.utils.SpringUtils; import com.cpop.core.utils.SqlUtils; +import com.cpop.core.utils.StringUtils; +import com.cpop.core.utils.bean.BeanUtils; import com.cpop.oam.business.bo.TaskDemandBo; import com.cpop.oam.business.bo.TaskDemandPageBo; import com.cpop.oam.business.bo.TaskDemandUrgentBo; @@ -39,7 +40,7 @@ import java.util.ArrayList; import java.util.Base64; import java.util.List; -import static com.cpop.core.base.table.table.SysUserTableDef.SYS_USER; +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; @@ -91,8 +92,7 @@ public class TaskDemandServiceImpl extends ServiceImpl item.field(TaskDemandPageVo::getRecordStaffName) - .queryWrapper(recordStaffName -> queryWrapper.create() + .queryWrapper(recordStaffName -> QueryWrapper.create() .select(STAFF.NAME.as(TaskDemandPageVo::getRecordStaffName)) .from(STAFF) .where(STAFF.ID.eq(recordStaffName.getRecordStaffId()))), // 更新人员 item -> item.field(TaskDemandPageVo::getUpdateStaffName) - .queryWrapper(updateStaffName -> queryWrapper.create() + .queryWrapper(updateStaffName -> QueryWrapper.create() .select(STAFF.NAME.as(TaskDemandPageVo::getUpdateStaffName)) .from(STAFF) - .leftJoin(SYS_USER) - .on(SYS_USER.ID.eq(STAFF.USER_ID)) - .where(SYS_USER.ID.eq(updateStaffName.getUpdateUserId())) - .and(SYS_USER.USER_TYPE.eq(UserType.OAM_USER.toString())) + .leftJoin(USER) + .on(USER.ID.eq(STAFF.USER_ID)) + .where(USER.ID.eq(updateStaffName.getUpdateUserId())) + .and(USER.USER_TYPE.eq(UserType.OAM_USER.toString())) .limit(1)), // 任务接收员工 item -> item.field(TaskDemandPageVo::getResponsibleStaffName).queryWrapper(responsibleStaffName -> { if (StringUtils.isNotBlank(responsibleStaffName.getResponsibleStaffId())) { - return queryWrapper.create() + return QueryWrapper.create() .select(STAFF.NAME.as(TaskDemandPageVo::getResponsibleStaffId)) .from(STAFF) .where(STAFF.ID.eq(responsibleStaffName.getResponsibleStaffId())); @@ -170,9 +170,8 @@ public class TaskDemandServiceImpl extends ServiceImpl phoneList = new ArrayList(); phoneList.add(auditStaffPhone); // 同时通知发起人 - phoneList.add(loginUserInfo.getString("phoneNumber")); + phoneList.add(StpUtil.getSession().getString("phone")); try { SpringUtils.getBean(WebHookSendHandler.class) .webHookSendText(WebHookKeyConstant.PRODUCT_BOT, 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 407eb50..be98d2f 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 @@ -1,9 +1,7 @@ package com.cpop.oam.business.service.impl; -import com.alibaba.fastjson.JSONObject; +import cn.dev33.satoken.stp.StpUtil; import com.cpop.api.tencent.wxWork.handler.WebHookSendHandler; -import com.cpop.core.utils.StringUtils; -import com.cpop.core.utils.bean.BeanUtils; import com.cpop.core.base.entity.PageDomain; import com.cpop.core.base.exception.ServiceException; import com.cpop.core.base.exception.UtilException; @@ -11,6 +9,8 @@ import com.cpop.core.service.RedisService; import com.cpop.core.utils.QuartzUtils; import com.cpop.core.utils.SpringUtils; import com.cpop.core.utils.SqlUtils; +import com.cpop.core.utils.StringUtils; +import com.cpop.core.utils.bean.BeanUtils; import com.cpop.oam.business.bo.*; import com.cpop.oam.business.dto.TaskWorkOrderReceiveDealPauseDto; import com.cpop.oam.business.entity.*; @@ -42,7 +42,7 @@ import java.time.temporal.TemporalAdjusters; import java.util.*; import java.util.stream.Collectors; -import static com.cpop.core.base.table.table.SysUserTableDef.SYS_USER; +import static com.cpop.core.base.table.table.UserTableDef.USER; import static com.cpop.oam.business.entity.table.DutyTableDef.DUTY; import static com.cpop.oam.business.entity.table.StaffTableDef.STAFF; import static com.cpop.oam.business.entity.table.TaskStaffGroupTableDef.TASK_STAFF_GROUP; @@ -223,15 +223,13 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl phoneList = new ArrayList(); - phoneList.add(loginUserInfo.getString("phoneNumber")); + phoneList.add(StpUtil.getSession().getString("phone")); phoneList.add(technologyStaffInfo.getPhoneNumber()); try { SpringUtils.getBean(WebHookSendHandler.class) @@ -482,14 +480,14 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl phoneList = new ArrayList<>(); StaffService staffService = SpringUtils.getBean(StaffService.class); - if (loginUserInfo.getInteger("staffType") == 1) { + if (StpUtil.getSession().getInt("staffType") == 1) { // 负责人手机号 StaffInfoVo responsibleStaff = staffService.getStaffInfo(task.getResponsibleStaffId()); phoneList.add(responsibleStaff.getPhoneNumber()); @@ -528,7 +525,7 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl phoneList = new ArrayList<>(); phoneList.add(responsibleStaff.getPhoneNumber()); - phoneList.add(loginUserInfo.getString("phoneNumber")); + phoneList.add(StpUtil.getSession().getString("phone")); // 通知记录 try { SpringUtils.getBean(WebHookSendHandler.class) @@ -671,7 +666,7 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl staffMap = staffService.listAs(QueryWrapper.create() .select(STAFF.ID, STAFF.NAME) - .select(SYS_USER.PHONE_NUMBER.as(StaffInfoVo::getPhoneNumber)) + .select(USER.PHONE_NUMBER.as(StaffInfoVo::getPhoneNumber)) .from(STAFF) - .leftJoin(SYS_USER) - .on(SYS_USER.ID.eq(STAFF.USER_ID)) + .leftJoin(USER) + .on(USER.ID.eq(STAFF.USER_ID)) .where(STAFF.ID.in(staffIds)), StaffInfoVo.class) .stream().collect(Collectors.toMap(StaffInfoVo::getId, item -> item)); @@ -798,7 +792,7 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl getPersonWorkOrder() { // 获取值班员工 DutyService dutyService = SpringUtils.getBean(DutyService.class); - Duty duty = dutyService.getOne(QueryWrapper.create().where(DUTY.DUTY_DATE.eq(DateUtils.getDate()))); + Duty duty = dutyService.getOne(QueryWrapper.create().where(DUTY.DUTY_DATE.eq(LocalDate.now()))); if (duty == null) { throw new ServiceException("当天没有值班员工,请联系相关人员添加值班信息!"); } @@ -841,9 +835,8 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl staffMap = staffService.listAs(QueryWrapper.create() .select(STAFF.ID, STAFF.NAME) - .select(SYS_USER.PHONE_NUMBER.as(StaffInfoVo::getPhoneNumber)) + .select(USER.PHONE_NUMBER.as(StaffInfoVo::getPhoneNumber)) .from(STAFF) - .leftJoin(SYS_USER) - .on(SYS_USER.ID.eq(STAFF.USER_ID)) + .leftJoin(USER) + .on(USER.ID.eq(STAFF.USER_ID)) .where(STAFF.ID.in(staffIds)), StaffInfoVo.class) .stream().collect(Collectors.toMap(StaffInfoVo::getId, item -> item)); @@ -1051,24 +1043,23 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl staffMap = staffService.listAs(QueryWrapper.create() .select(STAFF.ID, STAFF.NAME) - .select(SYS_USER.PHONE_NUMBER.as(StaffInfoVo::getPhoneNumber)) + .select(USER.PHONE_NUMBER.as(StaffInfoVo::getPhoneNumber)) .from(STAFF) - .leftJoin(SYS_USER) - .on(SYS_USER.ID.eq(STAFF.USER_ID)) + .leftJoin(USER) + .on(USER.ID.eq(STAFF.USER_ID)) .where(STAFF.ID.in(staffIds)), StaffInfoVo.class) .stream().collect(Collectors.toMap(StaffInfoVo::getId, item -> item)); diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/ClueFollowUpRecordVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/ClueFollowUpRecordVo.java index c564383..7f508f7 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/ClueFollowUpRecordVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/ClueFollowUpRecordVo.java @@ -1,8 +1,7 @@ package com.cpop.oam.business.vo; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; @@ -15,31 +14,31 @@ import java.time.LocalDateTime; */ @Data @Accessors(chain = true) -@ApiModel(value = "线索跟进记录返回对象") +@Schema(description = "线索跟进记录返回对象") public class ClueFollowUpRecordVo { /** * 记录内容 */ - @ApiModelProperty(value = "记录内容") + @Schema(description = "记录内容") private String recordContent; /** * 创建时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime createTime; /** * 员工名 */ - @ApiModelProperty(value = "员工名") + @Schema(description = "员工名") private String staffName; /** * 记录文件 */ - @ApiModelProperty(value = "记录文件") + @Schema(description = "记录文件") private String recordFileUrl; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/CluePageVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/CluePageVo.java index c2c0f04..6efea4d 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/CluePageVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/CluePageVo.java @@ -1,12 +1,10 @@ package com.cpop.oam.business.vo; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; -import javax.validation.constraints.NotNull; import java.time.LocalDate; import java.time.LocalDateTime; @@ -17,130 +15,130 @@ import java.time.LocalDateTime; */ @Data @Accessors(chain = true) -@ApiModel(value = "线索分页返回对象") +@Schema(description = "线索分页返回对象") public class CluePageVo { /** * 主键 */ - @ApiModelProperty(value = "主键") + @Schema(description = "主键") private String id; /** * 校区id */ - @ApiModelProperty(value = "校区id") + @Schema(description = "校区id") private String storeId; /** * 校区名 */ - @ApiModelProperty(value = "校区名") + @Schema(description = "校区名") private String storeName; /** * 品牌id */ - @ApiModelProperty(value = "品牌id") + @Schema(description = "品牌id") private String brandName; /** * 地区(省/市) */ - @ApiModelProperty(value = "地区(省/市)") + @Schema(description = "地区(省/市)") private String city; /** * 店铺/校区地址 */ - @ApiModelProperty(value = "店铺/校区地址") + @Schema(description = "店铺/校区地址") private String storeAddr; /** * 负责人 */ - @ApiModelProperty(value = "负责人") + @Schema(description = "负责人") private String personCharge; /** * 手机号 */ - @ApiModelProperty(value = "手机号") + @Schema(description = "手机号") private String phone; /** * 创建时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime createTime; /** * 负责员工id */ - @ApiModelProperty(value = "负责员工id") + @Schema(description = "负责员工id") private String responsibleStaffId; /** * 负责员工id */ - @ApiModelProperty(value = "负责员工id") + @Schema(description = "负责员工id") private String responsibleStaffName; /** * 开发员工id */ - @ApiModelProperty(value = "开发员工id") + @Schema(description = "开发员工id") private String devStaffId; /** * 开发员工id */ - @ApiModelProperty(value = "开发员工id") + @Schema(description = "开发员工id") private String devStaffName; /** * 最后跟进时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - @ApiModelProperty(value = "最后跟进时间") + @Schema(description = "最后跟进时间") private LocalDateTime lastFollowUpTime; /** * 最后跟进内容 */ - @ApiModelProperty(value = "最后跟进内容") + @Schema(description = "最后跟进内容") private String lastFollowUpContent; /** * 接收时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - @ApiModelProperty(value = "接收时间") + @Schema(description = "接收时间") private LocalDateTime receiptTime; /** * 跟进间隔 */ - @ApiModelProperty(value = "跟进间隔") + @Schema(description = "跟进间隔") private Integer followUpInterval; /** * 签约间隔 */ - @ApiModelProperty(value = "签约间隔") + @Schema(description = "签约间隔") private Integer signInterval; /** * 脱离间隔 */ - @ApiModelProperty(value = "脱离间隔") + @Schema(description = "脱离间隔") private Integer putOffInterval; /** * 签约状态(0:待签约;1:已签约;2:警告线索) */ - @ApiModelProperty(value = "签约状态(0:待签约;1:已签约;2:警告线索)") + @Schema(description = "签约状态(0:待签约;1:已签约;2:警告线索)") private Integer clueStatus; /** @@ -153,19 +151,19 @@ public class CluePageVo { * 最后接收时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - @ApiModelProperty(value = "最后接收时间") + @Schema(description = "最后接收时间") private String lastReceiptTime; /** * 最后接收员工id */ - @ApiModelProperty(value = "最后接收员工id") + @Schema(description = "最后接收员工id") private String lastReceiptStaffId; /** * 最后接收员工姓名 */ - @ApiModelProperty(value = "最后接收员工姓名") + @Schema(description = "最后接收员工姓名") private String lastReceiptStaffName; /** @@ -177,7 +175,7 @@ public class CluePageVo { /** * 更进状态(0:待跟进、1:已歇业、2:无法联系、3:无意向、4:已拜访、5:跟进中、6:已成交 */ - @ApiModelProperty(value = "更进状态(0:待跟进、1:已歇业、2:无法联系、3:无意向、4:已拜访、5:跟进中、6:已成交") + @Schema(description = "更进状态(0:待跟进、1:已歇业、2:无法联系、3:无意向、4:已拜访、5:跟进中、6:已成交") private Integer followStatus; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/CluePutOffVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/CluePutOffVo.java index 8f0b7de..a210ec5 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/CluePutOffVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/CluePutOffVo.java @@ -1,8 +1,7 @@ package com.cpop.oam.business.vo; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; import org.springframework.format.annotation.DateTimeFormat; @@ -17,62 +16,62 @@ import java.time.LocalDateTime; */ @Data @Accessors(chain = true) -@ApiModel(value = "线索延期返回对象") +@Schema(description = "线索延期返回对象") public class CluePutOffVo { /** * 延期到期日期 */ @DateTimeFormat(pattern = "yyyy-MM-dd") - @ApiModelProperty(value = "延期到期日期") + @Schema(description = "延期到期日期") private LocalDate putOffDate; /** * 审核状态(0:待审核,1:审核通过,2:审核不通过) */ - @ApiModelProperty(value = "审核状态(0:待审核,1:审核通过,2:审核不通过)") + @Schema(description = "审核状态(0:待审核,1:审核通过,2:审核不通过)") private Integer auditStatus; /** * 延迟员工id */ - @ApiModelProperty(value = "延迟员工id") + @Schema(description = "延迟员工id") private String putOffStaffId; /** * 延迟员工名 */ - @ApiModelProperty(value = "延迟员工名") + @Schema(description = "延迟员工名") private String putOffStaffName; /** * 审核员工id */ - @ApiModelProperty(value = "审核员工id") + @Schema(description = "审核员工id") private String auditStaffId; /** * 审核员工名 */ - @ApiModelProperty(value = "审核员工名") + @Schema(description = "审核员工名") private String auditStaffName; /** * 延期原因 */ - @ApiModelProperty(value = "延期原因") + @Schema(description = "延期原因") private String putOffReason; /** * 创建时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime createTime; /** * 延期附件 */ - @ApiModelProperty(value = "延期附件") + @Schema(description = "延期附件") private String putOffFileUrl; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/ClueRecordVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/ClueRecordVo.java index dc80995..98c718d 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/ClueRecordVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/ClueRecordVo.java @@ -1,8 +1,7 @@ package com.cpop.oam.business.vo; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; @@ -15,25 +14,25 @@ import java.time.LocalDateTime; */ @Data @Accessors(chain = true) -@ApiModel(value = "线索记录返回对象") +@Schema(description = "线索记录返回对象") public class ClueRecordVo { /** * 记录内容 */ - @ApiModelProperty(value = "记录内容") + @Schema(description = "记录内容") private String recordContent; /** * 记录类型(0:创建;1:领取;2:跟进;3:转交;4:脱离;5:成交;6:更新) */ - @ApiModelProperty(value = "记录类型(0:创建;1:领取;2:跟进;3:转交;4:脱离;5:成交;6:更新)") + @Schema(description = "记录类型(0:创建;1:领取;2:跟进;3:转交;4:脱离;5:成交;6:更新)") private Integer recordType; /** * 创建时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime createTime; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/ClueUpdateVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/ClueUpdateVo.java index 8d01d62..8681e1f 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/ClueUpdateVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/ClueUpdateVo.java @@ -1,8 +1,7 @@ package com.cpop.oam.business.vo; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; @@ -17,102 +16,102 @@ import java.util.List; */ @Data @Accessors(chain = true) -@ApiModel(value = "线索更新记录返回对象") +@Schema(description = "线索更新记录返回对象") public class ClueUpdateVo { /** * 店铺/校区地址 */ - @ApiModelProperty("店铺/校区地址") + @Schema(description = "店铺/校区地址") private String storeAddr; /** * 负责人 */ - @ApiModelProperty("负责人") + @Schema(description ="负责人") private String personCharge; /** * 手机号 */ - @ApiModelProperty("手机号") + @Schema(description ="手机号") private String phone; /** * 店铺/校区名 */ - @ApiModelProperty("店铺/校区名") + @Schema(description ="店铺/校区名") private String storeName; /** * 更新记录 */ - @ApiModelProperty("更新记录") + @Schema(description ="更新记录") private List recordVos; @Data - @ApiModel(value = "线索更新记录返回对象") + @Schema(description = "线索更新记录返回对象") public static class ClueUpdateRecordVo{ /** * 旧校区名 */ - @ApiModelProperty("旧校区名") + @Schema(description ="旧校区名") private String oldStoreName; /** * 新校区名 */ - @ApiModelProperty("新校区名") + @Schema(description ="新校区名") private String newStoreName; /** * 旧负责人 */ - @ApiModelProperty("旧负责人") + @Schema(description ="旧负责人") private String oldPersonCharge; /** * 新负责人 */ - @ApiModelProperty("新负责人") + @Schema(description ="新负责人") private String newPersonCharge; /** * 旧手机号 */ - @ApiModelProperty("旧手机号") + @Schema(description ="旧手机号") private String oldPhone; /** * 新手机号 */ - @ApiModelProperty("新手机号") + @Schema(description ="新手机号") private String newPhone; /** * 旧校区地址 */ - @ApiModelProperty("旧校区地址") + @Schema(description ="旧校区地址") private String oldStoreAddr; /** * 新校区地址 */ - @ApiModelProperty("新校区地址") + @Schema(description ="新校区地址") private String newStoreAddr; /** * 创建时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime createTime; /** * 员工名 */ - @ApiModelProperty(value = "员工名") + @Schema(description = "员工名") private String staffName; } } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/ConfigInfoVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/ConfigInfoVo.java index 203972a..1076925 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/ConfigInfoVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/ConfigInfoVo.java @@ -1,12 +1,9 @@ package com.cpop.oam.business.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; -import java.io.Serializable; - /** * @author: DB * @Date: 2023/07/07/16:43 @@ -14,26 +11,24 @@ import java.io.Serializable; */ @Data @Accessors(chain = true) -@ApiModel(value = "SysConfigInfoVo对象", description = "系统配置信息") -public class ConfigInfoVo implements Serializable { - - private static final long serialVersionUID = 1L; +@Schema(description = "系统配置信息") +public class ConfigInfoVo { /** * 任务审核员工手机号 */ - @ApiModelProperty("任务审核员工手机号") + @Schema(description ="任务审核员工手机号") private String auditStaffPhone; /** * 核销管理员工手机号 */ - @ApiModelProperty("核销管理员工手机号") + @Schema(description ="核销管理员工手机号") private String cancelAfterVerificationStaffPhone; /** * 测试员工手机号 */ - @ApiModelProperty("测试员工手机号") + @Schema(description ="测试员工手机号") private String testStaffPhone; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/DataImportPageVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/DataImportPageVo.java index 995d4b2..03ef199 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/DataImportPageVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/DataImportPageVo.java @@ -1,8 +1,7 @@ package com.cpop.oam.business.vo; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; @@ -15,49 +14,49 @@ import java.time.LocalDateTime; */ @Data @Accessors(chain = true) -@ApiModel(value = "DataImportPageVo对象") +@Schema(description = "DataImportPageVo对象") public class DataImportPageVo { /** * 主键 */ - @ApiModelProperty(value = "主键") + @Schema(description = "主键") private String id; /** * 品牌id */ - @ApiModelProperty(value = "品牌") + @Schema(description = "品牌") private String brandName; /** * 校区 */ - @ApiModelProperty(value = "校区") + @Schema(description = "校区") private String storeName; /** * 导入文件地址 */ - @ApiModelProperty(value = "导入文件地址") + @Schema(description = "导入文件地址") private String fileUrl; /** * 是否清空 */ - @ApiModelProperty(value = "是否清空") + @Schema(description = "是否清空") private Boolean isClear; /** * 导入状态 */ - @ApiModelProperty(value = "导入状态") + @Schema(description = "导入状态") private Boolean importStatus; /** * 上传时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") - @ApiModelProperty(value = "上传时间") + @Schema(description = "上传时间") private LocalDateTime createTime; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/DeptVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/DeptVo.java index 88c2a7d..4d26013 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/DeptVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/DeptVo.java @@ -2,12 +2,10 @@ package com.cpop.oam.business.vo; import com.fasterxml.jackson.annotation.JsonFormat; import com.mybatisflex.annotation.Column; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; -import java.io.Serializable; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; @@ -20,76 +18,74 @@ import java.util.List; */ @Data @Accessors(chain = true) -@ApiModel(value = "SysDept对象", description = "部门表") -public class DeptVo implements Serializable { - - private static final long serialVersionUID = 1L; +@Schema(description = "部门表") +public class DeptVo { /** * 部门id */ - @ApiModelProperty("部门id") + @Schema(description ="部门id") private String id; /** * 父部门id */ - @ApiModelProperty("父部门id") + @Schema(description ="父部门id") private String parentId; /** * 部门名称 */ - @ApiModelProperty("部门名称") + @Schema(description ="部门名称") private String name; /** * 排序 */ - @ApiModelProperty("排序") + @Schema(description ="排序") private Integer orderNo; /** * 负责人 */ - @ApiModelProperty("负责人") + @Schema(description ="负责人") private String leader; /** * 电话 */ - @ApiModelProperty("电话") + @Schema(description ="电话") private String phone; /** * 邮箱 */ - @ApiModelProperty("邮箱") + @Schema(description ="邮箱") private String email; /** * 部门状态:1正常,0停用 */ - @ApiModelProperty("部门状态:1正常,0停用") + @Schema(description ="部门状态:1正常,0停用") private Boolean status; /** * 子部门 */ @Column(ignore = true) - @ApiModelProperty("子部门集合") + @Schema(description ="子部门集合") private List children = new ArrayList(); /** * 更新时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") - @ApiModelProperty("更新时间") + @Schema(description ="更新时间") private LocalDateTime updateTime; /** * 备注 */ - @ApiModelProperty("备注") + @Schema(description ="备注") private String remark; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/DutyListVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/DutyListVo.java index 1597617..5454756 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/DutyListVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/DutyListVo.java @@ -1,12 +1,10 @@ package com.cpop.oam.business.vo; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; -import java.io.Serializable; import java.time.LocalDate; /** @@ -17,51 +15,49 @@ import java.time.LocalDate; */ @Data @Accessors(chain = true) -@ApiModel(value = "DutyList返回对象", description = "值班表") -public class DutyListVo implements Serializable { - - private static final long serialVersionUID = 1L; +@Schema(description = "值班表") +public class DutyListVo { /** * 主键 */ - @ApiModelProperty("主键") + @Schema(description ="主键") private String id; /** * 服务员工id */ - @ApiModelProperty("服务员工id") + @Schema(description ="服务员工id") private String serviceStaffId; /** * 服务员工名称 */ - @ApiModelProperty("服务员工名称") + @Schema(description ="服务员工名称") private String serviceStaffName; /** * 技术员工id */ - @ApiModelProperty("技术员工id") + @Schema(description ="技术员工id") private String technologyStaffId; /** * 技术员工名称 */ - @ApiModelProperty("技术员工名称") + @Schema(description ="技术员工名称") private String technologyStaffName; /** * 值班日期 */ - @ApiModelProperty("值班日期") + @Schema(description ="值班日期") @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8") private LocalDate dutyDate; /** * 备注 */ - @ApiModelProperty("备注") + @Schema(description ="备注") private String remark; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/FinanceReimburseAuditPageVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/FinanceReimburseAuditPageVo.java index d7529b9..4dd757e 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/FinanceReimburseAuditPageVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/FinanceReimburseAuditPageVo.java @@ -1,12 +1,10 @@ package com.cpop.oam.business.vo; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; -import java.io.Serializable; import java.math.BigDecimal; import java.sql.Date; import java.time.LocalDateTime; @@ -18,80 +16,80 @@ import java.time.LocalDateTime; */ @Data @Accessors(chain = true) -@ApiModel(value = "FinanceReimbursePageVo对象", description = "财务报销返回参数") -public class FinanceReimburseAuditPageVo implements Serializable { +@Schema(description = "财务报销返回参数") +public class FinanceReimburseAuditPageVo { /** * 主键 */ - @ApiModelProperty("主键") + @Schema(description ="主键") private String id; /** * 提交人 */ - @ApiModelProperty("提交人id") + @Schema(description ="提交人id") private String staffId; /** * 提交人 */ - @ApiModelProperty("提交人") + @Schema(description ="提交人") private String staffName; /** * 状态:0:审批中;1:下款中;2:已下发-1:驳回 */ - @ApiModelProperty("状态:0:审批中;1:下款中;2:已下发-1:驳回") + @Schema(description ="状态:0:审批中;1:下款中;2:已下发-1:驳回") private Integer status; /** * 申请类型id */ - @ApiModelProperty("申请类型id") + @Schema(description ="申请类型id") private String typeId; /** * 申请类型 */ - @ApiModelProperty("申请类型") + @Schema(description ="申请类型") private String typeName; /** * 报销日期 */ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") - @ApiModelProperty("报销日期") + @Schema(description ="报销日期") private Date reportDate; /** * 申请说明 */ - @ApiModelProperty("申请说明") + @Schema(description ="申请说明") private String remarks; /** * 申请金额 */ - @ApiModelProperty("申请金额") + @Schema(description ="申请金额") private BigDecimal price; /** * 附件 */ - @ApiModelProperty("附件") + @Schema(description ="附件") private String attachmentUrl; /** * 驳回原因 */ - @ApiModelProperty("驳回原因") + @Schema(description ="驳回原因") private String rejectReason; /** * 创建时间 */ - @ApiModelProperty("创建时间") + @Schema(description ="创建时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") private LocalDateTime createTime; diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/FinanceReimbursePageVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/FinanceReimbursePageVo.java index 2809cb0..c341c05 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/FinanceReimbursePageVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/FinanceReimbursePageVo.java @@ -1,12 +1,10 @@ package com.cpop.oam.business.vo; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; -import java.io.Serializable; import java.math.BigDecimal; import java.sql.Date; import java.time.LocalDateTime; @@ -18,80 +16,80 @@ import java.time.LocalDateTime; */ @Data @Accessors(chain = true) -@ApiModel(value = "FinanceReimbursePageVo对象", description = "财务报销返回参数") -public class FinanceReimbursePageVo implements Serializable { +@Schema(description = "财务报销返回参数") +public class FinanceReimbursePageVo { /** * 主键 */ - @ApiModelProperty("主键") + @Schema(description ="主键") private String id; /** * 提交人 */ - @ApiModelProperty("提交人id") + @Schema(description ="提交人id") private String staffId; /** * 提交人 */ - @ApiModelProperty("提交人") + @Schema(description ="提交人") private String staffName; /** * 状态:0:审批中;1:下款中;2:已下发-1:驳回 */ - @ApiModelProperty("状态:0:审批中;1:下款中;2:已下发-1:驳回") + @Schema(description ="状态:0:审批中;1:下款中;2:已下发-1:驳回") private Integer status; /** * 申请类型id */ - @ApiModelProperty("申请类型id") + @Schema(description ="申请类型id") private String typeId; /** * 申请类型 */ - @ApiModelProperty("申请类型") + @Schema(description ="申请类型") private String typeName; /** * 报销日期 */ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") - @ApiModelProperty("报销日期") + @Schema(description ="报销日期") private Date reportDate; /** * 申请说明 */ - @ApiModelProperty("申请说明") + @Schema(description ="申请说明") private String remarks; /** * 申请金额 */ - @ApiModelProperty("申请金额") + @Schema(description ="申请金额") private BigDecimal price; /** * 附件 */ - @ApiModelProperty("附件") + @Schema(description ="附件") private String attachmentUrl; /** * 驳回原因 */ - @ApiModelProperty("驳回原因") + @Schema(description ="驳回原因") private String rejectReason; /** * 创建时间 */ - @ApiModelProperty("创建时间") + @Schema(description ="创建时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") private LocalDateTime createTime; diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/FinanceReimburseRecordListVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/FinanceReimburseRecordListVo.java index 722c66d..005e780 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/FinanceReimburseRecordListVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/FinanceReimburseRecordListVo.java @@ -1,11 +1,9 @@ package com.cpop.oam.business.vo; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -import java.io.Serializable; import java.math.BigDecimal; import java.time.LocalDateTime; @@ -15,31 +13,31 @@ import java.time.LocalDateTime; * @description */ @Data -@ApiModel(value = "财务报销记录列表") -public class FinanceReimburseRecordListVo implements Serializable { +@Schema(description = "财务报销记录列表") +public class FinanceReimburseRecordListVo { /** * id */ - @ApiModelProperty(value = "id") + @Schema(description = "id") private String id; /** * 报销记录id */ - @ApiModelProperty(value = "报销记录id") + @Schema(description = "报销记录id") private String financeReimburseId; /** * 阶段金额 */ - @ApiModelProperty(value = "阶段金额") + @Schema(description = "阶段金额") private BigDecimal stageAmount; /** * 下发时间 */ - @ApiModelProperty(value = "下发时间") + @Schema(description = "下发时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") private LocalDateTime paymentTime; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/FinanceReimburseTypeListVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/FinanceReimburseTypeListVo.java index 37f687b..cfec74c 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/FinanceReimburseTypeListVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/FinanceReimburseTypeListVo.java @@ -1,12 +1,9 @@ package com.cpop.oam.business.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; -import java.io.Serializable; - /** * @author DB * @createTime 2023/09/20 17:20 @@ -14,18 +11,18 @@ import java.io.Serializable; */ @Data @Accessors(chain = true) -@ApiModel(value = "FinanceReimbursePageVo对象", description = "财务报销返回参数") -public class FinanceReimburseTypeListVo implements Serializable { +@Schema(description = "财务报销返回参数") +public class FinanceReimburseTypeListVo { /** * 主键 */ - @ApiModelProperty("主键") + @Schema(description ="主键") private String id; /** * 类型名 */ - @ApiModelProperty("类型名") + @Schema(description ="类型名") private String typeName; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/SysOperationLogVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/OperationLogVo.java similarity index 59% rename from Cpop-Oam/src/main/java/com/cpop/oam/business/vo/SysOperationLogVo.java rename to Cpop-Oam/src/main/java/com/cpop/oam/business/vo/OperationLogVo.java index 05b0b64..273c282 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/SysOperationLogVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/OperationLogVo.java @@ -1,12 +1,10 @@ package com.cpop.oam.business.vo; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; -import java.io.Serializable; import java.time.LocalDateTime; /** @@ -17,81 +15,79 @@ import java.time.LocalDateTime; */ @Data @Accessors(chain = true) -@ApiModel(value = "SysOperationLog对象", description = "操作日志表") -public class SysOperationLogVo implements Serializable { - - private static final long serialVersionUID = 1L; +@Schema(description = "操作日志表") +public class OperationLogVo { /** * ID */ - @ApiModelProperty("ID") + @Schema(description ="ID") private String id; /** * 用户ID */ - @ApiModelProperty("用户ID") + @Schema(description ="用户ID") private String operationUserId; /** * 操作用户 */ - @ApiModelProperty("操作用户") + @Schema(description ="操作用户") private String operationUserName; /** * 操作码 */ - @ApiModelProperty("操作码") + @Schema(description ="操作码") private Integer code; /** * 操作信息 */ - @ApiModelProperty("操作信息") + @Schema(description ="操作信息") private String info; /** * 操作终端的IP地址 */ - @ApiModelProperty("操作终端的IP地址") + @Schema(description ="操作终端的IP地址") private String devIp; /** * 结果 -1:失败 1:成功 */ - @ApiModelProperty("结果 -1:失败 1:成功") + @Schema(description ="结果 -1:失败 1:成功") private Boolean result; /** * 日志级别,0-提示,1-一般,2-危险,3-高危 */ - @ApiModelProperty("日志级别,0-提示,1-一般,2-危险,3-高危") + @Schema(description ="日志级别,0-提示,1-一般,2-危险,3-高危") private Integer level; /** * 行为类别,1-一般行为,2-异常行为 */ - @ApiModelProperty("行为类别,1-一般行为,2-异常行为") + @Schema(description ="行为类别,1-一般行为,2-异常行为") private Integer actionType; /** * 失败原因 */ - @ApiModelProperty("失败原因") + @Schema(description ="失败原因") private String failReason; /** * 操作描述 */ - @ApiModelProperty("操作描述") + @Schema(description ="操作描述") private String description; /** * 创建时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") - @ApiModelProperty("创建时间") + @Schema(description ="创建时间") private LocalDateTime createTime; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/PersonSignGoalVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/PersonSignGoalVo.java index 46717d2..0f90973 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/PersonSignGoalVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/PersonSignGoalVo.java @@ -1,7 +1,6 @@ package com.cpop.oam.business.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; @@ -12,30 +11,30 @@ import lombok.experimental.Accessors; */ @Data @Accessors(chain = true) -@ApiModel(value = "个人签约目标返回对象") +@Schema(description = "个人签约目标返回对象") public class PersonSignGoalVo { /** * 目标数 */ - @ApiModelProperty(value = "目标数") + @Schema(description = "目标数") private Integer goalNum = 0; /** * 完成数 */ - @ApiModelProperty(value = "完成数") + @Schema(description = "完成数") private Integer finishNum = 0; /** * 签约数 */ - @ApiModelProperty(value = "签约数") + @Schema(description = "签约数") private Integer signNum = 0; /** * 总数 */ - @ApiModelProperty(value = "总数") + @Schema(description = "总数") private Integer totalNum = 0; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/PersonTaskPageVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/PersonTaskPageVo.java index e7a43a3..4f1702c 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/PersonTaskPageVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/PersonTaskPageVo.java @@ -2,12 +2,10 @@ package com.cpop.oam.business.vo; import com.cpop.core.anno.StringArrayConvert; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; -import java.io.Serializable; import java.time.LocalDate; import java.time.LocalDateTime; @@ -19,77 +17,75 @@ import java.time.LocalDateTime; */ @Data @Accessors(chain = true) -@ApiModel(value = "Task对象", description = "OAM-任务表") -public class PersonTaskPageVo implements Serializable { - - private static final long serialVersionUID = 1L; +@Schema(description = "OAM-任务表") +public class PersonTaskPageVo { /** * 主键 */ - @ApiModelProperty("主键") + @Schema(description ="主键") private String id; /** * 主要负责员工名 */ - @ApiModelProperty("主要负责员工名") + @Schema(description ="主要负责员工名") private String responsibleStaffName; /** * 任务状态(-1:失败;0:待审核;1:待接受;2:进行中;3:已完成;4:逾期;) */ - @ApiModelProperty("任务状态(-1:失败;0:待审核;1:待接受;2:进行中;3:已完成;4:逾期;5:暂停;6:逾期完成;7:接收超时;8:待部署;9:待归档;10:审核不通过)") + @Schema(description ="任务状态(-1:失败;0:待审核;1:待接受;2:进行中;3:已完成;4:逾期;5:暂停;6:逾期完成;7:接收超时;8:待部署;9:待归档;10:审核不通过)") private Integer taskStatus; /** * 任务项(0:待开发;1:待测试:2:待部署;3:已归档) */ - @ApiModelProperty("任务项(0:待开发;1:待测试:2:待部署;3:已归档)") + @Schema(description ="任务项(0:待开发;1:待测试:2:待部署;3:已归档)") private Integer taskItem; /** * 任务项(0:待开发;1:待测试:2:待部署;3:已归档) */ @StringArrayConvert - @ApiModelProperty("任务进度(0:开发文档;1:原型涉及;2:UI涉及;3:前端开发;4:后端开发)") + @Schema(description ="任务进度(0:开发文档;1:原型涉及;2:UI涉及;3:前端开发;4:后端开发)") private String taskProgress; /** * 主体 */ - @ApiModelProperty("主体") + @Schema(description ="主体") private String subject; /** * 任务内容 */ - @ApiModelProperty("任务内容") + @Schema(description ="任务内容") private String taskContent; /** * 任务评级(0:A;1:B;2:C;3:D;4:E) */ - @ApiModelProperty("任务评级(0:A;1:B;2:C;3:D;4:E)") + @Schema(description ="任务评级(0:A;1:B;2:C;3:D;4:E)") private String taskRating; /** * 个人任务绩点 */ - @ApiModelProperty("个人任务绩点") + @Schema(description ="个人任务绩点") private Integer gradePoint; /** * 预期完成日期 */ - @ApiModelProperty("预期完成日期") + @Schema(description ="预期完成日期") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private LocalDate expectedCompletionDate; /** * 任务接收时间 */ - @ApiModelProperty("任务接收时间") + @Schema(description ="任务接收时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime taskReceiptTime; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/PutOffAuditPageVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/PutOffAuditPageVo.java index 064aca1..229f242 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/PutOffAuditPageVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/PutOffAuditPageVo.java @@ -1,8 +1,7 @@ package com.cpop.oam.business.vo; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; @@ -16,100 +15,100 @@ import java.time.LocalDateTime; */ @Data @Accessors(chain = true) -@ApiModel(value = "线索延期返回对象") +@Schema(description = "线索延期返回对象") public class PutOffAuditPageVo { /** * 主键 */ - @ApiModelProperty(value = "主键") + @Schema(description = "主键") private String id; /** * 校区id */ - @ApiModelProperty(value = "校区id") + @Schema(description = "校区id") private String storeId; /** * 校区名 */ - @ApiModelProperty(value = "校区名") + @Schema(description = "校区名") private String storeName; /** * 品牌id */ - @ApiModelProperty(value = "品牌id") + @Schema(description = "品牌id") private String brandName; /** * 地区(省/市) */ - @ApiModelProperty(value = "地区(省/市)") + @Schema(description = "地区(省/市)") private String city; /** * 店铺/校区地址 */ - @ApiModelProperty(value = "店铺/校区地址") + @Schema(description = "店铺/校区地址") private String storeAddr; /** * 负责人 */ - @ApiModelProperty(value = "负责人") + @Schema(description = "负责人") private String personCharge; /** * 手机号 */ - @ApiModelProperty(value = "手机号") + @Schema(description = "手机号") private String phone; /** * 创建时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime createTime; /** * 到期日期 */ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") - @ApiModelProperty(value = "到期日期") + @Schema(description = "到期日期") private LocalDate expireDate; /** * 延期原因 */ - @ApiModelProperty(value = "延期原因") + @Schema(description = "延期原因") private String putOffReason; /** * 延期文件路径 */ - @ApiModelProperty(value = "延期文件路径") + @Schema(description = "延期文件路径") private String putOffFileUrl; /** * 延期到期日期 */ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") - @ApiModelProperty(value = "延期到期日期") + @Schema(description = "延期到期日期") private LocalDate putOffDate; /** * 延迟员工id */ - @ApiModelProperty(value = "延迟员工id") + @Schema(description = "延迟员工id") private String putOffStaffId; /** * 延迟员工id */ - @ApiModelProperty(value = "延迟员工id") + @Schema(description = "延迟员工id") private String putOffStaffName; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/ReimbursePersonStatisticVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/ReimbursePersonStatisticVo.java index d5ec5c7..56fe8c3 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/ReimbursePersonStatisticVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/ReimbursePersonStatisticVo.java @@ -1,11 +1,9 @@ package com.cpop.oam.business.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; -import java.io.Serializable; import java.math.BigDecimal; /** @@ -15,18 +13,18 @@ import java.math.BigDecimal; */ @Data @Accessors(chain = true) -@ApiModel(value = "个人报销统计") -public class ReimbursePersonStatisticVo implements Serializable { +@Schema(description = "个人报销统计") +public class ReimbursePersonStatisticVo { /** * 未核销金额 */ - @ApiModelProperty("未核销金额") + @Schema(description = "未核销金额") private BigDecimal unPay; /** * 已核销金额 */ - @ApiModelProperty("已核销金额") + @Schema(description = "已核销金额") private BigDecimal havePay; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/RoleVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/RoleVo.java index 0defb20..6c32c5b 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/RoleVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/RoleVo.java @@ -1,12 +1,9 @@ package com.cpop.oam.business.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; -import java.io.Serializable; - /** * 系统角色表Vo输出 * @@ -15,45 +12,43 @@ import java.io.Serializable; */ @Data @Accessors(chain = true) -@ApiModel(value = "SysRole对象", description = "角色信息") -public class RoleVo implements Serializable { - - private static final long serialVersionUID = 1L; +@Schema(description = "角色信息") +public class RoleVo { /** * 主键 */ - @ApiModelProperty("主键") + @ Schema(description ="主键") private String id; /** * 角色名称 */ - @ApiModelProperty("角色名称") + @ Schema(description ="角色名称") private String roleName; /** * 角色值 */ - @ApiModelProperty("角色值") + @ Schema(description ="角色值") private String roleValue; /** * 状态 0:禁用 1:正常 */ - @ApiModelProperty("状态 0:禁用 1:正常") + @ Schema(description ="状态 0:禁用 1:正常") private Boolean status; /** * 备注 */ - @ApiModelProperty("备注") + @ Schema(description ="备注") private String remark; /** * 排序 */ - @ApiModelProperty("排序") + @ Schema(description ="排序") private Integer orderNo; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/SignGoalConfigInfoVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/SignGoalConfigInfoVo.java index 3970b52..7cfbda3 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/SignGoalConfigInfoVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/SignGoalConfigInfoVo.java @@ -1,12 +1,9 @@ package com.cpop.oam.business.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; -import javax.validation.constraints.NotNull; - /** * @author DB * @version 1.0.0 @@ -14,19 +11,19 @@ import javax.validation.constraints.NotNull; */ @Data @Accessors(chain = true) -@ApiModel(value = "SignGoalConfigInfoVo对象", description = "签约指标配置信息") +@Schema(description = "签约指标配置信息") public class SignGoalConfigInfoVo { /** * 跟进间隔 */ - @ApiModelProperty(value = "跟进间隔") + @Schema(description = "跟进间隔") private String followUpInterval; /** * 签约间隔 */ - @ApiModelProperty(value = "签约间隔") + @Schema(description = "签约间隔") private String signInterval; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/SignGoalPageVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/SignGoalPageVo.java index d5c8bd8..c6b45ad 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/SignGoalPageVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/SignGoalPageVo.java @@ -1,8 +1,6 @@ package com.cpop.oam.business.vo; -import com.mybatisflex.annotation.Id; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; @@ -15,180 +13,180 @@ import java.util.List; */ @Data @Accessors(chain = true) -@ApiModel(value = "SignGoalPageVo对象", description = "签约目标分页对象") +@Schema(description = "签约目标分页对象") public class SignGoalPageVo { /** * 主键 */ - @ApiModelProperty(value = "主键") + @Schema(description = "主键") private String id; /** * 员工名 */ - @ApiModelProperty(value = "员工名") + @Schema(description = "员工名") private String staffName; /** * 员工Id */ - @ApiModelProperty(value = "员工Id") + @Schema(description = "员工Id") private String staffId; /** * 签约区域 */ - @ApiModelProperty(value = "签约区域") + @Schema(description = "签约区域") private List signArea; /** * 年份 */ - @ApiModelProperty(value = "年份") + @Schema(description = "年份") private Integer year; /** * 一月目标 */ - @ApiModelProperty(value = "一月目标") + @Schema(description = "一月目标") private Integer janGoal; /** * 一月完成 */ - @ApiModelProperty(value = "一月完成") + @Schema(description = "一月完成") private Integer janFinish; /** * 二月目标 */ - @ApiModelProperty(value = "二月目标") + @Schema(description = "二月目标") private Integer febGoal; /** * 二月完成 */ - @ApiModelProperty(value = "二月完成") + @Schema(description = "二月完成") private Integer febFinish; /** * 三月目标 */ - @ApiModelProperty(value = "三月目标") + @Schema(description = "三月目标") private Integer marGoal; /** * 三月完成 */ - @ApiModelProperty(value = "三月完成") + @Schema(description = "三月完成") private Integer marFinish; /** * 四月目标 */ - @ApiModelProperty(value = "四月目标") + @Schema(description = "四月目标") private Integer aprGoal; /** * 四月完成 */ - @ApiModelProperty(value = "四月完成") + @Schema(description = "四月完成") private Integer aprFinish; /** * 五月目标 */ - @ApiModelProperty(value = "五月目标") + @Schema(description = "五月目标") private Integer mayGoal; /** * 五月完成 */ - @ApiModelProperty(value = "五月完成") + @Schema(description = "五月完成") private Integer mayFinish; /** * 六月目标 */ - @ApiModelProperty(value = "六月目标") + @Schema(description = "六月目标") private Integer junGoal; /** * 六月完成 */ - @ApiModelProperty(value = "六月完成") + @Schema(description = "六月完成") private Integer junFinish; /** * 七月目标 */ - @ApiModelProperty(value = "七月目标") + @Schema(description = "七月目标") private Integer julGoal; /** * 七月完成 */ - @ApiModelProperty(value = "七月完成") + @Schema(description = "七月完成") private Integer julFinish; /** * 八月目标 */ - @ApiModelProperty(value = "八月目标") + @Schema(description = "八月目标") private Integer augGoal; /** * 八月完成 */ - @ApiModelProperty(value = "八月完成") + @Schema(description = "八月完成") private Integer augFinish; /** * 九月目标 */ - @ApiModelProperty(value = "九月目标") + @Schema(description = "九月目标") private Integer sepGoal; /** * 九月完成 */ - @ApiModelProperty(value = "九月完成") + @Schema(description = "九月完成") private Integer sepFinish; /** * 十月目标 */ - @ApiModelProperty(value = "十月目标") + @Schema(description = "十月目标") private Integer octGoal; /** * 十月完成 */ - @ApiModelProperty(value = "十月完成") + @Schema(description = "十月完成") private Integer octFinish; /** * 十一月目标 */ - @ApiModelProperty(value = "十一月目标") + @Schema(description = "十一月目标") private Integer novGoal; /** * 十一月完成 */ - @ApiModelProperty(value = "十一月完成") + @Schema(description = "十一月完成") private Integer novFinish; /** * 十二月目标 */ - @ApiModelProperty(value = "十二月目标") + @Schema(description = "十二月目标") private Integer decGoal; /** * 十二月完成 */ - @ApiModelProperty(value = "十二月完成") + @Schema(description = "十二月完成") private Integer decFinish; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/StaffInfoVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/StaffInfoVo.java index 8669541..9f266f2 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/StaffInfoVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/StaffInfoVo.java @@ -1,12 +1,9 @@ package com.cpop.oam.business.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; -import java.io.Serializable; - /** * Description: * date: 2023/5/17 10:34 @@ -15,68 +12,66 @@ import java.io.Serializable; */ @Data @Accessors(chain = true) -@ApiModel(value = "StaffInfo对象", description = "员工信息") -public class StaffInfoVo implements Serializable { - - private static final long serialVersionUID = 1L; +@Schema(description = "员工信息") +public class StaffInfoVo { /** * 主键 */ - @ApiModelProperty("主键") + @Schema(description ="主键") private String id; /** * 姓名 */ - @ApiModelProperty("姓名") + @Schema(description ="姓名") private String name; /** * 用户id */ - @ApiModelProperty("用户id") + @Schema(description ="用户id") private String userId; /** * 用户名 */ - @ApiModelProperty(value = "用户名") + @Schema(description = "用户名") private String userName; /** * 昵称 */ - @ApiModelProperty(value = "昵称") + @Schema(description = "昵称") private String nickName; /** * 手机号 */ - @ApiModelProperty(value = "手机号") + @Schema(description = "手机号") private String phoneNumber; /** * 性别(0:男;1:女) */ - @ApiModelProperty(value = "性别(0:男;1:女)") + @Schema(description = "性别(0:男;1:女)") private Boolean sex; /** * 角色id */ - @ApiModelProperty(value = "角色id") + @Schema(description = "角色id") private String roleId; /** * 角色名 */ - @ApiModelProperty(value = "角色名") + @Schema(description = "角色名") private String roleName; /** * 头像 */ - @ApiModelProperty(value = "头像") + @Schema(description = "头像") private String avatar; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/StaffPageVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/StaffPageVo.java index c1851d2..63d7968 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/StaffPageVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/StaffPageVo.java @@ -2,12 +2,10 @@ package com.cpop.oam.business.vo; import com.cpop.core.anno.StringArrayConvert; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; -import java.io.Serializable; import java.time.LocalDateTime; /** @@ -18,112 +16,110 @@ import java.time.LocalDateTime; */ @Data @Accessors(chain = true) -@ApiModel(value = "系统员工返回对象", description = "系统用户(员工)信息") -public class StaffPageVo implements Serializable { - - private static final long serialVersionUID = 1L; +@Schema(description = "系统用户(员工)信息") +public class StaffPageVo { /** * 主键 */ - @ApiModelProperty("主键") + @Schema(description ="主键") private String id; /** * 姓名 */ - @ApiModelProperty("姓名") + @Schema(description ="姓名") private String name; /** * 用户名 */ - @ApiModelProperty("用户名") + @Schema(description ="用户名") private String userName; /** * 部门id */ @StringArrayConvert - @ApiModelProperty("部门id") + @Schema(description ="部门id") private String deptId; /** * 用户id */ - @ApiModelProperty("用户id") + @Schema(description ="用户id") private String userId; /** * 员工类型 */ - @ApiModelProperty("员工类型") + @Schema(description ="员工类型") private Integer staffType; /** * 昵称 */ - @ApiModelProperty("昵称") + @Schema(description ="昵称") private String nickName; /** * 邮箱 */ - @ApiModelProperty("邮箱") + @Schema(description ="邮箱") private String email; /** * 手机号 */ - @ApiModelProperty("手机号") + @Schema(description ="手机号") private String phoneNumber; /** * 性别(0:男;1:女) */ - @ApiModelProperty("性别(0:男;1:女)") + @Schema(description ="性别(0:男;1:女)") private Boolean sex; /** * 头像 */ - @ApiModelProperty("头像") + @Schema(description ="头像") private String avatar; /** * 状态(0:停用;1:启用) */ - @ApiModelProperty("状态(0:停用;1:启用)") + @Schema(description ="状态(0:停用;1:启用)") private Boolean status; /** * 角色id */ - @ApiModelProperty("角色id") + @Schema(description ="角色id") private String roleId; /** * 角色名 */ - @ApiModelProperty("角色名") + @Schema(description ="角色名") private String roleName; /** * 更新时间 */ - @ApiModelProperty("更新时间") + @Schema(description ="更新时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") private LocalDateTime updateTime; /** * 密码 */ - @ApiModelProperty("密码") + @Schema(description ="密码") private String password; /** * 是否是运维账号 */ - @ApiModelProperty("是否是运维账号") + @Schema(description ="是否是运维账号") private Boolean isOperation; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/StoreListVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/StoreListVo.java index 7749c3d..fd4c7f7 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/StoreListVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/StoreListVo.java @@ -1,6 +1,6 @@ package com.cpop.oam.business.vo; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; @@ -13,7 +13,7 @@ import java.io.Serializable; */ @Data @Accessors(chain = true) -@ApiModel(value = "校区/店铺对象", description = "校区/店铺对象") +@Schema(description = "校区/店铺对象") public class StoreListVo implements Serializable { /** diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskArchivingPagVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskArchivingPagVo.java index c358593..0a6c009 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskArchivingPagVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskArchivingPagVo.java @@ -1,8 +1,7 @@ package com.cpop.oam.business.vo; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; @@ -18,94 +17,94 @@ import java.time.LocalDateTime; */ @Data @Accessors(chain = true) -@ApiModel(value = "任务归档分页", description = "任务归档分页") +@Schema(description = "任务归档分页") public class TaskArchivingPagVo { /** * 主键 */ - @ApiModelProperty("主键") + @Schema(description ="主键") private String id; /** * 主要负责员工id */ - @ApiModelProperty("主要负责员工id") + @Schema(description ="主要负责员工id") private String responsibleStaffId; /** * 主键主要负责员工 */ - @ApiModelProperty("主要负责员工") + @Schema(description ="主要负责员工") private String responsibleStaffName; /** * 任务类型(0:迭代;1:需求;2:投诉) */ - @ApiModelProperty("任务类型(0:迭代;1:需求;2:投诉)") + @Schema(description ="任务类型(0:迭代;1:需求;2:投诉)") private Integer taskType; /** * 任务内容 */ - @ApiModelProperty("任务内容") + @Schema(description ="任务内容") private String taskContent; /** * 任务评级(0:A;1:B;2:C;3:D;4:E) */ - @ApiModelProperty("任务评级(0:A;1:B;2:C;3:D;4:E)") + @Schema(description ="任务评级(0:A;1:B;2:C;3:D;4:E)") private String taskRating; /** * 任务绩点 */ - @ApiModelProperty("任务绩点") + @Schema(description ="任务绩点") private Integer taskWeight; /** * 开始时间 */ - @ApiModelProperty("开始时间") + @Schema(description ="开始时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime taskReceiptTime; /** * 转测试时间 */ - @ApiModelProperty("转测试时间") + @Schema(description ="转测试时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime toTestTime; /** * 转部署时间 */ - @ApiModelProperty("转部署时间") + @Schema(description ="转部署时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime toDeployTime; /** * 完成日期 */ - @ApiModelProperty("完成日期") + @Schema(description ="完成日期") @JsonFormat(pattern = "yyyy-MM-dd") private LocalDate completionDate; /** * 主体 */ - @ApiModelProperty("主体") + @Schema(description ="主体") private String subject; /** * 小组成员 */ - @ApiModelProperty("小组成员") + @Schema(description ="小组成员") private String taskGroupStaffs; /** * 操作流程 */ - @ApiModelProperty("操作流程") + @Schema(description ="操作流程") private String testToFinishUrl; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskDemandPageVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskDemandPageVo.java index 69e46ac..d192dd7 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskDemandPageVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskDemandPageVo.java @@ -1,13 +1,12 @@ package com.cpop.oam.business.vo; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; -import java.time.LocalDateTime; import java.time.LocalDate; +import java.time.LocalDateTime; /** * 需求分页对象 @@ -17,130 +16,130 @@ import java.time.LocalDate; */ @Data @Accessors(chain = true) -@ApiModel(value = "需求分页对象", description = "需求管理") +@Schema(description = "需求管理") public class TaskDemandPageVo { /** * 主键 */ - @ApiModelProperty("主键") + @Schema(description ="主键") private String id; /** * 品牌/机构ID */ - @ApiModelProperty("品牌/机构ID") + @Schema(description ="品牌/机构ID") private String brandId; /** * 品牌/机构 */ - @ApiModelProperty("品牌/机构") + @Schema(description ="品牌/机构") private String brandName; /** * 校区/店铺ID */ - @ApiModelProperty("校区/店铺ID") + @Schema(description ="校区/店铺ID") private String storeId; /** * 校区/店铺 */ - @ApiModelProperty("校区/店铺") + @Schema(description ="校区/店铺") private String storeName; /** * 任务内容 */ - @ApiModelProperty("任务内容") + @Schema(description ="任务内容") private String taskContent; /** * 附件地址 */ - @ApiModelProperty("附件地址") + @Schema(description ="附件地址") private String attachmentUrl; /** * 记录员工Id */ - @ApiModelProperty("记录员工Id") + @Schema(description ="记录员工Id") private String recordStaffId; /** * 记录员工名 */ - @ApiModelProperty("记录员工名") + @Schema(description ="记录员工名") private String recordStaffName; /** * 创建时间 */ - @ApiModelProperty("创建时间") + @Schema(description ="创建时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime createTime; /** * 更新人 */ - @ApiModelProperty("更新人") + @Schema(description ="更新人") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private String updateUserId; /** * 更新人 */ - @ApiModelProperty("更新人") + @Schema(description ="更新人") private String updateStaffName; /** * 更新时间 */ - @ApiModelProperty("更新时间") + @Schema(description ="更新时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime updateTime; /**预期完成时间 */ - @ApiModelProperty("预期完成时间") + @Schema(description ="预期完成时间") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private LocalDate expectedCompletionDate; /** * 是否加急 */ - @ApiModelProperty("是否加急") + @Schema(description ="是否加急") private Integer isUrgent; /**任务评级(0:A;1:B;2:C;3:D;4:E) */ - @ApiModelProperty("任务评级(0:A;1:B;2:C;3:D;4:E)") + @Schema(description ="任务评级(0:A;1:B;2:C;3:D;4:E)") private String taskRating; /**任务接收员工Id */ - @ApiModelProperty("领取人Id") + @Schema(description ="领取人Id") private String responsibleStaffId; /**任务接收员工 */ - @ApiModelProperty("领取人") + @Schema(description ="领取人") private String responsibleStaffName; /**任务领取时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - @ApiModelProperty("任务领取时间") + @Schema(description ="任务领取时间") private LocalDateTime taskReceiptTime; /**完成日期 */ - @ApiModelProperty("完成日期") + @Schema(description ="完成日期") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private LocalDate completionDate; /**测试转部署文件 */ - @ApiModelProperty("测试转部署文件") + @Schema(description ="测试转部署文件") private String testToFinishUrl; /** * 备注 */ - @ApiModelProperty("备注") + @Schema(description ="备注") private String remark; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskDemandUrgentVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskDemandUrgentVo.java index 21c53b2..d45c99a 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskDemandUrgentVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskDemandUrgentVo.java @@ -1,7 +1,6 @@ package com.cpop.oam.business.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; @@ -14,42 +13,42 @@ import java.math.BigDecimal; */ @Data @Accessors(chain = true) -@ApiModel(value = "任务加急返回对象", description = "任务加急返回对象") +@Schema(description = "任务加急返回对象") public class TaskDemandUrgentVo { /** * 需求id */ - @ApiModelProperty(value = "需求id") + @Schema(description = "需求id") private String id; /** * 支付二维码 */ - @ApiModelProperty(value = "支付二维码") + @Schema(description = "支付二维码") private String payQrCode; /** * 签约图片 */ - @ApiModelProperty(value = "签约图片") + @Schema(description = "签约图片") private String signPic; /** * 任务评级(A;B:C:D:E) */ - @ApiModelProperty(value = "任务评级(A;B:C:D:E)") + @Schema(description = "任务评级(A;B:C:D:E)") private String taskRating; /** * 预付款 */ - @ApiModelProperty(value = "预付款") + @Schema(description = "预付款") private BigDecimal prepayment; /** * 应付款 */ - @ApiModelProperty(value = "应付款") + @Schema(description = "应付款") private BigDecimal payable; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskIndividualGpaDetailVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskIndividualGpaDetailVo.java index 365031e..95ad6f8 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskIndividualGpaDetailVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskIndividualGpaDetailVo.java @@ -1,6 +1,6 @@ package com.cpop.oam.business.vo; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; @@ -16,31 +16,31 @@ public class TaskIndividualGpaDetailVo { /** * 任务状态 */ - @ApiModelProperty(value = "任务状态") + @Schema(description = "任务状态") private Integer taskStatus; /** * 任务id */ - @ApiModelProperty(value = "任务") + @Schema(description = "任务") private String id; /** * 任务内容 */ - @ApiModelProperty(value = "任务内容") + @Schema(description = "任务内容") private String taskContent; /** * 备注 */ - @ApiModelProperty(value = "备注") + @Schema(description = "备注") private String remark; /** * 绩点 */ - @ApiModelProperty(value = "绩点") + @Schema(description = "绩点") private Integer gradePoint; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskIndividualGpaVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskIndividualGpaVo.java index 7866554..4b7b16a 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskIndividualGpaVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskIndividualGpaVo.java @@ -1,8 +1,6 @@ package com.cpop.oam.business.vo; -import com.cpop.oam.business.entity.TaskStaffGroup; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; @@ -15,31 +13,31 @@ import java.util.List; */ @Data @Accessors(chain = true) -@ApiModel(value = "个人绩点对象", description = "个人绩点对象") +@Schema(description = "个人绩点对象") public class TaskIndividualGpaVo { /** * 值班信息 */ - @ApiModelProperty(value = "值班信息") + @Schema(description = "值班信息") private WorkOrderDutyVo dutyVo; /** * 已完成 */ - @ApiModelProperty(value = "已完成") + @Schema(description = "已完成") private Integer haveFinished; /** * 待完成 */ - @ApiModelProperty(value = "待完成") + @Schema(description = "待完成") private Integer toBeCompleted; /** * 个人绩点 */ - @ApiModelProperty(value = "个人绩点") + @Schema(description = "个人绩点") private List gpa; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskStaffGroupVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskStaffGroupVo.java index 46e583e..1c4334c 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskStaffGroupVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskStaffGroupVo.java @@ -1,12 +1,9 @@ package com.cpop.oam.business.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; -import java.io.Serializable; - /** * OAM-任务-关联员工任务组表Vo输出 * @@ -15,37 +12,37 @@ import java.io.Serializable; */ @Data @Accessors(chain = true) -@ApiModel(value = "TaskStaffGroup对象", description = "OAM-任务-关联员工任务组表") +@Schema(description = "OAM-任务-关联员工任务组表") public class TaskStaffGroupVo { /** * 主键 */ - @ApiModelProperty("主键") + @Schema(description ="主键") private String id; /** * 任务id */ - @ApiModelProperty("任务id") + @Schema(description ="任务id") private String taskId; /** * 员工id */ - @ApiModelProperty("员工id") + @Schema(description ="员工id") private String staffId; /** * 员工id */ - @ApiModelProperty("员工id") + @Schema(description ="员工id") private String staffName; /** * 绩点 */ - @ApiModelProperty("绩点") + @Schema(description ="绩点") private Integer gradePoint; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskToBeClaimedPageVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskToBeClaimedPageVo.java index b7d5d9c..3167c6a 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskToBeClaimedPageVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskToBeClaimedPageVo.java @@ -1,10 +1,10 @@ package com.cpop.oam.business.vo; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; + import java.time.LocalDateTime; /** @@ -15,53 +15,53 @@ import java.time.LocalDateTime; */ @Data @Accessors(chain = true) -@ApiModel(value = "任务待评估与待领取分页") +@Schema(description = "任务待评估与待领取分页") public class TaskToBeClaimedPageVo { /**任务id */ - @ApiModelProperty(value = "任务id") + @Schema(description = "任务id") private String id; /**主体 */ - @ApiModelProperty(value = "主体") + @Schema(description = "主体") private String subject; /**任务内容 */ - @ApiModelProperty(value = "任务内容") + @Schema(description = "任务内容") private String taskContent; /**附件地址 */ - @ApiModelProperty(value = "附件地址") + @Schema(description = "附件地址") private String attachmentUrl; /**任务评级(0:A;1:B;2:C;3:D;4:E) */ - @ApiModelProperty(value = "任务评级(0:A;1:B;2:C;3:D;4:E)") + @Schema(description = "任务评级(0:A;1:B;2:C;3:D;4:E)") private String taskRating; /** * 任务权重 */ - @ApiModelProperty(value = "任务权重(任务绩点)") + @Schema(description = "任务权重(任务绩点)") private Integer taskWeight; /**任务类型(0:迭代;1:需求;2:投诉/工单) */ - @ApiModelProperty(value = "任务类型(0:迭代;1:需求;2:投诉/工单)") + @Schema(description = "任务类型(0:迭代;1:需求;2:投诉/工单)") private Integer taskType; /** * 记录员工id */ - @ApiModelProperty(value = "记录员工id") + @Schema(description = "记录员工id") private String recordStaffId; /** * 创建时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - @ApiModelProperty("创建时间") + @Schema(description ="创建时间") private LocalDateTime createTime; /**对接员工 */ - @ApiModelProperty(value = "对接员工") + @Schema(description = "对接员工") private String dockingStaff; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskWorkOrderPersonVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskWorkOrderPersonVo.java index fc246b9..51b5ce1 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskWorkOrderPersonVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskWorkOrderPersonVo.java @@ -1,8 +1,7 @@ package com.cpop.oam.business.vo; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; @@ -10,67 +9,67 @@ import java.time.LocalDateTime; @Data @Accessors(chain = true) -@ApiModel(value = "个人工单返回对象", description = "个人工单返回对象对象") +@Schema(description = "个人工单返回对象对象") public class TaskWorkOrderPersonVo { /** * 工单id */ - @ApiModelProperty(value = "工单id") + @Schema(description = "工单id") private String id; /** * 机构/品牌 */ - @ApiModelProperty(value = "机构/品牌") + @Schema(description = "机构/品牌") private String brandName; /** * 校区/店铺 */ - @ApiModelProperty(value = "校区/店铺") + @Schema(description = "校区/店铺") private String storeName; /** * 问题描述 */ - @ApiModelProperty(value = "问题描述") + @Schema(description = "问题描述") private String taskContent; /** * 手机号 */ - @ApiModelProperty(value = "手机号") + @Schema(description = "手机号") private String phoneNumber; /** * 提交人ID */ - @ApiModelProperty(value = "提交人ID") + @Schema(description = "提交人ID") private String recordStaffId; /** * 提交人 */ - @ApiModelProperty(value = "提交人") + @Schema(description = "提交人") private String recordStaffName; /** * 提交时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - @ApiModelProperty(value = "提交时间") + @Schema(description = "提交时间") private LocalDateTime createTime; /** * 接收用时 */ - @ApiModelProperty(value = "接收用时") + @Schema(description = "接收用时") private Integer receivingTime; /** * 工单状态 */ - @ApiModelProperty(value = "工单状态") + @Schema(description = "工单状态") private Integer taskStatus; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskWorkOrderRecordListVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskWorkOrderRecordListVo.java index 568fc28..3956b26 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskWorkOrderRecordListVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/TaskWorkOrderRecordListVo.java @@ -1,8 +1,7 @@ package com.cpop.oam.business.vo; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; @@ -17,61 +16,61 @@ import java.time.LocalDateTime; */ @Data @Accessors(chain = true) -@ApiModel(value = "TaskWorkOrderRecordListVo对象", description = "任务-工单记录-记录") +@Schema(description = "任务-工单记录-记录") public class TaskWorkOrderRecordListVo { /** * 主键 */ - @ApiModelProperty("主键") + @Schema(description ="主键") private String id; /** * 任务工单id */ - @ApiModelProperty("任务工单id") + @Schema(description ="任务工单id") private String taskWorkOrderId; /** * 记录员工id */ - @ApiModelProperty("记录员工id") + @Schema(description ="记录员工id") private String recordStaffId; /** * 记录员工id */ - @ApiModelProperty("记录员工id") + @Schema(description ="记录员工id") private String recordStaffName; /** * 员工类型(0:技术人员;1:售后人员;2:管理人员) */ - @ApiModelProperty("员工类型(0:技术人员;1:售后人员;2:管理人员)") + @Schema(description ="员工类型(0:技术人员;1:售后人员;2:管理人员)") private Integer recordStaffType; /** * 记录内容 */ - @ApiModelProperty("记录内容") + @Schema(description ="记录内容") private String recordText; /** * 附件地址 */ - @ApiModelProperty("附件地址") + @Schema(description ="附件地址") private String attachmentUrl; /** * 头像 */ - @ApiModelProperty("头像") + @Schema(description ="头像") private String avatar; /** * 创建时间 */ - @ApiModelProperty("创建时间") + @Schema(description ="创建时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime createTime; }