feat:修改小结查重

feat/updateRepetitionTask2024-05-08
sunchenliang 1 year ago
parent 8f0687bb35
commit fd3fba61de

@ -499,7 +499,7 @@ public class FlowTaskController extends BaseController {
Map<String, Object> query = searchQuery.getQuery();
flowTaskService.getFinalProcessInstances(query, pageUtils,user);
flowTaskService.getFinalProcessInstances(query, pageUtils, user);
return ResultVoUtil.success(pageUtils);
}
@ -680,9 +680,120 @@ public class FlowTaskController extends BaseController {
@GetMapping("/repetitionTask")
@ResponseBody
public ResultVo repetitionTask(HttpServletRequest request,
@RequestParam(value = "type",required = false,defaultValue = "1") Integer type) {
@RequestParam(value = "type", required = false, defaultValue = "0") Integer type,
@RequestParam(name = "izupuser", defaultValue = "", required = false) String izupuser,
@RequestParam(name = "taskName", defaultValue = "", required = false) String taskName,
@RequestParam(name = "izproject", defaultValue = "", required = false) String izproject,
@RequestParam(name = "izplan", defaultValue = "", required = false) String izplan,
@RequestParam(name = "izstatus", defaultValue = "", required = false) String izstatus,
@RequestParam(name = "iztaskrrom", defaultValue = "", required = false) String iztaskrrom,
@RequestParam(name = "izuptime", defaultValue = "", required = false) String izuptime,
@RequestParam(name = "isFail", defaultValue = "false", required = false) String isFail) {
SearchQuery searchQuery = new SearchQuery();
if (org.springframework.util.StringUtils.hasText(izupuser)) {
if (izupuser.contains(",")) {
String[] userIds = izupuser.split(",");
List<String> arrayData = Arrays.asList(userIds);
searchQuery.addIn("fromuserid", arrayData);
} else {
searchQuery.addEqual("fromuserid", izupuser);
}
}
if (StringUtils.isNotBlank(taskName)) {
searchQuery.addLike("fromtaskname", taskName);
}
if (org.springframework.util.StringUtils.hasText(izproject)) {
if (izproject.contains(",")) {
String[] projectIds = izproject.split(","); // 以逗号拆分字符串
List<String> arrayData = Arrays.asList(projectIds);
SearchQueryForm searchQueryForm = new SearchQueryForm();
searchQuery.addIn("fromprojectname", arrayData);
} else {
searchQuery.addEqual("fromprojectname", izproject);
}
}
if (org.springframework.util.StringUtils.hasText(izplan)) {
if (izplan.contains(",")) {
String[] planIds = izplan.split(","); // 以逗号拆分字符串
List<String> arrayData = Arrays.asList(planIds);
SearchQueryForm searchQueryForm = new SearchQueryForm();
searchQuery.addIn("fromplanid", arrayData);
} else {
searchQuery.addEqual("fromplanid", izplan);
}
}
if (org.springframework.util.StringUtils.hasText(izstatus)) {
if (izstatus.contains(",")) {
String[] statusIds = izstatus.split(","); // 以逗号拆分字符串
List<String> arrayData = Arrays.asList(statusIds);
searchQuery.addIn("states", arrayData);
} else {
searchQuery.addEqual("states", izstatus);
}
}
if (Boolean.parseBoolean(isFail)) {
searchQuery.addEqual("isFail", "1");
}
if (org.springframework.util.StringUtils.hasText(iztaskrrom)) {
if (iztaskrrom.contains(",")) {
String[] taskrromIds = iztaskrrom.split(","); // 以逗号拆分字符串
List<String> arrayData = Arrays.asList(taskrromIds);
searchQuery.addIn("fromsourceid", arrayData);
} else {
searchQuery.addEqual("fromsourceid", iztaskrrom);
}
}
if (org.springframework.util.StringUtils.hasText(izuptime)) {
String[] dateRange = izuptime.split("-");
if (dateRange.length == 2) {
try {
SimpleDateFormat sdfInput = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
// 解析开始时间
Long startTimeStamp = sdfInput.parse(dateRange[0].trim() + " 00:00:00").getTime();
// 解析结束时间
Long endTimeStamp = sdfInput.parse(dateRange[1].trim() + " 23:59:59").getTime();
// 如果开始时间不为空,则将其放入查询条件中
if (startTimeStamp != null) {
searchQuery.addGreater("fromuptimeStart", startTimeStamp);
}
// 如果结束时间不为空,则将其放入查询条件中
if (endTimeStamp != null) {
searchQuery.addLess("fromuptimeEnd", endTimeStamp);
}
} catch (ParseException e) {
// 处理日期解析异常
e.printStackTrace();
}
}
}
//租户主键,由前端页面传送
String tenantId = request.getHeader("X-Tenant-Id");
return flowTaskService.repetitionTask(type,tenantId);
if (org.apache.commons.lang3.StringUtils.isBlank(tenantId)) {
return ResultVoUtil.error("租户主键不能为空");
}
User user = this.userService.getSessionUser(request);
if (user.isUserIsSys(xiaoyaoConfig.getWebconfig().getSysLoginUser().split(","))) {
} else {
searchQuery.addEqual("thisLoginUserid", user.getLoginname());
}
searchQuery.addEqual("tenantid", tenantId);
String searchId = request.getParameter("searchId");
if (StringUtils.isNotBlank(searchId)) {
List<OcrUsersearchchild> list = usersearchchildService.list(new LambdaQueryWrapper<OcrUsersearchchild>().eq(OcrUsersearchchild::getUsersearchid, searchId).orderByAsc(OcrUsersearchchild::getOrderNum));
for (OcrUsersearchchild userSearch : list) {
disSearchQuery(searchQuery, userSearch);
}
}
Map<String, Object> query = searchQuery.getQuery();
return flowTaskService.repetitionTask(type, tenantId,query);
}
/**
@ -699,9 +810,9 @@ public class FlowTaskController extends BaseController {
public ResultVo repetitionTaskList(HttpServletRequest request,
@RequestParam(name = "pageNo") Integer pageNo,
@RequestParam(name = "pageSize") Integer pageSize,
@RequestParam(value = "type",required = false,defaultValue = "1") Integer type) {
@RequestParam(value = "type", required = false, defaultValue = "1") Integer type) {
String tenantId = request.getHeader("X-Tenant-Id");
Page<OcrTaskchildPicture> result = flowTaskService.repetitionTaskList(pageNo, pageSize,type,tenantId);
Page<OcrTaskchildPicture> result = flowTaskService.repetitionTaskList(pageNo, pageSize, type, tenantId);
return ResultVoUtil.success(result);
}
@ -717,14 +828,14 @@ public class FlowTaskController extends BaseController {
@GetMapping("/retryPrevailCloud")
@ResponseBody
public ResultVo retryPrevailCloud(HttpServletRequest request,
@RequestParam(name = "formId") String formId) {
@RequestParam(name = "formId") String formId) {
String tenantId = request.getHeader("X-Tenant-Id");
Boolean result = null;
try {
result = flowTaskService.retryPrevailCloud(tenantId,formId);
result = flowTaskService.retryPrevailCloud(tenantId, formId);
} catch (Exception e) {
log.error(e.getMessage());
result =false;
result = false;
}
return ResultVoUtil.success(result);
}

@ -193,7 +193,7 @@ public interface IFlowTaskService {
*
* @return
*/
ResultVo repetitionTask(Integer type, String tenantId);
ResultVo repetitionTask(Integer type, String tenantId, Map<String, Object> query);
Page<OcrTaskchildPicture> repetitionTaskList(Integer pageNo, Integer pageSize, Integer type, String tenantId);

@ -40,7 +40,6 @@ import cn.jyjz.xiaoyao.ocr.dataobject.*;
import cn.jyjz.xiaoyao.ocr.service.*;
import cn.jyjz.xiaoyao.ocr.util.SearchParaFormatting;
import cn.jyjz.xiaoyao.ocr.vo.OcrTaskchildPictureApproVo;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -1962,8 +1961,9 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
}
@Override
public ResultVo repetitionTask(Integer type, String tenantId) {
List<RepeatedContentVo> repeatedContentVoList = flowableccMybatisDao.repetitionTask(type, tenantId);
public ResultVo repetitionTask(Integer type, String tenantId, Map<String, Object> query) {
query.put("type",type);
List<RepeatedContentVo> repeatedContentVoList = flowableccMybatisDao.repetitionTaskNew(query);
List<String> formIdsToUpdate = new ArrayList<>();
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(repeatedContentVoList)) {
List<OcrCheckDescribeHis> checkDescribeHis = new ArrayList<>();
@ -1997,15 +1997,16 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
}
}
ocrCheckDescribeHisService.saveOrUpdateBatch(checkDescribeHis);
UpdateWrapper<OcrTaskchildPicture> updateWrapper = new UpdateWrapper<>();
updateWrapper.in("PICTUREID", formIdsToUpdate)
.eq("is_repeated_nodules", 0);
OcrTaskchildPicture updateEntity = new OcrTaskchildPicture();
updateEntity.setIsRepeatedNodules(1);
ocrTaskchildPictureService.update(updateEntity, updateWrapper);
if(!CollectionUtils.isEmpty(checkDescribeHis)){
ocrCheckDescribeHisService.saveOrUpdateBatch(checkDescribeHis);
UpdateWrapper<OcrTaskchildPicture> updateWrapper = new UpdateWrapper<>();
updateWrapper.in("PICTUREID", formIdsToUpdate)
.eq("is_repeated_nodules", 0);
OcrTaskchildPicture updateEntity = new OcrTaskchildPicture();
updateEntity.setIsRepeatedNodules(1);
ocrTaskchildPictureService.update(updateEntity, updateWrapper);
}
}
return ResultVoUtil.success(repeatedContentVoList);
}

@ -40,7 +40,7 @@ public interface FlowableccMybatisDao extends BaseMapper<Flowablecc> {
*/
List<UserDistionaryVo> selectUserByFromid(String fromid);
List<RepeatedContentVo> repetitionTask(@Param("type") Integer type, @Param("tenantId") String tenantId);
List<RepeatedContentVo> repetitionTaskNew(Map<String, Object> query);
Page<OcrTaskchildPicture> repetitionTaskList(Page<OcrTaskchildPicture> page, @Param("type") Integer type, @Param("tenantId") String tenantId);
}

@ -158,6 +158,187 @@
</trim>
</where>
</sql>
<sql id="Base_Where_union_new">
<where>
<trim prefixOverrides="and|or">
<if test="id != null">
and tcp.ID ${id.dataOp} ${id.likestar}#{id.value}${id.likeend}
</if>
<if test="ocpictureid != null">
and tcp.OCPICTUREID ${ocpictureid.dataOp} ${ocpictureid.likestar}#{ocpictureid.value}${ocpictureid.likeend}
</if>
<if test="pictureresult != null">
and tcp.PICTURERESULT ${pictureresult.dataOp} ${pictureresult.likestar}#{pictureresult.value}${pictureresult.likeend}
</if>
<if test="picturecompare != null">
and tcp.PICTURECOMPARE ${picturecompare.dataOp} ${picturecompare.likestar}#{picturecompare.value}${picturecompare.likeend}
</if>
<if test="deptid != null">
and tcp.DEPTID ${deptid.dataOp} ${deptid.likestar}#{deptid.value}${deptid.likeend}
</if>
<if test="tenantid != null">
and tcp.TENANTID ${tenantid.dataOp} ${tenantid.likestar}#{tenantid.value}${tenantid.likeend}
</if>
<if test="packageid != null">
and tcp.PACKAGEID ${packageid.dataOp} ${packageid.likestar}#{packageid.value}${packageid.likeend}
</if>
<if test="pictureid != null">
and tcp.PICTUREID ${pictureid.dataOp} ${pictureid.likestar}#{pictureid.value}${pictureid.likeend}
</if>
<if test="category != null">
and tcp.CATEGORY ${category.dataOp} ${category.likestar}#{category.value}${category.likeend}
</if>
<if test="categoryid != null">
and tcp.CATEGORYID ${categoryid.dataOp} ${categoryid.likestar}#{categoryid.value}${categoryid.likeend}
</if>
<if test="specification != null">
and tcp.SPECIFICATION ${specification.dataOp} ${specification.likestar}#{specification.value}${specification.likeend}
</if>
<if test="buessinessno != null">
and tcp.BUESSINESSNO ${buessinessno.dataOp} ${buessinessno.likestar}#{buessinessno.value}${buessinessno.likeend}
</if>
<!-- <if test="states != null"> and tcp.STATES ${states.dataOp} ${states.likestar}#{states.value}${states.likeend}</if>-->
<if test="processinstanceid != null">
and tcp.PROCESSINSTANCEID ${processinstanceid.dataOp} ${processinstanceid.likestar}#{processinstanceid.value}${processinstanceid.likeend}
</if>
<if test="processdefinitionid != null">
and tcp.PROCESSDEFINITIONID ${processdefinitionid.dataOp} ${processdefinitionid.likestar}#{processdefinitionid.value}${processdefinitionid.likeend}
</if>
<if test="deploymentid != null">
and tcp.DEPLOYMENTID ${deploymentid.dataOp} ${deploymentid.likestar}#{deploymentid.value}${deploymentid.likeend}
</if>
<if test="assigneename != null">
and tcp.ASSIGNEENAME ${assigneename.dataOp} ${assigneename.likestar}#{assigneename.value}${assigneename.likeend}
</if>
<if test="assignee != null">
and tcp.ASSIGNEE ${assignee.dataOp} ${assignee.likestar}#{assignee.value}${assignee.likeend}
</if>
<if test="updateuser != null">
and tcp.UPDATEUSER ${updateuser.dataOp} ${updateuser.likestar}#{updateuser.value}${updateuser.likeend}
</if>
<if test="updatetime != null">
and tcp.UPDATETIME ${updatetime.dataOp} ${updatetime.likestar}#{updatetime.value}${updatetime.likeend}
</if>
<if test="fileannex != null">
and tcp.FILEANNEX ${fileannex.dataOp} ${fileannex.likestar}#{fileannex.value}${fileannex.likeend}
</if>
<if test="guidang != null">
and tcp.GUIDANG ${guidang.dataOp} ${guidang.likestar}#{guidang.value}${guidang.likeend}
</if>
<if test="createuser != null">
and tcp.CREATEUSER ${createuser.dataOp} ${createuser.likestar}#{createuser.value}${createuser.likeend}
</if>
<if test="createusername != null">
and tcp.CREATEUSERNAME ${createusername.dataOp} ${createusername.likestar}#{createusername.value}${createusername.likeend}
</if>
<if test="createdate != null">
and tcp.CREATEDATE ${createdate.dataOp} ${createdate.likestar}#{createdate.value}${createdate.likeend}
</if>
<if test="createdateStart != null">
and tcp.CREATEDATE ${createdateStart.dataOp} ${createdateStart.likestar}#{createdateStart.value}${createdateStart.likeend}
</if>
<if test="createdateEnd != null">
and tcp.CREATEDATE ${createdateEnd.dataOp} ${createdateEnd.likestar}#{createdateEnd.value}${createdateEnd.likeend}
</if>
<if test="username != null">
and tcp.USERNAME ${username.dataOp} ${username.likestar}#{username.value}${username.likeend}
</if>
<if test="fromtaskid != null">
and tcp.FROMTASKID ${fromtaskid.dataOp} ${fromtaskid.likestar}#{fromtaskid.value}${fromtaskid.likeend}
</if>
<if test="fromtaskname != null">
and tcp.FROMTASKNAME ${fromtaskname.dataOp} ${fromtaskname.likestar}#{fromtaskname.value}${fromtaskname.likeend}
</if>
<!-- <if test="fromuserid != null"> and tcp.FROMUSERID ${fromuserid.dataOp} ${fromuserid.likestar}#{fromuserid.value}${fromuserid.likeend}</if>-->
<!-- <if test="fromprojectid != null"> and tcp.FROMPROJECTID ${fromprojectid.dataOp} ${fromprojectid.likestar}#{fromprojectid.value}${fromprojectid.likeend}</if>-->
<!-- <if test="fromplanid != null"> and tcp.FROMPLANID ${fromplanid.dataOp} ${fromplanid.likestar}#{fromplanid.value}${fromplanid.likeend}</if>-->
<if test="fromuptime != null">
and tcp.FROMUPTIME ${fromuptime.dataOp} ${fromuptime.likestar}#{fromuptime.value}${fromuptime.likeend}
</if>
<if test="fromuserid != null">
and tcp.FROMUSERID ${fromuserid.dataOp} ${fromuserid.likestar}
<!-- #{fromuserid.value}-->
<if test="fromuserid.value instanceof java.util.List">
<foreach item="item" collection="fromuserid.value" open="" separator="," close="">
#{item}
</foreach>
</if>
<if test="!fromuserid.value instanceof java.util.List">
#{fromuserid.value}
</if>
${fromuserid.likeend}
</if>
<if test="fromprojectid != null">
and tcp.FROMPROJECTID ${fromprojectid.dataOp} ${fromprojectid.likestar}
<!-- #{fromuserid.value}-->
<if test="fromprojectid.value instanceof java.util.List">
<foreach item="item" collection="fromprojectid.value" open="" separator="," close="">
#{item}
</foreach>
</if>
<if test="!fromprojectid.value instanceof java.util.List">
#{fromprojectid.value}
</if>
${fromprojectid.likeend}
</if>
<if test="fromplanid != null">
and tcp.FROMPLANID ${fromplanid.dataOp} ${fromplanid.likestar}
<!-- #{fromuserid.value}-->
<if test="fromplanid.value instanceof java.util.List">
<foreach item="item" collection="fromplanid.value" open="" separator="," close="">
#{item}
</foreach>
</if>
<if test="!fromplanid.value instanceof java.util.List">
#{fromplanid.value}
</if>
${fromplanid.likeend}
</if>
<if test="states != null">
and tcp.STATES ${states.dataOp} ${states.likestar}
<!-- #{fromuserid.value}-->
<if test="states.value instanceof java.util.List">
<foreach item="item" collection="states.value" open="" separator="," close="">
#{item}
</foreach>
</if>
<if test="!states.value instanceof java.util.List">
#{states.value}
</if>
${states.likeend}
</if>
<if test="fromsourceid != null">
and tcp.FROMSOURCEID ${fromsourceid.dataOp} ${fromsourceid.likestar}
<!-- #{fromuserid.value}-->
<if test="fromsourceid.value instanceof java.util.List">
<foreach item="item" collection="fromsourceid.value" open="" separator="," close="">
#{item}
</foreach>
</if>
<if test="!fromsourceid.value instanceof java.util.List">
#{fromsourceid.value}
</if>
${fromsourceid.likeend}
</if>
<!-- <if test="fromuserid.value instanceof java.util.List"> and tcp.FROMUSERID-->
<!-- in-->
<!-- <foreach item="item" collection="fromuserid.value" open="(" separator="," close=")">-->
<!-- #{item}-->
<!-- </foreach>-->
<!-- </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>
</sql>
<select id="selectUserByFromid" resultMap="BaseResultUserMap" >
select
u.ID AS id,
@ -232,6 +413,55 @@
where t2.TENANTID = #{tenantId,jdbcType=VARCHAR}
</select>
<select id="repetitionTaskNew" resultMap="resultMap">
SELECT t1.count,
t1.content,
t1.id,
t1.imgUrl,
pic.similarity_score similarityScore,
tcp.STATES,
pic.remark as fromTaskId,
pic.taskName,
tcp.TASKNAME nodeName,
tcp.FROMUPTIME fromTime,
tcp.UPDATETIME as updateTime,
tcp.TASKID as taskId,
tcp.ID as formId,
t1.pictureIds
from (select count(field8) count, field8 content, ID id, GROUP_CONCAT(id) pictureIds, imgUrl
FROM ocr_picture
where suspiciousfile = 0
and tenant_id = #{tenantid.value,jdbcType=VARCHAR}
GROUP BY field8
HAVING count(field8) > 1) t1
left JOIN ocr_picture pic on t1.content = pic.field8
left JOIN ocr_taskchild_picture tcp ON pic.ID = tcp.PICTUREID
<include refid="Base_Where_union_new"/>
<if test="type.value == 0">
and tcp.ISFINAIL = 1
</if>
<if test="type.value == 1">
and tcp.ISLAST = 1
</if>
<if test="thisLoginUserid != null and isFail == null">
and FIND_IN_SET(#{thisLoginUserid.value}
, tcp.ASSIGNEE)
</if>
<if test="thisLoginUserid != null and isFail != null">
and (FIND_IN_SET(#{thisLoginUserid.value}
, tcp.ASSIGNEE)
or tcp.STATES = 5)
</if>
<if test="fromuptimeStart != null">
and tcp.fromuptime &gt;= ${fromuptimeStart.value}
</if>
<if test="fromuptimeEnd != null">
and tcp.fromuptime &lt;= ${fromuptimeEnd.value}
</if>
</select>
<select id="repetitionTaskList" resultType="cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture">
SELECT t2.*, t3.similarity_score similarityScore
FROM ocr_taskchild_picture t2

Loading…
Cancel
Save