Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
zt
2025-09-20 20:08:02 +08:00
5 changed files with 103 additions and 75 deletions

View File

@ -39,6 +39,8 @@ public interface IHseSafetyInspectionService extends IService<HseSafetyInspectio
*/
TableDataInfo<HseSafetyInspectionVo> queryPageList(HseSafetyInspectionQueryReq req, PageQuery pageQuery);
TableDataInfo<HseSafetyInspectionVo> queryPageListWeb(HseSafetyInspectionQueryReq req, PageQuery pageQuery);
/**
* 查询符合条件的安全巡检工单列表
*

View File

@ -142,6 +142,24 @@ public class HseSafetyInspectionServiceImpl extends ServiceImpl<HseSafetyInspect
return TableDataInfo.build(this.getVoPage(result));
}
@Override
public TableDataInfo<HseSafetyInspectionVo> queryPageListWeb(HseSafetyInspectionQueryReq req, PageQuery pageQuery) {
LambdaQueryWrapper<HseSafetyInspection> 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<HseSafetyInspection> result = this.page(pageQuery.build(), lqw);
return TableDataInfo.build(this.getVoPage(result));
}
/**
* 查询符合条件的安全巡检工单列表
*

View File

@ -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<BusAttendance> batchList = new ArrayList<>(arrs);
// 提交异步任务:处理照片 + 批量保存
transferDataService.handlePhotoAndSaveBatch(batchList);
@ -199,7 +199,7 @@ public class TransferDataController {
@GetMapping("/handleFile")
private void handleFile() {
transferDataService.handleFile();
transferDataService.handleFile();
}

View File

@ -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<OldAttendance> getData();
@ -22,7 +23,7 @@ public interface TransferDataMapper {
List<User> 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<BusAttendance> 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<ConstructionUserNew> getConstructionUserList();

View File

@ -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<ConstructionUserNew> constructionUserList = transferDataMapper.getConstructionUserList();
log.info("开始处理特殊图片,一共{}条数据", constructionUserList.size());
List<Long> list1 = constructionUserList.stream().map(ConstructionUserNew::getGoId).toList();
//zmkgprod
List<OldFile> oldFileList1 = transferDataMapper.getOldFileList1(list1);
// 将 oldFileList1 转换为 Map<Long, Map<String, String>> 结构
Map<Long, Map<String, String>> resultMap1 = oldFileList1.stream()
.collect(Collectors.groupingBy(
OldFile::getUserId,
Collectors.toMap(
OldFile::getUserImgType,
OldFile::getPath,
(existing, replacement) -> replacement // 如果有重复的 key保留后面的值
)
));
//zmkgc
List<OldFile> oldFileList = transferDataMapper.getOldFileList(list1);
// 将 oldFileList1 转换为 Map<Long, Map<String, String>> 结构
Map<Long, Map<String, String>> 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<String, String> map = resultMap1.get(goId);
if (map != null) {
handle0to3(map, constructionUser);
handle4to10(map, goId);
}
Map<String, String> map1 = resultMap.get(goId);
if (map1 != null) {
handle0to3(map1, constructionUser);
handle4to10(map1, goId);
}
}
// List<ConstructionUserNew> constructionUserList = transferDataMapper.getConstructionUserList();
// log.info("开始处理特殊图片,一共{}条数据", constructionUserList.size());
// List<Long> list1 = constructionUserList.stream().map(ConstructionUserNew::getGoId).toList();
// //zmkgprod
// List<OldFile> oldFileList1 = transferDataMapper.getOldFileList1(list1);
// // 将 oldFileList1 转换为 Map<Long, Map<String, String>> 结构
// Map<Long, Map<String, String>> resultMap1 = oldFileList1.stream()
// .collect(Collectors.groupingBy(
// OldFile::getUserId,
// Collectors.toMap(
// OldFile::getUserImgType,
// OldFile::getPath,
// (existing, replacement) -> replacement // 如果有重复的 key保留后面的值
// )
// ));
// //zmkgc
// List<OldFile> oldFileList = transferDataMapper.getOldFileList(list1);
//
// // 将 oldFileList1 转换为 Map<Long, Map<String, String>> 结构
// Map<Long, Map<String, String>> 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<String, String> map = resultMap1.get(goId);
// if (map != null) {
// handle0to3(map, constructionUser);
// handle4to10(map, goId);
// }
//
// Map<String, String> 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);
}