From 77d9aef4c567498ac8827c6e25a54c471443d968 Mon Sep 17 00:00:00 2001 From: Paidax Date: Wed, 11 Jun 2025 16:45:59 +0800 Subject: [PATCH] =?UTF-8?q?=E7=96=97=E4=BC=91=E5=85=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lxy/controller/LxyAgentController.java | 4 +- .../v/nutz/zhgh/lxy/controller/LxyCommon.java | 54 +- .../lxy/controller/LxyFghShController.java | 36 +- .../lxy/controller/LxyGhbmController.java | 309 ++++------ .../lxy/controller/LxyGrBmController.java | 6 +- .../v/nutz/zhgh/lxy/controller/LxyHdCon.java | 6 +- .../lxy/controller/LxyHdTjController.java | 54 +- .../lxy/controller/LxyMetjController.java | 4 +- .../lxy/controller/LxyXghshController.java | 210 ++++--- .../java/io/v/nutz/zhgh/lxy/model/Lxy_bm.java | 58 +- .../nutz/zhgh/lxy/template/LxyImportTemp.java | 39 ++ .../static/components/plugins/FileImport.vue | 384 ++++++------- .../views/platform/zgfw/lxy/HdFghsh.html | 307 +++++----- .../views/platform/zgfw/lxy/HdGhbm.html | 138 +++-- .../views/platform/zgfw/lxy/HdGrbm.html | 354 ++++++------ .../views/platform/zgfw/lxy/HdMange.html | 19 +- .../views/platform/zgfw/lxy/HdMetj.html | 542 +++++++++--------- .../views/platform/zgfw/lxy/HdXghsh.html | 100 +--- .../views/platform/zgfw/lxy/dialogViewBm.html | 11 +- .../views/platform/zgfw/lxy/dialogViewFp.html | 9 +- 20 files changed, 1377 insertions(+), 1267 deletions(-) create mode 100644 src/main/java/io/v/nutz/zhgh/lxy/template/LxyImportTemp.java diff --git a/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyAgentController.java b/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyAgentController.java index 7868c9e..ec3758c 100644 --- a/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyAgentController.java +++ b/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyAgentController.java @@ -2,8 +2,8 @@ package io.v.nutz.zhgh.lxy.controller; import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.utils.Vi; -import io.v.nutz.zhgh.lxy.service.LxyBmService; import io.v.nutz.web.commons.utils.ShiroUtil; +import io.v.nutz.zhgh.lxy.service.LxyBmService; import org.nutz.dao.Cnd; import org.nutz.dao.Sqls; import org.nutz.dao.entity.Record; @@ -40,7 +40,7 @@ public class LxyAgentController { final String title = "【疗休养】"; List result = new ArrayList<>(); if (ShiroUtil.hasAnyRoles("sysadmin")) { - result.add(new NutMap().setv("title", title).setv("url", FGHSH).setv("iconClass", vi.getIconByPath(FGHSH)).setv("label", "待基层工会审核").setv("number", getFghshCount())); + result.add(new NutMap().setv("title", title).setv("url", FGHSH).setv("iconClass", vi.getIconByPath(FGHSH)).setv("label", "待院级工会审核").setv("number", getFghshCount())); result.add(new NutMap().setv("title", title).setv("url", XGHSH).setv("iconClass", vi.getIconByPath(XGHSH)).setv("label", "待校工会审核").setv("number", getXghshCount().size())); } return result; diff --git a/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyCommon.java b/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyCommon.java index e36c24a..f5d7a2c 100644 --- a/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyCommon.java +++ b/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyCommon.java @@ -40,30 +40,36 @@ public class LxyCommon { Record record = lxyHdService.list(Sqls.create("SELECT * FROM `lxy_hd` WHERE id = @id").setParam("id", id)).get(0); record.set("files", baseService.dao().query("sys_file", Cnd.where("reid", "=", id))); record.set("mefp", lxyHdService.list(Sqls.create("SELECT fp.*,unionname,unioncode from lxy_mefp fp left join sys_union un on fp.ghid = un.id WHERE fp.hdid = @id ORDER BY un.unioncode").setParam("id", id))); - record.set("bm", lxyBmService.list(Sqls.create("SELECT\n" + - "\tu.id,\n" + - "\tu.loginname,\n" + - "\tu.username,\n" + - "\tu.sex,\n" + - "\tu.mobile,\n" + - "\tTIMESTAMPDIFF(\n" + - "\t\tYEAR,\n" + - "\t\tu.birthday,\n" + - "\tCURDATE()) age,\n" + - "\tbm.bmzt \n" + - "FROM\n" + - "\tsys_user u\n" + - "\tLEFT JOIN lxy_bm bm ON u.id = bm.userid \n" + - "WHERE\n" + - "\tbm.hdid = @hdid \n" + - "\tAND u.id IN (\n" + - "\tSELECT\n" + - "\t\tbm.userid \n" + - "\tFROM\n" + - "\t\tlxy_bm bm \n" + - "\tWHERE\n" + - "\tbm.bmzt IN (3,5,6) AND\n" + - "\tbm.hdid =@hdid) ORDER BY bm.bmzt DESC").setParam("hdid", id))); + record.set("bm", lxyBmService.list(Sqls.create(""" + SELECT + u.id, + u.loginname, + u.username, + u.sex, + bm.mobile, + bm.nation, + bm.zyhj, + bm.idcard, + bm.talent, + TIMESTAMPDIFF(YEAR, u.birthday, CURDATE()) age, + bm.bmzt + FROM + sys_user u + LEFT JOIN lxy_bm bm ON u.id = bm.userid + WHERE + bm.hdid = @hdid + AND u.id IN ( + SELECT + bm.userid + FROM + lxy_bm bm + WHERE + bm.bmzt IN (3, 5, 6) + AND bm.hdid = @hdid + ) + ORDER BY + bm.bmzt DESC + """).setParam("hdid", id))); return record; } diff --git a/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyFghShController.java b/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyFghShController.java index 0e9b04a..1847678 100644 --- a/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyFghShController.java +++ b/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyFghShController.java @@ -4,13 +4,12 @@ import cn.wizzer.framework.base.service.BaseService; import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.utils.PageUtil; import io.v.nutz.base.utils.Vi; +import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.zhgh.lxy.model.Lxy_bm; import io.v.nutz.zhgh.lxy.model.Lxy_grxx; import io.v.nutz.zhgh.lxy.service.LxyBmService; import io.v.nutz.zhgh.lxy.service.LxyGrxxService; import io.v.nutz.zhgh.lxy.service.LxyHdService; -import io.v.nutz.sys.models.Sys_file; -import io.v.nutz.web.commons.utils.ShiroUtil; import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresPermissions; @@ -28,12 +27,10 @@ import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Param; -import java.util.List; - /** * @author: Aaron * @create: 2020-09-01 16:08 - * @description: 疗修养基层工会审核 + * @description: 疗修养分工会审核 **/ @At("/platform/zgfw/lxy/fghsh") @Ok("json") @@ -65,13 +62,13 @@ public class LxyFghShController { @At @ViReturn @RequiresPermissions("zgfw.lxy.fghsh") - public Object pageData(@Param(value = "year",required = false) Integer year, - @Param(value = "hdid",required = false) String hdid, - @Param(value = "searchName",required = false) String searchName, - @Param(value = "searchKeyword",required = false) String searchKeyword, + public Object pageData(@Param(value = "year", required = false) Integer year, + @Param(value = "hdid", required = false) String hdid, + @Param(value = "searchName", required = false) String searchName, + @Param(value = "searchKeyword", required = false) String searchKeyword, @Param("pageNumber") int pageNumber, @Param("pageSize") int pageSize, - @Param(value = "pageOrderName",required = false) String pageOrderName, - @Param(value = "pageOrderBy",required = false) String pageOrderBy) { + @Param(value = "pageOrderName", required = false) String pageOrderName, + @Param(value = "pageOrderBy", required = false) String pageOrderBy) { Sql sql = Sqls.create("SELECT\n" + "\tunit.name unitname,\n" + "\tl.id,\n" + @@ -141,17 +138,24 @@ public class LxyFghShController { @At @ViReturn - @RequiresPermissions(value = {"zgfw.lxy.xghsh","zgfw.lxy.fghsh"},logical = Logical.OR) + @RequiresPermissions(value = {"zgfw.lxy.xghsh", "zgfw.lxy.fghsh"}, logical = Logical.OR) public Object getBmInfo(String id) { Lxy_grxx grxx = lxyGrxxService.fetch(id); - List files = baseService.dao().query(Sys_file.class, Cnd.where("reid", "=", id)); - grxx.setFiles(files); +// List files = baseService.dao().query(Sys_file.class, Cnd.where("reid", "=", id)); +// grxx.setFiles(files); Lxy_bm lxyBm = lxyBmService.dao().fetch(Lxy_bm.class, Cnd.where("hdid", "=", grxx.getHdid()) .and("userid", "=", grxx.getUserid())); - NutMap nutMap = Lang.obj2nutmap(grxx); - nutMap.put("bmFiles", lxyBm.getFiles()); + NutMap nutMap = Lang.obj2nutmap(lxyBm); + nutMap.put("username", grxx.getUsername()); + nutMap.put("loginname", grxx.getLoginname()); + nutMap.put("sex", grxx.getSex()); +// nutMap.put("bmFiles", lxyBm.getFiles()); +// nutMap.put("mobile", lxyBm.getMobile()); +// nutMap.put("idcard", lxyBm.getIdcard()); +// nutMap.put("zyhj", lxyBm.getZyhj()); +// nutMap.put("bz", lxyBm.getBz()); return nutMap; } diff --git a/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyGhbmController.java b/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyGhbmController.java index b8a7115..edb451e 100644 --- a/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyGhbmController.java +++ b/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyGhbmController.java @@ -1,36 +1,46 @@ package io.v.nutz.zhgh.lxy.controller; +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; import cn.wizzer.framework.base.Result; -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.PageUtil; import io.v.nutz.base.utils.Vi; +import io.v.nutz.base.utils.ViTool; +import io.v.nutz.sys.services.SysUserService; +import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.zhgh.lxy.model.Lxy_bm; import io.v.nutz.zhgh.lxy.model.Lxy_grxx; import io.v.nutz.zhgh.lxy.service.LxyBmService; import io.v.nutz.zhgh.lxy.service.LxyGrxxService; import io.v.nutz.zhgh.lxy.service.LxyHdService; -import io.v.nutz.sys.services.SysUserService; -import io.v.nutz.web.commons.utils.ShiroUtil; +import io.v.nutz.zhgh.lxy.template.LxyImportTemp; +import org.apache.poi.ss.usermodel.Workbook; import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.nutz.dao.Cnd; +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.dao.util.cri.Static; 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 org.nutz.trans.Trans; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; import java.util.ArrayList; import java.util.List; @@ -45,14 +55,15 @@ import java.util.List; @RequiresAuthentication public class LxyGhbmController { - @Inject - private LxyHdService lxyHdService; - @Inject private Vi vi; @Inject + private Dao dao; + @Inject private LxyBmService lxyBmService; @Inject + private LxyHdService lxyHdService; + @Inject private SysUserService sysUserService; @Inject private LxyGrxxService lxyGrxxService; @@ -66,15 +77,15 @@ public class LxyGhbmController { @At @ViReturn @RequiresPermissions("zgfw.lxy.ghbm") - public Object pageData(@Param(value = "year",required = false) Integer year, - @Param(value = "hdid",required = false) String hdid, - @Param(value = "unionId",required = false)String unionId, - @Param(value = "searchName",required = false) String searchName, - @Param(value = "searchKeyword",required = false) String searchKeyword, - @Param(value = "pageNumber",required = false) int pageNumber, - @Param(value = "pageSize",required = false) int pageSize, - @Param(value = "pageOrderName",required = false) String pageOrderName, - @Param(value = "pageOrderBy",required = false) String pageOrderBy) { + public Object pageData(@Param(value = "year", required = false) Integer year, + @Param(value = "hdid", required = false) String hdid, + @Param(value = "unionId", required = false) String unionId, + @Param(value = "searchName", required = false) String searchName, + @Param(value = "searchKeyword", required = false) String searchKeyword, + @Param(value = "pageNumber", required = false) int pageNumber, + @Param(value = "pageSize", required = false) int pageSize, + @Param(value = "pageOrderName", required = false) String pageOrderName, + @Param(value = "pageOrderBy", required = false) String pageOrderBy) { Sql sql = Sqls.create(""" SELECT mefp.*, @@ -101,7 +112,7 @@ public class LxyGhbmController { cnd.and(new Static("now() < hd.bmjzsj")); cnd.and("mefp.hdid", "=", hdid); - cnd.andEX("un.id","=",unionId); + cnd.andEX("un.id", "=", unionId); if (!ShiroUtil.hasAnyRoles(new String[]{"sysadmin", "SchoolUnionAdmin"})) { cnd.and(new Static("mefp.ghid in " + vi.getMangeUnionStr())); //工会管理员查看分配名额大于0的 @@ -131,14 +142,15 @@ public class LxyGhbmController { @ViReturn @RequiresPermissions("zgfw.lxy.ghbm") public Object getNotApply(String unionid, String hdid, - @Param(value = "query",required = false) String query, - @Param(value = "checks",required = false) String[] checks) { + @Param(value = "query", required = false) String query, + @Param(value = "checks", required = false) String[] checks) { Sql sql = Sqls.create(""" SELECT u.id, u.sex, u.mobile, + u.unitid, TIMESTAMPDIFF( YEAR, u.birthday, @@ -146,7 +158,8 @@ public class LxyGhbmController { u.username, u.loginname, unit.`name` unitname, - un.unionname + un.unionname, + u.idcard FROM sys_user u LEFT JOIN lxy_bm bm ON bm.userid = u.id @@ -178,20 +191,25 @@ public class LxyGhbmController { @ViReturn @RequiresPermissions("zgfw.lxy.ghbm") public Object getHasApply(String unionid, String hdid, - @Param(value = "query",required = false) String query, - @Param(value = "checks",required = false) String[] checks) { + @Param(value = "query", required = false) String query, + @Param(value = "checks", required = false) String[] checks) { Sql sql = Sqls.create(""" SELECT u.id, u.loginname, u.username, - u.unitname, bm.bmzt, - TIMESTAMPDIFF( - YEAR, - u.birthday, - CURDATE()) age, - bm.files + bm.age, + bm.files, + bm.zyhj, + bm.bz, + bm.mobile, + bm.idcard, + bm.unitid, + bm.unitname, + bm.unionname, + bm.nation, + bm.talent FROM lxy_bm bm LEFT JOIN `user` u ON u.id = bm.userid @@ -203,101 +221,25 @@ public class LxyGhbmController { @At @ViReturn @RequiresPermissions("zgfw.lxy.ghbm") - public Object getUser(@Param(value = "sign",required = false) Integer sign, - @Param(value = "unionid",required = false) String unionid, - @Param(value = "hdid",required = false) String hdid, - @Param(value = "hdid",required = false) String query, - @Param(value = "checks",required = false) String[] checks, - @Param("pageNumber") int pageNumber,@Param("pageSize") int pageSize, - @Param(value = "pageOrderName",required = false) String pageOrderName, - @Param(value = "pageOrderBy",required = false) String pageOrderBy) { - Sql sql = Sqls.create("SELECT\n" + - "\tu.id,\n" + - "\tu.sex,u.mobile, TIMESTAMPDIFF(YEAR, u.birthday, CURDATE()) age,\n" + - "\tu.username,\n" + - "\tu.loginname,\n" + - "\tunit.`name` unitname,\n" + - "\tun.unionname \n" + - "FROM\n" + - "\tsys_user u\n" + - "\tLEFT JOIN lxy_bm bm ON bm.userid = u.id \n" + - "\tLEFT JOIN sys_unit unit ON u.unitid = unit.id\n" + - "\tLEFT JOIN ry_rygl_gr ry ON ry.userid = u.id\n" + - "\tLEFT JOIN sys_union un ON unit.unionid = un.id $condition"); - - Cnd cnd = Cnd.NEW(); - - cnd.and("unit.unionid", "=", unionid); - cnd.and("bm.hdid","=",hdid); - if (sign == 0) { - cnd.and(new Static("u.id not in (SELECT bm.userid from lxy_bm bm WHERE bm.hdid = '" + hdid + "')")); - } - - if (checks.length > 0) { - for (String check : checks) { - if (check.equals("honer")) { - cnd.and(new Static("ry.zyxjsj is not null")); - } - - if (check.equals("five")) { - cnd.and(new Static(" u.id not in (SELECT bm.userid from lxy_bm bm WHERE YEAR (NOW())- 5 < YEAR ( bm.bmsj ) )")); - } - } - } - - if (Strings.isNotBlank(query)) { - SqlExpressionGroup group = new SqlExpressionGroup(); - group.orLike("u.username", query).orLike("u.loginname", query); - cnd.and(group); - } - - if (Strings.isNotBlank(pageOrderName) && Strings.isNotBlank(pageOrderName)) { - cnd.orderBy(pageOrderName, PageUtil.getOrder(pageOrderBy)); - } - - cnd.desc("bm.bmzt"); - - sql.setCondition(cnd); - Pagination pagination = lxyHdService.listPage(pageNumber, pageSize, sql); - return pagination; - } - - @At - @ViReturn - @RequiresPermissions("zgfw.lxy.ghbm") - public Object getNumberData(String unionid, String hdid) { - Sql sql = Sqls.create("SELECT\n" + - "\tun.unionname,\n" + - "\tmefp.number sum,\n" + - "\t( SELECT count( 1 ) FROM lxy_bm bm WHERE bm.hdid = mefp.hdid AND bm.ghid = mefp.ghid and bm.bmzt = 5) ybm,\n" + - "\t( SELECT count( 1 ) FROM lxy_bm bm WHERE bm.hdid = mefp.hdid AND bm.ghid = mefp.ghid and bm.bmzt in (1,3)) dsh ,\n" + - "\t( SELECT count( 1 ) FROM lxy_bm bm WHERE bm.hdid = mefp.hdid AND bm.ghid = mefp.ghid and bm.bmzt in (2,4)) btg ,\n" + - "\t(mefp.number - (SELECT count( 1 ) FROM lxy_bm bm WHERE bm.hdid = mefp.hdid AND bm.ghid = mefp.ghid and bm.bmzt not in (2,4))) kxz\n" + - "FROM\n" + - "\tlxy_mefp mefp\n" + - "\tLEFT JOIN sys_union un ON mefp.ghid = un.id WHERE mefp.hdid=@hdid and mefp.ghid=@unionid").setParam("hdid", hdid).setParam("unionid", unionid); - Record record = lxyHdService.list(sql).get(0); - record.set("multiple", lxyBmService.list(Sqls.create("SELECT bm.userid id from lxy_bm bm WHERE bm.hdid = '" + hdid + "' AND bm.ghid = '" + unionid + "'"))); - return record; - } - - - @At - @ViReturn - @RequiresAuthentication - @RequiresPermissions("zgfw.lxy.ghbm") public Object bm(@Param("::data") List bmMapList, @Param("flag") boolean flag) { Trans.exec(() -> { List bmList = Lang.collection2list(bmMapList, Lxy_bm.class); if (Lang.isNotEmpty(bmList)) { lxyBmService.clear(Cnd - .where("bmzt", "is", null) + .NEW().and(Cnd.exps("bmzt", "is", null).or("bmzt", "=", 4)) .and("ghid", "=", bmList.get(0).getGhid()) .and("hdid", "=", bmList.get(0).getHdid())); List grxxList = new ArrayList<>(); for (Lxy_bm bm : bmList) { + lxyBmService.clear(Cnd + .where("userid","=",bm.getUserid()) + .and("ghid", "=", bmList.get(0).getGhid()) + .and("hdid", "=", bmList.get(0).getHdid())); + +// NutMap nutMap = bmMapList.stream().filter(item -> item.getString("id").equals(bm.getId())).findFirst().orElse(NutMap.NEW()); + Lxy_bm fetch = lxyBmService.fetch(Cnd.where("hdid", "=", bm.getGhid()).and("userid", "=", bm.getUserid()).and("bmzt", "=", 3)); if (Lang.isNotEmpty(fetch)) { continue; @@ -305,6 +247,8 @@ public class LxyGhbmController { bm.setBmzt(flag ? 3 : null); bm.setBmlx(1); bm.setBmsj(DateUtil.getDate()); +// bm.setNation(nutMap.getString("nation")); +// bm.setTalent(nutMap.getString("talent")); if (flag) { Sql sql = Sqls.create("SELECT u.loginname,u.username,u.mobile,TIMESTAMPDIFF(YEAR,u.birthday,CURDATE()) age,u.sex,u.position,u.personType,u.nation,u.idcard FROM sys_user u WHERE u.id = '" + bm.getUserid() + "'"); @@ -313,13 +257,13 @@ public class LxyGhbmController { Lxy_grxx lxy_grxx = new Lxy_grxx(); lxy_grxx.setLoginname(item.getString("loginname")); lxy_grxx.setUsername(item.getString("username")); - lxy_grxx.setMobile(item.getString("mobile")); - lxy_grxx.setAge(item.getString("age")); + lxy_grxx.setMobile(bm.getMobile()); + lxy_grxx.setAge(bm.getAge()); lxy_grxx.setSex(item.getString("sex")); lxy_grxx.setZw(item.getString("position")); lxy_grxx.setRsbz(item.getString("personType")); lxy_grxx.setMz(item.getString("nation")); - lxy_grxx.setIdcard(item.getString("idcard")); + lxy_grxx.setIdcard(bm.getIdcard()); lxy_grxx.setChry(new ArrayList()); lxy_grxx.setUserid(bm.getUserid()); lxy_grxx.setHdid(bm.getHdid()); @@ -335,85 +279,76 @@ public class LxyGhbmController { return null; } + @At @ViReturn @RequiresPermissions("zgfw.lxy.ghbm") - public Object doEdit(@Param("::data") List bmMapList) { - if (Lang.isEmpty(bmMapList)) { - return Result.success(); - } + public Object findBm(String ghId, String hdId) { + Sql sql = Sqls.create(""" + SELECT + l.id, + hd.id hdid, + u.id uid, + u.loginname, + u.username, + u.sex, + bm.age, + bm.mobile, + bm.idcard, + bm.unitname, + bm.bmzt, + bm.zyhj, + bm.nation, + bm.talent, + bm.bz, + bm.ghid + FROM + lxy_bm bm + LEFT JOIN lxy_hd hd ON hd.id = bm.hdid + LEFT JOIN sys_user u ON u.id = bm.userid + LEFT JOIN sys_unit unit ON u.unitid = unit.id + LEFT JOIN Lxy_grxx l ON l.loginname = u.loginname + $condition + """); - List bmList = Lang.collection2list(bmMapList, Lxy_bm.class); - lxyBmService.clear(Cnd.where("hdid", "=", bmList.get(0).getHdid()).and("ghid", "=", bmList.get(0).getGhid()).and("bmlx", "=", 1)); - lxyGrxxService.clear(Cnd.where("hdid", "=", bmList.get(0).getHdid()).and("ghid", "=", bmList.get(0).getGhid())); - List grxxList = new ArrayList<>(); - for (Lxy_bm bm : bmList) { - Lxy_bm fetch = lxyBmService.fetch(Cnd.where("hdid", "=", bm.getGhid()).and("userid", "=", bm.getUserid()).and("bmzt", "=", 3)); - if (Lang.isNotEmpty(fetch)) { - continue; - } - bm.setBmzt(3); - bm.setBmlx(1); - bm.setBmsj(DateUtil.getDate()); - - Sql sql = Sqls.create("SELECT u.loginname,u.username,u.mobile,TIMESTAMPDIFF(YEAR,u.birthday,CURDATE()) age,u.sex,u.position,u.preparedBy,u.nation,u.idcard FROM sys_user u WHERE u.id = '" + bm.getUserid() + "'"); - List records = sysUserService.list(sql); - records.forEach(item -> { - Lxy_grxx lxy_grxx = new Lxy_grxx(); - lxy_grxx.setLoginname(item.getString("loginname")); - lxy_grxx.setUsername(item.getString("username")); - lxy_grxx.setMobile(item.getString("mobile")); - lxy_grxx.setAge(item.getString("age")); - lxy_grxx.setSex(item.getString("sex")); - lxy_grxx.setZw(item.getString("position")); - lxy_grxx.setRsbz(item.getString("preparedBy")); - lxy_grxx.setMz(item.getString("nation")); - lxy_grxx.setIdcard(item.getString("idcard")); - lxy_grxx.setChry(new ArrayList()); - lxy_grxx.setUserid(bm.getUserid()); - lxy_grxx.setHdid(bm.getHdid()); - lxy_grxx.setGhid(bm.getGhid()); - grxxList.add(lxy_grxx); - }); - } - lxyBmService.insert(bmList); - lxyGrxxService.insert(grxxList); - return null; + Cnd cnd = Cnd.NEW(); + cnd.and("bm.bmzt","NOT IN",List.of(2,4,6)); + cnd.and("bm.hdid","=",hdId); + cnd.and("bm.ghid","=",ghId); + cnd.groupBy("u.loginname"); + cnd.desc("bm.bmzt"); + sql.setCondition(cnd); + return lxyBmService.list(sql); } + + + @At + @Ok("void") + @RequiresPermissions("zgfw.lxy.ghbm") + public void downloadImportTemp(HttpServletResponse response) { + try { + ViTool.excelResponse(response, "疗休养导入模版.xlsx"); + ExportParams exportParams = new ExportParams(); + exportParams.setType(ExcelType.XSSF); + Workbook sheets = ExcelExportUtil.exportExcel(exportParams, LxyImportTemp.class, new ArrayList<>()); + ServletOutputStream outputStream = response.getOutputStream(); + sheets.write(outputStream); + outputStream.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + @At @RequiresPermissions("zgfw.lxy.ghbm") - public Object findBm(String ghId, String hdId) { - try { - Sql sql = Sqls.create("SELECT\n" + - "unit.`name` unitname,\n" + - "l.id,\n" + - "hd.id hdid,\n" + - "u.id uid,\n" + - "u.loginname,\n" + - "u.username,\n" + - "u.sex,\n" + - "u.mobile,\n" + - "TIMESTAMPDIFF(YEAR,u.birthday,CURDATE()) age,\n" + - "bm.bmzt,\n" + - "bm.ghid\n" + - "FROM lxy_bm bm\n" + - "LEFT JOIN lxy_hd hd ON hd.id = bm.hdid\n" + - "LEFT JOIN sys_user u ON u.id = bm.userid\n" + - "LEFT JOIN sys_unit unit ON u.unitid = unit.id\n" + - "LEFT JOIN Lxy_grxx l ON l.loginname = u.loginname \n" + - "WHERE bm.bmzt NOT IN (2,4,6) AND bm.hdid = @hdid \n" + - "AND bm.ghid = @ghid \n" + - "GROUP BY u.loginname\n" + - "ORDER BY bm.bmzt DESC"); - sql.setParam("hdid", hdId); - sql.setParam("ghid", ghId); - List list = lxyBmService.list(sql); - return Result.success().addData(list); - } catch (Exception e) { - return Result.error(); - } + @AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"}) + public Result doImport(TempFile file, String projectId){ + 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"))); + return null; } - - } diff --git a/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyGrBmController.java b/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyGrBmController.java index a246a54..8e472d1 100644 --- a/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyGrBmController.java +++ b/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyGrBmController.java @@ -4,13 +4,13 @@ import cn.wizzer.framework.base.service.BaseService; import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.utils.PageUtil; import io.v.nutz.base.utils.Vi; +import io.v.nutz.sys.models.Sys_file; +import io.v.nutz.sys.services.SysUserService; +import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.zhgh.lxy.model.Lxy_grxx; import io.v.nutz.zhgh.lxy.service.LxyBmService; import io.v.nutz.zhgh.lxy.service.LxyGrxxService; import io.v.nutz.zhgh.lxy.service.LxyHdService; -import io.v.nutz.sys.models.Sys_file; -import io.v.nutz.sys.services.SysUserService; -import io.v.nutz.web.commons.utils.ShiroUtil; import org.apache.commons.io.FilenameUtils; import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresPermissions; diff --git a/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyHdCon.java b/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyHdCon.java index 6bf7ca6..2879d0c 100644 --- a/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyHdCon.java +++ b/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyHdCon.java @@ -2,13 +2,13 @@ package io.v.nutz.zhgh.lxy.controller; import cn.wizzer.framework.base.service.BaseService; import io.v.nutz.base.annontation.ViReturn; -import io.v.nutz.base.utils.PageUtil; import io.v.nutz.base.dao.CndPlus; +import io.v.nutz.base.utils.PageUtil; +import io.v.nutz.sys.models.Sys_file; import io.v.nutz.zhgh.lxy.model.Lxy_hd; import io.v.nutz.zhgh.lxy.model.Lxy_mefp; import io.v.nutz.zhgh.lxy.service.LxyHdService; import io.v.nutz.zhgh.lxy.service.LxyMefpService; -import io.v.nutz.sys.models.Sys_file; import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.nutz.boot.starter.ftp.FtpService; @@ -195,7 +195,7 @@ public class LxyHdCon { FROM sys_union gh LEFT JOIN `user` u ON u.unionid = gh.id - GROUP BY gh.id + GROUP BY gh.id ORDER BY gh.unioncode asc """); return lxyHdService.list(sql); } diff --git a/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyHdTjController.java b/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyHdTjController.java index b220836..4b0148a 100644 --- a/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyHdTjController.java +++ b/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyHdTjController.java @@ -3,8 +3,10 @@ package io.v.nutz.zhgh.lxy.controller; import cn.afterturn.easypoi.excel.ExcelExportUtil; import cn.afterturn.easypoi.excel.entity.TemplateExportParams; import io.v.nutz.base.annontation.ViReturn; +import io.v.nutz.base.utils.MsgApi; import io.v.nutz.base.utils.OfficeTemplateUtil; import io.v.nutz.base.utils.Vi; +import io.v.nutz.zhgh.lxy.model.Lxy_bm; import io.v.nutz.zhgh.lxy.service.LxyGrxxService; import io.v.nutz.zhgh.lxy.service.LxyHdService; import org.apache.poi.ss.usermodel.Workbook; @@ -53,6 +55,10 @@ public class LxyHdTjController { @Inject private OfficeTemplateUtil officeTemplateUtil; + + @Inject + private MsgApi msgApi; + @At("") @Ok("beetl:/platform/zgfw/lxy/HdTj.html") @RequiresPermissions("zgfw.lxy.hdtj") @@ -62,9 +68,9 @@ public class LxyHdTjController { @At @ViReturn @RequiresPermissions("zgfw.lxy.hdtj") - public Object pageData(@Param(value = "hdid",required = false) String hdid, - @Param(value = "ghid",required = false) String ghid, - @Param(value = "searchKey",required = false) String searchKey, + public Object pageData(@Param(value = "hdid", required = false) String hdid, + @Param(value = "ghid", required = false) String ghid, + @Param(value = "searchKey", required = false) String searchKey, @Param("pageNumber") int pageNumber, @Param("pageSize") int pageSize) { Cnd cnd = Cnd.NEW(); Sql sql = Sqls.create("SELECT gr.* ,u.unionname,u.unioncode,u.unitname unitname,u.unitcode FROM `lxy_grxx` gr \n" + @@ -96,13 +102,23 @@ public class LxyHdTjController { @At @Ok("void") @RequiresPermissions("zgfw.lxy.hdtj") - public void doExport(@Param(value = "hdid",required = false) String hdid, - @Param(value = "hdname",required = false) String hdname, - @Param(value = "ghid",required = false) String ghid, HttpServletResponse response) throws IOException { + public void doExport(@Param(value = "hdid", required = false) String hdid, + @Param(value = "hdname", required = false) String hdname, + @Param(value = "ghid", required = false) String ghid, HttpServletResponse response) throws IOException { Cnd cnd = Cnd.NEW(); - Sql sql = Sqls.create("SELECT gr.* ,u.unionname,u.unioncode,u.unitname unitname,u.unitcode FROM `lxy_grxx` gr \n" + - "LEFT JOIN lxy_bm bm ON bm.userid = gr.userid \n" + - "LEFT JOIN `user` u ON u.id=bm.userid $condition"); + Sql sql = Sqls.create(""" + SELECT + gr.*, + bm.unionname, + bm.unitname, + bm.zyhj, + bm.bz + FROM + `lxy_grxx` gr + LEFT JOIN lxy_bm bm ON bm.userid = gr.userid + LEFT JOIN `user` u ON u.id = bm.userid + $condition + """); cnd.and(new Static("bm.bmzt = 5")); cnd.and("gr.hdid", "=", hdid); @@ -111,7 +127,7 @@ public class LxyHdTjController { cnd.and("gr.ghid", "=", ghid); } cnd.groupBy("bm.userid"); - cnd.asc("u.unionname").asc("u.unitcode").asc("gr.age"); + cnd.asc("bm.unionname").asc("bm.unitname").asc("gr.age"); sql.setCondition(cnd); List list = lxyGrxxService.list(sql); int i = 1; @@ -132,7 +148,7 @@ public class LxyHdTjController { String fileName = "疗休养人员名单汇总表.xls"; response.setContentType("application/octet-stream"); response.setHeader("Content-Disposition", "attachment;filename=" + new String(fileName.getBytes("utf-8"), "ISO8859-1")); - //TemplateExportParams params = new TemplateExportParams("templates/lxy/lxyrymd.xls"); +// TemplateExportParams params = new TemplateExportParams("C:\\Users\\mayn\\Desktop\\lxyrymd.xls"); TemplateExportParams params = new TemplateExportParams(officeTemplateUtil.getPath("lxy_lxyrymd")); // Workbook workbook = ExcelExportUtil.exportExcel(params, map); // workbook.write(response.getOutputStream()); @@ -141,4 +157,20 @@ public class LxyHdTjController { workbook.write(outputStream); outputStream.close(); } + + + @At + @RequiresPermissions("zgfw.lxy.hdtj") + public Object openSendMessage(String hdid, + @Param("sendTypes") String[] sendTypes, + @Param("content") String content) { + List grxxes = lxyGrxxService.dao().query(Lxy_bm.class, Cnd.where("hdid", "=", hdid).and("bmzt", "=", 5)); +// List loginnames = grxxes.stream().map(Lxy_bm::getLoginname).collect(Collectors.toList()); +// loginnames.forEach(loginname -> { +// msgApi.sendMsg(content, "", "", "", "4", new ArrayList<>() {{ +// add(NutMap.NEW().addv("userId", loginname)); +// }}); +// }); + return null; + } } diff --git a/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyMetjController.java b/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyMetjController.java index 25b3cc7..3b94986 100644 --- a/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyMetjController.java +++ b/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyMetjController.java @@ -5,11 +5,11 @@ import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.utils.DateUtil; import io.v.nutz.base.utils.PageUtil; import io.v.nutz.base.utils.Vi; +import io.v.nutz.sys.services.SysUserService; +import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.zhgh.lxy.model.Lxy_bm; import io.v.nutz.zhgh.lxy.service.LxyBmService; import io.v.nutz.zhgh.lxy.service.LxyHdService; -import io.v.nutz.sys.services.SysUserService; -import io.v.nutz.web.commons.utils.ShiroUtil; import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.nutz.dao.Cnd; diff --git a/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyXghshController.java b/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyXghshController.java index 2bf5971..5ccba87 100644 --- a/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyXghshController.java +++ b/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyXghshController.java @@ -8,14 +8,15 @@ import io.v.nutz.base.service.BaseService; import io.v.nutz.base.utils.PageUtil; import io.v.nutz.base.utils.Roles; import io.v.nutz.base.utils.Vi; +import io.v.nutz.sys.models.Sys_file; +import io.v.nutz.web.commons.utils.FileUtil; +import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.zhgh.lxy.model.Lxy_grxx; import io.v.nutz.zhgh.lxy.service.LxyBmService; import io.v.nutz.zhgh.lxy.service.LxyHdService; -import io.v.nutz.sys.models.Sys_file; -import io.v.nutz.web.commons.utils.ShiroUtil; -import org.apache.commons.net.ftp.FTPClient; import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.nutz.boot.starter.ftp.FtpService; import org.nutz.dao.Chain; import org.nutz.dao.Cnd; import org.nutz.dao.Sqls; @@ -26,6 +27,7 @@ import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.json.Json; import org.nutz.lang.Strings; +import org.nutz.lang.random.R; import org.nutz.lang.util.NutMap; import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.Ok; @@ -33,15 +35,14 @@ import org.nutz.mvc.annotation.Param; import org.nutz.trans.Trans; import javax.servlet.http.HttpServletResponse; -import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; import java.io.IOException; -import java.io.InputStream; import java.net.URLEncoder; import java.util.List; -import java.util.zip.ZipEntry; -import java.util.zip.ZipOutputStream; - -import static org.nutz.boot.starter.ftp.FtpStarter.*; +import java.util.Map; +import java.util.stream.Collectors; /** * @Author: 1V @@ -69,6 +70,9 @@ public class LxyXghshController { @Inject protected PropertiesProxy conf; + @Inject + private FtpService ftpService; + @At("") @Ok("beetl:/platform/zgfw/lxy/HdXghsh.html") @RequiresPermissions("zgfw.lxy.xghsh") @@ -78,14 +82,14 @@ public class LxyXghshController { @At @ViReturn @RequiresPermissions("zgfw.lxy.xghsh") - public Object pageData(@Param(value = "hdid",required = false) String hdid, - @Param(value = "year",required = false) Integer year, - @Param(value = "isAudit",required = false) Integer isAudit, - @Param(value = "searchName",required = false) String searchName, - @Param(value = "unionId",required = false) String unionId, - @Param("pageNumber") int pageNumber,@Param("pageSize") int pageSize, - @Param(value = "pageOrderName",required = false) String pageOrderName, - @Param(value = "pageOrderBy",required = false) String pageOrderBy) { + public Object pageData(@Param(value = "hdid", required = false) String hdid, + @Param(value = "year", required = false) Integer year, + @Param(value = "isAudit", required = false) Integer isAudit, + @Param(value = "searchName", required = false) String searchName, + @Param(value = "unionId", required = false) String unionId, + @Param("pageNumber") int pageNumber, @Param("pageSize") int pageSize, + @Param(value = "pageOrderName", required = false) String pageOrderName, + @Param(value = "pageOrderBy", required = false) String pageOrderBy) { Sql sql = Sqls.create(""" SELECT mefp.*, @@ -94,6 +98,7 @@ public class LxyXghshController { hd.*, (mefp.number - ( SELECT count( 1 ) FROM lxy_bm bm WHERE bm.hdid = mefp.hdid AND bm.ghid = mefp.ghid AND bm.bmzt NOT IN (2,4)) ) remain, (SELECT count( 1 ) FROM lxy_bm bm WHERE bm.hdid = mefp.hdid AND bm.ghid = mefp.ghid AND bm.bmzt = 3) dsh, + (SELECT count( 1 ) FROM lxy_bm bm WHERE bm.hdid = mefp.hdid AND bm.ghid = mefp.ghid AND bm.bmzt = 5) ysh, (SELECT GROUP_CONCAT(u.username) FROM lxy_bm bm LEFT JOIN `user` u on u.id=bm.userid WHERE bm.hdid=@hdid AND bm.ghid=mefp.ghid AND bm.bmzt != 4) username , (SELECT GROUP_CONCAT(DISTINCT concat(u.username,'(',u.mobile,')') ) FROM `user` u LEFT JOIN sys_user_role ur ON u.id = ur.userId WHERE u.unionid = mefp.ghid AND ur.roleId = @roleId ) fglyname FROM @@ -108,7 +113,7 @@ public class LxyXghshController { Cnd cnd = Cnd.NEW(); cnd.andEX("mefp.ghid", "=", unionId); - cnd.and(new Static("now()", 0); cnd.and("mefp.hdid", "=", hdid); cnd.and(new Static("(select count(1) from lxy_bm lb where lb.hdid = '" + hdid + "' and lb.ghid = mefp.ghid AND lb.bmzt is NOT null) > 0 ")); @@ -148,40 +153,46 @@ public class LxyXghshController { * @return */ @At + @ViReturn @RequiresPermissions("zgfw.lxy.xghsh") public Object findBm(String ghId, String hdId, Integer pageNumber, Integer pageSize) { - try { - Sql sql = Sqls.create(""" - SELECT - l.id, - hd.id hdid, - u.id uid, - u.loginname, - u.username, - u.unitname, - u.unionname, - u.sex, - u.mobile, - TIMESTAMPDIFF(YEAR,u.birthday,CURDATE()) age, - bm.bmzt, - bm.ghid - FROM lxy_bm bm - LEFT JOIN lxy_hd hd ON hd.id = bm.hdid - LEFT JOIN Lxy_grxx l ON l.userid = bm.userid - LEFT JOIN `user` u ON u.id = bm.userid - WHERE bm.bmzt IN (3,4,5) AND bm.hdid = @hdid - AND bm.ghid = @ghid - GROUP BY u.username - ORDER BY bm.bmzt ASC - """); - sql.setParam("hdid", hdId); - sql.setParam("ghid", ghId); -// List list = lxyBmService.list(sql); - Pagination pagination = lxyBmService.listPage(pageNumber, pageSize, sql); - return Result.success().addData(pagination); - } catch (Exception e) { - return Result.error(); - } + Sql sql = Sqls.create(""" + SELECT + l.id, + hd.id hdid, + u.id uid, + u.loginname, + u.username, + u.sex, + bm.age, + bm.mobile, + bm.idcard, + bm.unitname, + bm.bmzt, + bm.zyhj, + bm.nation, + bm.talent, + bm.bz, + bm.ghid + FROM + lxy_bm bm + LEFT JOIN lxy_hd hd ON hd.id = bm.hdid + LEFT JOIN sys_user u ON u.id = bm.userid + LEFT JOIN sys_unit unit ON u.unitid = unit.id + LEFT JOIN Lxy_grxx l ON l.loginname = u.loginname + $condition + """); + + Cnd cnd = Cnd.NEW(); + cnd.and("bm.bmzt", "NOT IN", List.of(2, 4, 6)); + cnd.and("bm.hdid", "=", hdId); + cnd.and("bm.ghid", "=", ghId); + cnd.groupBy("u.loginname"); + cnd.desc("bm.bmzt"); + sql.setCondition(cnd); + Pagination pagination = lxyBmService.listPage(pageNumber, pageSize, sql); + return Result.success().addData(pagination); + } @At @@ -226,16 +237,12 @@ public class LxyXghshController { } @At - @RequiresAuthentication @RequiresPermissions("zgfw.lxy.xghsh") - public void downLoadAll(@Param(value = "year",required = false) Integer year, - @Param(value = "hdid",required = false) String hdid, - @Param(value = "unionId",required = false) String unionId, - @Param(value = "isAudit",required = false) Integer isAudit, HttpServletResponse response) throws IOException { + public void downLoadAll(@Param(value = "year", required = false) Integer year, + @Param(value = "hdid", required = false) String hdid, + @Param(value = "unionId", required = false) String unionId, + @Param(value = "isAudit", required = false) Integer isAudit, HttpServletResponse response) throws IOException { - response.setContentType("application/octet-stream"); - response.setHeader("content-disposition", "attachment;filename=" - + URLEncoder.encode("报名人员材料.zip", "UTF-8")); Sql sql = Sqls.create(""" SELECT @@ -262,45 +269,70 @@ public class LxyXghshController { sql.setCondition(cnd); List list = baseService.listMap(sql); - //连接ftp - FTPClient ftpClient = new FTPClient(); - ftpClient.connect(conf.get(PROP_SERVER_HOST, ""), conf.getInt(PROP_SERVER_PORT, 21)); - ftpClient.login(conf.get(PROP_SERVER_USERNAME, ""), conf.get(PROP_SERVER_PASSWORD, "")); - ftpClient.enterLocalPassiveMode(); try { - ZipOutputStream zipOutputStream = new ZipOutputStream(new BufferedOutputStream(response.getOutputStream())); - list.forEach(item -> { - if (StrUtil.isNotBlank(item.getString("files"))) { - List fileList = Json.fromJsonAsList(Sys_file.class, item.getString("files")); - try { - for (int i = 0; i < fileList.size(); i++) { - Sys_file file = fileList.get(0); - String fileName = item.getString("username"); - if (fileList.size() > 1) { - fileName = fileName + (i + 1); + response.reset(); + response.setContentType("application/x-msdownload;charset=utf-8"); + + /** + * 创建临时文件夹 + */ + String tmpPath = "tmp/" + R.UU32(); + File tmpDir = new File(tmpPath + "/报名人员材料"); + tmpDir.mkdirs(); + + Map> unionNameMap = list.stream() + .collect(Collectors.groupingBy(l -> l.getString("unionname"))); + + + unionNameMap.forEach((k, v) -> { + File unionTmpDir = new File(tmpDir + "/" + k); + unionTmpDir.mkdirs(); + List unionNameList = list.stream().filter(li -> li.getString("unionname").equals(k)).collect(Collectors.toList()); + + unionNameList.forEach(item -> { + + File tDir = new File(unionTmpDir + "/" + item.getString("username")); + tDir.mkdirs(); + + if (StrUtil.isNotBlank(item.getString("files"))) { + List fileList = Json.fromJsonAsList(Sys_file.class, item.getString("files")); + fileList.forEach(file -> { + try { + FileOutputStream outputStream = new FileOutputStream(tDir.getPath() + "/" + file.getFilename()); + ftpService.download(file.getFilepath(), outputStream); + outputStream.close(); + } catch (Exception e) { + e.printStackTrace(); } - fileName = fileName + "--" + file.getFilename(); - zipOutputStream.putNextEntry(new ZipEntry(item.getString("unionname") + "/" + fileName)); - //读取ftp文件 - InputStream inputStream = ftpClient.retrieveFileStream(file.getFilepath()); - org.apache.commons.io.IOUtils.copy(inputStream, zipOutputStream); - inputStream.close(); - zipOutputStream.closeEntry(); - ftpClient.completePendingCommand(); - response.flushBuffer(); - } - } catch (Exception e) { - e.printStackTrace(); + }); } - } + }); }); - zipOutputStream.flush(); - zipOutputStream.close(); - ftpClient.logout(); + + String aimsDir = "zipTmp/" + R.UU32(); + String aimsName = "报名人员材料.zip"; + String aimsPath = aimsDir + "/" + aimsName; + FileUtil.compressToZip(tmpDir.getPath(), aimsDir, aimsName); + + response.setHeader("content-disposition", "attachment;filename=" + + URLEncoder.encode(aimsName, "UTF-8")); + + File aimsFile = new File(aimsPath); + FileInputStream inputStream = new FileInputStream(aimsFile); + org.apache.commons.io.IOUtils.copy(inputStream, response.getOutputStream()); + inputStream.close(); + aimsFile.delete(); + + FileUtil.deleteDir(new File(tmpPath)); + FileUtil.deleteDir(new File(aimsDir)); } catch (Exception e) { e.printStackTrace(); } + } + + + } diff --git a/src/main/java/io/v/nutz/zhgh/lxy/model/Lxy_bm.java b/src/main/java/io/v/nutz/zhgh/lxy/model/Lxy_bm.java index 10ac815..9f283f0 100644 --- a/src/main/java/io/v/nutz/zhgh/lxy/model/Lxy_bm.java +++ b/src/main/java/io/v/nutz/zhgh/lxy/model/Lxy_bm.java @@ -32,6 +32,11 @@ public class Lxy_bm { @ColDefine(type = ColType.VARCHAR, width = 32) private String userid; + @Column + @Comment("工号") + @ColDefine(type = ColType.VARCHAR, width = 32) + private String loginname; + @Column @Comment("工会id") @ColDefine(type = ColType.VARCHAR, width = 32) @@ -43,15 +48,64 @@ public class Lxy_bm { private String bmsj; @Column - @Comment("报名状态(1.待基层工会审核 2.基层工会审核不通过 3.待校工会审核 4 校工会审核不通过 5 报名成功 6 待填写个人资料)") + @Comment("报名状态(1.待分工会审核 2.分工会审核不通过 3.待校工会审核 4 校工会审核不通过 5 报名成功 6 待填写个人资料)") @ColDefine(type = ColType.INT) private Integer bmzt; @Column - @Comment("报名类型(1.基层工会统一报名 2.个人报名)") + @Comment("报名类型(1.分工会统一报名 2.个人报名)") @ColDefine(type = ColType.INT) private Integer bmlx; + @Column + @Comment("单位") + @ColDefine(type = ColType.VARCHAR, width = 50) + private String unitname; + @Column + @Comment("单位id") + @ColDefine(type = ColType.VARCHAR, width = 32) + private String unitid; + + @Column + @Comment("年龄") + @ColDefine(type = ColType.INT) + private String age; + + @Column + @Comment("民族") + @ColDefine(type = ColType.VARCHAR, width = 50) + private String nation; + + @Column + @Comment("疗休养身份") + @ColDefine(type = ColType.VARCHAR, width = 1000) + private String zyhj; + + @Column + @Comment("工会") + @ColDefine(type = ColType.VARCHAR, width = 50) + private String unionname; + + @Column + @Comment("身份证号码") + @ColDefine(type = ColType.VARCHAR, width = 32) + private String idcard; + + @Column + @Comment("手机号") + @ColDefine(type = ColType.VARCHAR, width = 11) + private String mobile; + + @Column + @Comment("是否为ABCDE类高层次人才") + @ColDefine(type = ColType.VARCHAR, width = 20) + private String talent; + + @Column + @Comment("备注") + @ColDefine(type = ColType.VARCHAR, width = 1000) + private String bz; + @Column @Comment("附件") @ColDefine(type = ColType.MYSQL_JSON) diff --git a/src/main/java/io/v/nutz/zhgh/lxy/template/LxyImportTemp.java b/src/main/java/io/v/nutz/zhgh/lxy/template/LxyImportTemp.java new file mode 100644 index 0000000..c685169 --- /dev/null +++ b/src/main/java/io/v/nutz/zhgh/lxy/template/LxyImportTemp.java @@ -0,0 +1,39 @@ +package io.v.nutz.zhgh.lxy.template; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +/** + * @version 1.0 + * @Author zzr + * @name:LxyImportTemp + * @Date 2025/6/11 16:16 + * @注释 + */ +@Data +public class LxyImportTemp { + + @Excel(name = "工号") + String loginname; + + @Excel(name = "姓名") + String username; + + @Excel(name = "民族") + String nation; + + @Excel(name = "疗休养员身份") + String zyhj; + + @Excel(name = "身份证号") + String idcard; + + @Excel(name = "联系电话") + String mobile; + + @Excel(name = "是否为ABCDE类高层次人才") + String talent; + + String remark; + +} diff --git a/src/main/resources/static/components/plugins/FileImport.vue b/src/main/resources/static/components/plugins/FileImport.vue index 06ce8c5..0295394 100644 --- a/src/main/resources/static/components/plugins/FileImport.vue +++ b/src/main/resources/static/components/plugins/FileImport.vue @@ -1,220 +1,220 @@ diff --git a/src/main/resources/views/platform/zgfw/lxy/HdFghsh.html b/src/main/resources/views/platform/zgfw/lxy/HdFghsh.html index f95a872..fa2ec25 100644 --- a/src/main/resources/views/platform/zgfw/lxy/HdFghsh.html +++ b/src/main/resources/views/platform/zgfw/lxy/HdFghsh.html @@ -3,7 +3,7 @@ layout("/layouts/platform.html"){ #-->
+
- + +
- + +
@@ -42,43 +54,53 @@ layout("/layouts/platform.html"){ - + - + - + - - + + - + @@ -86,44 +108,47 @@ layout("/layouts/platform.html"){ + @size-change="pageSizeChange" + @current-change="pageNumberChange" + :current-page="pageForm.pageNumber" + :page-sizes="[10, 20, 30, 50]" + :page-size="pageForm.pageSize" + layout="total, sizes, prev, pager, next" + :total="pageForm.totalCount"> + - + + - - + - + - + - + @@ -133,9 +158,11 @@ layout("/layouts/platform.html"){ + @@ -192,75 +193,98 @@ layout("/layouts/platform.html"){ - + - - + + + + - + - + - + + - + + @@ -283,30 +307,37 @@ layout("/layouts/platform.html"){ @@ -449,6 +480,16 @@ display: -webkit-box; + + + + diff --git a/src/main/resources/views/platform/zgfw/lxy/HdGrbm.html b/src/main/resources/views/platform/zgfw/lxy/HdGrbm.html index f3c847c..325271c 100644 --- a/src/main/resources/views/platform/zgfw/lxy/HdGrbm.html +++ b/src/main/resources/views/platform/zgfw/lxy/HdGrbm.html @@ -3,7 +3,7 @@ layout("/layouts/platform.html"){ #-->
+
- + +
- + +
@@ -59,44 +71,60 @@ layout("/layouts/platform.html"){ - + - + - + - + - - + + - + @@ -104,14 +132,14 @@ layout("/layouts/platform.html"){ + @size-change="pageSizeChange" + @current-change="pageNumberChange" + :current-page="pageForm.pageNumber" + :page-sizes="[10, 20, 30, 50]" + :page-size="pageForm.pageSize" + layout="total, sizes, prev, pager, next" + :total="pageForm.totalCount"> +
@@ -120,12 +148,16 @@ layout("/layouts/platform.html"){
- 返回 + 返回 +
- - 请填写以下个人信息 - + + 请填写以下个人信息 + + + @@ -184,23 +216,17 @@ layout("/layouts/platform.html"){ - + 添加 - - + + @@ -210,15 +236,14 @@ layout("/layouts/platform.html"){ - + - + @@ -254,22 +277,21 @@ layout("/layouts/platform.html"){ + name="file" + ref="upload" + action="**" + :on-remove="handleRemove" + :on-change="handleChange" + :auto-upload="false" + limit="1" + :file-list="fileList" + list-type="picture"> 选择文件 -
+
取 消 确 定
@@ -417,11 +439,12 @@ layout("/layouts/platform.html"){ +
+#--> \ No newline at end of file diff --git a/src/main/resources/views/platform/zgfw/lxy/HdMange.html b/src/main/resources/views/platform/zgfw/lxy/HdMange.html index c1d7cc9..b61c3ad 100644 --- a/src/main/resources/views/platform/zgfw/lxy/HdMange.html +++ b/src/main/resources/views/platform/zgfw/lxy/HdMange.html @@ -50,11 +50,18 @@ layout("/layouts/platform.html"){
-
- - +
@@ -231,7 +238,7 @@ layout("/layouts/platform.html"){ - + @@ -363,7 +370,7 @@ layout("/layouts/platform.html"){ - + diff --git a/src/main/resources/views/platform/zgfw/lxy/HdMetj.html b/src/main/resources/views/platform/zgfw/lxy/HdMetj.html index 0d5ee0c..e8ffb1d 100644 --- a/src/main/resources/views/platform/zgfw/lxy/HdMetj.html +++ b/src/main/resources/views/platform/zgfw/lxy/HdMetj.html @@ -3,7 +3,7 @@ layout("/layouts/platform.html"){ #-->
+
- + +
- + +
@@ -81,43 +93,59 @@ layout("/layouts/platform.html"){ - + - + - + - - + + - - + + + - + - + - + - + @@ -127,12 +155,13 @@ layout("/layouts/platform.html"){ @@ -140,14 +169,14 @@ layout("/layouts/platform.html"){ + @size-change="pageSizeChange" + @current-change="pageNumberChange" + :current-page="pageForm.pageNumber" + :page-sizes="[10, 20, 30, 50]" + :page-size="pageForm.pageSize" + layout="total, sizes, prev, pager, next" + :total="pageForm.totalCount"> +
@@ -156,22 +185,27 @@ layout("/layouts/platform.html"){
- 返回 + 返回 +
- + + -
+
+
- + +
@@ -183,66 +217,75 @@ layout("/layouts/platform.html"){
- {{numData.unionname}} 共有 - {{numData.sum}} - 个名额, 可选择 - {{numData.kxz}} - 个, 已选择 - {{multipleSelection.length}} - 个。 + {{numData.unionname}} 共有 {{numData.sum}}个名额, + 可选择 {{numData.kxz}} + 个, + 已选择{{multipleSelection.length}}个。
- - + + + - - - - - + + + + + + @size-change="userPageSizeChange" + @current-change="userPageNumberChange" + :current-page="userPageForm.pageNumber" + :page-size="userPageForm.pageSize" + layout="total, prev, pager, next" + :total="userPageForm.totalCount"> + -
+
下一步
-
- - - - - - +
+ + + + + + + -
+
上一步 提交
@@ -257,68 +300,46 @@ layout("/layouts/platform.html"){
- 返回 + 返回 +
- + + - - - - - + + + + + @@ -349,10 +375,10 @@ layout("/layouts/platform.html"){
diff --git a/src/main/resources/views/platform/zgfw/lxy/HdXghsh.html b/src/main/resources/views/platform/zgfw/lxy/HdXghsh.html index 4fc0872..95670d7 100644 --- a/src/main/resources/views/platform/zgfw/lxy/HdXghsh.html +++ b/src/main/resources/views/platform/zgfw/lxy/HdXghsh.html @@ -39,7 +39,7 @@ layout("/layouts/platform.html"){ {{scope.row.name}} - + @@ -132,23 +132,29 @@ layout("/layouts/platform.html"){ tooltip-effect="dark" > - + - - + + - - + + @@ -160,7 +166,7 @@ layout("/layouts/platform.html"){ - 查看 + 审核 @@ -182,9 +188,8 @@ layout("/layouts/platform.html"){ - + - {{ viewData.loginname }} @@ -192,83 +197,28 @@ layout("/layouts/platform.html"){ {{ viewData.username }} - - {{ viewData.zw }} - - - {{ viewData.rsbz }} - {{ viewData.sex }} - {{ viewData.age }} + {{ viewData.nation }} {{ viewData.unitname }} + + {{ viewData.idcard }} + {{ viewData.mobile }} - {{ viewData.idcard }} - - {{ viewData.zyhj }} - - {{ viewData.bz }} + + {{ viewData.talent }} - - - - - - - 暂无个人材料 - - 不通过 @@ -639,7 +589,7 @@ layout("/layouts/platform.html"){ }, async created() { this.unions = await getUnions() - this.lxyHd = await getNowLxyHd() + this.lxyHd = await getLxyHd() this.pageForm.hdid = this.lxyHd[0].id this.pageData() } diff --git a/src/main/resources/views/platform/zgfw/lxy/dialogViewBm.html b/src/main/resources/views/platform/zgfw/lxy/dialogViewBm.html index 9b3716b..8a31cc6 100644 --- a/src/main/resources/views/platform/zgfw/lxy/dialogViewBm.html +++ b/src/main/resources/views/platform/zgfw/lxy/dialogViewBm.html @@ -1,15 +1,18 @@ + - + + + - + diff --git a/src/main/resources/views/platform/zgfw/lxy/dialogViewFp.html b/src/main/resources/views/platform/zgfw/lxy/dialogViewFp.html index 95cb874..aab2f49 100644 --- a/src/main/resources/views/platform/zgfw/lxy/dialogViewFp.html +++ b/src/main/resources/views/platform/zgfw/lxy/dialogViewFp.html @@ -1,7 +1,10 @@ - + - + - +
+ 个人信息
工号{{viewData.loginname}} {{viewData.loginname}} 姓名 {{viewData.username}}
职务{{viewData.zw}} {{viewData.zw}} 人事编制 {{viewData.rsbz}}
性别{{viewData.sex}} {{viewData.sex}} 年龄 {{viewData.age}}
所在单位{{viewData.unitname}} {{viewData.unitname}} 手机号 {{viewData.mobile}}
- + @@ -150,35 +177,17 @@ layout("/layouts/platform.html"){
- - -
- - {{row.ryfj}} - + + + +
+ {{row.ryfj}}
@@ -187,46 +196,33 @@ layout("/layouts/platform.html"){