工单
This commit is contained in:
parent
de05445ab2
commit
34a4950925
@ -8,9 +8,9 @@ cpop:
|
||||
gateway:
|
||||
rsa-keypair:
|
||||
# 公钥文件
|
||||
publicKeyFile: E:\Cpop\Cpop-Union\Cpop-Core\src\main\resources\static\keyPair\publicKey
|
||||
publicKeyFile: D:\Cpop\Cpop-Union\Cpop-Core\src\main\resources\static\keypair\publicKey
|
||||
# 公钥文件
|
||||
privateKeyFile: E:\Cpop\Cpop-Union\Cpop-Core\src\main\resources\static\keyPair\privateKey
|
||||
privateKeyFile: D:\Cpop\Cpop-Union\Cpop-Core\src\main\resources\static\keypair\privateKey
|
||||
|
||||
# DataSource Config
|
||||
spring:
|
||||
@ -70,9 +70,9 @@ mybatis-flex:
|
||||
username: cpop_dev
|
||||
password: Ch5WkZRsCATsnMXw
|
||||
jambox:
|
||||
url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/jambox_test?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
|
||||
username: root
|
||||
password: Customer0401
|
||||
url: jdbc:mysql://bj-cynosdbmysql-grp-anccz88g.sql.tencentcdb.com:24808/jambox_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: jambox_dev
|
||||
password: sQt3XZyzW74b5mkJ
|
||||
|
||||
# springdoc-openapi项目配置
|
||||
springdoc:
|
||||
|
||||
@ -96,7 +96,7 @@
|
||||
<logger name="com.cpop.core.mapper" level="DEBUG">
|
||||
<appender-ref ref="sqlFile" />
|
||||
</logger>
|
||||
<logger name="com.cpop.system.business.mapper" level="DEBUG">
|
||||
<logger name="com.cpop.oam.business.mapper" level="DEBUG">
|
||||
<appender-ref ref="sqlFile" />
|
||||
</logger>
|
||||
</configuration>
|
||||
@ -0,0 +1,40 @@
|
||||
package com.cpop.oam.web;
|
||||
|
||||
import com.cpop.core.utils.SpringUtils;
|
||||
import com.cpop.system.business.service.BrandService;
|
||||
import com.mybatisflex.core.datasource.DataSourceKey;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.mybatisflex.core.row.Db;
|
||||
import com.mybatisflex.core.row.Row;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import static com.cpop.system.business.entity.table.BrandTableDef.BRAND;
|
||||
|
||||
/**
|
||||
* @author DB
|
||||
* @version 1.0.0
|
||||
* @since 2024-04-27 20:38
|
||||
*/
|
||||
@SpringBootTest
|
||||
public class JamboxDataSourceTests {
|
||||
|
||||
/**
|
||||
* 获取果酱品牌数据
|
||||
* @author DB
|
||||
* @since 2023/12/07
|
||||
*/
|
||||
@Test
|
||||
public void getJamboxBrandData() {
|
||||
try {
|
||||
DataSourceKey.use("jambox", () -> {
|
||||
Row row = Db.selectOneByQuery(BRAND.getTableName(), QueryWrapper.create().where(BRAND.ID.eq("134483921482485760")));
|
||||
System.out.println(row);
|
||||
});
|
||||
} finally {
|
||||
DataSourceKey.clear();
|
||||
}
|
||||
|
||||
SpringUtils.getBean(BrandService.class).queryChain().where(BRAND.ID.eq("134483921482485760")).one();
|
||||
}
|
||||
}
|
||||
@ -33,6 +33,16 @@ public class TaskWorkOrderReceiveDealPauseDto implements Serializable {
|
||||
*/
|
||||
private String storeName;
|
||||
|
||||
/**
|
||||
* 机构/品牌ID
|
||||
*/
|
||||
private String brandId;
|
||||
|
||||
/**
|
||||
* 校区/店铺ID
|
||||
*/
|
||||
private String storeId;
|
||||
|
||||
/**
|
||||
* 问题描述
|
||||
*/
|
||||
|
||||
@ -21,8 +21,10 @@ import com.cpop.oam.framework.constant.WebHookKeyConstant;
|
||||
import com.cpop.oam.framework.enums.OamConfigEnum;
|
||||
import com.cpop.oam.framework.enums.QuartzEnums;
|
||||
import com.cpop.oam.framework.tasks.*;
|
||||
import com.mybatisflex.core.datasource.DataSourceKey;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.mybatisflex.core.row.DbChain;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.quartz.*;
|
||||
@ -80,46 +82,65 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
|
||||
// 工单
|
||||
.select(TASK_WORK_ORDER.ID,
|
||||
TASK_WORK_ORDER.PHONE_NUMBER,
|
||||
TASK_WORK_ORDER.CREATE_TIME.as("createTime"),
|
||||
TASK_WORK_ORDER.CREATE_TIME,
|
||||
TASK_WORK_ORDER.RECEIVING_TIME,
|
||||
TASK_WORK_ORDER.PAUSE_STAFF_ID,
|
||||
TASK_WORK_ORDER.PAUSE_RECORD_TIME,
|
||||
TASK_WORK_ORDER.PAUSE_EXPIRE_TIME)
|
||||
TASK_WORK_ORDER.PAUSE_EXPIRE_TIME,
|
||||
TASK_WORK_ORDER.BRAND_ID,
|
||||
TASK_WORK_ORDER.STORE_ID)
|
||||
// 任务
|
||||
.select(TASK.TASK_CONTENT, TASK.TASK_STATUS, TASK.RESPONSIBLE_STAFF_ID, TASK.TASK_RECEIPT_TIME, TASK.RECORD_STAFF_ID)
|
||||
// 品牌
|
||||
.select(BRAND.BRAND_NAME)
|
||||
// 校区
|
||||
.select(STORE.STORE_NAME)
|
||||
.from(TASK_WORK_ORDER)
|
||||
.leftJoin(TASK)
|
||||
.on(TASK.ID.eq(TASK_WORK_ORDER.TASK_ID))
|
||||
.leftJoin(BRAND)
|
||||
.on(BRAND.ID.eq(TASK_WORK_ORDER.BRAND_ID))
|
||||
.leftJoin(STORE)
|
||||
.on(STORE.ID.eq(TASK_WORK_ORDER.STORE_ID))
|
||||
// 工单
|
||||
.where(TASK.TASK_TYPE.eq(2))
|
||||
.and(TASK.TASK_STATUS.in(1, 2, 4, 5, 6, 7)),
|
||||
TaskWorkOrderReceiveDealPauseDto.class,
|
||||
// 提交人
|
||||
item -> item.field(TaskWorkOrderReceiveDealPauseDto::getRecordStaffName)
|
||||
.queryWrapper(recordStaff -> queryChain().select(STAFF.NAME.as("recordStaffName"))
|
||||
.queryWrapper(recordStaff -> queryChain().select(STAFF.NAME.as(TaskWorkOrderReceiveDealPauseDto::getRecordStaffName))
|
||||
.from(STAFF)
|
||||
.where(STAFF.ID.eq(recordStaff.getRecordStaffId()))),
|
||||
// 负责人
|
||||
item -> item.field(TaskWorkOrderReceiveDealPauseDto::getResponsibleStaffName)
|
||||
.queryWrapper(responsibleStaff -> queryChain().select(STAFF.NAME.as("responsibleStaffName"))
|
||||
.queryWrapper(responsibleStaff -> queryChain().select(STAFF.NAME.as(TaskWorkOrderReceiveDealPauseDto::getResponsibleStaffName))
|
||||
.from(STAFF)
|
||||
.where(STAFF.ID.eq(StringUtils.isNotBlank(responsibleStaff.getResponsibleStaffId())
|
||||
? responsibleStaff.getResponsibleStaffId()
|
||||
: "-1"))),
|
||||
.where(STAFF.ID.eq(StringUtils.isNotBlank(responsibleStaff.getResponsibleStaffId()) ? responsibleStaff.getResponsibleStaffId() : "-1"))),
|
||||
// 暂停人
|
||||
item -> item.field(TaskWorkOrderReceiveDealPauseDto::getPauseStaffName)
|
||||
.queryWrapper(pauseStaff -> queryChain().select(STAFF.NAME.as("pauseStaffName"))
|
||||
.from(STAFF)
|
||||
.where(STAFF.ID.eq(
|
||||
StringUtils.isNotBlank(pauseStaff.getPauseStaffId()) ? pauseStaff.getPauseStaffId() : "-1"))));
|
||||
.queryWrapper(pauseStaff ->
|
||||
queryChain().select(STAFF.NAME.as(TaskWorkOrderReceiveDealPauseDto::getPauseStaffName))
|
||||
.from(STAFF)
|
||||
.where(STAFF.ID.eq(StringUtils.isNotBlank(pauseStaff.getPauseStaffId()) ? pauseStaff.getPauseStaffId() : "-1"))),
|
||||
// 品牌
|
||||
item -> item.field(TaskWorkOrderReceiveDealPauseDto::getBrandName).prevent(true)
|
||||
.queryWrapper(brandName -> {
|
||||
DbChain jambox;
|
||||
try {
|
||||
jambox = DataSourceKey.use("jambox", () -> DbChain.table(BRAND).select(BRAND.BRAND_NAME.as(TaskWorkOrderReceiveDealPauseDto::getBrandName))
|
||||
.from(BRAND)
|
||||
.where(BRAND.ID.eq(StringUtils.isNotBlank(brandName.getBrandId()) ? brandName.getBrandId() : "-1")));
|
||||
} finally {
|
||||
DataSourceKey.clear();
|
||||
}
|
||||
return jambox;
|
||||
}),
|
||||
// 校区
|
||||
item -> item.field(TaskWorkOrderReceiveDealPauseDto::getStoreName).prevent(true)
|
||||
.queryWrapper(storeName -> {
|
||||
DbChain jambox;
|
||||
try {
|
||||
jambox = DataSourceKey.use("jambox", () -> DbChain.table(STORE).select(STORE.STORE_NAME.as(TaskWorkOrderReceiveDealPauseDto::getStoreName))
|
||||
.from(STORE)
|
||||
.where(STORE.ID.eq(StringUtils.isNotBlank(storeName.getStoreId()) ? storeName.getStoreId() : "-1")));
|
||||
} finally {
|
||||
DataSourceKey.clear();
|
||||
}
|
||||
return jambox;
|
||||
})
|
||||
);
|
||||
// 分组过滤
|
||||
Map<Integer, List<TaskWorkOrderReceiveDealPauseDto>> taskStatusMap =
|
||||
dtoList.stream().collect(Collectors.groupingBy(TaskWorkOrderReceiveDealPauseDto::getTaskStatus));
|
||||
|
||||
@ -61,6 +61,18 @@ public class TaskWorkOrderReceiveDealPauseVo {
|
||||
@Schema(description = "校区/店铺")
|
||||
private String storeName;
|
||||
|
||||
/**
|
||||
* 机构/品牌ID
|
||||
*/
|
||||
@Schema(description = "机构/品牌ID")
|
||||
private String brandId;
|
||||
|
||||
/**
|
||||
* 校区/店铺ID
|
||||
*/
|
||||
@Schema(description = "校区/店铺ID")
|
||||
private String storeId;
|
||||
|
||||
/**
|
||||
* 问题描述
|
||||
*/
|
||||
@ -113,6 +125,18 @@ public class TaskWorkOrderReceiveDealPauseVo {
|
||||
@Schema(description = "校区/店铺")
|
||||
private String storeName;
|
||||
|
||||
/**
|
||||
* 机构/品牌ID
|
||||
*/
|
||||
@Schema(description = "机构/品牌ID")
|
||||
private String brandId;
|
||||
|
||||
/**
|
||||
* 校区/店铺ID
|
||||
*/
|
||||
@Schema(description = "校区/店铺ID")
|
||||
private String storeId;
|
||||
|
||||
/**
|
||||
* 问题描述
|
||||
*/
|
||||
@ -184,6 +208,18 @@ public class TaskWorkOrderReceiveDealPauseVo {
|
||||
@Schema(description = "校区/店铺")
|
||||
private String storeName;
|
||||
|
||||
/**
|
||||
* 机构/品牌ID
|
||||
*/
|
||||
@Schema(description = "机构/品牌ID")
|
||||
private String brandId;
|
||||
|
||||
/**
|
||||
* 校区/店铺ID
|
||||
*/
|
||||
@Schema(description = "校区/店铺ID")
|
||||
private String storeId;
|
||||
|
||||
/**
|
||||
* 问题描述
|
||||
*/
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.cpop.system.business.mapper;
|
||||
|
||||
import com.mybatisflex.annotation.UseDataSource;
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.cpop.system.business.entity.Brand;
|
||||
|
||||
@ -9,6 +10,7 @@ import com.cpop.system.business.entity.Brand;
|
||||
* @author DB
|
||||
* @since 2023-10-25
|
||||
*/
|
||||
@UseDataSource("jambox")
|
||||
public interface BrandMapper extends BaseMapper<Brand> {
|
||||
|
||||
}
|
||||
|
||||
5
pom.xml
5
pom.xml
@ -21,12 +21,7 @@
|
||||
<module>Cpop-Api</module>
|
||||
<module>Cpop-Oam</module>
|
||||
<module>Cpop-Oam/Cpop-Oam-Web</module>
|
||||
<module>Cpop-Jambox</module>
|
||||
<module>Cpop-Jambox/Cpop-Jambox-Web</module>
|
||||
<module>Cpop-Mall</module>
|
||||
<module>Cpop-Mall/Cpop-Mall-Web</module>
|
||||
<module>Cpop-System</module>
|
||||
<module>Cpop-Mini</module>
|
||||
<module>Cpop-Pay</module>
|
||||
<module>Cpop-ClockIn-Demo</module>
|
||||
</modules>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user