commit
This commit is contained in:
+14
-1
@@ -234,7 +234,20 @@ public class ClubRegistApplyController {
|
||||
|
||||
//如果不是管理员,并且点的提交按钮
|
||||
if (!isSave && Objects.equals(club.getUserid(), ShiroUtil.getUserId())) {
|
||||
club.setState(club.getSponsorType() == 1 ? ClubRegistAuditState.UNIT_PART_READY : ClubRegistAuditState.XT_READY);
|
||||
if(club.getSponsorType() == 1) {
|
||||
// 如果申请是基层单位申请,设置归属工会
|
||||
Sql sql = Sqls.create("SELECT unionid AS unionId,unionname AS unionName FROM `user` WHERE id = @userId").setParam("userId", club.getUserid());
|
||||
sql.setCallback(Sqls.callback.map());
|
||||
dao.execute(sql);
|
||||
NutMap map = (NutMap) sql.getResult();
|
||||
club.setUnionId(map.getString("unionId"));
|
||||
club.setUnionName(map.getString("unionName"));
|
||||
|
||||
club.setState(ClubRegistAuditState.UNIT_PART_READY);
|
||||
} else {
|
||||
club.setState(ClubRegistAuditState.XT_READY);
|
||||
}
|
||||
// club.setState(club.getSponsorType() == 1 ? ClubRegistAuditState.UNIT_PART_READY : ClubRegistAuditState.XT_READY);
|
||||
club.setXtAuditId("");
|
||||
club.setXldAuditId("");
|
||||
club.setUnitPartAuditId("");
|
||||
|
||||
@@ -173,4 +173,14 @@ public class Sys_club {
|
||||
@Comment("发起类型(1.基层单位申请,2.协会发起人申请)")
|
||||
@ColDefine(type = ColType.INT, width = 10)
|
||||
private Integer sponsorType;
|
||||
|
||||
@Column
|
||||
@Comment("归属分工会id(如果是基层单位申请的协会)")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionId;
|
||||
|
||||
@Column
|
||||
@Comment("归属分工会名称(如果是基层单位申请的协会)")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String unionName;
|
||||
}
|
||||
|
||||
+19
-4
@@ -24,6 +24,7 @@ import io.v.nutz.zhgh.activity.models.ActivityTissuePerson;
|
||||
import io.v.nutz.zhgh.activity.services.ActivitySchoolService;
|
||||
import io.v.nutz.zhgh.activity.services.ActivityTissueService;
|
||||
import io.v.nutz.zhgh.mobileHome.service.MobileHomeService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.shiro.authz.annotation.Logical;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
@@ -58,6 +59,7 @@ import java.util.List;
|
||||
* @description: 分工会活动信息管理
|
||||
**/
|
||||
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@At("/platform/activity/info/mange")
|
||||
@@ -315,7 +317,9 @@ public class ActivityUnionManageController {
|
||||
@At
|
||||
@Ok("void")
|
||||
@RequiresPermissions(value = {"activity.union.info", "activity.club.info", "activity.school.info2"}, logical = Logical.OR)
|
||||
public void doExportUser(String id, @Param(value = "unionId", required = false) String unionId, HttpServletResponse response) throws IOException {
|
||||
public void doExportUser(String id, @Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "isSign", required = false) Boolean isSign,
|
||||
HttpServletResponse response) throws IOException {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.id,
|
||||
@@ -325,7 +329,9 @@ public class ActivityUnionManageController {
|
||||
u.unionname,
|
||||
u.sex,
|
||||
u.mobile,
|
||||
atp.applyDateTime
|
||||
atp.applyDateTime,
|
||||
IF(atp.isSign = 1, '已签到', '未签到') AS signState,
|
||||
signTime
|
||||
FROM
|
||||
`activity_tissue_person` atp
|
||||
LEFT JOIN `user` u ON u.id = atp.userId
|
||||
@@ -334,8 +340,13 @@ public class ActivityUnionManageController {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("atp.tissueId", "=", id);
|
||||
cnd.andEX("u.unionId", "=", unionId);
|
||||
if (isSign) {
|
||||
cnd.and("atp.isSign", "=", 1);
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
|
||||
ActivityTissue tissue = tissuePersonService.dao().fetch(ActivityTissue.class, Cnd.where("id", "=", id));
|
||||
|
||||
List<ActivityTissuePerson> tissuePeople = tissuePersonService.listEntity(sql);
|
||||
List<ExcelExportEntity> entityList = new ArrayList<>();
|
||||
entityList.add(new ExcelExportEntity("姓名", "userName", 20));
|
||||
@@ -344,12 +355,16 @@ public class ActivityUnionManageController {
|
||||
entityList.add(new ExcelExportEntity("联系方式", "mobile", 20));
|
||||
entityList.add(new ExcelExportEntity("单位", "unitName", 20));
|
||||
entityList.add(new ExcelExportEntity("工会", "unionName", 20));
|
||||
if (isSign) {
|
||||
entityList.add(new ExcelExportEntity("签到状态", "singState", 20));
|
||||
entityList.add(new ExcelExportEntity("签到时间", "signTime", 20));
|
||||
}
|
||||
try {
|
||||
ViTool.excelResponse(response, "参赛人数.xls");
|
||||
ViTool.excelResponse(response, tissue.getName() + (isSign ? "签到" : "报名") + "人员信息表.xlsx");
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), entityList, tissuePeople);
|
||||
workbook.write(response.getOutputStream());
|
||||
} catch (Exception e) {
|
||||
|
||||
log.error("参赛人员导出失败:{}", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+9
-4
@@ -12,6 +12,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
@@ -81,7 +82,6 @@ public class ActivityUnionUserStatisticsController {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
@@ -95,7 +95,9 @@ public class ActivityUnionUserStatisticsController {
|
||||
u.mobile,
|
||||
atp.applyUserId,
|
||||
atp.id atpId ,
|
||||
atp.applyDateTime
|
||||
atp.applyDateTime,
|
||||
IF(atp.isSign = 1, '已签到', '未签到') AS signState,
|
||||
signTime
|
||||
FROM
|
||||
`activity_tissue_person` atp
|
||||
LEFT JOIN `user` u ON u.id = atp.userId
|
||||
@@ -113,8 +115,11 @@ public class ActivityUnionUserStatisticsController {
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
if (Strings.isNotBlank(page.getSearchName()) && Strings.isNotBlank(page.getSearchKeyword())) {
|
||||
cnd.where().andLike(page.getSearchName(), page.getSearchKeyword());
|
||||
if (StrUtil.isNotBlank(page.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or("u.loginname", "LIKE", "%" + page.getSearchKeyword() + "%");
|
||||
seg.or("u.username", "LIKE", "%" + page.getSearchKeyword() + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
if (StrUtil.isNotBlank(page.getPageOrderName()) && StrUtil.isNotBlank(page.getPageOrderBy())) {
|
||||
cnd.orderBy(page.getPageOrderName(), page.getPageOrderBy().equalsIgnoreCase("ascending") ? "ASC" : "DESC");
|
||||
|
||||
@@ -8,6 +8,7 @@ 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.io.IoUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import cn.wizzer.framework.base.service.BaseService;
|
||||
@@ -38,6 +39,7 @@ import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.entity.Record;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
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;
|
||||
@@ -111,11 +113,11 @@ public class JdhDbGlController {
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.username,
|
||||
u.loginname,
|
||||
u.sex,
|
||||
u.mobile,
|
||||
TIMESTAMPDIFF(YEAR, u.birthday,CURDATE()) as age,
|
||||
db.dbLoginName AS loginname,
|
||||
db.dbUserName AS username,
|
||||
db.dbSex AS sex,
|
||||
db.dbMobile AS mobile,
|
||||
TIMESTAMPDIFF(YEAR, db.dbBirthday,CURDATE()) as age,
|
||||
db.political,
|
||||
db.education,
|
||||
db.jobTitle,
|
||||
@@ -146,8 +148,11 @@ public class JdhDbGlController {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.groupBy("db.id");
|
||||
cnd.and("db.dbzt", "=", 2);
|
||||
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
|
||||
cnd.and(searchName, "LIKE", "%" + searchKeyword + "%");
|
||||
if (StrUtil.isNotBlank(searchKeyword)) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("db.dbUserName", searchKeyword);
|
||||
seg.orLike("db.dbLoginName", searchKeyword);
|
||||
cnd.and(seg);
|
||||
}
|
||||
if (Strings.isNotBlank(jdhid)) {
|
||||
cnd.and("db.jdhid", "=", jdhid);
|
||||
@@ -227,6 +232,12 @@ public class JdhDbGlController {
|
||||
db.setDbunitname(userMap.getString("dwname"));
|
||||
db.setDbfghid(userMap.getString("ghid"));
|
||||
db.setDbfghname(userMap.getString("unionname"));
|
||||
db.setDbLoginName(userMap.getString("loginname"));
|
||||
db.setDbUserName(userMap.getString("username"));
|
||||
db.setDbSex(ObjectUtil.defaultIfBlank(userMap.getString("sex"), ""));
|
||||
db.setDbBirthday(ObjectUtil.defaultIfBlank(userMap.getString("birthday"), ""));
|
||||
db.setDbMobile(ObjectUtil.defaultIfBlank(userMap.getString("mobile"), ""));
|
||||
db.setDbNation(ObjectUtil.defaultIfBlank(userMap.getString("nation"), ""));
|
||||
db.setDbtid(dbtid);
|
||||
db.setJdhid(jdhid);
|
||||
db.setDbzt(2);
|
||||
@@ -303,8 +314,10 @@ public class JdhDbGlController {
|
||||
u.education,
|
||||
u.position,
|
||||
u.mobile,
|
||||
u.birthday,
|
||||
u.nation,
|
||||
dw.id AS dwid,
|
||||
dw.NAME AS dwname,
|
||||
dw.`name` AS dwname,
|
||||
gh.id AS ghid,
|
||||
gh.unionname
|
||||
FROM
|
||||
@@ -338,6 +351,13 @@ public class JdhDbGlController {
|
||||
db.setId(R.UU32());
|
||||
db.setDbid(userMap.getString("id"));
|
||||
|
||||
db.setDbLoginName(userMap.getString("loginname"));
|
||||
db.setDbUserName(userMap.getString("username"));
|
||||
db.setDbSex(ObjectUtil.defaultIfBlank(userMap.getString("sex"), ""));
|
||||
db.setDbBirthday(ObjectUtil.defaultIfBlank(userMap.getString("birthday"), ""));
|
||||
db.setDbMobile(ObjectUtil.defaultIfBlank(userMap.getString("mobile"), ""));
|
||||
db.setDbNation(ObjectUtil.defaultIfBlank(userMap.getString("nation"), ""));
|
||||
|
||||
db.setPolitical(userMap.getString("political"));
|
||||
db.setEducation(userMap.getString("education"));
|
||||
db.setJobTitle(userMap.getString("jobTitle"));
|
||||
@@ -513,6 +533,13 @@ public class JdhDbGlController {
|
||||
Jdh_db db = new Jdh_db();
|
||||
db.setId(R.UU32());
|
||||
db.setDbid(userMap.getString("id"));
|
||||
db.setDbLoginName(loginName);
|
||||
db.setDbUserName(userMap.getString("username"));
|
||||
db.setDbSex(userMap.getString("sex"));
|
||||
db.setDbBirthday(userMap.getString("birthday"));
|
||||
db.setDbMobile(userMap.getString("mobile"));
|
||||
db.setDbNation(userMap.getString("nation"));
|
||||
|
||||
db.setPolitical(userMap.getString("political"));
|
||||
db.setEducation(userMap.getString("education"));
|
||||
db.setJobTitle(userMap.getString("jobTitle"));
|
||||
|
||||
@@ -144,26 +144,33 @@ public class JdhDbScmdController {
|
||||
public Object queryNotDbUser(String jdhid, String dbtid, String keyword) {
|
||||
try {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.id,u.loginname,u.username,dw.id as dwid,dw.name as dwname,
|
||||
gh.id as ghid,gh.unionname,
|
||||
u.political,
|
||||
u.education,
|
||||
u.jobTitle,
|
||||
u.position
|
||||
FROM
|
||||
sys_user u
|
||||
LEFT JOIN sys_unit dw ON dw.id = u.unitid
|
||||
LEFT JOIN sys_union gh ON gh.id = dw.unionid
|
||||
SELECT
|
||||
u.id,
|
||||
u.loginname,
|
||||
u.username,
|
||||
u.unitid as dwid,
|
||||
u.unitname as dwname,
|
||||
gh.id as ghid,
|
||||
gh.unionname,
|
||||
u.political,
|
||||
u.education,
|
||||
u.jobTitle,
|
||||
u.position,
|
||||
u.birthday,
|
||||
u.sex,
|
||||
u.nation,
|
||||
u.mobile
|
||||
FROM
|
||||
`user` u
|
||||
$condition
|
||||
AND u.id NOT IN ( SELECT dbid FROM jdh_db WHERE jdhid = @jdhid AND dbzt in (1,2) )
|
||||
AND (u.username like @keyword or u.loginname like @keyword)
|
||||
""");
|
||||
AND u.id NOT IN ( SELECT dbid FROM jdh_db WHERE jdhid = @jdhid AND dbzt in (1,2) )
|
||||
AND (u.username like @keyword or u.loginname like @keyword)
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if ("unit".equals(Globals.MyConfig.getString("dbtzc"))) {
|
||||
cnd.and(new Static(" dw.id in (select dwid from jdh_dbt_zcdw where jdhid='%s' and dbtid='%s' )".formatted(jdhid, dbtid)));
|
||||
cnd.and(new Static(" u.unitid IN (select dwid from jdh_dbt_zcdw where jdhid='%s' and dbtid='%s' )".formatted(jdhid, dbtid)));
|
||||
} else {
|
||||
cnd.and(new Static("gh.id IN ( SELECT fghid FROM jdh_dbt_zcfgh WHERE jdhid = '%s' AND dbtid = '%s' )".formatted(jdhid, dbtid)));
|
||||
cnd.and(new Static(" u.unionid IN ( SELECT fghid FROM jdh_dbt_zcfgh WHERE jdhid = '%s' AND dbtid = '%s' )".formatted(jdhid, dbtid)));
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
sql.setParam("jdhid", jdhid);
|
||||
|
||||
@@ -29,6 +29,7 @@ import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.entity.Record;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
@@ -94,13 +95,12 @@ public class JdhDbYlController {
|
||||
try {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.username,
|
||||
u.loginname,
|
||||
u.sex,
|
||||
u.mobile,
|
||||
TIMESTAMPDIFF(YEAR, u.birthday,CURDATE()) as age,
|
||||
u.unionname,
|
||||
u.unioncode,
|
||||
db.dbLoginName AS loginname,
|
||||
db.dbUserName AS username,
|
||||
db.dbSex AS sex,
|
||||
db.dbMobile AS mobile,
|
||||
TIMESTAMPDIFF(YEAR, db.dbBirthday,CURDATE()) as age,
|
||||
db.dbfghname AS unionname,
|
||||
db.id,
|
||||
db.dbid,
|
||||
db.jdhid,
|
||||
@@ -114,7 +114,6 @@ public class JdhDbYlController {
|
||||
r.`name` as rolename
|
||||
FROM
|
||||
jdh_db db
|
||||
LEFT JOIN `user` u ON u.id = db.dbid
|
||||
LEFT JOIN sys_role r ON r.id = db.roleid
|
||||
LEFT JOIN jdh_dbt dbt ON dbt.id = db.dbtid
|
||||
LEFT JOIN jdh_jdhxx jdh on jdh.id = db.jdhid
|
||||
@@ -127,8 +126,11 @@ public class JdhDbYlController {
|
||||
} else {
|
||||
cnd.desc("jdh.jdhkqsj").asc("dbt.dbtname").asc("db.dbunitname");
|
||||
}
|
||||
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
|
||||
cnd.and(searchName, "LIKE", "%" + searchKeyword + "%");
|
||||
if (StrUtil.isNotBlank(searchKeyword)) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("db.dbUserName", searchKeyword);
|
||||
seg.orLike("db.dbLoginName", searchKeyword);
|
||||
cnd.and(seg);
|
||||
}
|
||||
if (Strings.isNotBlank(jdhid)) {
|
||||
cnd.and("db.jdhid", "=", jdhid);
|
||||
@@ -151,7 +153,7 @@ public class JdhDbYlController {
|
||||
}
|
||||
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,tamange")) {
|
||||
cnd.and("u.unionid", "=", Vi.getUnionId());
|
||||
cnd.and("db.dbfghid", "=", Vi.getUnionId());
|
||||
}
|
||||
|
||||
sql.setCondition(cnd);
|
||||
@@ -171,15 +173,52 @@ public class JdhDbYlController {
|
||||
@At
|
||||
@RequiresPermissions("jdh.db.dbyl")
|
||||
public void downloadDbList(@Param(value = "jdh_id",required = false) String jdh_id, HttpServletResponse response) throws Exception {
|
||||
Sql dbtSql = Sqls.create("SELECT dbt.*,(SELECT count(1) from jdh_db db WHERE db.dbtid = dbt.id) " +
|
||||
"dbnum from jdh_dbt dbt where dbt.jdhid = @jdhid ORDER BY dbt.code").setParam("jdhid", jdh_id);
|
||||
Sql dbSql = Sqls.create("SELECT u.id,(case u.sex when '女' then CONCAT(u.username,'(女)') else u.username end) " +
|
||||
"username,u.nation mz,db.dbtid,db.roleid from jdh_db db left join sys_user u on db.dbid = u.id " +
|
||||
"WHERE db.dbzt = 2 and db.jdhid = @jdhid ORDER BY u.username").setParam("jdhid", jdh_id);
|
||||
Sql tzSql = Sqls.create("SELECT u.id,(case u.sex when '女' then CONCAT(u.username,'(女)') else u.username end) " +
|
||||
"username,u.nation mz,sur.dbtid,sur.roleId roleid from sys_user_role sur left join sys_user u on sur.userId = u.id " +
|
||||
"WHERE sur.roleId in (@tz_role_id,@ftz_role_id) and sur.jdhid = @jdhid ORDER BY u.username")
|
||||
.setParam("tz_role_id", Roles.DBT_TZ).setParam("ftz_role_id", Roles.DBT_FTZ).setParam("jdhid", jdh_id);
|
||||
Sql dbtSql = Sqls.create("""
|
||||
SELECT
|
||||
dbt.*,
|
||||
(SELECT count(1) FROM jdh_db db WHERE db.dbtid = dbt.id) dbnum
|
||||
FROM
|
||||
jdh_dbt dbt
|
||||
WHERE
|
||||
dbt.jdhid = @jdhid
|
||||
ORDER BY
|
||||
dbt.`code`
|
||||
""").setParam("jdhid", jdh_id);
|
||||
|
||||
Sql dbSql = Sqls.create("""
|
||||
SELECT
|
||||
db.dbid AS id,
|
||||
(CASE db.dbSex WHEN '女' THEN CONCAT(db.dbUsername, '(女)') ELSE db.dbUsername END) username,
|
||||
db.dbNation AS mz,
|
||||
db.dbtid,
|
||||
db.roleid
|
||||
FROM
|
||||
jdh_db db
|
||||
WHERE
|
||||
db.dbzt = 2
|
||||
AND db.jdhid = @jdhid
|
||||
ORDER BY
|
||||
db.dbUserName
|
||||
""").setParam("jdhid", jdh_id);
|
||||
|
||||
Sql tzSql = Sqls.create("""
|
||||
SELECT
|
||||
db.dbid AS id,
|
||||
(CASE db.dbSex WHEN '女' THEN CONCAT(db.dbUsername, '(女)') ELSE db.dbUsername END) username,
|
||||
db.dbNation AS mz,
|
||||
sur.dbtid,
|
||||
sur.roleId roleid
|
||||
FROM
|
||||
sys_user_role sur
|
||||
LEFT JOIN jdh_db db ON sur.userId = db.dbid
|
||||
WHERE
|
||||
sur.roleId IN (@tz_role_id, @ftz_role_id)
|
||||
AND sur.jdhid = @jdhid
|
||||
GROUP BY
|
||||
db.id
|
||||
ORDER BY
|
||||
db.dbUserName
|
||||
""").setParam("tz_role_id", Roles.DBT_TZ).setParam("ftz_role_id", Roles.DBT_FTZ).setParam("jdhid", jdh_id);
|
||||
|
||||
List<Record> dbtList = baseService.list(dbtSql);
|
||||
List<Record> dbs = baseService.list(dbSql);
|
||||
@@ -243,7 +282,7 @@ public class JdhDbYlController {
|
||||
Jdh_jdhxx jdhxx = baseService.dao().fetch(Jdh_jdhxx.class, jdhid);
|
||||
|
||||
//只查询开启教代会的代表
|
||||
Sql sql = Sqls.create("""
|
||||
/*Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.loginname,
|
||||
u.username,
|
||||
@@ -266,16 +305,16 @@ public class JdhDbYlController {
|
||||
dbt.code,
|
||||
u.unioncode,
|
||||
u.unitcode
|
||||
""").setParam("jdhid", jdhid);
|
||||
""").setParam("jdhid", jdhid);*/
|
||||
|
||||
Sql sql2 = Sqls.create("""
|
||||
SELECT
|
||||
u.loginname,
|
||||
u.username,
|
||||
u.sex,
|
||||
u.mobile,
|
||||
u.unitname,
|
||||
u.unionname,
|
||||
db.dbLoginName AS loginname,
|
||||
db.dbUserName AS username,
|
||||
db.dbSex AS sex,
|
||||
db.dbMobile AS mobile,
|
||||
db.dbunitname AS unitname,
|
||||
db.dbfghname AS unionname,
|
||||
dbt.dbtname,
|
||||
CONCAT( jdh.jdhjs, '届', jdh.jdhcs, '次' ) jdh,
|
||||
role.`name` rolename
|
||||
@@ -312,7 +351,7 @@ public class JdhDbYlController {
|
||||
}
|
||||
|
||||
response.setContentType("application/octet-stream");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + new String((jdhxx.getJdhjs() + "届" + jdhxx.getJdhcs() + "次" + "教代会代表名单.xls").getBytes("utf-8"), "ISO8859-1"));
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + new String((jdhxx.getJdhjs() + "届" + jdhxx.getJdhcs() + "次" + "教代会代表名单.xlsx").getBytes("utf-8"), "ISO8859-1"));
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), DB.class, dbs);
|
||||
workbook.write(response.getOutputStream());
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import cn.wizzer.framework.page.Pagination;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.Roles;
|
||||
import io.v.nutz.sys.models.User;
|
||||
import io.v.nutz.zhgh.jdh.model.db.Jdh_db;
|
||||
import io.v.nutz.zhgh.jdh.model.zzjg.Jdh_dbt;
|
||||
import io.v.nutz.zhgh.jdh.model.zzjg.Jdh_dbt_zcdw;
|
||||
@@ -32,6 +33,9 @@ import org.nutz.mvc.annotation.Param;
|
||||
import org.nutz.trans.Trans;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
@@ -570,9 +574,9 @@ public class DelegationController {
|
||||
PageForm page, @Param(value = "jdhid", required = false) String jdhid) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.id,
|
||||
u.loginname,
|
||||
u.username,
|
||||
db.dbid AS id,
|
||||
db.dbLoginName AS loginname,
|
||||
db.dbUserName AS username,
|
||||
db.dbunitname as unitname,
|
||||
db.dbfghname as unionname,
|
||||
r.`name` as rolename
|
||||
@@ -599,4 +603,32 @@ public class DelegationController {
|
||||
sql.setCondition(cnd);
|
||||
return sysUserRoleService.list(sql);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.jdh.zzjg.delegation")
|
||||
public Object setDbInfo() {
|
||||
List<Jdh_db> list = dao.query(Jdh_db.class, Cnd.NEW());
|
||||
|
||||
Set<String> userIds = list.stream().map(Jdh_db::getDbid).collect(Collectors.toSet());
|
||||
|
||||
List<User> query = dao.query(User.class, Cnd.where("id", "in", userIds));
|
||||
|
||||
Map<String, User> userMap = query.stream().collect(Collectors.toMap(User::getId, v -> v));
|
||||
|
||||
for (Jdh_db db : list) {
|
||||
User user = userMap.get(db.getDbid());
|
||||
db.setDbUserName(user.getUsername());
|
||||
db.setDbLoginName(user.getLoginname());
|
||||
db.setDbSex(user.getSex());
|
||||
db.setDbBirthday(user.getBirthday());
|
||||
db.setDbMobile(user.getMobile());
|
||||
db.setDbNation(user.getNation());
|
||||
}
|
||||
|
||||
dao.update(list);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,36 @@ public class Jdh_db implements Serializable {
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String dbid;
|
||||
|
||||
@Column
|
||||
@Comment("代表工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String dbLoginName;
|
||||
|
||||
@Column
|
||||
@Comment("代表姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String dbUserName;
|
||||
|
||||
@Column
|
||||
@Comment("代表性别")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
private String dbSex;
|
||||
|
||||
@Column
|
||||
@Comment("代表生日")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String dbBirthday;
|
||||
|
||||
@Column
|
||||
@Comment("代表联系方式")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String dbMobile;
|
||||
|
||||
@Column
|
||||
@Comment("代表民族")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String dbNation;
|
||||
|
||||
@Column
|
||||
@Comment("所属教代会ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
|
||||
@@ -64,7 +64,7 @@ public class H5QsvQuizController {
|
||||
|
||||
int count = dao.count(ActivityUserScope.class, Cnd.where("groupId", "=", activity.getGroupId()).and("userId", "=", ShiroUtil.getUserId()));
|
||||
if (count != 1) {
|
||||
return Result.error("您无需参加此次知识竞赛,感谢您的关注!");
|
||||
return Result.error("您无需参加此次答题,感谢您的关注!");
|
||||
}
|
||||
|
||||
String mode = activity.getMode();
|
||||
@@ -76,6 +76,8 @@ public class H5QsvQuizController {
|
||||
Integer maxAttempts = activity.getMaxAttempts();
|
||||
//题目显示模式
|
||||
String displayMode = activity.getDisplayMode();
|
||||
// 重复答题,显示提示
|
||||
Boolean repeatTips = false;
|
||||
|
||||
//最终返回的题目数据
|
||||
List<QsvSubject> resultSubjects = new ArrayList<>();
|
||||
@@ -161,6 +163,7 @@ public class H5QsvQuizController {
|
||||
String dynamic = subjectIds.stream().map(id -> "'" + id + "'").collect(Collectors.joining(","));
|
||||
cnd.and(new Static("1=1 ORDER BY FIELD (id," + dynamic + ")"));
|
||||
resultSubjects = dao.query(QsvSubject.class, cnd);
|
||||
repeatTips = true;
|
||||
} else {
|
||||
//已达到最大次数 返回最新一次记录
|
||||
Optional<QsvUserAnswerRecord> maxAnswerRecordOptional = answerRecords.stream().max(Comparator.comparingLong(QsvUserAnswerRecord::getRandomNumber));
|
||||
@@ -306,7 +309,8 @@ public class H5QsvQuizController {
|
||||
|
||||
resultSubjects.forEach(v -> v.setUserSelectOptionIds(new ArrayList<>()));
|
||||
|
||||
NutMap result = NutMap.NEW().addv("subjects", resultSubjects).addv("answerRecordId", answerRecordId).addv("activity", activity);
|
||||
NutMap result = NutMap.NEW().addv("subjects", resultSubjects).addv("answerRecordId", answerRecordId)
|
||||
.addv("activity", activity).addv("repeatTips", repeatTips);
|
||||
return Result.success(result);
|
||||
}
|
||||
|
||||
|
||||
@@ -93,6 +93,7 @@ public class QsvQuizRankServiceImpl extends BaseServiceImpl<QsvUserAnswerRecord>
|
||||
t1.userId,
|
||||
t1.userName,
|
||||
t1.loginName,
|
||||
u.sex,
|
||||
t1.unitName,
|
||||
t1.unionName,
|
||||
u.mobile,
|
||||
|
||||
@@ -319,10 +319,15 @@ public class WelfareProjectMangeController {
|
||||
Set<String> loginNameList = userList.stream().map(user -> user.getString("loginname")).collect(Collectors.toSet());
|
||||
String loginNames = loginNameList.stream().collect(Collectors.joining(","));
|
||||
|
||||
WelfareProject project = dao.fetch(WelfareProject.class, projectId);
|
||||
// WelfareProject project = dao.fetch(WelfareProject.class, projectId);
|
||||
String link = Globals.AppDomain + "/mobile/welfare/list/receive?projectId=%s".formatted(projectId);
|
||||
// String imageUrl = Globals.AppDomain + "/file_server/fileStreamPreview?id=" + project.getCover();
|
||||
msgApi.sendMsg(List.of("DingTalk"), loginNames, 2, "职工福利", sendMsgValue, "", link);
|
||||
// msgApi.sendMsg(List.of("DingTalk"), loginNames, 2, "职工福利", sendMsgValue, "", link);
|
||||
if ("51e3449b5f234dd58757de63142d6b48".equals(projectId)) {
|
||||
msgApi.sendMsg(List.of("DingTalk"), loginNames, 2, "答题纪念品!点开有惊喜!", sendMsgValue, "", link);
|
||||
} else {
|
||||
msgApi.sendMsg(List.of("DingTalk"), loginNames, 2, "职工福利", sendMsgValue, "", link);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user