init
This commit is contained in:
@@ -0,0 +1,235 @@
|
||||
package io.v.nutz.zhgh.hd.controller.ca;
|
||||
|
||||
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import cn.wizzer.framework.base.service.BaseService;
|
||||
import cn.wizzer.framework.page.Pagination;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.FileService;
|
||||
import io.v.nutz.base.utils.PageUtil;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_ca_sbxx;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.web.commons.base.Globals;
|
||||
import io.v.nutz.zhgh.hd.services.*;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
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.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.Strings;
|
||||
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 java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/hd/childhd/sczp")
|
||||
@Ok("json:full")
|
||||
@RequiresAuthentication
|
||||
public class HdChildAddZpController {
|
||||
|
||||
@Inject
|
||||
private HdCasbxxService hdCasbxxService;
|
||||
|
||||
@Inject
|
||||
private HdCasbxxFjService hdCasbxxFjService;
|
||||
|
||||
@Inject
|
||||
private HdWmLbService hdWmLbService;
|
||||
|
||||
@Inject
|
||||
private HdWmZplbService hdWmZplbService;
|
||||
|
||||
@Inject
|
||||
private HdWmxxService hdWmxxService;
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@Inject
|
||||
private FileService fileService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/hd/ca/zpMange.html")
|
||||
@RequiresPermissions("hd.child.sczp")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前人的工会name
|
||||
*/
|
||||
@At
|
||||
@RequiresPermissions("hd.child.sczp")
|
||||
public String getGhname() {
|
||||
return Optional.ofNullable(Vi.getUnion()).map(v -> v.getUnionname()).orElse(null);
|
||||
}
|
||||
|
||||
@At
|
||||
@RequiresPermissions("hd.child.sczp")
|
||||
public Object initformHdxxlist() {
|
||||
try {
|
||||
Sql sql = Sqls.create("select * from hd_wm_xx where hdtype =2 and hdflag = 1 and hdkssj<=NOW() and hdjssj >=NOW()");
|
||||
return Result.success().addData(baseService.list(sql));
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object pageData(PageForm page,
|
||||
@Param(value = "hdid", required = false) String hdid,
|
||||
@Param(value = "hdlb", required = false) String hdlb,
|
||||
@Param(value = "zplb", required = false) String zplb,
|
||||
@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "unitId", required = false) String unitId,
|
||||
@Param(value = "year", required = false) String year) {
|
||||
try {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
xx.*,
|
||||
sbr.username AS sbrname,
|
||||
sbr.loginname,
|
||||
hd.hdname,
|
||||
hd.hdkssj,
|
||||
hd.hdjssj,
|
||||
zplb.zname as zplbname,
|
||||
lb.lname as hdlbname,
|
||||
dw.name as dwname,
|
||||
gh.unionname as ghname
|
||||
FROM
|
||||
hd_ca_sbxx xx
|
||||
LEFT JOIN sys_user sbr ON sbr.id = xx.sbr
|
||||
left join sys_unit dw on dw.id = sbr.unitid
|
||||
LEFT JOIN sys_union gh ON gh.id = dw.unionid
|
||||
left join hd_wm_xx hd on hd.hdid = xx.hdid
|
||||
left join hd_wm_zplb zplb on zplb.zid = xx.zplb
|
||||
left join hd_wm_lb lb on lb.lid = xx.hdlb
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("xx.hdid", "in", Sqls.create("select hdid from hd_wm_xx where hdtype =2"));
|
||||
if (!ShiroUtil.hasAnyRoles("H04,sysadmin")) {
|
||||
cnd.and("xx.sbr", "=", ShiroUtil.getPrincipalProperty("id"));
|
||||
}
|
||||
cnd.andEX("xx.hdid", "=", hdid);
|
||||
cnd.andEX("xx.hdlb", "=", hdlb);
|
||||
cnd.andEX("xx.zplb", "=", zplb);
|
||||
cnd.andEX("dw.id", "=", unitId);
|
||||
cnd.andEX("gh.id", "=", unionId);
|
||||
cnd.andEX("YEAR(xx.sbsj)", "=", year);
|
||||
|
||||
if (Strings.isNotBlank(page.getSearchName()) && Strings.isNotBlank(page.getSearchKeyword())) {
|
||||
cnd.where().andLike(page.getSearchName(), page.getSearchKeyword());
|
||||
}
|
||||
if (Strings.isNotBlank(page.getPageOrderName()) && Strings.isNotBlank(page.getPageOrderBy())) {
|
||||
cnd.orderBy(page.getPageOrderName(), PageUtil.getOrder(page.getPageOrderBy()));
|
||||
} else {
|
||||
cnd.desc("sbr.username");
|
||||
cnd.desc("gh.unionname");
|
||||
cnd.desc("dw.name");
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPage(page.getPageNumber(), page.getPageSize(), sql);
|
||||
return Result.success().addData(pagination);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
|
||||
@RequiresPermissions("hd.child.sczp")
|
||||
public Object doSubmit(@Param("data") String data, @Param(value = "file", required = false) TempFile[] files, boolean flag) {
|
||||
try {
|
||||
Hd_ca_sbxx sbxx = Json.fromJson(Hd_ca_sbxx.class, data);
|
||||
sbxx.setSbr(ShiroUtil.getPrincipalProperty("id").toString());
|
||||
sbxx.setSbsj(new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
|
||||
Hd_ca_sbxx insert = hdCasbxxService.insert(sbxx);
|
||||
|
||||
for (TempFile file : files) {
|
||||
fileService.upload(file, insert.getId(), "/hd/hdca/");
|
||||
}
|
||||
return Result.success().addMsg("上传成功!");
|
||||
} catch (Exception e) {
|
||||
return Result.error().addMsg("上传失败!");
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
|
||||
@RequiresPermissions("hd.child.sczp")
|
||||
public Object doEdit(@Param("data") String data, String readytodelfile, @Param(value = "file", required = false) TempFile[] files) {
|
||||
try {
|
||||
Hd_ca_sbxx sbxx = Json.fromJson(Hd_ca_sbxx.class, data);
|
||||
hdCasbxxService.updateIgnoreNull(sbxx);
|
||||
|
||||
List<String> dellist = Json.fromJsonAsList(String.class, readytodelfile);
|
||||
for (String f : dellist) {
|
||||
fileService.delete(null, f);
|
||||
}
|
||||
for (TempFile file : files) {
|
||||
fileService.upload(file, sbxx.getId(), "/hd/hdca/");
|
||||
}
|
||||
return Result.success().addMsg("修改成功!");
|
||||
} catch (Exception e) {
|
||||
return Result.error().addMsg("上传失败!");
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("hd.child.sczp")
|
||||
public Object findOne(String id) {
|
||||
try {
|
||||
Hd_ca_sbxx sbxx = hdCasbxxService.fetch(id);
|
||||
Map<String, Object> map = Lang.obj2map(sbxx);
|
||||
List<Record> fjlist = baseService.dao().query("sys_file", Cnd.where("reid", "=", sbxx.getId()));
|
||||
List<Record> piclist = new ArrayList<Record>();
|
||||
List<Record> vadlist = new ArrayList<Record>();
|
||||
for (Record r : fjlist) {
|
||||
String fjurl = r.getString("filepath");
|
||||
String fid = r.getString("id");
|
||||
|
||||
r.set("status", "success");
|
||||
r.set("name", r.getString("fjname"));
|
||||
r.set("uid", r.getString("fjid"));
|
||||
|
||||
if (fjurl.endsWith(".jpg") || fjurl.endsWith(".jpeg")
|
||||
|| fjurl.endsWith(".bmp")
|
||||
|| fjurl.endsWith(".gif")
|
||||
|| fjurl.endsWith(".png")) {
|
||||
//r.set("url", Globals.AppFileDomain + fjurl);
|
||||
r.set("url", Globals.AppDomain + "/file_server/fileStreamPreview?id=" + fid);
|
||||
piclist.add(r);
|
||||
} else {
|
||||
r.set("url", Globals.AppFileDomain + fjurl);
|
||||
r.set("name", r.getString("filename"));
|
||||
vadlist.add(r);
|
||||
}
|
||||
|
||||
}
|
||||
map.put("piclist", piclist);
|
||||
map.put("vadlist", vadlist);
|
||||
map.put("hdlblist", hdWmLbService.query(Cnd.where("lhdid", "=", sbxx.getHdid())));
|
||||
map.put("hdzplblist", hdWmZplbService.query(Cnd.where("zlid", "=", sbxx.getHdlb())));
|
||||
return Result.success().addData(map);
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
package io.v.nutz.zhgh.hd.controller.ca;
|
||||
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import cn.wizzer.framework.base.service.BaseService;
|
||||
import cn.wizzer.framework.page.Pagination;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.ExcelUtil;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
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.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.OutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/hd/childhd/hjxx")
|
||||
@Ok("json:full")
|
||||
public class HdChildHjxxController {
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@At("")
|
||||
@Ok("re")
|
||||
@RequiresPermissions("hd.child.hjxx")
|
||||
public String index() {
|
||||
return "beetl:/platform/hd/ca/hjxxyl.html";
|
||||
}
|
||||
|
||||
@At
|
||||
@RequiresPermissions("hd.child.hjxx")
|
||||
@ViReturn
|
||||
public Object pageData(@Param(value = "union", required = false) String union,
|
||||
@Param(value = "unit", required = false) String unit,
|
||||
Integer pageNumber,
|
||||
Integer pageSize,
|
||||
@Param(value = "hdid", required = false) String hdid,
|
||||
@Param(value = "searchName", required = false) String searchName,
|
||||
@Param(value = "searchKeyword", required = false) String searchKeyword) {
|
||||
try {
|
||||
Sql sql = Sqls.create("""
|
||||
select DISTINCT(xx.sbr),
|
||||
sbr.loginname,
|
||||
sbr.username,
|
||||
dw.name as dwname,
|
||||
gh.unionname as ghname,
|
||||
(SELECT COUNT(DISTINCT(a.zplb)) FROM hd_ca_sbxx a WHERE a.sbr = xx.sbr AND a.hdid = @hdid) as hjcount
|
||||
FROM hd_ca_sbxx xx
|
||||
LEFT JOIN sys_user sbr on sbr.id = xx.sbr
|
||||
LEFT JOIN sys_unit dw on dw.id = sbr.unitid
|
||||
LEFT JOIN sys_union gh ON gh.id = dw.unionid
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!ShiroUtil.hasRole("SchoolUnionAdmin") && !ShiroUtil.hasRole("sysadmin")) {
|
||||
cnd.and("gh.id", "=", Vi.getUnionId());
|
||||
}
|
||||
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
|
||||
cnd.and(Cnd.likeEX(searchName, searchKeyword));
|
||||
}
|
||||
|
||||
cnd.and("xx.hdid", "=", hdid);
|
||||
cnd.andEX("dw.unionid", "=", union);
|
||||
cnd.andEX("dw.id", "=", unit);
|
||||
cnd.asc("sbr.username").asc("gh.unioncode").asc("dw.unitcode");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPage(pageNumber, pageSize, sql);
|
||||
return Result.success().addData(pagination);
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@RequiresPermissions("hd.child.hjxx")
|
||||
@ViReturn
|
||||
public void exportExcel(int num, String hdid, HttpServletResponse response) {
|
||||
HSSFWorkbook wb = null;
|
||||
String fileName = "";
|
||||
if (num == 1) {
|
||||
StringBuffer sbsql = new StringBuffer();
|
||||
sbsql.append("select DISTINCT(xx.sbr),sbr.loginname,sbr.username,dw.name as dwname,gh.unionname as ghname,xx.mobile,\n" +
|
||||
"(SELECT COUNT(DISTINCT(a.zplb)) FROM hd_ca_sbxx a WHERE a.sbr = xx.sbr) as hjcount\n" +
|
||||
"from hd_ca_sbxx xx\n" +
|
||||
"left join sys_user sbr on sbr.id = xx.sbr\n" +
|
||||
"left join sys_unit dw on dw.id = sbr.unitid\n" +
|
||||
"LEFT JOIN sys_union gh ON gh.id = dw.unionid\n" +
|
||||
"where xx.hdid = @hdid ");
|
||||
if (!ShiroUtil.hasRole("SchoolUnionAdmin") && !ShiroUtil.hasRole("sysadmin")) {
|
||||
sbsql.append("\tAND gh.id IN (\n" +
|
||||
"\tSELECT\n" +
|
||||
"\t\tgh.id \n" +
|
||||
"\tFROM\n" +
|
||||
"\t\tsys_user u\n" +
|
||||
"\t\tLEFT JOIN sys_unit n ON n.id = u.unitid\n" +
|
||||
"\tLEFT JOIN sys_union gh ON gh.id = n.unionid where u.id = @cuserid)");
|
||||
}
|
||||
Sql sql = Sqls.create(sbsql.toString());
|
||||
sql.setParam("hdid", hdid);
|
||||
sql.setParam("cuserid", ShiroUtil.getPrincipalProperty("id"));
|
||||
List<Record> list = baseService.list(sql);
|
||||
fileName = "获奖人员名单";
|
||||
String[] title = {"姓名", "工资号", "手机号", "单位", "分工会", "获奖次数"};
|
||||
String[][] content = new String[list.size()][title.length];
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
Record r = list.get(i);
|
||||
content[i][0] = r.getString("username");
|
||||
content[i][1] = r.getString("loginname");
|
||||
content[i][2] = r.getString("mobile");
|
||||
content[i][3] = r.getString("dwname");
|
||||
content[i][4] = r.getString("ghname");
|
||||
content[i][5] = String.valueOf(r.getInt("hjcount"));
|
||||
}
|
||||
wb = ExcelUtil.getHSSFWorkbook(fileName, title, content, null);
|
||||
} else {
|
||||
String ghtjstr = "SELECT\n" +
|
||||
"\tfgh.unionname,\n" +
|
||||
"\t(\n" +
|
||||
"\tSELECT\n" +
|
||||
"\t\tcount( DISTINCT ( xx.sbr ) ) \n" +
|
||||
"\tFROM\n" +
|
||||
"\t\thd_ca_sbxx xx\n" +
|
||||
"\t\tLEFT JOIN sys_user u ON u.id = xx.sbr\n" +
|
||||
"\t\tLEFT JOIN sys_unit n ON n.id = u.unitid\n" +
|
||||
"\t\tLEFT JOIN sys_union ghx ON ghx.id = n.unionid \n" +
|
||||
"\tWHERE\n" +
|
||||
"\t\tghx.id = fgh.id and xx.hdid = @hdid \n" +
|
||||
"\t) AS cjrsCount,\n" +
|
||||
"\t(\n" +
|
||||
"\tSELECT\n" +
|
||||
"\t\tSUM( c ) \n" +
|
||||
"\tFROM\n" +
|
||||
"\t\t(\n" +
|
||||
"\t\tSELECT\n" +
|
||||
"\t\t\tgh.`id`,\n" +
|
||||
"\t\t\t( SELECT COUNT( DISTINCT ( a.zplb ) ) FROM hd_ca_sbxx a WHERE a.sbr = xx.`sbr` ) c \n" +
|
||||
"\t\tFROM\n" +
|
||||
"\t\t\thd_ca_sbxx xx\n" +
|
||||
"\t\t\tLEFT JOIN sys_user u ON u.id = xx.sbr\n" +
|
||||
"\t\t\tLEFT JOIN sys_unit n ON n.id = u.unitid\n" +
|
||||
"\t\t\tLEFT JOIN sys_union gh ON gh.id = n.unionid and xx.hdid = @hdid \n" +
|
||||
"\t\tGROUP BY\n" +
|
||||
"\t\t\txx.sbr \n" +
|
||||
"\t\t) tab \n" +
|
||||
"\tWHERE\n" +
|
||||
"\t\ttab.id = fgh.`id` \n" +
|
||||
"\t) jpCount \n" +
|
||||
"FROM\n" +
|
||||
"\tsys_union fgh";
|
||||
Sql ghtjsql = Sqls.create(ghtjstr.toString());
|
||||
ghtjsql.setParam("hdid", hdid);
|
||||
List<Record> ghtjList = baseService.list(ghtjsql);
|
||||
fileName = "分工会奖品统计";
|
||||
String[] title = {"分工会", "参加人数", "应发奖品数"};
|
||||
String[][] content = new String[ghtjList.size()][title.length];
|
||||
for (int i = 0; i < ghtjList.size(); i++) {
|
||||
Record r = ghtjList.get(i);
|
||||
content[i][0] = r.getString("unionname");
|
||||
content[i][1] = r.getString("cjrsCount");
|
||||
content[i][2] = r.getString("jpCount") == null ? "0" : r.getString("jpCount");
|
||||
}
|
||||
wb = ExcelUtil.getHSSFWorkbook(fileName, title, content, null);
|
||||
}
|
||||
try {
|
||||
this.setResponseHeader(response, fileName + ".xls");
|
||||
OutputStream os = response.getOutputStream();
|
||||
wb.write(os);
|
||||
os.flush();
|
||||
os.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void setResponseHeader(HttpServletResponse response, String fileName) {
|
||||
try {
|
||||
try {
|
||||
fileName = new String(fileName.getBytes(), "ISO8859-1");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
response.setContentType("application/octet-stream;charset=ISO8859-1");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
|
||||
response.addHeader("Pargam", "no-cache");
|
||||
response.addHeader("Cache-Control", "no-cache");
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,290 @@
|
||||
package io.v.nutz.zhgh.hd.controller.ca;
|
||||
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.page.Pagination;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.base.utils.ExcelUtil;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.zhgh.hd.services.HdCasbxxFjService;
|
||||
import io.v.nutz.zhgh.hd.services.HdWmsbxxService;
|
||||
import io.v.nutz.sys.models.Sys_file;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
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.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.OutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/hd/childhd/zpxx")
|
||||
@Ok("json:full")
|
||||
public class HdChildZpxxController {
|
||||
|
||||
@Inject
|
||||
private HdWmsbxxService hdWmsbxxService;
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Inject
|
||||
private HdCasbxxFjService hdCasbxxFjService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/hd/ca/zpxx.html")
|
||||
@RequiresPermissions("hd.child.zpxx")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
@At
|
||||
@RequiresPermissions("hd.child.zpxx")
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Object dodelete(String id) {
|
||||
try {
|
||||
baseService.clear("hd_ca_sbxx", Cnd.where("id", "=", id));
|
||||
dao.clear(Sys_file.class, Cnd.where("reid", "=", id));
|
||||
return Result.success().addMsg("删除成功!");
|
||||
} catch (Exception e) {
|
||||
return Result.error().addMsg("删除失败!");
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@RequiresPermissions("hd.child.zpxx")
|
||||
@ViReturn
|
||||
public Object initHdxxlist() {
|
||||
try {
|
||||
String isSysadmin = " and hdcjr is not null";
|
||||
if (!ShiroUtil.hasRole("sysadmin")) {
|
||||
isSysadmin = "and hdcjr = '" + ShiroUtil.getUserId() + "'";
|
||||
}
|
||||
List<Record> list = baseService.list(Sqls.create("select *,year(hdcjsj) year from hd_wm_xx where hdtype=2 %s order by hdcjsj".formatted(isSysadmin)));
|
||||
List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
|
||||
|
||||
Map<Integer, List<Record>> listMap = list.stream().collect(Collectors.groupingBy(v -> v.getInt("year")));
|
||||
|
||||
listMap.forEach((k, v) -> {
|
||||
List<Map<String, Object>> children = new ArrayList<>();
|
||||
v.forEach(x -> {
|
||||
children.add(Map.of("value", x.getString("hdid"), "label", x.getString("hdname")));
|
||||
});
|
||||
|
||||
Map<String, Object> parent = Map.of("value", k, "label", k, "children", children);
|
||||
result.add(parent);
|
||||
});
|
||||
|
||||
return Result.success().addData(result);
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@RequiresPermissions("hd.child.zpxx")
|
||||
@ViReturn
|
||||
public Object gethdlblist(String id) {
|
||||
try {
|
||||
List list = baseService.list(Sqls.create("select * from hd_wm_lb where lhdid = @id").setParam("id", id));
|
||||
return Result.success().addData(list);
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@RequiresPermissions("hd.child.zpxx")
|
||||
@ViReturn
|
||||
public Object gethdzplblist(String id) {
|
||||
try {
|
||||
List list = baseService.list(Sqls.create("select * from hd_wm_zplb where zlid = @id").setParam("id", id));
|
||||
return Result.success().addData(list);
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@RequiresPermissions("hd.child.zpxx")
|
||||
@ViReturn
|
||||
public Object pageData(@Param(value = "union", required = false) String union,
|
||||
@Param(value = "unit", required = false) String unit,
|
||||
Integer pageNumber,
|
||||
Integer pageSize,
|
||||
@Param(value = "searchName", required = false) String searchName,
|
||||
@Param(value = "searchKeyword", required = false) String searchKeyword,
|
||||
@Param(value = "hdid", required = false) String hdid,
|
||||
@Param(value = "hdlb", required = false) String hdlb,
|
||||
@Param(value = "zplb", required = false) String zplb,
|
||||
@Param(value = "year", required = false) String year) {
|
||||
try {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
xx.*,
|
||||
sbr.username AS sbrname,
|
||||
sbr.loginname,
|
||||
hd.hdname,
|
||||
hd.hdkssj,
|
||||
hd.hdjssj,
|
||||
zplb.zname as zplbname,
|
||||
lb.lname as hdlbname,
|
||||
dw.name as dwname,
|
||||
gh.unionname as ghname
|
||||
FROM
|
||||
hd_ca_sbxx xx
|
||||
LEFT JOIN sys_user sbr ON sbr.id = xx.sbr
|
||||
left join sys_unit dw on dw.id = sbr.unitid
|
||||
LEFT JOIN sys_union gh ON gh.id = dw.unionid
|
||||
left join hd_wm_xx hd on hd.hdid = xx.hdid
|
||||
left join hd_wm_zplb zplb on zplb.zid = xx.zplb
|
||||
left join hd_wm_lb lb on lb.lid = xx.hdlb
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("xx.hdid", "in", Sqls.create("select hdid from hd_wm_xx where hdtype =2"));
|
||||
cnd.andEX("dw.unionid", "=", union);
|
||||
cnd.andEX("dw.id", "=", unit);
|
||||
cnd.andEX("xx.hdid", "=", hdid);
|
||||
cnd.andEX("xx.hdlb", "=", hdlb);
|
||||
cnd.andEX("xx.zplb", "=", zplb);
|
||||
cnd.andEX("YEAR(xx.sbsj)", "=", year);
|
||||
|
||||
if (!ShiroUtil.hasRole("SchoolUnionAdmin") && !ShiroUtil.hasRole("sysadmin")) {
|
||||
cnd.and("gh.id", "=", Vi.getUnionId());
|
||||
}
|
||||
|
||||
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
|
||||
cnd.and(Cnd.likeEX(searchName, searchKeyword));
|
||||
}
|
||||
cnd.asc("sbr.username").asc("gh.unioncode").asc("dw.unitcode");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPage(pageNumber, pageSize, sql);
|
||||
return Result.success().addData(pagination);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@RequiresPermissions("hd.child.zpxx")
|
||||
@ViReturn
|
||||
public Object findOneById(String id) {
|
||||
List<Record> fjList = baseService.dao().query("sys_file", Cnd.where("reid", "=", id));
|
||||
return Result.success().addData(fjList);
|
||||
}
|
||||
|
||||
@At("/exportExcel")
|
||||
@Ok("void")
|
||||
@RequiresPermissions("hd.child.zpxx")
|
||||
@ViReturn
|
||||
public void exportExcel(HttpServletResponse response, String hdid, String hdname) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append("SELECT\n" +
|
||||
"\txx.*,\n" +
|
||||
"\tsbr.username AS sbrname,\n" +
|
||||
"\tsbr.loginname,\n" +
|
||||
"\tsbr.mobile as sbrmobile,\n" +
|
||||
"\thd.hdname,\n" +
|
||||
"\tzplb.zname as zplbname,\n" +
|
||||
"\tlb.lname as hdlbname,\n" +
|
||||
"\tdw.name as dwname,\n" +
|
||||
"\tgh.unionname as ghname\n" +
|
||||
"FROM\n" +
|
||||
"\thd_ca_sbxx xx\n" +
|
||||
"\tLEFT JOIN sys_user sbr ON sbr.id = xx.sbr\n" +
|
||||
"\tleft join sys_unit dw on dw.id = sbr.unitid\n" +
|
||||
"\tLEFT JOIN sys_union gh ON gh.id = dw.unionid\n" +
|
||||
"\tleft join hd_wm_xx hd on hd.hdid = xx.hdid\n" +
|
||||
"\tleft join hd_wm_zplb zplb on zplb.zid = xx.zplb\n" +
|
||||
"\tleft join hd_wm_lb lb on lb.lid = xx.hdlb where 1=1");
|
||||
sb.append("\tand xx.hdid = @hdid");
|
||||
if (!ShiroUtil.hasRole("SchoolUnionAdmin") && !ShiroUtil.hasRole("sysadmin")) {
|
||||
sb.append("\tAND gh.id IN (\n" +
|
||||
"\tSELECT\n" +
|
||||
"\t\tgh.id \n" +
|
||||
"\tFROM\n" +
|
||||
"\t\tsys_user u\n" +
|
||||
"\t\tLEFT JOIN sys_unit n ON n.id = u.unitid\n" +
|
||||
"\tLEFT JOIN sys_union gh ON gh.id = n.unionid where u.id = @cuserid)");
|
||||
}
|
||||
sb.append("\tORDER BY sbr.username,gh.unionname,dw.name");
|
||||
Sql sql = Sqls.create(sb.toString());
|
||||
sql.setParam("hdid", hdid);
|
||||
sql.setParam("cuserid", ShiroUtil.getPrincipalProperty("id"));
|
||||
List<Record> zpList = baseService.list(sql);
|
||||
HSSFWorkbook wb = null;
|
||||
String fileName = hdname;
|
||||
//excel标题
|
||||
String[] title = {"作品主题", "子女姓名", "教职工姓名", "工资号", "手机号", "活动主题", "活动类别", "作品类别", "年龄", "关系", "单位", "分工会"};
|
||||
//content
|
||||
String[][] content = new String[zpList.size()][title.length];
|
||||
for (int i = 0; i < zpList.size(); i++) {
|
||||
Record r = zpList.get(i);
|
||||
content[i][0] = r.getString("zpzt");
|
||||
content[i][1] = r.getString("znxm");
|
||||
content[i][2] = r.getString("sbrname");
|
||||
content[i][3] = r.getString("loginname");
|
||||
content[i][4] = r.getString("mobile");
|
||||
content[i][5] = r.getString("hdname");
|
||||
content[i][6] = r.getString("hdlbname");
|
||||
content[i][7] = r.getString("zplbname");
|
||||
content[i][8] = r.getString("znnl");
|
||||
content[i][9] = r.getString("zngx");
|
||||
content[i][10] = r.getString("dwname");
|
||||
content[i][11] = r.getString("ghname");
|
||||
}
|
||||
wb = ExcelUtil.getHSSFWorkbook(fileName, title, content, null);
|
||||
try {
|
||||
this.setResponseHeader(response, fileName + ".xls");
|
||||
OutputStream os = response.getOutputStream();
|
||||
wb.write(os);
|
||||
os.flush();
|
||||
os.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
//发送响应流方法
|
||||
public void setResponseHeader(HttpServletResponse response, String fileName) {
|
||||
try {
|
||||
try {
|
||||
fileName = new String(fileName.getBytes(), "ISO8859-1");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
response.setContentType("application/octet-stream;charset=ISO8859-1");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
|
||||
response.addHeader("Pargam", "no-cache");
|
||||
response.addHeader("Cache-Control", "no-cache");
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package io.v.nutz.zhgh.hd.controller.ca;
|
||||
|
||||
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
/**
|
||||
* Created by lyw on 2020/3/12 14:22
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/hd/cahdMange")
|
||||
public class HdCnMangeController {
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/hd/ca/hdMange.html")
|
||||
@RequiresPermissions("hd.ca.hdmange")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("beetl:/platform/hd/ca/mobileBox.html")
|
||||
@RequiresPermissions("hd.ca.hdmange")
|
||||
public void mobileBox() {
|
||||
|
||||
}
|
||||
private final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package io.v.nutz.zhgh.hd.controller.ca.mobile;
|
||||
|
||||
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_ca_sbxx;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_ca_sbxx_fj;
|
||||
import io.v.nutz.zhgh.hd.services.HdCasbxxFjService;
|
||||
import io.v.nutz.base.service.ViService;
|
||||
import io.v.nutz.sys.models.Sys_file;
|
||||
import io.v.nutz.sys.services.SysUserService;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.nutz.boot.starter.ftp.FtpService;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.entity.Record;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.random.R;
|
||||
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 javax.servlet.http.HttpSession;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: V
|
||||
* @Date: 2020/5/14 21:02
|
||||
* @Description:
|
||||
*/
|
||||
@IocBean
|
||||
@At("/childrenActivities")
|
||||
public class ChildrenActivitiesCon {
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/hd/ca/mobile/childrenActivities.html")
|
||||
public void index(HttpSession session) {
|
||||
|
||||
}
|
||||
|
||||
@Inject
|
||||
|
||||
private SysUserService sysUserService;
|
||||
|
||||
@Inject
|
||||
|
||||
private io.v.nutz.zhgh.hd.services.HdCasbxxService HdCasbxxService;
|
||||
|
||||
@Inject
|
||||
private HdCasbxxFjService hdCasbxxFjService;
|
||||
|
||||
/**
|
||||
* 根据用户名查询用户
|
||||
*
|
||||
* @param loginname
|
||||
* @return
|
||||
*/
|
||||
@At
|
||||
@Ok("json")
|
||||
public Object queryUserByLoginname(String loginname) {
|
||||
try {
|
||||
Sql sql = Sqls.create("SELECT u.`id`,u.`loginname`,u.`username`,un.`unionname` FROM sys_user u\n" +
|
||||
"LEFT JOIN sys_unit unit ON u.`unitid` = unit.`id`\n" +
|
||||
"LEFT JOIN sys_union un ON unit.unionid=un.id WHERE u.`loginname` = @loginname ").setParam("loginname", loginname);
|
||||
List<Record> list = sysUserService.list(sql);
|
||||
if (list.size() > 0) {
|
||||
return Result.success().addData(list.get(0));
|
||||
}
|
||||
return Result.success().addData(null);
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@Inject
|
||||
private FtpService ftpService;
|
||||
|
||||
private String saveFile(TempFile file) throws IOException {
|
||||
String rid = R.UU32();
|
||||
String suffixName = FilenameUtils.getExtension(file.getSubmittedFileName());
|
||||
ftpService.upload("/", rid + "." + suffixName, file.getInputStream());
|
||||
|
||||
return "/" + rid + "." + suffixName;
|
||||
}
|
||||
|
||||
@Inject("Sys_file")
|
||||
private ViService<Sys_file> fileViService;
|
||||
|
||||
/**
|
||||
* 提交
|
||||
*
|
||||
* @param sbxx
|
||||
* @param files
|
||||
* @return
|
||||
*/
|
||||
@At
|
||||
@Ok("json")
|
||||
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
|
||||
public Object doSubmit(@Param("..") Hd_ca_sbxx sbxx, @Param("files") TempFile[] files) {
|
||||
try {
|
||||
Hd_ca_sbxx insert = HdCasbxxService.insert(sbxx);
|
||||
|
||||
for (TempFile file : files) {
|
||||
|
||||
Sys_file sysFile = new Sys_file();
|
||||
sysFile.setReid(insert.getId());
|
||||
sysFile.setFilename(file.getSubmittedFileName());
|
||||
sysFile.setFilepath(saveFile(file));
|
||||
fileViService.insert(sysFile);
|
||||
|
||||
Hd_ca_sbxx_fj fj = new Hd_ca_sbxx_fj();
|
||||
fj.setHdsbid(insert.getId());
|
||||
fj.setFjname(file.getSubmittedFileName());
|
||||
fj.setFjurl(sysFile.getFilepath());
|
||||
hdCasbxxFjService.insert(fj);
|
||||
}
|
||||
|
||||
return Result.success().addMsg("上传成功!");
|
||||
} catch (Exception e) {
|
||||
return Result.error().addMsg("上传失败!");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,386 @@
|
||||
package io.v.nutz.zhgh.hd.controller.checkin;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.page.Pagination;
|
||||
import io.v.nutz.zhgh.hd.models.HdCheckIn;
|
||||
import io.v.nutz.zhgh.hd.models.HdCheckinContent;
|
||||
import io.v.nutz.zhgh.hd.models.HdCheckinFile;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_wm_bgi;
|
||||
import io.v.nutz.zhgh.hd.services.CheckinContentService;
|
||||
import io.v.nutz.zhgh.hd.services.CheckinFileService;
|
||||
import io.v.nutz.zhgh.hd.services.CheckinService;
|
||||
import io.v.nutz.zhgh.hd.services.HdWmBgiService;
|
||||
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;
|
||||
import org.nutz.boot.starter.ftp.FtpService;
|
||||
import org.nutz.dao.Chain;
|
||||
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.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.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 javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author JyuHsin
|
||||
* @Date 2022/4/22
|
||||
* @Description
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/hd/checkinManage")
|
||||
@RequiresAuthentication
|
||||
public class CheckinController {
|
||||
|
||||
@Inject
|
||||
private FtpService ftpService;
|
||||
|
||||
@Inject
|
||||
private CheckinService checkinService;
|
||||
|
||||
@Inject
|
||||
private HdWmBgiService hdWmBgiService;
|
||||
|
||||
@Inject
|
||||
private CheckinContentService checkinContentService;
|
||||
|
||||
@Inject
|
||||
private CheckinFileService checkinFileService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/hd/checkin/checkinManage.html")
|
||||
@RequiresPermissions("hd.checkin.manage")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
@At("/mobileBox")
|
||||
@Ok("beetl:/mobile/hd/checkin/mobileBox.html")
|
||||
public void mobileBox() {
|
||||
|
||||
}
|
||||
|
||||
@At("/uploadInfo")
|
||||
@Ok("beetl:/platform/hd/checkin/uploadInfo.html")
|
||||
public void uploadInfo() {
|
||||
|
||||
}
|
||||
|
||||
@At("/summary")
|
||||
@Ok("beetl:/platform/hd/checkin/summary.html")
|
||||
public void summary() {
|
||||
|
||||
}
|
||||
|
||||
private final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
private String saveFile(TempFile file) throws IOException {
|
||||
String rid = R.UU32();
|
||||
String suffixName = FilenameUtils.getExtension(file.getSubmittedFileName());
|
||||
ftpService.upload("/common/", rid + "." + suffixName, file.getInputStream());
|
||||
|
||||
return "/common/" + rid + "." + suffixName;
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("json")
|
||||
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
|
||||
public Object doAdd(@Param("data") HdCheckIn hdWmXx, @Param("files") TempFile[] files) {
|
||||
try {
|
||||
hdWmXx.setHdcjr(ShiroUtil.getPrincipalProperty("id").toString());
|
||||
hdWmXx.setHdcjsj(sdf.format(new Date()));
|
||||
hdWmXx.setHdflag(false);
|
||||
HdCheckIn insert = checkinService.insert(hdWmXx);
|
||||
|
||||
for (TempFile file : files) {
|
||||
Hd_wm_bgi bgi = new Hd_wm_bgi();
|
||||
bgi.setIhdid(insert.getHdid());
|
||||
bgi.setIurl(saveFile(file));
|
||||
hdWmBgiService.insert(bgi);
|
||||
}
|
||||
return Result.success();
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("json")
|
||||
public Object data(String hdname, Integer hdtype, int pageNumber, int pageSize, Integer year) {
|
||||
try {
|
||||
Sql sql = Sqls.create("SELECT hd.*,u.`username` cjr FROM hd_checkin hd LEFT JOIN sys_user u ON hd.hdcjr = u.`id` $condition");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (Strings.isNotBlank(hdname)) {
|
||||
cnd.where().andLike("hdname", hdname);
|
||||
}
|
||||
if (year != null) {
|
||||
cnd.and("YEAR(hdcjsj)", "=", year);
|
||||
}
|
||||
cnd.desc("hdcjsj");
|
||||
sql.setCondition(cnd);
|
||||
return Result.success().addData(checkinService.listPage(pageNumber, pageSize, sql));
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("json")
|
||||
public Object delete(String hdid) {
|
||||
try {
|
||||
//查询附件并删除
|
||||
List<HdCheckinFile> files = checkinFileService.query(Cnd.NEW().and("hdid", "=", hdid));
|
||||
files.forEach(item -> {
|
||||
ftpService.delete(item.getUrl());
|
||||
});
|
||||
|
||||
//删除附件表数据
|
||||
checkinFileService.clear(Cnd.NEW().and("hdid", "=", hdid));
|
||||
//删除点赞表数据
|
||||
checkinService.clear("hd_checkin_zan", Cnd.NEW().and("hdid", "=", hdid));
|
||||
//删除内容表数据
|
||||
checkinContentService.clear(Cnd.NEW().and("hdid", "=", hdid));
|
||||
//删除活动数据
|
||||
checkinService.clear(Cnd.NEW().and("hdid", "=", hdid));
|
||||
|
||||
return Result.success();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("json")
|
||||
public Object changeStatus(String hdid, Boolean flag) {
|
||||
try {
|
||||
HdCheckIn hdWmXx = checkinService.fetch(hdid);
|
||||
hdWmXx.setHdflag(flag);
|
||||
checkinService.update(hdWmXx);
|
||||
return Result.success();
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("json")
|
||||
public Object findOne(String hdid) {
|
||||
try {
|
||||
HdCheckIn hdWmXx = checkinService.fetch(hdid);
|
||||
List<Hd_wm_bgi> bgis = hdWmBgiService.query(Cnd.where("ihdid", "=", hdid));
|
||||
hdWmXx.setBgis(bgis);
|
||||
|
||||
List<HdCheckinContent> query = checkinContentService.query(Cnd.NEW().and("hdid", "=", hdid).and("userid", "=", ShiroUtil.getPrincipalProperty("id")));
|
||||
Map<String, Object> map = Json.fromJsonAsMap(Object.class, Json.toJson(hdWmXx));
|
||||
map.put("content", query);
|
||||
return Result.success().addData(map);
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("json")
|
||||
public Object getContent(String hdid, String day, Integer pageSize, Integer pageNumber, String active, Boolean order) {
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
select
|
||||
con.*,
|
||||
u.username,
|
||||
u.unitname,
|
||||
u.sex,
|
||||
(select count(*) from hd_checkin_zan where con.id = contentId) as zan_count,
|
||||
(select id from hd_checkin_zan where con.id = contentId and userid = @userid) as zan_id
|
||||
from
|
||||
hd_checkin_content con
|
||||
left join `user` u on con.userid = u.id
|
||||
$condition
|
||||
""").setParam("userid", ShiroUtil.getPrincipalProperty("id"));
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
//cnd.and("con.hdid", "=", hdid);
|
||||
|
||||
/*if (StrUtil.isBlank(day)) {
|
||||
day = sdf.format(new Date());
|
||||
}*/
|
||||
if (StrUtil.isNotBlank(active) && "0".equals(active)) {
|
||||
cnd.and("con.isOpen", "=", true);
|
||||
}
|
||||
if (StrUtil.isNotBlank(active) && "1".equals(active)) {
|
||||
cnd.and("con.userid", "=", ShiroUtil.getPrincipalProperty("id"));
|
||||
}
|
||||
//cnd.and("time", ">=", day + " 00:00:00");
|
||||
//cnd.and("time", "<", day + " 23:59:59");
|
||||
|
||||
if (order != null && order) {
|
||||
cnd.desc("zan_count");
|
||||
} else {
|
||||
cnd.desc("con.time");
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
|
||||
Pagination pagination = checkinContentService.listPage(pageNumber, pageSize, sql);
|
||||
List<Object> list = pagination.getList();
|
||||
list.forEach(item -> {
|
||||
Map<String, Object> map = (Map<String, Object>) item;
|
||||
map.put("me_zan", map.get("zan_id") != null);
|
||||
|
||||
//查询附件
|
||||
List<HdCheckinFile> files = checkinFileService.query(Cnd.NEW().and("hdid", "=", hdid).and("contentId", "=", map.get("id")));
|
||||
map.put("files", files);
|
||||
});
|
||||
pagination.setList(list);
|
||||
return Result.success().addData(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("json")
|
||||
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
|
||||
public Object doEdit(@Param("..") HdCheckIn hdWmXx, @Param("files") TempFile[] files, String delFilesJson) {
|
||||
try {
|
||||
checkinService.update(hdWmXx);
|
||||
List<String> lbids = new ArrayList<>();
|
||||
List<String> zpLbids = new ArrayList<>();
|
||||
|
||||
//删除
|
||||
for (TempFile file : files) {
|
||||
Hd_wm_bgi bgi = new Hd_wm_bgi();
|
||||
bgi.setIhdid(hdWmXx.getHdid());
|
||||
bgi.setIurl(saveFile(file));
|
||||
hdWmBgiService.insert(bgi);
|
||||
}
|
||||
|
||||
String path = new File("").getCanonicalPath();
|
||||
List<NutMap> nutMaps = Json.fromJsonAsList(NutMap.class, delFilesJson);
|
||||
for (NutMap nutMap : nutMaps) {
|
||||
hdWmBgiService.delete(nutMap.getString("uid"));
|
||||
}
|
||||
|
||||
return Result.success();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("json")
|
||||
public Object clickZan(String id, String hdid, String contentId, Boolean zan) {
|
||||
|
||||
String r = R.UU32();
|
||||
if (!zan) {
|
||||
checkinContentService.clear("hd_checkin_zan", Cnd.NEW().and("id", "=", id));
|
||||
} else {
|
||||
checkinContentService.insert("hd_checkin_zan", Chain.make("id", r).add("hdid", hdid)
|
||||
.add("contentId", contentId).add("userid", ShiroUtil.getPrincipalProperty("id")));
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将图片转为流发送到页面
|
||||
*/
|
||||
@At
|
||||
@Ok("void")
|
||||
public void getPic(String url, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
response.setContentType("image/jpeg");
|
||||
//获取路径
|
||||
File directory = new File("");// 参数为空
|
||||
String courseFile = directory.getCanonicalPath();
|
||||
// 获取图片
|
||||
File file = new File(courseFile + "\\" + url);
|
||||
//创建文件输入流
|
||||
FileInputStream is = new FileInputStream(file);
|
||||
// 响应输出流
|
||||
ServletOutputStream out = response.getOutputStream();
|
||||
// 创建缓冲区
|
||||
byte[] buffer = new byte[1024];
|
||||
int len = 0;
|
||||
while ((len = is.read(buffer)) != -1) {
|
||||
out.write(buffer, 0, len);
|
||||
}
|
||||
is.close();
|
||||
out.flush();
|
||||
out.close();
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("json")
|
||||
@ViReturn
|
||||
public Object getUploadInfo(String hdid, Integer pageNumber, Integer pageSize, String year, String unitId, String unionId, String username) {
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
hc.hdname,
|
||||
con.*,
|
||||
u.username,
|
||||
u.unitname,
|
||||
u.unionname
|
||||
FROM
|
||||
hd_checkin_content con
|
||||
left join hd_checkin hc on hc.hdid=con.hdid
|
||||
left join `user` u on u.id = con.userid
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(hdid)) {
|
||||
cnd.and("con.hdid", "=", hdid);
|
||||
}
|
||||
if (StrUtil.isNotBlank(year)) {
|
||||
cnd.and("left(con.time, 10)", "=", year);
|
||||
}
|
||||
if (StrUtil.isNotBlank(unitId)) {
|
||||
cnd.and("u.unitcode", "=", unitId);
|
||||
}
|
||||
if (StrUtil.isNotBlank(unionId)) {
|
||||
cnd.and("u.unionid", "=", unionId);
|
||||
}
|
||||
if (StrUtil.isNotBlank(username)) {
|
||||
cnd.and("username", "like", "%" + username + "%");
|
||||
}
|
||||
cnd.desc("con.time");
|
||||
sql.setCondition(cnd);
|
||||
|
||||
Pagination pagination = checkinService.listPage(pageNumber, pageSize, sql);
|
||||
List<Record> list = pagination.getList();
|
||||
list.forEach(item -> {
|
||||
List<HdCheckinFile> query = checkinFileService.query(Cnd.NEW().and("contentId", "=", item.getString("id")));
|
||||
item.put("files", query);
|
||||
});
|
||||
return pagination;
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("json")
|
||||
@ViReturn
|
||||
public Object getAllActivity() {
|
||||
|
||||
return checkinService.query();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
package io.v.nutz.zhgh.hd.controller.checkin;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.zhgh.hd.services.CheckinService;
|
||||
import io.v.nutz.base.utils.ViTool;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/hd/checkinManage/summary")
|
||||
@RequiresAuthentication
|
||||
public class CheckinSummaryController {
|
||||
|
||||
@Inject
|
||||
private CheckinService checkinService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/hd/checkin/uploadInfo.html")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("json")
|
||||
@ViReturn
|
||||
public Object data(String hdid, String start, String username, String end, String unitId, String unionId, int pageNumber, int pageSize) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.username,
|
||||
u.loginname,
|
||||
u.sex,
|
||||
u.unitname,
|
||||
u.unionname,
|
||||
count(DISTINCT time) as count
|
||||
FROM
|
||||
hd_checkin_content c
|
||||
LEFT JOIN `user` u on c.userid = u.id
|
||||
$condition
|
||||
""");
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
|
||||
if (StrUtil.isNotBlank(hdid)) {
|
||||
cnd.and("hdid", "=", hdid);
|
||||
}
|
||||
if (StrUtil.isNotBlank(start)) {
|
||||
cnd.and("time", ">=", start + " 00:00:00");
|
||||
}
|
||||
if (StrUtil.isNotBlank(end)) {
|
||||
cnd.and("time", "<", end + " 23:59:59");
|
||||
}
|
||||
if (StrUtil.isNotBlank(unitId)) {
|
||||
cnd.and("u.unitid", "=", unitId);
|
||||
}
|
||||
if (StrUtil.isNotBlank(unionId)) {
|
||||
cnd.and("u.unionid", "=", unionId);
|
||||
}
|
||||
if (StrUtil.isNotBlank(username)) {
|
||||
cnd.and("u.username", "like", "%" + username + "%");
|
||||
}
|
||||
|
||||
cnd.groupBy("c.userid");
|
||||
cnd.desc("count");
|
||||
|
||||
sql.setCondition(cnd);
|
||||
|
||||
return checkinService.listPage(pageNumber, pageSize, sql);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
public void doExport(String hdid, String username, String start, String end, String unitId, String unionId, HttpServletResponse response) {
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.username,
|
||||
u.loginname,
|
||||
u.sex,
|
||||
u.unitname,
|
||||
u.unionname,
|
||||
count(DISTINCT time) as count
|
||||
FROM
|
||||
hd_checkin_content c
|
||||
LEFT JOIN `user` u on c.userid = u.id
|
||||
$condition
|
||||
""");
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
|
||||
if (StrUtil.isNotBlank(hdid)) {
|
||||
cnd.and("hdid", "=", hdid);
|
||||
}
|
||||
if (StrUtil.isNotBlank(start)) {
|
||||
cnd.and("time", ">=", start + " 00:00:00");
|
||||
}
|
||||
if (StrUtil.isNotBlank(end)) {
|
||||
cnd.and("time", "<", end + " 23:59:59");
|
||||
}
|
||||
if (StrUtil.isNotBlank(unitId)) {
|
||||
cnd.and("u.unitid", "=", unitId);
|
||||
}
|
||||
if (StrUtil.isNotBlank(unionId)) {
|
||||
cnd.and("u.unionid", "=", unionId);
|
||||
}
|
||||
if (StrUtil.isNotBlank(username)) {
|
||||
cnd.and("u.username", "like", "%" + username + "%");
|
||||
}
|
||||
|
||||
cnd.groupBy("c.userid");
|
||||
cnd.desc("count");
|
||||
|
||||
sql.setCondition(cnd);
|
||||
|
||||
List<NutMap> listMap = checkinService.listMap(sql);
|
||||
|
||||
List<ExcelExportEntity> entityList = new ArrayList<>();
|
||||
entityList.add(new ExcelExportEntity("姓名","username",20));
|
||||
entityList.add(new ExcelExportEntity("工号","loginname",20));
|
||||
entityList.add(new ExcelExportEntity("打卡次数","count",20));
|
||||
entityList.add(new ExcelExportEntity("所属单位","unitname",60));
|
||||
entityList.add(new ExcelExportEntity("公会","unionname",60));
|
||||
|
||||
try {
|
||||
ViTool.excelResponse(response, "打卡名单.xls");
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), entityList, listMap);
|
||||
workbook.write(response.getOutputStream());
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
package io.v.nutz.zhgh.hd.controller.wmhd;
|
||||
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import cn.wizzer.framework.base.service.BaseService;
|
||||
import cn.wizzer.framework.page.Pagination;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.FileService;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_wm_sbxx;
|
||||
import io.v.nutz.zhgh.hd.services.HdWmLbService;
|
||||
import io.v.nutz.zhgh.hd.services.HdWmZplbService;
|
||||
import io.v.nutz.zhgh.hd.services.HdWmsbxxService;
|
||||
import io.v.nutz.zhgh.hd.services.HdWmsbxxfjService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
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.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
import org.nutz.lang.Lang;
|
||||
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 java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/hd/jzghd/sczp")
|
||||
@Ok("json:full")
|
||||
public class HdJzgAddZpController {
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@Inject
|
||||
private HdWmsbxxService hdWmsbxxService;
|
||||
|
||||
@Inject
|
||||
private HdWmsbxxfjService hdWmsbxxfjService;
|
||||
|
||||
@Inject
|
||||
private HdWmLbService hdWmLbService;
|
||||
|
||||
@Inject
|
||||
private HdWmZplbService hdWmZplbService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/hd/wmhd/zpMange.html")
|
||||
@RequiresPermissions("hd.wmhd.sczp")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
@Inject
|
||||
private FileService fileService;
|
||||
|
||||
@At
|
||||
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
|
||||
public Object doSubmit(@Param("data") String data, @Param(value = "file", required = false) TempFile[] files, boolean flag) {
|
||||
try {
|
||||
Hd_wm_sbxx sbxx = Json.fromJson(Hd_wm_sbxx.class, data);
|
||||
sbxx.setHdsbrid(ShiroUtil.getPrincipalProperty("id").toString());
|
||||
sbxx.setHdsbsj(new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
|
||||
sbxx.setAuditState(flag ? "4000" : "3999");
|
||||
Hd_wm_sbxx insert = hdWmsbxxService.insert(sbxx);
|
||||
|
||||
for (TempFile file : files) {
|
||||
fileService.upload(file, insert.getId(), "/hd/hdwm/");
|
||||
}
|
||||
return Result.success().addMsg("上传成功!");
|
||||
} catch (Exception e) {
|
||||
return Result.error().addMsg("上传失败!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
|
||||
public Object doEdit(@Param("data") String data, String readytodelfile, @Param(value = "file", required = false) TempFile[] files, boolean flag) {
|
||||
try {
|
||||
Hd_wm_sbxx sbxx = Json.fromJson(Hd_wm_sbxx.class, data);
|
||||
sbxx.setAuditState(flag ? "4000" : "3999");
|
||||
hdWmsbxxService.updateIgnoreNull(sbxx);
|
||||
|
||||
List<String> dellist = Json.fromJsonAsList(String.class, readytodelfile);
|
||||
for (String f : dellist) {
|
||||
fileService.delete(f, f);
|
||||
}
|
||||
for (TempFile file : files) {
|
||||
fileService.upload(file, sbxx.getId(), "/hd/hdwm/");
|
||||
}
|
||||
return Result.success().addMsg("修改成功!");
|
||||
} catch (Exception e) {
|
||||
return Result.error().addMsg("上传失败!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object pageData(Integer pageNumber,
|
||||
Integer pageSize,
|
||||
@Param(value = "hdid", required = false) String hdid,
|
||||
@Param(value = "hdlb", required = false) String hdlb,
|
||||
@Param(value = "zplb", required = false) String zplb) {
|
||||
try {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
xx.*,
|
||||
sbr.username AS sbrname,
|
||||
sbr.loginname,
|
||||
hd.hdname,
|
||||
hd.hdkssj,
|
||||
hd.hdjssj,
|
||||
dw.name as dwname,
|
||||
gh.unionname as ghname,
|
||||
hdlb.lname as hdlbname,
|
||||
zplb.zname as zplbname,
|
||||
state.stateColor,
|
||||
state.stateName
|
||||
FROM
|
||||
hd_wm_sbxx xx
|
||||
LEFT JOIN sys_user sbr ON sbr.id = xx.hdsbrid
|
||||
left join sys_unit dw on dw.id = sbr.unitid
|
||||
LEFT JOIN sys_union gh ON gh.id = dw.unionid
|
||||
LEFT JOIN hd_wm_lb hdlb ON hdlb.lid = xx.hdzplx
|
||||
LEFT JOIN hd_wm_zplb zplb ON zplb.zid = xx.hdzplx2
|
||||
left join hd_wm_xx hd on hd.hdid = xx.hdid
|
||||
LEFT JOIN audit_state state ON state.stateId = xx.auditState
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("xx.hdid", "in", Sqls.create("select hdid from hd_wm_xx where hdtype =1"));
|
||||
cnd.and("xx.hdsbrid", "=", ShiroUtil.getPrincipalProperty("id"));
|
||||
cnd.andEX("xx.hdid", "=", hdid);
|
||||
cnd.andEX("xx.hdlb", "=", hdlb);
|
||||
cnd.andEX("xx.zplb", "=", zplb);
|
||||
cnd.desc("sbr.username").desc("gh.unionname").desc("dw.name");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPage(pageNumber, pageSize, sql);
|
||||
return Result.success().addData(pagination);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
public Object findOne(String id) {
|
||||
try {
|
||||
Hd_wm_sbxx sbxx = hdWmsbxxService.fetch(id);
|
||||
Map<String, Object> map = Lang.obj2map(sbxx);
|
||||
List<Record> fjlist = baseService.list(Sqls.create("select * from hd_wm_sbxx_fj where hdsbid = @id").setParam("id", id));
|
||||
List<Record> piclist = new ArrayList<Record>();
|
||||
List<Record> vadlist = new ArrayList<Record>();
|
||||
for (Record r : fjlist) {
|
||||
String fjurl = r.getString("fjurl");
|
||||
r.set("status", "success");
|
||||
r.set("name", r.getString("fjname"));
|
||||
r.set("uid", r.getString("fjid"));
|
||||
if (fjurl.endsWith(".jpg") || fjurl.endsWith(".jpeg")
|
||||
|| fjurl.endsWith(".bmp")
|
||||
|| fjurl.endsWith(".gif")
|
||||
|| fjurl.endsWith(".png")) {
|
||||
r.set("url", "/platform/hd/childhd/sczp/previewPhoto?url=" + fjurl);
|
||||
piclist.add(r);
|
||||
} else {
|
||||
r.set("url", fjurl);
|
||||
vadlist.add(r);
|
||||
}
|
||||
|
||||
}
|
||||
map.put("piclist", piclist);
|
||||
map.put("vadlist", vadlist);
|
||||
map.put("hdlblist", hdWmLbService.query(Cnd.where("lhdid", "=", sbxx.getHdid())));
|
||||
map.put("hdzplblist", hdWmZplbService.query(Cnd.where("zlid", "=", sbxx.getHdzplx())));
|
||||
return Result.success().addData(map);
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
public Object gethdzplblist(String id) {
|
||||
try {
|
||||
return Result.success().addData(hdWmZplbService.query(Cnd.where("zlid", "=", id)));
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,291 @@
|
||||
package io.v.nutz.zhgh.hd.controller.wmhd;
|
||||
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.FileService;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_wm_lb;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_wm_xx;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_wm_zplb;
|
||||
import io.v.nutz.zhgh.hd.services.*;
|
||||
import io.v.nutz.sys.services.SysMsgService;
|
||||
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.boot.starter.ftp.FtpService;
|
||||
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.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
import org.nutz.trans.Trans;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by lyw on 2020/3/12 14:22
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/hd/wmhdMange")
|
||||
public class HdMangeController {
|
||||
@Inject
|
||||
private HdWmxxService hdWmxxService;
|
||||
|
||||
@Inject
|
||||
private HdWmsbxxService hdWmsbxxService;
|
||||
|
||||
@Inject
|
||||
private HdWmsbxxfjService hdWmsbxxfjService;
|
||||
|
||||
@Inject
|
||||
private HdWmBgiService hdWmBgiService;
|
||||
|
||||
@Inject
|
||||
private FileService fileService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/hd/wmhd/hdMange.html")
|
||||
@RequiresPermissions("hd.wmhd.hdmange")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("beetl:/platform/hd/wmhd/mobileBox.html")
|
||||
@RequiresPermissions("hd.wmhd.hdmange")
|
||||
public void mobileBox() {
|
||||
|
||||
}
|
||||
|
||||
private final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
@Inject
|
||||
private HdWmLbService hdWmLbService;
|
||||
|
||||
@Inject
|
||||
private HdWmZplbService hdWmZplbService;
|
||||
|
||||
@Inject
|
||||
private FtpService ftpService;
|
||||
|
||||
@Inject
|
||||
private SysMsgService sysMsgService;
|
||||
|
||||
@At
|
||||
@Ok("json")
|
||||
@ViReturn
|
||||
@RequiresPermissions("hd.wmhd.hdmange")
|
||||
public Object doAdd(@Param("hdxx") Hd_wm_xx hdWmXx) {
|
||||
Trans.exec(() -> {
|
||||
hdWmXx.setHdcjr(ShiroUtil.getPrincipalProperty("id").toString());
|
||||
hdWmXx.setHdcjsj(sdf.format(new Date()));
|
||||
hdWmXx.setHdflag(false);
|
||||
Hd_wm_xx insert = hdWmxxService.insert(hdWmXx);
|
||||
|
||||
List<Hd_wm_lb> lbs = hdWmXx.getLbs();
|
||||
for (int i = 0; i < lbs.size(); i++) {
|
||||
lbs.get(i).setLhdid(insert.getHdid());
|
||||
lbs.get(i).setLlocation(i + 1);
|
||||
Hd_wm_lb hdWmLb = hdWmLbService.insert(lbs.get(i));
|
||||
List<Hd_wm_zplb> zplbs = lbs.get(i).getZplbs();
|
||||
for (int j = 0; j < zplbs.size(); j++) {
|
||||
zplbs.get(j).setZlid(hdWmLb.getLid());
|
||||
zplbs.get(j).setZlocation(j + 1);
|
||||
hdWmZplbService.insert(zplbs.get(j));
|
||||
}
|
||||
}
|
||||
|
||||
if (hdWmXx.getXlFlag() != null && hdWmXx.getXlFlag()) {
|
||||
String time = hdWmXx.getHdkssj() + "至" + hdWmXx.getHdjssj();
|
||||
String title = "教工作品征集";
|
||||
String url = "/platform/hd/jzghd/sczp?hdid=" + insert.getHdid();
|
||||
String mobileUrl = "/platform/staffActivities?client=mobile&id=" + insert.getHdid();
|
||||
if (hdWmXx.getHdtype() == 2) {
|
||||
url = "/platform/hd/childhd/sczp?hdid=" + insert.getHdid();
|
||||
mobileUrl = "/childrenActivities?client=mobile&id=" + insert.getHdid();
|
||||
title = "亲子作品征集";
|
||||
}
|
||||
sysMsgService.sendMsgByActivityGroupId(insert.getHdid(), hdWmXx.getActivityGroupId(), title, hdWmXx.getHdname(), url, mobileUrl, time);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("json")
|
||||
public Object data(@Param(value = "hdname", required = false) String hdname, @Param(value = "hdtype", required = false) Integer hdtype, @Param(value = "year", required = false) Integer year, int pageNumber, int pageSize) {
|
||||
try {
|
||||
Sql sql = Sqls.create("SELECT hd.*,u.`username` cjr FROM hd_wm_xx hd LEFT JOIN sys_user u ON hd.hdcjr = u.`id` $condition");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("hdtype", "=", hdtype);
|
||||
if (Strings.isNotBlank(hdname)) {
|
||||
cnd.where().andLike("hdname", hdname);
|
||||
}
|
||||
if (year != null) {
|
||||
cnd.and("YEAR(hdcjsj)", "=", year);
|
||||
}
|
||||
if (!ShiroUtil.hasRole("sysadmin")) {
|
||||
cnd.and("hd.hdcjr", "=", ShiroUtil.getUserId());
|
||||
}
|
||||
cnd.desc("hdcjsj");
|
||||
sql.setCondition(cnd);
|
||||
return Result.success().addData(hdWmxxService.listPage(pageNumber, pageSize, sql));
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("json")
|
||||
@RequiresPermissions("hd.wmhd.hdmange")
|
||||
public Object delete(String hdid) {
|
||||
try {
|
||||
String path = new File("").getCanonicalPath();
|
||||
|
||||
hdWmZplbService.execute(Sqls.create("DELETE FROM `hd_wm_zplb` WHERE zlid IN (SELECT lb.`lid` FROM hd_wm_lb lb WHERE lb.`lhdid`=@hdid)").setParam("hdid", hdid));
|
||||
hdWmLbService.clear(Cnd.where("lhdid", "=", hdid));
|
||||
|
||||
List<Record> list = hdWmsbxxfjService.list(Sqls.create("SELECT fj.`fjurl` FROM hd_wm_sbxx_fj fj WHERE fj.`hdsbid` IN (SELECT sb.`id` FROM `hd_wm_sbxx` sb WHERE sb.`hdid`=@hdid)").setParam("hdid", hdid));
|
||||
for (Record record : list) {
|
||||
File file = new File(path + "/" + record.getString("fjurl"));
|
||||
if (file.exists() && file.isFile()) {
|
||||
file.delete();
|
||||
}
|
||||
}
|
||||
//删除上报附件
|
||||
hdWmsbxxfjService.execute(Sqls.create("DELETE FROM `hd_wm_sbxx_fj` WHERE `hdsbid` IN (SELECT sb.`id` FROM `hd_wm_sbxx` sb WHERE sb.`hdid`=@hdid)").setParam("hdid", hdid));
|
||||
|
||||
//删除上报信息
|
||||
hdWmsbxxService.execute(Sqls.create("DELETE FROM `hd_wm_sbxx` WHERE `hdid`=@hdid").setParam("hdid", hdid));
|
||||
|
||||
hdWmxxService.delete(hdid);
|
||||
sysMsgService.deleteMsg(hdid);
|
||||
return Result.success();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("json")
|
||||
@RequiresPermissions("hd.wmhd.hdmange")
|
||||
public Object changeStatus(String hdid, Boolean flag) {
|
||||
try {
|
||||
Hd_wm_xx hdWmXx = hdWmxxService.fetch(hdid);
|
||||
hdWmXx.setHdflag(flag);
|
||||
hdWmxxService.update(hdWmXx);
|
||||
return Result.success();
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("json")
|
||||
public Object findOne(String hdid) {
|
||||
try {
|
||||
Hd_wm_xx hdWmXx = hdWmxxService.fetch(hdid);
|
||||
List<Hd_wm_lb> lbs = hdWmLbService.query(Cnd.where("lhdid", "=", hdid).asc("llocation"));
|
||||
for (Hd_wm_lb lb : lbs) {
|
||||
lb.setZplbs(hdWmZplbService.query(Cnd.where("zlid", "=", lb.getLid()).asc("zlocation")));
|
||||
}
|
||||
hdWmXx.setLbs(lbs);
|
||||
return Result.success().addData(hdWmXx);
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("json")
|
||||
@RequiresPermissions("hd.wmhd.hdmange")
|
||||
@ViReturn
|
||||
public Object doEdit(@Param("hdxx") Hd_wm_xx hdWmXx) {
|
||||
Trans.exec(() -> {
|
||||
hdWmxxService.update(hdWmXx);
|
||||
List<String> lbids = new ArrayList<>();
|
||||
List<String> zpLbids = new ArrayList<>();
|
||||
|
||||
List<Hd_wm_lb> lbs = hdWmXx.getLbs();
|
||||
|
||||
//删除
|
||||
for (int i = 0; i < lbs.size(); i++) {
|
||||
List<Hd_wm_zplb> zplbs = lbs.get(i).getZplbs();
|
||||
for (int j = 0; j < zplbs.size(); j++) {
|
||||
if (Strings.isNotBlank(zplbs.get(j).getZid())) {
|
||||
zpLbids.add(zplbs.get(j).getZid());
|
||||
}
|
||||
}
|
||||
if (Strings.isNotBlank(lbs.get(i).getLid())) {
|
||||
lbids.add(lbs.get(i).getLid());
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (zpLbids.size() > 0) {
|
||||
cnd.where().andNotInStrList("zid", zpLbids).and("zlid", "=", lbs.get(i).getLid());
|
||||
hdWmZplbService.clear(cnd);
|
||||
}
|
||||
}
|
||||
}
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.where().andNotInStrList("lid", lbids).and("lhdid", "=", hdWmXx.getHdid());
|
||||
hdWmLbService.clear(cnd);
|
||||
|
||||
for (int i = 0; i < lbs.size(); i++) {
|
||||
lbs.get(i).setLhdid(hdWmXx.getHdid());
|
||||
lbs.get(i).setLlocation(i + 1);
|
||||
Hd_wm_lb hdWmLb = hdWmLbService.insertOrUpdate(lbs.get(i));
|
||||
List<Hd_wm_zplb> zplbs = lbs.get(i).getZplbs();
|
||||
for (int j = 0; j < zplbs.size(); j++) {
|
||||
zplbs.get(j).setZlid(hdWmLb.getLid());
|
||||
zplbs.get(j).setZlocation(j + 1);
|
||||
hdWmZplbService.insertOrUpdate(zplbs.get(j));
|
||||
}
|
||||
}
|
||||
|
||||
sysMsgService.deleteMsgByActivityId(hdWmXx.getHdid());
|
||||
if (hdWmXx.getXlFlag() != null && hdWmXx.getXlFlag()) {
|
||||
String time = hdWmXx.getHdkssj() + "至" + hdWmXx.getHdjssj();
|
||||
String title = "教工作品征集";
|
||||
String url = "/platform/hd/jzghd/sczp?hdid=" + hdWmXx.getHdid();
|
||||
String mobileUrl = "/platform/staffActivities?client=mobile&id=" + hdWmXx.getHdid();
|
||||
if (hdWmXx.getHdtype() == 2) {
|
||||
url = "/platform/hd/childhd/sczp?hdid=" + hdWmXx.getHdid();
|
||||
mobileUrl = "/childrenActivities?client=mobile&id=" + hdWmXx.getHdid();
|
||||
title = "亲子作品征集";
|
||||
}
|
||||
sysMsgService.sendMsgByActivityGroupId(hdWmXx.getHdid(), hdWmXx.getActivityGroupId(), title, hdWmXx.getHdname(), url, mobileUrl, time);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Ok("json")
|
||||
@ViReturn
|
||||
@RequiresAuthentication
|
||||
public Object getUserActivityGroup() {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT * FROM hd_wm_xx WHERE activityGroupId in (SELECT groupId FROM `activity_user_scope` $condition)
|
||||
""");
|
||||
if (!ShiroUtil.hasRole("sysadmin")) {
|
||||
cnd.and("userId", "=", ShiroUtil.getUserId());
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
return hdWmsbxxService.listMap(sql);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
package io.v.nutz.zhgh.hd.controller.wmhd;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.zhgh.hd.services.HdWmsbxxService;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.base.utils.ViTool;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
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.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@At("/platform/hd/wmhdhjxx")
|
||||
@IocBean
|
||||
public class HdWmHjInfoController {
|
||||
|
||||
@Inject
|
||||
private HdWmsbxxService hdWmsbxxService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/hd/wmhd/hjxxyl.html")
|
||||
@RequiresPermissions("hd.wmhd.hjxx1")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
@At("/pageData")
|
||||
@Ok("json")
|
||||
@ViReturn
|
||||
@RequiresPermissions("hd.wmhd.hjxx1")
|
||||
public Object pageData(@Param(value = "year", required = false) String year,
|
||||
@Param(value = "union", required = false) String union,
|
||||
@Param(value = "unit", required = false) String unit,
|
||||
PageForm pageForm,
|
||||
@Param(value = "hdid", required = false) String hdid,
|
||||
@Param(value = "searchName", required = false) String searchName,
|
||||
@Param(value = "searchKeyword", required = false) String searchKeyword) {
|
||||
try {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT DISTINCT
|
||||
( xx.hdsbrid ),
|
||||
u.username,
|
||||
u.loginname,
|
||||
n.NAME AS dwname,
|
||||
gh.unionname AS ghname,
|
||||
( SELECT COUNT( DISTINCT ( a.hdzplx )) FROM hd_wm_sbxx a WHERE a.hdsbrid = xx.`hdsbrid` and a.hdid = @hdid AND auditState=4400) AS hjcount
|
||||
FROM
|
||||
hd_wm_sbxx xx
|
||||
LEFT JOIN sys_user u ON u.id = xx.hdsbrid
|
||||
LEFT JOIN sys_unit n ON n.id = u.unitid
|
||||
LEFT JOIN sys_union gh ON gh.id = n.unionid
|
||||
$condition
|
||||
""");
|
||||
sql.setParam("hdid", hdid);
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("xx.hdid", "=", hdid);
|
||||
cnd.andEX("YEAR(xx.hdsbsj)", "=", year);
|
||||
cnd.andEX("xx.auditState", "=", 4400);
|
||||
if (!ShiroUtil.hasRole("H10") && !ShiroUtil.hasRole("SchoolUnionAdmin") && !ShiroUtil.hasRole("sysadmin")) {
|
||||
cnd.andEX("gh.id", "=", Vi.getUnionId());
|
||||
}
|
||||
cnd.andEX("n.unionid", "=", union);
|
||||
cnd.andEX("n.id", "=", unit);
|
||||
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
|
||||
cnd.and(Cnd.likeEX(searchName, searchKeyword));
|
||||
}
|
||||
cnd.asc("u.username").asc("n.name").asc("gh.unionname");
|
||||
sql.setCondition(cnd);
|
||||
return hdWmsbxxService.list(pageForm, sql);
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At("/exportExcel")
|
||||
@Ok("void")
|
||||
@RequiresPermissions("hd.wmhd.hjxx1")
|
||||
public void exportExcel(Integer num, String hdid, HttpServletResponse response) {
|
||||
|
||||
if (num == 1) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT DISTINCT
|
||||
( xx.hdsbrid ),
|
||||
u.username,
|
||||
u.loginname,
|
||||
n.NAME AS dwname,
|
||||
gh.unionname AS ghname,
|
||||
( SELECT COUNT( DISTINCT ( a.hdzplx )) FROM hd_wm_sbxx a WHERE a.hdsbrid = xx.`hdsbrid` and a.hdid = @hdid AND a.auditState=4400) AS hjcount
|
||||
FROM
|
||||
hd_wm_sbxx xx
|
||||
LEFT JOIN sys_user u ON u.id = xx.hdsbrid
|
||||
LEFT JOIN sys_unit n ON n.id = u.unitid
|
||||
LEFT JOIN sys_union gh ON gh.id = n.unionid
|
||||
$condition
|
||||
""");
|
||||
sql.setParam("hdid", hdid);
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("xx.hdid", "=", hdid);
|
||||
cnd.andEX("xx.auditState", "=", 4400);
|
||||
cnd.asc("u.username").asc("n.name").asc("gh.unionname");
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> winnerList = hdWmsbxxService.listMap(sql);
|
||||
|
||||
List<ExcelExportEntity> exportEntities = new ArrayList<>();
|
||||
exportEntities.add(new ExcelExportEntity("姓名", "username", 20));
|
||||
exportEntities.add(new ExcelExportEntity("工号", "loginname", 20));
|
||||
exportEntities.add(new ExcelExportEntity("单位", "dwname", 20));
|
||||
exportEntities.add(new ExcelExportEntity("分工会", "ghname", 20));
|
||||
exportEntities.add(new ExcelExportEntity("获奖次数", "hjcount", 20));
|
||||
|
||||
try {
|
||||
ViTool.excelResponse(response, "获奖人员名单.xls");
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), exportEntities, winnerList);
|
||||
workbook.write(response.getOutputStream());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
gh.unionname,
|
||||
count( DISTINCT sbxx.hdsbrid ) as joinNum ,
|
||||
count(DISTINCT sbxx.hdsbrid,sbxx.hdzplx) as prizeNum
|
||||
FROM
|
||||
sys_union gh
|
||||
LEFT JOIN `user` u ON u.unionid = gh.id
|
||||
LEFT JOIN hd_wm_sbxx sbxx ON sbxx.hdsbrid = u.id
|
||||
AND sbxx.hdid = @hdid
|
||||
AND sbxx.auditState = @auditState
|
||||
$condition
|
||||
""");
|
||||
sql.setParam("hdid", hdid);
|
||||
sql.setParam("auditState", 4400);
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.groupBy("gh.id");
|
||||
cnd.asc("gh.unioncode");
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> unionList = hdWmsbxxService.listMap(sql);
|
||||
List<ExcelExportEntity> exportEntities = new ArrayList<>();
|
||||
exportEntities.add(new ExcelExportEntity("分工会", "unionname", 20));
|
||||
exportEntities.add(new ExcelExportEntity("参加人数", "joinNum", 20));
|
||||
exportEntities.add(new ExcelExportEntity("应发奖品数", "prizeNum", 20));
|
||||
|
||||
try {
|
||||
ViTool.excelResponse(response, "分工会获奖信息.xls");
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), exportEntities, unionList);
|
||||
workbook.write(response.getOutputStream());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,634 @@
|
||||
package io.v.nutz.zhgh.hd.controller.wmhd;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.base.utils.Office2Pdf;
|
||||
import io.v.nutz.base.utils.PageUtil;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_wm_sbxx;
|
||||
import io.v.nutz.zhgh.hd.services.HdWmLbService;
|
||||
import io.v.nutz.zhgh.hd.services.HdWmZplbService;
|
||||
import io.v.nutz.zhgh.hd.services.HdWmsbxxService;
|
||||
import io.v.nutz.zhgh.hd.services.HdWmsbxxfjService;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.model.AuditState;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.sys.models.Sys_file;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.base.utils.ViTool;
|
||||
import net.coobird.thumbnailator.Thumbnails;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.net.ftp.FTPClient;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.boot.starter.ftp.FtpService;
|
||||
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.ioc.impl.PropertiesProxy;
|
||||
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.random.R;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.*;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
import static org.nutz.boot.starter.ftp.FtpStarter.*;
|
||||
import static org.nutz.boot.starter.ftp.FtpStarter.PROP_SERVER_PASSWORD;
|
||||
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@At("/platform/hd/wmhd")
|
||||
public class HdWmInfoController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@Inject
|
||||
private HdWmLbService hdWmLbService;
|
||||
|
||||
@Inject
|
||||
private HdWmZplbService hdWmZplbService;
|
||||
|
||||
@Inject
|
||||
private HdWmsbxxService hdWmsbxxService;
|
||||
|
||||
@Inject
|
||||
private HdWmsbxxfjService hdWmsbxxfjService;
|
||||
|
||||
@Inject
|
||||
protected PropertiesProxy conf;
|
||||
|
||||
private static final String imgnewdir = "upload/hd/hdwm/new/";
|
||||
|
||||
private String path = new File("").getCanonicalPath();
|
||||
|
||||
private final String imgtype[] = new String[]{"gif", "jpg", "png", "jpeg"};
|
||||
private final String videotype[] = new String[]{"flv", "swf", "mkv", "avi", "rm", "rmvb", "wmv", "mp4", "mov", "mpg", "mpeg"};
|
||||
private final String audiotype[] = new String[]{"mp3", "wma", "flac", "wav", "m4a", "amr", "au"};
|
||||
|
||||
private Set<String> imgSet = new HashSet<>(Arrays.asList(imgtype));
|
||||
private Set<String> videoSet = new HashSet<>(Arrays.asList(videotype));
|
||||
private Set<String> audioSet = new HashSet<>(Arrays.asList(audiotype));
|
||||
|
||||
public HdWmInfoController() throws IOException {
|
||||
|
||||
}
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/hd/wmhd/sbxxyl.html")
|
||||
@RequiresPermissions("hd.wmhd.zpxx1")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 返回原图片、视频流
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param filepath
|
||||
*/
|
||||
|
||||
@At("/getVideo")
|
||||
@Ok("void")
|
||||
@RequiresPermissions("hd.wmhd.zpxx1")
|
||||
public void getVideo(HttpServletRequest request, HttpServletResponse response, String filepath) {
|
||||
try {
|
||||
File file = new File(path + "\\" + filepath);
|
||||
FileInputStream fileInputStream = new FileInputStream(file);
|
||||
String filetype = filepath.substring(filepath.lastIndexOf(".") + 1, filepath.length());
|
||||
if (imgSet.contains(filetype)) {
|
||||
|
||||
} else if (videoSet.contains(filetype) || audioSet.contains(filetype)) {
|
||||
//视频 音频
|
||||
response.addHeader("Content-Type", "video/mp4;charset=UTF_8");
|
||||
response.addHeader("Accept-Ranges", "bytes");
|
||||
if (request.getHeader("Range") != null) {
|
||||
String range = StringUtils.substringBetween(request.getHeader("Range"), "bytes=", "-");
|
||||
long start = Long.parseLong(range);
|
||||
response.setHeader("Content-Length", String.valueOf(file.length() - start));
|
||||
if (start != 0) {
|
||||
response.setStatus(HttpServletResponse.SC_PARTIAL_CONTENT);//206
|
||||
response.setHeader("Content-Range", "bytes " + start + "-" + String.valueOf(file.length() - 1) + "/" + String.valueOf(file.length()));
|
||||
fileInputStream.skip(start);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IOUtils.copy(fileInputStream, response.getOutputStream());
|
||||
IOUtils.closeQuietly(fileInputStream);
|
||||
IOUtils.closeQuietly(response.getOutputStream());
|
||||
response.flushBuffer();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 压缩图片流
|
||||
*
|
||||
* @param response
|
||||
* @param filepath
|
||||
* @throws IOException
|
||||
*/
|
||||
@At("/getNewImg")
|
||||
@Ok("void")
|
||||
@RequiresPermissions("hd.wmhd.zpxx1")
|
||||
public void getNewImg(HttpServletResponse response, String filepath) throws IOException {
|
||||
//图片格式
|
||||
String imgformat = filepath.substring(filepath.lastIndexOf(".") + 1, filepath.length());
|
||||
|
||||
int i = filepath.indexOf("/", 14);
|
||||
String filename = filepath.substring(i + 1, filepath.length());
|
||||
String fromPic = path + "\\" + filepath;
|
||||
//压缩后的地址
|
||||
String toPic = path + "\\" + imgnewdir + filename;
|
||||
|
||||
if (!new File(toPic).exists()) {
|
||||
//进行压缩
|
||||
Thumbnails.of(fromPic).scale(1f).outputQuality(0.25f).toFile(toPic);
|
||||
}
|
||||
File tofile = new File(toPic);
|
||||
FileInputStream fileInputStream = new FileInputStream(tofile);
|
||||
BufferedImage img = ImageIO.read(fileInputStream);
|
||||
if (img != null) {
|
||||
ImageIO.write(img, imgformat, response.getOutputStream());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@At("/pageData")
|
||||
@ViReturn
|
||||
@RequiresPermissions("hd.wmhd.zpxx1")
|
||||
public Object pageData(@Param(value = "union", required = false) String union,
|
||||
@Param(value = "unit", required = false) String unit,
|
||||
PageForm pageForm,
|
||||
@Param(value = "hdid", required = false) String hdid,
|
||||
@Param(value = "hdlb", required = false) String hdlb,
|
||||
@Param(value = "zplb", required = false) String zplb,
|
||||
@Param(value = "year", required = false) String year,
|
||||
@Param(value = "stateId", required = false) Integer stateId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
xx.id,
|
||||
xx.hdsbsj,
|
||||
xx.hdsbzpzt,
|
||||
xx.hdsbzpms,
|
||||
xx.hdzplx,
|
||||
xx.hdid,
|
||||
wmxx.hdname,
|
||||
u.username,
|
||||
u.loginname,
|
||||
u.mobile,
|
||||
u.unitname AS 'dwname',
|
||||
u.unionname AS 'ghname',
|
||||
hdlb.lname AS hdlbname,
|
||||
zplb.zname AS zplbname,
|
||||
state.stateColor,
|
||||
state.stateName
|
||||
FROM
|
||||
hd_wm_sbxx xx
|
||||
LEFT JOIN hd_wm_lb hdlb ON hdlb.lid = xx.hdzplx
|
||||
LEFT JOIN hd_wm_zplb zplb ON zplb.zid = xx.hdzplx2
|
||||
LEFT JOIN `user` u ON u.id = xx.hdsbrid
|
||||
LEFT JOIN audit_state state ON state.stateId = xx.auditState
|
||||
LEFT JOIN hd_wm_xx wmxx ON wmxx.hdid = xx.hdid
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin")) {
|
||||
cnd.and("u.unionid", "=", Vi.getUnionId());
|
||||
}
|
||||
cnd.andEX("u.unionid", "=", union);
|
||||
cnd.andEX("u.unitid", "=", unit);
|
||||
cnd.andEX("xx.hdid", "=", hdid);
|
||||
cnd.andEX("xx.hdzplx", "=", hdlb);
|
||||
cnd.andEX("xx.hdzplx2", "=", zplb);
|
||||
cnd.andEX("YEAR(xx.hdsbsj)", "=", year);
|
||||
cnd.andEX("xx.auditState", "=", stateId);
|
||||
if (Strings.isNotBlank(pageForm.getSearchName()) && Strings.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
cnd.and(Cnd.likeEX(pageForm.getSearchName(), pageForm.getSearchKeyword()));
|
||||
}
|
||||
if (Strings.isNotBlank(pageForm.getPageOrderName()) && Strings.isNotBlank(pageForm.getPageOrderBy())) {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
} else {
|
||||
cnd.desc("xx.hdsbsj").asc("xx.auditState").asc("unioncode");
|
||||
}
|
||||
|
||||
sql.setCondition(cnd);
|
||||
|
||||
return hdWmsbxxfjService.listPage(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询附件信息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@At("/findOneById")
|
||||
@RequiresPermissions("hd.wmhd.zpxx1")
|
||||
public Object findOneById(String id) {
|
||||
try {
|
||||
// List<Hd_wm_sbxx_fj> fjList = hdWmsbxxfjService.query(Cnd.where("hdsbid", "=", id));
|
||||
List<Record> fjList = baseService.dao().query("sys_file", Cnd.where("reid", "=", id));
|
||||
|
||||
return Result.success().addData(fjList);
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At("/findxxById")
|
||||
@RequiresPermissions("hd.wmhd.zpxx1")
|
||||
@ViReturn
|
||||
public Object findxxById(String id) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
xx.*,
|
||||
u.username,
|
||||
u.loginname,
|
||||
u.unitname AS 'dwname',
|
||||
u.unionname AS 'ghname',
|
||||
hdlb.lname AS hdlbname,
|
||||
zplb.zname AS zplbname,
|
||||
zplb.*,
|
||||
zt.hdname,
|
||||
state.stateColor,
|
||||
state.stateName
|
||||
FROM
|
||||
hd_wm_sbxx xx
|
||||
LEFT JOIN hd_wm_lb hdlb ON hdlb.lid = xx.hdzplx
|
||||
LEFT JOIN hd_wm_zplb zplb ON zplb.zid = xx.hdzplx2
|
||||
LEFT JOIN hd_wm_xx zt ON zt.hdid = xx.hdid
|
||||
LEFT JOIN `user` u ON u.id = xx.hdsbrid
|
||||
LEFT JOIN audit_state state ON state.stateId = xx.auditState
|
||||
WHERE xx.id=@id
|
||||
""").setParam("id", id);
|
||||
List<NutMap> list = baseService.listMap(sql);
|
||||
if (list.size() > 0) {
|
||||
NutMap map = list.get(0);
|
||||
map.setv("union", Strings.isNotBlank(map.getString("unionAuditId")) ? baseService.dao().fetch(Audit.class, map.getString("unionAuditId")) : null);
|
||||
map.setv("school", Strings.isNotBlank(map.getString("schoolAuditId")) ? baseService.dao().fetch(Audit.class, map.getString("schoolAuditId")) : null);
|
||||
return map;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@At("/exportWork")
|
||||
@Ok("void")
|
||||
@RequiresPermissions("hd.wmhd.zpxx1")
|
||||
public void exportWork(HttpServletResponse response,
|
||||
String hdid,
|
||||
String hdname,
|
||||
String zplb,
|
||||
String union,
|
||||
String unit,
|
||||
String stateId) throws IOException {
|
||||
|
||||
response.setContentType("application/octet-stream");
|
||||
response.setHeader("content-disposition", "attachment;filename="
|
||||
+ URLEncoder.encode(hdname + "作品.zip", "UTF-8"));
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
xx.id,
|
||||
xx.hdzplx,
|
||||
xx.hdsbzpms,
|
||||
u.username,
|
||||
u.sex,
|
||||
u.loginname,
|
||||
u.unitname AS dwname,
|
||||
u.unionname AS ghname,
|
||||
hd.hdname as hdname,
|
||||
hdlb.lname as hdlbname,
|
||||
zplb.zname as zplbname
|
||||
FROM
|
||||
hd_wm_sbxx xx
|
||||
LEFT JOIN hd_wm_xx hd ON hd.hdid = xx.hdid
|
||||
LEFT JOIN hd_wm_lb hdlb ON hdlb.lid = xx.hdzplx
|
||||
LEFT JOIN hd_wm_zplb zplb ON zplb.zid = xx.hdzplx2
|
||||
LEFT JOIN `user` u ON u.id = xx.hdsbrid
|
||||
$condition
|
||||
""");
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("xx.hdid", "=", hdid);
|
||||
cnd.andEX("xx.hdzplx2", "=", zplb);
|
||||
cnd.andEX("u.unionid", "=", union);
|
||||
cnd.andEX("u.unitid", "=", unit);
|
||||
cnd.andEX("xx.auditState", "=", 4400);
|
||||
if (!ShiroUtil.hasRole("SchoolUnionAdmin") && !ShiroUtil.hasRole("sysadmin")) {
|
||||
if (ShiroUtil.hasRole("H04")) {
|
||||
cnd.andEX("u.unionid", "=", Vi.getUnionId());
|
||||
}
|
||||
}
|
||||
cnd.asc("u.unionname").asc("u.unitname").asc("u.username").asc("xx.hdzplx");
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> list = hdWmsbxxService.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();
|
||||
|
||||
ZipOutputStream zipOutputStream = new ZipOutputStream(new BufferedOutputStream(response.getOutputStream()));
|
||||
|
||||
list.forEach(item -> {
|
||||
List<Sys_file> fileList = dao.query(Sys_file.class, Cnd.where("reid", "=", item.getString("id")));
|
||||
if (Lang.isNotEmpty(fileList)) {
|
||||
for (int i = 0; i < fileList.size(); i++) {
|
||||
Sys_file file = fileList.get(i);
|
||||
try {
|
||||
String extension = file.getFilename().substring(file.getFilename().lastIndexOf("."));
|
||||
String newFileName = "";
|
||||
if (fileList.size() > 1) {
|
||||
newFileName = item.getString("hdsbzpms").replaceAll("\n", "") + (i + 1) + extension;
|
||||
} else {
|
||||
newFileName = item.getString("hdsbzpms").replaceAll("\n", "") + extension;
|
||||
}
|
||||
String entryName = item.getString("ghname") + "/" + "【" + item.getString("username") + "】" + newFileName;
|
||||
zipOutputStream.putNextEntry(new ZipEntry(entryName));
|
||||
//读取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();
|
||||
}
|
||||
|
||||
@At("/exportExcel")
|
||||
@Ok("void")
|
||||
@RequiresPermissions("hd.wmhd.zpxx1")
|
||||
public void exportExcel(HttpServletResponse response,
|
||||
String hdid,
|
||||
String hdname,
|
||||
String zplb,
|
||||
String union,
|
||||
String unit,
|
||||
String stateId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
xx.id,
|
||||
xx.hdzplx,
|
||||
xx.hdsbzpms,
|
||||
u.username,
|
||||
u.sex,
|
||||
u.loginname,
|
||||
u.unitname AS dwname,
|
||||
u.unionname AS ghname,
|
||||
hd.hdname as hdname,
|
||||
hdlb.lname as hdlbname,
|
||||
zplb.zname as zplbname
|
||||
FROM
|
||||
hd_wm_sbxx xx
|
||||
LEFT JOIN hd_wm_xx hd ON hd.hdid = xx.hdid
|
||||
LEFT JOIN hd_wm_lb hdlb ON hdlb.lid = xx.hdzplx
|
||||
LEFT JOIN hd_wm_zplb zplb ON zplb.zid = xx.hdzplx2
|
||||
LEFT JOIN `user` u ON u.id = xx.hdsbrid
|
||||
$condition
|
||||
""");
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("xx.hdid", "=", hdid);
|
||||
cnd.andEX("xx.hdzplx2", "=", zplb);
|
||||
cnd.andEX("u.unionid", "=", union);
|
||||
cnd.andEX("u.unitid", "=", unit);
|
||||
cnd.andEX("xx.auditState", "=", stateId);
|
||||
if (!ShiroUtil.hasRole("SchoolUnionAdmin") && !ShiroUtil.hasRole("sysadmin")) {
|
||||
if (ShiroUtil.hasRole("H04")) {
|
||||
cnd.andEX("u.unionid", "=", Vi.getUnionId());
|
||||
}
|
||||
}
|
||||
cnd.asc("u.unionname").asc("u.unitname").asc("u.username").asc("xx.hdzplx");
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> list = hdWmsbxxService.listMap(sql);
|
||||
|
||||
List<ExcelExportEntity> exportEntities = new ArrayList<>();
|
||||
exportEntities.add(new ExcelExportEntity("姓名", "username", 20));
|
||||
exportEntities.add(new ExcelExportEntity("工号", "loginname", 20));
|
||||
exportEntities.add(new ExcelExportEntity("性别", "sex", 20));
|
||||
exportEntities.add(new ExcelExportEntity("单位", "dwname", 20));
|
||||
exportEntities.add(new ExcelExportEntity("分工会", "ghname", 20));
|
||||
exportEntities.add(new ExcelExportEntity("作品主题", "hdname", 20));
|
||||
exportEntities.add(new ExcelExportEntity("活动类别", "hdlbname", 20));
|
||||
exportEntities.add(new ExcelExportEntity("作品类别", "zplbname", 20));
|
||||
exportEntities.add(new ExcelExportEntity("作品描述", "hdsbzpms", 200));
|
||||
|
||||
try {
|
||||
ViTool.excelResponse(response, hdname + ".xls");
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), exportEntities, list);
|
||||
workbook.write(response.getOutputStream());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Inject
|
||||
private FtpService ftpService;
|
||||
|
||||
/**
|
||||
* 下载图片视频
|
||||
*
|
||||
* @param filepath
|
||||
* @param filename
|
||||
* @param username
|
||||
* @param response
|
||||
*/
|
||||
@At("/downLoad")
|
||||
@Ok("void")
|
||||
@RequiresPermissions("hd.wmhd.zpxx1")
|
||||
public void download(String filepath, String filename, String username, HttpServletResponse response) {
|
||||
try {
|
||||
response.setContentType("application/octet-stream");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + new String(filename.getBytes("utf-8"), "ISO8859-1"));
|
||||
ftpService.download(filepath, response.getOutputStream());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 预览文档
|
||||
*
|
||||
* @param fjurl
|
||||
* @param request
|
||||
* @param response
|
||||
* @throws Exception
|
||||
*/
|
||||
@At("/YlDoc")
|
||||
@Ok("void")
|
||||
@RequiresPermissions("hd.wmhd.zpxx1")
|
||||
public void viewFJ(String fjurl, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
String destFile = "";
|
||||
try {
|
||||
String rootPath = new File("").getCanonicalPath();
|
||||
//源文件地址
|
||||
String sourceFile = rootPath + "\\" + fjurl;
|
||||
|
||||
ftpService.download(fjurl, new FileOutputStream(sourceFile));
|
||||
|
||||
//临时存放生成的pdf文件
|
||||
destFile = rootPath + "\\upload\\pdf\\" + R.UU32() + ".pdf";
|
||||
//转换
|
||||
boolean b = Office2Pdf.officeToPDF(sourceFile, destFile);
|
||||
if (b) {
|
||||
FileInputStream is = new FileInputStream(new File(destFile));
|
||||
ServletOutputStream out = response.getOutputStream();
|
||||
// 创建缓冲区
|
||||
byte[] buffer = new byte[1024];
|
||||
int len = 0;
|
||||
while ((len = is.read(buffer)) != -1) {
|
||||
out.write(buffer, 0, len);
|
||||
}
|
||||
is.close();
|
||||
out.flush();
|
||||
out.close();
|
||||
}
|
||||
|
||||
File file = new File(sourceFile);
|
||||
if (file.exists()) {
|
||||
file.delete();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
File file = new File(destFile);
|
||||
if (file.exists()) {
|
||||
file.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@RequiresPermissions("hd.wmhd.zpxx1")
|
||||
public Object initHdxxlist() {
|
||||
try {
|
||||
String isSysadmin = " and hdcjr is not null";
|
||||
if (ShiroUtil.hasRole("H10")) {
|
||||
isSysadmin = "and hdcjr = '" + ShiroUtil.getUserId() + "'";
|
||||
}
|
||||
Sql sql = Sqls.create("select *,year(hdcjsj) year from hd_wm_xx where hdtype=1 and hdflag = true %s order by hdcjsj desc".formatted(isSysadmin));
|
||||
|
||||
List<Record> list = hdWmsbxxService.list(sql);
|
||||
|
||||
List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
|
||||
|
||||
Map<Integer, List<Record>> listMap = list.stream().collect(Collectors.groupingBy(v -> v.getInt("year")));
|
||||
|
||||
listMap.forEach((k, v) -> {
|
||||
List<Map<String, Object>> children = new ArrayList<>();
|
||||
v.forEach(x -> {
|
||||
children.add(Map.of("value", x.getString("hdid"), "label", x.getString("hdname")));
|
||||
});
|
||||
|
||||
Map<String, Object> parent = Map.of("value", k, "label", k, "children", children);
|
||||
result.add(parent);
|
||||
});
|
||||
|
||||
return Result.success().addData(result);
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@RequiresPermissions("hd.wmhd.zpxx1")
|
||||
public Object findOne(String id) {
|
||||
try {
|
||||
Hd_wm_sbxx sbxx = hdWmsbxxService.fetch(id);
|
||||
Map<String, Object> map = Lang.obj2map(sbxx);
|
||||
// List<Record> fjlist = baseService.list(Sqls.create("select * from hd_wm_sbxx_fj where hdsbid = @id").setParam("id", id));
|
||||
List<Record> fjList = baseService.dao().query("sys_file", Cnd.where("reid", "=", id));
|
||||
List<Record> piclist = new ArrayList<Record>();
|
||||
List<Record> vadlist = new ArrayList<Record>();
|
||||
for (Record r : fjList) {
|
||||
String fjurl = r.getString("filepath");
|
||||
r.set("status", "success");
|
||||
r.set("name", r.getString("filename"));
|
||||
r.set("uid", r.getString("reid"));
|
||||
if (fjurl.endsWith(".jpg") || fjurl.endsWith(".jpeg")
|
||||
|| fjurl.endsWith(".bmp")
|
||||
|| fjurl.endsWith(".gif")
|
||||
|| fjurl.endsWith(".png")) {
|
||||
r.set("url", fjurl);
|
||||
piclist.add(r);
|
||||
} else {
|
||||
r.set("url", fjurl);
|
||||
vadlist.add(r);
|
||||
}
|
||||
|
||||
}
|
||||
map.put("piclist", piclist);
|
||||
map.put("vadlist", vadlist);
|
||||
map.put("hdlblist", hdWmLbService.query(Cnd.where("lhdid", "=", sbxx.getHdid())));
|
||||
map.put("hdzplblist", hdWmZplbService.query(Cnd.where("zlid", "=", sbxx.getHdzplx())));
|
||||
return Result.success().addData(map);
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("hd.wmhd.zpxx1")
|
||||
public Object doDelete(String id) {
|
||||
dao.clear(Hd_wm_sbxx.class, Cnd.where("id", "=", id));
|
||||
dao.clear(Sys_file.class, Cnd.where("reid", "=", id));
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("hd.wmhd.zpxx1")
|
||||
public Object getAuditStateByModule() {
|
||||
return baseService.dao().query(AuditState.class, Cnd.where("module", "=", "hdwm"));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
package io.v.nutz.zhgh.hd.controller.wmhd;
|
||||
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.base.utils.PageUtil;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_wm_sbxx;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
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.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*
|
||||
* @Author zhf
|
||||
* @Date 2022/11/24 15:07
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/hd/wmhd/school/audit")
|
||||
@Ok("json:full")
|
||||
public class HdWmSchoolAuditController {
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/hd/wmhd/schoolAudit.html")
|
||||
@RequiresPermissions("hd.wmhd.schoolAudit")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("hd.wmhd.schoolAudit")
|
||||
public Object pageData(@Param(value = "stateId", required = false) String stateId,
|
||||
String isAudit,
|
||||
@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "unitId", required = false) String unitId,
|
||||
PageForm page,
|
||||
@Param(value = "hdid", required = false) String hdid,
|
||||
@Param(value = "hdlb", required = false) String hdlb,
|
||||
@Param(value = "zplb", required = false) String zplb,
|
||||
@Param(value = "year", required = false) String year) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
xx.*,
|
||||
u.username,
|
||||
u.loginname,
|
||||
u.unitname AS 'dwname',
|
||||
u.unionname AS 'ghname',
|
||||
hdlb.lname AS hdlbname,
|
||||
zplb.zname AS zplbname,
|
||||
zt.hdname,
|
||||
state.stateColor,
|
||||
state.stateName
|
||||
FROM
|
||||
hd_wm_sbxx xx
|
||||
LEFT JOIN hd_wm_lb hdlb ON hdlb.lid = xx.hdzplx
|
||||
LEFT JOIN hd_wm_zplb zplb ON zplb.zid = xx.hdzplx2
|
||||
LEFT JOIN hd_wm_xx zt ON zt.hdid = xx.hdid
|
||||
LEFT JOIN `user` u ON u.id = xx.hdsbrid
|
||||
LEFT JOIN audit_state state ON state.stateId = xx.auditState
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("YEAR(xx.hdsbsj)", "=", year);
|
||||
cnd.andEX("u.unionid", "=", unionId);
|
||||
cnd.andEX("u.unitid", "=", unitId);
|
||||
cnd.andEX("xx.hdid", "=", hdid);
|
||||
cnd.andEX("xx.hdzplx", "=", hdlb);
|
||||
cnd.andEX("xx.hdzplx2", "=", zplb);
|
||||
cnd.andEX("xx.auditState", "=", stateId);
|
||||
if (Strings.isNotBlank(page.getSearchKeyword()) && Strings.isNotBlank(page.getSearchName())) {
|
||||
cnd.and(Cnd.likeEX(page.getSearchName(), page.getSearchKeyword()));
|
||||
}
|
||||
if (Strings.isNotBlank(isAudit)) {
|
||||
cnd.and("xx.auditState", isAudit.equals("true") ? ">" : "=", "4200");
|
||||
} else {
|
||||
cnd.and("xx.auditState", ">=", "4200");
|
||||
}
|
||||
if (Strings.isNotBlank(page.getPageOrderName()) && Strings.isNotBlank(page.getPageOrderBy())) {
|
||||
cnd.orderBy(page.getPageOrderName(), PageUtil.getOrder(page.getPageOrderBy()));
|
||||
} else {
|
||||
cnd.desc("xx.hdsbsj").asc("xx.auditState").asc("unioncode");
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
|
||||
return baseService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Object doReview(@Param(value = "id", required = false) String id,
|
||||
@Param(value = "ids", required = false) String[] ids,
|
||||
Integer pass,
|
||||
Audit audit) {
|
||||
String auditState = (pass == 1 ? "4300" : pass == 2 ? "4250" : "4400");
|
||||
baseService.insert(audit);
|
||||
if (Lang.isNotEmpty(ids)) {
|
||||
baseService.dao().update(Hd_wm_sbxx.class, Chain.make("auditState", auditState).add("schoolAuditId", audit.getId()), Cnd.where("id", "in", ids));
|
||||
} else {
|
||||
baseService.dao().update(Hd_wm_sbxx.class, Chain.make("auditState", auditState).add("schoolAuditId", audit.getId()), Cnd.where("id", "=", id));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
package io.v.nutz.zhgh.hd.controller.wmhd;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.base.utils.PageUtil;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_wm_sbxx;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
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.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*
|
||||
* @Author zhf
|
||||
* @Date 2022/11/24 10:53
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/hd/wmhd/union/audit")
|
||||
@Ok("json:full")
|
||||
public class HdWmUnionAuditController {
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/hd/wmhd/unionAudit.html")
|
||||
@RequiresPermissions("hd.wmhd.unionAudit")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("hd.wmhd.unionAudit")
|
||||
public Object pageData(@Param(value = "stateId", required = false) String stateId,
|
||||
String isAudit,
|
||||
@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "unitId", required = false) String unitId,
|
||||
PageForm page,
|
||||
@Param(value = "hdid", required = false) String hdid,
|
||||
@Param(value = "hdlb", required = false) String hdlb,
|
||||
@Param(value = "zplb", required = false) String zplb,
|
||||
@Param(value = "year", required = false) String year) {
|
||||
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
xx.*,
|
||||
u.username,
|
||||
u.loginname,
|
||||
u.unitname AS 'dwname',
|
||||
u.unionname AS 'ghname',
|
||||
hdlb.lname AS hdlbname,
|
||||
zplb.zname AS zplbname,
|
||||
zt.hdname,
|
||||
state.stateColor,
|
||||
state.stateName
|
||||
FROM
|
||||
hd_wm_sbxx xx
|
||||
LEFT JOIN hd_wm_lb hdlb ON hdlb.lid = xx.hdzplx
|
||||
LEFT JOIN hd_wm_zplb zplb ON zplb.zid = xx.hdzplx2
|
||||
LEFT JOIN hd_wm_xx zt ON zt.hdid = xx.hdid
|
||||
LEFT JOIN `user` u ON u.id = xx.hdsbrid
|
||||
LEFT JOIN audit_state state ON state.stateId = xx.auditState
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("YEAR(xx.hdsbsj)", "=", year);
|
||||
cnd.andEX("u.unionid", "=", unionId);
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin")) {
|
||||
cnd.andEX("u.unionid", "=", Vi.getUnionId());
|
||||
}
|
||||
cnd.andEX("u.unitid", "=", unitId);
|
||||
cnd.andEX("xx.hdid", "=", hdid);
|
||||
cnd.andEX("xx.hdzplx", "=", hdlb);
|
||||
cnd.andEX("xx.hdzplx2", "=", zplb);
|
||||
cnd.andEX("xx.auditState", "=", stateId);
|
||||
if (Strings.isNotBlank(page.getSearchKeyword()) && Strings.isNotBlank(page.getSearchName())) {
|
||||
cnd.and(Cnd.likeEX(page.getSearchName(), page.getSearchKeyword()));
|
||||
}
|
||||
if (Strings.isNotBlank(isAudit)) {
|
||||
cnd.and("xx.auditState", isAudit.equals("true") ? ">" : "=", "4000");
|
||||
} else {
|
||||
cnd.and("xx.auditState", ">=", "4000");
|
||||
}
|
||||
if (Strings.isNotBlank(page.getPageOrderName()) && Strings.isNotBlank(page.getPageOrderBy())) {
|
||||
cnd.orderBy(page.getPageOrderName(), PageUtil.getOrder(page.getPageOrderBy()));
|
||||
} else {
|
||||
cnd.desc("xx.hdsbsj").asc("xx.auditState").asc("unioncode");
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
|
||||
return baseService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("hd.wmhd.unionAudit")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Object doReview(@Param(value = "id", required = false) String id,
|
||||
@Param(value = "ids", required = false)String[] ids,
|
||||
Integer pass,
|
||||
Audit audit) {
|
||||
if (StrUtil.isBlank(id) && Lang.isEmptyArray(ids)) {
|
||||
return Result.error("参数错误");
|
||||
}
|
||||
|
||||
String auditState = (pass == 1 ? "4150" : pass == 2 ? "4100" : "4200");
|
||||
baseService.insert(audit);
|
||||
if (Lang.isNotEmpty(ids)) {
|
||||
baseService.dao().update(Hd_wm_sbxx.class, Chain.make("auditState", auditState).add("unionAuditId", audit.getId()), Cnd.where("id", "in", ids));
|
||||
} else {
|
||||
baseService.dao().update(Hd_wm_sbxx.class, Chain.make("auditState", auditState).add("unionAuditId", audit.getId()), Cnd.where("id", "=", id));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package io.v.nutz.zhgh.hd.controller.wmhd.mobile;
|
||||
|
||||
/**
|
||||
* Created by lyw on 2020/3/2 15:51
|
||||
*/
|
||||
|
||||
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.utils.FileService;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_wm_sbxx;
|
||||
import io.v.nutz.zhgh.hd.services.HdWmsbxxService;
|
||||
import io.v.nutz.zhgh.hd.services.HdWmsbxxfjService;
|
||||
import io.v.nutz.sys.services.SysUserService;
|
||||
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.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
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 javax.servlet.http.HttpSession;
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by lyw on 2020/3/2 13:10
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/hd/wm/wmMobile")
|
||||
public class HdWmMobileController {
|
||||
@At("")
|
||||
@Ok("beetl:/platform/hd/wmhd/mobile/wmMobile.html")
|
||||
public void index(HttpSession session) {
|
||||
|
||||
}
|
||||
|
||||
@Inject
|
||||
private SysUserService sysUserService;
|
||||
|
||||
@Inject
|
||||
private HdWmsbxxfjService hdWmsbxxfjService;
|
||||
|
||||
@Inject
|
||||
private HdWmsbxxService hdWmsbxxService;
|
||||
|
||||
@At
|
||||
@Ok("json")
|
||||
public Object queryUserByLoginname(String loginname) {
|
||||
try {
|
||||
Sql sql = Sqls.create("SELECT u.`id`,u.`loginname`,u.`username`,un.`unionname` FROM sys_user u\n" +
|
||||
"LEFT JOIN sys_unit unit ON u.`unitid` = unit.`id`\n" +
|
||||
"LEFT JOIN sys_union un ON unit.`unionid`=un.`id` WHERE u.`loginname` = @loginname AND u.`sex` = '女' ").setParam("loginname", loginname);
|
||||
List<Record> list = sysUserService.list(sql);
|
||||
if (list.size() > 0) {
|
||||
return Result.success().addData(list.get(0));
|
||||
}
|
||||
return Result.success().addData(null);
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("json")
|
||||
public boolean getSubCount(String userid) {
|
||||
return hdWmsbxxService.count(Cnd.where("hdsbrid", "=", userid)) == 0;
|
||||
}
|
||||
|
||||
@Inject
|
||||
private FileService fileService;
|
||||
|
||||
@At
|
||||
@Ok("json")
|
||||
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
|
||||
public Object doSubmit(@Param("..") Hd_wm_sbxx sbxx, @Param("files") TempFile[] files) {
|
||||
try {
|
||||
String path = new File("").getCanonicalPath();
|
||||
|
||||
Hd_wm_sbxx insert = hdWmsbxxService.insert(sbxx);
|
||||
|
||||
for (TempFile file : files) {
|
||||
fileService.upload(file,insert.getId(),"/hd/hdwm/");
|
||||
}
|
||||
|
||||
return Result.success().addMsg("上传成功!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error().addMsg("上传失败!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package io.v.nutz.zhgh.hd.controller.wmhd.mobile;
|
||||
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.utils.FileService;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_wm_sbxx;
|
||||
import io.v.nutz.zhgh.hd.services.HdWmsbxxService;
|
||||
import io.v.nutz.zhgh.hd.services.HdWmsbxxfjService;
|
||||
import io.v.nutz.sys.services.SysUserService;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
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.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
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 javax.servlet.http.HttpSession;
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: V
|
||||
* @Date: 2020/6/2 12:04
|
||||
* @Description: 教职工作品征集活动
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/staffActivities")
|
||||
public class StaffActivitiesCon {
|
||||
@At("")
|
||||
@Ok("beetl:/platform/hd/wmhd/mobile/staffActivities.html")
|
||||
@RequiresAuthentication
|
||||
public void index(HttpSession session) {
|
||||
|
||||
}
|
||||
|
||||
@Inject
|
||||
private SysUserService sysUserService;
|
||||
|
||||
@Inject
|
||||
private HdWmsbxxfjService hdWmsbxxfjService;
|
||||
@Inject
|
||||
private HdWmsbxxService hdWmsbxxService;
|
||||
|
||||
@At
|
||||
@Ok("json")
|
||||
@RequiresAuthentication
|
||||
public Object queryUserByLoginname(String loginname) {
|
||||
try {
|
||||
Sql sql = Sqls.create("SELECT u.`id`,u.`loginname`,u.`username`,un.`unionname`,unit.name unitname FROM sys_user u\n" +
|
||||
"LEFT JOIN sys_unit unit ON u.`unitid` = unit.`id`\n" +
|
||||
"LEFT JOIN sys_union un ON unit.`unionid`=un.`id` WHERE u.`loginname` = @loginname ").setParam("loginname", loginname);
|
||||
List<Record> list = sysUserService.list(sql);
|
||||
if (list.size() > 0) {
|
||||
return Result.success().addData(list.get(0));
|
||||
}
|
||||
return Result.success().addData(null);
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("json")
|
||||
@RequiresAuthentication
|
||||
public boolean getSubCount(String userid) {
|
||||
return hdWmsbxxService.count(Cnd.where("hdsbrid", "=", userid)) == 0;
|
||||
}
|
||||
|
||||
@Inject
|
||||
private FileService fileService;
|
||||
|
||||
@At
|
||||
@Ok("json")
|
||||
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
|
||||
@RequiresAuthentication
|
||||
public Object doSubmit(@Param("..") Hd_wm_sbxx sbxx, @Param("files") TempFile[] files, boolean flag) {
|
||||
try {
|
||||
String path = new File("").getCanonicalPath();
|
||||
sbxx.setAuditState(flag ? "4000" : "3999");
|
||||
Hd_wm_sbxx insert = hdWmsbxxService.insert(sbxx);
|
||||
|
||||
for (TempFile file : files) {
|
||||
fileService.upload(file, insert.getId(), "/hd/hdwm/");
|
||||
}
|
||||
|
||||
|
||||
return Result.success().addMsg("上传成功!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error().addMsg("上传失败!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package io.v.nutz.zhgh.hd.controller.zxdt;
|
||||
|
||||
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.PageUtil;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_papers;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_subject_reply;
|
||||
import io.v.nutz.zhgh.hd.services.HdPaperService;
|
||||
import io.v.nutz.zhgh.hd.services.HdSubjectAnswerService;
|
||||
import io.v.nutz.zhgh.hd.services.HdSubjectReplyService;
|
||||
import io.v.nutz.zhgh.hd.services.HdSubjectService;
|
||||
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;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
/**
|
||||
* @author: Aaron
|
||||
* @create: 2020-10-23 09:24
|
||||
* @description: 开始答题
|
||||
**/
|
||||
@At("/platform/hd/zxdt/answer")
|
||||
@Ok("json:full")
|
||||
@IocBean
|
||||
@RequiresAuthentication
|
||||
public class AnswerController {
|
||||
|
||||
@Inject
|
||||
private HdSubjectAnswerService hdSubjectAnswerService;
|
||||
|
||||
@Inject
|
||||
private HdPaperService hdPaperService;
|
||||
|
||||
@Inject
|
||||
private HdSubjectService hdSubjectService;
|
||||
|
||||
@Inject
|
||||
private HdSubjectReplyService hdSubjectReplyService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/hd/zxdt/answer.html")
|
||||
@RequiresPermissions("hd.zxdt.ksdt")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object pageData(Integer pageNumber, Integer pageSize, String searchName, String searchKeyword, String pageOrderName, String pageOrderBy) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("SELECT id, `name`, explain_txt, answer_num, fraction, answer_start_time, answer_end_time, create_time FROM hd_papers $condition");
|
||||
|
||||
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
|
||||
cnd.where().andLike(searchName, searchKeyword);
|
||||
}
|
||||
|
||||
if (Strings.isNotBlank(pageOrderName) && Strings.isNotBlank(pageOrderName)) {
|
||||
cnd.orderBy(pageOrderName, PageUtil.getOrder(pageOrderBy));
|
||||
} else {
|
||||
cnd.desc("create_time").desc("answer_start_time");
|
||||
}
|
||||
|
||||
sql.setCondition(cnd);
|
||||
return hdPaperService.listPage(pageNumber, pageSize, sql);
|
||||
}
|
||||
|
||||
@At
|
||||
public Object doAdd(@Param("replyList") Hd_subject_reply[] replyList) {
|
||||
try {
|
||||
hdSubjectAnswerService.doAdd(replyList, (String) ShiroUtil.getPrincipalProperty("loginname"));
|
||||
return Result.success();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
public Object findOne(String id) {
|
||||
try {
|
||||
Hd_papers hd_papers = (Hd_papers) hdSubjectAnswerService.findOne(id, (String) ShiroUtil.getPrincipalProperty("loginname"));
|
||||
return Result.success().addData(hd_papers);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
package io.v.nutz.zhgh.hd.controller.zxdt;
|
||||
|
||||
|
||||
import cn.wizzer.framework.base.service.BaseService;
|
||||
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.zhgh.hd.models.Hd_papers;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_subject;
|
||||
import io.v.nutz.zhgh.hd.services.HdPaperService;
|
||||
import io.v.nutz.zhgh.hd.services.HdSubjectService;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: Aaron
|
||||
* @create: 2020-10-21 09:45
|
||||
* @description: 试卷管理
|
||||
**/
|
||||
@At("/platform/hd/zxdt/papers")
|
||||
@Ok("json:full")
|
||||
@IocBean
|
||||
@RequiresAuthentication
|
||||
public class PapersController {
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@Inject
|
||||
private HdPaperService hdPaperService;
|
||||
|
||||
@Inject
|
||||
private HdSubjectService hdSubjectService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/hd/zxdt/papers.html")
|
||||
@RequiresPermissions("hd.zxdt.sj")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object pageData(Integer pageNumber, Integer pageSize, String searchName, String searchKeyword, String pageOrderName, String pageOrderBy) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("SELECT id, `name`, explain_txt, answer_num, fraction, answer_start_time, answer_end_time, create_time FROM hd_papers $condition");
|
||||
|
||||
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
|
||||
cnd.where().andLike(searchName, searchKeyword);
|
||||
}
|
||||
|
||||
if (Strings.isNotBlank(pageOrderName) && Strings.isNotBlank(pageOrderName)) {
|
||||
cnd.orderBy(pageOrderName, PageUtil.getOrder(pageOrderBy));
|
||||
} else {
|
||||
cnd.desc("create_time");
|
||||
}
|
||||
|
||||
sql.setCondition(cnd);
|
||||
return hdPaperService.listPage(pageNumber, pageSize, sql);
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Object doAdd(@Param("papers") Hd_papers papers, @Param("subject") Hd_subject[] subject) {
|
||||
papers.setCreate_time(DateUtil.getDate());
|
||||
ArrayList<Hd_subject> hd_subject = new ArrayList<>();
|
||||
for (Hd_subject hdSubject : subject) {
|
||||
hd_subject.add(hdSubject);
|
||||
}
|
||||
papers.setSubjects(hd_subject);
|
||||
hdPaperService.insertRelation(hdPaperService.insert(papers), "subjects");
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Object doEdit(@Param("papers") Hd_papers papers, @Param("subject") Hd_subject[] subject) {
|
||||
baseService.clear("hd_papers_subject", Cnd.where("pid", "=", papers.getId()));
|
||||
papers.setCreate_time(DateUtil.getDate());
|
||||
hdPaperService.updateIgnoreNull(papers);
|
||||
ArrayList<Hd_subject> hd_subject = new ArrayList<>();
|
||||
for (Hd_subject hdSubject : subject) {
|
||||
hd_subject.add(hdSubject);
|
||||
}
|
||||
papers.setSubjects(hd_subject);
|
||||
hdPaperService.insertRelation(papers, "subjects");
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Object delete(String id) {
|
||||
hdPaperService.delete(id);
|
||||
baseService.clear("hd_papers_subject", Cnd.where("pid", "=", id));
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object findOne(String id) {
|
||||
Hd_papers hd_papers = hdPaperService.fetchLinks(hdPaperService.fetch(id), "subjects", Cnd.NEW().asc("location"));
|
||||
List<Hd_subject> subjects = new ArrayList<>();
|
||||
hd_papers.getSubjects().forEach(v -> {
|
||||
subjects.add(hdSubjectService.fetchLinks(hdSubjectService.fetch(v.getId()), "answer", Cnd.NEW().asc("location")));
|
||||
});
|
||||
hd_papers.setSubjects(subjects);
|
||||
return hd_papers;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object findSubject(Integer pageNumber, Integer pageSize, String type, String searchName, String searchKeyword, String pageOrderName, String pageOrderBy) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("SELECT\n" +
|
||||
"\tsub.id,\n" +
|
||||
"\tsub.`name`,\n" +
|
||||
"\tsub.type,\n" +
|
||||
"\tGROUP_CONCAT(ans.option_txt separator '、') option_txt\n" +
|
||||
"FROM\n" +
|
||||
"\thd_subject sub\n" +
|
||||
"\tLEFT JOIN hd_subject_answer ans ON ans.subject_id = sub.id \n" +
|
||||
"\tAND ans.is_yes = TRUE $condition");
|
||||
|
||||
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
|
||||
cnd.where().andLike(searchName, searchKeyword);
|
||||
}
|
||||
|
||||
if (Strings.isNotBlank(type)) {
|
||||
cnd.where().and("sub.type", "=", type);
|
||||
}
|
||||
|
||||
if (Strings.isNotBlank(pageOrderName) && Strings.isNotBlank(pageOrderName)) {
|
||||
cnd.orderBy(pageOrderName, PageUtil.getOrder(pageOrderBy));
|
||||
} else {
|
||||
cnd.desc("sub.location");
|
||||
}
|
||||
|
||||
cnd.groupBy("sub.id");
|
||||
|
||||
sql.setCondition(cnd);
|
||||
|
||||
return hdSubjectService.listPage(pageNumber, pageSize, sql);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package io.v.nutz.zhgh.hd.controller.zxdt;
|
||||
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.PageUtil;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_papers;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_subject;
|
||||
import io.v.nutz.zhgh.hd.services.HdPaperService;
|
||||
import io.v.nutz.zhgh.hd.services.HdSubjectReplyService;
|
||||
import io.v.nutz.zhgh.hd.services.HdSubjectService;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
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.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author: Aaron
|
||||
* @create: 2020-10-24 08:48
|
||||
* @description: 统计分析
|
||||
**/
|
||||
@At("/platform/hd/zxdt/result")
|
||||
@Ok("json:full")
|
||||
@IocBean
|
||||
@RequiresAuthentication
|
||||
public class ResultController {
|
||||
|
||||
@Inject
|
||||
private HdPaperService hdPaperService;
|
||||
|
||||
@Inject
|
||||
private HdSubjectService hdSubjectService;
|
||||
|
||||
@Inject
|
||||
private HdSubjectReplyService hdSubjectReplyService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/hd/zxdt/result.html")
|
||||
@RequiresPermissions("hd.zxdt.tj")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object pageData(Integer pageNumber, Integer pageSize, String searchName, String searchKeyword, String pageOrderName, String pageOrderBy) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("SELECT id, `name`, explain_txt, answer_num, fraction, answer_start_time, answer_end_time, create_time FROM hd_papers $condition");
|
||||
|
||||
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
|
||||
cnd.where().andLike(searchName, searchKeyword);
|
||||
}
|
||||
|
||||
if (Strings.isNotBlank(pageOrderName) && Strings.isNotBlank(pageOrderName)) {
|
||||
cnd.orderBy(pageOrderName, PageUtil.getOrder(pageOrderBy));
|
||||
} else {
|
||||
cnd.desc("create_time");
|
||||
}
|
||||
|
||||
sql.setCondition(cnd);
|
||||
return hdPaperService.listPage(pageNumber, pageSize, sql);
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object findOne(String id) {
|
||||
Map result = new HashMap();
|
||||
Hd_papers hd_papers = hdPaperService.fetchLinks(hdPaperService.fetch(id), "subjects", Cnd.NEW().asc("location"));
|
||||
List<Hd_subject> subjects = new ArrayList<>();
|
||||
hd_papers.getSubjects().forEach(v -> {
|
||||
subjects.add(hdSubjectService.fetchLinks(hdSubjectService.fetch(v.getId()), "answer", Cnd.NEW().asc("location")));
|
||||
});
|
||||
|
||||
hd_papers.setSubjects(subjects);
|
||||
result.put("hd_papers", hd_papers);
|
||||
|
||||
hd_papers.getSubjects().forEach(subject -> {
|
||||
Map map = new HashMap();
|
||||
|
||||
Sql yxs = Sqls.create("SELECT COUNT(DISTINCT reply.unique_id) \n" +
|
||||
"FROM hd_subject_reply reply\n" +
|
||||
"WHERE reply.answer_id IN (SELECT ans.id FROM hd_subject_answer ans WHERE ans.subject_id = @subject_id)\n" +
|
||||
"AND reply.papers_id = @papers_id").setParam("subject_id", subject.getId()).setParam("papers_id", id);
|
||||
|
||||
Sql sql = Sqls.create("SELECT answer_id,count(DISTINCT unique_id) num \n" +
|
||||
"FROM hd_subject_reply \n" +
|
||||
"WHERE subject_id = @subject_id \n" +
|
||||
"AND papers_id = @papers_id \n" +
|
||||
"GROUP BY answer_id").setParam("subject_id", subject.getId()).setParam("papers_id", id);
|
||||
|
||||
hdSubjectReplyService.list(sql).forEach(v -> {
|
||||
map.put(v.getString("answer_id"), v.getInt("num"));
|
||||
});
|
||||
|
||||
map.put("yxs", hdSubjectReplyService.count(yxs));
|
||||
|
||||
result.put(subject.getId(), map);
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
package io.v.nutz.zhgh.hd.controller.zxdt;
|
||||
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import cn.wizzer.framework.base.service.BaseService;
|
||||
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.zhgh.hd.models.Hd_subject;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_subject_answer;
|
||||
import io.v.nutz.zhgh.hd.services.HdPaperService;
|
||||
import io.v.nutz.zhgh.hd.services.HdSubjectAnswerService;
|
||||
import io.v.nutz.zhgh.hd.services.HdSubjectService;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
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.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: Aaron
|
||||
* @create: 2020-10-21 09:45
|
||||
* @description: 题库管理
|
||||
**/
|
||||
@At("/platform/hd/zxdt/subject")
|
||||
@Ok("json:full")
|
||||
@IocBean
|
||||
@RequiresAuthentication
|
||||
public class SubjectController {
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@Inject
|
||||
private HdPaperService hdPaperService;
|
||||
|
||||
@Inject
|
||||
private HdSubjectService hdSubjectService;
|
||||
|
||||
@Inject
|
||||
private HdSubjectAnswerService hdSubjectAnswerService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/hd/zxdt/subject.html")
|
||||
@RequiresPermissions("hd.zxdt.tk")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object pageData(Integer pageNumber, Integer pageSize, String type, String searchName, String searchKeyword, String pageOrderName, String pageOrderBy) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("SELECT id, `name`, type, create_time FROM hd_subject $condition");
|
||||
|
||||
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
|
||||
cnd.where().andLike(searchName, searchKeyword);
|
||||
}
|
||||
|
||||
if (Strings.isNotBlank(type)) {
|
||||
cnd.where().and("type", "=", type);
|
||||
}
|
||||
|
||||
if (Strings.isNotBlank(pageOrderName) && Strings.isNotBlank(pageOrderName)) {
|
||||
cnd.orderBy(pageOrderName, PageUtil.getOrder(pageOrderBy));
|
||||
} else {
|
||||
cnd.desc("location");
|
||||
}
|
||||
|
||||
sql.setCondition(cnd);
|
||||
return hdSubjectService.listPage(pageNumber, pageSize, sql);
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Object doAdd(@Param("subject") Hd_subject subject) {
|
||||
String time = DateUtil.getDate();
|
||||
|
||||
subject.setCreate_time(time);
|
||||
|
||||
for (Hd_subject_answer answer : subject.getAnswer()) {
|
||||
answer.setCreate_time(time);
|
||||
}
|
||||
hdSubjectService.insertWith(subject, "answer");
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Object doEdit(@Param("subject") Hd_subject subject, String[] delOption) {
|
||||
if (delOption.length > 0) {
|
||||
for (String s : delOption) {
|
||||
hdSubjectAnswerService.delete(s);
|
||||
}
|
||||
}
|
||||
|
||||
String time = DateUtil.getDate();
|
||||
for (Hd_subject_answer answer : subject.getAnswer()) {
|
||||
if (Strings.isBlank(answer.getSubject_id()) && Strings.isBlank(answer.getId())) {
|
||||
answer.setCreate_time(time);
|
||||
answer.setSubject_id(subject.getId());
|
||||
hdSubjectAnswerService.insert(answer);
|
||||
}
|
||||
}
|
||||
|
||||
hdSubjectService.updateWith(subject, "answer");
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Object delete(String id) {
|
||||
try {
|
||||
List<Record> records = hdPaperService.list(Sqls.create("SELECT `name` FROM hd_papers WHERE id IN (SELECT pid FROM `hd_papers_subject` WHERE sid = @sid )").setParam("sid", id));
|
||||
List<String> name = new ArrayList<>();
|
||||
if (records.size() > 0) {
|
||||
records.forEach(v -> {
|
||||
name.add(v.getString("name"));
|
||||
});
|
||||
return Result.error().addMsg("试卷 " + name + " 正在使用该题");
|
||||
}
|
||||
hdSubjectService.delete(id);
|
||||
hdSubjectAnswerService.clear(Cnd.where("subject_id", "=", id));
|
||||
return Result.success();
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object findOne(String id) {
|
||||
return hdSubjectService.fetchLinks(hdSubjectService.fetch(id), "answer", Cnd.NEW().asc("location"));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package io.v.nutz.zhgh.hd.controller.zxdt.mobile;
|
||||
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_papers;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_subject_reply;
|
||||
import io.v.nutz.zhgh.hd.services.HdSubjectAnswerService;
|
||||
import io.v.nutz.zhgh.hd.services.HdSubjectReplyService;
|
||||
import io.v.nutz.zhgh.hd.services.HdSubjectService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Attr;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
/**
|
||||
* @author: Aaron
|
||||
* @create: 2020-10-23 09:24
|
||||
* @description: 手机端答题
|
||||
**/
|
||||
@At("/platform/hd/zxdt/mobile/answer")
|
||||
@Ok("json:full")
|
||||
@IocBean
|
||||
public class MobileAnswerController {
|
||||
|
||||
@Inject
|
||||
private HdSubjectAnswerService hdSubjectAnswerService;
|
||||
|
||||
@Inject
|
||||
private HdSubjectService hdSubjectService;
|
||||
|
||||
@Inject
|
||||
private HdSubjectReplyService hdSubjectReplyService;
|
||||
|
||||
@Inject
|
||||
private Vi vi;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/hd/zxdt/mobile/mobile_answer.html")
|
||||
public void index(String papers_id, HttpSession session) {
|
||||
session.setAttribute("papers_id", papers_id);
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object doAdd(@Param("replyList") Hd_subject_reply[] replyList, HttpServletRequest request) {
|
||||
try {
|
||||
hdSubjectAnswerService.doAdd(replyList, String.valueOf(Vi.getCookie(request, "sid")));
|
||||
return Result.success();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
public Object findOne(@Attr("papers_id") String papers_id) {
|
||||
try {
|
||||
Hd_papers hd_papers = (Hd_papers) hdSubjectAnswerService.findOne(papers_id, (String) ShiroUtil.getPrincipalProperty("loginname"));
|
||||
return Result.success().addData(hd_papers);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,234 @@
|
||||
package io.v.nutz.zhgh.hd.models;
|
||||
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author JyuHsin
|
||||
* @Date 2022/4/22
|
||||
* @Description 打卡签到活动
|
||||
*/
|
||||
@Table("hd_checkin")
|
||||
public class HdCheckIn implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@Prev(els = {@EL("uuid()")})
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String hdid;
|
||||
|
||||
@Column
|
||||
@Comment("活动名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String hdname;
|
||||
|
||||
@Column
|
||||
@Comment("月打卡率")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
private String rate;
|
||||
|
||||
@Column
|
||||
@Comment("活动介绍")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String hdjs;
|
||||
|
||||
@Column
|
||||
@Comment("参加人员")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String hdcjry;
|
||||
|
||||
@Column
|
||||
@Comment("奖励方式")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String hdjlfs;
|
||||
|
||||
@Column
|
||||
@Comment("活动内容")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String hdnr;
|
||||
|
||||
@Column
|
||||
@Comment("活动联系人")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String hdlxr;
|
||||
|
||||
@Column
|
||||
@Comment("其他")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String hdother;
|
||||
|
||||
@Column
|
||||
@Comment("活动开始时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String hdkssj;
|
||||
|
||||
@Column
|
||||
@Comment("活动结束时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String hdjssj;
|
||||
|
||||
@Column
|
||||
@Comment("活动状态 (开启 关闭)")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean hdflag;
|
||||
|
||||
@Column
|
||||
@Comment("活动创建人")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String hdcjr;
|
||||
|
||||
@Column
|
||||
@Comment("活动创建时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String hdcjsj;
|
||||
|
||||
@Column
|
||||
@Comment("配色")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String hdcolor;
|
||||
|
||||
private List<Hd_wm_bgi> bgis;
|
||||
|
||||
private List<HdCheckinFile> files;
|
||||
|
||||
public List<HdCheckinFile> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<HdCheckinFile> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
public String getRate() {
|
||||
return rate;
|
||||
}
|
||||
|
||||
public void setRate(String rate) {
|
||||
this.rate = rate;
|
||||
}
|
||||
|
||||
public List<Hd_wm_bgi> getBgis() {
|
||||
return bgis;
|
||||
}
|
||||
|
||||
public void setBgis(List<Hd_wm_bgi> bgis) {
|
||||
this.bgis = bgis;
|
||||
}
|
||||
|
||||
public String getHdid() {
|
||||
return hdid;
|
||||
}
|
||||
|
||||
public void setHdid(String hdid) {
|
||||
this.hdid = hdid;
|
||||
}
|
||||
|
||||
public String getHdname() {
|
||||
return hdname;
|
||||
}
|
||||
|
||||
public void setHdname(String hdname) {
|
||||
this.hdname = hdname;
|
||||
}
|
||||
|
||||
public String getHdjs() {
|
||||
return hdjs;
|
||||
}
|
||||
|
||||
public void setHdjs(String hdjs) {
|
||||
this.hdjs = hdjs;
|
||||
}
|
||||
|
||||
public String getHdcjry() {
|
||||
return hdcjry;
|
||||
}
|
||||
|
||||
public void setHdcjry(String hdcjry) {
|
||||
this.hdcjry = hdcjry;
|
||||
}
|
||||
|
||||
public String getHdjlfs() {
|
||||
return hdjlfs;
|
||||
}
|
||||
|
||||
public void setHdjlfs(String hdjlfs) {
|
||||
this.hdjlfs = hdjlfs;
|
||||
}
|
||||
|
||||
public String getHdnr() {
|
||||
return hdnr;
|
||||
}
|
||||
|
||||
public void setHdnr(String hdnr) {
|
||||
this.hdnr = hdnr;
|
||||
}
|
||||
|
||||
public String getHdlxr() {
|
||||
return hdlxr;
|
||||
}
|
||||
|
||||
public void setHdlxr(String hdlxr) {
|
||||
this.hdlxr = hdlxr;
|
||||
}
|
||||
|
||||
public String getHdother() {
|
||||
return hdother;
|
||||
}
|
||||
|
||||
public void setHdother(String hdother) {
|
||||
this.hdother = hdother;
|
||||
}
|
||||
|
||||
public String getHdkssj() {
|
||||
return hdkssj;
|
||||
}
|
||||
|
||||
public void setHdkssj(String hdkssj) {
|
||||
this.hdkssj = hdkssj;
|
||||
}
|
||||
|
||||
public String getHdjssj() {
|
||||
return hdjssj;
|
||||
}
|
||||
|
||||
public void setHdjssj(String hdjssj) {
|
||||
this.hdjssj = hdjssj;
|
||||
}
|
||||
|
||||
public Boolean getHdflag() {
|
||||
return hdflag;
|
||||
}
|
||||
|
||||
public void setHdflag(Boolean hdflag) {
|
||||
this.hdflag = hdflag;
|
||||
}
|
||||
|
||||
public String getHdcjr() {
|
||||
return hdcjr;
|
||||
}
|
||||
|
||||
public void setHdcjr(String hdcjr) {
|
||||
this.hdcjr = hdcjr;
|
||||
}
|
||||
|
||||
public String getHdcjsj() {
|
||||
return hdcjsj;
|
||||
}
|
||||
|
||||
public void setHdcjsj(String hdcjsj) {
|
||||
this.hdcjsj = hdcjsj;
|
||||
}
|
||||
|
||||
public String getHdcolor() {
|
||||
return hdcolor;
|
||||
}
|
||||
|
||||
public void setHdcolor(String hdcolor) {
|
||||
this.hdcolor = hdcolor;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package io.v.nutz.zhgh.hd.models;
|
||||
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Author JyuHsin
|
||||
* @Date 2022/4/22
|
||||
* @Description
|
||||
*/
|
||||
@Table("hd_checkin_zan")
|
||||
public class HdCheckZan implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@Prev(els = {@EL("uuid()")})
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("活动id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String hdid;
|
||||
|
||||
@Column
|
||||
@Comment("打卡内容id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String contentId;
|
||||
|
||||
@Column
|
||||
@Comment("点赞人id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userid;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getHdid() {
|
||||
return hdid;
|
||||
}
|
||||
|
||||
public void setHdid(String hdid) {
|
||||
this.hdid = hdid;
|
||||
}
|
||||
|
||||
public String getContentId() {
|
||||
return contentId;
|
||||
}
|
||||
|
||||
public void setContentId(String contentId) {
|
||||
this.contentId = contentId;
|
||||
}
|
||||
|
||||
public String getUserid() {
|
||||
return userid;
|
||||
}
|
||||
|
||||
public void setUserid(String userid) {
|
||||
this.userid = userid;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package io.v.nutz.zhgh.hd.models;
|
||||
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Author JyuHsin
|
||||
* @Date 2022/4/22
|
||||
* @Description
|
||||
*/
|
||||
@Table("hd_checkin_content")
|
||||
public class HdCheckinContent implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@Prev(els = {@EL("uuid()")})
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("活动id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String hdid;
|
||||
|
||||
@Column
|
||||
@Comment("打卡内容")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String content;
|
||||
|
||||
@Column
|
||||
@Comment("打卡人")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userid;
|
||||
|
||||
@Column
|
||||
@Comment("打卡时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String time;
|
||||
|
||||
@Column
|
||||
@Comment("是否公开")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean isOpen;
|
||||
|
||||
public String getUserid() {
|
||||
return userid;
|
||||
}
|
||||
|
||||
public void setUserid(String userid) {
|
||||
this.userid = userid;
|
||||
}
|
||||
|
||||
public String getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(String time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getHdid() {
|
||||
return hdid;
|
||||
}
|
||||
|
||||
public void setHdid(String hdid) {
|
||||
this.hdid = hdid;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public Boolean getOpen() {
|
||||
return isOpen;
|
||||
}
|
||||
|
||||
public void setOpen(Boolean open) {
|
||||
isOpen = open;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package io.v.nutz.zhgh.hd.models;
|
||||
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Author JyuHsin
|
||||
* @Date 2022/4/22
|
||||
* @Description
|
||||
*/
|
||||
@Table("hd_checkin_file")
|
||||
public class HdCheckinFile implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@Prev(els = {@EL("uuid()")})
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("活动id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String hdid;
|
||||
|
||||
@Column
|
||||
@Comment("打卡内容id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String contentId;
|
||||
|
||||
@Column
|
||||
@Comment("附件路径")
|
||||
@ColDefine(type = ColType.VARCHAR,width = 200)
|
||||
private String url;
|
||||
|
||||
@Column
|
||||
@Comment("附件名称")
|
||||
@ColDefine(type = ColType.VARCHAR,width = 100)
|
||||
private String name;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getHdid() {
|
||||
return hdid;
|
||||
}
|
||||
|
||||
public void setHdid(String hdid) {
|
||||
this.hdid = hdid;
|
||||
}
|
||||
|
||||
public String getContentId() {
|
||||
return contentId;
|
||||
}
|
||||
|
||||
public void setContentId(String contentId) {
|
||||
this.contentId = contentId;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
package io.v.nutz.zhgh.hd.models;
|
||||
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Author: V
|
||||
* @Date: 2020/5/15 9:18
|
||||
* @Description: 六一儿童节作品征集
|
||||
*/
|
||||
@Table("Hd_ca_sbxx")
|
||||
@TableIndexes({@Index(name = "INDEX_HDCASB_HBSBRID", fields = {"sbr"}, unique = false)})
|
||||
public class Hd_ca_sbxx implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Column
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Prev(els = {@EL("uuid()")})
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("活动id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String hdid;
|
||||
|
||||
@Column
|
||||
@Comment("活动类别")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String hdlb;
|
||||
|
||||
@Column
|
||||
@Comment("作品类别")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String zplb;
|
||||
|
||||
@Column
|
||||
@Comment("上报人id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String sbr;
|
||||
|
||||
@Column
|
||||
@Comment("手机号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String mobile;
|
||||
|
||||
@Column
|
||||
@Comment("子女姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String znxm;
|
||||
|
||||
@Column
|
||||
@Comment("子女年龄")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer znnl;
|
||||
|
||||
@Column
|
||||
@Comment("子女性别")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 2)
|
||||
private String znxb;
|
||||
|
||||
@Column
|
||||
@Comment("子女关系")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
private String zngx;
|
||||
|
||||
@Column
|
||||
@Comment("作品主题")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String zpzt;
|
||||
|
||||
@Column
|
||||
@Comment("作品描述/介绍")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String zpms;
|
||||
|
||||
@Column
|
||||
@Comment("上报时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String sbsj;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getHdid() {
|
||||
return hdid;
|
||||
}
|
||||
|
||||
public void setHdid(String hdid) {
|
||||
this.hdid = hdid;
|
||||
}
|
||||
|
||||
public String getSbr() {
|
||||
return sbr;
|
||||
}
|
||||
|
||||
public void setSbr(String sbr) {
|
||||
this.sbr = sbr;
|
||||
}
|
||||
|
||||
public String getMobile() {
|
||||
return mobile;
|
||||
}
|
||||
|
||||
public void setMobile(String mobile) {
|
||||
this.mobile = mobile;
|
||||
}
|
||||
|
||||
public String getZnxm() {
|
||||
return znxm;
|
||||
}
|
||||
|
||||
public void setZnxm(String znxm) {
|
||||
this.znxm = znxm;
|
||||
}
|
||||
|
||||
public Integer getZnnl() {
|
||||
return znnl;
|
||||
}
|
||||
|
||||
public void setZnnl(Integer znnl) {
|
||||
this.znnl = znnl;
|
||||
}
|
||||
|
||||
public String getZnxb() {
|
||||
return znxb;
|
||||
}
|
||||
|
||||
public void setZnxb(String znxb) {
|
||||
this.znxb = znxb;
|
||||
}
|
||||
|
||||
public String getZngx() {
|
||||
return zngx;
|
||||
}
|
||||
|
||||
public void setZngx(String zngx) {
|
||||
this.zngx = zngx;
|
||||
}
|
||||
|
||||
public String getZpzt() {
|
||||
return zpzt;
|
||||
}
|
||||
|
||||
public void setZpzt(String zpzt) {
|
||||
this.zpzt = zpzt;
|
||||
}
|
||||
|
||||
public String getHdlb() {
|
||||
return hdlb;
|
||||
}
|
||||
|
||||
public void setHdlb(String hdlb) {
|
||||
this.hdlb = hdlb;
|
||||
}
|
||||
|
||||
public String getZplb() {
|
||||
return zplb;
|
||||
}
|
||||
|
||||
public void setZplb(String zplb) {
|
||||
this.zplb = zplb;
|
||||
}
|
||||
|
||||
public String getZpms() {
|
||||
return zpms;
|
||||
}
|
||||
|
||||
public void setZpms(String zpms) {
|
||||
this.zpms = zpms;
|
||||
}
|
||||
|
||||
public String getSbsj() {
|
||||
return sbsj;
|
||||
}
|
||||
|
||||
public void setSbsj(String sbsj) {
|
||||
this.sbsj = sbsj;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package io.v.nutz.zhgh.hd.models;
|
||||
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Table("Hd_ca_sbxx_fj")
|
||||
@TableIndexes({@Index(name = "INDEX_HDCASB_FJ_SBID", fields = {"hdsbid"}, unique = false)})
|
||||
public class Hd_ca_sbxx_fj implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Column
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Prev(els = {@EL("uuid()")})
|
||||
private String fjid;
|
||||
|
||||
@Column
|
||||
@Comment("上报id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String hdsbid;
|
||||
|
||||
@Column
|
||||
@Comment("附件路径")
|
||||
@ColDefine(type = ColType.VARCHAR,width = 200)
|
||||
private String fjurl;
|
||||
|
||||
@Column
|
||||
@Comment("附件名称")
|
||||
@ColDefine(type = ColType.VARCHAR,width = 100)
|
||||
private String fjname;
|
||||
|
||||
|
||||
public String getFjid() {
|
||||
return fjid;
|
||||
}
|
||||
|
||||
public void setFjid(String fjid) {
|
||||
this.fjid = fjid;
|
||||
}
|
||||
|
||||
public String getHdsbid() {
|
||||
return hdsbid;
|
||||
}
|
||||
|
||||
public void setHdsbid(String hdsbid) {
|
||||
this.hdsbid = hdsbid;
|
||||
}
|
||||
|
||||
public String getFjurl() {
|
||||
return fjurl;
|
||||
}
|
||||
|
||||
public void setFjurl(String fjurl) {
|
||||
this.fjurl = fjurl;
|
||||
}
|
||||
|
||||
public String getFjname() {
|
||||
return fjname;
|
||||
}
|
||||
|
||||
public void setFjname(String fjname) {
|
||||
this.fjname = fjname;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package io.v.nutz.zhgh.hd.models;
|
||||
|
||||
import cn.wizzer.framework.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.integration.json4excel.annotation.J4EIgnore;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: Aaron
|
||||
* @create: 2020-10-21 16:43
|
||||
* @description: 试卷
|
||||
**/
|
||||
|
||||
@Data
|
||||
@Table("hd_papers")
|
||||
public class Hd_papers extends BaseModel {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Prev(els = {@EL("uuid()")})
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("试卷名称")
|
||||
@J4EIgnore
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String name;
|
||||
|
||||
@Column
|
||||
@Comment("说明")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String explain_txt;
|
||||
|
||||
@Column
|
||||
@Comment("分数")
|
||||
@ColDefine(type = ColType.INT, width = 3)
|
||||
private Integer fraction;
|
||||
|
||||
@Column
|
||||
@Comment("每日可答次数")
|
||||
@ColDefine(type = ColType.INT, width = 2)
|
||||
private Integer answer_num;
|
||||
|
||||
@Column
|
||||
@Comment("每日开始答题时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String answer_start_time;
|
||||
|
||||
@Column
|
||||
@Comment("每日结束答题时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String answer_end_time;
|
||||
|
||||
@Column
|
||||
@Comment("创建时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String create_time;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("活动创建人")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String hdcjr;
|
||||
|
||||
@ManyMany(relation = "hd_papers_subject", from = "pid", to = "sid")
|
||||
private List<Hd_subject> subjects;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package io.v.nutz.zhgh.hd.models;
|
||||
|
||||
import cn.wizzer.framework.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import org.nutz.dao.DB;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.integration.json4excel.annotation.J4EIgnore;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: Aaron
|
||||
* @create: 2020-10-21 09:56
|
||||
* @description: 题目
|
||||
**/
|
||||
|
||||
@Data
|
||||
@Table("hd_subject")
|
||||
public class Hd_subject extends BaseModel {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Prev(els = {@EL("uuid()")})
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("题名")
|
||||
@J4EIgnore
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String name;
|
||||
|
||||
@Column
|
||||
@Comment("题型 (1.单选 2.多选 3.填空)")
|
||||
@J4EIgnore
|
||||
@ColDefine(type = ColType.INT, width = 2)
|
||||
private Integer type;
|
||||
|
||||
@Column
|
||||
@Comment("创建时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String create_time;
|
||||
|
||||
@Column
|
||||
@Comment("排序字段")
|
||||
@Prev({
|
||||
@SQL(db = DB.MYSQL, value = "SELECT IFNULL(MAX(location),0)+1 FROM hd_subject"),
|
||||
@SQL(db = DB.ORACLE, value = "SELECT COALESCE(MAX(location),0)+1 FROM hd_subject")
|
||||
})
|
||||
private Integer location;
|
||||
|
||||
@Many(field = "subject_id")
|
||||
private List<Hd_subject_answer> answer;
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package io.v.nutz.zhgh.hd.models;
|
||||
|
||||
import cn.wizzer.framework.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import org.nutz.dao.DB;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.integration.json4excel.annotation.J4EIgnore;
|
||||
|
||||
/**
|
||||
* @author: Aaron
|
||||
* @create: 2020-10-21 10:04
|
||||
* @description: 答案
|
||||
**/
|
||||
|
||||
@Data
|
||||
@Table("hd_subject_answer")
|
||||
public class Hd_subject_answer extends BaseModel {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Prev(els = {@EL("uuid()")})
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("所属题目")
|
||||
@J4EIgnore
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String subject_id;
|
||||
|
||||
@Column
|
||||
@Comment("选项文字")
|
||||
@J4EIgnore
|
||||
@ColDefine(type = ColType.VARCHAR, width = 200)
|
||||
private String option_txt;
|
||||
|
||||
@Column
|
||||
@Comment("是否正确答案")
|
||||
@J4EIgnore
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean is_yes;
|
||||
|
||||
@Column
|
||||
@Comment("创建时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String create_time;
|
||||
|
||||
@Column
|
||||
@Comment("排序字段")
|
||||
@Prev({
|
||||
@SQL(db = DB.MYSQL, value = "SELECT IFNULL(MAX(location),0)+1 FROM hd_subject_answer"),
|
||||
@SQL(db = DB.ORACLE, value = "SELECT COALESCE(MAX(location),0)+1 FROM hd_subject_answer")
|
||||
})
|
||||
private Integer location;
|
||||
|
||||
@One(field = "subject_id", key = "id")
|
||||
private Hd_subject subject;
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package io.v.nutz.zhgh.hd.models;
|
||||
|
||||
import cn.wizzer.framework.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import org.nutz.dao.DB;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
|
||||
/**
|
||||
* @author: Aaron
|
||||
* @create: 2020-10-23 09:30
|
||||
* @description: 提交的试卷
|
||||
**/
|
||||
|
||||
@Data
|
||||
@Table("hd_subject_reply")
|
||||
public class Hd_subject_reply extends BaseModel {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Prev(els = {@EL("uuid()")})
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("所属试卷")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String papers_id;
|
||||
|
||||
@Column
|
||||
@Comment("所属题目")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String subject_id;
|
||||
|
||||
@Column
|
||||
@Comment("所选答案")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String answer_id;
|
||||
|
||||
@Column
|
||||
@Comment("唯一id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String unique_id;
|
||||
|
||||
@Column
|
||||
@Comment("提交时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String submit_time;
|
||||
|
||||
@Column
|
||||
@Comment("排序字段")
|
||||
@Prev({
|
||||
@SQL(db = DB.MYSQL, value = "SELECT IFNULL(MAX(location),0)+1 FROM Hd_subject_reply"),
|
||||
@SQL(db = DB.ORACLE, value = "SELECT COALESCE(MAX(location),0)+1 FROM Hd_subject_reply")
|
||||
})
|
||||
private Integer location;
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package io.v.nutz.zhgh.hd.models;
|
||||
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Created by lyw on 2020/3/13 11:10
|
||||
* 三八活动封面图
|
||||
*/
|
||||
@Table("Hd_wm_bgi")
|
||||
public class Hd_wm_bgi implements Serializable {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@Prev(els = {@EL("uuid()")})
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String iid;
|
||||
|
||||
@Column
|
||||
@Comment("活动id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String ihdid;
|
||||
|
||||
@Column
|
||||
@Comment("图片地址")
|
||||
@ColDefine(type = ColType.VARCHAR,width = 200)
|
||||
private String iurl;
|
||||
|
||||
public String getIid() {
|
||||
return iid;
|
||||
}
|
||||
|
||||
public void setIid(String iid) {
|
||||
this.iid = iid;
|
||||
}
|
||||
|
||||
public String getIhdid() {
|
||||
return ihdid;
|
||||
}
|
||||
|
||||
public void setIhdid(String ihdid) {
|
||||
this.ihdid = ihdid;
|
||||
}
|
||||
|
||||
public String getIurl() {
|
||||
return iurl;
|
||||
}
|
||||
|
||||
public void setIurl(String iurl) {
|
||||
this.iurl = iurl;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package io.v.nutz.zhgh.hd.models;
|
||||
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by lyw on 2020/3/13 11:10
|
||||
* 三八活动类别
|
||||
*/
|
||||
@Table("Hd_wm_lb")
|
||||
public class Hd_wm_lb implements Serializable {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@Prev(els = {@EL("uuid()")})
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String lid;
|
||||
|
||||
@Column
|
||||
@Comment("活动id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String lhdid;
|
||||
|
||||
@Column
|
||||
@Comment("名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String lname;
|
||||
|
||||
@Column
|
||||
@Comment("排序")
|
||||
@ColDefine(type = ColType.INT, width = 4)
|
||||
private int llocation;
|
||||
|
||||
private List<Hd_wm_zplb> zplbs;
|
||||
|
||||
public List<Hd_wm_zplb> getZplbs() {
|
||||
return zplbs;
|
||||
}
|
||||
|
||||
public void setZplbs(List<Hd_wm_zplb> zplbs) {
|
||||
this.zplbs = zplbs;
|
||||
}
|
||||
|
||||
public String getLid() {
|
||||
return lid;
|
||||
}
|
||||
|
||||
public void setLid(String lid) {
|
||||
this.lid = lid;
|
||||
}
|
||||
|
||||
public String getLhdid() {
|
||||
return lhdid;
|
||||
}
|
||||
|
||||
public void setLhdid(String lhdid) {
|
||||
this.lhdid = lhdid;
|
||||
}
|
||||
|
||||
public String getLname() {
|
||||
return lname;
|
||||
}
|
||||
|
||||
public void setLname(String lname) {
|
||||
this.lname = lname;
|
||||
}
|
||||
|
||||
public int getLlocation() {
|
||||
return llocation;
|
||||
}
|
||||
|
||||
public void setLlocation(int llocation) {
|
||||
this.llocation = llocation;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package io.v.nutz.zhgh.hd.models;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@Table("Hd_wm_sbxx")
|
||||
@TableIndexes({@Index(name = "INDEX_HDWMSB_HBSBRID", fields = {"hdsbrid"}, unique = false)})
|
||||
public class Hd_wm_sbxx implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Column
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Prev(els = {@EL("uuid()")})
|
||||
private String id;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("活动id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String hdid;
|
||||
|
||||
@Column
|
||||
@Comment("上报人id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String hdsbrid;
|
||||
|
||||
@Column
|
||||
@Comment("作品主题")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String hdsbzpzt;
|
||||
|
||||
@Column
|
||||
@Comment("作品类型(1 巾帼担当行 2 巾帼温馨行)")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String hdzplx;
|
||||
|
||||
@Column
|
||||
@Comment("巾帼温馨行(1 风采风貌 2 温馨生活 3 烹饪乐趣 4 创意手工)")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String hdzplx2;
|
||||
|
||||
@Column
|
||||
@Comment("作品描述")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String hdsbzpms;
|
||||
|
||||
@Column
|
||||
@Comment("作品名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String zpmc;
|
||||
|
||||
@Column
|
||||
@Comment("上报时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String hdsbsj;
|
||||
|
||||
@Column
|
||||
@Comment("手机号码")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String mobile;
|
||||
|
||||
@Column
|
||||
@Comment("状态")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String auditState;
|
||||
|
||||
@Column
|
||||
@Comment("分工会审核id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionAuditId;
|
||||
|
||||
@Column
|
||||
@Comment("校工会审核id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String schoolAuditId;
|
||||
|
||||
@Column
|
||||
@Comment("是否发送系统消息")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean xlFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package io.v.nutz.zhgh.hd.models;
|
||||
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Table("Hd_wm_sbxx_fj")
|
||||
@TableIndexes({@Index(name = "INDEX_HDWMSB_FJ_HBSBID", fields = {"hdsbid"}, unique = false)})
|
||||
public class Hd_wm_sbxx_fj implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Column
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Prev(els = {@EL("uuid()")})
|
||||
private String fjid;
|
||||
|
||||
@Column
|
||||
@Comment("上报id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String hdsbid;
|
||||
|
||||
@Column
|
||||
@Comment("附件路径")
|
||||
@ColDefine(type = ColType.VARCHAR,width = 200)
|
||||
private String fjurl;
|
||||
|
||||
@Column
|
||||
@Comment("附件名称")
|
||||
@ColDefine(type = ColType.VARCHAR,width = 100)
|
||||
private String fjname;
|
||||
|
||||
public String getFjid() {
|
||||
return fjid;
|
||||
}
|
||||
|
||||
public void setFjid(String fjid) {
|
||||
this.fjid = fjid;
|
||||
}
|
||||
|
||||
public String getHdsbid() {
|
||||
return hdsbid;
|
||||
}
|
||||
|
||||
public void setHdsbid(String hdsbid) {
|
||||
this.hdsbid = hdsbid;
|
||||
}
|
||||
|
||||
public String getFjurl() {
|
||||
return fjurl;
|
||||
}
|
||||
|
||||
public void setFjurl(String fjurl) {
|
||||
this.fjurl = fjurl;
|
||||
}
|
||||
|
||||
public String getFjname() {
|
||||
return fjname;
|
||||
}
|
||||
|
||||
public void setFjname(String fjname) {
|
||||
this.fjname = fjname;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package io.v.nutz.zhgh.hd.models;
|
||||
|
||||
import io.v.nutz.sys.models.Sys_file;
|
||||
import lombok.Data;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Table("Hd_wm_xx")
|
||||
public class Hd_wm_xx implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@Prev(els = {@EL("uuid()")})
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String hdid;
|
||||
|
||||
@Column
|
||||
@Comment("活动名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String hdname;
|
||||
|
||||
@Column
|
||||
@Comment("活动介绍")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String hdjs;
|
||||
|
||||
@Column
|
||||
@Comment("参加人员")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String hdcjry;
|
||||
|
||||
@Column
|
||||
@Comment("奖励方式")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String hdjlfs;
|
||||
|
||||
@Column
|
||||
@Comment("活动内容")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String hdnr;
|
||||
|
||||
@Column
|
||||
@Comment("活动联系人")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String hdlxr;
|
||||
|
||||
@Column
|
||||
@Comment("其他")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String hdother;
|
||||
|
||||
@Column
|
||||
@Comment("活动开始时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String hdkssj;
|
||||
|
||||
@Column
|
||||
@Comment("活动结束时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String hdjssj;
|
||||
|
||||
@Column
|
||||
@Comment("活动状态 (开启 关闭)")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean hdflag;
|
||||
|
||||
@Column
|
||||
@Comment("活动创建人")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String hdcjr;
|
||||
|
||||
@Column
|
||||
@Comment("活动创建时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String hdcjsj;
|
||||
|
||||
@Column
|
||||
@Comment("配色")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String hdcolor;
|
||||
@Column
|
||||
@Comment("活动范围Id")
|
||||
@ColDefine(type = ColType.INT, width = 32)
|
||||
private Integer activityGroupId;
|
||||
|
||||
@Column
|
||||
@Comment("活动范围名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 40)
|
||||
private String activityGroupName;
|
||||
|
||||
@Column
|
||||
@Comment("活动类型(1 教工 2 亲子)")
|
||||
@ColDefine(type = ColType.INT, width = 1)
|
||||
private Integer hdtype;
|
||||
|
||||
private List<Hd_wm_lb> lbs;
|
||||
|
||||
private List<Hd_wm_bgi> bgis;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("附件信息")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<Sys_file> files;
|
||||
|
||||
@Column
|
||||
@Comment("是否发送系统消息")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean xlFlag;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package io.v.nutz.zhgh.hd.models;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by lyw on 2020/3/13 11:10
|
||||
* 三八活动作品类别
|
||||
*/
|
||||
@Data
|
||||
@Table("Hd_wm_zplb")
|
||||
public class Hd_wm_zplb implements Serializable {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@Prev(els = {@EL("uuid()")})
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String zid;
|
||||
|
||||
@Column
|
||||
@Comment("类别id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String zlid;
|
||||
|
||||
@Column
|
||||
@Comment("名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String zname;
|
||||
|
||||
@Column
|
||||
@Comment("作品介绍最多字数")
|
||||
@ColDefine(type = ColType.INT, width = 20)
|
||||
private Integer maxWordCount;
|
||||
|
||||
@Column
|
||||
@Comment("是否上传图片")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean isUploadPhoto;
|
||||
|
||||
@Column
|
||||
@Comment("上传图片数量")
|
||||
@ColDefine(type = ColType.INT, width = 10)
|
||||
private Integer photoNum;
|
||||
|
||||
@Column
|
||||
@Comment("上传图片格式")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<String> photoType;
|
||||
|
||||
@Column
|
||||
@Comment("每张图片大小")
|
||||
@ColDefine(type = ColType.INT, width = 10)
|
||||
private Integer photoSize;
|
||||
|
||||
@Column
|
||||
@Comment("是否上传音/视频、文档")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean isUploadOther;
|
||||
|
||||
@Column
|
||||
@Comment("上传音/视频、文档数量")
|
||||
@ColDefine(type = ColType.INT, width = 10)
|
||||
private Integer otherFileNum;
|
||||
|
||||
@Column
|
||||
@Comment("上传音/视频、文档格式")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<String> otherType;
|
||||
|
||||
@Column
|
||||
@Comment("每个音/视频、文档大小")
|
||||
@ColDefine(type = ColType.INT, width = 10)
|
||||
private Integer otherSize;
|
||||
|
||||
@Column
|
||||
@Comment("排序")
|
||||
@ColDefine(type = ColType.INT, width = 4)
|
||||
private int zlocation;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package io.v.nutz.zhgh.hd.services;
|
||||
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.zhgh.hd.models.HdCheckinContent;
|
||||
|
||||
/**
|
||||
* @Author JyuHsin
|
||||
* @Date 2022/4/22
|
||||
* @Description
|
||||
*/
|
||||
public interface CheckinContentService extends BaseService<HdCheckinContent> {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package io.v.nutz.zhgh.hd.services;
|
||||
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.zhgh.hd.models.HdCheckinFile;
|
||||
|
||||
/**
|
||||
* @Author JyuHsin
|
||||
* @Date 2022/4/24
|
||||
* @Description
|
||||
*/
|
||||
public interface CheckinFileService extends BaseService<HdCheckinFile> {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package io.v.nutz.zhgh.hd.services;
|
||||
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.zhgh.hd.models.HdCheckIn;
|
||||
|
||||
/**
|
||||
* @Author JyuHsin
|
||||
* @Date 2022/4/22
|
||||
* @Description
|
||||
*/
|
||||
public interface CheckinService extends BaseService<HdCheckIn> {
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package io.v.nutz.zhgh.hd.services;
|
||||
|
||||
|
||||
import cn.wizzer.framework.base.service.BaseService;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_ca_sbxx_fj;
|
||||
|
||||
public interface HdCasbxxFjService extends BaseService<Hd_ca_sbxx_fj> {
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package io.v.nutz.zhgh.hd.services;
|
||||
|
||||
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_ca_sbxx;
|
||||
|
||||
public interface HdCasbxxService extends BaseService<Hd_ca_sbxx> {
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package io.v.nutz.zhgh.hd.services;
|
||||
|
||||
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_papers;
|
||||
|
||||
public interface HdPaperService extends BaseService<Hd_papers> {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package io.v.nutz.zhgh.hd.services;
|
||||
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_subject_answer;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_subject_reply;
|
||||
|
||||
public interface HdSubjectAnswerService extends BaseService<Hd_subject_answer> {
|
||||
|
||||
void doAdd(Hd_subject_reply[] replyList, String unique_id) throws Exception;
|
||||
|
||||
Object findOne(String id, String unique_id) throws Exception;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package io.v.nutz.zhgh.hd.services;
|
||||
|
||||
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_subject_reply;
|
||||
|
||||
public interface HdSubjectReplyService extends BaseService<Hd_subject_reply> {
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package io.v.nutz.zhgh.hd.services;
|
||||
|
||||
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_subject;
|
||||
|
||||
public interface HdSubjectService extends BaseService<Hd_subject> {
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package io.v.nutz.zhgh.hd.services;
|
||||
|
||||
|
||||
import cn.wizzer.framework.base.service.BaseService;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_wm_bgi;
|
||||
|
||||
public interface HdWmBgiService extends BaseService<Hd_wm_bgi> {
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package io.v.nutz.zhgh.hd.services;
|
||||
|
||||
|
||||
import cn.wizzer.framework.base.service.BaseService;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_wm_lb;
|
||||
|
||||
public interface HdWmLbService extends BaseService<Hd_wm_lb> {
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package io.v.nutz.zhgh.hd.services;
|
||||
|
||||
|
||||
import cn.wizzer.framework.base.service.BaseService;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_wm_zplb;
|
||||
|
||||
public interface HdWmZplbService extends BaseService<Hd_wm_zplb> {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package io.v.nutz.zhgh.hd.services;
|
||||
|
||||
import io.v.nutz.zhgh.hd.models.Hd_wm_sbxx;
|
||||
import io.v.nutz.base.service.ViService;
|
||||
|
||||
public interface HdWmsbxxService extends ViService<Hd_wm_sbxx> {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package io.v.nutz.zhgh.hd.services;
|
||||
|
||||
import cn.wizzer.framework.base.service.BaseService;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_wm_sbxx_fj;
|
||||
|
||||
public interface HdWmsbxxfjService extends BaseService<Hd_wm_sbxx_fj> {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package io.v.nutz.zhgh.hd.services;
|
||||
|
||||
import cn.wizzer.framework.base.service.BaseService;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_wm_xx;
|
||||
|
||||
public interface HdWmxxService extends BaseService<Hd_wm_xx> {
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package io.v.nutz.zhgh.hd.services.impl;
|
||||
|
||||
import io.v.nutz.base.service.impl.BaseServiceImpl;
|
||||
import io.v.nutz.zhgh.hd.models.HdCheckinContent;
|
||||
import io.v.nutz.zhgh.hd.services.CheckinContentService;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.plugins.wkcache.annotation.CacheDefaults;
|
||||
|
||||
/**
|
||||
* @Author JyuHsin
|
||||
* @Date 2022/4/22
|
||||
* @Description
|
||||
*/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
@CacheDefaults(cacheName = "hd_checkin_content")
|
||||
public class CheckinContentServiceImpl extends BaseServiceImpl<HdCheckinContent> implements CheckinContentService {
|
||||
|
||||
public CheckinContentServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package io.v.nutz.zhgh.hd.services.impl;
|
||||
|
||||
import io.v.nutz.base.service.impl.BaseServiceImpl;
|
||||
import io.v.nutz.zhgh.hd.models.HdCheckinFile;
|
||||
import io.v.nutz.zhgh.hd.services.CheckinFileService;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.plugins.wkcache.annotation.CacheDefaults;
|
||||
|
||||
/**
|
||||
* @Author JyuHsin
|
||||
* @Date 2022/4/24
|
||||
* @Description
|
||||
*/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
@CacheDefaults(cacheName = "hd_checkin_file")
|
||||
public class CheckinFileServiceImpl extends BaseServiceImpl<HdCheckinFile> implements CheckinFileService {
|
||||
|
||||
public CheckinFileServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package io.v.nutz.zhgh.hd.services.impl;
|
||||
|
||||
import io.v.nutz.base.service.impl.BaseServiceImpl;
|
||||
import io.v.nutz.zhgh.hd.models.HdCheckIn;
|
||||
import io.v.nutz.zhgh.hd.services.CheckinService;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.plugins.wkcache.annotation.CacheDefaults;
|
||||
|
||||
/**
|
||||
* @Author JyuHsin
|
||||
* @Date 2022/4/22
|
||||
* @Description
|
||||
*/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
@CacheDefaults(cacheName = "hd_checkin")
|
||||
public class CheckinServiceImpl extends BaseServiceImpl<HdCheckIn> implements CheckinService {
|
||||
|
||||
public CheckinServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package io.v.nutz.zhgh.hd.services.impl;
|
||||
|
||||
|
||||
import cn.wizzer.framework.base.service.BaseServiceImpl;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_ca_sbxx_fj;
|
||||
import io.v.nutz.zhgh.hd.services.HdCasbxxFjService;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.plugins.wkcache.annotation.CacheDefaults;
|
||||
|
||||
@IocBean(args = {"refer:dao"})
|
||||
@CacheDefaults(cacheName = "Hd_ca_sbxx_fj")
|
||||
public class HdCasbxxFjServiceImpl extends BaseServiceImpl<Hd_ca_sbxx_fj> implements HdCasbxxFjService {
|
||||
public HdCasbxxFjServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package io.v.nutz.zhgh.hd.services.impl;
|
||||
|
||||
|
||||
import io.v.nutz.base.service.impl.BaseServiceImpl;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_ca_sbxx;
|
||||
import io.v.nutz.zhgh.hd.services.HdCasbxxService;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.plugins.wkcache.annotation.CacheDefaults;
|
||||
|
||||
@IocBean(args = {"refer:dao"})
|
||||
@CacheDefaults(cacheName = "Hd_ca_sbxx")
|
||||
public class HdCasbxxServiceImpl extends BaseServiceImpl<Hd_ca_sbxx> implements HdCasbxxService {
|
||||
public HdCasbxxServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package io.v.nutz.zhgh.hd.services.impl;
|
||||
|
||||
import io.v.nutz.base.service.impl.BaseServiceImpl;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_papers;
|
||||
import io.v.nutz.zhgh.hd.services.HdPaperService;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
/**
|
||||
* @author: Aaron
|
||||
* @create: 2020-10-21 10:39
|
||||
* @description:
|
||||
**/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class HdPaperServiceImpl extends BaseServiceImpl<Hd_papers> implements HdPaperService {
|
||||
|
||||
public HdPaperServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package io.v.nutz.zhgh.hd.services.impl;
|
||||
|
||||
import io.v.nutz.base.service.impl.BaseServiceImpl;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_papers;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_subject;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_subject_answer;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_subject_reply;
|
||||
import io.v.nutz.zhgh.hd.services.HdPaperService;
|
||||
import io.v.nutz.zhgh.hd.services.HdSubjectAnswerService;
|
||||
import io.v.nutz.zhgh.hd.services.HdSubjectReplyService;
|
||||
import io.v.nutz.zhgh.hd.services.HdSubjectService;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
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.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: Aaron
|
||||
* @create: 2020-10-21 10:39
|
||||
* @description:
|
||||
**/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class HdSubjectAnswerServiceImpl extends BaseServiceImpl<Hd_subject_answer> implements HdSubjectAnswerService {
|
||||
|
||||
public HdSubjectAnswerServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Inject
|
||||
private HdPaperService hdPaperService;
|
||||
|
||||
@Inject
|
||||
private HdSubjectService hdSubjectService;
|
||||
|
||||
@Inject
|
||||
private HdSubjectReplyService hdSubjectReplyService;
|
||||
|
||||
@Override
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void doAdd(Hd_subject_reply[] replyList, String unique_id) throws Exception {
|
||||
String time = DateUtil.getDateTime();
|
||||
for (Hd_subject_reply reply : replyList) {
|
||||
reply.setSubmit_time(time);
|
||||
reply.setUnique_id(unique_id);
|
||||
hdSubjectReplyService.insert(reply);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object findOne(String id, String unique_id) {
|
||||
Sql sql = Sqls.create("SELECT\n" +
|
||||
"\t(\n" +
|
||||
"\tSELECT\n" +
|
||||
"\t\tcount( DISTINCT sr.papers_id ) \n" +
|
||||
"\tFROM\n" +
|
||||
"\t\t`hd_subject_reply` sr \n" +
|
||||
"\tWHERE\n" +
|
||||
"\t\tsr.papers_id = @papers_id \n" +
|
||||
"\t\tAND sr.unique_id = @unique_id \n" +
|
||||
"\t\tAND sr.submit_time = @submit_time \n" +
|
||||
"\t) >= p.answer_num flag\n" +
|
||||
"FROM\n" +
|
||||
"\t`hd_papers` p\n" +
|
||||
"\tLEFT JOIN hd_subject_reply sr ON p.id = sr.papers_id \n" +
|
||||
"GROUP BY\n" +
|
||||
"\tsr.papers_id").setParam("papers_id", id)
|
||||
.setParam("unique_id", unique_id)
|
||||
.setParam("submit_time", DateUtil.getDate());
|
||||
Record record = hdPaperService.list(sql).get(0);
|
||||
if (record.getInt("flag") > 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Hd_papers hd_papers = hdPaperService.fetchLinks(hdPaperService.fetch(id), "subjects", Cnd.NEW().asc("location"));
|
||||
List<Hd_subject> subjects = new ArrayList<>();
|
||||
hd_papers.getSubjects().forEach(v -> {
|
||||
subjects.add(hdSubjectService.fetchLinks(hdSubjectService.fetch(v.getId()), "answer", Cnd.NEW().asc("location")));
|
||||
});
|
||||
hd_papers.setSubjects(subjects);
|
||||
return hd_papers;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package io.v.nutz.zhgh.hd.services.impl;
|
||||
|
||||
import io.v.nutz.base.service.impl.BaseServiceImpl;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_subject_reply;
|
||||
import io.v.nutz.zhgh.hd.services.HdSubjectReplyService;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
/**
|
||||
* @author: Aaron
|
||||
* @create: 2020-10-21 10:39
|
||||
* @description:
|
||||
**/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class HdSubjectReplyServiceImpl extends BaseServiceImpl<Hd_subject_reply> implements HdSubjectReplyService {
|
||||
|
||||
public HdSubjectReplyServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package io.v.nutz.zhgh.hd.services.impl;
|
||||
|
||||
import io.v.nutz.base.service.impl.BaseServiceImpl;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_subject;
|
||||
import io.v.nutz.zhgh.hd.services.HdSubjectService;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
/**
|
||||
* @author: Aaron
|
||||
* @create: 2020-10-21 10:39
|
||||
* @description:
|
||||
**/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class HdSubjectServiceImpl extends BaseServiceImpl<Hd_subject> implements HdSubjectService {
|
||||
|
||||
public HdSubjectServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package io.v.nutz.zhgh.hd.services.impl;
|
||||
|
||||
|
||||
import cn.wizzer.framework.base.service.BaseServiceImpl;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_wm_bgi;
|
||||
import io.v.nutz.zhgh.hd.services.HdWmBgiService;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.plugins.wkcache.annotation.CacheDefaults;
|
||||
|
||||
@IocBean(args = {"refer:dao"})
|
||||
@CacheDefaults(cacheName = "Hd_wm_bgi")
|
||||
public class HdWmBgiServiceImpl extends BaseServiceImpl<Hd_wm_bgi> implements HdWmBgiService {
|
||||
public HdWmBgiServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package io.v.nutz.zhgh.hd.services.impl;
|
||||
|
||||
|
||||
import cn.wizzer.framework.base.service.BaseServiceImpl;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_wm_lb;
|
||||
import io.v.nutz.zhgh.hd.services.HdWmLbService;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.plugins.wkcache.annotation.CacheDefaults;
|
||||
|
||||
@IocBean(args = {"refer:dao"})
|
||||
@CacheDefaults(cacheName = "Hd_wm_lb")
|
||||
public class HdWmLbServiceImpl extends BaseServiceImpl<Hd_wm_lb> implements HdWmLbService {
|
||||
public HdWmLbServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package io.v.nutz.zhgh.hd.services.impl;
|
||||
|
||||
|
||||
import cn.wizzer.framework.base.service.BaseServiceImpl;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_wm_zplb;
|
||||
import io.v.nutz.zhgh.hd.services.HdWmZplbService;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.plugins.wkcache.annotation.CacheDefaults;
|
||||
|
||||
@IocBean(args = {"refer:dao"})
|
||||
@CacheDefaults(cacheName = "Hd_wm_zplb")
|
||||
public class HdWmZplbServiceImpl extends BaseServiceImpl<Hd_wm_zplb> implements HdWmZplbService {
|
||||
public HdWmZplbServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package io.v.nutz.zhgh.hd.services.impl;
|
||||
|
||||
|
||||
import io.v.nutz.zhgh.hd.models.Hd_wm_sbxx;
|
||||
import io.v.nutz.zhgh.hd.services.HdWmsbxxService;
|
||||
import io.v.nutz.base.service.impl.ViServiceImpl;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.plugins.wkcache.annotation.CacheDefaults;
|
||||
|
||||
@IocBean(args = {"refer:dao"})
|
||||
@CacheDefaults(cacheName = "Hd_Wm_sbxx")
|
||||
public class HdWmsbxxServiceImpl extends ViServiceImpl<Hd_wm_sbxx> implements HdWmsbxxService {
|
||||
public HdWmsbxxServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package io.v.nutz.zhgh.hd.services.impl;
|
||||
|
||||
|
||||
import cn.wizzer.framework.base.service.BaseServiceImpl;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_wm_sbxx_fj;
|
||||
import io.v.nutz.zhgh.hd.services.HdWmsbxxfjService;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.plugins.wkcache.annotation.CacheDefaults;
|
||||
|
||||
@IocBean(args = {"refer:dao"})
|
||||
@CacheDefaults(cacheName = "Hd_Wm_sbxx_fj")
|
||||
public class HdWmsbxxfjServiceImpl extends BaseServiceImpl<Hd_wm_sbxx_fj> implements HdWmsbxxfjService {
|
||||
public HdWmsbxxfjServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package io.v.nutz.zhgh.hd.services.impl;
|
||||
|
||||
|
||||
import cn.wizzer.framework.base.service.BaseServiceImpl;
|
||||
import io.v.nutz.zhgh.hd.models.Hd_wm_xx;
|
||||
import io.v.nutz.zhgh.hd.services.HdWmxxService;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.plugins.wkcache.annotation.CacheDefaults;
|
||||
|
||||
@IocBean(args = {"refer:dao"})
|
||||
@CacheDefaults(cacheName = "Hd_Wm_xx")
|
||||
public class HdWmxxServiceImpl extends BaseServiceImpl<Hd_wm_xx> implements HdWmxxService {
|
||||
public HdWmxxServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user