bug调整>体检管理移动端:
1:上年度体检医院显示不出来 2:人员类型改成人员类别
This commit is contained in:
+1
-1
@@ -272,7 +272,7 @@ public class H5HealthCheckupController {
|
||||
Sql sql = Sqls.create("""
|
||||
select cu.id,cu.projectId,cu.userId,cu.userName,cu.sex,
|
||||
cu.loginName,cu.phone,cu.card,cu.marriage,
|
||||
u.personType
|
||||
cu.personType
|
||||
from health_checkup_user cu
|
||||
left join sys_user u on cu.userId=u.id
|
||||
$condition
|
||||
|
||||
+23
-27
@@ -99,8 +99,10 @@ public class HealthCheckupProjectServiceImpl extends BaseServiceImpl<HealthCheck
|
||||
manyAddOrRenewUtil.asyncExecuteFastInsert(needInsertSelectionUsers, null);
|
||||
Sql updateSql = Sqls.create("""
|
||||
update health_checkup_user cu
|
||||
left join sys_user u on cu.userId=u.id\s
|
||||
set cu.phone=u.mobile,cu.card=u.idCard,cu.marriage=u.marriage,cu.personType=u.personType
|
||||
left join health_checkup_project p on cu.projectId=p.id
|
||||
left join sys_user u on cu.userId=u.id
|
||||
set cu.phone=u.mobile,cu.card=u.idCard,cu.marriage=u.marriage
|
||||
,cu.personType=(case when p.name like '%在职教职工%' then '在职教职工' when p.name like '%校聘高知%' then '校聘高知保健对象' else '' end)
|
||||
where cu.projectId=@projectId2 and cu.confirmStatus!='1'
|
||||
""");
|
||||
updateSql.setParam("projectId2", healthCheckupProject.getId());
|
||||
@@ -135,31 +137,25 @@ public class HealthCheckupProjectServiceImpl extends BaseServiceImpl<HealthCheck
|
||||
* @return
|
||||
*/
|
||||
public String findLastYearHospital(HealthCheckupUserSelection healthCheckupUserSelection){
|
||||
Cnd cndSelection = Cnd.NEW();
|
||||
cndSelection.and("selectUserId","=",healthCheckupUserSelection.getSelectUserId());
|
||||
cndSelection.and("projectId","=",healthCheckupUserSelection.getProjectId());
|
||||
List<HealthCheckupUserSelection> checkupUserSelections = dao().query(HealthCheckupUserSelection.class, cndSelection);
|
||||
if(CollectionUtil.isNotEmpty(checkupUserSelections)){
|
||||
Date selectTime = checkupUserSelections.get(0).getSelectTime();
|
||||
if(ObjectUtil.isNotEmpty(selectTime)){
|
||||
Calendar instance = Calendar.getInstance();
|
||||
instance.setTime(selectTime);
|
||||
int year = instance.get(Calendar.YEAR);
|
||||
LocalDate start = LocalDate.of(year - 1, 1, 1);
|
||||
LocalDate end = LocalDate.of(year - 1, 12, 31);
|
||||
Cnd lastYearCndSelection = Cnd.NEW();
|
||||
lastYearCndSelection.and("selectUserId","=",healthCheckupUserSelection.getSelectUserId());
|
||||
lastYearCndSelection.and("selectTime", ">=", start.toString()).and("selectTime", "<=", end.toString());
|
||||
lastYearCndSelection.where().andNotIsNull("selectTime");
|
||||
lastYearCndSelection.desc("selectTime");
|
||||
List<HealthCheckupUserSelection> lastYearSelections = dao().query(HealthCheckupUserSelection.class, lastYearCndSelection);
|
||||
if(CollectionUtil.isNotEmpty(lastYearSelections)) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("id","=",lastYearSelections.get(0).getSubjectId());
|
||||
HealthCheckupProjectSubject projectSubject = dao().fetch(HealthCheckupProjectSubject.class, cnd);
|
||||
if(ObjectUtil.isNotEmpty(projectSubject)) {
|
||||
return projectSubject.getOptionName();
|
||||
}
|
||||
Date selectTime = new Date();
|
||||
if(ObjectUtil.isNotEmpty(selectTime)) {
|
||||
Calendar instance = Calendar.getInstance();
|
||||
instance.setTime(selectTime);
|
||||
int year = instance.get(Calendar.YEAR);
|
||||
LocalDate start = LocalDate.of(year - 1, 1, 1);
|
||||
LocalDate end = LocalDate.of(year - 1, 12, 31);
|
||||
Cnd lastYearCndSelection = Cnd.NEW();
|
||||
lastYearCndSelection.and("selectUserId","=",healthCheckupUserSelection.getSelectUserId());
|
||||
lastYearCndSelection.and("selectTime", ">=", start.toString()).and("selectTime", "<=", end.toString());
|
||||
lastYearCndSelection.where().andNotIsNull("selectTime");
|
||||
lastYearCndSelection.desc("selectTime");
|
||||
List<HealthCheckupUserSelection> lastYearSelections = dao().query(HealthCheckupUserSelection.class, lastYearCndSelection);
|
||||
if(CollectionUtil.isNotEmpty(lastYearSelections)) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("id","=",lastYearSelections.get(0).getSubjectId());
|
||||
HealthCheckupProjectSubject projectSubject = dao().fetch(HealthCheckupProjectSubject.class, cnd);
|
||||
if(ObjectUtil.isNotEmpty(projectSubject)) {
|
||||
return projectSubject.getOptionName();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user