新增续费管理功能
This commit is contained in:
@@ -5,7 +5,7 @@ public class TaskConstants {
|
||||
public static final Integer TOBEARRANGED = 0; // 待安排
|
||||
public static final Integer PENDING = 1; // 待处理
|
||||
public static final Integer PROCESSING = 2; // 处理中
|
||||
public static final Integer TOBECONFIRMED = 3; // 待确认
|
||||
public static final Integer TOBECONFIRMED = 3; // 待评价
|
||||
public static final Integer COMPLETED = 4; // 已完成
|
||||
public static final Integer CLOSED = 5; // 已关闭
|
||||
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
package com.gxwebsoft.oa.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.*;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.oa.entity.AppRenew;
|
||||
import com.gxwebsoft.oa.param.AppRenewParam;
|
||||
import com.gxwebsoft.oa.service.AppRenewService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 续费管理控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-11-14 14:27:57
|
||||
*/
|
||||
@Api(tags = "续费管理管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/oa/app-renew")
|
||||
public class AppRenewController extends BaseController {
|
||||
@Resource
|
||||
private AppRenewService appRenewService;
|
||||
|
||||
@ApiOperation("分页查询续费管理")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<AppRenew>> page(AppRenewParam param) {
|
||||
// 使用关联查询
|
||||
return success(appRenewService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部续费管理")
|
||||
@GetMapping()
|
||||
public ApiResult<List<AppRenew>> list(AppRenewParam param) {
|
||||
// 使用关联查询
|
||||
return success(appRenewService.listRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询续费管理")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<AppRenew> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(appRenewService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加续费管理")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody AppRenew appRenew) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
appRenew.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (appRenewService.save(appRenew)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改续费管理")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody AppRenew appRenew) {
|
||||
if (appRenewService.updateById(appRenew)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除续费管理")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (appRenewService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加续费管理")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<AppRenew> list) {
|
||||
if (appRenewService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改续费管理")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<AppRenew> batchParam) {
|
||||
if (batchParam.update(appRenewService, "app_renew_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除续费管理")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (appRenewService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,22 +1,20 @@
|
||||
package com.gxwebsoft.oa.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gxwebsoft.common.core.security.JwtUtil;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.oa.service.AppUserService;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.oa.entity.AppUser;
|
||||
import com.gxwebsoft.oa.param.AppUserParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.oa.service.AppUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -34,8 +32,10 @@ public class AppUserController extends BaseController {
|
||||
|
||||
@ApiOperation("分页查询应用成员")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<AppUser>> page(AppUserParam param) {
|
||||
public ApiResult<PageResult<AppUser>> page(AppUserParam param, HttpServletRequest request) {
|
||||
// 使用关联查询
|
||||
param.setToken(JwtUtil.getAccessToken(request));
|
||||
param.setTenantId(getTenantId());
|
||||
return success(appUserService.pageRel(param));
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class AppUserController extends BaseController {
|
||||
public ApiResult<List<AppUser>> list(AppUserParam param) {
|
||||
// 使用关联查询
|
||||
if (param.getAppId() == null) {
|
||||
return fail("AppId不存在",null);
|
||||
return fail("AppId不存在",null);
|
||||
}
|
||||
return success(appUserService.listRel(param));
|
||||
}
|
||||
@@ -81,10 +81,10 @@ public class AppUserController extends BaseController {
|
||||
@ApiOperation("删除应用成员")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (appUserService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
if (appUserService.removeById(id)) {
|
||||
return success("移除成功");
|
||||
}
|
||||
return fail("移除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加应用成员")
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
package com.gxwebsoft.oa.controller;
|
||||
|
||||
import cn.hutool.core.date.DateField;
|
||||
import cn.hutool.core.date.DateRange;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.gxwebsoft.common.core.security.JwtUtil;
|
||||
import com.gxwebsoft.common.core.utils.MyQrCodeUtil;
|
||||
@@ -13,8 +10,10 @@ import com.gxwebsoft.common.system.entity.Role;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.oa.entity.Task;
|
||||
import com.gxwebsoft.oa.entity.TaskCount;
|
||||
import com.gxwebsoft.oa.entity.TaskRecord;
|
||||
import com.gxwebsoft.oa.param.TaskParam;
|
||||
import com.gxwebsoft.oa.service.TaskCountService;
|
||||
import com.gxwebsoft.oa.service.TaskRecordService;
|
||||
import com.gxwebsoft.oa.service.TaskService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -46,13 +45,15 @@ public class TaskController extends BaseController {
|
||||
@Resource
|
||||
private TaskService taskService;
|
||||
@Resource
|
||||
private TaskRecordService taskRecordService;
|
||||
@Resource
|
||||
private TaskCountService taskCountService;
|
||||
|
||||
@ApiOperation("分页查询任务记录表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<Task>> page(TaskParam param) {
|
||||
// 使用关联查询
|
||||
param.setLoginUser(getLoginUser());
|
||||
param.setLoginUserId(getLoginUserId());
|
||||
return success(taskService.pageRel(param));
|
||||
}
|
||||
|
||||
@@ -194,15 +195,16 @@ public class TaskController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 定时结算已解决待确认的工单的任务
|
||||
* 定时结算已解决待评价的工单的任务
|
||||
* 1个小时内没有用户再次提交新的回复则自动结算
|
||||
* 时间间隔2分钟执行一次
|
||||
*/
|
||||
@Scheduled(cron="*/1 * * * * *")
|
||||
@Scheduled(cron="*/30 * * * * *")
|
||||
public void updateProgressTask() {
|
||||
// System.out.println("定时任务开始:updateProgressTask = " + DateUtil.now());
|
||||
TaskParam taskParam = new TaskParam();
|
||||
taskParam.setProgress(TOBECONFIRMED);
|
||||
// taskParam.setTaskId(689);
|
||||
taskParam.setLimit(10L);
|
||||
final PageResult<Task> result = taskService.pageRelAll(taskParam);
|
||||
if(result.getCount() == 0){
|
||||
@@ -213,7 +215,7 @@ public class TaskController extends BaseController {
|
||||
list.forEach(task -> {
|
||||
try {
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date newDate = DateUtil.offset(task.getUpdateTime(), DateField.MINUTE, 1);
|
||||
Date newDate = DateUtil.offset(task.getUpdateTime(), DateField.MINUTE, 60 * 24);
|
||||
Date date1 = df.parse(newDate.toString());
|
||||
Date date2 = df.parse(DateUtil.now());
|
||||
final boolean after = date2.after(date1);
|
||||
@@ -222,7 +224,14 @@ public class TaskController extends BaseController {
|
||||
task.setProgress(COMPLETED);
|
||||
task.setStatus(TASK_STATUS_1);
|
||||
taskService.updateByIdAll(task);
|
||||
System.out.println("已解决的工单半个小时未确认则自动确认 = " + task.getTaskId());
|
||||
// 待评价的工单超过24小时没有评价则自动确认
|
||||
final TaskRecord taskRecord = new TaskRecord();
|
||||
taskRecord.setTaskId(task.getTaskId());
|
||||
taskRecord.setContent("超过24小时没有评价的工单系统已自动评价");
|
||||
taskRecord.setTenantId(task.getTenantId());
|
||||
final boolean save = taskRecordService.save(taskRecord);
|
||||
System.out.println("save = " + save);
|
||||
System.out.println("超过24小时没有评价的工单已自动确认 = " + task.getTaskId());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package com.gxwebsoft.oa.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.config.ConfigProperties;
|
||||
import com.gxwebsoft.common.core.security.JwtUtil;
|
||||
import com.gxwebsoft.common.core.utils.CommonUtil;
|
||||
import com.gxwebsoft.common.core.web.*;
|
||||
import com.gxwebsoft.common.system.entity.Role;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.oa.entity.Task;
|
||||
import com.gxwebsoft.oa.entity.TaskRecord;
|
||||
|
||||
@@ -1,19 +1,16 @@
|
||||
package com.gxwebsoft.oa.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 应用管理记录表
|
||||
*
|
||||
@@ -178,6 +175,9 @@ public class App implements Serializable {
|
||||
@ApiModelProperty(value = "附件3")
|
||||
private String file3;
|
||||
|
||||
@ApiModelProperty(value = "服务到期时间")
|
||||
private Date expirationTime;
|
||||
|
||||
@ApiModelProperty(value = "应用状态")
|
||||
private String appStatus;
|
||||
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.gxwebsoft.oa.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 续费管理
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-11-14 14:27:57
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "AppRenew对象", description = "续费管理")
|
||||
@TableName("oa_app_renew")
|
||||
public class AppRenew implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "自增ID")
|
||||
@TableId(value = "app_renew_id", type = IdType.AUTO)
|
||||
private Integer appRenewId;
|
||||
|
||||
@ApiModelProperty(value = "续费金额")
|
||||
private BigDecimal money;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date startTime;
|
||||
|
||||
@ApiModelProperty(value = "到期时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "用户昵称")
|
||||
private String nickname;
|
||||
|
||||
@ApiModelProperty(value = "应用ID")
|
||||
private Integer appId;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1待确认")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -1,18 +1,17 @@
|
||||
package com.gxwebsoft.oa.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 应用成员
|
||||
*
|
||||
@@ -39,7 +38,7 @@ public class AppUser implements Serializable {
|
||||
@ApiModelProperty(value = "应用ID")
|
||||
private Integer appId;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1待确认")
|
||||
@ApiModelProperty(value = "状态, 0正常, 1待评价")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
|
||||
@@ -39,7 +39,7 @@ public class AssetsUser implements Serializable {
|
||||
@ApiModelProperty(value = "应用ID")
|
||||
private Integer assetsId;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1待确认")
|
||||
@ApiModelProperty(value = "状态, 0正常, 1待评价")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
package com.gxwebsoft.oa.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import java.io.Serializable;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 企业信息
|
||||
*
|
||||
@@ -67,10 +64,10 @@ public class Company implements Serializable {
|
||||
private String businessEntity;
|
||||
|
||||
@ApiModelProperty(value = "服务开始时间")
|
||||
private LocalDateTime startTime;
|
||||
private Date startTime;
|
||||
|
||||
@ApiModelProperty(value = "服务到期时间")
|
||||
private LocalDateTime expirationTime;
|
||||
private Date expirationTime;
|
||||
|
||||
@ApiModelProperty(value = "应用版本 10体验版 20授权版 30旗舰版")
|
||||
private Integer version;
|
||||
@@ -173,9 +170,9 @@ public class Company implements Serializable {
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.oa.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.oa.entity.AppRenew;
|
||||
import com.gxwebsoft.oa.param.AppRenewParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 续费管理Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-11-14 14:27:57
|
||||
*/
|
||||
public interface AppRenewMapper extends BaseMapper<AppRenew> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<AppRenew>
|
||||
*/
|
||||
List<AppRenew> selectPageRel(@Param("page") IPage<AppRenew> page,
|
||||
@Param("param") AppRenewParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<AppRenew> selectListRel(@Param("param") AppRenewParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.oa.mapper.AppRenewMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM oa_app_renew a
|
||||
<where>
|
||||
<if test="param.appRenewId != null">
|
||||
AND a.app_renew_id = #{param.appRenewId}
|
||||
</if>
|
||||
<if test="param.money != null">
|
||||
AND a.money = #{param.money}
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.startTime != null">
|
||||
AND a.start_time LIKE CONCAT('%', #{param.startTime}, '%')
|
||||
</if>
|
||||
<if test="param.endTime != null">
|
||||
AND a.end_time LIKE CONCAT('%', #{param.endTime}, '%')
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.appId != null">
|
||||
AND a.app_id = #{param.appId}
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.oa.entity.AppRenew">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.oa.entity.AppRenew">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -28,6 +28,13 @@
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (b.nickname LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
OR b.email LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
OR b.username LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
OR b.phone LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.gxwebsoft.oa.param;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 续费管理查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-11-14 14:27:57
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@ApiModel(value = "AppRenewParam对象", description = "续费管理查询参数")
|
||||
public class AppRenewParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "自增ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer appRenewId;
|
||||
|
||||
@ApiModelProperty(value = "续费金额")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal money;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
private String startTime;
|
||||
|
||||
@ApiModelProperty(value = "到期时间")
|
||||
private String endTime;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "应用ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer appId;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1待确认")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -39,7 +39,7 @@ public class AppUserParam extends BaseParam {
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer appId;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1待确认")
|
||||
@ApiModelProperty(value = "状态, 0正常, 1待评价")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public class AssetsUserParam extends BaseParam {
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer assetsId;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1待确认")
|
||||
@ApiModelProperty(value = "状态, 0正常, 1待评价")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
|
||||
@@ -120,4 +120,7 @@ public class TaskParam extends BaseParam {
|
||||
@ApiModelProperty(value = "当前登录用户")
|
||||
private User loginUser;
|
||||
|
||||
@ApiModelProperty(value = "当前登录用户Id")
|
||||
private Integer loginUserId;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.gxwebsoft.oa.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.oa.entity.AppRenew;
|
||||
import com.gxwebsoft.oa.param.AppRenewParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 续费管理Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-11-14 14:27:57
|
||||
*/
|
||||
public interface AppRenewService extends IService<AppRenew> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<AppRenew>
|
||||
*/
|
||||
PageResult<AppRenew> pageRel(AppRenewParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<AppRenew>
|
||||
*/
|
||||
List<AppRenew> listRel(AppRenewParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param appRenewId 自增ID
|
||||
* @return AppRenew
|
||||
*/
|
||||
AppRenew getByIdRel(Integer appRenewId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.gxwebsoft.oa.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.oa.mapper.AppRenewMapper;
|
||||
import com.gxwebsoft.oa.service.AppRenewService;
|
||||
import com.gxwebsoft.oa.entity.AppRenew;
|
||||
import com.gxwebsoft.oa.param.AppRenewParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 续费管理Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-11-14 14:27:57
|
||||
*/
|
||||
@Service
|
||||
public class AppRenewServiceImpl extends ServiceImpl<AppRenewMapper, AppRenew> implements AppRenewService {
|
||||
|
||||
@Override
|
||||
public PageResult<AppRenew> pageRel(AppRenewParam param) {
|
||||
PageParam<AppRenew, AppRenewParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
List<AppRenew> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AppRenew> listRel(AppRenewParam param) {
|
||||
List<AppRenew> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<AppRenew, AppRenewParam> page = new PageParam<>();
|
||||
//page.setDefaultOrder("create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AppRenew getByIdRel(Integer appRenewId) {
|
||||
AppRenewParam param = new AppRenewParam();
|
||||
param.setAppRenewId(appRenewId);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,15 +1,27 @@
|
||||
package com.gxwebsoft.oa.service.impl;
|
||||
|
||||
import cn.hutool.core.net.url.UrlBuilder;
|
||||
import cn.hutool.core.net.url.UrlQuery;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.TypeReference;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.oa.mapper.AppUserMapper;
|
||||
import com.gxwebsoft.oa.service.AppUserService;
|
||||
import com.gxwebsoft.oa.entity.AppUser;
|
||||
import com.gxwebsoft.oa.param.AppUserParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.oa.entity.AppUser;
|
||||
import com.gxwebsoft.oa.mapper.AppUserMapper;
|
||||
import com.gxwebsoft.oa.param.AppUserParam;
|
||||
import com.gxwebsoft.oa.service.AppUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 应用成员Service实现
|
||||
@@ -20,28 +32,62 @@ import java.util.List;
|
||||
@Service
|
||||
public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> implements AppUserService {
|
||||
|
||||
@Override
|
||||
public PageResult<AppUser> pageRel(AppUserParam param) {
|
||||
PageParam<AppUser, AppUserParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
List<AppUser> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
@Override
|
||||
public PageResult<AppUser> pageRel(AppUserParam param) {
|
||||
PageParam<AppUser, AppUserParam> page = new PageParam<>(param);
|
||||
// page.setDefaultOrder("create_time desc");
|
||||
List<AppUser> list = baseMapper.selectPageRel(page, param);
|
||||
PageResult<AppUser> result = new PageResult<>(list, page.getTotal());
|
||||
final List<AppUser> appUserList = result.getList();
|
||||
final Set<Integer> userIds = appUserList.stream().map(AppUser::getUserId).collect(Collectors.toSet());
|
||||
// 请求主服务器获取用户信息
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("userIds", userIds);
|
||||
// 链式构建GET请求
|
||||
final String build = UrlBuilder.of("https://server.gxwebsoft.com/api/system/user/page").setQuery(new UrlQuery(map)).build();
|
||||
String response = HttpRequest.get(build)
|
||||
.header("Authorization", param.getToken())
|
||||
.header("Tenantid", param.getTenantId().toString())
|
||||
.body(JSONObject.toJSONString(map))//表单内容
|
||||
.timeout(20000)//超时,毫秒
|
||||
.execute().body();
|
||||
|
||||
@Override
|
||||
public List<AppUser> listRel(AppUserParam param) {
|
||||
List<AppUser> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<AppUser, AppUserParam> page = new PageParam<>();
|
||||
//page.setDefaultOrder("create_time desc");
|
||||
return page.sortRecords(list);
|
||||
final ApiResult<PageResult<User>> userResult = JSONObject.parseObject(response, new TypeReference<ApiResult<PageResult<User>>>() {
|
||||
});
|
||||
final PageResult<User> data = userResult.getData();
|
||||
System.out.println("data = " + data);
|
||||
final List<User> userList = data.getList();
|
||||
if (!CollectionUtils.isEmpty(userList)) {
|
||||
final Map<Integer, List<User>> collect = userList.stream().collect(Collectors.groupingBy(User::getUserId));
|
||||
appUserList.forEach(item -> {
|
||||
final List<User> users = collect.get(item.getUserId());
|
||||
if (!CollectionUtils.isEmpty(users)) {
|
||||
final User user = users.get(0);
|
||||
item.setNickname(user.getNickname());
|
||||
item.setAvatar(user.getAvatar());
|
||||
item.setPhone(user.getPhone());
|
||||
item.setEmail(user.getEmail());
|
||||
}
|
||||
});
|
||||
result.setList(appUserList);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AppUser getByIdRel(Integer appUserId) {
|
||||
AppUserParam param = new AppUserParam();
|
||||
param.setAppUserId(appUserId);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
@Override
|
||||
public List<AppUser> listRel(AppUserParam param) {
|
||||
List<AppUser> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<AppUser, AppUserParam> page = new PageParam<>();
|
||||
//page.setDefaultOrder("create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AppUser getByIdRel(Integer appUserId) {
|
||||
AppUserParam param = new AppUserParam();
|
||||
param.setAppUserId(appUserId);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,23 +5,16 @@ import cn.hutool.core.net.url.UrlQuery;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.TypeReference;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.oa.entity.Task;
|
||||
import com.gxwebsoft.oa.entity.TaskRecord;
|
||||
import com.gxwebsoft.oa.mapper.TaskCountMapper;
|
||||
import com.gxwebsoft.oa.service.TaskCountService;
|
||||
import com.gxwebsoft.oa.entity.TaskCount;
|
||||
import com.gxwebsoft.oa.param.TaskCountParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.oa.service.TaskService;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.common.system.service.UserRoleService;
|
||||
import com.gxwebsoft.oa.entity.TaskCount;
|
||||
import com.gxwebsoft.oa.mapper.TaskCountMapper;
|
||||
import com.gxwebsoft.oa.param.TaskCountParam;
|
||||
import com.gxwebsoft.oa.service.TaskCountService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
@@ -40,17 +33,22 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Service
|
||||
public class TaskCountServiceImpl extends ServiceImpl<TaskCountMapper, TaskCount> implements TaskCountService {
|
||||
@Resource
|
||||
private UserRoleService userRoleService;
|
||||
|
||||
@Override
|
||||
public PageResult<TaskCount> pageRel(TaskCountParam param) {
|
||||
|
||||
PageParam<TaskCount, TaskCountParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("month desc");
|
||||
List<TaskCount> list = baseMapper.selectPageRel(page, param);
|
||||
final PageResult<TaskCount> result = new PageResult<>(list, page.getTotal());
|
||||
// 请求主服务器获取用户信息
|
||||
final List<TaskCount> taskCountList = result.getList();
|
||||
System.out.println("taskCountList = " + taskCountList);
|
||||
System.out.println("taskCountList = " + taskCountList);
|
||||
final Set<Integer> userIds = taskCountList.stream().map(TaskCount::getUserId).collect(Collectors.toSet());
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
// map.put("roleCode","commander");
|
||||
map.put("userIds", userIds);
|
||||
if (!userIds.isEmpty()) {
|
||||
// 链式构建GET请求
|
||||
|
||||
@@ -1,33 +1,27 @@
|
||||
package com.gxwebsoft.oa.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.*;
|
||||
import cn.hutool.core.date.DateField;
|
||||
import cn.hutool.core.date.DateRange;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.common.core.utils.JSONUtil;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.common.system.param.CompanyParam;
|
||||
import com.gxwebsoft.oa.entity.Company;
|
||||
import com.gxwebsoft.oa.entity.Task;
|
||||
import com.gxwebsoft.oa.entity.TaskCount;
|
||||
import com.gxwebsoft.oa.entity.TaskRecord;
|
||||
import com.gxwebsoft.oa.mapper.TaskMapper;
|
||||
import com.gxwebsoft.oa.param.TaskParam;
|
||||
import com.gxwebsoft.oa.service.TaskCountService;
|
||||
import com.gxwebsoft.oa.service.TaskRecordService;
|
||||
import com.gxwebsoft.oa.service.TaskService;
|
||||
import com.gxwebsoft.oa.entity.Task;
|
||||
import com.gxwebsoft.oa.param.TaskParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@@ -53,6 +47,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
||||
PageParam<Task, TaskParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
List<Task> list = baseMapper.selectPageRel(page, param);
|
||||
System.out.println("param2222 = " + param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@@ -169,35 +164,35 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
||||
// 查询待处理的工单总数量
|
||||
final int pendingTasks = count(new LambdaQueryWrapper<Task>().eq(Task::getStatus, TASK_STATUS_0));
|
||||
// 查询今日已处理的工单数量
|
||||
final int todayTasks = count(new LambdaQueryWrapper<Task>().between(Task::getUpdateTime, dayStart, dayEnd).eq(Task::getStatus,TASK_STATUS_1));
|
||||
final int todayTasks = count(new LambdaQueryWrapper<Task>().between(Task::getUpdateTime, dayStart, dayEnd).eq(Task::getProgress,COMPLETED).eq(Task::getStatus,TASK_STATUS_1));
|
||||
// 查询本月已处理的工单数量
|
||||
final int monthTasks = count(new LambdaQueryWrapper<Task>().between(Task::getUpdateTime, monthStart, monthEnd).eq(Task::getStatus,TASK_STATUS_1));
|
||||
final int monthTasks = count(new LambdaQueryWrapper<Task>().between(Task::getUpdateTime, monthStart, monthEnd).eq(Task::getProgress,COMPLETED).eq(Task::getStatus,TASK_STATUS_1));
|
||||
// 查询本年已处理的工单总数量
|
||||
final int yearTasks = count(new LambdaQueryWrapper<Task>().between(Task::getUpdateTime, yearStart, yearEnd).eq(Task::getStatus, TASK_STATUS_1));
|
||||
final int yearTasks = count(new LambdaQueryWrapper<Task>().between(Task::getCreateTime, yearStart, yearEnd).eq(Task::getProgress,COMPLETED).eq(Task::getStatus, TASK_STATUS_1));
|
||||
// 查询公司总处理工单数量
|
||||
final int totalTasks = count(new LambdaQueryWrapper<Task>().eq(Task::getStatus, TASK_STATUS_1));
|
||||
final int totalTasks = count(new LambdaQueryWrapper<Task>().eq(Task::getProgress,COMPLETED).eq(Task::getStatus, TASK_STATUS_1));
|
||||
|
||||
// 查询当前登录用户待处理的工单数量
|
||||
final int userPendingTasks = count(new LambdaQueryWrapper<Task>().eq(Task::getStatus, TASK_STATUS_1).eq(Task::getUserId,task.getUserId()));
|
||||
final int userPendingTasks = count(new LambdaQueryWrapper<Task>().eq(Task::getProgress,COMPLETED).eq(Task::getStatus, TASK_STATUS_1).eq(Task::getUserId,task.getUserId()));
|
||||
// 查询当前登录用户今日已处理的工单数量
|
||||
final int userTodayTasks = count(new LambdaQueryWrapper<Task>().between(Task::getUpdateTime,dayStart,dayEnd).eq(Task::getStatus, TASK_STATUS_1).eq(Task::getUserId,task.getUserId()));
|
||||
final int userTodayTasks = count(new LambdaQueryWrapper<Task>().between(Task::getUpdateTime,dayStart,dayEnd).eq(Task::getProgress,COMPLETED).eq(Task::getStatus, TASK_STATUS_1).eq(Task::getUserId,task.getUserId()));
|
||||
// 查询当前登录用户本月已处理的工单数量
|
||||
final int userMonthTasks = count(new LambdaQueryWrapper<Task>().between(Task::getUpdateTime,monthStart,monthEnd).eq(Task::getStatus, TASK_STATUS_1).eq(Task::getUserId,task.getUserId()));
|
||||
final int userMonthTasks = count(new LambdaQueryWrapper<Task>().between(Task::getUpdateTime,monthStart,monthEnd).eq(Task::getProgress,COMPLETED).eq(Task::getStatus, TASK_STATUS_1).eq(Task::getUserId,task.getUserId()));
|
||||
// 查询当前登录用户本年已处理的工单数量
|
||||
final int userYearTasks = count(new LambdaQueryWrapper<Task>().between(Task::getUpdateTime,yearStart,yearEnd).eq(Task::getStatus, TASK_STATUS_1).eq(Task::getUserId,task.getUserId()));
|
||||
final int userYearTasks = count(new LambdaQueryWrapper<Task>().between(Task::getCreateTime,yearStart,yearEnd).eq(Task::getProgress,COMPLETED).eq(Task::getStatus, TASK_STATUS_1).eq(Task::getUserId,task.getUserId()));
|
||||
// 查询当前登录用户已处理的总工单数量
|
||||
final int userTotalTasks = count(new LambdaQueryWrapper<Task>().eq(Task::getStatus, TASK_STATUS_1).eq(Task::getUserId,task.getUserId()));
|
||||
final int userTotalTasks = count(new LambdaQueryWrapper<Task>().eq(Task::getProgress,COMPLETED).eq(Task::getStatus, TASK_STATUS_1).eq(Task::getUserId,task.getUserId()));
|
||||
|
||||
// 查询受理人待处理的工单数量
|
||||
final int commanderPendingTasks = count(new LambdaQueryWrapper<Task>().eq(Task::getStatus, TASK_STATUS_0).eq(Task::getCommander,task.getCommander()));
|
||||
// 查询受理人今日已处理的工单数量
|
||||
final int commanderTodayTasks = count(new LambdaQueryWrapper<Task>().between(Task::getUpdateTime,dayStart,dayEnd).eq(Task::getStatus, TASK_STATUS_1).eq(Task::getCommander,task.getCommander()));
|
||||
final int commanderTodayTasks = count(new LambdaQueryWrapper<Task>().between(Task::getUpdateTime,dayStart,dayEnd).eq(Task::getProgress,COMPLETED).eq(Task::getStatus, TASK_STATUS_1).eq(Task::getCommander,task.getCommander()));
|
||||
// 查询受理人本月已处理的工单数量
|
||||
final int commanderMonthTasks = count(new LambdaQueryWrapper<Task>().between(Task::getUpdateTime,monthStart,monthEnd).eq(Task::getStatus, TASK_STATUS_1).eq(Task::getCommander,task.getCommander()));
|
||||
final int commanderMonthTasks = count(new LambdaQueryWrapper<Task>().between(Task::getUpdateTime,monthStart,monthEnd).eq(Task::getProgress,COMPLETED).eq(Task::getStatus, TASK_STATUS_1).eq(Task::getCommander,task.getCommander()));
|
||||
// 查询受理人本年已处理的工单数量
|
||||
final int commanderYearTasks = count(new LambdaQueryWrapper<Task>().between(Task::getUpdateTime,yearStart,yearEnd).eq(Task::getStatus, TASK_STATUS_1).eq(Task::getCommander,task.getCommander()));
|
||||
final int commanderYearTasks = count(new LambdaQueryWrapper<Task>().between(Task::getCreateTime,yearStart,yearEnd).eq(Task::getProgress,COMPLETED).eq(Task::getStatus, TASK_STATUS_1).eq(Task::getCommander,task.getCommander()));
|
||||
// 查询受理人已处理的总工单数量
|
||||
final int commanderTotalTasks = count(new LambdaQueryWrapper<Task>().eq(Task::getStatus, TASK_STATUS_1).eq(Task::getCommander,task.getCommander()));
|
||||
final int commanderTotalTasks = count(new LambdaQueryWrapper<Task>().eq(Task::getProgress,COMPLETED).eq(Task::getStatus, TASK_STATUS_1).eq(Task::getCommander,task.getCommander()));
|
||||
|
||||
// 统计工单发起人
|
||||
if (taskCountService.count(new LambdaQueryWrapper<TaskCount>().eq(TaskCount::getUserId,task.getUserId())) == 0) {
|
||||
@@ -231,13 +226,15 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
||||
taskCount.setRoleCode("superAdmin");
|
||||
taskCountService.save(taskCount);
|
||||
}
|
||||
final TaskCount superAdmin = taskCountService.getOne(new LambdaQueryWrapper<TaskCount>().eq(TaskCount::getUserId,0).eq(TaskCount::getRoleCode, "superAdmin"));
|
||||
superAdmin.setPending(pendingTasks);
|
||||
superAdmin.setToday(todayTasks);
|
||||
superAdmin.setMonth(monthTasks);
|
||||
superAdmin.setYear(yearTasks);
|
||||
superAdmin.setTotal(totalTasks);
|
||||
taskCountService.updateById(superAdmin);
|
||||
final TaskCount superAdmin = taskCountService.getByUserId(param.getLoginUserId());
|
||||
if (superAdmin.getRoleCode().equals("superAdmin") || superAdmin.getRoleCode().equals("admin")) {
|
||||
superAdmin.setPending(pendingTasks);
|
||||
superAdmin.setToday(todayTasks);
|
||||
superAdmin.setMonth(monthTasks);
|
||||
superAdmin.setYear(yearTasks);
|
||||
superAdmin.setTotal(totalTasks);
|
||||
taskCountService.updateById(superAdmin);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user