server_commit
This commit is contained in:
+4
-5
@@ -234,21 +234,21 @@ public class HealthCheckupSingleServiceImpl extends ViServiceImpl<HealthCheckupP
|
||||
if ("0".equals(isSelected)){
|
||||
sql = Sqls.create("""
|
||||
SELECT
|
||||
u.loginname AS loginName,
|
||||
u.username AS userName,
|
||||
u.loginName,
|
||||
u.userName,
|
||||
IFNULL(hcus.sex, u.sex) AS sex,
|
||||
u.birthday,
|
||||
u.unitName,
|
||||
u.threeUnitName,
|
||||
u.unionName,
|
||||
hcus.idcard AS idCard,
|
||||
hcus.mobile,
|
||||
hcus.age,
|
||||
hcps.optionName subjectName,
|
||||
hcus.userSign,
|
||||
hcc.campusName
|
||||
FROM
|
||||
`health_checkup_user_selection` hcus
|
||||
LEFT JOIN `health_checkup_user` u ON u.id = hcus.selectUserId
|
||||
LEFT JOIN `health_checkup_user` u ON u.userId = hcus.selectUserId
|
||||
LEFT JOIN `health_checkup_project_subject` hcps ON hcps.id = hcus.subjectId
|
||||
LEFT JOIN `health_checkup_campus` hcc ON hcc.id = hcus.campus
|
||||
$condition
|
||||
@@ -263,7 +263,6 @@ public class HealthCheckupSingleServiceImpl extends ViServiceImpl<HealthCheckupP
|
||||
u.loginname loginName,
|
||||
u.username userName,
|
||||
u.sex,
|
||||
u.birthday,
|
||||
u.unitname unitName,
|
||||
u.unitCode unitCode,
|
||||
u.unionname unionName,
|
||||
|
||||
@@ -124,7 +124,8 @@ public class LxyGhbmController {
|
||||
cnd.and("mefp.hdid", "=", hdid);
|
||||
cnd.andEX("un.id", "=", unionId);
|
||||
if (!ShiroUtil.hasAnyRoles(new String[]{"sysadmin", "SchoolUnionAdmin"})) {
|
||||
cnd.and(new Static("mefp.ghid in " + vi.getMangeUnionStr()));
|
||||
cnd.and("mefp.ghid", "=", Vi.getUnionId());
|
||||
// cnd.and(new Static("mefp.ghid in " + vi.getMangeUnionStr()));
|
||||
//工会管理员查看分配名额大于0的
|
||||
cnd.and("mefp.number", ">", 0);
|
||||
}
|
||||
@@ -230,12 +231,27 @@ public class LxyGhbmController {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions("zgfw.lxy.ghbm")
|
||||
public Object bm(@Param("::data") List<NutMap> bmMapList, @Param("flag") boolean flag) {
|
||||
|
||||
Trans.exec(() -> {
|
||||
try {
|
||||
List<Lxy_bm> bmList = Lang.collection2list(bmMapList, Lxy_bm.class);
|
||||
|
||||
if (Lang.isEmpty(bmList)){
|
||||
return Result.error("未获取到报名数据,请选择人员报名");
|
||||
}
|
||||
|
||||
|
||||
String unionId = Vi.getUnionId();
|
||||
Lxy_mefp meNum = dao.fetch(Lxy_mefp.class, Cnd.where("hdid", "=", bmList.get(0).getHdid()).and("ghid", "=", unionId));
|
||||
|
||||
int size = bmList.size();
|
||||
|
||||
if (size > meNum.getNumber()) {
|
||||
return Result.error("报名人数已满");
|
||||
}
|
||||
|
||||
|
||||
if (Lang.isNotEmpty(bmList)) {
|
||||
lxyBmService.clear(Cnd
|
||||
.NEW().and(Cnd.exps("bmzt", "is", null).or("bmzt", "=", 4))
|
||||
@@ -285,9 +301,14 @@ public class LxyGhbmController {
|
||||
}
|
||||
lxyBmService.insert(bmList);
|
||||
lxyGrxxService.insert(grxxList);
|
||||
return Result.success();
|
||||
} else {
|
||||
return Result.error();
|
||||
}
|
||||
});
|
||||
return null;
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -365,17 +386,19 @@ public class LxyGhbmController {
|
||||
String unionId = Vi.getUnionId();
|
||||
// 已经报名的,排除审核未通过
|
||||
int count = dao.count(Lxy_bm.class, Cnd.where("hdid", "=", projectId).and("ghid", "=", unionId)
|
||||
.and("bmzt", "in", List.of("1", "2", "3", "4", "5", "6")));
|
||||
.and(Cnd.exps("bmzt", "in", List.of("1", "3", "5", "6")).or("bmzt", "is", null)));
|
||||
|
||||
Lxy_mefp fetch = dao.fetch(Lxy_mefp.class, Cnd.where("hdid", "=", projectId).and("ghid", "=", unionId));
|
||||
|
||||
if (count >= fetch.getNumber()) {
|
||||
if (count > fetch.getNumber()) {
|
||||
return Result.error("报名人数已满");
|
||||
}
|
||||
|
||||
List<LxyImportTemp> tempList = ExcelImportUtil.importExcel(file.getFile(), LxyImportTemp.class, new ImportParams());
|
||||
|
||||
if ((tempList.size() + count) >= fetch.getNumber()) {
|
||||
int size = tempList.size();
|
||||
|
||||
if ((size + count) > fetch.getNumber()) {
|
||||
return Result.error("文件数据超过名额限制,请检查是否存在已报名人员");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user