commit
This commit is contained in:
@@ -2,17 +2,22 @@ package io.v.nutz.zhgh.lxy.controller;
|
|||||||
|
|
||||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||||
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
|
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
|
||||||
|
import com.deepoove.poi.XWPFTemplate;
|
||||||
|
import com.deepoove.poi.config.Configure;
|
||||||
|
import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
|
||||||
import io.v.nutz.base.annontation.ViReturn;
|
import io.v.nutz.base.annontation.ViReturn;
|
||||||
import io.v.nutz.base.utils.MsgApi;
|
import io.v.nutz.base.utils.MsgApi;
|
||||||
import io.v.nutz.base.utils.OfficeTemplateUtil;
|
import io.v.nutz.base.utils.OfficeTemplateUtil;
|
||||||
import io.v.nutz.base.utils.Vi;
|
import io.v.nutz.base.utils.Vi;
|
||||||
import io.v.nutz.zhgh.lxy.model.Lxy_bm;
|
import io.v.nutz.zhgh.lxy.model.Lxy_bm;
|
||||||
|
import io.v.nutz.zhgh.lxy.model.Lxy_hd;
|
||||||
import io.v.nutz.zhgh.lxy.service.LxyGrxxService;
|
import io.v.nutz.zhgh.lxy.service.LxyGrxxService;
|
||||||
import io.v.nutz.zhgh.lxy.service.LxyHdService;
|
import io.v.nutz.zhgh.lxy.service.LxyHdService;
|
||||||
import org.apache.poi.ss.usermodel.Workbook;
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.nutz.dao.Cnd;
|
import org.nutz.dao.Cnd;
|
||||||
|
import org.nutz.dao.Dao;
|
||||||
import org.nutz.dao.Sqls;
|
import org.nutz.dao.Sqls;
|
||||||
import org.nutz.dao.entity.Record;
|
import org.nutz.dao.entity.Record;
|
||||||
import org.nutz.dao.sql.Sql;
|
import org.nutz.dao.sql.Sql;
|
||||||
@@ -29,6 +34,7 @@ import org.nutz.mvc.annotation.Param;
|
|||||||
import javax.servlet.ServletOutputStream;
|
import javax.servlet.ServletOutputStream;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -45,19 +51,16 @@ public class LxyHdTjController {
|
|||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private LxyHdService lxyHdService;
|
private LxyHdService lxyHdService;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private LxyGrxxService lxyGrxxService;
|
private LxyGrxxService lxyGrxxService;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private Vi vi;
|
private Vi vi;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private OfficeTemplateUtil officeTemplateUtil;
|
private OfficeTemplateUtil officeTemplateUtil;
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private MsgApi msgApi;
|
private MsgApi msgApi;
|
||||||
|
@Inject
|
||||||
|
private Dao dao;
|
||||||
|
|
||||||
@At("")
|
@At("")
|
||||||
@Ok("beetl:/platform/zgfw/lxy/HdTj.html")
|
@Ok("beetl:/platform/zgfw/lxy/HdTj.html")
|
||||||
@@ -73,9 +76,24 @@ public class LxyHdTjController {
|
|||||||
@Param(value = "searchKey", required = false) String searchKey,
|
@Param(value = "searchKey", required = false) String searchKey,
|
||||||
@Param("pageNumber") int pageNumber, @Param("pageSize") int pageSize) {
|
@Param("pageNumber") int pageNumber, @Param("pageSize") int pageSize) {
|
||||||
Cnd cnd = Cnd.NEW();
|
Cnd cnd = Cnd.NEW();
|
||||||
Sql sql = Sqls.create("SELECT gr.* ,u.unionname,u.unioncode,u.unitname unitname,u.unitcode FROM `lxy_grxx` gr \n" +
|
Sql sql = Sqls.create("""
|
||||||
"LEFT JOIN lxy_bm bm ON bm.userid = gr.userid \n" +
|
SELECT
|
||||||
"LEFT JOIN `user` u ON u.id=bm.userid $condition");
|
gr.*,
|
||||||
|
u.unionname,
|
||||||
|
u.unioncode,
|
||||||
|
u.unitname,
|
||||||
|
u.unitcode,
|
||||||
|
bm.zyhj,
|
||||||
|
bm.bz,
|
||||||
|
bm.talent,
|
||||||
|
bm.nation,
|
||||||
|
bm.bmzt
|
||||||
|
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(new Static("bm.bmzt = 5"));
|
||||||
cnd.and("gr.hdid", "=", hdid);
|
cnd.and("gr.hdid", "=", hdid);
|
||||||
@@ -108,56 +126,44 @@ public class LxyHdTjController {
|
|||||||
Cnd cnd = Cnd.NEW();
|
Cnd cnd = Cnd.NEW();
|
||||||
Sql sql = Sqls.create("""
|
Sql sql = Sqls.create("""
|
||||||
SELECT
|
SELECT
|
||||||
gr.*,
|
gr.username as uName,
|
||||||
bm.unionname,
|
|
||||||
bm.unitname,
|
bm.unitname,
|
||||||
|
gr.sex,
|
||||||
|
bm.nation,
|
||||||
bm.zyhj,
|
bm.zyhj,
|
||||||
bm.bz
|
bm.idcard,
|
||||||
|
bm.mobile,
|
||||||
|
bm.talent
|
||||||
FROM
|
FROM
|
||||||
`lxy_grxx` gr
|
`lxy_grxx` gr
|
||||||
LEFT JOIN lxy_bm bm ON bm.userid = gr.userid
|
LEFT JOIN lxy_bm bm ON bm.userid = gr.userid
|
||||||
LEFT JOIN `user` u ON u.id = bm.userid
|
LEFT JOIN `user` u ON u.id = bm.userid
|
||||||
$condition
|
$condition
|
||||||
""");
|
""");
|
||||||
|
cnd.and("bm.bmzt", "=", 5);
|
||||||
cnd.and(new Static("bm.bmzt = 5"));
|
|
||||||
cnd.and("gr.hdid", "=", hdid);
|
cnd.and("gr.hdid", "=", hdid);
|
||||||
|
cnd.andEX("gr.ghid", "=", ghid);
|
||||||
if (Strings.isNotBlank(ghid)) {
|
|
||||||
cnd.and("gr.ghid", "=", ghid);
|
|
||||||
}
|
|
||||||
cnd.groupBy("bm.userid");
|
cnd.groupBy("bm.userid");
|
||||||
cnd.asc("bm.unionname").asc("bm.unitname").asc("gr.age");
|
cnd.asc("u.unioncode");
|
||||||
sql.setCondition(cnd);
|
sql.setCondition(cnd);
|
||||||
List<Record> list = lxyGrxxService.list(sql);
|
List<Record> list = lxyGrxxService.list(sql);
|
||||||
int i = 1;
|
for (int i = 0; i < list.size(); i++) {
|
||||||
for (Record r : list) {
|
list.get(i).set("index", i + 1);
|
||||||
r.set("index", i);
|
|
||||||
List<NutMap> chry = Json.fromJsonAsList(NutMap.class, r.getString("chry"));
|
|
||||||
for (NutMap map : chry) {
|
|
||||||
r.set("rych", (r.getString("rych") == null ? "" : r.getString("rych")) + " " + map.getString("shry"));
|
|
||||||
}
|
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// HackLoopTableRenderPolicy policy = new HackLoopTableRenderPolicy();
|
NutMap map = new NutMap();
|
||||||
// Configure config = Configure.newBuilder().bind("list", policy).build();
|
map.put("list", list);
|
||||||
HashMap<String, Object> map = new HashMap<>();
|
|
||||||
map.put("hdmc", hdname);
|
HackLoopTableRenderPolicy policy = new HackLoopTableRenderPolicy();
|
||||||
map.put("mapList", list);
|
Configure config = Configure.builder().bind("list", policy).build();
|
||||||
String fileName = "疗休养人员名单汇总表.xls";
|
|
||||||
|
String fileName = "疗休养人员名单汇总表.docx";
|
||||||
response.setContentType("application/octet-stream");
|
response.setContentType("application/octet-stream");
|
||||||
response.setHeader("Content-Disposition", "attachment;filename=" + new String(fileName.getBytes("utf-8"), "ISO8859-1"));
|
response.setHeader("Content-Disposition", "attachment;filename=" + new String(fileName.getBytes(StandardCharsets.UTF_8), "ISO8859-1"));
|
||||||
// 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());
|
|
||||||
Workbook workbook = ExcelExportUtil.exportExcel(params, map);
|
|
||||||
ServletOutputStream outputStream = response.getOutputStream();
|
|
||||||
workbook.write(outputStream);
|
|
||||||
outputStream.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
XWPFTemplate.compile(officeTemplateUtil.getPath("lxy_lxyrymd"), config).render(map).write(response.getOutputStream());
|
||||||
|
response.getOutputStream().close();
|
||||||
|
}
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@RequiresPermissions("zgfw.lxy.hdtj")
|
@RequiresPermissions("zgfw.lxy.hdtj")
|
||||||
|
|||||||
@@ -2,19 +2,10 @@
|
|||||||
layout("/layouts/platform.html"){
|
layout("/layouts/platform.html"){
|
||||||
#-->
|
#-->
|
||||||
<style>
|
<style>
|
||||||
.file-down-span {
|
.el-descriptions-item__label.is-bordered-label {
|
||||||
background: black;
|
max-width: 200px;
|
||||||
opacity: 0.5;
|
min-width: 200px;
|
||||||
z-index: 1000;
|
width: 200px;
|
||||||
width: 100px;
|
|
||||||
text-align: center;
|
|
||||||
position: relative;
|
|
||||||
bottom: -100px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.viewFile {
|
|
||||||
height: 150px;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<div id="app" v-cloak>
|
<div id="app" v-cloak>
|
||||||
@@ -63,38 +54,43 @@ layout("/layouts/platform.html"){
|
|||||||
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
|
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="pull-right offscreen-right mt5">
|
|
||||||
<el-button :disabled="!pageForm.hdid" @click="$refs.customMessage.open()"
|
|
||||||
type="primary">一键发送
|
|
||||||
</el-button>
|
|
||||||
<el-button @click="doExport" icon="el-icon-download" type="primary">导 出</el-button>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="mt10" shadow="never">
|
<el-card class="mt10" shadow="never">
|
||||||
|
<table-tool label="报名列表" :app="this">
|
||||||
|
<template #func>
|
||||||
|
<el-button @click="doExport" icon="el-icon-download" type="primary" size="small">导出</el-button>
|
||||||
|
</template>
|
||||||
|
</table-tool>
|
||||||
<el-table :data="tableData" row-key="id" style="width: 100%" v-loading="tabLoading">
|
<el-table :data="tableData" row-key="id" style="width: 100%" v-loading="tabLoading">
|
||||||
<el-table-column align="center" header-align="center" label="序号" width="100px">
|
<el-table-column align="center" header-align="center" label="序号" width="100px">
|
||||||
<template scope="scope">
|
<template scope="scope">
|
||||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" header-align="center" label="姓名"
|
<el-table-column align="center" header-align="center" label="工号" prop="loginname"></el-table-column>
|
||||||
prop="username"></el-table-column>
|
<el-table-column align="center" header-align="center" label="姓名" prop="username"></el-table-column>
|
||||||
<el-table-column align="center" header-align="center" label="性别"
|
<el-table-column align="center" header-align="center" label="性别" prop="sex" sortable width="80"></el-table-column>
|
||||||
prop="sex"></el-table-column>
|
<el-table-column align="center" header-align="center" label="民族" prop="nation" sortable width="80"></el-table-column>
|
||||||
<el-table-column align="center" header-align="center" label="年龄"
|
<el-table-column align="center" header-align="center" label="疗休养员身份" prop="zyhj" show-overflow-tooltip></el-table-column>
|
||||||
prop="age" sortable></el-table-column>
|
<el-table-column align="center" header-align="center" label="身份证号" prop="idcard"></el-table-column>
|
||||||
<el-table-column align="center" header-align="center" label="民族"
|
<el-table-column align="center" header-align="center" label="联系电话" prop="mobile"></el-table-column>
|
||||||
prop="mz" sortable></el-table-column>
|
<el-table-column
|
||||||
<el-table-column align="center" header-align="center" label="手机号"
|
align="center"
|
||||||
prop="mobile" show-overflow-tooltip></el-table-column>
|
header-align="center"
|
||||||
<el-table-column align="center" header-align="center" label="身份证号" prop="idcard"
|
label="是否为ABCDE类高层次人才"
|
||||||
width="300px"></el-table-column>
|
prop="talent"
|
||||||
<el-table-column align="center" header-align="center" label="工会"
|
show-overflow-tooltip
|
||||||
prop="unionname" show-overflow-tooltip sortable></el-table-column>
|
></el-table-column>
|
||||||
<el-table-column align="center" header-align="center" label="单位"
|
<el-table-column align="center" header-align="center" label="报名状态" prop="bmzt">
|
||||||
prop="unitname" show-overflow-tooltip sortable></el-table-column>
|
<template scope="scope">
|
||||||
|
<span style="color: #e6a23c" v-if="scope.row.bmzt==1">待分工会审核</span>
|
||||||
|
<span style="color: #f56c6c" v-if="scope.row.bmzt==2">分工会审核未通过</span>
|
||||||
|
<span style="color: #e6a23c" v-if="scope.row.bmzt==3">待校工会审核</span>
|
||||||
|
<span style="color: #f56c6c" v-if="scope.row.bmzt==4">校工会审核未通过</span>
|
||||||
|
<span style="color: #67c23a" v-if="scope.row.bmzt==5">报名成功</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column align="center" fixed="right" header-align="center" label="操作"
|
<el-table-column align="center" fixed="right" header-align="center" label="操作"
|
||||||
width="120px">
|
width="120px">
|
||||||
@@ -120,101 +116,21 @@ layout("/layouts/platform.html"){
|
|||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<template #view>
|
<template #view>
|
||||||
|
<el-descriptions class="margin-top" title="" :column="3" border>
|
||||||
<el-row style="padding: 50px 150px">
|
<el-descriptions-item label="工号">{{ viewData.loginname }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="姓名">{{ viewData.username }}</el-descriptions-item>
|
||||||
<el-form label-position="right" label-width="120px" style="padding: 20px 0">
|
<el-descriptions-item label="人事编制">{{ viewData.rsbz }}</el-descriptions-item>
|
||||||
<vi-title title="个人信息"></vi-title>
|
<el-descriptions-item label="性别">{{ viewData.sex }}</el-descriptions-item>
|
||||||
<el-row gutter="20">
|
<el-descriptions-item label="年龄">{{ viewData.age }}</el-descriptions-item>
|
||||||
<el-col :span="12">
|
<el-descriptions-item label="所在单位">{{ viewData.unitname }}</el-descriptions-item>
|
||||||
<el-form-item label="工号:">
|
<el-descriptions-item label="手机号">{{ viewData.mobile }}</el-descriptions-item>
|
||||||
{{viewData.loginname}}
|
<el-descriptions-item label="身份证号">{{ viewData.idcard }}</el-descriptions-item>
|
||||||
</el-form-item>
|
<el-descriptions-item label="获奖名称">{{ viewData.zyhj }}</el-descriptions-item>
|
||||||
</el-col>
|
<el-descriptions-item label="民族">{{ viewData.nation }}</el-descriptions-item>
|
||||||
<el-col :span="12">
|
<el-descriptions-item label="疗休养身份">{{ viewData.zyhj }}</el-descriptions-item>
|
||||||
<el-form-item label="姓名:">
|
<el-descriptions-item label="是否为ABCDE类高层次人才">{{ viewData.talent }}</el-descriptions-item>
|
||||||
{{viewData.username}}
|
<el-descriptions-item label="备注">{{ viewData.bz }}</el-descriptions-item>
|
||||||
</el-form-item>
|
</el-descriptions>
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="人事编制:">
|
|
||||||
{{viewData.rsbz}}
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="性别:">
|
|
||||||
{{viewData.sex}}
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="年龄:">
|
|
||||||
{{viewData.age}}
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="所在单位:">
|
|
||||||
{{viewData.unitname}}
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="手机号:">
|
|
||||||
{{viewData.mobile}}
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="身份证号:">
|
|
||||||
{{viewData.idcard}}
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="获奖名称:">
|
|
||||||
{{viewData.zyhj}}
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="备注:">
|
|
||||||
{{viewData.bz}}
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<template v-if="viewData.files&&viewData.files.length">
|
|
||||||
<vi-title title="身份证复印件"></vi-title>
|
|
||||||
<div style="text-align: left;">
|
|
||||||
<div style="display: inline-block;width: 100px;margin-right:10px"
|
|
||||||
v-for="item in viewData.files">
|
|
||||||
<div @click="dd3s.download(item.filepath,item.filename)"
|
|
||||||
class="file-down-span">
|
|
||||||
<i class="el-icon-download"></i>
|
|
||||||
</div>
|
|
||||||
<el-image :src="'${AppFileDomain!}'+item.filepath"
|
|
||||||
@click="dd3s.showpic(item.filepath)"
|
|
||||||
fit="cover"
|
|
||||||
style="width: 100px;height: 100px;box-shadow: 0 0 5px rgb(200,200,200)"
|
|
||||||
v-if="dd3s.isPic(item.filepath)">
|
|
||||||
</el-image>
|
|
||||||
<el-image src="***"
|
|
||||||
style="width: 100px;height: 100px;box-shadow: 0 0 5px rgb(200,200,200)"
|
|
||||||
v-else>
|
|
||||||
<div class="image-slot" slot="error"
|
|
||||||
style="width: 100%;height: 100%; display:flex;align-items: center;text-align: center">
|
|
||||||
<span style="font-size: 12px;color: rgb(180,180,180);width: 100%;text-align: center;overflow: hidden;padding: 0 10px;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
display: -webkit-box;
|
|
||||||
-webkit-line-clamp: 2;
|
|
||||||
-webkit-box-orient: vertical">{{item.filename}}</span>
|
|
||||||
</div>
|
|
||||||
</el-image>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<vi-title title="个人材料"></vi-title>
|
|
||||||
<file-upload :files="viewData.bmFiles"
|
|
||||||
:view="true"
|
|
||||||
v-if="viewData.bmFiles && viewData.bmFiles.length > 0"></file-upload>
|
|
||||||
<span v-else>暂无个人材料</span>
|
|
||||||
</el-form>
|
|
||||||
</el-row>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<custom-message @confirm="confirmMsg" ref="customMessage"></custom-message>
|
<custom-message @confirm="confirmMsg" ref="customMessage"></custom-message>
|
||||||
@@ -289,7 +205,7 @@ display: -webkit-box;
|
|||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(async () => {
|
}).then(async () => {
|
||||||
window.location.href = '/platform/zgfw/lxy/hdtj/doExport?hdid=' + this.pageForm.hdid + '&ghid=' + this.pageForm.ghid + '&hdname=' + obj.name
|
window.open('/platform/zgfw/lxy/hdtj/doExport?hdid=' + this.pageForm.hdid + '&ghid=' + this.pageForm.ghid + '&hdname=' + obj.name)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user