This commit is contained in:
Paidax
2025-05-28 11:30:56 +08:00
parent d2412c998c
commit 0d8bdbb11b
11 changed files with 505 additions and 81 deletions
@@ -1,32 +1,56 @@
package io.v.nutz.zhgh.healthCheckup.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.result.Result;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.utils.ViTool;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.activity.models.ActivityUserScope;
import io.v.nutz.zhgh.healthCheckup.model.HealthCheckupProject;
import io.v.nutz.zhgh.healthCheckup.model.HealthCheckupProjectSubject;
import io.v.nutz.zhgh.healthCheckup.model.HealthCheckupUnionConfirm;
import io.v.nutz.zhgh.healthCheckup.model.HealthCheckupUserSelection;
import io.v.nutz.zhgh.healthCheckup.service.HealthCheckupProjectService;
import io.v.nutz.zhgh.healthCheckup.template.HealthCheckupImportTemp;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
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.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
import org.nutz.lang.Strings;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.AdaptBy;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import org.nutz.mvc.upload.TempFile;
import org.nutz.mvc.upload.UploadAdaptor;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* @ClassName HealthCheckupListController
@@ -39,6 +63,8 @@ import java.util.List;
@At("/platform/healthCheckup/list/mange")
public class HealthCheckupListController {
@Inject
private Dao dao;
@Inject
private HealthCheckupProjectService healthCheckupProjectService;
@@ -58,6 +84,8 @@ public class HealthCheckupListController {
@Param(value = "unitId", required = false) String unitId,
@Param(value = "threeUnitId", required = false) String threeUnitId,
@Param(value = "unionGroupId", required = false) String unionGroupId) {
List<HealthCheckupUnionConfirm> confirms = dao.query(HealthCheckupUnionConfirm.class, Cnd.where("projectId", "=", projectId));
HealthCheckupProject project = healthCheckupProjectService.findOne(projectId);
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
@@ -66,6 +94,7 @@ public class HealthCheckupListController {
hcu.loginname,
hcu.username,
hcu.sex,
hcu.unionId,
hcu.unionname,
hcu.unitname,
hcu.threeUnitName,
@@ -81,20 +110,20 @@ public class HealthCheckupListController {
$condition
""").setParam("projectId", projectId);
sql.setCondition(cnd);
cnd.andEX("hcu.projectId", "=", projectId);
cnd.andEX("hcu.unionId", "=", unionId);
cnd.andEX("hcu.unitId", "=", unitId);
cnd.andEX("hcu.unionGroupId", "=", unionGroupId);
cnd.andEX("hcu.threeUnitId", "=", threeUnitId);
cnd.andEX("hcu.projectId","=",projectId);
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin")) {
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
cnd.andEX("hcu.unionId", "=", Vi.getUnionId());
}
if (StrUtil.isNotBlank(pageForm.getSearchName()) && StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
cnd.and(Cnd.likeEX(pageForm.getSearchName(), pageForm.getSearchKeyword()));
}
cnd.groupBy("hcu.userId");
if (Vi.isNotBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
cnd.orderBy(pageForm.getPageOrderName(), "ascending".equalsIgnoreCase(pageForm.getPageOrderBy()) ? "ASC" : "DESC");
} else {
@@ -109,10 +138,37 @@ public class HealthCheckupListController {
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 ? confirm.getAuditTime() : "");
}
});
return pagination;
}
@At
@ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("healthCheckup.list.mange")
public Object doAuditUser(@Param(value = "projectId", required = false) String projectId,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "flag") Boolean flag) {
if (flag) {
dao.update(HealthCheckupUnionConfirm.class, Chain.make("isAudit", true)
.add("auditTime", DateUtil.date())
.add("auditUser", ShiroUtil.getUserId()),
Cnd.where("projectId", "=", projectId).and("unionId", "=", unionId));
} else {
dao.update(HealthCheckupUnionConfirm.class, Chain.make("isAudit", null)
.add("auditTime", null)
.add("auditUser", null),
Cnd.where("projectId", "=", projectId).and("unionId", "=", unionId));
}
return null;
}
@At
@ViReturn
@@ -167,4 +223,66 @@ public class HealthCheckupListController {
return sql.getResult();
}
}
@At
@ViReturn
@RequiresAuthentication
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
@Aop(TransAop.READ_COMMITTED)
public Object healthImport(TempFile file, String healthProjectId) {
List<HealthCheckupImportTemp> healthCheckupImportTemps = ExcelImportUtil.importExcel(file.getFile(), HealthCheckupImportTemp.class, new ImportParams());
List<String> loginNames = healthCheckupImportTemps.stream().filter(v -> Strings.isNotBlank(v.getLoginName())).map(v -> v.getLoginName()).collect(Collectors.toList());
//全部的user
Sql sql = Sqls.create("select loginname from sys_user");
List<String> allUserLoginNames = (List<String>) Daos.query(dao, sql.toString(), Sqls.callback.strList());
List<Sys_user> userList = dao.query(Sys_user.class, Cnd.where("loginname", "in", loginNames));
String errMsg = "系统中没有该用户的信息";
//导入数据不在全部user中的人员
List<HealthCheckupImportTemp> errorUsers = healthCheckupImportTemps.stream().filter(v -> !allUserLoginNames.contains(v.getLoginName())).collect(Collectors.toList());
HealthCheckupProject checkupProject = dao.fetch(HealthCheckupProject.class, healthProjectId);
ActivityUserScope userScope = dao.fetch(ActivityUserScope.class, Cnd.where("groupId", "=", checkupProject.getActivityGroupId()));
List<ActivityUserScope> userScopeList = new ArrayList<>();
userList.forEach(v -> {
ActivityUserScope s = new ActivityUserScope();
s.setGroupId(userScope.getGroupId());
s.setGroupName(userScope.getGroupName());
s.setUserId(v.getId());
s.setCreator(ShiroUtil.getUserId());
userScopeList.add(s);
});
dao.insert(userScopeList);
NutMap resultMap = NutMap.NEW();
resultMap.addv("totalCount", healthCheckupImportTemps.size());
resultMap.addv("successCount", userScopeList.size());
resultMap.addv("errorCount", errorUsers.size());
resultMap.addv("errorList", errorUsers.stream().map(v -> {
return NutMap.NEW().addv("工号", v.getLoginName()).addv("姓名", v.getUserName()).addv("错误信息", errMsg);
}).collect(Collectors.toList()));
return Result.success(resultMap);
}
@At
@Ok("void")
public void downloadTem(HttpServletResponse response) {
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
List<ExcelExportEntity> entities = List.of(
new ExcelExportEntity("姓名", "username", 20),
new ExcelExportEntity("工号", "loginname", 20)
);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, new ArrayList<>());
try {
ViTool.excelResponse(response, "参加人员.xlsx");
workbook.write(response.getOutputStream());
} catch (Exception e) {
e.printStackTrace();
}
}
}
@@ -3,11 +3,12 @@ package io.v.nutz.zhgh.healthCheckup.controller;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.zhgh.data.model.MatchConditionStructure;
import io.v.nutz.zhgh.data.service.MatchConditionStructureService;
import io.v.nutz.zhgh.healthCheckup.model.*;
import io.v.nutz.zhgh.healthCheckup.service.HealthCheckupProjectService;
import io.v.nutz.base.query.PageForm;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
@@ -23,6 +24,7 @@ import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@@ -57,7 +59,6 @@ public class HealthCheckupProjectMangeController {
@Aop(TransAop.READ_COMMITTED)
public Object doAdd(HealthCheckupProject healthCheckupProject, @Param(value = "deleteRowIds", required = false) String[] deleteRowIds) {
healthCheckupProject.getHealthCheckupProjectSubjects().forEach(v -> {
if (Lang.isNotEmpty(v.getMatchCnd())) {
MatchConditionStructure save = matchConditionStructureService.save(v.getMatchCnd());
@@ -65,11 +66,14 @@ public class HealthCheckupProjectMangeController {
}
});
String projectId;
//如果是保存
if (StrUtil.isBlank(healthCheckupProject.getId())) {
healthCheckupProject.setYear(DateUtil.thisYear());
healthCheckupProjectService.insertWith(healthCheckupProject, "healthCheckupProjectSubjects");
HealthCheckupProject checkupProject = healthCheckupProjectService.insertWith(healthCheckupProject, "healthCheckupProjectSubjects");
projectId = checkupProject.getId();
} else {
projectId = healthCheckupProject.getId();
healthCheckupProjectService.dao().clear(HealthCheckupProjectSubject.class, Cnd.where("id", "in", deleteRowIds));
healthCheckupProject.getHealthCheckupProjectSubjects().forEach(v -> {
v.setProjectId(healthCheckupProject.getId());
@@ -77,8 +81,21 @@ public class HealthCheckupProjectMangeController {
healthCheckupProjectService.dao().insertOrUpdate(healthCheckupProject.getHealthCheckupProjectSubjects());
healthCheckupProjectService.update(healthCheckupProject);
}
return null;
healthCheckupProjectService.dao().clear(HealthCheckupUnionConfirm.class, Cnd.where("projectId", "=", projectId));
List<Sys_union> unionList = healthCheckupProjectService.dao().query(Sys_union.class, Cnd.NEW());
List<HealthCheckupUnionConfirm> confirmList = new ArrayList<>();
unionList.forEach(item -> {
HealthCheckupUnionConfirm c = new HealthCheckupUnionConfirm();
c.setProjectId(projectId);
c.setUnionId(item.getId());
c.setUnionName(item.getUnionname());
c.setUnionCode(item.getUnioncode());
c.setIsAudit(false);
confirmList.add(c);
});
healthCheckupProjectService.dao().insert(confirmList);
return null;
}
@@ -102,7 +119,8 @@ public class HealthCheckupProjectMangeController {
hcp.provideTimeEnd,
hcp.healthCheckupType,
IF((select count(userId) from health_checkup_user hcu where hcu.projectId = hcp.id) > 0,true,false) AS isHasUserList,
IF(NOW() > hcp.choiceTimeStart AND NOW() < hcp.choiceTimeEnd, true, false) AS isWithinChoiceTime
IF(NOW() > hcp.choiceTimeStart AND NOW() < hcp.choiceTimeEnd, true, false) AS isWithinChoiceTime,
IF(NOW() < hcp.choiceTimeStart, true, false) AS canCreated
FROM
health_checkup_project hcp
$condition
@@ -184,9 +202,9 @@ public class HealthCheckupProjectMangeController {
List<String> userSelectionIds = list.stream().map(v->v.getString("id")).collect(Collectors.toList());
List<String> userIds = list.stream().map(v -> v.getString("selectUserId")).collect(Collectors.toList());
healthCheckupProjectService.dao().clear(HealthCheckupUser.class,Cnd.where("projectId","=",healthCheckupProject.getId()));
healthCheckupProjectService.dao().clear(HealthCheckupUserSelection.class,Cnd.where("selectUserId","in",userIds));
healthCheckupProjectService.dao().clear(HealthCheckupUserCompanion.class,Cnd.where("userSelectionId","in",userSelectionIds));
healthCheckupProjectService.dao().clear(HealthCheckupUser.class,Cnd.where("projectId","=",healthCheckupProject.getId()));
healthCheckupProjectService.addHealthCheckupUser(healthCheckupProject);
return null;
}
@@ -0,0 +1,56 @@
package io.v.nutz.zhgh.healthCheckup.model;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.util.Date;
@Data
@Table
public class HealthCheckupUnionConfirm {
@Column
@Name
@Comment("ID")
@ColDefine(type = ColType.VARCHAR, width = 32)
@PrevInsert(uu32 = true)
private String id;
@Column
@Comment("所属项目")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String projectId;
@Column
@Comment("工会id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String unionId;
@Column
@Comment("工会名称")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String unionName;
@Column
@Comment("工会编号")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String unionCode;
@Column
@Comment("是否确认")
@ColDefine(type = ColType.BOOLEAN)
private Boolean isAudit;
@Column
@Comment("确认时间")
@ColDefine(type = ColType.DATETIME)
private Date auditTime;
@Column
@Comment("操作人")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String auditUser;
}
@@ -2,12 +2,11 @@ package io.v.nutz.zhgh.healthCheckup.service.impl;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.zhgh.healthCheckup.model.HealthCheckupProject;
import io.v.nutz.zhgh.healthCheckup.model.HealthCheckupProjectSubject;
import io.v.nutz.zhgh.healthCheckup.service.HealthCheckupProjectService;
import io.v.nutz.zhgh.healthCheckup.service.HealthCheckupSingleService;
import io.v.nutz.base.service.impl.ViServiceImpl;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
@@ -35,19 +34,22 @@ public class HealthCheckupSingleServiceImpl extends ViServiceImpl<HealthCheckupP
HealthCheckupProject project = healthCheckupProjectService.findOne(projectId);
Sql sql = Sqls.create("""
SELECT
su.*,
(SELECT count( 1 ) FROM `health_checkup_user` hcu WHERE hcu.unionId = su.id and hcu.projectId = @projectId $unionGroupIdCnd ) sumCount
uc.unionId AS id,
uc.unionName AS unionname,
uc.unionCode AS unioncode,
SUM(IF(u.id is not null,1,0)) AS sumCount
FROM
sys_union su
health_checkup_union_confirm uc
LEFT JOIN health_checkup_user u ON u.unionId = uc.unionId
$condition
""").setParam("projectId",projectId);
CndPlus cnd = CndPlus.create();
cnd.andEX("su.id","=",unionId);
cnd.asc("su.unioncode");
Cnd cnd = Cnd.NEW();
cnd.andEX("uc.unionId","=",unionId);
cnd.and("uc.projectId", "=", projectId);
cnd.and("u.projectId", "=", projectId);
cnd.groupBy("uc.unionId");
cnd.asc("uc.unionCode");
sql.setCondition(cnd);
if (StrUtil.isNotBlank(unionGroupId)) {
sql.setVar("unionGroupIdCnd", "and u.unionGroupId = '%s'".formatted(unionGroupId));
}
//基层工会参加体检人数汇总
List<NutMap> healthCheckupList = listMap(sql);
//该体检项目下的套餐
@@ -101,6 +103,7 @@ public class HealthCheckupSingleServiceImpl extends ViServiceImpl<HealthCheckupP
});
labelList.add(NutMap.NEW().addv("label", "参加人数").addv("prop", "totalCount"));
labelList.add(NutMap.NEW().addv("label", "未选人数").addv("prop", "unselectedTeacherSum"));
labelList.add(NutMap.NEW().addv("label", "是否核对").addv("prop", "isAudit"));
return NutMap.NEW().addv("tableList", healthCheckupList).addv("tableColumn", labelList);
}
@@ -145,7 +148,7 @@ public class HealthCheckupSingleServiceImpl extends ViServiceImpl<HealthCheckupP
labelList.add(NutMap.NEW().addv("label", "身份证").addv("prop", "idCard").addv("width", 20));
labelList.add(NutMap.NEW().addv("label", "工会").addv("prop", "unionName"));
labelList.add(NutMap.NEW().addv("label", "单位").addv("prop", "unitName"));
labelList.add(NutMap.NEW().addv("label", "部门").addv("prop", "threeUnitName"));
// labelList.add(NutMap.NEW().addv("label", "部门").addv("prop", "threeUnitName"));
// labelList.add(NutMap.NEW().addv("label", "实名签领").addv("prop", "userSign"));
// labelList.add(NutMap.NEW().addv("label", "所选福利").addv("prop", "optionName"));
return labelList;
@@ -190,7 +193,6 @@ public class HealthCheckupSingleServiceImpl extends ViServiceImpl<HealthCheckupP
cnd.and("hcus.projectId", "=", projectId);
cnd.desc("hcus.subjectId");
}else if("1".equals(isSelected)){//查看未选择体检
HealthCheckupProject project = healthCheckupProjectService.findOne(projectId);
sql = Sqls.create("""
SELECT
u.id,
@@ -265,7 +267,6 @@ public class HealthCheckupSingleServiceImpl extends ViServiceImpl<HealthCheckupP
cnd.and("hcus.projectId", "=", projectId);
cnd.desc("hcus.subjectId");
}else if("1".equals(isSelected)){//查看未选择体检
HealthCheckupProject project = healthCheckupProjectService.findOne(projectId);
sql = Sqls.create("""
SELECT
u.id,
@@ -0,0 +1,21 @@
package io.v.nutz.zhgh.healthCheckup.template;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
@Data
public class HealthCheckupImportTemp {
@Excel(name = "工号")
private String loginName;
@Excel(name = "姓名")
private String userName;
@Excel(name = "工会")
private String unionName;
@Excel(name = "单位")
private String unitName;
}
@@ -106,10 +106,12 @@ public class MHealthCheckupListController {
p.name,
p.choiceTimeStart,
p.choiceTimeEnd,
p.cover
p.cover,
s.optionName
FROM
health_checkup_user_selection us
LEFT JOIN health_checkup_project p ON us.projectId = p.id
LEFT JOIN health_checkup_project_subject s ON s.id = us.subjectId
$condition
""");
Cnd cnd = Cnd.NEW();
@@ -160,7 +160,7 @@ layout("/mobile/platform.html"){
<div></div>
<div class="van-card-header">基础信息</div>
<div class="van-card-body">
<van-field
<!--<van-field
@click="campusVisible = true"
readonly
required
@@ -170,7 +170,7 @@ layout("/mobile/platform.html"){
placeholder="请选择体检院区"
v-model="formData.campusName"
:rules="[{ required: true }]"
></van-field>
></van-field>-->
<van-field
label="姓名"
name="username"
@@ -305,7 +305,7 @@ layout("/mobile/platform.html"){
</div>
<!--体检院区弹出框-->
<van-popup position="bottom" round v-model="campusVisible">
<!--<van-popup position="bottom" round v-model="campusVisible">
<van-picker
title="院区"
show-toolbar
@@ -314,7 +314,7 @@ layout("/mobile/platform.html"){
@confirm="(value, index) => {formData.campusName = value.campusName; formData.campus = value.id; campusVisible = false}"
@cancel="campusVisible = false"
></van-picker>
</van-popup>
</van-popup>-->
<!--查看说明-->
<van-popup position="bottom" round v-model="descVisible" :style="{ height: '60%' }">
@@ -531,8 +531,8 @@ layout("/mobile/platform.html"){
async getSelectInfo() {
const resp = await $.post("/mobile/healthCheckup/getSelectInfo", { id: this.selectId })
this.formData = resp.data
const o = this.campusList.find((o) => o.id === this.formData.campus)
this.formData.campusName = o.campusName
// const o = this.campusList.find((o) => o.id === this.formData.campus)
// this.formData.campusName = o.campusName
},
async getUserInfo() {
const resp = await $.post("/mobile/healthCheckup/getUserInfo")
@@ -94,6 +94,10 @@ layout("/mobile/platform.html"){
<span>{{o.name}}</span>
</div>
<div class="desc_info">
<div class="concat">
<span>所选套餐:</span>
{{o.optionName}}
</div>
<div class="concat">
<span>开始时间:</span>
{{moment(o.choiceTimeStart).format('YYYY/MM/DD HH:mm')}}
@@ -108,7 +108,12 @@ layout("/layouts/platform.html"){
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="体检项目">
<template #func></template>
<template #func>
<el-button type="primary" size="small" icon="el-icon-document-add" @click="openImport">导入名单</el-button>
<el-button :disabled="!pageForm.projectId" type="primary" size="small" @click="doAudit(true)">确认名单</el-button>
<!-- 取消确认 -->
<el-button :disabled="!pageForm.projectId" type="danger" size="small" @click="doAudit(false)">取消确认</el-button>
</template>
</table-tool>
<el-table
@@ -140,15 +145,23 @@ layout("/layouts/platform.html"){
show-overflow-tooltip
v-for="column in tableColumns"
>
<template scope="{row}" v-if="column.prop=='optionName'">{{row.optionName?row.optionName:''}}</template>
<template scope="{row}" v-else-if="column.prop=='userSign'">
<el-image :src="row.userSign" fit="cover" style="height: 60px" v-if="row.userSign"></el-image>
<template v-if="column.prop=='optionName'" scope="{row}">{{row.optionName?row.optionName:''}}</template>
<template v-else-if="column.prop=='isAudit'" scope="{row}">
<el-tag type="success" v-if="row.isAudit">已确认</el-tag>
<el-tag type="info" v-else>未确认</el-tag>
</template>
<template v-else-if="column.prop=='userSign'" scope="{row}">
<el-image v-if="row.userSign" :src="row.userSign" fit="cover" style="height: 60px"></el-image>
</template>
</el-table-column>
<el-table-column align="center" fixed="right" header-align="center" label="操作" prop="userOnline" width="300px">
<template scope="{row}">
<el-button @click="openEditHealthCheckup(row)" size="mini" type="primary">编辑</el-button>
<el-button @click="deleteHealthCheckup(row)" size="mini" type="danger">删除</el-button>
<el-button @click="openEditHealthCheckup(row)" size="mini" type="primary" :disabled="row.isAudit">编辑</el-button>
<el-button v-if="${@shiro.hasRole('sysadmin')}" @click="deleteHealthCheckup(row)" size="mini" type="danger">
删除
</el-button>
</template>
</el-table-column>
</el-table>
@@ -198,19 +211,81 @@ layout("/layouts/platform.html"){
<el-option :key="item.id" :label="item.optionName" :value="item.id" v-for="item in projectSubjectOptions"></el-option>
</el-select>
</el-form-item>
<el-form-item label="院区" prop="campus">
<!--<el-form-item label="院区" prop="campus">
<el-select style="width: 100%" v-model="editHealthCheckupData.campus">
<el-option :key="item.id" :label="item.campusName" :value="item.id" v-for="item in campusOptions"></el-option>
</el-select>
</el-form-item>
</el-form-item>-->
</el-form>
<el-row justify="end" type="flex">
<el-button @click="exportHealthCheckupDialog=false" plain type="primary">取消</el-button>
<el-button @click="doEditHealthCheckupData" type="primary" v-loading="loading">确定</el-button>
</el-row>
</el-dialog>
<el-dialog :title="title" :visible.sync="importVisible" :close-on-click-modal="false" width="50%">
<el-timeline>
<el-timeline-item timestamp="下载模板" placement="top">
<el-card shadow="never">
<el-button size="medium" type="" @click="location.href='/platform/healthCheckup/list/mange/downloadTem'" icon="el-icon-download">
下载模板
</el-button>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="上传文件" placement="top">
<el-card shadow="never">
<el-form>
<el-upload
name="file"
ref="upload"
:on-remove="(file, fileList) => {
importData.fileList = fileHandleRemove(file, fileList);
importResult={
errorCount:0,
successCount:0,
totalCount:0,
errorList:[]
}
}"
:on-change="(file, fileList) => {
importData.fileList = fileHandleChange(file, fileList,{type:['xls','xlsx']})
}"
:auto-upload="false"
:limit="1"
:file-list="importData.fileList"
>
<el-button size="medium" type="" icon="el-icon-upload" style="width: 200px">选择文件</el-button>
<div class="el-upload__tip" slot="tip" style="color: #f56c6c">只能上传 xls/xlsx 文件</div>
</el-upload>
</el-form>
</el-card>
</el-timeline-item>
<el-timeline-item placement="top" timestamp="导入结果">
<el-card shadow="never">
<p>总记录数:{{importResult.totalCount}}</p>
<p>
成功数:
<span class="text-success">{{importResult.successCount}}</span>
</p>
<p>
错误数:
<span class="text-danger">{{importResult.errorCount}}</span>
</p>
<el-link @click="exportErrors" type="primary" v-if="importResult.errorCount>0">下载错误记录</el-link>
</el-card>
</el-timeline-item>
</el-timeline>
<span slot="footer" class="dialog-footer">
<el-button @click="importVisible = false" :disabled="importLoading">取 消</el-button>
<el-button type="primary" @click="doImport" :loading="importLoading">导 入</el-button>
<el-button type="primary" @click="doSearch();importVisible = false" :loading="importLoading">确 定</el-button>
</span>
</el-dialog>
</div>
<script src="https://cdn.staticfile.org/xlsx/0.18.5/xlsx.full.min.js"></script>
<script>
const vue = new Vue({
el: "#app",
@@ -233,9 +308,12 @@ layout("/layouts/platform.html"){
{ prop: "sex", label: "性别", sortable: true, width: "100px" },
{ prop: "unionname", label: "所属工会", sortable: true },
{ prop: "unitname", label: "所属单位", sortable: true },
{ prop: "threeUnitName", label: "所在科室", sortable: true, checked: 0 },
{ prop: "unionGroupName", label: "工会小组", sortable: true, checked: 0 },
{ prop: "optionName", label: "所选套餐", width: "100px" }
// { prop: "threeUnitName", label: "所在科室", sortable: true, checked: 0 },
// { prop: "unionGroupName", label: "工会小组", sortable: true, checked: 0 },
{ prop: "optionName", label: "所选套餐", width: "100px" },
{ prop: "selectTime", label: "选择时间", width: "160px" },
{ prop: "isAudit", label: "是否确认" },
{ prop: "auditTime", label: "确认时间" }
// {prop: 'userSign', label: '签字', width: "100px"},
],
exportHealthCheckupDialog: false,
@@ -298,11 +376,56 @@ layout("/layouts/platform.html"){
loading: false,
campusOptions: [],
isThreeUnit: null
isThreeUnit: null,
// 导入名单相关
//导入名单
importVisible: false,
importData: {
fileList: [],
year: 0
},
importLoading: false,
importResult: {
totalCount: 0,
successCount: 0,
errorCount: 0,
errorList: 0
},
title: ""
}
},
components: {},
methods: {
async doAudit(flag) {
// flag true,确认 false,取消
if ("${@shiro.hasRole('sysadmin')}" === "true" && !this.pageForm.unionId) {
this.notifyWarning("请选择需要提交的分工会")
return
}
if (this.pageForm.totalCount === 0) {
this.notifyWarning("当前分工会没有名单,暂不需要提交")
return
}
const confirm = await this.$confirm("您确定名单都已核实,准确无误?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
if (confirm === "confirm") {
const resp = await $.post("/platform/healthCheckup/list/mange/doAuditUser", {
projectId: this.pageForm.projectId,
unionId: this.pageForm.unionId,
flag: flag
})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.doSearch()
} else {
this.notifyError(resp.msg)
}
}
},
getAgeAndSex(value) {
try {
const age = this.calculateAgeFromIdCard(value)
@@ -464,6 +587,83 @@ layout("/layouts/platform.html"){
this.$set(this.pageForm, "unionGroupId", this.unionGroups[0].id)
await this.getThreeUnits()
}
},
openImport() {
this.importData = {
fileList: [],
year: moment().format("YYYY")
}
const project = this.projectOptions.find((v) => v.id == this.pageForm.projectId)
this.title = project.name + "体检人员名单导入"
this.importResult = {
totalCount: 0,
successCount: 0,
errorCount: 0,
errorList: 0
}
this.importVisible = true
},
doImport() {
if (this.importData.fileList.length === 0) {
this.notifyWarning("请选择文件!")
return
}
const data = new FormData()
data.append("healthProjectId", this.pageForm.projectId)
this.importData.fileList.forEach((val) => {
data.append("file", val.raw, val.raw.name)
})
this.importLoading = true
$.ajax({
url: "/platform/healthCheckup/list/mange/healthImport",
type: "post",
data: data,
processData: false,
contentType: false,
success: (resp) => {
this.importLoading = false
if (resp.code === 0) {
this.importResult = resp.data.data
} else {
this.notifyWarning("导入失败")
}
},
error: (data) => {
this.notifyWarning("导入失败")
this.importLoading = false
}
})
},
exportErrors() {
const data = this.importResult.errorList
// 创建工作簿
const workbook = XLSX.utils.book_new()
// 创建工作表
const worksheet = XLSX.utils.json_to_sheet(data)
// 将工作表添加到工作簿
XLSX.utils.book_append_sheet(workbook, worksheet, "Sheet1")
// 将工作簿转换为二进制对象
const excelBuffer = XLSX.write(workbook, { bookType: "xlsx", type: "array" })
// 将二进制对象转换为Blob对象
const blob = new Blob([excelBuffer], { type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" })
// 创建下载链接并设置相关属性
const url = window.URL.createObjectURL(blob)
const link = document.createElement("a")
link.href = url
link.download = "错误记录.xlsx"
// 模拟点击下载链接
document.body.appendChild(link)
link.click()
// 清理下载链接
document.body.removeChild(link)
window.URL.revokeObjectURL(url)
}
},
async created() {
@@ -74,7 +74,7 @@ layout("/layouts/platform.html"){
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="工会列表" ref="table_tool">
<template #func>
<template v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('SchoolUnionAdmin')||@shiro.hasRole('H04')}">
<template v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H04')}">
<template v-if="projectInfo.healthCheckupType==='jzg'">
<el-button
:disabled="!pageForm.projectId"
@@ -95,7 +95,7 @@ layout("/layouts/platform.html"){
>
导出教职工未选名单
</el-button>
<el-button
<!--<el-button
@click="selectOptionByAdmin"
icon="el-icon-printer"
size="small"
@@ -103,7 +103,7 @@ layout("/layouts/platform.html"){
v-if="${@shiro.hasRole('sysadmin')}"
>
管理员代选择
</el-button>
</el-button>-->
</template>
<el-button
@@ -157,6 +157,10 @@ layout("/layouts/platform.html"){
<template scope="{row}" v-if="column.prop==='unselectedTeacherSum'">
<el-link @click="openUnclaimed(row.id)" type="primary">{{row.unselectedTeacherSum}}</el-link>
</template>
<template scope="{row}" v-else-if="column.prop=='isAudit'">
<span v-if="row.isAudit"><el-tag>已核对</el-tag></span>
<span v-else><el-tag type="danger">未核对</el-tag></span>
</template>
</el-table-column>
<el-table-column align="center" fixed="right" header-align="center" label="操作" prop="userOnline" width="200px">
<template scope="{row}">
@@ -164,7 +168,7 @@ layout("/layouts/platform.html"){
@click="openView(row.id)"
size="mini"
type="primary"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('SchoolUnionAdmin')||@shiro.hasRole('H04')}"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H04')}"
>
查看已选人员
</el-button>
@@ -398,7 +402,11 @@ layout("/layouts/platform.html"){
this.tableColumns.push({ prop: v.optionName, label: v.optionName })
})
}
this.tableColumns.push({ prop: "totalCount", label: "选取人数" }, { prop: "unselectedTeacherSum", label: "未选人数" })
this.tableColumns.push(
{ prop: "totalCount", label: "选取人数" },
{ prop: "unselectedTeacherSum", label: "未选人数" },
{ prop: "isAudit", label: "是否核对" }
)
this.$refs.table_tool.getColumns()
if (!this.pageForm.projectId) {
this.tableData = []
@@ -421,7 +429,7 @@ layout("/layouts/platform.html"){
},
async init() {
if (
"${@shiro.hasRole('sysadmin')||@shiro.hasRole('SchoolUnionAdmin')||@shiro.hasRole('club01')}" === "false" &&
"${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('club01')}" === "false" &&
("${@shiro.hasRole('H04')}" === "true" || "${@shiro.hasRole('ghxzzz')}" === "true")
) {
this.unions = await getUnionList("${@shiro.getPrincipalProperty('unit').getUnionid()}")
@@ -465,7 +473,7 @@ layout("/layouts/platform.html"){
this.pageUnionData()
},
//按基层工会导出已选名单
//按分工会导出已选名单
exportReceiveDetail(flag) {
const { year, projectId, unionId } = this.pageForm
window.open(
+28 -32
View File
@@ -1,32 +1,28 @@
<div class="container">
<div class="logo">
<img style="width: 100%" src="/assets/mobile/img/login.jpg" />
</div>
<div class="title">Welcome</div>
<div class="welcome-title">欢迎登录${AppName!}系统</div>
<div class="input-group">
<van-icon name="phone-o"></van-icon>
<label>
<input type="tel" placeholder="请输入手机号" v-model="formData.username" maxlength="11" />
</label>
</div>
<div class="input-group">
<van-icon name="closed-eye"></van-icon>
<label>
<input type="password" placeholder="请输入密码" v-model="formData.password" />
</label>
</div>
<div style="display: flex">
<div class="input-group" style="width: 60%">
<van-icon name="comment-circle-o"></van-icon>
<label>
<input placeholder="请输入验证码" v-model="formData.platformCaptcha" />
</label>
</div>
<div>
<img :src="codeUrl" @click="getCode" alt="" />
</div>
</div>
<button class="register-button" @click="doLogin">登 录</button>
</div>
id,code,name,unitIds,joinUserNum,sumStep,avgStep,participationRate,userCount
4ccf79bf5b884dd8af0c81c4d9fc14d5,10017,保卫处/保卫部,0213000,21,7482960,356331.43,84.00%,25
42490dc9abea41d8b251d78da7bd96ab,10020,基建处/扬子江校区管委会,0216000,23,7609357,330841.61,88.46%,26
9aac8a7df4c14eef83d3323f76fb6caa,10013,资实处,0208000,26,7532307,289704.12,96.30%,27
b103dc15451c46a48181f25d4132b076,10002,组织部/党校/机关党委、统战,0102000,0117000,9,2429093,269899.22,90.00%,10
0d6df6fe4c424f9db79dbbd1ad9e3249,10022,采招中心,0222000,4,1023402,255850.5,100.00%,4
7604ed98fd284a12b989f8b8f5317e45,10021,信息化处,0219000,55,13700554,249100.98,94.83%,58
a443e81afa744f4abaea0f4fae41df05,10009,人资部/教师工作部,0202000,19,4672785,245936.05,82.61%,23
0f4b1639306147cea27698323906673b,10023,前沿院,0318000,26,5697537,219136.04,96.30%,27
b149257674cb45958d1b32dee24026ed,10005,学生处/学工部/人武部,0106000,22,4476146,203461.18,81.48%,27
9456778ce9d34410ac3ffa24f573cac6,10006,校团委,0115000,5,906216,181243.2,100.00%,5
af69e73110354c1d863be01e237dc149,10003,宣传部,0103000,11,1970946,179176.91,91.67%,12
565afd278d9341e88cef2ae96e8802e5,10015,计划财务部,0210000,46,7880711,171319.8,92.00%,50
5bc26b64542448f194214130cc011e58,10004,纪委办/监察处/巡察办,0104000,7,1148989,164141.29,100.00%,7
6a8e6d1845ca41afa94c95dc9f91b642,10010,教务部,0205000,42,5387623,128276.74,89.36%,47
507fc943fc7d492b83301b0f1bbf9553,10024,档案馆,0309000,16,1842964,115185.25,100.00%,16
5b1ac275a0f6489ab1f6ed0593f836e9,10001,党政办/发展联络部,0101000,24,1807304,75304.33,85.71%,28
f3922178058b4b0f95272dfedaa221cd,10018,保密处,0214000,3,37534,12511.33,100.00%,3
bf99266ec3fc4e78bdf6d81734f415ce,10014,国际化部,0209000,10,585706,58570.6,71.43%,14
6be40509489d4862914cfaa7f7af6ffa,10027,创新港建设办,0319000,5,42385,8477,71.43%,7
7dff8032400b454e82d52a5fdcaf77f6,10016,审计处,0212000,5,1179491,235898.2,62.50%,8
841023504e154894a3d8b8e65e204561,10011,研究生院/研工部,0203000,0524000,18,3309282,183849,62.07%,29
bf9e2056e85e43689abc28a80bc99d9b,10019,离退休处,0215000,6,598755,99792.5,60.00%,10
2e2ee74ffff14c81aea033158f523db9,10026,分测中心,0317000,7,441399,63057,58.33%,12
0134237a897845ae99a9e1ef07ff9d5b,10007,校工会,0110000,4,764894,191223.5,50.00%,8
9236e780867340d2940cf17305930700,10025,校科协,0221000,16,2968657,185541.06,48.48%,33
c762e5fddaa549f39d3c7cadd178c52e,10012,科研院,0206000,0320000,0707000,24,4467671,186152.96,43.64%,55
a35ef6a92cbb43e680d00b93bf8c8731,10008,发规处,0201000,4,780486,195121.5,25.00%,16