fix: 修改任务审批列表

pull/100/head
sunchenliang 1 year ago
parent 80f007f03d
commit 0cc8855a60

@ -9,6 +9,7 @@ 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.apache.commons.lang3.StringUtils;
import org.flowable.task.api.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -29,10 +30,11 @@ public class UserapproveServiceImpl extends BaseServiceImpl<UserapproveMybatisDa
userapprove.setFormid(Long.parseLong(formId));
userapprove.setTaskname(taskd.getName());
userapprove.setTaskcomment(approve.getComment());
userapprove.setTaskindex(StringUtils.isBlank(taskd.getDescription()) ?0:Integer.parseInt(taskd.getDescription()));
userapprove.setCreatedate(System.currentTimeMillis());
userapprove.setUsername(userToken.getUsername());
userapprove.setReason(approve.getFailCauseName());
userapprove.setReason(approve.getDisposeType());
userapprove.setProcessMethod(approve.getDisposeType());
if (approve.getResult()) {
userapprove.setStatshis(2);
} else {

@ -51,7 +51,7 @@ public interface OcrTaskchildPictureMybatisDao extends BaseMapper<OcrTaskchildPi
String selectocpicture(@Param("tenantid")String tenantid,@Param("packageid")String packageid,@Param("id")String id);
List<OcrTaskChildPictureVo> getPictureHistoryList(@Param("pictureIds") List<String> pictureIds, @Param("taskname") String taskname);
List<OcrTaskChildPictureVo> getPictureHistoryList(@Param("pictureIds") List<String> pictureIds, @Param("pictureId") String pictureId);
List<OcrTaskChildPictureVo> getDubiousfileList(@Param("pictureIds") List<String> pictureIds, @Param("taskname") String taskname);
PictureDetailVo getPictureDetail(String pictureId);

@ -195,6 +195,10 @@ public class OcrTaskchildPicture implements BaseDto, java.io.Serializable {
@TableField(value = "TASKNAME")
private String taskname;
@Schema(description = "当前节点名称")
@TableField(value = "TASKINDEX")
private String taskindex;
@Schema(description = "当前节点id")
@TableField(value = "TASKID")
private String taskId;

@ -8,6 +8,8 @@ import cn.jyjz.flowable.entity.FlowApprove;
import cn.jyjz.flowable.service.IFlowInstanceService;
import cn.jyjz.flowable.service.IFlowTaskService;
import cn.jyjz.flowable.service.IFormCustomService;
import cn.jyjz.xiaoyao.admin.dataobject.Department;
import cn.jyjz.xiaoyao.admin.service.DepartmentService;
import cn.jyjz.xiaoyao.common.base.param.ParamterPage;
import cn.jyjz.xiaoyao.common.base.util.SpringUtils;
import cn.jyjz.xiaoyao.common.base.vo.ResultVo;
@ -41,6 +43,7 @@ import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.flowable.task.api.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.mock.web.MockHttpServletRequest;
@ -94,6 +97,9 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
@Resource
private PrevailCloudApi prevailCloudApi;
@Autowired
private DepartmentService departmentService;
/**
*
*
@ -319,8 +325,8 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
//TODO 没有对应项目,返回提示信息
continue;
}
Category category = categoryService.getById(ocrPicture.getCategoryid());
if (null == category || StringUtils.isBlank(category.getProcessdefinitionid())) {
Department department = departmentService.getOne(new LambdaQueryWrapper<Department>().eq(Department::getDeptno, tenantId));
if (null == department || StringUtils.isBlank(department.getProcessdefinitionid())) {
continue;
}
//创建工单,如果创建成功,增加标志,用于过滤条件使用
@ -330,13 +336,13 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(request));
//发起流程
flowInstanceService.startProcessInstanceById(
category.getProcessdefinitionid(),
department.getProcessdefinitionid(),
null,
request,
ocrTaskchildPicture.getId().toString(),
category.getServicename()
department.getServicename()
);
IFormCustomService iFormCustomService = SpringUtils.getBean(category.getServicename());
IFormCustomService iFormCustomService = SpringUtils.getBean(department.getServicename());
FlowModelVO formData = iFormCustomService.getForm(ocrTaskchildPicture.getId().toString());
List<Task> taskList = iFlowTaskService.nowRunTask(formData.getProcessInstanceId(), ocrTaskchildPicture.getProcessdefinitionid());
Task taskData = null;
@ -656,8 +662,8 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
}
@Override
public List<OcrTaskChildPictureVo> getPictureHistoryList(List<String> pictureIds, String taskname) {
return ocrtaskchildpicturemybatisdao.getPictureHistoryList(pictureIds, taskname);
public List<OcrTaskChildPictureVo> getPictureHistoryList(List<String> pictureIds, String pictureId) {
return ocrtaskchildpicturemybatisdao.getPictureHistoryList(pictureIds, pictureId);
}
@Override
@ -680,10 +686,9 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
OcrPictureDuplicateHis duplicateHis = pictureDuplicateHisService.getOne(new LambdaQueryWrapper<OcrPictureDuplicateHis>().eq(OcrPictureDuplicateHis::getPictureId, pictureId));
Page<OcrTaskChildPictureVo> objectPage = new Page<>();
if (ObjectUtils.isNotEmpty(duplicateHis) && org.apache.commons.lang3.StringUtils.isNotBlank(duplicateHis.getCheckDuplicateResultHisJson())) {
String userNodeType = ProcessConstant.userNodeType.getOrDefault(userToken.getNodeType(), "一级审批");
JSONObject jsonObject = JSONObject.parseObject(duplicateHis.getCheckDuplicateResultHisJson());
Set<String> pictureIds = jsonObject.keySet();
List<OcrTaskChildPictureVo> taskChildPicturesOld = this.getPictureHistoryList(new ArrayList<>(pictureIds), userNodeType);
List<OcrTaskChildPictureVo> taskChildPicturesOld = this.getPictureHistoryList(new ArrayList<>(pictureIds), pictureId);
List<OcrTaskChildPictureVo> taskChildPictures = new ArrayList<>();
for (OcrTaskChildPictureVo taskChildPicture : taskChildPicturesOld) {
if(taskChildPicture.getPictureId()!=null){

@ -252,7 +252,7 @@ public class TaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchildPic
//iFlowFormMessageService.sendMsg(user.getLoginname(),model.getUsername() + SystemMessage.SYS_OA_TYPE_LEAVE + SystemMessage.SYS_OA_TO_DO,taskId,processInstanceId,fromid, CacheQyweixinConstants.OA_DISTIONARY_TYPE_MSG_SHENPI,model.getCategoryid().toString());
}
model.setAssigneename(stringBuffer.toString());
model.setTaskindex(task.getDescription());
return this.ocrTaskchildPictureService.updateById(model);
}
return false;

@ -626,7 +626,6 @@
uf.COMMENTHIS,
uf.TASKNAME as TASKNAMEHIS,
uf.STATSHIS,
uf.TASKINDEX,
uf.TASKNO,
op.field6 as fromCustomerLevel,
@ -646,7 +645,7 @@
)
</if>
UNION
select tc.*, uf.COMMENTHIS, uf.TASKNAME as TASKNAMEHIS, uf.STATSHIS, uf.TASKINDEX, uf.TASKNO, op.field6 as fromCustomerLevel, op.releaseArea as fromCity, op.is_repeat
select tc.*, uf.COMMENTHIS, uf.TASKNAME as TASKNAMEHIS, uf.STATSHIS, uf.TASKNO, op.field6 as fromCustomerLevel, op.releaseArea as fromCity, op.is_repeat
from ocr_taskchild_picture tc, OA_USERAPPROVE_T uf, ocr_picture op
where tc.ID = uf.FORMID
and tc.PICTUREID = op.ID
@ -674,26 +673,43 @@
</if>
</select>
<select id="listmytaskCount" resultType="java.lang.Long" parameterType="java.util.Map">
select count(tcp.ID) from (
select tc.*
select count(1) from (
select tc.*,
uf.COMMENTHIS,
uf.TASKNAME as TASKNAMEHIS,
uf.STATSHIS,
uf.TASKNO,
op.field6 as fromCustomerLevel,
op.releaseArea as fromCity,
op.is_repeat
from ocr_taskchild_picture tc
LEFT JOIN OA_USERAPPROVE_T uf ON tc.ID = uf.ID
left join ocr_picture op on tc.PICTUREID = op.ID
where tc.ASSIGNEE = #{searchassignee}
and tc.TENANTID = #{searchtenantid}
and tc.STATES = 2
and tc.TENANTID = #{searchtenantid}
and tc.STATES = 2
and op.suspiciousfile = 0
<if test="izApprovalStatus != null">
${izApprovalStatus.rulesOp}
( #{izApprovalStatus.value} ${izApprovalStatus.dataOp} COALESCE (uf.STATSHIS
, 1)
)
</if>
UNION
select tc.*
from ocr_taskchild_picture tc,
OA_USERAPPROVE_T uf
select tc.*, uf.COMMENTHIS, uf.TASKNAME as TASKNAMEHIS, uf.STATSHIS, uf.TASKNO, op.field6 as fromCustomerLevel, op.releaseArea as fromCity, op.is_repeat
from ocr_taskchild_picture tc, OA_USERAPPROVE_T uf, ocr_picture op
where tc.ID = uf.FORMID
and tc.TENANTID = #{searchtenantid}
and tc.PICTUREID = op.ID
and op.suspiciousfile = 0
and tc.TENANTID = #{searchtenantid}
<if test="thisLoginUserid != null">
and uf.USERID = #{thisLoginUserid}
</if>
<if test="izApprovalStatus != null">
${izApprovalStatus.rulesOp}
( #{izApprovalStatus.value} ${izApprovalStatus.dataOp} COALESCE (uf.STATSHIS
, 1)
)
( #{izApprovalStatus.value} ${izApprovalStatus.dataOp} COALESCE (uf.STATSHIS
, 1)
)
</if>
) as tcp
<include refid="Base_Where_union">
@ -741,15 +757,22 @@
t2.FROMPROJECTNAME fromProjectName,
t2.FINISHTIME finishTime,
t1.imgUrl,
ifnull(t3.STATSHIS, 1) historyStates,
t1.submit_date_timestamp submitDateTimestamp,
t1.photo_date_timestamp photoDateTimestamp,
t1.similarity_score similarityScore,
t1.server_thumbnail_url serverThumbnailUrl
t1.server_thumbnail_url serverThumbnailUrl,
COALESCE(
(SELECT t3.STATSHIS
FROM oa_userapprove_t t3
WHERE t3.FORMID = t2.ID
AND t3.TASKINDEX = (SELECT TASKNODE
FROM ocr_taskchild_picture
WHERE PICTUREID = #{pictureId})
LIMIT 1),
1) AS historyStates
FROM ocr_picture t1
LEFT JOIN ocr_taskchild_picture t2
on t1.ID = t2.PICTUREID
LEFT JOIN oa_userapprove_t t3 on t2.ID = t3.FORMID and t3.TASKNAME = '${taskname}'
where t1.suspiciousfile = 0
and t1.ID in
<foreach collection="pictureIds" open="(" close=")" item="item" separator="," index="index">

Loading…
Cancel
Save