智能预警
This commit is contained in:
parent
6f1e42009f
commit
f049784fcf
|
|
@ -0,0 +1,51 @@
|
||||||
|
package com.rzyc.bean.task.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description:
|
||||||
|
* @Author: ZQW
|
||||||
|
* @CreateTime: 2022/11/23 16:26
|
||||||
|
*/
|
||||||
|
|
||||||
|
@ApiModel("分页请求参数")
|
||||||
|
public class PageDto {
|
||||||
|
|
||||||
|
@ApiModelProperty("关键字")
|
||||||
|
private String condition;
|
||||||
|
|
||||||
|
@NotNull(message = "页码不能为空")
|
||||||
|
@ApiModelProperty(value = "页码",required = true,example = "1")
|
||||||
|
private Integer page;//当前页
|
||||||
|
|
||||||
|
@NotNull(message = "每页条数不能为空")
|
||||||
|
@ApiModelProperty(value = "每页条数",required = true,example = "10")
|
||||||
|
private Integer pageSize;//每页显示多少条
|
||||||
|
|
||||||
|
public String getCondition() {
|
||||||
|
return condition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCondition(String condition) {
|
||||||
|
this.condition = condition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPage() {
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPage(Integer page) {
|
||||||
|
this.page = page;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPageSize() {
|
||||||
|
return pageSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPageSize(Integer pageSize) {
|
||||||
|
this.pageSize = pageSize;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.rzyc.bean.task.dto;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description:
|
||||||
|
* @Author: ZQW
|
||||||
|
* @CreateTime: 2022/11/23 15:39
|
||||||
|
*/
|
||||||
|
|
||||||
|
@ApiModel("智能预警请求实体")
|
||||||
|
public class WarnDto {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "类型:1.企业重大隐患 2.隐患未按期闭环 3.企业清单未落实 4.政府履职清单未履行 5.下级未履行上级任务",required = true)
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "预警:1.当前预警 2.历史预警",required = true)
|
||||||
|
private Integer warnState;
|
||||||
|
|
||||||
|
public Integer getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(Integer type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getWarnState() {
|
||||||
|
return warnState;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWarnState(Integer warnState) {
|
||||||
|
this.warnState = warnState;
|
||||||
|
}
|
||||||
|
}
|
||||||
23
inventory-dao/src/main/java/com/rzyc/bean/task/vo/NumVo.java
Normal file
23
inventory-dao/src/main/java/com/rzyc/bean/task/vo/NumVo.java
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.rzyc.bean.task.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description:
|
||||||
|
* @Author: ZQW
|
||||||
|
* @CreateTime: 2022/11/23 16:55
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class NumVo {
|
||||||
|
|
||||||
|
@ApiModelProperty("未处理数量")
|
||||||
|
private Integer num;
|
||||||
|
|
||||||
|
public Integer getNum() {
|
||||||
|
return num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNum(Integer num) {
|
||||||
|
this.num = num;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.rzyc.mapper;
|
||||||
|
|
||||||
|
import com.github.pagehelper.Page;
|
||||||
|
import com.rzyc.bean.task.dto.WarnDto;
|
||||||
|
import com.rzyc.model.GovWarning;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 智能预警 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author
|
||||||
|
* @since 2022-11-23
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface GovWarningMapper extends BaseMapper<GovWarning> {
|
||||||
|
|
||||||
|
List<GovWarning> selectAll(@Param("warnDto") WarnDto warnDto);
|
||||||
|
|
||||||
|
//只能预警分页
|
||||||
|
List<GovWarning> warnList(@Param("condition") String condition);
|
||||||
|
|
||||||
|
int countNum(@Param("type") Integer type);
|
||||||
|
}
|
||||||
164
inventory-dao/src/main/java/com/rzyc/model/GovWarning.java
Normal file
164
inventory-dao/src/main/java/com/rzyc/model/GovWarning.java
Normal file
|
|
@ -0,0 +1,164 @@
|
||||||
|
package com.rzyc.model;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 智能预警
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author
|
||||||
|
* @since 2022-11-23
|
||||||
|
*/
|
||||||
|
@TableName("gov_warning")
|
||||||
|
@ApiModel(value="GovWarning对象", description="智能预警")
|
||||||
|
public class GovWarning implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "预警id")
|
||||||
|
@TableId("warn_id")
|
||||||
|
private String warnId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "预警内容")
|
||||||
|
@TableField("content")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "目标id")
|
||||||
|
@TableField("target_id")
|
||||||
|
private String targetId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "类型:1.企业重大隐患 2.隐患未按期闭环 3.企业清单未落实 4.政府履职清单未履行 5.下级未履行上级任务")
|
||||||
|
@TableField("type")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "预警:1.当前预警 2.历史预警")
|
||||||
|
@TableField("warn_state")
|
||||||
|
private Integer warnState;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "处理状态 : 1.未处理 2.已处理")
|
||||||
|
@TableField("solve_state")
|
||||||
|
private Integer solveState;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "预警时间")
|
||||||
|
@TableField("warn_time")
|
||||||
|
private Date warnTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
@TableField("create_time")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
@TableField("create_by")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
@TableField("modify_time")
|
||||||
|
private Date modifyTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改人")
|
||||||
|
@TableField("modify_by")
|
||||||
|
private String modifyBy;
|
||||||
|
|
||||||
|
public Integer getSolveState() {
|
||||||
|
return solveState;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSolveState(Integer solveState) {
|
||||||
|
this.solveState = solveState;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWarnId() {
|
||||||
|
return warnId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWarnId(String warnId) {
|
||||||
|
this.warnId = warnId;
|
||||||
|
}
|
||||||
|
public String getContent() {
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContent(String content) {
|
||||||
|
this.content = content;
|
||||||
|
}
|
||||||
|
public String getTargetId() {
|
||||||
|
return targetId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTargetId(String targetId) {
|
||||||
|
this.targetId = targetId;
|
||||||
|
}
|
||||||
|
public Integer getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(Integer type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
public Date getWarnTime() {
|
||||||
|
return warnTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWarnTime(Date warnTime) {
|
||||||
|
this.warnTime = warnTime;
|
||||||
|
}
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
public String getCreateBy() {
|
||||||
|
return createBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateBy(String createBy) {
|
||||||
|
this.createBy = createBy;
|
||||||
|
}
|
||||||
|
public Date getModifyTime() {
|
||||||
|
return modifyTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setModifyTime(Date modifyTime) {
|
||||||
|
this.modifyTime = modifyTime;
|
||||||
|
}
|
||||||
|
public String getModifyBy() {
|
||||||
|
return modifyBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setModifyBy(String modifyBy) {
|
||||||
|
this.modifyBy = modifyBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getWarnState() {
|
||||||
|
return warnState;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWarnState(Integer warnState) {
|
||||||
|
this.warnState = warnState;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "GovWarning{" +
|
||||||
|
"warnId='" + warnId + '\'' +
|
||||||
|
", content='" + content + '\'' +
|
||||||
|
", targetId='" + targetId + '\'' +
|
||||||
|
", type=" + type +
|
||||||
|
", warnState=" + warnState +
|
||||||
|
", warnTime=" + warnTime +
|
||||||
|
", createTime=" + createTime +
|
||||||
|
", createBy='" + createBy + '\'' +
|
||||||
|
", modifyTime=" + modifyTime +
|
||||||
|
", modifyBy='" + modifyBy + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
43
inventory-dao/src/main/resources/mapper/GovWarningMapper.xml
Normal file
43
inventory-dao/src/main/resources/mapper/GovWarningMapper.xml
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
<?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.rzyc.mapper.GovWarningMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="BaseResultMap" type="com.rzyc.model.GovWarning">
|
||||||
|
<id column="warn_id" property="warnId" />
|
||||||
|
<result column="content" property="content" />
|
||||||
|
<result column="target_id" property="targetId" />
|
||||||
|
<result column="type" property="type" />
|
||||||
|
<result column="warn_state" property="warnState" />
|
||||||
|
<result column="warn_time" property="warnTime" />
|
||||||
|
<result column="solve_state" property="solveState" />
|
||||||
|
<result column="create_time" property="createTime" />
|
||||||
|
<result column="create_by" property="createBy" />
|
||||||
|
<result column="modify_time" property="modifyTime" />
|
||||||
|
<result column="modify_by" property="modifyBy" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<!-- 通用查询结果列 -->
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
warn_id, content, target_id, type, warn_time, create_time, create_by, modify_time, modify_by
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectAll" resultMap="BaseResultMap">
|
||||||
|
select gw.* from gov_warning gw where gw.type = #{warnDto.type} and gw.warn_state = #{warnDto.warnState}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="warnList" resultMap="BaseResultMap">
|
||||||
|
SELECT * FROM gov_warning gw
|
||||||
|
<where>
|
||||||
|
<if test="condition != null and condition != ''">
|
||||||
|
and gw.content like concat('%',#{condition},'%')
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY gw.warn_time asc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="countNum" resultType="int" parameterType="Integer">
|
||||||
|
select count(gw.warn_id) from gov_warning gw where gw.type = #{type} and gw.solve_state = '1'
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -68,7 +68,6 @@ public class EmergencyEquipmentController {
|
||||||
String resourceType)throws Exception{
|
String resourceType)throws Exception{
|
||||||
return pcBusinessService.entEmEquipmentList(enterpriseId,page,pageSize,resourceType);
|
return pcBusinessService.entEmEquipmentList(enterpriseId,page,pageSize,resourceType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 应急资源修改
|
* 应急资源修改
|
||||||
* @return list
|
* @return list
|
||||||
|
|
|
||||||
|
|
@ -334,6 +334,10 @@ public class BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
protected IndustryWorkMapper industryWorkMapper;
|
protected IndustryWorkMapper industryWorkMapper;
|
||||||
|
|
||||||
|
//企业应急资源
|
||||||
|
@Autowired
|
||||||
|
protected EntEmEquipmentMapper entEmEquipmentMapper;
|
||||||
|
|
||||||
// //企业监管用户
|
// //企业监管用户
|
||||||
// @Autowired
|
// @Autowired
|
||||||
// protected EntUserMapper entUserMapper;
|
// protected EntUserMapper entUserMapper;
|
||||||
|
|
@ -470,8 +474,13 @@ public class BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
protected InEntListMapper inEntListMapper;
|
protected InEntListMapper inEntListMapper;
|
||||||
|
|
||||||
|
//企业应急预案
|
||||||
|
@Autowired
|
||||||
|
protected EntEmReservePlanMapper entEmReservePlanMapper;
|
||||||
|
|
||||||
|
//政府智能预警
|
||||||
|
@Autowired
|
||||||
|
protected GovWarningMapper govWarningMapper;
|
||||||
/**
|
/**
|
||||||
* 岗位不需要的字符串
|
* 岗位不需要的字符串
|
||||||
*/
|
*/
|
||||||
|
|
@ -841,6 +850,17 @@ public class BaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统一处理分页
|
||||||
|
* @param pager api返回的对象
|
||||||
|
* @param page 分页插件对象
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
protected void getDatePage(Pager pager, Page page)throws Exception{
|
||||||
|
pager.setTotal(page.getTotal());
|
||||||
|
pager.setRows(page.getResult());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 履职任务
|
* 履职任务
|
||||||
* @param receiveId
|
* @param receiveId
|
||||||
|
|
@ -1668,10 +1688,10 @@ public class BaseController {
|
||||||
* @param page 分页插件对象
|
* @param page 分页插件对象
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
protected void getDatePage(Pager pager, Page page)throws Exception{
|
/* protected void getDatePage(Pager pager, Page page)throws Exception{
|
||||||
pager.setTotal(page.getTotal());
|
pager.setTotal(page.getTotal());
|
||||||
pager.setRows(page.getResult());
|
pager.setRows(page.getResult());
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户职务
|
* 获取用户职务
|
||||||
|
|
|
||||||
|
|
@ -3,21 +3,19 @@ package com.rzyc.controller;
|
||||||
import com.common.utils.RandomNumber;
|
import com.common.utils.RandomNumber;
|
||||||
import com.common.utils.StringUtils;
|
import com.common.utils.StringUtils;
|
||||||
import com.common.utils.model.MultiResult;
|
import com.common.utils.model.MultiResult;
|
||||||
|
import com.common.utils.model.Pager;
|
||||||
import com.common.utils.model.SingleResult;
|
import com.common.utils.model.SingleResult;
|
||||||
|
import com.github.pagehelper.Page;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.rzyc.bean.task.dto.*;
|
import com.rzyc.bean.task.dto.*;
|
||||||
import com.rzyc.bean.task.vo.*;
|
import com.rzyc.bean.task.vo.*;
|
||||||
import com.rzyc.config.MethodAnnotation;
|
import com.rzyc.config.MethodAnnotation;
|
||||||
import com.rzyc.mapper.OATaskMapper;
|
import com.rzyc.mapper.OATaskMapper;
|
||||||
import com.rzyc.model.OADistribution;
|
import com.rzyc.model.*;
|
||||||
import com.rzyc.model.OATask;
|
|
||||||
import com.rzyc.model.OaTaskType;
|
|
||||||
import com.rzyc.model.OaTaskUser;
|
|
||||||
import com.rzyc.model.task.dto.TaskAddOrUpdateDto;
|
import com.rzyc.model.task.dto.TaskAddOrUpdateDto;
|
||||||
import com.rzyc.model.user.SysUser;
|
import com.rzyc.model.user.SysUser;
|
||||||
import io.swagger.annotations.Api;
|
import com.rzyc.service.PcBusinessService;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.*;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.apache.commons.beanutils.BeanUtils;
|
import org.apache.commons.beanutils.BeanUtils;
|
||||||
import org.apache.commons.beanutils.ConvertUtils;
|
import org.apache.commons.beanutils.ConvertUtils;
|
||||||
import org.apache.commons.beanutils.converters.DateConverter;
|
import org.apache.commons.beanutils.converters.DateConverter;
|
||||||
|
|
@ -49,34 +47,36 @@ import java.util.List;
|
||||||
@RequestMapping("work")
|
@RequestMapping("work")
|
||||||
@RestController
|
@RestController
|
||||||
@Validated
|
@Validated
|
||||||
public class WorkController extends BaseController{
|
public class WorkController extends BaseController {
|
||||||
|
|
||||||
|
|
||||||
|
PcBusinessService pcBusinessService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 新增任务
|
* @Description: 新增任务
|
||||||
* @Author ZQW
|
* @Author ZQW
|
||||||
* @CreateTime 2022/9/23 14:38
|
* @CreateTime 2022/9/23 14:38
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "新增任务",position = 1)
|
@ApiOperation(value = "新增任务", position = 1)
|
||||||
@PostMapping("addTask")
|
@PostMapping("addTask")
|
||||||
public SingleResult<String> addTask(@Valid AddTaskDto addTaskDto) throws Exception{
|
public SingleResult<String> addTask(@Valid AddTaskDto addTaskDto) throws Exception {
|
||||||
SingleResult<String> result = new SingleResult<>();
|
SingleResult<String> result = new SingleResult<>();
|
||||||
OATask oaTask = new OATask();
|
OATask oaTask = new OATask();
|
||||||
|
|
||||||
//日期格式转换
|
//日期格式转换
|
||||||
ConvertUtils.register(new DateConverter(null), Date.class);
|
ConvertUtils.register(new DateConverter(null), Date.class);
|
||||||
BeanUtils.copyProperties(oaTask,addTaskDto);
|
BeanUtils.copyProperties(oaTask, addTaskDto);
|
||||||
|
|
||||||
//发布人
|
//发布人
|
||||||
SysUser sysUser = sysUserMapper.selectByPrimaryKey(addTaskDto.getSendId());
|
SysUser sysUser = sysUserMapper.selectByPrimaryKey(addTaskDto.getSendId());
|
||||||
|
|
||||||
if(null == sysUser){
|
if (null == sysUser) {
|
||||||
result.setCode(0);
|
result.setCode(0);
|
||||||
result.setMessage("未知错误");
|
result.setMessage("未知错误");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(StringUtils.isNotBlank(addTaskDto.getOataskid())){
|
if (StringUtils.isNotBlank(addTaskDto.getOataskid())) {
|
||||||
oaTask.setOataskid(addTaskDto.getOataskid());
|
oaTask.setOataskid(addTaskDto.getOataskid());
|
||||||
oaTask.setAppstatus("1");
|
oaTask.setAppstatus("1");
|
||||||
oaTask.setCreatedby(getUserId());
|
oaTask.setCreatedby(getUserId());
|
||||||
|
|
@ -92,28 +92,28 @@ public class WorkController extends BaseController{
|
||||||
* @Author ZQW
|
* @Author ZQW
|
||||||
* @CreateTime 2022/11/2 17:01
|
* @CreateTime 2022/11/2 17:01
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "修改任务",position = 2)
|
@ApiOperation(value = "修改任务", position = 2)
|
||||||
@PreAuthorize("hasAnyAuthority('updateTask','updateTask:update')")
|
@PreAuthorize("hasAnyAuthority('updateTask','updateTask:update')")
|
||||||
@MethodAnnotation(authorizations = {"updateTask","updateTask:update"},name = "修改任务")
|
@MethodAnnotation(authorizations = {"updateTask", "updateTask:update"}, name = "修改任务")
|
||||||
@PostMapping("updateTask")
|
@PostMapping("updateTask")
|
||||||
public SingleResult<String> updateTask(@Valid AddTaskDto addTaskDto) throws Exception{
|
public SingleResult<String> updateTask(@Valid AddTaskDto addTaskDto) throws Exception {
|
||||||
SingleResult<String> result = new SingleResult<>();
|
SingleResult<String> result = new SingleResult<>();
|
||||||
OATask oaTask = new OATask();
|
OATask oaTask = new OATask();
|
||||||
|
|
||||||
//日期格式转换
|
//日期格式转换
|
||||||
ConvertUtils.register(new DateConverter(null), Date.class);
|
ConvertUtils.register(new DateConverter(null), Date.class);
|
||||||
BeanUtils.copyProperties(oaTask,addTaskDto);
|
BeanUtils.copyProperties(oaTask, addTaskDto);
|
||||||
|
|
||||||
//发布人
|
//发布人
|
||||||
SysUser sysUser = sysUserMapper.selectByPrimaryKey(addTaskDto.getSendId());
|
SysUser sysUser = sysUserMapper.selectByPrimaryKey(addTaskDto.getSendId());
|
||||||
|
|
||||||
if(null == sysUser){
|
if (null == sysUser) {
|
||||||
result.setCode(0);
|
result.setCode(0);
|
||||||
result.setMessage("未知错误");
|
result.setMessage("未知错误");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(StringUtils.isNotBlank(addTaskDto.getOataskid())){
|
if (StringUtils.isNotBlank(addTaskDto.getOataskid())) {
|
||||||
oaTask.setModifiedby(getUserId());
|
oaTask.setModifiedby(getUserId());
|
||||||
oaTask.setModifiedon(new Date());
|
oaTask.setModifiedon(new Date());
|
||||||
oaTaskMapper.updateOATask(oaTask);
|
oaTaskMapper.updateOATask(oaTask);
|
||||||
|
|
@ -127,14 +127,14 @@ public class WorkController extends BaseController{
|
||||||
* @Author ZQW
|
* @Author ZQW
|
||||||
* @CreateTime 2022/11/2 11:03
|
* @CreateTime 2022/11/2 11:03
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "分配任务",position = 3)
|
@ApiOperation(value = "分配任务", position = 3)
|
||||||
@PostMapping("distributeWork")
|
@PostMapping("distributeWork")
|
||||||
public SingleResult<String> distributeWork(@Valid TaskAddOrUpdateDto addTaskDto) throws Exception{
|
public SingleResult<String> distributeWork(@Valid TaskAddOrUpdateDto addTaskDto) throws Exception {
|
||||||
SingleResult<String> result = new SingleResult<>();
|
SingleResult<String> result = new SingleResult<>();
|
||||||
OATask oaTask = oaTaskMapper.findById(addTaskDto.getOataskid());
|
OATask oaTask = oaTaskMapper.findById(addTaskDto.getOataskid());
|
||||||
String[] sysuid = addTaskDto.getSysuserid().split(",");
|
String[] sysuid = addTaskDto.getSysuserid().split(",");
|
||||||
List<OADistribution> list = new ArrayList<>();
|
List<OADistribution> list = new ArrayList<>();
|
||||||
for (String uid: sysuid) {
|
for (String uid : sysuid) {
|
||||||
OADistribution oaDistribution = new OADistribution();
|
OADistribution oaDistribution = new OADistribution();
|
||||||
oaDistribution.setOadistributionid(RandomNumber.getUUid());
|
oaDistribution.setOadistributionid(RandomNumber.getUUid());
|
||||||
oaDistribution.setOataskid(addTaskDto.getOataskid());
|
oaDistribution.setOataskid(addTaskDto.getOataskid());
|
||||||
|
|
@ -156,17 +156,17 @@ public class WorkController extends BaseController{
|
||||||
* @Author ZQW
|
* @Author ZQW
|
||||||
* @CreateTime 2022/9/23 10:20
|
* @CreateTime 2022/9/23 10:20
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "待办事项列表",position = 4)
|
@ApiOperation(value = "待办事项列表", position = 4)
|
||||||
@GetMapping("thingsList")
|
@GetMapping("thingsList")
|
||||||
@ApiImplicitParams(value = {
|
@ApiImplicitParams(value = {
|
||||||
@ApiImplicitParam(name = "id",value = "任务类型id"),
|
@ApiImplicitParam(name = "id", value = "任务类型id"),
|
||||||
@ApiImplicitParam(name = "userId", value = "用户id",required = true, dataType = "string"),
|
@ApiImplicitParam(name = "userId", value = "用户id", required = true, dataType = "string"),
|
||||||
})
|
})
|
||||||
@PreAuthorize("hasAnyAuthority('thingsList','thingsList:update')")
|
@PreAuthorize("hasAnyAuthority('thingsList','thingsList:update')")
|
||||||
@MethodAnnotation(authorizations = {"thingsList","thingsList:update"},name = "待办事项列表")
|
@MethodAnnotation(authorizations = {"thingsList", "thingsList:update"}, name = "待办事项列表")
|
||||||
public MultiResult<ThingVo> thingsList(@Valid IdDto idDto,@RequestParam(required = true) String userId){
|
public MultiResult<ThingVo> thingsList(@Valid IdDto idDto, @RequestParam(required = true) String userId) {
|
||||||
MultiResult<ThingVo> result = new MultiResult<>();
|
MultiResult<ThingVo> result = new MultiResult<>();
|
||||||
List<ThingVo> thingVos = oaTaskMapper.thingsList(idDto,userId);
|
List<ThingVo> thingVos = oaTaskMapper.thingsList(idDto, userId);
|
||||||
System.out.println("查询的数据=====" + thingVos);
|
System.out.println("查询的数据=====" + thingVos);
|
||||||
result.setData(thingVos);
|
result.setData(thingVos);
|
||||||
return result;
|
return result;
|
||||||
|
|
@ -177,23 +177,23 @@ public class WorkController extends BaseController{
|
||||||
* @Author: ZQW
|
* @Author: ZQW
|
||||||
* @Date: 2022/9/20
|
* @Date: 2022/9/20
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "查询我发布的任务",position = 5)
|
@ApiOperation(value = "查询我发布的任务", position = 5)
|
||||||
@ApiImplicitParams(value = {
|
@ApiImplicitParams(value = {
|
||||||
@ApiImplicitParam(name = "id",value = "发布人id")
|
@ApiImplicitParam(name = "id", value = "发布人id")
|
||||||
})
|
})
|
||||||
@GetMapping("deliverTaskList")
|
@GetMapping("deliverTaskList")
|
||||||
public MultiResult<TaskVo> deliverTaskList(@Valid IdDto idDto) throws Exception{
|
public MultiResult<TaskVo> deliverTaskList(@Valid IdDto idDto) throws Exception {
|
||||||
MultiResult<TaskVo> result = new MultiResult<>();
|
MultiResult<TaskVo> result = new MultiResult<>();
|
||||||
SysUser user = sysUserMapper.selectByPrimaryKey(idDto.getId());
|
SysUser user = sysUserMapper.selectByPrimaryKey(idDto.getId());
|
||||||
System.out.println("user=========" + user);
|
System.out.println("user=========" + user);
|
||||||
List<TaskVo> oaTasks = oaTaskMapper.deliverTaskList("%%",idDto.getId());
|
List<TaskVo> oaTasks = oaTaskMapper.deliverTaskList("%%", idDto.getId());
|
||||||
|
|
||||||
if(null == user){
|
if (null == user) {
|
||||||
result.setCode(0);
|
result.setCode(0);
|
||||||
result.setMessage("未知错误");
|
result.setMessage("未知错误");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if(oaTasks != null){
|
if (oaTasks != null) {
|
||||||
result.setData(oaTasks);
|
result.setData(oaTasks);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -205,42 +205,41 @@ public class WorkController extends BaseController{
|
||||||
* @Author ZQW
|
* @Author ZQW
|
||||||
* @CreateTime 2022/9/26 9:34
|
* @CreateTime 2022/9/26 9:34
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "查询我收到的任务",position = 6)
|
@ApiOperation(value = "查询我收到的任务", position = 6)
|
||||||
@ApiImplicitParams(value = {
|
@ApiImplicitParams(value = {
|
||||||
@ApiImplicitParam(name = "id",value = "接收用户id")
|
@ApiImplicitParam(name = "id", value = "接收用户id")
|
||||||
})
|
})
|
||||||
@GetMapping("getTaskList")
|
@GetMapping("getTaskList")
|
||||||
public MultiResult<TaskVo> getTaskList(@Valid IdDto idDto){
|
public MultiResult<TaskVo> getTaskList(@Valid IdDto idDto) {
|
||||||
MultiResult<TaskVo> result = new MultiResult<>();
|
MultiResult<TaskVo> result = new MultiResult<>();
|
||||||
SysUser user = sysUserMapper.selectByPrimaryKey(idDto.getId());
|
SysUser user = sysUserMapper.selectByPrimaryKey(idDto.getId());
|
||||||
List<TaskVo> oaTasks = oaTaskMapper.getTaskList("%%",idDto.getId());
|
List<TaskVo> oaTasks = oaTaskMapper.getTaskList("%%", idDto.getId());
|
||||||
|
|
||||||
if(null == user){
|
if (null == user) {
|
||||||
result.setCode(0);
|
result.setCode(0);
|
||||||
result.setMessage("未知错误");
|
result.setMessage("未知错误");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if(oaTasks != null){
|
if (oaTasks != null) {
|
||||||
result.setData(oaTasks);
|
result.setData(oaTasks);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return: 完成任务
|
* @return: 完成任务
|
||||||
* @Author: ZQW
|
* @Author: ZQW
|
||||||
* @Date: 2022/9/20
|
* @Date: 2022/9/20
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "完成任务",position = 7)
|
@ApiOperation(value = "完成任务", position = 7)
|
||||||
@PostMapping("addExecute")
|
@PostMapping("addExecute")
|
||||||
public SingleResult<String> addExecute(@Valid FinishWorkDto finishDto) throws Exception{
|
public SingleResult<String> addExecute(@Valid FinishWorkDto finishDto) throws Exception {
|
||||||
SingleResult<String> result = new SingleResult<>();
|
SingleResult<String> result = new SingleResult<>();
|
||||||
//日期格式转换
|
//日期格式转换
|
||||||
ConvertUtils.register(new DateConverter(null), Date.class);
|
ConvertUtils.register(new DateConverter(null), Date.class);
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(finishDto.getOadistributionid())){
|
if (StringUtils.isNotBlank(finishDto.getOadistributionid())) {
|
||||||
OADistribution oaDistribution = oaDistributionMapper.selectDistribution(finishDto.getOadistributionid());
|
OADistribution oaDistribution = oaDistributionMapper.selectDistribution(finishDto.getOadistributionid());
|
||||||
oaDistribution.setSubject(finishDto.getSubject());
|
oaDistribution.setSubject(finishDto.getSubject());
|
||||||
oaDistribution.setTitle(finishDto.getTitle());
|
oaDistribution.setTitle(finishDto.getTitle());
|
||||||
|
|
@ -259,12 +258,12 @@ public class WorkController extends BaseController{
|
||||||
* @Author ZQW
|
* @Author ZQW
|
||||||
* @CreateTime 2022/9/29 13:56
|
* @CreateTime 2022/9/29 13:56
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "发布任务详情",position = 10)
|
@ApiOperation(value = "发布任务详情", position = 10)
|
||||||
@ApiImplicitParams(value = {
|
@ApiImplicitParams(value = {
|
||||||
@ApiImplicitParam(name = "id",value = "任务id")
|
@ApiImplicitParam(name = "id", value = "任务id")
|
||||||
})
|
})
|
||||||
@GetMapping("deliverTaskDetail")
|
@GetMapping("deliverTaskDetail")
|
||||||
public SingleResult<TaskDetailVo> deliverTaskDetail(@Valid IdDto idDto){
|
public SingleResult<TaskDetailVo> deliverTaskDetail(@Valid IdDto idDto) {
|
||||||
SingleResult<TaskDetailVo> result = new SingleResult<>();
|
SingleResult<TaskDetailVo> result = new SingleResult<>();
|
||||||
TaskDetailVo detailVo = oaTaskMapper.selectDetail(idDto.getId());
|
TaskDetailVo detailVo = oaTaskMapper.selectDetail(idDto.getId());
|
||||||
result.setData(detailVo);
|
result.setData(detailVo);
|
||||||
|
|
@ -276,12 +275,12 @@ public class WorkController extends BaseController{
|
||||||
* @Author ZQW
|
* @Author ZQW
|
||||||
* @CreateTime 2022/10/31 16:04
|
* @CreateTime 2022/10/31 16:04
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "收到任务详情",position = 11)
|
@ApiOperation(value = "收到任务详情", position = 11)
|
||||||
@ApiImplicitParams(value = {
|
@ApiImplicitParams(value = {
|
||||||
@ApiImplicitParam(name = "id",value = "任务分配id")
|
@ApiImplicitParam(name = "id", value = "任务分配id")
|
||||||
})
|
})
|
||||||
@GetMapping("receiveTaskDetail")
|
@GetMapping("receiveTaskDetail")
|
||||||
public SingleResult<ReceiveTaskVo> receiveTaskDetail(@Valid IdDto idDto){
|
public SingleResult<ReceiveTaskVo> receiveTaskDetail(@Valid IdDto idDto) {
|
||||||
SingleResult<ReceiveTaskVo> result = new SingleResult<>();
|
SingleResult<ReceiveTaskVo> result = new SingleResult<>();
|
||||||
ReceiveTaskVo receiveTaskVo = oaTaskMapper.selectReceive(idDto.getId());
|
ReceiveTaskVo receiveTaskVo = oaTaskMapper.selectReceive(idDto.getId());
|
||||||
result.setData(receiveTaskVo);
|
result.setData(receiveTaskVo);
|
||||||
|
|
@ -295,18 +294,18 @@ public class WorkController extends BaseController{
|
||||||
* @CreateTime 2022/10/27 15:34
|
* @CreateTime 2022/10/27 15:34
|
||||||
*/
|
*/
|
||||||
@Transactional
|
@Transactional
|
||||||
@ApiOperation(value = "任务流转",position = 12)
|
@ApiOperation(value = "任务流转", position = 12)
|
||||||
@PostMapping("taskFlow")
|
@PostMapping("taskFlow")
|
||||||
public SingleResult<String> taskFlow(@Valid WorkFlowDto flowDto) throws Exception{
|
public SingleResult<String> taskFlow(@Valid WorkFlowDto flowDto) throws Exception {
|
||||||
SingleResult<String> result = new SingleResult<>();
|
SingleResult<String> result = new SingleResult<>();
|
||||||
OADistribution work = oaDistributionMapper.selectDistribution(flowDto.getOaDistributionId());
|
OADistribution work = oaDistributionMapper.selectDistribution(flowDto.getOaDistributionId());
|
||||||
|
|
||||||
String[] sysuid = flowDto.getSysUserId().split(",");
|
String[] sysuid = flowDto.getSysUserId().split(",");
|
||||||
List<OADistribution> list = new ArrayList<>();
|
List<OADistribution> list = new ArrayList<>();
|
||||||
for (String uid: sysuid) {
|
for (String uid : sysuid) {
|
||||||
int num = oaDistributionMapper.checkExist(work.getOataskid(),uid);
|
int num = oaDistributionMapper.checkExist(work.getOataskid(), uid);
|
||||||
System.err.println("数量======" + num);
|
System.err.println("数量======" + num);
|
||||||
if(num <= 0){
|
if (num <= 0) {
|
||||||
OADistribution oaDistribution = new OADistribution();
|
OADistribution oaDistribution = new OADistribution();
|
||||||
oaDistribution.setOadistributionid(RandomNumber.getUUid());
|
oaDistribution.setOadistributionid(RandomNumber.getUUid());
|
||||||
oaDistribution.setOataskid(work.getOataskid());
|
oaDistribution.setOataskid(work.getOataskid());
|
||||||
|
|
@ -321,7 +320,7 @@ public class WorkController extends BaseController{
|
||||||
list.add(oaDistribution);
|
list.add(oaDistribution);
|
||||||
|
|
||||||
System.err.println("插入的内容" + oaDistribution);
|
System.err.println("插入的内容" + oaDistribution);
|
||||||
}else {
|
} else {
|
||||||
result.setCode(0);
|
result.setCode(0);
|
||||||
result.setMessage("以流转任务,即将回滚");
|
result.setMessage("以流转任务,即将回滚");
|
||||||
return result;
|
return result;
|
||||||
|
|
@ -340,21 +339,21 @@ public class WorkController extends BaseController{
|
||||||
* @Author ZQW
|
* @Author ZQW
|
||||||
* @CreateTime 2022/11/1 13:41
|
* @CreateTime 2022/11/1 13:41
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "查询用户",position = 13)
|
@ApiOperation(value = "查询用户", position = 13)
|
||||||
@GetMapping ("selectUser")
|
@GetMapping("selectUser")
|
||||||
@ApiImplicitParams(value = {
|
@ApiImplicitParams(value = {
|
||||||
@ApiImplicitParam(name = "id",value = "登录用户id",required = true)
|
@ApiImplicitParam(name = "id", value = "登录用户id", required = true)
|
||||||
})
|
})
|
||||||
@PreAuthorize("hasAnyAuthority('selectUser','selectUser:update')")
|
@PreAuthorize("hasAnyAuthority('selectUser','selectUser:update')")
|
||||||
@MethodAnnotation(authorizations = {"selectUser","selectUser:update"},name = "查询用户")
|
@MethodAnnotation(authorizations = {"selectUser", "selectUser:update"}, name = "查询用户")
|
||||||
public MultiResult<UserVo> selectUser(@Valid IdDto idDto){
|
public MultiResult<UserVo> selectUser(@Valid IdDto idDto) {
|
||||||
MultiResult<UserVo> result = new MultiResult();
|
MultiResult<UserVo> result = new MultiResult();
|
||||||
List<UserVo> userVoList = sysUserMapper.selectTransferor();
|
List<UserVo> userVoList = sysUserMapper.selectTransferor();
|
||||||
|
|
||||||
//移除登录用户
|
//移除登录用户
|
||||||
for(Iterator<UserVo> iter = userVoList.listIterator(); iter.hasNext();){
|
for (Iterator<UserVo> iter = userVoList.listIterator(); iter.hasNext(); ) {
|
||||||
UserVo next = iter.next();
|
UserVo next = iter.next();
|
||||||
if((idDto.getId().equals(next.getSysuserid()))){
|
if ((idDto.getId().equals(next.getSysuserid()))) {
|
||||||
iter.remove();
|
iter.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -367,21 +366,21 @@ public class WorkController extends BaseController{
|
||||||
* @Author ZQW
|
* @Author ZQW
|
||||||
* @CreateTime 2022/11/3 11:14
|
* @CreateTime 2022/11/3 11:14
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "查询任务是否完成",position = 14)
|
@ApiOperation(value = "查询任务是否完成", position = 14)
|
||||||
@GetMapping ("checkFinish")
|
@GetMapping("checkFinish")
|
||||||
@ApiImplicitParams(value = {
|
@ApiImplicitParams(value = {
|
||||||
@ApiImplicitParam(name = "id",value = "任务id")
|
@ApiImplicitParam(name = "id", value = "任务id")
|
||||||
})
|
})
|
||||||
@PreAuthorize("hasAnyAuthority('checkFinish','checkFinish:update')")
|
@PreAuthorize("hasAnyAuthority('checkFinish','checkFinish:update')")
|
||||||
@MethodAnnotation(authorizations = {"checkFinish","checkFinish:update"},name = "查询任务是否完成")
|
@MethodAnnotation(authorizations = {"checkFinish", "checkFinish:update"}, name = "查询任务是否完成")
|
||||||
public SingleResult<String> checkFinish(@Valid IdDto idDto){
|
public SingleResult<String> checkFinish(@Valid IdDto idDto) {
|
||||||
SingleResult<String> result = new SingleResult<>();
|
SingleResult<String> result = new SingleResult<>();
|
||||||
List<WorkStateVo> stateVoList = oaTaskMapper.selectWorkState(idDto.getId());
|
List<WorkStateVo> stateVoList = oaTaskMapper.selectWorkState(idDto.getId());
|
||||||
OATask oaTask = oaTaskMapper.selectOATask(idDto.getId());
|
OATask oaTask = oaTaskMapper.selectOATask(idDto.getId());
|
||||||
for (WorkStateVo list : stateVoList) {
|
for (WorkStateVo list : stateVoList) {
|
||||||
if ((list.getAppStatus()).equals("3")){
|
if ((list.getAppStatus()).equals("3")) {
|
||||||
oaTask.setAppstatus("3");
|
oaTask.setAppstatus("3");
|
||||||
}else {
|
} else {
|
||||||
oaTask.setAppstatus("2");
|
oaTask.setAppstatus("2");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -395,20 +394,20 @@ public class WorkController extends BaseController{
|
||||||
* @Author ZQW
|
* @Author ZQW
|
||||||
* @CreateTime 2022/11/8 15:00
|
* @CreateTime 2022/11/8 15:00
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "任务流转接收人列表",position = 15)
|
@ApiOperation(value = "任务流转接收人列表", position = 15)
|
||||||
@GetMapping ("selectFlowUser")
|
@GetMapping("selectFlowUser")
|
||||||
@PreAuthorize("hasAnyAuthority('selectFlowUser','selectFlowUser:update')")
|
@PreAuthorize("hasAnyAuthority('selectFlowUser','selectFlowUser:update')")
|
||||||
@MethodAnnotation(authorizations = {"selectFlowUser","selectFlowUser:update"},name = "任务流转接收人列表")
|
@MethodAnnotation(authorizations = {"selectFlowUser", "selectFlowUser:update"}, name = "任务流转接收人列表")
|
||||||
public MultiResult<FlowUserVo> selectFlowUser(@Valid FlowUserDto flowUserDto){
|
public MultiResult<FlowUserVo> selectFlowUser(@Valid FlowUserDto flowUserDto) {
|
||||||
MultiResult<FlowUserVo> result = new MultiResult();
|
MultiResult<FlowUserVo> result = new MultiResult();
|
||||||
OADistribution oaDistribution = oaDistributionMapper.selectDistribution(flowUserDto.getOADistributionId());
|
OADistribution oaDistribution = oaDistributionMapper.selectDistribution(flowUserDto.getOADistributionId());
|
||||||
System.err.println("流转状态=====" + oaDistribution.getFlowState());
|
System.err.println("流转状态=====" + oaDistribution.getFlowState());
|
||||||
System.err.println("主任务信息=====" + oaDistribution);
|
System.err.println("主任务信息=====" + oaDistribution);
|
||||||
if(oaDistribution.getFlowState() == 2){
|
if (oaDistribution.getFlowState() == 2) {
|
||||||
List<FlowUserVo> list = oaDistributionMapper.selectFlowUser(flowUserDto);
|
List<FlowUserVo> list = oaDistributionMapper.selectFlowUser(flowUserDto);
|
||||||
result.setData(list);
|
result.setData(list);
|
||||||
return result;
|
return result;
|
||||||
}else {
|
} else {
|
||||||
result.setMessage("未流转任务");
|
result.setMessage("未流转任务");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
@ -420,21 +419,21 @@ public class WorkController extends BaseController{
|
||||||
* @Author ZQW
|
* @Author ZQW
|
||||||
* @CreateTime 2022/11/8 15:21
|
* @CreateTime 2022/11/8 15:21
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "任务流转人详情",position = 16)
|
@ApiOperation(value = "任务流转人详情", position = 16)
|
||||||
@GetMapping ("FlowUserDetail")
|
@GetMapping("FlowUserDetail")
|
||||||
@ApiImplicitParams(value = {
|
@ApiImplicitParams(value = {
|
||||||
@ApiImplicitParam(name = "id",value = "任务分配id")
|
@ApiImplicitParam(name = "id", value = "任务分配id")
|
||||||
})
|
})
|
||||||
@PreAuthorize("hasAnyAuthority('FlowUserDetail','FlowUserDetail:update')")
|
@PreAuthorize("hasAnyAuthority('FlowUserDetail','FlowUserDetail:update')")
|
||||||
@MethodAnnotation(authorizations = {"FlowUserDetail","FlowUserDetail:update"},name = "任务流转人详情")
|
@MethodAnnotation(authorizations = {"FlowUserDetail", "FlowUserDetail:update"}, name = "任务流转人详情")
|
||||||
public SingleResult<FlowDetailVo> FlowUserDetail(@Valid IdDto idDto){
|
public SingleResult<FlowDetailVo> FlowUserDetail(@Valid IdDto idDto) {
|
||||||
SingleResult<FlowDetailVo> result = new SingleResult();
|
SingleResult<FlowDetailVo> result = new SingleResult();
|
||||||
OADistribution oaDistribution = oaDistributionMapper.selectDistribution(idDto.getId());
|
OADistribution oaDistribution = oaDistributionMapper.selectDistribution(idDto.getId());
|
||||||
if((oaDistribution.getAppstatus().equals("1"))){
|
if ((oaDistribution.getAppstatus().equals("1"))) {
|
||||||
result.setCode(0);
|
result.setCode(0);
|
||||||
result.setMessage("该用户未完成任务");
|
result.setMessage("该用户未完成任务");
|
||||||
return result;
|
return result;
|
||||||
}else{
|
} else {
|
||||||
FlowDetailVo detailVo = oaDistributionMapper.FlowUserDetail(idDto);
|
FlowDetailVo detailVo = oaDistributionMapper.FlowUserDetail(idDto);
|
||||||
result.setData(detailVo);
|
result.setData(detailVo);
|
||||||
return result;
|
return result;
|
||||||
|
|
@ -446,14 +445,14 @@ public class WorkController extends BaseController{
|
||||||
* @Author ZQW
|
* @Author ZQW
|
||||||
* @CreateTime 2022/11/8 17:31
|
* @CreateTime 2022/11/8 17:31
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "修改任务完成状态",position = 17)
|
@ApiOperation(value = "修改任务完成状态", position = 17)
|
||||||
@PostMapping ("modifyState")
|
@PostMapping("modifyState")
|
||||||
@ApiImplicitParams(value = {
|
@ApiImplicitParams(value = {
|
||||||
@ApiImplicitParam(name = "id",value = "任务id")
|
@ApiImplicitParam(name = "id", value = "任务id")
|
||||||
})
|
})
|
||||||
@PreAuthorize("hasAnyAuthority('modifyState','modifyState:update')")
|
@PreAuthorize("hasAnyAuthority('modifyState','modifyState:update')")
|
||||||
@MethodAnnotation(authorizations = {"modifyState","modifyState:update"},name = "修改任务完成状态")
|
@MethodAnnotation(authorizations = {"modifyState", "modifyState:update"}, name = "修改任务完成状态")
|
||||||
public SingleResult<String> modifyState(@Valid IdDto idDto){
|
public SingleResult<String> modifyState(@Valid IdDto idDto) {
|
||||||
SingleResult<String> result = new SingleResult<>();
|
SingleResult<String> result = new SingleResult<>();
|
||||||
OATask oaTask = oaTaskMapper.selectOATask(idDto.getId());
|
OATask oaTask = oaTaskMapper.selectOATask(idDto.getId());
|
||||||
oaTask.setAppstatus("3");
|
oaTask.setAppstatus("3");
|
||||||
|
|
@ -467,11 +466,11 @@ public class WorkController extends BaseController{
|
||||||
* @Author ZQW
|
* @Author ZQW
|
||||||
* @CreateTime 2022/11/9 11:15
|
* @CreateTime 2022/11/9 11:15
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "查看发布人任务执行情况",position = 18)
|
@ApiOperation(value = "查看发布人任务执行情况", position = 18)
|
||||||
@GetMapping ("selectImplementation")
|
@GetMapping("selectImplementation")
|
||||||
@PreAuthorize("hasAnyAuthority('selectImplementation','selectImplementation:update')")
|
@PreAuthorize("hasAnyAuthority('selectImplementation','selectImplementation:update')")
|
||||||
@MethodAnnotation(authorizations = {"selectImplementation","selectImplementation:update"},name = "查看发布人任务执行情况")
|
@MethodAnnotation(authorizations = {"selectImplementation", "selectImplementation:update"}, name = "查看发布人任务执行情况")
|
||||||
public MultiResult<ImplementationVo> selectImplementation(@Valid DeliverDto deliverDto){
|
public MultiResult<ImplementationVo> selectImplementation(@Valid DeliverDto deliverDto) {
|
||||||
MultiResult<ImplementationVo> result = new MultiResult();
|
MultiResult<ImplementationVo> result = new MultiResult();
|
||||||
List<ImplementationVo> list = oaDistributionMapper.selectImplementation(deliverDto);
|
List<ImplementationVo> list = oaDistributionMapper.selectImplementation(deliverDto);
|
||||||
result.setData(list);
|
result.setData(list);
|
||||||
|
|
@ -483,11 +482,11 @@ public class WorkController extends BaseController{
|
||||||
* @Author ZQW
|
* @Author ZQW
|
||||||
* @CreateTime 2022/11/16 10:07
|
* @CreateTime 2022/11/16 10:07
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "查询任务类型id",position = 20)
|
@ApiOperation(value = "查询任务类型id", position = 20)
|
||||||
@GetMapping ("selectTypeId")
|
@GetMapping("selectTypeId")
|
||||||
@PreAuthorize("hasAnyAuthority('selectTypeId','selectTypeId:update')")
|
@PreAuthorize("hasAnyAuthority('selectTypeId','selectTypeId:update')")
|
||||||
@MethodAnnotation(authorizations = {"selectTypeId","selectTypeId:update"},name = "查询任务类型id")
|
@MethodAnnotation(authorizations = {"selectTypeId", "selectTypeId:update"}, name = "查询任务类型id")
|
||||||
public MultiResult<OaTaskType> selectTypeId(){
|
public MultiResult<OaTaskType> selectTypeId() {
|
||||||
MultiResult<OaTaskType> result = new MultiResult();
|
MultiResult<OaTaskType> result = new MultiResult();
|
||||||
List<OaTaskType> list = oaTaskTypeMapper.selectFull();
|
List<OaTaskType> list = oaTaskTypeMapper.selectFull();
|
||||||
result.setData(list);
|
result.setData(list);
|
||||||
|
|
@ -499,14 +498,14 @@ public class WorkController extends BaseController{
|
||||||
* @Author ZQW
|
* @Author ZQW
|
||||||
* @CreateTime 2022/11/16 11:19
|
* @CreateTime 2022/11/16 11:19
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "查询参与人员姓名",position = 21)
|
@ApiOperation(value = "查询参与人员姓名", position = 21)
|
||||||
@GetMapping ("selectName")
|
@GetMapping("selectName")
|
||||||
@ApiImplicitParams(value = {
|
@ApiImplicitParams(value = {
|
||||||
@ApiImplicitParam(name = "userId",value = "任务发送人id",required = true)
|
@ApiImplicitParam(name = "userId", value = "任务发送人id", required = true)
|
||||||
})
|
})
|
||||||
@PreAuthorize("hasAnyAuthority('selectName','selectName:update')")
|
@PreAuthorize("hasAnyAuthority('selectName','selectName:update')")
|
||||||
@MethodAnnotation(authorizations = {"selectName","selectName:update"},name = "查询参与人员姓名")
|
@MethodAnnotation(authorizations = {"selectName", "selectName:update"}, name = "查询参与人员姓名")
|
||||||
public MultiResult<NameVo> selectName(@Valid AddWorkDto addWorkDto){
|
public MultiResult<NameVo> selectName(@Valid AddWorkDto addWorkDto) {
|
||||||
MultiResult<NameVo> result = new MultiResult();
|
MultiResult<NameVo> result = new MultiResult();
|
||||||
List<NameVo> list = oaDistributionMapper.selectJoinUser(addWorkDto);
|
List<NameVo> list = oaDistributionMapper.selectJoinUser(addWorkDto);
|
||||||
result.setData(list);
|
result.setData(list);
|
||||||
|
|
@ -514,4 +513,107 @@ public class WorkController extends BaseController{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应急资源列表
|
||||||
|
*
|
||||||
|
* @return list
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "应急资源列表", notes = "应急资源列表")
|
||||||
|
@GetMapping(value = "/entEmEquipmentList")
|
||||||
|
@PreAuthorize("hasAnyAuthority('entEmEquipmentList','entEmEquipmentList:update')")
|
||||||
|
@MethodAnnotation(authorizations = {"entEmEquipmentList", "entEmEquipmentList:update"}, name = "应急资源列表")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "enterpriseId", value = "企业id", required = true, dataType = "string"),
|
||||||
|
@ApiImplicitParam(name = "page", value = "page", required = true, dataType = "string"),
|
||||||
|
@ApiImplicitParam(name = "pageSize", value = "pageSize", required = true, dataType = "string"),
|
||||||
|
@ApiImplicitParam(name = "resourceType", value = "物质类型", required = false, dataType = "string"),
|
||||||
|
})
|
||||||
|
@ResponseBody
|
||||||
|
public SingleResult<List<EntEmEquipment>> entEmEquipmentList(@RequestParam(required = true) String enterpriseId,
|
||||||
|
@RequestParam(required = true) Integer page,
|
||||||
|
@RequestParam(required = true) Integer pageSize,
|
||||||
|
String resourceType) throws Exception {
|
||||||
|
return pcBusinessService.entEmEquipmentList(enterpriseId, page, pageSize, resourceType);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应急预案
|
||||||
|
*
|
||||||
|
* @return list
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "应急预案列表", notes = "应急预案列表")
|
||||||
|
@GetMapping(value = "/entEmReservePlanList")
|
||||||
|
@PreAuthorize("hasAnyAuthority('entEmReservePlanList','entEmReservePlanList:update')")
|
||||||
|
@MethodAnnotation(authorizations = {"entEmReservePlanList", "entEmReservePlanList:update"}, name = "应急预案列表")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "enterpriseId", value = "企业id", required = true, dataType = "string"),
|
||||||
|
@ApiImplicitParam(name = "page", value = "page", required = true, dataType = "string"),
|
||||||
|
@ApiImplicitParam(name = "pageSize", value = "pageSize", required = true, dataType = "string"),
|
||||||
|
@ApiImplicitParam(name = "entEmReservePlanName", value = "预案名", required = false, dataType = "string")
|
||||||
|
})
|
||||||
|
@ResponseBody
|
||||||
|
public SingleResult<List<EntEmReservePlan>> entEmReservePlanList(@RequestParam(required = true) String enterpriseId,
|
||||||
|
@RequestParam(required = true) Integer page,
|
||||||
|
@RequestParam(required = true) Integer pageSize,
|
||||||
|
String entEmReservePlanName) throws Exception {
|
||||||
|
return pcBusinessService.entEmReservePlanList(enterpriseId, page, pageSize, entEmReservePlanName);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 查询智能预警
|
||||||
|
* @Author ZQW
|
||||||
|
* @CreateTime 2022/11/23 15:15
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "查询智能预警", position = 30)
|
||||||
|
@GetMapping("selectWarn")
|
||||||
|
@PreAuthorize("hasAnyAuthority('selectWarn','selectWarn:update')")
|
||||||
|
@MethodAnnotation(authorizations = {"selectWarn", "selectWarn:update"}, name = "查询智能预警")
|
||||||
|
public MultiResult<GovWarning> selectWarn(@Valid WarnDto warnDto) {
|
||||||
|
MultiResult<GovWarning> result = new MultiResult();
|
||||||
|
List<GovWarning> list = govWarningMapper.selectAll(warnDto);
|
||||||
|
result.setData(list);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 智能预警分页
|
||||||
|
* @Author ZQW
|
||||||
|
* @CreateTime 2022/11/23 16:35
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "智能预警分页", notes = "智能预警分页", position = 31)
|
||||||
|
@GetMapping("/WarnList")
|
||||||
|
@PreAuthorize("hasAnyAuthority('WarnList','WarnList:update')")
|
||||||
|
@MethodAnnotation(authorizations = {"WarnList", "WarnList:update"}, name = "智能预警分页")
|
||||||
|
public SingleResult<Pager<GovWarning>> WarnList(@Valid PageDto pageDto) throws Exception {
|
||||||
|
SingleResult<Pager<GovWarning>> result = new SingleResult<>();
|
||||||
|
PageHelper.startPage(pageDto.getPage(), pageDto.getPageSize());
|
||||||
|
Page<GovWarning> page = (Page<GovWarning>) govWarningMapper.warnList(pageDto.getCondition());
|
||||||
|
Pager<GovWarning> pager = new Pager<>();
|
||||||
|
getDatePage(pager, page);
|
||||||
|
result.setData(pager);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 计算未处理数量值
|
||||||
|
* @Author ZQW
|
||||||
|
* @CreateTime 2022/11/23 16:48
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "计算未处理数量值", position = 32)
|
||||||
|
@PostMapping("countWarnNum")
|
||||||
|
@ApiImplicitParam(name = "type", value = "类型:1.企业重大隐患 2.隐患未按期闭环 3.企业清单未落实 4.政府履职清单未履行 5.下级未履行上级任务", required = true)
|
||||||
|
@PreAuthorize("hasAnyAuthority('countWarnNum','countWarnNum:update')")
|
||||||
|
@MethodAnnotation(authorizations = {"countWarnNum", "countWarnNum:update"}, name = "计算未处理数量值")
|
||||||
|
public SingleResult<NumVo> countWarnNum(@Valid Integer type){
|
||||||
|
SingleResult<NumVo> result = new SingleResult<>();
|
||||||
|
NumVo vo = new NumVo();
|
||||||
|
int totalNum = govWarningMapper.countNum(type);
|
||||||
|
System.err.println("数量=====" + totalNum);
|
||||||
|
vo.setNum(totalNum);
|
||||||
|
result.setData(vo);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,63 @@
|
||||||
|
package com.rzyc.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.common.utils.Arith;
|
||||||
|
import com.common.utils.RandomNumber;
|
||||||
|
import com.common.utils.StringUtils;
|
||||||
|
import com.common.utils.TypeConversion;
|
||||||
|
import com.common.utils.encryption.MD5;
|
||||||
|
import com.common.utils.model.Code;
|
||||||
|
import com.common.utils.model.Message;
|
||||||
|
import com.common.utils.model.SingleResult;
|
||||||
|
import com.common.utils.pager.PageOperation;
|
||||||
|
import com.github.pagehelper.Page;
|
||||||
|
import com.rzyc.advice.CustomException;
|
||||||
|
import com.rzyc.config.RedisUtil;
|
||||||
|
import com.rzyc.controller.BaseController;
|
||||||
|
import com.rzyc.enums.DelState;
|
||||||
|
import com.rzyc.enums.RedisKeys;
|
||||||
|
import com.rzyc.model.*;
|
||||||
|
import com.rzyc.model.dto.*;
|
||||||
|
import com.rzyc.model.ent.EntPost;
|
||||||
|
import com.rzyc.model.ent.EntUser;
|
||||||
|
import com.rzyc.model.ent.InEntList;
|
||||||
|
import com.rzyc.model.ent.SysEnterprise;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业端pc业务 Service
|
||||||
|
* @author Xuwanxin
|
||||||
|
* @date 2022/9/29
|
||||||
|
* */
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class PcBusinessService extends BaseController {
|
||||||
|
|
||||||
|
RedisUtil redisUtil;
|
||||||
|
|
||||||
|
@PageOperation
|
||||||
|
public SingleResult entEmEquipmentList(String enterpriseId,Integer page,Integer pageSize,String resourceType){
|
||||||
|
SingleResult singleResult = new SingleResult();
|
||||||
|
Page<EntEmEquipment> entEmEquipments = (Page<EntEmEquipment>) entEmEquipmentMapper.selectEntEmEquipmentList(enterpriseId,resourceType);
|
||||||
|
singleResult.setDataPager(entEmEquipments);
|
||||||
|
return singleResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PageOperation
|
||||||
|
public SingleResult entEmReservePlanList(String enterpriseId,Integer page,Integer pageSize,String entEmReservePlanName){
|
||||||
|
SingleResult singleResult = new SingleResult();
|
||||||
|
Page<EntEmReservePlan>list = (Page<EntEmReservePlan>) entEmReservePlanMapper.selectEntEmReservePlanList(enterpriseId,entEmReservePlanName);
|
||||||
|
singleResult.setDataPager(list);
|
||||||
|
return singleResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user