Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
7969e243de
|
|
@ -37,6 +37,9 @@ public class AddTaskDto {
|
|||
@ApiModelProperty(value = "任务发布人id",required = true)
|
||||
private String sendId;
|
||||
|
||||
@ApiModelProperty(value = "接收用户id",required = true)
|
||||
@TableField("SysUserId")
|
||||
private String sysuserid;
|
||||
/**
|
||||
* 0刚发出来 100已完成
|
||||
*/
|
||||
|
|
@ -87,27 +90,26 @@ public class AddTaskDto {
|
|||
@ApiModelProperty("任务完成状态")
|
||||
private String isfinish;
|
||||
|
||||
@ApiModelProperty(value = "删除状态 1、正常 2、已删除")
|
||||
@TableField("del_state")
|
||||
@ApiModelProperty("删除状态 1:正常 2:已删除")
|
||||
private Integer delState = 1;
|
||||
|
||||
@TableField("CreatedOn")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd ")
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createdon;
|
||||
|
||||
@TableField("CreatedBy")
|
||||
@ApiModelProperty("创建人")
|
||||
private String createdby;
|
||||
public String getSysuserid() {
|
||||
return sysuserid;
|
||||
}
|
||||
|
||||
@TableField("ModifiedOn")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd ")
|
||||
@ApiModelProperty("修改时间")
|
||||
private Date modifiedon;
|
||||
public void setSysuserid(String sysuserid) {
|
||||
this.sysuserid = sysuserid;
|
||||
}
|
||||
|
||||
@TableField("ModifiedBy")
|
||||
@ApiModelProperty("修改人")
|
||||
private String modifiedby;
|
||||
public Integer getDelState() {
|
||||
return delState;
|
||||
}
|
||||
|
||||
public void setDelState(Integer delState) {
|
||||
this.delState = delState;
|
||||
}
|
||||
|
||||
public String getOataskid() {
|
||||
return oataskid;
|
||||
|
|
@ -213,43 +215,6 @@ public class AddTaskDto {
|
|||
this.isfinish = isfinish;
|
||||
}
|
||||
|
||||
public Integer getDelState() {
|
||||
return delState;
|
||||
}
|
||||
|
||||
public void setDelState(Integer delState) {
|
||||
this.delState = delState;
|
||||
}
|
||||
|
||||
public Date getCreatedon() {
|
||||
return createdon;
|
||||
}
|
||||
|
||||
public void setCreatedon(Date createdon) {
|
||||
this.createdon = createdon;
|
||||
}
|
||||
|
||||
public String getCreatedby() {
|
||||
return createdby;
|
||||
}
|
||||
|
||||
public void setCreatedby(String createdby) {
|
||||
this.createdby = createdby;
|
||||
}
|
||||
|
||||
public Date getModifiedon() {
|
||||
return modifiedon;
|
||||
}
|
||||
|
||||
public void setModifiedon(Date modifiedon) {
|
||||
this.modifiedon = modifiedon;
|
||||
}
|
||||
|
||||
public String getModifiedby() {
|
||||
return modifiedby;
|
||||
}
|
||||
|
||||
public void setModifiedby(String modifiedby) {
|
||||
this.modifiedby = modifiedby;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,4 +43,5 @@ public interface OADistributionMapper extends BaseMapper<OADistribution> {
|
|||
//查询我收到的任务
|
||||
List<OADistribution> getTaskList(@Param("condition")String condition,
|
||||
@Param("snedId")String snedId);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,4 +110,12 @@ public interface OATaskMapper extends BaseMapper<OATask> {
|
|||
|
||||
//插入任务
|
||||
int insertTask(OATask oaTask);
|
||||
|
||||
//查询我发布的任务
|
||||
List<OATask> deliverTaskList(@Param("condition")String condition,
|
||||
@Param("sendId")String sendId);
|
||||
|
||||
//查询我收到的任务
|
||||
List<OATask> getTaskList(@Param("condition")String condition,
|
||||
@Param("sendId")String sendId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,10 @@ public class OATask implements Serializable {
|
|||
@ApiModelProperty("任务发布人")
|
||||
private String sendId;
|
||||
|
||||
@ApiModelProperty("接收用户id")
|
||||
@TableField("SysUserId")
|
||||
private String sysuserid;
|
||||
|
||||
/**
|
||||
* 0刚发出来 100已完成
|
||||
*/
|
||||
|
|
@ -157,6 +161,14 @@ public class OATask implements Serializable {
|
|||
@ApiModelProperty("任务接收人")
|
||||
private List<OADistribution> distributions = new ArrayList<>();
|
||||
|
||||
public String getSysuserid() {
|
||||
return sysuserid;
|
||||
}
|
||||
|
||||
public void setSysuserid(String sysuserid) {
|
||||
this.sysuserid = sysuserid;
|
||||
}
|
||||
|
||||
public String getOtcid() {
|
||||
return otcid;
|
||||
}
|
||||
|
|
@ -365,6 +377,36 @@ public class OATask implements Serializable {
|
|||
this.distributions = distributions;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OATask{" +
|
||||
"oataskid='" + oataskid + '\'' +
|
||||
", otcid='" + otcid + '\'' +
|
||||
", tasktype='" + tasktype + '\'' +
|
||||
", sendId='" + sendId + '\'' +
|
||||
", sysuserid='" + sysuserid + '\'' +
|
||||
", syspercent=" + syspercent +
|
||||
", startdate=" + startdate +
|
||||
", enddate=" + enddate +
|
||||
", planenddate=" + planenddate +
|
||||
", appstatus='" + appstatus + '\'' +
|
||||
", unitName='" + unitName + '\'' +
|
||||
", title='" + title + '\'' +
|
||||
", subject='" + subject + '\'' +
|
||||
", frequency=" + frequency +
|
||||
", totalFrequency=" + totalFrequency +
|
||||
", isfinish='" + isfinish + '\'' +
|
||||
", createdon=" + createdon +
|
||||
", createdby='" + createdby + '\'' +
|
||||
", modifiedon=" + modifiedon +
|
||||
", modifiedby='" + modifiedby + '\'' +
|
||||
", checkNum=" + checkNum +
|
||||
", sendName='" + sendName + '\'' +
|
||||
", taskStatus='" + taskStatus + '\'' +
|
||||
", redAlert=" + redAlert +
|
||||
", yellowAlert=" + yellowAlert +
|
||||
", delState=" + delState +
|
||||
", distributions=" + distributions +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,15 +22,15 @@ public class TaskAddOrUpdateDto {
|
|||
@TableId("OADistributionId")
|
||||
private String oadistributionid;
|
||||
|
||||
@ApiModelProperty(value = "任务id")
|
||||
@ApiModelProperty(value = "任务id",required = true)
|
||||
@TableField("OATaskId")
|
||||
private String oataskid;
|
||||
|
||||
@ApiModelProperty(value = "指派用户id",required = true)
|
||||
@ApiModelProperty(value = "指派用户id")
|
||||
@TableField("sned_id")
|
||||
private String snedId;
|
||||
|
||||
@ApiModelProperty(value = "接收用户id",required = true)
|
||||
@ApiModelProperty(value = "接收用户id")
|
||||
@TableField("SysUserId")
|
||||
private String sysuserid;
|
||||
|
||||
|
|
|
|||
|
|
@ -218,24 +218,21 @@
|
|||
order by ob.end_time asc
|
||||
</select>
|
||||
|
||||
<!--<select id="getTaskList" resultType="com.rzyc.model.OADistribution">
|
||||
<select id="getTaskList" resultType="com.rzyc.model.OADistribution">
|
||||
select ob.* from OADistribution ob
|
||||
where ob.subject like #{condition}
|
||||
and ob.SysUserId = #{snedId}
|
||||
order by ob.end_time asc
|
||||
</select>-->
|
||||
</select>
|
||||
|
||||
<select id="getTaskList" resultType="com.rzyc.model.OADistribution">
|
||||
<!--<select id="getTaskList" resultType="com.rzyc.model.OADistribution">
|
||||
select ob.* from OADistribution ob
|
||||
where 1=1
|
||||
<if test="null != condition and condition != ''">
|
||||
ob.subject like #{condition}
|
||||
</if>
|
||||
where ob.subject like #{condition}
|
||||
<if test="null != SysUserId and SysUserId != ''">
|
||||
and ob.SysUserId = #{snedId}
|
||||
</if>
|
||||
order by ob.end_time asc
|
||||
</select>
|
||||
</select>-->
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -426,7 +426,7 @@
|
|||
</select>
|
||||
|
||||
<insert id="insertTask" parameterType="com.rzyc.model.OATask">
|
||||
insert into OATask (OATaskId, TaskType,OTCId,send_id,
|
||||
insert into OATask (OATaskId, TaskType,OTCId,send_id,SysUserId
|
||||
SysPercent,
|
||||
StartDate, EndDate, PlanEndDate,
|
||||
AppStatus,title, Subject, Frequency,
|
||||
|
|
@ -438,6 +438,7 @@
|
|||
#{tasktype,jdbcType=VARCHAR},
|
||||
#{otcid,jdbcType=VARCHAR},
|
||||
#{sendId,jdbcType=VARCHAR},
|
||||
#{SysUserId,jdbcType=VARCHAR},
|
||||
#{syspercent,jdbcType=INTEGER},
|
||||
#{startdate,jdbcType=TIMESTAMP}, #{enddate,jdbcType=TIMESTAMP}, #{planenddate,jdbcType=TIMESTAMP},
|
||||
#{appstatus,jdbcType=VARCHAR},
|
||||
|
|
@ -449,4 +450,20 @@
|
|||
#{modifiedon,jdbcType=TIMESTAMP}, #{modifiedby,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="deliverTaskList" resultType="com.rzyc.model.OATask">
|
||||
select ot.* from OATask ot
|
||||
|
||||
where ot.subject like #{condition}
|
||||
and ot.send_id = #{sendId}
|
||||
order by ot.EndDate asc
|
||||
</select>
|
||||
|
||||
<select id="getTaskList" resultType="com.rzyc.model.OATask">
|
||||
select ot.* from OATask ot
|
||||
|
||||
where ot.TaskType like #{condition}
|
||||
and ot.SysUserId = #{sendId}
|
||||
order by ot.EndDate asc
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,138 @@
|
|||
package com.rzyc.controller;
|
||||
|
||||
import com.common.utils.RandomNumber;
|
||||
import com.common.utils.StringUtils;
|
||||
import com.common.utils.model.MultiResult;
|
||||
import com.common.utils.model.SingleResult;
|
||||
import com.rzyc.bean.task.dto.AddTaskDto;
|
||||
import com.rzyc.bean.task.dto.IdDto;
|
||||
import com.rzyc.bean.task.vo.ThingVo;
|
||||
import com.rzyc.model.OADistribution;
|
||||
import com.rzyc.model.OATask;
|
||||
import com.rzyc.model.task.dto.TaskAddOrUpdateDto;
|
||||
import com.rzyc.model.user.SysUser;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.beanutils.BeanUtils;
|
||||
import org.apache.commons.beanutils.ConvertUtils;
|
||||
import org.apache.commons.beanutils.converters.DateConverter;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName: TaskController
|
||||
* @description:
|
||||
* @author: ZQW
|
||||
* * @create: 2022-09-20 15:21
|
||||
**/
|
||||
|
||||
@Api(tags = "可删除控制层")
|
||||
@CrossOrigin("*")
|
||||
@RequestMapping("delete")
|
||||
@RestController
|
||||
@Validated
|
||||
public class DeleteController extends BaseController{
|
||||
|
||||
|
||||
/**
|
||||
* @return: 新增任务执行情况
|
||||
* @Author: ZQW
|
||||
* @Date: 2022/9/20
|
||||
*/
|
||||
@ApiOperation(value = "新增任务执行情况",position = 10)
|
||||
@PostMapping()
|
||||
public SingleResult<String> addTask(@Valid TaskAddOrUpdateDto addTaskDto) throws Exception{
|
||||
SingleResult<String> result = new SingleResult<>();
|
||||
OADistribution oaDistribution = new OADistribution();
|
||||
BeanUtils.copyProperties(oaDistribution,addTaskDto);
|
||||
//日期格式转换
|
||||
ConvertUtils.register(new DateConverter(null), Date.class);
|
||||
|
||||
SysUser sysUser = sysUserMapper.selectByPrimaryKey(addTaskDto.getSysuserid());
|
||||
if(null == sysUser){
|
||||
result.setCode(0);
|
||||
result.setMessage("用户不存在");
|
||||
return result;
|
||||
}
|
||||
|
||||
if(StringUtils.isBlank(addTaskDto.getOadistributionid())){
|
||||
oaDistribution.setOadistributionid(RandomNumber.getUUid());
|
||||
oaDistribution.setSyschinaname(sysUser.getChinaname());
|
||||
oaDistribution.setSystelephone(sysUser.getMobiletel());
|
||||
oaDistribution.setCreatedby(getChinaName());
|
||||
oaDistribution.setCreatedon(new Date());
|
||||
oaDistributionMapper.insert(oaDistribution);
|
||||
}else {
|
||||
oaDistribution.setModifiedby(getChinaName());
|
||||
oaDistribution.setModifiedon(new Date());
|
||||
oaDistributionMapper.updateById(oaDistribution);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return: 查询任务
|
||||
* @Author: ZQW
|
||||
* @Date: 2022/9/20
|
||||
*/
|
||||
@ApiOperation(value = "查询我发布的任务",position = 2)
|
||||
@ApiImplicitParams(value = {
|
||||
@ApiImplicitParam(name = "id",value = "指派用户id")
|
||||
})
|
||||
@GetMapping("deliverTaskList")
|
||||
public MultiResult<OADistribution> deliverTaskList(@Valid IdDto idDto){
|
||||
MultiResult<OADistribution> result = new MultiResult<>();
|
||||
List<OADistribution> oaTasks = oaDistributionMapper.deliverTaskList("%%",idDto.getId());
|
||||
if(oaTasks != null){
|
||||
result.setData(oaTasks);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: 查询我收到的任务
|
||||
* @Author ZQW
|
||||
* @CreateTime 2022/9/26 9:34
|
||||
*/
|
||||
@ApiOperation(value = "查询我收到的任务",position = 3)
|
||||
@ApiImplicitParams(value = {
|
||||
@ApiImplicitParam(name = "id",value = "接收用户id")
|
||||
})
|
||||
@GetMapping("getTaskList")
|
||||
public MultiResult<OADistribution> getTaskList(@Valid IdDto idDto){
|
||||
MultiResult<OADistribution> result = new MultiResult<>();
|
||||
List<OADistribution> oaTasks = oaDistributionMapper.getTaskList("%%",idDto.getId());
|
||||
if(oaTasks != null){
|
||||
result.setData(oaTasks);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return: 查询任务
|
||||
* @Author: ZQW
|
||||
* @Date: 2022/9/20
|
||||
*/
|
||||
@ApiOperation(value = "查询任务",position = 10)
|
||||
@GetMapping("taskList")
|
||||
public MultiResult<OATask> taskList(){
|
||||
MultiResult<OATask> result = new MultiResult<>();
|
||||
List<OATask> oaTasks = oaTaskMapper.taskList("%%");
|
||||
result.setData(oaTasks);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -4,7 +4,6 @@ import com.common.utils.RandomNumber;
|
|||
import com.common.utils.StringUtils;
|
||||
import com.common.utils.model.MultiResult;
|
||||
import com.common.utils.model.SingleResult;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.rzyc.bean.task.dto.AddTaskDto;
|
||||
import com.rzyc.bean.task.dto.IdDto;
|
||||
import com.rzyc.bean.task.vo.ThingVo;
|
||||
|
|
@ -41,26 +40,125 @@ import java.util.List;
|
|||
public class TaskController extends BaseController{
|
||||
|
||||
/**
|
||||
* @return: 新增发布任务
|
||||
* @Description: 新增任务
|
||||
* @Author ZQW
|
||||
* @CreateTime 2022/9/23 14:38
|
||||
*/
|
||||
@ApiOperation(value = "新增任务",position = 1)
|
||||
@PostMapping("addTask")
|
||||
public SingleResult<String> addTask(@Valid AddTaskDto addTaskDto) throws Exception{
|
||||
SingleResult<String> result = new SingleResult<>();
|
||||
OATask oaTask = new OATask();
|
||||
BeanUtils.copyProperties(oaTask,addTaskDto);
|
||||
//日期格式转换
|
||||
ConvertUtils.register(new DateConverter(null), Date.class);
|
||||
|
||||
SysUser sysUser = sysUserMapper.selectByPrimaryKey(addTaskDto.getSendId());
|
||||
if(null == sysUser){
|
||||
result.setCode(0);
|
||||
result.setMessage("未知错误");
|
||||
return result;
|
||||
}
|
||||
|
||||
if(StringUtils.isBlank(addTaskDto.getOataskid())){
|
||||
oaTask.setOataskid(RandomNumber.getUUid());
|
||||
oaTask.setCreatedby(getChinaName());
|
||||
oaTask.setCreatedon(new Date());
|
||||
oaTaskMapper.insertTask(oaTask);
|
||||
}else {
|
||||
oaTask.setModifiedby(getChinaName());
|
||||
oaTask.setModifiedon(new Date());
|
||||
oaTaskMapper.updateById(oaTask);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: 待办事项列表
|
||||
* @Author ZQW
|
||||
* @CreateTime 2022/9/23 10:20
|
||||
*/
|
||||
@ApiOperation(value = "待办事项列表",position = 2)
|
||||
@GetMapping("thingsList")
|
||||
@ApiImplicitParams(value = {
|
||||
@ApiImplicitParam(name = "id",value = "任务类型id")
|
||||
})
|
||||
public MultiResult<ThingVo> thingsList(@Valid IdDto idDto){
|
||||
MultiResult<ThingVo> result = new MultiResult<>();
|
||||
List<ThingVo> thingVos = oaTaskMapper.thingsList(idDto);
|
||||
result.setData(thingVos);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return: 查询我发布的任务
|
||||
* @Author: ZQW
|
||||
* @Date: 2022/9/20
|
||||
*/
|
||||
@ApiOperation(value = "新增发布任务",position = 1)
|
||||
@PostMapping()
|
||||
public SingleResult<String> addTask(@Valid TaskAddOrUpdateDto addTaskDto) throws Exception{
|
||||
@ApiOperation(value = "查询我发布的任务",position = 3)
|
||||
@ApiImplicitParams(value = {
|
||||
@ApiImplicitParam(name = "id",value = "发布人id")
|
||||
})
|
||||
@GetMapping("deliverTaskList")
|
||||
public MultiResult<OATask> deliverTaskList(@Valid IdDto idDto){
|
||||
MultiResult<OATask> result = new MultiResult<>();
|
||||
List<OATask> oaTasks = oaTaskMapper.deliverTaskList("%%",idDto.getId());
|
||||
System.out.println("任务============" + oaTasks);
|
||||
if(oaTasks != null){
|
||||
result.setData(oaTasks);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: 查询我收到的任务
|
||||
* @Author ZQW
|
||||
* @CreateTime 2022/9/26 9:34
|
||||
*/
|
||||
@ApiOperation(value = "查询我收到的任务",position = 4)
|
||||
@ApiImplicitParams(value = {
|
||||
@ApiImplicitParam(name = "id",value = "接收用户id")
|
||||
})
|
||||
@GetMapping("getTaskList")
|
||||
public MultiResult<OATask> getTaskList(@Valid IdDto idDto){
|
||||
MultiResult<OATask> result = new MultiResult<>();
|
||||
List<OATask> oaTasks = oaTaskMapper.getTaskList("%%",idDto.getId());
|
||||
if(oaTasks != null){
|
||||
result.setData(oaTasks);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return: 新增任务执行情况
|
||||
* @Author: ZQW
|
||||
* @Date: 2022/9/20
|
||||
*/
|
||||
@ApiOperation(value = "新增或修改任务执行情况",position = 10)
|
||||
@PostMapping("addExecute")
|
||||
public SingleResult<String> addExecute(@Valid TaskAddOrUpdateDto addTaskDto) throws Exception{
|
||||
SingleResult<String> result = new SingleResult<>();
|
||||
OADistribution oaDistribution = new OADistribution();
|
||||
BeanUtils.copyProperties(oaDistribution,addTaskDto);
|
||||
//日期格式转换
|
||||
ConvertUtils.register(new DateConverter(null), java.util.Date.class);
|
||||
ConvertUtils.register(new DateConverter(null), Date.class);
|
||||
|
||||
SysUser sysUser = sysUserMapper.selectByPrimaryKey(addTaskDto.getSysuserid());
|
||||
OATask oaTask = oaTaskMapper.findById(addTaskDto.getOataskid());
|
||||
System.out.println("任务 ========" + oaTask);
|
||||
if(null == sysUser){
|
||||
result.setCode(0);
|
||||
result.setMessage("用户不存在");
|
||||
return result;
|
||||
}
|
||||
|
||||
if(null == oaTask){
|
||||
result.setCode(0);
|
||||
result.setMessage("未知任务");
|
||||
return result;
|
||||
}
|
||||
|
||||
if(StringUtils.isBlank(addTaskDto.getOadistributionid())){
|
||||
oaDistribution.setOadistributionid(RandomNumber.getUUid());
|
||||
oaDistribution.setSyschinaname(sysUser.getChinaname());
|
||||
|
|
@ -76,100 +174,4 @@ public class TaskController extends BaseController{
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return: 查询任务
|
||||
* @Author: ZQW
|
||||
* @Date: 2022/9/20
|
||||
*/
|
||||
@ApiOperation(value = "查询我发布的任务",position = 2)
|
||||
@ApiImplicitParams(value = {
|
||||
@ApiImplicitParam(name = "id",value = "指派用户id")
|
||||
})
|
||||
@GetMapping("deliverTaskList")
|
||||
public MultiResult<OADistribution> deliverTaskList(@Valid IdDto idDto){
|
||||
MultiResult<OADistribution> result = new MultiResult<>();
|
||||
List<OADistribution> oaTasks = oaDistributionMapper.deliverTaskList("%%",idDto.getId());
|
||||
result.setData(oaTasks);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: 查询我收到的任务
|
||||
* @Author ZQW
|
||||
* @CreateTime 2022/9/26 9:34
|
||||
*/
|
||||
@ApiOperation(value = "查询我收到的任务",position = 3)
|
||||
@ApiImplicitParams(value = {
|
||||
@ApiImplicitParam(name = "id",value = "接收用户id")
|
||||
})
|
||||
@GetMapping("getTaskList")
|
||||
public MultiResult<OADistribution> getTaskList(@Valid IdDto idDto){
|
||||
MultiResult<OADistribution> result = new MultiResult<>();
|
||||
List<OADistribution> oaTasks = oaDistributionMapper.getTaskList("%%",idDto.getId());
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return: 查询任务
|
||||
* @Author: ZQW
|
||||
* @Date: 2022/9/20
|
||||
*/
|
||||
@ApiOperation(value = "查询任务",position = 10)
|
||||
@GetMapping("taskList")
|
||||
public MultiResult<OATask> taskList(){
|
||||
MultiResult<OATask> result = new MultiResult<>();
|
||||
List<OATask> oaTasks = oaTaskMapper.taskList("%%");
|
||||
result.setData(oaTasks);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: 待办事项列表
|
||||
* @Author ZQW
|
||||
* @CreateTime 2022/9/23 10:20
|
||||
*/
|
||||
@ApiOperation(value = "待办事项列表",position = 11)
|
||||
@GetMapping("thingsList")
|
||||
public MultiResult<ThingVo> thingsList(@Valid IdDto idDto){
|
||||
MultiResult<ThingVo> result = new MultiResult<>();
|
||||
List<ThingVo> thingVos = oaTaskMapper.thingsList(idDto);
|
||||
result.setData(thingVos);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: 新增任务任务执行进度
|
||||
* @Author ZQW
|
||||
* @CreateTime 2022/9/23 14:38
|
||||
*/
|
||||
@ApiOperation(value = "新增任务任务执行进度",position = 12)
|
||||
@PostMapping("addTask")
|
||||
public SingleResult<String> addTask(@Valid AddTaskDto addTaskDto) throws Exception{
|
||||
SingleResult<String> result = new SingleResult<>();
|
||||
OATask oaTask = new OATask();
|
||||
BeanUtils.copyProperties(oaTask,addTaskDto);
|
||||
//日期格式转换
|
||||
ConvertUtils.register(new DateConverter(null), java.util.Date.class);
|
||||
|
||||
SysUser sysUser = sysUserMapper.selectByPrimaryKey(addTaskDto.getSendId());
|
||||
System.out.println("用户======" + sysUser);
|
||||
if(null == sysUser){
|
||||
result.setCode(0);
|
||||
result.setMessage("用户不存在");
|
||||
return result;
|
||||
}
|
||||
|
||||
if(StringUtils.isBlank(addTaskDto.getOataskid())){
|
||||
oaTask.setOataskid(RandomNumber.getUUid());
|
||||
oaTask.setCreatedby(getChinaName());
|
||||
oaTask.setCreatedon(new Date());
|
||||
oaTaskMapper.insertTask(oaTask);
|
||||
}else {
|
||||
oaTask.setModifiedby(getChinaName());
|
||||
oaTask.setModifiedon(new Date());
|
||||
oaTaskMapper.updateById(oaTask);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user