添加初始化角色;调整任务技术模块;调整任务工单需求模块;调整登陆用户权限问题

This commit is contained in:
DB 2023-12-01 14:26:11 +08:00
parent 9cf9a60a63
commit cbb4a1f62d
35 changed files with 1202 additions and 1043 deletions

View File

@ -17,10 +17,13 @@ public enum InitRoleEnum {
*/ */
SUPER_MALL_ROLE("2", "SuperMallAdmin", "SuperMallAdmin", -1, UserType.MALL_USER), SUPER_MALL_ROLE("2", "SuperMallAdmin", "SuperMallAdmin", -1, UserType.MALL_USER),
/** /**
* 企微注册初始化角色 * 企微注册初始化技术员工角色
*/ */
WX_CP_INIT_ROLE("3", "企微注册通用角色", "RegisterRole", 0, UserType.OAM_USER), WX_CP_INIT_TECHNOLOGY_ROLE("3", "企微注册初始化技术员工角色", "RegisterTechnologyRole", 0, UserType.OAM_USER),
; /**
* 企微注册初始化运营员工角色
*/
WX_CP_INIT_OPERATION_ROLE("4", "企微注册初始化运营员工角色", "RegisterOperationRole", 1, UserType.OAM_USER),;
/** /**
* 主键 * 主键

View File

@ -33,4 +33,18 @@ public class SysConfigInfoBo implements Serializable {
@NotBlank(message = "核销管理员工手机号不能为空") @NotBlank(message = "核销管理员工手机号不能为空")
@ApiModelProperty(value = "核销管理员工手机号", required = true) @ApiModelProperty(value = "核销管理员工手机号", required = true)
private String cancelAfterVerificationStaffPhone; private String cancelAfterVerificationStaffPhone;
/**
* 需求转任务主体品牌
*/
@NotBlank(message = "需求转任务主体品牌不能为空")
@ApiModelProperty(value = "需求转任务主体品牌", required = true)
private String oamDemandToTaskBrand;
/**
* 需求转任务主体校区
*/
@NotBlank(message = "需求转任务主体校区不能为空")
@ApiModelProperty(value = "需求转任务主体校区", required = true)
private String oamDemandToTaskStore;
} }

View File

@ -8,21 +8,18 @@ import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDate; import java.time.LocalDate;
/** /**
* Description: * 任务审核对象
* date: 2023/5/16 17:33 * @author DB
* * @since 2023-12-01 10:36:14
* @Author ST * @version 1.0.0
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@ApiModel(value = "TaskAudit对象", description = "任务审核对象") @ApiModel(value = "TaskAudit对象", description = "任务审核对象")
public class TaskAuditCommentsBo implements Serializable { public class TaskAuditCommentsBo {
private static final long serialVersionUID = 1L;
/** /**
* 主键 * 主键
@ -50,10 +47,4 @@ public class TaskAuditCommentsBo implements Serializable {
@ApiModelProperty("任务评级(0:A;1:B;2:C;3:D;4:E)") @ApiModelProperty("任务评级(0:A;1:B;2:C;3:D;4:E)")
private Integer taskRating; private Integer taskRating;
/**
* 任务状态(-1:驳回;0:待审核;1:待接受;2:进行中;3:已完成;4:逾期;)
*/
@NotNull(message = "任务状态不能为空")
@ApiModelProperty(value = "任务状态(-1:驳回;0:待审核;1:待接受;2:进行中;3:已完成;4:逾期;)",required = true)
private Integer taskStatus;
} }

View File

@ -1,73 +0,0 @@
package com.cpop.oam.business.bo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDate;
/**
* OAM-任务表Bo
*
* @author DB.lost
* @since 2023-05-15
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "Task对象", description = "OAM-任务表")
public class TaskBo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@ApiModelProperty("主键")
private String id;
/**
* 任务名
*/
@NotBlank(message = "任务名不能为空")
@ApiModelProperty(value = "任务名",required = true)
private String taskName;
/**
* 任务类型(0:迭代;1:需求;2:投诉)
*/
@NotNull(message = "任务类型不能为空")
@ApiModelProperty(value = "任务类型(0:迭代;1:需求;2:投诉)",required = true)
private Integer taskType;
/**
* 任务内容
*/
@NotBlank(message = "任务内容不能为空")
@ApiModelProperty(value = "任务内容",required = true)
private String taskContent;
/**
* 附件地址
*/
@ApiModelProperty("附件地址")
private String attachmentUrl;
/**
* 备注
*/
@ApiModelProperty("备注")
private String remark;
/**
* 预期完成日期
*/
@ApiModelProperty("预期完成日期")
@JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
private LocalDate expectedCompletionDate;
}

View File

@ -7,7 +7,7 @@ import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.io.Serializable; import com.cpop.core.annontation.StringArrayConvert;
/** /**
* OAM-任务-需求表Bo * OAM-任务-需求表Bo
@ -18,9 +18,7 @@ import java.io.Serializable;
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@ApiModel(value = "TaskDemand对象", description = "OAM-任务-需求表") @ApiModel(value = "TaskDemand对象", description = "OAM-任务-需求表")
public class TaskDemandBo implements Serializable { public class TaskDemandBo {
private static final long serialVersionUID = 1L;
/** /**
* 主键 * 主键
@ -28,62 +26,32 @@ public class TaskDemandBo implements Serializable {
@ApiModelProperty("主键") @ApiModelProperty("主键")
private String id; private String id;
/**
* 需求类型(0:;1:;2:;3:)
*/
@ApiModelProperty("需求类型(0:轻;1:缓;2:急;3:重)")
private Integer demandType;
/**
* 需求状态(0:待接收;1:处理中;2:已解决)
*/
@ApiModelProperty("需求状态(0:待接收;1:处理中;2:已解决)")
private Integer demandStatus;
/**
* 任务名
*/
@NotBlank(message = "任务名不能为空")
@ApiModelProperty("任务名")
private String taskName;
/**
* 任务类型(0:迭代;1:需求;2:投诉)
*/
@NotNull(message = "任务类型不能为空")
@ApiModelProperty("任务类型(0:迭代;1:需求;2:投诉)")
private Integer taskType;
/** /**
* 品牌id * 品牌id
*/ */
@NotBlank(message = "品牌不能为空") @NotBlank(message = "品牌不能为空")
@ApiModelProperty("品牌id") @ApiModelProperty(value = "品牌id", required = true)
private String brandId; private String brandId;
/** /**
* 校区id * 校区id
*/ */
@NotBlank(message = "校区不能为空") @NotBlank(message = "校区不能为空")
@ApiModelProperty("校区id") @ApiModelProperty(value = "校区id", required = true)
private String campusId; private String storeId;
/** /**
* 任务内容 * 任务内容
*/ */
@NotBlank(message = "任务内容不能为空") @NotBlank(message = "任务内容不能为空")
@ApiModelProperty("任务内容") @ApiModelProperty(value = "任务内容", required = true)
private String taskContent; private String taskContent;
/** /**
* 附件地址 * 附件地址
*/ */
@StringArrayConvert
@ApiModelProperty("附件地址") @ApiModelProperty("附件地址")
private String attachmentUrl; private String attachmentUrl;
/**
* 备注
*/
@ApiModelProperty("备注")
private String remark;
} }

View File

@ -16,26 +16,24 @@ import java.io.Serializable;
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@ApiModel(value = "SysDept对象", description = "部门表") @ApiModel(value = "SysDept对象", description = "部门表")
public class TaskDemandPageBo implements Serializable { public class TaskDemandPageBo {
private static final long serialVersionUID = 1L;
/** /**
* 任务 * 任务内容
*/ */
@ApiModelProperty("任务") @ApiModelProperty("任务内容")
private String taskName; private String taskContent;
/** /**
* 校区 * 品牌或校区
*/ */
@ApiModelProperty("校区") @ApiModelProperty("品牌或校区")
private String campusName; private String brandOrStore;
/** /**
* 任务状态 * 任务状态
*/ */
@ApiModelProperty("任务状态") @ApiModelProperty(value = "任务查询状态(待评估:0;待领取:1;处理中:2;已解决:3)", required = true)
private Integer taskStatus; private Integer taskStatus;
} }

View File

@ -1,34 +0,0 @@
package com.cpop.oam.business.bo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* Description:
* date: 2023/5/16 15:27
*
* @Author ST
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "Task分页列表对象", description = "OAM-任务管理")
public class TaskPageBo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 任务类型(0:迭代;1:需求;2:投诉)
*/
@ApiModelProperty("任务类型(0:迭代;1:需求;2:投诉)")
private Integer taskType;
/**
* 任务评级(0:A;1:B;2:C;3:D;4:E)
*/
@ApiModelProperty("任务评级(0:A;1:B;2:C;3:D;4:E)")
private Integer taskRating;
}

View File

@ -6,6 +6,7 @@ import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import com.cpop.core.annontation.StringArrayConvert;
/** /**
* TaskWorkOrderRecord对象 * TaskWorkOrderRecord对象
@ -22,20 +23,21 @@ public class TaskWorkOrderRecordBo {
* 任务工单id * 任务工单id
*/ */
@NotBlank(message = "任务工单id不能为空") @NotBlank(message = "任务工单id不能为空")
@ApiModelProperty("任务工单id") @ApiModelProperty(value = "任务工单id", required = true)
private String taskWorkOrderId; private String taskWorkOrderId;
/** /**
* 记录内容 * 记录内容
*/ */
@NotBlank(message = "记录内容不能为空") @NotBlank(message = "记录内容不能为空")
@ApiModelProperty("记录内容") @ApiModelProperty(value = "记录内容", required = true)
private String recordText; private String recordText;
/** /**
* 附件地址 * 附件地址
*/ */
@ApiModelProperty("附件地址") @StringArrayConvert
@ApiModelProperty(value = "附件地址", required = true)
private String attachmentUrl; private String attachmentUrl;
} }

View File

@ -4,15 +4,25 @@ import com.cpop.core.base.R;
import com.cpop.oam.business.bo.TaskDemandBo; import com.cpop.oam.business.bo.TaskDemandBo;
import com.cpop.oam.business.bo.TaskDemandPageBo; import com.cpop.oam.business.bo.TaskDemandPageBo;
import com.cpop.oam.business.service.TaskDemandService; import com.cpop.oam.business.service.TaskDemandService;
import com.cpop.oam.business.vo.BrandListVo;
import com.cpop.oam.business.vo.StoreListVo;
import com.cpop.oam.business.vo.TaskDemandPageVo; import com.cpop.oam.business.vo.TaskDemandPageVo;
import com.cpop.system.business.service.BrandService;
import com.cpop.system.business.service.StoreService;
import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.paginate.Page;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
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.util.List;
import static com.cpop.system.business.entity.table.BrandTableDef.BRAND;
import static com.cpop.system.business.entity.table.StoreTableDef.STORE;
/** /**
* OAM-任务-需求表 控制层 * OAM-任务-需求表 控制层
* *
@ -20,22 +30,27 @@ import org.springframework.web.bind.annotation.*;
* @since 2023-09-18 * @since 2023-09-18
*/ */
@RestController @RestController
@Api(tags = "任务管理模块-需求任务") @Api(tags = "工单模块-需求")
@RequestMapping("/taskDemand") @RequestMapping("/taskDemand")
public class TaskDemandController { public class TaskDemandController {
@Autowired @Autowired
private TaskDemandService taskDemandService; private TaskDemandService taskDemandService;
@Autowired
private BrandService brandService;
@Autowired
private StoreService storeService;
/** /**
* @Description: 任务管理-需求管理分页列表 * 工单模块-需求-需求分页列表
* @param bo 请求参数 * @author DB
* @return: R<PageVo<DemandPageListVo>> * @param bo 查询参数
* @Author: DB * @since 2023-11-30 17:26:24
* @Date: 2023/5/30 15:44 */
**/
@PreAuthorize("@aps.hasPermission('oamTask:taskDemand:list')") @PreAuthorize("@aps.hasPermission('oamTask:taskDemand:list')")
@ApiOperation("任务管理模块-需求任务分页列表") @ApiOperation("工单模块-需求-需求分页列表")
@GetMapping("/getTaskDemandPage") @GetMapping("/getTaskDemandPage")
public R<Page<TaskDemandPageVo>> getTaskDemandPage(TaskDemandPageBo bo) { public R<Page<TaskDemandPageVo>> getTaskDemandPage(TaskDemandPageBo bo) {
Page<TaskDemandPageVo> pageVo = taskDemandService.getTaskDemandPage(bo); Page<TaskDemandPageVo> pageVo = taskDemandService.getTaskDemandPage(bo);
@ -43,18 +58,77 @@ public class TaskDemandController {
} }
/** /**
* @Description: 任务管理-需求管理-新增需求任务 * 工单模块-需求-新增需求
* @author DB
* @param bo 请求参数 * @param bo 请求参数
* @return: R<Void> * @since 2023-11-30 17:27:24
* @Author: DB */
* @Date: 2023/5/30 16:53
**/
@PreAuthorize("@aps.hasPermission('oamTask:taskDemand:insert')") @PreAuthorize("@aps.hasPermission('oamTask:taskDemand:insert')")
@ApiOperation("任务管理模块-新增需求任务") @ApiOperation("工单模块-需求-新增需求")
@PostMapping("/insertDemandTask") @PostMapping("/insertDemandTask")
public R<Void> insertDemandTask(@RequestBody @Validated TaskDemandBo bo) { public R<Void> insertDemandTask(@RequestBody @Validated
TaskDemandBo bo) {
taskDemandService.insertTaskDemand(bo); taskDemandService.insertTaskDemand(bo);
return R.ok(); return R.ok();
} }
/**
* 工单模块-需求-修改需求
* @author DB
* @param bo 请求参数
* @since 2023-11-30 18:26:42
*/
@PreAuthorize("@aps.hasPermission('oamTask:taskDemand:update')")
@ApiOperation("工单模块-需求-修改需求")
@PutMapping("/updateDemandTask")
public R<Void> updateDemandTask(@RequestBody @Validated
TaskDemandBo bo) {
taskDemandService.updateDemandTask(bo);
return R.ok();
}
/**
* 工单模块-需求-删除需求
* @author DB
* @param demandId 需求id
* @since 2023-11-30 20:30:54
*/
@PreAuthorize("@aps.hasPermission('oamTask:taskDemand:remove')")
@ApiOperation("工单模块-需求-删除需求")
@DeleteMapping("/removeDemandTask/{demandId}")
public R<Void> removeDemandTask(@PathVariable @ApiParam(value = "需求id")
String demandId) {
taskDemandService.removeDemandTask(demandId);
return R.ok();
}
/**
* 任务管理模块-工单管理-获取品牌列表
* @author DB
* @param brandName 品牌名
* @since 2023-11-30 17:59:29
*/
@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);
}
/**
* 工单模块-工单提交-获取校区/店铺列表
* @author DB
* @param brandId 品牌id
* @since 2023-11-30 18:00:08
*/
@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);
}
} }

View File

@ -1,9 +1,7 @@
package com.cpop.oam.business.controller.backstage; package com.cpop.oam.business.controller.backstage;
import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.paginate.Page;
import com.cpop.core.annontation.OperationLog;
import com.cpop.core.base.R; import com.cpop.core.base.R;
import com.cpop.core.base.enums.OperationLogEnum;
import com.cpop.oam.business.bo.*; import com.cpop.oam.business.bo.*;
import com.cpop.oam.business.service.StaffService; import com.cpop.oam.business.service.StaffService;
import com.cpop.oam.business.service.TaskService; import com.cpop.oam.business.service.TaskService;
@ -11,12 +9,14 @@ import com.cpop.oam.business.service.TaskStaffGroupService;
import com.cpop.oam.business.vo.*; import com.cpop.oam.business.vo.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
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.util.List; import java.util.List;
import com.cpop.oam.business.service.TaskWorkOrderService;
/** /**
* OAM-任务表 控制层 * OAM-任务表 控制层
@ -25,9 +25,12 @@ import java.util.List;
* @since 2023-09-15 * @since 2023-09-15
*/ */
@RestController @RestController
@Api(tags = "任务管理模块") @Api(tags = "技术模块-技术")
@RequestMapping("/task") @RequestMapping("/taskTechnology")
public class TaskController { public class TaskTechnologyController {
@Autowired
private TaskWorkOrderService taskWorkOrderService;
@Autowired @Autowired
private TaskService taskService; private TaskService taskService;
@ -39,93 +42,145 @@ public class TaskController {
private StaffService staffService; private StaffService staffService;
/** /**
* @Description: 查询OAM-任务分页列表 * 技术模块-今日事务-获取个人工单列表
* @author DB
* @since 2023-11-30 19:41:32
*/
@PreAuthorize("@aps.hasPermission('oamTask:taskTechnology:list')")
@ApiOperation("技术模块-今日事务-获取个人工单列表")
@GetMapping("/getPersonWorkOrder")
public R<List<TaskWorkOrderPersonVo>> getPersonWorkOrder() {
List<TaskWorkOrderPersonVo> list = taskWorkOrderService.getPersonWorkOrder();
return R.ok(list);
}
/**
* 工单模块-今日事务-工单记录列表
* @author DB
* @param workOrderId 工单id
* @since 2023-11-29 11:25:28
*/
@PreAuthorize("@aps.hasPermission('oamTask:workOrder:record')")
@ApiOperation("技术模块-今日事务-工单记录列表")
@GetMapping("/getWorkOrderRecordList/{workOrderId}")
public R<List<TaskWorkOrderRecordListVo>> getWorkOrderRecordList(@PathVariable @ApiParam("工单id")
String workOrderId) {
List<TaskWorkOrderRecordListVo> list = taskWorkOrderService.getWorkOrderRecordList(workOrderId);
return R.ok(list);
}
/**
* 工单模块-今日事务-新增工单记录
* @author DB
* @param bo 请求参数 * @param bo 请求参数
* @return: R<PageVo<PersonTaskPageListVo>> * @since 2023-11-29 11:33:35
* @Author: DB */
* @Date: 2023/5/16 15:24 @PreAuthorize("@aps.hasPermission('oamTask:workOrder:record')")
**/ @ApiOperation("技术模块-今日事务-新增工单记录")
@PostMapping("/insertWorkOrderRecord")
public R<Void> insertWorkOrderRecord(@RequestBody @Validated
TaskWorkOrderRecordBo bo) {
taskWorkOrderService.insertWorkOrderRecord(bo);
return R.ok();
}
/**
* 技术模块-任务归档-获取任务归档分页
* @author DB
* @param subject 主体
* @param taskContent 任务内容
* @since 2023-11-30 21:11:47
*/
@PreAuthorize("@aps.hasPermission('oamTask:taskArchiving:list')")
@ApiOperation("技术模块-任务归档-获取任务归档分页")
@GetMapping("/getTaskArchivingPage")
public R<Page<TaskArchivingPagVo>> getTaskArchivingPage(@ApiParam(value = "主体")
String subject, @ApiParam(value = "任务内容")
String taskContent, @RequestParam("isFinish") @ApiParam(value = "是否已归档", required = true)
Boolean isFinish) {
Page<TaskArchivingPagVo> page = taskService.getTaskArchivingPage(subject, taskContent, isFinish);
return R.ok(page);
}
/**
* 技术模块-任务归档-设置任务归档
* @author DB
* @param taskId 任务id
* @since 2023-11-30 21:49:05
*/
@PreAuthorize("@aps.hasPermission('oamTask:taskArchiving:update')")
@ApiOperation("技术模块-任务归档-设置任务归档")
@PutMapping("/setTaskArchiving/{taskId}")
public R<Void> setTaskArchiving(@PathVariable @ApiParam("任务id")
String taskId) {
taskService.setTaskArchiving(taskId);
return R.ok();
}
/**
* 技术模块-任务领取-获取领取任务分页
* @author DB
* @param subject 主体
* @param taskContent 任务内容
* @param toBeEvaluated 是否待评估
* @since 2023-11-30 22:21:58
*/
@PreAuthorize("@aps.hasPermission('oamTask:task:list')") @PreAuthorize("@aps.hasPermission('oamTask:task:list')")
@ApiOperation("任务分页列表") @ApiOperation("技术模块-任务领取-获取领取任务分页")
@GetMapping("/getTaskPage") @GetMapping("/getToBeClaimedPage")
public R<Page<TaskPageVo>> getTaskPage(TaskPageBo bo) { public R<Page<TaskToBeClaimedPageVo>> getToBeClaimedPage(@ApiParam(value = "主体")
Page<TaskPageVo> list = taskService.getTaskPage(bo); String subject, @ApiParam(value = "任务内容")
String taskContent, @RequestParam("toBeEvaluated") @ApiParam(value = "是否待评估", required = true)
Boolean toBeEvaluated) {
Page<TaskToBeClaimedPageVo> list = taskService.getToBeClaimedPage(subject, taskContent, toBeEvaluated);
return R.ok(list); return R.ok(list);
} }
/** /**
* @Description: OAM-新增迭代任务 * 技术模块-任务领取-新增迭代任务
* @param bo 请求参数 * @author DB
* @return: R<Void> * @param bo 请求
* @Author: DB * @since 2023-12-01 09:45:08
* @Date: 2023/5/16 15:58 */
**/ @PreAuthorize("@aps.hasPermission('oamTask:iterateTask:insert')")
@PreAuthorize("@aps.hasPermission('oamTask:task:insert')") @ApiOperation("技术模块-任务领取-新增迭代任务")
@ApiOperation("新增迭代任务")
@PostMapping("/insertIterationTask") @PostMapping("/insertIterationTask")
public R<Void> insertIterationTask(@RequestBody @Validated TaskBo bo) { public R<Void> insertIterationTask(@RequestBody @Validated
taskService.insertTask(bo); TaskIterationBo bo) {
taskService.insertIterationTask(bo);
return R.ok(); return R.ok();
} }
/** /**
* @Description: 查询OAM-任务审核分页列表 * 技术模块-任务领取-技术人员领取任务
* @return: R<Page<OamTaskAuditPageVo>> * @author DB
* @Author: DB * @param id 任务id
* @Date: 2023/5/16 15:24 * @since 2023-12-01 10:15:28
**/ */
@PreAuthorize("@aps.hasPermission('oamTask:taskAudit:list')") @PreAuthorize("@aps.hasPermission('oamTask:iterateTask:update')")
@ApiOperation("任务审核分页列表") @ApiOperation("技术模块-任务领取-技术人员领取任务")
@GetMapping("/getTaskAuditPage")
public R<Page<TaskAuditPageVo>> getTaskAuditPage() {
Page<TaskAuditPageVo> list = taskService.getTaskAuditPage();
return R.ok(list);
}
/**
* @Description: 设置任务审核意见
* @param bo 请求参数
* @return: R<Void>
* @Author: DB
* @Date: 2023/5/16 17:36
**/
@PreAuthorize("@aps.hasPermission('oamTask:taskAudit:update')")
@ApiOperation("设置任务审核意见")
@PutMapping("/setTaskAuditComments")
public R<Void> setTaskAuditComments(@RequestBody TaskAuditCommentsBo bo) {
taskService.setTaskAuditComments(bo);
return R.ok();
}
/**
* @Description: 查询OAM-任务审核驳回列表
* @return: R<Page<OamTaskAuditPageVo>>
* @Author: DB
* @Date: 2023/5/16 15:24
**/
@PreAuthorize("@aps.hasPermission('oamTask:taskAudit:list')")
@ApiOperation("任务审核驳回列表")
@GetMapping("/getTaskRejectPage")
public R<Page<TaskAuditPageVo>> getTaskRejectPage() {
Page<TaskAuditPageVo> list = taskService.getTaskRejectPage();
return R.ok(list);
}
/**
* @Description: 技术人员领取任务
* @param id 任务主键
* @return: R<Void>
* @Author: DB
* @Date: 2023/5/16 17:10
**/
@PreAuthorize("@aps.hasPermission('oamTask:task:update')")
@ApiOperation("技术人员领取任务")
@PutMapping("/claimTask/{id}") @PutMapping("/claimTask/{id}")
public R<Void> claimTask(@PathVariable String id) { public R<Void> claimTask(@PathVariable @ApiParam("任务id")
String id) {
taskService.claimTask(id); taskService.claimTask(id);
return R.ok(); return R.ok();
} }
/**
* 技术模块-任务领取-任务审核
* @author DB
* @param bo 请求参数
* @since 2023-12-01 10:35:31
*/
@PreAuthorize("@aps.hasPermission('oamTask:taskAudit:update')")
@ApiOperation("技术模块-任务领取-任务审核")
@PutMapping("/setTaskAuditComments")
public R<Void> setTaskAuditComments(@RequestBody @Validated
TaskAuditCommentsBo bo) {
taskService.setTaskAuditComments(bo);
return R.ok();
}
/** /**
* @Description: 删除任务 * @Description: 删除任务
* @param id 主键 * @param id 主键
@ -136,7 +191,8 @@ public class TaskController {
@PreAuthorize("@aps.hasPermission('oamTask:task:remove')") @PreAuthorize("@aps.hasPermission('oamTask:task:remove')")
@ApiOperation("删除任务") @ApiOperation("删除任务")
@DeleteMapping("/removeTask/{id}") @DeleteMapping("/removeTask/{id}")
public R<Void> removeTask(@PathVariable String id) { public R<Void> removeTask(@PathVariable
String id) {
taskService.removeById(id); taskService.removeById(id);
return R.ok(); return R.ok();
} }
@ -163,7 +219,8 @@ public class TaskController {
**/ **/
@ApiOperation("任务成员组列表") @ApiOperation("任务成员组列表")
@GetMapping("/getTaskStaffGroupList") @GetMapping("/getTaskStaffGroupList")
public R<List<TaskStaffGroupVo>> getTaskStaffGroupList(@Validated TaskStaffGroupListBo bo) { public R<List<TaskStaffGroupVo>> getTaskStaffGroupList(@Validated
TaskStaffGroupListBo bo) {
List<TaskStaffGroupVo> list = taskStaffGroupService.getTaskStaffGroupList(bo); List<TaskStaffGroupVo> list = taskStaffGroupService.getTaskStaffGroupList(bo);
return R.ok(list); return R.ok(list);
} }
@ -190,7 +247,8 @@ public class TaskController {
**/ **/
@ApiOperation("新增任务小组成员") @ApiOperation("新增任务小组成员")
@PostMapping("/insertTaskStaffGroup") @PostMapping("/insertTaskStaffGroup")
public R<Void> insertTaskStaffGroup(@RequestBody @Validated TaskStaffGroupBo bo) { public R<Void> insertTaskStaffGroup(@RequestBody @Validated
TaskStaffGroupBo bo) {
taskStaffGroupService.insertTaskStaffGroup(bo); taskStaffGroupService.insertTaskStaffGroup(bo);
return R.ok(); return R.ok();
} }
@ -204,7 +262,8 @@ public class TaskController {
**/ **/
@ApiOperation("修改员工任务绩点") @ApiOperation("修改员工任务绩点")
@PutMapping("/updateStaffGradePoint") @PutMapping("/updateStaffGradePoint")
public R<Void> updateStaffGradePoint(@RequestBody @Validated TaskStaffGroupBo bo) { public R<Void> updateStaffGradePoint(@RequestBody @Validated
TaskStaffGroupBo bo) {
taskStaffGroupService.updateStaffGradePoint(bo); taskStaffGroupService.updateStaffGradePoint(bo);
return R.ok(); return R.ok();
} }
@ -218,7 +277,8 @@ public class TaskController {
**/ **/
@ApiOperation("删除成员组") @ApiOperation("删除成员组")
@DeleteMapping("/removeTaskStaffGroup/{id}") @DeleteMapping("/removeTaskStaffGroup/{id}")
public R<Void> removeTaskStaffGroup(@PathVariable String id) { public R<Void> removeTaskStaffGroup(@PathVariable
String id) {
taskStaffGroupService.removeTaskStaffGroupById(id); taskStaffGroupService.removeTaskStaffGroupById(id);
return R.ok(); return R.ok();
} }
@ -232,7 +292,8 @@ public class TaskController {
**/ **/
@ApiOperation("修改任务进度") @ApiOperation("修改任务进度")
@PutMapping("/updateTaskItem") @PutMapping("/updateTaskItem")
public R<Void> updateTaskItem(@RequestBody @Validated TaskItemBo bo) { public R<Void> updateTaskItem(@RequestBody @Validated
TaskItemBo bo) {
taskService.updateTaskItem(bo); taskService.updateTaskItem(bo);
return R.ok(); return R.ok();
} }
@ -246,7 +307,8 @@ public class TaskController {
**/ **/
@ApiOperation("修改任务负责人") @ApiOperation("修改任务负责人")
@PutMapping("/updateTaskResponsibleStaff") @PutMapping("/updateTaskResponsibleStaff")
public R<Void> updateTaskResponsibleStaff(@RequestBody @Validated TransferTaskBo bo) { public R<Void> updateTaskResponsibleStaff(@RequestBody @Validated
TransferTaskBo bo) {
taskService.updateTaskResponsibleStaff(bo); taskService.updateTaskResponsibleStaff(bo);
return R.ok(); return R.ok();
} }
@ -261,7 +323,8 @@ public class TaskController {
@PreAuthorize("@aps.hasPermission('oamTask:task:update')") @PreAuthorize("@aps.hasPermission('oamTask:task:update')")
@ApiOperation("完成任务") @ApiOperation("完成任务")
@PutMapping("/finishTask/{id}") @PutMapping("/finishTask/{id}")
public R<Void> finishTask(@PathVariable String id) { public R<Void> finishTask(@PathVariable
String id) {
taskService.finishTask(id); taskService.finishTask(id);
return R.ok(); return R.ok();
} }

View File

@ -33,7 +33,7 @@ import static com.cpop.system.business.entity.table.StoreTableDef.STORE;
* @since 2023-09-18 * @since 2023-09-18
*/ */
@RestController @RestController
@Api(tags = "工单模块") @Api(tags = "工单模块-工单")
@RequestMapping("/taskWorkOrder") @RequestMapping("/taskWorkOrder")
public class TaskWorkOrderController { public class TaskWorkOrderController {
@ -202,12 +202,10 @@ public class TaskWorkOrderController {
} }
/** /**
* @descriptions 任务管理模块-工单管理-获取品牌列表 * 任务管理模块-工单管理-获取品牌列表
* @author DB * @author DB
* @date 2023/11/28 12:34 * @param brandName 品牌名
* @param brandName * @since 2023-11-30 17:59:29
* 品牌名
* @return: com.cpop.core.base.R<java.util.List<com.cpop.jambox.business.vo.BrandListVo>>
*/ */
@ApiOperation("工单模块-工单提交-获取品牌列表") @ApiOperation("工单模块-工单提交-获取品牌列表")
@GetMapping("/getBrandList") @GetMapping("/getBrandList")
@ -219,12 +217,10 @@ public class TaskWorkOrderController {
} }
/** /**
* @descriptions 任务管理模块-工单管理-获取校区/店铺列表 * 工单模块-工单提交-获取校区/店铺列表
* @author DB * @author DB
* @date 2023/11/28 12:38 * @param brandId 品牌id
* @param brandId * @since 2023-11-30 18:00:08
* 品牌id
* @return: com.cpop.core.base.R<java.util.List<com.cpop.oam.business.vo.StoreListVo>>
*/ */
@ApiOperation("工单模块-工单提交-获取校区/店铺列表") @ApiOperation("工单模块-工单提交-获取校区/店铺列表")
@GetMapping("/getStoreList") @GetMapping("/getStoreList")

View File

@ -30,13 +30,17 @@ public class WxCpPortalController {
private OamWxCpService oamWxCpService; private OamWxCpService oamWxCpService;
@GetMapping(produces = "text/plain;charset=utf-8") @GetMapping(produces = "text/plain;charset=utf-8")
public String authGet(@PathVariable Integer agentId, public String authGet(@PathVariable
@RequestParam(name = "msg_signature", required = false) String signature, Integer agentId, @RequestParam(name = "msg_signature", required = false)
@RequestParam(name = "timestamp", required = false) String timestamp, String signature, @RequestParam(name = "timestamp", required = false)
@RequestParam(name = "nonce", required = false) String nonce, String timestamp, @RequestParam(name = "nonce", required = false)
@RequestParam(name = "echostr", required = false) String echostr) { String nonce, @RequestParam(name = "echostr", required = false)
String echostr) {
this.logger.info("\n接收到来自微信服务器的认证消息signature = [{}], timestamp = [{}], nonce = [{}], echostr = [{}]", this.logger.info("\n接收到来自微信服务器的认证消息signature = [{}], timestamp = [{}], nonce = [{}], echostr = [{}]",
signature, timestamp, nonce, echostr); signature,
timestamp,
nonce,
echostr);
if (StringUtils.isAnyBlank(signature, timestamp, nonce, echostr)) { if (StringUtils.isAnyBlank(signature, timestamp, nonce, echostr)) {
throw new IllegalArgumentException("请求参数非法,请核实!"); throw new IllegalArgumentException("请求参数非法,请核实!");
} }
@ -51,17 +55,21 @@ public class WxCpPortalController {
} }
@PostMapping(produces = "application/xml; charset=UTF-8") @PostMapping(produces = "application/xml; charset=UTF-8")
public String post(@PathVariable Integer agentId, public String post(@PathVariable
@RequestBody String requestBody, Integer agentId, @RequestBody
@RequestParam("msg_signature") String signature, String requestBody, @RequestParam("msg_signature")
@RequestParam("timestamp") String timestamp, String signature, @RequestParam("timestamp")
@RequestParam("nonce") String nonce) { String timestamp, @RequestParam("nonce")
String nonce) {
this.logger.info("\n接收微信请求[signature=[{}], timestamp=[{}], nonce=[{}], requestBody=[\n{}\n] ", this.logger.info("\n接收微信请求[signature=[{}], timestamp=[{}], nonce=[{}], requestBody=[\n{}\n] ",
signature, timestamp, nonce, requestBody); signature,
timestamp,
nonce,
requestBody);
final WxCpService wxCpService = WxCpConfiguration.getCpService(agentId); final WxCpService wxCpService = WxCpConfiguration.getCpService(agentId);
WxCpXmlMessage inMessage = WxCpXmlMessage.fromEncryptedXml(requestBody, wxCpService.getWxCpConfigStorage(), WxCpXmlMessage inMessage = WxCpXmlMessage
timestamp, nonce, signature); .fromEncryptedXml(requestBody, wxCpService.getWxCpConfigStorage(), timestamp, nonce, signature);
this.logger.debug("\n消息解密后内容为\n{} ", JsonUtils.toJson(inMessage)); this.logger.debug("\n消息解密后内容为\n{} ", JsonUtils.toJson(inMessage));
WxCpXmlOutMessage outMessage = this.route(agentId, inMessage); WxCpXmlOutMessage outMessage = this.route(agentId, inMessage);
if (outMessage == null) { if (outMessage == null) {
@ -82,18 +90,18 @@ public class WxCpPortalController {
} }
/** /**
* @descriptions 企微的o2认证可查询用户敏感信息 * 企微的o2认证可查询用户敏感信息
* @author DB * @author DB
* @date 2023/11/17 14:42 * @since 2023/11/17 14:42
* @param agentId 企业微信服务应用id * @param agentId 企业微信服务应用id
* @param code 授权码 * @param code 授权码
* @param state 信息 注册 * @param state 信息 注册
* @return: java.lang.String
*/ */
@GetMapping(produces = "text/plain;charset=utf-8", value = "/registerCode") @GetMapping(produces = "text/plain;charset=utf-8", value = "/registerCode")
public void registerCode(@PathVariable Integer agentId, public void registerCode(@PathVariable
@RequestParam("code") String code, Integer agentId, @RequestParam("code")
@RequestParam("state") String state) { String code, @RequestParam("state")
String state) {
oamWxCpService.registerCode(agentId, code); oamWxCpService.registerCode(agentId, code);
} }

View File

@ -10,8 +10,8 @@ import lombok.*;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
import java.sql.Date;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.LocalDate;
/** /**
* OAM-任务表 实体类 * OAM-任务表 实体类
@ -34,11 +34,6 @@ public class Task extends BaseEntity implements Serializable {
@Id @Id
private String id; private String id;
/**
* 任务名
*/
private String taskName;
/** /**
* 任务类型(0:迭代;1:需求;2:投诉/工单) * 任务类型(0:迭代;1:需求;2:投诉/工单)
*/ */
@ -50,7 +45,7 @@ public class Task extends BaseEntity implements Serializable {
private String responsibleStaffId; private String responsibleStaffId;
/** /**
* 任务状态(-1:失败;0:待审核;1:待接受;2:进行中;3:已完成;4:逾期;5:暂停;6:逾期完成;7:接收超时) * 任务状态(-1:失败;0:待审核;1:待接受;2:进行中;3:已完成;4:逾期;5:暂停;6:逾期完成;7:接收超时;8:待部署;9:待归档)
*/ */
private Integer taskStatus; private Integer taskStatus;
@ -84,21 +79,42 @@ public class Task extends BaseEntity implements Serializable {
*/ */
private String remark; private String remark;
/**
* 是否加急
*/
private Integer isUrgent;
/** /**
* 预期完成日期 * 预期完成日期
*/ */
private Date expectedCompletionDate; private LocalDate expectedCompletionDate;
/** /**
* 完成日期 * 完成日期
*/ */
private Date completionDate; private LocalDate completionDate;
/** /**
* 任务接收时间 * 任务接收时间
*/ */
private LocalDateTime taskReceiptTime; private LocalDateTime taskReceiptTime;
/**主体 */
private String subject;
/**测试转部署文件 */
private String testToFinishUrl;
/**
* 转测试时间
*/
private LocalDateTime toTestTime;
/**
* 转部署时间
*/
private LocalDateTime toFinishTime;
/** /**
* 是否删除(0否1是) * 是否删除(0否1是)
*/ */

View File

@ -38,11 +38,6 @@ public class TaskDemand extends BaseEntity implements Serializable {
*/ */
private String taskId; private String taskId;
/**
* 商户id
*/
private String mechanismId;
/** /**
* 品牌id * 品牌id
*/ */
@ -51,12 +46,7 @@ public class TaskDemand extends BaseEntity implements Serializable {
/** /**
* 校区id * 校区id
*/ */
private String campusId; private String storeId;
/**
* 需求类型(0:;1:;2:;3:)
*/
private Integer demandType;
/** /**
* 记录员工id * 记录员工id
@ -83,10 +73,6 @@ public class TaskDemand extends BaseEntity implements Serializable {
*/ */
private BigDecimal payable; private BigDecimal payable;
/** /**
* 是否删除(0否1是) * 是否删除(0否1是)
*/ */

View File

@ -16,20 +16,34 @@ import com.cpop.oam.business.vo.TaskDemandPageVo;
public interface TaskDemandService extends IService<TaskDemand> { public interface TaskDemandService extends IService<TaskDemand> {
/** /**
* @Description: 任务管理-需求管理分页列表 * 工单模块-需求-需求分页列表
* @param bo 请求参数 * @author DB
* @return: R<PageVo<DemandPageListVo>> * @param bo 查询参数
* @Author: DB * @since 2023-11-30 17:26:24
* @Date: 2023/5/30 15:44 */
**/
Page<TaskDemandPageVo> getTaskDemandPage(TaskDemandPageBo bo); Page<TaskDemandPageVo> getTaskDemandPage(TaskDemandPageBo bo);
/** /**
* @Description: 任务管理-需求管理-新增需求任务 * 工单模块-需求-新增需求
* @author DB
* @param bo 请求参数 * @param bo 请求参数
* @return: R<Void> * @since 2023-11-30 17:27:24
* @Author: DB */
* @Date: 2023/5/30 16:53
**/
void insertTaskDemand(TaskDemandBo bo); void insertTaskDemand(TaskDemandBo bo);
/**
* 工单模块-需求-修改需求
* @author DB
* @param bo 请求参数
* @since 2023-11-30 18:26:42
*/
void updateDemandTask(TaskDemandBo bo);
/**
* 工单模块-需求-删除需求
* @author DB
* @param demandId 需求id
* @since 2023-11-30 20:30:54
*/
void removeDemandTask(String demandId);
} }

View File

@ -1,13 +1,13 @@
package com.cpop.oam.business.service; package com.cpop.oam.business.service;
import com.cpop.oam.business.vo.TaskArchivingPagVo;
import com.cpop.oam.business.vo.TaskToBeClaimedPageVo;
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.*; import com.cpop.oam.business.bo.*;
import com.cpop.oam.business.entity.Task; import com.cpop.oam.business.entity.Task;
import com.cpop.oam.business.vo.PersonTaskPageVo; import com.cpop.oam.business.vo.PersonTaskPageVo;
import com.cpop.oam.business.vo.TaskAuditPageVo;
import com.cpop.oam.business.vo.TaskMonthStatisticsVo; import com.cpop.oam.business.vo.TaskMonthStatisticsVo;
import com.cpop.oam.business.vo.TaskPageVo;
/** /**
* OAM-任务表 服务层 * OAM-任务表 服务层
@ -18,57 +18,56 @@ import com.cpop.oam.business.vo.TaskPageVo;
public interface TaskService extends IService<Task> { public interface TaskService extends IService<Task> {
/** /**
* @Description: 查询OAM-任务分页列表 * 技术模块-任务归档-获取任务归档分页
* @param bo 请求参数 * @author DB
* @return: R<PageVo<PersonTaskPageListVo>> * @param subject 主体
* @Author: DB * @param taskContent 任务内容
* @Date: 2023/5/16 15:24 * @since 2023-11-30 21:11:47
**/ */
Page<TaskPageVo> getTaskPage(TaskPageBo bo); Page<TaskArchivingPagVo> getTaskArchivingPage(String subject, String taskContent, Boolean isFinish);
/** /**
* @Description: OAM-新增任务 * 技术模块-任务归档-设置任务归档
* @param bo 请求参数 * @author DB
* @return: R<Void> * @param taskId 任务id
* @Author: DB * @since 2023-11-30 21:49:05
* @Date: 2023/5/16 15:58 */
**/ void setTaskArchiving(String taskId);
void insertTask(TaskBo bo);
/** /**
* @Description: 查询OAM-任务审核分页列表 * 技术模块-任务领取-获取领取任务分页
* @return: R<Page<OamTaskAuditPageVo>> * @author DB
* @Author: DB * @param subject 主体
* @Date: 2023/5/16 15:24 * @param taskContent 任务内容
**/ * @param toBeEvaluated 是否待评估
Page<TaskAuditPageVo> getTaskAuditPage(); * @since 2023-11-30 22:21:58
*/
Page<TaskToBeClaimedPageVo> getToBeClaimedPage(String subject, String taskContent, Boolean toBeEvaluated);
/** /**
* @Description: 设置任务审核意见 * 技术模块-任务领取-新增迭代任务
* @param bo 请求参数 * @author DB
* @return: R<Void> * @param bo 请求
* @Author: DB * @since 2023-12-01 09:45:08
* @Date: 2023/5/16 17:36 */
**/ void insertIterationTask(TaskIterationBo bo);
void setTaskAuditComments(TaskAuditCommentsBo bo);
/** /**
* @Description: 查询OAM-任务审核驳回列表 * 技术模块-任务领取-技术人员领取任务
* @return: R<Page<OamTaskAuditPageVo>> * @author DB
* @Author: DB * @param id 任务id
* @Date: 2023/5/16 15:24 * @since 2023-12-01 10:15:28
**/ */
Page<TaskAuditPageVo> getTaskRejectPage();
/**
* @Description: 技术人员领取任务
* @param id 任务主键
* @return: R<Void>
* @Author: DB
* @Date: 2023/5/16 17:10
**/
void claimTask(String id); void claimTask(String id);
/**
* 技术模块-任务领取-任务审核
* @author DB
* @param bo 请求参数
* @since 2023-12-01 10:35:31
*/
void setTaskAuditComments(TaskAuditCommentsBo bo);
/** /**
* @Description: 查询OAM-个人任务分页列表 * @Description: 查询OAM-个人任务分页列表
* @return: R<PageVo<PersonTaskPageListVo>> * @return: R<PageVo<PersonTaskPageListVo>>
@ -112,4 +111,5 @@ public interface TaskService extends IService<Task> {
* @Date: 2023/5/15 16:42 * @Date: 2023/5/15 16:42
**/ **/
TaskMonthStatisticsVo getTaskMonthStatistics(TaskMonthStatisticsBo bo); TaskMonthStatisticsVo getTaskMonthStatistics(TaskMonthStatisticsBo bo);
} }

View File

@ -12,11 +12,4 @@ import com.cpop.oam.business.entity.TaskWorkOrderRecord;
*/ */
public interface TaskWorkOrderRecordService extends IService<TaskWorkOrderRecord> { public interface TaskWorkOrderRecordService extends IService<TaskWorkOrderRecord> {
/**
* @descriptions 新增任务-工单-记录
* @author DB
* @date 2023/09/18 17:31
* @param orderRecordDto 请求参数
*/
void insertTaskWorkOrderRecord(TaskWorkOrderRecordDto orderRecordDto);
} }

View File

@ -1,5 +1,6 @@
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.TaskWorkOrderReceiveDealPauseVo; import com.cpop.oam.business.vo.TaskWorkOrderReceiveDealPauseVo;
import com.cpop.oam.business.vo.WorkOrderDutyVo; import com.cpop.oam.business.vo.WorkOrderDutyVo;
import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.paginate.Page;
@ -108,4 +109,10 @@ public interface TaskWorkOrderService extends IService<TaskWorkOrder> {
*/ */
void workOrderFinish(String workOrderId); void workOrderFinish(String workOrderId);
/**
* 技术模块-技术-获取个人工单列表
* @author DB
* @since 2023-11-30 19:41:32
*/
List<TaskWorkOrderPersonVo> getPersonWorkOrder();
} }

View File

@ -13,6 +13,7 @@ import com.cpop.oam.business.service.CommonService;
import com.cpop.oam.business.vo.ConfigInfoVo; import com.cpop.oam.business.vo.ConfigInfoVo;
import com.cpop.oam.framework.constant.OamConfigKey; import com.cpop.oam.framework.constant.OamConfigKey;
import com.cpop.oam.framework.enums.OamConfigEnum; import com.cpop.oam.framework.enums.OamConfigEnum;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
@ -42,7 +43,7 @@ public class CommonServiceImpl implements CommonService {
*/ */
@Override @Override
public void loadingConfigCache() { public void loadingConfigCache() {
List<String> keys = Arrays.asList(OamConfigKey.WORK_WX_INFO); String[] keys = ArrayUtils.addAll(OamConfigKey.WORK_WX_INFO, OamConfigKey.DEMAND_TO_TASK);
// 加载OAM配置参数 // 加载OAM配置参数
List<SysConfig> configsList = DbChain.table(SYS_CONFIG) List<SysConfig> configsList = DbChain.table(SYS_CONFIG)
.select(SYS_CONFIG.ALL_COLUMNS) .select(SYS_CONFIG.ALL_COLUMNS)
@ -50,7 +51,8 @@ public class CommonServiceImpl implements CommonService {
.listAs(SysConfig.class); .listAs(SysConfig.class);
if (!configsList.isEmpty()) { if (!configsList.isEmpty()) {
for (SysConfig config : configsList) { for (SysConfig config : configsList) {
SpringUtils.getBean(RedisService.class).setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); SpringUtils.getBean(RedisService.class)
.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
} }
} }
} }
@ -139,13 +141,16 @@ public class CommonServiceImpl implements CommonService {
.setConfigKey(sysConfigEnum.getKey()) .setConfigKey(sysConfigEnum.getKey())
.setConfigValue(field.get(bo).toString()); .setConfigValue(field.get(bo).toString());
// 修改 // 修改
if (DbChain.table(SYS_CONFIG).where(SYS_CONFIG.CONFIG_KEY.eq(sysConfig.getConfigKey())).count() > 0) { if (DbChain.table(SYS_CONFIG)
.where(SYS_CONFIG.CONFIG_KEY.eq(sysConfig.getConfigKey()))
.count() > 0) {
coreService.updateConfig(sysConfig); coreService.updateConfig(sysConfig);
} else { } else {
coreService.insertConfig(sysConfig); coreService.insertConfig(sysConfig);
} }
// 更新缓存 // 更新缓存
SpringUtils.getBean(RedisService.class).setCacheObject(getCacheKey(sysConfigEnum.getKey()), sysConfig.getConfigValue()); SpringUtils.getBean(RedisService.class)
.setCacheObject(getCacheKey(sysConfigEnum.getKey()), sysConfig.getConfigValue());
} }
} }
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {

View File

@ -64,16 +64,21 @@ public class OamWxCpServiceImpl implements OamWxCpService {
// 获取所有数据 // 获取所有数据
List<WxCpDepart> list = cpService.getDepartmentService().list(null); List<WxCpDepart> list = cpService.getDepartmentService().list(null);
// 过滤出最顶级部门 // 过滤出最顶级部门
WxCpDepart wxCpDepart = list.stream().filter(item -> item.getParentId() == 0).collect(Collectors.toList()).get(0); WxCpDepart wxCpDepart =
list.stream().filter(item -> item.getParentId() == 0).collect(Collectors.toList()).get(0);
// 先存 // 先存
Dept dept = new Dept(); Dept dept = new Dept();
dept.setWxCpId(wxCpDepart.getId()).setWxCpParentId(wxCpDepart.getParentId()).setOrderNo(wxCpDepart.getOrder().intValue()).setName(wxCpDepart.getName()); dept.setWxCpId(wxCpDepart.getId())
.setWxCpParentId(wxCpDepart.getParentId())
.setOrderNo(wxCpDepart.getOrder().intValue())
.setName(wxCpDepart.getName());
if (wxCpDepart.getDepartmentLeader().length > 0) { if (wxCpDepart.getDepartmentLeader().length > 0) {
dept.setLeader(wxCpDepart.getDepartmentLeader()[0]); dept.setLeader(wxCpDepart.getDepartmentLeader()[0]);
} }
SpringUtils.getBean(DeptService.class).save(dept); SpringUtils.getBean(DeptService.class).save(dept);
// 递归保存余下部门 // 递归保存余下部门
List<WxCpDepart> filterWxDeptList = list.stream().filter(item -> item.getParentId() != 0).collect(Collectors.toList()); List<WxCpDepart> filterWxDeptList =
list.stream().filter(item -> item.getParentId() != 0).collect(Collectors.toList());
recursionSonDept(filterWxDeptList, dept); recursionSonDept(filterWxDeptList, dept);
} catch (WxErrorException e) { } catch (WxErrorException e) {
throw new ServiceException(e.getMessage()); throw new ServiceException(e.getMessage());
@ -96,7 +101,11 @@ public class OamWxCpServiceImpl implements OamWxCpService {
if (next.getParentId().equals(parentDept.getWxCpId())) { if (next.getParentId().equals(parentDept.getWxCpId())) {
// 先存 // 先存
Dept dept = new Dept(); Dept dept = new Dept();
dept.setWxCpId(next.getId()).setWxCpParentId(next.getParentId()).setOrderNo(next.getOrder().intValue()).setParentId(parentDept.getId()).setName(next.getName()); dept.setWxCpId(next.getId())
.setWxCpParentId(next.getParentId())
.setOrderNo(next.getOrder().intValue())
.setParentId(parentDept.getId())
.setName(next.getName());
deptList.add(dept); deptList.add(dept);
iterator.remove(); iterator.remove();
} }
@ -144,10 +153,12 @@ public class OamWxCpServiceImpl implements OamWxCpService {
}); });
SpringUtils.getBean(StaffService.class).saveBatch(staffList); SpringUtils.getBean(StaffService.class).saveBatch(staffList);
// 获取所有部门信息 // 获取所有部门信息
List<Dept> deptList = SpringUtils.getBean(DeptService.class).queryChain().where(DEPT.WX_CP_ID.isNotNull()).list(); List<Dept> deptList =
SpringUtils.getBean(DeptService.class).queryChain().where(DEPT.WX_CP_ID.isNotNull()).list();
// 部门id映射 // 部门id映射
Map<Long, String> deptMap = deptList.stream().collect(Collectors.toMap(Dept::getWxCpId, Dept::getId)); Map<Long, String> deptMap = deptList.stream().collect(Collectors.toMap(Dept::getWxCpId, Dept::getId));
Map<String, String> userIdToStaffIdMap = staffList.stream().collect(Collectors.toMap(Staff::getUserId, Staff::getId)); Map<String, String> userIdToStaffIdMap =
staffList.stream().collect(Collectors.toMap(Staff::getUserId, Staff::getId));
List<StaffMidDept> staffMidDeptList = new ArrayList<>(); List<StaffMidDept> staffMidDeptList = new ArrayList<>();
// 批量创建用户 // 批量创建用户
userWxCpUserMap.forEach((key, value) -> { userWxCpUserMap.forEach((key, value) -> {
@ -182,8 +193,10 @@ public class OamWxCpServiceImpl implements OamWxCpService {
String wxCpUserId = userInfo.getUserId(); String wxCpUserId = userInfo.getUserId();
// 查询用户信息 // 查询用户信息
Row row = Db.selectOneByQuery("cp_sys_user", Row row = Db.selectOneByQuery("cp_sys_user",
QueryWrapper.create().select(SYS_USER.ALL_COLUMNS) QueryWrapper.create()
.leftJoin(STAFF).on(STAFF.USER_ID.eq(SYS_USER.ID)) .select(SYS_USER.ALL_COLUMNS)
.leftJoin(STAFF)
.on(STAFF.USER_ID.eq(SYS_USER.ID))
.where(STAFF.WX_CP_USER_ID.eq(wxCpUserId))); .where(STAFF.WX_CP_USER_ID.eq(wxCpUserId)));
if (null == row) { if (null == row) {
throw new ServiceException("请先在企微上的Oam应用中进行注册"); throw new ServiceException("请先在企微上的Oam应用中进行注册");
@ -243,13 +256,24 @@ public class OamWxCpServiceImpl implements OamWxCpService {
} }
String encrypt = SpringUtils.getBean(RsaUtils.class).encrypt(userDetail.getMobile()); String encrypt = SpringUtils.getBean(RsaUtils.class).encrypt(userDetail.getMobile());
// 读取用户通用信息 // 读取用户通用信息
staffBo.setUserName(userDetail.getMobile()).setName(wxCpUser.getName()).setNickName(wxCpUser.getAlias()).setAvatar(userDetail.getAvatar()).setEmail(userDetail.getBizMail()).setPhoneNumber(userDetail.getMobile()) staffBo.setUserName(userDetail.getMobile())
.setSex(!StringUtils.equals(userDetail.getGender(), "1")).setStatus(true).setStaffType(2).setWxCpUserId(wxCpUser.getUserId()) .setName(wxCpUser.getName())
.setNickName(wxCpUser.getAlias())
.setAvatar(userDetail.getAvatar())
.setEmail(userDetail.getBizMail())
.setPhoneNumber(userDetail.getMobile())
.setSex(!StringUtils.equals(userDetail.getGender(), "1"))
.setStatus(true)
.setStaffType(StringUtils.equals(wxCpUser.getMainDepartment(), "5") ? 0 : 1)
.setWxCpUserId(wxCpUser.getUserId())
// 密码默认为手机号 // 密码默认为手机号
.setPassword(encrypt) .setPassword(encrypt)
// 设置部门 // 设置部门
.setDeptId(deptIds) .setDeptId(deptIds)
.setRoleId(InitRoleEnum.WX_CP_INIT_ROLE.getId()); // 区分技术员工和运营员工
.setRoleId(StringUtils.equals(wxCpUser.getMainDepartment(), "5")
? InitRoleEnum.WX_CP_INIT_TECHNOLOGY_ROLE.getId()
: InitRoleEnum.WX_CP_INIT_OPERATION_ROLE.getId());
// 保存员工 // 保存员工
staffService.insertStaff(staffBo); staffService.insertStaff(staffBo);
} catch (WxErrorException e) { } catch (WxErrorException e) {

View File

@ -1,5 +1,6 @@
package com.cpop.oam.business.service.impl; package com.cpop.oam.business.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.cpop.api.tencent.wxWork.handler.WebHookSendHandler; import com.cpop.api.tencent.wxWork.handler.WebHookSendHandler;
import com.cpop.common.utils.StringUtils; import com.cpop.common.utils.StringUtils;
import com.cpop.common.utils.bean.BeanUtils; import com.cpop.common.utils.bean.BeanUtils;
@ -33,11 +34,13 @@ import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static com.cpop.core.base.table.table.SysUserTableDef.SYS_USER;
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.TaskDemandTableDef.TASK_DEMAND; import static com.cpop.oam.business.entity.table.TaskDemandTableDef.TASK_DEMAND;
import static com.cpop.oam.business.entity.table.TaskTableDef.TASK; import static com.cpop.oam.business.entity.table.TaskTableDef.TASK;
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 org.springframework.transaction.annotation.Transactional;
/** /**
* OAM-任务-需求表 服务层实现 * OAM-任务-需求表 服务层实现
@ -49,110 +52,188 @@ import static com.cpop.system.business.entity.table.StoreTableDef.STORE;
public class TaskDemandServiceImpl extends ServiceImpl<TaskDemandMapper, TaskDemand> implements TaskDemandService { public class TaskDemandServiceImpl extends ServiceImpl<TaskDemandMapper, TaskDemand> implements TaskDemandService {
/** /**
* @Description: 任务管理-需求管理分页列表 * 工单模块-需求-需求分页列表
* @param bo 请求参数 * @author DB
* @return: R<PageVo<DemandPageListVo>> * @param bo 查询参数
* @Author: DB * @since 2023-11-30 17:26:24
* @Date: 2023/5/30 15:44 */
**/
@Override @Override
public Page<TaskDemandPageVo> getTaskDemandPage(TaskDemandPageBo bo) { public Page<TaskDemandPageVo> getTaskDemandPage(TaskDemandPageBo bo) {
// 分页主体应该是任务 // 分页主体应该是任务
QueryWrapper queryWrapper = QueryWrapper.create(); QueryWrapper queryWrapper = QueryWrapper.create();
if (null != bo.getTaskStatus()) { if (null != bo.getTaskStatus()) {
if (bo.getTaskStatus() == 1) { switch (bo.getTaskStatus()) {
queryWrapper.and(TASK.TASK_STATUS.in(1, 2, 4)); // 待评估
} else { case 0:
queryWrapper.and(TASK.TASK_STATUS.eq(bo.getTaskStatus())); queryWrapper.and(TASK.TASK_STATUS.eq(0));
break;
// 待领取
case 1:
queryWrapper.and(TASK.TASK_STATUS.eq(1));
// 处理中
case 2:
queryWrapper.and(TASK.TASK_STATUS.in(2, 4));
break;
// 已完成
default:
queryWrapper.and(TASK.TASK_STATUS.in(3, 6));
} }
} else { } else {
queryWrapper.and(TASK.TASK_STATUS.eq(0)); queryWrapper.and(TASK.TASK_STATUS.eq(0));
} }
// 重新定义列表 // 重新定义列表
PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); PageDomain pageDomain = SqlUtils.getInstance().getPageDomain();
return SpringUtils.getBean(TaskService.class).getMapper().paginateAs(pageDomain.getPageNum(), pageDomain.getPageSize(), return this.mapper.paginateAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()),
queryWrapper.select(TASK.ALL_COLUMNS) queryWrapper
.select(TASK_DEMAND.DEMAND_TYPE.as(TaskDemandPageVo::getDemandType),TASK_DEMAND.RECORD_STAFF_ID,TASK_DEMAND.BRAND_ID,TASK_DEMAND.CAMPUS_ID) .select(TASK_DEMAND.ID,
.select(STORE.STORE_NAME.as(TaskDemandPageVo::getCampusName)) TASK_DEMAND.BRAND_ID,
.select(BRAND.BRAND_NAME.as(TaskDemandPageVo::getBrandName)) TASK_DEMAND.STORE_ID,
.select(STAFF.NAME.as(TaskDemandPageVo::getRecordStaffName)) TASK_DEMAND.RECORD_STAFF_ID,
.from(TASK) TASK_DEMAND.CREATE_TIME,
TASK_DEMAND.UPDATE_USER_ID,
TASK_DEMAND.UPDATE_TIME)
// 品牌
.select(BRAND.BRAND_NAME)
// 校区
.select(STORE.STORE_NAME)
// 任务
.select(TASK.TASK_CONTENT,
TASK.IS_URGENT,
TASK.ATTACHMENT_URL,
TASK.EXPECTED_COMPLETION_DATE,
TASK.TASK_RATING,
TASK.RESPONSIBLE_STAFF_ID,
TASK.TASK_RECEIPT_TIME,
TASK.COMPLETION_DATE,
TASK.TEST_TO_FINISH_URL)
.from(TASK_DEMAND)
// 任务需求表 // 任务需求表
.leftJoin(TASK_DEMAND).on(TASK_DEMAND.TASK_ID.eq(TASK.ID)) .leftJoin(TASK)
.on(TASK.ID.eq(TASK_DEMAND.TASK_ID))
// 校区表 // 校区表
.leftJoin(STORE).on(STORE.ID.eq(TASK_DEMAND.CAMPUS_ID)) .leftJoin(STORE)
.on(STORE.ID.eq(TASK_DEMAND.STORE_ID))
// 品牌表 // 品牌表
.leftJoin(BRAND).on(BRAND.ID.eq(STORE.BRAND_ID)) .leftJoin(BRAND)
//员工表 .on(BRAND.ID.eq(TASK_DEMAND.BRAND_ID))
.leftJoin(STAFF).on(STAFF.ID.eq(TASK_DEMAND.RECORD_STAFF_ID))
.where(TASK.TASK_TYPE.eq(1)) .where(TASK.TASK_TYPE.eq(1))
.and(TASK.TASK_NAME.like(bo.getTaskName())) .and(TASK.TASK_CONTENT.like(bo.getTaskContent()))
.and(STORE.STORE_NAME.like(bo.getCampusName())), .and(STORE.STORE_NAME.like(bo.getBrandOrStore()).or(BRAND.BRAND_NAME.like(bo.getBrandOrStore()))),
TaskDemandPageVo.class); TaskDemandPageVo.class,
// 记录员工名
item -> item.field(TaskDemandPageVo::getRecordStaffName)
.queryWrapper(recordStaffName -> queryWrapper.create()
.select(STAFF.NAME.as(TaskDemandPageVo::getRecordStaffName))
.from(STAFF)
.where(STAFF.ID.eq(recordStaffName.getRecordStaffId()))),
// 更新人员
item -> item.field(TaskDemandPageVo::getUpdateStaffName)
.queryWrapper(updateStaffName -> queryWrapper.create()
.select(STAFF.NAME.as(TaskDemandPageVo::getUpdateStaffName))
.from(STAFF)
.leftJoin(SYS_USER)
.on(SYS_USER.ID.eq(STAFF.USER_ID))
.where(SYS_USER.ID.eq(updateStaffName.getUpdateUserId()))
.and(SYS_USER.USER_TYPE.eq(UserType.OAM_USER.toString()))
.limit(1)),
// 任务接收员工
item -> item.field(TaskDemandPageVo::getResponsibleStaffName).queryWrapper(responsibleStaffName -> {
if (StringUtils.isNoneBlank(responsibleStaffName.getResponsibleStaffName())) {
return queryWrapper.create()
.select(STAFF.NAME.as(TaskDemandPageVo::getResponsibleStaffName))
.from(STAFF)
.where(STAFF.ID.eq(responsibleStaffName.getResponsibleStaffName()));
} else {
return null;
}
}));
} }
/** /**
* @Description: 任务管理-需求管理-新增需求任务 * 工单模块-需求-新增需求
* @author DB
* @param bo 请求参数 * @param bo 请求参数
* @return: R<Void> * @since 2023-11-30 17:27:24
* @Author: DB */
* @Date: 2023/5/30 16:53
**/
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void insertTaskDemand(TaskDemandBo bo) { public void insertTaskDemand(TaskDemandBo bo) {
// 添加任务 // 添加任务
Task task = BeanUtils.mapToClass(bo, Task.class); Task task = BeanUtils.mapToClass(bo, Task.class);
// 默认待审核 // 默认待审核
task.setTaskStatus(0); task.setTaskStatus(0).setTaskItem(0).setTaskType(1);
//默认开发中
task.setTaskItem(0);
TaskService taskService = SpringUtils.getBean(TaskService.class); TaskService taskService = SpringUtils.getBean(TaskService.class);
taskService.save(task); taskService.save(task);
// 添加需求 // 添加需求
TaskDemand entity = new TaskDemand(); TaskDemand entity = new TaskDemand();
BeanUtils.copyBeanProp(entity, bo); BeanUtils.copyBeanProp(entity, bo);
entity.setTaskId(task.getId()); entity.setTaskId(task.getId());
//当前操作员工是否是主要负责人不是抛出异常 // 当前操作员工
LoginUser loginUser = SecurityUtils.getInstance().getLoginUser(); JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo();
//读取员工信息 entity.setRecordStaffId(loginUserInfo.getString("id"));
RedisService redisService = SpringUtils.getBean(RedisService.class);
OamStaffLoginInfo loginInfo = redisService.getCacheObject(UserType.OAM_USER.getKey() + loginUser.getUsername());
entity.setRecordStaffId(loginInfo.getId());
this.save(entity); this.save(entity);
// 获取审核管理员手机号 // 获取审核管理员手机号
RedisService redisService = SpringUtils.getBean(RedisService.class);
String auditStaffPhone = redisService.getCacheObject(OamConfigEnum.AUDIT_STAFF_PHONE.getKey()); String auditStaffPhone = redisService.getCacheObject(OamConfigEnum.AUDIT_STAFF_PHONE.getKey());
if (StringUtils.isBlank(auditStaffPhone)) { if (StringUtils.isBlank(auditStaffPhone)) {
SysConfig sysConfig = SpringUtils.getBean(CoreService.class).selectConfigByKey(OamConfigEnum.AUDIT_STAFF_PHONE.getKey()); SysConfig sysConfig =
SpringUtils.getBean(CoreService.class).selectConfigByKey(OamConfigEnum.AUDIT_STAFF_PHONE.getKey());
auditStaffPhone = sysConfig.getConfigValue(); auditStaffPhone = sysConfig.getConfigValue();
redisService.setCacheObject(OamConfigEnum.AUDIT_STAFF_PHONE.getKey(), auditStaffPhone); redisService.setCacheObject(OamConfigEnum.AUDIT_STAFF_PHONE.getKey(), auditStaffPhone);
} }
if (StringUtils.isNotBlank(auditStaffPhone)) {
// 企微通知审核管理员 // 企微通知审核管理员
List<String> phoneList = new ArrayList<String>(); List<String> phoneList = new ArrayList<String>();
phoneList.add(auditStaffPhone); phoneList.add(auditStaffPhone);
// 同时通知发起人 // 同时通知发起人
if (StringUtils.isNotBlank(loginUser.getUser().getPhoneNumber())) { phoneList.add(loginUserInfo.getString("phoneNumber"));
phoneList.add(loginUser.getUser().getPhoneNumber());
}
String demandType;
switch (bo.getDemandType()) {
case 0:
demandType = "";
break;
case 1:
demandType = "";
break;
case 2:
demandType = "";
break;
default:
demandType = "";
}
try { try {
SpringUtils.getBean(WebHookSendHandler.class).webHookSendText(WebHookKeyConstant.ORDER_INFO_BOT, phoneList, "==========您有一条新的《" + demandType + "》需求任务需要审核==========", false); SpringUtils.getBean(WebHookSendHandler.class)
.webHookSendText(WebHookKeyConstant.ORDER_INFO_BOT,
phoneList,
"==========您有一条新的需求任务需要审核==========" + "\n" + task.getTaskContent(),
false);
} catch (IOException e) { } catch (IOException e) {
throw new ServiceException("发送消息通知失败!"); throw new ServiceException("发送需求任务消息通知失败!");
} }
} }
/**
* 工单模块-需求-修改需求
* @author DB
* @param bo 请求参数
* @since 2023-11-30 18:26:42
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void updateDemandTask(TaskDemandBo bo) {
TaskDemand taskDemand = this.getById(bo.getId());
// 更新需求
this.updateChain()
.set(TASK_DEMAND.BRAND_ID, bo.getBrandId())
.set(TASK_DEMAND.STORE_ID, bo.getStoreId())
.where(TASK_DEMAND.ID.eq(bo.getId()))
.update();
// 更新任务
SpringUtils.getBean(TaskService.class)
.updateChain()
.set(TASK.TASK_CONTENT, bo.getTaskContent())
.set(TASK.ATTACHMENT_URL, bo.getAttachmentUrl())
.where(TASK.ID.eq(taskDemand.getTaskId()))
.update();
}
/**
* 工单模块-需求-删除需求
* @author DB
* @param demandId 需求id
* @since 2023-11-30 20:30:54
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void removeDemandTask(String demandId) {
// 获取任务
TaskDemand demand = this.getById(demandId);
this.removeById(demandId);
SpringUtils.getBean(TaskService.class).removeById(demand.getTaskId());
} }
} }

View File

@ -1,6 +1,8 @@
package com.cpop.oam.business.service.impl; package com.cpop.oam.business.service.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cpop.oam.business.vo.TaskArchivingPagVo;
import com.cpop.oam.business.vo.TaskToBeClaimedPageVo;
import com.cpop.system.framework.ws.server.WebSocketServer; import com.cpop.system.framework.ws.server.WebSocketServer;
import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.core.query.QueryWrapper;
@ -30,9 +32,7 @@ import com.cpop.oam.business.service.StaffService;
import com.cpop.oam.business.service.TaskService; import com.cpop.oam.business.service.TaskService;
import com.cpop.oam.business.service.TaskStaffGroupService; import com.cpop.oam.business.service.TaskStaffGroupService;
import com.cpop.oam.business.vo.PersonTaskPageVo; import com.cpop.oam.business.vo.PersonTaskPageVo;
import com.cpop.oam.business.vo.TaskAuditPageVo;
import com.cpop.oam.business.vo.TaskMonthStatisticsVo; import com.cpop.oam.business.vo.TaskMonthStatisticsVo;
import com.cpop.oam.business.vo.TaskPageVo;
import com.cpop.oam.framework.constant.WebHookKeyConstant; import com.cpop.oam.framework.constant.WebHookKeyConstant;
import com.cpop.oam.framework.enums.OamConfigEnum; import com.cpop.oam.framework.enums.OamConfigEnum;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -51,8 +51,11 @@ import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
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.TaskDemandTableDef.TASK_DEMAND;
import static com.cpop.oam.business.entity.table.TaskStaffGroupTableDef.TASK_STAFF_GROUP; 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.mybatisflex.core.query.QueryMethods.groupConcat;
import org.springframework.transaction.annotation.Transactional;
/** /**
* OAM-任务表 服务层实现 * OAM-任务表 服务层实现
@ -64,45 +67,130 @@ import static com.cpop.oam.business.entity.table.TaskTableDef.TASK;
public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements TaskService { public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements TaskService {
/** /**
* @Description: 查询OAM-任务分页列表 * 技术模块-任务归档-获取任务归档分页
* @param bo 请求参数 * @author DB
* @return: R<PageVo<PersonTaskPageListVo>> * @param subject 品主体牌名
* @Author: DB * @param taskContent 任务内容
* @Date: 2023/5/16 15:24 * @since 2023-11-30 21:11:47
**/ */
@Override @Override
public Page<TaskPageVo> getTaskPage(TaskPageBo bo) { public Page<TaskArchivingPagVo> getTaskArchivingPage(String subject, String taskContent, Boolean isFinish) {
// 获取当前员工
JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo();
PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); PageDomain pageDomain = SqlUtils.getInstance().getPageDomain();
return this.mapper.paginateAs(pageDomain.getPageNum(), return this.mapper.paginateAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()),
pageDomain.getPageSize(),
QueryWrapper.create() QueryWrapper.create()
.where(TASK.TASK_STATUS.eq(1)) .select(TASK.ID,
.and(TASK.TASK_TYPE.eq(bo.getTaskType())) TASK.RESPONSIBLE_STAFF_ID,
.and(TASK.TASK_RATING.eq(bo.getTaskRating())) TASK.TASK_CONTENT,
.orderBy(TASK.EXPECTED_COMPLETION_DATE.asc()), TASK.TASK_RATING,
TaskPageVo.class); TASK.TASK_RECEIPT_TIME,
TASK.TEST_TO_FINISH_URL,
TASK.TO_TEST_TIME,
TASK.TO_FINISH_TIME,
TASK.SUBJECT)
.select(TASK_STAFF_GROUP.GRADE_POINT)
.from(TASK)
.leftJoin(TASK_STAFF_GROUP)
.on(TASK_STAFF_GROUP.TASK_ID.eq(TASK.ID))
.where(TASK_STAFF_GROUP.STAFF_ID.eq(loginUserInfo.getString("id")))
.and(TASK.TASK_STATUS.eq(isFinish ? 8 : 9).and(TASK.TASK_CONTENT.like(taskContent)))
.and(TASK.SUBJECT.like(subject)),
TaskArchivingPagVo.class,
// 负责人
item -> item.field(TaskArchivingPagVo::getResponsibleStaffName)
.queryWrapper(
recordStaff -> queryChain().select(STAFF.NAME.as(TaskArchivingPagVo::getResponsibleStaffName))
.from(STAFF)
.where(STAFF.ID.eq(recordStaff.getResponsibleStaffId()))),
// 小组成员
item -> item.field(TaskArchivingPagVo::getTaskGroupStaffs)
.queryWrapper(taskGroupStaffs -> queryChain()
.select(groupConcat(STAFF.NAME).as(TaskArchivingPagVo::getTaskGroupStaffs))
.from(STAFF)
.leftJoin(TASK_STAFF_GROUP)
.on(TASK_STAFF_GROUP.TASK_ID.eq(TASK.ID))
.where(TASK_STAFF_GROUP.STAFF_ID.eq(taskGroupStaffs.getId()))
.groupBy(TASK.ID)));
} }
/** /**
* @Description: OAM-新增任务 * 技术模块-任务归档-设置任务归档
* @param bo 请求参数 * @author DB
* @return: R<Void> * @param taskId 任务id
* @Author: DB * @since 2023-11-30 21:49:05
* @Date: 2023/5/16 15:58 */
**/
@Override @Override
public void insertTask(TaskBo bo) { public void setTaskArchiving(String taskId) {
this.updateChain()
.set(TASK.TASK_STATUS, 9)
.set(TASK.TO_FINISH_TIME, LocalDateTime.now())
.where(TASK.ID.eq(taskId))
.update();
}
/**
* 技术模块-任务领取-获取领取任务分页
* @author DB
* @param subject 主体
* @param taskContent 任务内容
* @param toBeEvaluated 是否待评估
* @since 2023-11-30 22:21:58
*/
@Override
public Page<TaskToBeClaimedPageVo> getToBeClaimedPage(String subject, String taskContent, Boolean toBeEvaluated) {
// 获取当前员工
PageDomain pageDomain = SqlUtils.getInstance().getPageDomain();
return this.mapper.paginateAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()),
QueryWrapper.create()
.select(TASK.ID,
TASK.TASK_TYPE,
TASK.SUBJECT,
TASK.TASK_CONTENT,
TASK.ATTACHMENT_URL,
TASK.TASK_RATING,
TASK.CREATE_TIME)
.select(TASK_STAFF_GROUP.GRADE_POINT)
.from(TASK)
.leftJoin(TASK_STAFF_GROUP)
.on(TASK_STAFF_GROUP.TASK_ID.eq(TASK.ID))
.where(TASK.TASK_STATUS.eq(toBeEvaluated ? 0 : 1))
.and(TASK.TASK_CONTENT.like(taskContent))
.and(TASK.SUBJECT.like(subject))
.orderBy(TASK.IS_URGENT.desc(), TASK.CREATE_TIME.desc()),
TaskToBeClaimedPageVo.class,
// 对接人
item -> item.field(TaskToBeClaimedPageVo::getDockingStaff).queryWrapper(dockingStaff -> {
if (dockingStaff.getTaskType() == 1) {
return queryChain().select(STAFF.NAME.as(TaskToBeClaimedPageVo::getDockingStaff))
.select(STAFF.NAME)
.from(STAFF)
.leftJoin(TASK_DEMAND)
.on(TASK_DEMAND.RECORD_STAFF_ID.eq(STAFF.ID))
.where(TASK_DEMAND.TASK_ID.eq(dockingStaff.getId()));
} else {
return null;
}
}));
}
/**
* 技术模块-任务领取-新增迭代任务
* @author DB
* @param bo 请求
* @since 2023-12-01 09:45:08
*/
@Override
public void insertIterationTask(TaskIterationBo bo) {
Task entity = BeanUtils.mapToClass(bo, Task.class); Task entity = BeanUtils.mapToClass(bo, Task.class);
// 默认待审核 // 默认待审核 默认开发中
entity.setTaskStatus(0); entity.setTaskStatus(0).setTaskItem(0).setTaskType(0);
// 默认开发中
entity.setTaskItem(0);
this.save(entity); this.save(entity);
// 获取审核管理员手机号 // 获取审核管理员手机号
CoreService coreService = SpringUtils.getBean(CoreService.class);
RedisService redisService = SpringUtils.getBean(RedisService.class); RedisService redisService = SpringUtils.getBean(RedisService.class);
String auditStaffPhone = redisService.getCacheObject(OamConfigEnum.AUDIT_STAFF_PHONE.getKey()); String auditStaffPhone = redisService.getCacheObject(OamConfigEnum.AUDIT_STAFF_PHONE.getKey());
if (StringUtils.isBlank(auditStaffPhone)) { if (StringUtils.isBlank(auditStaffPhone)) {
CoreService coreService = SpringUtils.getBean(CoreService.class);
SysConfig sysConfig = coreService.selectConfigByKey(OamConfigEnum.AUDIT_STAFF_PHONE.getKey()); SysConfig sysConfig = coreService.selectConfigByKey(OamConfigEnum.AUDIT_STAFF_PHONE.getKey());
auditStaffPhone = sysConfig.getConfigValue(); auditStaffPhone = sysConfig.getConfigValue();
if (StringUtils.isBlank(auditStaffPhone)) { if (StringUtils.isBlank(auditStaffPhone)) {
@ -116,113 +204,55 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
SpringUtils.getBean(WebHookSendHandler.class) SpringUtils.getBean(WebHookSendHandler.class)
.webHookSendText(WebHookKeyConstant.PRODUCT_BOT, .webHookSendText(WebHookKeyConstant.PRODUCT_BOT,
phoneList, phoneList,
"==========您有一条新的迭代任务需要审核==========", "==========您有一条新的迭代任务需要审核==========" + "\n" + entity.getTaskContent(),
false); false);
} catch (IOException e) { } catch (IOException e) {
throw new ServiceException("发送通知失败!"); throw new ServiceException("发送迭代任务通知失败!");
} }
} }
/** /**
* @Description: 查询OAM-任务审核分页列表 * 技术模块-任务领取-技术人员领取任务
* @return: R<Page<OamTaskAuditPageVo>> * @author DB
* @Author: DB * @param id 任务id
* @Date: 2023/5/16 15:24 * @since 2023-12-01 10:15:28
**/ */
@Override
public Page<TaskAuditPageVo> getTaskAuditPage() {
PageDomain pageDomain = SqlUtils.getInstance().getPageDomain();
return this.mapper.paginateAs(pageDomain.getPageNum(),
pageDomain.getPageSize(),
QueryWrapper.create().where(TASK.TASK_STATUS.eq(0)).orderBy(TASK.CREATE_TIME.desc()),
TaskAuditPageVo.class);
}
/**
* @Description: 设置任务审核意见
* @param bo 请求参数
* @return: R<Void>
* @Author: DB
* @Date: 2023/5/16 17:36
**/
@Override
public void setTaskAuditComments(TaskAuditCommentsBo bo) {
Task entity = BeanUtils.mapToClass(bo, Task.class);
this.updateById(entity);
// 如果通过,可以通过websocket进行通信
if (bo.getTaskStatus() == 1) {
// 获取任务信息
Task task = this.getById(bo.getId());
SpringUtils.getBean(WebSocketServer.class).sendInfo("您的任务" + task.getTaskName() + "已通过,请注意接收:", task.getResponsibleStaffId());
}
}
/**
* @Description: 查询OAM-任务审核驳回列表
* @return: R<Page<OamTaskAuditPageVo>>
* @Author: DB
* @Date: 2023/5/16 15:24
**/
@Override
public Page<TaskAuditPageVo> getTaskRejectPage() {
// 获取当前用户信息
PageDomain pageDomain = SqlUtils.getInstance().getPageDomain();
return this.mapper.paginateAs(pageDomain.getPageNum(),
pageDomain.getPageSize(),
QueryWrapper.create().where(TASK.TASK_STATUS.eq(-1)).orderBy(TASK.CREATE_TIME.desc()),
TaskAuditPageVo.class);
}
/**
* @Description: 技术人员领取任务
* @param id 任务主键
* @return: R<Void>
* @Author: DB
* @Date: 2023/5/16 17:10
**/
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void claimTask(String id) { public void claimTask(String id) {
// 查询任务 // 查询任务
Task task = this.getById(id); Task task = this.getById(id);
// 进行中 // 进行中 接受时间
task.setTaskStatus(2); task.setTaskStatus(2).setTaskReceiptTime(LocalDateTime.now());
// 接受时间
task.setTaskReceiptTime(LocalDateTime.now());
// 如果任务没有设置预期完成时间则按照任务评级进行设置默认 // 如果任务没有设置预期完成时间则按照任务评级进行设置默认
if (null == task.getExpectedCompletionDate()) { if (task.getExpectedCompletionDate() == null) {
// 获取任务评级 // 获取任务评级
Integer taskRating = task.getTaskRating(); Integer taskRating = task.getTaskRating();
Date expectedCompletionDate; LocalDate now = LocalDate.now();
switch (taskRating) { switch (taskRating) {
case 0: case 0:
// 30天 // 30天
expectedCompletionDate = DateUtils.addDateDays(new Date(), 30); task.setExpectedCompletionDate(now.plusDays(30));
task.setExpectedCompletionDate(new java.sql.Date(expectedCompletionDate.getTime()));
break; break;
case 1: case 1:
// 21天 // 21天
expectedCompletionDate = DateUtils.addDateDays(new Date(), 21); task.setExpectedCompletionDate(now.plusDays(21));
task.setExpectedCompletionDate(new java.sql.Date(expectedCompletionDate.getTime()));
break; break;
case 2: case 2:
// 15天 // 15天
expectedCompletionDate = DateUtils.addDateDays(new Date(), 15); task.setExpectedCompletionDate(now.plusDays(15));
task.setExpectedCompletionDate(new java.sql.Date(expectedCompletionDate.getTime()));
break; break;
case 3: case 3:
// 7天 // 7天
expectedCompletionDate = DateUtils.addDateDays(new Date(), 7); task.setExpectedCompletionDate(now.plusDays(7));
task.setExpectedCompletionDate(new java.sql.Date(expectedCompletionDate.getTime()));
break; break;
case 4: case 4:
// 3天 // 3天
expectedCompletionDate = DateUtils.addDateDays(new Date(), 3); task.setExpectedCompletionDate(now.plusDays(3));
task.setExpectedCompletionDate(new java.sql.Date(expectedCompletionDate.getTime()));
break; break;
default: default:
// 1天 // 1天
expectedCompletionDate = DateUtils.addDateDays(new Date(), 1); task.setExpectedCompletionDate(now.plusDays(1));
task.setExpectedCompletionDate(new java.sql.Date(expectedCompletionDate.getTime()));
break; break;
} }
} }
@ -262,6 +292,29 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
SpringUtils.getBean(TaskStaffGroupService.class).save(taskStaffGroup); SpringUtils.getBean(TaskStaffGroupService.class).save(taskStaffGroup);
} }
/**
* 技术模块-任务领取-任务审核
* @author DB
* @param bo 请求参数
* @since 2023-12-01 10:35:31
*/
@Override
public void setTaskAuditComments(TaskAuditCommentsBo bo) {
Task entity = BeanUtils.mapToClass(bo, Task.class);
entity.setTaskStatus(1);
this.updateById(entity);
// 通知所有人
try {
SpringUtils.getBean(WebHookSendHandler.class)
.webHookSendText(WebHookKeyConstant.PRODUCT_BOT,
new ArrayList<>(),
"==========任务审核通过==========" + "\n" + entity.getTaskContent(),
true);
} catch (IOException e) {
throw new ServiceException("发送任务审核通过通知失败!");
}
}
/** /**
* @Description: 查询OAM-个人任务分页列表 * @Description: 查询OAM-个人任务分页列表
* @return: R<PageVo<PersonTaskPageListVo>> * @return: R<PageVo<PersonTaskPageListVo>>
@ -393,7 +446,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
public void finishTask(String id) { public void finishTask(String id) {
// 查询任务相关信息 // 查询任务相关信息
Task task = this.getById(id); Task task = this.getById(id);
if (null == task) { if (task == null) {
throw new ServiceException("获取任务失败,请联系相关人员!"); throw new ServiceException("获取任务失败,请联系相关人员!");
} }
if (task.getTaskItem() != 3) { if (task.getTaskItem() != 3) {
@ -401,7 +454,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
} }
// 判断完成任务日期 // 判断完成任务日期
LocalDate now = LocalDate.now(); LocalDate now = LocalDate.now();
LocalDate expectedCompletionDate = task.getExpectedCompletionDate().toLocalDate(); LocalDate expectedCompletionDate = task.getExpectedCompletionDate();
long day = now.until(expectedCompletionDate, ChronoUnit.DAYS); long day = now.until(expectedCompletionDate, ChronoUnit.DAYS);
// 逾期完成 // 逾期完成
if (day < 0) { if (day < 0) {
@ -409,7 +462,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
} else { } else {
task.setTaskStatus(3); task.setTaskStatus(3);
} }
task.setCompletionDate(java.sql.Date.valueOf(now)); task.setCompletionDate(now);
this.updateById(task); this.updateById(task);
} }
@ -511,19 +564,18 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
} }
allTheDateOfMonth.forEach(item -> { allTheDateOfMonth.forEach(item -> {
LocalDate localDate = item.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); LocalDate localDate = item.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
List<String> taskNames = new ArrayList<>(); List<String> taskContents = new ArrayList<>();
TaskMonthStatisticsVo.DataStatisticsVo dataStatisticsVo = statisticsVo.new DataStatisticsVo(); TaskMonthStatisticsVo.DataStatisticsVo dataStatisticsVo = statisticsVo.new DataStatisticsVo();
// 如果日期大于等于接受任务日期,并且小于等于预期完成日期,则插入 // 如果日期大于等于接受任务日期,并且小于等于预期完成日期,则插入
taskList.forEach(task -> { taskList.forEach(task -> {
// 接受时间 // 接受时间
LocalDate date = task.getTaskReceiptTime().toLocalDate(); LocalDate date = task.getTaskReceiptTime().toLocalDate();
if (localDate.compareTo(date) >= 0 if (localDate.compareTo(date) >= 0 && localDate.compareTo(task.getExpectedCompletionDate()) <= 0) {
&& localDate.compareTo(task.getExpectedCompletionDate().toLocalDate()) <= 0) { taskContents.add(task.getTaskContent());
taskNames.add(task.getTaskName());
} }
}); });
dataStatisticsVo.setDate(localDate); dataStatisticsVo.setDate(localDate);
dataStatisticsVo.setTaskNames(taskNames); dataStatisticsVo.setTaskContents(taskContents);
statisticsVo.getVos().add(dataStatisticsVo); statisticsVo.getVos().add(dataStatisticsVo);
}); });
return statisticsVo; return statisticsVo;

View File

@ -41,7 +41,8 @@ import static com.cpop.oam.business.entity.table.TaskStaffGroupTableDef.TASK_STA
* @since 2023-09-18 * @since 2023-09-18
*/ */
@Service("taskStaffGroupService") @Service("taskStaffGroupService")
public class TaskStaffGroupServiceImpl extends ServiceImpl<TaskStaffGroupMapper, TaskStaffGroup> implements TaskStaffGroupService { public class TaskStaffGroupServiceImpl extends ServiceImpl<TaskStaffGroupMapper, TaskStaffGroup>
implements TaskStaffGroupService {
/** /**
* @Description: 查询OAM-任务成员组列表 * @Description: 查询OAM-任务成员组列表
@ -55,9 +56,9 @@ public class TaskStaffGroupServiceImpl extends ServiceImpl<TaskStaffGroupMapper,
.select(TASK_STAFF_GROUP.ALL_COLUMNS) .select(TASK_STAFF_GROUP.ALL_COLUMNS)
.select(STAFF.NAME.as(TaskStaffGroupVo::getStaffName)) .select(STAFF.NAME.as(TaskStaffGroupVo::getStaffName))
.from(TASK_STAFF_GROUP) .from(TASK_STAFF_GROUP)
.leftJoin(STAFF).on(STAFF.ID.eq(TASK_STAFF_GROUP.STAFF_ID)) .leftJoin(STAFF)
.where(TASK_STAFF_GROUP.TASK_ID.eq(bo.getTaskId())), .on(STAFF.ID.eq(TASK_STAFF_GROUP.STAFF_ID))
TaskStaffGroupVo.class); .where(TASK_STAFF_GROUP.TASK_ID.eq(bo.getTaskId())), TaskStaffGroupVo.class);
} }
/** /**
@ -110,8 +111,12 @@ public class TaskStaffGroupServiceImpl extends ServiceImpl<TaskStaffGroupMapper,
StaffInfoVo staffInfo = SpringUtils.getBean(StaffService.class).getStaffInfo(bo.getStaffId()); StaffInfoVo staffInfo = SpringUtils.getBean(StaffService.class).getStaffInfo(bo.getStaffId());
phoneList.add(staffInfo.getPhoneNumber()); phoneList.add(staffInfo.getPhoneNumber());
try { try {
SpringUtils.getBean(WebHookSendHandler.class).webHookSendText(WebHookKeyConstant.PRODUCT_BOT, phoneList, loginInfo.getName() + "您的绩点调整为" + responsibleStaff.getGradePoint() SpringUtils.getBean(WebHookSendHandler.class)
+ "\n" + staffInfo.getName() + "您新加入任务:" + task.getTaskName() + "绩点为:" + bo.getGradePoint(), false); .webHookSendText(WebHookKeyConstant.PRODUCT_BOT,
phoneList,
loginInfo.getName() + "您的绩点调整为" + responsibleStaff.getGradePoint() + "\n" + staffInfo.getName()
+ "您新加入任务:" + task.getTaskContent() + "绩点为:" + bo.getGradePoint(),
false);
} catch (IOException e) { } catch (IOException e) {
throw new ServiceException("发送通知失败!"); throw new ServiceException("发送通知失败!");
} }
@ -169,7 +174,8 @@ public class TaskStaffGroupServiceImpl extends ServiceImpl<TaskStaffGroupMapper,
this.updateById(responsibleStaffTaskInfo); this.updateById(responsibleStaffTaskInfo);
} }
// 更新绩点 // 更新绩点
this.updateChain().set(TASK_STAFF_GROUP.GRADE_POINT, bo.getGradePoint()) this.updateChain()
.set(TASK_STAFF_GROUP.GRADE_POINT, bo.getGradePoint())
.where(TASK_STAFF_GROUP.TASK_ID.eq(bo.getTaskId())) .where(TASK_STAFF_GROUP.TASK_ID.eq(bo.getTaskId()))
.and(TASK_STAFF_GROUP.STAFF_ID.eq(bo.getStaffId())) .and(TASK_STAFF_GROUP.STAFF_ID.eq(bo.getStaffId()))
.update(); .update();
@ -180,8 +186,12 @@ public class TaskStaffGroupServiceImpl extends ServiceImpl<TaskStaffGroupMapper,
StaffInfoVo staffInfo = SpringUtils.getBean(StaffService.class).getStaffInfo(bo.getStaffId()); StaffInfoVo staffInfo = SpringUtils.getBean(StaffService.class).getStaffInfo(bo.getStaffId());
phoneList.add(staffInfo.getPhoneNumber()); phoneList.add(staffInfo.getPhoneNumber());
try { try {
SpringUtils.getBean(WebHookSendHandler.class).webHookSendText(WebHookKeyConstant.PRODUCT_BOT, phoneList, loginInfo.getName() + "您的绩点调整为" + responsibleStaffTaskInfo.getGradePoint() SpringUtils.getBean(WebHookSendHandler.class)
+ "\n" + staffInfo.getName() + "您的绩点调整为:" + bo.getGradePoint(), false); .webHookSendText(WebHookKeyConstant.PRODUCT_BOT,
phoneList,
loginInfo.getName() + "您的绩点调整为" + responsibleStaffTaskInfo.getGradePoint() + "\n"
+ staffInfo.getName() + "您的绩点调整为:" + bo.getGradePoint(),
false);
} catch (IOException e) { } catch (IOException e) {
throw new ServiceException("发送通知失败!"); throw new ServiceException("发送通知失败!");
} }

View File

@ -1,21 +1,10 @@
package com.cpop.oam.business.service.impl; package com.cpop.oam.business.service.impl;
import com.mybatisflex.spring.service.impl.ServiceImpl; import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.cpop.api.tencent.wxWork.handler.WebHookSendHandler;
import com.cpop.common.utils.bean.BeanUtils;
import com.cpop.core.base.exception.ServiceException;
import com.cpop.core.utils.SpringUtils;
import com.cpop.oam.business.dto.TaskWorkOrderRecordDto;
import com.cpop.oam.business.entity.TaskWorkOrderRecord; import com.cpop.oam.business.entity.TaskWorkOrderRecord;
import com.cpop.oam.business.mapper.TaskWorkOrderRecordMapper; import com.cpop.oam.business.mapper.TaskWorkOrderRecordMapper;
import com.cpop.oam.business.service.TaskWorkOrderRecordService; import com.cpop.oam.business.service.TaskWorkOrderRecordService;
import com.cpop.oam.framework.constant.WebHookKeyConstant;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/** /**
* 任务-工单-记录表 服务层实现 * 任务-工单-记录表 服务层实现
@ -24,28 +13,7 @@ import java.util.List;
* @since 2023-09-18 * @since 2023-09-18
*/ */
@Service("taskWorkOrderRecordService") @Service("taskWorkOrderRecordService")
public class TaskWorkOrderRecordServiceImpl extends ServiceImpl<TaskWorkOrderRecordMapper, TaskWorkOrderRecord> implements TaskWorkOrderRecordService { public class TaskWorkOrderRecordServiceImpl extends ServiceImpl<TaskWorkOrderRecordMapper, TaskWorkOrderRecord>
implements TaskWorkOrderRecordService {
/**
* @descriptions 新增任务-工单-记录
* @author DB
* @date 2023/09/18 17:31
* @param bo 请求参数
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void insertTaskWorkOrderRecord(TaskWorkOrderRecordDto bo) {
TaskWorkOrderRecord entity = new TaskWorkOrderRecord();
BeanUtils.copyBeanProp(entity, bo);
this.save(entity);
//发送企业微信信息通知
List<String> phoneList = new ArrayList<String>();
phoneList.add(bo.getResponsibleStaffPhone());
phoneList.add(bo.getRecordStaffPhone());
try {
SpringUtils.getBean(WebHookSendHandler.class).webHookSendText(WebHookKeyConstant.ORDER_INFO_BOT, phoneList, "有新的工单信息请注意回复\n" + bo.getRecordText(), false);
} catch (IOException e) {
throw new ServiceException("发送消息通知失败!");
}
}
} }

View File

@ -3,9 +3,12 @@ package com.cpop.oam.business.service.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cpop.common.utils.StringUtils; import com.cpop.common.utils.StringUtils;
import com.cpop.core.base.entity.PageDomain; import com.cpop.core.base.entity.PageDomain;
import com.cpop.oam.business.bo.TaskDemandBo;
import com.cpop.oam.business.dto.TaskWorkOrderReceiveDealPauseDto; import com.cpop.oam.business.dto.TaskWorkOrderReceiveDealPauseDto;
import com.cpop.oam.business.vo.TaskWorkOrderPersonVo;
import com.cpop.oam.business.vo.TaskWorkOrderReceiveDealPauseVo; import com.cpop.oam.business.vo.TaskWorkOrderReceiveDealPauseVo;
import com.cpop.oam.business.vo.WorkOrderDutyVo; import com.cpop.oam.business.vo.WorkOrderDutyVo;
import com.cpop.oam.framework.enums.OamConfigEnum;
import com.cpop.oam.framework.tasks.WorkOrderAcceptOverTimeTask; import com.cpop.oam.framework.tasks.WorkOrderAcceptOverTimeTask;
import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.core.query.QueryWrapper;
@ -13,11 +16,7 @@ import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.cpop.api.tencent.wxWork.handler.WebHookSendHandler; import com.cpop.api.tencent.wxWork.handler.WebHookSendHandler;
import com.cpop.common.utils.DateUtils; import com.cpop.common.utils.DateUtils;
import com.cpop.common.utils.bean.BeanUtils; import com.cpop.common.utils.bean.BeanUtils;
import com.cpop.core.base.entity.LoginUser;
import com.cpop.core.base.entity.loginInfo.OamStaffLoginInfo;
import com.cpop.core.base.enums.UserType;
import com.cpop.core.base.exception.ServiceException; import com.cpop.core.base.exception.ServiceException;
import com.cpop.core.service.RedisService;
import com.cpop.core.utils.QuartzUtils; import com.cpop.core.utils.QuartzUtils;
import com.cpop.core.utils.SecurityUtils; import com.cpop.core.utils.SecurityUtils;
import com.cpop.core.utils.SpringUtils; import com.cpop.core.utils.SpringUtils;
@ -53,13 +52,13 @@ 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 com.cpop.core.utils.sql.SqlUtils; import com.cpop.core.utils.sql.SqlUtils;
import com.cpop.core.service.RedisService;
/** /**
* 任务-工单表 服务层实现 * 任务-工单表 服务层实现
@ -234,7 +233,6 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
BeanUtils.copyBeanProp(task, bo); BeanUtils.copyBeanProp(task, bo);
// 默认待接受 // 默认待接受
task.setTaskStatus(1) task.setTaskStatus(1)
.setTaskName("工单")
// 默认开发中 // 默认开发中
.setTaskItem(0) .setTaskItem(0)
.setTaskWeight(10) .setTaskWeight(10)
@ -255,6 +253,13 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
TaskStaffGroup taskStaffGroup = new TaskStaffGroup(); TaskStaffGroup taskStaffGroup = new TaskStaffGroup();
taskStaffGroup.setTaskId(task.getId()).setStaffId(duty.getTechnologyStaffId()).setGradePoint(0); taskStaffGroup.setTaskId(task.getId()).setStaffId(duty.getTechnologyStaffId()).setGradePoint(0);
taskStaffGroupService.save(taskStaffGroup); taskStaffGroupService.save(taskStaffGroup);
// 添加工单记录
TaskWorkOrderRecord workOrderRecord = new TaskWorkOrderRecord();
workOrderRecord.setTaskWorkOrderId(entity.getId())
.setRecordText(bo.getTaskContent())
.setRecordStaffId(loginUserInfo.getString("id"))
.setAttachmentUrl(bo.getAttachmentUrl());
SpringUtils.getBean(TaskWorkOrderRecordService.class).save(workOrderRecord);
// 通知值班员工 // 通知值班员工
StaffService staffService = SpringUtils.getBean(StaffService.class); StaffService staffService = SpringUtils.getBean(StaffService.class);
StaffInfoVo technologyStaffInfo = staffService.getStaffInfo(duty.getTechnologyStaffId()); StaffInfoVo technologyStaffInfo = staffService.getStaffInfo(duty.getTechnologyStaffId());
@ -266,7 +271,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,
"==========您有一条新的工单需要处理==========" + "\n" + task.getTaskName() + "\n" + task.getTaskContent(), "==========您有一条新的工单需要处理==========\n" + task.getTaskContent(),
false); false);
} catch (IOException e) { } catch (IOException e) {
throw new ServiceException("发送消息通知失败!"); throw new ServiceException("发送消息通知失败!");
@ -373,7 +378,8 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
.listAs( .listAs(
QueryWrapper.create() QueryWrapper.create()
.select(TASK_WORK_ORDER_RECORD.ALL_COLUMNS) .select(TASK_WORK_ORDER_RECORD.ALL_COLUMNS)
.select(STAFF.NAME.as(TaskWorkOrderRecordListVo::getRecordStaffName)) .select(STAFF.NAME.as(TaskWorkOrderRecordListVo::getRecordStaffName),
STAFF.STAFF_TYPE.as(TaskWorkOrderRecordListVo::getRecordStaffType))
.select(SYS_USER.AVATAR.as(TaskWorkOrderRecordListVo::getAvatar)) .select(SYS_USER.AVATAR.as(TaskWorkOrderRecordListVo::getAvatar))
.from(TASK_WORK_ORDER_RECORD) .from(TASK_WORK_ORDER_RECORD)
// 员工表 // 员工表
@ -403,32 +409,30 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
Task task = taskService.getOne(QueryWrapper.create().where(TASK.ID.eq(taskWorkOrder.getTaskId()))); Task task = taskService.getOne(QueryWrapper.create().where(TASK.ID.eq(taskWorkOrder.getTaskId())));
// 插入工单记录 // 插入工单记录
TaskWorkOrderRecord taskWorkOrderRecord = BeanUtils.mapToClass(bo, TaskWorkOrderRecord.class); TaskWorkOrderRecord taskWorkOrderRecord = BeanUtils.mapToClass(bo, TaskWorkOrderRecord.class);
// 获取记录员工;当前操作员工是否是主要负责人不是抛出异常
LoginUser loginUser = SecurityUtils.getInstance().getLoginUser();
// 读取员工信息 // 读取员工信息
RedisService redisService = SpringUtils.getBean(RedisService.class); JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo();
JSONObject cacheObject = redisService.getCacheObject(UserType.OAM_USER.getKey() + loginUser.getUsername()); taskWorkOrderRecord.setRecordStaffId(loginUserInfo.getString("id"));
OamStaffLoginInfo loginInfo = cacheObject.getJSONObject("user").toJavaObject(OamStaffLoginInfo.class);
taskWorkOrderRecord.setRecordStaffId(loginInfo.getId());
// 插入记录 // 插入记录
SpringUtils.getBean(TaskWorkOrderRecordService.class).save(taskWorkOrderRecord); SpringUtils.getBean(TaskWorkOrderRecordService.class).save(taskWorkOrderRecord);
if (StringUtils.isNotBlank(task.getResponsibleStaffId())) {
// 负责人手机号 // 负责人手机号
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(loginInfo.getPhoneNumber()); phoneList.add(loginUserInfo.getString("phoneNumber"));
// 通知记录 // 通知记录
try { try {
SpringUtils.getBean(WebHookSendHandler.class) SpringUtils.getBean(WebHookSendHandler.class)
.webHookSendText(WebHookKeyConstant.ORDER_INFO_BOT, .webHookSendText(WebHookKeyConstant.ORDER_INFO_BOT,
phoneList, phoneList,
task.getTaskName() + "\n" + task.getTaskContent() + "\n工单有新回复:\n" + bo.getRecordText(), task.getTaskContent() + "\n工单有新回复:\n" + bo.getRecordText(),
false); false);
} catch (IOException e) { } catch (IOException e) {
throw new ServiceException("发送消息通知失败!"); throw new ServiceException("发送消息通知失败!");
} }
} }
}
/** /**
* 工单模块-工单提交-工单提醒 * 工单模块-工单提交-工单提醒
@ -460,14 +464,14 @@ 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.getTaskName() + "\n" + task.getTaskContent() + "\n您有一条工单需要接收\n", task.getTaskContent() + "\n您有一条工单需要接收\n",
false); false);
break; break;
default: default:
SpringUtils.getBean(WebHookSendHandler.class) SpringUtils.getBean(WebHookSendHandler.class)
.webHookSendText(WebHookKeyConstant.ORDER_INFO_BOT, .webHookSendText(WebHookKeyConstant.ORDER_INFO_BOT,
phoneList, phoneList,
task.getTaskName() + "\n" + task.getTaskContent() + "\n您有一条工单需要尽快处理\n", task.getTaskContent() + "\n您有一条工单需要尽快处理\n",
false); false);
} }
} catch (IOException e) { } catch (IOException e) {
@ -490,8 +494,17 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
if (!StringUtils.equals(workOrder.getRecordStaffId(), loginUserInfo.getString("id"))) { if (!StringUtils.equals(workOrder.getRecordStaffId(), loginUserInfo.getString("id"))) {
throw new ServiceException("当前操作员工不是当前工单提交人,请联系提交人操作"); throw new ServiceException("当前操作员工不是当前工单提交人,请联系提交人操作");
} }
// TODO: 工单转需求 // 获取任务
Task task = SpringUtils.getBean(TaskService.class).getById(workOrder.getTaskId());
TaskDemandBo taskDemandBo = new TaskDemandBo();
RedisService redisService = SpringUtils.getBean(RedisService.class);
String brandId = redisService.getCacheObject(OamConfigEnum.DEMAND_TO_TASK_BRAND.getKey());
String storeId = redisService.getCacheObject(OamConfigEnum.DEMAND_TO_TASK_STORE.getKey());
taskDemandBo.setAttachmentUrl(task.getAttachmentUrl())
.setBrandId(brandId)
.setStoreId(storeId)
.setTaskContent(task.getTaskContent());
SpringUtils.getBean(TaskDemandService.class).insertTaskDemand(taskDemandBo);
} }
/** /**
@ -525,7 +538,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.getTaskName() + "\n" + task.getTaskContent() + "\n工单已暂停到:" task.getTaskContent() + "\n工单已暂停到:"
+ bo.getPauseExpireTime().format(DateTimeFormatter.ofPattern(DateUtils.YYYY_MM_DD_HH_MM_SS)), + bo.getPauseExpireTime().format(DateTimeFormatter.ofPattern(DateUtils.YYYY_MM_DD_HH_MM_SS)),
false); false);
} catch (IOException e) { } catch (IOException e) {
@ -564,15 +577,15 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
TaskService taskService = SpringUtils.getBean(TaskService.class); TaskService taskService = SpringUtils.getBean(TaskService.class);
Task task = taskService.getOne(QueryWrapper.create().where(TASK.ID.eq(taskWorkOrder.getTaskId()))); Task task = taskService.getOne(QueryWrapper.create().where(TASK.ID.eq(taskWorkOrder.getTaskId())));
// 超时设置逾期 // 超时设置逾期
if (finishTime.compareTo(task.getTaskReceiptTime()) > 0 if (Duration.between(finishTime, task.getTaskReceiptTime()).toMillis() >= 4800000
|| Duration.between(finishTime, task.getTaskReceiptTime()).toMillis() >= 4800000) { || Duration.between(finishTime, taskWorkOrder.getPauseExpireTime()).toMillis() >= 4800000) {
// 工单暂停期间完成 // 工单正常与暂停期间完成
task.setTaskStatus(3); task.setTaskStatus(3);
} else { } else {
task.setTaskStatus(6); task.setTaskStatus(6);
} }
task.setTaskItem(3); task.setTaskItem(3);
task.setCompletionDate(Date.valueOf(LocalDate.now())); task.setCompletionDate(LocalDate.now());
taskService.updateById(task); taskService.updateById(task);
// 更新工单 // 更新工单
this.updateById(taskWorkOrder); this.updateById(taskWorkOrder);
@ -601,10 +614,7 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
// 通知记录 // 通知记录
try { try {
SpringUtils.getBean(WebHookSendHandler.class) SpringUtils.getBean(WebHookSendHandler.class)
.webHookSendText(WebHookKeyConstant.ORDER_INFO_BOT, .webHookSendText(WebHookKeyConstant.ORDER_INFO_BOT, phoneList, task.getTaskContent() + "\n工单办结", false);
phoneList,
task.getTaskName() + "\n" + task.getTaskContent() + "\n工单办结",
false);
} catch (IOException e) { } catch (IOException e) {
throw new ServiceException("发送消息通知失败!"); throw new ServiceException("发送消息通知失败!");
} }
@ -618,4 +628,54 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
} }
} }
/**
* 技术模块-技术-获取个人工单列表
* @author DB
* @since 2023-11-30 19:41:32
*/
@Override
public List<TaskWorkOrderPersonVo> getPersonWorkOrder() {
// 获取当前用户
JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo();
// 获取当天技术值班
// 获取值班员工
DutyService dutyService = SpringUtils.getBean(DutyService.class);
Duty duty = dutyService.getOne(QueryWrapper.create().where(DUTY.DUTY_DATE.eq(DateUtils.getDate())));
if (duty == null) {
throw new ServiceException("当天没有值班员工,请联系相关人员添加值班信息!");
}
// 判断当前用户是不是值班用户
QueryWrapper queryWrapper = QueryWrapper.create();
if (!StringUtils.equals(duty.getTechnologyStaffId(), loginUserInfo.getString("id"))) {
// 获取未接受的工单
queryWrapper.or(TASK.TASK_STATUS.in(1, 7));
}
return this.mapper.selectListByQueryAs(
queryWrapper
.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)
// 任务
.select(TASK.TASK_CONTENT, TASK.TASK_STATUS, TASK.TASK_RECEIPT_TIME)
// 品牌
.select(BRAND.BRAND_NAME)
// 校区
.select(STORE.STORE_NAME)
.where(TASK.RESPONSIBLE_STAFF_ID.eq(loginUserInfo.getString("id")))
.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)),
TaskWorkOrderPersonVo.class,
// 提交人
item -> item.field(TaskWorkOrderPersonVo::getRecordStaffName)
.queryWrapper(recordStaff -> queryChain().select(STAFF.NAME.as("recordStaffName"))
.from(STAFF)
.where(STAFF.ID.eq(recordStaff.getRecordStaffId()))));
}
} }

View File

@ -29,12 +29,6 @@ public class PersonTaskPageVo implements Serializable {
@ApiModelProperty("主键") @ApiModelProperty("主键")
private String id; private String id;
/**
* 任务名
*/
@ApiModelProperty("任务名")
private String taskName;
/** /**
* 任务类型(0:迭代;1:需求;2:投诉) * 任务类型(0:迭代;1:需求;2:投诉)
*/ */

View File

@ -1,81 +0,0 @@
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.LocalDate;
import java.time.LocalDateTime;
/**
* Description:
* date: 2023/5/22 9:28
*
* @Author DB
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "Task分页对象", description = "OAM-任务列表")
public class TaskAuditPageVo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@ApiModelProperty("主键")
private String id;
/**
* 任务名
*/
@ApiModelProperty("任务名")
private String taskName;
/**
* 任务类型(0:迭代;1:需求;2:投诉)
*/
@ApiModelProperty("任务类型(0:迭代;1:需求;2:投诉)")
private Integer taskType;
/**
* 任务内容
*/
@ApiModelProperty("任务内容")
private String taskContent;
/**
* 任务评级(0:A;1:B;2:C;3:D;4:E)
*/
@ApiModelProperty("任务评级(0:A;1:B;2:C;3:D;4:E)")
private Integer taskRating;
/**
* 附件地址
*/
@ApiModelProperty("附件地址")
private String attachmentUrl;
/**
* 备注
*/
@ApiModelProperty("备注")
private String remark;
/**
* 预期完成日期
*/
@ApiModelProperty("预期完成日期")
@JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
private LocalDate expectedCompletionDate;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
@ApiModelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@ -6,21 +6,20 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable; import java.time.LocalDateTime;
import java.sql.Timestamp; import java.time.LocalDate;
import com.cpop.core.annontation.StringArrayConvert;
/** /**
* Description: * 需求分页对象
* date: 2023/5/30 15:44 * @author DB
* * @since 2023-11-30 16:01:47
* @Author ST * @version 1.0.0
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@ApiModel(value = "需求管理分页对象", description = "需求管理") @ApiModel(value = "需求分页对象", description = "需求管理")
public class TaskDemandPageVo implements Serializable { public class TaskDemandPageVo {
private static final long serialVersionUID = 1L;
/** /**
* 主键 * 主键
@ -29,10 +28,28 @@ public class TaskDemandPageVo implements Serializable {
private String id; private String id;
/** /**
* 任务名 * 品牌/机构ID
*/ */
@ApiModelProperty("任务名") @ApiModelProperty("品牌/机构ID")
private String taskName; private String brandId;
/**
* 品牌/机构
*/
@ApiModelProperty("品牌/机构")
private String brandName;
/**
* 校区/店铺ID
*/
@ApiModelProperty("校区/店铺ID")
private String storeId;
/**
* 校区/店铺
*/
@ApiModelProperty("校区/店铺")
private String storeName;
/** /**
* 任务内容 * 任务内容
@ -43,61 +60,85 @@ public class TaskDemandPageVo implements Serializable {
/** /**
* 附件地址 * 附件地址
*/ */
@StringArrayConvert
@ApiModelProperty("附件地址") @ApiModelProperty("附件地址")
private String attachmentUrl; private String attachmentUrl;
/** /**
* 备注 * 记录员工Id
*/ */
@ApiModelProperty("备注") @ApiModelProperty("记录员工Id")
private String remark;
/**
* 品牌
*/
@ApiModelProperty("品牌id")
private String brandId;
/**
* 品牌
*/
@ApiModelProperty("品牌")
private String brandName;
/**
* 校区
*/
@ApiModelProperty("校区id")
private String campusId;
/**
* 校区
*/
@ApiModelProperty("校区")
private String campusName;
/**
* 创建时间
*/
@ApiModelProperty("创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
private Timestamp createTime;
/**
* 需求类型
*/
@ApiModelProperty("需求类型")
private Integer demandType;
/**
* 记录员工id
*/
@ApiModelProperty("记录员工id")
private String recordStaffId; private String recordStaffId;
/** /**
* 记录员工名 * 记录员工名
*/ */
@ApiModelProperty("记录员工名") @ApiModelProperty("记录员工名")
private String recordStaffName; private String recordStaffName;
/**
* 创建时间
*/
@ApiModelProperty("创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime createTime;
/**
* 更新人
*/
@ApiModelProperty("更新人")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private String updateUserId;
/**
* 更新人
*/
@ApiModelProperty("更新人")
private String updateStaffName;
/**
* 更新时间
*/
@ApiModelProperty("更新时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime updateTime;
/**预期完成时间 */
@ApiModelProperty("预期完成时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private LocalDate expectedCompletionDate;
/**
* 是否加急
*/
@ApiModelProperty("是否加急")
private Integer isUrgent;
/**任务评级(0:A;1:B;2:C;3:D;4:E) */
@ApiModelProperty("任务评级(0:A;1:B;2:C;3:D;4:E)")
private Integer taskRating;
/**任务接收员工Id */
@ApiModelProperty("领取人Id")
private String responsibleStaffId;
/**任务接收员工 */
@ApiModelProperty("领取人")
private String responsibleStaffName;
/**任务领取时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ApiModelProperty("任务领取时间")
private LocalDateTime taskReceiptTime;
/**完成日期 */
@ApiModelProperty("完成日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private LocalDate completionDate;
/**测试转部署文件 */
@ApiModelProperty("测试转部署文件")
@StringArrayConvert
private String testToFinishUrl;
} }

View File

@ -77,12 +77,10 @@ public class TaskMonthStatisticsVo implements Serializable {
@ApiModelProperty(value = "日期") @ApiModelProperty(value = "日期")
private LocalDate date; private LocalDate date;
/** /**
* 日期 * 任务内容
*/ */
@JsonFormat(pattern = "yyyy-MM-dd") @ApiModelProperty(value = "任务内容")
@ApiModelProperty(value = "任务名") private List<String> taskContents;
private List<String> taskNames;
} }
} }

View File

@ -1,74 +0,0 @@
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.LocalDate;
/**
* Description:
* date: 2023/5/16 15:48
*
* @Author ST
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "Task分页对象", description = "OAM-任务列表")
public class TaskPageVo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@ApiModelProperty("主键")
private String id;
/**
* 任务名
*/
@ApiModelProperty("任务名")
private String taskName;
/**
* 任务类型(0:迭代;1:需求;2:投诉)
*/
@ApiModelProperty("任务类型(0:迭代;1:需求;2:投诉)")
private Integer taskType;
/**
* 任务内容
*/
@ApiModelProperty("任务内容")
private String taskContent;
/**
* 任务评级(0:A;1:B;2:C;3:D;4:E)
*/
@ApiModelProperty("任务评级(0:A;1:B;2:C;3:D;4:E)")
private Integer taskRating;
/**
* 附件地址
*/
@ApiModelProperty("附件地址")
private String attachmentUrl;
/**
* 备注
*/
@ApiModelProperty("备注")
private String remark;
/**
* 预期完成日期
*/
@ApiModelProperty("预期完成日期")
@JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
private LocalDate expectedCompletionDate;
}

View File

@ -7,6 +7,7 @@ import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.sql.Timestamp; import java.sql.Timestamp;
import com.cpop.core.annontation.StringArrayConvert;
/** /**
* 任务-工单记录-记录 * 任务-工单记录-记录
@ -43,6 +44,12 @@ public class TaskWorkOrderRecordListVo {
@ApiModelProperty("记录员工id") @ApiModelProperty("记录员工id")
private String recordStaffName; private String recordStaffName;
/**
* 员工类型(0:技术人员;1:售后人员;2:管理人员)
*/
@ApiModelProperty("员工类型(0:技术人员;1:售后人员;2:管理人员)")
private String recordStaffType;
/** /**
* 记录内容 * 记录内容
*/ */
@ -52,6 +59,7 @@ public class TaskWorkOrderRecordListVo {
/** /**
* 附件地址 * 附件地址
*/ */
@StringArrayConvert
@ApiModelProperty("附件地址") @ApiModelProperty("附件地址")
private String attachmentUrl; private String attachmentUrl;

View File

@ -10,11 +10,11 @@ import javax.annotation.PostConstruct;
import static org.springframework.integration.config.xml.IntegrationNamespaceUtils.ROLE; import static org.springframework.integration.config.xml.IntegrationNamespaceUtils.ROLE;
/** /**
* 初始化配置
* @author DB * @author DB
* @createTime 2023/11/10 12:25 * @since 2023-11-30 15:33:30
* @description 初始化配置 * @version 1.0.0
*/ */
@Component @Component
public class InitConfig { public class InitConfig {

View File

@ -14,4 +14,9 @@ public interface OamConfigKey {
* 企业微信配置信息 * 企业微信配置信息
*/ */
String[] WORK_WX_INFO = {"OamAuditStaffPhone", "OamCancelAfterVerificationStaffPhone"}; String[] WORK_WX_INFO = {"OamAuditStaffPhone", "OamCancelAfterVerificationStaffPhone"};
/**
* 需求转任务配置信息
*/
String[] DEMAND_TO_TASK = {"DemandToTaskBrand", "DemandToTaskStore"};
} }

View File

@ -15,20 +15,32 @@ public enum OamConfigEnum {
/** /**
* 核销管理员手机号 * 核销管理员手机号
*/ */
CANCEL_AFTER_VERIFICATION_STAFF_PHONE("核销管理员手机号", "OamCancelAfterVerificationStaffPhone", "cancelAfterVerificationStaffPhone",true); CANCEL_AFTER_VERIFICATION_STAFF_PHONE("核销管理员手机号", "OamCancelAfterVerificationStaffPhone",
"cancelAfterVerificationStaffPhone", true),
/**
* 需求转任务主体品牌
*/
DEMAND_TO_TASK_BRAND("需求转任务主体品牌", "DemandToTaskBrand", "oamDemandToTaskBrand", true),
/**
* 需求转任务主体校区
*/
DEMAND_TO_TASK_STORE("需求转任务主体校区", "DemandToTaskStore", "oamDemandToTaskStore", true);
/** /**
* 配置名 * 配置名
*/ */
private final String name; private final String name;
/** /**
* 配置键 * 配置键
*/ */
private final String key; private final String key;
/** /**
* 属性 * 属性
*/ */
private final String field; private final String field;
/** /**
* 配置类型(是否系统内置) * 配置类型(是否系统内置)
*/ */

View File

@ -1,8 +1,11 @@
package com.cpop.system.business.service.impl; package com.cpop.system.business.service.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cpop.common.constant.Constants;
import com.cpop.core.base.entity.LoginUser; import com.cpop.core.base.entity.LoginUser;
import com.cpop.core.utils.SecurityUtils; import com.cpop.core.utils.SecurityUtils;
import com.cpop.system.business.entity.Menu;
import com.cpop.system.business.entity.Role;
import com.cpop.system.business.service.LoginService; import com.cpop.system.business.service.LoginService;
import com.cpop.system.business.service.MenuService; import com.cpop.system.business.service.MenuService;
import com.cpop.system.business.vo.LoginUserInfoVo; import com.cpop.system.business.vo.LoginUserInfoVo;
@ -15,6 +18,15 @@ import java.util.List;
import java.util.Set; import java.util.Set;
import com.cpop.core.utils.SpringUtils; import com.cpop.core.utils.SpringUtils;
import com.cpop.system.framework.ws.server.WebSocketServer; import com.cpop.system.framework.ws.server.WebSocketServer;
import com.cpop.system.business.service.RoleService;
import static com.cpop.system.business.entity.table.MenuTableDef.MENU;
import static com.cpop.system.business.entity.table.RoleMenuTableDef.ROLE_MENU;
import static com.cpop.system.business.entity.table.RoleTableDef.ROLE;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.compress.archivers.dump.DumpArchiveEntry.PERMISSION;
import java.util.HashSet;
/** /**
* @author DB * @author DB
@ -39,8 +51,7 @@ public class LoginServiceImpl implements LoginService {
LoginUser loginUser = SecurityUtils.getInstance().getLoginUser(); LoginUser loginUser = SecurityUtils.getInstance().getLoginUser();
// 获取申请员工信息 // 获取申请员工信息
JSONObject loginStaffInfo = SecurityUtils.getInstance().getLoginUserInfo(); JSONObject loginStaffInfo = SecurityUtils.getInstance().getLoginUserInfo();
return new LoginUserInfoVo() return new LoginUserInfoVo().setUserId(loginUser.getUserId())
.setUserId(loginUser.getUserId())
.setUsername(loginUser.getUsername()) .setUsername(loginUser.getUsername())
.setRealName(loginStaffInfo.getString("name")) .setRealName(loginStaffInfo.getString("name"))
.setAvatar(loginStaffInfo.getString("avatar")) .setAvatar(loginStaffInfo.getString("avatar"))
@ -50,16 +61,35 @@ public class LoginServiceImpl implements LoginService {
} }
/** /**
* @author LOST.yuan * 获取权限码
* @Description 获取权限码 * @author DB
* @date 17:30 2022/10/19 * @since 2023-11-30 14:32:57
* @return {@link List<String>} * @version 1.0.0
**/ */
@Override @Override
public Set<String> getPermCode() { public Set<String> getPermCode() {
// 获取当前登录用户信息 // 获取当前登录用户信息
LoginUser loginUser = SecurityUtils.getInstance().getLoginUser(); JSONObject loginUser = SecurityUtils.getInstance().getLoginUserInfo();
return loginUser.getPermissions();
if (StringUtils.equals(Constants.SUPER_ADMIN, loginUser.getString("userName"))) {
Set<String> permCodes = new HashSet<>();
permCodes.add("*:*:*");
return permCodes;
} else {
List<Menu> menuPermissions = SpringUtils.getBean(MenuService.class)
.queryChain()
.select(MENU.PERMISSION)
.leftJoin(ROLE_MENU)
.on(ROLE_MENU.MENU_ID.eq(MENU.ID))
.leftJoin(ROLE)
.on(ROLE.ID.eq(ROLE_MENU.ROLE_ID))
.where(ROLE.ID.eq(loginUser.getString("roleId")))
.and(MENU.TYPE.in(1, 2))
.and(MENU.PERMISSION.isNotNull())
.list();
return menuPermissions.stream().map(Menu::getPermission).collect(Collectors.toSet());
}
} }
/** /**