fix: 修改小结查重添加查重日志 #129

Merged
sunchenliang merged 1 commits from fix/updateCheckRepetition20240418 into test 1 year ago

@ -676,8 +676,8 @@ public class FlowTaskController extends BaseController {
})
@GetMapping("/repetitionTask")
@ResponseBody
public ResultVo repetitionTask() {
return flowTaskService.repetitionTask();
public ResultVo repetitionTask(@RequestParam(value = "type",required = false,defaultValue = "1") Integer type) {
return flowTaskService.repetitionTask(type);
}
/**
@ -692,8 +692,9 @@ public class FlowTaskController extends BaseController {
@GetMapping("/repetitionTaskList")
@ResponseBody
public ResultVo repetitionTaskList(@RequestParam(name = "pageNo") Integer pageNo,
@RequestParam(name = "pageSize") Integer pageSize) {
Page<OcrTaskchildPicture> result = flowTaskService.repetitionTaskList(pageNo, pageSize);
@RequestParam(name = "pageSize") Integer pageSize,
@RequestParam(value = "type",required = false,defaultValue = "1") Integer type) {
Page<OcrTaskchildPicture> result = flowTaskService.repetitionTaskList(pageNo, pageSize,type);
return ResultVoUtil.success(result);
}
}

@ -177,7 +177,7 @@ public interface IFlowTaskService {
*
* @return
*/
ResultVo repetitionTask();
ResultVo repetitionTask(Integer type);
Page<OcrTaskchildPicture> repetitionTaskList(Integer pageNo, Integer pageSize);
Page<OcrTaskchildPicture> repetitionTaskList(Integer pageNo, Integer pageSize,Integer type);
}

@ -17,7 +17,6 @@ import cn.jyjz.xiaoyao.common.base.vo.ResultVo;
import cn.jyjz.xiaoyao.common.base.vo.ResultVoUtil;
import cn.jyjz.xiaoyao.oa.from.dataDao.FlowableccMybatisDao;
import cn.jyjz.xiaoyao.oa.from.dataDao.IHisFlowableActinstDao;
import cn.jyjz.xiaoyao.oa.from.dataDao.IRunFlowableActinstDao;
import cn.jyjz.flowable.domain.dto.HistoricTaskInstanceDto;
import cn.jyjz.flowable.factory.FlowServiceFactory;
import cn.jyjz.flowable.service.IFlowTaskService;
@ -107,7 +106,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
@Resource
private DepartmentService departmentService;
@Resource
private IHisFlowableActinstDao hisFlowableActinstDao;
private OcrCheckDescribeHisService ocrCheckDescribeHisService;
@Resource
private OcrUsersearchService ocrUsersearchService;
@ -496,7 +495,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
List<String> taskNames = taskList.stream().map(Task::getName).collect(Collectors.toList());
childPicture.setTaskId(String.join(",", taskIds));
childPicture.setTaskname(String.join(",", taskNames));
}else{
} else {
taskData = taskList.get(0);
childPicture.setTaskId(taskData.getId());
childPicture.setTaskname(taskData.getName());
@ -1424,7 +1423,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
ocrTaskchildPictureApproVo.setProjectName(one.getFromprojectname());//项目名称
ocrTaskchildPictureApproVo.setCustomerLevel(one.getFromCustomerLevel());//客户级别
ocrTaskchildPictureApproVo.setReleaseArea(one.getFromCity());//拜访城市
ocrTaskchildPictureApproVo.setTaskIndex(one.getTaskNodeIndex()==null?"1":one.getTaskNodeIndex());
ocrTaskchildPictureApproVo.setTaskIndex(one.getTaskNodeIndex() == null ? "1" : one.getTaskNodeIndex());
listNew.add(ocrTaskchildPictureApproVo);
}
@ -1758,29 +1757,58 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
}
@Override
public ResultVo repetitionTask() {
List<RepeatedContentVo> repeatedContentVoList = flowableccMybatisDao.repetitionTask();
public ResultVo repetitionTask(Integer type) {
List<RepeatedContentVo> repeatedContentVoList = flowableccMybatisDao.repetitionTask(type);
List<String> formIdsToUpdate = new ArrayList<>();
if (repeatedContentVoList.size() > 0 && repeatedContentVoList.get(0).getRepeatedTaskList().size() > 0) {
String formIds = repeatedContentVoList.get(0).getRepeatedTaskList().get(0).getFormId();
String[] formIdsArray = formIds.split(",");
for (String formId : formIdsArray) {
formIdsToUpdate.add(formId.trim()); // 去除字符串首尾的空格并添加到集合中
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(repeatedContentVoList)) {
List<OcrCheckDescribeHis> checkDescribeHis = new ArrayList<>();
for (RepeatedContentVo contentVo : repeatedContentVoList) {
if (org.apache.commons.lang3.StringUtils.isNotBlank(contentVo.getPictureIds())) {
String[] pictureIds = contentVo.getPictureIds().split(",");
formIdsToUpdate.addAll(Arrays.asList(pictureIds));
List<OcrCheckDescribeHis> list = ocrCheckDescribeHisService.list(new LambdaQueryWrapper<OcrCheckDescribeHis>().in(OcrCheckDescribeHis::getPictureId, pictureIds));
Map<String, List<OcrCheckDescribeHis>> resultMap = new HashMap<>();
if (!CollectionUtils.isEmpty(list)) {
resultMap = list.stream().collect(Collectors.groupingBy(OcrCheckDescribeHis::getPictureId));
}
for (String pictureId : pictureIds) {
Set<String> set = new HashSet<>();
OcrCheckDescribeHis describeHis;
List<OcrCheckDescribeHis> ocrCheckDescribeHis = resultMap.get(pictureId);
if (!CollectionUtils.isEmpty(ocrCheckDescribeHis)) {
describeHis = ocrCheckDescribeHis.get(0);
String[] split = describeHis.getCheckResult().split(",");
set.addAll(Arrays.asList(split));
} else {
describeHis = new OcrCheckDescribeHis();
}
set.addAll(Arrays.asList(pictureIds));
set.remove(pictureId);
describeHis.setDescribe(contentVo.getContent());
describeHis.setPictureId(pictureId);
describeHis.setCheckResult(String.join(",", set));
checkDescribeHis.add(describeHis);
}
}
}
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);
}
@Override
public Page<OcrTaskchildPicture> repetitionTaskList(Integer pageNo, Integer pageSize) {
public Page<OcrTaskchildPicture> repetitionTaskList(Integer pageNo, Integer pageSize, Integer type) {
Page<OcrTaskchildPicture> page = new Page<>(pageNo, pageSize);
Page<OcrTaskchildPicture> result = flowableccMybatisDao.repetitionTaskList(page);
Page<OcrTaskchildPicture> result = flowableccMybatisDao.repetitionTaskList(page, type);
return result;
}

@ -8,6 +8,7 @@ import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
@ -39,7 +40,7 @@ public interface FlowableccMybatisDao extends BaseMapper<Flowablecc> {
*/
List<UserDistionaryVo> selectUserByFromid(String fromid);
List<RepeatedContentVo> repetitionTask();
List<RepeatedContentVo> repetitionTask(@Param("type") Integer type);
Page<OcrTaskchildPicture> repetitionTaskList(Page<OcrTaskchildPicture> page);
Page<OcrTaskchildPicture> repetitionTaskList(Page<OcrTaskchildPicture> page, @Param("type") Integer type);
}

@ -21,6 +21,8 @@ public class RepeatedContentVo {
private String imgUrl;
private String pictureIds;
private List<RepeatedTaskVo> repeatedTaskList;

@ -28,4 +28,6 @@ public class RepeatedTaskVo {
private String fromTime;
private String updateTime;
private String pictureId;
}

@ -35,6 +35,7 @@
<result column="content" property="content"/>
<result column="count" property="count"/>
<result column="imgUrl" property="imgUrl"/>
<result column="pictureIds" property="pictureIds"/>
<collection property="repeatedTaskList" ofType="cn.jyjz.xiaoyao.oa.from.vo.RepeatedTaskVo">
<result column="taskId" property="taskId"/>
<result column="formId" property="formId"/>
@ -201,48 +202,58 @@
</select>
<select id="repetitionTask" resultMap="resultMap">
SELECT t1.count,
t1.content,
t1.id,
t1.imgUrl,
t3.similarity_score similarityScore,
t2.STATES,
t3.remark fromTaskId,
t3.taskName,
t2.TASKNAME nodeName,
t2.FROMUPTIME fromTime,
t2.UPDATETIME updateTime,
t2.TASKID taskId,
(
SELECT GROUP_CONCAT(t4.ID)
FROM ocr_picture t4
WHERE t4.field8 = t1.content
AND t4.ID IN (
SELECT child.PICTUREID
FROM oa_userfinal_t final
LEFT JOIN ocr_taskchild_picture child ON final.FORMID = child.ID
)
) AS formId
from (select count(field8) count, field8 content, ID id, imgUrl
FROM ocr_picture
where ID in (select child.PICTUREID from oa_userfinal_t final left join ocr_taskchild_picture child on final.FORMID = child.ID)
GROUP BY field8
HAVING count(field8) > 1) t1
LEFT JOIN ocr_taskchild_picture t2 ON t1.ID = t2.PICTUREID
LEFT JOIN ocr_picture t3 on t1.id = t3.ID
SELECT t1.count,
t1.content,
t1.id,
t1.imgUrl,
t3.similarity_score similarityScore,
t2.STATES,
t3.remark fromTaskId,
t3.taskName,
t2.TASKNAME nodeName,
t2.FROMUPTIME fromTime,
t2.UPDATETIME updateTime,
t2.TASKID taskId,
t2.ID as formId,
t1.pictureIds
from (select count(field8) count, field8 content, ID id, GROUP_CONCAT(id) pictureIds, imgUrl
FROM ocr_picture
where
<if test="type == 0">
ID in (select PICTUREID from ocr_taskchild_picture where ISFINAIL = 1)
</if>
<if test="type == 1">
ID in (select PICTUREID from ocr_taskchild_picture where ISFINAIL = 1)
</if>
GROUP BY field8
HAVING count(field8) > 1) t1
LEFT JOIN ocr_taskchild_picture t2 ON t1.ID = t2.PICTUREID
LEFT JOIN ocr_picture t3 on t1.id = t3.ID
</select>
<select id="repetitionTaskList" resultType="cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture">
SELECT t2.*,t3.similarity_score similarityScore
FROM oa_userfinal_t t1
LEFT JOIN ocr_taskchild_picture t2 ON t2.ID = t1.FORMID
SELECT t2.*, t3.similarity_score similarityScore
FROM ocr_taskchild_picture t2
LEFT JOIN ocr_picture t3 ON t2.PICTUREID = t3.ID
WHERE t3.field8 IN (SELECT t3.field8
FROM oa_userfinal_t t1
LEFT JOIN
ocr_taskchild_picture t2 on t1.FORMID = t2.ID
WHERE
<if test="type == 0">
t2.ISFINAIL = 1
</if>
<if test="type == 1">
t2.ISFINAIL = 1
</if>
and t3.field8 IN (SELECT t3.field8
FROM ocr_taskchild_picture t2
LEFT JOIN ocr_picture t3 on t2.PICTUREID = t3.ID
GROUP BY t3.field8
HAVING count(t3.field8) > 1)
where
<if test="type == 0">
t2.ISFINAIL = 1
</if>
<if test="type == 1">
t2.ISFINAIL = 1
</if>
GROUP BY t3.field8
HAVING count(t3.field8) > 1)
</select>
</mapper>

Loading…
Cancel
Save