工单统计;调整小程序用户注册登录
This commit is contained in:
parent
73c31ce07a
commit
00be6f52ab
@ -99,23 +99,21 @@ public class MiniLoginStrategy implements LoginStrategy {
|
|||||||
}
|
}
|
||||||
//构建用户信息
|
//构建用户信息
|
||||||
Row row = DbChain.table("cp_mini_user")
|
Row row = DbChain.table("cp_mini_user")
|
||||||
.select("cmu.id","cmu.open_id","cmu.app_id","cmu.user_id","cmu.brand_id","cmu.nick_name","cmu.avatar","cmu.source_type")
|
.select("cmu.id","cmu.open_id","cmu.app_id","cmu.brand_id","cmu.nick_name","cmu.avatar","cmu.source_type")
|
||||||
.from("cp_mini_user").as("cmu")
|
.from("cp_mini_user").as("cmu")
|
||||||
.leftJoin("cp_j_brand_extend").as("cjbe").on("cjbe.brand_id = cmu.brand_id")
|
.leftJoin("cp_j_brand_extend").as("cjbe").on("cjbe.brand_id = cmu.brand_id")
|
||||||
.where("cmu.user_id = ?", loginInfo.getUserId())
|
.where("cmu.app_id = ?",credentials.get("appId"))
|
||||||
.and("cjbe.brand_cloud_id = ?",credentials.get("brandId"))
|
.and("cjbe.brand_cloud_id = ?",credentials.get("brandId"))
|
||||||
.and("cmu.app_id = ?",credentials.get("appId"))
|
|
||||||
.and("cmu.open_id = ?",credentials.get("openId"))
|
.and("cmu.open_id = ?",credentials.get("openId"))
|
||||||
//用户来源
|
//用户来源
|
||||||
.and("cmu.source_type = ?",sourceType.toString())
|
.and("cmu.source_type = ?",sourceType.toString())
|
||||||
.and("cmu.is_delete = 0")
|
.and("cmu.is_delete = 0")
|
||||||
.one();
|
.one();
|
||||||
|
//保存小程序用户信息
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
if (row == null) {
|
if (row == null) {
|
||||||
//保存小程序用户信息
|
|
||||||
LocalDateTime now = LocalDateTime.now();
|
|
||||||
Row miniUser = Row.ofKey(RowKey.SNOW_FLAKE_ID);
|
Row miniUser = Row.ofKey(RowKey.SNOW_FLAKE_ID);
|
||||||
miniUser.set("user_id", loginInfo.getUserId())
|
miniUser.set("open_id", credentials.get("openId"))
|
||||||
.set("open_id", credentials.get("openId"))
|
|
||||||
.set("app_id", credentials.get("appId"))
|
.set("app_id", credentials.get("appId"))
|
||||||
.set("brand_id", brand.getString("id"))
|
.set("brand_id", brand.getString("id"))
|
||||||
.set("nick_name", credentials.get("nickName"))
|
.set("nick_name", credentials.get("nickName"))
|
||||||
@ -126,10 +124,18 @@ public class MiniLoginStrategy implements LoginStrategy {
|
|||||||
.set("create_user_id", 1)
|
.set("create_user_id", 1)
|
||||||
.set("update_user_id", 1);
|
.set("update_user_id", 1);
|
||||||
int save = Db.insert("cp_mini_user", miniUser);
|
int save = Db.insert("cp_mini_user", miniUser);
|
||||||
|
//插入中间表
|
||||||
|
Row miniMidUser = new Row();
|
||||||
|
miniMidUser.set("user_id", loginInfo.getUserId())
|
||||||
|
.set("mini_id",miniUser.getString("id"))
|
||||||
|
.set("create_time", now)
|
||||||
|
.set("update_time", now)
|
||||||
|
.set("create_user_id", 1)
|
||||||
|
.set("update_user_id", 1);
|
||||||
|
Db.insert("cp_mini_user_mid_sys", miniMidUser);
|
||||||
if (save > 0) {
|
if (save > 0) {
|
||||||
loginInfo.setOpenId((String) credentials.get("openId"))
|
loginInfo.setOpenId((String) credentials.get("openId"))
|
||||||
.setAppId((String) credentials.get("appId"))
|
.setAppId((String) credentials.get("appId"))
|
||||||
.setUserId(loginInfo.getUserId())
|
|
||||||
.setBrandId(brand.getString("id"))
|
.setBrandId(brand.getString("id"))
|
||||||
.setNickName((String) credentials.get("nickName"))
|
.setNickName((String) credentials.get("nickName"))
|
||||||
.setAvatar((String) credentials.get("avatar"))
|
.setAvatar((String) credentials.get("avatar"))
|
||||||
@ -137,9 +143,24 @@ public class MiniLoginStrategy implements LoginStrategy {
|
|||||||
.setSourceType(sourceType);
|
.setSourceType(sourceType);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
//查询中间表
|
||||||
|
long count = DbChain.table("cp_mini_user_mid_sys")
|
||||||
|
.where("mini_id = ?", row.getString("id"))
|
||||||
|
.and("user_id = ?", loginInfo.getUserId())
|
||||||
|
.count();
|
||||||
|
if (count == 0) {
|
||||||
|
//插入中间表
|
||||||
|
Row miniMidUser = new Row();
|
||||||
|
miniMidUser.set("user_id", loginInfo.getUserId())
|
||||||
|
.set("mini_id", row.getString("id"))
|
||||||
|
.set("create_time", now)
|
||||||
|
.set("update_time", now)
|
||||||
|
.set("create_user_id", 1)
|
||||||
|
.set("update_user_id", 1);
|
||||||
|
Db.insert("cp_mini_user_mid_sys", miniMidUser);
|
||||||
|
}
|
||||||
loginInfo.setOpenId(row.getString("openId"))
|
loginInfo.setOpenId(row.getString("openId"))
|
||||||
.setAppId(row.getString("appId"))
|
.setAppId(row.getString("appId"))
|
||||||
.setUserId(row.getString("userId"))
|
|
||||||
.setBrandId(row.getString("brandId"))
|
.setBrandId(row.getString("brandId"))
|
||||||
.setNickName(row.getString("nickName"))
|
.setNickName(row.getString("nickName"))
|
||||||
.setAvatar(row.getString("avatar"))
|
.setAvatar(row.getString("avatar"))
|
||||||
|
|||||||
5
Cpop-Mall/Cpop-Mall-Web/Mall-DockerD-Dockerfile
Normal file
5
Cpop-Mall/Cpop-Mall-Web/Mall-DockerD-Dockerfile
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
FROM openjdk:8-jdk
|
||||||
|
LABEL authors="Lost"
|
||||||
|
RUN mkdir -p /root/Cpop-Mall/
|
||||||
|
ADD ./target/Cpop-Mall-Web.jar /root/Cpop-Mall/Cpop-Mall-Web.jar
|
||||||
|
ENTRYPOINT ["sh", "-c", "java -jar /root/Cpop-Mall/Cpop-Mall-Web.jar --spring.profiles.active=dockerD,core,pay"]
|
||||||
@ -0,0 +1,123 @@
|
|||||||
|
# 项目相关配置
|
||||||
|
cpop:
|
||||||
|
# 文件路径 示例( Windows配置W:/WorkSpace/java/uploadPath,Linux配置 /home/baseFramework/uploadPath)
|
||||||
|
profile: E:/Cpop/uploadPath
|
||||||
|
jwt:
|
||||||
|
#白名单
|
||||||
|
whiteList: /login,/miniLogin,/wxPay/callback/notify/**,/mini/brand/jamboxBrandIsInMall/*,/doc.html,/webjars/**,/favicon.ico,/v2/api-docs/**,/swagger-resources
|
||||||
|
gateway:
|
||||||
|
rsa-keypair:
|
||||||
|
# 公钥文件
|
||||||
|
publicKeyFile: /root/Cpop-Oam/keyPair/publicKey
|
||||||
|
# 公钥文件
|
||||||
|
privateKeyFile: /root/Cpop-Oam/keyPair/privateKey
|
||||||
|
|
||||||
|
# DataSource Config
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: Cpop-Mall-Dev
|
||||||
|
#redis配置
|
||||||
|
redis:
|
||||||
|
#地址
|
||||||
|
host: gz-crs-lv77ii2t.sql.tencentcdb.com
|
||||||
|
#端口
|
||||||
|
port: 27714
|
||||||
|
#数据库
|
||||||
|
database: 3
|
||||||
|
#密码
|
||||||
|
password: Cpop2022@
|
||||||
|
#连接超时
|
||||||
|
timeout: 5000
|
||||||
|
jedis:
|
||||||
|
pool:
|
||||||
|
#
|
||||||
|
min-idle: 0
|
||||||
|
#
|
||||||
|
max-idle: 8
|
||||||
|
#
|
||||||
|
max-active: 8
|
||||||
|
#
|
||||||
|
max-wait: -1ms
|
||||||
|
client-type: jedis
|
||||||
|
data:
|
||||||
|
mongodb:
|
||||||
|
host: localhost
|
||||||
|
port: 27017
|
||||||
|
database: cpop-union
|
||||||
|
|
||||||
|
server:
|
||||||
|
port: 9430
|
||||||
|
servlet:
|
||||||
|
context-path: /Cpop-Mall
|
||||||
|
|
||||||
|
#Mybatis-Flex
|
||||||
|
mybatis-flex:
|
||||||
|
configuration:
|
||||||
|
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||||
|
datasource:
|
||||||
|
mall:
|
||||||
|
url: jdbc:mysql://192.168.3.61:3306/cpop_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
|
username: root
|
||||||
|
password: Admin@123
|
||||||
|
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
|
||||||
|
|
||||||
|
# springdoc-openapi项目配置
|
||||||
|
knife4j:
|
||||||
|
enable: true
|
||||||
|
openapi:
|
||||||
|
title: Cpop-Mall开发API
|
||||||
|
description: Cpop-Mall开发API
|
||||||
|
email:
|
||||||
|
concat: DB
|
||||||
|
url: https://api.jamboxsys.com
|
||||||
|
version: 1.0.0
|
||||||
|
license: Apache 2.0
|
||||||
|
license-url: https://stackoverflow.com/
|
||||||
|
terms-of-service-url: https://api.jamboxsys.com
|
||||||
|
group:
|
||||||
|
#商城
|
||||||
|
Mall-Backstage:
|
||||||
|
#后台
|
||||||
|
group-name: Mall-Backstage
|
||||||
|
api-rule: package
|
||||||
|
api-rule-resources:
|
||||||
|
- com.cpop.mall.business.controller.backstage
|
||||||
|
Mall-Mini:
|
||||||
|
#小程序
|
||||||
|
group-name: Mall-Mini
|
||||||
|
api-rule: package
|
||||||
|
api-rule-resources:
|
||||||
|
- com.cpop.mall.business.controller.mini
|
||||||
|
Mall-Test:
|
||||||
|
#测试
|
||||||
|
group-name: Mall-Test
|
||||||
|
api-rule: package
|
||||||
|
api-rule-resources:
|
||||||
|
- com.cpop.mall.business.controller.test
|
||||||
|
#系统
|
||||||
|
System:
|
||||||
|
group-name: System
|
||||||
|
api-rule: package
|
||||||
|
api-rule-resources:
|
||||||
|
- com.cpop.system
|
||||||
|
|
||||||
|
#商城相关配置文件
|
||||||
|
mall:
|
||||||
|
cloudBaseUrl: https://test.cpopsz.com/test/ass/
|
||||||
|
|
||||||
|
#微信支付
|
||||||
|
wx:
|
||||||
|
pay:
|
||||||
|
# p12证书的位置,可以指定绝对路径,也可以指定类路径(以classpath:开头)
|
||||||
|
keyPath: /root/Cpop-Oam/keyPair/wxPay_cert.p12
|
||||||
|
# 私钥证书
|
||||||
|
privateKeyPath: /root/Cpop-Oam/keyPair/wxPay_key.pem
|
||||||
|
# 私钥文件
|
||||||
|
privateCertPath: /root/Cpop-Oam/keyPair/wxPay_cert.pem
|
||||||
|
#支付通知地址
|
||||||
|
notifyUrl: https://frp-oak.top:11899/Cpop-Mall/callback/wxPay/notify/order
|
||||||
|
#退款通知地址
|
||||||
|
notifyRefund: https://frp-oak.top:11899/Cpop-Mall/callback/wxPay/notify/refund
|
||||||
@ -46,9 +46,9 @@ public class MiniUser extends BaseEntity implements Serializable {
|
|||||||
private String appId;
|
private String appId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户id
|
* 品牌id
|
||||||
*/
|
*/
|
||||||
private String userId;
|
private String brandId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序昵称
|
* 小程序昵称
|
||||||
|
|||||||
@ -39,8 +39,4 @@ public class MiniUserMidSys extends BaseEntity implements Serializable {
|
|||||||
@Id
|
@Id
|
||||||
private String userId;
|
private String userId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,6 +11,11 @@ import com.cpop.jambox.business.service.BrandExtendService;
|
|||||||
import com.cpop.jambox.business.service.CardTemplateExtendService;
|
import com.cpop.jambox.business.service.CardTemplateExtendService;
|
||||||
import com.cpop.jambox.business.service.CardTemplateService;
|
import com.cpop.jambox.business.service.CardTemplateService;
|
||||||
import com.cpop.jambox.business.service.StoreExtendService;
|
import com.cpop.jambox.business.service.StoreExtendService;
|
||||||
|
import com.cpop.oam.business.entity.Task;
|
||||||
|
import com.cpop.oam.business.entity.TaskWorkOrder;
|
||||||
|
import com.cpop.oam.business.mapper.TaskWorkOrderMapper;
|
||||||
|
import com.cpop.oam.business.service.TaskService;
|
||||||
|
import com.cpop.oam.business.service.TaskWorkOrderService;
|
||||||
import com.cpop.system.business.entity.Store;
|
import com.cpop.system.business.entity.Store;
|
||||||
import com.cpop.system.business.entity.StoreSign;
|
import com.cpop.system.business.entity.StoreSign;
|
||||||
import com.cpop.system.business.entity.WxPayScore;
|
import com.cpop.system.business.entity.WxPayScore;
|
||||||
@ -29,6 +34,7 @@ import org.junit.jupiter.api.Test;
|
|||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.test.context.ActiveProfiles;
|
import org.springframework.test.context.ActiveProfiles;
|
||||||
|
|
||||||
|
import java.time.Duration;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
@ -40,6 +46,8 @@ import java.util.Map;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static com.cpop.jambox.business.entity.table.StoreExtendTableDef.STORE_EXTEND;
|
import static com.cpop.jambox.business.entity.table.StoreExtendTableDef.STORE_EXTEND;
|
||||||
|
import static com.cpop.oam.business.entity.table.TaskTableDef.TASK;
|
||||||
|
import static com.cpop.oam.business.entity.table.TaskWorkOrderTableDef.TASK_WORK_ORDER;
|
||||||
import static com.cpop.system.business.entity.table.StoreSignTableDef.STORE_SIGN;
|
import static com.cpop.system.business.entity.table.StoreSignTableDef.STORE_SIGN;
|
||||||
import static com.cpop.system.business.entity.table.StoreTableDef.STORE;
|
import static com.cpop.system.business.entity.table.StoreTableDef.STORE;
|
||||||
import static com.mybatisflex.core.query.QueryMethods.count;
|
import static com.mybatisflex.core.query.QueryMethods.count;
|
||||||
@ -318,4 +326,29 @@ public class CpopDataSyncTests {
|
|||||||
storeService.removeByIds(collect);
|
storeService.removeByIds(collect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void syncTaskOrderReceivingTime(){
|
||||||
|
List<Task> list = SpringUtils.getBean(TaskService.class).queryChain()
|
||||||
|
.leftJoin(TASK_WORK_ORDER).on(TASK_WORK_ORDER.TASK_ID.eq(TASK.ID))
|
||||||
|
.where(TASK.TASK_TYPE.eq(2))
|
||||||
|
.where(TASK_WORK_ORDER.CREATE_TIME.ge(LocalDateTime.of(2024, 1, 11, 0, 0, 0)))
|
||||||
|
.list();
|
||||||
|
List<TaskWorkOrder> taskWorkOrders = new ArrayList<>();
|
||||||
|
list.forEach(item->{
|
||||||
|
if (item.getTaskReceiptTime() != null){
|
||||||
|
TaskWorkOrder taskWorkOrder = new TaskWorkOrder();
|
||||||
|
Long minutes = Duration.between(item.getCreateTime(), item.getTaskReceiptTime()).toMinutes();
|
||||||
|
taskWorkOrder.setTaskId(item.getId())
|
||||||
|
.setReceivingTime(minutes.intValue());
|
||||||
|
taskWorkOrders.add(taskWorkOrder);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Db.executeBatch(taskWorkOrders, TaskWorkOrderMapper.class, (mapper, data) -> {
|
||||||
|
UpdateChain.of(mapper)
|
||||||
|
.set(TASK_WORK_ORDER.RECEIVING_TIME, data.getReceivingTime())
|
||||||
|
.where(TASK_WORK_ORDER.TASK_ID.eq(data.getTaskId()))
|
||||||
|
.update();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,11 +6,7 @@ import com.cpop.oam.business.bo.PauseWorkOrderBo;
|
|||||||
import com.cpop.oam.business.bo.TaskWorkOrderBo;
|
import com.cpop.oam.business.bo.TaskWorkOrderBo;
|
||||||
import com.cpop.oam.business.bo.TaskWorkOrderRecordBo;
|
import com.cpop.oam.business.bo.TaskWorkOrderRecordBo;
|
||||||
import com.cpop.oam.business.service.TaskWorkOrderService;
|
import com.cpop.oam.business.service.TaskWorkOrderService;
|
||||||
import com.cpop.oam.business.vo.StoreListVo;
|
import com.cpop.oam.business.vo.*;
|
||||||
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.BrandService;
|
||||||
import com.cpop.system.business.service.StoreService;
|
import com.cpop.system.business.service.StoreService;
|
||||||
import com.mybatisflex.core.paginate.Page;
|
import com.mybatisflex.core.paginate.Page;
|
||||||
@ -18,10 +14,12 @@ import io.swagger.annotations.Api;
|
|||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.annotations.ApiParam;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static com.cpop.system.business.entity.table.BrandTableDef.BRAND;
|
import static com.cpop.system.business.entity.table.BrandTableDef.BRAND;
|
||||||
@ -93,8 +91,7 @@ public class BackstageTaskWorkOrderController {
|
|||||||
**/
|
**/
|
||||||
@ApiOperation("工单模块-工单提交-新增工单")
|
@ApiOperation("工单模块-工单提交-新增工单")
|
||||||
@PostMapping("/insertWorkOrder")
|
@PostMapping("/insertWorkOrder")
|
||||||
public R<Void> insertWorkOrder(@RequestBody @Validated
|
public R<Void> insertWorkOrder(@RequestBody @Validated TaskWorkOrderBo bo) {
|
||||||
TaskWorkOrderBo bo) {
|
|
||||||
taskWorkOrderService.insertWorkOrder(bo);
|
taskWorkOrderService.insertWorkOrder(bo);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
@ -107,8 +104,7 @@ public class BackstageTaskWorkOrderController {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation("工单模块-工单提交-工单记录列表")
|
@ApiOperation("工单模块-工单提交-工单记录列表")
|
||||||
@GetMapping("/getWorkOrderRecordList/{workOrderId}")
|
@GetMapping("/getWorkOrderRecordList/{workOrderId}")
|
||||||
public R<List<TaskWorkOrderRecordListVo>> getWorkOrderRecordList(@PathVariable @ApiParam("工单id")
|
public R<List<TaskWorkOrderRecordListVo>> getWorkOrderRecordList(@PathVariable @ApiParam("工单id") String workOrderId) {
|
||||||
String workOrderId) {
|
|
||||||
List<TaskWorkOrderRecordListVo> list = taskWorkOrderService.getWorkOrderRecordList(workOrderId);
|
List<TaskWorkOrderRecordListVo> list = taskWorkOrderService.getWorkOrderRecordList(workOrderId);
|
||||||
return R.ok(list);
|
return R.ok(list);
|
||||||
}
|
}
|
||||||
@ -121,8 +117,7 @@ public class BackstageTaskWorkOrderController {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation("工单模块-工单提交-新增工单记录")
|
@ApiOperation("工单模块-工单提交-新增工单记录")
|
||||||
@PostMapping("/insertWorkOrderRecord")
|
@PostMapping("/insertWorkOrderRecord")
|
||||||
public R<Void> insertWorkOrderRecord(@RequestBody @Validated
|
public R<Void> insertWorkOrderRecord(@RequestBody @Validated TaskWorkOrderRecordBo bo) {
|
||||||
TaskWorkOrderRecordBo bo) {
|
|
||||||
taskWorkOrderService.insertWorkOrderRecord(bo);
|
taskWorkOrderService.insertWorkOrderRecord(bo);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
@ -135,8 +130,7 @@ public class BackstageTaskWorkOrderController {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation("工单模块-工单提交-工单提醒")
|
@ApiOperation("工单模块-工单提交-工单提醒")
|
||||||
@PutMapping("/workOrderRemind/{workOrderId}")
|
@PutMapping("/workOrderRemind/{workOrderId}")
|
||||||
public R<Void> workOrderRemind(@PathVariable @ApiParam("工单id")
|
public R<Void> workOrderRemind(@PathVariable @ApiParam("工单id") String workOrderId) {
|
||||||
String workOrderId) {
|
|
||||||
taskWorkOrderService.workOrderRemind(workOrderId);
|
taskWorkOrderService.workOrderRemind(workOrderId);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
@ -149,8 +143,7 @@ public class BackstageTaskWorkOrderController {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation("工单模块-工单提交-工单转需求")
|
@ApiOperation("工单模块-工单提交-工单转需求")
|
||||||
@PutMapping("/workOrderToDemand/{workOrderId}")
|
@PutMapping("/workOrderToDemand/{workOrderId}")
|
||||||
public R<Void> workOrderToDemand(@PathVariable @ApiParam("工单id")
|
public R<Void> workOrderToDemand(@PathVariable @ApiParam("工单id") String workOrderId) {
|
||||||
String workOrderId) {
|
|
||||||
taskWorkOrderService.workOrderToDemand(workOrderId);
|
taskWorkOrderService.workOrderToDemand(workOrderId);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
@ -163,8 +156,7 @@ public class BackstageTaskWorkOrderController {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation("工单模块-工单提交-工单暂停")
|
@ApiOperation("工单模块-工单提交-工单暂停")
|
||||||
@PutMapping("/pauseWorkOrder")
|
@PutMapping("/pauseWorkOrder")
|
||||||
public R<Void> pauseWorkOrder(@RequestBody @Validated
|
public R<Void> pauseWorkOrder(@RequestBody @Validated PauseWorkOrderBo bo) {
|
||||||
PauseWorkOrderBo bo) {
|
|
||||||
taskWorkOrderService.pauseWorkOrder(bo);
|
taskWorkOrderService.pauseWorkOrder(bo);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
@ -177,8 +169,7 @@ public class BackstageTaskWorkOrderController {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation("工单模块-工单提交-工单办结")
|
@ApiOperation("工单模块-工单提交-工单办结")
|
||||||
@PutMapping("/workOrderFinish/{workOrderId}")
|
@PutMapping("/workOrderFinish/{workOrderId}")
|
||||||
public R<Void> workOrderFinish(@PathVariable("workOrderId") @ApiParam("工单id")
|
public R<Void> workOrderFinish(@PathVariable("workOrderId") @ApiParam("工单id") String workOrderId) {
|
||||||
String workOrderId) {
|
|
||||||
taskWorkOrderService.workOrderFinish(workOrderId);
|
taskWorkOrderService.workOrderFinish(workOrderId);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
@ -191,8 +182,7 @@ public class BackstageTaskWorkOrderController {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation("工单模块-工单提交-获取品牌列表")
|
@ApiOperation("工单模块-工单提交-获取品牌列表")
|
||||||
@GetMapping("/getBrandList")
|
@GetMapping("/getBrandList")
|
||||||
public R<List<BrandListVo>> getBrandList(@ApiParam("品牌名")
|
public R<List<BrandListVo>> getBrandList(@ApiParam("品牌名") String brandName) {
|
||||||
String brandName) {
|
|
||||||
List<BrandListVo> list = brandService.queryChain().and(BRAND.BRAND_NAME.like(brandName)).listAs(BrandListVo.class);
|
List<BrandListVo> list = brandService.queryChain().and(BRAND.BRAND_NAME.like(brandName)).listAs(BrandListVo.class);
|
||||||
return R.ok(list);
|
return R.ok(list);
|
||||||
}
|
}
|
||||||
@ -205,10 +195,26 @@ public class BackstageTaskWorkOrderController {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation("工单模块-工单提交-获取校区/店铺列表")
|
@ApiOperation("工单模块-工单提交-获取校区/店铺列表")
|
||||||
@GetMapping("/getStoreList")
|
@GetMapping("/getStoreList")
|
||||||
public R<List<StoreListVo>> getStoreList(@ApiParam("品牌id")
|
public R<List<StoreListVo>> getStoreList(@ApiParam("品牌id") String brandId) {
|
||||||
String brandId) {
|
|
||||||
List<StoreListVo> list = storeService.queryChain().and(STORE.BRAND_ID.eq(brandId)).listAs(StoreListVo.class);
|
List<StoreListVo> list = storeService.queryChain().and(STORE.BRAND_ID.eq(brandId)).listAs(StoreListVo.class);
|
||||||
return R.ok(list);
|
return R.ok(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单统计-获取工单统计分页
|
||||||
|
* @author DB
|
||||||
|
* @since 2024/1/31
|
||||||
|
* @param staffId 员工id
|
||||||
|
* @param startDate 开始日期
|
||||||
|
* @param endDate 结束日期
|
||||||
|
* @return R<Page<TaskWorkOrderPageVo>>
|
||||||
|
*/
|
||||||
|
@ApiOperation("工单统计-获取工单统计分页")
|
||||||
|
@GetMapping("/getWorkOrderStatPage")
|
||||||
|
public R<Page<TaskWorkOrderStatPageVo>> getWorkOrderStatPage(@ApiParam("员工id") @RequestParam(value = "staffId", required = false) String staffId,
|
||||||
|
@RequestParam(value = "startDate", required = false) @ApiParam("开始日期") @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate startDate,
|
||||||
|
@RequestParam(value = "endDate", required = false) @ApiParam("结束日期") @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate endDate) {
|
||||||
|
Page<TaskWorkOrderStatPageVo> page = taskWorkOrderService.getWorkOrderStatPage(staffId, startDate, endDate);
|
||||||
|
return R.ok(page);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,16 +1,12 @@
|
|||||||
package com.cpop.oam.business.service;
|
package com.cpop.oam.business.service;
|
||||||
|
|
||||||
import com.cpop.oam.business.vo.TaskWorkOrderPersonVo;
|
import com.cpop.oam.business.vo.*;
|
||||||
import com.cpop.oam.business.vo.TaskWorkOrderReceiveDealPauseVo;
|
|
||||||
import com.cpop.oam.business.vo.WorkOrderDutyVo;
|
|
||||||
import com.mybatisflex.core.paginate.Page;
|
import com.mybatisflex.core.paginate.Page;
|
||||||
import com.mybatisflex.core.service.IService;
|
import com.mybatisflex.core.service.IService;
|
||||||
import com.cpop.oam.business.bo.PauseWorkOrderBo;
|
import com.cpop.oam.business.bo.PauseWorkOrderBo;
|
||||||
import com.cpop.oam.business.bo.TaskWorkOrderBo;
|
import com.cpop.oam.business.bo.TaskWorkOrderBo;
|
||||||
import com.cpop.oam.business.bo.TaskWorkOrderRecordBo;
|
import com.cpop.oam.business.bo.TaskWorkOrderRecordBo;
|
||||||
import com.cpop.oam.business.entity.TaskWorkOrder;
|
import com.cpop.oam.business.entity.TaskWorkOrder;
|
||||||
import com.cpop.oam.business.vo.TaskWorkOrderPageVo;
|
|
||||||
import com.cpop.oam.business.vo.TaskWorkOrderRecordListVo;
|
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -115,4 +111,15 @@ public interface TaskWorkOrderService extends IService<TaskWorkOrder> {
|
|||||||
* @since 2023/12/04
|
* @since 2023/12/04
|
||||||
*/
|
*/
|
||||||
void whetherReceive(String taskWorkOrderId);
|
void whetherReceive(String taskWorkOrderId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单统计-获取工单统计分页
|
||||||
|
* @author DB
|
||||||
|
* @since 2024/1/31
|
||||||
|
* @param staffId 员工id
|
||||||
|
* @param startDate 开始日期
|
||||||
|
* @param endDate 结束日期
|
||||||
|
* @return R<Page<TaskWorkOrderPageVo>>
|
||||||
|
*/
|
||||||
|
Page<TaskWorkOrderStatPageVo> getWorkOrderStatPage(String staffId,LocalDate startDate,LocalDate endDate);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,21 +39,25 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.sql.Date;
|
import java.sql.Date;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
|
import java.time.Duration;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.time.temporal.TemporalAdjusters;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static com.cpop.core.base.table.table.SysUserTableDef.SYS_USER;
|
import static com.cpop.core.base.table.table.SysUserTableDef.SYS_USER;
|
||||||
import static com.cpop.oam.business.entity.table.DutyTableDef.DUTY;
|
import static com.cpop.oam.business.entity.table.DutyTableDef.DUTY;
|
||||||
import static com.cpop.oam.business.entity.table.StaffTableDef.STAFF;
|
import static com.cpop.oam.business.entity.table.StaffTableDef.STAFF;
|
||||||
|
import static com.cpop.oam.business.entity.table.TaskStaffGroupTableDef.TASK_STAFF_GROUP;
|
||||||
import static com.cpop.oam.business.entity.table.TaskTableDef.TASK;
|
import static com.cpop.oam.business.entity.table.TaskTableDef.TASK;
|
||||||
import static com.cpop.oam.business.entity.table.TaskWorkOrderRecordTableDef.TASK_WORK_ORDER_RECORD;
|
import static com.cpop.oam.business.entity.table.TaskWorkOrderRecordTableDef.TASK_WORK_ORDER_RECORD;
|
||||||
import static com.cpop.oam.business.entity.table.TaskWorkOrderTableDef.TASK_WORK_ORDER;
|
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.BrandTableDef.BRAND;
|
||||||
import static com.cpop.system.business.entity.table.StoreTableDef.STORE;
|
import static com.cpop.system.business.entity.table.StoreTableDef.STORE;
|
||||||
|
import static com.mybatisflex.core.query.QueryMethods.dateFormat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务-工单表 服务层实现。
|
* 任务-工单表 服务层实现。
|
||||||
@ -63,8 +67,7 @@ import static com.cpop.system.business.entity.table.StoreTableDef.STORE;
|
|||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service("taskWorkOrderService")
|
@Service("taskWorkOrderService")
|
||||||
public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, TaskWorkOrder>
|
public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, TaskWorkOrder> implements TaskWorkOrderService {
|
||||||
implements TaskWorkOrderService {
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private Scheduler scheduler;
|
private Scheduler scheduler;
|
||||||
@ -199,7 +202,8 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
|
|||||||
.on(TASK.ID.eq(TASK_WORK_ORDER.TASK_ID))
|
.on(TASK.ID.eq(TASK_WORK_ORDER.TASK_ID))
|
||||||
// 工单
|
// 工单
|
||||||
.where(TASK.TASK_TYPE.eq(2))
|
.where(TASK.TASK_TYPE.eq(2))
|
||||||
.and(TASK.TASK_STATUS.eq(9)),
|
.and(TASK.TASK_STATUS.eq(9))
|
||||||
|
.orderBy(TASK_WORK_ORDER.FINISH_TIME.desc()),
|
||||||
TaskWorkOrderPageVo.class,
|
TaskWorkOrderPageVo.class,
|
||||||
item -> item.field(TaskWorkOrderPageVo::getFinishStaffName)
|
item -> item.field(TaskWorkOrderPageVo::getFinishStaffName)
|
||||||
.queryWrapper(finishStaff -> queryChain().select(STAFF.NAME.as("finishStaffName"))
|
.queryWrapper(finishStaff -> queryChain().select(STAFF.NAME.as("finishStaffName"))
|
||||||
@ -414,7 +418,6 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
|
|||||||
//判断插入记录用户类型
|
//判断插入记录用户类型
|
||||||
List<String> phoneList = new ArrayList<>();
|
List<String> phoneList = new ArrayList<>();
|
||||||
StaffService staffService = SpringUtils.getBean(StaffService.class);
|
StaffService staffService = SpringUtils.getBean(StaffService.class);
|
||||||
|
|
||||||
if (loginUserInfo.getInteger("staffType") == 1) {
|
if (loginUserInfo.getInteger("staffType") == 1) {
|
||||||
// 负责人手机号
|
// 负责人手机号
|
||||||
StaffInfoVo responsibleStaff = staffService.getStaffInfo(task.getResponsibleStaffId());
|
StaffInfoVo responsibleStaff = staffService.getStaffInfo(task.getResponsibleStaffId());
|
||||||
@ -536,12 +539,19 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
|
|||||||
// 设定任务状态暂停
|
// 设定任务状态暂停
|
||||||
task.setTaskStatus(5);
|
task.setTaskStatus(5);
|
||||||
taskService.updateById(task);
|
taskService.updateById(task);
|
||||||
// 获取记录员工
|
// 插入工单暂停记录
|
||||||
// 当前操作员工是否是主要负责人,不是抛出异常
|
TaskWorkOrderRecord taskWorkOrderRecord = new TaskWorkOrderRecord();
|
||||||
|
//暂停时间
|
||||||
|
String pauseExpireTime = "工单已暂停到:" + bo.getPauseExpireTime().format(DateTimeFormatter.ofPattern(DateUtils.YYYY_MM_DD_HH_MM_SS));
|
||||||
|
// 读取员工信息
|
||||||
JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo();
|
JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo();
|
||||||
|
taskWorkOrderRecord.setRecordStaffId(loginUserInfo.getString("id"))
|
||||||
|
.setTaskWorkOrderId(bo.getWorkOrderId())
|
||||||
|
.setRecordText(pauseExpireTime);
|
||||||
|
// 插入记录
|
||||||
|
SpringUtils.getBean(TaskWorkOrderRecordService.class).save(taskWorkOrderRecord);
|
||||||
// 负责人手机号
|
// 负责人手机号
|
||||||
StaffInfoVo responsibleStaff =
|
StaffInfoVo responsibleStaff = SpringUtils.getBean(StaffService.class).getStaffInfo(task.getResponsibleStaffId());
|
||||||
SpringUtils.getBean(StaffService.class).getStaffInfo(task.getResponsibleStaffId());
|
|
||||||
List<String> phoneList = new ArrayList<>();
|
List<String> phoneList = new ArrayList<>();
|
||||||
phoneList.add(responsibleStaff.getPhoneNumber());
|
phoneList.add(responsibleStaff.getPhoneNumber());
|
||||||
phoneList.add(loginUserInfo.getString("phoneNumber"));
|
phoneList.add(loginUserInfo.getString("phoneNumber"));
|
||||||
@ -550,8 +560,7 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
|
|||||||
SpringUtils.getBean(WebHookSendHandler.class)
|
SpringUtils.getBean(WebHookSendHandler.class)
|
||||||
.webHookSendText(WebHookKeyConstant.ORDER_INFO_BOT,
|
.webHookSendText(WebHookKeyConstant.ORDER_INFO_BOT,
|
||||||
phoneList,
|
phoneList,
|
||||||
task.getTaskContent() + "\n工单已暂停到:"
|
task.getTaskContent() + "\n" + pauseExpireTime,
|
||||||
+ bo.getPauseExpireTime().format(DateTimeFormatter.ofPattern(DateUtils.YYYY_MM_DD_HH_MM_SS)),
|
|
||||||
false);
|
false);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new ServiceException("发送消息通知失败!");
|
throw new ServiceException("发送消息通知失败!");
|
||||||
@ -629,6 +638,16 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
|
|||||||
taskService.updateById(task);
|
taskService.updateById(task);
|
||||||
// 更新工单
|
// 更新工单
|
||||||
this.updateById(taskWorkOrder);
|
this.updateById(taskWorkOrder);
|
||||||
|
// 插入工单暂停记录
|
||||||
|
TaskWorkOrderRecord taskWorkOrderRecord = new TaskWorkOrderRecord();
|
||||||
|
//暂停时间
|
||||||
|
String finishTimeString = "\n工单办结,时间为:" + finishTime.format(DateTimeFormatter.ofPattern(DateUtils.YYYY_MM_DD_HH_MM_SS));
|
||||||
|
// 读取员工信息
|
||||||
|
taskWorkOrderRecord.setRecordStaffId(loginUserInfo.getString("id"))
|
||||||
|
.setTaskWorkOrderId(workOrderId)
|
||||||
|
.setRecordText(finishTimeString);
|
||||||
|
// 插入记录
|
||||||
|
SpringUtils.getBean(TaskWorkOrderRecordService.class).save(taskWorkOrderRecord);
|
||||||
// 负责人手机号
|
// 负责人手机号
|
||||||
StaffService staffService = SpringUtils.getBean(StaffService.class);
|
StaffService staffService = SpringUtils.getBean(StaffService.class);
|
||||||
Set<String> staffIds = new HashSet<>();
|
Set<String> staffIds = new HashSet<>();
|
||||||
@ -649,7 +668,7 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
|
|||||||
phoneList.add(staffMap.get(task.getRecordStaffId()).getPhoneNumber());
|
phoneList.add(staffMap.get(task.getRecordStaffId()).getPhoneNumber());
|
||||||
// 通知记录
|
// 通知记录
|
||||||
try {
|
try {
|
||||||
SpringUtils.getBean(WebHookSendHandler.class).webHookSendText(WebHookKeyConstant.ORDER_INFO_BOT, phoneList, task.getTaskContent() + "\n工单办结", false);
|
SpringUtils.getBean(WebHookSendHandler.class).webHookSendText(WebHookKeyConstant.ORDER_INFO_BOT, phoneList, task.getTaskContent() + "\n" + finishTimeString, false);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new ServiceException("发送消息通知失败!");
|
throw new ServiceException("发送消息通知失败!");
|
||||||
}
|
}
|
||||||
@ -735,8 +754,8 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
|
|||||||
.set(TASK.TASK_RECEIPT_TIME, now)
|
.set(TASK.TASK_RECEIPT_TIME, now)
|
||||||
.where(TASK.ID.eq(task.getId()))
|
.where(TASK.ID.eq(task.getId()))
|
||||||
.update();
|
.update();
|
||||||
int receivingTime = now.compareTo(workOrder.getCreateTime());
|
Duration duration = Duration.between(now, workOrder.getCreateTime());
|
||||||
workOrder.setReceivingTime(receivingTime);
|
workOrder.setReceivingTime((int) duration.toMinutes());
|
||||||
this.updateById(workOrder);
|
this.updateById(workOrder);
|
||||||
//删除工单接收超时任务
|
//删除工单接收超时任务
|
||||||
startOrRemoveWorkOrderAcceptTask(taskWorkOrderId, false, now);
|
startOrRemoveWorkOrderAcceptTask(taskWorkOrderId, false, now);
|
||||||
@ -745,4 +764,85 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单统计-获取工单统计分页
|
||||||
|
* @author DB
|
||||||
|
* @since 2024/1/31
|
||||||
|
* @param staffId 员工id
|
||||||
|
* @param startDate 开始日期
|
||||||
|
* @param endDate 结束日期
|
||||||
|
* @return R<Page<TaskWorkOrderPageVo>>
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Page<TaskWorkOrderStatPageVo> getWorkOrderStatPage(String staffId,LocalDate startDate,LocalDate endDate) {
|
||||||
|
PageDomain pageDomain = SqlUtils.getInstance().getPageDomain();
|
||||||
|
QueryWrapper queryWrapper = QueryWrapper.create();
|
||||||
|
if (startDate == null && endDate == null) {
|
||||||
|
LocalDate now = LocalDate.now();
|
||||||
|
// 获取目标月的第一天
|
||||||
|
LocalDate firstDay = now.with(TemporalAdjusters.firstDayOfMonth());
|
||||||
|
// 获取目标月的最后一天
|
||||||
|
LocalDate lastDay = now.with(TemporalAdjusters.lastDayOfMonth());
|
||||||
|
//获取当月绩点
|
||||||
|
queryWrapper.where(dateFormat(TASK_WORK_ORDER.CREATE_TIME, "%Y-%m-%d").between(firstDay, lastDay));
|
||||||
|
} else {
|
||||||
|
queryWrapper.where(dateFormat(TASK_WORK_ORDER.CREATE_TIME, "%Y-%m-%d").between(startDate, endDate));
|
||||||
|
}
|
||||||
|
return this.mapper.paginateAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()), queryWrapper
|
||||||
|
.select(TASK_WORK_ORDER.ID,BRAND.BRAND_NAME,STORE.STORE_NAME,TASK_WORK_ORDER.RECEIVING_TIME,TASK.TASK_CONTENT,TASK_WORK_ORDER.PAUSE_STAFF_ID,TASK_WORK_ORDER.PAUSE_EXPIRE_TIME,
|
||||||
|
TASK_WORK_ORDER.PAUSE_RECORD_TIME,TASK_WORK_ORDER.FINISH_STAFF_ID,TASK_WORK_ORDER.FINISH_TIME,TASK.RECORD_STAFF_ID,TASK.RESPONSIBLE_STAFF_ID,TASK.TASK_RECEIPT_TIME,
|
||||||
|
TASK_STAFF_GROUP.GRADE_POINT,TASK_STAFF_GROUP.REMARK,TASK.TASK_STATUS)
|
||||||
|
.leftJoin(BRAND).on(BRAND.ID.eq(TASK_WORK_ORDER.BRAND_ID))
|
||||||
|
.leftJoin(STORE).on(STORE.ID.eq(TASK_WORK_ORDER.STORE_ID))
|
||||||
|
.leftJoin(TASK).on(TASK.ID.eq(TASK_WORK_ORDER.TASK_ID))
|
||||||
|
.leftJoin(TASK_STAFF_GROUP).on(TASK_STAFF_GROUP.TASK_ID.eq(TASK.ID))
|
||||||
|
.and(TASK.RESPONSIBLE_STAFF_ID.eq(staffId))
|
||||||
|
.orderBy(TASK_WORK_ORDER.CREATE_TIME.desc()),
|
||||||
|
TaskWorkOrderStatPageVo.class,
|
||||||
|
// 暂停人
|
||||||
|
item -> item.field(TaskWorkOrderStatPageVo::getPauseStaffName)
|
||||||
|
.queryWrapper(pauseStaffName -> {
|
||||||
|
if (StringUtils.isNotBlank(pauseStaffName.getPauseStaffId())) {
|
||||||
|
return queryChain().select(STAFF.NAME.as(TaskWorkOrderStatPageVo::getPauseStaffName))
|
||||||
|
.from(STAFF)
|
||||||
|
.where(STAFF.ID.eq(pauseStaffName.getPauseStaffId()));
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
// 办结人
|
||||||
|
item -> item.field(TaskWorkOrderStatPageVo::getFinishStaffName)
|
||||||
|
.queryWrapper(finishStaffName -> {
|
||||||
|
if (StringUtils.isNotBlank(finishStaffName.getFinishStaffId())) {
|
||||||
|
return queryChain().select(STAFF.NAME.as(TaskWorkOrderStatPageVo::getFinishStaffName))
|
||||||
|
.from(STAFF)
|
||||||
|
.where(STAFF.ID.eq(finishStaffName.getFinishStaffId()));
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
// 记录人
|
||||||
|
item -> item.field(TaskWorkOrderStatPageVo::getRecordStaffName)
|
||||||
|
.queryWrapper(recordStaffName -> {
|
||||||
|
if (StringUtils.isNotBlank(recordStaffName.getRecordStaffId())) {
|
||||||
|
return queryChain().select(STAFF.NAME.as(TaskWorkOrderStatPageVo::getRecordStaffName))
|
||||||
|
.from(STAFF)
|
||||||
|
.where(STAFF.ID.eq(recordStaffName.getRecordStaffId()));
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
// 负责人
|
||||||
|
item -> item.field(TaskWorkOrderStatPageVo::getResponsibleStaffName)
|
||||||
|
.queryWrapper(responsibleStaffName -> {
|
||||||
|
if (StringUtils.isNotBlank(responsibleStaffName.getResponsibleStaffId())){
|
||||||
|
return queryChain().select(STAFF.NAME.as(TaskWorkOrderStatPageVo::getResponsibleStaffName))
|
||||||
|
.from(STAFF)
|
||||||
|
.where(STAFF.ID.eq(responsibleStaffName.getResponsibleStaffId()));
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,144 @@
|
|||||||
|
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.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author DB
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024-01-31 12:39
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@ApiModel(value = "TaskWorkOrderStatPageVo对象", description = "工单统计")
|
||||||
|
public class TaskWorkOrderStatPageVo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 品牌
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "品牌")
|
||||||
|
private String brandName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校区店铺
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "校区店铺")
|
||||||
|
private String storeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接收用时
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "接收用时")
|
||||||
|
private Integer receivingTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务内容
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("任务内容")
|
||||||
|
private String taskContent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暂停员工id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("暂停员工id")
|
||||||
|
private String pauseStaffId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暂停员工
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("暂停员工")
|
||||||
|
private String pauseStaffName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暂停记录时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("暂停记录时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private LocalDateTime pauseRecordTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暂停到期时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("暂停到期时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private LocalDateTime pauseExpireTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 办结员工id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("办结员工id")
|
||||||
|
private String finishStaffId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 办结员工
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("办结员工")
|
||||||
|
private String finishStaffName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 办结时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("办结时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private LocalDateTime finishTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 记录员工id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("记录员工id")
|
||||||
|
private String recordStaffId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 记录员工
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("记录员工")
|
||||||
|
private String recordStaffName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主要负责员工id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("主要负责员工id")
|
||||||
|
private String responsibleStaffId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主要负责员工
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("主要负责员工")
|
||||||
|
private String responsibleStaffName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务接收时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("任务接收时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private LocalDateTime taskReceiptTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绩点
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("绩点")
|
||||||
|
private Integer gradePoint;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务状态
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("任务状态")
|
||||||
|
private Integer taskStatus;
|
||||||
|
}
|
||||||
@ -43,7 +43,7 @@ public class MiniSysCommonController {
|
|||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiOperation("小程序同步品牌和校区")
|
@ApiOperation("小程序同步品牌和校区")
|
||||||
@PostMapping("/syncBrandAndStore")
|
@PostMapping("/miniSyncBrandAndStore")
|
||||||
public R<Void> miniSyncBrandAndStore(@RequestBody SyncBrandAndStoreBo bo) {
|
public R<Void> miniSyncBrandAndStore(@RequestBody SyncBrandAndStoreBo bo) {
|
||||||
storeService.miniSyncBrandAndStore(bo);
|
storeService.miniSyncBrandAndStore(bo);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
|
|||||||
@ -1,44 +0,0 @@
|
|||||||
package com.cpop.system.business.controller.mini;
|
|
||||||
|
|
||||||
import com.cpop.core.base.R;
|
|
||||||
import com.cpop.system.business.bo.SyncBrandAndStoreBo;
|
|
||||||
import com.cpop.system.business.service.StoreService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author DB
|
|
||||||
* @createTime 2023/09/13 15:10
|
|
||||||
* @description 通用接口
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Api(tags = "通用接口")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("sysCommon")
|
|
||||||
@Deprecated
|
|
||||||
public class SysCommonController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private StoreService storeService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 小程序同步品牌和校区
|
|
||||||
* @author DB
|
|
||||||
* @since 2023/12/21
|
|
||||||
* @param bo 请求参数
|
|
||||||
* @return R<SysFileVo>
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@ApiOperation("小程序同步品牌和校区")
|
|
||||||
@PostMapping("/syncBrandAndStore")
|
|
||||||
public R<Void> miniSyncBrandAndStore(@RequestBody SyncBrandAndStoreBo bo) {
|
|
||||||
storeService.miniSyncBrandAndStore(bo);
|
|
||||||
return R.ok();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user