体检管理bug调整

This commit is contained in:
2026-04-11 17:46:16 +08:00
parent 91c5d8a446
commit ab7eb2fe3d
21 changed files with 403 additions and 95 deletions
@@ -99,7 +99,8 @@ RoleConstant {
PSYCHOLOGY_DOCTOR("心理咨询师"), PSYCHOLOGY_DOCTOR("心理咨询师"),
LEGAL_DOCTOR("法律顾问"), LEGAL_DOCTOR("法律顾问"),
//体检管理员
HEALTH_ADMIN("体检管理员")
; ;
/** /**
* 避免和枚举类的name冲突 * 避免和枚举类的name冲突
@@ -459,7 +459,7 @@ public class SysUnionController {
public Result listUnion(@Valid String unionId, @Valid String keyWord) { public Result listUnion(@Valid String unionId, @Valid String keyWord) {
Sql sql = Sqls.create("select id,loginname,username,unitName,unionName,sex from vw_user $condition"); Sql sql = Sqls.create("select id,loginname,username,unitName,unionName,sex from vw_user $condition");
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.and(View_user::getUnionId, "=", unionId); cnd.andEX(View_user::getUnionId, "=", unionId);
SqlExpressionGroup seg = new SqlExpressionGroup(); SqlExpressionGroup seg = new SqlExpressionGroup();
seg.orLike(View_user::getLoginname, keyWord, true); seg.orLike(View_user::getLoginname, keyWord, true);
seg.orLike(View_user::getUsername, keyWord, true); seg.orLike(View_user::getUsername, keyWord, true);
@@ -26,7 +26,7 @@ public class Sys_config extends BaseModel implements Serializable {
private String configValue; private String configValue;
@Column @Column
@ColDefine(type = ColType.VARCHAR, width = 255) @ColDefine(type = ColType.TEXT)
private String note; private String note;
} }
@@ -102,7 +102,7 @@ public class SmartBenefitsManageController {
@At @At
@ApiOperation("查询单个活动") @ApiOperation("查询单个活动")
@SaCheckPermission("smartBenefits") @SaCheckPermission("smartbenefits.manage")
public Result findOne(@Param("id") @NotNull String id) { public Result findOne(@Param("id") @NotNull String id) {
NutMap dataMap = smartBenefitsActivityManageService.findOne(id, null, ""); NutMap dataMap = smartBenefitsActivityManageService.findOne(id, null, "");
String activityStartTime = dataMap.getString("activityStartTime"); String activityStartTime = dataMap.getString("activityStartTime");
@@ -2,9 +2,11 @@ package com.budwk.app.zhgh.dayofficework.healthCheckup.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil; import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.budwk.app.base.annotation.SLog; import com.budwk.app.base.annotation.SLog;
@@ -51,6 +53,7 @@ import org.nutz.mvc.upload.UploadAdaptor;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Date; import java.util.Date;
@@ -191,7 +194,7 @@ public class HealthCheckupListController {
@SLog(type = "healthCheckup", tag = "体检管理", msg = "管理员编辑了一条选择记录") @SLog(type = "healthCheckup", tag = "体检管理", msg = "管理员编辑了一条选择记录")
@SaCheckPermission("healthCheckup.list.mange") @SaCheckPermission("healthCheckup.list.mange")
public Result doEditHealthCheckupData(String subjectId, String campus, String projectId, String userId, String bz) { public Result doEditHealthCheckupData(String subjectId, String campus, String projectId, String userId, String bz) {
if(!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name())) { if(!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(),RoleConstant.HEALTH_ADMIN.name())) {
return Result.error("您没有操作此按钮的权限"); return Result.error("您没有操作此按钮的权限");
} }
//查询用户符合哪个套餐 //查询用户符合哪个套餐
@@ -284,12 +287,14 @@ public class HealthCheckupListController {
excel.setErrInfo("无此用户", i + 1); excel.setErrInfo("无此用户", i + 1);
continue; continue;
} }
if (healthCheckupUserList.stream().anyMatch(s -> s.getUserId().equals(user.getId()))) { if (healthCheckupUserList.stream().anyMatch(s -> s.getUserId().equals(user.getId()))) {
excel.setErrInfo("该用户已加入体检名单", i + 1); dao.update(
continue; HealthCheckupUser.class,
} Chain.make("phone",excel.getPhone()),
Cnd.NEW().and(HealthCheckupUser::getUserId,"=",user.getId())
.and(HealthCheckupUser::getProjectId, "=", healthProjectId)
);
} else {
ActivityUserScope s = new ActivityUserScope(); ActivityUserScope s = new ActivityUserScope();
s.setGroupId(userScope.getGroupId()); s.setGroupId(userScope.getGroupId());
s.setGroupName(userScope.getGroupName()); s.setGroupName(userScope.getGroupName());
@@ -307,13 +312,13 @@ public class HealthCheckupListController {
newHealthUser.setUnionId(user.getUnionId()); newHealthUser.setUnionId(user.getUnionId());
newHealthUser.setUnitName(user.getUnitName()); newHealthUser.setUnitName(user.getUnitName());
newHealthUser.setCard(user.getIdCard()); newHealthUser.setCard(user.getIdCard());
newHealthUser.setPhone(user.getMobile()); newHealthUser.setPhone(excel.getPhone());
newHealthUser.setMarriage(user.getMarriage()); newHealthUser.setMarriage(user.getMarriage());
newHealthUser.setPersonType(user.getPersonType()); newHealthUser.setPersonType(user.getPersonType());
healthCheckupUsersToAdd.add(newHealthUser); healthCheckupUsersToAdd.add(newHealthUser);
successCount++; successCount++;
} }
}
dao.insert(userScopeList); dao.insert(userScopeList);
@@ -338,6 +343,7 @@ public class HealthCheckupListController {
List<ExcelExportEntity> entities = new ArrayList<>(); List<ExcelExportEntity> entities = new ArrayList<>();
entities.add(new ExcelExportEntity("工号", "loginName", 20)); entities.add(new ExcelExportEntity("工号", "loginName", 20));
entities.add(new ExcelExportEntity("姓名", "userName", 20)); entities.add(new ExcelExportEntity("姓名", "userName", 20));
entities.add(new ExcelExportEntity("手机号", "phone", 20));
ExportParams exportParams = new ExportParams(); ExportParams exportParams = new ExportParams();
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, Collections.emptyList()); Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, Collections.emptyList());
CommonDownloadUtil.download("参加人员导入模版.xlsx", workbook, response); CommonDownloadUtil.download("参加人员导入模版.xlsx", workbook, response);
@@ -433,4 +439,131 @@ public class HealthCheckupListController {
Cnd.NEW().and("projectId","=",projectId)) Cnd.NEW().and("projectId","=",projectId))
); );
} }
@At
@ApiOperation("体检名单编辑备注")
@SLog(type = "healthCheckup", tag = "体检管理", msg = "编辑备注")
@SaCheckPermission("healthCheckup.list.mange")
public Result doEditRemarks(String userId, String projectId,String remarks) {
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.BRANCH_UNION_ADMIN.name(), RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
return Result.error("您没有操作此按钮的权限");
}
dao.update(HealthCheckupUserSelection.class,
Chain.make("bz", remarks),
Cnd.where("selectUserId", "=", userId)
.and("projectId", "=", projectId));
return Result.success();
}
@At
@Ok("void")
@ApiOperation("导出")
@SaCheckPermission("healthCheckup.list.mange")
public void exportHealthUser(String projectId,
String unionId,
String searchKeyword,
String subjectId,
String unitId,
String physicalExaminationStatus,
String pageOrderName,
String pageOrderBy,
HttpServletResponse response) {
List<HealthCheckupUnionConfirm> confirms = dao.query(HealthCheckupUnionConfirm.class, Cnd.where("projectId", "=", projectId));
HealthCheckupProject project = healthCheckupProjectService.findOne(projectId);
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
hcu.id AS headId,
hcu.userId AS id,
hcu.loginName,
hcu.userName,
hcu.sex,
hcu.unionId,
hcu.unionName,
hcu.unitName,
hcus.selectTime,
hcus.campus,
hcus.subjectId,
hcus.bz,
hcus.receiveAddress,
ca.campusName
FROM health_checkup_user hcu
LEFT JOIN health_checkup_user_selection hcus ON hcu.userId = hcus.selectUserId
AND hcus.projectId=@projectId
LEFT JOIN health_checkup_campus ca on ca.id=hcus.campus
$condition
""").setParam("projectId", projectId);
sql.setCondition(cnd);
cnd.andEX("hcu.projectId", "=", projectId);
cnd.andEX("hcu.unionId", "=", unionId);
cnd.andEX("hcu.unitId", "=", unitId);
cnd.andEX("hcus.subjectId", "=", subjectId);
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
cnd.andEX("hcu.unionId", "=", SecurityUtil.getUnionId());
}
//体检状态
if(StringUtils.isNotBlank(physicalExaminationStatus) && !physicalExaminationStatus.equals("2")){
if(physicalExaminationStatus.equals("1")) cnd.where().andNotIsNull("hcus.selectTime");
if(physicalExaminationStatus.equals("0")) cnd.where().andIsNull("hcus.selectTime");
}
if (StrUtil.isNotBlank(searchKeyword)) {
SqlExpressionGroup group = new SqlExpressionGroup();
group.orLike("hcu.userName", searchKeyword);
group.orLike("hcu.loginName", searchKeyword);
cnd.and(group);
}
cnd.groupBy("hcu.userId");
if (StrUtil.isNotBlank(pageOrderName) && Strings.isNotBlank(pageOrderBy)) {
cnd.orderBy(pageOrderName, "ascending".equalsIgnoreCase(pageOrderBy) ? "ASC" : "DESC");
} else {
cnd.desc("hcus.selectTime").asc("hcu.unitId");
}
sql.setCondition(cnd);
List<NutMap> paginationList = healthCheckupProjectService.listMap(sql);
paginationList.forEach(v -> {
if (StrUtil.isNotBlank(v.getString("subjectId"))) {
List<HealthCheckupProjectSubject> subjects = project.getHealthCheckupProjectSubjects();
HealthCheckupProjectSubject subject = subjects.stream().filter(s -> s.getId().equals(v.getString("subjectId"))).findFirst().orElse(null);
v.setv("optionName", subject.getOptionName());
}
if (StrUtil.isNotBlank(v.getString("unionId"))) {
HealthCheckupUnionConfirm confirm = confirms.stream().filter(o -> o.getUnionId().equals(v.getString("unionId"))).findFirst().orElse(null);
v.setv("isAudit", confirm != null && confirm.getIsAudit() ? "已确认" : "未确认");
v.setv("auditTime", confirm != null && ObjectUtil.isNotEmpty(confirm.getAuditTime() )
? new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(confirm.getAuditTime()) : "");
}
});
for (int i = 0; i < paginationList.size(); i++) {
paginationList.get(i).put("index", i + 1);
}
List<ExcelExportEntity> entityList = new ArrayList<>() {{
add(new ExcelExportEntity("序号", "index", 20));
add(new ExcelExportEntity("工号", "loginName", 20));
add(new ExcelExportEntity("姓名", "userName", 20));
add(new ExcelExportEntity("性别", "sex", 20));
add(new ExcelExportEntity("所属工会", "unionName", 20));
add(new ExcelExportEntity("所属单位", "unitName", 20));
add(new ExcelExportEntity("所选套餐", "optionName", 20));
add(new ExcelExportEntity("选择时间", "selectTime", 50));
add(new ExcelExportEntity("是否确认", "isAudit", 50));
add(new ExcelExportEntity("确认时间", "auditTime", 50));
add(new ExcelExportEntity("备注", "bz", 50));
}};
try {
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
exportParams.setTitle("体检名单数据导出");
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, paginationList);
CommonDownloadUtil.download("体检名单数据导出.xlsx", workbook, response);
} catch (Exception e) {
e.printStackTrace();
}
}
} }
@@ -2,11 +2,14 @@ package com.budwk.app.zhgh.dayofficework.healthCheckup.controller;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.annotation.SLog; import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.param.PageForm; import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result; import com.budwk.app.base.result.Result;
import com.budwk.app.sys.models.Sys_home_activity;
import com.budwk.app.sys.models.Sys_union; import com.budwk.app.sys.models.Sys_union;
import com.budwk.app.zhgh.activity.culture.service.ActivityCultureService;
import com.budwk.app.zhgh.dayofficework.healthCheckup.model.*; import com.budwk.app.zhgh.dayofficework.healthCheckup.model.*;
import com.budwk.app.zhgh.dayofficework.healthCheckup.service.HealthCheckupProjectService; import com.budwk.app.zhgh.dayofficework.healthCheckup.service.HealthCheckupProjectService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@@ -43,6 +46,8 @@ public class HealthCheckupProjectMangeController {
@Inject @Inject
private HealthCheckupProjectService healthCheckupProjectService; private HealthCheckupProjectService healthCheckupProjectService;
@Inject
private ActivityCultureService activityCultureService;
@At("") @At("")
@@ -85,7 +90,7 @@ public class HealthCheckupProjectMangeController {
} }
@At @At
@ApiOperation("体检名单确认") @ApiOperation("体检项目确认")
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("healthCheckup.projectMange") @SaCheckPermission("healthCheckup.projectMange")
@SLog(type = "healthCheckup", tag = "体检管理", msg = "提交体检项目") @SLog(type = "healthCheckup", tag = "体检管理", msg = "提交体检项目")
@@ -147,6 +152,13 @@ public class HealthCheckupProjectMangeController {
confirmList.add(c); confirmList.add(c);
}); });
healthCheckupProjectService.dao().insert(confirmList); healthCheckupProjectService.dao().insert(confirmList);
Sys_home_activity sysHomeActivity = activityCultureService.dao().fetch(Sys_home_activity.class, Cnd.where("id", "=", healthCheckupProject.getId()));
if(ObjectUtil.isNotEmpty(sysHomeActivity)){
activityCultureService.dao().clear(Sys_home_activity.class, Cnd.where(Sys_home_activity::getId, "=", sysHomeActivity.getId()));
}
activityCultureService.insertOrUpdate(healthCheckupProject.covertToSysHomeActivity());
return Result.success(); return Result.success();
} }
@@ -166,6 +178,7 @@ public class HealthCheckupProjectMangeController {
healthCheckupProjectService.delete(id); healthCheckupProjectService.delete(id);
healthCheckupProjectService.dao().clear(HealthCheckupProjectSubject.class, Cnd.where("projectId", "=", id)); healthCheckupProjectService.dao().clear(HealthCheckupProjectSubject.class, Cnd.where("projectId", "=", id));
healthCheckupProjectService.dao().clear(HealthCheckupProjectSubjectMoney.class, Cnd.where("projectId", "=", id)); healthCheckupProjectService.dao().clear(HealthCheckupProjectSubjectMoney.class, Cnd.where("projectId", "=", id));
activityCultureService.dao().clear(Sys_home_activity.class, Cnd.where(Sys_home_activity::getId, "=", id));
return Result.success(); return Result.success();
} }
@@ -297,7 +297,7 @@ public class HealthCheckupSingleController {
@At @At
@ApiOperation("管理员一键选择去年数据") @ApiOperation("按上年补齐未选人员")
@Ok("json:full") @Ok("json:full")
@SaCheckPermission("healthCheckup.statisticsSingle") @SaCheckPermission("healthCheckup.statisticsSingle")
@SLog(type = "healthCheckup", tag = "体检管理", msg = "管理员给没选的人统一选择去年的数据") @SLog(type = "healthCheckup", tag = "体检管理", msg = "管理员给没选的人统一选择去年的数据")
@@ -339,6 +339,8 @@ public class HealthCheckupSingleController {
//今年项目下的医院 //今年项目下的医院
List<HealthCheckupProjectSubject> thisYearSubjectList = dao.query(HealthCheckupProjectSubject.class, List<HealthCheckupProjectSubject> thisYearSubjectList = dao.query(HealthCheckupProjectSubject.class,
Cnd.where(HealthCheckupProjectSubject::getProjectId, "=", projectId)); Cnd.where(HealthCheckupProjectSubject::getProjectId, "=", projectId));
List<HealthCheckupProjectSubjectMoney> thisYearSubjectMoneyList = dao.query(HealthCheckupProjectSubjectMoney.class,
Cnd.where(HealthCheckupProjectSubject::getProjectId, "=", projectId));
List<HealthCheckupUserSelection> selections = new ArrayList<>(); List<HealthCheckupUserSelection> selections = new ArrayList<>();
userIds.forEach(v -> { userIds.forEach(v -> {
@@ -378,6 +380,43 @@ public class HealthCheckupSingleController {
selections.add(selection); selections.add(selection);
} }
} }
} else {
//若去年未体检,则去本年校医院体检
HealthCheckupProjectSubject thisYearProjectSubject = thisYearSubjectList.stream()
.filter(e -> e.getOptionName().contains("校医院"))
.findFirst()
.orElse(null);
if(ObjectUtil.isNotEmpty(thisYearProjectSubject)) {
List<HealthCheckupProjectSubjectMoney> healthCheckupProjectSubjectMonies = thisYearSubjectMoneyList.stream()
.filter(e -> e.getSubjectId().equals(thisYearProjectSubject.getId()))
.collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(healthCheckupProjectSubjectMonies)){
BigDecimal money = BigDecimal.valueOf(0.00);
String subjectMoneyId = null;
for (HealthCheckupProjectSubjectMoney subject : healthCheckupProjectSubjectMonies) {
//找出这个人符合哪个项目
Cnd cndUser = Cnd.where("id", "=", v);
ConditionGroupUtil.applyConditionGroup(cndUser, subject.getMatchCnd());
int count = dao.count(View_user.class, cndUser);
if (count > 0) {
money = subject.getMoney();
subjectMoneyId = subject.getId();
break;
}
}
//如果有符合的就添加
if (subjectMoneyId != null) {
HealthCheckupUserSelection selection = new HealthCheckupUserSelection();
selection.setProjectId(projectId);
selection.setSelectUserId(v);
selection.setSubjectId(thisYearProjectSubject.getId());
selection.setSubjectMoneyId(subjectMoneyId);
selection.setMoney(money);
selection.setSelectTime(new Date());
selections.add(selection);
}
}
}
} }
}); });
dao.insert(selections); dao.insert(selections);
@@ -131,14 +131,15 @@ public class H5HealthCheckupController {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.and("us.selectUserId", "=", SecurityUtil.getUserId()); cnd.and("us.selectUserId", "=", SecurityUtil.getUserId());
cnd.andEX("us.projectId", "=", projectId); cnd.andEX("us.projectId", "=", projectId);
cnd.orderBy("us.selectTime","desc");
// 根据 status 参数筛选进行中或已结束的项目 // 根据 status 参数筛选进行中或已结束的项目
if ("ongoing".equals(status)) { // if ("ongoing".equals(status)) {
// 进行中的项目:结束时间大于等于当前时间 // // 进行中的项目:结束时间大于等于当前时间
cnd.and("p.choiceTimeEnd", ">=", DateUtil.now()); // cnd.and("p.choiceTimeEnd", ">=", DateUtil.now());
} else if ("finished".equals(status)) { // } else if ("finished".equals(status)) {
// 已结束的项目:结束时间小于当前时间 // // 已结束的项目:结束时间小于当前时间
cnd.and("p.choiceTimeEnd", "<", DateUtil.now()); // cnd.and("p.choiceTimeEnd", "<", DateUtil.now());
} // }
sql.setCondition(cnd); sql.setCondition(cnd);
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success(pagination); return Result.success(pagination);
@@ -2,10 +2,13 @@ package com.budwk.app.zhgh.dayofficework.healthCheckup.model;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import com.budwk.app.base.model.BaseModel; import com.budwk.app.base.model.BaseModel;
import com.budwk.app.sys.models.Sys_home_activity;
import com.budwk.app.sys.services.SysHomeConvert;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*; import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert; import org.nutz.dao.interceptor.annotation.PrevInsert;
import org.nutz.lang.Lang;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
@@ -22,7 +25,7 @@ import java.util.List;
@Table("health_checkup_project") @Table("health_checkup_project")
@TableMeta("{'mysql-charset':'utf8mb4'}") @TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("体检项目表") @Comment("体检项目表")
public class HealthCheckupProject extends BaseModel implements Serializable { public class HealthCheckupProject extends BaseModel implements Serializable, SysHomeConvert {
@Column @Column
@Name @Name
@@ -80,4 +83,20 @@ public class HealthCheckupProject extends BaseModel implements Serializable {
@Many(field = "projectId") @Many(field = "projectId")
private List<HealthCheckupProjectSubject> healthCheckupProjectSubjects; private List<HealthCheckupProjectSubject> healthCheckupProjectSubjects;
@Override
public Sys_home_activity covertToSysHomeActivity() {
Sys_home_activity sysHomeActivity = new Sys_home_activity();
sysHomeActivity.setId(this.getId());
sysHomeActivity.setName(this.getName());
sysHomeActivity.setCover(this.getCover());
sysHomeActivity.setH5Url("/platform/healthCheckup/h5/list?id=" + this.getId());
if (Lang.isNotEmpty(this.getChoiceTimeStart())) {
sysHomeActivity.setStartDate(this.getChoiceTimeStart());
sysHomeActivity.setEndDate(this.getChoiceTimeEnd());
}
sysHomeActivity.setEnable(true);
sysHomeActivity.setAllowUserSql("select userId from health_checkup_user where projectId = '" + this.getId() + "' and userId = @userId");
sysHomeActivity.setClassPath(this.getClass().getPackageName() + this.getClass().getName());
return sysHomeActivity;
}
} }
@@ -24,9 +24,8 @@ import org.nutz.lang.Strings;
import org.nutz.lang.random.R; import org.nutz.lang.random.R;
import org.nutz.lang.util.NutMap; import org.nutz.lang.util.NutMap;
import java.util.ArrayList; import java.time.LocalDate;
import java.util.List; import java.util.*;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@@ -138,17 +137,32 @@ public class HealthCheckupProjectServiceImpl extends BaseServiceImpl<HealthCheck
public String findLastYearHospital(HealthCheckupUserSelection healthCheckupUserSelection){ public String findLastYearHospital(HealthCheckupUserSelection healthCheckupUserSelection){
Cnd cndSelection = Cnd.NEW(); Cnd cndSelection = Cnd.NEW();
cndSelection.and("selectUserId","=",healthCheckupUserSelection.getSelectUserId()); cndSelection.and("selectUserId","=",healthCheckupUserSelection.getSelectUserId());
cndSelection.where().andNotIsNull("selectTime"); cndSelection.and("projectId","=",healthCheckupUserSelection.getProjectId());
cndSelection.desc("selectTime");
List<HealthCheckupUserSelection> checkupUserSelections = dao().query(HealthCheckupUserSelection.class, cndSelection); List<HealthCheckupUserSelection> checkupUserSelections = dao().query(HealthCheckupUserSelection.class, cndSelection);
if(CollectionUtil.isNotEmpty(checkupUserSelections)) { 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 cnd = Cnd.NEW();
cnd.and("id","=",checkupUserSelections.get(0).getSubjectId()); cnd.and("id","=",lastYearSelections.get(0).getSubjectId());
HealthCheckupProjectSubject projectSubject = dao().fetch(HealthCheckupProjectSubject.class, cnd); HealthCheckupProjectSubject projectSubject = dao().fetch(HealthCheckupProjectSubject.class, cnd);
if(ObjectUtil.isNotEmpty(projectSubject)) { if(ObjectUtil.isNotEmpty(projectSubject)) {
return projectSubject.getOptionName(); return projectSubject.getOptionName();
} }
} }
}
}
return null; return null;
} }
} }
@@ -213,13 +213,13 @@ public class HealthCheckupSingleServiceImpl extends BaseServiceImpl<HealthChecku
u.username AS userName, u.username AS userName,
u.sex, u.sex,
u.birthday, u.birthday,
u.personType, hcu.personType,
u.unitName, u.unitName,
u.unitCode, u.unitCode,
u.marriage, hcu.marriage,
u.unionName, hcu.unionName,
u.idCard, hcu.phone as mobile,
u.mobile, hcu.card as idCard,
hcps.optionName subjectName, hcps.optionName subjectName,
hcc.campusName, hcc.campusName,
hcpsm.money, hcpsm.money,
@@ -235,9 +235,6 @@ public class HealthCheckupSingleServiceImpl extends BaseServiceImpl<HealthChecku
AND hcus.selectUserId = u.id AND hcus.selectUserId = u.id
) optionName, ) optionName,
concat(u.address,',',u.linkMan,',',u.contactNumber) receiveAddress, concat(u.address,',',u.linkMan,',',u.contactNumber) receiveAddress,
u.unionName,
u.mobile,
u.personType,
hcp.name projectName hcp.name projectName
FROM FROM
`health_checkup_user_selection` hcus `health_checkup_user_selection` hcus
@@ -22,6 +22,9 @@ public class HealthCheckupImportTemp extends ExcelImportError {
@ExcelProperty("姓名") @ExcelProperty("姓名")
private String userName; private String userName;
@ExcelProperty("手机号")
private String phone;
@ExcelProperty("体检报告") @ExcelProperty("体检报告")
private String medicalExamination; private String medicalExamination;
@@ -82,6 +82,9 @@ layout("/layouts/platform.html"){
<el-button type="primary" size="small" @click="openImportMedicalExaminationReport" <el-button type="primary" size="small" @click="openImportMedicalExaminationReport"
v-if="$auth.hasPermissionOr(['healthCheckup.list.import.medicalExamination'])">导入体检报告 v-if="$auth.hasPermissionOr(['healthCheckup.list.import.medicalExamination'])">导入体检报告
</el-button> </el-button>
<el-button type="primary" size="small" @click="exportData"
v-if="$auth.hasRoleOr(['SYSADMIN','BRANCH_UNION_ADMIN','BRANCH_UNION_CHAIRMAN'])">导出
</el-button>
<el-button :disabled="!pageForm.projectId" type="primary" size="small" <el-button :disabled="!pageForm.projectId" type="primary" size="small"
@click="doAudit(true)">确认名单 @click="doAudit(true)">确认名单
</el-button> </el-button>
@@ -133,11 +136,16 @@ layout("/layouts/platform.html"){
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center" <el-table-column prop="userOnline" align="center" header-align="center"
label="操作" width="160px" label="操作" width="250px"
fixed="right"> fixed="right">
<template slot-scope="{row}"> <template slot-scope="{row}">
<el-button @click="openEditRemarks(row)" size="mini"
v-if="$auth.hasRoleOr(['SYSADMIN','BRANCH_UNION_ADMIN','BRANCH_UNION_CHAIRMAN'])"
type="primary">
编辑备注
</el-button>
<el-button @click="openEditHealthCheckup(row)" size="mini" <el-button @click="openEditHealthCheckup(row)" size="mini"
v-if="$auth.hasRoleOr(['SYSADMIN'])" v-if="$auth.hasRoleOr(['SYSADMIN','HEALTH_ADMIN'])"
type="primary"> type="primary">
编辑 编辑
</el-button> </el-button>
@@ -192,6 +200,19 @@ layout("/layouts/platform.html"){
</el-button> </el-button>
</el-row> </el-row>
</el-dialog> </el-dialog>
<el-dialog title="修改备注" :visible.sync="doEditRemarksDialog" width="50%"
:close-on-click-modal="false">
<el-form label-width="120px" ref="editRemarksForm" :model="doEditRemarks">
<el-form-item label="备注" prop="bz">
<el-input v-model="doEditRemarks.remarks" type="textarea" rows="5"
placeholder="请输入备注"></el-input>
</el-form-item>
</el-form>
<el-row type="flex" justify="end">
<el-button @click="doEditRemarksDialog=false" type="primary" plain>取消</el-button>
<el-button @click="doEditRemarksFun" type="primary" v-loading="loading">确定</el-button>
</el-row>
</el-dialog>
<excel-import <excel-import
@@ -250,7 +271,12 @@ layout("/layouts/platform.html"){
//导入名单 //导入名单
importVisible: false, importVisible: false,
importVisibleExaminationReport: false, importVisibleExaminationReport: false,
doEditRemarksDialog: false,
doEditRemarks: {
userId: "",
projectId: "",
remarks: "",
},
campusOptions: [], campusOptions: [],
} }
}, },
@@ -419,6 +445,40 @@ layout("/layouts/platform.html"){
} }
} }
}, },
openEditRemarks(row){
this.doEditRemarks.userId = row.id;
this.doEditRemarks.projectId = this.pageForm.projectId;
this.doEditRemarksDialog = true;
},
async doEditRemarksFun(){
this.$refs['editRemarksForm'].validate(async valid => {
if (valid) {
this.loading = true
const resp = await $.post(loc() + "/doEditRemarks", this.doEditRemarks)
this.doEditRemarksDialog=false
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.doSearch()
} else {
this.notifyWarning(resp.msg)
}
this.loading = false
}
})
},
async exportData(){
const {year, searchKeyword, projectId, subjectId, unionId, unitId, physicalExaminationStatus, pageOrderName, pageOrderBy} = this.pageForm
window.open(loc() + '/exportHealthUser?year=' + year +
'&projectId=' + projectId +
'&unionId=' + (unionId ? unionId : '') +
'&searchKeyword=' + (searchKeyword ? searchKeyword : '') +
'&subjectId=' + (subjectId ? subjectId : '') +
'&unitId=' + (unitId ? unitId : '') +
'&physicalExaminationStatus=' + (physicalExaminationStatus ? physicalExaminationStatus : '') +
'&pageOrderName=' + (pageOrderName ? pageOrderName : '') +
'&pageOrderBy=' + (pageOrderBy ? pageOrderBy : '')
)
},
}, },
async created() { async created() {
this.unions = await this.$businessTool.listUnion() this.unions = await this.$businessTool.listUnion()
@@ -426,8 +486,6 @@ layout("/layouts/platform.html"){
await this.yearChange() await this.yearChange()
this.pageData() this.pageData()
await this.queryCampus() await this.queryCampus()
} }
}) })
</script> </script>
@@ -236,7 +236,10 @@ layout("/layouts/platform.html"){
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row justify="end" type="flex"> <el-row>
<span style="color: red; padding-left: 52px;">温馨提示:系统默认选择去年的体检项目,新入职教职工选用本年校医院套餐</span>
</el-row>
<el-row justify="end" type="flex" style="margin-top: 15px">
<el-button @click="selectLastYearProject=false">取消</el-button> <el-button @click="selectLastYearProject=false">取消</el-button>
<el-button @click="selectOptionByLastYear" type="primary" :loading="loading">提交</el-button> <el-button @click="selectOptionByLastYear" type="primary" :loading="loading">提交</el-button>
</el-row> </el-row>
@@ -130,7 +130,7 @@ layout("/layouts/platform.html"){
</el-card> </el-card>
<el-dialog title="费用报销须知" :visible.sync="noticeDialogVisible" v-model="noticeDialogVisible"> <el-dialog title="费用报销须知" :visible.sync="noticeDialogVisible" v-model="noticeDialogVisible">
<div style="max-height: 50vh; overflow-y: auto; white-space: pre-line"> <div style="max-height: 50vh; overflow-y: auto; white-space: pre-line; ">
{{friendlyReminderText}} {{friendlyReminderText}}
</div> </div>
<div slot="footer"> <div slot="footer">
@@ -77,7 +77,7 @@ const applyForm = {
this.$set(this.formData, 'activityId', row.activityId) this.$set(this.formData, 'activityId', row.activityId)
this.$set(this.formData, 'courseId', row.id) this.$set(this.formData, 'courseId', row.id)
this.dynamicColumnsData = courseType ? courseType.trainMobileSignColumnList : [] this.dynamicColumnsData = courseType ? courseType.smartBenefitsMobileSignColumnList : []
this.dynamicColumnsData.forEach((item) => { this.dynamicColumnsData.forEach((item) => {
item.columnValue = this.$store.state.user[item.columnCode] || "" item.columnValue = this.$store.state.user[item.columnCode] || ""
}) })
@@ -62,6 +62,12 @@ layout("/layouts/platform_h5.html"){
<span>去报名</span> <span>去报名</span>
</div> </div>
</template> </template>
<template v-else>
<div class="action-btn" @click="look(row)">
<van-icon name="eye-o" />
<span>查看</span>
</div>
</template>
</template> </template>
</table-list> </table-list>
@@ -132,6 +138,9 @@ layout("/layouts/platform_h5.html"){
// 初始化状态 // 初始化状态
this.$set(this.pageForm, "status", "ongoing") this.$set(this.pageForm, "status", "ongoing")
}, },
look(row) {
this.$pjaxReplace("/platform/healthCheckup/h5/physicalExaminationList?projectId=" + row.id)
}
}, },
created() { created() {
this.initData() this.initData()
@@ -19,7 +19,7 @@ layout("/layouts/platform_h5.html"){
<van-nav-bar @click-left="historyBack" left-arrow left-text="返回" title="报名详情" placeholder <van-nav-bar @click-left="historyBack" left-arrow left-text="返回" title="报名详情" placeholder
fixed></van-nav-bar> fixed></van-nav-bar>
<div style="padding: 15px 20px"> <div style="padding: 15px 20px">
<van-button round type="primary" size="large" color="#0db776" class="buttonClass" @click="userMessage"><van-icon name="user-o" size="27px"/> 基础信息确认</van-button> <van-button round type="primary" size="large" color="#0db776" class="buttonClass" @click="userMessage"><van-icon name="user-o" size="27px"/> 基础信息查询</van-button>
<van-button round type="primary" size="large" color="#2cabdd" class="buttonClass" @click="selectPhysicalExaminationHospital"><van-icon name="records-o" size="27px"/> 选择体检医院</van-button> <van-button round type="primary" size="large" color="#2cabdd" class="buttonClass" @click="selectPhysicalExaminationHospital"><van-icon name="records-o" size="27px"/> 选择体检医院</van-button>
<van-button round type="primary" size="large" color="#eca807" class="buttonClass" @click="minePhysicalExaminationHospital"><van-icon name="idcard" size="27px"/> 我的体检医院</van-button> <van-button round type="primary" size="large" color="#eca807" class="buttonClass" @click="minePhysicalExaminationHospital"><van-icon name="idcard" size="27px"/> 我的体检医院</van-button>
</div> </div>
@@ -88,13 +88,13 @@ layout("/layouts/platform_h5.html"){
let friendlyReminderStatus = sessionStorage.getItem("friendlyReminderStatus"); let friendlyReminderStatus = sessionStorage.getItem("friendlyReminderStatus");
if (friendlyReminderStatus == "0" ) { if (friendlyReminderStatus == "0" ) {
this.show = true; this.show = true;
this.confirmButtonText = '已知(' + this.count + '' this.confirmButtonText = '已知' + this.count + ''
let timer = setInterval(() => { let timer = setInterval(() => {
this.count--; this.count--;
this.confirmButtonText = '已知(' + this.count + '' this.confirmButtonText = '已知' + this.count + ''
if (this.count <= 0) { if (this.count <= 0) {
this.confirmDisabled = false; this.confirmDisabled = false;
this.confirmButtonText = '已知'; this.confirmButtonText = '已知';
clearInterval(timer); clearInterval(timer);
} }
}, 1000); }, 1000);
@@ -44,7 +44,6 @@ layout("/layouts/platform_h5.html"){
pageSize: 10, pageSize: 10,
totalCount: 0, totalCount: 0,
year: "", year: "",
status: "ongoing", // 默认为进行中
name: "", // 添加搜索名称字段 name: "", // 添加搜索名称字段
projectId: "" projectId: ""
}, },
@@ -99,12 +98,11 @@ layout("/layouts/platform_h5.html"){
this.yearList.unshift({value: i, text: i + "年"}) this.yearList.unshift({value: i, text: i + "年"})
} }
this.$set(this.pageForm, "year", this.yearList[0].value) this.$set(this.pageForm, "year", this.yearList[0].value)
// 初始化状态
this.$set(this.pageForm, "status", "ongoing")
this.pageForm.projectId = GetQueryString("projectId"); this.pageForm.projectId = GetQueryString("projectId");
}, },
look() { look(row) {
this.$pjaxReplace("/platform/healthCheckup/h5/physicalExaminationList?projectId=" + this.pageForm.projectId) this.$pjaxReplace("/platform/healthCheckup/h5/physicalExaminationList?projectId=" + row.projectId)
} }
}, },
created() { created() {
@@ -34,7 +34,25 @@ layout("/layouts/platform_h5.html"){
<van-cell title="单位">{{formData.unitName}}</van-cell> <van-cell title="单位">{{formData.unitName}}</van-cell>
</van-cell-group> </van-cell-group>
<van-cell-group title="本年度预约体检医院"> <van-cell-group title="本年度预约体检医院">
<van-cell title="本年度预约体检医院">{{getSelectedOptionName}}</van-cell> <div class="van-card-body">
<van-radio-group v-model="formData.subjectId" class="basic" disabled >
<van-cell-group>
<van-cell
v-for="(item,index) in project.healthCheckupProjectSubjects"
:key="item.id"
:title="(index + 1) + '、' +item.optionName">
<template #label>
<div style="display: flex; justify-content: space-between; margin-left: 8px">
<div @click.stop="viewDesc(item)" style="color: #0e78c5; padding-left: 15px">查看说明</div>
</div>
</template>
<template #right-icon>
<van-radio :name="item.id" ></van-radio>
</template>
</van-cell>
</van-cell-group>
</van-radio-group>
</div>
<van-field <van-field
input-align="right" input-align="right"
readonly readonly
@@ -20,7 +20,7 @@ layout("/layouts/platform_h5.html"){
<van-cell title="性别"> <van-cell title="性别">
<template #right-icon> <template #right-icon>
<van-radio-group v-model="formData.sex" direction="horizontal"> <van-radio-group v-model="formData.sex" direction="horizontal" disabled >
<van-radio name="男"></van-radio> <van-radio name="男"></van-radio>
<van-radio name="女"></van-radio> <van-radio name="女"></van-radio>
</van-radio-group> </van-radio-group>
@@ -31,6 +31,7 @@ layout("/layouts/platform_h5.html"){
input-align="right" input-align="right"
label="手机号码" label="手机号码"
name="phone" name="phone"
readonly
required required
v-model="formData.phone" v-model="formData.phone"
:rules="[{ required: false, message: '手机号码',trigger: ['blur', 'change'] },{ pattern: /^1[3456789]\d{9}$/, message: '输入正确的手机号码'}]"> :rules="[{ required: false, message: '手机号码',trigger: ['blur', 'change'] },{ pattern: /^1[3456789]\d{9}$/, message: '输入正确的手机号码'}]">
@@ -39,6 +40,7 @@ layout("/layouts/platform_h5.html"){
input-align="right" input-align="right"
label="身份证号" label="身份证号"
name="card" name="card"
readonly
required required
placeholder="请联系输入身份证号" placeholder="请联系输入身份证号"
v-model="formData.card" v-model="formData.card"
@@ -47,7 +49,7 @@ layout("/layouts/platform_h5.html"){
<van-cell title="人员类型">{{formData.personType}}</van-cell> <van-cell title="人员类型">{{formData.personType}}</van-cell>
<van-cell title="婚姻状态"> <van-cell title="婚姻状态">
<template #right-icon> <template #right-icon>
<van-radio-group v-model="formData.marriage" direction="horizontal"> <van-radio-group v-model="formData.marriage" direction="horizontal" disabled >
<van-radio name="已婚">已婚</van-radio> <van-radio name="已婚">已婚</van-radio>
<van-radio name="未婚">未婚</van-radio> <van-radio name="未婚">未婚</van-radio>
</van-radio-group> </van-radio-group>
@@ -56,10 +58,10 @@ layout("/layouts/platform_h5.html"){
</van-cell-group> </van-cell-group>
<!-- 按钮区域 --> <!-- 按钮区域 -->
<div class="form-actions"> <div class="form-actions">
<van-button type="primary" <van-button class="buttonClass"
class="buttonClass" @click-left="historyBack"
block block
native-type="submit">提交&修改</van-button> native-type="submit">返回</van-button>
</div> </div>
</van-form> </van-form>
</div> </div>