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

This commit is contained in:
2025-09-29 15:19:59 +08:00
15 changed files with 183 additions and 50 deletions

View File

@ -57,9 +57,9 @@ spring:
lazy: true lazy: true
type: ${spring.datasource.type} type: ${spring.datasource.type}
driverClassName: com.mysql.cj.jdbc.Driver driverClassName: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.110.2:13386/zmkgdev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true url: jdbc:mysql://192.168.110.2:13386/zmkgc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
username: zmkgdev username: zmkgc
password: JhYxREf25AXdy3h8 password: nWKDKRNRT48tFBdh
slave1: slave1:
lazy: true lazy: true
type: ${spring.datasource.type} type: ${spring.datasource.type}
@ -67,6 +67,13 @@ spring:
url: jdbc:mysql://192.168.110.2:13386/zmkgprod?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true url: jdbc:mysql://192.168.110.2:13386/zmkgprod?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
username: zmkgprod username: zmkgprod
password: MaY8nehwWkJriWPm password: MaY8nehwWkJriWPm
slave2:
lazy: true
type: ${spring.datasource.type}
driverClassName: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.110.2:13386/zmkgdev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
username: zmkgdev
password: JhYxREf25AXdy3h8
# oracle: # oracle:
# type: ${spring.datasource.type} # type: ${spring.datasource.type}
# driverClassName: oracle.jdbc.OracleDriver # driverClassName: oracle.jdbc.OracleDriver

View File

@ -13,7 +13,7 @@ import java.util.List;
* @author lilemy * @author lilemy
* @date 2025-09-10 19:32 * @date 2025-09-10 19:32
*/ */
@DS("slave") @DS("slave2")
@Mapper @Mapper
public interface ProjectBigScreenMapper { public interface ProjectBigScreenMapper {

View File

@ -134,4 +134,9 @@ public class DesVolumeCatalogVo implements Serializable {
*/ */
private Long fileCount; private Long fileCount;
/**
* 待提交审核数量
*/
private Long reviewCount;
} }

View File

@ -252,14 +252,15 @@ public class DesVolumeCatalogServiceImpl extends ServiceImpl<DesVolumeCatalogMap
// 判断是否重名 // 判断是否重名
Long count = this.lambdaQuery() Long count = this.lambdaQuery()
.eq(DesVolumeCatalog::getProjectId, oldVolumeCatalog.getProjectId()) .eq(DesVolumeCatalog::getProjectId, oldVolumeCatalog.getProjectId())
.and(lqw -> lqw .eq(DesVolumeCatalog::getVolumeNumber, req.getVolumeNumber())
.eq(DesVolumeCatalog::getVolumeNumber, req.getVolumeNumber()) // .and(lqw -> lqw
.or() // .eq(DesVolumeCatalog::getVolumeNumber, req.getVolumeNumber())
.eq(DesVolumeCatalog::getDocumentName, req.getDocumentName())) // .or()
// .eq(DesVolumeCatalog::getDocumentName, req.getDocumentName()))
.ne(DesVolumeCatalog::getDesign, req.getDesign()) .ne(DesVolumeCatalog::getDesign, req.getDesign())
.count(); .count();
if (count > 0) { if (count > 0) {
throw new ServiceException("卷册目录已存在", HttpStatus.BAD_REQUEST); throw new ServiceException("卷册已存在", HttpStatus.BAD_REQUEST);
} }
// 修改数据 // 修改数据
DesVolumeCatalog volumeCatalog = new DesVolumeCatalog(); DesVolumeCatalog volumeCatalog = new DesVolumeCatalog();
@ -390,6 +391,13 @@ public class DesVolumeCatalogServiceImpl extends ServiceImpl<DesVolumeCatalogMap
fileQueryWrapper.eq(DesVolumeFile::getVolumeCatalogId, desVolumeCatalogVo.getDesign()); fileQueryWrapper.eq(DesVolumeFile::getVolumeCatalogId, desVolumeCatalogVo.getDesign());
List<DesVolumeFile> list = volumeFileService.list(fileQueryWrapper); List<DesVolumeFile> list = volumeFileService.list(fileQueryWrapper);
if (list != null && !list.isEmpty()) { if (list != null && !list.isEmpty()) {
long count = 0;
for (DesVolumeFile file : list) {
if (BusinessStatusEnum.DRAFT.getStatus().equals(file.getAuditStatus())) {
count++;
}
}
desVolumeCatalogVo.setReviewCount(count);
desVolumeCatalogVo.setFileCount((long) list.size()); desVolumeCatalogVo.setFileCount((long) list.size());
} else { } else {
desVolumeCatalogVo.setFileCount(0L); desVolumeCatalogVo.setFileCount(0L);

View File

@ -312,10 +312,10 @@ public class FacPhotovoltaicPanelServiceImpl extends ServiceImpl<FacPhotovoltaic
} }
Long matrixId = matrix.getId();*/ Long matrixId = matrix.getId();*/
// 去掉首字母 (T/G) // 去掉首字母 (T/G)
String withoutPrefix = name.substring(1); String withoutPrefix = name.substring(2);
// 如果包含".",只取第一个"."前的数字 // 如果包含".",只取第一个"."前的数字
int dotIndex = withoutPrefix.indexOf("."); int dotIndex = withoutPrefix.indexOf("#");
if (dotIndex != -1) { if (dotIndex != -1) {
withoutPrefix = withoutPrefix.substring(0, dotIndex); withoutPrefix = withoutPrefix.substring(0, dotIndex);
} }

View File

@ -101,6 +101,11 @@ public class OthYs7Device implements Serializable {
*/ */
private Integer videoEncrypted; private Integer videoEncrypted;
/**
* 设备详情
*/
private String detail;
/** /**
* 备注 * 备注
*/ */

View File

@ -35,6 +35,11 @@ public class OthYs7DeviceUpdateReq implements Serializable {
*/ */
private String deviceVersion; private String deviceVersion;
/**
* 设备详情
*/
private String detail;
/** /**
* 备注 * 备注
*/ */

View File

@ -87,6 +87,11 @@ public class OthYs7DeviceVo implements Serializable {
@ExcelProperty(value = "视频加密(0关闭 1开启)") @ExcelProperty(value = "视频加密(0关闭 1开启)")
private Integer videoEncrypted; private Integer videoEncrypted;
/**
* 设备详情
*/
private String detail;
/** /**
* 备注 * 备注
*/ */

View File

@ -14,7 +14,6 @@ import org.dromara.common.core.utils.ObjectUtils;
import org.dromara.common.core.utils.StringUtils; import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.satoken.utils.LoginHelper;
import org.dromara.manager.ys7manager.Ys7Constant; import org.dromara.manager.ys7manager.Ys7Constant;
import org.dromara.manager.ys7manager.Ys7Manager; import org.dromara.manager.ys7manager.Ys7Manager;
import org.dromara.manager.ys7manager.enums.DeviceOnOffLineEnum; import org.dromara.manager.ys7manager.enums.DeviceOnOffLineEnum;

View File

@ -308,7 +308,6 @@ public class PgsProgressCategoryServiceImpl extends ServiceImpl<PgsProgressCateg
// 取分组中的第一条记录的排序字段作为当前VO的排序值 // 取分组中的第一条记录的排序字段作为当前VO的排序值
List<PgsProgressCategory> value = entry.getValue(); List<PgsProgressCategory> value = entry.getValue();
PgsProgressCategory first = value.getFirst(); PgsProgressCategory first = value.getFirst();
topVo.setId(first.getId());
topVo.setSort(first.getSort()); topVo.setSort(first.getSort());
// 转换为方阵结构的VO列表 // 转换为方阵结构的VO列表
List<PgsProgressCategoryMatrixStructureTopVo> matrixVoList = value.stream().map(category -> { List<PgsProgressCategoryMatrixStructureTopVo> matrixVoList = value.stream().map(category -> {

View File

@ -166,7 +166,7 @@ public class PgsProgressPlanDetailServiceImpl extends ServiceImpl<PgsProgressPla
} }
// 判断当前详情是否已提交 // 判断当前详情是否已提交
if (progressPlanDetail.getStatus().equals("3")) { if (progressPlanDetail.getStatus().equals("3")) {
throw new ServiceException("当前详情已在施工产值中提交,无法提交", HttpStatus.BAD_REQUEST); throw new ServiceException("当前详情已在施工产值中审核完成,无法提交", HttpStatus.BAD_REQUEST);
} }
Long progressPlanId = progressPlanDetail.getProgressPlanId(); Long progressPlanId = progressPlanDetail.getProgressPlanId();
PgsProgressPlan progressPlan = progressPlanService.getById(progressPlanId); PgsProgressPlan progressPlan = progressPlanService.getById(progressPlanId);
@ -174,11 +174,11 @@ public class PgsProgressPlanDetailServiceImpl extends ServiceImpl<PgsProgressPla
throw new ServiceException("进度计划信息不存在", HttpStatus.NOT_FOUND); throw new ServiceException("进度计划信息不存在", HttpStatus.NOT_FOUND);
} }
BigDecimal oldFinishedNumber = progressPlan.getFinishedNumber(); BigDecimal oldFinishedNumber = progressPlan.getFinishedNumber();
// 判断完成时间是否大于当前时间 // todo 判断完成时间是否大于当前时间
LocalDate planDate = progressPlanDetail.getDate(); LocalDate planDate = progressPlanDetail.getDate();
if (planDate.isAfter(LocalDate.now())) { /* if (planDate.isAfter(LocalDate.now())) {
throw new ServiceException("完成时间不能大于当前时间", HttpStatus.BAD_REQUEST); throw new ServiceException("完成时间不能大于当前时间", HttpStatus.BAD_REQUEST);
} }*/
Long projectId = progressPlanDetail.getProjectId(); Long projectId = progressPlanDetail.getProjectId();
Long progressCategoryId = progressPlanDetail.getProgressCategoryId(); Long progressCategoryId = progressPlanDetail.getProgressCategoryId();
PgsProgressCategory progressCategory = progressCategoryService.getById(progressCategoryId); PgsProgressCategory progressCategory = progressCategoryService.getById(progressCategoryId);
@ -361,11 +361,11 @@ public class PgsProgressPlanDetailServiceImpl extends ServiceImpl<PgsProgressPla
if (progressPlanDetail == null) { if (progressPlanDetail == null) {
throw new ServiceException("进度计划详情信息不存在", HttpStatus.NOT_FOUND); throw new ServiceException("进度计划详情信息不存在", HttpStatus.NOT_FOUND);
} }
// 判断完成时间是否大于当前时间 // todo 判断完成时间是否大于当前时间
LocalDate date = progressPlanDetail.getDate(); LocalDate date = progressPlanDetail.getDate();
if (date.isAfter(LocalDate.now())) { /* if (date.isAfter(LocalDate.now())) {
throw new ServiceException("完成时间不能大于当前时间", HttpStatus.BAD_REQUEST); throw new ServiceException("完成时间不能大于当前时间", HttpStatus.BAD_REQUEST);
} }*/
// 判断当前详情是否已提交 // 判断当前详情是否已提交
if (progressPlanDetail.getStatus().equals("3")) { if (progressPlanDetail.getStatus().equals("3")) {
throw new ServiceException("当前详情已在施工产值中提交,无法提交", HttpStatus.BAD_REQUEST); throw new ServiceException("当前详情已在施工产值中提交,无法提交", HttpStatus.BAD_REQUEST);

View File

@ -84,12 +84,12 @@ public class QltQualityConstructionLogVo implements Serializable {
* 创建者 * 创建者
*/ */
@ExcelProperty(value = "创建者") @ExcelProperty(value = "创建者")
private String createBy; private Long createBy;
/** /**
* 创建者名称 * 创建者名称
*/ */
@Translation(type = TransConstant.USER_ID_TO_NICKNAME) @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "createBy")
private String createByName; private String createByName;
/** /**

View File

@ -7,6 +7,7 @@ import lombok.extern.slf4j.Slf4j;
import org.dromara.contractor.domain.SubConstructionUser; import org.dromara.contractor.domain.SubConstructionUser;
import org.dromara.contractor.service.ISubConstructionUserService; import org.dromara.contractor.service.ISubConstructionUserService;
import org.dromara.project.domain.BusAttendanceRule; import org.dromara.project.domain.BusAttendanceRule;
import org.dromara.project.service.IBusAttendanceService;
import org.dromara.system.domain.vo.SysOssVo; import org.dromara.system.domain.vo.SysOssVo;
import org.dromara.transferData.domain.ConstructionUserCopy; import org.dromara.transferData.domain.ConstructionUserCopy;
import org.dromara.transferData.domain.OldAttendance; import org.dromara.transferData.domain.OldAttendance;
@ -48,7 +49,12 @@ public class TransferDataController {
@Resource @Resource
private TransferDataService transferDataService; private TransferDataService transferDataService;
@Resource
private IBusAttendanceService attendanceService;
private static final String slave = "zmkgc";
private static final String slave1 = "zmkgprod";
// 两个候选基础URL // 两个候选基础URL
@ -59,10 +65,16 @@ public class TransferDataController {
@RequestMapping("/transferAttendance") @RequestMapping("/transferAttendance")
public void transferAttendance() { public void transferAttendance(String name) {
List<BusAttendance> arrs = new ArrayList<>(); List<BusAttendance> arrs = new ArrayList<>();
List<OldAttendance> data;
List<OldAttendance> data = transferDataMapper.getData(); if(slave.equals(name)){
data = transferDataMapper.getData0();
}else if(slave1.equals(name)) {
data = transferDataMapper.getData();
}else {
return;
}
List<BusAttendanceRule> list = attendanceRuleService.list(Wrappers.<BusAttendanceRule>lambdaQuery() List<BusAttendanceRule> list = attendanceRuleService.list(Wrappers.<BusAttendanceRule>lambdaQuery()
.in(BusAttendanceRule::getProjectId, Arrays.asList(1897160897167638529L, 1897161054676336641L))); .in(BusAttendanceRule::getProjectId, Arrays.asList(1897160897167638529L, 1897161054676336641L)));
@ -75,16 +87,16 @@ public class TransferDataController {
continue; continue;
} }
LocalDate clockDate = LocalDate.parse(oldAttendance.getPrintingDate()); LocalDate clockDate = LocalDate.parse(oldAttendance.getPrintingDate());
// //判定是否重 //判定是否重
// List<BusAttendance> list = attendanceService.list(Wrappers.lambdaQuery(BusAttendance.class) List<BusAttendance> list1 = attendanceService.list(Wrappers.lambdaQuery(BusAttendance.class)
// .eq(BusAttendance::getUserId, constructionUserCopy.getSysUserId()) .eq(BusAttendance::getUserId, constructionUserCopy.getSysUserId())
// .eq(BusAttendance::getProjectId, constructionUserCopy.getProjectId()) .eq(BusAttendance::getProjectId, constructionUserCopy.getProjectId())
// .eq(BusAttendance::getClockDate, clockDate) .eq(BusAttendance::getClockDate, clockDate)
// .eq(BusAttendance::getClockType, oldAttendance.getCommuter()) .eq(BusAttendance::getClockType, oldAttendance.getCommuter())
// ); );
// if(CollectionUtil.isNotEmpty(list)){ if(CollectionUtil.isNotEmpty(list1)){
// continue; continue;
// } }
BusAttendance busAttendance = new BusAttendance(); BusAttendance busAttendance = new BusAttendance();
@ -162,10 +174,10 @@ public class TransferDataController {
// attendanceService.saveBatch(arrs); // attendanceService.saveBatch(arrs);
// transferDataMapper.saveBatchCopy(arrs); // transferDataMapper.saveBatchCopy(arrs);
//更新施工人员图片 // //更新施工人员图片
transferDataService.renYuan(); // transferDataService.renYuan();
//更新附件图片 // //更新附件图片
transferDataService.renYuanFuJiang(); // transferDataService.renYuanFuJiang();
} }
@ -204,8 +216,8 @@ public class TransferDataController {
@GetMapping("/userTransfer") @GetMapping("/userTransfer")
private void userTransfer() { private void userTransfer(String name) {
transferDataService.userTransfer(); transferDataService.userTransfer(name);
} }

View File

@ -18,10 +18,19 @@ public interface TransferDataMapper {
@Select("select * from bus_attendance where project_id in (59,60)") @Select("select * from bus_attendance where project_id in (59,60)")
List<OldAttendance> getData(); List<OldAttendance> getData();
@DS("slave")
@Select("select * from bus_attendance where project_id in (59,60)")
List<OldAttendance> getData0();
@DS("slave1") @DS("slave1")
@Select("select * from bus_construction_user where project_id in (59,60) and deleted_at is null") @Select("select * from bus_construction_user where project_id in (59,60) and deleted_at is null")
List<User> getUserList(); List<User> getUserList();
@DS("slave")
@Select("select * from bus_construction_user where project_id in (59,60) and deleted_at is null")
List<User> getUserList0();
@Select("select id,sys_user_id,project_id,user_name from sub_construction_user 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); ConstructionUserCopy getConstructionUserCopy(@Param("openId") String openId);
@ -60,6 +69,16 @@ public interface TransferDataMapper {
List<OldFile> getOldFileList1(List<Long> userIds); List<OldFile> getOldFileList1(List<Long> userIds);
@DS("slave") @DS("slave")
@Select("<script>" +
"SELECT * FROM bus_construction_user_file " +
"WHERE user_id IN " +
"<foreach collection='userIds' item='userId' open='(' separator=',' close=')'>" +
"#{userId}" +
"</foreach>" +
"</script>")
List<OldFile> getOldFileList0(List<Long> userIds);
@DS("slave2")
@Select("<script>" + @Select("<script>" +
"SELECT * FROM bus_construction_user_file " + "SELECT * FROM bus_construction_user_file " +
"WHERE user_id IN " + "WHERE user_id IN " +

View File

@ -19,8 +19,12 @@ import org.dromara.contractor.domain.SubConstructionUserFile;
import org.dromara.contractor.service.ISubConstructionUserFileService; import org.dromara.contractor.service.ISubConstructionUserFileService;
import org.dromara.contractor.service.ISubConstructionUserService; import org.dromara.contractor.service.ISubConstructionUserService;
import org.dromara.project.domain.BusAttendance; import org.dromara.project.domain.BusAttendance;
import org.dromara.project.domain.BusProjectTeamMember;
import org.dromara.project.domain.BusUserProjectRelevancy;
import org.dromara.project.service.IBusAttendanceRuleService; import org.dromara.project.service.IBusAttendanceRuleService;
import org.dromara.project.service.IBusAttendanceService; import org.dromara.project.service.IBusAttendanceService;
import org.dromara.project.service.IBusProjectTeamMemberService;
import org.dromara.project.service.IBusUserProjectRelevancyService;
import org.dromara.system.domain.SysUser; import org.dromara.system.domain.SysUser;
import org.dromara.system.domain.vo.SysOssVo; import org.dromara.system.domain.vo.SysOssVo;
import org.dromara.system.domain.vo.SysUserVo; import org.dromara.system.domain.vo.SysUserVo;
@ -83,6 +87,14 @@ public class TransferDataService {
private ISysUserService userService; private ISysUserService userService;
@Resource @Resource
private IdCardEncryptorUtil idCardEncryptorUtil; private IdCardEncryptorUtil idCardEncryptorUtil;
@Resource
private IBusProjectTeamMemberService projectTeamMemberService;
@Resource
private IBusUserProjectRelevancyService relevancyService;
private static final String slave = "zmkgc";
private static final String slave1 = "zmkgprod";
// 两个候选基础URL // 两个候选基础URL
@ -91,6 +103,7 @@ public class TransferDataService {
"http://192.168.110.2:7363" "http://192.168.110.2:7363"
}; };
/** /**
* 异步处理照片并批量保存(修复线程安全 + 性能优化) * 异步处理照片并批量保存(修复线程安全 + 性能优化)
* *
@ -461,8 +474,15 @@ public class TransferDataService {
} }
public void userTransfer() { public void userTransfer(String name) {
List<User> userList = transferDataMapper.getUserList(); List<User> userList;
if(slave.equals(name)){
userList = transferDataMapper.getUserList0();
}else if(slave1.equals(name)) {
userList = transferDataMapper.getUserList();
}else {
return;
}
log.info("开始处理用户数据,数量:{}", userList.size()); log.info("开始处理用户数据,数量:{}", userList.size());
// 设置每批处理的数据量 // 设置每批处理的数据量
@ -482,7 +502,7 @@ public class TransferDataService {
batches.parallelStream().forEach(batch -> { batches.parallelStream().forEach(batch -> {
try { try {
log.info("开始处理批次,数据量:{}", batch.size()); log.info("开始处理批次,数据量:{}", batch.size());
handleUser(batch); handleUser(batch,name);
log.info("批次处理完成"); log.info("批次处理完成");
} catch (Exception e) { } catch (Exception e) {
log.error("处理批次时发生错误,数据量:{}", batch.size(), e); log.error("处理批次时发生错误,数据量:{}", batch.size(), e);
@ -493,10 +513,17 @@ public class TransferDataService {
} }
public void handleUser(List<User> userList) { public void handleUser(List<User> userList,String name) {
//查询附件 //查询附件
List<Long> list1 = userList.stream().map(User::getId).toList(); List<Long> list1 = userList.stream().map(User::getId).toList();
List<OldFile> oldFileList = transferDataMapper.getOldFileList1(list1); List<OldFile> oldFileList;
if(slave.equals(name)){
oldFileList = transferDataMapper.getOldFileList0(list1);
}else if(slave1.equals(name)) {
oldFileList = transferDataMapper.getOldFileList1(list1);
}else {
oldFileList = new ArrayList<>();
}
// 将 oldFileList1 转换为 Map<Long, Map<String, String>> 结构 // 将 oldFileList1 转换为 Map<Long, Map<String, String>> 结构
Map<Long, Map<String, String>> oldFileMap = oldFileList.stream() Map<Long, Map<String, String>> oldFileMap = oldFileList.stream()
@ -510,12 +537,26 @@ public class TransferDataService {
)); ));
ArrayList<SubConstructionUser> userAddList = new ArrayList<>(); ArrayList<SubConstructionUser> userAddList = new ArrayList<>();
List<SubConstructionUserFile> fileAddList = new ArrayList<>(); List<SubConstructionUserFile> fileAddList = new ArrayList<>();
//人员与班组关联
List<BusProjectTeamMember> teamMemberAddList = new ArrayList<>();
//人员与项目关联
List<BusUserProjectRelevancy> relevancyAddList = new ArrayList<>();
for (User user : userList) { for (User user : userList) {
String phone = user.getPhone(); String phone = user.getPhone();
if(StrUtil.isBlank(phone)){ if(StrUtil.isBlank(phone)){
continue; continue;
} }
List<SubConstructionUser> list2 = constructionUserService.list(Wrappers.<SubConstructionUser>lambdaQuery()
.eq(SubConstructionUser::getPhone, user.getPhone())
);
if(CollectionUtil.isNotEmpty(list2)){
continue;
}
//获取sysUserId //获取sysUserId
Long sysUserId; Long sysUserId;
SysUserVo sysUserVo = userService.selectUserByPhonenumber(phone); SysUserVo sysUserVo = userService.selectUserByPhonenumber(phone);
@ -531,16 +572,44 @@ public class TransferDataService {
sysUserId = sysUserVo.getUserId(); sysUserId = sysUserVo.getUserId();
} }
Map<String, String> map = oldFileMap.get(user.getId()); Map<String, String> map = oldFileMap.get(user.getId());
//创建施工人员 //创建施工人员
SubConstructionUser constructUser = createConstructUser(user, sysUserId,map); SubConstructionUser constructUser = createConstructUser(user, sysUserId,map);
userAddList.add(constructUser); userAddList.add(constructUser);
//处理附件 //处理附件
List<SubConstructionUserFile> subConstructionUserFiles = handle4to10ConstructionUser(map, sysUserId, user.getId()); List<SubConstructionUserFile> subConstructionUserFiles = handle4to10ConstructionUser(map, sysUserId, user.getId());
fileAddList.addAll(subConstructionUserFiles); fileAddList.addAll(subConstructionUserFiles);
}
constructionUserService.saveBatch(userAddList);
constructionUserFileService.saveBatch(fileAddList);
//项目关联
if(constructUser.getProjectId() != null){
BusUserProjectRelevancy relevancy = new BusUserProjectRelevancy();
relevancy.setUserId(constructUser.getSysUserId());
relevancy.setProjectId(constructUser.getProjectId());
relevancyAddList.add(relevancy);
}
//班组关联
if(constructUser.getTeamId() != null){
BusProjectTeamMember teamMember = new BusProjectTeamMember();
teamMember.setTeamId(constructUser.getTeamId());
teamMember.setMemberId(constructUser.getSysUserId());
teamMember.setPostId("0");
teamMember.setProjectId(constructUser.getProjectId());
teamMemberAddList.add(teamMember);
}
}
if(CollectionUtil.isNotEmpty(userAddList)){
constructionUserService.saveBatch(userAddList);
}
if(CollectionUtil.isNotEmpty(fileAddList)){
constructionUserFileService.saveBatch(fileAddList);
}
if(CollectionUtil.isNotEmpty(teamMemberAddList)){
projectTeamMemberService.saveBatch(teamMemberAddList);
}
if(CollectionUtil.isNotEmpty(relevancyAddList)){
relevancyService.saveBatch(relevancyAddList);
}
} }
@ -581,7 +650,7 @@ public class TransferDataService {
constructionUser.setEntryDate(stringToDate(user.getEntryDate(), "yyyy-MM-dd HH:mm:ss")); constructionUser.setEntryDate(stringToDate(user.getEntryDate(), "yyyy-MM-dd HH:mm:ss"));
constructionUser.setLeaveDate(stringToDate(user.getLeaveDate(), "yyyy-MM-dd HH:mm:ss")); constructionUser.setLeaveDate(stringToDate(user.getLeaveDate(), "yyyy-MM-dd HH:mm:ss"));
constructionUser.setSalary(user.getSalary()); constructionUser.setSalary(user.getSalary());
constructionUser.setUserRole("1"); constructionUser.setUserRole("0");
constructionUser.setExitStatus(user.getProjectRecord()); constructionUser.setExitStatus(user.getProjectRecord());
constructionUser.setRemark("GoLand"); constructionUser.setRemark("GoLand");
constructionUser.setGoId(user.getId()); constructionUser.setGoId(user.getId());