体检管理需求整改

This commit is contained in:
2026-04-08 11:44:54 +08:00
parent 32ee62edd4
commit 15cdcb02a2
23 changed files with 1326 additions and 97 deletions
@@ -40,4 +40,19 @@ public class Sys_union extends BaseModel {
@Comment("校区")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String campus;
@Column
@Comment("联系人")
@ColDefine(type = ColType.VARCHAR, width = 64)
private String linkMan;
@Column
@Comment("联系电话")
@ColDefine(type = ColType.VARCHAR, width = 11)
private String contactNumber;
@Column
@Comment("地址")
@ColDefine(type = ColType.TEXT)
private String address;
}
@@ -14,6 +14,7 @@ import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.utils.CommonDownloadUtil;
import com.budwk.app.base.utils.ConditionGroupUtil;
import com.budwk.app.base.utils.easyexcel.EasyExcelUtil;
import com.budwk.app.sys.views.View_user;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
@@ -26,6 +27,7 @@ import com.budwk.app.zhgh.dayofficework.healthCheckup.template.HealthCheckupImpo
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.apache.poi.ss.usermodel.Workbook;
import org.nutz.aop.interceptor.ioc.TransAop;
@@ -48,6 +50,7 @@ import org.nutz.mvc.upload.TempFile;
import org.nutz.mvc.upload.UploadAdaptor;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
@@ -82,10 +85,8 @@ public class HealthCheckupListController {
@At
@ApiOperation("分页查询")
@SaCheckPermission("healthCheckup.list.mange")
public Result pageData(PageForm pageForm,
String projectId,
String unionId,
String unitId) {
public Result pageData(PageForm pageForm, String projectId,
String unionId, String unitId,String physicalExaminationStatus) {
List<HealthCheckupUnionConfirm> confirms = dao.query(HealthCheckupUnionConfirm.class, Cnd.where("projectId", "=", projectId));
HealthCheckupProject project = healthCheckupProjectService.findOne(projectId);
@@ -121,6 +122,11 @@ public class HealthCheckupListController {
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(pageForm.getSearchKeyword())) {
SqlExpressionGroup group = new SqlExpressionGroup();
@@ -184,15 +190,34 @@ public class HealthCheckupListController {
@SLog(type = "healthCheckup", tag = "体检管理", msg = "管理员编辑了一条选择记录")
@SaCheckPermission("healthCheckup.list.mange")
public Result doEditHealthCheckupData(String subjectId, String campus, String projectId, String userId, String bz) {
//查询用户符合哪个套餐
List<HealthCheckupProjectSubjectMoney> list = healthCheckupProjectService.dao().query(HealthCheckupProjectSubjectMoney.class,
Cnd.where(HealthCheckupProjectSubjectMoney::getSubjectId, "=", subjectId));
BigDecimal money = BigDecimal.valueOf(0.00);
String subjectMoneyId = "";
for (HealthCheckupProjectSubjectMoney subject : list) {
// 是否满足条件
Cnd cnd = Cnd.where("id", "=", userId);
ConditionGroupUtil.applyConditionGroup(cnd, subject.getMatchCnd());
int count = dao.count(View_user.class, cnd);
if (count > 0) {
money = subject.getMoney();
subjectMoneyId = subject.getId();
break;
}
}
//查询用户有没有选择过套餐
HealthCheckupUserSelection userSelection = healthCheckupProjectService.dao().fetch(HealthCheckupUserSelection.class,
Cnd.where("projectId", "=", projectId).and("selectUserId", "=", userId));
Cnd.where("projectId", "=", projectId)
.and("selectUserId", "=", userId));
//如果选择过套餐就修改选择的套餐id
if (Lang.isNotEmpty(userSelection)) {
userSelection.setSubjectId(subjectId);
userSelection.setCampus(campus);
userSelection.setBz(bz);
userSelection.setSubjectMoneyId(subjectMoneyId);
userSelection.setMoney(money);
healthCheckupProjectService.update(userSelection);
} else {
//如果没有选择过套餐添加一条记录
@@ -203,6 +228,8 @@ public class HealthCheckupListController {
checkupUserSelection.setCampus(campus);
checkupUserSelection.setSelectTime(new Date());
checkupUserSelection.setBz(bz);
checkupUserSelection.setSubjectMoneyId(subjectMoneyId);
checkupUserSelection.setMoney(money);
healthCheckupProjectService.insert(checkupUserSelection);
}
return Result.success();
@@ -321,8 +348,72 @@ public class HealthCheckupListController {
RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
return Result.error("您没有【删除】的权限");
} else {
HealthCheckupUser fetch = dao.fetch(HealthCheckupUser.class, Cnd.where(HealthCheckupUser::getId, "=", id));
Cnd and = Cnd.NEW().and(HealthCheckupUserSelection::getProjectId, "=", fetch.getProjectId())
.and(HealthCheckupUserSelection::getSelectUserId, "=", fetch.getUserId());
dao.clear(HealthCheckupUserSelection.class, and);
dao.clear(HealthCheckupUser.class, Cnd.where(HealthCheckupUser::getId, "=", id));
return Result.success();
}
}
@At
@Ok("void")
@ApiOperation("下载体检报告导入模版")
@SaCheckPermission("healthCheckup.list.mange")
public void downloadTemMedicalExaminationReport(HttpServletResponse response) {
List<ExcelExportEntity> entities = new ArrayList<>();
entities.add(new ExcelExportEntity("工号", "loginName", 20));
entities.add(new ExcelExportEntity("体检报告", "medicalExamination", 20));
ExportParams exportParams = new ExportParams();
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, Collections.emptyList());
CommonDownloadUtil.download("体检报告导入模版.xlsx", workbook, response);
}
@At
@ApiOperation("体检名单导入名单")
@SLog(type = "healthCheckup", tag = "体检管理", msg = "管理员导入了体检名单")
@SaCheckPermission("healthCheckup.list.import.medicalExamination")
@Aop(TransAop.READ_COMMITTED)
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
public Result healthImportMedicalExaminationReport(TempFile file, String healthProjectId) {
// 读取数据
List<T> ts = EasyExcelUtil.syncReadModel(file.getFile(), HealthCheckupImportTemp.class, 0, 1);
List<HealthCheckupImportTemp> healthCheckupImportTemps = JSONUtil.parseArray(JSONUtil.toJsonStr(ts)).toList(HealthCheckupImportTemp.class);
List<String> loginNames = healthCheckupImportTemps.stream().filter(v -> Strings.isNotBlank(v.getLoginName())).map(v -> v.getLoginName()).collect(Collectors.toList());
List<View_user> userList = dao.query(View_user.class, Cnd.where(View_user::getLoginname, "in", loginNames));
int successCount = 0;
for (int i = 0; i < healthCheckupImportTemps.size(); i++) {
HealthCheckupImportTemp excel = healthCheckupImportTemps.get(i);
if (StrUtil.isBlank(excel.getLoginName())) {
excel.setErrInfo("工号为空", i + 1);
continue;
}
// 不能在excel里重复
if (healthCheckupImportTemps.stream().filter(s -> s.getLoginName().equals(excel.getLoginName())).count() > 1) {
excel.setErrInfo("重复数据", i + 1);
}
View_user user = userList.stream().filter(s -> s.getLoginname().equals(excel.getLoginName())).findFirst().orElse(null);
if (user == null) {
excel.setErrInfo("无此用户", i + 1);
continue;
}
dao.update(HealthCheckupUser.class,
Chain.make("medicalExamination", excel.getMedicalExamination()),
Cnd.where("loginName", "=", excel.getLoginName()));
successCount++;
}
// 创建结果集
ExcelImportRes<HealthCheckupImportTemp> excelImportRes = new ExcelImportRes<>();
excelImportRes.setTotalRecords(healthCheckupImportTemps.size());
// 添加错误记录
excelImportRes.setErrorDetails(healthCheckupImportTemps.stream().filter(s -> StrUtil.isNotBlank(s.getErrMsg())).collect(Collectors.toList()));
excelImportRes.setFailedCount(excelImportRes.getErrorDetails().size());
excelImportRes.setSuccessCount(successCount);
return Result.success(excelImportRes);
}
}
@@ -132,6 +132,7 @@ public class HealthCheckupProjectMangeController {
}
});
healthCheckupProjectService.dao().insertOrUpdate(healthCheckupProject.getHealthCheckupProjectSubjects());
healthCheckupProjectService.update(healthCheckupProject);
}
@@ -5,15 +5,18 @@ 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.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.sms.SmsService;
import com.budwk.app.base.utils.CommonDownloadUtil;
import com.budwk.app.base.utils.ConditionGroupUtil;
import com.budwk.app.base.utils.ManyAddOrRenewUtil;
import com.budwk.app.sys.views.View_user;
import com.budwk.app.web.commons.base.Globals;
import com.budwk.app.zhgh.dayofficework.healthCheckup.model.HealthCheckupProject;
import com.budwk.app.zhgh.dayofficework.healthCheckup.model.HealthCheckupProjectSubject;
import com.budwk.app.zhgh.dayofficework.healthCheckup.model.HealthCheckupProjectSubjectMoney;
@@ -54,6 +57,8 @@ import java.util.stream.Collectors;
@At("/platform/healthCheckup/statistics/single")
public class HealthCheckupSingleController {
@Inject
private SmsService smsService;
@Inject
private HealthCheckupSingleService healthCheckupSingleService;
@@ -116,18 +121,19 @@ public class HealthCheckupSingleController {
boolean flag, HttpServletResponse response) {
List<ExcelExportEntity> entityList = new ArrayList<>() {{
add(new ExcelExportEntity("工号", "loginName", 20));
add(new ExcelExportEntity("工号", "loginName", 20));
add(new ExcelExportEntity("姓名", "userName", 20));
add(new ExcelExportEntity("性别", "sex", 20));
// add(new ExcelExportEntity("出生年月", "birthday", 20));
add(new ExcelExportEntity("年龄", "age", 20));
add(new ExcelExportEntity("婚姻状况", "marriage", 20));
add(new ExcelExportEntity("手机号码", "mobile", 20));
add(new ExcelExportEntity("身份证号", "idCard", 20));
add(new ExcelExportEntity("部门", "unitName", 20));
// add(new ExcelExportEntity("部门编码", "unitCode", 20));
add(new ExcelExportEntity("用户类型", "personType", 20));
add(new ExcelExportEntity("婚姻状况", "marriage", 20));
add(new ExcelExportEntity("医院", "subjectName", 20));
add(new ExcelExportEntity("套餐金额", "money", 20));
add(new ExcelExportEntity("结算金额", "settlementMoney", 20));
add(new ExcelExportEntity("部门", "unitName", 20));
add(new ExcelExportEntity("分工会", "unionName", 20));
add(new ExcelExportEntity("邮寄地址", "receiveAddress", 50));
}};
@@ -375,6 +381,17 @@ public class HealthCheckupSingleController {
@SLog(type = "healthCheckup", tag = "体检管理", msg = "管理员给未选的人发送提醒")
public Result msgNotSelect(@Valid String projectId) {
List<NutMap> userList = healthCheckupSingleService.receivePageData(projectId, null, "1");
return Result.success("暂未开启消息!");
if(CollectionUtil.isNotEmpty(userList)){
List<String> loginNameList = userList.stream()
.map(e -> e.getString("loginName"))
.collect(Collectors.toList());
smsService.massSendTextCard(loginNameList,
"系统显示您本年度体检医院信息尚未维护,请尽快登录小程序完成体检医院选择及个人信息确认,以免影响正常体检安排。",
"#",
Globals.AppDomain);
return Result.success("提醒成功");
} else {
return Result.success("不存在未体检人员");
}
}
}
@@ -4,6 +4,7 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result;
@@ -11,12 +12,10 @@ import com.budwk.app.base.service.BaseService;
import com.budwk.app.base.utils.ConditionGroupUtil;
import com.budwk.app.sys.views.View_user;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.dayofficework.healthCheckup.model.HealthCheckupCampus;
import com.budwk.app.zhgh.dayofficework.healthCheckup.model.HealthCheckupProject;
import com.budwk.app.zhgh.dayofficework.healthCheckup.model.HealthCheckupProjectSubjectMoney;
import com.budwk.app.zhgh.dayofficework.healthCheckup.model.HealthCheckupUserSelection;
import com.budwk.app.zhgh.dayofficework.healthCheckup.model.*;
import com.budwk.app.zhgh.dayofficework.healthCheckup.service.HealthCheckupProjectService;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
@@ -32,6 +31,7 @@ import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@@ -113,7 +113,7 @@ public class H5HealthCheckupController {
@At
@SaCheckPermission(value = {"h5.healthCheckup.list", "h5.healthCheckup.mine"}, mode = SaMode.OR)
public Object mineData(PageForm pageForm, String status) {
public Object mineData(PageForm pageForm, String status, String projectId) {
Sql sql = Sqls.create("""
SELECT
us.*,
@@ -130,6 +130,7 @@ public class H5HealthCheckupController {
""");
Cnd cnd = Cnd.NEW();
cnd.and("us.selectUserId", "=", SecurityUtil.getUserId());
cnd.andEX("us.projectId", "=", projectId);
// 根据 status 参数筛选进行中或已结束的项目
if ("ongoing".equals(status)) {
// 进行中的项目:结束时间大于等于当前时间
@@ -236,6 +237,66 @@ public class H5HealthCheckupController {
return Result.success().addData(Map.of("money", money, "subjectMoneyId", subjectMoneyId));
}
@At("/listParticulars")
@Ok("beetl:/platform/zhghh5/dayofficework/healthCheckup/listParticulars/index.html")
@SaCheckPermission("h5.healthCheckup.list")
@ApiOperation("体检项目报名详情页面")
public void listParticulars(){}
@At("/userBaseMessage")
@Ok("beetl:/platform/zhghh5/dayofficework/healthCheckup/userBaseMessage/index.html")
@SaCheckPermission("h5.healthCheckup.list")
@ApiOperation("基础信息确认")
public void userBaseMessage(){}
@At
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("h5.healthCheckup.list")
@ApiOperation("获取基础信息数据")
public Result findUserBaseMessageData(HealthCheckupUser checkupUser) {
if(StringUtils.isNotBlank(checkupUser.getProjectId()) && StringUtils.isNotBlank(checkupUser.getUserId())){
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
from health_checkup_user cu
left join sys_user u on cu.userId=u.id
$condition
""");
Cnd cnd = Cnd.NEW().and("cu.projectId", "=", checkupUser.getProjectId())
.and("cu.userId", "=", checkupUser.getUserId());
sql.setCondition(cnd);
NutMap nutMap = baseService.fetchMap(sql);
return Result.success(nutMap);
}
return Result.success();
}
@At
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("h5.healthCheckup.list")
@ApiOperation("基础信息提交")
public Result doSubmitUserBaseMessage(HealthCheckupUser checkupUser) {
checkupUser.setConfirmStatus("1");
dao.updateIgnoreNull(checkupUser);
return Result.success();
}
@At
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("h5.healthCheckup.list")
@ApiOperation("上年度体检医院")
public Result findLastYearHospital(HealthCheckupUserSelection checkupUserSelection) {
return Result.success("成功",healthCheckupProjectService.findLastYearHospital(checkupUserSelection));
}
@At("/physicalExaminationList")
@Ok("beetl:/platform/zhghh5/dayofficework/healthCheckup/physicalExaminationList/index.html")
@SaCheckPermission("h5.healthCheckup.list")
public void physicalExaminationList() {
}
}
@@ -72,9 +72,10 @@ public class HealthCheckupProject extends BaseModel implements Serializable {
@ColDefine(type = ColType.VARCHAR, width = 200)
private String cover;
@Column
@Comment("温馨提示")
@ColDefine(type = ColType.TEXT)
private String friendlyReminderText;
@Many(field = "projectId")
private List<HealthCheckupProjectSubject> healthCheckupProjectSubjects;
@@ -1,6 +1,7 @@
package com.budwk.app.zhgh.dayofficework.healthCheckup.model;
import com.budwk.app.base.model.BaseModel;
import com.budwk.app.sys.annotation.DataCenterColumn;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
@@ -78,4 +79,35 @@ public class HealthCheckupUser extends BaseModel implements Serializable {
@ColDefine(type = ColType.VARCHAR, width = 30)
private String userState;
@Column
@Comment("手机号码")
@ColDefine(type = ColType.VARCHAR, width = 11)
private String phone;
@Column
@Comment("身份证号")
@ColDefine(type = ColType.VARCHAR, width = 18)
private String card;
@Column
@Comment("婚姻状况")
@ColDefine(type = ColType.VARCHAR, width = 20)
@DataCenterColumn(name = "婚姻状况", key = "hyztm", dict = "USER_MARRIAGE")
private String marriage;
@Column
@Comment("教职工类别")
@ColDefine(type = ColType.VARCHAR)
private String personType;
@Column
@Comment("确认状态")
@ColDefine(type = ColType.CHAR)
@Default("0")
private String confirmStatus;
@Column
@Comment("体检报告")
@ColDefine(type = ColType.TEXT)
private String medicalExamination;
}
@@ -2,6 +2,7 @@ package com.budwk.app.zhgh.dayofficework.healthCheckup.service;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.zhgh.dayofficework.healthCheckup.model.HealthCheckupProject;
import com.budwk.app.zhgh.dayofficework.healthCheckup.model.HealthCheckupUserSelection;
public interface HealthCheckupProjectService extends BaseService<HealthCheckupProject> {
@@ -20,4 +21,10 @@ public interface HealthCheckupProjectService extends BaseService<HealthCheckupPr
* @param healthCheckupProject
*/
void renewHealthCheckupUser(HealthCheckupProject healthCheckupProject);
/**
* 获取用户上年度体检医院
* @param checkupUserSelection
*/
String findLastYearHospital(HealthCheckupUserSelection checkupUserSelection);
}
@@ -1,8 +1,12 @@
package com.budwk.app.zhgh.dayofficework.healthCheckup.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.base.utils.ConditionGroupUtil;
import com.budwk.app.base.utils.ManyAddOrRenewUtil;
import com.budwk.app.sys.views.View_user;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.activity.basic.models.ActivityUserScope;
import com.budwk.app.zhgh.dayofficework.healthCheckup.model.*;
import com.budwk.app.zhgh.dayofficework.healthCheckup.service.HealthCheckupProjectService;
@@ -12,6 +16,7 @@ import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.Daos;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
@@ -19,6 +24,7 @@ import org.nutz.lang.Strings;
import org.nutz.lang.random.R;
import org.nutz.lang.util.NutMap;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
@@ -92,6 +98,14 @@ public class HealthCheckupProjectServiceImpl extends BaseServiceImpl<HealthCheck
dao().clear(HealthCheckupUserCompanion.class, Cnd.where("userSelectionId", "in", userSelectionIds));
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
where cu.projectId=@projectId and cu.confirmStatus!='1'
""");
sql.setParam("projectId", healthCheckupProject.getId());
dao().execute(updateSql);
}
@@ -115,4 +129,26 @@ public class HealthCheckupProjectServiceImpl extends BaseServiceImpl<HealthCheck
return user;
}).collect(Collectors.toList());
}
/**
* 获取上年度体检医院
* @param healthCheckupUserSelection
* @return
*/
public String findLastYearHospital(HealthCheckupUserSelection healthCheckupUserSelection){
Cnd cndSelection = Cnd.NEW();
cndSelection.and("selectUserId","=",healthCheckupUserSelection.getSelectUserId());
cndSelection.where().andNotIsNull("selectTime");
cndSelection.desc("selectTime");
List<HealthCheckupUserSelection> checkupUserSelections = dao().query(HealthCheckupUserSelection.class, cndSelection);
if(CollectionUtil.isNotEmpty(checkupUserSelections)) {
Cnd cnd = Cnd.NEW();
cnd.and("id","=",checkupUserSelections.get(0).getSubjectId());
HealthCheckupProjectSubject projectSubject = dao().fetch(HealthCheckupProjectSubject.class, cnd);
if(ObjectUtil.isNotEmpty(projectSubject)) {
return projectSubject.getOptionName();
}
}
return null;
}
}
@@ -2,10 +2,12 @@ package com.budwk.app.zhgh.dayofficework.healthCheckup.service.impl;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.base.utils.StringUtil;
import com.budwk.app.zhgh.dayofficework.healthCheckup.model.HealthCheckupProject;
import com.budwk.app.zhgh.dayofficework.healthCheckup.model.HealthCheckupProjectSubject;
import com.budwk.app.zhgh.dayofficework.healthCheckup.service.HealthCheckupProjectService;
import com.budwk.app.zhgh.dayofficework.healthCheckup.service.HealthCheckupSingleService;
import org.apache.commons.lang3.StringUtils;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
@@ -47,6 +49,7 @@ public class HealthCheckupSingleServiceImpl extends BaseServiceImpl<HealthChecku
sql.setCondition(cnd);
//分工会参加体检人数汇总
List<NutMap> healthCheckupList = listMap(sql);
//该体检项目下的套餐
List<HealthCheckupProjectSubject> subjectList = project.getHealthCheckupProjectSubjects();
@@ -218,7 +221,6 @@ public class HealthCheckupSingleServiceImpl extends BaseServiceImpl<HealthChecku
u.idCard,
u.mobile,
hcps.optionName subjectName,
hcus.receiveAddress,
hcc.campusName,
hcpsm.money,
hcpsm.settlementMoney,
@@ -231,13 +233,17 @@ public class HealthCheckupSingleServiceImpl extends BaseServiceImpl<HealthChecku
WHERE
hcus.projectId = @projectId
AND hcus.selectUserId = u.id
) optionName
) optionName,
concat(u.address,',',u.linkMan,',',u.contactNumber) receiveAddress,
u.unionName,
u.mobile,
u.personType
FROM
`health_checkup_user_selection` hcus
LEFT JOIN `vw_user` u ON u.id = hcus.selectUserId
LEFT JOIN `health_checkup_user` hcu ON hcu.userId = hcus.selectUserId and hcu.projectId=@projectId
LEFT JOIN `health_checkup_project_subject` hcps ON hcps.id = hcus.subjectId
LEFT JOIN `health_checkup_project_subject_money` hcpsm ON hcpsm.projectId = @projectId and hcpsm.subjectId=hcps.id
LEFT JOIN `health_checkup_project_subject_money` hcpsm ON hcpsm.projectId = @projectId and hcpsm.subjectId=hcps.id and hcus.subjectMoneyId=hcpsm.id
LEFT JOIN `health_checkup_campus` hcc ON hcc.id = hcus.campus
$condition
""").setParam("projectId", projectId);
@@ -22,4 +22,7 @@ public class HealthCheckupImportTemp extends ExcelImportError {
@ExcelProperty("姓名")
private String userName;
@ExcelProperty("体检报告")
private String medicalExamination;
}
@@ -6,6 +6,7 @@
:action="action"
:on-change="handleChange"
:on-success="handleSuccess"
:on-remove="handleRemove"
:on-preview="handlePreview"
:on-exceed="handleExceed"
:before-upload="beforeUpload"
@@ -48,6 +48,15 @@ const branchUnionManage = {
<el-form-item label="校区" prop="campus">
<dict-select v-model="formData.campus" code="USER_CAMPUS"></dict-select>
</el-form-item>
<el-form-item label="联系人">
<el-input v-model="formData.linkMan" maxlength="64" placeholder="联系人"></el-input>
</el-form-item>
<el-form-item label="联系电话" :prop="contactNumber">
<el-input v-model="formData.contactNumber" placeholder="联系电话"></el-input>
</el-form-item>
<el-form-item label="地址">
<el-input v-model="formData.address" placeholder="地址"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button>
@@ -64,7 +73,11 @@ const branchUnionManage = {
formRules: {
name: [{ required: true, message: "请输入工会名称", trigger: ["change", "blur"] }],
unionCode: [{ required: true, message: "请输入工会编码", trigger: ["change", "blur"] }],
campus: [{ required: false, message: "请选择校区", trigger: ["change", "blur"] }]
campus: [{ required: false, message: "请选择校区", trigger: ["change", "blur"] }],
contactNumber: [
{ required: false, message: '手机号码',trigger: ['blur', 'change'] },
{ pattern: /^1[3456789]\d{9}$/, message: '输入正确的手机号码'}
]
}
}
},
@@ -59,9 +59,17 @@ layout("/layouts/platform.html"){
<el-card shadow="never" class="mt10">
<table-tool label="体检项目">
<el-radio-group v-model="pageForm.physicalExaminationStatus" size="medium" @change="doSearch" class="pr10">
<el-radio-button :label="2">全部</el-radio-button>
<el-radio-button :label="1">已体检</el-radio-button>
<el-radio-button :label="0">未体检</el-radio-button>
</el-radio-group>
<el-button type="primary" size="small" @click="openImport"
v-if="$auth.hasPermissionOr(['healthCheckup.list.import'])">导入名单
</el-button>
<el-button type="primary" size="small" @click="openImportMedicalExaminationReport"
v-if="$auth.hasPermissionOr(['healthCheckup.list.import.medicalExamination'])">导入体检报告
</el-button>
<el-button :disabled="!pageForm.projectId" type="primary" size="small"
@click="doAudit(true)">确认名单
</el-button>
@@ -69,6 +77,12 @@ layout("/layouts/platform.html"){
<el-button :disabled="!pageForm.projectId" type="danger" size="small"
@click="doAudit(false)">取消确认
</el-button>
<el-button @click="msgNotSelect"
icon="el-icon-printer"
size="small"
type="primary"
v-if="$auth.hasRoleOr(['SYSADMIN'])">给未选发送消息
</el-button>
</table-tool>
@@ -176,6 +190,16 @@ layout("/layouts/platform.html"){
width="700px"
:extra_params="{healthProjectId:pageForm.projectId}"
></excel-import>
<excel-import
ref="excelImportExaminationReportRef"
url="/platform/healthCheckup/list/mange/healthImportMedicalExaminationReport"
template_url="/platform/healthCheckup/list/mange/downloadTemMedicalExaminationReport"
:visible.sync="importVisibleExaminationReport"
title="导入名单数据"
width="700px"
:extra_params="{healthProjectId:pageForm.projectId}"
></excel-import>
</div>
@@ -188,6 +212,7 @@ layout("/layouts/platform.html"){
return {
pageForm: {
year: moment().format('YYYY'),
physicalExaminationStatus: '2',
},
unions: [],
units: [],
@@ -201,7 +226,6 @@ layout("/layouts/platform.html"){
{prop: 'unitName', label: '所属单位', sortable: true},
{prop: 'optionName', label: '所选套餐'},
{prop: 'selectTime', label: '选择时间', width: "160px"},
{prop: 'receiveAddress', label: '邮寄地址', width: "160px"},
{prop: 'isAudit', label: '是否确认'},
{prop: 'auditTime', label: '确认时间'},
{prop: 'bz', label: '备注',width: "200px"},
@@ -211,6 +235,7 @@ layout("/layouts/platform.html"){
loading: false,
//导入名单
importVisible: false,
importVisibleExaminationReport: false,
campusOptions: [],
}
@@ -319,6 +344,11 @@ layout("/layouts/platform.html"){
this.importVisible = true;
},
openImportMedicalExaminationReport() {
// importUser
this.importVisibleExaminationReport = true;
},
successImport() {
this.importLoading = false
this.doSearch()
@@ -339,6 +369,28 @@ layout("/layouts/platform.html"){
})
},
async msgNotSelect() {
const confirm = await this.$confirm('是否给未体检的教职工发送提醒短信?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === "confirm") {
this.tableLoading = true
const resp = await $.get('/platform/healthCheckup/statistics/single/msgNotSelect', {
projectId: this.pageForm.projectId
})
if (resp.code === 0) {
setTimeout(() => {
this.doSearch()
this.tableLoading = false
this.notifySuccess(resp.msg)
}, 2000)
} else {
this.notifyWarning(resp.msg)
}
}
},
},
async created() {
this.unions = await this.$businessTool.listUnion()
@@ -140,6 +140,11 @@ layout("/layouts/platform.html"){
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="温馨提示">
<el-input type="textarea" v-model="formData.friendlyReminderText" :rows="4"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="体检套餐" prop="healthCheckupProjectSubjects">
<el-card shadow="hover" v-for="(item,index) in formData.healthCheckupProjectSubjects"
@@ -201,7 +206,6 @@ layout("/layouts/platform.html"){
autosize
class="text-input"
data-type="option"
readonly
></el-input>
</template>
</el-table-column>
@@ -653,9 +657,10 @@ layout("/layouts/platform.html"){
formData.choiceTimeStart = formData.choiceTime[0]
formData.choiceTimeEnd = formData.choiceTime[1]
formData.healthCheckupProjectSubjects = JSON.stringify(this.formData.healthCheckupProjectSubjects)
formData.activityGroupName = this.activityGroupList.find(v => v.groupId === this.formData.activityGroupId).groupName
formData.activityGroupName = this.activityGroupList.find(v => v.groupId === this.formData.activityGroupId)?.groupName
formData.deleteRowIds = JSON.stringify(this.deleteRowIds)
formData.deleteSubjectIds = JSON.stringify(this.deleteSubjectIds)
formData.friendlyReminderText = (formData.friendlyReminderText || '');
const resp = await this.$axios.post("/platform/healthCheckup/project/mange/doAdd", formData)
loading.close()
if (resp.code === 0) {
@@ -357,6 +357,10 @@ layout("/layouts/platform.html"){
},
async getHealthCheckupSubject() {
this.projectSubjectOptions = []
if(!this.pageForm.projectId){
this.notifyError("请选择体检项目查询")
return ;
}
const resp = await this.$axios.post("/platform/healthCheckup/project/mange/findOne", {id: this.pageForm.projectId})
if (resp.code === 0) {
if (resp.data) {
@@ -402,12 +406,16 @@ layout("/layouts/platform.html"){
if (!this.pageForm.projectId) {
this.tableData = []
}
const resp = await this.$axios.post(loc() + '/pageData', this.pageForm)
if (resp.code === 0) {
this.tableData = resp.data.tableList
}
loading.close()
if(!this.pageForm.projectId){
this.notifyError("请选择体检项目查询")
this.tableData = []
} else {
const resp = await this.$axios.post(loc() + '/pageData', this.pageForm)
if (resp.code === 0) {
this.tableData = resp.data.tableList
}
}
loading.close()
},
pageNumberChange(val) {
this.pageFormUnion.pageNumber = val;
@@ -29,6 +29,25 @@ layout("/layouts/platform_h5.html"){
<table-list api="/platform/healthCheckup/h5/pageData" :page_form.sync="pageForm" ref="tableListRef"
@ready="doSearch" img="cover">
<template v-slot="{index,row}">
<table-column label="项目名称">
<div style="display: flex;
justify-content: space-between;
align-items: flex-start; /* 关键:改成顶部对齐 */
width: 100%;">
<span style="word-break: break-all;
white-space: normal;
flex: 1;
padding-right: 5px;">{{ row.name }}</span>
<span style="margin-left: 8px; font-size: 14px; white-space: nowrap;">
<span v-if="row.selectCount > 0" style="color: rgb(29 179 76);">
已报名
</span>
<span v-if="row.selectCount == 0" style="color: #ff0000;">
未报名
</span>
</span>
</div>
</table-column>
<table-column label="开始时间">
{{$moment(row.choiceTimeStart).format('MM/DD HH:mm')}}
</table-column>
@@ -38,7 +57,7 @@ layout("/layouts/platform_h5.html"){
</template>
<template #actions="{index,row}">
<template v-if="$moment().isBefore($moment(row.choiceTimeEnd))">
<div class="action-btn" @click="onView(row)">
<div class="action-btn" style="text-align: right" @click="onView(row)">
<i class="fa fa-edit"></i>
<span>去报名</span>
</div>
@@ -90,7 +109,9 @@ layout("/layouts/platform_h5.html"){
return;
}
this.$pjaxReplace("/platform/healthCheckup/h5/projectManageForm?projectId=" + row.id)
// this.$pjaxReplace("/platform/healthCheckup/h5/projectManageForm?projectId=" + row.id)
this.$pjaxReplace("/platform/healthCheckup/h5/listParticulars?projectId=" + row.id)
sessionStorage.setItem("friendlyReminderStatus", 0);
},
doSearch() {
this.$nextTick(() => {
@@ -0,0 +1,97 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<style scoped>
.buttonClass {
height: 93px;
margin: 8px 0px;
border-radius: 20px
}
.van-dialog__header {
color: red;
font-size: 20px;
}
.dialog-content > div {
padding: 8px 20px;
}
</style>
<div id="app">
<van-nav-bar @click-left="historyBack" left-arrow left-text="返回" title="报名详情" placeholder
fixed></van-nav-bar>
<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="#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>
</div>
<van-dialog v-model="show" title="温馨提醒" v-if="show" @confirm="confirmClick"
:confirm-button-text="confirmButtonText">
<div class="dialog-content">
<div style="white-space: pre-line">{{project.friendlyReminderText}}</div>
</div>
</van-dialog>
</div>
<script>
const vue = new Vue({
el: "#app",
store,
components: {
},
data() {
return {
show: false,
confirmButtonText: "",
amount: 0,
project: {
id: "",
friendlyReminderText: "",
},
baseLoc: "",
}
},
methods: {
userMessage() {
this.$pjaxReplace("/platform/healthCheckup/h5/userBaseMessage?projectId=" + this.project.id);
},
selectPhysicalExaminationHospital() {
this.$pjaxReplace("/platform/healthCheckup/h5/projectManageForm?projectId=" + this.project.id);
},
minePhysicalExaminationHospital() {
this.$pjaxReplace("/platform/healthCheckup/h5/mine?projectId=" + this.project.id);
},
confirmClick() {
sessionStorage.setItem("friendlyReminderStatus", 1);
},
// 查询体检套餐
async findSubject(id) {
try {
const resp = await this.$axios.post('/platform/healthCheckup/project/mange/findOne', {id});
this.project = resp.data || {};
} catch (error) {
vant.Toast('获取体检项目失败');
}
},
},
created() {
let projectId = GetQueryString("projectId");
this.findSubject(projectId);
let friendlyReminderStatus = sessionStorage.getItem("friendlyReminderStatus");
if (friendlyReminderStatus == "0" ) {
this.show = true;
let count = 5;
this.confirmButtonText = '已悉知(' + count + ''
let timer = setInterval(() => {
count--;
this.confirmButtonText = '已悉知(' + count + ''
if (count <= 0) {
this.confirmButtonText = '已悉知';
clearInterval(timer);
}
}, 1000);
}
}
})
</script>
<!--#
}
#-->
@@ -4,25 +4,20 @@ layout("/layouts/platform_h5.html"){
<div id="app">
<van-nav-bar @click-left="historyBack" left-arrow left-text="返回" title="我的体检" placeholder fixed></van-nav-bar>
<van-sticky offset-top="46px">
<van-tabs v-model="pageForm.status"
@change="onStatusChange">
<van-tab title="进行中" name="ongoing"></van-tab>
<van-tab title="已结束" name="finished"></van-tab>
</van-tabs>
</van-sticky>
<table-list api="/platform/healthCheckup/h5/mineData" :page_form.sync="pageForm" ref="tableListRef"
@ready="doSearch" title="healthCheckupName">
<template v-slot="{index,row}">
<table-column label="项目名称">{{row.name}}</table-column>
<tableR-column label="项目名称">{{row.name}}</tableR-column>
<table-column label="开始时间">{{row.choiceTimeStart}}</table-column>
<table-column label="结束时间">{{row.choiceTimeEnd}}</table-column>
<table-column label="选择医院">{{row.optionName}}</table-column>
<table-column label="邮寄地址">{{row.receiveAddress}}</table-column>
<!-- <table-column label="邮寄地址">{{row.receiveAddress}}</table-column>-->
</template>
<template #actions="{index,row}">
<div class="action-btn" @click="look(row)">
<van-icon name="eye-o" />
<span>查看</span>
</div>
<div class="action-btn" @click="edit(row)" v-if="new Date().getTime() < new Date(row.choiceTimeEnd).getTime()">
<i class="fa fa-edit"></i>
<span>修改</span>
@@ -33,8 +28,6 @@ layout("/layouts/platform_h5.html"){
</div>
</template>
</table-list>
</div>
<script>
const vue = new Vue({
@@ -52,7 +45,8 @@ layout("/layouts/platform_h5.html"){
totalCount: 0,
year: "",
status: "ongoing", // 默认为进行中
name: "" // 添加搜索名称字段
name: "", // 添加搜索名称字段
projectId: ""
},
}
},
@@ -107,7 +101,11 @@ layout("/layouts/platform_h5.html"){
this.$set(this.pageForm, "year", this.yearList[0].value)
// 初始化状态
this.$set(this.pageForm, "status", "ongoing")
this.pageForm.projectId = GetQueryString("projectId");
},
look() {
this.$pjaxReplace("/platform/healthCheckup/h5/physicalExaminationList?projectId=" + this.pageForm.projectId)
}
},
created() {
this.initData()
@@ -0,0 +1,501 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<div id="app">
<van-nav-bar @click-left="historyBack" left-arrow left-text="返回" title="体检套餐选择" placeholder
fixed></van-nav-bar>
<div class="form-container">
<van-form ref="formRef" @submit="doSubmit">
<van-cell-group title="基础信息">
<van-field
input-align="right"
label="身份证号"
name="idCard"
readonly
required
placeholder="请联系校工会补充身份证号"
v-model="formData.idCard"
:rules="[{ required: true, message: '请输入身份证号' }]">
</van-field>
<van-cell title="人员类型">{{formData.userState}}</van-cell>
<van-field
input-align="right"
readonly
required
label="婚姻状况"
name="marriage"
placeholder="请联系校工会补充婚姻状况"
v-model="formData.marriage"
:rules="[{ required: true, message: '请选择婚姻状况' }]"></van-field>
<van-cell title="出生年月">{{$moment(formData.birthday).format('YYYY-MM-DD')}}</van-cell>
<van-cell title="单位">{{formData.unitName}}</van-cell>
</van-cell-group>
<van-cell-group title="本年度预约体检医院">
<van-cell title="本年度预约体检医院">{{getSelectedOptionName}}</van-cell>
<van-field
input-align="right"
readonly
required
label="所选医院额度"
name="marriage"
placeholder="请选择医院"
v-model="formData.money"
:rules="[{ required: true, message: '请选择医院' }]"></van-field>
</van-cell-group>
<van-cell-group title="上年度预约体检医院">
<div class="van-card-body">
<van-cell title="上年度体检医院" :value="formData.lastYearHospital" />
</div>
</van-cell-group>
<!-- <van-cell-group title="体检报告邮寄地址">-->
<!-- <van-radio-group v-model="formData.postMethod" disabled>-->
<!-- <van-cell-group>-->
<!-- <van-cell title="单位" >-->
<!-- <template #right-icon>-->
<!-- <van-radio name="1"></van-radio>-->
<!-- </template>-->
<!-- </van-cell>-->
<!-- <van-cell title="自选" >-->
<!-- <template #right-icon>-->
<!-- <van-radio name="2"></van-radio>-->
<!-- </template>-->
<!-- </van-cell>-->
<!-- </van-cell-group>-->
<!-- </van-radio-group>-->
<!-- <template>-->
<!-- <van-field-->
<!-- v-if="formData.postMethod === '2'"-->
<!-- v-model="formData.receiveAddress"-->
<!-- label="邮寄地址"-->
<!-- placeholder="请选择邮寄地址"-->
<!-- readonly-->
<!-- type="textarea"-->
<!-- autosize-->
<!-- rows="2"-->
<!-- is-link-->
<!-- @click="editAddressPopup = true"-->
<!-- required-->
<!-- ></van-field>-->
<!-- <van-cell title="邮寄地址" v-else>{{formData.receiveAddress}}</van-cell>-->
<!-- <van-cell title="体检报告">-->
<!-- <div v-html="formData.medicalExamination"></div>-->
<!-- </van-cell>-->
<!-- </template>-->
<!-- </van-cell-group>-->
<van-cell-group title="家属信息" v-if="formData.isFamily === '是'">
<div style="padding: 10px;">
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;">
<span>家属信息</span>
<div>
<van-tag @click="delCompanion" size="large" type="primary" color="lightgrey">
删除家属
</van-tag>
<van-tag @click="addCompanion" size="large" type="primary" color="#1867b0">
添加家属
</van-tag>
</div>
</div>
<div v-if="formData.companionList && formData.companionList.length > 0">
<van-tabs v-model="active" type="card" color="#0e78c5" animated>
<van-tab
v-for="(item, index) in formData.companionList"
:key="index"
:title="'家属' + (index + 1)">
<van-field
label="姓名"
name="userName"
placeholder="请填写姓名"
v-model="item.userName"
:rules="[{ required: true, message: '请填写姓名' }]">
</van-field>
<van-field
:rules="[{ required: true, message: '请选择性别' }]"
label="性别"
name="sex">
<template #input>
<van-radio-group direction="horizontal" v-model="item.sex">
<van-radio name="男" shape="square"></van-radio>
<van-radio name="女" shape="square"></van-radio>
</van-radio-group>
</template>
</van-field>
<van-field
:rules="[{ required: true, message: '请选择婚否' }]"
label="婚否"
name="marry">
<template #input>
<van-radio-group direction="horizontal" v-model="item.marry">
<van-radio name="未婚" shape="square">未婚</van-radio>
<van-radio name="已婚" shape="square">已婚</van-radio>
</van-radio-group>
</template>
</van-field>
<van-field
label="年龄"
name="age"
placeholder="请填写年龄"
type="digit"
:rules="[{ required: true, message: '请填写年龄' }]"
v-model="item.age">
</van-field>
<van-field
label="身份证号"
name="idCard"
placeholder="请填写身份证号"
type="digit"
:rules="[{ required: true, message: '请填写身份证号' }]"
v-model="item.idCard">
</van-field>
<van-field
label="手机号"
name="mobile"
placeholder="请填写手机号"
type="digit"
:rules="[{ required: true, message: '请填写手机号' }]"
v-model="item.mobile">
</van-field>
</van-tab>
</van-tabs>
</div>
<div v-else class="empty_text">
<span>如有家属,请添加家属</span>
</div>
</div>
</van-cell-group>
</van-form>
</div>
<!--体检院区弹出框-->
<van-action-sheet title="体检院区" v-model="campusVisible">
<van-picker
title="院区"
show-toolbar
:columns="campusList"
value-key="campusName"
@confirm="onCampusConfirm"
@cancel="campusVisible = false">
</van-picker>
</van-action-sheet>
<!--查看说明-->
<van-action-sheet title="医院说明" v-model="descVisible" :style="{ height: '60%' }">
<div class="form-container" style="margin: 10px;">
<van-cell-group title="说明"></van-cell-group>
<div v-html="desc" class="pre_text"></div>
<div style="margin-top: 10px">
<van-cell-group title="以下内容由医院方提供"></van-cell-group>
<file-preview :files="files" complete_result></file-preview>
</div>
</div>
</van-action-sheet>
<!-- 收货地址选择弹窗 -->
<van-action-sheet v-model="editAddressPopup" title="选择收货地址" :round="true">
<div style="padding: 16px 0 0">
<div
v-for="address in addressOptions"
:key="address.id"
class="address-item"
@click="selectAddress(address)"
style="padding: 12px 16px; border-bottom: 1px solid #f0f0f0; cursor: pointer"
>
<div style="display: flex; justify-content: space-between; align-items: flex-start">
<div style="flex: 1">
<div style="font-size: 16px; font-weight: 500; color: #323233; margin-bottom: 4px">
{{ address.userName }} {{ address.tel }}
</div>
<div style="font-size: 14px; color: #646566; line-height: 1.4">
{{ address.province }}{{ address.city }}{{ address.county }}{{ address.addressDetail
}}
</div>
</div>
<van-tag v-if="address.isDefault" type="primary" size="mini" style="margin-left: 8px">默认
</van-tag>
</div>
</div>
<div v-if="addressOptions.length === 0"
style="text-align: center; padding: 40px 16px; color: #969799">暂无收货地址
</div>
</div>
<div style="padding: 16px; border-top: 1px solid #f0f0f0; background: #fafafa">
<van-button type="info" block round @click="goToAddressManage">收货地址管理</van-button>
</div>
</van-action-sheet>
</div>
<script>
const vue = new Vue({
el: "#app",
store,
dicts: ["ASSET_USAGE_STATE"],
data() {
return {
viewData: {},
formData: {
subjectId: '',
campus: '',
campusName: '',
isFamily: '否',
companionList: [],
projectId: '',
postMethod: ''
},
assetUsageStateNameOption: [],
showAssetUsageStateNamePopup: false,
assetUseUserOption: [],
assetUseNameShow: false,
searchKeyword: "",
active: 0,
campusList: [],
campusVisible: false,
descVisible: false,
desc: '',
files: [],
project: {},
marriageList: ["已婚", "未婚"],
marriageVisible: false,
editAddressPopup: false,
addressOptions: [],
userBaseMessage: {},
}
},
computed: {
// 根据 subjectId 自动匹配出 optionName
getSelectedOptionName() {
if (!this.formData.subjectId) return ''
if (!this.project?.healthCheckupProjectSubjects) return ''
const item = this.project.healthCheckupProjectSubjects.find(
item => item.id == this.formData.subjectId
)
return item ? item.optionName : ''
}
},
methods: {
// 选择收货地址
selectAddress(address) {
this.formData.receiveAddress =
address.userName + " " + address.tel + " " + address.province + address.city + address.county + address.addressDetail
this.editAddressPopup = false
},
// 跳转到地址管理页面
goToAddressManage() {
this.$pjaxReplace("/platform/h5/welfare/address/list")
},
// 获取收货地址
getAddress() {
this.$axios.post("/platform/welfare/addressManage/selectUserAddress").then(resp => {
if (resp.code === 0) {
this.addressOptions = resp.data
}
})
},
isEmptyObject(obj) {
for (let key in obj) {
if (obj.hasOwnProperty(key)) {
return false
}
}
return true
},
addressClick() {
},
// 打开表单
async initData() {
await this.getCampus()
this.getAddress()
let projectId = GetQueryString("projectId")
await this.findSubject(projectId);
if (projectId) {
const {id, userState, marriage, birthday, unit} = this.$store.state.user
await this.selectInfo(projectId);
await this.findUserBaseMessage(projectId, id);
await this.findLastYearHospital(projectId, id);
this.$set(this.formData, 'projectId', projectId)
this.$set(this.formData, 'idCard', this.userBaseMessage?.card)
this.$set(this.formData, 'userState', userState)
this.$set(this.formData, 'marriage', this.userBaseMessage?.marriage)
this.$set(this.formData, 'birthday', birthday)
this.$set(this.formData, 'unitName', unit.name)
this.$set(this.formData, 'postMethod', this.formData?.postMethod ? this.formData.postMethod : "1")
this.$set(this.formData, 'receiveAddress', this.formData?.receiveAddress ? this.formData.receiveAddress : unit.name)
this.$set(this.formData, 'medicalExamination', this.formData?.medicalExamination)
}
},
clickRadio(item) {
const toast = this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true,
message: '查询中....',
});
$.post("/platform/healthCheckup/h5/getSubjectMoney", {
id: item.id,
marriage: this.formData.marriage
}).then(resp => {
if (resp.code === 0) {
this.$set(this.formData, 'subjectId', item.id)
this.$set(this.formData, 'money', resp.data.money)
this.$set(this.formData, 'subjectMoneyId', resp.data.subjectMoneyId)
} else {
this.$set(this.formData, 'money', 0)
}
toast.clear();
})
},
async selectInfo(projectId) {
const resp = await this.$axios.post('/platform/healthCheckup/h5/selectInfo', {projectId: projectId});
if (resp.data !== null) {
this.formData = resp.data;
}
},
// 查看说明
viewDesc(item) {
if (item.description || item.files) {
this.files = item.files;
this.desc = item.description;
this.descVisible = true;
} else {
vant.Toast('暂无详细说明');
}
},
// 执行提交
async doSubmit() {
const formData = clone(this.formData);
if (!formData.receiveAddress) {
this.$toast.fail('请填写邮寄地址!')
}
const subject = this.project.healthCheckupProjectSubjects.find(v => v.id === formData.subjectId)
this.$dialog.confirm({
title: '温馨提示',
message: '您确定要提交选择的【' + subject.optionName + '】吗?',
}).then(() => {
const toast = this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true,
message: '提交中....',
});
/* if (formData.isFamily === '否') {
formData.companionList = [];
} else {
// 过滤空的家属信息
formData.companionList = formData.companionList.filter(item => item.userName && item.userName.trim() !== '');
}*/
this.$axios.post('/platform/healthCheckup/h5/doSubmit', {
userSelection: JSON.stringify(formData),
}).then(resp => {
if (resp.code === 0) {
toast.clear();
this.$toast.success(resp.msg)
this.historyBack()
}
})
}).catch(() => {
});
},
// 添加家属
addCompanion() {
// 检查是否已达到最大数量限制
if (this.companionList && this.formData.companionList.length >= 5) {
vant.Toast('最多只能添加5个家属');
return;
}
if (!this.formData.companionList) {
this.$set(this.formData, 'companionList', []);
}
this.formData.companionList.push({
userName: '', sex: '', marry: '', age: '', idCard: '', mobile: ''
});
},
// 删除家属
delCompanion() {
if (this.formData.companionList && this.formData.companionList.length > 0) {
this.formData.companionList.splice(this.active, 1);
// 确保active索引有效
if (this.active >= this.formData.companionList.length && this.active > 0) {
this.active = this.formData.companionList.length - 1;
}
}
},
// 院区选择确认
onCampusConfirm(value) {
this.formData.campusName = value.campusName;
this.formData.campus = value.id;
this.campusVisible = false;
},
// 婚姻状况确认
onMarriageConfirm(value) {
this.$set(this.formData, 'marriage', value)
this.$set(this.formData, 'subjectId', null)
this.marriageVisible = false;
},
// 查询体检套餐
async findSubject(id) {
try {
const resp = await this.$axios.post('/platform/healthCheckup/project/mange/findOne', {
id: id
});
this.project = resp.data || {};
} catch (error) {
vant.Toast('获取体检套餐失败');
}
},
// 获取院区
async getCampus() {
try {
const resp = await this.$axios.post('/platform/healthCheckup/h5/getCampus');
this.campusList = resp.data || [];
} catch (error) {
vant.Toast('获取院区失败');
}
},
async findUserBaseMessage(projectId, userId) {
//获取用户基础信息
const resp = await this.$axios.post('/platform/healthCheckup/h5/findUserBaseMessageData', {projectId,userId});
if (resp.data !== null) {
this.userBaseMessage = resp.data;
}
},
async findLastYearHospital(projectId, userId,subjectId) {
//获取上年度体检医院
const resp = await this.$axios.post('/platform/healthCheckup/h5/findLastYearHospital', {
projectId,
selectUserId: userId
});
if (resp.data !== null) {
this.$set(this.formData, 'lastYearHospital', resp.data);
}
}
},
created() {
this.initData()
}
})
</script>
<!--#
}
#-->
@@ -38,13 +38,11 @@ layout("/layouts/platform_h5.html"){
<van-radio-group v-model="formData.subjectId" class="basic">
<van-cell-group>
<van-cell
v-for="item in project.healthCheckupProjectSubjects"
v-for="(item,index) in project.healthCheckupProjectSubjects"
:key="item.id"
:title="item.optionName">
:title="(index + 1) + '、 ' +item.optionName">
<template #label>
<div style="display: flex; justify-content: space-between; margin-left: 8px">
<!-- <div>{{ item.optionName }}</div>-->
<div></div>
<div @click.stop="viewDesc(item)" style="color: #0e78c5">查看说明</div>
</div>
</template>
@@ -65,40 +63,45 @@ layout("/layouts/platform_h5.html"){
v-model="formData.money"
:rules="[{ required: true, message: '请选择医院' }]"></van-field>
</van-cell-group>
<van-cell-group title="体检报告邮寄地址">
<van-radio-group v-model="formData.postMethod">
<van-cell-group>
<van-cell title="单位" clickable
@click="formData.postMethod = '1';formData.receiveAddress=formData.unitName">
<template #right-icon>
<van-radio name="1"></van-radio>
</template>
</van-cell>
<van-cell title="自选" clickable
@click="formData.postMethod = '2';formData.receiveAddress=''">
<template #right-icon>
<van-radio name="2"></van-radio>
</template>
</van-cell>
</van-cell-group>
</van-radio-group>
<template>
<van-field
v-if="formData.postMethod === '2'"
v-model="formData.receiveAddress"
label="邮寄地址"
placeholder="请选择邮寄地址"
readonly
type="textarea"
autosize
rows="2"
is-link
@click="editAddressPopup = true"
required
></van-field>
<van-cell title="邮寄地址" v-else>{{formData.receiveAddress}}</van-cell>
</template>
</van-cell-group>
<van-cell-group title="上年度预约体检医院">
<div class="van-card-body">
<van-cell title="上年度体检医院" :value="formData.lastYearHospital" />
</div>
</van-cell-group>
<!-- <van-cell-group title="体检报告邮寄地址">-->
<!-- <van-radio-group v-model="formData.postMethod">-->
<!-- <van-cell-group>-->
<!-- <van-cell title="单位" clickable-->
<!-- @click="formData.postMethod = '1';formData.receiveAddress=formData.unitName">-->
<!-- <template #right-icon>-->
<!-- <van-radio name="1"></van-radio>-->
<!-- </template>-->
<!-- </van-cell>-->
<!-- <van-cell title="自选" clickable-->
<!-- @click="formData.postMethod = '2';formData.receiveAddress=''">-->
<!-- <template #right-icon>-->
<!-- <van-radio name="2"></van-radio>-->
<!-- </template>-->
<!-- </van-cell>-->
<!-- </van-cell-group>-->
<!-- </van-radio-group>-->
<!-- <template>-->
<!-- <van-field-->
<!-- v-if="formData.postMethod === '2'"-->
<!-- v-model="formData.receiveAddress"-->
<!-- label="邮寄地址"-->
<!-- placeholder="请选择邮寄地址"-->
<!-- readonly-->
<!-- type="textarea"-->
<!-- autosize-->
<!-- rows="2"-->
<!-- is-link-->
<!-- @click="editAddressPopup = true"-->
<!-- required-->
<!-- ></van-field>-->
<!-- <van-cell title="邮寄地址" v-else>{{formData.receiveAddress}}</van-cell>-->
<!-- </template>-->
<!-- </van-cell-group>-->
<!-- <van-cell-group title="基础信息">
<div class="van-card-body">
@@ -309,7 +312,8 @@ layout("/layouts/platform_h5.html"){
marriageVisible: false,
editAddressPopup: false,
addressOptions: []
addressOptions: [],
userBaseMessage: {},
}
},
methods: {
@@ -348,14 +352,17 @@ layout("/layouts/platform_h5.html"){
async initData() {
await this.getCampus()
this.getAddress()
await this.findSubject(GetQueryString("projectId"))
if (GetQueryString("projectId")) {
await this.selectInfo(GetQueryString("projectId"));
const {idCard, userState, marriage, birthday, unit} = this.$store.state.user
this.$set(this.formData, 'projectId', GetQueryString("projectId"))
this.$set(this.formData, 'idCard', idCard)
this.$set(this.formData, 'userState', userState)
this.$set(this.formData, 'marriage', marriage)
let projectId = GetQueryString("projectId")
await this.findSubject(projectId);
if (projectId) {
const {id, personType, birthday, unit} = this.$store.state.user
await this.selectInfo(projectId);
await this.findUserBaseMessage(projectId, id);
await this.findLastYearHospital(projectId, id);
this.$set(this.formData, 'projectId', projectId)
this.$set(this.formData, 'idCard', this.userBaseMessage?.card)
this.$set(this.formData, 'userState', personType)
this.$set(this.formData, 'marriage', this.userBaseMessage?.marriage)
this.$set(this.formData, 'birthday', birthday)
this.$set(this.formData, 'unitName', unit.name)
this.$set(this.formData, 'postMethod', this.formData?.postMethod ? this.formData.postMethod : "1")
@@ -502,11 +509,27 @@ layout("/layouts/platform_h5.html"){
} catch (error) {
vant.Toast('获取院区失败');
}
}
},
async findUserBaseMessage(projectId, userId) {
//获取用户基础信息
const resp = await this.$axios.post('/platform/healthCheckup/h5/findUserBaseMessageData', {projectId,userId});
if (resp.data !== null) {
this.userBaseMessage = resp.data;
}
},
async findLastYearHospital(projectId, userId,subjectId) {
//获取上年度体检医院
const resp = await this.$axios.post('/platform/healthCheckup/h5/findLastYearHospital', {
projectId,
selectUserId: userId
});
if (resp.data !== null) {
this.$set(this.formData, 'lastYearHospital', resp.data);
}
}
},
created() {
this.initData()
}
})
</script>
@@ -0,0 +1,153 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<div id="app">
<van-nav-bar @click-left="historyBack" left-arrow left-text="返回" title="基础信息" placeholder
fixed></van-nav-bar>
<div class="form-container" v-cloak>
<van-form ref="formRef" @submit="doSubmit">
<van-cell-group>
<van-field
input-align="right"
label="姓名"
name="userName"
readonly
required
v-model="formData.userName"
:rules="[{ required: true, message: '请输入姓名' }]">
</van-field>
<van-cell title="性别">
<template #right-icon>
<van-radio-group v-model="formData.sex" direction="horizontal">
<van-radio name="男"></van-radio>
<van-radio name="女"></van-radio>
</van-radio-group>
</template>
</van-cell>
<van-cell title="年龄">{{formData.age}}</van-cell>
<van-field
input-align="right"
label="手机号码"
name="phone"
required
v-model="formData.phone"
:rules="[{ required: false, message: '手机号码',trigger: ['blur', 'change'] },{ pattern: /^1[3456789]\d{9}$/, message: '输入正确的手机号码'}]">
</van-field>
<van-field
input-align="right"
label="身份证号"
name="card"
required
placeholder="请联系输入身份证号"
v-model="formData.card"
:rules="[{ required: true, message: '请输入子女身份证号', trigger: 'blur' }, {pattern: /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/, message: '请输入正确的身份证号码', trigger: 'blur'}]">
</van-field>
<van-cell title="人员类型">{{formData.personType}}</van-cell>
<van-cell title="婚姻状态">
<template #right-icon>
<van-radio-group v-model="formData.marriage" direction="horizontal">
<van-radio name="已婚">已婚</van-radio>
<van-radio name="未婚">未婚</van-radio>
</van-radio-group>
</template>
</van-cell>
</van-cell-group>
<!-- 按钮区域 -->
<div class="form-actions">
<van-button type="primary"
class="buttonClass"
block
native-type="submit">提交&修改</van-button>
</div>
</van-form>
</div>
</div>
<script>
const vue = new Vue({
el: "#app",
store,
data() {
return {
project: {},
formData: {
sex: "",
age: 0,
marriage: ""
}
}
},
methods: {
// 打开表单
async initData() {
await this.findSubject(GetQueryString("projectId"))
if (GetQueryString("projectId")) {
const {id, birthday} = this.$store.state.user
await this.selectInfo(GetQueryString("projectId"),id);
this.$set(this.formData, 'projectId', GetQueryString("projectId"))
// 1. 转成日期对象
if(birthday) {
const birth = new Date(birthday)
const now = new Date()
let age = now.getFullYear() - birth.getFullYear()
const birthMonth = birth.getMonth()
const nowMonth = now.getMonth()
const birthDate = birth.getDate()
const nowDate = now.getDate()
if (nowMonth < birthMonth || (nowMonth === birthMonth && nowDate < birthDate)) {
age--
}
this.$set(this.formData, 'age', age);
}
}
},
async findSubject(id) {
try {
const resp = await this.$axios.post('/platform/healthCheckup/project/mange/findOne', {id});
this.project = resp.data || {};
} catch (error) {
vant.Toast('获取体检项目失败');
}
},
// 执行提交
async doSubmit() {
const formData = clone(this.formData);
this.$dialog.confirm({
title: '温馨提示',
message: '您确定要提交吗?',
}).then(() => {
const toast = this.$toast.loading({
duration: 0,
forbidClick: true,
message: '提交中....',
});
this.$axios.post('/platform/healthCheckup/h5/doSubmitUserBaseMessage', formData).then(resp => {
if (resp.code === 0) {
toast.clear();
this.$toast.success(resp.msg)
this.historyBack()
}
})
}).catch(() => {
});
},
async selectInfo(projectId,userId) {
const resp = await this.$axios.post('/platform/healthCheckup/h5/findUserBaseMessageData', {projectId,userId});
if (resp.data !== null) {
this.formData = resp.data;
}
},
},
created() {
this.initData()
}
})
</script>
<!--#
}
#-->
@@ -8,6 +8,7 @@ import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.hutool.core.codec.Base64;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.core.util.IdcardUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.digest.DigestUtil;
import cn.hutool.http.HttpRequest;
@@ -16,11 +17,17 @@ import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.budwk.app.sys.models.*;
import com.budwk.app.zhgh.dayofficework.healthCheckup.model.HealthCheckupProjectSubject;
import com.budwk.app.zhgh.dayofficework.healthCheckup.model.HealthCheckupProjectSubjectMoney;
import com.budwk.app.zhgh.dayofficework.healthCheckup.model.HealthCheckupUserSelection;
import com.budwk.app.zhgh.welfare.model.WelfareList;
import com.budwk.app.zhgh.welfare.model.WelfareProjectSubjectOption;
import com.budwk.app.zhgh.welfare.model.WelfareUserSelection;
import com.budwk.app.zhgh.welfare.service.WelfareProjectService;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Workbook;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -29,6 +36,9 @@ import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.entity.annotation.ColDefine;
import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Comment;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
@@ -36,11 +46,13 @@ import org.nutz.json.Json;
import org.nutz.lang.Lang;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.springframework.util.CollectionUtils;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.*;
@@ -55,6 +67,81 @@ public class WelfareTest {
@Inject
private WelfareProjectService welfareService;
@Test
public void importPhysicalExamination() {
Sql sql = Sqls.create("""
select u.*
from temp_user_loginName t
left join sys_user u on t.loginName=u.loginname
where u.id is not null
""");
List<NutMap> nutMaps = welfareService.listMap(sql);
List<HealthCheckupProjectSubject> healthCheckupProjectSubjects = dao.query(HealthCheckupProjectSubject.class,
Cnd.where(HealthCheckupProjectSubject::getProjectId, "=", "ccdc49e3d63b4a8cb89c0af0687bb1bf"));
List<HealthCheckupProjectSubjectMoney> healthCheckupProjectSubjectMoneyList = dao.query(HealthCheckupProjectSubjectMoney.class,
Cnd.where(HealthCheckupProjectSubjectMoney::getProjectId, "=", "ccdc49e3d63b4a8cb89c0af0687bb1bf"));
List<PhysicalExamination> physicalExaminationList = ExcelImportUtil.importExcel(new File("C:\\Users\\mayn\\Desktop\\1.xlsx"), PhysicalExamination.class, new ImportParams());
List<HealthCheckupUserSelection> userSelectionList = physicalExaminationList.stream().map(e -> {
NutMap nutMap = nutMaps.stream().filter(v -> e.getLoginName().equals(v.getString("loginname"))).findFirst().orElse(null);
HealthCheckupUserSelection userSelection = new HealthCheckupUserSelection();
if (ObjectUtil.isNotEmpty(nutMap)) {
userSelection.setSelectUserId(nutMap.getString("id"));
userSelection.setProjectId("ccdc49e3d63b4a8cb89c0af0687bb1bf");
HealthCheckupProjectSubject healthCheckupProjectSubject = healthCheckupProjectSubjects.stream()
.filter(v -> e.getHealthExaminationHospital().equals(v.getOptionName()))
.findFirst().orElse(null);
if(ObjectUtil.isNotEmpty(healthCheckupProjectSubject)) {
userSelection.setSubjectId(healthCheckupProjectSubject.getId());
} else {
userSelection.setBz("医院不存在");
return userSelection;
}
List<HealthCheckupProjectSubjectMoney> healthCheckupProjectSubjectMonies = healthCheckupProjectSubjectMoneyList.stream()
.filter(v -> v.getSubjectId().equals(healthCheckupProjectSubject.getId()))
.collect(Collectors.toList());
healthCheckupProjectSubjectMonies = healthCheckupProjectSubjectMoneyList.stream()
.filter(v -> v.getMoney().compareTo(e.getMoney()) == 0
&& v.getSettlementMoney().compareTo(e.getSettlementMoney()) == 0)
.collect(Collectors.toList());
if(!CollectionUtils.isEmpty(healthCheckupProjectSubjectMonies)){
userSelection.setSubjectMoneyId(healthCheckupProjectSubjectMonies.get(0).getId());
userSelection.setMoney(healthCheckupProjectSubjectMonies.get(0).getMoney());
} else {
userSelection.setSelectUserId(e.getLoginName());
userSelection.setBz("项目不存在");
return userSelection;
}
userSelection.setId(UUID.randomUUID().toString());
userSelection.setCampus("");
userSelection.setSelectTime(new Date());
userSelection.setBz("");
userSelection.setReceiveAddress("");
userSelection.setPostMethod("1");
return userSelection;
} else {
return null;
}
}).filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
List<HealthCheckupUserSelection> healthCheckupUserSelections = userSelectionList.stream().filter(e -> StringUtils.isBlank(e.getId())).collect(Collectors.toList());
List<String> collect = healthCheckupUserSelections.stream().map(HealthCheckupUserSelection::getSelectUserId).collect(Collectors.toList());
userSelectionList = userSelectionList.stream().filter(e-> StringUtils.isNotBlank(e.getId())).collect(Collectors.toList());
dao.insert(userSelectionList);
}
@Data
public static class PhysicalExamination {
@Excel(name = "工号")
private String loginName;
@Excel(name = "体检医院")
private String healthExaminationHospital;
@Excel(name = "套餐金额")
private BigDecimal money;
@Excel(name = "结算金额")
private BigDecimal settlementMoney;
}
@Test
public void importSelectUser() {
List<SelectUser> list = ExcelImportUtil.importExcel(new File("C:\\Users\\administrator\\Desktop\\匹配上生日.xlsx"), SelectUser.class, new ImportParams());