This commit is contained in:
sxu 2024-12-25 12:08:57 +08:00
parent ae9d118c49
commit a9ca59b733
7 changed files with 259 additions and 11 deletions

View File

@ -4,17 +4,8 @@ import lombok.Getter;
@Getter @Getter
public enum TmTaskTypeEnum { public enum TmTaskTypeEnum {
TM_TASK_DEV(1, "商城装备维护任务"),
TM_TASK_PURCHASE(0, "新购"), TM_TASK_ORDER(2, "商城订单任务"),
TM_TASK_PURCHASE_PART(1, "新购配件任务"),
TM_TASK_LEASE(2, "领料任务"),
TM_TASK_BACK(3, "退料任务"),
TM_TASK_REPAIR(4, "维修任务"),
TM_TASK_REPAIR_STORAGE(5, "修试后入库任务"),
TM_TASK_SCRAP(6, "报废任务"),
TM_TASK_SETTLEMENT(7, "结算任务"),
TM_TASK_CHECK(8, "检验任务"),
TM_TASK_FACTORY_MANAGEMENT(9, "物资厂家管理任务"),
TM_TASK_AGREEMENT_MANAGEMENT(10, "新增协议任务"), TM_TASK_AGREEMENT_MANAGEMENT(10, "新增协议任务"),
TM_TASK_ADD_DEVICE_TASK(17, "新增商城物资任务"), TM_TASK_ADD_DEVICE_TASK(17, "新增商城物资任务"),
TM_TASK_ADD_REQUIREMENT_TASK(18, "新增商城需求任务"), TM_TASK_ADD_REQUIREMENT_TASK(18, "新增商城需求任务"),

View File

@ -0,0 +1,41 @@
package com.bonus.material.basic.controller;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.web.page.TableDataInfo;
import com.bonus.material.basic.domain.ToDoBean;
import com.bonus.material.basic.service.ToDoService;
import com.bonus.material.common.annotation.PreventRepeatSubmit;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@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 = "代办事件下拉")
@PreventRepeatSubmit
@PostMapping("/getTaskType")
public AjaxResult getTaskType(ToDoBean bean){
return toDoService.getTaskType(bean);
}
}

View File

@ -0,0 +1,76 @@
package com.bonus.material.basic.domain;
import com.bonus.common.core.annotation.Excel;
import com.bonus.common.core.web.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* 代办事项
* @Author 阮世耀
* @Create 2023/12/13 15:45
* @Version 1.0
*/
@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;
}

View File

@ -0,0 +1,22 @@
package com.bonus.material.basic.mapper;
import com.bonus.material.basic.domain.ToDoBean;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface ToDoMapper {
/**
* 代办事项列表
* @param bean
* @return
*/
List<ToDoBean> getToDoList(ToDoBean bean);
/**
* 获取TaskType
* @param bean
* @return ToDoBean
*/
List<ToDoBean> getTaskType(ToDoBean bean);
}

View File

@ -0,0 +1,23 @@
package com.bonus.material.basic.service;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.material.basic.domain.ToDoBean;
import java.util.List;
public interface ToDoService {
/**
* 代办事项列表
* @param bean
* @return
*/
List<ToDoBean> getToDoList(ToDoBean bean);
/**
* 代办事件下拉
* @param bean
* @return
*/
AjaxResult getTaskType(ToDoBean bean);
}

View File

@ -0,0 +1,41 @@
package com.bonus.material.basic.service.impl;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.material.basic.domain.ToDoBean;
import com.bonus.material.basic.mapper.ToDoMapper;
import com.bonus.material.basic.service.ToDoService;
import com.bonus.system.api.RemoteUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Service
@Slf4j
public class ToDoServiceImpl implements ToDoService {
@Resource
private ToDoMapper toDoMapper;
@Resource
private RemoteUserService remoteUserService;
@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);
}
}

View File

@ -0,0 +1,54 @@
<?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.material.basic.mapper.ToDoMapper">
<select id="getToDoList" resultType="com.bonus.material.basic.domain.ToDoBean">
SELECT
tt.task_id as taskId,
tt.`code` as taskCode,
tt.task_type as taskTypeId,
sd2.dict_label as taskType,
sd3.dict_label as taskEvent,
us.user_name as createName,
tt.create_by as createBy,
tt.create_time as createTime
FROM
tm_task tt
LEFT JOIN sys_dict_data sd2 on sd2.dict_value=tt.task_type
LEFT JOIN sys_dict_data sd3 on sd3.dict_value=tt.task_status
LEFT JOIN sys_user us on us.user_id=tt.create_by
WHERE
tt.`status` = '1'
and sd2.dict_type in ('tm_task_type')
and tt.task_type in (2)
and tt.task_status in (1,2,3,4,5,10,15,20,99)
<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 != null and endTime != ''">
AND tt.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
</if>
<if test="keyWord != null and keyWord != ''">
and sd2.dict_label like concat('%', #{keyWord}, '%') or
sd3.dict_label like concat('%', #{keyWord}, '%') or
us.user_name like concat('%', #{keyWord}, '%')
</if>
ORDER BY tt.create_time desc
</select>
<select id="getTaskType" resultType="com.bonus.material.basic.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>