待办流程-批量办理

This commit is contained in:
liyawei
2022-09-15 19:45:53 +08:00
parent 074eb45232
commit f1489178a2
8 changed files with 178 additions and 23 deletions
@@ -1,25 +1,26 @@
package com.jero.modules.project.controller;
import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.jero.common.api.vo.Result;
import com.jero.common.system.query.QueryGenerator;
import com.jero.modules.project.entity.ProjectLawsInventoryRejectCauseEO;
import com.jero.modules.project.service.IProjectLawsInventoryRejectCauseEOService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.system.base.controller.JeroController;
import com.jero.common.system.query.QueryGenerator;
import com.jero.modules.project.entity.ProjectLawsInventoryRejectCauseEO;
import com.jero.modules.project.service.IProjectLawsInventoryRejectCauseEOService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.jero.common.aspect.annotation.AutoLog;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;
/**
@@ -85,6 +86,20 @@ public class ProjectLawsInventoryRejectCauseEOController extends JeroController<
return Result.OK("添加成功!");
}
/**
* 批量添加
*
* @param projectLawsInventoryRejectCauseEO
* @return
*/
@AutoLog(value = "清单确认-拒绝原因表-批量添加")
@ApiOperation(value="清单确认-拒绝原因表-批量添加", notes="清单确认-拒绝原因表-批量添加")
@PostMapping(value = "/addBatch")
public Result<?> addBatch(@Validated @RequestBody ProjectLawsInventoryRejectCauseEO projectLawsInventoryRejectCauseEO) {
projectLawsInventoryRejectCauseEOService.addBatch(projectLawsInventoryRejectCauseEO);
return Result.OK("添加成功!");
}
/**
* 编辑
*
@@ -1,21 +1,19 @@
package com.jero.modules.project.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import com.jero.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
@@ -88,4 +86,6 @@ public class ProjectLawsInventoryRejectCauseEO implements Serializable {
@ApiModelProperty(value = "拒绝类型")
private java.lang.String rejectType;
@TableField(exist = false)
private String taskIds;
}
@@ -22,6 +22,8 @@ public interface IProjectLawsInventoryRejectCauseEOService extends IService<Proj
*/
void add(ProjectLawsInventoryRejectCauseEO projectLawsInventoryRejectCauseEO);
void addBatch(ProjectLawsInventoryRejectCauseEO projectLawsInventoryRejectCauseEO);
/**
* 更新
*
@@ -1,16 +1,23 @@
package com.jero.modules.project.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.system.query.QueryGenerator;
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
import com.jero.modules.project.entity.ProjectLawsInventoryRejectCauseEO;
import com.jero.modules.project.mapper.ProjectLawsInventoryRejectCauseEOMapper;
import com.jero.modules.project.service.IProjectLawsInventoryRejectCauseEOService;
import com.jero.modules.wkflow.feginClient.TaskFeignClient;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Date;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
* @Description: 清单确认-拒绝原因表
@@ -21,6 +28,9 @@ import javax.servlet.http.HttpServletRequest;
@Service
public class ProjectLawsInventoryRejectCauseEOServiceImpl extends ServiceImpl<ProjectLawsInventoryRejectCauseEOMapper, ProjectLawsInventoryRejectCauseEO> implements IProjectLawsInventoryRejectCauseEOService {
@Autowired
private TaskFeignClient taskFeignClient;
/**
* 保存
*
@@ -35,6 +45,35 @@ public class ProjectLawsInventoryRejectCauseEOServiceImpl extends ServiceImpl<Pr
save(projectLawsInventoryRejectCauseEO);
}
/**
* 批量保存
*
* @param projectLawsInventoryRejectCauseEO
* @return
*/
@Override
public void addBatch(ProjectLawsInventoryRejectCauseEO projectLawsInventoryRejectCauseEO) {
List<String> taskIdList = Arrays.asList(projectLawsInventoryRejectCauseEO.getTaskIds().split(","));
List<ProjectLawsInventoryRejectCauseEO> insertEOList = new ArrayList<>();
// 获取法规清单id
for(String taskId : taskIdList) {
ProjectLawsInventoryRejectCauseEO insertEO = new ProjectLawsInventoryRejectCauseEO();
BeanUtils.copyProperties(projectLawsInventoryRejectCauseEO, insertEO);
String taskDetailJson = taskFeignClient.queryTaskDetailByTaskIds(taskId);
ProjectLawsInventoryEO projectLawsInventoryEO = JSONObject.parseObject(taskDetailJson, ProjectLawsInventoryEO.class);
insertEO.setProjectLawsInventoryId(projectLawsInventoryEO.getId());
insertEO.setTaskIds(null);
Date now = new Date();
insertEO.setCreateTime(now);
insertEO.setUpdateTime(now);
insertEOList.add(insertEO);
}
saveBatch(insertEOList);
}
/**
* 更新
*
@@ -97,6 +97,22 @@ public class workFlowController {
return str;
}
@AutoLog(value = "批量完成任务")
@ApiOperation(value="批量完成任务", notes="批量完成任务")
@PostMapping("/completeTaskBatch")
public Result<String> completeTaskByUserIdBatch(@RequestBody BusMes busMes){
if(StringUtils.isEmpty(busMes.getUserId())){
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
busMes.setUserId(currentUser.getId());
}
Result<String> str = workFlowFeignClient.completeTaskByUserIdBatch(busMes);
if(str.getCode() == 500){
str.setSuccess(false);
}
// sendWebsocket(busMes.getTaskId(),busMes.getTaskId());
return str;
}
public void sendWebsocket(String msgId, String msgTet) {
com.alibaba.fastjson.JSONObject obj = new com.alibaba.fastjson.JSONObject();
obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_TOPIC);
@@ -28,6 +28,15 @@ public class BusMes {
private String nowStateType;
private String flag;
private String approvalOpinion; // 反馈意见 待办流程-批量办理专用
private String dreUserId; // 待办流程-批量办理专用
private String dreUserIdName; // 待办流程-批量办理专用
private String handlingTime; // 待办流程-批量办理专用
private String projectLawsInventoryIds; // 待办流程-批量办理专用
private String taskDefinitionKey; // 待办流程-批量办理专用
public String getUserId() {
return userId;
}
@@ -128,4 +137,60 @@ public class BusMes {
public String getNowStateType() { return nowStateType; }
public void setNowStateType(String nowStateType) { this.nowStateType = nowStateType; }
public String getFlag() {
return flag;
}
public void setFlag(String flag) {
this.flag = flag;
}
public String getApprovalOpinion() {
return approvalOpinion;
}
public void setApprovalOpinion(String approvalOpinion) {
this.approvalOpinion = approvalOpinion;
}
public String getDreUserId() {
return dreUserId;
}
public void setDreUserId(String dreUserId) {
this.dreUserId = dreUserId;
}
public String getDreUserIdName() {
return dreUserIdName;
}
public void setDreUserIdName(String dreUserIdName) {
this.dreUserIdName = dreUserIdName;
}
public String getHandlingTime() {
return handlingTime;
}
public void setHandlingTime(String handlingTime) {
this.handlingTime = handlingTime;
}
public String getProjectLawsInventoryIds() {
return projectLawsInventoryIds;
}
public void setProjectLawsInventoryIds(String projectLawsInventoryIds) {
this.projectLawsInventoryIds = projectLawsInventoryIds;
}
public String getTaskDefinitionKey() {
return taskDefinitionKey;
}
public void setTaskDefinitionKey(String taskDefinitionKey) {
this.taskDefinitionKey = taskDefinitionKey;
}
}
@@ -36,6 +36,14 @@ public interface WorkFlowFeignClient {
@RequestMapping(value = "/bat-wkflow/completeTask",method = RequestMethod.POST)
Result<String> completeTaskByUserId(@RequestBody BusMes busMes);
/**
* 批量完成任务
* @param busMes
* @return
*/
@RequestMapping(value = "/bat-wkflow/completeTaskBatch",method = RequestMethod.POST)
Result<String> completeTaskByUserIdBatch(@RequestBody BusMes busMes);
/**
* 通过流程实例id查询当前待办的流程实例是否结束
* @param prcId
@@ -46,6 +46,16 @@ public class WorkFlowFeignClientImpl{
return stringWrapper;
}
/**
* 批量完成任务
* @param busMes
* @return
*/
public Result<String> completeTaskByUserIdBatch( BusMes busMes){
Result<String> stringWrapper = workFlowFeignClient.completeTaskByUserIdBatch(busMes);
return stringWrapper;
}
/**
* 通过流程实例id查询当前待办的流程实例是否结束
* @param prcId