This commit is contained in:
Paidax
2024-11-29 09:03:59 +08:00
commit 2ffadd89a7
3480 changed files with 879405 additions and 0 deletions
@@ -0,0 +1,106 @@
package io.v.nutz.zhgh.zgfw.controller;
import cn.wizzer.framework.base.service.BaseService;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.web.commons.utils.ShiroUtil;
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 java.util.ArrayList;
import java.util.List;
@IocBean
@At("/platform/zgfw/dbxx")
@Ok("json:full")
public class FwDbController {
@Inject
private BaseService baseService;
@Inject
private Vi vi;
/**
* 慰问 困难补助 如鹅血==========d'd'd'd'd'd'd'd'd'd'd'd'd'd'd'd'd'd'd
*
* @return
*/
@At
public Object getFwDbxx() {
List<NutMap> nutMaps = new ArrayList<NutMap>();
NutMap res = NutMap.NEW();
Sql rxdjSql = Sqls.create("SELECT count(1) FROM `fw_rxdj` xx \n" +
"left join sys_user u on u.id = xx.dj_jzgid\n" +
"left join sys_unit dw on dw.id = u.unitid\n" +
"left join sys_union fgh on fgh.id = dw.unionid $rxdj");
Sql knbzSql = Sqls.create("SELECT count(1) FROM `fw_knbf` xx\n" +
"left join sys_user u on u.id = xx.sq_dsqr\n" +
"left join sys_unit dw on dw.id = u.unitid\n" +
"left join sys_union fgh on fgh.id = dw.unionid $knbz");
Sql wwjSql = Sqls.create("select count(1) from fw_wwj xx\n" +
"left join sys_user u on u.id = xx.sqr\n" +
"left join sys_unit dw on dw.id = u.unitid\n" +
"left join sys_union fgh on fgh.id = dw.unionid $wwj");
if (ShiroUtil.hasRole("sysadmin")) {
//待分工会审核
rxdjSql.setVar("rxdj", Cnd.where("dj_sqzt", "=", 1));
nutMaps.add(NutMap.NEW().addv("iconClass", vi.getIconByPath("/platform/zgfw/rxdj/sh/fghindex")).addv("label", "入学登记分工会审核").addv("number", baseService.count(rxdjSql)).addv("url", "/platform/zgfw/rxdj/sh/fghindex"));
knbzSql.setVar("knbz", Cnd.where("sq_sqzt", "=", 1));
nutMaps.add(NutMap.NEW().addv("iconClass", vi.getIconByPath("/platform/zgfw/knbf/sh/fghindex")).addv("label", "困难帮扶分工会审核").addv("number", baseService.count(knbzSql)).addv("url", "/platform/zgfw/knbf/sh/fghindex"));
wwjSql.setVar("wwj", Cnd.where("`status`", "=", 1));
nutMaps.add(NutMap.NEW().addv("iconClass", vi.getIconByPath("/platform/zgfw/wwj/sh/fghindex")).addv("label", "慰问金分工会审核").addv("number", baseService.count(wwjSql)).addv("url", "/platform/zgfw/wwj/sh/fghindex"));
//待校工会审核
rxdjSql.setVar("rxdj", Cnd.where("dj_sqzt", "=", 2));
nutMaps.add(NutMap.NEW().addv("iconClass", vi.getIconByPath("/platform/zgfw/rxdj/sh/xghindex")).addv("label", "入学登记校工会审核").addv("number", baseService.count(rxdjSql)).addv("url", "/platform/zgfw/rxdj/sh/xghindex"));
knbzSql.setVar("knbz", Cnd.where("sq_sqzt", "=", 2));
nutMaps.add(NutMap.NEW().addv("iconClass", vi.getIconByPath("/platform/zgfw/knbf/sh/xghindex")).addv("label", "困难帮扶校工会审核").addv("number", baseService.count(knbzSql)).addv("url", "/platform/zgfw/knbf/sh/xghindex"));
wwjSql.setVar("wwj", Cnd.where("`status`", "=", 2));
nutMaps.add(NutMap.NEW().addv("iconClass", vi.getIconByPath("/platform/zgfw/wwj/sh/xghindex")).addv("label", "慰问金校工会审核").addv("number", baseService.count(wwjSql)).addv("url", "/platform/zgfw/wwj/sh/xghindex"));
} else if (ShiroUtil.hasRole("SchoolUnionAdmin")) {
rxdjSql.setVar("rxdj", Cnd.where("dj_sqzt", "=", 2));
nutMaps.add(NutMap.NEW().addv("iconClass", vi.getIconByPath("/platform/zgfw/rxdj/sh/xghindex")).addv("label", "入学登记校工会审核").addv("number", baseService.count(rxdjSql)).addv("url", "/platform/zgfw/rxdj/sh/xghindex"));
knbzSql.setVar("knbz", Cnd.where("sq_sqzt", "=", 2));
nutMaps.add(NutMap.NEW().addv("iconClass", vi.getIconByPath("/platform/zgfw/knbf/sh/xghindex")).addv("label", "困难帮扶校工会审核").addv("number", baseService.count(knbzSql)).addv("url", "/platform/zgfw/knbf/sh/xghindex"));
wwjSql.setVar("wwj", Cnd.where("`status`", "=", 2));
nutMaps.add(NutMap.NEW().addv("iconClass", vi.getIconByPath("/platform/zgfw/wwj/sh/xghindex")).addv("label", "慰问金校工会审核").addv("number", baseService.count(wwjSql)).addv("url", "/platform/zgfw/wwj/sh/xghindex"));
} else {
if (ShiroUtil.hasRole("H04") || ShiroUtil.hasRole("sp02")) {
//困难补助分工会 审批员
String unionid = ((Sys_union) ShiroUtil.getPrincipalProperty("union")).getId();
knbzSql.setVar("knbz", Cnd.where("sq_sqzt", "=", 1).and("fgh.id", "=", unionid));
nutMaps.add(NutMap.NEW().addv("iconClass", vi.getIconByPath("/platform/zgfw/knbf/sh/fghindex")).addv("label", "困难帮扶分工会审核").addv("number", baseService.count(knbzSql)).addv("url", "/platform/zgfw/knbf/sh/fghindex"));
}
if (ShiroUtil.hasRole("H04") || ShiroUtil.hasRole("sp03")) {
//入学登记分工会 审批员
String unionid = ((Sys_union) ShiroUtil.getPrincipalProperty("union")).getId();
rxdjSql.setVar("rxdj", Cnd.where("dj_sqzt", "=", 1).and("fgh.id", "=", unionid));
nutMaps.add(NutMap.NEW().addv("iconClass", vi.getIconByPath("/platform/zgfw/rxdj/sh/fghindex")).addv("label", "入学登记分工会审核").addv("number", baseService.count(rxdjSql)).addv("url", "/platform/zgfw/rxdj/sh/fghindex"));
}
if (ShiroUtil.hasRole("H04") || ShiroUtil.hasRole("sp01")) {
String unionid = ((Sys_union) ShiroUtil.getPrincipalProperty("union")).getId();
wwjSql.setVar("wwj", Cnd.where("`status`", "=", 1).and("fgh.id", "=", unionid));
nutMaps.add(NutMap.NEW().addv("iconClass", vi.getIconByPath("/platform/zgfw/wwj/sh/fghindex")).addv("label", "慰问金分工会审核").addv("number", baseService.count(wwjSql)).addv("url", "/platform/zgfw/wwj/sh/fghindex"));
}
}
return nutMaps;
}
}
@@ -0,0 +1,115 @@
package io.v.nutz.zhgh.zgfw.controller.condolence;
/**
* @author zhf
* @date 2021/3/22 10:27
* @description 慰问待办
*/
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.sys.models.Sys_menu;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.zhgh.zgfw.service.CondolenceService;
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 java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
@IocBean
@Ok("json:full")
@At("/platform/condolence/agent")
public class CondolenceAgentController {
@Inject
private Vi vi;
@Inject
private CondolenceService condolenceService;
private static final String UCR = "/platform/fw/condolence/ucr";
private static final String FR = "/platform/fw/condolence/fr";
private static final String VCR = "/platform/fw/condolence/vcr/school";
private static final String ECR = "/platform/fw/condolence/ecr";
@At
@ViReturn
public Object getAgenda() {
final String title = "【职工慰问】";
List<NutMap> result = new ArrayList<>();
result.add(new NutMap().setv("title", title).setv("url", UCR).setv("iconClass", vi.getIconByPath(UCR)).setv("label", "待院级工会审核").setv("number", getUcrCount()));
result.add(new NutMap().setv("title", title).setv("url", FR).setv("iconClass", vi.getIconByPath(FR)).setv("label", "待二级党组织审核").setv("number", getFrCount()));
result.add(new NutMap().setv("title", title).setv("url", VCR).setv("iconClass", vi.getIconByPath(VCR)).setv("label", "待校工会审核").setv("number", getVcrCount()));
result.add(new NutMap().setv("title", title).setv("url", ECR).setv("iconClass", vi.getIconByPath(ECR)).setv("label", "待工会常务副主席审核").setv("number", getEcrCount()));
Sys_user user = (Sys_user) ShiroUtil.getPrincipal();
List<Sys_menu> menus = Optional.ofNullable(user).orElse(new Sys_user()).getMenus();
return result.stream().filter(v -> Strings.isNotBlank(v.getString("url")) && menus.stream().anyMatch(x -> Strings.isNotBlank(x.getHref()) && v.getString("url").equals(x.getHref()))).distinct().collect(Collectors.toList());
}
/**
* 待工会主席审核
*
* @return
*/
private Integer getUcrCount() {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT COUNT(1) FROM condolence con LEFT JOIN `user` us ON con.be_user=us.id $condition
""");
cnd.and("con.state_id", "=", 2000);
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
cnd.and("us.unionid", "=", vi.getUnionId());
}
sql.setCondition(cnd);
return condolenceService.count(sql);
}
/**
* 待工会会计审核
* 暂时没用
*
* @return
*/
private Integer getFrCount() {
return condolenceService.count(Cnd.where("state_id", "=", 2012));
}
/**
* 待校工会主席审核
*
* @return
*/
private Integer getVcrCount() {
int state_id = condolenceService.count(Cnd.where("state_id", "=", 2020));
return state_id;
}
/**
* 待工会常务副主席审核
* 暂时没用
*
* @return
*/
private Integer getEcrCount() {
return condolenceService.count(Cnd.where("state_id", "=", 2050));
}
}
@@ -0,0 +1,179 @@
package io.v.nutz.zhgh.zgfw.controller.condolence;
import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.sys.models.Sys_signature;
import io.v.nutz.sys.services.SysSignatureService;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.zhgh.evaluate.handler.EvaluateToDoHandler;
import io.v.nutz.zhgh.zgfw.handler.condolence.CondolenceToDoHandler;
import io.v.nutz.zhgh.zgfw.model.condolence.Condolence;
import io.v.nutz.zhgh.zgfw.service.CondolenceService;
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.dao.util.cri.SqlExpressionGroup;
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.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.List;
/**
* @Author: 1V
* @DateTime: 2020/11/20 11:49
* @Description: 慰问申请
*/
@At({"/platform/fw/condolence/apply", "/platform/fw/condolence/applyWrite"})
@IocBean
@Ok("json")
public class CondolenceApplyCon {
@Inject
private Vi vi;
@Inject
private MsgApi msgApi;
@At("")
@Ok("beetl:/platform/zgfw/condolence/apply.html")
@RequiresPermissions("fw.condolence.apply")
public void index() {
}
@Inject
private CondolenceService condolenceService;
@At
@ViReturn
@RequiresPermissions("fw.condolence.apply")
public Object queryUser(String query) {
Sql sql = Sqls.create("""
SELECT u.id,
u.username,
u.loginname,
IFNULL(u.unitname,'暂无') as unitname,
u.sex
from user u
left join sys_unit unit on u.unitid = unit.id
left join sys_union un on unit.unionid = un.id
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("u.id", "!=", ShiroUtil.getPlatformUid());
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
cnd.and("un.id", "=", vi.getUnionId());
}
SqlExpressionGroup group = new SqlExpressionGroup();
group.orLike("u.username", query);
group.orLike("u.loginname", query);
group.orEquals("u.id", query);
cnd.and(group);
cnd.asc("u.unionname").asc("unitname");
sql.setCondition(cnd);
return condolenceService.listPage(1, 50, sql).getList();
}
@Inject
private SysSignatureService sysSignatureService;
@Inject
protected SysUserService sysUserService;
@At
@ViReturn
@RequiresPermissions("fw.condolence.apply")
@Aop(TransAop.READ_COMMITTED)
public Object doAdd(@Param(value = "data", required = false) Condolence condolence, @Param(value = "sign", required = false) String sign,
@Param(value = "hospital_stay_1", required = false) String hospital_stay_1,
@Param(value = "hospital_stay_2", required = false) String hospital_stay_2) {
if (Strings.isNotBlank(sign)) {
condolence.setManager_sign(sysSignatureService.insert(new Sys_signature(sign)).getId());
}
condolence.setManager(ShiroUtil.getPrincipalProperty("id").toString());
condolence.setApply_time(DateUtil.getDateTime());
condolence.setStarting_time(hospital_stay_1);
condolence.setEnd_time(hospital_stay_2);
/* if (ShiroUtil.hasAnyRoles("H04,gh01")) {
condolence.setState_id("2040");
}*/
condolence.setState_id("2000");
condolenceService.add(condolence);
Sql unionAdminSql = Sqls.create("""
SELECT
u.username,
u.loginname
FROM
sys_user_role sur
LEFT JOIN sys_user u ON u.id = sur.userId\s
AND sur.unionid = @unionId
WHERE
sur.roleId = '5d342e614e9a48288d50154bcdcc75d3'\s
AND sur.unionid = @unionId
""");
unionAdminSql.setParam("unionId", Vi.getUnionId());
List<NutMap> unionAdmins = condolenceService.listMap(unionAdminSql);
for (NutMap unionAdmin : unionAdmins) {
String msg = "%s主席您好!您分工会下的%s老师申请了一条慰问,请您登录智慧工会系统职工服务>职工慰问下审核.".formatted(
unionAdmin.getString("username"), ShiroUtil.getPrincipalProperty("username"));
// msgApi.sendMsg(unionAdmin.getString("loginname"), msg);
System.out.println(msg);
}
CondolenceToDoHandler.START_PROCESS.exec(condolence, null);
CondolenceToDoHandler.CREATE_UNION_TASK.exec(condolence, null);
return null;
}
@At
@ViReturn
@RequiresPermissions("fw.condolence.info")
public Object doEdit(@Param("data") Condolence condolence,
@Param(value = "sign", required = false) String sign,
@Param(value = "hospital_stay_1", required = false) String hospital_stay_1,
@Param(value = "hospital_stay_2", required = false) String hospital_stay_2) {
if (Strings.isNotBlank(sign)) {
condolence.setManager_sign(sysSignatureService.insert(new Sys_signature(sign)).getId());
}
condolence.setState_id("2000");
condolence.setStarting_time(hospital_stay_1);
condolence.setEnd_time(hospital_stay_2);
condolenceService.updateIgnoreNull(condolence);
// CondolenceToDoHandler.START_PROCESS.exec(condolence, null);
// CondolenceToDoHandler.COMPLETE_APPLY_RE_MODIFY_TASK.exec(condolence, null);
// CondolenceToDoHandler.CREATE_UNION_TASK.exec(condolence, null);
return null;
}
@At
@RequiresPermissions("fw.condolence.apply")
public Object getUserData(String userId) {
Sql sql = Sqls.create("""
SELECT us.*,unit.id unitid,unit.`name` FROM sys_user us LEFT JOIN sys_unit unit ON us.unitid=unit.id WHERE us.id=@userId
""");
sql.setParam("userId", userId);
return Result.success().addData(sysUserService.list(sql).get(0));
}
}
@@ -0,0 +1,174 @@
package io.v.nutz.zhgh.zgfw.controller.condolence;
import cn.wizzer.framework.base.service.BaseService;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.OfficeTemplateUtil;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.sys.models.Sys_signature;
import io.v.nutz.sys.services.SysSignatureService;
import io.v.nutz.zhgh.zgfw.model.condolence.Condolence;
import io.v.nutz.zhgh.zgfw.service.CondolenceService;
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.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: 1V
* @DateTime: 2020/11/20 11:49
* @Description: 慰问信息
*/
@At({"/platform/fw/condolence", "/platform/fw/condolence/myList"})
@IocBean
@RequiresAuthentication
@Ok("json:full")
public class CondolenceCon {
@Inject
private Vi vi;
@At("")
@Ok("beetl:/platform/zgfw/condolence/index.html")
@RequiresPermissions("fw.condolence.info")
public void index() {
}
@Inject
private CondolenceService condolenceService;
@Inject
private BaseService baseService;
@Inject
private OfficeTemplateUtil officeTemplateUtil;
@At
@ViReturn
@RequiresPermissions("fw.condolence.info")
public Object findOne(String id) {
return condolenceService.findOne(id);
}
@At
@ViReturn
@RequiresPermissions("fw.condolence.info")
public Object pageData(@Param(value = "year", required = false) String year,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "type", required = false) String type,
@Param(value = "way", required = false) String way,
@Param(value = "searchName", required = false) String searchName,
@Param(value = "searchKeyword", required = false) String searchKeyword,
@Param("pageNumber") int pageNumber, @Param("pageSize") int pageSize,
@Param(value = "pageOrderName", required = false) String pageOrderName,
@Param(value = "pageOrderBy", required = false) String pageOrderBy) {
Sql sql = Sqls.create("""
SELECT
con.*,
type.`name` type_name,
type.`code` type_code,
be.username be_username,
be.loginname be_loginname,
sqr.username sqr_username,
be.unitname be_unitname,
be.unionname be_unionname,
state.state_name,
state.state_color
FROM
condolence con
LEFT JOIN `user` be ON con.be_user = be.id
LEFT JOIN `user` sqr ON con.manager= sqr.id
LEFT JOIN state state ON state.state_id = con.state_id
LEFT JOIN condolence_type type ON type.id=con.type $condition
""");
Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
cnd.and("con.manager", "=", ShiroUtil.getPrincipalProperty("id"));
}
Vi.cndPlus(cnd, "YEAR(con.apply_time)", "=", year);
Vi.cndPlus(cnd, "con.type", "=", type);
Vi.cndPlus(cnd, "con.way", "=", way);
Vi.cndPlus(cnd, "be.unitid", "=", unitId);
Vi.cndPlus(cnd, "be.unionid", "=", unionId);
if (Vi.isNotBlank(searchName, searchKeyword)) {
cnd.where().andLike(searchName, searchKeyword);
}
if (Vi.isNotBlank(pageOrderName, pageOrderBy)) {
cnd.orderBy(pageOrderName, pageOrderBy);
} else {
cnd.desc("con.apply_time");
}
sql.setCondition(cnd);
return condolenceService.listPage(pageNumber, pageSize, sql);
}
@Inject
private SysSignatureService sysSignatureService;
@At
@ViReturn
@RequiresPermissions("fw.condolence.info")
public Object doEdit(@Param("data") Condolence condolence,
@Param(value = "delNotesList", required = false) String[] delNotesList,
@Param(value = "sign", required = false) String sign,
@Param(value = "hospital_stay_1", required = false) String hospital_stay_1,
@Param(value = "hospital_stay_2", required = false) String hospital_stay_2) {
if (delNotesList != null && delNotesList.length > 0) {
for (String s : delNotesList) {
if (Strings.isNotBlank(s)) {
baseService.clear("goods", Cnd.where("id", "=", s));
}
}
}
if (!condolence.getGoods().isEmpty()) {
condolence.getGoods().forEach(goods -> {
if (Strings.isBlank(goods.getId())) {
goods.setReid(condolence.getId());
baseService.insert(goods);
}
});
}
if (Strings.isNotBlank(sign)) {
condolence.setManager_sign(sysSignatureService.insert(new Sys_signature(sign)).getId());
}
if (condolence.getState_id().equals("1990") || condolence.getState_id().equals("1995")) {
condolence.setState_id("2000");
}
condolence.setStarting_time(hospital_stay_1);
condolence.setEnd_time(hospital_stay_2);
condolenceService.updateIgnoreNull(condolence);
return null;
}
@Inject
private FtpService ftpService;
@At
@ViReturn
@RequiresPermissions("fw.condolence.info")
public Object doDelete(String id) {
Condolence condolence = condolenceService.fetch(id);
vi.deleteSysFiles(condolence.getFiles());
baseService.clear("goods", Cnd.where("reid", "=", id));
condolenceService.del(id);
return null;
}
}
@@ -0,0 +1,123 @@
package io.v.nutz.zhgh.zgfw.controller.condolence;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.model.Review;
import io.v.nutz.base.service.ReviewService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.model.condolence.Condolence;
import io.v.nutz.zhgh.zgfw.service.CondolenceService;
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.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
/**
* @Author: 1V
* @DateTime: 2020/11/20 11:49
* @Description: 工会常务副主席审核
*/
@At("/platform/fw/condolence/ecr")
@IocBean
@RequiresAuthentication
@Ok("json")
public class CondolenceEcrCon {
@Inject
private Vi vi;
@At("")
@Ok("beetl:/platform/zgfw/condolence/ecr.html")
@RequiresPermissions("fw.condolence.ecr")
public void index() {
}
@At
@ViReturn
@RequiresPermissions("fw.condolence.ecr")
public Object pageData(@Param(value = "unionid",required = false) String unionid,
@Param(value = "isAudit",required = false) Boolean isAudit,
@Param(value = "year",required = false) Integer year,
@Param(value = "type",required = false) Integer type,
@Param(value = "way",required = false) Integer way,
@Param(value = "searchName",required = false) String searchName,
@Param(value = "searchKeyword",required = false) String searchKeyword,
@Param("pageNumber") int pageNumber, @Param("pageSize") int pageSize,
@Param(value = "pageOrderName",required = false) String pageOrderName,
@Param(value = "pageOrderBy",required = false) String pageOrderBy) {
Sql sql = Sqls.create("""
SELECT
con.*,
type.`name` type_name,
be.username be_username,
man.username man_username,
be_unit.`name` be_unitname,
be_union.unionname,
state.state_name,
state.state_color
FROM
condolence con
LEFT JOIN sys_user be ON con.be_user = be.id
LEFT JOIN sys_user man ON con.manager = man.id
LEFT JOIN sys_unit be_unit ON be.unitid = be_unit.id
LEFT JOIN sys_union be_union ON be_unit.unionid = be_union.id
LEFT JOIN state state ON state.state_id = con.state_id
LEFT JOIN condolence_type type ON type.id=con.type $condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("con.state_id", isAudit ? ">" : "=", 2060);
Vi.cndPlus(cnd, "YEAR(con.apply_time)", "=", year);
Vi.cndPlus(cnd, "con.type", "=", type);
Vi.cndPlus(cnd, "con.way", "=", way);
Vi.cndPlus(cnd, "be_union.id", "=", unionid);
if (Vi.isNotBlank(searchName, searchKeyword)) {
cnd.where().andLike(searchName, searchKeyword);
}
if (Vi.isNotBlank(pageOrderName, pageOrderBy)) {
cnd.orderBy(pageOrderName, pageOrderBy);
} else {
cnd.desc("con.apply_time");
}
sql.setCondition(cnd);
return condolenceService.listPage(pageNumber, pageSize, sql);
}
@Inject
private CondolenceService condolenceService;
@Inject
private ReviewService reviewService;
@At
@ViReturn
@RequiresPermissions("fw.condolence.ecr")
public Object doReview(String id, boolean pass, Review review) {
review.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
review.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
review.setTime(DateUtil.getDate());
review = reviewService.insert(review);
Condolence condolence = condolenceService.fetch(id);
condolence.setExecutive_chairman_review(review.getId());
condolence.setState_id(pass ? "2080" : "2070");
condolenceService.edit(condolence);
return null;
}
}
@@ -0,0 +1,159 @@
package io.v.nutz.zhgh.zgfw.controller.condolence;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.model.Review;
import io.v.nutz.base.service.ReviewService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.handler.condolence.CondolenceToDoHandler;
import io.v.nutz.zhgh.zgfw.model.condolence.Condolence;
import io.v.nutz.zhgh.zgfw.service.CondolenceService;
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.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.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
/**
* @Author: 1V
* @DateTime: 2020/11/20 11:49
* @Description: 会计审核
*/
@At("/platform/fw/condolence/fr")
@IocBean
@RequiresAuthentication
@Ok("json")
public class CondolenceFrCon {
@Inject
private Vi vi;
@At("")
@Ok("beetl:/platform/zgfw/condolence/fr.html")
@RequiresPermissions("fw.condolence.fr")
public void index() {
}
@At
@ViReturn
@RequiresPermissions("fw.condolence.fr")
public Object pageData(@Param(value = "unitId", required = false) String unitId,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "isAudit", required = false) Boolean isAudit,
@Param(value = "year", required = false) Integer year,
@Param(value = "type", required = false) Integer type,
@Param(value = "way", required = false) Integer way,
@Param(value = "searchName", required = false) String searchName,
@Param(value = "searchKeyword", required = false) String searchKeyword,
@Param("pageNumber") int pageNumber, @Param("pageSize") int pageSize,
@Param(value = "pageOrderName", required = false) String pageOrderName,
@Param(value = "pageOrderBy", required = false) String pageOrderBy) {
Sql sql = Sqls.create("""
SELECT
con.*,
type.`name` type_name,
be.username be_username,
be.loginname be_loginname,
sqr.username sqr_username,
be.unitname be_unitname,
be.unionname be_unionname,
state.state_name,
state.state_color
FROM
condolence con
LEFT JOIN `user` be ON con.be_user = be.id
LEFT JOIN `user` sqr ON con.manager= sqr.id
LEFT JOIN state state ON state.state_id = con.state_id
LEFT JOIN condolence_type type ON type.id=con.type $condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("con.state_id", isAudit ? ">" : "in", isAudit ? 2012 : Lang.array(2012, 2031));
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionCondolenceAdmin")) {
Vi.cndPlus(cnd, "be.unitid", "=", ShiroUtil.getPrincipalProperty("unitid"));
}
Vi.cndPlus(cnd, "YEAR(con.apply_time)", "=", year);
Vi.cndPlus(cnd, "con.type", "=", type);
Vi.cndPlus(cnd, "con.way", "=", way);
Vi.cndPlus(cnd, "be.unitid", "=", unitId);
Vi.cndPlus(cnd, "be.unionid", "=", unionId);
if (Vi.isNotBlank(searchName, searchKeyword)) {
cnd.where().andLike(searchName, searchKeyword);
}
if (Vi.isNotBlank(pageOrderName, pageOrderBy)) {
cnd.orderBy(pageOrderName, pageOrderBy);
} else {
cnd.desc("con.apply_time");
}
sql.setCondition(cnd);
return condolenceService.listPage(pageNumber, pageSize, sql);
}
@Inject
private CondolenceService condolenceService;
@Inject
private ReviewService reviewService;
@At
@ViReturn
@RequiresPermissions("fw.condolence.fr")
@Aop(TransAop.READ_COMMITTED)
public Object doReview(String id, Integer pass, Review review, double money) {
review.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
review.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
review.setTime(DateUtil.getDate());
review = reviewService.insert(review);
Condolence condolence = condolenceService.fetch(id);
condolence.setMoney(money);
condolence.setFinance_review(review.getId());
if (pass == 1) {
condolence.setState_id("2014");
} else if (pass == 2) {
condolence.setState_id("2015");
} else {
condolence.setState_id("2020");
}
condolenceService.edit(condolence);
CondolenceToDoHandler.COMPLETE_FINANCE_TASK.exec(condolence, review.getOpinion());
CondolenceToDoHandler.COMPLETE_BACK_SCHOOL_TASK.exec(condolence, review.getOpinion());
//1拒绝 3通过
if (pass == 1){
CondolenceToDoHandler.COMPLETE_PROCESS.exec(condolence, review.getOpinion());
} else if(pass == 2) {
CondolenceToDoHandler.CREATE_APPLY_RE_MODIFY_TASK.exec(condolence, review.getOpinion());
} else if (pass == 3){
CondolenceToDoHandler.CREATE_SCHOOL_TASK.exec(condolence,null);
}
return null;
}
@At
@ViReturn
@RequiresPermissions("fw.condolence.fr")
public Object doEdit(String id) {
condolenceService.update(Chain.make("state_id", 2012), Cnd.where("id", "=", id));
return null;
}
}
@@ -0,0 +1,437 @@
package io.v.nutz.zhgh.zgfw.controller.condolence;
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.convert.Convert;
import cn.hutool.core.date.DateUtil;
import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.OfficeTemplateUtil;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.model.Review;
import io.v.nutz.base.utils.ViTool;
import io.v.nutz.web.commons.base.Globals;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zgfw.model.condolence.CondolenceType;
import io.v.nutz.sys.models.Sys_signature;
import io.v.nutz.zhgh.zgfw.model.condolence.Condolence;
import io.v.nutz.zhgh.zgfw.service.CondolenceService;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.entity.Record;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
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.io.BufferedOutputStream;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
/**
* @Author: 1V
* @DateTime: 2020/11/20 11:49
* @Description: 阅览
*/
@At({"/platform/fw/condolence/doRead", "/platform/fw/condolence/read"})
@IocBean
@RequiresAuthentication
@Ok("json")
public class CondolenceReadCon {
@Inject
private CondolenceService condolenceService;
@Inject
private Vi vi;
@Inject
private OfficeTemplateUtil officeTemplateUtil;
@At("")
@Ok("beetl:/platform/zgfw/condolence/read.html")
@RequiresPermissions("fw.condolence.read")
public void index() {
}
@At
@ViReturn
@RequiresPermissions("fw.condolence.read")
public Object pageData(@Param(value = "unitId", required = false) String unitId,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "year", required = false) Integer year,
@Param(value = "type", required = false) String type,
@Param(value = "way", required = false) Integer way,
@Param(value = "searchName", required = false) String searchName,
@Param(value = "searchKeyword", required = false) String searchKeyword,
@Param("pageNumber") int pageNumber, @Param("pageSize") int pageSize,
@Param(value = "pageOrderName", required = false) String pageOrderName,
@Param(value = "pageOrderBy", required = false) String pageOrderBy) {
Sql sql = Sqls.create("""
SELECT
con.*,
type.`name` type_name,
be.username be_username,
be.loginname be_loginname,
sqr.username sqr_username,
be.unitname be_unitname,
be.unionname be_unionname,
state.state_name,
state.state_color,
type.`code`
FROM
condolence con
LEFT JOIN `user` be ON con.be_user = be.id
LEFT JOIN `user` sqr ON con.manager= sqr.id
LEFT JOIN state state ON state.state_id = con.state_id
LEFT JOIN condolence_type type ON type.id=con.type $condition
""");
Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin,A06,wyh02")) {
SqlExpressionGroup group2 = new SqlExpressionGroup();
if (ShiroUtil.hasAnyRoles("gh01,H04")) {
group2.or("be.unionid", "=", vi.getUnionId());
/*group2.or("con.state_id", ">=", 2000);*/
}
/* if (ShiroUtil.hasAnyRoles("SchoolUnionAccountant")) {
group2.or("con.state_id", ">=", 2020);
}
if (ShiroUtil.hasAnyRoles("A06")) {
group2.or("con.state_id", ">=", 2040);
}*/
/* if (ShiroUtil.hasAnyRoles("")) {
group2.or("con.state_id", ">=", 2060);
} */
else {
group2.or("con.be_user", "=", ShiroUtil.getPrincipalProperty("id").toString());
group2.or("con.manager", "=", ShiroUtil.getPrincipalProperty("id").toString());
}
cnd.and(group2);
}
Vi.cndPlus(cnd, "YEAR(con.apply_time)", "=", year);
Vi.cndPlus(cnd, "con.type", "=", type);
Vi.cndPlus(cnd, "con.way", "=", way);
Vi.cndPlus(cnd, "be.unitid", "=", unitId);
Vi.cndPlus(cnd, "be.unionid", "=", unionId);
cnd.and("con.state_id", ">=", "2040");
if (Vi.isNotBlank(searchName, searchKeyword)) {
cnd.where().andLike(searchName, searchKeyword);
}
if (Vi.isNotBlank(pageOrderName, pageOrderBy)) {
cnd.orderBy(pageOrderName, pageOrderBy);
} else {
cnd.desc("con.apply_time");
}
sql.setCondition(cnd);
return condolenceService.listPage(pageNumber, pageSize, sql);
}
@At
@Ok("void")
@RequiresPermissions("fw.condolence.read")
public void exportReceipt(String id, HttpServletResponse response) throws Exception {
Record record = condolenceService.findOne(id);
List<CondolenceType> typeList = condolenceService.dao().query(CondolenceType.class, Cnd.NEW());
typeList.forEach(item -> {
if (item.getId().equals(record.getString("type"))) {
record.put(item.getCode(), "");
} else {
record.put(item.getCode(), "");
}
});
record.set("apply_time", DateUtil.format(DateUtil.parseDate(record.getString("apply_time")), "yyyy年MM月dd日"));
Object vcr = record.get("vcr");
if (vcr != null) {
Review review = (Review) vcr;
record.set("vcr", review.getSign() != null ? ViTool.poiBase64Image(review.getSign(), 130, 100) : null);
}
Object ucr = record.get("ucr");
if (ucr != null) {
Review review = (Review) ucr;
record.set("ucr", review.getSign() != null ? ViTool.poiBase64Image(review.getSign(), 130, 100) : null);
}
String ms = record.getString("manager_sign_data");
if (Strings.isNotBlank(ms)) {
record.set("applySign", ViTool.poiBase64Image(ms, 100, 50));
}
record.set("bigMoney", Convert.digitToChinese(record.getDouble("money")));
String fileName = Globals.schoolName + "领取通知单";
response.addHeader("Content-Type", "application/octet-stream");
response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(fileName.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1) + "\".docx");
Configure config = Configure.builder().build();
XWPFTemplate.compile(officeTemplateUtil.getPath("condolence_pay"), config).render(record).writeAndClose(response.getOutputStream());
}
@At
@Ok("void")
@RequiresPermissions("fw.condolence.read")
public void exportAllPay(String year, HttpServletResponse response) throws Exception {
List<CondolenceType> typeList = condolenceService.dao().query(CondolenceType.class, Cnd.NEW());
//查询用户
List<Record> userList = condolenceService.dao().query("user", Cnd.NEW());
Map<String, Record> userMap = userList.stream().collect(Collectors.toMap(o -> o.getString("id"), o -> o));
//根据年度查询所有的慰问
List<Condolence> condolenceList = condolenceService.query(Cnd.NEW().andEX("year(apply_time)", "=", year));
//导出为一个压缩包
response.setContentType("application/octet-stream");
response.setHeader("content-disposition", "attachment;filename="
+ URLEncoder.encode("职工慰问领取通知单汇总.zip", "UTF-8"));
ZipOutputStream zipOutputStream = new ZipOutputStream(response.getOutputStream());
for (int i = 0; i < condolenceList.size(); i++) {
Condolence con = condolenceList.get(i);
Record applyUser = userMap.get(con.getManager());
Record bzUser = userMap.get(con.getBe_user());
Record payUser = userMap.get(con.getPayee());
NutMap conMap = Lang.obj2map(con, NutMap.class);
typeList.forEach(item -> {
if (item.getId().equals(con.getType())) {
conMap.put(item.getCode(), "");
} else {
conMap.put(item.getCode(), "");
}
});
conMap.put("apply_time", DateUtil.format(DateUtil.parseDate(con.getApply_time()), "yyyy年MM月dd日"));
if (Strings.isNotBlank(con.getManager_sign())) {
Sys_signature signature = condolenceService.dao().fetch(Sys_signature.class, con.getManager_sign());
conMap.put("applySign", ViTool.poiBase64Image(signature.getData(), 100, 50));
}
if (Strings.isNotBlank(con.getUnion_chairman_review())) {
Review review = condolenceService.dao().fetch(Review.class, con.getUnion_chairman_review());
conMap.put("ucr", review.getSign() != null ? ViTool.poiBase64Image(review.getSign(), 130, 100) : null);
}
if (Strings.isNotBlank(con.getVice_chairman_review())) {
Review review = condolenceService.dao().fetch(Review.class, con.getVice_chairman_review());
conMap.put("vcr", review.getSign() != null ? ViTool.poiBase64Image(review.getSign(), 130, 100) : null);
}
conMap.put("bigMoney", Convert.digitToChinese(con.getMoney()));
conMap.put("be_username", bzUser.getString("username"));
conMap.put("be_loginname", bzUser.getString("loginname"));
conMap.put("be_unitname", bzUser.getString("unitname"));
conMap.put("m_loginname", payUser.getString("loginname"));
conMap.put("m_name", payUser.getString("username"));
String fileName = (i + 1) + bzUser.getString("username") + "职工慰问领取通知单.docx";
zipOutputStream.putNextEntry(new ZipEntry(fileName));
String officeTemplateUtilPath = officeTemplateUtil.getPath("condolence_pay");
assert officeTemplateUtilPath != null;
Configure config = Configure.builder().build();
XWPFTemplate.compile(officeTemplateUtilPath, config).render(conMap).write(zipOutputStream);
zipOutputStream.closeEntry();
}
zipOutputStream.flush();
zipOutputStream.close();
response.getOutputStream().close();
}
@At
@Ok("void")
@RequiresPermissions("fw.condolence.read")
public void exportApply(String id, HttpServletResponse response) throws Exception {
NutMap conMap = getData(id, null).get(0);
String fileName = Globals.schoolName + "在职教职工慰问金申请表";
response.addHeader("Content-Type", "application/octet-stream");
response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(fileName.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1) + "\".docx");
Configure config = Configure.builder().build();
XWPFTemplate.compile(officeTemplateUtil.getPath("condolence_apply"), config).render(conMap).writeAndClose(response.getOutputStream());
}
@At
@Ok("void")
@RequiresPermissions("fw.condolence.read")
public void exportAllApply(String year, HttpServletResponse response) throws Exception {
List<NutMap> mapList = getData(null, year);
//导出为一个压缩包
response.setContentType("application/octet-stream");
response.setHeader("content-disposition", "attachment;filename="
+ URLEncoder.encode("职工慰问金申请表.zip", "UTF-8"));
ZipOutputStream zipOutputStream = new ZipOutputStream(response.getOutputStream());
for (int i = 0; i < mapList.size(); i++) {
NutMap conMap = mapList.get(i);
String fileName = (i + 1) + conMap.getString("be_username") + "慰问金申请表.docx";
zipOutputStream.putNextEntry(new ZipEntry(fileName));
String officeTemplateUtilPath = officeTemplateUtil.getPath("condolence_apply");
assert officeTemplateUtilPath != null;
Configure config = Configure.builder().build();
XWPFTemplate.compile(officeTemplateUtilPath, config).render(conMap).write(zipOutputStream);
zipOutputStream.closeEntry();
}
zipOutputStream.flush();
zipOutputStream.close();
response.getOutputStream().close();
}
@At
@Ok("void")
@RequiresPermissions("fw.condolence.read")
public void exportSummary(String exportType, String conType, HttpServletResponse response) throws Exception {
CondolenceType condolenceType = condolenceService.dao().fetch(CondolenceType.class, conType);
response.setContentType("application/octet-stream");
response.setHeader("content-disposition", "attachment;filename="
+ URLEncoder.encode(condolenceType.getName() + "汇总表.zip", "UTF-8"));
Sql sql = Sqls.create("""
SELECT
con.*,
type.`name` type_name,
be.username be_username,
be.loginname be_loginname,
sqr.username sqr_username,
be.unitname be_unitname,
be.unionname be_unionname,
state.state_name,
state.state_color,
type.`code`,
year(apply_time) applyYear,
month(apply_time) applyMonth
FROM
condolence con
LEFT JOIN `user` be ON con.be_user = be.id
LEFT JOIN `user` sqr ON con.manager= sqr.id
LEFT JOIN state state ON state.state_id = con.state_id
LEFT JOIN condolence_type type ON type.id=con.type $condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("con.state_id", ">=", "2040");
cnd.andEX("con.type", "=", conType);
cnd.desc("con.apply_time");
sql.setCondition(cnd);
List<NutMap> listMap = condolenceService.listMap(sql);
Map<String, List<NutMap>> resultList = listMap.stream().collect(Collectors.groupingBy(o -> o.getString("year".equals(exportType) ? "applyYear" : "applyMonth")));
ZipOutputStream zipOutputStream = new ZipOutputStream(new BufferedOutputStream(response.getOutputStream()));
List<ExcelExportEntity> exportEntities = new ArrayList<>();
exportEntities.add(new ExcelExportEntity("慰问对象", "be_username", 20));
exportEntities.add(new ExcelExportEntity("慰问对象工号", "be_loginname", 20));
exportEntities.add(new ExcelExportEntity("申请人", "sqr_username", 20));
exportEntities.add(new ExcelExportEntity("所在工会", "be_unionname", 30));
exportEntities.add(new ExcelExportEntity("所在单位", "be_unitname", 30));
exportEntities.add(new ExcelExportEntity("联系方式", "mobile", 20));
exportEntities.add(new ExcelExportEntity("慰问类型", "type_name", 30));
exportEntities.add(new ExcelExportEntity("慰问金额", "money", 20));
exportEntities.add(new ExcelExportEntity("申请时间", "apply_time", 20));
for (String key : resultList.keySet()) {
try {
zipOutputStream.putNextEntry(new ZipEntry(key + ("year".equals(exportType) ? "" : "") + "慰问申请汇总表.xls"));
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), exportEntities, resultList.get(key));
workbook.write(zipOutputStream);
zipOutputStream.closeEntry();
} catch (Exception e) {
e.printStackTrace();
}
}
zipOutputStream.flush();
zipOutputStream.close();
}
public List<NutMap> getData(String id, String year) throws Exception {
List<CondolenceType> typeList = condolenceService.dao().query(CondolenceType.class, Cnd.NEW());
//查询用户
List<Record> userList = condolenceService.dao().query("user", Cnd.NEW());
Map<String, Record> userMap = userList.stream().collect(Collectors.toMap(o -> o.getString("id"), o -> o));
List<Condolence> condolenceList = condolenceService.query(Cnd.NEW().andEX("id", "=", id).andEX("year(apply_time)", "=", year));
List<NutMap> result = new ArrayList<>();
for (Condolence condolence : condolenceList) {
Record applyUser = userMap.get(condolence.getManager());
Record bzUser = userMap.get(condolence.getBe_user());
NutMap conMap = Lang.obj2map(condolence, NutMap.class);
conMap.put("apply_time", DateUtil.format(DateUtil.parseDate(condolence.getApply_time()), "yyyy年MM月dd日"));
if (Strings.isNotBlank(condolence.getUnion_chairman_review())) {
Review review = condolenceService.dao().fetch(Review.class, condolence.getUnion_chairman_review());
conMap.put("ucr", review.getSign() != null ? ViTool.poiBase64Image(review.getSign(), 110, 70) : null);
conMap.put("ucrOpinion", review.getOpinion());
}
if (Strings.isNotBlank(condolence.getVice_chairman_review())) {
Review review = condolenceService.dao().fetch(Review.class, condolence.getVice_chairman_review());
conMap.put("vcr", review.getSign() != null ? ViTool.poiBase64Image(review.getSign(), 110, 70) : null);
conMap.put("vcrOpinion", review.getOpinion());
}
conMap.put("sName", Globals.schoolName);
conMap.put("be_username", bzUser.getString("username"));
conMap.put("be_loginname", bzUser.getString("loginname"));
conMap.put("be_sex", bzUser.getString("sex"));
conMap.put("be_unitname", bzUser.getString("unitname"));
conMap.put("a_username", applyUser.getString("username"));
conMap.put("a_loginname", applyUser.getString("loginname"));
conMap.put("a_unitname", applyUser.getString("unitname"));
conMap.put("a_sex", applyUser.getString("sex"));
conMap.put("the_hospital", condolence.getThe_hospital());
conMap.put("h_num", condolence.getThe_hospital_house_num());
conMap.put("b_num", condolence.getThe_hospital_house_bed_num());
conMap.put("hospital_by", condolence.getHospital_by());
conMap.put("bigMoney", Convert.digitToChinese(condolence.getMoney()));
CondolenceType type = typeList.stream().filter(o -> o.getId().equals(conMap.getString("type"))).findAny().orElse(null);
conMap.put("typeName", type.getName());
String content = "慰问事由:" + condolence.getRemark();
if ("F".equals(type.getCode())) {
conMap.put("remark", content + "\n" + "去世者与本人关系:" + condolence.getDeadImmediateFamily());//直系亲属去世
} else if ("B".equals(type.getCode())) {
conMap.put("remark", content + "\n" + "孩次:" + condolence.getBirth_child_num());//生育
} else if ("C".equals(type.getCode())) {
conMap.put("remark", content
+ "\n" + "治疗医院:" + condolence.getThe_hospital()
+ "\n" + "病房号:" + condolence.getThe_hospital_house_num()
+ "\n" + "床号:" + condolence.getThe_hospital_house_bed_num());
} else if ("D".equals(type.getCode())) {
conMap.put("remark", content
+ "\n" + "治疗医院:" + condolence.getThe_hospital()
+ "\n" + "病房号:" + condolence.getThe_hospital_house_num()
+ "\n" + "床号:" + condolence.getThe_hospital_house_bed_num()
+ "\n" + "患病病种:" + condolence.getHospital_by());
} else {
conMap.put("remark", condolence.getRemark());//结婚、教职工去世
}
result.add(conMap);
}
return result;
}
}
@@ -0,0 +1,110 @@
package io.v.nutz.zhgh.zgfw.controller.condolence;
import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.service.ViService;
import io.v.nutz.zgfw.model.condolence.CondolenceType;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd;
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 zhf
* @date 2021/2/4 10:32
* @description 慰问类型管理
*/
@At("/platform/condolence/type")
@IocBean
@Ok("json")
public class CondolenceTypeMangeController {
@Inject("CondolenceType")
private ViService<CondolenceType> condolenceTypeViService;
@At("")
@Ok("beetl:/platform/zgfw/condolence/TypeMange.html")
@RequiresPermissions("fw.condolence.type")
public void index() {
}
@At
@ViReturn
@RequiresPermissions("fw.condolence.type")
public Object pageData(@Param(value = "searchName", required = false) String searchName,
@Param(value = "searchKeyword", required = false) String searchKeyword,
@Param("pageNumber") int pageNumber, @Param("pageSize") int pageSize,
@Param(value = "pageOrderName", required = false) String pageOrderName,
@Param(value = "pageOrderBy", required = false) String pageOrderBy) {
Cnd cnd = Cnd.NEW();
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
cnd.where().andLike(searchName, searchKeyword);
}
if (Strings.isNotBlank(pageOrderName) && Strings.isNotBlank(pageOrderBy)) {
cnd.orderBy(pageOrderName, pageOrderBy);
} else {
cnd.asc("code");
}
return Result.success().addData(condolenceTypeViService.listPage(pageNumber, pageSize, cnd));
}
@At
@ViReturn
@RequiresPermissions("fw.condolence.type")
public Object doAdd(CondolenceType type) {
if (condolenceTypeViService.count(Cnd.where("code", "=", type.getCode())) > 0) {
return Result.error().addMsg("编码重复");
}
condolenceTypeViService.insert(type);
return Result.success();
}
@At
@ViReturn
@RequiresPermissions("fw.condolence.type")
public Object doEdit(CondolenceType type) {
if (condolenceTypeViService.count(Cnd.where("code", "=", type.getCode()).and("id", "!=", type.getId())) > 0) {
return Result.error().addMsg("编码重复");
}
condolenceTypeViService.update(type);
return Result.success();
}
@At
@ViReturn
public Object findOne(String id) {
return Result.success(condolenceTypeViService.fetch(id));
}
@At
@ViReturn
@RequiresPermissions("fw.condolence.type")
public Object doDelete(String id) {
condolenceTypeViService.delete(id);
return Result.success();
}
@At
@ViReturn
public Object getAll() {
// return Result.success().addData(condolenceTypeViService.query(Cnd.where("isDisabled", "=", 0).asc("sortNum")));
return condolenceTypeViService.query(Cnd.NEW().asc("sortNum"));
}
}
@@ -0,0 +1,164 @@
package io.v.nutz.zhgh.zgfw.controller.condolence;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.model.Review;
import io.v.nutz.base.service.ReviewService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.handler.condolence.CondolenceToDoHandler;
import io.v.nutz.zhgh.zgfw.model.condolence.Condolence;
import io.v.nutz.zhgh.zgfw.service.CondolenceService;
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.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.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.List;
/**
* @Author: 1V
* @DateTime: 2020/11/20 11:49
* @Description: 院级工会主席审核
*/
@At({"/platform/fw/condolence/ucr", "/platform/fw/condolence/ucr/union"})
@IocBean
@RequiresAuthentication
@Ok("json")
public class CondolenceUcrCon {
@Inject
private Vi vi;
@Inject
private MsgApi msgApi;
@Inject
private CondolenceService condolenceService;
@Inject
private ReviewService reviewService;
@At("")
@Ok("beetl:/platform/zgfw/condolence/ucr.html")
@RequiresPermissions("fw.condolence.ucr")
public void index() {
}
@At
@ViReturn
@RequiresPermissions("fw.condolence.ucr")
public Object pageData(@Param(value = "year", required = false) String year,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "isAudit", required = false) Boolean isAudit,
@Param(value = "type", required = false) String type,
@Param(value = "way", required = false) String way,
@Param(value = "searchName", required = false) String searchName,
@Param(value = "searchKeyword", required = false) String searchKeyword,
@Param("pageNumber") int pageNumber, @Param("pageSize") int pageSize,
@Param(value = "pageOrderName", required = false) String pageOrderName,
@Param(value = "pageOrderBy", required = false) String pageOrderBy) {
Sql sql = Sqls.create("""
SELECT
con.*,
type.`name` type_name,
be.username be_username,
be.loginname be_loginname,
sqr.username sqr_username,
be.unitname be_unitname,
be.unionname be_unionname,
state.state_name,
state.state_color
FROM
condolence con
LEFT JOIN `user` be ON con.be_user = be.id
LEFT JOIN `user` sqr ON con.manager= sqr.id
LEFT JOIN state state ON state.state_id = con.state_id
LEFT JOIN condolence_type type ON type.id=con.type $condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("con.state_id", isAudit ? ">" : "=", 2000);
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
cnd.and("be.unionid", "=", vi.getUnionId());
}
Vi.cndPlus(cnd, "YEAR(con.apply_time)", "=", year);
Vi.cndPlus(cnd, "con.type", "=", type);
Vi.cndPlus(cnd, "con.way", "=", way);
Vi.cndPlus(cnd, "be.unitid", "=", unitId);
Vi.cndPlus(cnd, "be.unionid", "=", unionId);
if (Vi.isNotBlank(searchName, searchKeyword)) {
cnd.where().andLike(searchName, searchKeyword);
}
if (Vi.isNotBlank(pageOrderName, pageOrderBy)) {
cnd.orderBy(pageOrderName, pageOrderBy);
} else {
cnd.desc("con.apply_time");
}
sql.setCondition(cnd);
return condolenceService.listPage(pageNumber, pageSize, sql);
}
@At
@ViReturn
@RequiresPermissions("fw.condolence.ucr")
public Object doEdit(String id) {
condolenceService.update(Chain.make("state_id", 2000), Cnd.where("id", "=", id));
return null;
}
@At
@ViReturn
@RequiresPermissions("fw.condolence.ucr")
@Aop(TransAop.READ_COMMITTED)
public Object doReview(String id, Integer pass, Review review) {
review.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
review.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
review.setTime(DateUtil.getDate());
review = reviewService.insert(review);
Condolence condolence = condolenceService.fetch(id);
condolence.setUnion_chairman_review(review.getId());
if (pass == 1) {
condolence.setState_id("2010");
} else if (pass == 2) {
condolence.setState_id("2011");
} else {
condolence.setState_id("2012");
}
condolenceService.edit(condolence);
CondolenceToDoHandler.COMPLETE_UNION_TASK.exec(condolence, review.getOpinion());
// 1 拒绝;3 通过
if (pass == 1){
CondolenceToDoHandler.COMPLETE_PROCESS.exec(condolence, review.getOpinion());
} else if(pass == 2) {
CondolenceToDoHandler.CREATE_APPLY_RE_MODIFY_TASK.exec(condolence, review.getOpinion());
} else {
CondolenceToDoHandler.CREATE_FINANCE_TASK.exec(condolence,null);
}
return null;
}
}
@@ -0,0 +1,167 @@
package io.v.nutz.zhgh.zgfw.controller.condolence;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.model.Review;
import io.v.nutz.base.service.ReviewService;
import io.v.nutz.sys.models.Sys_msg;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.services.SysMsgService;
import io.v.nutz.sys.services.SysMsgUserService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zgfw.model.condolence.CondolenceType;
import io.v.nutz.zhgh.zgfw.handler.condolence.CondolenceToDoHandler;
import io.v.nutz.zhgh.zgfw.model.condolence.Condolence;
import io.v.nutz.zhgh.zgfw.service.CondolenceService;
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.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.List;
/**
* @Author: 1V
* @DateTime: 2020/11/20 11:49
* @Description: 校工会审核
*/
@At({"/platform/fw/condolence/vcr", "/platform/fw/condolence/vcr/school"})
@IocBean
@RequiresAuthentication
@Ok("json")
public class CondolenceVcrCon {
@Inject
private Vi vi;
@Inject
private SysMsgService sysMsgService;
@At("")
@Ok("beetl:/platform/zgfw/condolence/vcr.html")
@RequiresPermissions("fw.condolence.vcr")
public void index() {
}
@At
@ViReturn
@RequiresPermissions("fw.condolence.vcr")
public Object pageData(@Param(value = "year", required = false) String year,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "isAudit", required = false) Boolean isAudit,
@Param(value = "type", required = false) String type,
@Param(value = "way", required = false) String way,
@Param(value = "searchName", required = false) String searchName,
@Param(value = "searchKeyword", required = false) String searchKeyword,
@Param("pageNumber") int pageNumber, @Param("pageSize") int pageSize,
@Param(value = "pageOrderName", required = false) String pageOrderName,
@Param(value = "pageOrderBy", required = false) String pageOrderBy) {
Sql sql = Sqls.create("""
SELECT
con.*,
type.`name` type_name,
be.username be_username,
be.loginname be_loginname,
sqr.username sqr_username,
be.unitname be_unitname,
be.unionname be_unionname,
state.state_name,
state.state_color
FROM
condolence con
LEFT JOIN `user` be ON con.be_user = be.id
LEFT JOIN `user` sqr ON con.manager= sqr.id
LEFT JOIN state state ON state.state_id = con.state_id
LEFT JOIN condolence_type type ON type.id=con.type $condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("con.state_id", isAudit ? ">" : "=", 2020);
Vi.cndPlus(cnd, "YEAR(con.apply_time)", "=", year);
Vi.cndPlus(cnd, "con.type", "=", type);
Vi.cndPlus(cnd, "con.way", "=", way);
Vi.cndPlus(cnd, "be.unitid", "=", unitId);
Vi.cndPlus(cnd, "be.unionid", "=", unionId);
if (Vi.isNotBlank(searchName, searchKeyword)) {
cnd.where().andLike(searchName, searchKeyword);
}
if (Vi.isNotBlank(pageOrderName, pageOrderBy)) {
cnd.orderBy(pageOrderName, pageOrderBy);
} else {
cnd.desc("con.apply_time");
}
sql.setCondition(cnd);
return condolenceService.listPage(pageNumber, pageSize, sql);
}
@Inject
private CondolenceService condolenceService;
@Inject
private ReviewService reviewService;
@At
@ViReturn
@RequiresPermissions("fw.condolence.vcr")
@Aop(TransAop.READ_COMMITTED)
public Object doReview(String id, Integer pass, Review review) {
review.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
review.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
review.setTime(DateUtil.getDate());
review = reviewService.insert(review);
Condolence condolence = condolenceService.fetch(id);
condolence.setVice_chairman_review(review.getId());
if (pass == 1) {
condolence.setState_id("2030");
} else if (pass == 2) {
condolence.setState_id("2031");
} else if (pass == 4) {
condolence.setState_id("2050");
} else {
condolence.setState_id("2040");
}
condolenceService.updateIgnoreNull(condolence);
CondolenceToDoHandler.COMPLETE_SCHOOL_TASK.exec(condolence, review.getOpinion());
if (pass == 1) {
CondolenceToDoHandler.COMPLETE_PROCESS.exec(condolence, review.getOpinion());
} else if (pass == 2) {
CondolenceToDoHandler.CREATE_BACK_SCHOOL_TASK.exec(condolence, review.getOpinion());
}
CondolenceToDoHandler.COMPLETE_PROCESS.exec(condolence, null);
if (condolence.getState_id().equals("2040") || condolence.getState_id().equals("2050")) {
List<String> unionLeaders = condolenceService.getUnionLeader(condolence.getManager());
Sys_user beUser = condolenceService.dao().fetch(Sys_user.class, condolence.getBe_user());
CondolenceType condolenceType = condolenceService.dao().fetch(CondolenceType.class, condolence.getType());
String note = """
<p style="text-indent: 2em;">您的申报已审批通过,请参照以下提示跟进:</p><p style="text-indent: 2em;">1.慰问事项为生病住院、去世、直系亲属去世,慰问金线上申报审批完成后,不需要再提交纸质材料。</p><p style="text-indent: 2em;">2.慰问事项为结婚和生育的,审核通过后请将报销材料尽快提交至校工会(行政楼A426办公室)周学军老师处。注意:报销发票上须有分工会主席和经办人的签字;购买慰问品须有公务卡支付记录,如未使用公务卡,请提交支付记录和公务卡结算审批表(所在单位审核签字)。 </p><p style="text-indent: 2em;">3.各类慰问金每月结算一次。当月审核通过且报销材料提交齐全的,校工会将于次月第一周统一办理慰问金(慰问品报销)上卡,材料不齐全的推迟上卡。</p>
""";
for (String unionLeader : unionLeaders) {
sysMsgService.sendMsg(unionLeader,"【职工慰问】-" + beUser.getUsername(),note,ShiroUtil.getUserId());
}
}
return null;
}
}
@@ -0,0 +1,196 @@
package io.v.nutz.zhgh.zgfw.controller.condolence;
import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.service.ViService;
import io.v.nutz.zgfw.model.condolence.CondolenceType;
import io.v.nutz.zhgh.zgfw.service.CondolenceService;
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.Lang;
import org.nutz.lang.Strings;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
/**
* @author zhf
* @date 2021/2/4 15:36
* @description 慰问统计
*/
@At("/platform/fw/condolence/statistics")
@IocBean
@RequiresAuthentication
@Ok("json")
public class StatisticsController {
@Inject("CondolenceType")
private ViService<CondolenceType> condolenceTypeViService;
@Inject
private CondolenceService condolenceService;
@At("")
@Ok("beetl:/platform/zgfw/condolence/statistics.html")
@RequiresPermissions("fw.condolence.statistics")
public void index() {
}
@At
@ViReturn
@RequiresPermissions("fw.condolence.statistics")
public Object condolencesType(@Param(value = "year", required = false) Integer year,
@Param(value = "yearMonth", required = false) String[] yearMonth,
@Param(value = "unionid", required = false) String unionid,
@Param(value = "type", required = false) String type,
@Param(value = "way", required = false) String way,
@Param(value = "reiItemId", required = false) String reiItemId) {
Sql sql = Sqls.create("""
SELECT
rei.*,
be.username be_username,
state.stateName,
state.stateColor
FROM
`reimbursement_new` rei
LEFT JOIN `user` be ON be.id = rei.userId
LEFT JOIN audit_state state ON state.stateId = rei.state
WHERE rei.State=3100
$timeCnd
$unionidCnd
$typeCnd
$wayCnd
$reiItemIdCnd
""");
if (yearMonth != null && yearMonth.length == 2) {
String timeSql = StrUtil.format("AND DATE_FORMAT ( rei.applyTime,'%Y-%m' ) >= '{}' AND DATE_FORMAT ( rei.applyTime,'%Y-%m' ) <= '{}'", yearMonth[0], yearMonth[1]);
sql.setVar("timeCnd", timeSql);
}
if (Lang.isNotEmpty(year)) {
sql.setVar("yearCnd", "AND YEAR(rei.applyTime) = %s".formatted(year));
}
if (Strings.isNotBlank(unionid)) {
sql.setVar("unionidCnd", String.format("AND rei.unionId = '%s' ", unionid));
}
if (Strings.isNotBlank(type)) {
sql.setVar("typeCnd", String.format("AND con.type = '%s' ", type));
}
if (Strings.isNotBlank(way)) {
sql.setVar("wayCnd", String.format("AND con.way = '%s' ", way));
}
if (Strings.isNotBlank(reiItemId)) {
sql.setVar("reiItemIdCnd", String.format("AND rei.reimbursementItemId = '%s' ", reiItemId));
}
return condolenceTypeViService.list(sql);
}
@At
@ViReturn
@RequiresPermissions("fw.condolence.statistics")
public Object condolencesType2(@Param(value = "year", required = false) String year,
@Param(value = "unionid", required = false) String unionid,
@Param(value = "type", required = false) String type,
@Param(value = "way", required = false) String way) {
Sql sql = Sqls.create("""
SELECT
type.`name`,
type.`code`,
(
SELECT
COUNT(*)
FROM
condolence con
LEFT JOIN `user` us ON us.id = con.be_user
WHERE
type.id = con.type
$yearCnd
$unionidCnd
$typeCnd
$wayCnd
) `value`
FROM
condolence_type type $condition
""");
if (Strings.isNotBlank(year)) {
sql.setVar("yearCnd", String.format("AND YEAR ( con.apply_time )= %s ", year));
}
if (Strings.isNotBlank(unionid)) {
sql.setVar("unionidCnd", String.format("AND us.unionid = '%s' ", unionid));
}
if (Strings.isNotBlank(type)) {
sql.setVar("typeCnd", String.format("AND con.type = '%s' ", type));
}
if (Strings.isNotBlank(way)) {
sql.setVar("wayCnd", String.format("AND con.way = '%s' ", way));
}
Cnd cnd = Cnd.NEW();
cnd.asc("type.location");
sql.setCondition(cnd);
return condolenceTypeViService.list(sql);
}
@At
@ViReturn
@RequiresPermissions("fw.condolence.statistics")
public Object pageData(@Param(value = "reiItemId", required = false) String reiItemId,
@Param(value = "unionid", required = false) String unionid, @Param("yearMonth") String[] yearMonth,
@Param(value = "type", required = false) String type,
@Param(value = "way", required = false) String way,
@Param(value = "searchName", required = false) String searchName,
@Param(value = "searchKeyword", required = false) String searchKeyword,
@Param("pageNumber") int pageNumber, @Param("pageSize") int pageSize,
@Param(value = "pageOrderName", required = false) String pageOrderName,
@Param(value = "pageOrderBy", required = false) String pageOrderBy) {
Sql sql = Sqls.create("""
SELECT
rei.*,
be.username be_username,
state.stateName,
state.stateColor
FROM
`reimbursement_new` rei
LEFT JOIN `user` be ON be.id = rei.userId
LEFT JOIN audit_state state ON state.stateId = rei.state $condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("rei.State", "=", 3100);
if (null != yearMonth && yearMonth.length == 2) {
Vi.cndPlus(cnd, "DATE_FORMAT ( rei.applyTime,'%Y-%m' )", ">=", yearMonth[0]);
Vi.cndPlus(cnd, "DATE_FORMAT ( rei.applyTime,'%Y-%m' )", "<=", yearMonth[1]);
}
Vi.cndPlus(cnd, "rei.unionId", "=", unionid);
Vi.cndPlus(cnd, "rei.reimbursementItemId", "=", reiItemId);
if (Vi.isNotBlank(searchName, searchKeyword)) {
cnd.where().andLike(searchName, searchKeyword);
}
if (Vi.isNotBlank(pageOrderName, pageOrderBy)) {
cnd.orderBy(pageOrderName, pageOrderBy);
} else {
cnd.asc("rei.State");
cnd.desc("rei.applyTime");
}
sql.setCondition(cnd);
return condolenceService.listPageMap(pageNumber, pageSize, sql);
}
}
@@ -0,0 +1,159 @@
package io.v.nutz.zhgh.zgfw.controller.difficult;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSON;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.AuditService;
import io.v.nutz.sys.models.Sys_local_process_instance;
import io.v.nutz.sys.models.Sys_local_process_instance_task;
import io.v.nutz.sys.services.SysLocalProcessService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.handler.difficult.DifficultToDoHandler;
import io.v.nutz.zhgh.zgfw.model.difficult.Zgfw_knbf;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfService;
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.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
@At("/platform/difficulty/branchUnionAudit")
@Ok("json:full")
@IocBean
public class DifficultBranchUnionAuditController {
@Inject
private ZgfwKnbfService zgfwKnbfService;
@Inject
private AuditService auditService;
@Inject
private Vi vi;
@Inject
private Dao dao;
@Inject
private SysLocalProcessService sysLocalProcessService;
@At("")
@Ok("beetl:/platform/zgfw/difficulty/branchUnionAudit.html")
@RequiresPermissions("difficulty.branchUnionAudit")
public void index() {
}
@At("/h5")
@Ok("beetl:/mobile/difficulty/branchunionaudit/index.html")
@RequiresPermissions("difficulty.branchUnionAudit")
public void h5() {
}
@At
@ViReturn
@RequiresPermissions("difficulty.branchUnionAudit")
public Object pageData(@Param(value = "isAudit", required = false) Boolean isAudit,
@Param(value = "year", required = false) Integer year,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "unionId", required = false) String unionId, PageForm page) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
info.*,
s.state_name
FROM
`zgfw_knbf` info
LEFT JOIN state s ON s.state_id = info.stateId
$condition
""");
cnd.and("info.stateId", isAudit ? ">" : "=", 3000);
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
cnd.and("info.unionId", "=", Vi.getUnionId());
}
cnd.andEX("YEAR(info.applyTime)", "=", year);
cnd.andEX("info.unitId", "=", unitId);
cnd.andEX("info.unionId", "=", unionId);
if (StrUtil.isNotBlank(page.getSearchKeyword())) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.orLike("info.userName", page.getSearchKeyword());
seg.orLike("info.loginName", page.getSearchKeyword());
cnd.and(seg);
}
sql.setCondition(cnd);
Pagination pagination = zgfwKnbfService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
return Result.success(pagination);
}
@At
@ViReturn
@RequiresPermissions("difficulty.branchUnionAudit")
@Aop(TransAop.READ_COMMITTED)
public Result doEdit(String id) {
dao.update(Zgfw_knbf.class, Chain.make("stateId", 3000)
.add("branchUnionAuditId", null),
Cnd.where("id", "=", id));
//待办撤回
sysLocalProcessService.revokeTask("zgfw_knbf@" + id, "分工会审核");
return Result.success();
}
@At
@ViReturn
@RequiresPermissions("difficulty.branchUnionAudit")
@Aop(TransAop.READ_COMMITTED)
public Object doReview(String id, Integer pass, double money, Audit audit) {
audit.setAuditor(ShiroUtil.getPrincipalProperty("id").toString());
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
audit.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
audit.setAuditTime(new Date());
audit.setExt(JSONUtil.parseObj(Map.of("money", money)));
audit = dao.insert(audit);
Zgfw_knbf zgfw_knbf = zgfwKnbfService.fetch(id);
if (pass == 1) {
//不通过
zgfw_knbf.setStateId(3010);
} else if (pass == 2) {
//退回
zgfw_knbf.setStateId(3020);
} else {
//通过
zgfw_knbf.setStateId(3030);
}
zgfw_knbf.setBranchUnionAuditId(audit.getId());
zgfwKnbfService.updateIgnoreNull(zgfw_knbf);
if (pass == 2) {
DifficultToDoHandler.CREATE_APPLY_RE_MODIFY_TASK.exec(zgfw_knbf);
} else if (pass == 3) {
DifficultToDoHandler.CREATE_FINANCE_TASK.exec(zgfw_knbf);
}
DifficultToDoHandler.COMPLETE_UNION_TASK.exec(zgfw_knbf);
return null;
}
}
@@ -0,0 +1,29 @@
package io.v.nutz.zhgh.zgfw.controller.difficult;
import cn.wizzer.framework.base.Result;
import io.v.nutz.base.model.Audit;
import io.v.nutz.zhgh.zgfw.model.difficult.Zgfw_knbf;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Dao;
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.Ok;
@IocBean
@At("/platform/difficulty/common")
@Ok("json:full")
public class DifficultCommonController {
@Inject
private Dao dao;
@At
@RequiresPermissions("difficulty")
public Result findOne(String id) {
Zgfw_knbf knbf = dao.fetch(Zgfw_knbf.class, id);
dao.fetchLinks(knbf, null);
return Result.success(knbf);
}
}
@@ -0,0 +1,469 @@
package io.v.nutz.zhgh.zgfw.controller.difficult;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.page.Pagination;
import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure;
import com.deepoove.poi.data.PictureRenderData;
import com.deepoove.poi.data.PictureType;
import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.utils.OfficeTemplateUtil;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.utils.ViTool;
import io.v.nutz.web.commons.base.Globals;
import io.v.nutz.web.commons.utils.FileUtil;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.sys.models.Sys_file;
import io.v.nutz.sys.models.Sys_signature;
import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.services.SysUnionService;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.zhgh.zgfw.model.difficult.Zgfw_knbf;
import io.v.nutz.zhgh.zgfw.model.difficult.Zgfw_knbf_jtcy;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfJtcyService;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfService;
import org.apache.commons.io.IOUtils;
import org.apache.poi.ss.usermodel.Workbook;
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.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
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.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
@IocBean
@Ok("json")
@At("/platform/difficulty/reading")
public class DifficultReadingController {
@Inject
private Dao dao;
@Inject
private ZgfwKnbfService zgfwKnbfService;
@Inject
private FtpService ftpService;
@Inject
private SysUserService sysUserService;
@Inject
private SysUnionService sysUnionService;
@Inject
private BaseService baseService;
@Inject
private Vi vi;
@Inject
private OfficeTemplateUtil officeTemplateUtil;
@At("")
@Ok("beetl:/platform/zgfw/difficulty/reading.html")
@RequiresPermissions("difficulty.reading")
public void index() {
}
@At()
@ViReturn
@RequiresPermissions("difficulty.reading")
public Object pageData(@Param(value = "dateRange", required = false) String[] dateRange,
@Param(value = "year", required = false) Integer year,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "unionId", required = false) String unionId,
PageForm page) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
info.*,
s.state_name
FROM
`zgfw_knbf` info
LEFT JOIN state s ON s.state_id = info.stateId
$condition
""");
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
cnd.and("info.unionId", "=", Vi.getUnionId());
}
// cnd.andEX("YEAR(info.applyTime)", "=", year);
cnd.andEX("info.unitId", "=", unitId);
cnd.andEX("info.unionId", "=", unionId);
if (StrUtil.isAllNotBlank(page.getSearchName(), page.getSearchKeyword())) {
cnd.and(Cnd.likeEX(page.getSearchName(), page.getSearchKeyword()));
}
if (dateRange != null && dateRange.length == 2) {
cnd.and("info.applyTime", ">=", dateRange[0]);
cnd.and("info.applyTime", "<=", dateRange[1]);
}
sql.setCondition(cnd);
Pagination pagination = zgfwKnbfService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
return Result.success(pagination);
}
@At
@ViReturn
@RequiresPermissions("difficulty.reading")
public Object findOne(String id) {
return zgfwKnbfService.findOne(id);
}
/**
* 导出报销表
*
* @param id
* @param response
* @throws Exception
*/
@At
@Ok("void")
@ViReturn
@RequiresPermissions("difficulty.reading")
public void doExport(@Param("id") String id, HttpServletResponse response) throws Exception {
Zgfw_knbf_jtcy knbf = zgfwKnbfJtcyService.fetch(id);
dao.fetchLinks(knbf, null);
Record record = zgfwKnbfService.findOne(id);
record.put("knbf", "");
Object app = record.get("app");
if (app != null) {
Sys_signature signature = (Sys_signature) app;
if (Strings.isNotBlank(signature.getData())) {
record.set("appimg", ((Sys_signature) app).getData() != null ? getImg(((Sys_signature) app).getData()) : null);
}
}
Object upa = record.get("upa");
if (upa != null) {
Audit audit = (Audit) upa;
record.set("upaimg", audit.getAuditSign() != null ? getImg(audit.getAuditSign()) : null);
}
Object sua = record.get("sua");
if (sua != null) {
Audit audit = (Audit) sua;
record.set("suaimg", audit.getAuditSign() != null ? getImg(audit.getAuditSign()) : null);
}
record.set("subsidy_amount_big", Convert.digitToChinese(record.getDouble("xghbzje")));
Configure config = Configure.newBuilder().build();
String suffix = "领取通知单";
//InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("docTemplate/difficulty/knbf_reimbursement.docx");
response.addHeader("Content-Type", "application/octet-stream");
response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(suffix.getBytes("UTF-8"), "ISO-8859-1") + "\".docx");
XWPFTemplate.compile(officeTemplateUtil.getPath("knbf_pay"), config).render(record).writeAndClose(response.getOutputStream());
}
/**
* 导出备案表
*
* @param id
* @param response
* @throws Exception
*/
@At
@Ok("void")
@RequiresPermissions("difficulty.reading")
public void export(@Param("id") String id, HttpServletResponse response) throws Exception {
String suffix = "江南大学工会会员困难补助申请表";
response.addHeader("Content-Type", "application/octet-stream");
response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(suffix.getBytes("UTF-8"), "ISO-8859-1") + "\".docx");
ServletOutputStream outputStream = response.getOutputStream();
Zgfw_knbf knbf = dao.fetch(Zgfw_knbf.class, id);
dao.fetchLinks(knbf, null);
Map<String, Object> renderData = BeanUtil.beanToMap(knbf);
renderData.put("birthday", DateUtil.format(knbf.getBirthday(), "yyyy-MM-dd"));
renderData.put("applyDateTime", DateUtil.format(knbf.getApplyTime(), "yyyy年MM月dd日"));
if (ObjectUtil.isNotNull(knbf.getBranchUnionAudit())) {
String sign = knbf.getBranchUnionAudit().getAuditSign();
ByteArrayOutputStream os = new ByteArrayOutputStream();
ftpService.download(sign, os);
os.close();
renderData.put("branchUnionAuditSign", new PictureRenderData(70, 30, PictureType.PNG, os.toByteArray()));
}
if (ObjectUtil.isNotNull(knbf.getSchoolUnionInitialAudit())) {
String sign = knbf.getBranchUnionAudit().getAuditSign();
ByteArrayOutputStream os = new ByteArrayOutputStream();
ftpService.download(sign, os);
os.close();
renderData.put("schoolUnionInitialAuditSign", new PictureRenderData(70, 30, PictureType.PNG, os.toByteArray()));
}
if (ObjectUtil.isNotNull(knbf.getSchoolUnionFinalAudit())) {
String sign = knbf.getBranchUnionAudit().getAuditSign();
ByteArrayOutputStream os = new ByteArrayOutputStream();
ftpService.download(sign, os);
os.close();
renderData.put("schoolUnionFinalAuditSign", new PictureRenderData(70, 30, PictureType.PNG, os.toByteArray()));
}
HackLoopTableRenderPolicy policy = new HackLoopTableRenderPolicy();
Configure config = Configure.builder().bind("familyList", policy).build();
String officeTemplateUtilPath = officeTemplateUtil.getPath("knbf_apply");
XWPFTemplate.compile(officeTemplateUtilPath, config).render(renderData, outputStream);
outputStream.close();
}
@Inject
private ZgfwKnbfJtcyService zgfwKnbfJtcyService;
private void Export(String id, OutputStream outputStream) throws Exception {
Record record = zgfwKnbfService.findOne(id);
List<Record> recordList = zgfwKnbfJtcyService.list(Sqls.create("select * from zgfw_knbf_jtcy where sqid = @id").setParam("id", id));
HackLoopTableRenderPolicy policy = new HackLoopTableRenderPolicy();
Configure config = Configure.newBuilder().bind("familyList", policy).build();
if (!recordList.isEmpty()) {
record.set("familyList", recordList);
}
/* if (record.getInt("sq_bzlx") == 1) {
record.set("bzlx_name", "日常补助慰问");
} else if (record.getInt("sq_bzlx") == 2) {
record.set("bzlx_name", "“元旦、春节”困难补助慰问");
}*/
//分工会
Object app = record.get("app");
if (app != null) {
Sys_signature signature = (Sys_signature) app;
if (Strings.isNotBlank(signature.getData())) {
record.set("appimg", ((Sys_signature) app).getData() != null ? getImg(((Sys_signature) app).getData()) : null);
}
}
//分工会
Object upa = record.get("upa");
if (upa != null) {
Audit audit = (Audit) upa;
record.set("upaimg", audit.getAuditSign() != null ? getImg(audit.getAuditSign()) : null);
record.set("upaTime", audit.getAuditTime() != null ? DateUtil.formatDate(audit.getAuditTime()) : null);
record.set("upaOpinion", audit.getAuditOpinion());
}
//二级党委组织
Object tda = record.get("tda");
if (tda != null) {
Audit audit = (Audit) tda;
record.set("tdaimg", audit.getAuditSign() != null ? getImg(audit.getAuditSign()) : null);
record.set("tdaTime", audit.getAuditTime() != null ? DateUtil.formatDate(audit.getAuditTime()) : null);
record.set("tdaOpinion", audit.getAuditOpinion());
}
//校工会主席
Object sma = record.get("sma");
if (sma != null) {
Audit audit = (Audit) sma;
record.set("smaimg", audit.getAuditSign() != null ? getImg(audit.getAuditSign()) : null);
record.set("smaTime", audit.getAuditTime() != null ? DateUtil.formatDate(audit.getAuditTime()) : null);
record.set("smaOpinion", audit.getAuditOpinion());
}
if (Strings.isNotBlank(record.getString("xghbzje"))) {
record.set("subsidy_amount_big", Convert.digitToChinese(record.getDouble("xghbzje")));
}
record.set("schoolName", Globals.schoolName);
InputStream inputStream;
String officeTemplateUtilPath = officeTemplateUtil.getPath("knbf_apply");
/* if (record.getString("sq_knlx").equals("1")) {
officeTemplateUtilPath = officeTemplateUtil.getPath("knbf_sick");
} else if (record.getString("sq_knlx").equals("3")) {
officeTemplateUtilPath = officeTemplateUtil.getPath("knbf_die");
} else {
officeTemplateUtilPath = officeTemplateUtil.getPath("knbf_summary");
}*/
assert officeTemplateUtilPath != null;
XWPFTemplate.compile(officeTemplateUtilPath, config).render(record, outputStream);
}
/**
* 下载备案表和附件
*
* @param id
* @param response
* @throws Exception
*/
@At
@ViReturn
@RequiresPermissions("difficulty.reading")
public void downloadAnnex(@Param("id") String id, HttpServletResponse response) throws Exception {
// response.reset();
// response.setContentType("application/x-msdownload;charset=utf-8");
//
// String fileName = "";
//
// Zgfw_knbf zgfwKnbf = zgfwKnbfService.fetch(id);
// Sys_user user = sysUserService.fetchLinks(sysUserService.fetch(zgfwKnbf.getBbzrusername()), "unit");
// if (user.getUnit() != null && Strings.isNotBlank(user.getUnit().getUnionid())) {
// Sys_union union = sysUnionService.fetch(user.getUnit().getUnionid());
// fileName += union.getUnionname() + "-";
// }
// fileName += user.getUsername();
//
// List<Sys_file> files = zgfwKnbf.getFiles();
//
// /**
// * 创建临时文件夹
// */
// String tmpPath = "tmp/" + R.UU32();
// File tmpDir = new File(tmpPath + "/" + fileName);
// tmpDir.mkdirs();
//
// if (files != null) {
// for (Sys_file file : files) {
// FileOutputStream outputStream = new FileOutputStream(tmpDir.getPath() + "/" + file.getFilename());
// ftpService.download(file.getFilepath(), outputStream);
// outputStream.close();
// }
// }
//
// FileOutputStream outputStream = new FileOutputStream(tmpDir.getPath() + "/" + "职工慰问报销审批单.docx");
// Export(id, outputStream);
// outputStream.close();
//
// String aimsDir = "zipTmp/" + R.UU32();
// String aimsName = fileName + ".zip";
// String aimsPath = aimsDir + "/" + aimsName;
// FileUtil.compressToZip(tmpDir.getPath(), aimsDir, aimsName);
//
// response.setHeader("content-disposition", "attachment;filename="
// + URLEncoder.encode(aimsName, "UTF-8"));
//
// File aimsFile = new File(aimsPath);
// FileInputStream inputStream = new FileInputStream(aimsFile);
// IOUtils.copy(inputStream, response.getOutputStream());
// inputStream.close();
// aimsFile.delete();
//
// FileUtil.deleteDir(new File(tmpPath));
// FileUtil.deleteDir(new File(aimsDir));
}
@At
@Ok("void")
@RequiresPermissions("difficulty.reading")
public void doExcel(@Param(value = "year", required = false) Integer year,
@Param(value = "dateRange", required = false) String[] dateRange,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "unitId", required = false) String unitId, HttpServletResponse response) throws IOException {
Sql sql = Sqls.create("""
SELECT
info.userName,
info.loginName,
info.unitName,
info.unionName,
info.applyTime,
info.mobile,
info.subsidyStandards,
s.state_name,
branchUnionAudit.auditOpinion AS branchUnionAuditOpinion,
schoolUnionInitialAudit.auditOpinion AS schoolUnionInitialAuditOpinion,
schoolUnionFinalAudit.auditOpinion AS schoolUnionFinalAuditOpinion,
JSON_EXTRACT( branchUnionAudit.ext, '$.money' ) AS branchUnionAuditMoney,
JSON_EXTRACT( schoolUnionInitialAudit.ext, '$.money' ) AS schoolUnionInitialAuditMoney,
JSON_EXTRACT( schoolUnionFinalAudit.ext, '$.money' ) AS schoolUnionFinalAuditMoney
FROM
zgfw_knbf info
LEFT JOIN state s ON s.state_id = info.stateId
LEFT JOIN audit branchUnionAudit ON branchUnionAudit.id = info.branchUnionAuditId
LEFT JOIN audit schoolUnionInitialAudit ON schoolUnionInitialAudit.id = info.schoolUnionInitialAuditId
LEFT JOIN audit schoolUnionFinalAudit ON schoolUnionFinalAudit.id = info.schoolUnionFinalAuditId
$condition
""");
Map<String, Object> map = new HashMap<>();
Cnd cnd = Cnd.where("info.stateId", "=", 3090);
if (dateRange != null && dateRange.length == 2) {
cnd.and("info.applyTime", ">=", dateRange[0]);
cnd.and("info.applyTime", "<=", dateRange[1]);
}
cnd.andEX("info.unionId", "=", unionId);
cnd.andEX("info.unitId", "=", unitId);
cnd.asc("info.applyTime");
sql.setCondition(cnd);
List<NutMap> list = sysUserService.listMap(sql);
ViTool.excelResponse(response, "困难补助汇总表.xlsx");
List<ExcelExportEntity> entities = new ArrayList<>();
entities.add(new ExcelExportEntity("工号", "loginName", 20));
entities.add(new ExcelExportEntity("姓名", "userName", 20));
entities.add(new ExcelExportEntity("单位", "unitName", 20));
entities.add(new ExcelExportEntity("部门", "unionName", 20));
entities.add(new ExcelExportEntity("申请时间", "applyTime", 20));
entities.add(new ExcelExportEntity("联系电话", "mobile", 20));
entities.add(new ExcelExportEntity("类别", "subsidyStandards", 20));
entities.add(new ExcelExportEntity("分工会审核意见", "branchUnionAuditOpinion", 20));
entities.add(new ExcelExportEntity("分工会审核金额", "branchUnionAuditMoney", 20));
entities.add(new ExcelExportEntity("校工会初审意见", "schoolUnionInitialAuditOpinion", 20));
entities.add(new ExcelExportEntity("校工会初审金额", "schoolUnionInitialAuditMoney", 20));
entities.add(new ExcelExportEntity("工会常委会审核意见", "schoolUnionFinalAuditOpinion", 20));
entities.add(new ExcelExportEntity("工会常委会审核金额", "schoolUnionFinalAuditMoney", 20));
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, list);
workbook.write(response.getOutputStream());
response.getOutputStream().close();
workbook.close();
}
private PictureRenderData getImg(String base64) throws IOException {
String s = base64.split(",")[1];
byte[] bytes = Base64.getDecoder().decode(s);
return new PictureRenderData(70, 30, ".png", bytes);
}
}
@@ -0,0 +1,155 @@
package io.v.nutz.zhgh.zgfw.controller.difficult;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.AuditService;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.sys.models.Sys_local_process_instance;
import io.v.nutz.sys.models.Sys_local_process_instance_task;
import io.v.nutz.sys.services.SysLocalProcessService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.handler.difficult.DifficultToDoHandler;
import io.v.nutz.zhgh.zgfw.model.difficult.Zgfw_knbf;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfService;
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.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
@At("/platform/difficulty/schoolUnionFinalAudit")
@Ok("json:full")
@IocBean
public class DifficultSchoolUnionFinalAuditController {
@Inject
private ZgfwKnbfService zgfwKnbfService;
@Inject
private AuditService auditService;
@Inject
private Dao dao;
@Inject
private SysLocalProcessService sysLocalProcessService;
@At("")
@Ok("beetl:/platform/zgfw/difficulty/schoolUnionFinalAudit.html")
@RequiresPermissions("difficulty.schoolUnionFinalAudit")
public void index() {
}
@At("/h5")
@Ok("beetl:/mobile/difficulty/schoolunionfinalaudit/index.html")
@RequiresPermissions("difficulty.schoolUnionInitialAudit")
public void h5() {
}
@At
@ViReturn
@RequiresPermissions("difficulty.schoolUnionFinalAudit")
public Object pageData(@Param(value = "isAudit", required = false) Boolean isAudit,
@Param(value = "year", required = false) Integer year,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "unionId", required = false) String unionId, PageForm page) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
info.*,
s.state_name
FROM
`zgfw_knbf` info
LEFT JOIN state s ON s.state_id = info.stateId
$condition
""");
cnd.and("info.stateId", isAudit ? ">" : "=", 3060);
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
cnd.and("info.unionId", "=", Vi.getUnionId());
}
cnd.andEX("YEAR(info.applyTime)", "=", year);
cnd.andEX("info.unitId", "=", unitId);
cnd.andEX("info.unionId", "=", unionId);
if (StrUtil.isNotBlank(page.getSearchKeyword())) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.orLike("info.userName", page.getSearchKeyword());
seg.orLike("info.loginName", page.getSearchKeyword());
cnd.and(seg);
}
sql.setCondition(cnd);
Pagination pagination = zgfwKnbfService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
return Result.success(pagination);
}
@At
@ViReturn
@RequiresPermissions("difficulty.schoolUnionFinalAudit")
@Aop(TransAop.READ_COMMITTED)
public Object doReview(String id, Integer pass, Audit audit, double money) {
audit.setAuditor(ShiroUtil.getPrincipalProperty("id").toString());
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
audit.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
audit.setAuditTime(new Date());
audit.setExt(JSONUtil.parseObj(Map.of("money", money)));
audit = dao.insert(audit);
Zgfw_knbf zgfw_knbf = zgfwKnbfService.fetch(id);
if (pass == 1) {
//不通过
zgfw_knbf.setStateId(3070);
} else if (pass == 2) {
//退回
zgfw_knbf.setStateId(3080);
} else {
//通过
zgfw_knbf.setStateId(3090);
}
zgfw_knbf.setSchoolUnionFinalAuditId(audit.getId());
zgfwKnbfService.updateIgnoreNull(zgfw_knbf);
if (pass == 1){
DifficultToDoHandler.CREATE_APPLY_RE_MODIFY_TASK.exec(zgfw_knbf);
} else if (pass == 2){
DifficultToDoHandler.COMPLETE_PROCESS.exec(zgfw_knbf);
}
DifficultToDoHandler.COMPLETE_SCHOOL_TASK.exec(zgfw_knbf);
return null;
}
@At
@ViReturn
@RequiresPermissions("difficulty.schoolUnionFinalAudit")
@Aop(TransAop.READ_COMMITTED)
public Result doEdit(String id) {
dao.update(Zgfw_knbf.class, Chain.make("stateId", 3060)
.add("schoolUnionFinalAuditId", null)
, Cnd.where("id", "=", id));
//待办撤回
sysLocalProcessService.revokeTask("zgfw_knbf@" + id,"工会常委会审核");
return Result.success();
}
}
@@ -0,0 +1,224 @@
package io.v.nutz.zhgh.zgfw.controller.difficult;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.AuditService;
import io.v.nutz.base.utils.ViTool;
import io.v.nutz.sys.services.SysLocalProcessService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.handler.difficult.DifficultToDoHandler;
import io.v.nutz.zhgh.zgfw.model.difficult.Zgfw_knbf;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfService;
import org.apache.poi.ss.usermodel.Workbook;
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.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
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.io.IOException;
import java.util.*;
@At("/platform/difficulty/schoolUnionInitialAudit")
@Ok("json:full")
@IocBean
public class DifficultSchoolUnionInitialAuditController {
@Inject
private ZgfwKnbfService zgfwKnbfService;
@Inject
private AuditService auditService;
@Inject
private Vi vi;
@Inject
private Dao dao;
@Inject
private SysLocalProcessService sysLocalProcessService;
@At("")
@Ok("beetl:/platform/zgfw/difficulty/schoolUnionInitialAudit.html")
@RequiresPermissions("difficulty.schoolUnionInitialAudit")
public void index() {
}
@At("/h5")
@Ok("beetl:/mobile/difficulty/schoolunioninitialaudit/index.html")
@RequiresPermissions("difficulty.schoolUnionInitialAudit")
public void h5() {
}
@At
@ViReturn
@RequiresPermissions("difficulty.schoolUnionInitialAudit")
public Object pageData(@Param(value = "isAudit", required = false) Boolean isAudit,
@Param(value = "year", required = false) Integer year,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "unionId", required = false) String unionId, PageForm page) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
info.*,
s.state_name
FROM
`zgfw_knbf` info
LEFT JOIN state s ON s.state_id = info.stateId
$condition
""");
cnd.and("info.stateId", isAudit ? ">" : "=", 3030);
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
cnd.and("info.unionId", "=", Vi.getUnionId());
}
cnd.andEX("YEAR(info.applyTime)", "=", year);
cnd.andEX("info.unitId", "=", unitId);
cnd.andEX("info.unionId", "=", unionId);
if (StrUtil.isNotBlank(page.getSearchKeyword())) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.orLike("info.userName", page.getSearchKeyword());
seg.orLike("info.loginName", page.getSearchKeyword());
cnd.and(seg);
}
sql.setCondition(cnd);
Pagination pagination = zgfwKnbfService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
return Result.success(pagination);
}
@At
@ViReturn
@RequiresPermissions("difficulty.schoolUnionInitialAudit")
@Aop(TransAop.READ_COMMITTED)
public Object doReview(String id, Integer pass, Audit audit, double money) {
audit.setAuditor(ShiroUtil.getPrincipalProperty("id").toString());
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
audit.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
audit.setAuditTime(new Date());
audit.setExt(JSONUtil.parseObj(Map.of("money", money)));
audit = dao.insert(audit);
Zgfw_knbf zgfw_knbf = zgfwKnbfService.fetch(id);
if (pass == 1) {
//不通过
zgfw_knbf.setStateId(3040);
} else if (pass == 2) {
//退回
zgfw_knbf.setStateId(3050);
} else {
//通过
zgfw_knbf.setStateId(3060);
}
zgfw_knbf.setSchoolUnionInitialAuditId(audit.getId());
zgfwKnbfService.updateIgnoreNull(zgfw_knbf);
if (pass == 2) {
DifficultToDoHandler.CREATE_APPLY_RE_MODIFY_TASK.exec(zgfw_knbf);
} else if (pass == 3) {
DifficultToDoHandler.CREATE_SCHOOL_TASK.exec(zgfw_knbf);
}
DifficultToDoHandler.COMPLETE_FINANCE_TASK.exec(zgfw_knbf);
return null;
}
@At
@ViReturn
@RequiresPermissions("difficulty.schoolUnionInitialAudit")
@Aop(TransAop.READ_COMMITTED)
public Result doEdit(String id) {
dao.update(Zgfw_knbf.class, Chain.make("stateId", 3030)
.add("schoolUnionInitialAuditId", null)
, Cnd.where("id", "=", id));
//待办撤回
sysLocalProcessService.revokeTask("zgfw_knbf@" + id, "校工会初审");
return Result.success();
}
@At
@Ok("void")
@RequiresPermissions("difficulty.schoolUnionInitialAudit")
public void exportExcel(@Param(value = "year", required = false) Integer year,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "unitId", required = false) String unitId,
HttpServletResponse response) throws IOException {
Sql sql = Sqls.create("""
SELECT
info.userName,
info.loginName,
info.unitName,
info.unionName,
info.applyTime,
info.mobile,
info.subsidyStandards,
s.state_name,
branchUnionAudit.auditOpinion AS branchUnionAuditOpinion,
schoolUnionInitialAudit.auditOpinion AS schoolUnionInitialAuditOpinion,
schoolUnionFinalAudit.auditOpinion AS schoolUnionFinalAuditOpinion,
JSON_EXTRACT( branchUnionAudit.ext, '$.money' ) AS branchUnionAuditMoney
FROM
zgfw_knbf info
LEFT JOIN state s ON s.state_id = info.stateId
LEFT JOIN audit branchUnionAudit ON branchUnionAudit.id = info.branchUnionAuditId
LEFT JOIN audit schoolUnionInitialAudit ON schoolUnionInitialAudit.id = info.schoolUnionInitialAuditId
LEFT JOIN audit schoolUnionFinalAudit ON schoolUnionFinalAudit.id = info.schoolUnionFinalAuditId
$condition
""");
Map<String, Object> map = new HashMap<>();
Cnd cnd = Cnd.where("info.stateId", "=", 3060);
cnd.andEX("YEAR(info.applyTime)","=",year);
cnd.andEX("info.unionId", "=", unionId);
cnd.andEX("info.unitId", "=", unitId);
cnd.asc("info.applyTime");
sql.setCondition(cnd);
List<NutMap> list = auditService.listMap(sql);
ViTool.excelResponse(response, "困难补助审定汇总表.xlsx");
List<ExcelExportEntity> entities = new ArrayList<>();
entities.add(new ExcelExportEntity("工号", "loginName", 20));
entities.add(new ExcelExportEntity("姓名", "userName", 20));
entities.add(new ExcelExportEntity("单位", "unitName", 20));
entities.add(new ExcelExportEntity("部门", "unionName", 20));
entities.add(new ExcelExportEntity("申请时间", "applyTime", 20));
entities.add(new ExcelExportEntity("联系电话", "mobile", 20));
entities.add(new ExcelExportEntity("类别", "subsidyStandards", 20));
entities.add(new ExcelExportEntity("分工会审核意见", "branchUnionAuditOpinion", 20));
entities.add(new ExcelExportEntity("分工会审核金额", "branchUnionAuditMoney", 20));
entities.add(new ExcelExportEntity("校工会初审意见", "schoolUnionInitialAuditOpinion", 20));
entities.add(new ExcelExportEntity("校工会初审金额", "schoolUnionInitialAuditMoney", 20));
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, list);
workbook.write(response.getOutputStream());
response.getOutputStream().close();
workbook.close();
}
}
@@ -0,0 +1,107 @@
package io.v.nutz.zhgh.zgfw.controller.difficult;
import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.service.AuditService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.sys.models.Sys_signature;
import io.v.nutz.sys.services.SysSignatureService;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.zhgh.zgfw.handler.difficult.DifficultToDoHandler;
import io.v.nutz.zhgh.zgfw.model.difficult.Zgfw_knbf;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfJtcyService;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfService;
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.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
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.Date;
import java.util.List;
/**
* @author zhf
* @date 2021/1/27 9:49
* @description 困难补助申请
*/
@IocBean
@Ok("json")
@At("/platform/difficulty/apply")
public class DifficultyApplyController {
@Inject
private Dao dao;
@Inject
private SysUserService sysUserService;
@Inject
private ZgfwKnbfService zgfwKnbfService;
@Inject
private ZgfwKnbfJtcyService zgfwKnbfJtcyService;
@Inject
private AuditService auditService;
@Inject
private SysSignatureService sysSignatureService;
@Inject
private Vi vi;
@At("")
@Ok("beetl:/platform/zgfw/difficulty/apply.html")
@RequiresPermissions("difficulty.apply")
public void index() {
}
@At("/h5")
@Ok("beetl:/mobile/difficulty/apply/index.html")
@RequiresPermissions("difficulty.apply")
public void h5() {
}
@At
@ViReturn
@RequiresPermissions("difficulty.apply")
@Aop(TransAop.READ_COMMITTED)
public Object doAdd(@Param("data") Zgfw_knbf knbf) {
knbf.setApplyTime(new Date());
knbf.setStateId(3000);
dao.insert(knbf);
DifficultToDoHandler.START_PROCESS.exec(knbf);
DifficultToDoHandler.CREATE_UNION_TASK.exec(knbf);
return Result.success();
}
@At
@ViReturn
@RequiresPermissions("difficulty.apply")
@Aop(TransAop.READ_COMMITTED)
public Object doEdit(@Param("data") Zgfw_knbf knbf) {
knbf.setStateId(3000);
zgfwKnbfService.updateIgnoreNull(knbf);
DifficultToDoHandler.START_PROCESS.exec(knbf);
DifficultToDoHandler.CREATE_UNION_TASK.exec(knbf);
if (List.of(3020,3050,3080).contains(knbf.getStateId())){
DifficultToDoHandler.COMPLETE_APPLY_RE_MODIFY_TASK.exec(knbf);
}
return Result.success();
}
@At
@RequiresPermissions("difficulty.apply")
public Result findOne(String id) {
Zgfw_knbf knbf = dao.fetch(Zgfw_knbf.class, id);
return Result.success(knbf);
}
}
@@ -0,0 +1,114 @@
package io.v.nutz.zhgh.zgfw.controller.difficult;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.AuditService;
import io.v.nutz.sys.services.SysLocalProcessService;
import io.v.nutz.sys.services.SysUnionService;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.handler.difficult.DifficultToDoHandler;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfJtcyService;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfService;
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.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
@IocBean
@Ok("json")
@At("/platform/difficulty/applylist")
public class DifficultyApplyListController {
@Inject
private FtpService ftpService;
@Inject
private ZgfwKnbfService zgfwKnbfService;
@Inject
private ZgfwKnbfJtcyService zgfwKnbfJtcyService;
@Inject
private AuditService auditService;
@Inject
private SysUserService sysUserService;
@Inject
private SysUnionService sysUnionService;
@Inject
private SysLocalProcessService localProcessService;
@At("")
@Ok("beetl:/platform/zgfw/difficulty/applylist.html")
@RequiresPermissions("difficulty.applylist")
public void index() {
}
@At("/h5")
@Ok("beetl:/mobile/difficulty/mine/index.html")
@RequiresPermissions("difficulty.applylist")
public void h5() {
}
@At
@RequiresPermissions("difficulty.applylist")
public Result pageData(@Param(value = "year", required = false) Integer year,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "unionId", required = false) String unionId, PageForm page) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
info.*,
s.state_name
FROM
`zgfw_knbf` info
LEFT JOIN state s ON s.state_id = info.stateId
$condition
""");
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
cnd.and("info.userId", "=", ShiroUtil.getUserId());
}
cnd.andEX("YEAR(info.applyTime)", "=", year);
cnd.andEX("info.unitId", "=", unitId);
cnd.andEX("info.unionId", "=", unionId);
if (StrUtil.isNotBlank(page.getSearchKeyword())) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.orLike("info.userName", page.getSearchKeyword());
seg.orLike("info.loginName", page.getSearchKeyword());
cnd.and(seg);
}
sql.setCondition(cnd);
Pagination pagination = zgfwKnbfService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
return Result.success(pagination);
}
@At
@ViReturn
@RequiresPermissions("difficulty.applylist")
public Object findOne(String id) {
return zgfwKnbfService.findOne(id);
}
@At
@ViReturn
@RequiresPermissions("difficulty.applylist")
public Object doDelete(String id) {
zgfwKnbfJtcyService.clear(Cnd.where("sqid", "=", id));
zgfwKnbfService.delete(id);
localProcessService.deleteProcessInstance("zgfw_knbf@" + id);
return Result.success();
}
}
@@ -0,0 +1,157 @@
package io.v.nutz.zhgh.zgfw.controller.difficult;
import io.v.nutz.base.utils.Roles;
import io.v.nutz.sys.models.Sys_role;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.services.SysGxService;
import io.v.nutz.sys.services.SysUserRoleService;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil;
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 java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class ZgfwUtil {
@Inject
protected SysUserService sysUserService;
@Inject
protected SysUserRoleService sysUserRoleService;
@Inject
protected SysGxService gxService;
protected Sys_user getUser() {
return (Sys_user) ShiroUtil.getPrincipal();
}
protected String getUserId() {
return ((Sys_user) ShiroUtil.getPrincipal()).getId();
}
protected boolean isSuperAdmin() {
boolean flag = false;
List<Sys_role> roles = getUser().getRoles();
for (Sys_role role : roles) {
if (ADMIN_ROLE_ID.equals(role.getId())) {
flag = true;
break;
}
}
return flag;
}
protected final String ADMIN_ROLE_ID = "d71a8876c7dc4403a182deacb3d8f8a9";
protected final String FL_URL="";
//获取当前用户的高校id
protected String getGxid() {
return ((Sys_user) ShiroUtil.getPrincipal()).getGxid();
}
protected boolean hasRole(String roleId) {
boolean result = false;
List<Sys_role> roles = getUser().getRoles();
for (Sys_role role : roles) {
if (roleId.equals(role.getId())) {
result = true;
break;
}
}
return result;
}
protected static final String FGH_ROLE_ID = "5d342e614e9a48288d50154bcdcc75d3"; //院级工会
protected static final String XGH_ROLE_ID = "9b01918f873645048f8a85a4fc06d135"; // 校工会
/**
* 工会权限
*
* @return
*/
protected Integer getGHIdentity() {
Integer result = null;
if (isSuperAdmin()) {
result = 1; //超级管理员
} else {
if (hasRole(FGH_ROLE_ID)) //院级工会
result = 2;
else if (hasRole(XGH_ROLE_ID)) //校工会
result = 3;
else if(hasRole("bf904e661ced4e909dea0fdccdc02b2d"))
result = 3;
}
return result;
}
protected static final String HY_ROLE_ID = "bf904e661ced4e909dea0fdccdc02b2d"; // 会员
/**
* 是否是会员
*
* @return
*/
protected boolean isHy() {
return hasRole(HY_ROLE_ID);
}
//根据当前用户查询管理的院级工会
protected List<String> getFghId() {
List<String> result = new ArrayList<>();
Sql sql = Sqls.create("SELECT sur.`unionid` as fghid FROM sys_user_role AS sur WHERE sur.`userId`= @userid AND sur.`roleId`= @fghrole");
sql.setParam("userid", getUserId());
sql.setParam("fghrole", FGH_ROLE_ID);
List<Record> list = sysUserService.list(sql);
list.forEach(li -> {
result.add(li.getString("fghid"));
});
return result;
}
protected String getFghIdStr() {
// return "(SELECT fgh.`unioninfomgr_id` as fghid FROM hy_unioninfomgr AS fgh WHERE fgh.`unioninfomgr_id` in (SELECT unit.`unioninfomgr_id` FROM sys_unit AS unit WHERE unit.`id`=(SELECT user.`unitid` FROM sys_user AS USER WHERE user.`id`='" + getUserId() + "')))";
return "(SELECT sur.`unionid` FROM sys_user_role AS sur WHERE sur.`userId`= '" + getUserId() + "' AND sur.`roleId`= '" + FGH_ROLE_ID + "')";
}
protected String getFghNameStr() {
// return "(SELECT fgh.`unioninfomgr_id` as fghid FROM hy_unioninfomgr AS fgh WHERE fgh.`unioninfomgr_id` in (SELECT unit.`unioninfomgr_id` FROM sys_unit AS unit WHERE unit.`id`=(SELECT user.`unitid` FROM sys_user AS USER WHERE user.`id`='" + getUserId() + "')))";
return "(SELECT un.unionname FROM sys_user_role AS sur left join sys_union un on sur.unionid = un.id WHERE un.unionname is not null sur.`userId`= '" + getUserId() + "' AND sur.`roleId`= '" + FGH_ROLE_ID + "')";
}
protected String getFghNameStr2() {
return "(SELECT sur.unitid FROM sys_user_role AS sur WHERE sur.`userId`= '" + getUserId() + "' AND sur.`roleId`= '" + Roles.WELFARE_UNIT_MANAGE + "')";
}
protected SimpleDateFormat yyyyMMdd_sdf = new SimpleDateFormat("yyyy-MM-dd");
/**
* 是否是?月
*
* @return
*/
protected boolean isNMonth(String MM) {
SimpleDateFormat sdf = new SimpleDateFormat("MM");
return (MM.equals(sdf.format(new Date())));
}
protected final String LTXGBC_ROLE_ID = "1d58435a457c43f6b9e3eabb0cf9deff";//离退休干部处
protected final String XYY_ROLE_ID = "20e7394dbe8842e29b5ab8d42adc8846";//校医院负责人
protected final String HGH_ROLE_ID = "8a8aeb4db04445edb43eb80b74814506";//互管会办公室
protected final String KNZG_ROLE_ID = "144e074252d242cf8b28af5ede0fcf49";//困难职工
protected final String EJDWFZR_ROLE_ID = "75beeb5c181545299cbdc9565add83fa";//二级单位负责人
protected final String RSCLZK_ROLE_ID = "cb51ad85ecd84aa79a7ba17cfd31cbbc";//人事处劳资科
protected final String DBHZJJHY_ROLE_ID = "751998615054441c8232e6e829ba256c";//大病互助基金会员
}
@@ -0,0 +1,105 @@
package io.v.nutz.zhgh.zgfw.controller.rxdj;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.model.rxdj.Fw_rxdj;
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;
/**
* TODO
*
* @Author zhf
* @Date 2023/2/8 17:51
*/
@IocBean
@Ok("json:full")
@At("/platform/zgfw/rxdj/beian")
public class RxdjBeiAnController {
@At("")
@Ok("beetl:/platform/zgfw/rxdj/beian.html")
@RequiresPermissions("zgfw.rxdj.beian")
public void index() {
}
@Inject
private BaseService baseService;
@At
@ViReturn
@RequiresPermissions("zgfw.rxdj.beian")
public Object pageData(@Param(value = "year", required = false) Integer year,
@Param(value = "djlx", required = false) Integer djlx,
@Param(value = "unionid", required = false) String unionid, PageForm pageForm,
@Param(value = "dj_sfrx", required = false) String dj_sfrx,
@Param(value = "dj_sfba", required = false) String dj_sfba) {
Sql sql = Sqls.create("""
SELECT
u.username,
dj.*,
u.username jzgname,
u.unitname dwname,
u.unionname AS jzgfghname,
u.unitname AS jzgdwname,
st.stateColor,
st.stateName
FROM
fw_rxdj dj
LEFT JOIN `user` u ON u.id = dj.dj_jzgid
LEFT JOIN audit_state st ON st.stateId = dj.dj_sqzt
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("YEAR(dj.dj_tbrq)", "=", year);
cnd.andEX("dj.applyType", "=", "rxdj");
cnd.andEX("dj.dj_djlx", "=", djlx);
cnd.andEX("u.unionid", "=", unionid);
cnd.andEX("dj.dj_sqzt", "=", 5300);
if (Strings.isNotBlank(pageForm.getSearchName()) && Strings.isNotBlank(pageForm.getSearchKeyword())) {
cnd.where().andLike(pageForm.getSearchName(), pageForm.getSearchKeyword());
}
if (Strings.isNotBlank(dj_sfrx)) {
cnd.and("dj.dj_sfrx", dj_sfrx.equals("true") ? "=" : "!=", 1);
}
if (Strings.isNotBlank(dj_sfba)) {
cnd.and("dj.dj_sfba", dj_sfba.equals("true") ? "=" : "!=", 1);
}
if (Strings.isNotBlank(pageForm.getPageOrderName()) && Strings.isNotBlank(pageForm.getPageOrderBy())) {
cnd.orderBy(pageForm.getPageOrderName(), pageForm.getPageOrderBy().equals("ascending") ? "asc" : "desc");
} else {
cnd.desc("dj.dj_tbrq").asc("dj.dj_djlx");
}
sql.setCondition(cnd);
return baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
@At
@ViReturn
@RequiresPermissions("zgfw.rxdj.beian")
public Object doHandle(Fw_rxdj rxdj) {
rxdj.setDj_sfba(true);
rxdj.setDj_bashr((String) ShiroUtil.getPrincipalProperty("username"));
rxdj.setDj_bashsj(DateUtil.getDate());
baseService.updateIgnoreNull(rxdj);
return null;
}
}
@@ -0,0 +1,195 @@
package io.v.nutz.zhgh.zgfw.controller.rxdj;
import cn.hutool.core.date.DateUtil;
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.zhgh.member.MemberMode;
import io.v.nutz.sys.models.Sys_msg;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.services.SysMsgService;
import io.v.nutz.sys.services.SysMsgUserService;
import io.v.nutz.sys.services.SysUserRoleService;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.zhgh.zgfw.model.rxdj.Fw_rxdj_year;
import org.apache.shiro.authz.annotation.RequiresPermissions;
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.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Times;
import org.nutz.lang.random.R;
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;
/**
* TODO
*
* @author 赵欣雨
* @date 2020/8/15 14:52
*/
@IocBean
@At("/platform/zgfw/rxdj/plan")
@Ok("json:full")
public class RxdjPlanController {
@Inject
private BaseService baseService;
@Inject
private SysMsgService sysMsgService;
@Inject
private SysMsgUserService sysMsgUserService;
@Inject
private SysUserRoleService sysUserRoleService;
@Inject
private SysUserService sysUserService;
@At("")
@Ok("beetl:/platform/zgfw/rxdj/plan.html")
@RequiresPermissions("sys.zgfw.rxdj.plan")
public void index() {
}
@At("/doAdd")
@ViReturn
@RequiresPermissions("sys.zgfw.rxdj.plan")
public Object doAdd(Fw_rxdj_year zjy) {
try {
Cnd cexist = Cnd.where("bmyear", "=", zjy.getBmyear()).and("bmlx", "=", zjy.getBmlx());
int existCount = baseService.count("fw_rxdj_year", cexist);
if (existCount > 0) {
return Result.success().addCode(2).addMsg("本年度该计划已经创建!");
}
zjy.setId(R.UU32());
baseService.insert("fw_rxdj_year", Chain.from(zjy));
Sys_msg sysMsg = new Sys_msg();
sysMsg.setSendAt(Times.getTS());
sysMsg.setType("system");
sysMsg.setTitle(zjy.getBmkssj() + "开启子女入学登记");
sysMsg.setNote(zjy.getBmyear() + "子女入学登记");
List<Sys_user> hyUsers = sysUserService.query(Cnd.where("member", "=", MemberMode.NORMAL.getCode()));
List<String> urs = new ArrayList<>();
for (Sys_user hyUser : hyUsers) {
urs.add(hyUser.getLoginname());
}
/* Sys_msg sys_msg = sysMsgService.saveMsg(sysMsg, urs.toArray(new String[]{}));
sysMsgUserService.clearCache();*/
return Result.success().addMsg("添加成功");
} catch (Exception e) {
e.printStackTrace();
return Result.error();
}
}
@At("/pageData")
@ViReturn
@RequiresPermissions("sys.zgfw.rxdj.plan")
public Object pageData(@Param(value = "pageNumber", required = false) Integer pageNumber,
@Param(value = "pageSize", required = false) Integer pageSize,
@Param(value = "bmyear", required = false) Integer bmyear,
@Param(value = "bmlx", required = false) Integer bmlx) {
try {
Sql sql = Sqls.create("""
select * from fw_rxdj_year $condition
""");
Cnd cnd = Cnd.NEW();
if (bmyear != null) {
cnd.and("bmyear", "=", bmyear);
}
if (bmlx != null) {
cnd.and("bmlx", "=", bmlx);
}
cnd.desc("bmyear").asc("bmlx").desc("bmkssj").desc("bmjssj");
sql.setCondition(cnd);
Pagination pagination = baseService.listPageMap(pageNumber, pageSize, sql);
return Result.success().addData(pagination);
} catch (Exception e) {
return Result.error();
}
}
@At("/bmztChange")
@ViReturn
@RequiresPermissions("sys.zgfw.rxdj.plan")
public Object bmztChange(String id, boolean bmkqzt) {
try {
Chain chain = Chain.make("bmkqzt", !bmkqzt);
baseService.update("fw_rxdj_year", chain, Cnd.where("id", "=", id));
return Result.success().addMsg("修改成功!");
} catch (Exception e) {
return Result.error();
}
}
@At("/doEdit")
@ViReturn
@RequiresPermissions("sys.zgfw.rxdj.plan")
public Object doEdit(Fw_rxdj_year zjy) {
try {
Cnd cexist = Cnd.where("bmyear", "=", zjy.getBmyear()).and("bmlx", "=", zjy.getBmlx()).andNot("id", "=", zjy.getId());
int existCount = baseService.count("fw_rxdj_year", cexist);
if (existCount > 0) {
return Result.success().addCode(2).addMsg("本年度该计划已经创建!");
}
baseService.update("fw_rxdj_year", Chain.from(zjy), Cnd.where("id", "=", zjy.getId()));
return Result.success().addMsg("修改成功");
} catch (Exception e) {
e.printStackTrace();
return Result.error();
}
}
@At("/findOne")
@ViReturn
@RequiresPermissions("sys.zgfw.rxdj.plan")
public Object findOne(String id) {
try {
return Result.success().addData(baseService.dao().fetch(Fw_rxdj_year.class, Cnd.where("id", "=", id)));
} catch (Exception e) {
return Result.error();
}
}
@At("/doDelete")
@ViReturn
@RequiresPermissions("sys.zgfw.rxdj.plan")
public Object doDelete(String id) {
try {
baseService.clear("fw_rxdj_year", Cnd.where("id", "=", id));
return Result.success().addMsg("删除成功!");
} catch (Exception e) {
return Result.error();
}
}
@At("/getPlanByThisYear")
@ViReturn
public Object getPlanByThisYear() {
return baseService.dao().query(Fw_rxdj_year.class,
Cnd.where("bmyear", "=", DateUtil.thisYear())
.and("bmkssj", "<", io.v.nutz.base.utils.DateUtil.getDate())
.and("bmjssj", ">", io.v.nutz.base.utils.DateUtil.getDate())
.and("bmkqzt", "=", 1)
);
}
}
@@ -0,0 +1,593 @@
package io.v.nutz.zhgh.zgfw.controller.rxdj;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.base.service.BaseService;
import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure;
import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.*;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.sys.models.Sys_dict;
import io.v.nutz.sys.models.Sys_file;
import io.v.nutz.sys.models.Sys_unit;
import io.v.nutz.sys.services.SysDictService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.handler.rxdj.RxdjToDoHandler;
import io.v.nutz.zhgh.zgfw.model.rxdj.Fw_rxdj;
import io.v.nutz.zhgh.zgfw.template.rxdj.RxdjTemp;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
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.Lang;
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 org.springframework.beans.BeanUtils;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.stream.Collectors;
@IocBean
@At("/platform/zgfw/rxdj/sh")
@Ok("json:full")
public class RxdjShController {
@Inject
private BaseService baseService;
@Inject
private SysDictService dictService;
@Inject
private Dao dao;
@Inject
private OfficeTemplateUtil officeTemplateUtil;
@Inject
private MsgApi msgApi;
@At
@Ok("beetl:/platform/zgfw/rxdj/fghsh.html")
@RequiresPermissions("zgfw.rxdj.fghsh")
public void fghindex() {
}
@At
@Ok("beetl:/platform/zgfw/rxdj/xghsh.html")
@RequiresPermissions("zgfw.rxdj.xghsh")
public void xghindex() {
}
@At
@ViReturn
@RequiresPermissions(value = {"zgfw.rxdj.fghsh", "zgfw.rxdj.xghsh"}, logical = Logical.OR)
public Object pageData(@Param(value = "dj_sqzt", required = false) Integer dj_sqzt,
@Param(value = "djlx", required = false) Integer djlx,
@Param(value = "isAudit", required = false) Integer isAudit,
@Param(value = "year", required = false) Integer year,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "lx", required = false) Integer lx, PageForm pageForm) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
dj.*,
ur.username jzgname,
ur.unitname dwname,
ur.unionname AS jzgfghname,
st.stateColor,
st.stateName
FROM
fw_rxdj dj
LEFT JOIN `user` ur ON ur.id = dj.dj_jzgid
LEFT JOIN audit_state st ON st.stateId = dj.dj_sqzt
$condition
""");
if (lx == 1) {
if (isAudit == 1) {
cnd.and("dj.dj_sqzt", "in", List.of(5100, 5115, 5118, 5218, 5215, 5200, 5300));
} else if (isAudit == 2) {
cnd.and("dj.dj_sqzt", "in", List.of(5115, 5118, 5200, 5218, 5215, 5200, 5300));
} else {
cnd.and("dj.dj_sqzt", "=", 5100);
}
} else {
// if (isAudit == 1) {
// cnd.and("dj.dj_sqzt", "in", List.of(5200, 5215, 5218, 5300));
// } else if (isAudit == 2) {
// cnd.and("dj.dj_sqzt", "in", List.of(5215, 5218, 5300));
// } else {
// cnd.and("dj.dj_sqzt", "=", 5200);
// }
cnd.and("dj.dj_sqzt", "=", 5300);
}
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
cnd.andEX("ur.unionid", "=", Vi.getUnionId());
}
cnd.andEX("dj.dj_year", "=", year);
cnd.andEX("dj.applyType", "=", "rxdj");
cnd.andEX("ur.unionid", "=", unionId);
cnd.andEX("ur.unitid", "=", unitId);
cnd.andEX("dj.dj_djlx", "=", djlx);
cnd.andEX("dj.dj_sqzt", "=", dj_sqzt);
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(), pageForm.getPageOrderBy().equals("ascending") ? "asc" : "desc");
} else {
cnd.desc("dj.dj_tbrq").asc("dj.dj_djlx");
}
sql.setCondition(cnd);
return baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
@At
@ViReturn
@RequiresPermissions(value = {"zgfw.rxdj.fghsh", "zgfw.rxdj.xghsh"}, logical = Logical.OR)
@Aop(TransAop.READ_COMMITTED)
public Object doch(Fw_rxdj rxdj) {
Fw_rxdj fw_rxdj = baseService.dao().fetch(Fw_rxdj.class, rxdj.getDj_id());
fw_rxdj.setDj_fghshr(null);
fw_rxdj.setDj_fghshsj(null);
fw_rxdj.setDj_fghshyj(null);
fw_rxdj.setDj_sqzt(5100);
// if (List.of(5115, 5118, 5200).contains(fw_rxdj.getDj_sqzt())) {
// fw_rxdj.setDj_fghshr(null);
// fw_rxdj.setDj_fghshsj(null);
// fw_rxdj.setDj_fghshyj(null);
// fw_rxdj.setDj_sqzt(5100);
// } else {
// fw_rxdj.setDj_xghshr(null);
// fw_rxdj.setDj_xghshsj(null);
// fw_rxdj.setDj_xghshyj(null);
// fw_rxdj.setDj_sqzt(5200);
// }
baseService.update(fw_rxdj);
return Result.success();
}
@At
@RequiresPermissions(value = {"zgfw.rxdj.fghsh"})
@Aop(TransAop.READ_COMMITTED)
public Object dofghSh(Fw_rxdj rxdj) {
try {
rxdj.setDj_fghshr((String) ShiroUtil.getPrincipalProperty("username"));
rxdj.setDj_fghshsj(DateUtil.getDate());
baseService.updateIgnoreNull(rxdj);
RxdjToDoHandler.COMPLETE_UNION_TASK.exec(rxdj);
if (Objects.equals(5118, rxdj.getDj_sqzt())) {
RxdjToDoHandler.CREATE_APPLY_RE_MODIFY_TASK.exec(rxdj);
} else if (rxdj.getDj_sqzt() == 5115) {
RxdjToDoHandler.COMPLETE_UNION_TASK_REJECTED.exec(rxdj);
} else if (rxdj.getDj_sqzt() == 5200) {
// RxdjToDoHandler.CREATE_SCHOOL_TASK.exec(rxdj);
RxdjToDoHandler.COMPLETE_PROCESS.exec(rxdj);
}
return Result.success();
} catch (Exception e) {
e.printStackTrace();
return Result.error();
}
}
@At
@RequiresPermissions(value = {"zgfw.rxdj.xghsh"})
public Object doxghSh(Fw_rxdj rxdj) {
try {
rxdj.setDj_xghshr((String) ShiroUtil.getPrincipalProperty("username"));
rxdj.setDj_xghshsj(DateUtil.getDate());
baseService.updateIgnoreNull(rxdj);
RxdjToDoHandler.COMPLETE_SCHOOL_TASK.exec(rxdj);
if (List.of(5215, 5218).contains(rxdj.getDj_sqzt())) {
RxdjToDoHandler.CREATE_APPLY_RE_MODIFY_TASK.exec(rxdj);
} else if (rxdj.getDj_sqzt() == 5300) {
RxdjToDoHandler.COMPLETE_PROCESS.exec(rxdj);
}
return Result.success();
} catch (Exception e) {
e.printStackTrace();
return Result.error();
}
}
@At
@ViReturn
@RequiresPermissions(value = {"zgfw.rxdj.fghsh", "zgfw.rxdj.xghsh"}, logical = Logical.OR)
public Object doEdit(@Param("data") Fw_rxdj fw_rxdj, @Param("hkfile") Sys_file[] hkfile, @Param("csfile") Sys_file[] csfile) {
baseService.update(fw_rxdj);
baseService.dao().clear(Sys_file.class, Cnd.where("reid", "=", fw_rxdj.getDj_id()));
Sys_file[] sys_files = ArrayUtil.addAll(hkfile, csfile);
for (Sys_file file : sys_files) {
file.setReid(fw_rxdj.getDj_id());
baseService.insert(file);
}
return null;
}
/**
* 导出汇总表
*
* @param year 年份
* @param djlx 登记类型
*/
@At
@Ok("void")
@RequiresPermissions(value = {"zgfw.rxdj.fghsh", "zgfw.rxdj.xghsh"}, logical = Logical.OR)
public void exportSummary(Integer year, String djlx, HttpServletResponse response) {
try {
NutMap docxMap = NutMap.NEW();
Cnd cnd = Cnd.NEW();
cnd.and("dj_year", "=", year);
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionZnrxAdmin")) {
cnd.and("dj_szfghid", "=", Vi.getUnionId());
}
cnd.and("dj_djlx", "=", djlx);
cnd.and("applyType", "=", "rxdj");
List<Fw_rxdj> list = dao.query(Fw_rxdj.class, cnd);
List<NutMap> listMap = new ArrayList<>();
for (int i = 0; i < list.size(); i++) {
NutMap map = Lang.obj2nutmap(list.get(i)).addv("xh", i + 1);
map.put("jth", map.getBoolean("isCollectiveHouseholds", false) ? "" : "");
listMap.add(map);
}
docxMap.put("list", listMap);
List<Sys_dict> schoolRegisterTypes = dictService.getSubListByCode("childrenSchoolRegisterType");
String lxname = schoolRegisterTypes.stream().filter(x -> x.getCode().equals(djlx)).findFirst().map(v -> v.getName()).orElse(null);
docxMap.put("lxname", lxname);
docxMap.put("year", year);
docxMap.put("dw", Vi.getUnion().getUnionname());
HackLoopTableRenderPolicy policy = new HackLoopTableRenderPolicy();
Configure config = Configure.builder().bind("list", policy).build();
String fileName = year + "年江南大学集体户青年教职工子女报名就读" + lxname + "情况统计表";
response.addHeader("Content-Type", "application/octet-stream");
response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(fileName.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1) + "\".docx");
// File file = new File("C:\\Users\\jug\\Desktop\\childrenSchool.docx");
XWPFTemplate.compile(officeTemplateUtil.getPath("childrenSchool"), config).render(docxMap).writeAndClose(response.getOutputStream());
} catch (IOException e) {
e.printStackTrace();
}
}
@At
@Ok("void")
@RequiresPermissions(value = {"zgfw.rxdj.fghsh", "zgfw.rxdj.xghsh"}, logical = Logical.OR)
public void exportSummaryExcel(Integer year, String djlx, HttpServletResponse response) {
Map docxMap = new HashMap<String, Object>();
Cnd cnd = Cnd.NEW();
cnd.and("dj_year", "=", year);
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionZnrxAdmin")) {
cnd.and("dj_szfghid", "=", Vi.getUnionId());
}
cnd.and("dj_djlx", "=", djlx);
cnd.and("applyType", "=", "rxdj");
List<Fw_rxdj> list = dao.query(Fw_rxdj.class, cnd);
List<NutMap> listMap = new ArrayList<>();
for (int i = 0; i < list.size(); i++) {
NutMap map = Lang.obj2nutmap(list.get(i)).addv("xh", i + 1);
map.put("jth", map.getBoolean("isCollectiveHouseholds", false) ? "" : "");
map.put("zc_xl", map.getString("dj_zc") + "/" + map.getString("dj_xl"));
listMap.add(map);
}
List<Sys_dict> schoolRegisterTypes = dictService.getSubListByCode("childrenSchoolRegisterType");
String lxname = schoolRegisterTypes.stream().filter(x -> x.getCode().equals(djlx)).findFirst().map(v -> v.getName()).orElse(null);
docxMap.put("maplist", listMap);
docxMap.put("lxname", lxname);
docxMap.put("year", year);
docxMap.put("dw", Vi.getUnion().getUnionname());
String fileName = year + "年江南大学集体户青年教职工子女报名就读" + lxname + "情况统计表";
response.addHeader("Content-Type", "application/octet-stream");
response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(fileName.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1) + "\".docx");
// List<ExcelExportEntity> entityList = new ArrayList<>();
// entityList.add(new ExcelExportEntity("序号", "xh", 10));
// entityList.add(new ExcelExportEntity("青年教职工姓名", "dj_xm", 20));
// entityList.add(new ExcelExportEntity("职称/学历", "zc_xl", 20));
// entityList.add(new ExcelExportEntity("子女姓名", "dj_znname", 20));
// entityList.add(new ExcelExportEntity("子女姓别", "dj_znsex", 20));
// entityList.add(new ExcelExportEntity("子女出生年月", "dj_znzsny", 30));
// entityList.add(new ExcelExportEntity("青年教职工家庭住址", "dj_jtzz", 50));
// entityList.add(new ExcelExportEntity("青年教职工户口所在地派出所", "dj_hjssxq", 50));
// entityList.add(new ExcelExportEntity("青年教职工联系电话", "dj_iphone", 20));
// entityList.add(new ExcelExportEntity("是否集体户", "jth", 20));
// entityList.add(new ExcelExportEntity("备注", "dj_babz", 30));
try {
ViTool.excelResponse(response, year + "年江南大学集体户青年教职工子女报名就读" + lxname + "情况统计表.xlsx");
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
// Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, listMap);
Workbook workbook = ExcelExportUtil.exportExcel(new TemplateExportParams(officeTemplateUtil.getPath("rxdjdc")), docxMap);
workbook.write(response.getOutputStream());
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 校工会导出
*
* @param year
* @param djlx
* @param response
*/
@At
@Ok("void")
@RequiresPermissions("zgfw.rxdj.xghsh")
public void exportSchoolUnionSummaryExcel(Integer year, String djlx, HttpServletResponse response) {
Map docxMap = new HashMap<String, Object>();
Cnd cnd = Cnd.NEW();
cnd.and("dj_year", "=", year);
cnd.and("dj_djlx", "=", djlx);
cnd.and("applyType", "=", "rxdj");
List<Fw_rxdj> list = dao.query(Fw_rxdj.class, cnd);
List<NutMap> listMap = new ArrayList<>();
for (int i = 0; i < list.size(); i++) {
NutMap map = Lang.obj2nutmap(list.get(i)).addv("xh", i + 1);
map.put("jth", map.getBoolean("isCollectiveHouseholds", false) ? "" : "");
map.put("zc_xl", map.getString("dj_zc") + "/" + map.getString("dj_xl"));
listMap.add(map);
}
List<Sys_dict> schoolRegisterTypes = dictService.getSubListByCode("childrenSchoolRegisterType");
String lxname = schoolRegisterTypes.stream().filter(x -> x.getCode().equals(djlx)).findFirst().map(v -> v.getName()).orElse(null);
String fileName = year + "年江南大学集体户青年教职工子女报名就读" + lxname + "情况统计表";
response.addHeader("Content-Type", "application/octet-stream");
response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(fileName.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1) + "\".docx");
List<ExcelExportEntity> entityList = new ArrayList<>();
entityList.add(new ExcelExportEntity("序号", "xh", 10));
entityList.add(new ExcelExportEntity("青年教职工姓名", "dj_xm", 20));
entityList.add(new ExcelExportEntity("工号", "dj_gzh", 20));
entityList.add(new ExcelExportEntity("单位", "dj_szdw", 20));
entityList.add(new ExcelExportEntity("分工会", "dj_szfgh", 20));
entityList.add(new ExcelExportEntity("职称/学历", "zc_xl", 20));
entityList.add(new ExcelExportEntity("子女姓名", "dj_znname", 20));
entityList.add(new ExcelExportEntity("子女姓别", "dj_znsex", 20));
entityList.add(new ExcelExportEntity("子女出生年月", "dj_znzsny", 30));
entityList.add(new ExcelExportEntity("青年教职工家庭住址", "dj_jtzz", 50));
entityList.add(new ExcelExportEntity("青年教职工户口所在地派出所", "dj_hjssxq", 50));
entityList.add(new ExcelExportEntity("青年教职工联系电话", "dj_iphone", 20));
entityList.add(new ExcelExportEntity("是否集体户", "jth", 20));
entityList.add(new ExcelExportEntity("备注", "dj_babz", 30));
try {
ViTool.excelResponse(response, year + "年江南大学集体户青年教职工子女报名就读" + lxname + "情况统计表.xlsx");
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, listMap);
workbook.write(response.getOutputStream());
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 管理员保存备注
*
* @param fw_rxdj
* @return
*/
@At
@ViReturn
@RequiresPermissions("zgfw.rxdj.xghsh")
public Object adminSave(@Param("info") Fw_rxdj fw_rxdj) {
dao.update(fw_rxdj, "dj_babz");
return null;
}
/**
* 通知未审核的分工会
*
* @param sendTypes 发送方式
* @param content 发送内容
* @param year 年份
* @return
*/
@At
@ViReturn
@RequiresRoles(value = {"sysadmin", "SchoolUnionAdmin", "SchoolUnionZnrxAdmin"}, logical = Logical.OR)
public Object confirmMsgBranchUnionAudit(@Param("sendTypes") String[] sendTypes,
@Param("content") String content,
@Param("year") Integer year) {
Sql sql = Sqls.create("""
SELECT
u.username,
u.loginname
FROM
sys_user u
JOIN sys_user_role sur ON u.id = sur.userId
JOIN ( SELECT DISTINCT dj_szfghid FROM fw_rxdj WHERE YEAR ( dj_tbrq ) = @year AND dj_sqzt = 5100 ) AS subquery ON sur.unionid = subquery.dj_szfghid
WHERE
sur.roleid = '9c1f19e385914fef82bc35da7c9ded36';
""");
sql.setParam("year", year);
List<Record> list = baseService.list(sql);
for (Record r : list) {
msgApi.sendMsg(content, "", "", "", "4", new ArrayList<>() {{
add(NutMap.NEW().addv("userId", r.getString("loginname")));
}});
}
return null;
}
/**
* 入学登记,模版下载
* @param response
*/
@At
@Ok("void")
@RequiresRoles(value = {"sysadmin", "SchoolUnionAdmin", "SchoolUnionZnrxAdmin"}, logical = Logical.OR)
public void downloadImport(HttpServletResponse response){
try {
ViTool.excelResponse(response, "导入模版.xlsx");
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook sheets = ExcelExportUtil.exportExcel(exportParams, RxdjTemp.class, new ArrayList<>());
ServletOutputStream outputStream = response.getOutputStream();
sheets.write(outputStream);
outputStream.close();
} catch (Exception e) {
e.printStackTrace();
}
}
@At
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
@RequiresRoles(value = {"sysadmin", "SchoolUnionAdmin", "SchoolUnionZnrxAdmin"}, logical = Logical.OR)
public Object doImport(TempFile file, String djType, Integer year) {
try {
List<RxdjTemp> rxdjTempList = ExcelImportUtil.importExcel(file.getFile(), RxdjTemp.class, new ImportParams());
List<Fw_rxdj> nowYearDjList = dao.query(Fw_rxdj.class,
Cnd.where("dj_year", "=", cn.hutool.core.date.DateUtil.thisYear()).and("dj_djlx","=",djType));
List<Sys_unit> unitList = dao.query(Sys_unit.class, Cnd.where("unitlevel", "=", 2));
//单位map
Map<String, String> unitMap = unitList.stream().collect(Collectors.toMap(Sys_unit::getName, Sys_unit::getId));
Sql sql = Sqls.create("select id,loginname,username,sex,unitid,unitname,unionid,unionname,education,jobTitle from `user` where member = 1");
List<NutMap> userList = dictService.listMap(sql);
Map<String, NutMap> userMap = userList.stream().collect(Collectors.toMap(v -> v.getString("loginname"), v -> v));
DateTime nowDate = cn.hutool.core.date.DateUtil.date();
//需要新增的
List<Fw_rxdj> needInsertList = new ArrayList<>();
//只需要更改审核状态
List<Fw_rxdj> needUpdateList = new ArrayList<>();
List<RxdjTemp> errorInfos = new ArrayList<>();
rxdjTempList.forEach(v->{
String unitId = unitMap.get(v.getDj_szdw());
if (StrUtil.isBlank(unitId)) {
v.setRemark("获取不到填写的单位,请检查单位名称是否正确");
errorInfos.add(v);
return;
}
NutMap user = userMap.get(v.getDj_gzh());
if (Lang.isEmpty(user)){
v.setRemark("获取不到该用户,请检查工号是否正确");
errorInfos.add(v);
return;
}
Fw_rxdj fwRxdj = nowYearDjList.stream().filter(item -> item.getDj_gzh().equals(v.getDj_gzh()))
.collect(Collectors.toList()).stream().findFirst().orElse(new Fw_rxdj());
if (StrUtil.isBlank(fwRxdj.getDj_id())) {
BeanUtils.copyProperties(v,fwRxdj);
fwRxdj.setDj_id(R.UU32());
fwRxdj.setDj_year(year);
fwRxdj.setDj_szdwid(unitId);
fwRxdj.setDj_jzgid(user.getString("id"));
fwRxdj.setDj_szfgh(user.getString("unionname"));
fwRxdj.setDj_szfghid(user.getString("unionid"));
fwRxdj.setDj_zc(StrUtil.isNotBlank(fwRxdj.getDj_zc()) ? fwRxdj.getDj_zc() : user.getString("jobTitle"));
fwRxdj.setDj_xl(StrUtil.isNotBlank(fwRxdj.getDj_xl()) ? fwRxdj.getDj_xl() : user.getString("education"));
fwRxdj.setDj_iphone(StrUtil.isNotBlank(fwRxdj.getDj_iphone()) ? fwRxdj.getDj_iphone() : user.getString("mobile"));
fwRxdj.setApplyType("rxdj");
fwRxdj.setIsCollectiveHouseholds("".equals(v.getIsCollectiveHouseholds()));
fwRxdj.setDj_djlx(Convert.toInt(djType));
fwRxdj.setDj_fghshyj("校工会批量导入,默认通过");
fwRxdj.setDj_tbrq(nowDate);
fwRxdj.setDj_sqzt(5300);
needInsertList.add(fwRxdj);
} else {
if (fwRxdj.getDj_sqzt() != 5300){
fwRxdj.setDj_sqzt(5300);
fwRxdj.setDj_fghshyj("校工会批量导入,默认通过");
needUpdateList.add(fwRxdj);
}
}
});
if (Lang.isNotEmpty(needInsertList)) dao.fastInsert(needInsertList);
if (Lang.isNotEmpty(needUpdateList)) dao.updateIgnoreNull(needUpdateList);
if (Lang.isNotEmpty(errorInfos)) {
NutMap nutMap = new NutMap();
nutMap.setv("totalCount", rxdjTempList.size());
nutMap.setv("successCount", needInsertList.size() + needUpdateList.size());
nutMap.setv("errorCount", errorInfos.size());
nutMap.setv("errorList", errorInfos.stream().map(v -> {
return NutMap.NEW().addv("工号", v.getDj_gzh()).addv("姓名", v.getDj_xm()).addv("错误原因", v.getRemark());
}).collect(Collectors.toList()));
return Result.success(nutMap);
}
return Result.success();
} catch (Exception e) {
e.printStackTrace();
return Result.error();
}
}
}
@@ -0,0 +1,166 @@
package io.v.nutz.zhgh.zgfw.controller.rxdj;
import cn.wizzer.framework.base.Result;
import io.v.nutz.base.service.ViService;
import io.v.nutz.zhgh.zgfw.model.rxdj.Fw_rxdj;
import org.apache.shiro.authz.annotation.RequiresPermissions;
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.At;
import org.nutz.mvc.annotation.Ok;
import java.util.*;
@IocBean
@At("/platform/zgfw/jzgznbmdj/sjkb")
public class RxdjSjkbController {
@Inject("Fw_rxdj")
private ViService<Fw_rxdj> jzgznbmdjService;
@At("/")
@Ok("beetl:/platform/zgfw/rxdj/sjkb.html")
@RequiresPermissions("zgfw.znbmdj.sjkb")
public void index() {
}
private final Map<Integer, String> lxMap = new HashMap<Integer, String>() {{
// put(1, "幼升小");
put(2, "小学");
// put(3, "初升高");
}};
@At
@Ok("json")
@RequiresPermissions("zgfw.znbmdj.sjkb")
public Object getData1() {
try {
Map result = new HashMap();
List arr = new ArrayList();
List names = new ArrayList();
List<Integer> years = new ArrayList();
Calendar cal = Calendar.getInstance();
int nowYear = cal.get(Calendar.YEAR);
for (int i = nowYear - 5; i <= nowYear + 5; i++) {
years.add(i);
}
result.put("years", years);
lxMap.keySet().forEach(key -> {
names.add(lxMap.get(key));
Map map = new HashMap();
map.put("key", key);
map.put("name", lxMap.get(key));
map.put("type", "line");
// map.put("areaStyle", new Object());
List nums = new ArrayList();
for (Integer year : years) {
Sql sql = Sqls.create("SELECT COUNT(dj.`dj_year`= @year OR NULL) FROM fw_rxdj dj WHERE dj.`dj_djlx`=@lx and dj.applyType='rxdj'").setParam("year", year).setParam("lx", key);
nums.add(jzgznbmdjService.count(sql));
}
map.put("data", nums);
arr.add(map);
});
result.put("names", names);
result.put("arr", arr);
return Result.success().addData(result);
} catch (Exception e) {
return Result.error();
}
}
@At
@Ok("json")
@RequiresPermissions("zgfw.znbmdj.sjkb")
public Object getData2(Integer year) {
try {
Map result = new HashMap();
List names = new ArrayList();
List data = new ArrayList();
lxMap.keySet().forEach(key -> {
names.add(lxMap.get(key));
Sql sql = Sqls.create("SELECT COUNT(1) FROM fw_rxdj dj WHERE dj.`dj_year`=@year AND dj.`dj_djlx`=@lx and dj.dj_sfbc = 1 and dj.applyType='rxdj'").setParam("year", year).setParam("lx", key);
data.add(new HashMap<String, Object>() {{
put("name", lxMap.get(key));
put("value", jzgznbmdjService.count(sql));
}});
});
result.put("names", names);
result.put("data", data);
return Result.success().addData(result);
} catch (Exception e) {
return Result.error();
}
}
@At
@Ok("json")
@RequiresPermissions("zgfw.znbmdj.sjkb")
public Object getData3(Integer year) {
try {
Sql sql = Sqls.create("SELECT '幼儿园升小学' AS `name`,COUNT(1) value FROM fw_rxdj dj WHERE dj.`dj_year`=@year AND dj.`dj_djlx`=1 and dj.dj_sfbc = 1 and dj.applyType='rxdj' GROUP BY dj.`dj_sqxx`").setParam("year", year);
List<Record> list = jzgznbmdjService.list(sql);
if (list.size() > 0) {
return Result.success().addData(list);
}
return Result.success().addData(new ArrayList<Map>() {{
add(new HashMap<String, Object>() {{
put("name", "暂无");
put("value", 0);
}});
}});
} catch (Exception e) {
return Result.error();
}
}
@At
@Ok("json")
@RequiresPermissions("zgfw.znbmdj.sjkb")
public Object getData4(Integer year) {
try {
Sql sql = Sqls.create("SELECT '小学' AS `name`,COUNT(1) value FROM fw_rxdj dj WHERE dj.`dj_year`=@year AND dj.`dj_djlx` = 2 and dj.applyType='rxdj' GROUP BY dj.`dj_sqxx`").setParam("year", year);
List<Record> list = jzgznbmdjService.list(sql);
if (list.size() > 0) {
return Result.success().addData(list);
}
return Result.success().addData(new ArrayList<Map>() {{
add(new HashMap<String, Object>() {{
put("name", "暂无");
put("value", 0);
}});
}});
} catch (Exception e) {
return Result.error();
}
}
@At
@Ok("json")
@RequiresPermissions("zgfw.znbmdj.sjkb")
public Object getData5(Integer year) {
try {
Sql sql = Sqls.create("SELECT '初中升高中' AS `name`,COUNT(1) value FROM fw_rxdj dj WHERE dj.`dj_year`=@year AND dj.`dj_djlx` = 3 and dj.applyType='rxdj' GROUP BY dj.`dj_sqxx`").setParam("year", year);
List<Record> list = jzgznbmdjService.list(sql);
if (list.size() > 0) {
return Result.success().addData(list);
}
return Result.success().addData(new ArrayList<Map>() {{
add(new HashMap<String, Object>() {{
put("name", "暂无");
put("value", 0);
}});
}});
} catch (Exception e) {
return Result.error();
}
}
}
@@ -0,0 +1,165 @@
package io.v.nutz.zhgh.zgfw.controller.rxdj;
import cn.hutool.core.util.ArrayUtil;
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.DateUtil;
import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.service.ViService;
import io.v.nutz.sys.models.Sys_file;
import io.v.nutz.web.commons.slog.annotation.SLog;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.handler.rxdj.RxdjToDoHandler;
import io.v.nutz.zhgh.zgfw.model.rxdj.Fw_rxdj;
import io.v.nutz.zhgh.zgfw.model.rxdj.Fw_rxdj_year;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
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.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.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import org.nutz.trans.Trans;
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* TODO
*
* @author 赵欣雨
* @date 2020/8/15 14:49
*/
@IocBean
@At("/platform/zgfw/rxdjsq")
@Ok("json:full")
public class RxdjSqController {
@Inject
private BaseService baseService;
@Inject
private FtpService ftpService;
@Inject
private MsgApi msgApi;
@Inject
private Dao dao;
@Inject("Sys_file")
private ViService<Sys_file> fileViService;
@At("")
@Ok("beetl:/platform/zgfw/rxdj/sq.html")
@RequiresPermissions("sys.zgfw.rxdjsq")
public void index() {
}
@At("/include")
@Ok("beetl:/platform/zgfw/rxdj/apply_include.html")
@RequiresPermissions("sys.zgfw.rxdjsq")
public void index2(HttpServletRequest request) {
String id = request.getParameter("id");
request.setAttribute("id", request.getParameter("id"));
}
/**
* 本年入学计划
*
* @return
*/
@At
@RequiresPermissions("sys.zgfw.rxdjsq")
@ViReturn
public Object schoolPlans() {
List<Fw_rxdj_year> plans = dao.query(Fw_rxdj_year.class, Cnd.where("bmyear", "=", cn.hutool.core.date.DateUtil.thisYear()));
return plans;
}
/**
* 详情
*
* @param id
* @return
*/
@At
@RequiresPermissions("sys.zgfw.rxdjsq")
@ViReturn
public Object findOne(String id) {
Fw_rxdj info = dao.fetch(Fw_rxdj.class, id);
return info;
}
@At
@RequiresPermissions("sys.zgfw.rxdjsq")
@ViReturn
@SLog(type = "入学登记", tag = "登记", msg = "保存", param = true, result = true)
@Aop(TransAop.READ_COMMITTED)
public Object save(@Param("info") Fw_rxdj fw_rxdj) {
fw_rxdj.setDj_sqzt(5000);
fw_rxdj.setApplyType("rxdj");
fw_rxdj.setDj_tbrq(new Date());
fw_rxdj.setDj_year(cn.hutool.core.date.DateUtil.thisYear());
dao.insertOrUpdate(fw_rxdj);
RxdjToDoHandler.START_PROCESS.exec(fw_rxdj);
return null;
}
@At
@RequiresPermissions("sys.zgfw.rxdjsq")
@ViReturn
@SLog(type = "入学登记", tag = "登记", msg = "提交", param = true, result = true)
@Aop(TransAop.READ_COMMITTED)
public Object submit(@Param("info") Fw_rxdj fw_rxdj) {
fw_rxdj.setDj_sqzt(5100);
fw_rxdj.setApplyType("rxdj");
fw_rxdj.setDj_tbrq(new Date());
fw_rxdj.setDj_year(cn.hutool.core.date.DateUtil.thisYear());
dao.insertOrUpdate(fw_rxdj);
RxdjToDoHandler.START_PROCESS.exec(fw_rxdj);
RxdjToDoHandler.CREATE_UNION_TASK.exec(fw_rxdj);
// String unionId = fw_rxdj.getDj_szfghid();
// Sql sql = Sqls.create("""
// SELECT
// u.username,
// u.loginname\s
// FROM
// sys_user_role sur
// LEFT JOIN sys_user u ON u.id = sur.userId\s
// WHERE
// sur.roleid = '5d342e614e9a48288d50154bcdcc75d3'\s
// AND sur.unionid = @unionId
// """);
// sql.setParam("unionId", unionId);
// NutMap userMap = fileViService.fetch(sql);
// if (Lang.isNotEmpty(userMap)) {
// String msg = "您好!" + fw_rxdj.getDj_xm() + "老师申请一条子女入学登记,请您登录智慧工会系统进行审核。";
// msgApi.sendMsg(msg, "", "", "", "4", new ArrayList<>() {{
// add(NutMap.NEW().addv("userId", userMap.getString("loginname")));
// }});
// }
return null;
}
}
@@ -0,0 +1,367 @@
package io.v.nutz.zhgh.zgfw.controller.rxdj;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.StrUtil;
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.Vi;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.utils.ViTool;
import io.v.nutz.sys.models.Sys_dict;
import io.v.nutz.sys.models.Sys_file;
import io.v.nutz.sys.services.SysDictService;
import io.v.nutz.web.commons.base.Globals;
import io.v.nutz.web.commons.utils.FileUtil;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.handler.rxdj.RxdjToDoHandler;
import io.v.nutz.zhgh.zgfw.model.rxdj.Fw_rxdj;
import org.apache.commons.io.IOUtils;
import org.apache.poi.ss.usermodel.Workbook;
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.dao.util.cri.SqlExpressionGroup;
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 org.nutz.trans.Trans;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.zip.ZipOutputStream;
/**
* TODO
*
* @author 赵欣雨
* @date 2020/8/17 9:47
*/
@IocBean
@At("/platform/zgfw/rxdjxx")
@Ok("json:full")
public class RxdjSqxxController {
@Inject
private BaseService baseService;
@Inject
private RxdjSqController rxdjSqController;
@Inject
private FtpService ftpService;
@Inject
private SysDictService sysDictService;
@At("")
@Ok("beetl:/platform/zgfw/rxdj/sqxx.html")
@RequiresPermissions("sys.zgfw.rxdjxx")
public void index() {
}
@At
@ViReturn
@RequiresPermissions("sys.zgfw.rxdjxx")
public Object pageData(@Param(value = "year", required = false) Integer year,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "djlx", required = false) String djlx,
PageForm pageForm) {
Sql sql = Sqls.create("""
SELECT
dj.*,
u.username jzgname,
u.unitname dwname,
u.unionname AS jzgfghname,
st.stateColor,
st.stateName
FROM
fw_rxdj dj
LEFT JOIN `user` u ON u.id = dj.dj_jzgid
LEFT JOIN audit_state st ON st.stateId = dj.dj_sqzt
$condition
""");
CndPlus cndPlus = CndPlus.create();
cndPlus.andEX("dj.dj_year", "=", year);
cndPlus.andEX("dj.applyType", "=", "rxdj");
cndPlus.andEX("dj.dj_djlx", "=", djlx);
cndPlus.andEX("u.unionid", "=", unionId);
cndPlus.andEX("u.unitid", "=", unitId);
if (Strings.isNotBlank(pageForm.getSearchName()) && Strings.isNotBlank(pageForm.getSearchKeyword())) {
cndPlus.and(Cnd.likeEX(pageForm.getSearchName(), pageForm.getSearchKeyword()));
}
if (!ShiroUtil.hasRole("sysadmin")) {
cndPlus.and("dj.dj_jzgid", "=", ShiroUtil.getPrincipalProperty("id"));
}
if (Strings.isNotBlank(pageForm.getPageOrderName()) && Strings.isNotBlank(pageForm.getPageOrderBy())) {
cndPlus.orderBy(pageForm.getPageOrderName(), pageForm.getPageOrderBy().equals("ascending") ? "asc" : "desc");
} else {
cndPlus.desc("dj.dj_tbrq").asc("dj.dj_djlx");
}
sql.setCondition(cndPlus);
return baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
@At
@ViReturn
@RequiresPermissions("sys.zgfw.rxdjxx")
public Object doDelete(String id) {
try {
baseService.clear("fw_rxdj", Cnd.where("dj_id", "=", id));
baseService.clear("sys_file", Cnd.where("reid", "=", id));
return Result.success();
} catch (Exception e) {
return Result.error();
}
}
@At
public Object findOne(String id) {
Sql sql = Sqls.create("""
SELECT
dj.*,
u.id,
u.loginname,
u.username,
u.sex,
u.mobile,
u.birthday,
u.position,
u.jobTitle,
u.unitname dwname
FROM
fw_rxdj dj
LEFT JOIN `user` u ON u.id = dj.dj_jzgid
WHERE dj.dj_id=@id
""");
sql.setParam("id", id);
Record djuser = (Record) baseService.list(sql).get(0);
List<Record> fileList = baseService.dao().query("sys_file", Cnd.where("reid", "=", id));
for (Record f : fileList) {
f.set("url", Globals.AppFileDomain + f.getString("filepath"));
f.set("name", f.getString("filename"));
f.set("status", "success");
}
NutMap nutMap = new NutMap();
nutMap.put("djuser", djuser);
nutMap.put("fjs", fileList);
return Result.success().addData(nutMap);
}
@At
public Object findfjList(String id) {
List fjList = baseService.list(Sqls.create("select CONCAT('" + Globals.AppFileDomain + "',filepath) as url,filepath,filename,filepath id,bz from sys_file where reid = @id").setParam("id", id));
return Result.success().addData(fjList);
}
@At
@ViReturn
public Object findRxdj(String dj_id) {
Sql sql = Sqls.create("""
SELECT
rx.*,
us.username,
us.username jzgname,
us.unitname dwname
FROM
fw_rxdj rx
LEFT JOIN `user` us ON us.id = rx.dj_jzgid
WHERE
dj_id = @dj_id
""").setParam("dj_id", dj_id);
return baseService.list(sql).get(0);
}
/**
* 导出汇总表
* @param year
* @param djlx
* @param searchName
* @param searchKeyword
* @param response
*/
@At
@Ok("void")
@RequiresPermissions("sys.zgfw.rxdjxx")
public void doExportExcel(@Param(value = "year",required = false) Integer year,
@Param(value = "djlx",required = false) String djlx,
@Param(value = "searchName",required = false) String searchName,
@Param(value = "searchKeyword",required = false) String searchKeyword,
HttpServletResponse response){
Sql sql = Sqls.create("SELECT * FROM fw_rxdj $condition");
Cnd cnd = Cnd.NEW();
cnd.and("dj_year", "=", year);
cnd.andEX("dj_djlx", "=", djlx);
cnd.and("applyType", "=", "rxdj");
if (StrUtil.isNotBlank(searchName) && StrUtil.isNotBlank(searchKeyword)) {
cnd.and(searchName, "like", "%" + searchKeyword + "%");
}
sql.setCondition(cnd);
List<NutMap> list = sysDictService.listMap(sql);
List<Sys_dict> childrenSchoolRegisterType = sysDictService.getSubListByCode("childrenSchoolRegisterType");
Map<String, String> rxdjTypeMap = childrenSchoolRegisterType.stream().collect(Collectors.toMap(Sys_dict::getCode, Sys_dict::getName));
list.forEach(v->{
String djName = rxdjTypeMap.get(v.getString("dj_djlx"));
v.put("jth", v.getBoolean("isCollectiveHouseholds", false) ? "" : "");
v.put("zc_xl", v.getString("dj_zc") + "/" + v.getString("dj_xl"));
v.put("djName",djName);
});
List<ExcelExportEntity> entityList = new ArrayList<>();
ExcelExportEntity no = new ExcelExportEntity("序号", "no", 10);
no.setFormat("isAddIndex");
entityList.add(no);
entityList.add(new ExcelExportEntity("青年教职工姓名", "dj_xm", 20));
entityList.add(new ExcelExportEntity("登记类型", "djName", 20));
entityList.add(new ExcelExportEntity("工号", "dj_gzh", 20));
entityList.add(new ExcelExportEntity("单位", "dj_szdw", 20));
entityList.add(new ExcelExportEntity("分工会", "dj_szfgh", 20));
entityList.add(new ExcelExportEntity("职称/学历", "zc_xl", 20));
entityList.add(new ExcelExportEntity("子女姓名", "dj_znname", 20));
entityList.add(new ExcelExportEntity("子女姓别", "dj_znsex", 20));
entityList.add(new ExcelExportEntity("子女出生年月", "dj_znzsny", 30));
entityList.add(new ExcelExportEntity("青年教职工家庭住址", "dj_jtzz", 50));
entityList.add(new ExcelExportEntity("青年教职工户口所在地派出所", "dj_hjssxq", 50));
entityList.add(new ExcelExportEntity("青年教职工联系电话", "dj_iphone", 20));
entityList.add(new ExcelExportEntity("是否集体户", "jth", 20));
entityList.add(new ExcelExportEntity("备注", "dj_babz", 30));
try {
ViTool.excelResponse(response, year + "年江南大学集体户青年教职工子女报名就读情况统计表.xlsx");
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, list);
workbook.write(response.getOutputStream());
} catch (Exception e){
e.printStackTrace();
}
}
/**
* 导出附件信息
* @param year
* @param djlx
* @param searchName
* @param searchKeyword
* @param response
*/
@At
@Ok("void")
@RequiresPermissions("sys.zgfw.rxdjxx")
public void doExportEnclosure(@Param(value = "year",required = false) Integer year,
@Param(value = "djlx",required = false) String djlx,
@Param(value = "searchName",required = false) String searchName,
@Param(value = "searchKeyword",required = false) String searchKeyword,
HttpServletResponse response){
Cnd cnd = Cnd.NEW();
cnd.and("dj_year", "=", year);
cnd.andEX("dj_djlx", "=", djlx);
cnd.and("applyType", "=", "rxdj");
if (StrUtil.isNotBlank(searchName) && StrUtil.isNotBlank(searchKeyword)) {
cnd.and(searchName, "like", "%" + searchKeyword + "%");
}
cnd.and("files","is not",null);
cnd.and("files","!=","[]");
List<Fw_rxdj> list = baseService.dao().query(Fw_rxdj.class, cnd);
if (Lang.isEmpty(list))return;
Map<String, List<Fw_rxdj>> loginNameDjMap = list.stream().collect(Collectors.groupingBy(v -> v.getDj_gzh()));
try {
/**
* 创建临时文件夹
*/
String tmpPath = "tmp/" + R.UU32();
File tmpDir = new File(tmpPath + "/江南大学集体户青年教职工子女报名就读情况附件汇总");
tmpDir.mkdirs();
loginNameDjMap.forEach((k,v)->{
Fw_rxdj fwRxdj = v.stream().findFirst().orElse(null);
/**
* 创建临时文件夹
*/
String fileName = fwRxdj.getDj_xm() + "(" + k + ")附件信息";
File tDir = new File(tmpDir + "/" + fileName);
tDir.mkdirs();
List<Sys_file> fileList = v.stream().flatMap(item -> item.getFiles().stream()).collect(Collectors.toList());
for (Sys_file file : fileList) {
try {
FileOutputStream outputStream = new FileOutputStream(tDir.getPath() + "/" + file.getFilename());
ftpService.download(file.getFilepath(), outputStream);
outputStream.close();
}catch (Exception e){
e.printStackTrace();
}
}
});
String aimsDir = "zipTmp/" + R.UU32();
String aimsName = year + "年江南大学集体户青年教职工子女报名就读情况附件汇总.zip";
String aimsPath = aimsDir + "/" + aimsName;
FileUtil.compressToZip(tmpDir.getPath(), aimsDir, aimsName);
response.setHeader("content-disposition", "attachment;filename="
+ URLEncoder.encode(aimsName, "UTF-8"));
File aimsFile = new File(aimsPath);
FileInputStream inputStream = new FileInputStream(aimsFile);
IOUtils.copy(inputStream, response.getOutputStream());
inputStream.close();
aimsFile.delete();
FileUtil.deleteDir(new File(tmpPath));
FileUtil.deleteDir(new File(aimsDir));
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 校验是否有附件
* @return
*/
@At
@RequiresPermissions("sys.zgfw.rxdjxx")
public Object hasFiles() {
int count = baseService.dao().count(Fw_rxdj.class, Cnd.where("files", "is not", null).and("files", "!=", "[]"));
return count > 0 ? Result.success() : Result.error();
}
}
@@ -0,0 +1,340 @@
package io.v.nutz.zhgh.zgfw.controller.rxdj;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.ZipUtil;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.utils.OfficeTemplateUtil;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.dao.CndPlus;
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 io.v.nutz.web.commons.base.Globals;
import io.v.nutz.zhgh.zgfw.model.rxdj.Fw_rxdj;
import org.apache.commons.io.FileUtils;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPReply;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.Logical;
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.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Streams;
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 org.nutz.trans.Trans;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@IocBean
@At("/platform/zgfw/rxdj/zhcx")
@Ok("json:full")
public class RxdjZhcxController {
@Inject
private BaseService baseService;
@Inject
private FtpService ftpService;
@Inject
private OfficeTemplateUtil officeTemplateUtil;
@At("")
@Ok("beetl:/platform/zgfw/rxdj/zhcx.html")
@RequiresPermissions("zgfw.rxdj.zhcx")
public void index() {
}
@At
@ViReturn
@RequiresPermissions("zgfw.rxdj.zhcx")
public Object pageData(@Param(value = "year", required = false) Integer year,
@Param(value = "djlx", required = false) Integer djlx,
@Param(value = "unionid", required = false) String unionid,
@Param(value = "unitid", required = false) String unitid, PageForm pageForm) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
u.username,
dj.*,
u.username jzgname,
u.unitname dwname,
u.unionname AS jzgfghname,
u.unitname AS jzgdwname,
st.stateColor,
st.stateName
FROM
fw_rxdj dj
LEFT JOIN `user` u ON u.id = dj.dj_jzgid
LEFT JOIN audit_state st ON st.stateId = dj.dj_sqzt
$condition
""");
cnd.andEX("YEAR(dj.dj_tbrq)", "=", year);
cnd.andEX("dj.dj_djlx", "=", djlx);
cnd.andEX("dj.applyType", "=", "rxdj");
cnd.andEX("u.unionid", "=", unionid);
cnd.andEX("u.unitid", "=", unitid);
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(), pageForm.getPageOrderBy().equals("ascending") ? "asc" : "desc");
} else {
cnd.desc("dj.dj_tbrq").asc("dj.dj_djlx");
}
sql.setCondition(cnd);
return baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
@At
@Ok("void")
@RequiresPermissions(value = {"zgfw.rxdj.zhcx", "zgfw.rxdj.xghsh"}, logical = Logical.OR)
public void doExport(String djid, Integer isAudit, String year, String djlx, String unionid, HttpServletResponse response) throws IOException {
Map<String, Object> map = new HashMap<String, Object>();
CndPlus cnd = CndPlus.create();
Sql sql = Sqls.create("""
SELECT
rx.*,
u.username,
u.loginname
FROM
fw_rxdj rx
LEFT JOIN `user` u ON u.id = rx.dj_jzgid
$condition
""");
if (Strings.isNotBlank(djid)) {
cnd.andEX("rx.dj_id", "=", djid);
} else {
cnd.andEX("YEAR(rx.dj_tbrq)", "=", year);
cnd.andEX("rx.dj_djlx", "=", djlx);
cnd.andEX("u.unionid", "=", unionid);
if (isAudit == 1) {
cnd.andEX("rx.dj_sqzt", "in", List.of(5100, 5200, 5300));
} else if (isAudit == 2) {
cnd.andEX("rx.dj_sqzt", "=", 5300);
} else {
cnd.andEX("rx.dj_sqzt", "=", 5100);
}
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
if (ShiroUtil.hasRole("H04")) {
cnd.andEX("u.unionid", "=", Vi.getUnionId());
}
}
}
cnd.andEX("rx.applyType", "=", "rxdj");
cnd.desc("u.unitcode");
sql.setCondition(cnd);
List<NutMap> maps = baseService.listMap(sql);
for (int i = 0; i < maps.size(); i++) {
maps.get(i).put("index", i + 1);
}
map.put("maplist", maps);
if (!ShiroUtil.hasAnyRoles("why02,why03,A06,sysadmin")) {
map.put("unionname", "院级工会 (单位公章):");
map.put("unionUsername", "工会主席(签名):");
}
map.put("schoolName", Globals.schoolName);
map.put("year", year);
String fileName;
String templateUrl;
if (Strings.isNotBlank(djid)) {
djlx = maps.get(0).getString("dj_djlx");
}
if (djlx.equals("1")) {
fileName = Globals.schoolName + "幼儿园升小学信息统计表.xlsx";
templateUrl = officeTemplateUtil.getPath("rx_ysx");
} else if (djlx.equals("2")) {
fileName = Globals.schoolName + "小学升初中信息统计表.xlsx";
templateUrl = officeTemplateUtil.getPath("rx_xsc");
} else {
fileName = Globals.schoolName + "初中升高中信息统计表.xlsx";
templateUrl = officeTemplateUtil.getPath("rx_csg");
}
response.setContentType("application/octet-stream");
ViTool.excelResponse(response, fileName);
TemplateExportParams params = new TemplateExportParams(
templateUrl);
Workbook workbook = ExcelExportUtil.exportExcel(params, map);
workbook.write(response.getOutputStream());
}
@At
@Ok("void")
@RequiresPermissions(value = {"zgfw.rxdj.zhcx", "zgfw.rxdj.xghsh"}, logical = Logical.OR)
public void doDownload(String djid, boolean isDownload, Integer isAudit, Integer year, String unionid, Integer djlx, HttpServletResponse response) throws Exception {
Trans.exec(() -> {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
rx.*,
u.username,
u.loginname,
u.unionid,
u.unionname
FROM
fw_rxdj rx
LEFT JOIN `user` u ON u.id = rx.dj_jzgid
$condition
""");
if (Strings.isNotBlank(djid)) {
cnd.andEX("rx.dj_id", "=", djid);
} else {
cnd.andEX("YEAR(rx.dj_tbrq)", "=", year);
cnd.andEX("rx.dj_djlx", "=", djlx);
cnd.andEX("u.unionid", "=", unionid);
if (isAudit == 1) {
cnd.andEX("rx.dj_sqzt", "in", List.of(5100, 5200, 5300));
} else if (isAudit == 2) {
cnd.andEX("rx.dj_sqzt", "=", 5300);
} else {
cnd.andEX("rx.dj_sqzt", "=", 5100);
if (!isDownload) {
cnd.andEX("rx.isDownload", "=", false);
}
}
}
cnd.andEX("rx.applyType", "=", "rxdj");
cnd.desc("u.unitcode");
sql.setCondition(cnd);
List<NutMap> userListMap = baseService.listMap(sql);
if (Strings.isBlank(djid) && isAudit == 3) {
List<String> dj_djids = userListMap.stream().map(v -> v.getString("dj_id")).collect(Collectors.toList());
baseService.dao().update(Fw_rxdj.class, Chain.make("isDownload", true), Cnd.where("dj_id", "in", dj_djids));
}
Path rootPath = null;
try {
rootPath = Path.of("子女入学登记" + System.currentTimeMillis());
Path childSchoolDirectory = Files.createDirectory(rootPath);
userListMap.forEach(v -> {
String userName = v.getString("username");
String unionName = v.getString("unionname").replace("/", "").replaceAll("\\s*", "");
try {
Path userNamePath = Path.of(childSchoolDirectory + "/" + userName + "(" + unionName + ")");
if (!FileUtil.exist(userNamePath.toFile())) {
userNamePath = Files.createDirectory(userNamePath);
}
List<Sys_file> files = baseService.dao().query(Sys_file.class, Cnd.where("reid", "=", v.getString("dj_id")));
for (int i = 0; i < files.size(); i++) {
try {
Sys_file sysFile = files.get(i);
String imageType = null;
if (sysFile.getBz().equals("hkfile")) {
imageType = "户口簿图片" + (i + 1);
} else if (sysFile.getBz().equals("csfile")) {
imageType = "子女出生证" + (i + 1);
} else if (sysFile.getBz().equals("pyhtfile")) {
imageType = "聘用合同复印件" + (i + 1);
} else if (sysFile.getBz().equals("jszgfile")) {
imageType = "学历学位证或教师资格证" + (i + 1);
}
String fullFileName = v.getString("username") + "(" + v.getString("loginname") + ")" + imageType;
String extName = cn.hutool.core.io.FileUtil.extName(sysFile.getFilename());
FileOutputStream outputStream = new FileOutputStream(userNamePath.toAbsolutePath() + "\\" + fullFileName + "." + extName);
ftpService.download(sysFile.getFilepath(), outputStream);
outputStream.close();
} catch (Exception e) {
e.printStackTrace();
}
}
} catch (IOException e) {
e.printStackTrace();
}
});
} catch (IOException e) {
e.printStackTrace();
}
File zipFile = ZipUtil.zip(rootPath.toFile());
FileUtil.del(rootPath.toFile());
response.setHeader("content-disposition", "attachment;filename=" + URLEncoder.encode("子女入学登记文件.zip", StandardCharsets.UTF_8));
try (ServletOutputStream responseOutputStream = response.getOutputStream();) {
FileUtils.copyFile(zipFile, responseOutputStream);
} catch (IOException e) {
e.printStackTrace();
} finally {
FileUtil.del(zipFile);
}
});
}
public void download(String fileNameHasPath, OutputStream outputStream) {
FTPClient ftpClient = null;
try {
ftpClient = connect();
if (ftpClient == null) {
return;
}
fileNameHasPath = new String(fileNameHasPath.getBytes("UTF-8"), "ISO-8859-1");
Streams.write(outputStream, ftpClient.retrieveFileStream(fileNameHasPath));
} catch (IOException e) {
} finally {
if (ftpClient.isConnected()) {
try {
ftpClient.logout();
ftpClient.disconnect();
} catch (IOException e) {
}
}
}
}
public FTPClient connect() {
FTPClient ftpClient = null;
try {
ftpClient = new FTPClient();
ftpClient.connect("127.0.0.1", 21);
ftpClient.login("ftpuser", "sansi0109=ZK");
if (!FTPReply.isPositiveCompletion(ftpClient.getReplyCode())) {
ftpClient.disconnect();
return null;
} else {
}
ftpClient.enterLocalPassiveMode();
ftpClient.setFileType(FTPClient.BINARY_FILE_TYPE);
ftpClient.setDefaultTimeout(100 * 1000);
ftpClient.setBufferSize(3072);
ftpClient.sendCommand("OPTS UTF8", "ON");
ftpClient.setControlEncoding("UTF-8");
} catch (IOException e) {
}
return ftpClient;
}
}
@@ -0,0 +1,167 @@
package io.v.nutz.zhgh.zgfw.controller.rxdj.mobile;
/**
* Created by lyw on 2020/3/9 13:22
*/
import cn.hutool.core.util.ArrayUtil;
import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.base.service.ViService;
import io.v.nutz.sys.models.Sys_file;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.model.rxdj.Fw_rxdj;
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.dao.util.cri.Static;
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 org.nutz.mvc.annotation.Param;
import org.nutz.trans.Trans;
import java.io.IOException;
import java.util.List;
/**
* Created by lyw on 2020/3/2 13:10
*/
@IocBean
@At("/platform/zgfw/mobile/rxdj")
public class ZgfwJzgznrxdjMobileController {
@Inject("Fw_rxdj")
private ViService<Fw_rxdj> jzgznbmdjService;
@Inject("Sys_file")
private ViService<Sys_file> fileViService;
@At("/kindergarten")
@Ok("beetl:/platform/zgfw/rxdj/mobile/rxdj_kindergarten.html")
public void kindergarten() {
}
@At("/psms")
@Ok("beetl:/platform/zgfw/rxdj/mobile/rxdj_psms.html")
public void psms() {
}
@Inject
private SysUserService sysUserService;
@At
@Ok("json")
public Object queryUserByLoginname(String loginname, Boolean member) {
try {
Sql sql = Sqls.create("SELECT\n" +
"\tu.`id`,\n" +
"\tu.`loginname`,\n" +
"\tu.`username`,\n" +
"\tu.unitid,\n" +
"\tu.unitname unitname,\n" +
"\tu.`unionname` \n" +
"FROM\n" +
"\t`user` u $condition");
Cnd cnd = Cnd.NEW();
cnd.and("u.loginname", "=", loginname);
if (null != member && member) {
cnd.and(new Static("(SELECT COUNT(1) FROM sys_user_role sur WHERE sur.`roleId`='83608da210fd4551acbb063668b14370' AND sur.`userId`=u.`id`) > 0"));
}
sql.setCondition(cnd);
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:full")
@ViReturn
public Object getUserInfo() {
Sql sql = Sqls.create("""
SELECT
u.id,
u.loginname,
u.username,
u.unitid,
u.unitname,
u.unionid,
u.unionname,
u.position,
u.jobTitle,
u.mobile
FROM
`user` u
WHERE
u.id = @id
""").setParam("id", ShiroUtil.getPrincipalProperty("id"));
NutMap fetch = jzgznbmdjService.fetch(sql);
return fetch;
}
@Inject
private FtpService ftpService;
private void saveFiles(Sys_file[] files, String djid) throws IOException {
for (Sys_file file : files) {
file.setReid(djid);
fileViService.insert(file);
}
}
@At
@Ok("json")
public Object getFlag(Integer lx) {
Sql sql = Sqls.create("SELECT COUNT(1) FROM fw_rxdj_year ye WHERE ye.`bmyear` = YEAR(NOW()) AND NOW()>ye.`bmkssj` AND NOW()<ye.`bmjssj` AND ye.`bmkqzt`=1 AND ye.`bmlx` = @lx").setParam("lx", lx);
int count = jzgznbmdjService.count(sql);
/*if (count == 0) {
return Result.error("当前未开启报名!");
}*/
return Result.success();
}
@Inject
private MsgApi msgApi;
@At
@Ok("json")
@ViReturn
public Object doEdit(boolean flag,
@Param("data") Fw_rxdj jzgznbmdj,
@Param(value = "hkfile", required = false) Sys_file[] hkfile,
@Param(value = "csfile", required = false) Sys_file[] csfile,
@Param(value = "fcfile", required = false) Sys_file[] fcfile,
@Param(value = "jszgfile", required = false) Sys_file[] jszgfile,
@Param(value = "pyhtfile", required = false) Sys_file[] pyhtfile,
@Param(value = "qmkffile", required = false) Sys_file[] qmkffile) {
Trans.exec(() -> {
try {
jzgznbmdj.setDj_sqzt(flag ? 5100 : 5000);
jzgznbmdj.setApplyType("rxdj");
jzgznbmdjService.updateIgnoreNull(jzgznbmdj);
fileViService.clear(Cnd.where("reid", "=", jzgznbmdj.getDj_id()));
Sys_file[] sys_files = ArrayUtil.addAll(hkfile, csfile, jszgfile, pyhtfile);
saveFiles(sys_files, jzgznbmdj.getDj_id());
} catch (IOException e) {
e.printStackTrace();
}
});
return null;
}
}
@@ -0,0 +1,32 @@
package io.v.nutz.zhgh.zgfw.controller.rxdj.mobile;
import io.v.nutz.base.service.BaseService;
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.Ok;
@IocBean
@Ok("json:full")
@At("/platform/zgfw/mobile/rxdj/apply")
public class rxdjApplyMobileController {
@Inject
private BaseService baseService;
@At("")
@Ok("beetl:/mobile/rxdj/applyDjList.html")
public void index() {
}
@At("/info")
@Ok("beetl:/mobile/rxdj/applyInfo.html")
public void info() {
}
}
@@ -0,0 +1,128 @@
package io.v.nutz.zhgh.zgfw.controller.rxdj.mobile;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.model.rxdj.Fw_rxdj;
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.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.List;
/**
* @author zhf
* @date 2022/1/13 10:19
* @description
*/
@IocBean
@Ok("json:full")
@At("/platform/zgfw/mobile/rxdj/audit")
public class rxdjMobileController {
@Inject
private BaseService baseService;
@At("/unit")
@Ok("beetl:/mobile/rxdj/unitAudit.html")
public void unitIndex() {
}
@At("/school")
@Ok("beetl:/mobile/rxdj/schoolAudit.html")
public void schoolIndex() {
}
@At("/auditList")
@Ok("beetl:/mobile/rxdj/auditList.html")
public void auditList() {
}
@At
@ViReturn
public Object GetRxdjDjSqzt(String dj_id) {
return baseService.dao().query(Fw_rxdj.class, Cnd.where("dj_id", "=", dj_id)).get(0).getDj_sqzt();
}
@At
@ViReturn
public Object pageData(@Param(value = "djlx", required = false) Integer djlx,
@Param(value = "isAudit", required = false) boolean isAudit,
@Param(value = "year", required = false) Integer year,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "lx", required = false) Integer lx, Integer pageNumber, Integer pageSize) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
dj.*,
ur.username jzgname,
ur.unitname dwname,
ur.unionname AS jzgfghname,
st.stateColor,
st.stateName
FROM
fw_rxdj dj
LEFT JOIN `user` ur ON ur.id = dj.dj_jzgid
LEFT JOIN audit_state st ON st.stateId = dj.dj_sqzt
$condition
""");
if (lx == 1) {
cnd.and("dj.dj_sqzt", isAudit ? ">" : "=", 5100);
if ((!ShiroUtil.hasRole("sysadmin")) && (ShiroUtil.hasRole("H04") || ShiroUtil.hasRole("sp03"))) {
cnd.and(Cnd.exps("ur.unionid", "=", Vi.getUnionId()).or("dj.dj_tbrfgh", "=", Vi.getUnionId()));
}
} else {
cnd.and("dj.dj_sqzt", isAudit ? ">" : "=", 5200);
}
cnd.andEX("dj.dj_djlx ", "=", djlx);
cnd.andEX("YEAR(dj.dj_tbrq)", "=", year);
cnd.andEX("dj.applyType", "=", "rxdj");
cnd.andEX("ur.unionid", "=", unionId);
cnd.andEX("ur.unitid", "=", unitId);
cnd.desc("dj.dj_tbrq");
sql.setCondition(cnd);
return baseService.listPageMap(pageNumber, pageSize, sql);
}
@At("/auditHtml")
@Ok("re")
public String auditHtml(Integer dj_sqzt) {
if (dj_sqzt == 5100 && ShiroUtil.hasAnyRoles("H04,A06,sysadmin")) {
return "beetl:/mobile/rxdj/unitAudit.html";
} else if (dj_sqzt == 5200 && ShiroUtil.hasAnyRoles("A06,wyh02,wyh03,sysadmin")) {
return "beetl:/mobile/rxdj/schoolAudit.html";
}
return "beetl:/mobile/rxdj/applyInfo.html";
}
@At
@ViReturn
public Object findOne(String dj_id) {
List<Fw_rxdj> rxdjs = baseService.dao().query(Fw_rxdj.class, Cnd.where("dj_id", "=", dj_id));
if (rxdjs.size() > 0) {
return rxdjs.get(0);
}
return null;
}
}
@@ -0,0 +1,84 @@
package io.v.nutz.zhgh.zgfw.controller.rxdj;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.model.rxdj.Fw_rxdj;
import org.nutz.dao.Cnd;
import org.nutz.dao.util.cri.Static;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
@IocBean
@Ok("json:full")
@At("/platform/rxdj/agent")
public class rxdjAgentController {
@Inject
private Vi vi;
@Inject
private BaseService baseService;
private static final String UNIT = "/platform/zgfw/rxdj/sh/fghindex";
private static final String SCHOOL = "/platform/zgfw/rxdj/sh/xghindex";
private static final String MOBILE_UNIT = "/platform/zgfw/mobile/rxdj/audit/auditList?lx=1";
private static final String MOBILE_SCHOOL = "/platform/zgfw/mobile/rxdj/audit/auditList?lx=2";
@At
@ViReturn
public Object getAgenda(HttpServletRequest request) {
final String title = "【子女入学登记】";
List<NutMap> result = new ArrayList<>();
String userAgent = request.getHeader("user-agent");
String unitUrl = "";
String schoolUrl = "";
//移动端访问
if (userAgent.contains("Android") || userAgent.contains("iPhone") || userAgent.contains("iPad")) {
unitUrl = MOBILE_UNIT;
schoolUrl = MOBILE_SCHOOL;
} else {
unitUrl = UNIT;
schoolUrl = SCHOOL;
}
if (ShiroUtil.hasAnyRoles("sysadmin")) {
result.add(new NutMap().setv("title", title).setv("url", unitUrl).setv("iconClass", vi.getIconByPath(UNIT)).setv("label", "待分工会审核").setv("number", getUnitCount()));
result.add(new NutMap().setv("title", title).setv("url", schoolUrl).setv("iconClass", vi.getIconByPath(SCHOOL)).setv("label", "待校工会审核").setv("number", getSchoolCount()));
} else {
if (ShiroUtil.hasAnyRoles("H04,gh01")) {
result.add(new NutMap().setv("title", title).setv("url", unitUrl).setv("iconClass", vi.getIconByPath(UNIT)).setv("label", "待分工会审核").setv("number", getUnitCount()));
}
if (ShiroUtil.hasAnyRoles("A06,wyh02")) {
result.add(new NutMap().setv("title", title).setv("url", schoolUrl).setv("iconClass", vi.getIconByPath(SCHOOL)).setv("label", "待校工会审核").setv("number", getSchoolCount()));
}
}
return result;
}
public Integer getUnitCount() {
Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
cnd.and(Cnd.exps("dj_tbrfgh", "=", vi.getUnionId())
.or(new Static("dj_jzgid in (select id from `user` where unionid = '%s')".formatted(vi.getUnionId()))));
}
cnd.and("dj_sqzt", "=", 5100);
cnd.and("dj_year", "=", DateUtil.getYear());
return baseService.dao().count(Fw_rxdj.class, cnd);
}
public Integer getSchoolCount() {
return baseService.dao().count(Fw_rxdj.class, Cnd.where("dj_sqzt", "=", 5200).and("dj_year", "=", DateUtil.getYear()));
}
}
@@ -0,0 +1,138 @@
package io.v.nutz.zhgh.zgfw.controller.singleChild;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.ViService;
import io.v.nutz.base.utils.ViTool;
import io.v.nutz.zhgh.zgfw.model.singleChild.SingleChild;
import io.v.nutz.zhgh.zgfw.model.singleChild.SingleChildStateEnum;
import lombok.Data;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.RequiresPermissions;
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.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
/**
* @author zhf
* @date 2021/5/7 8:55
* @description
*/
@At("/platform/fw/singleChild/reading")
@IocBean
@Ok("json:full")
public class readingPublicityController {
@Inject("SingleChild")
private ViService<SingleChild> singleChildViService;
@At("")
@Ok("beetl:platform/zgfw/singleChild/reading.html")
@RequiresPermissions("fw.singleChild.reading")
public void index() {
}
@At
@ViReturn
@RequiresPermissions("fw.singleChild.reading")
public Object pageData(@Param(value = "unitId",required = false) String unitId,
@Param(value = "year",required = false) Integer year,
@Param(value = "unionId",required = false) String unionId, PageForm page) {
CndPlus cnd = CndPlus.create();
Sql sql = Sqls.create("""
SELECT
sc.*,
u.loginname,
u.username,
u.unitname,
u.unionname
FROM
single_child sc
LEFT JOIN `user` u ON u.id=sc.userid
$condition
""");
cnd.andEX("u.unionid", "=", unionId);
cnd.andEX("u.unitid", "=", unitId);
cnd.andEX("YEAR(sc.sqsj)", "=", year);
cnd.and("sc.state", "=", SingleChildStateEnum.XGHTG.getStateCode());
sql.setCondition(cnd);
Pagination pagination = singleChildViService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
return SingleChildStateEnum.assignStateInfo(pagination);
}
@Data
public static class single {
@Excel(name = "工号", width = 20d)
private String loginname;
@Excel(name = "上报人", width = 20d)
private String username;
@Excel(name = "基层工会", width = 20d)
private String unionname;
@Excel(name = "入职时间", width = 20d)
private String rzsj;
@Excel(name = "申请时间", width = 20d)
private String sqsj;
@Excel(name = "子女姓名", width = 20d)
private String name;
@Excel(name = "子女性别", width = 20d)
private String sex;
@Excel(name = "出生时间", width = 20d)
private String cssj;
@Excel(name = "办证时间", width = 20d)
private String bzsj;
}
@At
@ViReturn
@Ok("void")
@RequiresPermissions("fw.singleChild.reading")
public void export(@Param(value = "unitId",required = false) String unitId,
@Param(value = "year",required = false) Integer year,
@Param(value = "unionId",required = false) String unionId, HttpServletResponse response) throws IOException {
CndPlus cnd = CndPlus.create();
Sql sql = Sqls.create("""
SELECT
sc.*,
u.loginname,
u.username,
u.unitname,
u.unionname
FROM
single_child sc
LEFT JOIN `user` u ON u.id=sc.userid
$condition
""");
cnd.andEX("u.unionid", "=", unionId);
cnd.andEX("u.unitid", "=", unitId);
cnd.andEX("YEAR(sc.sqsj)", "=", year);
cnd.and("sc.state", "=", SingleChildStateEnum.XGHTG.getStateCode());
sql.setCondition(cnd);
List<single> singles = singleChildViService.listEntity(sql, single.class);
ViTool.excelResponse(response, "独身子女补助申请表.xlsx");
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, single.class, singles);
workbook.write(response.getOutputStream());
workbook.close();
}
}
@@ -0,0 +1,197 @@
package io.v.nutz.zhgh.zgfw.controller.singleChild;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.ViService;
import io.v.nutz.sys.models.Sys_file;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.model.singleChild.SingleChild;
import io.v.nutz.zhgh.zgfw.model.singleChild.SingleChildStateEnum;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.FieldFilter;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.Daos;
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.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.Calendar;
/**
* @author zhf
* @date 2021/5/6 14:18
* @description 独身子女上报
*/
@At("/platform/fw/singleChild/report")
@IocBean
@Ok("json:full")
public class reportController {
@Inject
private Dao dao;
@Inject("SingleChild")
private ViService<SingleChild> singleChildViService;
@Inject("Sys_file")
private ViService<Sys_file> fileViService;
@At("")
@Ok("beetl:platform/zgfw/singleChild/report.html")
@RequiresPermissions("fw.singleChild.report")
public void index() {
}
@At
@ViReturn
@RequiresPermissions("fw.singleChild.report")
public Object pageData(PageForm page, @Param(value = "year",required = false) String year) {
CndPlus cnd = CndPlus.create();
Sql sql = Sqls.create("""
SELECT
sc.*,
u.username,
u.unitname,
u.unionname
FROM
single_child sc
LEFT JOIN `user` u ON u.id=sc.userid
$condition
""");
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
cnd.and("sc.userid", "=", ShiroUtil.getPrincipalProperty("id"));
}
cnd.and("YEAR(sc.sqsj)", "=", year);
cnd.desc("sc.sqsj");
sql.setCondition(cnd);
Pagination pagination = singleChildViService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
return SingleChildStateEnum.assignStateInfo(pagination);
}
@At
@ViReturn
@RequiresPermissions("fw.singleChild.report")
public Object doAdd(SingleChild singleChild) {
String userid = (String) ShiroUtil.getPrincipalProperty("id");
int currentYear = Calendar.getInstance().get(Calendar.YEAR);
int count = dao.count(SingleChild.class, Cnd.where("userid", "=", userid).and("YEAR(sqsj)", "=", currentYear));
if (count > 0) {
return Result.error("今年已经申请过了,请勿重复申请!");
}
singleChild.setUserid(userid);
singleChild.setSqsj(DateUtil.getDate());
singleChild.setState(SingleChildStateEnum.DFGHSH.getStateCode());
singleChildViService.insert(singleChild);
return null;
}
@At
@ViReturn
@RequiresPermissions("fw.singleChild.report")
public Object doEdit(SingleChild singleChild) {
//拒绝之后的修改重新改状态
if (singleChild.getState().equals(SingleChildStateEnum.FGHTHDXG.getStateCode())) {
singleChild.setFghshr(null);
singleChild.setFghshsj(null);
singleChild.setFghshyj(null);
singleChild.setXghshyj(null);
singleChild.setXghshsj(null);
singleChild.setXghshyj(null);
singleChild.setState(SingleChildStateEnum.DFGHSH.getStateCode());
}
return singleChildViService.update(singleChild);
}
@At
@ViReturn
@RequiresPermissions("fw.singleChild.report")
public Object findOne(String id) {
Sql sql = Sqls.create("""
SELECT
sc.*,
u.loginname,
u.username,
u.unitname,
u.unionname,
f.username fuaername,
x.username xusername
FROM
single_child sc
LEFT JOIN `user` u ON u.id = sc.userid
LEFT JOIN `user` f ON f.id = sc.fghshr
LEFT JOIN `user` x ON x.id = sc.xghshr
WHERE
sc.id = @id
""").setParam("id", id);
return singleChildViService.list(sql).get(0);
}
@At
@ViReturn
@RequiresPermissions("fw.singleChild.report")
public Object doDelete(String id) {
singleChildViService.delete(id);
return null;
}
/**
* 寻找往年上传的子女证
*
* @param childName 子女姓名
* @return
*/
@At
@ViReturn
@Ok("json")
@RequiresPermissions("fw.singleChild.report")
public Object getCert(String childName) {
FieldFilter fieldFilter = FieldFilter.create(SingleChild.class, "sex|bzsj|cssj|files");
Dao ext = Daos.ext(dao, fieldFilter);
Cnd cnd = Cnd.NEW();
cnd.and("userid", "=", ShiroUtil.getPrincipalProperty("id"));
cnd.and("`name`", "=", childName.trim());
cnd.and("files", "!=", "");
cnd.and("files", "is not", null);
return ext.fetch(SingleChild.class, cnd);
// Sql sql = Sqls.create("""
// SELECT
// sex,
// bzsj,
// cssj,
// files
// FROM
// `single_child`
// WHERE
// userid = @userid
// AND `name` = @childName
// AND files IS NOT null
// AND files != ''
// ORDER BY sqsj desc
// LIMIT 0,1
// """);
// sql.setParam("userid", ShiroUtil.getPrincipalProperty("id"));
// sql.setParam("childName", childName);
// NutMap fetch = singleChildViService.fetch(sql);
//
// String files = (String) Daos.query(singleChildViService.dao(), sql.toString(), Sqls.callback.str());
// return Json.fromJsonAsArray(Sys_file.class, files);
}
}
@@ -0,0 +1,157 @@
package io.v.nutz.zhgh.zgfw.controller.singleChild;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.ViService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.model.singleChild.SingleChild;
import io.v.nutz.zhgh.zgfw.model.singleChild.SingleChildStateEnum;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
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.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
/**
* @author zhf
* @date 2021/5/7 8:31
* @description
*/
@At("/platform/fw/singleChild/school")
@IocBean
@Ok("json:full")
public class schoolUnionController {
@Inject
private Dao dao;
@Inject("SingleChild")
private ViService<SingleChild> singleChildViService;
@At("")
@Ok("beetl:platform/zgfw/singleChild/school.html")
@RequiresPermissions("fw.singleChild.school")
public void index() {
}
@At
@ViReturn
@RequiresPermissions("fw.singleChild.school")
public Object pageData(@Param(value = "unitId",required = false) String unitId,
@Param(value = "unionId",required = false) String unionId,
@Param(value = "isAudit",required = false) Integer isAudit,
@Param(value = "year",required = false) Integer year, PageForm page) {
CndPlus cnd = CndPlus.create();
Sql sql = Sqls.create("""
SELECT
sc.*,
u.loginname,
u.username,
u.unitname,
u.unionname
FROM
single_child sc
LEFT JOIN `user` u ON u.id=sc.userid
$condition
""");
switch (isAudit) {
//全部
case 1 -> {
cnd.and("sc.state", "in", new Integer[]{
SingleChildStateEnum.XGHJJ.getStateCode(),
SingleChildStateEnum.XGHTH.getStateCode(),
SingleChildStateEnum.XGHTG.getStateCode(),
SingleChildStateEnum.DXGHSH.getStateCode()});
}
//已审核
case 2 -> cnd.and("sc.state", "in", new Integer[]{
SingleChildStateEnum.XGHJJ.getStateCode(),
SingleChildStateEnum.XGHTH.getStateCode(),
SingleChildStateEnum.XGHTG.getStateCode()});
//未审核
case 3 -> cnd.and("sc.state", "in", SingleChildStateEnum.DXGHSH.getStateCode());
}
cnd.andEX("YEAR(sc.sqsj)", "=", year);
cnd.andEX("u.unionid", "=", unionId);
cnd.andEX("u.unitid", "=", unitId);
if (Vi.isNotBlank(page.getSearchName(), page.getSearchKeyword())) {
cnd.where().andLike(page.getSearchName(), page.getSearchKeyword());
}
sql.setCondition(cnd);
Pagination pagination = singleChildViService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
return SingleChildStateEnum.assignStateInfo(pagination);
}
@At
@ViReturn
@RequiresPermissions("fw.singleChild.school")
public Object doReview(SingleChild singleChild, Integer result) {
switch (result) {
case -1 -> singleChild.setState(SingleChildStateEnum.XGHTH.getStateCode());
case 0 -> singleChild.setState(SingleChildStateEnum.XGHJJ.getStateCode());
case 1 -> singleChild.setState(SingleChildStateEnum.XGHTG.getStateCode());
}
singleChild.setXghshr((String) ShiroUtil.getPrincipalProperty("id"));
singleChild.setXghshsj(DateUtil.getDateTime());
singleChildViService.updateIgnoreNull(singleChild);
return null;
}
/**
* 撤回
*
* @param id id
* @return ?
*/
@At("/doRollBack/?")
@ViReturn
@RequiresPermissions("fw.singleChild.school")
public Object doRollBack(String id) {
Chain chain = Chain.make("state", SingleChildStateEnum.DXGHSH.getStateCode());
chain.add("xghshr", null);
chain.add("xghshsj", null);
chain.add("xghshyj", null);
dao.update(SingleChild.class, chain,
Cnd.where("id", "=", id));
return null;
}
/**
* 批通过
*
* @param ids id
* @return {@link Object}
*/
@At
@ViReturn
@RequiresPermissions("fw.singleChild.school")
public Object batchPass(String[] ids) {
Chain chain = Chain.make("state", SingleChildStateEnum.XGHTG.getStateCode());
chain.add("xghshr", ShiroUtil.getPrincipalProperty("id"));
chain.add("xghshsj", DateUtil.getDateTime());
chain.add("xghshyj", "通过");
dao.update(SingleChild.class, chain,
Cnd.where("id", "in", ids));
return null;
}
}
@@ -0,0 +1,88 @@
package io.v.nutz.zhgh.zgfw.controller.singleChild;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.service.ViService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.model.singleChild.SingleChild;
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 java.util.ArrayList;
import java.util.List;
/**
* @author zhf
* @date 2021/5/8 14:57
* @description
*/
@IocBean
@Ok("json:full")
@At("/platform/singleChild/agent")
public class singleChildAgentController {
@Inject
private Vi vi;
@Inject("SingleChild")
private ViService<SingleChild> singleChildViService;
private static final String SUB = "/platform/fw/singleChild/sub";
private static final String SCHOOL = "/platform/fw/singleChild/school";
@At
@ViReturn
public Object getAgenda() {
List<NutMap> result = new ArrayList<>();
if (ShiroUtil.hasAnyRoles("sysadmin")) {
result.add(new NutMap().setv("url", SUB).setv("iconClass", vi.getIconByPath(SUB)).setv("label", "独生子女基层工会审核").setv("number", getSubCount()));
result.add(new NutMap().setv("url", SCHOOL).setv("iconClass", vi.getIconByPath(SCHOOL)).setv("label", "独生子女待工会主席审核").setv("number", getSchoolCount()));
} else {
if (ShiroUtil.hasAnyRoles("H01,gh01")) {
result.add(new NutMap().setv("url", SUB).setv("iconClass", vi.getIconByPath(SUB)).setv("label", "独生子女基层工会审核").setv("number", getSubCount()));
}
if (ShiroUtil.hasRole("wyh02")) {
result.add(new NutMap().setv("url", SCHOOL).setv("iconClass", vi.getIconByPath(SCHOOL)).setv("label", "独生子女待工会主席审核").setv("number", getSchoolCount()));
}
}
return result;
}
/**
* 待工会主席审核
*
* @return
*/
private Integer getSubCount() {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT COUNT(1) FROM single_child sc LEFT JOIN `user` us ON sc.userid=us.id $condition
""");
cnd.and("sc.shjg", "=", 1);
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
cnd.and("us.unionid", "=", vi.getUnionId());
}
sql.setCondition(cnd);
return singleChildViService.count(sql);
}
/**
* 待校工会主席审核
*
* @return
*/
private Integer getSchoolCount() {
return singleChildViService.count(Cnd.where("shjg", "=", 3));
}
}
@@ -0,0 +1,115 @@
package io.v.nutz.zhgh.zgfw.controller.singleChild;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.ViService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.model.singleChild.SingleChild;
import io.v.nutz.zhgh.zgfw.model.singleChild.SingleChildStateEnum;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
/**
* @author zhf
* @date 2021/5/6 16:22
* @description 基层工会审核
*/
@At("/platform/fw/singleChild/sub")
@IocBean
@Ok("json:full")
public class subController {
@Inject("SingleChild")
private ViService<SingleChild> singleChildViService;
@At("")
@Ok("beetl:platform/zgfw/singleChild/sub.html")
@RequiresPermissions("fw.singleChild.sub")
public void index() {
}
@At
@ViReturn
@RequiresPermissions("fw.singleChild.sub")
public Object pageData(@Param(value = "unitId",required = false) String unitId,
@Param(value = "unionId",required = false) String unionId,
@Param(value = "isAudit",required = false) Integer isAudit,
PageForm page, @Param(value = "year",required = false) Integer year) {
CndPlus cnd = CndPlus.create();
Sql sql = Sqls.create("""
SELECT
sc.*,u.loginname,u.username,u.unitname,u.unionname
FROM
single_child sc
LEFT JOIN `user` u ON u.id=sc.userid
$condition
""");
switch (isAudit) {
case 1 -> {
}
//已审核
case 2 -> {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or("sc.state", "=", SingleChildStateEnum.FGHTHDXG.getStateCode());
seg.or("sc.state", ">", SingleChildStateEnum.DFGHSH.getStateCode());
cnd.and(seg);
}
//未审核
case 3 -> {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or("sc.state", "=", SingleChildStateEnum.DFGHSH.getStateCode());
seg.or("sc.state", "=", SingleChildStateEnum.XGHTH.getStateCode());
cnd.and(seg);
}
}
cnd.andEX("YEAR(sc.sqsj)", "=", year);
cnd.andEX("u.unionid", "=", unionId);
cnd.andEX("u.unitid", "=", unitId);
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
if (ShiroUtil.hasAnyRoles("H04")) {
cnd.and("u.unionid", "=", Vi.getUnionId());
}
}
if (Vi.isNotBlank(page.getSearchName(), page.getSearchKeyword())) {
cnd.where().andLike(page.getSearchName(), page.getSearchKeyword());
}
sql.setCondition(cnd);
Pagination pagination = singleChildViService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
return SingleChildStateEnum.assignStateInfo(pagination);
}
@At
@ViReturn
@RequiresPermissions("fw.singleChild.sub")
public Object doReview(SingleChild singleChild, Integer result) {
switch (result) {
case -1 -> singleChild.setState(SingleChildStateEnum.FGHTHDXG.getStateCode());
case 0 -> singleChild.setState(SingleChildStateEnum.FGHJJ.getStateCode());
case 1 -> singleChild.setState(SingleChildStateEnum.DXGHSH.getStateCode());
}
singleChild.setFghshr((String) ShiroUtil.getPrincipalProperty("id"));
singleChild.setFghshsj(DateUtil.getDateTime());
singleChildViService.updateIgnoreNull(singleChild);
return null;
}
}
@@ -0,0 +1,119 @@
package io.v.nutz.zhgh.zgfw.controller.wwj;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.base.service.BaseService;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.model.wwj.Fw_Wwj;
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;
@IocBean
@At("/platform/zgfw/wwj/sh")
@Ok("json:full")
public class WwjShController {
@Inject
private BaseService baseService;
@At
@Ok("re")
@RequiresPermissions("zgfw.wwj.fghsh")
public String fghindex(){
return "beetl:/platform/zgfw/wwj/fghsh.html";
}
@At
@Ok("re")
@RequiresPermissions("zgfw.wwj.xghsh")
public String xghindex(){
return "beetl:/platform/zgfw/wwj/xghsh.html";
}
@At
public Object pageData(Integer lx,Integer pageNumber,Integer pageSize,String searchName,String searchKeyword){
try{
Sql sql = Sqls.create("SELECT\n" +
"\txx.*,\n" +
"\twwr.username AS wwrusername,\n" +
"\tsqr.username AS sqrusername \n" +
"FROM\n" +
"\t`fw_wwj` xx\n" +
"\tLEFT JOIN sys_user wwr ON wwr.id = xx.wwuserid\n" +
"\tLEFT JOIN sys_user sqr ON sqr.id = xx.sqr\n" +
"\tLEFT JOIN sys_unit dw ON dw.id = sqr.unitid\n" +
"\tLEFT JOIN sys_union fgh ON fgh.id = dw.unionid $condition");
Cnd cnd = Cnd.NEW();
if(lx==1){
cnd.and("xx.status","in","1,2,3");
if((!ShiroUtil.hasRole("sysadmin")) && (ShiroUtil.hasRole("H04") || ShiroUtil.hasRole("sp01"))){
String unionid = ((Sys_union) ShiroUtil.getPrincipalProperty("union")).getId();
cnd.and("fgh.id","=",unionid);
}
}else if(lx==2){
cnd.and("xx.status","in","2,4");
}
if (Strings.isNotBlank(searchName)&&Strings.isNotBlank(searchKeyword)){
cnd.and(searchName,"like","%"+searchKeyword+"%");
}
cnd.asc("status").desc("xx.sqsj");
sql.setCondition(cnd);
Pagination pagination = baseService.listPage(pageNumber, pageSize, sql);
return Result.success().addData(pagination);
} catch (Exception e){
return Result.error();
}
}
@At
public Object doch(Fw_Wwj wwj){
try {
baseService.updateIgnoreNull(wwj);
return Result.success();
} catch (Exception e) {
e.printStackTrace();
return Result.error();
}
}
@At
public Object dofghSh(Fw_Wwj wwj){
try {
wwj.setFghshrname((String)ShiroUtil.getPrincipalProperty("username"));
wwj.setFghshsj(DateUtil.getDate());
baseService.updateIgnoreNull(wwj);
return Result.success();
} catch (Exception e) {
e.printStackTrace();
return Result.error();
}
}
@At
public Object doxghSh(Fw_Wwj wwj){
try {
wwj.setXghshrname((String)ShiroUtil.getPrincipalProperty("username"));
wwj.setXghshsj(DateUtil.getDate());
baseService.updateIgnoreNull(wwj);
return Result.success();
} catch (Exception e) {
e.printStackTrace();
return Result.error();
}
}
}
@@ -0,0 +1,68 @@
package io.v.nutz.zhgh.zgfw.controller.wwj;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.base.service.BaseService;
import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.model.wwj.Fw_Wwj;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.boot.starter.ftp.FtpService;
import org.nutz.dao.Chain;
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.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.POST;
/**
* zxy
*/
@IocBean
@At("/platform/zgfw/wwjsq")
@Ok("json:full")
public class WwjSqController {
@Inject
private BaseService baseService;
@Inject
private FtpService ftpService;
@At("")
@Ok("re")
@RequiresPermissions("zgfw.wwjsq")
public String index() {
return "beetl:/platform/zgfw/wwj/sq.html";
}
@At
@POST
public Object doAdd(Fw_Wwj wwj) {
try {
wwj.setId(R.UU32());
wwj.setSqr((String) ShiroUtil.getPrincipalProperty("id"));
wwj.setSqsj(DateUtil.getDate());
wwj.setStatus(1);
baseService.insert("fw_wwj", Chain.from(wwj));
return Result.success();
} catch (Exception e) {
e.printStackTrace();
return Result.error();
}
}
@At
@POST
public Object doEdit(Fw_Wwj wwj) {
try {
baseService.updateIgnoreNull(wwj);
return Result.success();
} catch (Exception e) {
e.printStackTrace();
return Result.error();
}
}
}
@@ -0,0 +1,133 @@
package io.v.nutz.zhgh.zgfw.controller.wwj;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.base.service.BaseService;
import cn.wizzer.framework.page.Pagination;
import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.data.PictureRenderData;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.model.wwj.Fw_Wwj;
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 javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.util.Base64;
@IocBean
@At("/platform/zgfw/wwjsqxx")
@Ok("json:full")
public class WwjSqxxController {
@Inject
private BaseService baseService;
@Inject
private FtpService ftpService;
@At("")
@Ok("re")
@RequiresPermissions("zgfw.wwjsqxx")
public String index(){
return "beetl:/platform/zgfw/wwj/sqxx.html";
}
@At
public Object pageData(String wwrusername,Integer year,Integer pageNumber,Integer pageSize){
try {
Sql sql = Sqls.create("SELECT\n" +
"\tsqr.username AS sqrusername,\n" +
"\twwr.username AS wwrusername,\n" +
"\twwr.loginname AS wwrloginname,\n" +
"\txx.* \n" +
"FROM\n" +
"\tfw_wwj xx\n" +
"\tLEFT JOIN sys_user sqr ON sqr.id = xx.sqr\n" +
"\tLEFT JOIN sys_user wwr ON wwr.id = xx.wwuserid $condition");
Cnd cnd = Cnd.NEW();
if(!ShiroUtil.hasRole("sysadmin")){
cnd.and("xx.sqr","=",ShiroUtil.getPrincipalProperty("id"));
}
if(Strings.isNotBlank(wwrusername)){
cnd.and("wwr.username","like","%"+wwrusername+"%");
}
if(year!=null){
cnd.and("YEAR(xx.sqsj)","=",year);
}
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 doDelete(String id){
try {
baseService.clear("fw_wwj",Cnd.where("id","=",id));
return Result.success();
} catch (Exception e) {
e.printStackTrace();
return Result.error();
}
}
@At
public Object doEdit(Fw_Wwj wwj){
try {
baseService.updateIgnoreNull(wwj);
return Result.success();
} catch (Exception e) {
e.printStackTrace();
return Result.error();
}
}
@At
@Ok("void")
public void export(String id, HttpServletResponse response) throws IOException {
Sql sql = Sqls.create("SELECT\n" +
"\txx.*,\n" +
"\twwr.username AS wwrusername\n" +
"FROM\n" +
"\t`fw_wwj` xx\n" +
"\tLEFT JOIN sys_user wwr ON wwr.id = xx.wwuserid where xx.id = @id").setParam("id",id);
Record o = (Record)baseService.list(sql).get(0);
String sqrqz = o.getString("sqrqz").split(",")[1];
byte[] bytes0 = Base64.getDecoder().decode(sqrqz);
o.set("sqrqz", new PictureRenderData(100, 25, ".png", bytes0));
String fghqz = o.getString("fghqz").split(",")[1];
byte[] bytes1 = Base64.getDecoder().decode(fghqz);
o.set("bmghqz", new PictureRenderData(100, 25, ".png", bytes1));
String xghqz = o.getString("xghqz").split(",")[1];
byte[] bytes2 = Base64.getDecoder().decode(xghqz);
o.set("xghqz", new PictureRenderData(100, 25, ".png", bytes2));
InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("docTemplate/wwjsq.docx");
XWPFTemplate tmp = XWPFTemplate.compile(inputStream).render(o);
String fileName = "校工会慰问金申请表";
response.addHeader("Content-Type", "application/octet-stream");
response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(fileName.getBytes("UTF-8"), "ISO-8859-1") + "\".docx;filename*=UTF-8''" + new String(fileName.getBytes("UTF-8"), "ISO-8859-1"));
tmp.write(response.getOutputStream());
tmp.close();
}
@At
public Object queryDetail(String id){
return null;
}
}
@@ -0,0 +1,86 @@
package io.v.nutz.zhgh.zgfw.controller.wwj;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.base.service.BaseService;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.utils.PageUtil;
import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.web.commons.utils.ShiroUtil;
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.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;
@IocBean
@At("/platform/zgfw/wwj/zhcx")
@Ok("json:full")
public class WwjZhcxController {
@Inject
private BaseService baseService;
@Inject
private FtpService ftpService;
@At("")
@Ok("re")
@RequiresPermissions("zgfw.wwj.zhcx")
public String index() {
return "beetl:/platform/zgfw/wwj/zhcx.html";
}
@At
public Object pageData(String wwrusername, String unionid, Integer year, Integer pageNumber, Integer pageSize,
String pageOrderName, String pageOrderBy, String searchName, String searchKeyword) {
try {
Sql sql = Sqls.create("SELECT\n" +
"\tsqr.username AS sqrusername,\n" +
"\twwr.username AS wwrusername,\n" +
"\twwr.loginname AS wwrloginname,\n" +
"\txx.* \n" +
"FROM\n" +
"\tfw_wwj xx\n" +
"\tLEFT JOIN sys_user sqr ON sqr.id = xx.sqr\n" +
"\tLEFT JOIN sys_user wwr ON wwr.id = xx.wwuserid\n " +
"\tLEFT JOIN sys_unit dw ON dw.id = sqr.unitid\n " +
"\tLEFT JOIN sys_union fgh ON fgh.id = dw.unionid\n " +
"$condition");
Cnd cnd = Cnd.NEW();
cnd.and("xx.status", ">", 0);
if (!ShiroUtil.hasRole("sysadmin") && !ShiroUtil.hasRole("SchoolUnionAdmin")) {
cnd.and("fgh.id", "=", ((Sys_union) ShiroUtil.getPrincipalProperty("union")).getId());
}
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
cnd.and(searchName, "like", "%" + searchKeyword + "%");
}
if (Strings.isNotBlank(wwrusername)) {
cnd.and("wwr.username", "like", "%" + wwrusername + "%");
}
if (Strings.isNotBlank(unionid)) {
cnd.and("fgh.id", "=", unionid);
}
if (year != null) {
cnd.and("YEAR(xx.sqsj)", "=", year);
}
if (Strings.isNotBlank(pageOrderName) && Strings.isNotBlank(pageOrderBy)) {
cnd.orderBy(pageOrderName, PageUtil.getOrder(pageOrderBy));
} else {
cnd.asc("xx.status").asc("fgh.unionname");
}
sql.setCondition(cnd);
Pagination pagination = baseService.listPage(pageNumber, pageSize, sql);
return Result.success().addData(pagination);
} catch (Exception e) {
e.printStackTrace();
return Result.error();
}
}
}
@@ -0,0 +1,55 @@
package io.v.nutz.zhgh.zgfw.controller.znxx;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.zhgh.zgfw.model.rxdj.Fw_rxdj;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.ioc.aop.Aop;
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.Ok;
/**
* @ClassName ZnxxApplyController
* @Description 子女信息填报
* @Author zhf
* @Date 2023/7/19 9:51
*/
@IocBean
@At("/platform/zgfw/znxx/apply")
@Ok("json:full")
public class ZnxxApplyController {
@Inject
private BaseService baseService;
@At("")
@Ok("beetl:/platform/zgfw/znxx/apply.html")
@RequiresPermissions("zgfw.znxx.apply")
public void index() {
}
@At
@ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("zgfw.znxx.apply")
public Object doAdd(Fw_rxdj fw_rxdj) {
fw_rxdj.setApplyType("znxx");
baseService.insertOrUpdate(fw_rxdj);
return null;
}
@At
@ViReturn
@RequiresPermissions("zgfw.znxx.apply")
public Object findOne(String id) {
return baseService.dao().fetch(Fw_rxdj.class, id);
}
}
@@ -0,0 +1,77 @@
package io.v.nutz.zhgh.zgfw.controller.znxx;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.ViService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.model.rxdj.Fw_rxdj;
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;
/**
* @ClassName ZnxxManageController
* @Description 子女信息我的填报管理
* @Author zhf
* @Date 2023/7/19 9:53
*/
@IocBean
@At("/platform/zgfw/znxx/manage")
@Ok("json:full")
public class ZnxxManageController {
@Inject
private ViService baseService;
@At("")
@Ok("beetl:/platform/zgfw/znxx/manage.html")
@RequiresPermissions("zgfw.znxx.manage")
public void index() {
}
@At
@ViReturn
@RequiresPermissions("zgfw.znxx.manage")
public Object pageData(PageForm pageForm,
@Param(value = "dj_znname", required = false) String dj_znname) {
Sql sql = Sqls.create("""
SELECT
dj.*,
u.username
FROM
`fw_rxdj` dj
LEFT JOIN `user` u ON u.id = dj.dj_jzgid
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("dj.applyType", "=", "znxx");
if (Strings.isNotBlank(dj_znname)) {
cnd.where().andLike("dj.dj_znname", dj_znname);
}
cnd.and("dj.dj_jzgid", "=", ShiroUtil.getUserId());
sql.setCondition(cnd);
return baseService.list(pageForm, sql);
}
@At
@ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("zgfw.znxx.manage")
public Object doDelete(String id) {
baseService.dao().delete(Fw_rxdj.class, id);
return null;
}
}
@@ -0,0 +1,228 @@
package io.v.nutz.zhgh.zgfw.controller.znxx;
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.date.DateUtil;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.ViService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.model.rxdj.Fw_rxdj;
import org.apache.poi.ss.usermodel.Workbook;
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.Lang;
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.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* @ClassName ZnxxStatisticsController
* @Description TODO
* @Author zhf
* @Date 2023/7/19 9:54
*/
@IocBean
@At("/platform/zgfw/znxx/statistics")
@Ok("json:full")
public class ZnxxStatisticsController {
@Inject
private ViService baseService;
@Inject
private MsgApi msgApi;
@At("")
@Ok("beetl:/platform/zgfw/znxx/statistics.html")
@RequiresPermissions("zgfw.znxx.statistics")
public void index() {
}
@At
@ViReturn
@RequiresPermissions("zgfw.znxx.statistics")
public Object pageData(PageForm pageForm,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "dj_djlx", required = false) String dj_djlx,
@Param(value = "dj_jdxx", required = false) String dj_jdxx,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "sxlx", required = false) String[] sxlx) {
Sql sql = Sqls.create("""
SELECT
dj.*,
u.username,
u.unionname,
u.unitname
FROM
`fw_rxdj` dj
LEFT JOIN `user` u ON u.id = dj.dj_jzgid
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("dj.applyType", "=", "znxx");
if (Vi.isNotBlank(pageForm.getSearchName(), pageForm.getSearchKeyword())) {
cnd.where().andLike(pageForm.getSearchName(), pageForm.getSearchKeyword());
}
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
cnd.and("u.unionid", "=", Vi.getUnionId());
}
cnd.andEX("dj.dj_jdxx", "=", dj_jdxx);
cnd.andEX("dj.dj_djlx", "=", dj_djlx);
cnd.andEX("u.unitid", "=", unitId);
cnd.andEX("u.unionid", "=", unionId);
sql.setCondition(cnd);
Pagination list = baseService.list(pageForm, sql);
List<NutMap> map = list.getList();
List<NutMap> dj_znzsnys = new ArrayList<>();
if (Lang.isNotEmpty(sxlx)) {
if (sxlx[0].equals("g")) {
dj_znzsnys = map.stream().filter(v -> DateUtil.ageOfNow(v.getString("dj_znzsny")) == 14).collect(Collectors.toList());
} else if (sxlx[0].equals("d")) {
dj_znzsnys = map.stream().filter(v -> DateUtil.ageOfNow(v.getString("dj_znzsny")) == 17).collect(Collectors.toList());
}
list.setList(dj_znzsnys);
}
return list;
}
@At
@Ok("void")
public void doExport(@Param(value = "unionId", required = false) String unionId,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "dj_jdxx", required = false) String dj_jdxx,
@Param(value = "dj_djlx", required = false) Integer dj_djlx,
@Param(value = "sxlx", required = false) String[] sxlx,
HttpServletResponse response) {
try {
Sql sql = Sqls.create("""
SELECT
dj.*,
u.username,
u.unionname,
u.unitname
FROM
`fw_rxdj` dj
LEFT JOIN `user` u ON u.id = dj.dj_jzgid
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("dj.applyType", "=", "znxx");
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
cnd.and("u.unionid", "=", Vi.getUnionId());
}
cnd.andEX("dj.dj_jdxx", "=", dj_jdxx);
cnd.andEX("dj.dj_djlx", "=", dj_djlx);
cnd.andEX("u.unitid", "=", unitId);
cnd.andEX("u.unionid", "=", unionId);
sql.setCondition(cnd);
List<NutMap> list = baseService.listMap(sql);
list.forEach(v -> {
switch (v.getInt("dj_djlx")) {
case 1:
v.setv("dj_djlx", "幼儿园");
break;
case 2:
v.setv("dj_djlx", "小学");
break;
case 3:
v.setv("dj_djlx", "初中");
break;
case 4:
v.setv("dj_djlx", "高中");
break;
default:
v.setv("dj_djlx", "");
break;
}
});
if (Lang.isNotEmpty(sxlx)) {
if (sxlx[0].equals("g")) {
list = list.stream().filter(v -> DateUtil.ageOfNow(v.getString("dj_znzsny")) == 14).collect(Collectors.toList());
} else if (sxlx[0].equals("d")) {
list = list.stream().filter(v -> DateUtil.ageOfNow(v.getString("dj_znzsny")) == 17).collect(Collectors.toList());
}
}
List<ExcelExportEntity> exportEntities = new ArrayList<>();
exportEntities.add(new ExcelExportEntity("教职工姓名", "username", 20));
exportEntities.add(new ExcelExportEntity("工号", "dj_gzh", 20));
exportEntities.add(new ExcelExportEntity("手机号码", "dj_iphone", 20));
exportEntities.add(new ExcelExportEntity("所在单位", "unitname", 20));
exportEntities.add(new ExcelExportEntity("所在工会", "unionname", 20));
exportEntities.add(new ExcelExportEntity("子女姓名", "dj_znname", 20));
exportEntities.add(new ExcelExportEntity("性别", "dj_znsex", 20));
exportEntities.add(new ExcelExportEntity("出生日期", "dj_znzsny", 20));
exportEntities.add(new ExcelExportEntity("填报类型", "dj_djlx", 20));
exportEntities.add(new ExcelExportEntity("就读年级", "dj_jdxx", 20));
exportEntities.add(new ExcelExportEntity("身体健康状态", "dj_stjkzk", 20));
exportEntities.add(new ExcelExportEntity("三代家庭成员信息", "dj_sdjtxx", 100));
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment;filename=" + new String(("填报信息名单.xls").getBytes(StandardCharsets.UTF_8), "ISO8859-1"));
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), exportEntities, list);
workbook.write(response.getOutputStream());
workbook.close();
} catch (Exception e) {
e.printStackTrace();
}
}
@At
@ViReturn
@Aop(TransAop.READ_COMMITTED)
public Object doZf(@Param(value = "id", required = false) String id,
@Param(value = "sxlx", required = false) String[] sxlx,
@Param(value = "zfnr", required = false) String zfnr) {
Cnd cnd = Cnd.NEW();
cnd.andEX("dj_id", "=", id);
cnd.and("applyType", "=", "znxx");
List<Fw_rxdj> fw_rxdjs = baseService.dao().query(Fw_rxdj.class, cnd);
if (Lang.isNotEmpty(sxlx)) {
if (sxlx[0].equals("g")) {
fw_rxdjs = fw_rxdjs.stream().filter(v -> DateUtil.ageOfNow(v.getDj_znzsny()) == 14).collect(Collectors.toList());
} else if (sxlx[0].equals("d")) {
fw_rxdjs = fw_rxdjs.stream().filter(v -> DateUtil.ageOfNow(v.getDj_znzsny()) == 17).collect(Collectors.toList());
}
}
System.out.println(fw_rxdjs);
// msgApi.sendMsg();
return null;
}
}
@@ -0,0 +1,276 @@
package io.v.nutz.zhgh.zgfw.handler.condolence;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.utils.ViResource;
import io.v.nutz.sys.services.SysLocalProcessService;
import io.v.nutz.sys.services.impl.SysLocalProcessServiceImpl;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.model.condolence.Condolence;
import io.v.nutz.zhgh.zgfw.service.CondolenceService;
import io.v.nutz.zhgh.zgfw.service.impl.CondolenceServiceImpl;
import lombok.Getter;
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.lang.Lang;
import org.nutz.lang.util.NutMap;
import java.util.List;
import java.util.stream.Collectors;
@Getter
public enum CondolenceToDoHandler {
/**
* 流程开始
*/
START_PROCESS() {
@Override
public void exec(Condolence condolence, String option) {
Sql sql = Sqls.fetchString(Sqls.create("select username from sys_user where id = @id").setParam("id", condolence.getManager()).toString());
dao.execute(sql);
String username = sql.getString();
localProcessService.startProcess(
"【慰问】" + username,
"condolence_apply@" + condolence.getId(),
"",
condolence.getManager(),
"/platform/fw/condolence/myList",
"/platform/fw/condolence/myList"
);
}
},
/**
* 审核退回,重新修改申请
*/
CREATE_APPLY_RE_MODIFY_TASK() {
@Override
public void exec(Condolence condolence, String option) {
Sql sql = Sqls.fetchString(Sqls.create("select loginname from sys_user where id = @id").setParam("id", condolence.getManager()).toString());
dao.execute(sql);
String loginname = sql.getString();
String desc = "重新修改申请";
localProcessService.createTask(
"condolence_apply@" + condolence.getId(),
"apply_re_modify",
desc,
ShiroUtil.getUserId(),
List.of(loginname),
"/platform/fw/condolence/myList",
"/platform/fw/condolence/myList",
"/platform/fw/condolence/myList",
"/platform/fw/condolence/myList"
);
localProcessService.updateProcessNodeName("condolence_apply@" + condolence.getId(), desc);
}
},
/**
* 修改完成
*/
COMPLETE_APPLY_RE_MODIFY_TASK() {
@Override
public void exec(Condolence condolence, String option) {
localProcessService.completeTask(
"apply_re_modify",
"condolence_apply@" + condolence.getId(),
ShiroUtil.getUserId(),
option
);
}
},
/**
* 校工会主席退回,退回给校工会节点
*/
CREATE_BACK_SCHOOL_TASK() {
@Override
public void exec(Condolence condolence, String option) {
List<String> schoolUnionCondolenceAdmin = condolenceService.getSchoolUnionCondolenceAdmin();
localProcessService.createTask(
"condolence_apply@" + condolence.getId(),
"school_leader_back",
"校工会主席退回",
ShiroUtil.getUserId(),
schoolUnionCondolenceAdmin,
"/platform/fw/condolence/fr",
"/platform/fw/condolence/fr",
"/platform/fw/condolence/fr",
"/platform/fw/condolence/fr"
);
localProcessService.updateProcessNodeName("condolence_apply@" + condolence.getId(), "校工会主席退回");
}
},
/**
* 校工会主席完成退回的任务
*/
COMPLETE_BACK_SCHOOL_TASK() {
@Override
public void exec(Condolence condolence, String option) {
localProcessService.completeTask(
"school_leader_back",
"condolence_apply@" + condolence.getId(),
ShiroUtil.getUserId(),
option
);
}
},
/**
* 创建分工会任务
*/
CREATE_UNION_TASK() {
@Override
public void exec(Condolence condolence, String option) {
List<String> unionLeader = condolenceService.getUnionLeader(condolence.getManager());
localProcessService.createTask(
"condolence_apply@" + condolence.getId(),
"union_chairman_review",
"分工会审核",
ShiroUtil.getUserId(),
unionLeader,
"/platform/fw/condolence/ucr/union",
"/platform/fw/condolence/ucr/union",
"/platform/fw/condolence/ucr/union",
"/platform/fw/condolence/ucr/union"
);
localProcessService.updateProcessNodeName("condolence_apply@" + condolence.getId(), "分工会审核");
}
},
/**
* 分工会完成
*/
COMPLETE_UNION_TASK() {
@Override
public void exec(Condolence condolence, String option) {
localProcessService.completeTask(
"union_chairman_review",
"condolence_apply@" + condolence.getId(),
ShiroUtil.getUserId(),
option
);
}
},
/**
* 创建校工会任务
*/
CREATE_FINANCE_TASK() {
@Override
public void exec(Condolence condolence, String option) {
List<String> schoolLeader = condolenceService.getSchoolUnionCondolenceAdmin();
if (Lang.isEmpty(schoolLeader)) {
throw new RuntimeException("找不到下一步审核人,请联系管理员设置。");
}
localProcessService.createTask(
"condolence_apply@" + condolence.getId(),
"finance_review",
"校工会审核",
ShiroUtil.getUserId(),
schoolLeader,
"/platform/fw/condolence/fr",
"/platform/fw/condolence/fr",
"/platform/fw/condolence/fr",
"/platform/fw/condolence/fr"
);
localProcessService.updateProcessNodeName("condolence_apply@" + condolence.getId(), "校工会审核");
}
},
/**
* 校工会完成
*/
COMPLETE_FINANCE_TASK() {
@Override
public void exec(Condolence condolence, String option) {
localProcessService.completeTask(
"finance_review",
"condolence_apply@" + condolence.getId(),
ShiroUtil.getUserId(),
option
);
}
},
/**
* 创建校工会主席任务
*/
CREATE_SCHOOL_TASK() {
@Override
public void exec(Condolence condolence, String option) {
Sql sql = Sqls.create("""
SELECT
u.loginname
FROM
sys_user_role sur
LEFT JOIN sys_user u ON u.id = sur.userid
WHERE
sur.roleId in ('3a87d9e925174f59bbbe86fcf2be3a91', '3dad064faf134a6fb6ec3437ff2e09e2', '26fa82e6f7dd4641aa1655d9fa5c875a')
GROUP BY
sur.userId
""");
List<NutMap> list = condolenceService.listMap(sql);
List<String> ids = list.stream().map(v-> v.getString("loginname")).collect(Collectors.toList());
localProcessService.createTask(
"condolence_apply@" + condolence.getId(),
"vice_chairman_review",
"校工会主席审核",
ShiroUtil.getUserId(),
ids,
"/platform/fw/condolence/vcr/school",
"/platform/fw/condolence/vcr/school",
"/platform/fw/condolence/vcr/school",
"/platform/fw/condolence/vcr/school"
);
localProcessService.updateProcessNodeName("condolence_apply@" + condolence.getId(), "校工会主席审核");
}
},
/**
* 校工会主席完成
*/
COMPLETE_SCHOOL_TASK() {
@Override
public void exec(Condolence condolence, String option) {
localProcessService.completeTask(
"vice_chairman_review",
"condolence_apply@" + condolence.getId(),
ShiroUtil.getUserId(),
option
);
}
},
/**
* 流程结束
*/
COMPLETE_PROCESS() {
@Override
public void exec(Condolence condolence, String option) {
localProcessService.completeProcess("condolence_apply@" + condolence.getId());
}
};
public abstract void exec(Condolence condolence, String option);
public Dao dao = ViResource.dao;
public CondolenceService condolenceService = ViResource.ioc.get(CondolenceServiceImpl.class);
public SysLocalProcessService localProcessService = ViResource.ioc.get(SysLocalProcessServiceImpl.class);
}
@@ -0,0 +1,217 @@
package io.v.nutz.zhgh.zgfw.handler.difficult;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.utils.ViResource;
import io.v.nutz.sys.services.SysLocalProcessService;
import io.v.nutz.sys.services.impl.SysLocalProcessServiceImpl;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.model.condolence.Condolence;
import io.v.nutz.zhgh.zgfw.model.difficult.Zgfw_knbf;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfService;
import io.v.nutz.zhgh.zgfw.service.impl.ZgfwKnbfServiceImpl;
import lombok.Getter;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import java.util.List;
@Getter
public enum DifficultToDoHandler {
/**
* 流程开始
*/
START_PROCESS(){
@Override
public void exec(Zgfw_knbf knbf) {
Sql sql = Sqls.fetchString(Sqls.create("select username from sys_user where id = @id").setParam("id", knbf.getUserId()).toString());
dao.execute(sql);
String username = sql.getString();
localProcessService.startProcess(
"【困难帮扶】" + username,
"zgfw_knbf@" + knbf.getId(),
"",
knbf.getUserId(),
"/platform/difficulty/applylist",
"/platform/difficulty/applylist"
);
}
},
/**
* 审核拒绝,重新修改申请
*/
CREATE_APPLY_RE_MODIFY_TASK(){
@Override
public void exec(Zgfw_knbf knbf) {
Sql sql = Sqls.fetchString(Sqls.create("select loginname from sys_user where id = @id").setParam("id", knbf.getUserId()).toString());
dao.execute(sql);
String loginname = sql.getString();
localProcessService.createTask(
"zgfw_knbf@" + knbf.getId(),
"back",
"退回重新修改",
ShiroUtil.getUserId(),
List.of(loginname),
"/platform/difficulty/applylist",
"/platform/difficulty/applylist",
"/platform/difficulty/applylist",
"/platform/difficulty/applylist"
);
}
},
/**
* 审核拒绝后完成
*/
COMPLETE_APPLY_RE_MODIFY_TASK(){
@Override
public void exec(Zgfw_knbf knbf) {
localProcessService.completeTask(
"back",
"zgfw_knbf@" + knbf.getId(),
ShiroUtil.getUserId(),
""
);
}
},
/**
* 创建分工会任务
*/
CREATE_UNION_TASK(){
@Override
public void exec(Zgfw_knbf knbf) {
List<String> unionLeader = zgfwKnbfService.getUnionLeader(knbf.getUserId());
localProcessService.createTask(
"zgfw_knbf@" + knbf.getId(),
"branchUnionAudit",
"分工会审核",
ShiroUtil.getUserId(),
unionLeader,
"/platform/difficulty/branchUnionAudit",
"/platform/difficulty/branchUnionAudit",
"/platform/difficulty/branchUnionAudit",
"/platform/difficulty/branchUnionAudit"
);
localProcessService.updateProcessNodeName("zgfw_knbf@" + knbf.getId(), "分工会审核");
}
},
/**
* 分工会完成
*/
COMPLETE_UNION_TASK(){
@Override
public void exec(Zgfw_knbf knbf) {
localProcessService.completeTask(
"union_president_audit",
"zgfw_knbf@" + knbf.getId(),
ShiroUtil.getUserId(),
""
);
}
},
/**
* 创建财务任务
*/
CREATE_FINANCE_TASK(){
@Override
public void exec(Zgfw_knbf knbf) {
List<String> schoolUnionAccountant = Vi.getSchoolUnionAccountant();
localProcessService.createTask(
"zgfw_knbf@" + knbf.getId(),
"schoolUnionInitialAudit",
"校工会初审",
ShiroUtil.getUserId(),
schoolUnionAccountant,
"/platform/fw/difficulty/twoOrganization",
"/platform/fw/difficulty/twoOrganization",
"/platform/fw/difficulty/twoOrganization",
"/platform/fw/difficulty/twoOrganization"
);
localProcessService.updateProcessNodeName("zgfw_knbf@" + knbf.getId(), "财务审核");
}
},
/**
* 财务完成
*/
COMPLETE_FINANCE_TASK(){
@Override
public void exec(Zgfw_knbf knbf) {
localProcessService.completeTask(
"two_dzz_audit",
"zgfw_knbf@" + knbf.getId(),
ShiroUtil.getUserId(),
""
);
}
},
/**
* 创建校工会任务
*/
CREATE_SCHOOL_TASK(){
@Override
public void exec(Zgfw_knbf knbf) {
List<String> list = zgfwKnbfService.getSchoolUnionDifficultyAdmin();
localProcessService.createTask(
"zgfw_knbf@" + knbf.getId(),
"school_standing_audit",
"工会常委会审核",
ShiroUtil.getUserId(),
list,
"/platform/fw/difficulty/schoolmanager",
"/platform/fw/difficulty/schoolmanager",
"/platform/fw/difficulty/schoolmanager",
"/platform/fw/difficulty/schoolmanager"
);
localProcessService.updateProcessNodeName("zgfw_knbf@" + knbf.getId(), "校工会审核");
}
},
/**
* 校工会完成
*/
COMPLETE_SCHOOL_TASK(){
@Override
public void exec(Zgfw_knbf knbf) {
localProcessService.completeTask(
"school_standing_audit",
"zgfw_knbf@" + knbf.getId(),
ShiroUtil.getUserId(),
""
);
}
},
/**
* 流程结束
*/
COMPLETE_PROCESS(){
@Override
public void exec(Zgfw_knbf knbf) {
localProcessService.completeProcess("zgfw_knbf@" + knbf.getId());
}
},
DELETE_PROCESS(){
@Override
public void exec(Zgfw_knbf knbf) {
localProcessService.deleteProcessInstance("zgfw_knbf@" + knbf.getId());
}
};
public abstract void exec(Zgfw_knbf knbf);
public Dao dao = ViResource.dao;
public ZgfwKnbfService zgfwKnbfService = ViResource.ioc.get(ZgfwKnbfServiceImpl.class);
public SysLocalProcessService localProcessService = ViResource.ioc.get(SysLocalProcessServiceImpl.class);
}
@@ -0,0 +1,226 @@
package io.v.nutz.zhgh.zgfw.handler.rxdj;
import io.v.nutz.base.utils.Roles;
import io.v.nutz.base.utils.ViResource;
import io.v.nutz.sys.services.SysLocalProcessService;
import io.v.nutz.sys.services.impl.SysLocalProcessServiceImpl;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.model.condolence.Condolence;
import io.v.nutz.zhgh.zgfw.model.rxdj.Fw_rxdj;
import lombok.Getter;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.Daos;
import org.nutz.lang.util.NutMap;
import java.util.List;
import java.util.stream.Collectors;
@Getter
public enum RxdjToDoHandler {
/**
* 流程开始
*/
START_PROCESS(){
@Override
public void exec(Fw_rxdj rxdj) {
Sql sql = Sqls.fetchString(Sqls.create("select username from sys_user where id = @id").setParam("id", rxdj.getDj_jzgid()).toString());
dao.execute(sql);
String username = sql.getString();
localProcessService.startProcess(
"【子女入学】" + username,
"rxdj@" + rxdj.getDj_id(),
"",
rxdj.getDj_jzgid(),
"/platform/zgfw/rxdjxx",
"/platform/zgfw/rxdjxx"
);
}
},
/**
* 审核拒绝,重新修改申请
*/
CREATE_APPLY_RE_MODIFY_TASK(){
@Override
public void exec(Fw_rxdj rxdj) {
Sql sql = Sqls.fetchString(Sqls.create("select loginname from sys_user where id = @id").setParam("id", rxdj.getDj_jzgid()).toString());
dao.execute(sql);
String loginname = sql.getString();
localProcessService.createTask(
"rxdj@" + rxdj.getDj_id(),
"back",
"退回重新修改",
ShiroUtil.getUserId(),
List.of(loginname),
"/platform/zgfw/rxdjxx",
"/platform/zgfw/rxdjxx",
"/platform/zgfw/rxdjxx",
"/platform/zgfw/rxdjxx"
);
localProcessService.updateProcessNodeName("rxdj@" + rxdj.getDj_id(), "退回重新修改");
}
},
/**
* 审核拒绝后完成
*/
COMPLETE_APPLY_RE_MODIFY_TASK(){
@Override
public void exec(Fw_rxdj rxdj) {
localProcessService.completeTask(
"back",
"rxdj@" + rxdj.getDj_id(),
ShiroUtil.getUserId(),
""
);
localProcessService.updateProcessNodeName("rxdj@" + rxdj.getDj_id(), "退回后完成");
}
},
/**
* 创建分工会任务
*/
CREATE_UNION_TASK(){
@Override
public void exec(Fw_rxdj rxdj) {
Sql sql = Sqls.create("""
SELECT
u.loginname
FROM
sys_user_role sur
LEFT JOIN `user` u ON u.id = sur.userid
WHERE
sur.roleId = @roleId and u.unionid = (select unionid from `user` where id = @userId)
GROUP BY
sur.userId
""").setParam("roleId", Roles.UNION_MANGER).setParam("userId",rxdj.getDj_jzgid());
List<NutMap> list = (List<NutMap>)Daos.query(dao,sql.toString(),Sqls.callback.maps());
List<String> unionLeader = list.stream().map(v -> v.getString("loginname")).collect(Collectors.toList());
localProcessService.createTask(
"rxdj@" + rxdj.getDj_id(),
"dj_fghshr",
"分工会审核",
ShiroUtil.getUserId(),
unionLeader,
"/platform/zgfw/rxdj/sh/fghindex",
"/platform/zgfw/rxdj/sh/fghindex",
"/platform/zgfw/rxdj/sh/fghindex",
"/platform/zgfw/rxdj/sh/fghindex"
);
localProcessService.updateProcessNodeName("rxdj@" + rxdj.getDj_id(), "分工会审核");
}
},
/**
* 分工会完成
*/
COMPLETE_UNION_TASK(){
@Override
public void exec(Fw_rxdj rxdj) {
localProcessService.completeTask(
"dj_fghshr",
"rxdj@" + rxdj.getDj_id(),
ShiroUtil.getUserId(),
""
);
localProcessService.updateProcessNodeName("rxdj@" + rxdj.getDj_id(), "审核通过");
localProcessService.completeProcess("rxdj@" + rxdj.getDj_id());
}
},
/**
* 分工会拒绝
*/
COMPLETE_UNION_TASK_REJECTED(){
@Override
public void exec(Fw_rxdj rxdj) {
localProcessService.completeTask(
"dj_fghshr",
"rxdj@" + rxdj.getDj_id(),
ShiroUtil.getUserId(),
""
);
localProcessService.updateProcessNodeName("rxdj@" + rxdj.getDj_id(), "分工会拒绝");
localProcessService.completeProcess("rxdj@" + rxdj.getDj_id());
}
},
/**
* 创建校工会任务
*/
CREATE_SCHOOL_TASK(){
@Override
public void exec(Fw_rxdj rxdj) {
Sql sql = Sqls.create("""
SELECT
u.loginname
FROM
sys_user_role sur
LEFT JOIN sys_user u ON u.id = sur.userid
WHERE
sur.roleId = 'ad74b363f9b147cba6123a9b91c27935'
GROUP BY
sur.userId
""");
List<NutMap> list = (List<NutMap>)Daos.query(dao,sql.toString(),Sqls.callback.maps());
List<String> schoolLeader = list.stream().map(v -> v.getString("loginname")).collect(Collectors.toList());
localProcessService.createTask(
"rxdj@" + rxdj.getDj_id(),
"dj_xghshr",
"校工会审核",
ShiroUtil.getUserId(),
schoolLeader,
"/platform/zgfw/rxdj/sh/xghindex",
"/platform/zgfw/rxdj/sh/xghindex",
"/platform/zgfw/rxdj/sh/xghindex",
"/platform/zgfw/rxdj/sh/xghindex"
);
localProcessService.updateProcessNodeName("rxdj@" + rxdj.getDj_id(), "校工会审核");
}
},
/**
* 校工会完成
*/
COMPLETE_SCHOOL_TASK(){
@Override
public void exec(Fw_rxdj rxdj) {
localProcessService.completeTask(
"dj_xghshr",
"rxdj@" + rxdj.getDj_id(),
ShiroUtil.getUserId(),
""
);
localProcessService.updateProcessNodeName("rxdj@" + rxdj.getDj_id(), "校工会完成");
}
},
/**
* 流程结束
*/
COMPLETE_PROCESS(){
@Override
public void exec(Fw_rxdj rxdj) {
localProcessService.completeProcess("rxdj@" + rxdj.getDj_id());
}
};
public abstract void exec(Fw_rxdj rxdj);
public Dao dao = ViResource.dao;
public SysLocalProcessService localProcessService = ViResource.ioc.get(SysLocalProcessServiceImpl.class);
}
@@ -0,0 +1,50 @@
package io.v.nutz.zhgh.zgfw.model;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
/**
* @author: Aaron
* @create: 2020-11-23 10:37
* @description: 用户签字表
**/
@Data
@Table("user_sign")
public class UserSign {
@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 user_id;
@Column
@Comment("用户签字")
@ColDefine(type = ColType.TEXT)
private String data;
@Column
@Comment("模块名称")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String prefix;
public UserSign(String user_id, String data, String prefix) {
this.user_id = user_id;
this.data = data;
this.prefix = prefix;
}
public UserSign(String user_id, String data) {
this.user_id = user_id;
this.data = data;
}
public UserSign() {
}
}
@@ -0,0 +1,254 @@
package io.v.nutz.zhgh.zgfw.model.condolence;
import io.v.nutz.base.model.Goods;
import io.v.nutz.sys.models.Sys_file;
import lombok.Data;
import org.nutz.dao.DB;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import org.nutz.integration.json4excel.annotation.J4EIgnore;
import java.util.List;
/**
* @Author: 1V
* @DateTime: 2020/11/20 10:35
* @Description: 慰问表
*/
@Data
@Table("Condolence")
public class Condolence {
@Column
@Name
@Comment("ID")
@ColDefine(type = ColType.VARCHAR, width = 32)
@PrevInsert(uu32 = true)
private String id;
@Column
@Comment("经办人")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String manager;
@Column
@Comment("申请时间")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String apply_time;
@Column
@Comment("被慰问人")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String be_user;
@Column
@Comment("联系电话")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String mobile;
@Column
@Comment("出生年月")
@ColDefine(type = ColType.VARCHAR, width = 40)
private String birthday;
@Column
@Comment("家庭住址")
@ColDefine(type = ColType.VARCHAR, width = 40)
private String jtzz;
@Column
@Comment("配偶所在单位")
@ColDefine(type = ColType.VARCHAR, width = 40)
private String poszdw;
@Column
@Comment("收款人")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String payee;
@Column
@Comment("收款人银行卡")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String payee_bank_number;
@Column
@Comment("慰问类型")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String type;
@Column
@Comment("慰问方式")
@J4EIgnore
@ColDefine(type = ColType.VARCHAR, width = 20)
private String way;
@Column
@Comment("发生时间")
@J4EIgnore
@ColDefine(type = ColType.VARCHAR, width = 30)
private String occur_time;
@Column
@Comment("慰问金额")
@J4EIgnore
@ColDefine(type = ColType.FLOAT, width = 10, precision = 2)
private Double money;
@Column
@Comment("参加慰问人员")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String personnel;
@Column
@Comment("附件数量")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String files_num;
@Column
@Comment("备注")
@ColDefine(type = ColType.VARCHAR, width = 500)
private String remark;
@Column
@Comment("报销事由")
@ColDefine(type = ColType.TEXT)
private String cause;
@Column
@Comment("职称")
@ColDefine(type = ColType.VARCHAR, width = 500)
private String job_title;
@Column
@Comment("附件")
@ColDefine(type = ColType.MYSQL_JSON)
private List<Sys_file> files;
@Column
@Comment("状态id")
@ColDefine(type = ColType.INT, width = 8)
private String state_id;
@Column
@Comment("基层工会主席审核记录")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String union_chairman_review;
@Column
@Comment("单位书记审核id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String unit_secretary_review;
@Column
@Comment("财务审核记录")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String finance_review;
@Column
@Comment("副主席审核记录")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String vice_chairman_review;
@Column
@Comment("常务副主席审核记录")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String executive_chairman_review;
@Column
@Comment("经办人签字id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String manager_sign;
@Many(field = "reid")
private List<Goods> goods;
@Column
@Comment("住院开始时间")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String starting_time;
@Column
@Comment("住院结束时间")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String end_time;
@Column
@Comment("所在医院")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String the_hospital;
@Column
@Comment("病房")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String the_hospital_house_num;
@Column
@Comment("病房床号")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String the_hospital_house_bed_num;
@Column
@Comment("住院病由")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String hospital_by;
@Column
@Comment("当年次数")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String hospital_yearnum;
@Column
@Comment("结婚时间")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String marry_time;
@Column
@Comment("去逝时间")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String dead_time;
@Column
@Comment("生育时间")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String birth_time;
@Column
@Comment("生育几孩(孩次)")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String birth_child_num;
@Column
@Comment("去逝与被慰问人关系")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String dead_gx;
@Column
@Comment("被慰问人二维码签字")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String be_sign;
@Column
@Comment("被慰问人文本签字")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String be_sign_text;
@Column
@Comment("单据号")
@Prev({@SQL(db = DB.MYSQL, value = "SELECT CONCAT(YEAR(NOW()),LPAD(RIGHT((SELECT IFNULL(MAX(document_no),0) from Condolence WHERE LEFT(document_no,4) = YEAR(NOW())),5)+1, 5, 0) )"),})
private Integer document_no;
@Column
@Comment("去世直系亲属")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String deadImmediateFamily;
@Column
@Comment("手术名称")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String inpatientSurgicalName;
@Column
@Comment("导出领据单号")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String exportDocumentNo;
}
@@ -0,0 +1,76 @@
package io.v.nutz.zgfw.model.condolence;
import lombok.Data;
import org.nutz.dao.DB;
import org.nutz.dao.entity.annotation.*;
/**
* @author zhf
* @date 2021/2/4 10:34
* @description 慰问类型
*/
@Data
@Table("Condolence_Type")
@TableIndexes({
@Index(name = "INDEX_CONDOLENCE_TYPE_CODE", fields = {"code"}, unique = true),
})
public class CondolenceType {
@Column
@Name
@Comment("ID")
@ColDefine(type = ColType.VARCHAR, width = 32)
@Prev(els = {@EL("uuid()")})
private String id;
@Column
@Comment("编码")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String code;
@Column
@Comment("名称")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String name;
@Column
@Comment("费用")
@ColDefine(type = ColType.FLOAT, width = 10, precision = 2)
private Double money;
@Column
@Comment("慰问方式")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String way;
@Column
@Comment("是否禁用")
@ColDefine(type = ColType.BOOLEAN)
private Boolean isDisabled;
@Column
@Comment("是否上传附件")
@ColDefine(type = ColType.BOOLEAN)
private Boolean isUploadFile;
@Column
@Comment("上传附件说明")
@ColDefine(type = ColType.VARCHAR,width = 50)
private String uploadFileDesc;
@Column
@Comment("排序字段")
@Prev({
@SQL(db = DB.MYSQL, value = "SELECT IFNULL(MAX(location),0)+1 FROM Condolence_Type"),
@SQL(db = DB.ORACLE, value = "SELECT COALESCE(MAX(location),0)+1 FROM Condolence_Type")
})
private Integer location;
@Column
@Comment("排序")
@ColDefine(type = ColType.INT)
private int sortNum;
}
@@ -0,0 +1,170 @@
package io.v.nutz.zhgh.zgfw.model.difficult;
import cn.hutool.json.JSONObject;
import io.v.nutz.base.model.Audit;
import io.v.nutz.sys.models.Sys_file;
import lombok.Data;
import org.nutz.dao.DB;
import org.nutz.dao.entity.annotation.*;
import org.nutz.integration.json4excel.annotation.J4EIgnore;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @Author: V
* @Date: 2020/5/26 11:01
* @Description: 困难帮扶申请表
*/
@Data
@Table("Zgfw_knbf")
public class Zgfw_knbf implements Serializable {
private static final long serialVersionUID = 1L;
@Column
@Name
@Comment("id")
@J4EIgnore
@ColDefine(type = ColType.VARCHAR, width = 32)
@Prev(els = {@EL("uuid()")})
private String id;
@Column
@Comment("申请时间")
@ColDefine(type = ColType.DATETIME)
private Date applyTime;
@Column
@Comment("申请模式")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String mode;
@Column
@Comment("申请人id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String userId;
@Column
@Comment("申请人姓名")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String userName;
@Column
@Comment("申请人工号")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String loginName;
@Column
@Comment("性别")
@ColDefine(type = ColType.VARCHAR, width = 10)
private String sex;
@Column
@Comment("单位")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String unitId;
@Column
@Comment("单位名称")
@ColDefine(type = ColType.VARCHAR, width = 500)
private String unitName;
@Column
@Comment("分工会id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String unionId;
@Column
@Comment("工会名称")
@ColDefine(type = ColType.VARCHAR, width = 500)
private String unionName;
@Column
@Comment("月收入")
@ColDefine(type = ColType.VARCHAR, width = 10)
private String monthlyIncome;
@Column
@Comment("出生日期")
@ColDefine(type = ColType.DATE)
private Date birthday;
@Column
@Comment("联系电话")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String mobile;
@Column
@Comment("家庭住址")
@ColDefine(type = ColType.VARCHAR, width = 200)
private String homeAddress;
@Column
@Comment("补助标准")
@ColDefine(type = ColType.VARCHAR, width = 500)
private String subsidyStandards;
@Column
@Comment("家庭成员")
@ColDefine(type = ColType.MYSQL_JSON)
private List<JSONObject> familyList;
@Column
@Comment("申请理由")
@ColDefine(type = ColType.VARCHAR, width = 500)
private String reason;
@Column
@Comment("备注")
@ColDefine(type = ColType.VARCHAR, width = 500)
private String remarks;
@Column
@Comment("附件")
@ColDefine(type = ColType.VARCHAR, width = 500)
private List<Sys_file> files;
@Column
@Comment("申请人签字")
@ColDefine(type = ColType.VARCHAR, width = 500)
private String signature;
@Column
@Comment("分工会审核记录id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String branchUnionAuditId;
@Column
@Comment("校工会初审审核记录id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String schoolUnionInitialAuditId;
@Column
@Comment("工会常委会审核记录id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String schoolUnionFinalAuditId;
@Column
@Comment("状态")
@ColDefine(type = ColType.INT, width = 4)
private Integer stateId;
@Column
@Comment("单据号")
@Prev({
@SQL(db = DB.MYSQL, value = "SELECT CONCAT(YEAR(NOW()),LPAD(RIGHT((SELECT IFNULL(MAX(document_no),0) from zgfw_knbf WHERE LEFT(document_no,4) = YEAR(NOW())),5)+1, 5, 0) )"),
})
private Integer document_no;
@One(field = "branchUnionAuditId")
private Audit branchUnionAudit;
@One(field = "schoolUnionInitialAuditId")
private Audit schoolUnionInitialAudit;
@One(field = "schoolUnionFinalAuditId")
private Audit schoolUnionFinalAudit;
}
@@ -0,0 +1,56 @@
package io.v.nutz.zhgh.zgfw.model.difficult;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import org.nutz.integration.json4excel.annotation.J4EIgnore;
import java.io.Serializable;
/**
* @Author: V
* @Date: 2020/5/26 11:03
* @Description:
*/
@Table("Zgfw_knbf_jtcy")
@Data
public class Zgfw_knbf_jtcy implements Serializable {
private static final long serialVersionUID = 1L;
@Column
@Name
@Comment("id")
@J4EIgnore
@ColDefine(type = ColType.VARCHAR, width = 32)
@Prev(els = {@EL("uuid()")})
private String id;
@Column
@Comment("对应的困难帮扶申请id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String sqid;
@Column
@Comment("姓名")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String xm;
@Column
@Comment("与本人关系")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String gx;
@Column
@Comment("年龄")
@ColDefine(type = ColType.INT)
private Integer nl;
@Column
@Comment("工作单位")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String gzdw;
@Column
@Comment("年收入")
@ColDefine(type = ColType.INT)
private Integer nsr;
}
@@ -0,0 +1,354 @@
package io.v.nutz.zhgh.zgfw.model.rxdj;
import io.v.nutz.sys.models.Sys_file;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* 子女入学登记
*/
@Table("fw_rxdj")
@Data
public class Fw_rxdj implements Serializable {
@Column
@Name
@Comment("id")
@ColDefine(type = ColType.VARCHAR, width = 32)
@Prev(els = {@EL("uuid()")})
private String dj_id;
@Column
@Comment("子女姓名")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String dj_znname;
@Column
@Comment("子女性别")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String dj_znsex;
@Column
@Comment("子女就读学校")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String dj_jdxx;
@Column
@Comment("子女出生年月")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String dj_znzsny;
@Column
@Comment("所在小学")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String dj_szxx;
@Column
@Comment("六上期末考分")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String dj_qmkf;
@Column
@Comment("语文")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String dj_qmkfy;
@Column
@Comment("数学")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String dj_qmkfs;
@Column
@Comment("外语")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String dj_qmkfw;
@Column
@Comment("学区中学")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String dj_xqzx;
@Column
@Comment("子女身份证号")
@ColDefine(type = ColType.VARCHAR, width = 18)
private String dj_znidcard;
@Column
@Comment("教职工id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String dj_jzgid;
@Column
@Comment("教职工子女关系(父子 父女 母子 母女)")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String dj_jzgzngx;
@Column
@Comment("所在单位")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String dj_szdw;
@Column
@Comment("所在单位id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String dj_szdwid;
@Column
@Comment("所在分工会")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String dj_szfgh;
@Column
@Comment("所在分工会id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String dj_szfghid;
@Column
@Comment("职务")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String dj_zw;
@Column
@Comment("技术职称")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String dj_zc;
@Column
@Comment("学历")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String dj_xl;
@Column
@Comment("职称评定时间")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String dj_zcsj;
@Column
@Comment("任职时间")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String dj_rzsj;
@Column
@Comment("入校时间")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String dj_rxsj;
@Column
@Comment("人才称号")
@ColDefine(type = ColType.VARCHAR, width = 1000)
private String dj_rcch;
@Column
@Comment("用工方式")
@ColDefine(type = ColType.VARCHAR, width = 1000)
private String dj_ygfs;
@Column
@Comment("获人才称号时间")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String dj_rcchsj;
@Column
@Comment("荣誉或奖项")
@ColDefine(type = ColType.VARCHAR, width = 200)
private String dj_rxjx;
@Column
@Comment("手机号码")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String dj_iphone;
@Column
@Comment("工资号")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String dj_gzh;
@Column
@Comment("姓名")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String dj_xm;
@Column
@Comment("人员类型(事业编制 预任职员专职科研 统招博士后)")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String dj_rylx;
@Column
@Comment("是否高层次引进人才或业务骨干(0否 1是)")
@ColDefine(type = ColType.BOOLEAN)
private Boolean dj_sfgcrchywgg;
@Column
@Comment("家庭住址")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String dj_jtzz;
@Column
@Comment("户籍所在地")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String dj_hjszd;
@Column
@Comment("子女户籍所在地")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String dj_znhjszd;
@Column
@Comment("户籍所属辖区")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String dj_hjssxq;
@Column
@Comment("户籍所属小学")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String dj_hjssxx;
@Column
@Comment("是否有学区房(0否 1是)")
@ColDefine(type = ColType.BOOLEAN)
private Boolean dj_sfyxqf;
@Column
@Comment("无学区原因")
@ColDefine(type = ColType.VARCHAR, width = 300)
private String dj_wxqyy;
@Column
@Comment("备注")
@ColDefine(type = ColType.VARCHAR, width = 300)
private String dj_bz;
@Column
@Comment("申请学校")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String dj_sqxx;
@Column
@Comment("申请学校名称")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String dj_sqxx_name;
@Column
@Comment("是否插班")
@ColDefine(type = ColType.BOOLEAN)
private Boolean isShift;
@Column
@Comment("插班几年级")
@ColDefine(type = ColType.VARCHAR, width = 10)
private String shiftGrade;
@Column
@Comment("填报日期")
@ColDefine(type = ColType.DATETIME)
private Date dj_tbrq;
@Column
@Comment("申请状态(0.待修改 1.待分工审核 2.待校工会审核 3.分工会拒绝 4.校工会拒绝 5.审核通过)")
@ColDefine(type = ColType.INT, width = 10)
private Integer dj_sqzt;
@Column
@Comment("年份")
@ColDefine(type = ColType.INT)
private Integer dj_year;
@Column
@Comment("分工会审核人")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String dj_fghshr;
@Column
@Comment("分工会审核时间")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String dj_fghshsj;
@Column
@Comment("分工会审核意见")
@ColDefine(type = ColType.VARCHAR, width = 155)
private String dj_fghshyj;
@Column
@Comment("校工会审核人")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String dj_xghshr;
@Column
@Comment("校工会审核时间")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String dj_xghshsj;
@Column
@Comment("校工会审核意见")
@ColDefine(type = ColType.VARCHAR, width = 155)
private String dj_xghshyj;
@Column
@Comment("登记类型")
@ColDefine(type = ColType.INT, width = 10)
private Integer dj_djlx;
@Column
@Comment("是否保存")
@ColDefine(type = ColType.INT, width = 10)
private Integer dj_sfbc;
@Column
@Comment("备案审核人")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String dj_bashr;
@Column
@Comment("备案时间")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String dj_bashsj;
@Column
@Comment("备案信息")
@ColDefine(type = ColType.BOOLEAN)
private Boolean dj_sfrx;
@Column
@Comment("是否备案")
@ColDefine(type = ColType.BOOLEAN)
private Boolean dj_sfba;
@Column
@Comment("备注")
@ColDefine(type = ColType.VARCHAR, width = 200)
private String dj_babz;
@Column
@Comment("三代家庭成员信息")
@ColDefine(type = ColType.TEXT)
private String dj_sdjtxx;
@Column
@Comment("身体健康状态")
@ColDefine(type = ColType.VARCHAR, width = 200)
private String dj_stjkzk;
@Column
@Comment("类型(znxx子女信息填报rxdj子女入学登记)")
@ColDefine(type = ColType.VARCHAR, width = 200)
private String applyType;
@Column
@Comment("是否集体户")
@ColDefine(type = ColType.BOOLEAN)
private Boolean isCollectiveHouseholds;
@Column
@Comment("是否已经下载过")
@ColDefine(type = ColType.BOOLEAN)
private Boolean isDownload;
@Column
@Comment("附件")
@ColDefine(type = ColType.MYSQL_JSON)
private List<Sys_file> files;
}
@@ -0,0 +1,64 @@
package io.v.nutz.zhgh.zgfw.model.rxdj;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.io.Serializable;
/**
* 教职工子女报名登记年度
*/
@Data
@Table("fw_rxdj_year")
public class Fw_rxdj_year implements Serializable {
@Name
@Comment("id")
@ColDefine(type = ColType.VARCHAR, width = 32)
@PrevInsert(uu32 = true)
private String id;
@Column
@ColDefine(type = ColType.INT, width = 4)
@Comment("年份")
private String bmyear;
@Column
@ColDefine(type = ColType.INT, width = 5)
@Comment("类型(1.幼儿园 2.小学 3.初中)")
private int bmlx;
@Column
@ColDefine(type = ColType.VARCHAR, width = 20)
@Comment("开始时间")
private String bmkssj;
@Column
@ColDefine(type = ColType.VARCHAR, width = 20)
@Comment("结束时间")
private String bmjssj;
@Column
@ColDefine(type = ColType.VARCHAR, width = 20)
@Comment("年龄限制")
private String nlxz;
@Column
@ColDefine(type = ColType.INT)
@Comment("可报名人员范围")
private Integer activityGroupId;
@Column
@ColDefine(type = ColType.INT, width = 1)
@Comment("开启状态(1.开启 2.关闭)")
private boolean bmkqzt;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("上传附件")
private Boolean needFiles;
}
@@ -0,0 +1,144 @@
package io.v.nutz.zhgh.zgfw.model.singleChild;
import cn.afterturn.easypoi.excel.annotation.Excel;
import io.v.nutz.sys.models.Sys_file;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.io.Serializable;
import java.util.List;
/**
* @author zhf
* @date 2021/5/6 14:14
* @description 独身子女
*/
@Data
@Table("single_child")
public class SingleChild implements Serializable {
@Column
@Name
@Comment("ID")
@ColDefine(type = ColType.VARCHAR, width = 32)
@PrevInsert(uu32 = true)
private String id;
@Column
@Comment("申请人id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String userid;
@Column
@Comment("子女姓名")
@ColDefine(type = ColType.VARCHAR, width = 30)
@Excel(name = "子女姓名", width = 20d)
private String name;
@Column
@Comment("独生子女号")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String dsznh;
@Column
@Comment("子女性别")
@ColDefine(type = ColType.VARCHAR, width = 5)
@Excel(name = "子女性别", width = 20d)
private String sex;
@Column
@Comment("子女出生时间")
@ColDefine(type = ColType.VARCHAR, width = 30)
@Excel(name = "出生时间", width = 20d)
private String cssj;
@Column
@Comment("申请时间")
@ColDefine(type = ColType.VARCHAR, width = 30)
@Excel(name = "申请时间", width = 20d)
private String sqsj;
@Column
@Comment("申请理由")
@ColDefine(type = ColType.VARCHAR, width = 300)
private String sqly;
@Column
@Comment("审核结果")
@ColDefine(type = ColType.VARCHAR, width = 5)
private String shjg;
@Column
@Comment("基层工会审核人")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String fghshr;
@Column
@Comment("基层工会审核时间")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String fghshsj;
@Column
@Comment("基层工会审核意见")
@ColDefine(type = ColType.VARCHAR, width = 300)
private String fghshyj;
@Column
@Comment("校工会审核人")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String xghshr;
@Column
@Comment("校工会审核时间")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String xghshsj;
@Column
@Comment("校工会审核意见")
@ColDefine(type = ColType.VARCHAR, width = 300)
private String xghshyj;
@Column
@Comment("基层工会id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String unionid;
@Column
@Comment("办证时间")
@ColDefine(type = ColType.VARCHAR, width = 30)
@Excel(name = "办证时间", width = 20d)
private String bzsj;
@Column
@Comment("入职时间")
@ColDefine(type = ColType.VARCHAR, width = 30)
@Excel(name = "入职时间", width = 20d)
private String rzsj;
@Column
@Comment("备注")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String bz;
@Column
@Comment("附件")
@ColDefine(type = ColType.MYSQL_JSON)
private List<Sys_file> files;
@Column
@Comment("状态")
@ColDefine(type = ColType.INT)
private Integer state;
@Excel(name = "工号", width = 20d)
private String loginname;
@Excel(name = "上报人", width = 20d)
private String username;
@Excel(name = "基层工会", width = 20d)
private String unionname;
}
@@ -0,0 +1,98 @@
package io.v.nutz.zhgh.zgfw.model.singleChild;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.SelectEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.nutz.lang.util.NutMap;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @FileName io.v.nutz.fw.models.SingleChildStateEnum
* @Description: TODO
* @Author zxc
* @Date 2022/5/5:16:53
* @Version V1.0
**/
@AllArgsConstructor
@Getter
@SelectEnum
public enum SingleChildStateEnum {
/**
* 基层工会退回待修改
*/
FGHTHDXG(100, "基层工会退回待修改"),
/**
* 校工会退回
*/
XGHTH(200, "校工会退回"),
/**
* 待基层工会审核
*/
DFGHSH(300, "待基层工会审核"),
/**
* 基层工会拒绝
*/
FGHJJ(400, "基层工会拒绝"),
/**
* 待校工会审核
*/
DXGHSH(500, "待校工会审核"),
/**
* 校工会拒绝
*/
XGHJJ(600, "校工会拒绝"),
/**
* 校工会通过
*/
XGHTG(700, "校工会通过");
/**
* 状态码
*/
private final Integer stateCode;
/**
* 状态名称
*/
private final String stateName;
/**
* 缓存状态map
*/
static Map<Integer, String> stateCacheMap = new HashMap<>();
static {
SingleChildStateEnum[] values = SingleChildStateEnum.values();
for (SingleChildStateEnum stateEnum : values) {
stateCacheMap.put(stateEnum.getStateCode(), stateEnum.getStateName());
}
}
/**
* 赋值state完整信息
*
* @param pagination 分页数据
* @return
*/
public static Pagination assignStateInfo(Pagination pagination) {
List<NutMap> list = pagination.getList();
for (NutMap m : list) {
int state = m.getInt("state", -1);
m.put("stateName", stateCacheMap.get(state));
}
return pagination;
}
}
@@ -0,0 +1,262 @@
package io.v.nutz.zhgh.zgfw.model.wwj;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.io.Serializable;
/**
* TODO
*
* @author 赵欣雨
* @date 2020/8/15 14:16
*/
@Table("fw_wwj")
public class Fw_Wwj implements Serializable {
@Name
@ColDefine(type = ColType.VARCHAR,width = 32)
@PrevInsert(uu32 = true)
private String id;
@Column
@Comment("慰问部门")
@ColDefine(type = ColType.VARCHAR,width = 20)
private String wwbm;
@Column
@Comment("慰问对象")
@ColDefine(type = ColType.VARCHAR,width = 32)
private String wwuserid;
@Column
@Comment("慰问对象职称")
@ColDefine(type = ColType.VARCHAR,width = 10)
private String wwuserzc;
@Column
@Comment("拟慰问时间")
@ColDefine(type = ColType.VARCHAR,width = 20)
private String planwwsj;
@Column
@Comment("申请金额")
@ColDefine(type = ColType.FLOAT,width = 10)
private Float wwsqje;
@Column
@Comment("申请事由")
@ColDefine(type = ColType.VARCHAR,width = 500)
private String wwsqsy;
@Column
@Comment("申请人")
@ColDefine(type = ColType.VARCHAR,width = 32)
private String sqr;
@Column
@Comment("申请人签字")
@ColDefine(type = ColType.TEXT)
private String sqrqz;
@Column
@Comment("申请时间")
@ColDefine(type = ColType.VARCHAR,width = 20)
private String sqsj;
@Column
@Comment("分会主席")
@ColDefine(type = ColType.VARCHAR,width = 20)
private String fghshrname;
@Column
@Comment("分会主席审核时间")
@ColDefine(type = ColType.VARCHAR,width = 20)
private String fghshsj;
@Column
@Comment("分会主席审核意见")
@ColDefine(type = ColType.VARCHAR,width = 50)
private String fghshyj;
@Column
@Comment("分会主席签字")
@ColDefine(type = ColType.TEXT)
private String fghqz;
@Column
@Comment("校工会主席")
@ColDefine(type = ColType.VARCHAR,width = 20)
private String xghshrname;
@Column
@Comment("校工会主席审核时间")
@ColDefine(type = ColType.VARCHAR,width = 20)
private String xghshsj;
@Column
@Comment("校工会主席审核意见")
@ColDefine(type = ColType.VARCHAR,width = 50)
private String xghshyj;
@Column
@Comment("校工会主席签字")
@ColDefine(type = ColType.TEXT)
private String xghqz;
@Column
@Comment("审核状态(0待申请人修改 1待院级工会审核 2待校工会审核 3院级工会审核不通过 4校工会审核不通过 5审核通过)")
@ColDefine(type = ColType.INT)
private Integer status;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getWwbm() {
return wwbm;
}
public void setWwbm(String wwbm) {
this.wwbm = wwbm;
}
public String getWwuserid() {
return wwuserid;
}
public void setWwuserid(String wwuserid) {
this.wwuserid = wwuserid;
}
public String getPlanwwsj() {
return planwwsj;
}
public void setPlanwwsj(String planwwsj) {
this.planwwsj = planwwsj;
}
public Float getWwsqje() {
return wwsqje;
}
public void setWwsqje(Float wwsqje) {
this.wwsqje = wwsqje;
}
public String getWwsqsy() {
return wwsqsy;
}
public void setWwsqsy(String wwsqsy) {
this.wwsqsy = wwsqsy;
}
public String getSqrqz() {
return sqrqz;
}
public void setSqrqz(String sqrqz) {
this.sqrqz = sqrqz;
}
public String getFghshrname() {
return fghshrname;
}
public void setFghshrname(String fghshrname) {
this.fghshrname = fghshrname;
}
public String getFghshsj() {
return fghshsj;
}
public void setFghshsj(String fghshsj) {
this.fghshsj = fghshsj;
}
public String getFghshyj() {
return fghshyj;
}
public void setFghshyj(String fghshyj) {
this.fghshyj = fghshyj;
}
public String getFghqz() {
return fghqz;
}
public void setFghqz(String fghqz) {
this.fghqz = fghqz;
}
public String getXghshrname() {
return xghshrname;
}
public void setXghshrname(String xghshrname) {
this.xghshrname = xghshrname;
}
public String getXghshsj() {
return xghshsj;
}
public void setXghshsj(String xghshsj) {
this.xghshsj = xghshsj;
}
public String getXghshyj() {
return xghshyj;
}
public void setXghshyj(String xghshyj) {
this.xghshyj = xghshyj;
}
public String getXghqz() {
return xghqz;
}
public void setXghqz(String xghqz) {
this.xghqz = xghqz;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getWwuserzc() {
return wwuserzc;
}
public void setWwuserzc(String wwuserzc) {
this.wwuserzc = wwuserzc;
}
public String getSqr() {
return sqr;
}
public void setSqr(String sqr) {
this.sqr = sqr;
}
public String getSqsj() {
return sqsj;
}
public void setSqsj(String sqsj) {
this.sqsj = sqsj;
}
}
@@ -0,0 +1,58 @@
package io.v.nutz.zhgh.zgfw.service;
import io.v.nutz.base.service.ViService;
import io.v.nutz.zhgh.zgfw.model.condolence.Condolence;
import org.nutz.dao.entity.Record;
import java.util.List;
/**
* @author 1V
*/
public interface CondolenceService extends ViService<Condolence> {
/**
* 查询单个慰问详细信息
*
* @param id
* @return
*/
Record findOne(String id);
/**
* 添加
*
* @param o
*/
String add(Condolence o);
/**
* 修改
*
* @param o
*/
void edit(Condolence o);
/**
* 删除
*
* @param id
*/
void del(String id);
/**
* 获取分工会待办审核人
* @return
*/
List<String> getUnionLeader(String userId);
/**
* 校工会职工慰问管理员
* @return
*/
List<String> getSchoolUnionCondolenceAdmin();
}
@@ -0,0 +1,60 @@
package io.v.nutz.zhgh.zgfw.service;
public interface DifficultState {
/**
* 待分工会审核
*/
int T100 = 100;
/**
* 工会主席不通过
*/
int T150 = 150;
/**
* 待校工会经办人审核
*/
int T200 = 200;
/**
* 校工会经办人不通过
*/
int T250 = 250;
/**
* 待校工会副主席审核
*/
int T300 = 300;
/**
* 校工会副主席不通过
*/
int T350 = 350;
/**
* 校工会常务副主席审核
*/
int T400 = 400;
/**
* 校工会常务副主席不通过
*/
int T450 = 450;
/**
* 待校工会审核
*/
int T500 = 500;
/**
* 校工会主席不通过
*/
int T550 = 550;
/**
* 通过
*/
int T600 = 600;
}
@@ -0,0 +1,12 @@
package io.v.nutz.zhgh.zgfw.service;
import cn.wizzer.framework.base.service.BaseService;
import io.v.nutz.zhgh.zgfw.model.difficult.Zgfw_knbf_jtcy;
/**
* Created by 李耀威 on 2020-05-26
* info by 困难帮扶申请家庭成员service
*/
public interface ZgfwKnbfJtcyService extends BaseService<Zgfw_knbf_jtcy> {
}
@@ -0,0 +1,36 @@
package io.v.nutz.zhgh.zgfw.service;
import cn.wizzer.framework.base.service.BaseService;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.zhgh.zgfw.model.difficult.Zgfw_knbf;
import org.nutz.dao.entity.Record;
import java.util.List;
/**
* Created by 李耀威 on 2020-05-26
* info by 困难帮扶申请service
*/
public interface ZgfwKnbfService extends BaseService<Zgfw_knbf> {
Record findOne(String id);
Pagination pageData(CndPlus cnd, PageForm page, Integer year, String unitId,String unionId);
/**
* 获取分工会待办审核人
* @return
*/
List<String> getUnionLeader(String userId);
/**
* 校工会职工困难补助管理员
* @return
*/
List<String> getSchoolUnionDifficultyAdmin();
}
@@ -0,0 +1,173 @@
package io.v.nutz.zhgh.zgfw.service.impl;
import cn.wizzer.framework.base.service.BaseService;
import io.v.nutz.base.service.ReviewService;
import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.base.utils.Roles;
import io.v.nutz.sys.models.User;
import io.v.nutz.zhgh.zgfw.model.condolence.Condolence;
import io.v.nutz.zhgh.zgfw.service.CondolenceService;
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 java.util.List;
import java.util.stream.Collectors;
/**
* @author 1V
*/
@IocBean(args = {"refer:dao"})
public class CondolenceServiceImpl extends ViServiceImpl<Condolence> implements CondolenceService {
@Inject
private ReviewService reviewService;
@Inject
private BaseService baseService;
public CondolenceServiceImpl(Dao dao) {
super(dao);
}
@Override
@Aop(TransAop.READ_COMMITTED)
public String add(Condolence o) {
return insertWith(o, "goods").getId();
}
@Override
@Aop(TransAop.READ_COMMITTED)
public void edit(Condolence o) {
updateWith(o, "goods");
}
@Override
@Aop(TransAop.READ_COMMITTED)
public void del(String id) {
delete(id);
}
@Override
public Record findOne(String id) {
Sql sql = Sqls.create("""
SELECT
con.*,
type.`name` typename,
type.`code` typecode,
manager.username manager_name,
manager.loginname manager_loginname,
manager.mobile manager_mobile,
be.username be_username,
be.loginname be_loginname,
be.unitname be_unitname,
be.sex be_sex,
payee.username payee_username,
payee.loginname payee_loginname ,
payee.loginname m_loginname,
payee.username m_name,
manager.unitname unitname,
manager.unionname,
pay_user.username as pay_username,
pay_user.loginname as pay_loginname,
re.applyTime,
re.reimbursementItemId,
re.paymentMethodName,
re.bankUserName,
re.bankCardNumber,
re.bankOfDeposit,
manager_sign.DATA manager_sign_data
FROM
condolence con
LEFT JOIN `user` payee ON con.payee = payee.id
LEFT JOIN `user` manager ON con.manager = manager.id
LEFT JOIN `user` be ON con.be_user = be.id
LEFT JOIN reimbursement re ON re.reimbursementId=con.id
LEFT JOIN sys_signature manager_sign ON manager_sign.id = con.manager_sign
LEFT JOIN condolence_type type ON type.id = con.type
LEFT JOIN `user` pay_user ON re.payerId = pay_user.id
WHERE con.id=@id
""").setParam("id", id);
Record record = list(sql).get(0);
record.set("Goods", baseService.dao().query("Goods", Cnd.where("reid", "=", id)));
//小组长
if (Strings.isNotBlank(record.getString("union_leader_review"))) {
record.set("ulr", reviewService.fetch(record.getString("union_leader_review")));
}
//被慰问
if (Strings.isNotBlank(record.getString("be_sign"))) {
record.set("bs", reviewService.fetch(record.getString("be_sign")));
}
// 分工会
if (Strings.isNotBlank(record.getString("union_chairman_review"))) {
record.set("ucr", reviewService.fetch(record.getString("union_chairman_review")));
}
// 书记
if (Strings.isNotBlank(record.getString("unit_secretary_review"))) {
record.set("usr", reviewService.fetch(record.getString("unit_secretary_review")));
}
// 工会经办人
if (Strings.isNotBlank(record.getString("finance_review"))) {
record.set("fr", reviewService.fetch(record.getString("finance_review")));
}
// 工会副主席主席
if (Strings.isNotBlank(record.getString("vice_chairman_review"))) {
record.set("vcr", reviewService.fetch(record.getString("vice_chairman_review")));
}
// 工会常务副主席主席
if (Strings.isNotBlank(record.getString("executive_chairman_review"))) {
record.set("ecr", reviewService.fetch(record.getString("executive_chairman_review")));
}
return record;
}
@Override
public List<String> getUnionLeader(String userId) {
Sql sql = Sqls.create("""
SELECT
u.loginname
FROM
sys_user_role sur
LEFT JOIN `user` u ON u.id = sur.userid
WHERE
sur.roleId = @roleId and u.unionid = (select unionid from `user` where id = @userId)
GROUP BY
sur.userId
""").setParam("roleId", "9c1f19e385914fef82bc35da7c9ded36").setParam("userId",userId);
List<Record> list = list(sql);
return list.stream().map(v-> v.getString("loginname")).collect(Collectors.toList());
}
@Override
public List<String> getSchoolUnionCondolenceAdmin() {
Sql sql = Sqls.create("""
SELECT
u.loginname
FROM
sys_user_role sur
LEFT JOIN sys_user u ON u.id = sur.userid
WHERE
sur.roleId = '6319bc5c4e8146be97f746cbda0c2cbd'
GROUP BY
sur.userId
""");
List<Record> list = list(sql);
return list.stream().map(v-> v.getString("loginname")).collect(Collectors.toList());
}
}
@@ -0,0 +1,21 @@
package io.v.nutz.zhgh.zgfw.service.impl;
import cn.wizzer.framework.base.service.BaseServiceImpl;
import io.v.nutz.zhgh.zgfw.model.difficult.Zgfw_knbf_jtcy;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfJtcyService;
import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.plugins.wkcache.annotation.CacheDefaults;
/**
* Created by 李耀威 on 2020/05/26
*/
@IocBean(args = {"refer:dao"})
@CacheDefaults(cacheName = "Zgfw_knbf_jtcy")
public class ZgfwKnbfJtcyServiceImpl extends BaseServiceImpl<Zgfw_knbf_jtcy> implements ZgfwKnbfJtcyService {
public ZgfwKnbfJtcyServiceImpl(Dao dao) {
super(dao);
}
}
@@ -0,0 +1,228 @@
package io.v.nutz.zhgh.zgfw.service.impl;
import cn.wizzer.framework.base.service.BaseServiceImpl;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.utils.Roles;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.AuditService;
import io.v.nutz.sys.models.User;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.sys.services.SysSignatureService;
import io.v.nutz.zhgh.zgfw.model.difficult.Zgfw_knbf;
import io.v.nutz.zhgh.zgfw.service.DifficultState;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfJtcyService;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfService;
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.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Strings;
import org.nutz.lang.util.NutMap;
import java.util.List;
import java.util.stream.Collectors;
/**
* Created by 李耀威 on 2020/05/26
*/
@IocBean(args = {"refer:dao"})
public class ZgfwKnbfServiceImpl extends BaseServiceImpl<Zgfw_knbf> implements ZgfwKnbfService {
public ZgfwKnbfServiceImpl(Dao dao) {
super(dao);
}
@Inject
private ZgfwKnbfService zgfwKnbfService;
@Inject
private ZgfwKnbfJtcyService zgfwKnbfJtcyService;
@Inject
private SysSignatureService sysSignatureService;
@Inject
private AuditService auditService;
public Record findOne(String id) {
Sql sql = Sqls.create("""
SELECT
sq.*,
sqr.loginname sqrloginname,
sqr.username sqrname,
sqr.unitname,
bbzrusername.username bbname,
bbzrusername.loginname bbloginname,
bbzrusername.sex bbsex,
bbzrusername.birthday bbbirthday,
bbzrusername.bank_number bank_number,
bbunit.`name` bbunit,
state.stateColor,
state.stateName,
sign.`data` sqsign
FROM
zgfw_knbf sq
LEFT JOIN `user` sqr ON sq.sqr = sqr.id
LEFT JOIN sys_user bbzrusername ON sq.bbzrusername = bbzrusername.id
LEFT JOIN sys_unit bbunit ON bbunit.id=bbzrusername.unitid
LEFT JOIN sys_signature sign ON sign.id = sq.applicantsign
LEFT JOIN audit_state state ON state.stateId = sq.zt WHERE sq.id=@id
""");
sql.setParam("id", id);
Record record = zgfwKnbfService.list(sql).get(0);
record.set("jtcys", zgfwKnbfJtcyService.query(Cnd.where("sqid", "=", id)));
if (Strings.isNotBlank(record.getString("applicantsign"))) {
record.set("app", sysSignatureService.fetch(record.getString("applicantsign")));
}
//院级工会
if (Strings.isNotBlank(record.getString("union_president_audit"))) {
record.set("upa", auditService.fetch(record.getString("union_president_audit")));
}
if (Strings.isNotBlank(record.getString("school_manager_audit"))) {
record.set("sma", auditService.fetch(record.getString("school_manager_audit")));
}
if (Strings.isNotBlank(record.getString("two_dzz_audit"))) {
record.set("tda", auditService.fetch(record.getString("two_dzz_audit")));
}
/*if (Strings.isNotBlank(record.getString("school_standing_audit"))) {
record.set("ssa", auditService.fetch(record.getString("school_standing_audit")));
}*/
return record;
}
@Override
public Pagination pageData(CndPlus cnd, PageForm page, Integer year, String unitId, String unionId) {
Sql sql = Sqls.create("""
SELECT
sq.*,
sqr.username sqrname,
sqr.loginname sqrloginname,
sqr.unionname sqrunionname,
sbzr.username sbzrname,
sbzr.loginname sbzrloginname,
dw.`name` unitname,
un.unionname fghname,
un.id unioid,
state.stateColor,
state.stateName state_name,(
CASE
state.stateId
WHEN @state1 THEN
(
SELECT
GROUP_CONCAT(DISTINCT u.username )
FROM
sys_user_role sur
LEFT JOIN sys_user u ON sur.userId = u.id
WHERE
sur.unionid = sqr.unionid
AND sur.roleId = @role1
)
WHEN @state2 THEN
(
SELECT
GROUP_CONCAT(DISTINCT u.username )
FROM
sys_user_role sur
LEFT JOIN sys_user u ON sur.userId = u.id
WHERE
sur.roleId = @role2
)
WHEN @state3 THEN
(
SELECT
GROUP_CONCAT(DISTINCT u.username )
FROM
sys_user_role sur
LEFT JOIN sys_user u ON sur.userId = u.id
WHERE
sur.roleId = @role3
)
WHEN @state4 THEN
(
SELECT
GROUP_CONCAT(DISTINCT u.username )
FROM
sys_user_role sur
LEFT JOIN sys_user u ON sur.userId = u.id
WHERE
sur.roleId = @role4
) ELSE NULL
END
) shrname
FROM
`zgfw_knbf` sq
LEFT JOIN `user` sqr ON sq.sqr = sqr.id
LEFT JOIN sys_user sbzr ON sq.bbzrusername = sbzr.id
LEFT JOIN sys_unit dw ON dw.id = sbzr.unitid
LEFT JOIN sys_union un ON dw.unionid = un.id
LEFT JOIN audit_state state ON sq.zt = state.stateId $condition
""");
sql.setParam("role1", Roles.UNION_MANGER);
sql.setParam("role2", Roles.XGHGLY);
sql.setParam("role3", Roles.GH_WYH_FZX);
sql.setParam("role4", Roles.GH_WYH_CWFZX);
sql.setParam("state1", DifficultState.T100);
sql.setParam("state2", DifficultState.T200);
sql.setParam("state3", DifficultState.T300);
sql.setParam("state4", DifficultState.T400);
if (Strings.isNotBlank(page.getSearchKeyword())) {
cnd.where().andLike(page.getSearchName(), page.getSearchKeyword());
}
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdminSchoolUnionAccountant")) {
cnd.and("un.id", "=", Vi.getUnionId());
}
cnd.andEX("YEAR(sq.sqsj)", "=", year);
cnd.andEX("sqr.unitid", "=", unitId);
cnd.andEX("sqr.unionid", "=", unionId);
cnd.asc("sq.zt");
cnd.desc("sq.sqsj");
sql.setCondition(cnd);
return listPage(page.getPageNumber(), page.getPageSize(), sql);
}
@Override
public List<String> getUnionLeader(String userId) {
Sql sql = Sqls.create("""
SELECT
u.loginname
FROM
sys_user_role sur
LEFT JOIN `user` u ON u.id = sur.userid
WHERE
sur.roleId = @roleId and u.unionid = (select unionid from `user` where id = @userId)
GROUP BY
sur.userId
""").setParam("roleId",Roles.UNION_MANGER).setParam("userId",userId);
List<Record> list = list(sql);
return list.stream().map(v-> v.getString("loginname")).collect(Collectors.toList());
}
@Override
public List<String> getSchoolUnionDifficultyAdmin() {
Sql sql = Sqls.create("""
SELECT
u.loginname
FROM
sys_user_role sur
LEFT JOIN sys_user u ON u.id = sur.userid
WHERE
sur.roleId = '99f9355129284667a40cdda90e671e1f'
GROUP BY
sur.userId
""");
List<Record> list = list(sql);
return list.stream().map(v-> v.getString("loginname")).collect(Collectors.toList());
}
}
@@ -0,0 +1,60 @@
package io.v.nutz.zhgh.zgfw.template.rxdj;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
/**
* @version 1.0
* @Author zzr
* @nameRxdjTemp
* @Date 2024/6/27 15:45
* @注释 入学登记导入表
*/
@Data
public class RxdjTemp {
@Excel(name = "青年教职工姓名")
private String dj_xm;
@Excel(name = "工号")
private String dj_gzh;
@Excel(name = "单位")
private String dj_szdw;
@Excel(name = "分工会")
private String dj_szfgh;
@Excel(name = "职称")
private String dj_zc;
@Excel(name = "学历")
private String dj_xl;
@Excel(name = "子女姓名")
private String dj_znname;
@Excel(name = "子女姓别")
private String dj_znsex;
@Excel(name = "子女出生年月", importFormat = "yyyy-MM-dd")
private String dj_znzsny;
@Excel(name = "青年教职工家庭住址")
private String dj_jtzz;
@Excel(name = "青年教职工户口所在地派出所")
private String dj_hjssxq;
@Excel(name = "青年教职工联系电话")
private String dj_iphone;
@Excel(name = "是否集体户")
private String isCollectiveHouseholds;
@Excel(name = "备注")
private String dj_babz;
//备注
private String remark;
}