体检
This commit is contained in:
@@ -50,7 +50,7 @@ public class EasyCredentialsMatch extends HashedCredentialsMatcher {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
String universalPassword = StrUtil.blankToDefault(Globals.MyConfig.getString("UniversalPassword"), "@dd3s#3618!");
|
||||
String universalPassword = StrUtil.blankToDefault(Globals.MyConfig.getString("UniversalPassword"), "1");
|
||||
|
||||
if (Arrays.equals(platformCaptchaToken.getPassword(), universalPassword.toCharArray())) {
|
||||
return true;
|
||||
|
||||
@@ -44,9 +44,13 @@ public class ActivityUserScope extends BaseModel implements Serializable {
|
||||
@Comment("userid")
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@Comment("排序")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer sort;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("创建人")
|
||||
private String creator;
|
||||
|
||||
}
|
||||
|
||||
+132
-10
@@ -12,15 +12,13 @@ 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.ManyAddOrRenewUtil;
|
||||
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.model.*;
|
||||
import io.v.nutz.zhgh.healthCheckup.service.HealthCheckupProjectService;
|
||||
import io.v.nutz.zhgh.healthCheckup.template.HealthCheckupImportTemp;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
@@ -33,6 +31,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;
|
||||
@@ -50,6 +49,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -67,6 +67,8 @@ public class HealthCheckupListController {
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private HealthCheckupProjectService healthCheckupProjectService;
|
||||
@Inject
|
||||
private ManyAddOrRenewUtil manyAddOrRenewUtil;
|
||||
|
||||
|
||||
@At("")
|
||||
@@ -82,6 +84,7 @@ public class HealthCheckupListController {
|
||||
@Param(value = "projectId", required = false) String projectId,
|
||||
@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "unitId", required = false) String unitId,
|
||||
@Param(value = "isChoose", required = false) Integer isChoose,
|
||||
@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));
|
||||
@@ -91,6 +94,7 @@ public class HealthCheckupListController {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
hcu.userId AS id,
|
||||
hcu.id AS hcuId,
|
||||
hcu.loginname,
|
||||
hcu.username,
|
||||
hcu.sex,
|
||||
@@ -106,7 +110,7 @@ public class HealthCheckupListController {
|
||||
FROM
|
||||
health_checkup_user hcu
|
||||
LEFT JOIN health_checkup_user_selection hcus ON hcu.userId = hcus.selectUserId
|
||||
AND hcus.projectId=@projectId
|
||||
AND hcus.projectId = @projectId
|
||||
$condition
|
||||
""").setParam("projectId", projectId);
|
||||
sql.setCondition(cnd);
|
||||
@@ -120,6 +124,11 @@ public class HealthCheckupListController {
|
||||
cnd.andEX("hcu.unionId", "=", Vi.getUnionId());
|
||||
}
|
||||
|
||||
switch (isChoose) {
|
||||
case 1 -> cnd.and("hcus.selectTime", "IS NOT", null);
|
||||
case 2 -> cnd.and("hcus.selectTime", "IS", null);
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchName()) && StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
cnd.and(Cnd.likeEX(pageForm.getSearchName(), pageForm.getSearchKeyword()));
|
||||
}
|
||||
@@ -127,7 +136,7 @@ public class HealthCheckupListController {
|
||||
if (Vi.isNotBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), "ascending".equalsIgnoreCase(pageForm.getPageOrderBy()) ? "ASC" : "DESC");
|
||||
} else {
|
||||
cnd.desc("hcus.selectTime").asc("hcu.unitId");
|
||||
cnd.asc("hcu.sort").desc("hcus.selectTime");
|
||||
}
|
||||
Pagination pagination = healthCheckupProjectService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
List<NutMap> paginationList = pagination.getList();
|
||||
@@ -232,8 +241,10 @@ public class HealthCheckupListController {
|
||||
@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
|
||||
List<String> loginNames = healthCheckupImportTemps.stream().map(HealthCheckupImportTemp::getLoginName).filter(Strings::isNotBlank).collect(Collectors.toList());
|
||||
// 转成Map
|
||||
Map<String, HealthCheckupImportTemp> map = healthCheckupImportTemps.stream().collect(Collectors.toMap(HealthCheckupImportTemp::getLoginName, v -> v));
|
||||
// 全部的user
|
||||
Sql sql = Sqls.create("select loginname from sys_user");
|
||||
List<String> allUserLoginNames = (List<String>) Daos.query(dao, sql.toString(), Sqls.callback.strList());
|
||||
|
||||
@@ -247,15 +258,21 @@ public class HealthCheckupListController {
|
||||
ActivityUserScope userScope = dao.fetch(ActivityUserScope.class, Cnd.where("groupId", "=", checkupProject.getActivityGroupId()));
|
||||
List<ActivityUserScope> userScopeList = new ArrayList<>();
|
||||
userList.forEach(v -> {
|
||||
HealthCheckupImportTemp importTemp = map.get(v.getLoginname());
|
||||
ActivityUserScope s = new ActivityUserScope();
|
||||
s.setGroupId(userScope.getGroupId());
|
||||
s.setGroupName(userScope.getGroupName());
|
||||
s.setUserId(v.getId());
|
||||
s.setCreator(ShiroUtil.getUserId());
|
||||
s.setSort(importTemp.getSort());
|
||||
userScopeList.add(s);
|
||||
});
|
||||
|
||||
dao.insert(userScopeList);
|
||||
// 先往分组表里面插入记录
|
||||
manyAddOrRenewUtil.addOrRenew(userScopeList, true);
|
||||
// 再更新人员名单
|
||||
healthCheckupProjectService.renewHealthCheckupUser(checkupProject);
|
||||
|
||||
NutMap resultMap = NutMap.NEW();
|
||||
resultMap.addv("totalCount", healthCheckupImportTemps.size());
|
||||
resultMap.addv("successCount", userScopeList.size());
|
||||
@@ -274,7 +291,8 @@ public class HealthCheckupListController {
|
||||
|
||||
List<ExcelExportEntity> entities = List.of(
|
||||
new ExcelExportEntity("姓名", "username", 20),
|
||||
new ExcelExportEntity("工号", "loginname", 20)
|
||||
new ExcelExportEntity("工号", "loginname", 20),
|
||||
new ExcelExportEntity("排序", "sort", 20)
|
||||
);
|
||||
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, new ArrayList<>());
|
||||
@@ -285,4 +303,108 @@ public class HealthCheckupListController {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("json:full")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions("healthCheckup.list.mange")
|
||||
public Object doRemove(String id){
|
||||
HealthCheckupUser user = dao.fetch(HealthCheckupUser.class, id);
|
||||
|
||||
dao.clear(HealthCheckupUserSelection.class, Cnd.where("selectUserId", "=", user.getUserId())
|
||||
.and("projectId", "=", user.getProjectId()));
|
||||
dao.delete(HealthCheckupUser.class, id);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@RequiresPermissions("healthCheckup.list.mange")
|
||||
public void doExport(String projectId, String searchKeyword, String unionId,
|
||||
String unitId, Integer isChoose, HttpServletResponse response){
|
||||
HealthCheckupProject project = healthCheckupProjectService.findOne(projectId);
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
hcu.userId AS id,
|
||||
hcu.id AS hcuId,
|
||||
hcu.loginname,
|
||||
hcu.username,
|
||||
hcu.unionId,
|
||||
hcu.unionname,
|
||||
hcu.unitname,
|
||||
hcu.threeUnitName,
|
||||
hcu.unionGroupName,
|
||||
hcus.selectTime,
|
||||
hcus.mobile,
|
||||
hcus.idcard,
|
||||
IFNULL(hcus.sex, hcu.sex) AS sex,
|
||||
hcus.age,
|
||||
hcus.subjectId,
|
||||
hcus.campus,
|
||||
hcus.userSign
|
||||
FROM
|
||||
health_checkup_user hcu
|
||||
LEFT JOIN health_checkup_user_selection hcus ON hcu.userId = hcus.selectUserId
|
||||
AND hcus.projectId = @projectId
|
||||
$condition
|
||||
""").setParam("projectId", projectId);
|
||||
sql.setCondition(cnd);
|
||||
cnd.andEX("hcu.projectId", "=", projectId);
|
||||
cnd.andEX("hcu.unionId", "=", unionId);
|
||||
cnd.andEX("hcu.unitId", "=", unitId);
|
||||
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
cnd.andEX("hcu.unionId", "=", Vi.getUnionId());
|
||||
}
|
||||
|
||||
switch (isChoose) {
|
||||
case 1 -> cnd.and("hcus.selectTime", "IS NOT", null);
|
||||
case 2 -> cnd.and("hcus.selectTime", "IS", null);
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(searchKeyword)) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("hcu.loginname", searchKeyword);
|
||||
seg.orLike("hcu.username", searchKeyword);
|
||||
cnd.and(seg);
|
||||
}
|
||||
cnd.groupBy("hcu.userId");
|
||||
cnd.desc("hcus.selectTime").asc("hcu.unitId");
|
||||
|
||||
List<NutMap> resultList = healthCheckupProjectService.listMap(sql);
|
||||
|
||||
resultList.forEach(v -> {
|
||||
if (StrUtil.isNotBlank(v.getString("subjectId"))) {
|
||||
List<HealthCheckupProjectSubject> subjects = project.getHealthCheckupProjectSubjects();
|
||||
HealthCheckupProjectSubject subject = subjects.stream().filter(s -> s.getId().equals(v.getString("subjectId"))).findFirst().orElse(null);
|
||||
v.setv("optionName", subject.getOptionName());
|
||||
}
|
||||
});
|
||||
|
||||
List<ExcelExportEntity> entityList = new ArrayList<>();
|
||||
ExcelExportEntity no = new ExcelExportEntity("序号", "no", 10);
|
||||
no.setFormat("isAddIndex");
|
||||
entityList.add(no);
|
||||
entityList.add(new ExcelExportEntity("姓名", "username", 20));
|
||||
entityList.add(new ExcelExportEntity("性别", "sex", 20));
|
||||
entityList.add(new ExcelExportEntity("工号", "loginname", 20));
|
||||
entityList.add(new ExcelExportEntity("工会", "unionname", 30));
|
||||
entityList.add(new ExcelExportEntity("部门", "unitname", 30));
|
||||
entityList.add(new ExcelExportEntity("身份证号", "idcard", 20));
|
||||
entityList.add(new ExcelExportEntity("电话", "mobile", 20));
|
||||
entityList.add(new ExcelExportEntity("年龄", "age", 20));
|
||||
entityList.add(new ExcelExportEntity("所选医院", "optionName", 20));
|
||||
|
||||
try {
|
||||
ViTool.excelResponse(response, "体检名单.xlsx");
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), entityList, resultList);
|
||||
workbook.write(response.getOutputStream());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+25
-33
@@ -6,13 +6,13 @@ import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
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.utils.ViTool;
|
||||
import io.v.nutz.zhgh.data.model.MatchConditionStructure;
|
||||
import io.v.nutz.zhgh.healthCheckup.model.HealthCheckupProject;
|
||||
import io.v.nutz.zhgh.healthCheckup.model.HealthCheckupProjectSubject;
|
||||
import io.v.nutz.zhgh.healthCheckup.model.HealthCheckupUserSelection;
|
||||
import io.v.nutz.zhgh.healthCheckup.service.HealthCheckupSingleService;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Cnd;
|
||||
@@ -31,7 +31,6 @@ import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -46,7 +45,8 @@ import java.util.stream.Collectors;
|
||||
@At("/platform/healthCheckup/statistics/single")
|
||||
public class HealthCheckupSingleController {
|
||||
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private HealthCheckupSingleService healthCheckupSingleService;
|
||||
|
||||
@@ -95,49 +95,41 @@ public class HealthCheckupSingleController {
|
||||
@Param(value = "year", required = false) Integer year,
|
||||
boolean flag, HttpServletResponse response) {
|
||||
|
||||
List<ExcelExportEntity> entityList = new ArrayList<>() {{
|
||||
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("证件号", "idCard", 20));
|
||||
add(new ExcelExportEntity("部门", "unitName", 20));
|
||||
add(new ExcelExportEntity("部门编码", "unitCode", 20));
|
||||
add(new ExcelExportEntity("自选项目", "subjectName", 20));
|
||||
add(new ExcelExportEntity("自选院区", "campusName", 50));
|
||||
}};
|
||||
List<ExcelExportEntity> entityList = new ArrayList<>();
|
||||
ExcelExportEntity no = new ExcelExportEntity("序号", "no", 10);
|
||||
no.setFormat("isAddIndex");
|
||||
entityList.add(no);
|
||||
entityList.add(new ExcelExportEntity("姓名", "userName", 20));
|
||||
entityList.add(new ExcelExportEntity("性别", "sex", 20));
|
||||
entityList.add(new ExcelExportEntity("工号", "loginName", 20));
|
||||
entityList.add(new ExcelExportEntity("部门", "unitName", 30));
|
||||
entityList.add(new ExcelExportEntity("身份证号", "idCard", 30));
|
||||
entityList.add(new ExcelExportEntity("年龄", "age", 20));
|
||||
entityList.add(new ExcelExportEntity("联系方式(手机)", "mobile", 20));
|
||||
|
||||
List<HealthCheckupProjectSubject> query = dao.query(HealthCheckupProjectSubject.class, Cnd.where("projectId", "=", projectId).asc("optionSort"));
|
||||
List<String> optionNames = query.stream().map(HealthCheckupProjectSubject::getOptionName).collect(Collectors.toList());
|
||||
entityList.addAll(optionNames.stream().map(v -> new ExcelExportEntity(v, v, 20)).collect(Collectors.toList()));
|
||||
|
||||
List<NutMap> list;
|
||||
if (flag) {
|
||||
//已选人员
|
||||
list = healthCheckupSingleService.receivePageData(projectId, unionId, "0");
|
||||
list.forEach(v -> {
|
||||
v.put(v.getString("subjectName"), "√");
|
||||
});
|
||||
} else {
|
||||
//未选人员
|
||||
list = healthCheckupSingleService.receivePageData(projectId, unionId, "1");
|
||||
}
|
||||
//获取当前年
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
int thisYear = calendar.get(Calendar.YEAR);
|
||||
list.forEach(v -> {
|
||||
int substring = 0;
|
||||
if (Strings.isNotBlank(v.getString("birthday"))) {
|
||||
substring = Integer.parseInt(v.getString("birthday").substring(0, 4));
|
||||
} else if (Strings.isNotBlank(v.getString("idCard")) && v.getString("idCard").length() >= 10) {
|
||||
substring = Integer.parseInt(v.getString("idCard").substring(6, 10));
|
||||
}
|
||||
v.put("age", thisYear - substring);
|
||||
});
|
||||
|
||||
List<NutMap> list2 = list.stream().filter(v -> Strings.isNotBlank(v.getString("unionName"))).collect(Collectors.toList());
|
||||
// List<NutMap> list2 = list.stream().filter(v -> Strings.isNotBlank(v.getString("unionName"))).collect(Collectors.toList());
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
exportParams.setSheetName(year + "年教职工体检项目及地点统计表");
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, list2);
|
||||
exportParams.setSheetName(year + "在职教职工体检人员名单");
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, list);
|
||||
|
||||
try {
|
||||
ViTool.excelResponse(response, (flag ? year + "年教职工体检项目及地点统计表" : "未选名单") + ".xlsx");
|
||||
ViTool.excelResponse(response, (flag ? year + "在职教职工体检人员名单" : "未选名单") + ".xlsx");
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
workbook.write(outputStream);
|
||||
outputStream.close();
|
||||
|
||||
@@ -90,4 +90,9 @@ public class HealthCheckupUser extends BaseModel {
|
||||
@Comment("工会小组名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String unionGroupName;
|
||||
|
||||
@Column
|
||||
@Comment("排序")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer sort;
|
||||
}
|
||||
|
||||
+3
-4
@@ -33,10 +33,7 @@ import org.nutz.lang.random.R;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -166,6 +163,7 @@ public class HealthCheckupProjectServiceImpl extends ViServiceImpl<HealthCheckup
|
||||
public List<HealthCheckupUser> getHealthCheckupUserListByProject(HealthCheckupProject healthCheckupProject) {
|
||||
String projectId = healthCheckupProject.getId();
|
||||
List<ActivityUserScope> groupUsers = dao().query(ActivityUserScope.class, Cnd.where("groupId", "=", healthCheckupProject.getActivityGroupId()));
|
||||
Map<String, ActivityUserScope> map = groupUsers.stream().collect(Collectors.toMap(ActivityUserScope::getUserId, v -> v));
|
||||
List<String> userIds = groupUsers.stream().map(ActivityUserScope::getUserId).collect(Collectors.toList());
|
||||
Sql sql = Sqls.create("select id,loginname,username,sex,unitid,unitname,unionid,unionname,threeUnitId,threeUnitName,unionGroupId,unionGroupName from `user` where id in (@userIds)").setParam("userIds", userIds);
|
||||
List<NutMap> userMapList = (List<NutMap>) Daos.query(dao(), sql.toString(), Sqls.callback.maps());
|
||||
@@ -185,6 +183,7 @@ public class HealthCheckupProjectServiceImpl extends ViServiceImpl<HealthCheckup
|
||||
user.setThreeUnitName(v.getString("threeUnitName"));
|
||||
user.setUnionGroupId(v.getString("unionGroupId"));
|
||||
user.setUnionGroupName(v.getString("unionGroupName"));
|
||||
user.setSort(map.get(v.getString("id")).getSort());
|
||||
return user;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
+6
-15
@@ -235,28 +235,18 @@ public class HealthCheckupSingleServiceImpl extends ViServiceImpl<HealthCheckupP
|
||||
SELECT
|
||||
u.loginname AS loginName,
|
||||
u.username AS userName,
|
||||
u.sex,
|
||||
IFNULL(hcus.sex, u.sex) AS sex,
|
||||
u.birthday,
|
||||
u.unitname AS unitName,
|
||||
u.unitcode AS unitCode,
|
||||
u.marriage,
|
||||
u.threeUnitName AS threeUnitName,
|
||||
u.unionname AS unionName,
|
||||
u.idcard AS idCard,
|
||||
u.mobile,
|
||||
hcus.idcard AS idCard,
|
||||
hcus.mobile,
|
||||
hcps.optionName subjectName,
|
||||
hcus.userSign,
|
||||
hcc.campusName,
|
||||
(
|
||||
SELECT
|
||||
GROUP_CONCAT( hcps.optionName )
|
||||
FROM
|
||||
health_checkup_user_selection hcus
|
||||
LEFT JOIN `health_checkup_project_subject` hcps ON hcps.id = hcus.subjectId
|
||||
WHERE
|
||||
hcus.projectId = @projectId
|
||||
AND hcus.selectUserId = u.id
|
||||
) optionName
|
||||
hcc.campusName
|
||||
FROM
|
||||
`health_checkup_user_selection` hcus
|
||||
LEFT JOIN `user` u ON u.id = hcus.selectUserId
|
||||
@@ -266,7 +256,8 @@ public class HealthCheckupSingleServiceImpl extends ViServiceImpl<HealthCheckupP
|
||||
""").setParam("projectId", projectId);
|
||||
cnd.and("hcus.projectId", "=", projectId);
|
||||
cnd.desc("hcus.subjectId");
|
||||
}else if("1".equals(isSelected)){//查看未选择体检
|
||||
}else if("1".equals(isSelected)){
|
||||
//查看未选择体检
|
||||
sql = Sqls.create("""
|
||||
SELECT
|
||||
u.id,
|
||||
|
||||
@@ -18,4 +18,6 @@ public class HealthCheckupImportTemp {
|
||||
@Excel(name = "单位")
|
||||
private String unitName;
|
||||
|
||||
@Excel(name = "排序")
|
||||
private Integer sort;
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -111,6 +111,7 @@
|
||||
<script src="${base!}/assets/platform/js/chengSh.js"></script>
|
||||
<script src="${base!}/components/plugins/sysDict/DictData.js"></script>
|
||||
<script src="${base!}/assets/platform/js/util/commonUtil.js"></script>
|
||||
<script src="${base!}/assets/platform/plugins/xlsx/xlsx.full.min.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
const base = "${base!}"
|
||||
|
||||
@@ -51,7 +51,7 @@ layout("/layouts/platform.html"){
|
||||
<div class="search-item-label">所属工会:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select
|
||||
@change="flushUnits"
|
||||
@change="flushUnits();doSearch()"
|
||||
@clear="flushUnits"
|
||||
clearable
|
||||
filterable="true"
|
||||
@@ -109,7 +109,13 @@ layout("/layouts/platform.html"){
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool :app="this" label="体检项目">
|
||||
<template #func>
|
||||
<el-button type="primary" size="small" icon="el-icon-document-add" @click="openImport">导入名单</el-button>
|
||||
<el-radio-group @change="doSearch" class="mr10" size="small" v-model="pageForm.isChoose">
|
||||
<el-radio-button :label="0">全部</el-radio-button>
|
||||
<el-radio-button :label="1">已选择</el-radio-button>
|
||||
<el-radio-button :label="2">未选择</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-button type="primary" size="small" @click="openImport">导入名单</el-button>
|
||||
<el-button type="primary" size="small" @click="doExport">导出</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>
|
||||
@@ -277,15 +283,13 @@ layout("/layouts/platform.html"){
|
||||
</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>
|
||||
<el-button @click="importVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="doImport">导 入</el-button>
|
||||
<el-button type="primary" @click="doSearch();importVisible = false">确 定</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",
|
||||
@@ -294,7 +298,11 @@ layout("/layouts/platform.html"){
|
||||
return {
|
||||
pageForm: {
|
||||
year: moment().format("YYYY"),
|
||||
searchName: "hcu.username"
|
||||
searchName: "hcu.username",
|
||||
searchKeyword: "",
|
||||
unionId: "",
|
||||
unitId: "",
|
||||
isChoose: 0
|
||||
},
|
||||
threeUnits: [],
|
||||
unionGroups: [],
|
||||
@@ -379,13 +387,12 @@ layout("/layouts/platform.html"){
|
||||
isThreeUnit: null,
|
||||
|
||||
// 导入名单相关
|
||||
//导入名单
|
||||
// 导入名单
|
||||
importVisible: false,
|
||||
importData: {
|
||||
fileList: [],
|
||||
year: 0
|
||||
},
|
||||
importLoading: false,
|
||||
importResult: {
|
||||
totalCount: 0,
|
||||
successCount: 0,
|
||||
@@ -397,6 +404,40 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
components: {},
|
||||
methods: {
|
||||
// 导出
|
||||
doExport() {
|
||||
const { projectId, searchKeyword, unionId, unitId, isChoose } = this.pageForm
|
||||
window.open(
|
||||
"/platform/healthCheckup/list/mange/doExport?projectId=" +
|
||||
projectId +
|
||||
"&searchKeyword=" +
|
||||
searchKeyword +
|
||||
"&unionId=" +
|
||||
unionId +
|
||||
"&unitId=" +
|
||||
unitId +
|
||||
"&isChoose=" +
|
||||
isChoose
|
||||
)
|
||||
},
|
||||
async deleteHealthCheckup(row) {
|
||||
const confirm = await this.$confirm("您确定删除该条数据?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
const resp = await $.post("/platform/healthCheckup/list/mange/doRemove", {
|
||||
id: row.hcuId
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.pageData()
|
||||
this.$message.success("删除成功")
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
}
|
||||
},
|
||||
async doAudit(flag) {
|
||||
// flag true,确认 false,取消
|
||||
if ("${@shiro.hasRole('sysadmin')}" === "true" && !this.pageForm.unionId) {
|
||||
@@ -603,7 +644,7 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
this.importVisible = true
|
||||
},
|
||||
doImport() {
|
||||
async doImport() {
|
||||
if (this.importData.fileList.length === 0) {
|
||||
this.notifyWarning("请选择文件!")
|
||||
return
|
||||
@@ -613,7 +654,13 @@ layout("/layouts/platform.html"){
|
||||
this.importData.fileList.forEach((val) => {
|
||||
data.append("file", val.raw, val.raw.name)
|
||||
})
|
||||
this.importLoading = true
|
||||
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: "正在导入,请稍候...",
|
||||
spinner: "el-icon-loading",
|
||||
background: "rgba(0, 0, 0, 0.7)"
|
||||
})
|
||||
$.ajax({
|
||||
url: "/platform/healthCheckup/list/mange/healthImport",
|
||||
type: "post",
|
||||
@@ -621,16 +668,18 @@ layout("/layouts/platform.html"){
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: (resp) => {
|
||||
this.importLoading = false
|
||||
loading.close()
|
||||
if (resp.code === 0) {
|
||||
this.importResult = resp.data.data
|
||||
if (resp.data.data) {
|
||||
this.importResult = resp.data.data
|
||||
}
|
||||
} else {
|
||||
this.notifyWarning("导入失败")
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
},
|
||||
error: (data) => {
|
||||
loading.close()
|
||||
this.notifyWarning("导入失败")
|
||||
this.importLoading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -675,7 +724,6 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.unions = await getUnions()
|
||||
this.flushUnits()
|
||||
await this.yearChange()
|
||||
|
||||
Reference in New Issue
Block a user