修改审批信息,保留各节点审批人数据

dev
admin 1 year ago
parent 8e3c79a52a
commit c6a549a046

@ -44,8 +44,9 @@ public class GlobalProcistEndListener extends AbstractFlowableEngineEventListene
if(StringUtils.isNotBlank(business)){
String[] busskey = business.split(SystemConstantsOa.OA_BUSSINESS_KEY_SPLIT);
IFormCustomService iFormCustomService = SpringUtils.getBean(busskey[2]);
//设置流程结束状态
iFormCustomService.endForm(busskey[1],SystemConstantsOa.OA_STATUS_TYPE_END,"",processInstanceId);
iFormCustomService.endForm(busskey[1],SystemConstantsOa.OA_STATUS_TYPE_END,"",processInstanceId,processInstance.getName());
}
logger.debug("业务流程key->{}", business);

@ -36,7 +36,7 @@ public interface IFormCustomService<T> {
* @param deploymentid
* @param processdefinitionid
*/
public boolean updateForm(String fromid,String deploymentid,String processdefinitionid,String assignee,String taskId,String processInstanceId);
public boolean updateForm(String fromid,String deploymentid,String processdefinitionid,String assignee,String taskId,String processInstanceId,String tasknme);
/**
*
* @param fromid
@ -48,7 +48,7 @@ public interface IFormCustomService<T> {
* @param states 1: 2: 3: 5
* @return
*/
public boolean endForm(String fromid,int states,String assignee,String processInstanceId);
public boolean endForm(String fromid,int states,String assignee,String processInstanceId,String tasknme);
/**
*

@ -93,8 +93,13 @@ public class FlowInstanceServiceImpl extends FlowServiceFactory implements IFlow
if(null == flowTaskCompleteVO){
throw new ServiceException("没有审批人,请联系管理员,流程定义:" + businessKey);
}
List<Task> list = this.flowTaskService.nowRunTask(processInstance.getProcessInstanceId(),processInstance.getProcessDefinitionId());
String taskname = "";
if(null != list && !list.isEmpty()){
taskname = list.get(0).getName();
}
//保存instanceId到数据库需要根据流程分类进行判断更新
boolean isupdate = iFormCustomService.updateForm(formid,processDefinition.getDeploymentId(),processDefinition.getId(),flowTaskCompleteVO.getAssignee(),flowTaskCompleteVO.getTaskId(),processInstance.getProcessInstanceId());
boolean isupdate = iFormCustomService.updateForm(formid,processDefinition.getDeploymentId(),processDefinition.getId(),flowTaskCompleteVO.getAssignee(),flowTaskCompleteVO.getTaskId(),processInstance.getProcessInstanceId(),taskname);
if(isupdate){
FlowModelVO flowModelVO = iFormCustomService.getForm(formid);
//增加未查看记录
@ -158,8 +163,13 @@ public class FlowInstanceServiceImpl extends FlowServiceFactory implements IFlow
if(null == flowTaskCompleteVO){
throw new ServiceException("没有审批人,请联系管理员,流程定义:" + businessKey);
}
List<Task> list = this.flowTaskService.nowRunTask(processInstance.getProcessInstanceId(),processInstance.getProcessDefinitionId());
String taskname = "";
if(null != list && !list.isEmpty()){
taskname = list.get(0).getName();
}
//保存instanceId到数据库需要根据流程分类进行判断更新
boolean isupdate = iFormCustomService.updateForm(formid,processDefinition.getDeploymentId(),processDefinition.getId(),flowTaskCompleteVO.getAssignee(),flowTaskCompleteVO.getTaskId(),processInstance.getProcessInstanceId());
boolean isupdate = iFormCustomService.updateForm(formid,processDefinition.getDeploymentId(),processDefinition.getId(),flowTaskCompleteVO.getAssignee(),flowTaskCompleteVO.getTaskId(),processInstance.getProcessInstanceId(),taskname);
if(isupdate){
FlowModelVO flowModelVO = iFormCustomService.getForm(formid);
//增加未查看记录

@ -518,7 +518,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
String[] busskey = businesskey.split(SystemConstantsOa.OA_BUSSINESS_KEY_SPLIT);
IFormCustomService iFormCustomService = SpringUtils.getBean(busskey[2]);
//设置流程结束状态
iFormCustomService.endForm(busskey[1],SystemConstantsOa.OA_STATUS_TYPE_REFUSE,assignee,task.getProcessInstanceId());
iFormCustomService.endForm(busskey[1],SystemConstantsOa.OA_STATUS_TYPE_REFUSE,assignee,task.getProcessInstanceId(),task.getName());
}
//1、获取终止节点
@ -535,7 +535,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
//保存当前审批用户与业务表的关系
userapproveService.save(userToken.getUserid(),taskVO.getFormid());
userapproveService.save(userToken.getUserid(),taskVO,task);
return true;
@ -567,7 +567,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
if(StringUtils.isNotBlank(businesskey)){
String[] busskey = businesskey.split(SystemConstantsOa.OA_BUSSINESS_KEY_SPLIT);
iFormCustomService = SpringUtils.getBean(busskey[2]);
iFormCustomService.updateForm(busskey[1],processDefinition.getDeploymentId(),processDefinition.getId(),flowTaskCompleteVO.getAssignee(),flowTaskCompleteVO.getTaskId(),processInstanceId);
iFormCustomService.updateForm(busskey[1],processDefinition.getDeploymentId(),processDefinition.getId(),flowTaskCompleteVO.getAssignee(),flowTaskCompleteVO.getTaskId(),processInstanceId,task.getName());
}
}

@ -47,6 +47,26 @@ public class Userapprove implements BaseDto,java.io.Serializable {
private Long formid;
@Schema(description = "审批节点名称")
@TableField(value="TASKNAME")
private String taskname;
@Schema(description = "审批状态记录当前节点审批状态1.待审批 (只针对前端返回 库中逻辑上不存在) 2.通过 3.不通过")
@TableField(value="STATSHIS")
private Integer statshis;
@Schema(description = "审批意见")
@TableField(value="COMMENTHIS")
private String commenthis;
@Schema(description = "节点位置,待定字段,")
@TableField(value="TASKINDEX")
private Integer taskindex;
@Schema(description = "节点编号")
@TableField(value="TASKNO")
private String taskno;
//保存当前登录用户的数据权限范围的搜索条件
@TableField(exist = false)
@JsonIgnore
@ -58,7 +78,12 @@ public class Userapprove implements BaseDto,java.io.Serializable {
new SimpleEntry<>("listdept","deptid"),
new SimpleEntry<>("ID","id"),
new SimpleEntry<>("USERID","userid"),
new SimpleEntry<>("FORMID","formid")
new SimpleEntry<>("FORMID","formid"),
new SimpleEntry<>("TASKNAME","taskname"),
new SimpleEntry<>("STATSHIS","statshis"),
new SimpleEntry<>("COMMENTHIS","commenthis"),
new SimpleEntry<>("TASKINDEX","taskindex"),
new SimpleEntry<>("TASKNO","taskno")
)
.collect(Collectors.toMap(SimpleEntry::getKey, SimpleEntry::getValue));
@Override

@ -1,7 +1,9 @@
package cn.jyjz.xiaoyao.oa.from.service;
import cn.jyjz.flowable.domain.vo.FlowTaskVO;
import cn.jyjz.xiaoyao.common.mybatisplus.base.BaseService;
import cn.jyjz.xiaoyao.oa.from.dataobject.Userapprove;
import org.flowable.task.api.Task;
/**
*
@ -14,7 +16,7 @@ public interface UserapproveService extends BaseService<Userapprove> {
* @param formid
* @return truefalse
*/
public boolean save(String userid,String formid);
public boolean save(String userid, FlowTaskVO taskVO, Task task );
/**
*

@ -1,11 +1,13 @@
package cn.jyjz.xiaoyao.oa.from.service.impl;
import cn.jyjz.flowable.domain.vo.FlowTaskVO;
import cn.jyjz.xiaoyao.common.mybatisplus.base.BaseServiceImpl;
import cn.jyjz.xiaoyao.oa.from.dataDao.UserapproveMybatisDao;
import cn.jyjz.xiaoyao.oa.from.dataobject.Userapprove;
import cn.jyjz.xiaoyao.oa.from.service.UserapproveService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.flowable.task.api.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -19,11 +21,18 @@ public class UserapproveServiceImpl extends BaseServiceImpl<UserapproveMybatisDa
private UserapproveMybatisDao userapprovemybatisdao;
@Override
public boolean save(String userid, String formid) {
public boolean save(String userid, FlowTaskVO taskVO, Task taskd) {
Userapprove userapprove = new Userapprove();
userapprove.setUserid(Long.parseLong(userid));
userapprove.setFormid(Long.parseLong(formid));
userapprove.setFormid(Long.parseLong(taskVO.getFormid()));
userapprove.setTaskname(taskd.getName());
if(taskVO.getApprovd()){
userapprove.setStatshis(2);
}else{
userapprove.setStatshis(3);
}
return this.save(userapprove);
}

@ -182,6 +182,10 @@ public class OcrTaskchildPicture implements BaseDto,java.io.Serializable {
@TableField(value="HAVEPOINTS")
private Integer havepoints;
@Schema(description = "当前节点名称")
@TableField(value="TASKNAME")
private String taskname;
@ApiModelProperty(value = "项目对象")
@TableField(exist = false)
private Category categoryDto;
@ -247,41 +251,42 @@ public class OcrTaskchildPicture implements BaseDto,java.io.Serializable {
@TableField(exist = false)
@JsonIgnore
private final Map<String,String> query = Stream.of(
new SimpleEntry<>("ID","id"),
new SimpleEntry<>("OCPICTUREID","ocpictureid"),
new SimpleEntry<>("PICTURERESULT","pictureresult"),
new SimpleEntry<>("PICTURECOMPARE","picturecompare"),
new SimpleEntry<>("DEPTID","deptid"),
new SimpleEntry<>("TENANTID","tenantid"),
new SimpleEntry<>("PACKAGEID","packageid"),
new SimpleEntry<>("PICTUREID","pictureid"),
new SimpleEntry<>("CATEGORY","category"),
new SimpleEntry<>("CATEGORYID","categoryid"),
new SimpleEntry<>("SPECIFICATION","specification"),
new SimpleEntry<>("BUESSINESSNO","buessinessno"),
new SimpleEntry<>("STATES","states"),
new SimpleEntry<>("PROCESSINSTANCEID","processinstanceid"),
new SimpleEntry<>("PROCESSDEFINITIONID","processdefinitionid"),
new SimpleEntry<>("DEPLOYMENTID","deploymentid"),
new SimpleEntry<>("ASSIGNEENAME","assigneename"),
new SimpleEntry<>("ASSIGNEE","assignee"),
new SimpleEntry<>("UPDATEUSER","updateuser"),
new SimpleEntry<>("UPDATETIME","updatetime"),
new SimpleEntry<>("FILEANNEX","fileannex"),
new SimpleEntry<>("GUIDANG","guidang"),
new SimpleEntry<>("CREATEUSER","createuser"),
new SimpleEntry<>("CREATEUSERNAME","createusername"),
new SimpleEntry<>("CREATEDATE","createdate"),
new SimpleEntry<>("USERID","userid"),
new SimpleEntry<>("USERNAME","username"),
new SimpleEntry<>("FROMTASKID","fromtaskid"),
new SimpleEntry<>("FROMTASKNAME","fromtaskname"),
new SimpleEntry<>("FROMUSERID","fromuserid"),
new SimpleEntry<>("FROMPROJECTID","fromprojectid"),
new SimpleEntry<>("FROMPLANID","fromplanid"),
new SimpleEntry<>("FROMUPTIME","fromuptime"),
new SimpleEntry<>("FROMSOURCEID","fromsourceid"),
new SimpleEntry<>("HAVEPOINTS","havepoints")
new SimpleEntry<>("ID","id"),
new SimpleEntry<>("OCPICTUREID","ocpictureid"),
new SimpleEntry<>("PICTURERESULT","pictureresult"),
new SimpleEntry<>("PICTURECOMPARE","picturecompare"),
new SimpleEntry<>("DEPTID","deptid"),
new SimpleEntry<>("TENANTID","tenantid"),
new SimpleEntry<>("PACKAGEID","packageid"),
new SimpleEntry<>("PICTUREID","pictureid"),
new SimpleEntry<>("CATEGORY","category"),
new SimpleEntry<>("CATEGORYID","categoryid"),
new SimpleEntry<>("SPECIFICATION","specification"),
new SimpleEntry<>("BUESSINESSNO","buessinessno"),
new SimpleEntry<>("STATES","states"),
new SimpleEntry<>("PROCESSINSTANCEID","processinstanceid"),
new SimpleEntry<>("PROCESSDEFINITIONID","processdefinitionid"),
new SimpleEntry<>("DEPLOYMENTID","deploymentid"),
new SimpleEntry<>("ASSIGNEENAME","assigneename"),
new SimpleEntry<>("ASSIGNEE","assignee"),
new SimpleEntry<>("UPDATEUSER","updateuser"),
new SimpleEntry<>("UPDATETIME","updatetime"),
new SimpleEntry<>("FILEANNEX","fileannex"),
new SimpleEntry<>("GUIDANG","guidang"),
new SimpleEntry<>("CREATEUSER","createuser"),
new SimpleEntry<>("CREATEUSERNAME","createusername"),
new SimpleEntry<>("CREATEDATE","createdate"),
new SimpleEntry<>("USERID","userid"),
new SimpleEntry<>("USERNAME","username"),
new SimpleEntry<>("FROMTASKID","fromtaskid"),
new SimpleEntry<>("FROMTASKNAME","fromtaskname"),
new SimpleEntry<>("FROMUSERID","fromuserid"),
new SimpleEntry<>("FROMPROJECTID","fromprojectid"),
new SimpleEntry<>("FROMPLANID","fromplanid"),
new SimpleEntry<>("FROMUPTIME","fromuptime"),
new SimpleEntry<>("FROMSOURCEID","fromsourceid"),
new SimpleEntry<>("HAVEPOINTS","havepoints"),
new SimpleEntry<>("TASKNAME","taskname")
)
.collect(Collectors.toMap(SimpleEntry::getKey, SimpleEntry::getValue));
@Override

@ -223,13 +223,14 @@ public class TaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchildPic
}
@Override
public boolean updateForm(String fromid, String deploymentid, String processdefinitionid, String assignee, String taskId, String processInstanceId) {
public boolean updateForm(String fromid, String deploymentid, String processdefinitionid, String assignee, String taskId, String processInstanceId,String tasknme) {
if(StringUtils.isNotBlank(fromid) && StringUtils.isNotBlank(deploymentid) && StringUtils.isNotBlank(processdefinitionid)){
OcrTaskchildPicture model = this.ocrTaskchildPictureService.selectDtoById(Long.parseLong(fromid));
model .setProcessinstanceid(processInstanceId);
model.setProcessdefinitionid(processdefinitionid);
model.setDeploymentid(deploymentid);
model.setAssignee(assignee);
model.setTaskname(tasknme);
model.setStates(SystemConstantsOa.OA_STATUS_TYPE_ING);
//查询审批人姓名
String[] assignees = assignee.split(",");
@ -253,6 +254,7 @@ public class TaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchildPic
@Override
public boolean editStatesForm(String fromid, int states, String assignee) {
//TODO 后期修改图片的状态
if(StringUtils.isNotBlank(fromid)){
OcrTaskchildPicture model = this.ocrTaskchildPictureService.selectDtoById(Long.parseLong(fromid));
if(StringUtils.isNotBlank(assignee)){
@ -280,7 +282,8 @@ public class TaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchildPic
}
@Override
public boolean endForm(String fromid, int states, String assignee, String processInstanceId) {
public boolean endForm(String fromid, int states, String assignee, String processInstanceId,String tasknme) {
//TODO 后期修改图片的状态
if(StringUtils.isNotBlank(fromid)){
OcrTaskchildPicture model = this.selectDtoById(Long.parseLong(fromid));
if(StringUtils.isNotBlank(assignee)){
@ -288,6 +291,7 @@ public class TaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchildPic
model.setAssigneename(user1.getUsername());
model.setAssignee(assignee);
}
model.setTaskname(tasknme);
//iFlowFormMessageService.sendMsg(model.getCreateuser(),SystemMessage.SYS_OA_TYPE_LEAVE + SystemMessage.SYS_OA_TO_CLOSE,null,processInstanceId,fromid,CacheQyweixinConstants.OA_DISTIONARY_TYPE_MSG_SHENPI_PASS,model.getCategoryid().toString());
//如果状态为拒绝,监听程序不改变当前状态
if(model.getStates().intValue() != SystemConstantsOa.OA_STATUS_TYPE_REFUSE){

@ -37,6 +37,7 @@
<result column="FROMUPTIME" property="fromuptime" jdbcType="BIGINT"/>
<result column="FROMSOURCEID" property="fromsourceid" jdbcType="VARCHAR"/>
<result column="HAVEPOINTS" property="havepoints" jdbcType="INTEGER"/>
<result column="TASKNAME" property="taskname" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
ID AS id,
@ -73,7 +74,8 @@
FROMPLANID AS fromplanid,
FROMUPTIME AS fromuptime,
FROMSOURCEID AS fromsourceid,
HAVEPOINTS AS havepoints
HAVEPOINTS AS havepoints,
TASKNAME AS taskname
</sql>
<sql id="Base_Where">
@ -113,6 +115,7 @@
<if test="fromuptime != null"> and FROMUPTIME ${fromuptime.dataOp} ${fromuptime.likestar}#{fromuptime.value}${fromuptime.likeend}</if>
<if test="fromsourceid != null"> and FROMSOURCEID ${fromsourceid.dataOp} ${fromsourceid.likestar}#{fromsourceid.value}${fromsourceid.likeend}</if>
<if test="havepoints != null"> and HAVEPOINTS ${havepoints.dataOp} ${havepoints.likestar}#{havepoints.value}${havepoints.likeend}</if>
<if test="taskname != null"> and TASKNAME ${taskname.dataOp} ${taskname.likestar}#{taskname.value}${taskname.likeend}</if>
<if test="userid != null"> and USERID ${userid.dataOp} ${userid.likestar}#{userid.value}${userid.likeend}</if>
</trim>
</where>
@ -158,6 +161,7 @@
<if test="fromuptime != null"> and tcp.FROMUPTIME ${fromuptime.dataOp} ${fromuptime.likestar}#{fromuptime.value}${fromuptime.likeend}</if>
<if test="fromsourceid != null"> and tcp.FROMSOURCEID ${fromsourceid.dataOp} ${fromsourceid.likestar}#{fromsourceid.value}${fromsourceid.likeend}</if>
<if test="havepoints != null"> and tcp.HAVEPOINTS ${havepoints.dataOp} ${havepoints.likestar}#{havepoints.value}${havepoints.likeend}</if>
<if test="taskname != null"> and tcp.TASKNAME ${taskname.dataOp} ${taskname.likestar}#{taskname.value}${taskname.likeend}</if>
<if test="userid != null"> and tcp.USERID ${userid.dataOp} ${userid.likestar}#{userid.value}${userid.likeend}</if>
</trim>
</where>

@ -5,6 +5,11 @@
<id column="ID" property="id" jdbcType="BIGINT"/>
<result column="USERID" property="userid" jdbcType="BIGINT"/>
<result column="FORMID" property="formid" jdbcType="BIGINT"/>
<result column="TASKNAME" property="taskname" jdbcType="VARCHAR"/>
<result column="STATSHIS" property="statshis" jdbcType="INTEGER"/>
<result column="COMMENTHIS" property="commenthis" jdbcType="VARCHAR"/>
<result column="TASKINDEX" property="taskindex" jdbcType="INTEGER"/>
<result column="TASKNO" property="taskno" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
ID AS id,
@ -17,13 +22,13 @@
<trim prefixOverrides="and|or">
<if test="id != null"> and ID ${id.dataOp} ${id.likestar}#{id.value}${id.likeend}</if>
<if test="formid != null"> and FORMID ${formid.dataOp} ${formid.likestar}#{formid.value}${formid.likeend}</if>
<if test="taskname != null"> and TASKNAME ${taskname.dataOp} ${taskname.likestar}#{taskname.value}${taskname.likeend}</if>
<if test="statshis != null"> and STATSHIS ${statshis.dataOp} ${statshis.likestar}#{statshis.value}${statshis.likeend}</if>
<if test="commenthis != null"> and COMMENTHIS ${commenthis.dataOp} ${commenthis.likestar}#{commenthis.value}${commenthis.likeend}</if>
<if test="taskindex != null"> and TASKINDEX ${taskindex.dataOp} ${taskindex.likestar}#{taskindex.value}${taskindex.likeend}</if>
<if test="taskno != null"> and TASKNO ${taskno.dataOp} ${taskno.likestar}#{taskno.value}${taskno.likeend}</if>
<if test="userid != null"> and USERID ${userid.dataOp} ${userid.likestar}#{userid.value}${userid.likeend}</if>
<if test="listdept != null">
and DEPARTID in
<foreach collection="listdept.value" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
</if>
</trim>
</where>
<if test="page != null">

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -178,3 +178,12 @@ create table ocr_province
REORDER int comment '排序字段',
primary key (ID)
);
ALTER TABLE ocr_taskchild_picture ADD COLUMN TASKNAME varchar(190) comment '当前节点名称';
ALTER TABLE OA_USERAPPROVE_T ADD COLUMN TASKNAME varchar(190) comment '审批节点名称';
ALTER TABLE OA_USERAPPROVE_T ADD COLUMN STATSHIS int comment '审批状态记录当前节点审批状态1.待审批 (只针对前端返回 库中逻辑上不存在) 2.通过 3.不通过';
ALTER TABLE OA_USERAPPROVE_T ADD COLUMN COMMENTHIS varchar(190) comment '审批意见';
ALTER TABLE OA_USERAPPROVE_T ADD COLUMN TASKINDEX int comment '节点位置,待定字段';
ALTER TABLE OA_USERAPPROVE_T ADD COLUMN TASKNO varchar(64) comment '节点编号,待定字段';

Loading…
Cancel
Save