待办事项
This commit is contained in:
parent
a954cbdb30
commit
25477c1289
|
|
@ -0,0 +1,52 @@
|
||||||
|
package com.bonus.sgzb.material.controller;
|
||||||
|
|
||||||
|
import com.bonus.sgzb.common.core.utils.poi.ExcelUtil;
|
||||||
|
import com.bonus.sgzb.common.core.web.controller.BaseController;
|
||||||
|
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
||||||
|
import com.bonus.sgzb.common.log.annotation.Log;
|
||||||
|
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||||
|
import com.bonus.sgzb.material.domain.AgreementInfo;
|
||||||
|
import com.bonus.sgzb.material.domain.ToDoBean;
|
||||||
|
import com.bonus.sgzb.material.service.AgreementInfoService;
|
||||||
|
import com.bonus.sgzb.material.service.ToDoService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 首页--代办事项
|
||||||
|
* @author hay
|
||||||
|
* @date 2024/1/15 17:16
|
||||||
|
*/
|
||||||
|
@Api(tags = " 代办事项")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/todo")
|
||||||
|
public class ToDoController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private ToDoService toDoService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代办事项列表
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "代办事项列表")
|
||||||
|
@GetMapping("/getToDoList")
|
||||||
|
public TableDataInfo getToDoList(ToDoBean bean)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<ToDoBean> list = toDoService.getToDoList(bean);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "代办事件下拉")
|
||||||
|
@PostMapping("/getTaskType")
|
||||||
|
public AjaxResult getTaskType(ToDoBean bean){
|
||||||
|
return toDoService.getTaskType(bean);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,73 @@
|
||||||
|
package com.bonus.sgzb.material.domain;
|
||||||
|
|
||||||
|
import com.bonus.sgzb.common.core.annotation.Excel;
|
||||||
|
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代办事项
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ToDoBean extends BaseEntity {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 任务ID */
|
||||||
|
@ApiModelProperty(value = "任务ID")
|
||||||
|
private Long taskId;
|
||||||
|
|
||||||
|
/** 任务单号 */
|
||||||
|
@Excel(name = "任务单号")
|
||||||
|
@ApiModelProperty(value = "任务单号")
|
||||||
|
private String taskCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代办事件id
|
||||||
|
*/
|
||||||
|
private String taskTypeId;
|
||||||
|
|
||||||
|
/** 代办任务 */
|
||||||
|
@Excel(name = "代办任务")
|
||||||
|
@ApiModelProperty(value = "代办任务")
|
||||||
|
private String taskType;
|
||||||
|
|
||||||
|
/** 代办事件 */
|
||||||
|
@Excel(name = "代办事件")
|
||||||
|
@ApiModelProperty(value = "代办事件")
|
||||||
|
private String taskEvent;
|
||||||
|
|
||||||
|
/** 任务创建人id */
|
||||||
|
@ApiModelProperty(value = "任务创建人")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人姓名
|
||||||
|
*/
|
||||||
|
private String createName;
|
||||||
|
|
||||||
|
/** 创建时间 */
|
||||||
|
@Excel(name = "创建时间")
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "关键字")
|
||||||
|
private String keyWord;
|
||||||
|
|
||||||
|
/** 备注 */
|
||||||
|
@Excel(name = "备注")
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
private String startTime;
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
private String endTime;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.bonus.sgzb.material.mapper;
|
||||||
|
|
||||||
|
import com.bonus.sgzb.material.domain.AgreementInfo;
|
||||||
|
import com.bonus.sgzb.material.domain.ToDoBean;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface ToDoMapper {
|
||||||
|
/**
|
||||||
|
* 代办事项列表
|
||||||
|
*/
|
||||||
|
List<ToDoBean> getToDoList(ToDoBean bean);
|
||||||
|
|
||||||
|
List<ToDoBean> getTaskType(ToDoBean bean);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.bonus.sgzb.material.service;
|
||||||
|
|
||||||
|
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.sgzb.material.domain.AgreementInfo;
|
||||||
|
import com.bonus.sgzb.material.domain.ToDoBean;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
public interface ToDoService {
|
||||||
|
/**
|
||||||
|
* 代办事项列表
|
||||||
|
*/
|
||||||
|
List<ToDoBean> getToDoList(ToDoBean bean);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代办事件下拉
|
||||||
|
*/
|
||||||
|
AjaxResult getTaskType(ToDoBean bean);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
package com.bonus.sgzb.material.service.impl;
|
||||||
|
|
||||||
|
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||||
|
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.sgzb.material.domain.AgreementInfo;
|
||||||
|
import com.bonus.sgzb.material.domain.ToDoBean;
|
||||||
|
import com.bonus.sgzb.material.mapper.AgreementInfoMapper;
|
||||||
|
import com.bonus.sgzb.material.mapper.ToDoMapper;
|
||||||
|
import com.bonus.sgzb.material.service.AgreementInfoService;
|
||||||
|
import com.bonus.sgzb.material.service.ToDoService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class ToDoServiceImpl implements ToDoService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ToDoMapper toDoMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ToDoBean> getToDoList(ToDoBean bean) {
|
||||||
|
return toDoMapper.getToDoList(bean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult getTaskType(ToDoBean bean) {
|
||||||
|
List<ToDoBean> list =new ArrayList<>();
|
||||||
|
try {
|
||||||
|
list = toDoMapper.getTaskType(bean);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("代办事件-查询失败", e);
|
||||||
|
}
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,49 @@
|
||||||
|
<?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.bonus.sgzb.material.mapper.ToDoMapper">
|
||||||
|
|
||||||
|
<select id="getToDoList" resultType="com.bonus.sgzb.material.domain.ToDoBean">
|
||||||
|
SELECT
|
||||||
|
tt.task_id as taskId,
|
||||||
|
tt.`code` as taskCode,
|
||||||
|
sd2.`name` as taskType,
|
||||||
|
sd.`name` as taskEvent,
|
||||||
|
us.user_name as createName,
|
||||||
|
tt.create_by as createBy,
|
||||||
|
tt.create_time as createTime
|
||||||
|
FROM
|
||||||
|
tm_task tt
|
||||||
|
LEFT JOIN sys_dic sd on sd.id=tt.task_status
|
||||||
|
LEFT JOIN sys_dic sd2 on sd2.id=tt.task_type
|
||||||
|
LEFT JOIN sys_user us on us.user_id=tt.create_by
|
||||||
|
WHERE
|
||||||
|
tt.`status` = '1'
|
||||||
|
and tt.task_status in ('24','25','30','31','32','33','34','37','39','42','43','46','53','58','68','69')
|
||||||
|
<if test="taskTypeId != null and taskTypeId != ''">
|
||||||
|
and tt.task_type=#{taskTypeId}
|
||||||
|
</if>
|
||||||
|
<if test="taskCode != null and taskCode != ''">
|
||||||
|
and tt.`code` like concat('%', #{taskCode}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="startTime != null and startTime != '' and endTime != '' and endTime != ''">
|
||||||
|
AND (tt.create_time like concat('%', #{startTime}, '%')
|
||||||
|
OR tt.create_time like concat('%', #{endTime}, '%'))
|
||||||
|
</if>
|
||||||
|
<if test="keyWord != null and keyWord != ''">
|
||||||
|
and sd2.`name` like concat('%', #{keyWord}, '%') or
|
||||||
|
us.user_name like concat('%', #{keyWord}, '%')
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<select id="getTaskType" resultType="com.bonus.sgzb.material.domain.ToDoBean">
|
||||||
|
SELECT
|
||||||
|
id as taskTypeId,`name` as taskType
|
||||||
|
FROM
|
||||||
|
sys_dic
|
||||||
|
WHERE
|
||||||
|
`status`='0'
|
||||||
|
and p_id='0'
|
||||||
|
and id not in (1,5,8,13,81)
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue