补充提交
This commit is contained in:
parent
6e5d889954
commit
9cf9a60a63
@ -5,6 +5,7 @@ import com.cpop.api.tencent.wxWork.core.config.WxWorkApiConfig;
|
||||
import com.cpop.api.tencent.wxWork.webHook.WebHookSendTextRequest;
|
||||
import okhttp3.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Profile;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@ -11,9 +11,7 @@ import java.util.Map;
|
||||
* @author LOST.yuan
|
||||
*/
|
||||
@Data
|
||||
public class BaseEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -5809782578272943991L;
|
||||
public class BaseEntity {
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@ -46,7 +46,6 @@ public class BoGenerator implements IGenerator {
|
||||
if (boJavaFile.exists() && !entityConfig.isOverwriteEnable()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Map<String, Object> params = new HashMap<>(4);
|
||||
params.put("table", table);
|
||||
params.put("entityConfig", entityConfig);
|
||||
|
||||
@ -36,5 +36,5 @@ public class BrandListVo implements Serializable {
|
||||
* 品牌名
|
||||
*/
|
||||
@ApiModelProperty("品牌名")
|
||||
private String name;
|
||||
private String brandName;
|
||||
}
|
||||
|
||||
@ -23,7 +23,8 @@ spring:
|
||||
#端口
|
||||
port: 6333
|
||||
#数据库
|
||||
database: 10
|
||||
#database: 10
|
||||
database: 0
|
||||
#密码
|
||||
password: Jambox.123*
|
||||
#连接超时
|
||||
@ -55,17 +56,14 @@ mybatis-flex:
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
datasource:
|
||||
mall:
|
||||
url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/cpop_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
#url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/cpop_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/cpop_union?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: Customer0401
|
||||
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
|
||||
cbc:
|
||||
url: jdbc:mysql://192.168.3.10:3306/cbc_game_prod?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
|
||||
username: nft
|
||||
password: nft
|
||||
|
||||
# springdoc-openapi项目配置
|
||||
knife4j:
|
||||
@ -129,4 +127,4 @@ wx:
|
||||
#退款通知地址
|
||||
notifyRefund: https://frp-oak.top:11899/Cpop-Mall/wxPay/callback/notify/refund
|
||||
#分账通知地址
|
||||
notifySharing: https://frp-oak.top:11899/Cpop-Mall/wxPay/callback/notify/profitSharing
|
||||
notifySharing: https://frp-oak.top:11899/Cpop-Mall/wxPay/callback/notify/profitSharing
|
||||
|
||||
@ -90,4 +90,4 @@ wx:
|
||||
#退款通知地址
|
||||
notifyRefund: https://api.jamboxsys.com/Cpop-Mall/wxPay/callback/notify/refund
|
||||
#分账通知地址
|
||||
notifySharing: https://api.jamboxsys.com/Cpop-Mall/wxPay/callback/notify/profitSharing
|
||||
notifySharing: https://api.jamboxsys.com/Cpop-Mall/wxPay/callback/notify/profitSharing
|
||||
|
||||
@ -120,4 +120,4 @@ wx:
|
||||
#退款通知地址
|
||||
notifyRefund: https://test.cpopsz.com/onlineShop/wxPay/callback/notify/refund
|
||||
#分账通知地址
|
||||
notifySharing: https://test.cpopsz.com/onlineShop/wxPay/callback/notify/profitSharing
|
||||
notifySharing: https://test.cpopsz.com/onlineShop/wxPay/callback/notify/profitSharing
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
# 项目相关配置
|
||||
cpop:
|
||||
# 文件路径 示例( Windows配置W:/WorkSpace/java/uploadPath,Linux配置 /home/baseFramework/uploadPath)
|
||||
profile: D:/Cpop/uploadPath
|
||||
profile: E:/Cpop/uploadPath
|
||||
jwt:
|
||||
#白名单
|
||||
whiteList: /websocket/*,/login,/getCaptcha,/profile/**,/doc.html,/webjars/**,/favicon.ico,/v2/api-docs/**,/swagger-resources,/wxCp/*,/wxCp/portal/*/registerCode
|
||||
gateway:
|
||||
rsa-keypair:
|
||||
# 公钥文件
|
||||
publicKeyFile: D:\Cpop\Cpop-Union\Cpop-Core\src\main\resources\static\keyPair\publicKey
|
||||
publicKeyFile: E:\Cpop\Cpop-Union\Cpop-Core\src\main\resources\static\keyPair\publicKey
|
||||
# 公钥文件
|
||||
privateKeyFile: D:\Cpop\Cpop-Union\Cpop-Core\src\main\resources\static\keyPair\privateKey
|
||||
privateKeyFile: E:\Cpop\Cpop-Union\Cpop-Core\src\main\resources\static\keyPair\privateKey
|
||||
|
||||
# DataSource Config
|
||||
spring:
|
||||
@ -43,6 +43,11 @@ spring:
|
||||
host: localhost
|
||||
port: 27017
|
||||
database: cpop-union
|
||||
# 热部署
|
||||
devtools:
|
||||
restart:
|
||||
# 开启热部署(更改文件后,自动重启)
|
||||
enabled: true
|
||||
|
||||
server:
|
||||
port: 9420
|
||||
@ -88,8 +93,8 @@ knife4j:
|
||||
wx:
|
||||
pay:
|
||||
# p12证书的位置,可以指定绝对路径,也可以指定类路径(以classpath:开头)
|
||||
keyPath: D:/Cpop/Cpop-Union/Cpop-Core/src/main/resources/static/keyPair/wxPay_cert.p12
|
||||
keyPath: E:/Cpop/Cpop-Union/Cpop-Core/src/main/resources/static/keyPair/wxPay_cert.p12
|
||||
# 私钥证书
|
||||
privateKeyPath: D:/Cpop/Cpop-Union/Cpop-Core/src/main/resources/static/keyPair/wxPay_key.pem
|
||||
privateKeyPath: E:/Cpop/Cpop-Union/Cpop-Core/src/main/resources/static/keyPair/wxPay_key.pem
|
||||
# 私钥文件
|
||||
privateCertPath: D:/Cpop/Cpop-Union/Cpop-Core/src/main/resources/static/keyPair/wxPay_cert.pem
|
||||
privateCertPath: E:/Cpop/Cpop-Union/Cpop-Core/src/main/resources/static/keyPair/wxPay_cert.pem
|
||||
|
||||
@ -44,6 +44,11 @@ spring:
|
||||
host: localhost
|
||||
port: 27017
|
||||
database: rock-blade
|
||||
# 热部署
|
||||
devtools:
|
||||
restart:
|
||||
# 开启热部署(更改文件后,自动重启)
|
||||
enabled: false
|
||||
|
||||
server:
|
||||
port: 9420
|
||||
@ -72,4 +77,4 @@ wx:
|
||||
# 私钥证书
|
||||
privateKeyPath: /root/cpop-union/cpop-oam/script/secretKey/wxPay_key.pem
|
||||
# 私钥文件
|
||||
privateCertPath: /root/cpop-union/cpop-oam/script/secretKey/wxPay_cert.pem
|
||||
privateCertPath: /root/cpop-union/cpop-oam/script/secretKey/wxPay_cert.pem
|
||||
|
||||
@ -44,6 +44,11 @@ spring:
|
||||
host: localhost
|
||||
port: 27017
|
||||
database: rock-blade
|
||||
# 热部署
|
||||
devtools:
|
||||
restart:
|
||||
# 开启热部署(更改文件后,自动重启)
|
||||
enabled: false
|
||||
|
||||
server:
|
||||
port: 8420
|
||||
@ -93,4 +98,4 @@ wx:
|
||||
# 私钥证书
|
||||
privateKeyPath: /root/cpop-union/cpop-oam/script/secretKey/wxPay_key.pem
|
||||
# 私钥文件
|
||||
privateCertPath: /root/cpop-union/cpop-oam/script/secretKey/wxPay_cert.pem
|
||||
privateCertPath: /root/cpop-union/cpop-oam/script/secretKey/wxPay_cert.pem
|
||||
|
||||
@ -2,23 +2,45 @@ package com.cpop.oam.web;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
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.SourceType;
|
||||
import com.cpop.core.utils.SpringUtils;
|
||||
import com.cpop.jambox.business.entity.BrandExtend;
|
||||
import com.cpop.jambox.business.entity.StoreExtend;
|
||||
import com.cpop.jambox.business.service.BrandExtendService;
|
||||
import com.cpop.jambox.business.service.StoreExtendService;
|
||||
import com.cpop.system.business.entity.Brand;
|
||||
import com.cpop.system.business.entity.Store;
|
||||
import com.cpop.system.business.service.BrandService;
|
||||
import com.cpop.system.business.service.StoreService;
|
||||
import com.mybatisflex.core.row.DbChain;
|
||||
import com.mybatisflex.core.row.Row;
|
||||
import lombok.Data;
|
||||
import lombok.Value;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.cpop.jambox.business.entity.table.BrandExtendTableDef.BRAND_EXTEND;
|
||||
import static com.cpop.system.business.entity.table.BrandTableDef.BRAND;
|
||||
|
||||
/**
|
||||
* @author DB
|
||||
* @createTime 2023/11/27 17:24
|
||||
* @description 导入数据
|
||||
*/
|
||||
@SpringBootTest
|
||||
@Slf4j
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
public class CpopImportTests {
|
||||
|
||||
/**
|
||||
@ -29,7 +51,7 @@ public class CpopImportTests {
|
||||
*/
|
||||
@Test
|
||||
public void importBrandJson() throws IOException {
|
||||
String brandFileUrl = "";
|
||||
String brandFileUrl = "C:\\Users\\Administrator\\Desktop\\brand.json";
|
||||
List<String> filterList = new ArrayList<>();
|
||||
filterList.add("b00064a760d0c4f121b0835d09b909ca");
|
||||
filterList.add("ac1268b164d1d20700080aae1703ecf8");
|
||||
@ -38,9 +60,21 @@ public class CpopImportTests {
|
||||
//过滤已存在的品牌
|
||||
List<JsonBrand> filterBrand = jsonBrands.stream().filter(item -> !filterList.contains(item.getBrandCloudId())).collect(Collectors.toList());
|
||||
//打印
|
||||
Map<BrandExtend, Brand> brandJsonBrandMap = new HashMap<>();
|
||||
filterBrand.forEach(item -> {
|
||||
log.info("品牌信息:{}", item.toString());
|
||||
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());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -50,9 +84,45 @@ public class CpopImportTests {
|
||||
* @return: void
|
||||
*/
|
||||
@Test
|
||||
public void importStoreJson() {
|
||||
|
||||
public void importStoreJson() throws IOException {
|
||||
String brandFileUrl = "C:\\Users\\Administrator\\Desktop\\store.json";
|
||||
List<String> filterList = new ArrayList<>();
|
||||
filterList.add("b00064a760d0c4f121b0835d09b909ca");
|
||||
filterList.add("ac1268b164d1d20700080aae1703ecf8");
|
||||
filterList.add("0122a5876468513f0d42569d389e8264");
|
||||
List<JsonStore> jsonBrands = JSONArray.parseArray(readJson(brandFileUrl), JsonStore.class);
|
||||
//过滤已存在的品牌
|
||||
List<JsonStore> filterStore = jsonBrands.stream()
|
||||
.filter(item -> !filterList.contains(item.getBrandCloudId()) &&
|
||||
//品牌不为null和空
|
||||
null != item.getBrandCloudId() && StringUtils.isNotBlank(item.getBrandCloudId())).collect(Collectors.toList());
|
||||
|
||||
//打印
|
||||
Map<StoreExtend, Store> storeExtendStoreMap = new HashMap<>();
|
||||
//获取所有品牌
|
||||
List<Row> 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<String, Row> 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(SourceType.JAMBOX.toString())
|
||||
.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());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -64,17 +134,42 @@ public class CpopImportTests {
|
||||
/**
|
||||
* 品牌名
|
||||
*/
|
||||
@JSONField(name = "")
|
||||
@JSONField(name = "name")
|
||||
private String brandName;
|
||||
|
||||
/**
|
||||
* 云品牌id
|
||||
*/
|
||||
@JSONField(name = "")
|
||||
@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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取json文件数据
|
||||
*
|
||||
|
||||
@ -41,6 +41,15 @@
|
||||
<groupId>com.github.binarywang</groupId>
|
||||
<artifactId>weixin-java-open</artifactId>
|
||||
</dependency>
|
||||
<!-- devtools热部署依赖 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
<!-- 防止将依赖传递到其他模块中 -->
|
||||
<optional>true</optional>
|
||||
<!-- 只在运行时起作用,打包时不打进去(防止线上执行打包后的程序,启动文件监听线程File Watcher,耗费大量的内存资源) -->
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
@ -49,6 +58,7 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<!-- devtools依赖此配置(否则,devtools不生效)。 -->
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
@ -6,32 +6,34 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author: DB
|
||||
* @Date: 2023/07/12/12:00
|
||||
* @Description:
|
||||
* 工单暂停请求对象
|
||||
* @author DB
|
||||
* @since 2023-11-29 16:01:35
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "PauseWorkOrderBo对象", description = "")
|
||||
public class PauseWorkOrderBo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ApiModel(value = "工单暂停请求对象")
|
||||
public class PauseWorkOrderBo {
|
||||
|
||||
/**
|
||||
* 工单id
|
||||
*/
|
||||
@NotBlank(message = "工单id不能为空")
|
||||
@ApiModelProperty("工单id")
|
||||
private String taskId;
|
||||
private String workOrderId;
|
||||
|
||||
/**
|
||||
* 暂停到时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
|
||||
@NotNull(message = "时间不能为空")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@ApiModelProperty("暂停到时间")
|
||||
private LocalDateTime taskReceiptTime;
|
||||
private LocalDateTime pauseExpireTime;
|
||||
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import com.cpop.core.annontation.StringArrayConvert;
|
||||
|
||||
/**
|
||||
* 任务-工单表Bo
|
||||
@ -18,7 +18,7 @@ import java.io.Serializable;
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "TaskWorkOrder对象", description = "任务-工单表")
|
||||
public class TaskWorkOrderBo implements Serializable {
|
||||
public class TaskWorkOrderBo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ -32,35 +32,28 @@ public class TaskWorkOrderBo implements Serializable {
|
||||
* 品牌id
|
||||
*/
|
||||
@NotBlank(message = "品牌id不能为空")
|
||||
@ApiModelProperty(value = "品牌id",required = true)
|
||||
@ApiModelProperty(value = "品牌id", required = true)
|
||||
private String brandId;
|
||||
|
||||
/**
|
||||
* 校区id
|
||||
*/
|
||||
@NotBlank(message = "校区id不能为空")
|
||||
@ApiModelProperty(value = "校区id",required = true)
|
||||
private String campusId;
|
||||
|
||||
/**
|
||||
* 工单名
|
||||
*/
|
||||
@NotBlank(message = "工单名不能为空")
|
||||
@ApiModelProperty(value = "工单名",required = true)
|
||||
private String taskName;
|
||||
@NotBlank(message = "校区/店铺id不能为空")
|
||||
@ApiModelProperty(value = "校区/店铺id", required = true)
|
||||
private String storeId;
|
||||
|
||||
/**
|
||||
* 工单内容
|
||||
*/
|
||||
@NotBlank(message = "工单内容不能为空")
|
||||
@ApiModelProperty(value = "工单内容",required = true)
|
||||
@ApiModelProperty(value = "工单内容", required = true)
|
||||
private String taskContent;
|
||||
|
||||
/**
|
||||
* 任务类型(0:迭代;1:需求;2:工单)
|
||||
*/
|
||||
@NotNull(message = "任务类型不能为空")
|
||||
@ApiModelProperty(value = "任务类型(0:迭代;1:需求;2:工单)",required = true)
|
||||
@ApiModelProperty(value = "任务类型(0:迭代;1:需求;2:工单)", required = true)
|
||||
private Integer taskType;
|
||||
|
||||
/**
|
||||
@ -72,6 +65,7 @@ public class TaskWorkOrderBo implements Serializable {
|
||||
/**
|
||||
* 附件地址
|
||||
*/
|
||||
@StringArrayConvert
|
||||
@ApiModelProperty("附件地址")
|
||||
private String attachmentUrl;
|
||||
|
||||
|
||||
@ -6,20 +6,17 @@ import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 任务-工单-记录表Bo
|
||||
*
|
||||
* @author DB.lost
|
||||
* @since 2023-07-10
|
||||
* TaskWorkOrderRecord对象
|
||||
* @author DB
|
||||
* @since 2023-11-29 11:32:51
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "TaskWorkOrderRecord对象", description = "任务-工单-记录表")
|
||||
public class TaskWorkOrderRecordBo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
public class TaskWorkOrderRecordBo {
|
||||
|
||||
/**
|
||||
* 任务工单id
|
||||
|
||||
@ -1,16 +1,22 @@
|
||||
package com.cpop.oam.business.controller.backstage;
|
||||
|
||||
import com.cpop.core.base.R;
|
||||
import com.cpop.jambox.business.vo.BrandListVo;
|
||||
import com.cpop.oam.business.bo.PauseWorkOrderBo;
|
||||
import com.cpop.oam.business.bo.TaskWorkOrderBo;
|
||||
import com.cpop.oam.business.bo.TaskWorkOrderPageBo;
|
||||
import com.cpop.oam.business.bo.TaskWorkOrderRecordBo;
|
||||
import com.cpop.oam.business.service.TaskWorkOrderService;
|
||||
import com.cpop.oam.business.vo.StoreListVo;
|
||||
import com.cpop.oam.business.vo.TaskWorkOrderPageVo;
|
||||
import com.cpop.oam.business.vo.TaskWorkOrderReceiveDealPauseVo;
|
||||
import com.cpop.oam.business.vo.TaskWorkOrderRecordListVo;
|
||||
import com.cpop.oam.business.vo.WorkOrderDutyVo;
|
||||
import com.cpop.system.business.service.BrandService;
|
||||
import com.cpop.system.business.service.StoreService;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@ -18,106 +24,214 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.cpop.system.business.entity.table.BrandTableDef.BRAND;
|
||||
import static com.cpop.system.business.entity.table.StoreTableDef.STORE;
|
||||
|
||||
/**
|
||||
* 任务-工单表 控制层。
|
||||
*
|
||||
* 工单模块
|
||||
* @author DB
|
||||
* @since 2023-09-18
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "任务管理模块-工单管理")
|
||||
@Api(tags = "工单模块")
|
||||
@RequestMapping("/taskWorkOrder")
|
||||
public class TaskWorkOrderController {
|
||||
|
||||
@Autowired
|
||||
private TaskWorkOrderService taskWorkOrderService;
|
||||
|
||||
@Autowired
|
||||
private BrandService brandService;
|
||||
|
||||
@Autowired
|
||||
private StoreService storeService;
|
||||
|
||||
/**
|
||||
* @Description: 任务管理-工单管理-新增工单
|
||||
* @param bo 请求参数
|
||||
* @return: R<Void>
|
||||
* @Author: DB
|
||||
* @Date: 2023/5/30 16:53
|
||||
* 工单模块-工单提交-接收/处理/暂停中
|
||||
* @author DB
|
||||
* @since 2023/09/18 17:18
|
||||
* @return com.cpop.core.base.R<com.mybatisflex.core.paginate.Page<com.cpop.oam.business.vo.TaskWorkOrderPageVo>>
|
||||
*/
|
||||
@PreAuthorize("@aps.hasPermission('oamTask:workOrder:list')")
|
||||
@ApiOperation("工单模块-工单提交-接收/处理/暂停中")
|
||||
@GetMapping("/receiveDealPause")
|
||||
public R<TaskWorkOrderReceiveDealPauseVo> receiveDealPause() {
|
||||
TaskWorkOrderReceiveDealPauseVo vo = taskWorkOrderService.receiveDealPause();
|
||||
return R.ok(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 工单模块-工单提交-获取当天值班人员
|
||||
* @author DB
|
||||
* @since 2023-11-29 14:01:03
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@PreAuthorize("@aps.hasPermission('oamTask:workOrder:list')")
|
||||
@ApiOperation("工单模块-工单提交-获取当天值班人员")
|
||||
@GetMapping("/getWorkOrderDutyStaff")
|
||||
public R<WorkOrderDutyVo> getWorkOrderDutyStaff() {
|
||||
WorkOrderDutyVo vo = taskWorkOrderService.getWorkOrderDutyStaff();
|
||||
return R.ok(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 工单模块-工单提交-已办结分页列表
|
||||
* @author DB
|
||||
* @since 2023-11-29 14:35:08
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@PreAuthorize("@aps.hasPermission('oamTask:workOrder:list')")
|
||||
@ApiOperation("工单模块-工单提交-已办结分页列表")
|
||||
@GetMapping("/finishWorkOrderPage")
|
||||
public R<Page<TaskWorkOrderPageVo>> finishWorkOrderPage() {
|
||||
Page<TaskWorkOrderPageVo> page = taskWorkOrderService.finishWorkOrderPage();
|
||||
return R.ok(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 工单模块-工单提交-新增工单
|
||||
* @param bo 请求参数
|
||||
* @return R<Void>
|
||||
* @author DB
|
||||
* @since 2023/5/30 16:53
|
||||
**/
|
||||
@PreAuthorize("@aps.hasPermission('oamTask:workOrder:insert')")
|
||||
@ApiOperation("任务管理模块-工单管理-新增工单")
|
||||
@ApiOperation("工单模块-工单提交-新增工单")
|
||||
@PostMapping("/insertWorkOrder")
|
||||
public R<Void> insertWorkOrder(@RequestBody @Validated TaskWorkOrderBo bo) {
|
||||
public R<Void> insertWorkOrder(@RequestBody @Validated
|
||||
TaskWorkOrderBo bo) {
|
||||
taskWorkOrderService.insertWorkOrder(bo);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* @descriptions 查询任务-工单-记录表列表
|
||||
* 工单模块-工单提交-工单记录列表
|
||||
* @author DB
|
||||
* @date 2023/09/18 17:18
|
||||
* @param bo 请求参数
|
||||
* @return com.cpop.core.base.R<com.mybatisflex.core.paginate.Page<com.cpop.oam.business.vo.TaskWorkOrderPageVo>>
|
||||
*/
|
||||
@ApiOperation("任务管理模块-工单-分页列表")
|
||||
@PostMapping("/getWorkOrderPage")
|
||||
public R<Page<TaskWorkOrderPageVo>> getWorkOrderPage(@RequestBody TaskWorkOrderPageBo bo) {
|
||||
Page<TaskWorkOrderPageVo> pageVo = taskWorkOrderService.getWorkOrderPage(bo);
|
||||
return R.ok(pageVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* @descriptions 查询任务-工单记录-列表
|
||||
* @author DB
|
||||
* @date 2023/09/18 17:19
|
||||
* @param workRecordId 工单记录id
|
||||
* @return com.cpop.core.base.R<java.util.List<com.cpop.oam.business.vo.TaskWorkOrderRecordListVo>>
|
||||
* @param workOrderId 工单id
|
||||
* @since 2023-11-29 11:25:28
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@PreAuthorize("@aps.hasPermission('oamTask:workOrder:record')")
|
||||
@ApiOperation("任务管理模块-工单记录")
|
||||
@GetMapping("/getWorkOrderRecordList/{workRecordId}")
|
||||
public R<List<TaskWorkOrderRecordListVo>> getWorkOrderRecordList(@PathVariable("workRecordId") String workRecordId) {
|
||||
List<TaskWorkOrderRecordListVo> list = taskWorkOrderService.getWorkOrderRecordList(workRecordId);
|
||||
@ApiOperation("工单模块-工单提交-工单记录列表")
|
||||
@GetMapping("/getWorkOrderRecordList/{workOrderId}")
|
||||
public R<List<TaskWorkOrderRecordListVo>> getWorkOrderRecordList(@PathVariable @ApiParam("工单id")
|
||||
String workOrderId) {
|
||||
List<TaskWorkOrderRecordListVo> list = taskWorkOrderService.getWorkOrderRecordList(workOrderId);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: 任务管理-工单管理-新增工单记录
|
||||
* 工单模块-工单提交-新增工单记录
|
||||
* @author DB
|
||||
* @param bo 请求参数
|
||||
* @return: R<Void>
|
||||
* @Author: DB
|
||||
* @Date: 2023/5/30 16:53
|
||||
**/
|
||||
@ApiOperation("任务管理模块-工单管理-新增工单记录")
|
||||
* @since 2023-11-29 11:33:35
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@PreAuthorize("@aps.hasPermission('oamTask:workOrder:record')")
|
||||
@ApiOperation("工单模块-工单提交-新增工单记录")
|
||||
@PostMapping("/insertWorkOrderRecord")
|
||||
public R<Void> insertWorkOrderRecord(@RequestBody @Validated TaskWorkOrderRecordBo bo) {
|
||||
public R<Void> insertWorkOrderRecord(@RequestBody @Validated
|
||||
TaskWorkOrderRecordBo bo) {
|
||||
taskWorkOrderService.insertWorkOrderRecord(bo);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: 工单办结
|
||||
* @param id 主键
|
||||
* @return: R<Void>
|
||||
* @Author: DB
|
||||
* @Date: 2023/5/16 17:10
|
||||
**/
|
||||
@PreAuthorize("@aps.hasPermission('oamTask:workOrder:update')")
|
||||
@ApiOperation("工单办结")
|
||||
@PutMapping("/concludeWorkOrder/{id}")
|
||||
public R<Void> concludeWorkOrder(@PathVariable("id") String id) {
|
||||
taskWorkOrderService.concludeWorkOrder(id);
|
||||
* 工单模块-工单提交-工单提醒
|
||||
* @author DB
|
||||
* @param workOrderId 工单id
|
||||
* @since 2023-11-29 11:41:46
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@PreAuthorize("@aps.hasPermission('oamTask:workOrder:record')")
|
||||
@ApiOperation("工单模块-工单提交-工单提醒")
|
||||
@PutMapping("/workOrderRemind/{workOrderId}")
|
||||
public R<Void> workOrderRemind(@PathVariable @ApiParam("工单id")
|
||||
String workOrderId) {
|
||||
taskWorkOrderService.workOrderRemind(workOrderId);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: 工单暂停
|
||||
* @param bo 请求参数
|
||||
* @return: R<Void>
|
||||
* @Author: DB
|
||||
* @Date: 2023/5/16 17:10
|
||||
**/
|
||||
* 工单模块-工单提交-工单转需求
|
||||
* @author DB
|
||||
* @param workOrderId 工单id
|
||||
* @since 2023-11-29 12:30:21
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Deprecated
|
||||
@PreAuthorize("@aps.hasPermission('oamTask:workOrder:update')")
|
||||
@ApiOperation("工单暂停")
|
||||
@ApiOperation("工单模块-工单提交-工单转需求")
|
||||
@PutMapping("/workOrderToDemand/{workOrderId}")
|
||||
public R<Void> workOrderToDemand(@PathVariable @ApiParam("工单id")
|
||||
String workOrderId) {
|
||||
taskWorkOrderService.workOrderToDemand(workOrderId);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 工单模块-工单提交-工单暂停
|
||||
* @author DB
|
||||
* @param bo 请求参数
|
||||
* @since 2023-11-29 16:00:18
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@PreAuthorize("@aps.hasPermission('oamTask:workOrder:update')")
|
||||
@ApiOperation("工单模块-工单提交-工单暂停")
|
||||
@PutMapping("/pauseWorkOrder")
|
||||
public R<Void> pauseWorkOrder(@RequestBody PauseWorkOrderBo bo) {
|
||||
public R<Void> pauseWorkOrder(@RequestBody @Validated
|
||||
PauseWorkOrderBo bo) {
|
||||
taskWorkOrderService.pauseWorkOrder(bo);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 工单模块-工单提交-工单办结
|
||||
* @author DB
|
||||
* @param workOrderId 工单id
|
||||
* @since 2023-11-29 15:44:08
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@PreAuthorize("@aps.hasPermission('oamTask:workOrder:update')")
|
||||
@ApiOperation("工单模块-工单提交-工单办结")
|
||||
@PutMapping("/workOrderFinish/{workOrderId}")
|
||||
public R<Void> workOrderFinish(@PathVariable("workOrderId") @ApiParam("工单id")
|
||||
String workOrderId) {
|
||||
taskWorkOrderService.workOrderFinish(workOrderId);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* @descriptions 任务管理模块-工单管理-获取品牌列表
|
||||
* @author DB
|
||||
* @date 2023/11/28 12:34
|
||||
* @param brandName
|
||||
* 品牌名
|
||||
* @return: com.cpop.core.base.R<java.util.List<com.cpop.jambox.business.vo.BrandListVo>>
|
||||
*/
|
||||
@ApiOperation("工单模块-工单提交-获取品牌列表")
|
||||
@GetMapping("/getBrandList")
|
||||
public R<List<BrandListVo>> getBrandList(@ApiParam("品牌名")
|
||||
String brandName) {
|
||||
List<BrandListVo> list =
|
||||
brandService.queryChain().and(BRAND.BRAND_NAME.like(brandName)).listAs(BrandListVo.class);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @descriptions 任务管理模块-工单管理-获取校区/店铺列表
|
||||
* @author DB
|
||||
* @date 2023/11/28 12:38
|
||||
* @param brandId
|
||||
* 品牌id
|
||||
* @return: com.cpop.core.base.R<java.util.List<com.cpop.oam.business.vo.StoreListVo>>
|
||||
*/
|
||||
@ApiOperation("工单模块-工单提交-获取校区/店铺列表")
|
||||
@GetMapping("/getStoreList")
|
||||
public R<List<StoreListVo>> getStoreList(@ApiParam("品牌id")
|
||||
String brandId) {
|
||||
List<StoreListVo> list = storeService.queryChain().and(STORE.BRAND_ID.eq(brandId)).listAs(StoreListVo.class);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,7 +1,103 @@
|
||||
package com.cpop.oam.business.dto;/**
|
||||
package com.cpop.oam.business.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author DB
|
||||
* @createTime 2023/11/28 15:42
|
||||
* @description
|
||||
* @description
|
||||
*/
|
||||
public class TaskWorkOrderReceiveDealPauseDto {
|
||||
@Data
|
||||
public class TaskWorkOrderReceiveDealPauseDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 任务状态
|
||||
*/
|
||||
private Integer taskStatus;
|
||||
|
||||
/**
|
||||
* 机构/品牌
|
||||
*/
|
||||
private String brandName;
|
||||
|
||||
/**
|
||||
* 校区/店铺
|
||||
*/
|
||||
private String storeName;
|
||||
|
||||
/**
|
||||
* 问题描述
|
||||
*/
|
||||
private String taskContent;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String phoneNumber;
|
||||
|
||||
/**
|
||||
* 提交员工di
|
||||
*/
|
||||
private String recordStaffId;
|
||||
|
||||
/**
|
||||
* 提交人
|
||||
*/
|
||||
private String recordStaffName;
|
||||
|
||||
/**
|
||||
* 提交时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 接收员工id
|
||||
*/
|
||||
private String responsibleStaffId;
|
||||
|
||||
/**
|
||||
* 接收人
|
||||
*/
|
||||
private String responsibleStaffName;
|
||||
|
||||
/**
|
||||
* 任务接收时间
|
||||
*/
|
||||
private LocalDateTime taskReceiptTime;
|
||||
|
||||
/**
|
||||
* 任务接收用时/min
|
||||
*/
|
||||
private Integer receivingTime;
|
||||
|
||||
/**
|
||||
* 暂停员工id
|
||||
*/
|
||||
private String pauseStaffId;
|
||||
|
||||
/**
|
||||
* 暂停员工
|
||||
*/
|
||||
private String pauseStaffName;
|
||||
|
||||
/**
|
||||
* 暂停记录时间
|
||||
*/
|
||||
private LocalDateTime pauseRecordTime;
|
||||
|
||||
/**
|
||||
* 暂停到期时间
|
||||
*/
|
||||
private LocalDateTime pauseExpireTime;
|
||||
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ import java.time.LocalDateTime;
|
||||
* @since 2023-09-15
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ -40,7 +40,7 @@ public class Task extends BaseEntity implements Serializable {
|
||||
private String taskName;
|
||||
|
||||
/**
|
||||
* 任务类型(0:迭代;1:需求;2:工单)
|
||||
* 任务类型(0:迭代;1:需求;2:投诉/工单)
|
||||
*/
|
||||
private Integer taskType;
|
||||
|
||||
@ -50,7 +50,7 @@ public class Task extends BaseEntity implements Serializable {
|
||||
private String responsibleStaffId;
|
||||
|
||||
/**
|
||||
* 任务状态(-1:失败;0:待审核;1:待接受;2:进行中;3:已完成;4:逾期;5:暂停;6:逾期完成)
|
||||
* 任务状态(-1:失败;0:待审核;1:待接受;2:进行中;3:已完成;4:逾期;5:暂停;6:逾期完成;7:接收超时)
|
||||
*/
|
||||
private Integer taskStatus;
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@ import java.time.LocalDateTime;
|
||||
* @since 2023-09-18
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ -44,9 +44,9 @@ public class TaskWorkOrder extends BaseEntity implements Serializable {
|
||||
private String brandId;
|
||||
|
||||
/**
|
||||
* 校区id
|
||||
* 校区店铺id
|
||||
*/
|
||||
private String campusId;
|
||||
private String storeId;
|
||||
|
||||
/**
|
||||
* 产品id
|
||||
@ -68,9 +68,30 @@ public class TaskWorkOrder extends BaseEntity implements Serializable {
|
||||
*/
|
||||
private LocalDateTime finishTime;
|
||||
|
||||
/**
|
||||
* 办结员工id
|
||||
*/
|
||||
private String finishStaffId;
|
||||
|
||||
/**
|
||||
* 接收用时
|
||||
*/
|
||||
private Integer receivingTime;
|
||||
|
||||
/**
|
||||
* 暂停员工
|
||||
*/
|
||||
private String pauseStaffId;
|
||||
|
||||
/**
|
||||
* 暂停记录时间
|
||||
*/
|
||||
private LocalDateTime pauseRecordTime;
|
||||
|
||||
/**
|
||||
* 暂停到期时间
|
||||
*/
|
||||
private LocalDateTime pauseExpireTime;
|
||||
|
||||
/**
|
||||
* 是否删除(0否1是)
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
package com.cpop.oam.business.service;
|
||||
|
||||
import com.cpop.oam.business.vo.TaskWorkOrderReceiveDealPauseVo;
|
||||
import com.cpop.oam.business.vo.WorkOrderDutyVo;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.cpop.oam.business.bo.PauseWorkOrderBo;
|
||||
import com.cpop.oam.business.bo.TaskWorkOrderBo;
|
||||
import com.cpop.oam.business.bo.TaskWorkOrderPageBo;
|
||||
import com.cpop.oam.business.bo.TaskWorkOrderRecordBo;
|
||||
import com.cpop.oam.business.entity.TaskWorkOrder;
|
||||
import com.cpop.oam.business.vo.TaskWorkOrderPageVo;
|
||||
@ -21,56 +22,90 @@ import java.util.List;
|
||||
public interface TaskWorkOrderService extends IService<TaskWorkOrder> {
|
||||
|
||||
/**
|
||||
* @Description: 任务管理-工单管理-新增工单
|
||||
* @param bo 请求参数
|
||||
* @return: R<Void>
|
||||
* @Author: DB
|
||||
* @Date: 2023/5/30 16:53
|
||||
* 工单模块-工单提交-接收/处理/暂停中
|
||||
* @author DB
|
||||
* @since 2023/09/18 17:18
|
||||
* @return com.cpop.core.base.R<com.mybatisflex.core.paginate.Page<com.cpop.oam.business.vo.TaskWorkOrderPageVo>>
|
||||
*/
|
||||
TaskWorkOrderReceiveDealPauseVo receiveDealPause();
|
||||
|
||||
/**
|
||||
* 工单模块-工单提交-获取当天值班人员
|
||||
* @author DB
|
||||
* @since 2023-11-29 14:01:03
|
||||
* @version 1.0.0
|
||||
*/
|
||||
WorkOrderDutyVo getWorkOrderDutyStaff();
|
||||
|
||||
/**
|
||||
* 工单模块-工单提交-已办结分页列表
|
||||
* @author DB
|
||||
* @since 2023-11-29 14:35:08
|
||||
* @version 1.0.0
|
||||
*/
|
||||
Page<TaskWorkOrderPageVo> finishWorkOrderPage();
|
||||
|
||||
/**
|
||||
* 工单模块-工单提交-新增工单
|
||||
* @param bo 请求参数
|
||||
* @return R<Void>
|
||||
* @author DB
|
||||
* @since 2023/5/30 16:53
|
||||
**/
|
||||
void insertWorkOrder(TaskWorkOrderBo bo);
|
||||
|
||||
/**
|
||||
* @descriptions 查询任务-工单-记录表列表
|
||||
* 工单模块-工单提交-工单记录列表
|
||||
* @author DB
|
||||
* @date 2023/09/18 17:18
|
||||
* @param bo 请求参数
|
||||
* @return com.cpop.core.base.R<com.mybatisflex.core.paginate.Page<com.cpop.oam.business.vo.TaskWorkOrderPageVo>>
|
||||
* @param workOrderId 工单id
|
||||
* @since 2023-11-29 11:25:28
|
||||
* @version 1.0.0
|
||||
*/
|
||||
Page<TaskWorkOrderPageVo> getWorkOrderPage(TaskWorkOrderPageBo bo);
|
||||
List<TaskWorkOrderRecordListVo> getWorkOrderRecordList(String workOrderId);
|
||||
|
||||
/**
|
||||
* @descriptions 查询任务-工单记录-列表
|
||||
* 工单模块-工单提交-新增工单记录
|
||||
* @author DB
|
||||
* @date 2023/09/18 17:19
|
||||
* @param workRecordId 工单记录id
|
||||
* @return com.cpop.core.base.R<java.util.List<com.cpop.oam.business.vo.TaskWorkOrderRecordListVo>>
|
||||
*/
|
||||
List<TaskWorkOrderRecordListVo> getWorkOrderRecordList(String workRecordId);
|
||||
|
||||
/**
|
||||
* @Description: 任务管理-工单管理-新增工单记录
|
||||
* @param bo 请求参数
|
||||
* @return: R<Void>
|
||||
* @Author: DB
|
||||
* @Date: 2023/5/30 16:53
|
||||
**/
|
||||
* @since 2023-11-29 11:33:35
|
||||
* @version 1.0.0
|
||||
*/
|
||||
void insertWorkOrderRecord(TaskWorkOrderRecordBo bo);
|
||||
|
||||
/**
|
||||
* @Description: 工单办结
|
||||
* @param id 主键
|
||||
* @return: R<Void>
|
||||
* @Author: DB
|
||||
* @Date: 2023/5/16 17:10
|
||||
**/
|
||||
void concludeWorkOrder(String id);
|
||||
* 工单模块-工单提交-工单提醒
|
||||
* @author DB
|
||||
* @param workOrderId 工单id
|
||||
* @since 2023-11-29 11:41:46
|
||||
* @version 1.0.0
|
||||
*/
|
||||
void workOrderRemind(String workOrderId);
|
||||
|
||||
/**
|
||||
* @Description: 工单暂停
|
||||
* 工单模块-工单提交-工单转需求
|
||||
* @author DB
|
||||
* @param workOrderId 工单id
|
||||
* @since 2023-11-29 12:30:21
|
||||
* @version 1.0.0
|
||||
*/
|
||||
void workOrderToDemand(String workOrderId);
|
||||
|
||||
/**
|
||||
* 工单模块-工单提交-工单暂停
|
||||
* @author DB
|
||||
* @param bo 请求参数
|
||||
* @return: R<Void>
|
||||
* @Author: DB
|
||||
* @Date: 2023/5/16 17:10
|
||||
**/
|
||||
* @since 2023-11-29 16:00:18
|
||||
* @version 1.0.0
|
||||
*/
|
||||
void pauseWorkOrder(PauseWorkOrderBo bo);
|
||||
|
||||
/**
|
||||
* 工单模块-工单提交-工单办结
|
||||
* @author DB
|
||||
* @param workOrderId 工单id
|
||||
* @since 2023-11-29 15:44:08
|
||||
* @version 1.0.0
|
||||
*/
|
||||
void workOrderFinish(String workOrderId);
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,12 @@
|
||||
package com.cpop.oam.business.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cpop.common.utils.StringUtils;
|
||||
import com.cpop.core.base.entity.PageDomain;
|
||||
import com.cpop.oam.business.dto.TaskWorkOrderReceiveDealPauseDto;
|
||||
import com.cpop.oam.business.vo.TaskWorkOrderReceiveDealPauseVo;
|
||||
import com.cpop.oam.business.vo.WorkOrderDutyVo;
|
||||
import com.cpop.oam.framework.tasks.WorkOrderAcceptOverTimeTask;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
@ -8,7 +14,6 @@ import com.cpop.api.tencent.wxWork.handler.WebHookSendHandler;
|
||||
import com.cpop.common.utils.DateUtils;
|
||||
import com.cpop.common.utils.bean.BeanUtils;
|
||||
import com.cpop.core.base.entity.LoginUser;
|
||||
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;
|
||||
@ -16,12 +21,9 @@ import com.cpop.core.service.RedisService;
|
||||
import com.cpop.core.utils.QuartzUtils;
|
||||
import com.cpop.core.utils.SecurityUtils;
|
||||
import com.cpop.core.utils.SpringUtils;
|
||||
import com.cpop.core.utils.sql.SqlUtils;
|
||||
import com.cpop.oam.business.bo.PauseWorkOrderBo;
|
||||
import com.cpop.oam.business.bo.TaskWorkOrderBo;
|
||||
import com.cpop.oam.business.bo.TaskWorkOrderPageBo;
|
||||
import com.cpop.oam.business.bo.TaskWorkOrderRecordBo;
|
||||
import com.cpop.oam.business.dto.TaskWorkOrderRecordDto;
|
||||
import com.cpop.oam.business.entity.*;
|
||||
import com.cpop.oam.business.mapper.TaskWorkOrderMapper;
|
||||
import com.cpop.oam.business.service.*;
|
||||
@ -31,6 +33,7 @@ import com.cpop.oam.business.vo.TaskWorkOrderRecordListVo;
|
||||
import com.cpop.oam.framework.constant.WebHookKeyConstant;
|
||||
import com.cpop.oam.framework.enums.QuartzEnums;
|
||||
import com.cpop.oam.framework.tasks.WorkOrderOvertimeTask;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.quartz.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -42,6 +45,8 @@ import java.text.ParseException;
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -54,6 +59,7 @@ import static com.cpop.oam.business.entity.table.TaskWorkOrderRecordTableDef.TAS
|
||||
import static com.cpop.oam.business.entity.table.TaskWorkOrderTableDef.TASK_WORK_ORDER;
|
||||
import static com.cpop.system.business.entity.table.BrandTableDef.BRAND;
|
||||
import static com.cpop.system.business.entity.table.StoreTableDef.STORE;
|
||||
import com.cpop.core.utils.sql.SqlUtils;
|
||||
|
||||
/**
|
||||
* 任务-工单表 服务层实现。
|
||||
@ -61,241 +67,506 @@ import static com.cpop.system.business.entity.table.StoreTableDef.STORE;
|
||||
* @author DB
|
||||
* @since 2023-09-18
|
||||
*/
|
||||
@Slf4j
|
||||
@Service("taskWorkOrderService")
|
||||
public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, TaskWorkOrder> implements TaskWorkOrderService {
|
||||
public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, TaskWorkOrder>
|
||||
implements TaskWorkOrderService {
|
||||
|
||||
@Autowired
|
||||
private Scheduler scheduler;
|
||||
|
||||
/**
|
||||
* @param bo 请求参数
|
||||
* @Description: 任务管理-工单管理-新增工单
|
||||
* @return: R<Void>
|
||||
* @Author: DB
|
||||
* @Date: 2023/5/30 16:53
|
||||
* 工单模块-工单提交-接收/处理/暂停中
|
||||
* @author DB
|
||||
* @since 2023/09/18 17:18
|
||||
* @return com.cpop.core.base.R<com.mybatisflex.core.paginate.Page<com.cpop.oam.business.vo.TaskWorkOrderPageVo>>
|
||||
*/
|
||||
@Override
|
||||
public TaskWorkOrderReceiveDealPauseVo receiveDealPause() {
|
||||
// 获取工单
|
||||
List<TaskWorkOrderReceiveDealPauseDto> dtoList = this.mapper.selectListByQueryAs(QueryWrapper.create()
|
||||
// 工单
|
||||
.select(TASK_WORK_ORDER.ID,
|
||||
TASK_WORK_ORDER.PHONE_NUMBER,
|
||||
TASK_WORK_ORDER.RECORD_STAFF_ID,
|
||||
TASK_WORK_ORDER.CREATE_TIME.as("createTime"),
|
||||
TASK_WORK_ORDER.RECEIVING_TIME,
|
||||
TASK_WORK_ORDER.PAUSE_STAFF_ID,
|
||||
TASK_WORK_ORDER.PAUSE_RECORD_TIME,
|
||||
TASK_WORK_ORDER.PAUSE_EXPIRE_TIME)
|
||||
// 任务
|
||||
.select(TASK.TASK_CONTENT, TASK.TASK_STATUS, TASK.RESPONSIBLE_STAFF_ID, TASK.TASK_RECEIPT_TIME)
|
||||
// 品牌
|
||||
.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, 7)),
|
||||
TaskWorkOrderReceiveDealPauseDto.class,
|
||||
// 提交人
|
||||
item -> item.field(TaskWorkOrderReceiveDealPauseDto::getRecordStaffName)
|
||||
.queryWrapper(recordStaff -> queryChain().select(STAFF.NAME.as("recordStaffName"))
|
||||
.from(STAFF)
|
||||
.where(STAFF.ID.eq(recordStaff.getRecordStaffId()))),
|
||||
// 负责人
|
||||
item -> item.field(TaskWorkOrderReceiveDealPauseDto::getResponsibleStaffName)
|
||||
.queryWrapper(responsibleStaff -> queryChain().select(STAFF.NAME.as("responsibleStaffName"))
|
||||
.from(STAFF)
|
||||
.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"))));
|
||||
// 分组过滤
|
||||
Map<Integer, List<TaskWorkOrderReceiveDealPauseDto>> taskStatusMap =
|
||||
dtoList.stream().collect(Collectors.groupingBy(TaskWorkOrderReceiveDealPauseDto::getTaskStatus));
|
||||
TaskWorkOrderReceiveDealPauseVo taskWorkOrderReceiveDealPauseVo = new TaskWorkOrderReceiveDealPauseVo();
|
||||
taskStatusMap.forEach((key, value) -> {
|
||||
switch (key) {
|
||||
// 待接收
|
||||
case 1:
|
||||
// 接收逾期
|
||||
case 7:
|
||||
List<TaskWorkOrderReceiveDealPauseVo.Receive> receiveList =
|
||||
BeanUtils.mapToList(taskStatusMap.get(key), TaskWorkOrderReceiveDealPauseVo.Receive.class);
|
||||
if (taskWorkOrderReceiveDealPauseVo.getReceiveList() == null) {
|
||||
taskWorkOrderReceiveDealPauseVo.setReceiveList(receiveList);
|
||||
} else {
|
||||
taskWorkOrderReceiveDealPauseVo.getReceiveList().addAll(receiveList);
|
||||
}
|
||||
break;
|
||||
// 进行中
|
||||
case 2:
|
||||
// 逾期
|
||||
case 4:
|
||||
List<TaskWorkOrderReceiveDealPauseVo.Deal> dealList =
|
||||
BeanUtils.mapToList(taskStatusMap.get(key), TaskWorkOrderReceiveDealPauseVo.Deal.class);
|
||||
if (taskWorkOrderReceiveDealPauseVo.getDealList() == null) {
|
||||
taskWorkOrderReceiveDealPauseVo.setDealList(dealList);
|
||||
} else {
|
||||
taskWorkOrderReceiveDealPauseVo.getDealList().addAll(dealList);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
// 暂停中
|
||||
List<TaskWorkOrderReceiveDealPauseVo.Pause> pauseList =
|
||||
BeanUtils.mapToList(taskStatusMap.get(key), TaskWorkOrderReceiveDealPauseVo.Pause.class);
|
||||
taskWorkOrderReceiveDealPauseVo.setPauseList(pauseList);
|
||||
}
|
||||
});
|
||||
return taskWorkOrderReceiveDealPauseVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 工单模块-工单提交-获取当天值班人员
|
||||
* @author DB
|
||||
* @since 2023-11-29 14:01:03
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Override
|
||||
public WorkOrderDutyVo getWorkOrderDutyStaff() {
|
||||
return SpringUtils.getBean(DutyService.class)
|
||||
.getMapper()
|
||||
.selectOneWithRelationsByQueryAs(
|
||||
QueryWrapper.create()
|
||||
.select(DUTY.SERVICE_STAFF_ID, DUTY.TECHNOLOGY_STAFF_ID, DUTY.DUTY_DATE)
|
||||
.from(DUTY)
|
||||
.where(DUTY.DUTY_DATE.eq(DateUtils.getDate())),
|
||||
WorkOrderDutyVo.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 工单模块-工单提交-已办结分页列表
|
||||
* @author DB
|
||||
* @since 2023-11-29 14:35:08
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Override
|
||||
public Page<TaskWorkOrderPageVo> finishWorkOrderPage() {
|
||||
PageDomain pageDomain = SqlUtils.getInstance().getPageDomain();
|
||||
return this.mapper.paginateAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()),
|
||||
QueryWrapper.create()
|
||||
.select(TASK_WORK_ORDER.FINISH_STAFF_ID, TASK_WORK_ORDER.FINISH_TIME)
|
||||
.select(TASK.TASK_CONTENT)
|
||||
.from(TASK_WORK_ORDER)
|
||||
.leftJoin(TASK)
|
||||
.on(TASK.ID.eq(TASK_WORK_ORDER.TASK_ID))
|
||||
// 工单
|
||||
.where(TASK.TASK_TYPE.eq(2))
|
||||
.and(TASK.TASK_STATUS.in(3, 6)),
|
||||
TaskWorkOrderPageVo.class,
|
||||
item -> item.field(TaskWorkOrderPageVo::getFinishStaffName)
|
||||
.queryWrapper(finishStaff -> queryChain().select(STAFF.NAME.as("finishStaffName"))
|
||||
.from(STAFF)
|
||||
.where(STAFF.ID.eq(finishStaff.getFinishStaffId()))));
|
||||
}
|
||||
|
||||
/**
|
||||
* 工单模块-工单提交-新增工单
|
||||
* @param bo 请求参数
|
||||
* @return R<Void>
|
||||
* @author DB
|
||||
* @since 2023/5/30 16:53
|
||||
**/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void insertWorkOrder(TaskWorkOrderBo bo) {
|
||||
//添加任务
|
||||
Task task = new Task();
|
||||
BeanUtils.copyBeanProp(task, bo);
|
||||
//默认待接受
|
||||
task.setTaskStatus(2)
|
||||
//默认开发中
|
||||
.setTaskItem(0)
|
||||
.setTaskWeight(10)
|
||||
//工单不参与评级
|
||||
.setTaskRating(-1)
|
||||
.setTaskReceiptTime(LocalDateTime.now());
|
||||
//获取值班员工
|
||||
// 获取值班员工
|
||||
DutyService dutyService = SpringUtils.getBean(DutyService.class);
|
||||
Duty duty = dutyService.getOne(QueryWrapper.create().where(DUTY.DUTY_DATE.eq(DateUtils.getDate())));
|
||||
if (null == duty) {
|
||||
if (duty == null) {
|
||||
throw new ServiceException("当天没有值班员工,请联系相关人员添加值班信息!");
|
||||
}
|
||||
task.setResponsibleStaffId(duty.getTechnologyStaffId());
|
||||
// 添加任务
|
||||
Task task = new Task();
|
||||
BeanUtils.copyBeanProp(task, bo);
|
||||
// 默认待接受
|
||||
task.setTaskStatus(1)
|
||||
.setTaskName("工单")
|
||||
// 默认开发中
|
||||
.setTaskItem(0)
|
||||
.setTaskWeight(10)
|
||||
// 工单不参与评级
|
||||
.setTaskRating(-1);
|
||||
TaskService taskService = SpringUtils.getBean(TaskService.class);
|
||||
task.setExpectedCompletionDate(Date.valueOf(LocalDate.now()));
|
||||
taskService.save(task);
|
||||
//添加工单绩点
|
||||
TaskStaffGroupService staffGroupService = SpringUtils.getBean(TaskStaffGroupService.class);
|
||||
TaskStaffGroup taskStaffGroup = new TaskStaffGroup();
|
||||
taskStaffGroup.setStaffId(duty.getTechnologyStaffId())
|
||||
.setTaskId(task.getId())
|
||||
.setGradePoint(0);
|
||||
staffGroupService.save(taskStaffGroup);
|
||||
//添加工单
|
||||
// 添加工单
|
||||
TaskWorkOrder entity = new TaskWorkOrder();
|
||||
BeanUtils.copyBeanProp(entity, bo);
|
||||
entity.setTaskId(task.getId());
|
||||
//当前操作员工是否是主要负责人,不是抛出异常
|
||||
LoginUser loginUser = SecurityUtils.getInstance().getLoginUser();
|
||||
//读取员工信息
|
||||
RedisService redisService = SpringUtils.getBean(RedisService.class);
|
||||
JSONObject cacheObject = redisService.getCacheObject(UserType.OAM_USER.getKey() + loginUser.getUsername());
|
||||
OamStaffLoginInfo loginInfo = cacheObject.getJSONObject("user").toJavaObject(OamStaffLoginInfo.class);
|
||||
entity.setRecordStaffId(loginInfo.getId());
|
||||
// 读取员工信息
|
||||
JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo();
|
||||
entity.setRecordStaffId(loginUserInfo.getString("id"));
|
||||
this.save(entity);
|
||||
//通知值班员工
|
||||
// 添加一个0绩点
|
||||
TaskStaffGroupService taskStaffGroupService = SpringUtils.getBean(TaskStaffGroupService.class);
|
||||
TaskStaffGroup taskStaffGroup = new TaskStaffGroup();
|
||||
taskStaffGroup.setTaskId(task.getId()).setStaffId(duty.getTechnologyStaffId()).setGradePoint(0);
|
||||
taskStaffGroupService.save(taskStaffGroup);
|
||||
// 通知值班员工
|
||||
StaffService staffService = SpringUtils.getBean(StaffService.class);
|
||||
StaffInfoVo technologyStaffInfo = staffService.getStaffInfo(duty.getTechnologyStaffId());
|
||||
if (null != technologyStaffInfo) {
|
||||
//企微通知值班人员
|
||||
if (technologyStaffInfo != null) {
|
||||
// 企微通知值班人员
|
||||
List<String> phoneList = new ArrayList<String>();
|
||||
phoneList.add(technologyStaffInfo.getPhoneNumber());
|
||||
try {
|
||||
SpringUtils.getBean(WebHookSendHandler.class).webHookSendText(WebHookKeyConstant.ORDER_INFO_BOT, phoneList, "==========您有一条新的工单需要处理==========", false);
|
||||
SpringUtils.getBean(WebHookSendHandler.class)
|
||||
.webHookSendText(WebHookKeyConstant.ORDER_INFO_BOT,
|
||||
phoneList,
|
||||
"==========您有一条新的工单需要处理==========" + "\n" + task.getTaskName() + "\n" + task.getTaskContent(),
|
||||
false);
|
||||
} catch (IOException e) {
|
||||
throw new ServiceException("发送消息通知失败!");
|
||||
}
|
||||
//添加工单记录
|
||||
TaskWorkOrderRecordDto orderRecordDto = new TaskWorkOrderRecordDto();
|
||||
orderRecordDto.setRecordStaffId(loginInfo.getId())
|
||||
.setTaskWorkOrderId(entity.getId())
|
||||
.setRecordText(bo.getTaskContent())
|
||||
.setAttachmentUrl(bo.getAttachmentUrl())
|
||||
.setRecordStaffPhone(loginInfo.getPhoneNumber())
|
||||
.setResponsibleStaffPhone(technologyStaffInfo.getPhoneNumber());
|
||||
SpringUtils.getBean(TaskWorkOrderRecordService.class).insertTaskWorkOrderRecord(orderRecordDto);
|
||||
}
|
||||
//添加逾期检查任务
|
||||
startOrUpdateWorkOrderOvertimeTask(entity.getId(), false, Date.valueOf(LocalDate.now()));
|
||||
// 添加未接收任务
|
||||
startOrRemoveWorkOrderAcceptTask(entity.getId(), true, LocalDateTime.now());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param workOrderId 工单id
|
||||
* @param isUpdate 是否更新
|
||||
* @param date 开始时间
|
||||
* @Description: 生成工单超时任务
|
||||
* 开始或删除工单接收任务
|
||||
* @author DB
|
||||
* @Date: 2023/7/13 0013 9:23
|
||||
* @param workOrderId 工单id
|
||||
* @param isStart 是否是开始标识
|
||||
* @param dateTime 时间
|
||||
* @since 2023-11-29 10:21:02
|
||||
* @version 1.0.0
|
||||
*/
|
||||
private void startOrUpdateWorkOrderOvertimeTask(String workOrderId, Boolean isUpdate, Date date) {
|
||||
private void startOrRemoveWorkOrderAcceptTask(String workOrderId, Boolean isStart, LocalDateTime dateTime) {
|
||||
// 基于表达式构建触发器
|
||||
QuartzUtils quartzUtils = SpringUtils.getBean(QuartzUtils.class);
|
||||
try {
|
||||
String cron = quartzUtils.convertToCron(DateUtils.addDateHours(date, 2));
|
||||
if (isUpdate) {
|
||||
quartzUtils.modifyJob(QuartzEnums.WORK_ORDER_OVERTIME_TASK.getName() + workOrderId,
|
||||
QuartzEnums.WORK_ORDER_OVERTIME_TASK.getGroup(), cron);
|
||||
} else {
|
||||
QuartzEnums acceptEnums = QuartzEnums.WORK_ORDER_ACCEPT_OVERTIME_TASK;
|
||||
// 开始
|
||||
if (isStart) {
|
||||
// 未接收半小时后触发
|
||||
LocalDateTime localDateTime = dateTime.plusMinutes(30);
|
||||
ZoneId zoneId = ZoneId.systemDefault();
|
||||
String cron = quartzUtils.convertToCron(Date.from(localDateTime.atZone(zoneId).toInstant()));
|
||||
// 通过JobBuilder构建JobDetail实例,JobDetail规定其job只能是实现Job接口的实例
|
||||
JobDetail jobDetail = JobBuilder.newJob(WorkOrderOvertimeTask.class).withIdentity(QuartzEnums.WORK_ORDER_OVERTIME_TASK.getName() + workOrderId,
|
||||
QuartzEnums.WORK_ORDER_OVERTIME_TASK.getGroup())
|
||||
.usingJobData("WorkOrderId", workOrderId)
|
||||
.build();
|
||||
JobDetail jobDetail = JobBuilder.newJob(WorkOrderAcceptOverTimeTask.class)
|
||||
.withIdentity(acceptEnums.getName() + workOrderId, acceptEnums.getGroup())
|
||||
.usingJobData("WorkOrderId", workOrderId)
|
||||
.build();
|
||||
CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule(cron);
|
||||
// CronTrigger表达式触发器 继承于Trigger。TriggerBuilder 用于构建触发器实例
|
||||
CronTrigger cronTrigger = TriggerBuilder.newTrigger().withIdentity(QuartzEnums.WORK_ORDER_OVERTIME_TASK.getName() + workOrderId,
|
||||
QuartzEnums.WORK_ORDER_OVERTIME_TASK.getGroup())
|
||||
.withSchedule(cronScheduleBuilder).build();
|
||||
CronTrigger cronTrigger = TriggerBuilder.newTrigger()
|
||||
.withIdentity(acceptEnums.getName() + workOrderId, acceptEnums.getGroup())
|
||||
.withSchedule(cronScheduleBuilder)
|
||||
.build();
|
||||
scheduler.scheduleJob(jobDetail, cronTrigger);
|
||||
} else {
|
||||
// 删除
|
||||
quartzUtils.deleteJob(acceptEnums.getName() + workOrderId, acceptEnums.getGroup());
|
||||
}
|
||||
} catch (SchedulerException | ParseException e) {
|
||||
throw new ServiceException("生成工单接收任务失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成工单超时任务
|
||||
* @author DB
|
||||
* @param workOrderId 工单id
|
||||
* @param isUpdate 是否更新
|
||||
* @param dateTime 开始时间
|
||||
* @since 2023-11-29 16:09:02
|
||||
* @version 1.0.0
|
||||
*/
|
||||
private void startOrUpdateWorkOrderOvertimeTask(String workOrderId, Boolean isUpdate, LocalDateTime dateTime) {
|
||||
// 基于表达式构建触发器
|
||||
QuartzUtils quartzUtils = SpringUtils.getBean(QuartzUtils.class);
|
||||
try {
|
||||
LocalDateTime localDateTime = dateTime.plusHours(2);
|
||||
ZoneId zoneId = ZoneId.systemDefault();
|
||||
String cron = quartzUtils.convertToCron(Date.from(localDateTime.atZone(zoneId).toInstant()));
|
||||
if (isUpdate) {
|
||||
quartzUtils.modifyJob(QuartzEnums.WORK_ORDER_OVERTIME_TASK.getName() + workOrderId,
|
||||
QuartzEnums.WORK_ORDER_OVERTIME_TASK.getGroup(),
|
||||
cron);
|
||||
} else {
|
||||
// 通过JobBuilder构建JobDetail实例,JobDetail规定其job只能是实现Job接口的实例
|
||||
JobDetail jobDetail = JobBuilder.newJob(WorkOrderOvertimeTask.class)
|
||||
.withIdentity(QuartzEnums.WORK_ORDER_OVERTIME_TASK.getName() + workOrderId,
|
||||
QuartzEnums.WORK_ORDER_OVERTIME_TASK.getGroup())
|
||||
.usingJobData("WorkOrderId", workOrderId)
|
||||
.build();
|
||||
CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule(cron);
|
||||
// CronTrigger表达式触发器 继承于Trigger。TriggerBuilder 用于构建触发器实例
|
||||
CronTrigger cronTrigger = TriggerBuilder.newTrigger()
|
||||
.withIdentity(QuartzEnums.WORK_ORDER_OVERTIME_TASK.getName() + workOrderId,
|
||||
QuartzEnums.WORK_ORDER_OVERTIME_TASK.getGroup())
|
||||
.withSchedule(cronScheduleBuilder)
|
||||
.build();
|
||||
scheduler.scheduleJob(jobDetail, cronTrigger);
|
||||
}
|
||||
} catch (SchedulerException | ParseException e) {
|
||||
log.error(e.getMessage());
|
||||
throw new ServiceException("生成工单超时任务失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bo 请求参数
|
||||
* @return com.cpop.core.base.R<com.mybatisflex.core.paginate.Page < com.cpop.oam.business.vo.TaskWorkOrderPageVo>>
|
||||
* @descriptions 查询任务-工单-记录表列表
|
||||
* 工单模块-工单提交-工单记录列表
|
||||
* @author DB
|
||||
* @date 2023/09/18 17:18
|
||||
* @param workOrderId 工单id
|
||||
* @since 2023-11-29 11:25:28
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Override
|
||||
public Page<TaskWorkOrderPageVo> getWorkOrderPage(TaskWorkOrderPageBo bo) {
|
||||
//重新定义列表
|
||||
PageDomain pageDomain = SqlUtils.getInstance().getPageDomain();
|
||||
return this.mapper.paginateAs(pageDomain.getPageNum(), pageDomain.getPageSize(),
|
||||
QueryWrapper.create().select(TASK_WORK_ORDER.ALL_COLUMNS)
|
||||
.select(TASK.TASK_NAME.as(TaskWorkOrderPageVo::getTaskName), TASK.TASK_CONTENT.as(TaskWorkOrderPageVo::getTaskContent), TASK.TASK_STATUS.as(TaskWorkOrderPageVo::getTaskStatus),
|
||||
TASK.ATTACHMENT_URL.as(TaskWorkOrderPageVo::getAttachmentUrl), TASK.RESPONSIBLE_STAFF_ID.as(TaskWorkOrderPageVo::getResponsibleStaffId),
|
||||
TASK.RESPONSIBLE_STAFF_ID.as(TaskWorkOrderPageVo::getResponsibleStaffId))
|
||||
.select(STAFF.NAME.as(TaskWorkOrderPageVo::getRecordStaffId))
|
||||
.select(BRAND.BRAND_NAME.as(TaskWorkOrderPageVo::getBrandName))
|
||||
.select(STORE.STORE_NAME.as(TaskWorkOrderPageVo::getCampusName))
|
||||
.select("rs.name as responsibleStaffName")
|
||||
.from(TASK_WORK_ORDER)
|
||||
//任务表
|
||||
.leftJoin(TASK).on(TASK.ID.eq(TASK_WORK_ORDER.TASK_ID))
|
||||
//小区表
|
||||
.leftJoin(STORE).on(STORE.ID.eq(TASK_WORK_ORDER.CAMPUS_ID))
|
||||
//品牌表
|
||||
.leftJoin(BRAND).on(BRAND.ID.eq(STORE.BRAND_ID))
|
||||
//员工表
|
||||
.leftJoin(STAFF).on(STAFF.ID.eq(TASK_WORK_ORDER.RECORD_STAFF_ID))
|
||||
.leftJoin(STAFF).as("rs").on("rs.id = cp_oam_task.responsible_staff_id")
|
||||
.and(TASK.TASK_NAME.like(bo.getTaskName()))
|
||||
.and(TASK.TASK_STATUS.eq(bo.getTaskStatus()))
|
||||
.and(STORE.STORE_NAME.like(bo.getCampusName())),
|
||||
TaskWorkOrderPageVo.class);
|
||||
public List<TaskWorkOrderRecordListVo> getWorkOrderRecordList(String workOrderId) {
|
||||
// 根据任务id获取列表
|
||||
return SpringUtils.getBean(TaskWorkOrderRecordService.class)
|
||||
.listAs(
|
||||
QueryWrapper.create()
|
||||
.select(TASK_WORK_ORDER_RECORD.ALL_COLUMNS)
|
||||
.select(STAFF.NAME.as(TaskWorkOrderRecordListVo::getRecordStaffName))
|
||||
.select(SYS_USER.AVATAR.as(TaskWorkOrderRecordListVo::getAvatar))
|
||||
.from(TASK_WORK_ORDER_RECORD)
|
||||
// 员工表
|
||||
.leftJoin(STAFF)
|
||||
.on(STAFF.ID.eq(TASK_WORK_ORDER_RECORD.RECORD_STAFF_ID))
|
||||
// 系统用户表
|
||||
.leftJoin(SYS_USER)
|
||||
.on(SYS_USER.ID.eq(STAFF.USER_ID))
|
||||
.where(TASK_WORK_ORDER_RECORD.TASK_WORK_ORDER_ID.eq(workOrderId))
|
||||
.orderBy(TASK_WORK_ORDER_RECORD.CREATE_TIME.asc()),
|
||||
TaskWorkOrderRecordListVo.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param workRecordId 工单记录id
|
||||
* @return com.cpop.core.base.R<java.util.List < com.cpop.oam.business.vo.TaskWorkOrderRecordListVo>>
|
||||
* @descriptions 查询任务-工单记录-列表
|
||||
* 工单模块-工单提交-新增工单记录
|
||||
* @author DB
|
||||
* @date 2023/09/18 17:19
|
||||
*/
|
||||
@Override
|
||||
public List<TaskWorkOrderRecordListVo> getWorkOrderRecordList(String workRecordId) {
|
||||
//根据任务id获取列表
|
||||
return SpringUtils.getBean(TaskWorkOrderRecordService.class).listAs(QueryWrapper.create()
|
||||
.select(TASK_WORK_ORDER_RECORD.ALL_COLUMNS)
|
||||
.select(STAFF.NAME.as(TaskWorkOrderRecordListVo::getRecordStaffName))
|
||||
.select(SYS_USER.AVATAR.as(TaskWorkOrderRecordListVo::getAvatar))
|
||||
.from(TASK_WORK_ORDER_RECORD)
|
||||
//员工表
|
||||
.leftJoin(STAFF).on(STAFF.ID.eq(TASK_WORK_ORDER_RECORD.RECORD_STAFF_ID))
|
||||
//系统用户表
|
||||
.leftJoin(SYS_USER).on(SYS_USER.ID.eq(STAFF.USER_ID))
|
||||
.where(TASK_WORK_ORDER_RECORD.TASK_WORK_ORDER_ID.eq(workRecordId))
|
||||
.orderBy(TASK_WORK_ORDER_RECORD.CREATE_TIME.asc())
|
||||
, TaskWorkOrderRecordListVo.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bo 请求参数
|
||||
* @Description: 任务管理-工单管理-新增工单记录
|
||||
* @return: R<Void>
|
||||
* @Author: DB
|
||||
* @Date: 2023/5/30 16:53
|
||||
**/
|
||||
* @since 2023-11-29 11:33:35
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Override
|
||||
public void insertWorkOrderRecord(TaskWorkOrderRecordBo bo) {
|
||||
//获取工单信息
|
||||
// 获取工单信息
|
||||
TaskWorkOrder taskWorkOrder = this.getById(bo.getTaskWorkOrderId());
|
||||
//获取任务信息
|
||||
// 获取任务信息
|
||||
TaskService taskService = SpringUtils.getBean(TaskService.class);
|
||||
Task task = taskService.getOne(QueryWrapper.create().where(TASK.ID.eq(taskWorkOrder.getTaskId())));
|
||||
//插入工单记录
|
||||
// 插入工单记录
|
||||
TaskWorkOrderRecord taskWorkOrderRecord = BeanUtils.mapToClass(bo, TaskWorkOrderRecord.class);
|
||||
//获取记录员工
|
||||
//当前操作员工是否是主要负责人,不是抛出异常
|
||||
// 获取记录员工;当前操作员工是否是主要负责人,不是抛出异常
|
||||
LoginUser loginUser = SecurityUtils.getInstance().getLoginUser();
|
||||
//读取员工信息
|
||||
// 读取员工信息
|
||||
RedisService redisService = SpringUtils.getBean(RedisService.class);
|
||||
JSONObject cacheObject = redisService.getCacheObject(UserType.OAM_USER.getKey() + loginUser.getUsername());
|
||||
OamStaffLoginInfo loginInfo = cacheObject.getJSONObject("user").toJavaObject(OamStaffLoginInfo.class);
|
||||
taskWorkOrderRecord.setRecordStaffId(loginInfo.getId());
|
||||
//插入记录
|
||||
// 插入记录
|
||||
SpringUtils.getBean(TaskWorkOrderRecordService.class).save(taskWorkOrderRecord);
|
||||
//负责人手机号
|
||||
StaffInfoVo responsibleStaff = SpringUtils.getBean(StaffService.class).getStaffInfo(task.getResponsibleStaffId());
|
||||
// 负责人手机号
|
||||
StaffInfoVo responsibleStaff =
|
||||
SpringUtils.getBean(StaffService.class).getStaffInfo(task.getResponsibleStaffId());
|
||||
List<String> phoneList = new ArrayList<>();
|
||||
phoneList.add(responsibleStaff.getPhoneNumber());
|
||||
phoneList.add(loginInfo.getPhoneNumber());
|
||||
//通知记录
|
||||
// 通知记录
|
||||
try {
|
||||
SpringUtils.getBean(WebHookSendHandler.class).webHookSendText(WebHookKeyConstant.ORDER_INFO_BOT, phoneList, task.getTaskName() + "\n\n工单有新回复:\n" + bo.getRecordText(), false);
|
||||
SpringUtils.getBean(WebHookSendHandler.class)
|
||||
.webHookSendText(WebHookKeyConstant.ORDER_INFO_BOT,
|
||||
phoneList,
|
||||
task.getTaskName() + "\n" + task.getTaskContent() + "\n工单有新回复:\n" + bo.getRecordText(),
|
||||
false);
|
||||
} catch (IOException e) {
|
||||
throw new ServiceException("发送消息通知失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param id 主键
|
||||
* @Description: 工单办结
|
||||
* @return: R<Void>
|
||||
* @Author: DB
|
||||
* @Date: 2023/5/16 17:10
|
||||
**/
|
||||
* 工单模块-工单提交-工单提醒
|
||||
* @author DB
|
||||
* @param workOrderId 工单id
|
||||
* @since 2023-11-29 11:41:46
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Override
|
||||
public void workOrderRemind(String workOrderId) {
|
||||
Task task = SpringUtils.getBean(TaskService.class)
|
||||
.queryChain()
|
||||
.select(TASK.ALL_COLUMNS)
|
||||
.leftJoin(TASK_WORK_ORDER)
|
||||
.on(TASK_WORK_ORDER.TASK_ID.eq(TASK.ID))
|
||||
.where(TASK_WORK_ORDER.ID.eq(workOrderId))
|
||||
.one();
|
||||
// 获取任务状态
|
||||
List<String> phoneList = new ArrayList<>();
|
||||
try {
|
||||
// 负责人手机号
|
||||
StaffInfoVo responsibleStaff =
|
||||
SpringUtils.getBean(StaffService.class).getStaffInfo(task.getResponsibleStaffId());
|
||||
phoneList.add(responsibleStaff.getPhoneNumber());
|
||||
switch (task.getTaskStatus()) {
|
||||
// 待接收与接收超时
|
||||
case 1:
|
||||
case 7:
|
||||
SpringUtils.getBean(WebHookSendHandler.class)
|
||||
.webHookSendText(WebHookKeyConstant.ORDER_INFO_BOT,
|
||||
phoneList,
|
||||
task.getTaskName() + "\n" + task.getTaskContent() + "\n您有一条工单需要接收\n",
|
||||
false);
|
||||
break;
|
||||
default:
|
||||
SpringUtils.getBean(WebHookSendHandler.class)
|
||||
.webHookSendText(WebHookKeyConstant.ORDER_INFO_BOT,
|
||||
phoneList,
|
||||
task.getTaskName() + "\n" + task.getTaskContent() + "\n您有一条工单需要尽快处理\n",
|
||||
false);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 工单模块-工单提交-工单转需求
|
||||
* @author DB
|
||||
* @param workOrderId 工单id
|
||||
* @since 2023-11-29 12:30:21
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Override
|
||||
public void workOrderToDemand(String workOrderId) {
|
||||
// 对比当前用户信息
|
||||
TaskWorkOrder workOrder = this.getById(workOrderId);
|
||||
JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo();
|
||||
if (!StringUtils.equals(workOrder.getRecordStaffId(), loginUserInfo.getString("id"))) {
|
||||
throw new ServiceException("当前操作员工不是当前工单提交人,请联系提交人操作");
|
||||
}
|
||||
// TODO: 工单转需求
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 工单模块-工单提交-工单暂停
|
||||
* @author DB
|
||||
* @param bo 请求参数
|
||||
* @since 2023-11-29 16:00:18
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void concludeWorkOrder(String id) {
|
||||
//获取工单信息
|
||||
TaskWorkOrder taskWorkOrder = this.getById(id);
|
||||
public void pauseWorkOrder(PauseWorkOrderBo bo) {
|
||||
// 获取工单信息
|
||||
TaskWorkOrder workOrder = this.getById(bo.getWorkOrderId());
|
||||
TaskService taskService = SpringUtils.getBean(TaskService.class);
|
||||
Task task = taskService.getById(workOrder.getTaskId());
|
||||
// 设定任务状态暂停
|
||||
task.setTaskStatus(5);
|
||||
taskService.updateById(task);
|
||||
// 获取记录员工
|
||||
// 当前操作员工是否是主要负责人,不是抛出异常
|
||||
JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo();
|
||||
// 负责人手机号
|
||||
StaffInfoVo responsibleStaff =
|
||||
SpringUtils.getBean(StaffService.class).getStaffInfo(task.getResponsibleStaffId());
|
||||
List<String> phoneList = new ArrayList<>();
|
||||
phoneList.add(responsibleStaff.getPhoneNumber());
|
||||
phoneList.add(loginUserInfo.getString("phoneNumber"));
|
||||
// 通知记录
|
||||
try {
|
||||
SpringUtils.getBean(WebHookSendHandler.class)
|
||||
.webHookSendText(WebHookKeyConstant.ORDER_INFO_BOT,
|
||||
phoneList,
|
||||
task.getTaskName() + "\n" + task.getTaskContent() + "\n工单已暂停到:"
|
||||
+ bo.getPauseExpireTime().format(DateTimeFormatter.ofPattern(DateUtils.YYYY_MM_DD_HH_MM_SS)),
|
||||
false);
|
||||
} catch (IOException e) {
|
||||
throw new ServiceException("发送消息通知失败!");
|
||||
}
|
||||
// 如果任务是在进行中没有逾期,重设定时任务
|
||||
if (task.getTaskStatus() == 2) {
|
||||
startOrUpdateWorkOrderOvertimeTask(bo.getWorkOrderId(), true, bo.getPauseExpireTime());
|
||||
}
|
||||
// 更新工单信息
|
||||
this.updateChain()
|
||||
.set(TASK_WORK_ORDER.PAUSE_STAFF_ID, loginUserInfo.getString("id"))
|
||||
.set(TASK_WORK_ORDER.PAUSE_EXPIRE_TIME, bo.getPauseExpireTime())
|
||||
.set(TASK_WORK_ORDER.PAUSE_RECORD_TIME, LocalDateTime.now())
|
||||
.where(TASK_WORK_ORDER.ID.eq(bo.getWorkOrderId()))
|
||||
.update();
|
||||
}
|
||||
|
||||
/**
|
||||
* 工单模块-工单提交-工单办结
|
||||
* @author DB
|
||||
* @param workOrderId 工单id
|
||||
* @since 2023-11-29 15:44:08
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void workOrderFinish(String workOrderId) {
|
||||
// 获取工单信息
|
||||
TaskWorkOrder taskWorkOrder = this.getById(workOrderId);
|
||||
JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo();
|
||||
taskWorkOrder.setFinishStaffId(loginUserInfo.getString("id"));
|
||||
LocalDateTime finishTime = LocalDateTime.now();
|
||||
taskWorkOrder.setFinishTime(finishTime);
|
||||
//设置工单完成
|
||||
// 设置工单完成
|
||||
TaskService taskService = SpringUtils.getBean(TaskService.class);
|
||||
Task task = taskService.getOne(QueryWrapper.create().where(TASK.ID.eq(taskWorkOrder.getTaskId())));
|
||||
//超时设置逾期
|
||||
if (finishTime.compareTo(task.getTaskReceiptTime()) > 0 || Duration.between(finishTime, task.getTaskReceiptTime()).toMillis() >= 7200000) {
|
||||
//工单暂停期间完成
|
||||
// 超时设置逾期
|
||||
if (finishTime.compareTo(task.getTaskReceiptTime()) > 0
|
||||
|| Duration.between(finishTime, task.getTaskReceiptTime()).toMillis() >= 4800000) {
|
||||
// 工单暂停期间完成
|
||||
task.setTaskStatus(3);
|
||||
} else {
|
||||
task.setTaskStatus(6);
|
||||
@ -303,76 +574,48 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
|
||||
task.setTaskItem(3);
|
||||
task.setCompletionDate(Date.valueOf(LocalDate.now()));
|
||||
taskService.updateById(task);
|
||||
// 更新工单
|
||||
this.updateById(taskWorkOrder);
|
||||
//负责人手机号
|
||||
// 负责人手机号
|
||||
StaffService staffService = SpringUtils.getBean(StaffService.class);
|
||||
Set<String> staffIds = new HashSet<>();
|
||||
staffIds.add(task.getResponsibleStaffId());
|
||||
staffIds.add(taskWorkOrder.getRecordStaffId());
|
||||
Map<String, StaffInfoVo> staffMap = staffService.listAs(QueryWrapper.create()
|
||||
Map<String, StaffInfoVo> staffMap =
|
||||
staffService
|
||||
.listAs(
|
||||
QueryWrapper.create()
|
||||
.select(STAFF.ID, STAFF.NAME)
|
||||
.select(SYS_USER.PHONE_NUMBER.as(StaffInfoVo::getPhoneNumber))
|
||||
.from(STAFF)
|
||||
.leftJoin(SYS_USER).on(SYS_USER.ID.eq(STAFF.ID))
|
||||
.where(STAFF.ID.in(staffIds))
|
||||
, StaffInfoVo.class).stream().collect(Collectors.toMap(StaffInfoVo::getId, item -> item));
|
||||
.leftJoin(SYS_USER)
|
||||
.on(SYS_USER.ID.eq(STAFF.ID))
|
||||
.where(STAFF.ID.in(staffIds)),
|
||||
StaffInfoVo.class)
|
||||
.stream()
|
||||
.collect(Collectors.toMap(StaffInfoVo::getId, item -> item));
|
||||
List<String> phoneList = new ArrayList<>();
|
||||
phoneList.add(staffMap.get(task.getResponsibleStaffId()).getPhoneNumber());
|
||||
//记录人手机号
|
||||
// 记录人手机号
|
||||
phoneList.add(staffMap.get(taskWorkOrder.getRecordStaffId()).getPhoneNumber());
|
||||
//通知记录
|
||||
// 通知记录
|
||||
try {
|
||||
SpringUtils.getBean(WebHookSendHandler.class).webHookSendText(WebHookKeyConstant.ORDER_INFO_BOT, phoneList, task.getTaskName() + "\n\n工单办结", false);
|
||||
SpringUtils.getBean(WebHookSendHandler.class)
|
||||
.webHookSendText(WebHookKeyConstant.ORDER_INFO_BOT,
|
||||
phoneList,
|
||||
task.getTaskName() + "\n" + task.getTaskContent() + "\n工单办结",
|
||||
false);
|
||||
} catch (IOException e) {
|
||||
throw new ServiceException("发送消息通知失败!");
|
||||
}
|
||||
// 删除工单完结超时任务
|
||||
try {
|
||||
SpringUtils.getBean(QuartzUtils.class)
|
||||
.deleteJob(QuartzEnums.WORK_ORDER_OVERTIME_TASK.getName() + workOrderId,
|
||||
QuartzEnums.WORK_ORDER_OVERTIME_TASK.getGroup());
|
||||
} catch (SchedulerException e) {
|
||||
throw new ServiceException("删除工单完结超时任务失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bo 请求参数
|
||||
* @Description: 工单暂停
|
||||
* @return: R<Void>
|
||||
* @Author: DB
|
||||
* @Date: 2023/5/16 17:10
|
||||
**/
|
||||
@Override
|
||||
public void pauseWorkOrder(PauseWorkOrderBo bo) {
|
||||
TaskService taskService = SpringUtils.getBean(TaskService.class);
|
||||
Task task = taskService.getById(bo.getTaskId());
|
||||
boolean isUpdate;
|
||||
if (task.getTaskStatus() == 2) {
|
||||
isUpdate = true;
|
||||
} else {
|
||||
//已是逾期状态,需要重新生成定时任务
|
||||
isUpdate = false;
|
||||
//绩点调整回0
|
||||
SpringUtils.getBean(TaskStaffGroupService.class).updateChain().set(TASK_STAFF_GROUP.GRADE_POINT, 0).where(TASK_STAFF_GROUP.TASK_ID.eq(task.getId())).update();
|
||||
}
|
||||
//重新设定任务状态暂停
|
||||
task.setTaskStatus(5);
|
||||
task.setTaskReceiptTime(bo.getTaskReceiptTime());
|
||||
taskService.updateById(task);
|
||||
//获取记录员工
|
||||
//当前操作员工是否是主要负责人,不是抛出异常
|
||||
LoginUser loginUser = SecurityUtils.getInstance().getLoginUser();
|
||||
//读取员工信息
|
||||
RedisService redisService = SpringUtils.getBean(RedisService.class);
|
||||
JSONObject cacheObject = redisService.getCacheObject(UserType.OAM_USER.getKey() + loginUser.getUsername());
|
||||
OamStaffLoginInfo loginInfo = cacheObject.getJSONObject("user").toJavaObject(OamStaffLoginInfo.class);
|
||||
//负责人手机号
|
||||
StaffInfoVo responsibleStaff = SpringUtils.getBean(StaffService.class).getStaffInfo(task.getResponsibleStaffId());
|
||||
List<String> phoneList = new ArrayList<>();
|
||||
phoneList.add(responsibleStaff.getPhoneNumber());
|
||||
phoneList.add(loginInfo.getPhoneNumber());
|
||||
//通知记录
|
||||
Date date = Date.valueOf(bo.getTaskReceiptTime().toLocalDate());
|
||||
try {
|
||||
SpringUtils.getBean(WebHookSendHandler.class).webHookSendText(WebHookKeyConstant.ORDER_INFO_BOT, phoneList,task.getTaskName() + "\n\n工单已暂停到:" + DateUtils.format(date, DateUtils.YYYY_MM_DD_HH_MM_SS), false);
|
||||
} catch (IOException e) {
|
||||
throw new ServiceException("发送消息通知失败!");
|
||||
}
|
||||
TaskWorkOrder taskWorkOrder = this.getOne(QueryWrapper.create().where(TASK_WORK_ORDER.TASK_ID.eq(bo.getTaskId())));
|
||||
//更新定时任务
|
||||
startOrUpdateWorkOrderOvertimeTask(taskWorkOrder.getId(), isUpdate, date);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,33 @@
|
||||
package com.cpop.oam.business.vo;/**
|
||||
package com.cpop.oam.business.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author DB
|
||||
* @createTime 2023/11/28 12:35
|
||||
* @description
|
||||
* @description
|
||||
*/
|
||||
public class StoreListVo {
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "校区/店铺对象", description = "校区/店铺对象")
|
||||
public class StoreListVo implements Serializable {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 校区名
|
||||
*/
|
||||
private String storeName;
|
||||
|
||||
/**
|
||||
* 云校区id
|
||||
*/
|
||||
private String storeCloudId;
|
||||
}
|
||||
|
||||
@ -17,26 +17,7 @@ import java.time.LocalDateTime;
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "TaskWorkOrderPageVo对象", description = "任务-工单-记录")
|
||||
public class TaskWorkOrderPageVo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ApiModelProperty("主键")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
@ApiModelProperty("任务id")
|
||||
private String taskId;
|
||||
|
||||
/**
|
||||
* 任务名
|
||||
*/
|
||||
@ApiModelProperty("任务名")
|
||||
private String taskName;
|
||||
public class TaskWorkOrderPageVo {
|
||||
|
||||
/**
|
||||
* 任务内容
|
||||
@ -45,81 +26,22 @@ public class TaskWorkOrderPageVo implements Serializable {
|
||||
private String taskContent;
|
||||
|
||||
/**
|
||||
* 品牌id
|
||||
* 办结员工id
|
||||
*/
|
||||
@ApiModelProperty("品牌id")
|
||||
private String brandId;
|
||||
@ApiModelProperty("办结员工id")
|
||||
private String finishStaffId;
|
||||
|
||||
/**
|
||||
* 品牌
|
||||
* 办结员工
|
||||
*/
|
||||
@ApiModelProperty("品牌")
|
||||
private String brandName;
|
||||
|
||||
/**
|
||||
* 校区id
|
||||
*/
|
||||
@ApiModelProperty("校区id")
|
||||
private String campusId;
|
||||
|
||||
/**
|
||||
* 校区
|
||||
*/
|
||||
@ApiModelProperty("校区")
|
||||
private String campusName;
|
||||
|
||||
/**
|
||||
* 附件地址
|
||||
*/
|
||||
@ApiModelProperty("附件地址")
|
||||
private String attachmentUrl;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty("备注")
|
||||
private String remarks;
|
||||
|
||||
/**
|
||||
* 问题手机号
|
||||
*/
|
||||
@ApiModelProperty("问题手机号")
|
||||
private String phoneNumber;
|
||||
|
||||
/**
|
||||
* 记录员工id
|
||||
*/
|
||||
@ApiModelProperty("记录员工id")
|
||||
private String recordStaffId;
|
||||
|
||||
/**
|
||||
* 记录员工
|
||||
*/
|
||||
@ApiModelProperty("记录员工")
|
||||
private String recordStaffName;
|
||||
|
||||
/**
|
||||
* 接收员工id
|
||||
*/
|
||||
@ApiModelProperty("接收员工id")
|
||||
private String responsibleStaffId;
|
||||
|
||||
/**
|
||||
* 接收员工
|
||||
*/
|
||||
@ApiModelProperty("接收员工")
|
||||
private String responsibleStaffName;
|
||||
@ApiModelProperty("办结员工")
|
||||
private String finishStaffName;
|
||||
|
||||
/**
|
||||
* 办结时间
|
||||
*/
|
||||
@ApiModelProperty("办结时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime finishTime;
|
||||
|
||||
/**
|
||||
* 任务状态
|
||||
*/
|
||||
@ApiModelProperty("任务状态")
|
||||
private Integer taskStatus;
|
||||
}
|
||||
|
||||
@ -1,7 +1,228 @@
|
||||
package com.cpop.oam.business.vo;/**
|
||||
package com.cpop.oam.business.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author DB
|
||||
* @createTime 2023/11/28 15:08
|
||||
* @description
|
||||
* @description
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "接收/处理/暂停中页面返回对象", description = "接收/处理/暂停中对象")
|
||||
public class TaskWorkOrderReceiveDealPauseVo {
|
||||
|
||||
/**
|
||||
* 待接收列表
|
||||
*/
|
||||
@ApiModelProperty(value = "待接收列表")
|
||||
private List<Receive> receiveList;
|
||||
|
||||
/**
|
||||
* 处理中列表
|
||||
*/
|
||||
@ApiModelProperty(value = "处理中列表")
|
||||
private List<Deal> dealList;
|
||||
|
||||
/**
|
||||
* 暂停中列表
|
||||
*/
|
||||
@ApiModelProperty(value = "暂停中列表")
|
||||
private List<Pause> pauseList;
|
||||
|
||||
/**
|
||||
* 接收
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("待接收")
|
||||
public static class Receive {
|
||||
|
||||
/**
|
||||
* 工单id
|
||||
*/
|
||||
@ApiModelProperty(value = "工单id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 机构/品牌
|
||||
*/
|
||||
@ApiModelProperty(value = "机构/品牌")
|
||||
private String brandName;
|
||||
|
||||
/**
|
||||
* 校区/店铺
|
||||
*/
|
||||
@ApiModelProperty(value = "校区/店铺")
|
||||
private String storeName;
|
||||
|
||||
/**
|
||||
* 问题描述
|
||||
*/
|
||||
@ApiModelProperty(value = "问题描述")
|
||||
private String taskContent;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@ApiModelProperty(value = "手机号")
|
||||
private String phoneNumber;
|
||||
|
||||
/**
|
||||
* 提交人
|
||||
*/
|
||||
@ApiModelProperty(value = "提交人")
|
||||
private String recordStaffName;
|
||||
|
||||
/**
|
||||
* 提交时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@ApiModelProperty(value = "提交时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 接收
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("处理中")
|
||||
public static class Deal {
|
||||
|
||||
/**
|
||||
* 工单id
|
||||
*/
|
||||
@ApiModelProperty(value = "工单id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 机构/品牌
|
||||
*/
|
||||
@ApiModelProperty(value = "机构/品牌")
|
||||
private String brandName;
|
||||
|
||||
/**
|
||||
* 校区/店铺
|
||||
*/
|
||||
@ApiModelProperty(value = "校区/店铺")
|
||||
private String storeName;
|
||||
|
||||
/**
|
||||
* 问题描述
|
||||
*/
|
||||
@ApiModelProperty(value = "问题描述")
|
||||
private String taskContent;
|
||||
|
||||
/**
|
||||
* 提交人
|
||||
*/
|
||||
@ApiModelProperty(value = "提交人")
|
||||
private String recordStaffName;
|
||||
|
||||
/**
|
||||
* 提交时间
|
||||
*/
|
||||
@ApiModelProperty(value = "提交时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 接收人
|
||||
*/
|
||||
@ApiModelProperty(value = "接收人")
|
||||
private String responsibleStaffName;
|
||||
|
||||
/**
|
||||
* 任务接收时间
|
||||
*/
|
||||
@ApiModelProperty(value = "任务接收时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime taskReceiptTime;
|
||||
|
||||
/**
|
||||
* 任务接收用时/min
|
||||
*/
|
||||
@ApiModelProperty(value = "任务接收用时/min")
|
||||
private Integer receivingTime;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 暂停中
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("暂停中")
|
||||
public static class Pause {
|
||||
|
||||
/**
|
||||
* 工单id
|
||||
*/
|
||||
@ApiModelProperty(value = "工单id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 机构/品牌
|
||||
*/
|
||||
@ApiModelProperty(value = "机构/品牌")
|
||||
private String brandName;
|
||||
|
||||
/**
|
||||
* 校区/店铺
|
||||
*/
|
||||
@ApiModelProperty(value = "校区/店铺")
|
||||
private String storeName;
|
||||
|
||||
/**
|
||||
* 问题描述
|
||||
*/
|
||||
@ApiModelProperty(value = "问题描述")
|
||||
private String taskContent;
|
||||
|
||||
/**
|
||||
* 提交人
|
||||
*/
|
||||
@ApiModelProperty(value = "提交人")
|
||||
private String recordStaffName;
|
||||
|
||||
/**
|
||||
* 提交时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@ApiModelProperty(value = "提交时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 接收人
|
||||
*/
|
||||
@ApiModelProperty(value = "接收人")
|
||||
private String responsibleStaffName;
|
||||
|
||||
/**
|
||||
* 暂停员工
|
||||
*/
|
||||
@ApiModelProperty(value = "暂停员工")
|
||||
private String pauseStaffName;
|
||||
|
||||
/**
|
||||
* 暂停记录时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@ApiModelProperty(value = "暂停记录时间")
|
||||
private LocalDateTime pauseRecordTime;
|
||||
|
||||
/**
|
||||
* 暂停到期时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@ApiModelProperty(value = "暂停到期时间")
|
||||
private LocalDateTime pauseExpireTime;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,20 +6,18 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
/**
|
||||
* @author: DB
|
||||
* @Date: 2023/07/11/14:25
|
||||
* @Description:
|
||||
* 任务-工单记录-记录
|
||||
* @author DB
|
||||
* @since 2023-11-29 11:30:57
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "TaskWorkOrderRecordListVo对象", description = "任务-工单记录-记录")
|
||||
public class TaskWorkOrderRecordListVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
public class TaskWorkOrderRecordListVo {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
@ -67,6 +65,6 @@ public class TaskWorkOrderRecordListVo implements Serializable {
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty("创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Timestamp createTime;
|
||||
}
|
||||
|
||||
@ -0,0 +1,56 @@
|
||||
package com.cpop.oam.business.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mybatisflex.annotation.RelationOneToOne;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 工单值班返回对象
|
||||
* @author DB
|
||||
* @since 2023-11-29 13:58:05
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "工单值班返回对象", description = "工单值班返回对象")
|
||||
public class WorkOrderDutyVo {
|
||||
|
||||
/**
|
||||
* 服务员工id
|
||||
*/
|
||||
@ApiModelProperty("服务员工id")
|
||||
private String serviceStaffId;
|
||||
|
||||
/**
|
||||
* 服务员工名称
|
||||
*/
|
||||
@RelationOneToOne(selfField = "serviceStaffId", targetField = "id", targetTable = "cp_oam_staff", valueField = "name")
|
||||
@ApiModelProperty("服务员工名称")
|
||||
private String serviceStaffName;
|
||||
|
||||
/**
|
||||
* 技术员工id
|
||||
*/
|
||||
@ApiModelProperty("技术员工id")
|
||||
private String technologyStaffId;
|
||||
|
||||
/**
|
||||
* 技术员工名称
|
||||
*/
|
||||
@RelationOneToOne(selfField = "technologyStaffId", targetField = "id", targetTable = "cp_oam_staff", valueField = "name")
|
||||
@ApiModelProperty("技术员工名称")
|
||||
private String technologyStaffName;
|
||||
|
||||
/**
|
||||
* 值班日期
|
||||
*/
|
||||
@ApiModelProperty("值班日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private LocalDate dutyDate;
|
||||
|
||||
}
|
||||
@ -10,7 +10,11 @@ public enum QuartzEnums {
|
||||
/**
|
||||
* 工单超时定时任务
|
||||
*/
|
||||
WORK_ORDER_OVERTIME_TASK("WorkOrderOvertimeTask:", "WorkOrder");
|
||||
WORK_ORDER_OVERTIME_TASK("WorkOrderOvertimeTask:", "WorkOrder"),
|
||||
/**
|
||||
* 工单接收超时定时任务
|
||||
*/
|
||||
WORK_ORDER_ACCEPT_OVERTIME_TASK("WorkOrderAcceptOvertimeTask:", "WorkOrder");
|
||||
|
||||
QuartzEnums(String name, String group) {
|
||||
this.name = name;
|
||||
|
||||
@ -0,0 +1,52 @@
|
||||
package com.cpop.oam.framework.tasks;
|
||||
|
||||
import com.cpop.core.utils.SpringUtils;
|
||||
import com.cpop.oam.business.entity.Task;
|
||||
import com.cpop.oam.business.entity.TaskWorkOrder;
|
||||
import com.cpop.oam.business.service.TaskStaffGroupService;
|
||||
import com.cpop.oam.business.service.TaskWorkOrderService;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobDataMap;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
|
||||
import static com.cpop.oam.business.entity.table.TaskStaffGroupTableDef.TASK_STAFF_GROUP;
|
||||
import static com.cpop.oam.business.entity.table.TaskTableDef.TASK;
|
||||
|
||||
import com.cpop.oam.business.service.TaskService;
|
||||
|
||||
/**
|
||||
* 工单接收超时定时任务
|
||||
*
|
||||
* @author DB
|
||||
* @since 2023-11-29 10:13:22
|
||||
* @version 1.0.0
|
||||
*/
|
||||
public class WorkOrderAcceptOverTimeTask implements Job {
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
// 获取工单id
|
||||
JobDataMap jobDataMap = jobExecutionContext.getJobDetail().getJobDataMap();
|
||||
String workOrderId = jobDataMap.getString("WorkOrderId");
|
||||
TaskWorkOrderService taskWorkOrderService = SpringUtils.getBean(TaskWorkOrderService.class);
|
||||
TaskWorkOrder workOrder = taskWorkOrderService.getById(workOrderId);
|
||||
// 获取任务
|
||||
TaskService taskService = SpringUtils.getBean(TaskService.class);
|
||||
Task task = taskService.getById(workOrder.getTaskId());
|
||||
if (task != null) {
|
||||
// 工单超时为接收,扣除5绩点
|
||||
TaskStaffGroupService taskStaffGroupService = SpringUtils.getBean(TaskStaffGroupService.class);
|
||||
taskStaffGroupService.updateChain()
|
||||
.set(TASK_STAFF_GROUP.GRADE_POINT, -5)
|
||||
.where(TASK_STAFF_GROUP.TASK_ID.eq(task.getId())
|
||||
.and(TASK_STAFF_GROUP.STAFF_ID.eq(task.getResponsibleStaffId())));
|
||||
// 更新任务为接收超时
|
||||
taskService.updateChain()
|
||||
.set(TASK.TASK_STATUS, 7)
|
||||
.set(TASK.REMARK, "工单接收超时扣除5绩点 ")
|
||||
.where(TASK.ID.eq(task.getId()))
|
||||
.update();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -15,7 +15,7 @@ import static com.cpop.oam.business.entity.table.TaskStaffGroupTableDef.TASK_STA
|
||||
import static com.cpop.oam.business.entity.table.TaskTableDef.TASK;
|
||||
|
||||
/**
|
||||
* @author: DB
|
||||
* @author DB
|
||||
* @Date: 2023/07/12/17:11
|
||||
* @Description: 工单任务超时检查
|
||||
*/
|
||||
@ -23,19 +23,24 @@ public class WorkOrderOvertimeTask implements Job {
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) {
|
||||
//获取工单id
|
||||
// 获取工单id
|
||||
JobDataMap jobDataMap = jobExecutionContext.getJobDetail().getJobDataMap();
|
||||
String workOrderId = jobDataMap.getString("WorkOrderId");
|
||||
TaskWorkOrderService taskWorkOrderService = SpringUtils.getBean(TaskWorkOrderService.class);
|
||||
TaskWorkOrder taskWorkOrder = taskWorkOrderService.getById(workOrderId);
|
||||
//逾期
|
||||
if (null == taskWorkOrder.getFinishTime() || (taskWorkOrder.getFinishTime().compareTo(LocalDateTime.now()) > 0)) {
|
||||
//修改任务逾期
|
||||
TaskService taskService = SpringUtils.getBean(TaskService.class);
|
||||
taskService.updateChain().set(TASK.TASK_STATUS, 4).where(TASK.ID.eq(taskWorkOrder.getTaskId())).update();
|
||||
//扣除5点绩点
|
||||
TaskStaffGroupService taskStaffGroupService = SpringUtils.getBean(TaskStaffGroupService.class);
|
||||
taskStaffGroupService.updateChain().set(TASK_STAFF_GROUP.GRADE_POINT, -5).where(TASK_STAFF_GROUP.TASK_ID.eq(taskWorkOrder.getTaskId()));
|
||||
}
|
||||
// 修改任务逾期
|
||||
TaskService taskService = SpringUtils.getBean(TaskService.class);
|
||||
taskService.updateChain().set(TASK.TASK_STATUS, 4).where(TASK.ID.eq(taskWorkOrder.getTaskId())).update();
|
||||
// 扣除5点绩点
|
||||
TaskStaffGroupService taskStaffGroupService = SpringUtils.getBean(TaskStaffGroupService.class);
|
||||
taskStaffGroupService.updateChain()
|
||||
.setRaw(TASK_STAFF_GROUP.GRADE_POINT, "grade_point - 5")
|
||||
.where(TASK_STAFF_GROUP.TASK_ID.eq(workOrderId));
|
||||
// 更新任务为逾期
|
||||
taskService.updateChain()
|
||||
.set(TASK.TASK_STATUS, 4)
|
||||
.set(TASK.REMARK, "remark + '工单完结超时扣除5绩点'")
|
||||
.where(TASK.ID.eq(taskWorkOrder.getTaskId()))
|
||||
.update();
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,10 +36,4 @@ public class BrandBo {
|
||||
@ApiModelProperty(value = "微信商户号")
|
||||
private String wxMchId;
|
||||
|
||||
/**
|
||||
* 背景图
|
||||
*/
|
||||
@StringArrayConvert
|
||||
@ApiModelProperty("背景图")
|
||||
private String backgroundUrl;
|
||||
}
|
||||
|
||||
@ -50,11 +50,6 @@ public class Brand extends BaseEntity implements Serializable {
|
||||
*/
|
||||
private String sourceType;
|
||||
|
||||
/**
|
||||
* 背景图
|
||||
*/
|
||||
private String backgroundUrl;
|
||||
|
||||
/**
|
||||
* 是否开通分账
|
||||
*/
|
||||
|
||||
@ -45,11 +45,6 @@ public class Store extends BaseEntity implements Serializable {
|
||||
*/
|
||||
private String brandId;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 来源
|
||||
*/
|
||||
|
||||
@ -73,7 +73,6 @@ public class BrandServiceImpl extends ServiceImpl<BrandMapper, Brand> implements
|
||||
Brand sysBrand = new Brand();
|
||||
sysBrand.setBrandName(brand.getString("name"))
|
||||
.setWxMchId(brand.getString("wxMchId"))
|
||||
.setBackgroundUrl(brand.getString("brandBg"))
|
||||
.setSourceType(SourceType.JAMBOX.toString());
|
||||
this.save(sysBrand);
|
||||
//果酱拓展表信息
|
||||
@ -152,7 +151,7 @@ public class BrandServiceImpl extends ServiceImpl<BrandMapper, Brand> implements
|
||||
PageDomain pageDomain = SqlUtils.getInstance().getPageDomain();
|
||||
return this.mapper.paginateAs(pageDomain.getPageNum(), pageDomain.getPageSize(),
|
||||
QueryWrapper.create()
|
||||
.select(BRAND.ID, BRAND.BRAND_NAME, BRAND.WX_MCH_ID, BRAND.CREATE_TIME, BRAND.BACKGROUND_URL, BRAND.IS_OPEN_SHARING)
|
||||
.select(BRAND.ID, BRAND.BRAND_NAME, BRAND.WX_MCH_ID, BRAND.CREATE_TIME, BRAND.IS_OPEN_SHARING)
|
||||
.and(BRAND.BRAND_NAME.like(brandName)),
|
||||
BrandPageVo.class);
|
||||
}
|
||||
|
||||
@ -40,31 +40,6 @@ public class BrandPageVo implements Serializable {
|
||||
@ApiModelProperty("微信商户号")
|
||||
private String wxMchId;
|
||||
|
||||
/**
|
||||
* 微信appid
|
||||
*/
|
||||
@ApiModelProperty("微信appid")
|
||||
private String wxAppId;
|
||||
|
||||
/**
|
||||
* 微信支付密钥
|
||||
*/
|
||||
@ApiModelProperty("微信支付密钥")
|
||||
private String wxMchKey;
|
||||
|
||||
/**
|
||||
* 微信支付keypath
|
||||
*/
|
||||
@ApiModelProperty("微信支付keyPath")
|
||||
private String wxKeyPath;
|
||||
|
||||
/**
|
||||
* 背景图
|
||||
*/
|
||||
@StringArrayConvert
|
||||
@ApiModelProperty("背景图")
|
||||
private String backgroundUrl;
|
||||
|
||||
/**
|
||||
* 是否开通分账
|
||||
*/
|
||||
|
||||
@ -1,10 +1,13 @@
|
||||
package com.cpop.system.business.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.cpop.core.base.enums.SourceType;
|
||||
|
||||
/*
|
||||
@ -49,16 +52,17 @@ public class StorePageVo implements Serializable {
|
||||
@ApiModelProperty("店铺/校区名")
|
||||
private String storeName;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
@ApiModelProperty("地址")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 数据来源
|
||||
*/
|
||||
@ApiModelProperty("数据来源")
|
||||
private SourceType sourceType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user