first commit
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
package io.v.nutz.reimbursement.constants;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2021/6/1 14:11
|
||||
* @description 报销状态
|
||||
*/
|
||||
public interface ReimbursementState {
|
||||
|
||||
|
||||
/**
|
||||
* 待申请人修改
|
||||
*/
|
||||
Integer MODIFY = 3040;
|
||||
|
||||
/**
|
||||
* 待审核确认
|
||||
*/
|
||||
Integer AUDIT_CONFIRM = 3043;
|
||||
|
||||
/**
|
||||
* 待慰问人签字
|
||||
*/
|
||||
Integer SIGNATURE = 3045;
|
||||
|
||||
/**
|
||||
* 待分工会审核
|
||||
*/
|
||||
Integer UNION = 3050;
|
||||
|
||||
/**
|
||||
* 分工会审核不通过
|
||||
*/
|
||||
Integer UNION_FAIL = 3055;
|
||||
/**
|
||||
* 单位书记
|
||||
*/
|
||||
Integer UNIT_SECRETARY = 3060;
|
||||
|
||||
|
||||
/**
|
||||
* 单位书记审核不通过
|
||||
*/
|
||||
Integer UNIT_SECRETARY_FAIL = 3065;
|
||||
|
||||
|
||||
/**
|
||||
* 待财务审核
|
||||
*/
|
||||
Integer FINANCE = 3070;
|
||||
|
||||
/**
|
||||
* 财务审核不通过
|
||||
*/
|
||||
Integer FINANCE_FAIL = 3075;
|
||||
|
||||
/**
|
||||
* 待分管副主席审核
|
||||
*/
|
||||
Integer VICE_CHAIRMAN = 3080;
|
||||
|
||||
/**
|
||||
* 分管副主席审核不通过
|
||||
*/
|
||||
Integer VICE_CHAIRMAN_FAIL = 3085;
|
||||
|
||||
/**
|
||||
* 待常务副主席审核
|
||||
*/
|
||||
Integer STANDING_VICE_CHAIRMAN = 3090;
|
||||
|
||||
/**
|
||||
* 常务副主席审核不通过
|
||||
*/
|
||||
Integer STANDING_VICE_CHAIRMAN_FAIL = 3095;
|
||||
|
||||
/**
|
||||
* 报销成功
|
||||
*/
|
||||
Integer SUCCESSFUL_REIMBURSEMENT = 3100;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
package io.v.nutz.reimbursement.controller;
|
||||
|
||||
import io.v.nutz.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.jf.model.*;
|
||||
import io.v.nutz.jf.service.ActivityBxService;
|
||||
import io.v.nutz.modules.models.Audit;
|
||||
import io.v.nutz.modules.models.PageForm;
|
||||
import io.v.nutz.reimbursement.constants.ReimbursementState;
|
||||
import io.v.nutz.reimbursement.models.ReimbursementNew;
|
||||
import io.v.nutz.service.ViService;
|
||||
import io.v.nutz.sys.models.Sys_club_user;
|
||||
import io.v.nutz.util.ShiroUtil;
|
||||
import io.v.nutz.web.commons.slog.annotation.SLog;
|
||||
import io.v.nutz.zgfw.service.CondolenceService;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
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.Strings;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2021/10/15 10:47
|
||||
* @description
|
||||
*/
|
||||
@At("/reimbursement/audit/confirm")
|
||||
@Ok("json:full")
|
||||
@IocBean
|
||||
@RequiresAuthentication
|
||||
public class AuditConfirmController {
|
||||
|
||||
|
||||
@Inject("ReimbursementNew")
|
||||
private ViService<ReimbursementNew> reimbursementNewViService;
|
||||
@Inject
|
||||
private ActivityBxService activityBxService;
|
||||
@Inject
|
||||
private CondolenceService condolenceService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/reimbursement/AuditConfirm.html")
|
||||
@RequiresPermissions("reimbursement.audit.confirm")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object pageData(boolean isAudit, PageForm page, Integer year, String unitId, String unionId, String reiItemId) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
rei.*,
|
||||
be.username be_username,
|
||||
state.stateName,
|
||||
state.stateColor
|
||||
FROM
|
||||
`reimbursement_new` rei
|
||||
LEFT JOIN sys_user be ON be.id = rei.be_user
|
||||
LEFT JOIN audit_state state ON state.stateId = rei.state
|
||||
$condition
|
||||
""");
|
||||
cnd.andEX("YEAR ( rei.applyTime )", "=", year);
|
||||
cnd.andEX("rei.unitId", "=", unitId);
|
||||
cnd.andEX("rei.unionId", "=", unionId);
|
||||
if (Strings.isNotBlank(reiItemId) && reiItemId.equals("ww")) {
|
||||
cnd.and("rei.reimbursementItemId", "in", "'fyww','zfww'");
|
||||
} else {
|
||||
cnd.andEX("rei.reimbursementItemId", "=", reiItemId);
|
||||
}
|
||||
cnd.and("rei.State", isAudit ? ">" : "=", ReimbursementState.AUDIT_CONFIRM);
|
||||
|
||||
if (Vi.isNotBlank(page.getSearchName(), page.getSearchKeyword())) {
|
||||
cnd.where().andLike(page.getSearchName(), page.getSearchKeyword());
|
||||
}
|
||||
cnd.desc("rei.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
return reimbursementNewViService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@SLog(tag = "工会报销", msg = "审核了一条记录", param = true, result = true)
|
||||
public Object doSubmit(String id, int flag, Audit audit) {
|
||||
ReimbursementNew reimbursementNew = reimbursementNewViService.fetch(id);
|
||||
audit.setAuditor(io.v.nutz.util.ShiroUtil.getPrincipalProperty("id").toString());
|
||||
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
|
||||
audit = reimbursementNewViService.insert(audit);
|
||||
reimbursementNewViService.update(Chain.make("State", flag == 3 ? ReimbursementState.SUCCESSFUL_REIMBURSEMENT : flag == 2 ? ReimbursementState.MODIFY : ReimbursementState.FINANCE_FAIL).add("accountingAuditId", audit.getId()), Cnd.where("id", "=", id));
|
||||
|
||||
if (flag == 3) {
|
||||
if (reimbursementNew.getReimbursementItemId().equals("fyhd") && (reimbursementNew.getActivity_type() != null && reimbursementNew.getActivity_type() != 1)) {
|
||||
if (reimbursementNew.getActivity_type() == 2) {
|
||||
jf_school jfSchool = reimbursementNewViService.dao().fetch(jf_school.class, Cnd.where("year", "=", DateUtil.getYear()).and("state", "=", 1));
|
||||
SchoolUse schoolUse = new SchoolUse();
|
||||
schoolUse.setReimbursementId(reimbursementNew.getId());
|
||||
reimbursementNewViService.insert(schoolUse);
|
||||
//往预算分配表减钱
|
||||
jfSchool.setUsedQuota(jfSchool.getUsedQuota() + reimbursementNew.getMoney());
|
||||
reimbursementNewViService.updateIgnoreNull(jfSchool);
|
||||
} else {
|
||||
Sys_club_user clubUser = reimbursementNewViService.dao().fetch(Sys_club_user.class, Cnd.where("userid", "=", reimbursementNew.getUserId()));
|
||||
|
||||
jf_club jf_club = reimbursementNewViService.dao().fetch(jf_club.class, Cnd.where("year", "=", DateUtil.getYear()).and("state", "=", 1).and("club_id", "=", clubUser.getClubid()));
|
||||
//往经费使用表中添加一条数据
|
||||
jf_use jf_use = new jf_use();
|
||||
jf_use.setAdjust_id(jf_club.getId());
|
||||
jf_use.setProject(reimbursementNew.getReimbursementItemName());
|
||||
jf_use.setAdjust_money(reimbursementNew.getMoney());
|
||||
jf_use.setAdjust_reason(reimbursementNew.getCause());
|
||||
jf_use.setAdjust_time(DateUtil.getDateTime());
|
||||
jf_use.setAdjust_person(ShiroUtil.getUserId());
|
||||
jf_use.setApply_id(reimbursementNew.getId());
|
||||
reimbursementNewViService.insert(jf_use);
|
||||
//往预算分配表减钱
|
||||
jf_club.setUsed_quota(jf_club.getUsed_quota() + reimbursementNew.getMoney());
|
||||
reimbursementNewViService.updateIgnoreNull(jf_club);
|
||||
}
|
||||
} else {
|
||||
jf_yjgh yjgh = reimbursementNewViService.dao().fetch(jf_yjgh.class, Cnd.where("unionId", "=", reimbursementNew.getUnionId()).and("year", "=", DateUtil.getYear()).and("state", "=", 1));
|
||||
//往经费使用表中添加一条数据
|
||||
jf_use jf_use = new jf_use();
|
||||
jf_use.setAdjust_id(yjgh.getId());
|
||||
jf_use.setProject(reimbursementNew.getReimbursementItemName());
|
||||
jf_use.setAdjust_money(reimbursementNew.getMoney());
|
||||
jf_use.setAdjust_reason(reimbursementNew.getCause());
|
||||
jf_use.setAdjust_time(DateUtil.getDateTime());
|
||||
jf_use.setAdjust_person(ShiroUtil.getUserId());
|
||||
jf_use.setApply_id(reimbursementNew.getId());
|
||||
reimbursementNewViService.insert(jf_use);
|
||||
//往预算分配表减钱
|
||||
yjgh.setUsedQuota(yjgh.getUsedQuota() + reimbursementNew.getMoney());
|
||||
reimbursementNewViService.updateIgnoreNull(yjgh);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//发信息
|
||||
String content = flag == 3 ? "您的报销已审核完毕,请前往智慧工会工会报销系统中的我的报销导出" : flag == 2 ? ("您的报销已被退回," + audit.getAuditOpinion() + "请前往智慧工会查看") : ("您的报销已被拒绝," + audit.getAuditOpinion() + "请前往智慧工会查看");
|
||||
// msgApi.sendWxMsg(content, reimbursementNew.getLoginName());
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@SLog(tag = "工会报销", msg = "撤回了一条记录", param = true, result = true)
|
||||
public Object doRecall(String id) {
|
||||
ReimbursementNew reimbursementNew = reimbursementNewViService.fetch(id);
|
||||
reimbursementNew.setState(ReimbursementState.AUDIT_CONFIRM);
|
||||
reimbursementNew.setAccountingAuditId(null);
|
||||
reimbursementNewViService.update(reimbursementNew);
|
||||
if (reimbursementNew.getReimbursementItemId().equals("fyhd") && (reimbursementNew.getActivity_type() != null && reimbursementNew.getActivity_type() != 1)) {
|
||||
|
||||
if (reimbursementNew.getActivity_type() == 2) {
|
||||
jf_school jfSchool = reimbursementNewViService.dao().fetch(jf_school.class, Cnd.where("year", "=", DateUtil.getYear()).and("state", "=", 1));
|
||||
jfSchool.setUsedQuota(jfSchool.getUsedQuota() - reimbursementNew.getMoney());
|
||||
reimbursementNewViService.updateIgnoreNull(jfSchool);
|
||||
reimbursementNewViService.dao().clear(jf_school.class, Cnd.where("reimbursementId", "=", reimbursementNew.getId()));
|
||||
|
||||
} else {
|
||||
Sys_club_user clubUser = reimbursementNewViService.dao().fetch(Sys_club_user.class, Cnd.where("userid", "=", reimbursementNew.getUserId()));
|
||||
|
||||
jf_club jf_club = reimbursementNewViService.dao().fetch(jf_club.class, Cnd.where("year", "=", DateUtil.getYear()).and("state", "=", 1).and("club_id", "=", clubUser.getClubid()));
|
||||
jf_club.setUsed_quota(jf_club.getUsed_quota() - reimbursementNew.getMoney());
|
||||
reimbursementNewViService.updateIgnoreNull(jf_club);
|
||||
reimbursementNewViService.dao().clear(jf_use.class, Cnd.where("apply_id", "=", reimbursementNew.getId()));
|
||||
|
||||
}
|
||||
} else {
|
||||
jf_yjgh yjgh = reimbursementNewViService.dao().fetch(jf_yjgh.class, Cnd.where("unionId", "=", reimbursementNew.getUnionId()).and("year", "=", DateUtil.getYear()).and("state", "=", 1));
|
||||
yjgh.setUsedQuota(yjgh.getUsedQuota() - reimbursementNew.getMoney());
|
||||
reimbursementNewViService.updateIgnoreNull(yjgh);
|
||||
reimbursementNewViService.dao().clear(jf_use.class, Cnd.where("apply_id", "=", reimbursementNew.getId()));
|
||||
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package io.v.nutz.reimbursement.controller;
|
||||
|
||||
|
||||
import io.v.nutz.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.reimbursement.constants.ReimbursementState;
|
||||
import io.v.nutz.reimbursement.models.Reimbursement;
|
||||
import io.v.nutz.service.ViService;
|
||||
import io.v.nutz.sys.models.Sys_signature;
|
||||
import io.v.nutz.sys.services.SysSignatureService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zgfw.model.condolence.Condolence;
|
||||
import io.v.nutz.zgfw.service.CondolenceService;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
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;
|
||||
|
||||
|
||||
@At("/platform/condolence/apply")
|
||||
@IocBean
|
||||
@RequiresAuthentication
|
||||
@Ok("json")
|
||||
public class CondolenceController {
|
||||
|
||||
@Inject
|
||||
private CondolenceService condolenceService;
|
||||
|
||||
@Inject
|
||||
private SysSignatureService sysSignatureService;
|
||||
|
||||
@Inject("Reimbursement")
|
||||
private ViService<Reimbursement> reimbursementViService;
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object doAdd(@Param("sign") String sign, @Param("data") Condolence condolence, @Param("data") Reimbursement reimbursement) {
|
||||
|
||||
if (Strings.isNotBlank(sign)) {
|
||||
condolence.setManager_sign(sysSignatureService.insert(new Sys_signature(sign)).getId());
|
||||
}
|
||||
|
||||
condolence.setManager(ShiroUtil.getPrincipalProperty("id").toString());
|
||||
condolence.setApply_time(DateUtil.getDate());
|
||||
condolence.setPayee(reimbursement.getPayerId());
|
||||
/* if (ShiroUtil.hasAnyRoles("H04,gh01")) {
|
||||
condolence.setState_id("2040");
|
||||
}*/
|
||||
//待申请人修改
|
||||
condolence.setState_id("3043");
|
||||
String ReimbursementId = condolenceService.add(condolence);
|
||||
reimbursement.setReimbursementId(ReimbursementId);
|
||||
reimbursement.setState(ReimbursementState.AUDIT_CONFIRM);
|
||||
reimbursementViService.insert(reimbursement);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package io.v.nutz.reimbursement.controller;
|
||||
|
||||
import io.v.nutz.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.reimbursement.constants.ReimbursementState;
|
||||
import io.v.nutz.reimbursement.models.Reimbursement;
|
||||
import io.v.nutz.service.ViService;
|
||||
import io.v.nutz.sys.models.Sys_signature;
|
||||
import io.v.nutz.sys.services.SysSignatureService;
|
||||
import io.v.nutz.util.ShiroUtil;
|
||||
import io.v.nutz.zgfw.model.difficult.Zgfw_knbf;
|
||||
import io.v.nutz.zgfw.service.ZgfwKnbfService;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
/**
|
||||
* @author: Aaron
|
||||
* @create: 2021-06-03 15:19
|
||||
* @description:
|
||||
**/
|
||||
|
||||
|
||||
@IocBean
|
||||
@RequiresAuthentication
|
||||
@Ok("json")
|
||||
@At("/platform/difficulty/apply")
|
||||
public class DifficultyController {
|
||||
|
||||
@Inject
|
||||
private SysSignatureService sysSignatureService;
|
||||
|
||||
@Inject
|
||||
private ZgfwKnbfService zgfwKnbfService;
|
||||
|
||||
@Inject("Reimbursement")
|
||||
private ViService<Reimbursement> reimbursementViService;
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object doAdd(@Param("data") Zgfw_knbf difficulty, @Param("data") Reimbursement reimbursement) {
|
||||
|
||||
if (Strings.isNotBlank(difficulty.getApplicantsign())) {
|
||||
difficulty.setApplicantsign(sysSignatureService.insert(new Sys_signature(difficulty.getApplicantsign())).getId());
|
||||
}
|
||||
difficulty.setZt(100);
|
||||
difficulty.setSqr(ShiroUtil.getPrincipalProperty("id").toString());
|
||||
difficulty.setSqsj(DateUtil.getDate());
|
||||
Zgfw_knbf knbf = zgfwKnbfService.insertWith(difficulty, "jtcys");
|
||||
|
||||
reimbursement.setReimbursementId(knbf.getId());
|
||||
reimbursement.setState(ReimbursementState.UNION);
|
||||
reimbursementViService.insert(reimbursement);
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object getUserData(String userId) {
|
||||
return reimbursementViService.fetch(Sqls.create(" SELECT * FROM `user` WHERE id = @userId").setParam("userId", userId));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
package io.v.nutz.reimbursement.controller;
|
||||
|
||||
import io.v.nutz.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.dao.CndPlus;
|
||||
import io.v.nutz.jf.model.ActivityBx;
|
||||
import io.v.nutz.jf.service.ActivityBxService;
|
||||
import io.v.nutz.modules.models.Audit;
|
||||
import io.v.nutz.modules.models.PageForm;
|
||||
import io.v.nutz.modules.models.Review;
|
||||
import io.v.nutz.modules.services.AuditService;
|
||||
import io.v.nutz.modules.services.ReviewService;
|
||||
import io.v.nutz.reimbursement.constants.ReimbursementState;
|
||||
import io.v.nutz.reimbursement.models.Reimbursement;
|
||||
import io.v.nutz.service.ViService;
|
||||
import io.v.nutz.sys.services.SysSignatureService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zgfw.model.condolence.Condolence;
|
||||
import io.v.nutz.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 java.util.Date;
|
||||
|
||||
@At("/platform/reimbursement/dma")
|
||||
@IocBean
|
||||
@RequiresAuthentication
|
||||
@Ok("json")
|
||||
public class DmaController {
|
||||
|
||||
@Inject("Reimbursement")
|
||||
private ViService<Reimbursement> reimbursementViService;
|
||||
|
||||
@Inject
|
||||
private ActivityBxService activityBxService;
|
||||
|
||||
@Inject
|
||||
private SysSignatureService sysSignatureService;
|
||||
|
||||
@Inject
|
||||
private AuditService auditService;
|
||||
|
||||
@Inject
|
||||
private ReviewService reviewService;
|
||||
|
||||
@Inject
|
||||
private CondolenceService condolenceService;
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/reimbursement/dma.html")
|
||||
@RequiresPermissions("rei.dma")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object pageData(boolean isAudit, PageForm page, Integer year, String unitId, String unionId, Integer reiItemId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
rei.*,
|
||||
us.unionname,
|
||||
us.unioncode,
|
||||
us.unitcode,
|
||||
state.stateId,
|
||||
state.stateColor,
|
||||
state.stateName,
|
||||
con_user.username be_username,
|
||||
bx.activity_name
|
||||
FROM
|
||||
`reimbursement` rei
|
||||
LEFT JOIN `user` us ON us.id = rei.userid
|
||||
LEFT JOIN audit_state state ON rei.State = state.stateId
|
||||
LEFT JOIN condolence con ON con.id = rei.reimbursementId
|
||||
LEFT JOIN activity_bx bx ON rei.reimbursementId = bx.id
|
||||
LEFT JOIN `user` con_user ON con_user.id=con.be_user
|
||||
$condition
|
||||
""");
|
||||
CndPlus cnd = CndPlus.create();
|
||||
cnd.and("rei.State", isAudit ? ">" : "=", ReimbursementState.UNION);
|
||||
Vi.cndPlus(cnd, "rei.reimbursementItemId", "=", reiItemId);
|
||||
Vi.cndPlus(cnd, "YEAR(rei.applyTime)", "=", year);
|
||||
Vi.cndPlus(cnd, "us.unitid", "=", unitId);
|
||||
Vi.cndPlus(cnd, "us.unionid", "=", unionId);
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
|
||||
cnd.and("us.unionid", "=", Vi.getUnionId());
|
||||
}
|
||||
cnd.desc("rei.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
return reimbursementViService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object doReview(String id, Boolean flag, double money, Audit audit, Review review, Integer reimbursementItemId) {
|
||||
double Amount = 2000;
|
||||
Reimbursement reimbursementId = reimbursementViService.fetch(Cnd.where("reimbursementId", "=", id));
|
||||
|
||||
|
||||
if (reimbursementItemId != 4) {
|
||||
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
|
||||
audit.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
|
||||
audit.setAuditTime(new Date());
|
||||
audit = auditService.insert(audit);
|
||||
ActivityBx aid = activityBxService.fetch(id);
|
||||
aid.setUnion_audit_id(audit.getId());
|
||||
if (money >= Amount) {
|
||||
aid.setState_id(flag ? "3060" : "3055");
|
||||
} else {
|
||||
aid.setState_id(flag ? "3070" : "3055");
|
||||
}
|
||||
activityBxService.updateIgnoreNull(aid);
|
||||
|
||||
} else {
|
||||
|
||||
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 (money >= Amount) {
|
||||
condolence.setState_id(flag ? "3060" : "3055");
|
||||
} else {
|
||||
condolence.setState_id(flag ? "3070" : "3055");
|
||||
}
|
||||
|
||||
condolenceService.updateIgnoreNull(condolence);
|
||||
|
||||
}
|
||||
|
||||
if (money >= Amount) {
|
||||
reimbursementId.setState(flag ? ReimbursementState.UNIT_SECRETARY : ReimbursementState.UNION_FAIL);
|
||||
} else {
|
||||
reimbursementId.setState(flag ? ReimbursementState.FINANCE : ReimbursementState.UNION_FAIL);
|
||||
}
|
||||
reimbursementViService.updateIgnoreNull(reimbursementId);
|
||||
return null;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
package io.v.nutz.reimbursement.controller;
|
||||
|
||||
import io.v.nutz.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.dao.CndPlus;
|
||||
import io.v.nutz.jf.model.ActivityBx;
|
||||
import io.v.nutz.jf.service.ActivityBxService;
|
||||
import io.v.nutz.modules.models.Audit;
|
||||
import io.v.nutz.modules.models.PageForm;
|
||||
import io.v.nutz.modules.models.Review;
|
||||
import io.v.nutz.modules.services.AuditService;
|
||||
import io.v.nutz.modules.services.ReviewService;
|
||||
import io.v.nutz.reimbursement.constants.ReimbursementState;
|
||||
import io.v.nutz.reimbursement.models.Reimbursement;
|
||||
import io.v.nutz.service.ViService;
|
||||
import io.v.nutz.sys.services.SysSignatureService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zgfw.model.condolence.Condolence;
|
||||
import io.v.nutz.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 java.util.Date;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2021/6/7 14:23
|
||||
* @description 财务审核
|
||||
*/
|
||||
|
||||
@At("/platform/reimbursement/finance")
|
||||
@IocBean
|
||||
@RequiresAuthentication
|
||||
@Ok("json")
|
||||
public class FinanceController {
|
||||
|
||||
|
||||
@Inject("Reimbursement")
|
||||
private ViService<Reimbursement> reimbursementViService;
|
||||
|
||||
@Inject
|
||||
private ActivityBxService activityBxService;
|
||||
|
||||
@Inject
|
||||
private SysSignatureService sysSignatureService;
|
||||
|
||||
@Inject
|
||||
private AuditService auditService;
|
||||
|
||||
@Inject
|
||||
private ReviewService reviewService;
|
||||
|
||||
@Inject
|
||||
private CondolenceService condolenceService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/reimbursement/finance.html")
|
||||
@RequiresPermissions("reimbursement.finance")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object pageData(boolean isAudit, PageForm page, Integer year, String unitId, String unionId, Integer reiItemId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
rei.*,
|
||||
us.unionname,
|
||||
state.stateColor,
|
||||
state.stateName,
|
||||
bx.activity_money,
|
||||
con.money
|
||||
FROM
|
||||
`reimbursement` rei
|
||||
LEFT JOIN `user` us ON us.id = rei.userid
|
||||
LEFT JOIN condolence con ON con.id = rei.reimbursementId
|
||||
LEFT JOIN activity_bx bx ON bx.id = rei.reimbursementId
|
||||
LEFT JOIN audit_state state ON rei.State = state.stateId $condition
|
||||
""");
|
||||
CndPlus cnd = CndPlus.create();
|
||||
cnd.and("rei.State", isAudit ? ">" : "=", ReimbursementState.FINANCE);
|
||||
|
||||
Vi.cndPlus(cnd, "rei.reimbursementItemId", "=", reiItemId);
|
||||
Vi.cndPlus(cnd, "YEAR(rei.applyTime)", "=", year);
|
||||
Vi.cndPlus(cnd, "us.unitid", "=", unitId);
|
||||
Vi.cndPlus(cnd, "us.unionid", "=", unionId);
|
||||
cnd.desc("rei.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
return reimbursementViService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object doReview(String id, Boolean flag, Audit audit, Review review, Integer reimbursementItemId, double money) {
|
||||
|
||||
|
||||
if (reimbursementItemId != 4) {
|
||||
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
|
||||
audit.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
|
||||
audit.setAuditTime(new Date());
|
||||
audit = auditService.insert(audit);
|
||||
ActivityBx aid = activityBxService.fetch(id);
|
||||
aid.setFinance_audit_id(audit.getId());
|
||||
aid.setState_id(flag ? "3080" : "3075");
|
||||
aid.setActivity_money(money);
|
||||
activityBxService.updateIgnoreNull(aid);
|
||||
} else {
|
||||
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.setFinance_review(review.getId());
|
||||
condolence.setState_id(flag ? "3080" : "3075");
|
||||
condolence.setMoney(money);
|
||||
condolenceService.updateIgnoreNull(condolence);
|
||||
}
|
||||
Reimbursement reimbursement = reimbursementViService.fetch(Cnd.where("reimbursementId", "=", id));
|
||||
reimbursement.setState(flag ? ReimbursementState.VICE_CHAIRMAN : ReimbursementState.FINANCE_FAIL);
|
||||
|
||||
reimbursementViService.updateIgnoreNull(reimbursement);
|
||||
return null;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
package io.v.nutz.reimbursement.controller;
|
||||
|
||||
import io.v.nutz.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.dao.CndPlus;
|
||||
import io.v.nutz.jf.model.ActivityBx;
|
||||
import io.v.nutz.jf.service.ActivityBxService;
|
||||
import io.v.nutz.modules.models.Audit;
|
||||
import io.v.nutz.modules.models.PageForm;
|
||||
import io.v.nutz.modules.models.Review;
|
||||
import io.v.nutz.modules.services.AuditService;
|
||||
import io.v.nutz.modules.services.ReviewService;
|
||||
import io.v.nutz.reimbursement.constants.ReimbursementState;
|
||||
import io.v.nutz.reimbursement.models.Reimbursement;
|
||||
import io.v.nutz.service.ViService;
|
||||
import io.v.nutz.sys.services.SysSignatureService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zgfw.model.condolence.Condolence;
|
||||
import io.v.nutz.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.dao.util.cri.Static;
|
||||
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.Date;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2021/6/7 10:24
|
||||
* @description 单位书记
|
||||
*/
|
||||
@At("/platform/reimbursement/secretary")
|
||||
@IocBean
|
||||
@RequiresAuthentication
|
||||
@Ok("json")
|
||||
public class ReiSecretaryController {
|
||||
|
||||
|
||||
@Inject("Reimbursement")
|
||||
private ViService<Reimbursement> reimbursementViService;
|
||||
|
||||
@Inject
|
||||
private ActivityBxService activityBxService;
|
||||
|
||||
@Inject
|
||||
private SysSignatureService sysSignatureService;
|
||||
|
||||
@Inject
|
||||
private AuditService auditService;
|
||||
|
||||
@Inject
|
||||
private ReviewService reviewService;
|
||||
|
||||
@Inject
|
||||
private CondolenceService condolenceService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/reimbursement/secretary.html")
|
||||
@RequiresPermissions("reimbursement.secretary")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object pageData(boolean isAudit, PageForm page, Integer year, String unitId, String unionId, Integer reiItemId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
rei.*,
|
||||
us.unionname,
|
||||
state.stateColor,
|
||||
state.stateName
|
||||
FROM
|
||||
`reimbursement` rei
|
||||
LEFT JOIN `user` us ON us.id = rei.userid
|
||||
LEFT JOIN condolence con ON con.id = rei.reimbursementId
|
||||
LEFT JOIN activity_bx bx ON bx.id = rei.reimbursementId
|
||||
LEFT JOIN audit_state state ON rei.State = state.stateId $condition
|
||||
""");
|
||||
CndPlus cnd = CndPlus.create();
|
||||
if (isAudit) {
|
||||
cnd.and(new Static("""
|
||||
(con.unit_secretary_review IS NOT NULL
|
||||
OR bx.unit_secretary_audit_id IS NOT NULL)
|
||||
"""));
|
||||
} else {
|
||||
cnd.and("rei.State", "=", ReimbursementState.UNIT_SECRETARY);
|
||||
}
|
||||
Vi.cndPlus(cnd, "rei.reimbursementItemId", "=", reiItemId);
|
||||
Vi.cndPlus(cnd, "YEAR(rei.applyTime)", "=", year);
|
||||
Vi.cndPlus(cnd, "us.unitid", "=", unitId);
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
|
||||
cnd.and("us.unionid", "=", Vi.getUnionId());
|
||||
}
|
||||
cnd.desc("rei.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
return reimbursementViService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object doReview(String id, Boolean flag, Audit audit, Review review, Integer reimbursementItemId) {
|
||||
|
||||
|
||||
if (reimbursementItemId != 4) {
|
||||
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
|
||||
audit.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
|
||||
audit.setAuditTime(new Date());
|
||||
audit = auditService.insert(audit);
|
||||
ActivityBx aid = activityBxService.fetch(id);
|
||||
aid.setUnit_secretary_audit_id(audit.getId());
|
||||
aid.setState_id(flag ? "3070" : "3065");
|
||||
activityBxService.updateIgnoreNull(aid);
|
||||
} else {
|
||||
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.setUnit_secretary_review(review.getId());
|
||||
condolence.setState_id(flag ? "3070" : "3065");
|
||||
condolenceService.updateIgnoreNull(condolence);
|
||||
}
|
||||
Reimbursement reimbursement = reimbursementViService.fetch(Cnd.where("reimbursementId", "=", id));
|
||||
reimbursement.setState(flag ? ReimbursementState.FINANCE : ReimbursementState.UNIT_SECRETARY_FAIL);
|
||||
|
||||
reimbursementViService.updateIgnoreNull(reimbursement);
|
||||
return null;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
package io.v.nutz.reimbursement.controller;
|
||||
|
||||
import io.v.nutz.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.reimbursement.constants.ReimbursementState;
|
||||
import io.v.nutz.reimbursement.services.ReimbursementService;
|
||||
import io.v.nutz.util.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;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2021/6/16 8:55
|
||||
* @description 报销待办
|
||||
*/
|
||||
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@At("/platform/Reimbursement/Agent")
|
||||
public class ReimbursementAgentController {
|
||||
|
||||
|
||||
private static final String MODIFY = "/activity/reimbursement/list";
|
||||
private static final String SIGNATURE = "/platform/fw/condolence/be";
|
||||
private static final String UNION = "/platform/reimbursement/dma";
|
||||
private static final String UNIT_SECRETARY = "/platform/reimbursement/secretary";
|
||||
private static final String FINANCE = "/platform/reimbursement/finance";
|
||||
private static final String VICE_CHAIRMAN = "/platform/reimbursement/ViceChairman";
|
||||
private static final String STANDING_VICE_CHAIRMAN = "/platform/reimbursement/StandingViceChairman";
|
||||
@Inject
|
||||
private Vi vi;
|
||||
@Inject
|
||||
private ReimbursementService reimbursementService;
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object getAgenda() {
|
||||
final String title = "【职工报销】";
|
||||
|
||||
List<NutMap> result = new ArrayList<>();
|
||||
|
||||
if (ShiroUtil.hasAnyRoles("sysadmin")) {
|
||||
result.add(new NutMap().setv("title", title).setv("url", MODIFY).setv("iconClass", vi.getIconByPath(MODIFY)).setv("label", "待经办人修改").setv("number", getModifyCount()));
|
||||
result.add(new NutMap().setv("title", title).setv("url", SIGNATURE).setv("iconClass", vi.getIconByPath(SIGNATURE)).setv("label", "待慰问人签字").setv("number", getSignatureCount()));
|
||||
result.add(new NutMap().setv("title", title).setv("url", UNION).setv("iconClass", vi.getIconByPath(UNION)).setv("label", "待分工会审核").setv("number", getUcrCount()));
|
||||
result.add(new NutMap().setv("title", title).setv("url", UNIT_SECRETARY).setv("iconClass", vi.getIconByPath(UNIT_SECRETARY)).setv("label", "待单位书记审核").setv("number", getUnit_secretaryCount()));
|
||||
result.add(new NutMap().setv("title", title).setv("url", FINANCE).setv("iconClass", vi.getIconByPath(FINANCE)).setv("label", "待财务审核").setv("number", getFinanceCount()));
|
||||
result.add(new NutMap().setv("title", title).setv("url", VICE_CHAIRMAN).setv("iconClass", vi.getIconByPath(VICE_CHAIRMAN)).setv("label", "待分管副主席审核").setv("number", getVice_chairmanCount()));
|
||||
result.add(new NutMap().setv("title", title).setv("url", STANDING_VICE_CHAIRMAN).setv("iconClass", vi.getIconByPath(STANDING_VICE_CHAIRMAN)).setv("label", "待分管副主席审核").setv("number", getStanding_vice_chairmanCount()));
|
||||
} else {
|
||||
if (ShiroUtil.hasAnyRoles("gh03")) {
|
||||
result.add(new NutMap().setv("title", title).setv("url", UNIT_SECRETARY).setv("iconClass", vi.getIconByPath(UNIT_SECRETARY)).setv("label", "待单位书记审核").setv("number", getUnit_secretaryCount()));
|
||||
}
|
||||
if (ShiroUtil.hasAnyRoles("xghkj")) {
|
||||
result.add(new NutMap().setv("title", title).setv("url", FINANCE).setv("iconClass", vi.getIconByPath(FINANCE)).setv("label", "待财务审核").setv("number", getFinanceCount()));
|
||||
}
|
||||
if (ShiroUtil.hasAnyRoles("wyh03")) {
|
||||
result.add(new NutMap().setv("title", title).setv("url", VICE_CHAIRMAN).setv("iconClass", vi.getIconByPath(VICE_CHAIRMAN)).setv("label", "待分管副主席审核").setv("number", getVice_chairmanCount()));
|
||||
}
|
||||
if (ShiroUtil.hasAnyRoles("wyh02")) {
|
||||
result.add(new NutMap().setv("title", title).setv("url", STANDING_VICE_CHAIRMAN).setv("iconClass", vi.getIconByPath(STANDING_VICE_CHAIRMAN)).setv("label", "待分管副主席审核").setv("number", getStanding_vice_chairmanCount()));
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 待申请人修改
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Object getModifyCount() {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT COUNT(1) FROM reimbursement $condition
|
||||
""");
|
||||
cnd.and("State", "=", ReimbursementState.MODIFY);
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
|
||||
cnd.and("userId", "=", ShiroUtil.getPrincipalProperty("id"));
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
return reimbursementService.count(sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* 待慰问人签字
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Object getSignatureCount() {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT COUNT(1) FROM reimbursement $condition
|
||||
""");
|
||||
cnd.and("State", "=", ReimbursementState.SIGNATURE);
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
|
||||
cnd.and("userId", "=", ShiroUtil.getPrincipalProperty("id"));
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
return reimbursementService.count(sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* 待工会主席审核
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private Integer getUcrCount() {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT COUNT(1) FROM reimbursement re LEFT JOIN `user` us ON re.userId=us.id $condition
|
||||
""");
|
||||
cnd.and("re.State", "=", ReimbursementState.UNION);
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
|
||||
cnd.and("us.unionid", "=", vi.getUnionId());
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
return reimbursementService.count(sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* 待单位书记审核
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private Integer getUnit_secretaryCount() {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT COUNT(1) FROM reimbursement re LEFT JOIN `user` us ON re.userId=us.id $condition
|
||||
""");
|
||||
cnd.and("re.State", "=", ReimbursementState.UNIT_SECRETARY);
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
|
||||
cnd.and("us.unionid", "=", vi.getUnionId());
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
return reimbursementService.count(sql);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 待财务审核
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Object getFinanceCount() {
|
||||
return reimbursementService.count(Cnd.where("State", "=", ReimbursementState.FINANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
* 待分管副主席审核
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Object getVice_chairmanCount() {
|
||||
return reimbursementService.count(Cnd.where("State", "=", ReimbursementState.VICE_CHAIRMAN));
|
||||
}
|
||||
|
||||
/**
|
||||
* 待常务副主席审核
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Object getStanding_vice_chairmanCount() {
|
||||
return reimbursementService.count(Cnd.where("State", "=", ReimbursementState.STANDING_VICE_CHAIRMAN));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package io.v.nutz.reimbursement.controller;
|
||||
|
||||
import io.v.nutz.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.jf.model.ActivityBx;
|
||||
import io.v.nutz.jf.model.jf_use;
|
||||
import io.v.nutz.jf.model.jf_yjgh;
|
||||
import io.v.nutz.modules.models.PageForm;
|
||||
import io.v.nutz.reimbursement.models.ReimbursementNew;
|
||||
import io.v.nutz.reimbursement.services.ReimbursementService;
|
||||
import io.v.nutz.service.ViService;
|
||||
import io.v.nutz.util.ShiroUtil;
|
||||
import io.v.nutz.web.commons.slog.annotation.SLog;
|
||||
import io.v.nutz.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.Strings;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2021/6/2 18:09
|
||||
* @description 报销列表
|
||||
*/
|
||||
@At("/activity/reimbursement/list")
|
||||
@Ok("json:full")
|
||||
@IocBean
|
||||
@RequiresAuthentication
|
||||
public class ReimbursementListController {
|
||||
|
||||
@Inject
|
||||
private ReimbursementService reimbursementService;
|
||||
|
||||
@Inject("ActivityBx")
|
||||
private ViService<ActivityBx> activityBxViService;
|
||||
|
||||
@Inject("ReimbursementNew")
|
||||
private ViService<ReimbursementNew> reimbursementNewViService;
|
||||
|
||||
@Inject
|
||||
private CondolenceService condolenceService;
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/reimbursement/ReimbursementList.html")
|
||||
@RequiresPermissions("reimbursement.list")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object pageData(Integer year, String unitId, String unionId, String reiItemId, PageForm page) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
rei.*,
|
||||
be.username be_username,
|
||||
state.stateName,
|
||||
state.stateColor
|
||||
FROM
|
||||
`reimbursement_new` rei
|
||||
LEFT JOIN sys_user be ON be.id = rei.be_user
|
||||
LEFT JOIN audit_state state ON state.stateId = rei.state
|
||||
$condition
|
||||
""");
|
||||
cnd.andEX("YEAR ( rei.applyTime )", "=", year);
|
||||
cnd.andEX("rei.unitId", "=", unitId);
|
||||
cnd.andEX("rei.unionId", "=", unionId);
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
|
||||
cnd.and("rei.userId", "=", ShiroUtil.getUserId());
|
||||
}
|
||||
if (Strings.isNotBlank(reiItemId) && reiItemId.equals("ww")) {
|
||||
cnd.and("rei.reimbursementItemId", "in", "'fyww','zfww'");
|
||||
} else {
|
||||
cnd.andEX("rei.reimbursementItemId", "=", reiItemId);
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
return reimbursementNewViService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object findOne(String id) {
|
||||
return reimbursementService.findOne(id);
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@SLog(tag = "工会报销", msg = "删除了一条记录", param = true, result = true)
|
||||
public Object doDelete(String id) {
|
||||
ReimbursementNew reimbursementNew = reimbursementNewViService.fetch(id);
|
||||
jf_yjgh yjgh = reimbursementNewViService.dao().fetch(jf_yjgh.class, Cnd.where("unionId", "=", Vi.getUnionId()).and("year", "=", DateUtil.getYear()).and("state", "=", 1));
|
||||
yjgh.setUsedQuota(yjgh.getUsedQuota() - reimbursementNew.getMoney());
|
||||
reimbursementNewViService.updateIgnoreNull(yjgh);
|
||||
reimbursementNewViService.dao().clear(jf_use.class, Cnd.where("apply_id", "=", reimbursementNew.getId()));
|
||||
|
||||
reimbursementNewViService.dao().clear(ReimbursementNew.class, Cnd.where("id", "=", id));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,566 @@
|
||||
package io.v.nutz.reimbursement.controller;
|
||||
|
||||
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.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.artofsolving.jodconverter.DocumentConverter;
|
||||
import com.artofsolving.jodconverter.openoffice.connection.OpenOfficeConnection;
|
||||
import com.artofsolving.jodconverter.openoffice.connection.SocketOpenOfficeConnection;
|
||||
import com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import com.deepoove.poi.data.PictureRenderData;
|
||||
import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
|
||||
import com.google.zxing.BarcodeFormat;
|
||||
import com.google.zxing.client.j2se.MatrixToImageWriter;
|
||||
import com.google.zxing.common.BitMatrix;
|
||||
import com.google.zxing.qrcode.QRCodeWriter;
|
||||
import io.v.nutz.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.dao.CndPlus;
|
||||
import io.v.nutz.modules.models.Audit;
|
||||
import io.v.nutz.modules.models.PageForm;
|
||||
import io.v.nutz.modules.models.Review;
|
||||
import io.v.nutz.reimbursement.services.ReimbursementService;
|
||||
import io.v.nutz.util.MoneyUtil;
|
||||
import io.v.nutz.util.ViTool;
|
||||
import io.v.nutz.web.commons.base.Globals;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zgfw.service.CondolenceService;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
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.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 javax.servlet.http.HttpServletResponse;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Base64;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2021/6/8 8:56
|
||||
* @description 报销汇总
|
||||
*/
|
||||
|
||||
@At("/platform/reimbursement/Summary")
|
||||
@IocBean
|
||||
@RequiresAuthentication
|
||||
@Ok("json")
|
||||
public class ReimbursementSummaryController {
|
||||
|
||||
|
||||
@Inject
|
||||
private ReimbursementService reimbursementViService;
|
||||
@Inject
|
||||
private CondolenceService condolenceService;
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/reimbursement/Summary.html")
|
||||
@RequiresPermissions("reimbursement.Summary")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object pageData(Integer year, String[] reimbursementDate, PageForm page, String unitId, String unionId, String reiItemId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
rei.*,
|
||||
be.username be_username,
|
||||
state.stateName,
|
||||
state.stateColor
|
||||
FROM
|
||||
`reimbursement_new` rei
|
||||
LEFT JOIN sys_user be ON be.id = rei.be_user
|
||||
LEFT JOIN audit_state state ON state.stateId = rei.state
|
||||
$condition
|
||||
""");
|
||||
CndPlus cnd = CndPlus.create();
|
||||
|
||||
Vi.cndPlus(cnd, "rei.reimbursementItemId", "=", reiItemId);
|
||||
if (reimbursementDate.length > 0) {
|
||||
cnd.and("rei.applyTime", ">=", reimbursementDate[0]);
|
||||
cnd.and("rei.applyTime", "<=", reimbursementDate[1]);
|
||||
}
|
||||
Vi.cndPlus(cnd, "rei.unitId", "=", unitId);
|
||||
Vi.cndPlus(cnd, "rei.unionId", "=", unionId);
|
||||
if (Vi.isNotBlank(page.getSearchName(), page.getSearchKeyword())) {
|
||||
cnd.where().andLike(page.getSearchName(), page.getSearchKeyword());
|
||||
}
|
||||
if (Strings.isNotBlank(reiItemId) && reiItemId.equals("ww")) {
|
||||
cnd.and("rei.reimbursementItemId", "in", "'fyww','zfww'");
|
||||
} else {
|
||||
cnd.andEX("rei.reimbursementItemId", "=", reiItemId);
|
||||
}
|
||||
/* Vi.cndPlus(cnd, "rei.State", "=", ReimbursementState.SUCCESSFUL_REIMBURSEMENT);*/
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06,gh12,wyh02,wyh03")) {
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
if (ShiroUtil.hasAnyRoles("gh01,H04")) {
|
||||
group.or("rei.unionId", "=", Vi.getUnionId());
|
||||
} else {
|
||||
group.or("rei.userId", "=", ShiroUtil.getPrincipalProperty("id"));
|
||||
}
|
||||
cnd.and(group);
|
||||
}
|
||||
cnd.desc("rei.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
return reimbursementViService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
public void ConExport(String id, HttpServletResponse response, boolean Print) throws Exception {
|
||||
|
||||
response.setContentType("application/pdf");
|
||||
Record record = condolenceService.findOne(id);
|
||||
QRCodeWriter qrCodeWriter = new QRCodeWriter();
|
||||
BitMatrix bitMatrix = qrCodeWriter.encode(record.getString("document_no"), BarcodeFormat.QR_CODE, 80, 80);
|
||||
BufferedImage bufferedImage = MatrixToImageWriter.toBufferedImage(bitMatrix);
|
||||
PictureRenderData pictureRenderData = new PictureRenderData(80, 80, ".png", bufferedImage);
|
||||
record.set("qrcode", pictureRenderData);
|
||||
record.set("money_big", MoneyUtil.toRMBUpper(record.getString("money")));
|
||||
|
||||
String wtAct = "□文体活动 √慰问 □人员经费";
|
||||
record.set("bxxm", wtAct);
|
||||
record.set("starting_time", record.getString("starting_time") + "至" + record.getString("end_time"));
|
||||
|
||||
|
||||
//自己签字
|
||||
String ms = record.getString("manager_sign");
|
||||
if (Strings.isNotBlank(ms)) {
|
||||
record.set("ms", getImg(ms));
|
||||
}
|
||||
if (StrUtil.isNotBlank(record.getString("be_sign_text"))) {
|
||||
record.set("mstext", record.getString("be_sign_text"));
|
||||
}
|
||||
|
||||
Object bs = record.get("bs");
|
||||
if (bs != null) {
|
||||
Review review = (Review) bs;
|
||||
record.set("bs", review.getSign() != null ? getImg(review.getSign()) : null);
|
||||
record.set("bsTime", review.getTime());
|
||||
}
|
||||
|
||||
//分工会主席
|
||||
Object ucr = record.get("ucr");
|
||||
if (ucr != null) {
|
||||
Review review = (Review) ucr;
|
||||
record.set("ucr", Strings.isNotBlank(review.getSign()) ? getImg(review.getSign()) : null);
|
||||
record.set("ucrName", StrUtil.isBlank(review.getSign()) ? review.getUsername() : "");
|
||||
record.set("ucrTime", review.getTime());
|
||||
record.set("ucrOpinion", review.getOpinion());
|
||||
}
|
||||
|
||||
//书记审核
|
||||
Object usr = record.get("usr");
|
||||
if (usr != null) {
|
||||
Review review = (Review) usr;
|
||||
record.set("usr", Strings.isNotBlank(review.getSign()) ? getImg(review.getSign()) : null);
|
||||
record.set("usrName", StrUtil.isBlank(review.getSign()) ? review.getUsername() : "");
|
||||
record.set("usrTime", review.getTime());
|
||||
record.set("usrOpinion", review.getOpinion());
|
||||
}
|
||||
|
||||
//财务
|
||||
Object fr = record.get("fr");
|
||||
if (fr != null) {
|
||||
Review review = (Review) fr;
|
||||
record.set("fr", Strings.isNotBlank(review.getSign()) ? getImg(review.getSign()) : null);
|
||||
record.set("frName", StrUtil.isBlank(review.getSign()) ? review.getUsername() : "");
|
||||
record.set("frTime", review.getTime());
|
||||
record.set("frOpinion", review.getOpinion());
|
||||
}
|
||||
|
||||
|
||||
//工会副主席
|
||||
Object vcr = record.get("vcr");
|
||||
if (vcr != null) {
|
||||
Review review = (Review) vcr;
|
||||
record.set("vcr", Strings.isNotBlank(review.getSign()) ? getImg(review.getSign()) : null);
|
||||
record.set("vcrName", StrUtil.isBlank(review.getSign()) ? review.getUsername() : "");
|
||||
record.set("vcrTime", review.getTime());
|
||||
record.set("vcrOpinion", review.getOpinion());
|
||||
}
|
||||
|
||||
//校工会常务副主席
|
||||
Object ecr = record.get("ecr");
|
||||
if (ecr != null) {
|
||||
Review review = (Review) ecr;
|
||||
record.set("ecr", Strings.isNotBlank(review.getSign()) ? getImg(review.getSign()) : null);
|
||||
record.set("ecrName", StrUtil.isBlank(review.getSign()) ? review.getUsername() : "");
|
||||
record.set("ecrTime", review.getTime());
|
||||
record.set("ecrOpinion", review.getOpinion());
|
||||
}
|
||||
|
||||
HackLoopTableRenderPolicy policy = new HackLoopTableRenderPolicy();
|
||||
Configure config = Configure.newBuilder().bind("goods", policy).build();
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("c", record);
|
||||
InputStream inputStream;
|
||||
if (record.getString("reimbursementItemId").equals("3") || Strings.isNotBlank(record.getString("way")) || record.getString("way").equals("慰问金 (A)")) {
|
||||
inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("docTemplate/reimbursement/reimbursementMoney.docx");
|
||||
} else {
|
||||
inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("docTemplate/reimbursement/reimbursement.docx");
|
||||
}
|
||||
if (Print) {
|
||||
String uuid = R.UU32();
|
||||
|
||||
File docx = new File(uuid + ".docx");
|
||||
File pdf = new File(uuid + ".pdf");
|
||||
|
||||
OutputStream outputStream = new FileOutputStream(docx);
|
||||
|
||||
XWPFTemplate.compile(inputStream, config).render(record, outputStream);
|
||||
inputStream.close();
|
||||
outputStream.close();
|
||||
|
||||
//打开连接
|
||||
OpenOfficeConnection connection = new SocketOpenOfficeConnection("127.0.0.1", 8100);
|
||||
connection.connect();
|
||||
DocumentConverter converter = new OpenOfficeDocumentConverter(connection);
|
||||
//执行转换
|
||||
converter.convert(docx, pdf);
|
||||
connection.disconnect();
|
||||
|
||||
|
||||
InputStream pdfStream = new FileInputStream(pdf);
|
||||
|
||||
IOUtils.copy(pdfStream, response.getOutputStream());
|
||||
|
||||
pdfStream.close();
|
||||
docx.delete();
|
||||
pdf.delete();
|
||||
} else {
|
||||
String fileName = "";
|
||||
if (record.getString("reimbursementItemId").equals("3") || record.getString("way").equals("慰问金 (A)")) {
|
||||
fileName = Globals.MyConfig.getString("GxName") + "工会凭证报销单";
|
||||
} else {
|
||||
fileName = Globals.MyConfig.getString("GxName") + "支付凭证";
|
||||
}
|
||||
response.addHeader("Content-Type", "application/octet-stream");
|
||||
response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(fileName.getBytes("UTF-8"), "ISO-8859-1") + "\".docx");
|
||||
XWPFTemplate.compile(inputStream, config).render(record, response.getOutputStream());
|
||||
inputStream.close();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
public void ActExport(String id, HttpServletResponse response, boolean Print) throws Exception {
|
||||
|
||||
NutMap record = reimbursementViService.findOne(id);
|
||||
|
||||
QRCodeWriter qrCodeWriter = new QRCodeWriter();
|
||||
BitMatrix bitMatrix = qrCodeWriter.encode(record.getString("document_no"), BarcodeFormat.QR_CODE, 80, 80);
|
||||
BufferedImage bufferedImage = MatrixToImageWriter.toBufferedImage(bitMatrix);
|
||||
PictureRenderData pictureRenderData = new PictureRenderData(80, 80, ".png", bufferedImage);
|
||||
record.setv("qrcode", pictureRenderData);
|
||||
record.setv("money", record.getString("activity_money"));
|
||||
record.setv("money_big", MoneyUtil.toRMBUpper(record.getString("activity_money")));
|
||||
|
||||
String wtAct = "□文体活动 □慰问 □人员经费 ";
|
||||
if (record.getInt("reimbursementItemId") == 1) {
|
||||
wtAct = wtAct.replace("□文体活动", "√文体活动");
|
||||
} else if (record.getInt("reimbursementItemId") == 3) {
|
||||
wtAct = wtAct.replace("□人员经费", "√人员经费");
|
||||
} else if (record.getInt("reimbursementItemId") == 4) {
|
||||
wtAct = wtAct.replace("□慰问", "√慰问");
|
||||
}
|
||||
record.setv("bxxm", wtAct);
|
||||
|
||||
//自己签字
|
||||
String us = record.getString("us_s");
|
||||
if (Strings.isNotBlank(us)) {
|
||||
record.setv("us", getImg(us));
|
||||
}
|
||||
if (StrUtil.isNotBlank(record.getString("be_sign_text"))) {
|
||||
record.setv("mstext", record.getString("be_sign_text"));
|
||||
}
|
||||
|
||||
//分工会主席
|
||||
Object uai = record.get("uai");
|
||||
if (uai != null) {
|
||||
Audit audit = (Audit) uai;
|
||||
record.setv("uai", audit.getAuditSign() != null ? getImg(audit.getAuditSign()) : null);
|
||||
record.setv("uaiName", StrUtil.isBlank(audit.getAuditSign()) ? audit.getUsername() : "");
|
||||
record.setv("uaiTime", audit.getAuditTime() != null ? DateUtil.formatDate(audit.getAuditTime()) : null);
|
||||
record.setv("uaiOpinion", audit.getAuditOpinion());
|
||||
}
|
||||
|
||||
//书记审核
|
||||
Object usai = record.get("usai");
|
||||
if (usai != null) {
|
||||
Audit audit = (Audit) usai;
|
||||
record.setv("usai", audit.getAuditSign() != null ? getImg(audit.getAuditSign()) : null);
|
||||
record.setv("usaiName", StrUtil.isBlank(audit.getAuditSign()) ? audit.getUsername() : "");
|
||||
record.setv("usaiTime", audit.getAuditTime() != null ? DateUtil.formatDate(audit.getAuditTime()) : null);
|
||||
record.setv("usaiOpinion", audit.getAuditOpinion());
|
||||
}
|
||||
|
||||
//财务
|
||||
Object fai = record.get("fai");
|
||||
if (fai != null) {
|
||||
Audit audit = (Audit) fai;
|
||||
record.setv("fai", audit.getAuditSign() != null ? getImg(audit.getAuditSign()) : null);
|
||||
record.setv("faiName", StrUtil.isBlank(audit.getAuditSign()) ? audit.getUsername() : "");
|
||||
record.setv("faiTime", audit.getAuditTime() != null ? DateUtil.formatDate(audit.getAuditTime()) : null);
|
||||
record.setv("faiOpinion", audit.getAuditOpinion());
|
||||
}
|
||||
|
||||
//工会副主席
|
||||
Object vcai = record.get("vcai");
|
||||
if (vcai != null) {
|
||||
Audit audit = (Audit) vcai;
|
||||
record.setv("vcai", audit.getAuditSign() != null ? getImg(audit.getAuditSign()) : null);
|
||||
record.setv("vcaiName", StrUtil.isBlank(audit.getAuditSign()) ? audit.getUsername() : "");
|
||||
record.setv("vcaiTime", audit.getAuditTime() != null ? DateUtil.formatDate(audit.getAuditTime()) : null);
|
||||
record.setv("vcaiOpinion", audit.getAuditOpinion());
|
||||
}
|
||||
|
||||
//校工会常务副主席
|
||||
Object svcai = record.get("svcai");
|
||||
if (svcai != null) {
|
||||
Audit audit = (Audit) svcai;
|
||||
record.setv("svcai", audit.getAuditSign() != null ? getImg(audit.getAuditSign()) : null);
|
||||
record.setv("svcaiName", StrUtil.isBlank(audit.getAuditSign()) ? audit.getUsername() : "");
|
||||
record.setv("svcaiTime", audit.getAuditTime() != null ? DateUtil.formatDate(audit.getAuditTime()) : null);
|
||||
record.setv("svcaiOpinion", audit.getAuditOpinion());
|
||||
}
|
||||
Configure config = Configure.newBuilder().build();
|
||||
InputStream inputStream;
|
||||
if (record.getString("reimbursementItemId").equals("3") || Strings.isNotBlank(record.getString("way")) || record.getString("way").equals("慰问金 (A)")) {
|
||||
inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("docTemplate/reimbursement/reimbursementMoney.docx");
|
||||
} else {
|
||||
inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("docTemplate/reimbursement/reimbursement.docx");
|
||||
}
|
||||
if (Print) {
|
||||
String uuid = R.UU32();
|
||||
|
||||
File docx = new File(uuid + ".docx");
|
||||
File pdf = new File(uuid + ".pdf");
|
||||
|
||||
OutputStream outputStream = new FileOutputStream(docx);
|
||||
|
||||
XWPFTemplate.compile(inputStream, config).render(record, outputStream);
|
||||
inputStream.close();
|
||||
outputStream.close();
|
||||
|
||||
//打开连接
|
||||
OpenOfficeConnection connection = new SocketOpenOfficeConnection("127.0.0.1", 8100);
|
||||
connection.connect();
|
||||
DocumentConverter converter = new OpenOfficeDocumentConverter(connection);
|
||||
//执行转换
|
||||
converter.convert(docx, pdf);
|
||||
connection.disconnect();
|
||||
|
||||
|
||||
InputStream pdfStream = new FileInputStream(pdf);
|
||||
|
||||
IOUtils.copy(pdfStream, response.getOutputStream());
|
||||
|
||||
pdfStream.close();
|
||||
docx.delete();
|
||||
pdf.delete();
|
||||
} else {
|
||||
String fileName = "";
|
||||
if (record.getString("reimbursementItemId").equals("3") || record.getString("way").equals("慰问金 (A)")) {
|
||||
fileName = Globals.MyConfig.getString("GxName") + "工会凭证报销单";
|
||||
} else {
|
||||
fileName = Globals.MyConfig.getString("GxName") + "支付凭证";
|
||||
}
|
||||
|
||||
response.addHeader("Content-Type", "application/octet-stream");
|
||||
response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(fileName.getBytes("UTF-8"), "ISO-8859-1") + "\".docx");
|
||||
XWPFTemplate.compile(inputStream, config).render(record, response.getOutputStream());
|
||||
inputStream.close();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
public void reiExport(String id, HttpServletResponse response, boolean Print) throws Exception {
|
||||
NutMap record = reimbursementViService.findOne(id);
|
||||
record.setv("schoolName", Globals.MyConfig.getString("GxName"));
|
||||
|
||||
QRCodeWriter qrCodeWriter = new QRCodeWriter();
|
||||
BitMatrix bitMatrix = qrCodeWriter.encode(record.getString("document_no"), BarcodeFormat.QR_CODE, 80, 80);
|
||||
BufferedImage bufferedImage = MatrixToImageWriter.toBufferedImage(bitMatrix);
|
||||
PictureRenderData pictureRenderData = new PictureRenderData(80, 80, ".png", bufferedImage);
|
||||
record.setv("qrcode", pictureRenderData);
|
||||
record.setv("money_big", MoneyUtil.toRMBUpper(record.getString("money")));
|
||||
|
||||
String wtAct = "□慰问 □活动 □建家 □日常 □劳务 □专家";
|
||||
if (record.getString("reimbursementItemId").equals("fyww") || record.getString("reimbursementItemId").equals("zfww")) {
|
||||
wtAct = wtAct.replace("□慰问", "√慰问");
|
||||
} else if (record.getString("reimbursementItemId").equals("fyhd")) {
|
||||
wtAct = wtAct.replace("□活动", "√活动");
|
||||
} else if (record.getString("reimbursementItemId").equals("fyjj")) {
|
||||
wtAct = wtAct.replace("□建家", "√建家");
|
||||
} else if (record.getString("reimbursementItemId").equals("fyrc")) {
|
||||
wtAct = wtAct.replace("□日常", "√日常");
|
||||
} else if (record.getString("reimbursementItemId").equals("zflw")) {
|
||||
wtAct = wtAct.replace("□劳务", "√劳务");
|
||||
} else if (record.getString("reimbursementItemId").equals("zfzj")) {
|
||||
wtAct = wtAct.replace("□专家", "√专家");
|
||||
}
|
||||
|
||||
record.setv("bxxm", wtAct);
|
||||
|
||||
//经办人签字
|
||||
String us = record.getString("jbrSignData");
|
||||
if (Strings.isNotBlank(us)) {
|
||||
record.setv("us", getImg(us));
|
||||
}
|
||||
|
||||
//工会副主席
|
||||
Object accounting = record.get("accounting");
|
||||
if (accounting != null) {
|
||||
Audit audit = (Audit) accounting;
|
||||
record.setv("accSign", audit.getAuditSign() != null ? getImg(audit.getAuditSign()) : null);
|
||||
record.setv("accUserName", StrUtil.isBlank(audit.getUsername()) ? audit.getUsername() : "");
|
||||
record.setv("accTime", audit.getAuditTime() != null ? DateUtil.formatDate(audit.getAuditTime()) : null);
|
||||
record.setv("accOpinion", audit.getAuditOpinion());
|
||||
}
|
||||
|
||||
Configure config = Configure.newBuilder().build();
|
||||
InputStream inputStream;
|
||||
if (record.getString("reimbursementItemSort").equals("zf")) {
|
||||
inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("docTemplate/reimbursement/reimbursementMoney.docx");
|
||||
} else {
|
||||
inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("docTemplate/reimbursement/reimbursement.docx");
|
||||
}
|
||||
if (Print) {
|
||||
String uuid = R.UU32();
|
||||
|
||||
File docx = new File(uuid + ".docx");
|
||||
File pdf = new File(uuid + ".pdf");
|
||||
|
||||
OutputStream outputStream = new FileOutputStream(docx);
|
||||
|
||||
XWPFTemplate.compile(inputStream, config).render(record, outputStream);
|
||||
inputStream.close();
|
||||
outputStream.close();
|
||||
|
||||
//打开连接
|
||||
OpenOfficeConnection connection = new SocketOpenOfficeConnection("127.0.0.1", 8100);
|
||||
connection.connect();
|
||||
DocumentConverter converter = new OpenOfficeDocumentConverter(connection);
|
||||
//执行转换
|
||||
converter.convert(docx, pdf);
|
||||
connection.disconnect();
|
||||
|
||||
|
||||
InputStream pdfStream = new FileInputStream(pdf);
|
||||
|
||||
IOUtils.copy(pdfStream, response.getOutputStream());
|
||||
|
||||
pdfStream.close();
|
||||
docx.delete();
|
||||
pdf.delete();
|
||||
} else {
|
||||
String fileName = "";
|
||||
if (record.getString("reimbursementItemSort").equals("zf")) {
|
||||
fileName = Globals.MyConfig.getString("GxName") + "支付凭证";
|
||||
} else {
|
||||
fileName = Globals.MyConfig.getString("GxName") + "工会凭证报销单";
|
||||
}
|
||||
|
||||
response.addHeader("Content-Type", "application/octet-stream");
|
||||
response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(fileName.getBytes("UTF-8"), "ISO-8859-1") + "\".docx");
|
||||
XWPFTemplate.compile(inputStream, config).render(record, response.getOutputStream());
|
||||
inputStream.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@At()
|
||||
@Ok("void")
|
||||
public void doExportUserExcel(HttpServletResponse response, String reiItemId, String unitId, String unionId, String searchKeyword, String searchName, String[] reimbursementDate) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
rei.*,
|
||||
be.username be_username,
|
||||
state.stateName,
|
||||
state.stateColor
|
||||
FROM
|
||||
`reimbursement_new` rei
|
||||
LEFT JOIN sys_user be ON be.id = rei.be_user
|
||||
LEFT JOIN audit_state state ON state.stateId = rei.state
|
||||
$condition
|
||||
""");
|
||||
CndPlus cnd = CndPlus.create();
|
||||
|
||||
Vi.cndPlus(cnd, "rei.reimbursementItemId", "=", reiItemId);
|
||||
if (Lang.isNotEmpty(reimbursementDate)) {
|
||||
Vi.cndPlus(cnd, "rei.applyTime", ">=", reimbursementDate[0]);
|
||||
Vi.cndPlus(cnd, "rei.applyTime", "<=", reimbursementDate[1]);
|
||||
}
|
||||
Vi.cndPlus(cnd, "rei.unitId", "=", unitId);
|
||||
Vi.cndPlus(cnd, "rei.unionId", "=", unionId);
|
||||
if (Vi.isNotBlank(searchName, searchKeyword)) {
|
||||
cnd.where().andLike(searchName, searchKeyword);
|
||||
}
|
||||
cnd.desc("rei.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> mapList = reimbursementViService.listMap(sql);
|
||||
mapList.forEach(v -> {
|
||||
v.setv("description", Strings.isNotBlank(v.getString("activity_name")) ? ("活动名称:" + v.getString("activity_name")) : ("被慰问人:" + v.getString("be_username")));
|
||||
});
|
||||
List<ExcelExportEntity> exportEntities = new ArrayList<>();
|
||||
exportEntities.add(new ExcelExportEntity("经办人工号", "loginName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("姓名", "userName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("所属工会", "unionName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("所属单位", "unitName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("申请时间", "applyTime", 20));
|
||||
exportEntities.add(new ExcelExportEntity("报销项目", "reimbursementItemName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("备注", "description", 20));
|
||||
exportEntities.add(new ExcelExportEntity("金额(元)", "money", 20));
|
||||
|
||||
try {
|
||||
ViTool.excelResponse(response, "报销汇总表.xlsx");
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, exportEntities, mapList);
|
||||
workbook.write(response.getOutputStream());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
package io.v.nutz.reimbursement.controller;
|
||||
|
||||
import io.v.nutz.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.dao.CndPlus;
|
||||
import io.v.nutz.jf.model.ActivityBx;
|
||||
import io.v.nutz.jf.service.ActivityBxService;
|
||||
import io.v.nutz.modules.models.Audit;
|
||||
import io.v.nutz.modules.models.PageForm;
|
||||
import io.v.nutz.modules.models.Review;
|
||||
import io.v.nutz.modules.services.AuditService;
|
||||
import io.v.nutz.modules.services.ReviewService;
|
||||
import io.v.nutz.reimbursement.constants.ReimbursementState;
|
||||
import io.v.nutz.reimbursement.models.Reimbursement;
|
||||
import io.v.nutz.service.ViService;
|
||||
import io.v.nutz.sys.services.SysSignatureService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zgfw.model.condolence.Condolence;
|
||||
import io.v.nutz.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 java.util.Date;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2021/6/7 16:58
|
||||
* @description 常务副主席审核
|
||||
*/
|
||||
|
||||
@At("/platform/reimbursement/StandingViceChairman")
|
||||
@IocBean
|
||||
@RequiresAuthentication
|
||||
@Ok("json")
|
||||
public class StandingViceChairmanController {
|
||||
|
||||
|
||||
@Inject("Reimbursement")
|
||||
private ViService<Reimbursement> reimbursementViService;
|
||||
|
||||
@Inject
|
||||
private ActivityBxService activityBxService;
|
||||
|
||||
@Inject
|
||||
private SysSignatureService sysSignatureService;
|
||||
|
||||
@Inject
|
||||
private AuditService auditService;
|
||||
|
||||
@Inject
|
||||
private ReviewService reviewService;
|
||||
|
||||
@Inject
|
||||
private CondolenceService condolenceService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/reimbursement/StandingViceChairman.html")
|
||||
@RequiresPermissions("reimbursement.StandingViceChairman")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object pageData(boolean isAudit, PageForm page, String unitId, Integer year, String unionId, Integer reiItemId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
rei.*,
|
||||
us.unionname,
|
||||
state.stateColor,
|
||||
state.stateName
|
||||
FROM
|
||||
`reimbursement` rei
|
||||
LEFT JOIN `user` us ON us.id = rei.userid
|
||||
LEFT JOIN condolence con ON con.id = rei.reimbursementId
|
||||
LEFT JOIN activity_bx bx ON bx.id = rei.reimbursementId
|
||||
LEFT JOIN audit_state state ON rei.State = state.stateId $condition
|
||||
""");
|
||||
CndPlus cnd = CndPlus.create();
|
||||
cnd.and("rei.State", isAudit ? ">" : "=", ReimbursementState.STANDING_VICE_CHAIRMAN);
|
||||
|
||||
Vi.cndPlus(cnd, "rei.reimbursementItemId", "=", reiItemId);
|
||||
Vi.cndPlus(cnd, "YEAR(rei.applyTime)", "=", year);
|
||||
Vi.cndPlus(cnd, "us.unitid", "=", unitId);
|
||||
Vi.cndPlus(cnd, "us.unionid", "=", unionId);
|
||||
|
||||
if (Vi.isNotBlank(page.getSearchName(), page.getSearchKeyword())) {
|
||||
cnd.where().andLike(page.getSearchName(), page.getSearchKeyword());
|
||||
}
|
||||
cnd.desc("rei.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
return reimbursementViService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object doReview(String id, Boolean flag, Audit audit, Review review, Integer reimbursementItemId) {
|
||||
|
||||
|
||||
if (reimbursementItemId != 4) {
|
||||
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
|
||||
audit.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
|
||||
audit.setAuditTime(new Date());
|
||||
audit = auditService.insert(audit);
|
||||
ActivityBx aid = activityBxService.fetch(id);
|
||||
aid.setStanding_vice_chairman_audit_id(audit.getId());
|
||||
aid.setState_id(flag ? "3100" : "3095");
|
||||
activityBxService.updateIgnoreNull(aid);
|
||||
} else {
|
||||
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(flag ? "3100" : "3095");
|
||||
condolenceService.updateIgnoreNull(condolence);
|
||||
}
|
||||
Reimbursement reimbursement = reimbursementViService.fetch(Cnd.where("reimbursementId", "=", id));
|
||||
reimbursement.setState(flag ? ReimbursementState.SUCCESSFUL_REIMBURSEMENT : ReimbursementState.STANDING_VICE_CHAIRMAN_FAIL);
|
||||
|
||||
reimbursementViService.updateIgnoreNull(reimbursement);
|
||||
return null;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package io.v.nutz.reimbursement.controller;
|
||||
|
||||
import io.v.nutz.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.jf.model.ActivityBx;
|
||||
import io.v.nutz.jf.service.ActivityBxService;
|
||||
import io.v.nutz.reimbursement.constants.ReimbursementState;
|
||||
import io.v.nutz.reimbursement.models.Reimbursement;
|
||||
import io.v.nutz.service.ViService;
|
||||
import io.v.nutz.sys.models.Sys_signature;
|
||||
import io.v.nutz.sys.services.SysSignatureService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
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.Calendar;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2021/6/2 10:13
|
||||
* @description
|
||||
*/
|
||||
@At("/reimbursement/StyleActivity/apply")
|
||||
@Ok("json:full")
|
||||
@IocBean
|
||||
@RequiresAuthentication
|
||||
public class StyleActivityController {
|
||||
|
||||
|
||||
@Inject
|
||||
private ActivityBxService activityBxService;
|
||||
|
||||
@Inject
|
||||
private SysSignatureService sysSignatureService;
|
||||
|
||||
@Inject("Reimbursement")
|
||||
private ViService<Reimbursement> reimbursementViService;
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object doAdd(@Param("data") ActivityBx activityBx, String sign, @Param("data") Reimbursement reimbursement) {
|
||||
|
||||
activityBx.setYear(Calendar.getInstance().get(Calendar.YEAR));
|
||||
activityBx.setApply_time(reimbursement.getApplyTime());
|
||||
activityBx.setUser_id(reimbursement.getUserId());
|
||||
activityBx.setUser_name(reimbursement.getUserName());
|
||||
if (reimbursement.getReimbursementItemId() == 1 && activityBx.getActivity_type().equals(2)) {
|
||||
activityBx.setState_id("3070");
|
||||
reimbursement.setState(ReimbursementState.FINANCE);
|
||||
activityBx.setActivity_type(2);
|
||||
} else if (reimbursement.getReimbursementItemId() == 1 && activityBx.getActivity_type().equals(3)) {
|
||||
activityBx.setState_id("3050");
|
||||
reimbursement.setState(ReimbursementState.UNION);
|
||||
activityBx.setActivity_type(3);
|
||||
} else {
|
||||
activityBx.setState_id("3050");
|
||||
reimbursement.setState(ReimbursementState.UNION);
|
||||
activityBx.setActivity_type(reimbursement.getReimbursementItemId() == 1 ? 1 : 0);
|
||||
}
|
||||
activityBx.setApply_time(DateUtil.getDate());
|
||||
activityBx.setUser_id(ShiroUtil.getPrincipalProperty("id").toString());
|
||||
if (Strings.isNotBlank(sign)) {
|
||||
activityBx.setUser_signature(sysSignatureService.insert(new Sys_signature(sign)).getId());
|
||||
}
|
||||
activityBx.setState_id("3043");
|
||||
reimbursement.setState(ReimbursementState.AUDIT_CONFIRM);
|
||||
activityBxService.insert(activityBx);
|
||||
reimbursement.setReimbursementId(activityBx.getId());
|
||||
reimbursementViService.insert(reimbursement);
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package io.v.nutz.reimbursement.controller;
|
||||
|
||||
import io.v.nutz.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.dao.CndPlus;
|
||||
import io.v.nutz.jf.model.ActivityBx;
|
||||
import io.v.nutz.jf.service.ActivityBxService;
|
||||
import io.v.nutz.modules.models.Audit;
|
||||
import io.v.nutz.modules.models.PageForm;
|
||||
import io.v.nutz.modules.models.Review;
|
||||
import io.v.nutz.modules.services.AuditService;
|
||||
import io.v.nutz.modules.services.ReviewService;
|
||||
import io.v.nutz.reimbursement.constants.ReimbursementState;
|
||||
import io.v.nutz.reimbursement.models.Reimbursement;
|
||||
import io.v.nutz.service.ViService;
|
||||
import io.v.nutz.sys.services.SysSignatureService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zgfw.model.condolence.Condolence;
|
||||
import io.v.nutz.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 java.util.Date;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2021/6/7 15:27
|
||||
* @description 分管副主席
|
||||
*/
|
||||
@At("/platform/reimbursement/ViceChairman")
|
||||
@IocBean
|
||||
@RequiresAuthentication
|
||||
@Ok("json")
|
||||
public class ViceChairmanController {
|
||||
|
||||
|
||||
@Inject("Reimbursement")
|
||||
private ViService<Reimbursement> reimbursementViService;
|
||||
|
||||
@Inject
|
||||
private ActivityBxService activityBxService;
|
||||
|
||||
@Inject
|
||||
private SysSignatureService sysSignatureService;
|
||||
|
||||
@Inject
|
||||
private AuditService auditService;
|
||||
|
||||
@Inject
|
||||
private ReviewService reviewService;
|
||||
|
||||
@Inject
|
||||
private CondolenceService condolenceService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/reimbursement/ViceChairman.html")
|
||||
@RequiresPermissions("reimbursement.ViceChairman")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object pageData(boolean isAudit, PageForm page, Integer year, String unitId, String unionId, Integer reiItemId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
rei.*,
|
||||
us.unionname,
|
||||
state.stateColor,
|
||||
state.stateName
|
||||
FROM
|
||||
`reimbursement` rei
|
||||
LEFT JOIN `user` us ON us.id = rei.userid
|
||||
LEFT JOIN condolence con ON con.id = rei.reimbursementId
|
||||
LEFT JOIN activity_bx bx ON bx.id = rei.reimbursementId
|
||||
LEFT JOIN audit_state state ON rei.State = state.stateId $condition
|
||||
""");
|
||||
CndPlus cnd = CndPlus.create();
|
||||
cnd.and("rei.State", isAudit ? ">" : "=", ReimbursementState.VICE_CHAIRMAN);
|
||||
|
||||
Vi.cndPlus(cnd, "rei.reimbursementItemId", "=", reiItemId);
|
||||
Vi.cndPlus(cnd, "YEAR(rei.applyTime)", "=", year);
|
||||
Vi.cndPlus(cnd, "us.unitid", "=", unitId);
|
||||
Vi.cndPlus(cnd, "us.unionid", "=", unionId);
|
||||
cnd.desc("rei.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
return reimbursementViService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object doReview(String id, Boolean flag, Audit audit, Review review, Integer reimbursementItemId) {
|
||||
|
||||
|
||||
if (reimbursementItemId != 4) {
|
||||
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
|
||||
audit.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
|
||||
audit.setAuditTime(new Date());
|
||||
audit = auditService.insert(audit);
|
||||
ActivityBx aid = activityBxService.fetch(id);
|
||||
aid.setVice_chairman_audit_id(audit.getId());
|
||||
aid.setState_id(flag ? "3090" : "3085");
|
||||
activityBxService.updateIgnoreNull(aid);
|
||||
} else {
|
||||
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());
|
||||
condolence.setState_id(flag ? "3090" : "3085");
|
||||
condolenceService.updateIgnoreNull(condolence);
|
||||
}
|
||||
Reimbursement reimbursement = reimbursementViService.fetch(Cnd.where("reimbursementId", "=", id));
|
||||
reimbursement.setState(flag ? ReimbursementState.STANDING_VICE_CHAIRMAN : ReimbursementState.VICE_CHAIRMAN_FAIL);
|
||||
|
||||
reimbursementViService.updateIgnoreNull(reimbursement);
|
||||
return null;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package io.v.nutz.reimbursement.controller;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2021/6/1 14:32
|
||||
* @description
|
||||
*/
|
||||
@At("/platform/reimbursement/apply")
|
||||
@Ok("json:full")
|
||||
@IocBean
|
||||
@RequiresAuthentication
|
||||
public class apply {
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/reimbursement/apply.html")
|
||||
@RequiresPermissions("reimbursement.apply")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
package io.v.nutz.reimbursement.controller;
|
||||
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.annontation.ViReturn;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.Roles;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.jf.model.jf_club;
|
||||
import io.v.nutz.jf.model.jf_school;
|
||||
import io.v.nutz.jf.model.jf_yjgh;
|
||||
import io.v.nutz.reimbursement.constants.ReimbursementState;
|
||||
import io.v.nutz.reimbursement.models.ReimbursementNew;
|
||||
import io.v.nutz.sys.models.Sys_club_user;
|
||||
import io.v.nutz.util.ShiroUtil;
|
||||
import io.v.nutz.web.commons.slog.annotation.SLog;
|
||||
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.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*
|
||||
* @Author zhf 报销新
|
||||
* @Date 2022/7/21 9:20
|
||||
*/
|
||||
|
||||
@At("/platform/reimbursement/applyNew")
|
||||
@Ok("json:full")
|
||||
@IocBean
|
||||
@RequiresAuthentication
|
||||
public class applyNewController {
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/reimbursement/applyNew.html")
|
||||
@RequiresPermissions("reimbursement.applyNew")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresAuthentication
|
||||
@SLog(tag = "工会报销", msg = "新增一条记录", param = true, result = true)
|
||||
public Object doAdd(@Param("data") ReimbursementNew reimbursementNew) {
|
||||
reimbursementNew.setUserId(ShiroUtil.getUserId());
|
||||
reimbursementNew.setUnitId(ShiroUtil.getUnitId());
|
||||
reimbursementNew.setUnionId(Vi.getUnionId());
|
||||
reimbursementNew.setState(ReimbursementState.AUDIT_CONFIRM);
|
||||
reimbursementNew.setApplyTime(DateUtil.getDateTime());
|
||||
baseService.insert(reimbursementNew);
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.loginname
|
||||
FROM
|
||||
sys_user_role role
|
||||
LEFT JOIN sys_user u ON u.id = role.userId
|
||||
WHERE
|
||||
role.roleId = @kj
|
||||
""").setParam("kj", Roles.XGHKJ);
|
||||
List<NutMap> list = baseService.listMap(sql);
|
||||
list.forEach(v -> {
|
||||
// msgApi.sendWxMsg("%s(%s)提交了一条报销申请待您审核,请前往智慧工会查看!".formatted(reimbursementNew.getUserName(), reimbursementNew.getLoginName()), v.getString("loginname"));
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresAuthentication
|
||||
public Object findOne(String id) {
|
||||
ReimbursementNew fetch = baseService.dao().fetch(ReimbursementNew.class, id);
|
||||
return fetch;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresAuthentication
|
||||
@SLog(tag = "工会报销", msg = "编辑一条记录", param = true, result = true)
|
||||
public Object doEdit(@Param("data") ReimbursementNew reimbursementNew) {
|
||||
if (reimbursementNew.getState().equals(ReimbursementState.MODIFY)) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.loginname
|
||||
FROM
|
||||
sys_user_role role
|
||||
LEFT JOIN sys_user u ON u.id = role.userId
|
||||
WHERE
|
||||
role.roleId = @kj
|
||||
""").setParam("kj", Roles.XGHKJ);
|
||||
List<NutMap> list = baseService.listMap(sql);
|
||||
list.forEach(v -> {
|
||||
// msgApi.sendWxMsg("%s(%s)提交了一条报销申请待您审核,请前往智慧工会查看!".formatted(reimbursementNew.getUserName(), reimbursementNew.getLoginName()), v.getString("loginname"));
|
||||
});
|
||||
}
|
||||
reimbursementNew.setState(ReimbursementState.AUDIT_CONFIRM);
|
||||
baseService.updateIgnoreNull(reimbursementNew);
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@RequiresAuthentication
|
||||
public Object getBalance() {
|
||||
jf_yjgh yjgh = baseService.dao().fetch(jf_yjgh.class, Cnd.where("unionId", "=", Vi.getUnionId()).and("year", "=", DateUtil.getYear()).and("state", "=", 1));
|
||||
if (yjgh != null) {
|
||||
double balance = yjgh.getTotalQuota() - yjgh.getUsedQuota();
|
||||
return Result.success(balance);
|
||||
}
|
||||
return Result.success(0f);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@RequiresAuthentication
|
||||
public Object getSchoolBudget() {
|
||||
jf_school jfSchool = baseService.dao().fetch(jf_school.class, Cnd.where("year", "=", DateUtil.getYear()).and("state", "=", 1));
|
||||
if (jfSchool != null) {
|
||||
double balance = jfSchool.getTotalQuota() - jfSchool.getUsedQuota();
|
||||
return Result.success(balance);
|
||||
}
|
||||
return Result.success(0f);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@RequiresAuthentication
|
||||
public Object getClubBudget() {
|
||||
Sys_club_user clubUser = baseService.dao().fetch(Sys_club_user.class, Cnd.where("userid", "=", ShiroUtil.getUserId()));
|
||||
if (clubUser == null) {
|
||||
return Result.success(0f);
|
||||
}
|
||||
jf_club jf_club = baseService.dao().fetch(jf_club.class, Cnd.where("year", "=", DateUtil.getYear()).and("state", "=", 1).and("club_id", "=", clubUser.getClubid()));
|
||||
if (jf_club != null) {
|
||||
double balance = jf_club.getTotal_quota() - jf_club.getUsed_quota();
|
||||
return Result.success(balance);
|
||||
}
|
||||
return Result.success(0f);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package io.v.nutz.reimbursement.models;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2021/5/31 15:32
|
||||
* @description 工会报销
|
||||
*/
|
||||
@Data
|
||||
@Table("reimbursement")
|
||||
public class Reimbursement {
|
||||
|
||||
|
||||
@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 reimbursementId;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("经办人id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userId;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("经办人姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userName;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String loginName;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("单位")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String unitName;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("电话")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String mobile;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("报销项目Id(1.文体活动,2.日常活动,3.其它活动,4.慰问,5困难帮扶)")
|
||||
@ColDefine(type = ColType.INT, width = 2)
|
||||
private Integer reimbursementItemId;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("报销项目名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
private String reimbursementItemName;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("状态")
|
||||
@ColDefine(type = ColType.INT, width = 10)
|
||||
private Integer State;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("申请时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String applyTime;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("付款人Id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String payerId;
|
||||
|
||||
@Column
|
||||
@Comment("支付方式Id")
|
||||
@ColDefine(type = ColType.INT, width = 2)
|
||||
private Integer paymentMethodId;
|
||||
|
||||
@Column
|
||||
@Comment("支付方式名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String paymentMethodName;
|
||||
|
||||
@Column
|
||||
@Comment("户名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String bankUserName;
|
||||
|
||||
@Column
|
||||
@Comment("账号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String bankCardNumber;
|
||||
|
||||
@Column
|
||||
@Comment("开户行")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String bankOfDeposit;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,297 @@
|
||||
package io.v.nutz.reimbursement.models;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*
|
||||
* @Author zhf 报销新表
|
||||
* @Date 2022/7/21 11:29
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Table
|
||||
public class ReimbursementNew {
|
||||
|
||||
@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 = 32)
|
||||
private String userName;
|
||||
|
||||
@Column
|
||||
@Comment("经办人电话")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String mobile;
|
||||
|
||||
@Column
|
||||
@Comment("工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String loginName;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("单位")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String unitName;
|
||||
|
||||
@Column
|
||||
@Comment("单位id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unitId;
|
||||
|
||||
@Column
|
||||
@Comment("工会")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String unionName;
|
||||
|
||||
@Column
|
||||
@Comment("工会id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionId;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("慰问人电话")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String conMobile;
|
||||
|
||||
@Column
|
||||
@Comment("报销类别")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
private String reimbursementItemSort;
|
||||
|
||||
@Column
|
||||
@Comment("报销项目")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
private String reimbursementItemId;
|
||||
|
||||
@Column
|
||||
@Comment("报销项目名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
private String reimbursementItemName;
|
||||
|
||||
@Column
|
||||
@Comment("状态")
|
||||
@ColDefine(type = ColType.INT, width = 10)
|
||||
private Integer State;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("申请时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String applyTime;
|
||||
|
||||
@Column
|
||||
@Comment("支付方式Id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
private String paymentMethodId;
|
||||
|
||||
@Column
|
||||
@Comment("支付方式名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String paymentMethodName;
|
||||
|
||||
@Column
|
||||
@Comment("户名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String bankUserName;
|
||||
|
||||
@Column
|
||||
@Comment("账号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String bankCardNumber;
|
||||
|
||||
@Column
|
||||
@Comment("开户行")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String bankOfDeposit;
|
||||
|
||||
@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.MYSQL_JSON)
|
||||
private List<Sys_file> files;
|
||||
|
||||
@Column
|
||||
@Comment("经办人签字id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String signId;
|
||||
|
||||
@Column
|
||||
@Comment("会计审核id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String accountingAuditId;
|
||||
|
||||
@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 = 32)
|
||||
private String be_user;
|
||||
|
||||
@Column
|
||||
@Comment("慰问类型")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String type;
|
||||
|
||||
@Column
|
||||
@Comment("性别")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String sex;
|
||||
|
||||
@Column
|
||||
@Comment("生日")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String birthday;
|
||||
|
||||
@Column
|
||||
@Comment("身份证号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String idCard;
|
||||
|
||||
@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 = 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 = 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 dead_gx;
|
||||
|
||||
|
||||
/**
|
||||
* 活动
|
||||
*/
|
||||
|
||||
@Column
|
||||
@Comment("活动时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String activity_time;
|
||||
|
||||
@Column
|
||||
@Comment("活动地点")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String venue;
|
||||
|
||||
@Column
|
||||
@Comment("活动名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String activity_name;
|
||||
|
||||
@Column
|
||||
@Comment("活动人数")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String activity_number;
|
||||
|
||||
@Column
|
||||
@Comment("活动类型(1.基层工会,2.校工会,3.社团)")
|
||||
@ColDefine(type = ColType.INT, width = 2)
|
||||
private Integer activity_type;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package io.v.nutz.reimbursement.services;
|
||||
|
||||
import io.v.nutz.reimbursement.models.Reimbursement;
|
||||
import io.v.nutz.service.ViService;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2021/6/3 10:16
|
||||
* @description
|
||||
*/
|
||||
public interface ReimbursementService extends ViService<Reimbursement> {
|
||||
|
||||
NutMap findOne(String id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package io.v.nutz.reimbursement.services.impl;
|
||||
|
||||
import io.v.nutz.modules.services.AuditService;
|
||||
import io.v.nutz.reimbursement.models.Reimbursement;
|
||||
import io.v.nutz.reimbursement.services.ReimbursementService;
|
||||
import io.v.nutz.service.impl.ViServiceImpl;
|
||||
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.lang.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2021/6/3 10:17
|
||||
* @description
|
||||
*/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class ReimbursementServiceImpl extends ViServiceImpl<Reimbursement> implements ReimbursementService {
|
||||
@Inject
|
||||
private AuditService auditService;
|
||||
|
||||
public ReimbursementServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NutMap findOne(String id) {
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
rei.*,
|
||||
be.username be_username,
|
||||
be.loginname be_loginname,
|
||||
state.stateName,
|
||||
state.stateColor,
|
||||
type.`name` typeName,
|
||||
type.`code` typeCode,
|
||||
sign.`data` jbrSignData
|
||||
FROM
|
||||
`reimbursement_new` rei
|
||||
LEFT JOIN sys_user be ON be.id = rei.be_user
|
||||
LEFT JOIN audit_state state ON state.stateId = rei.state
|
||||
LEFT JOIN sys_signature sign ON sign.id = rei.signId
|
||||
LEFT JOIN condolence_type type ON type.id=rei.type
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("rei.id", "=", id);
|
||||
sql.setCondition(cnd);
|
||||
NutMap record = listMap(sql).get(0);
|
||||
|
||||
if (Strings.isNotBlank(record.getString("accountingAuditId"))) {
|
||||
record.setv("accounting", auditService.fetch(record.getString("accountingAuditId")));
|
||||
}
|
||||
|
||||
|
||||
return record;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user