This commit is contained in:
2026-04-15 14:25:40 +08:00
parent 5f1ed92d9f
commit 7be45635cf
2 changed files with 19 additions and 12 deletions
@@ -287,10 +287,17 @@ public class HealthCheckupListController {
excel.setErrInfo("无此用户", i + 1); excel.setErrInfo("无此用户", i + 1);
continue; continue;
} }
String projectName = checkupProject.getName();
if(projectName.contains("在职教职工")) {
projectName = "在职教职工";
}
if(projectName.contains("校聘高知")) {
projectName = "校聘高知";
}
if (healthCheckupUserList.stream().anyMatch(s -> s.getUserId().equals(user.getId()))) { if (healthCheckupUserList.stream().anyMatch(s -> s.getUserId().equals(user.getId()))) {
dao.update( dao.update(
HealthCheckupUser.class, HealthCheckupUser.class,
Chain.make("phone",excel.getPhone()), Chain.make("phone",excel.getPhone()).add("personType",projectName),
Cnd.NEW().and(HealthCheckupUser::getUserId,"=",user.getId()) Cnd.NEW().and(HealthCheckupUser::getUserId,"=",user.getId())
.and(HealthCheckupUser::getProjectId, "=", healthProjectId) .and(HealthCheckupUser::getProjectId, "=", healthProjectId)
); );
@@ -314,7 +321,7 @@ public class HealthCheckupListController {
newHealthUser.setCard(user.getIdCard()); newHealthUser.setCard(user.getIdCard());
newHealthUser.setPhone(excel.getPhone()); newHealthUser.setPhone(excel.getPhone());
newHealthUser.setMarriage(user.getMarriage()); newHealthUser.setMarriage(user.getMarriage());
newHealthUser.setPersonType(user.getPersonType()); newHealthUser.setPersonType(projectName);
healthCheckupUsersToAdd.add(newHealthUser); healthCheckupUsersToAdd.add(newHealthUser);
successCount++; successCount++;
} }
@@ -97,16 +97,16 @@ public class HealthCheckupProjectServiceImpl extends BaseServiceImpl<HealthCheck
dao().clear(HealthCheckupUserCompanion.class, Cnd.where("userSelectionId", "in", userSelectionIds)); dao().clear(HealthCheckupUserCompanion.class, Cnd.where("userSelectionId", "in", userSelectionIds));
manyAddOrRenewUtil.asyncExecuteFastInsert(needInsertSelectionUsers, null); manyAddOrRenewUtil.asyncExecuteFastInsert(needInsertSelectionUsers, null);
Sql updateSql = Sqls.create(""" // Sql updateSql = Sqls.create("""
update health_checkup_user cu // update health_checkup_user cu
left join health_checkup_project p on cu.projectId=p.id // left join health_checkup_project p on cu.projectId=p.id
left join sys_user u on cu.userId=u.id // left join sys_user u on cu.userId=u.id
set cu.phone=if(cu.phone is null,u.mobile,cu.phone),cu.card=u.idCard,cu.marriage=u.marriage // set cu.phone=if(cu.phone is null,u.mobile,cu.phone),cu.card=u.idCard,cu.marriage=u.marriage
,cu.personType=(case when p.name like '%在职教职工%' then '在职教职工' when p.name like '%校聘高知%' then '校聘高知保健对象' else '' end) // ,cu.personType=(case when p.name like '%在职教职工%' then '在职教职工' when p.name like '%校聘高知%' then '校聘高知保健对象' else '' end)
where cu.projectId=@projectId2 and cu.confirmStatus!='1' // where cu.projectId=@projectId2 and cu.confirmStatus!='1'
"""); // """);
updateSql.setParam("projectId2", healthCheckupProject.getId()); // updateSql.setParam("projectId2", healthCheckupProject.getId());
dao().execute(updateSql); // dao().execute(updateSql);
} }