From c56b4d7949bd6b859bb3086d60c34f42631e52ed Mon Sep 17 00:00:00 2001 From: guoshengxiong <1923636941@qq.com> Date: Tue, 18 Feb 2025 20:15:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=85=E5=A4=B4bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/zhgd/xmgl/call/HikvisionCall.java | 30 +++++++++++++++++-- .../service/impl/PlanRecordServiceImpl.java | 8 +++++ .../video/mapper/xml/VideoItemMapper.xml | 6 ++++ .../com/zhgd/xmgl/util/FlowSeviceUtil.java | 2 -- 4 files changed, 41 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/zhgd/xmgl/call/HikvisionCall.java b/src/main/java/com/zhgd/xmgl/call/HikvisionCall.java index d2b27a4c1..19d91048e 100644 --- a/src/main/java/com/zhgd/xmgl/call/HikvisionCall.java +++ b/src/main/java/com/zhgd/xmgl/call/HikvisionCall.java @@ -57,6 +57,7 @@ import com.zhgd.xmgl.modules.worker.mapper.EnterpriseInfoMapper; import com.zhgd.xmgl.modules.worker.mapper.UfaceDevMapper; import com.zhgd.xmgl.modules.worker.mapper.WorkerAttendanceMapper; import com.zhgd.xmgl.modules.worker.mapper.WorkerInfoMapper; +import com.zhgd.xmgl.modules.worker.service.ITeamInfoService; import com.zhgd.xmgl.modules.worker.service.IUfaceDevService; import com.zhgd.xmgl.modules.worker.service.IWorkerAttendancePresenceService; import com.zhgd.xmgl.modules.worker.service.IWorkerAttendanceService; @@ -92,7 +93,6 @@ import org.springframework.web.bind.annotation.RestController; import springfox.documentation.annotations.ApiIgnore; import javax.annotation.Resource; -import java.nio.file.Path; import java.util.*; import java.util.stream.Collectors; @@ -231,6 +231,9 @@ public class HikvisionCall { @Lazy @Autowired private ISystemUserService systemUserService; + @Lazy + @Autowired + private ITeamInfoService teamInfoService; /** * 获取图片 @@ -1018,6 +1021,10 @@ public class HikvisionCall { if (project == null || !Objects.equals(project.getSyncHikvision(), 1)) { return; } + //劳务就要判断班组不存在就要添加组织 + if (workerInfo.getPersonType() == 1) { + saveIfNotExistTeam(workerInfo, project); + } //idcard, // 存在: // person一样,更新 @@ -1046,6 +1053,22 @@ public class HikvisionCall { } } + /** + * 劳务就要判断班组不存在就要添加组织 + * + * @param workerInfo + * @param project + * @throws Exception + */ + private void saveIfNotExistTeam(WorkerInfo workerInfo, Project project) throws Exception { + boolean existOrg = hikvisionCall.existOrg(project, workerInfo.getTeamId() + "", workerInfo.getEnterpriseId() + ""); + if (!existOrg) { + TeamInfo teamInfo = teamInfoService.getById(workerInfo.getTeamId()); + HikvisionOrganization hikvisionOrganization = getHikvisionOrganization(teamInfo, project); + addOrgNoticeFromHttp(project, hikvisionOrganization); + } + } + /** * 更新人员 * @@ -1057,6 +1080,7 @@ public class HikvisionCall { String rs = HikvisionUtil.editWorker(workerInfo, project); sendNoticeAndSetStatusForWorker("更新人员到海康isc", rs, workerInfo, 1, 2, true); } + /** * 添加人脸 * @@ -1297,9 +1321,9 @@ public class HikvisionCall { if (Objects.equals(msg1, orgIndexCodeNotExists)) { String pN = ""; if (Objects.equals(workerInfo.getPersonType(), WorkerInfoPersonTypeEnum.LW.getValue())) { - pN = "班组"; + pN = "工种"; } else if (Objects.equals(workerInfo.getPersonType(), WorkerInfoPersonTypeEnum.GL.getValue())) { - pN = "部门"; + pN = "岗位"; } msg = "同步失败,人员名称:" + workerInfo.getWorkerName() + ",身份证号:" + workerInfo.getIdCard() + "。失败原因:" + pN + "未同步成功"; title += FAIL; diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/plan/service/impl/PlanRecordServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/baotou/plan/service/impl/PlanRecordServiceImpl.java index 6d0fca022..aad22a8e3 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/plan/service/impl/PlanRecordServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/plan/service/impl/PlanRecordServiceImpl.java @@ -516,6 +516,14 @@ public class PlanRecordServiceImpl extends ServiceImpl categories = planWorkCategoryService.queryList(param); + //查询所有上级 + List ids = categories.stream().map(PlanWorkCategory::getId).collect(Collectors.toList()); + Set parentIds = categories.stream().flatMap(o -> StrUtil.split(o.getAncestors(), ",").stream()).filter(o -> !ids.contains(Long.valueOf(o)) && !"0".equals(o)).collect(Collectors.toSet()); + if (CollUtil.isNotEmpty(parentIds)) { + List list = planWorkCategoryService.list(new LambdaQueryWrapper() + .in(PlanWorkCategory::getId, parentIds)); + categories.addAll(list); + } Map> cidMap = planChooseCategoryService.queryList(param).stream().collect(Collectors.groupingBy(PlanChooseCategory::getCategoryId)); List records = planRecordService.list(new LambdaQueryWrapper().eq(PlanRecord::getProjectSn, projectSn) .eq(isImportantMilestone != null, PlanRecord::getIsImportantMilestone, isImportantMilestone)); diff --git a/src/main/java/com/zhgd/xmgl/modules/video/mapper/xml/VideoItemMapper.xml b/src/main/java/com/zhgd/xmgl/modules/video/mapper/xml/VideoItemMapper.xml index 15e8adae4..0b981feb3 100644 --- a/src/main/java/com/zhgd/xmgl/modules/video/mapper/xml/VideoItemMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/video/mapper/xml/VideoItemMapper.xml @@ -23,6 +23,12 @@ left join video_nvr vn on vi.nvr_id = vn.id left join enterprise_info ei on find_in_set(ei.id,vi.enterprise_ids) WHERE vi.video_id = #{videoId} + + and vi.serial_number like concat('%', #{serialNumber}, '%') + + + and vi.video_name like concat('%', #{videoName}, '%') + and vi.group_id = #{groupId} diff --git a/src/main/java/com/zhgd/xmgl/util/FlowSeviceUtil.java b/src/main/java/com/zhgd/xmgl/util/FlowSeviceUtil.java index b1b267516..17d195ef7 100644 --- a/src/main/java/com/zhgd/xmgl/util/FlowSeviceUtil.java +++ b/src/main/java/com/zhgd/xmgl/util/FlowSeviceUtil.java @@ -158,8 +158,6 @@ public class FlowSeviceUtil { WflowSubProcess subProcess = subProcessMapper.selectOne(new LambdaQueryWrapper<>(WflowSubProcess.builder() .procDefId(instance.getProcessDefinitionId()).build())); nodeMap = nodeCatchService.reloadProcessByStr(subProcess.getProcess()); - HistoricVariableInstance formsVar = historyService.createHistoricVariableInstanceQuery() - .processInstanceId(mainInst.getId()).variableName(WflowGlobalVarDef.WFLOW_FORMS).singleResult(); } //搜索当前版本流程的配置 WflowModelHistorys modelHistory = modelHistorysMapper.selectOne(new LambdaQueryWrapper<>(WflowModelHistorys.builder()