提交
This commit is contained in:
parent
99834c633a
commit
282fb562f1
|
@ -0,0 +1,26 @@
|
|||
package com.ruoyi.bst.project.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.bst.project.domain.ProjectVO;
|
||||
|
||||
public interface ProjectAssembler {
|
||||
|
||||
/**
|
||||
* 组装任务总数量
|
||||
* @param list
|
||||
*/
|
||||
void assembleTaskCount(List<ProjectVO> list);
|
||||
|
||||
/**
|
||||
* 组装任务完成数量
|
||||
* @param list
|
||||
*/
|
||||
void assembleTaskPassCount(List<ProjectVO> list);
|
||||
|
||||
/**
|
||||
* 组装任务待确认数量
|
||||
* @param list
|
||||
*/
|
||||
void assembleTaskWaitConfirmCount(List<ProjectVO> list);
|
||||
}
|
|
@ -0,0 +1,86 @@
|
|||
package com.ruoyi.bst.project.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ruoyi.bst.project.domain.ProjectVO;
|
||||
import com.ruoyi.bst.project.service.ProjectAssembler;
|
||||
import com.ruoyi.bst.task.domain.TaskQuery;
|
||||
import com.ruoyi.bst.task.domain.enums.TaskStatus;
|
||||
import com.ruoyi.bst.task.service.TaskService;
|
||||
import com.ruoyi.common.utils.collection.CollectionUtils;
|
||||
import com.ruoyi.common.vo.LongIntegerVO;
|
||||
|
||||
@Service
|
||||
public class ProjectAssemblerImpl implements ProjectAssembler {
|
||||
|
||||
@Autowired
|
||||
private TaskService taskService;
|
||||
|
||||
@Override
|
||||
public void assembleTaskCount(List<ProjectVO> list) {
|
||||
if (CollectionUtils.isEmptyElement(list)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Map<Long, Integer> taskCountMap = this.selectTaskCountByProjects(list, null);
|
||||
|
||||
for (ProjectVO project : list) {
|
||||
Integer count = taskCountMap.get(project.getId());
|
||||
if (count == null) {
|
||||
count = 0;
|
||||
}
|
||||
project.setTaskCount(count);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void assembleTaskPassCount(List<ProjectVO> list) {
|
||||
if (CollectionUtils.isEmptyElement(list)) {
|
||||
return;
|
||||
}
|
||||
Map<Long, Integer> taskCountMap = this.selectTaskCountByProjects(list, TaskStatus.PASS.getStatus());
|
||||
|
||||
for (ProjectVO project : list) {
|
||||
Integer count = taskCountMap.get(project.getId());
|
||||
if (count == null) {
|
||||
count = 0;
|
||||
}
|
||||
project.setTaskPassCount(count);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void assembleTaskWaitConfirmCount(List<ProjectVO> list) {
|
||||
if (CollectionUtils.isEmptyElement(list)) {
|
||||
return;
|
||||
}
|
||||
Map<Long, Integer> taskCountMap = this.selectTaskCountByProjects(list, TaskStatus.WAIT_CONFIRM.getStatus());
|
||||
|
||||
for (ProjectVO project : list) {
|
||||
Integer count = taskCountMap.get(project.getId());
|
||||
if (count == null) {
|
||||
count = 0;
|
||||
}
|
||||
project.setTaskWaitConfirmCount(count);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据项目id查询任务数量
|
||||
*/
|
||||
private Map<Long, Integer> selectTaskCountByProjects(List<ProjectVO> list, String status) {
|
||||
TaskQuery query = new TaskQuery();
|
||||
query.setStatus(status);
|
||||
query.setProjectIds(CollectionUtils.map(list, ProjectVO::getId));
|
||||
return taskService.selectCountGroupByProject(query)
|
||||
.stream()
|
||||
.filter(vo -> vo.getKey() != null)
|
||||
.collect(Collectors.toMap(LongIntegerVO::getKey, LongIntegerVO::getValue));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.ruoyi.bst.task.domain.dto;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TaskCancelDTO {
|
||||
|
||||
@ApiModelProperty("任务ID")
|
||||
@NotNull(message = "任务ID不能为空")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("取消备注")
|
||||
@NotBlank(message = "取消备注不能为空")
|
||||
@Size(max = 200, message = "取消备注不能超过200个字符")
|
||||
private String cancelRemark;
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.ruoyi.bst.task.domain.dto;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TaskStartDTO {
|
||||
|
||||
@ApiModelProperty("任务ID")
|
||||
@NotNull(message = "任务ID不能为空")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("预计完成时间")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime expectFinishTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.ruoyi.bst.task.domain.dto;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TaskSubmitDTO {
|
||||
|
||||
@ApiModelProperty("任务ID")
|
||||
@NotNull(message = "任务ID不能为空")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("提交附件")
|
||||
private String submitAttaches;
|
||||
|
||||
@ApiModelProperty("提交备注")
|
||||
@Size(max = 200, message = "提交备注长度不能超过200个字符")
|
||||
private String submitRemark;
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.ruoyi.bst.task.domain.dto;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TaskVerifyDTO {
|
||||
|
||||
@ApiModelProperty("任务ID")
|
||||
@NotNull(message = "任务ID不能为空")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("审核结果")
|
||||
@NotNull(message = "审核结果不能为空")
|
||||
private Boolean pass;
|
||||
|
||||
@ApiModelProperty("审核备注")
|
||||
@Size(max = 200, message = "审核备注长度不能超过200个字符")
|
||||
private String remark;
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.ruoyi.bst.task.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.bst.task.domain.TaskVO;
|
||||
|
||||
public interface TaskAssembler {
|
||||
|
||||
/**
|
||||
* 组装提交列表
|
||||
* @param list 任务列表
|
||||
*/
|
||||
void assembleSubmitList(List<TaskVO> list);
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.ruoyi.bst.task.service;
|
||||
|
||||
public interface TaskValidator {
|
||||
|
||||
/**
|
||||
* 校验用户是否能提交任务
|
||||
* @param id 任务ID
|
||||
* @param userId 用户ID
|
||||
* @return 是否能提交
|
||||
*/
|
||||
boolean allowSubmit(Long id, Long userId);
|
||||
|
||||
/**
|
||||
* 校验用户是否能开始任务
|
||||
* @param id 任务ID
|
||||
* @param userId 用户ID
|
||||
* @return 是否能开始
|
||||
*/
|
||||
boolean allowStart(Long id, Long userId);
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package com.ruoyi.bst.task.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ruoyi.bst.task.domain.TaskVO;
|
||||
import com.ruoyi.bst.task.service.TaskAssembler;
|
||||
import com.ruoyi.bst.taskSubmit.domain.TaskSubmitVO;
|
||||
import com.ruoyi.bst.taskSubmit.service.TaskSubmitService;
|
||||
import com.ruoyi.common.utils.collection.CollectionUtils;
|
||||
|
||||
@Service
|
||||
public class TaskAssemblerImpl implements TaskAssembler {
|
||||
|
||||
|
||||
@Autowired
|
||||
private TaskSubmitService taskSubmitService;
|
||||
|
||||
@Override
|
||||
public void assembleSubmitList(List<TaskVO> list) {
|
||||
if (CollectionUtils.isEmptyElement(list)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 查询列表
|
||||
List<Long> taskIds = CollectionUtils.map(list, TaskVO::getId);
|
||||
List<TaskSubmitVO> submitList = taskSubmitService.selectListByTaskIds(taskIds);
|
||||
|
||||
// 组装审核列表
|
||||
for (TaskVO task : list) {
|
||||
List<TaskSubmitVO> taskSubmitList = submitList.stream()
|
||||
.filter(item -> Objects.equals(item.getTaskId(), task.getId()))
|
||||
.collect(Collectors.toList());
|
||||
task.setSubmitList(taskSubmitList);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package com.ruoyi.bst.task.service.impl;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ruoyi.bst.task.domain.Task;
|
||||
import com.ruoyi.bst.task.domain.TaskVO;
|
||||
import com.ruoyi.bst.task.service.TaskService;
|
||||
import com.ruoyi.bst.task.service.TaskValidator;
|
||||
|
||||
@Service
|
||||
public class TaskValidatorImpl implements TaskValidator{
|
||||
|
||||
@Autowired
|
||||
private TaskService taskService;
|
||||
|
||||
@Override
|
||||
public boolean allowSubmit(Long id, Long userId) {
|
||||
if (id == null || userId == null) {
|
||||
return false;
|
||||
}
|
||||
TaskVO task = taskService.selectTaskById(id);
|
||||
return this.isOwner(task, userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean allowStart(Long id, Long userId) {
|
||||
if (id == null || userId == null) {
|
||||
return false;
|
||||
}
|
||||
TaskVO task = taskService.selectTaskById(id);
|
||||
return this.isOwner(task, userId);
|
||||
}
|
||||
|
||||
// 校验当前用户是否是任务的负责人
|
||||
private boolean isOwner(Task task, Long userId) {
|
||||
return task != null && task.getOwnerId() != null && task.getOwnerId().equals(userId);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package com.ruoyi.bst.taskSubmit.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 任务提交记录对象 bst_task_submit
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-08
|
||||
*/
|
||||
@Data
|
||||
public class TaskSubmit extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
@Excel(name = "任务ID")
|
||||
@ApiModelProperty("任务ID")
|
||||
private Long taskId;
|
||||
|
||||
@Excel(name = "提交人ID")
|
||||
@ApiModelProperty("提交人ID")
|
||||
private Long userId;
|
||||
|
||||
@Excel(name = "附件列表")
|
||||
@ApiModelProperty("附件列表")
|
||||
private String attaches;
|
||||
|
||||
@Excel(name = "审核ID")
|
||||
@ApiModelProperty("审核ID")
|
||||
private Long verifyId;
|
||||
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.ruoyi.bst.taskSubmit.domain;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TaskSubmitQuery extends TaskSubmitVO {
|
||||
|
||||
@ApiModelProperty(value = "任务ID列表")
|
||||
private List<Long> taskIds;
|
||||
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.ruoyi.bst.taskSubmit.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TaskSubmitVO extends TaskSubmit {
|
||||
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
package com.ruoyi.bst.taskSubmit.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.ruoyi.bst.taskSubmit.domain.TaskSubmit;
|
||||
import com.ruoyi.bst.taskSubmit.domain.TaskSubmitQuery;
|
||||
import com.ruoyi.bst.taskSubmit.domain.TaskSubmitVO;
|
||||
|
||||
/**
|
||||
* 任务提交记录Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-08
|
||||
*/
|
||||
public interface TaskSubmitMapper
|
||||
{
|
||||
/**
|
||||
* 查询任务提交记录
|
||||
*
|
||||
* @param id 任务提交记录主键
|
||||
* @return 任务提交记录
|
||||
*/
|
||||
TaskSubmitVO selectTaskSubmitById(Long id);
|
||||
|
||||
/**
|
||||
* 查询任务提交记录列表
|
||||
*
|
||||
* @param query 任务提交记录
|
||||
* @return 任务提交记录集合
|
||||
*/
|
||||
List<TaskSubmitVO> selectTaskSubmitList(@Param("query")TaskSubmitQuery query);
|
||||
|
||||
/**
|
||||
* 新增任务提交记录
|
||||
*
|
||||
* @param taskSubmit 任务提交记录
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTaskSubmit(TaskSubmit taskSubmit);
|
||||
|
||||
/**
|
||||
* 修改任务提交记录
|
||||
*
|
||||
* @param taskSubmit 任务提交记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTaskSubmit(@Param("data") TaskSubmit taskSubmit);
|
||||
|
||||
/**
|
||||
* 删除任务提交记录
|
||||
*
|
||||
* @param id 任务提交记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTaskSubmitById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除任务提交记录
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTaskSubmitByIds(Long[] ids);
|
||||
}
|
|
@ -0,0 +1,97 @@
|
|||
<?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.ruoyi.bst.taskSubmit.mapper.TaskSubmitMapper">
|
||||
|
||||
<resultMap type="TaskSubmitVO" id="TaskSubmitResult" autoMapping="true"/>
|
||||
|
||||
<sql id="selectTaskSubmitVo">
|
||||
select
|
||||
bts.id,
|
||||
bts.task_id,
|
||||
bts.user_id,
|
||||
bts.create_time,
|
||||
bts.attaches,
|
||||
bts.remark,
|
||||
bts.verify_id
|
||||
from bst_task_submit bts
|
||||
</sql>
|
||||
|
||||
<sql id="searchCondition">
|
||||
<if test="query.id != null "> and bts.id = #{query.id}</if>
|
||||
<if test="query.taskId != null "> and bts.task_id = #{query.taskId}</if>
|
||||
<if test="query.userId != null "> and bts.user_id = #{query.userId}</if>
|
||||
<if test="query.remark != null and query.remark != ''"> and bts.remark like concat('%', #{query.remark}, '%')</if>
|
||||
<if test="query.verifyId != null "> and bts.verify_id = #{query.verifyId}</if>
|
||||
<if test="query.taskIds != null and query.taskIds.size() > 0">
|
||||
and bts.task_id in
|
||||
<foreach collection="query.taskIds" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
${query.params.dataScope}
|
||||
</sql>
|
||||
|
||||
<select id="selectTaskSubmitList" parameterType="TaskSubmitQuery" resultMap="TaskSubmitResult">
|
||||
<include refid="selectTaskSubmitVo"/>
|
||||
<where>
|
||||
<include refid="searchCondition"/>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectTaskSubmitById" parameterType="Long" resultMap="TaskSubmitResult">
|
||||
<include refid="selectTaskSubmitVo"/>
|
||||
where bts.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertTaskSubmit" parameterType="TaskSubmit">
|
||||
insert into bst_task_submit
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="taskId != null">task_id,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="attaches != null">attaches,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="verifyId != null">verify_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="taskId != null">#{taskId},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="attaches != null">#{attaches},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="verifyId != null">#{verifyId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTaskSubmit" parameterType="TaskSubmit">
|
||||
update bst_task_submit
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<include refid="updateColumns"/>
|
||||
</trim>
|
||||
where id = #{data.id}
|
||||
</update>
|
||||
|
||||
<sql id="updateColumns">
|
||||
<if test="data.taskId != null">task_id = #{data.taskId},</if>
|
||||
<if test="data.userId != null">user_id = #{data.userId},</if>
|
||||
<if test="data.createTime != null">create_time = #{data.createTime},</if>
|
||||
<if test="data.attaches != null">attaches = #{data.attaches},</if>
|
||||
<if test="data.remark != null">remark = #{data.remark},</if>
|
||||
<if test="data.verifyId != null">verify_id = #{data.verifyId},</if>
|
||||
</sql>
|
||||
|
||||
<delete id="deleteTaskSubmitById" parameterType="Long">
|
||||
delete from bst_task_submit where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTaskSubmitByIds" parameterType="String">
|
||||
delete from bst_task_submit where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -0,0 +1,13 @@
|
|||
package com.ruoyi.bst.taskSubmit.service;
|
||||
|
||||
import com.ruoyi.bst.task.domain.dto.TaskSubmitDTO;
|
||||
import com.ruoyi.bst.taskSubmit.domain.TaskSubmit;
|
||||
|
||||
public interface TaskSubmitConverter {
|
||||
|
||||
/**
|
||||
* 转换为PO
|
||||
*/
|
||||
TaskSubmit toPo(TaskSubmitDTO dto);
|
||||
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
package com.ruoyi.bst.taskSubmit.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.bst.taskSubmit.domain.TaskSubmit;
|
||||
import com.ruoyi.bst.taskSubmit.domain.TaskSubmitQuery;
|
||||
import com.ruoyi.bst.taskSubmit.domain.TaskSubmitVO;
|
||||
|
||||
/**
|
||||
* 任务提交记录Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-08
|
||||
*/
|
||||
public interface TaskSubmitService
|
||||
{
|
||||
/**
|
||||
* 查询任务提交记录
|
||||
*
|
||||
* @param id 任务提交记录主键
|
||||
* @return 任务提交记录
|
||||
*/
|
||||
public TaskSubmitVO selectTaskSubmitById(Long id);
|
||||
|
||||
/**
|
||||
* 查询任务提交记录列表
|
||||
*
|
||||
* @param taskSubmit 任务提交记录
|
||||
* @return 任务提交记录集合
|
||||
*/
|
||||
public List<TaskSubmitVO> selectTaskSubmitList(TaskSubmitQuery taskSubmit);
|
||||
|
||||
/**
|
||||
* 新增任务提交记录
|
||||
*
|
||||
* @param taskSubmit 任务提交记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTaskSubmit(TaskSubmit taskSubmit);
|
||||
|
||||
/**
|
||||
* 修改任务提交记录
|
||||
*
|
||||
* @param taskSubmit 任务提交记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTaskSubmit(TaskSubmit taskSubmit);
|
||||
|
||||
/**
|
||||
* 批量删除任务提交记录
|
||||
*
|
||||
* @param ids 需要删除的任务提交记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTaskSubmitByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除任务提交记录信息
|
||||
*
|
||||
* @param id 任务提交记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTaskSubmitById(Long id);
|
||||
|
||||
/**
|
||||
* 查询任务提交记录列表
|
||||
* @param taskIds 任务ID列表
|
||||
* @return 任务提交记录列表
|
||||
*/
|
||||
List<TaskSubmitVO> selectListByTaskIds(List<Long> taskIds);
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package com.ruoyi.bst.taskSubmit.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ruoyi.bst.task.domain.dto.TaskSubmitDTO;
|
||||
import com.ruoyi.bst.taskSubmit.domain.TaskSubmit;
|
||||
import com.ruoyi.bst.taskSubmit.service.TaskSubmitConverter;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
|
||||
@Service
|
||||
public class TaskSubmitConverterImpl implements TaskSubmitConverter {
|
||||
|
||||
@Override
|
||||
public TaskSubmit toPo(TaskSubmitDTO dto) {
|
||||
if (dto == null) {
|
||||
return null;
|
||||
}
|
||||
TaskSubmit submit = new TaskSubmit();
|
||||
submit.setTaskId(dto.getId());
|
||||
submit.setUserId(SecurityUtils.getUserId());
|
||||
submit.setAttaches(dto.getSubmitAttaches());
|
||||
submit.setRemark(dto.getSubmitRemark());
|
||||
return submit;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,112 @@
|
|||
package com.ruoyi.bst.taskSubmit.service.impl;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ruoyi.bst.taskSubmit.domain.TaskSubmit;
|
||||
import com.ruoyi.bst.taskSubmit.domain.TaskSubmitQuery;
|
||||
import com.ruoyi.bst.taskSubmit.domain.TaskSubmitVO;
|
||||
import com.ruoyi.bst.taskSubmit.mapper.TaskSubmitMapper;
|
||||
import com.ruoyi.bst.taskSubmit.service.TaskSubmitService;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.collection.CollectionUtils;
|
||||
|
||||
/**
|
||||
* 任务提交记录Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-08
|
||||
*/
|
||||
@Service
|
||||
public class TaskSubmitServiceImpl implements TaskSubmitService
|
||||
{
|
||||
@Autowired
|
||||
private TaskSubmitMapper taskSubmitMapper;
|
||||
|
||||
/**
|
||||
* 查询任务提交记录
|
||||
*
|
||||
* @param id 任务提交记录主键
|
||||
* @return 任务提交记录
|
||||
*/
|
||||
@Override
|
||||
public TaskSubmitVO selectTaskSubmitById(Long id)
|
||||
{
|
||||
return taskSubmitMapper.selectTaskSubmitById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询任务提交记录列表
|
||||
*
|
||||
* @param taskSubmit 任务提交记录
|
||||
* @return 任务提交记录
|
||||
*/
|
||||
@Override
|
||||
public List<TaskSubmitVO> selectTaskSubmitList(TaskSubmitQuery taskSubmit)
|
||||
{
|
||||
return taskSubmitMapper.selectTaskSubmitList(taskSubmit);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增任务提交记录
|
||||
*
|
||||
* @param taskSubmit 任务提交记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTaskSubmit(TaskSubmit taskSubmit)
|
||||
{
|
||||
taskSubmit.setCreateTime(DateUtils.getNowDate());
|
||||
return taskSubmitMapper.insertTaskSubmit(taskSubmit);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改任务提交记录
|
||||
*
|
||||
* @param taskSubmit 任务提交记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTaskSubmit(TaskSubmit taskSubmit)
|
||||
{
|
||||
return taskSubmitMapper.updateTaskSubmit(taskSubmit);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除任务提交记录
|
||||
*
|
||||
* @param ids 需要删除的任务提交记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTaskSubmitByIds(Long[] ids)
|
||||
{
|
||||
return taskSubmitMapper.deleteTaskSubmitByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除任务提交记录信息
|
||||
*
|
||||
* @param id 任务提交记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTaskSubmitById(Long id)
|
||||
{
|
||||
return taskSubmitMapper.deleteTaskSubmitById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TaskSubmitVO> selectListByTaskIds(List<Long> taskIds) {
|
||||
if (CollectionUtils.isEmptyElement(taskIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
TaskSubmitQuery query = new TaskSubmitQuery();
|
||||
query.setTaskIds(taskIds);
|
||||
return this.selectTaskSubmitList(query);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package com.ruoyi.bst.verify.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 审核对象 bst_verify
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-08
|
||||
*/
|
||||
@Data
|
||||
public class Verify extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
@Excel(name = "业务单ID")
|
||||
@ApiModelProperty("业务单ID")
|
||||
private Long bstId;
|
||||
|
||||
@Excel(name = "业务类型")
|
||||
@ApiModelProperty("业务类型")
|
||||
private String bstType;
|
||||
|
||||
@Excel(name = "状态", readConverterExp = "1=-通过,2=-驳回")
|
||||
@ApiModelProperty("状态")
|
||||
private String status;
|
||||
|
||||
@Excel(name = "审核人ID")
|
||||
@ApiModelProperty("审核人ID")
|
||||
private Long userId;
|
||||
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.ruoyi.bst.verify.domain;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class VerifyQuery extends VerifyVO {
|
||||
|
||||
@ApiModelProperty(value = "业务ID列表")
|
||||
private List<Long> bstIds;
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.ruoyi.bst.verify.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class VerifyVO extends Verify {
|
||||
|
||||
@ApiModelProperty("审核人名称")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty("审核人头像")
|
||||
private String userAvatar;
|
||||
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.ruoyi.bst.verify.domain.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum VerifyBstType {
|
||||
|
||||
TASK("TASK", "任务");
|
||||
|
||||
private final String type;
|
||||
private final String name;
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.ruoyi.bst.verify.domain.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum VerifyStatus {
|
||||
|
||||
PASS("1", "通过"),
|
||||
REJECT("2", "驳回");
|
||||
|
||||
private final String status;
|
||||
private final String name;
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
package com.ruoyi.bst.verify.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.ruoyi.bst.verify.domain.Verify;
|
||||
import com.ruoyi.bst.verify.domain.VerifyQuery;
|
||||
import com.ruoyi.bst.verify.domain.VerifyVO;
|
||||
|
||||
/**
|
||||
* 审核Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-08
|
||||
*/
|
||||
public interface VerifyMapper
|
||||
{
|
||||
/**
|
||||
* 查询审核
|
||||
*
|
||||
* @param id 审核主键
|
||||
* @return 审核
|
||||
*/
|
||||
VerifyVO selectVerifyById(Long id);
|
||||
|
||||
/**
|
||||
* 查询审核列表
|
||||
*
|
||||
* @param query 审核
|
||||
* @return 审核集合
|
||||
*/
|
||||
List<VerifyVO> selectVerifyList(@Param("query")VerifyQuery query);
|
||||
|
||||
/**
|
||||
* 新增审核
|
||||
*
|
||||
* @param verify 审核
|
||||
* @return 结果
|
||||
*/
|
||||
int insertVerify(Verify verify);
|
||||
|
||||
/**
|
||||
* 批量新增审核
|
||||
*/
|
||||
int batchInsert(@Param("list") List<? extends Verify> list);
|
||||
|
||||
/**
|
||||
* 批量修改审核
|
||||
*/
|
||||
int batchUpdate(@Param("list") List<? extends Verify> list);
|
||||
|
||||
/**
|
||||
* 修改审核
|
||||
*
|
||||
* @param verify 审核
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateVerify(@Param("data") Verify verify);
|
||||
|
||||
/**
|
||||
* 删除审核
|
||||
*
|
||||
* @param id 审核主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteVerifyById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除审核
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int logicDel(@Param("ids") List<Long> ids);
|
||||
}
|
|
@ -0,0 +1,102 @@
|
|||
<?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.ruoyi.bst.verify.mapper.VerifyMapper">
|
||||
|
||||
<resultMap type="VerifyVO" id="VerifyResult" autoMapping="true"/>
|
||||
|
||||
<sql id="selectVerifyVo">
|
||||
select
|
||||
bv.id,
|
||||
bv.bst_id,
|
||||
bv.bst_type,
|
||||
bv.status,
|
||||
bv.user_id,
|
||||
bv.remark,
|
||||
bv.create_time,
|
||||
su.nick_name as user_name,
|
||||
su.avatar as user_avatar
|
||||
from bst_verify bv
|
||||
left join sys_user su on su.user_id = bv.user_id
|
||||
</sql>
|
||||
|
||||
<sql id="searchCondition">
|
||||
<if test="query.id != null "> and bv.id = #{query.id}</if>
|
||||
<if test="query.bstId != null "> and bv.bst_id = #{query.bstId}</if>
|
||||
<if test="query.bstType != null and query.bstType != ''"> and bv.bst_type = #{query.bstType}</if>
|
||||
<if test="query.status != null and query.status != ''"> and bv.status = #{query.status}</if>
|
||||
<if test="query.userId != null "> and bv.user_id = #{query.userId}</if>
|
||||
<if test="query.remark != null and query.remark != ''"> and bv.remark like concat('%', #{query.remark}, '%')</if>
|
||||
<if test="query.deleted != null "> and bv.deleted = #{query.deleted}</if>
|
||||
<if test="query.deleted == null "> and bv.deleted = false</if>
|
||||
<if test="query.userName != null and query.userName != ''"> and su.nick_name like concat('%', #{query.userName}, '%')</if>
|
||||
<if test="query.bstIds != null and query.bstIds.size() > 0">
|
||||
and bv.bst_id in
|
||||
<foreach item="item" collection="query.bstIds" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
${query.params.dataScope}
|
||||
</sql>
|
||||
|
||||
<select id="selectVerifyList" parameterType="VerifyQuery" resultMap="VerifyResult">
|
||||
<include refid="selectVerifyVo"/>
|
||||
<where>
|
||||
<include refid="searchCondition"/>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectVerifyById" parameterType="Long" resultMap="VerifyResult">
|
||||
<include refid="selectVerifyVo"/>
|
||||
where bv.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertVerify" parameterType="Verify" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into bst_verify
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="bstId != null">bst_id,</if>
|
||||
<if test="bstType != null and bstType != ''">bst_type,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="bstId != null">#{bstId},</if>
|
||||
<if test="bstType != null and bstType != ''">#{bstType},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateVerify" parameterType="Verify">
|
||||
update bst_verify
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<include refid="updateColumns"/>
|
||||
</trim>
|
||||
where id = #{data.id}
|
||||
</update>
|
||||
|
||||
<sql id="updateColumns">
|
||||
<if test="data.bstId != null">bst_id = #{data.bstId},</if>
|
||||
<if test="data.bstType != null and data.bstType != ''">bst_type = #{data.bstType},</if>
|
||||
<if test="data.status != null and data.status != ''">status = #{data.status},</if>
|
||||
<if test="data.userId != null">user_id = #{data.userId},</if>
|
||||
<if test="data.remark != null">remark = #{data.remark},</if>
|
||||
<if test="data.createTime != null">create_time = #{data.createTime},</if>
|
||||
</sql>
|
||||
|
||||
<delete id="deleteVerifyById" parameterType="Long">
|
||||
delete from bst_verify where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="logicDel" parameterType="String">
|
||||
delete from bst_verify where id in
|
||||
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -0,0 +1,15 @@
|
|||
package com.ruoyi.bst.verify.service;
|
||||
|
||||
import com.ruoyi.bst.task.domain.dto.TaskVerifyDTO;
|
||||
import com.ruoyi.bst.verify.domain.Verify;
|
||||
|
||||
public interface VerifyConverter {
|
||||
|
||||
/**
|
||||
* 任务审核DTO转PO
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
Verify toPo(TaskVerifyDTO dto);
|
||||
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
package com.ruoyi.bst.verify.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.bst.verify.domain.Verify;
|
||||
import com.ruoyi.bst.verify.domain.VerifyQuery;
|
||||
import com.ruoyi.bst.verify.domain.VerifyVO;
|
||||
import com.ruoyi.bst.verify.domain.enums.VerifyBstType;
|
||||
|
||||
/**
|
||||
* 审核Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-08
|
||||
*/
|
||||
public interface VerifyService
|
||||
{
|
||||
/**
|
||||
* 查询审核
|
||||
*
|
||||
* @param id 审核主键
|
||||
* @return 审核
|
||||
*/
|
||||
public VerifyVO selectVerifyById(Long id);
|
||||
|
||||
/**
|
||||
* 查询审核列表
|
||||
*
|
||||
* @param verify 审核
|
||||
* @return 审核集合
|
||||
*/
|
||||
public List<VerifyVO> selectVerifyList(VerifyQuery verify);
|
||||
|
||||
/**
|
||||
* 新增审核
|
||||
*
|
||||
* @param verify 审核
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertVerify(Verify verify);
|
||||
|
||||
/**
|
||||
* 修改审核
|
||||
*
|
||||
* @param verify 审核
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateVerify(Verify verify);
|
||||
|
||||
/**
|
||||
* 批量删除审核
|
||||
*
|
||||
* @param ids 需要删除的审核主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int logicDel(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 根据业务ID查询审核列表
|
||||
* @param bstType 业务类型
|
||||
* @param bstIds 业务ID列表
|
||||
* @return 审核列表
|
||||
*/
|
||||
public List<VerifyVO> selectListByBstIds(VerifyBstType bstType, List<Long> bstIds);
|
||||
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.ruoyi.bst.verify.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ruoyi.bst.task.domain.dto.TaskVerifyDTO;
|
||||
import com.ruoyi.bst.verify.domain.Verify;
|
||||
import com.ruoyi.bst.verify.domain.enums.VerifyBstType;
|
||||
import com.ruoyi.bst.verify.domain.enums.VerifyStatus;
|
||||
import com.ruoyi.bst.verify.service.VerifyConverter;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
|
||||
@Service
|
||||
public class VerifyConverterImpl implements VerifyConverter {
|
||||
|
||||
@Override
|
||||
public Verify toPo(TaskVerifyDTO dto) {
|
||||
if (dto == null) {
|
||||
return null;
|
||||
}
|
||||
Verify verify = new Verify();
|
||||
verify.setBstType(VerifyBstType.TASK.getType());
|
||||
verify.setBstId(dto.getId());
|
||||
verify.setStatus(dto.getPass() != null && dto.getPass() ? VerifyStatus.PASS.getStatus() : VerifyStatus.REJECT.getStatus());
|
||||
verify.setRemark(dto.getRemark());
|
||||
verify.setUserId(SecurityUtils.getUserId());
|
||||
return verify;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,103 @@
|
|||
package com.ruoyi.bst.verify.service.impl;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ruoyi.bst.verify.domain.Verify;
|
||||
import com.ruoyi.bst.verify.domain.VerifyQuery;
|
||||
import com.ruoyi.bst.verify.domain.VerifyVO;
|
||||
import com.ruoyi.bst.verify.domain.enums.VerifyBstType;
|
||||
import com.ruoyi.bst.verify.mapper.VerifyMapper;
|
||||
import com.ruoyi.bst.verify.service.VerifyService;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.collection.CollectionUtils;
|
||||
|
||||
/**
|
||||
* 审核Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-08
|
||||
*/
|
||||
@Service
|
||||
public class VerifyServiceImpl implements VerifyService
|
||||
{
|
||||
@Autowired
|
||||
private VerifyMapper verifyMapper;
|
||||
|
||||
/**
|
||||
* 查询审核
|
||||
*
|
||||
* @param id 审核主键
|
||||
* @return 审核
|
||||
*/
|
||||
@Override
|
||||
public VerifyVO selectVerifyById(Long id)
|
||||
{
|
||||
return verifyMapper.selectVerifyById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询审核列表
|
||||
*
|
||||
* @param verify 审核
|
||||
* @return 审核
|
||||
*/
|
||||
@Override
|
||||
public List<VerifyVO> selectVerifyList(VerifyQuery verify)
|
||||
{
|
||||
return verifyMapper.selectVerifyList(verify);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增审核
|
||||
*
|
||||
* @param verify 审核
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertVerify(Verify verify)
|
||||
{
|
||||
verify.setCreateTime(DateUtils.getNowDate());
|
||||
return verifyMapper.insertVerify(verify);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改审核
|
||||
*
|
||||
* @param verify 审核
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateVerify(Verify verify)
|
||||
{
|
||||
return verifyMapper.updateVerify(verify);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除审核
|
||||
*
|
||||
* @param ids 需要删除的审核主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int logicDel(List<Long> ids)
|
||||
{
|
||||
return verifyMapper.logicDel(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VerifyVO> selectListByBstIds(VerifyBstType bstType, List<Long> bstIds) {
|
||||
if (CollectionUtils.isEmptyElement(bstIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
VerifyQuery query = new VerifyQuery();
|
||||
query.setBstType(bstType.getType());
|
||||
query.setBstIds(bstIds);
|
||||
return verifyMapper.selectVerifyList(query);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.ruoyi.common.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class LongIntegerVO {
|
||||
|
||||
private Long key;
|
||||
|
||||
private Integer value;
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package com.ruoyi.dashboard.customer.service;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.dashboard.index.domain.brief.CustomerBriefVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ruoyi.bst.customer.domain.CustomerQuery;
|
||||
import com.ruoyi.bst.customer.service.CustomerService;
|
||||
import com.ruoyi.common.vo.StringIntegerVO;
|
||||
|
||||
@Service
|
||||
public class DashboardCustomerService {
|
||||
|
||||
@Autowired
|
||||
private CustomerService customerService;
|
||||
|
||||
public CustomerBriefVO selectCustomerBrief() {
|
||||
|
||||
List<StringIntegerVO> customerMap = customerService.selectCountGroupByStatus(new CustomerQuery());
|
||||
CustomerBriefVO customerBriefVO = new CustomerBriefVO(customerMap);
|
||||
// 今日新增客户
|
||||
customerBriefVO.setToday(this.selectTodayCustomerCount());
|
||||
return customerBriefVO;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询今日新增客户数
|
||||
* @return
|
||||
*/
|
||||
private int selectTodayCustomerCount() {
|
||||
CustomerQuery query = new CustomerQuery();
|
||||
query.setCreateDate(LocalDate.now());
|
||||
return customerService.selectCount(query);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.ruoyi.dashboard.index.domain.brief;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BriefVO {
|
||||
|
||||
@ApiModelProperty("项目概览")
|
||||
ProjectBriefVO project;
|
||||
|
||||
@ApiModelProperty("任务概览")
|
||||
TaskBriefVO task;
|
||||
|
||||
@ApiModelProperty("客户概览")
|
||||
CustomerBriefVO customer;
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package com.ruoyi.dashboard.index.domain.brief;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.bst.customer.domain.enums.CustomerStatus;
|
||||
import com.ruoyi.common.vo.StringIntegerVO;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class CustomerBriefVO {
|
||||
|
||||
@ApiModelProperty("客户总数")
|
||||
private Integer total;
|
||||
|
||||
@ApiModelProperty("今日新增客户数")
|
||||
private Integer today;
|
||||
|
||||
@ApiModelProperty("潜在客户")
|
||||
private Integer potential;
|
||||
|
||||
@ApiModelProperty("意向客户")
|
||||
private Integer intention;
|
||||
|
||||
@ApiModelProperty("已成交")
|
||||
private Integer transaction;
|
||||
|
||||
@ApiModelProperty("失效客户")
|
||||
private Integer invalid;
|
||||
|
||||
public CustomerBriefVO(List<StringIntegerVO> statusMap) {
|
||||
this.potential = statusMap.stream()
|
||||
.filter(vo -> CustomerStatus.POTENTIAL.getStatus().equals(vo.getKey()))
|
||||
.findFirst().map(StringIntegerVO::getValue).orElse(0);
|
||||
|
||||
this.intention = statusMap.stream()
|
||||
.filter(vo -> CustomerStatus.INTENTION.getStatus().equals(vo.getKey()))
|
||||
.findFirst().map(StringIntegerVO::getValue).orElse(0);
|
||||
|
||||
this.transaction = statusMap.stream()
|
||||
.filter(vo -> CustomerStatus.TRANSACTION.getStatus().equals(vo.getKey()))
|
||||
.findFirst().map(StringIntegerVO::getValue).orElse(0);
|
||||
|
||||
this.invalid = statusMap.stream()
|
||||
.filter(vo -> CustomerStatus.INVALID.getStatus().equals(vo.getKey()))
|
||||
.findFirst().map(StringIntegerVO::getValue).orElse(0);
|
||||
|
||||
this.total = statusMap.stream().map(map -> map.getValue()).reduce(0, Integer::sum);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
package com.ruoyi.dashboard.index.domain.brief;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.bst.project.domain.enums.ProjectStatus;
|
||||
import com.ruoyi.common.vo.StringIntegerVO;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class ProjectBriefVO {
|
||||
|
||||
@ApiModelProperty("项目总数")
|
||||
private Integer total;
|
||||
|
||||
@ApiModelProperty("已完成")
|
||||
private Integer completed;
|
||||
|
||||
@ApiModelProperty("进行中")
|
||||
private Integer inProgress;
|
||||
|
||||
@ApiModelProperty("维护中")
|
||||
private Integer maintenance;
|
||||
|
||||
@ApiModelProperty("开发超期")
|
||||
private Integer developmentOverdue;
|
||||
|
||||
@ApiModelProperty("维护超期")
|
||||
private Integer maintenanceOverdue;
|
||||
|
||||
public ProjectBriefVO(List<StringIntegerVO> statusMap) {
|
||||
this.completed = statusMap.stream()
|
||||
.filter(vo -> ProjectStatus.COMPLETED.getStatus().equals(vo.getKey()))
|
||||
.findFirst().map(StringIntegerVO::getValue).orElse(0);
|
||||
|
||||
this.inProgress = statusMap.stream()
|
||||
.filter(vo -> ProjectStatus.IN_PROGRESS.getStatus().equals(vo.getKey()))
|
||||
.findFirst().map(StringIntegerVO::getValue).orElse(0);
|
||||
|
||||
this.maintenance = statusMap.stream()
|
||||
.filter(vo -> ProjectStatus.MAINTENANCE.getStatus().equals(vo.getKey()))
|
||||
.findFirst().map(StringIntegerVO::getValue).orElse(0);
|
||||
|
||||
this.developmentOverdue = statusMap.stream()
|
||||
.filter(vo -> ProjectStatus.DEVELOPMENT_OVERDUE.getStatus().equals(vo.getKey()))
|
||||
.findFirst().map(StringIntegerVO::getValue).orElse(0);
|
||||
|
||||
this.maintenanceOverdue = statusMap.stream()
|
||||
.filter(vo -> ProjectStatus.MAINTENANCE_OVERDUE.getStatus().equals(vo.getKey()))
|
||||
.findFirst().map(StringIntegerVO::getValue).orElse(0);
|
||||
|
||||
this.total = statusMap.stream().map(StringIntegerVO::getValue).reduce(0, Integer::sum);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package com.ruoyi.dashboard.index.domain.brief;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.bst.task.domain.enums.TaskStatus;
|
||||
import com.ruoyi.common.vo.StringIntegerVO;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class TaskBriefVO {
|
||||
|
||||
@ApiModelProperty("任务总数")
|
||||
private Integer total;
|
||||
|
||||
@ApiModelProperty("待完成")
|
||||
private Integer waitCompleted;
|
||||
|
||||
@ApiModelProperty("进行中")
|
||||
private Integer inProgress;
|
||||
|
||||
@ApiModelProperty("待确认")
|
||||
private Integer waitConfirm;
|
||||
|
||||
@ApiModelProperty("已完成")
|
||||
private Integer completed;
|
||||
|
||||
public TaskBriefVO(List<StringIntegerVO> statusMap) {
|
||||
this.waitCompleted = statusMap.stream()
|
||||
.filter(vo -> TaskStatus.WAIT_COMPLETED.getStatus().equals(vo.getKey()))
|
||||
.findFirst().map(StringIntegerVO::getValue).orElse(0);
|
||||
|
||||
this.inProgress = statusMap.stream()
|
||||
.filter(vo -> TaskStatus.PROCESSING.getStatus().equals(vo.getKey()))
|
||||
.findFirst().map(StringIntegerVO::getValue).orElse(0);
|
||||
|
||||
this.waitConfirm = statusMap.stream()
|
||||
.filter(vo -> TaskStatus.WAIT_CONFIRM.getStatus().equals(vo.getKey()))
|
||||
.findFirst().map(StringIntegerVO::getValue).orElse(0);
|
||||
|
||||
this.completed = statusMap.stream()
|
||||
.filter(vo -> TaskStatus.PASS.getStatus().equals(vo.getKey()))
|
||||
.findFirst().map(StringIntegerVO::getValue).orElse(0);
|
||||
|
||||
this.total = statusMap.stream().map(StringIntegerVO::getValue).reduce(0, Integer::sum);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package com.ruoyi.dashboard.project.domain.monthProject;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MonthProjectQuery {
|
||||
|
||||
@ApiModelProperty("年份")
|
||||
private Integer year;
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.ruoyi.dashboard.project.domain.monthProject;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MonthProjectVO {
|
||||
|
||||
@ApiModelProperty("年份")
|
||||
private Integer year;
|
||||
|
||||
@ApiModelProperty("月份")
|
||||
private Integer month;
|
||||
|
||||
@ApiModelProperty("开始项目数")
|
||||
private Integer startCount;
|
||||
|
||||
@ApiModelProperty("完成项目数")
|
||||
private Integer finishCount;
|
||||
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.ruoyi.dashboard.project.domain.projectRate;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ProjectRateVO {
|
||||
|
||||
@ApiModelProperty("总数")
|
||||
private Integer total;
|
||||
|
||||
@ApiModelProperty("完成数")
|
||||
private Integer completed;
|
||||
|
||||
@ApiModelProperty("开发超期数")
|
||||
private Integer devOverdue;
|
||||
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
package com.ruoyi.dashboard.project.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ruoyi.bst.project.domain.ProjectQuery;
|
||||
import com.ruoyi.bst.project.domain.enums.ProjectStatus;
|
||||
import com.ruoyi.bst.project.service.ProjectService;
|
||||
import com.ruoyi.common.vo.IntegerIntegerVO;
|
||||
import com.ruoyi.common.vo.StringIntegerVO;
|
||||
import com.ruoyi.dashboard.index.domain.brief.ProjectBriefVO;
|
||||
import com.ruoyi.dashboard.project.domain.monthProject.MonthProjectQuery;
|
||||
import com.ruoyi.dashboard.project.domain.monthProject.MonthProjectVO;
|
||||
import com.ruoyi.dashboard.project.domain.projectRate.ProjectRateVO;
|
||||
|
||||
@Service
|
||||
public class DashboardProjectService {
|
||||
|
||||
@Autowired
|
||||
private ProjectService projectService;
|
||||
|
||||
public List<MonthProjectVO> selectMonthProject(MonthProjectQuery query) {
|
||||
List<MonthProjectVO> result = new ArrayList<>();
|
||||
|
||||
// 查询每月新增的项目数
|
||||
List<IntegerIntegerVO> startList = this.selectCoungGroupByStartMonth(query);
|
||||
|
||||
// 查询每月完成的项目数
|
||||
List<IntegerIntegerVO> finishList = this.selectCountGroupByCompleteMonth(query);
|
||||
|
||||
// 构造成12月的数据
|
||||
for (int i = 1; i <= 12; i ++) {
|
||||
MonthProjectVO vo = new MonthProjectVO();
|
||||
vo.setYear(query.getYear());
|
||||
vo.setMonth(i);
|
||||
|
||||
// 开始项目
|
||||
IntegerIntegerVO startCount = startList.stream().filter(item -> Objects.equals(vo.getMonth(), item.getKey())).findFirst().orElse(null);
|
||||
if (startCount == null || startCount.getValue() == null) {
|
||||
vo.setStartCount(0);
|
||||
} else {
|
||||
vo.setStartCount(startCount.getValue());
|
||||
}
|
||||
|
||||
// 完成项目
|
||||
IntegerIntegerVO finishCount = finishList.stream().filter(item -> Objects.equals(vo.getMonth(), item.getKey())).findFirst().orElse(null);
|
||||
if (finishCount == null || finishCount.getValue() == null) {
|
||||
vo.setFinishCount(0);
|
||||
} else {
|
||||
vo.setFinishCount(finishCount.getValue());
|
||||
}
|
||||
|
||||
result.add(vo);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// 查询项目概览
|
||||
public ProjectBriefVO selectProjectBrief() {
|
||||
List<StringIntegerVO> projectMap = projectService.selectCountGroupByStatus(new ProjectQuery());
|
||||
return new ProjectBriefVO(projectMap);
|
||||
}
|
||||
|
||||
// 按月查询新增项目数
|
||||
public List<IntegerIntegerVO> selectCountGroupByCreateMonth(MonthProjectQuery query) {
|
||||
ProjectQuery projectQuery = new ProjectQuery();
|
||||
projectQuery.setCreateYear(query.getYear());
|
||||
return projectService.selectCountGroupByCreateMonth(projectQuery);
|
||||
}
|
||||
|
||||
// 按月查询完成项目数
|
||||
public List<IntegerIntegerVO> selectCountGroupByCompleteMonth(MonthProjectQuery query) {
|
||||
ProjectQuery projectQuery = new ProjectQuery();
|
||||
projectQuery.setCompleteYear(query.getYear());
|
||||
return projectService.selectCountGroupByCompleteMonth(projectQuery);
|
||||
}
|
||||
|
||||
// 按月查询开始项目数
|
||||
public List<IntegerIntegerVO> selectCoungGroupByStartMonth(MonthProjectQuery query) {
|
||||
ProjectQuery projectQuery = new ProjectQuery();
|
||||
projectQuery.setStartYear(query.getYear());
|
||||
return projectService.selectCountGroupByStartMonth(projectQuery);
|
||||
}
|
||||
|
||||
// 获取项目比率
|
||||
public ProjectRateVO selectProjectRate() {
|
||||
ProjectRateVO result = new ProjectRateVO();
|
||||
|
||||
// 查询总数
|
||||
int total = projectService.selectCount(new ProjectQuery());
|
||||
result.setTotal(total);
|
||||
|
||||
// 查询完成数
|
||||
result.setCompleted(this.selectCompletedCount());
|
||||
|
||||
// 查询超期数
|
||||
result.setDevOverdue(this.selectDevOverdueCount());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// 查询完成数
|
||||
private int selectCompletedCount() {
|
||||
ProjectQuery query = new ProjectQuery();
|
||||
query.setStatusList(ProjectStatus.completedList());
|
||||
return projectService.selectCount(query);
|
||||
}
|
||||
|
||||
// 查询开发超期数
|
||||
private int selectDevOverdueCount() {
|
||||
ProjectQuery query = new ProjectQuery();
|
||||
query.setDevOverdue(true);
|
||||
return projectService.selectCount(query);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.ruoyi.dashboard.task.domain;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.dashboard.index.domain.brief.TaskBriefVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ruoyi.bst.task.domain.TaskQuery;
|
||||
import com.ruoyi.bst.task.service.TaskService;
|
||||
import com.ruoyi.common.vo.StringIntegerVO;
|
||||
|
||||
@Service
|
||||
public class DashboardTaskService {
|
||||
|
||||
@Autowired
|
||||
private TaskService taskService;
|
||||
|
||||
public TaskBriefVO selectTaskBrief() {
|
||||
List<StringIntegerVO> taskMap = taskService.selectCountGroupByStatus(new TaskQuery());
|
||||
return new TaskBriefVO(taskMap);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,106 @@
|
|||
package com.ruoyi.web.bst;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.ruoyi.bst.taskSubmit.domain.TaskSubmitQuery;
|
||||
import com.ruoyi.bst.taskSubmit.domain.TaskSubmitVO;
|
||||
import com.ruoyi.bst.taskSubmit.service.TaskSubmitService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
|
||||
/**
|
||||
* 任务提交记录Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/bst/taskSubmit")
|
||||
public class TaskSubmitController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private TaskSubmitService taskSubmitService;
|
||||
|
||||
/**
|
||||
* 查询任务提交记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bst:taskSubmit:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TaskSubmitQuery query)
|
||||
{
|
||||
startPage();
|
||||
startOrderBy();
|
||||
List<TaskSubmitVO> list = taskSubmitService.selectTaskSubmitList(query);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出任务提交记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bst:taskSubmit:export')")
|
||||
@Log(title = "任务提交记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TaskSubmitQuery query)
|
||||
{
|
||||
List<TaskSubmitVO> list = taskSubmitService.selectTaskSubmitList(query);
|
||||
ExcelUtil<TaskSubmitVO> util = new ExcelUtil<TaskSubmitVO>(TaskSubmitVO.class);
|
||||
util.exportExcel(response, list, "任务提交记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取任务提交记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bst:taskSubmit:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(taskSubmitService.selectTaskSubmitById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增任务提交记录
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('bst:taskSubmit:add')")
|
||||
// @Log(title = "任务提交记录", businessType = BusinessType.INSERT)
|
||||
// @PostMapping
|
||||
// public AjaxResult add(@RequestBody TaskSubmit taskSubmit)
|
||||
// {
|
||||
// return toAjax(taskSubmitService.insertTaskSubmit(taskSubmit));
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * 修改任务提交记录
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('bst:taskSubmit:edit')")
|
||||
// @Log(title = "任务提交记录", businessType = BusinessType.UPDATE)
|
||||
// @PutMapping
|
||||
// public AjaxResult edit(@RequestBody TaskSubmit taskSubmit)
|
||||
// {
|
||||
// return toAjax(taskSubmitService.updateTaskSubmit(taskSubmit));
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * 删除任务提交记录
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('bst:taskSubmit:remove')")
|
||||
// @Log(title = "任务提交记录", businessType = BusinessType.DELETE)
|
||||
// @DeleteMapping("/{ids}")
|
||||
// public AjaxResult remove(@PathVariable Long[] ids)
|
||||
// {
|
||||
// return toAjax(taskSubmitService.deleteTaskSubmitByIds(ids));
|
||||
// }
|
||||
}
|
106
ruoyi-web/src/main/java/com/ruoyi/web/bst/VerifyController.java
Normal file
106
ruoyi-web/src/main/java/com/ruoyi/web/bst/VerifyController.java
Normal file
|
@ -0,0 +1,106 @@
|
|||
package com.ruoyi.web.bst;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.ruoyi.bst.verify.domain.VerifyQuery;
|
||||
import com.ruoyi.bst.verify.domain.VerifyVO;
|
||||
import com.ruoyi.bst.verify.service.VerifyService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
|
||||
/**
|
||||
* 审核Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/bst/verify")
|
||||
public class VerifyController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private VerifyService verifyService;
|
||||
|
||||
/**
|
||||
* 查询审核列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bst:verify:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(VerifyQuery query)
|
||||
{
|
||||
startPage();
|
||||
startOrderBy();
|
||||
List<VerifyVO> list = verifyService.selectVerifyList(query);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出审核列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bst:verify:export')")
|
||||
@Log(title = "审核", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, VerifyQuery query)
|
||||
{
|
||||
List<VerifyVO> list = verifyService.selectVerifyList(query);
|
||||
ExcelUtil<VerifyVO> util = new ExcelUtil<VerifyVO>(VerifyVO.class);
|
||||
util.exportExcel(response, list, "审核数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取审核详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bst:verify:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(verifyService.selectVerifyById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增审核
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('bst:verify:add')")
|
||||
// @Log(title = "审核", businessType = BusinessType.INSERT)
|
||||
// @PostMapping
|
||||
// public AjaxResult add(@RequestBody Verify verify)
|
||||
// {
|
||||
// return toAjax(verifyService.insertVerify(verify));
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * 修改审核
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('bst:verify:edit')")
|
||||
// @Log(title = "审核", businessType = BusinessType.UPDATE)
|
||||
// @PutMapping
|
||||
// public AjaxResult edit(@RequestBody Verify verify)
|
||||
// {
|
||||
// return toAjax(verifyService.updateVerify(verify));
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * 删除审核
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('bst:verify:remove')")
|
||||
// @Log(title = "审核", businessType = BusinessType.DELETE)
|
||||
// @DeleteMapping("/{ids}")
|
||||
// public AjaxResult remove(@PathVariable List<Long> ids)
|
||||
// {
|
||||
// return toAjax(verifyService.logicDel(ids));
|
||||
// }
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package com.ruoyi.web.dashboard;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.dashboard.project.domain.monthProject.MonthProjectQuery;
|
||||
import com.ruoyi.dashboard.project.service.DashboardProjectService;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/dashboard/project")
|
||||
public class DashboardProjectController {
|
||||
|
||||
@Autowired
|
||||
private DashboardProjectService dashboardProjectService;
|
||||
|
||||
|
||||
// 获取每月项目数和完成数的数据
|
||||
@GetMapping("/month")
|
||||
public AjaxResult month(MonthProjectQuery query) {
|
||||
return AjaxResult.success(dashboardProjectService.selectMonthProject(query));
|
||||
}
|
||||
|
||||
// 获取项目比率
|
||||
@GetMapping("/rate")
|
||||
public AjaxResult rate() {
|
||||
return AjaxResult.success(dashboardProjectService.selectProjectRate());
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user