diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/IHseSafetyInspectionService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/IHseSafetyInspectionService.java index e5348556..a2cf960c 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/IHseSafetyInspectionService.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/IHseSafetyInspectionService.java @@ -39,6 +39,8 @@ public interface IHseSafetyInspectionService extends IService queryPageList(HseSafetyInspectionQueryReq req, PageQuery pageQuery); + TableDataInfo queryPageListWeb(HseSafetyInspectionQueryReq req, PageQuery pageQuery); + /** * 查询符合条件的安全巡检工单列表 * diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HseSafetyInspectionServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HseSafetyInspectionServiceImpl.java index 9a37ca10..8eb607d4 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HseSafetyInspectionServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HseSafetyInspectionServiceImpl.java @@ -141,6 +141,24 @@ public class HseSafetyInspectionServiceImpl extends ServiceImpl queryPageListWeb(HseSafetyInspectionQueryReq req, PageQuery pageQuery) { + LambdaQueryWrapper lqw = this.buildQueryWrapper(req); + Long userId = LoginHelper.getUserId(); +// if (userId != null) { +// BusProjectTeamMember one = projectTeamMemberService.lambdaQuery() +// .eq(BusProjectTeamMember::getMemberId, userId) +// .eq(BusProjectTeamMember::getPostId, "0") +// .last("limit 1") +// .one(); +// if (one != null) { +// lqw.eq(HseSafetyInspection::getCorrectorId, userId); +// } +// } + Page result = this.page(pageQuery.build(), lqw); + return TableDataInfo.build(this.getVoPage(result)); + } + /** * 查询符合条件的安全巡检工单列表 * diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/transferData/controller/TransferDataController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/transferData/controller/TransferDataController.java index d7202da3..607ffd5e 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/transferData/controller/TransferDataController.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/transferData/controller/TransferDataController.java @@ -148,7 +148,7 @@ public class TransferDataController { busAttendance.setHandle("5".equals(oldAttendance.getIsPinch())?"1":"0"); } arrs.add(busAttendance); - if(arrs.size() >= 1000){ + if(arrs.size() >= 500){ List batchList = new ArrayList<>(arrs); // 提交异步任务:处理照片 + 批量保存 transferDataService.handlePhotoAndSaveBatch(batchList); @@ -199,7 +199,7 @@ public class TransferDataController { @GetMapping("/handleFile") private void handleFile() { - transferDataService.handleFile(); + transferDataService.handleFile(); } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/transferData/mapper/TransferDataMapper.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/transferData/mapper/TransferDataMapper.java index 73cf8635..e6527ce8 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/transferData/mapper/TransferDataMapper.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/transferData/mapper/TransferDataMapper.java @@ -13,7 +13,8 @@ import java.util.List; public interface TransferDataMapper { - @DS("slave") + + @DS("slave1") @Select("select * from bus_attendance where project_id in (59,60)") List getData(); @@ -22,7 +23,7 @@ public interface TransferDataMapper { List getUserList(); - @Select("select id,sys_user_id,project_id,user_name from sub_construction_user_copy1 where go_openid = #{openId}") + @Select("select id,sys_user_id,project_id,user_name from sub_construction_user where go_openid = #{openId}") ConstructionUserCopy getConstructionUserCopy(@Param("openId") String openId); @@ -43,8 +44,8 @@ public interface TransferDataMapper { int saveBatchCopy(@Param("list") List busAttendanceList); - @Select("select id,go_id,sfz_front_pic,sfz_back_pic,yhk_pic,special_work_pic from sub_construction_user " + - "where go_id between 107 and 893 order by go_id") + + @Select("select id,go_id,sfz_front_pic,sfz_back_pic,yhk_pic,special_work_pic from sub_construction_user") List getConstructionUserList(); diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/transferData/service/TransferDataService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/transferData/service/TransferDataService.java index cacd93f8..d8f7088f 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/transferData/service/TransferDataService.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/transferData/service/TransferDataService.java @@ -47,6 +47,10 @@ import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.concurrent.Executor; import java.util.concurrent.Semaphore; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.*; import java.util.stream.Collectors; import static kotlin.reflect.jvm.internal.impl.builtins.StandardNames.FqNames.list; @@ -83,8 +87,8 @@ public class TransferDataService { // 两个候选基础URL private static final String[] BASE_URLS = { - "http://xny.yj-3d.com:7464", - "http://xny.yj-3d.com:7363" + "http://192.168.110.2:7464", + "http://192.168.110.2:7363" }; /** @@ -227,18 +231,18 @@ public class TransferDataService { Long l = handleSinglePhoto1(subConstructionUser.getFacePic()); subConstructionUser.setFacePic(l == null ? "" : l.toString()); } - if (subConstructionUser.getSfzFrontPic() != null) { - Long l = handleSinglePhoto1(subConstructionUser.getSfzFrontPic()); - subConstructionUser.setSfzFrontPic(l == null ? "" : l.toString()); - } - if (subConstructionUser.getSfzBackPic() != null) { - Long l = handleSinglePhoto1(subConstructionUser.getSfzBackPic()); - subConstructionUser.setSfzBackPic(l == null ? "" : l.toString()); - } - if (subConstructionUser.getYhkPic() != null) { - Long l = handleSinglePhoto1(subConstructionUser.getYhkPic()); - subConstructionUser.setYhkPic(l == null ? "" : l.toString()); - } +// if (subConstructionUser.getSfzFrontPic() != null) { +// Long l = handleSinglePhoto1(subConstructionUser.getSfzFrontPic()); +// subConstructionUser.setSfzFrontPic(l == null ? "" : l.toString()); +// } +// if (subConstructionUser.getSfzBackPic() != null) { +// Long l = handleSinglePhoto1(subConstructionUser.getSfzBackPic()); +// subConstructionUser.setSfzBackPic(l == null ? "" : l.toString()); +// } +// if (subConstructionUser.getYhkPic() != null) { +// Long l = handleSinglePhoto1(subConstructionUser.getYhkPic()); +// subConstructionUser.setYhkPic(l == null ? "" : l.toString()); +// } objects.add(subConstructionUser); } //更新数据 @@ -334,61 +338,62 @@ public class TransferDataService { public void handleFile() { - List constructionUserList = transferDataMapper.getConstructionUserList(); - log.info("开始处理特殊图片,一共{}条数据", constructionUserList.size()); - List list1 = constructionUserList.stream().map(ConstructionUserNew::getGoId).toList(); - //zmkgprod - List oldFileList1 = transferDataMapper.getOldFileList1(list1); - // 将 oldFileList1 转换为 Map> 结构 - Map> resultMap1 = oldFileList1.stream() - .collect(Collectors.groupingBy( - OldFile::getUserId, - Collectors.toMap( - OldFile::getUserImgType, - OldFile::getPath, - (existing, replacement) -> replacement // 如果有重复的 key,保留后面的值 - ) - )); - //zmkgc - List oldFileList = transferDataMapper.getOldFileList(list1); - - // 将 oldFileList1 转换为 Map> 结构 - Map> resultMap = oldFileList.stream() - .collect(Collectors.groupingBy( - OldFile::getUserId, - Collectors.toMap( - OldFile::getUserImgType, - OldFile::getPath, - (existing, replacement) -> replacement // 如果有重复的 key,保留后面的值 - ) - )); - //本地文件 - - //身份证(正面),0 - //身份证(反面),1 - //银行卡,2 - //特种作业证,3 - //合同,4 - //体检报告,5 - //安全责任书,6 - //岗位危险告知书,7 - //安全技术交底,8 - //三级安全教育,10 - - for (ConstructionUserNew constructionUser : constructionUserList) { - Long goId = constructionUser.getGoId(); - Map map = resultMap1.get(goId); - if (map != null) { - handle0to3(map, constructionUser); - handle4to10(map, goId); - } - - Map map1 = resultMap.get(goId); - if (map1 != null) { - handle0to3(map1, constructionUser); - handle4to10(map1, goId); - } - } +// List constructionUserList = transferDataMapper.getConstructionUserList(); +// log.info("开始处理特殊图片,一共{}条数据", constructionUserList.size()); +// List list1 = constructionUserList.stream().map(ConstructionUserNew::getGoId).toList(); +// //zmkgprod +// List oldFileList1 = transferDataMapper.getOldFileList1(list1); +// // 将 oldFileList1 转换为 Map> 结构 +// Map> resultMap1 = oldFileList1.stream() +// .collect(Collectors.groupingBy( +// OldFile::getUserId, +// Collectors.toMap( +// OldFile::getUserImgType, +// OldFile::getPath, +// (existing, replacement) -> replacement // 如果有重复的 key,保留后面的值 +// ) +// )); +// //zmkgc +// List oldFileList = transferDataMapper.getOldFileList(list1); +// +// // 将 oldFileList1 转换为 Map> 结构 +// Map> resultMap = oldFileList.stream() +// .collect(Collectors.groupingBy( +// OldFile::getUserId, +// Collectors.toMap( +// OldFile::getUserImgType, +// OldFile::getPath, +// (existing, replacement) -> replacement // 如果有重复的 key,保留后面的值 +// ) +// )); +// //本地文件 +// +// //身份证(正面),0 +// //身份证(反面),1 +// //银行卡,2 +// //特种作业证,3 +// //合同,4 +// //体检报告,5 +// //安全责任书,6 +// //岗位危险告知书,7 +// //安全技术交底,8 +// //三级安全教育,10 +// +// for (ConstructionUserNew constructionUser : constructionUserList) { +// log.info("处理特殊图片,goId={}", constructionUser.getGoId()); +// Long goId = constructionUser.getGoId(); +// Map map = resultMap1.get(goId); +// if (map != null) { +// handle0to3(map, constructionUser); +// handle4to10(map, goId); +// } +// +// Map map1 = resultMap.get(goId); +// if (map1 != null) { +// handle0to3(map1, constructionUser); +// handle4to10(map1, goId); +// } +// } } @@ -426,6 +431,7 @@ public class TransferDataService { SubConstructionUser constructionUser1 = BeanUtil.copyProperties(constructionUser, SubConstructionUser.class); log.info("开始修改数据,id:{}", constructionUser1.getId()); + log.info("修改施工人员数据,Id={}", constructionUser1.getId()); constructionUserService.updateById(constructionUser1); } @@ -450,6 +456,7 @@ public class TransferDataService { } } // log.info("开始修改附件,数量:{}", list1.size()); + log.info("修改附件数据,数量={}", list1.size()); constructionUserFileService.updateBatchById(list1); }