commit
This commit is contained in:
@@ -53,6 +53,7 @@ public interface SourceData {
|
||||
put("XBM", new String[]{"sex"});// 性别码
|
||||
put("MZMC", new String[]{"nation"});// 民族码
|
||||
put("SJ", new String[]{"mobile"}); // 手机号
|
||||
put("SFZJH", new String[]{"idcard"}); // 身份证件号
|
||||
put("ZZMMM", new String[]{"political"}); // 政治面貌码
|
||||
put("DQZTM", new String[]{"userState", "personalStatus"}); // 在职状态码
|
||||
put("RYFLMC", new String[]{"personType"}); // 人员类型码
|
||||
|
||||
@@ -189,7 +189,7 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
|
||||
//不更新会员和福利会员字段
|
||||
source.setMember(null);
|
||||
source.setWelfareMember(null);
|
||||
Sys_user user = userMap.get(source.getLoginname().toLowerCase());
|
||||
Sys_user user = userMap.get(source.getLoginname());
|
||||
|
||||
if (user != null && userIds.contains(user.getId())) {
|
||||
continue;
|
||||
|
||||
@@ -52,6 +52,8 @@ import java.math.RoundingMode;
|
||||
import java.util.Base64;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
@@ -66,16 +68,14 @@ public class ReimbursementCon {
|
||||
|
||||
@Inject
|
||||
private Vi vi;
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private ActivityBxService activityBxService;
|
||||
|
||||
@Inject
|
||||
private SysSignatureService sysSignatureService;
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@Inject
|
||||
private FtpService ftpService;
|
||||
|
||||
@@ -194,14 +194,6 @@ public class ReimbursementCon {
|
||||
}
|
||||
|
||||
activityBxService.update(activityBx);
|
||||
|
||||
if (Lang.isNotEmpty(activityBx.getGoods())) {
|
||||
baseService.dao().clear(Goods.class, Cnd.where("reid", "=", activityBx.getActivity_id()));
|
||||
activityBx.getGoods().forEach(v -> {
|
||||
v.setReid(activityBx.getActivity_id());
|
||||
});
|
||||
baseService.dao().insert(activityBx.getGoods());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -227,7 +219,32 @@ public class ReimbursementCon {
|
||||
@ViReturn
|
||||
public void doExport(String id, HttpServletResponse response) throws Exception {
|
||||
NutMap one = activityBxService.queryOne(id);
|
||||
if (StrUtil.isNotBlank(one.getString("activity_content"))) {
|
||||
ActivityBx fetch = dao.fetch(ActivityBx.class, id);
|
||||
|
||||
List<ActivityBx.Budget> budgets = fetch.getBudgets();
|
||||
|
||||
Map<String, List<ActivityBx.Budget>> map = budgets.stream().collect(Collectors.groupingBy(ActivityBx.Budget::getCategory));
|
||||
|
||||
map.forEach((k, v) -> {
|
||||
NutMap result = NutMap.NEW();
|
||||
result.put("unitName", fetch.getFundsUnitName());
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
String fileName = Globals.schoolName + "【" + one.getString("activity_name") + "】报销凭证";
|
||||
|
||||
HackLoopTableRenderPolicy policy = new HackLoopTableRenderPolicy();
|
||||
Configure config = Configure.newBuilder().bind("goods", policy).build();
|
||||
|
||||
InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("docTemplate/funds3.docx");
|
||||
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(one, response.getOutputStream());
|
||||
inputStream.close();
|
||||
|
||||
/* if (StrUtil.isNotBlank(one.getString("activity_content"))) {
|
||||
one.setv("activity_content", Html2Text.getContent(one.getString("activity_content")));
|
||||
}
|
||||
one.setv("money_big", Convert.digitToChinese(one.getDouble("activity_money")));
|
||||
@@ -272,29 +289,29 @@ public class ReimbursementCon {
|
||||
one.setv("nine", (hundredths % 10) + 1);
|
||||
|
||||
|
||||
/*基层工会主席签字*/
|
||||
*//*基层工会主席签字*//*
|
||||
if (one.get("reimbursement_union_audit") != null) {
|
||||
Audit reimbursementUnionChairman = one.getAs("reimbursement_union_audit", Audit.class);
|
||||
one.setv("dc_sign", getImage(reimbursementUnionChairman.getAuditSign()));
|
||||
}
|
||||
|
||||
/*协会负责人*/
|
||||
*//*协会负责人*//*
|
||||
if (one.get("reimbursement_club_audit") != null) {
|
||||
Audit reimbursementClubChairman = one.getAs("reimbursement_club_audit", Audit.class);
|
||||
one.setv("ap_sign", getImage(reimbursementClubChairman.getAuditSign()));
|
||||
}
|
||||
|
||||
/*校工会主席签字*/
|
||||
*//*校工会主席签字*//*
|
||||
if (one.get("reimbursement_school_chairman") != null) {
|
||||
Audit reimbursementSchoolChairman = one.getAs("reimbursement_school_chairman", Audit.class);
|
||||
one.setv("ucc_sign", getImage(reimbursementSchoolChairman.getAuditSign()));
|
||||
}
|
||||
|
||||
/*会计*/
|
||||
*//*会计*//*
|
||||
if (one.get("user_signature") != null) {
|
||||
Sys_signature sysSignature = sysSignatureService.dao().fetch(Sys_signature.class, Cnd.where("id", "=", one.getString("user_signature")));
|
||||
one.setv("a_sign", getImage(sysSignature.getData()));
|
||||
}
|
||||
}*/
|
||||
|
||||
/*
|
||||
// 基层工会活动
|
||||
@@ -313,17 +330,6 @@ public class ReimbursementCon {
|
||||
inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("docTemplate/association.docx");
|
||||
}
|
||||
*/
|
||||
|
||||
String fileName = Globals.schoolName + "【" + one.getString("activity_name") + "】报销凭证";
|
||||
|
||||
HackLoopTableRenderPolicy policy = new HackLoopTableRenderPolicy();
|
||||
Configure config = Configure.newBuilder().bind("goods", policy).build();
|
||||
|
||||
InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("docTemplate/funds3.docx");
|
||||
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(one, response.getOutputStream());
|
||||
inputStream.close();
|
||||
}
|
||||
|
||||
private PictureRenderData getImage(String base64) throws IOException {
|
||||
|
||||
@@ -142,7 +142,6 @@ public class UnionCon {
|
||||
aid.setUnion_chairman_idea(nutMap.getString("idea"));
|
||||
aid.setActivity_money(nutMap.getDouble("activity_money"));
|
||||
List<Goods> goods = nutMap.getAsList("goods", Goods.class);
|
||||
aid.setGoods(goods);
|
||||
|
||||
if (Strings.isNotBlank(nutMap.getString("sign"))) {
|
||||
aid.setUnion_chairman(sysSignatureService.insert(new Sys_signature(nutMap.getString("sign"))).getId());
|
||||
|
||||
+40
-26
@@ -66,31 +66,22 @@ public class ActivityReimbursementApplyController {
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.jf.reimbursement.apply")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Object doSave(@Param("activityBx") ActivityBx activityBx, @Param(value = "sign", required = false) String sign) {
|
||||
if (Strings.isNotBlank(sign)) {
|
||||
activityBx.setUser_signature(sysSignatureService.insert(new Sys_signature(sign)).getId());
|
||||
}
|
||||
public Object doSave(@Param("activityBx") ActivityBx activityBx) {
|
||||
this.setEntityValue(activityBx);
|
||||
activityBx.setReimbursement_state_id(999);
|
||||
activityBxService.insertOrUpdate(activityBx);
|
||||
return null;
|
||||
}
|
||||
|
||||
private void setEntityValue(ActivityBx activityBx) {
|
||||
int count = activityBxService.count(Cnd.where("id", "=", activityBx.getId()));
|
||||
// int count = activityBxService.count(Cnd.where("id", "=", activityBx.getId()));
|
||||
|
||||
activityBx.setReimbursement_state_id(999);
|
||||
ActivityTissue tissue = dao.fetch(ActivityTissue.class, activityBx.getActivity_id());
|
||||
// ActivityTissue tissue = dao.fetch(ActivityTissue.class, activityBx.getActivity_id());
|
||||
activityBx.setApply_time(DateUtil.now());
|
||||
activityBx.setReimbursement_apply_time(DateUtil.now());
|
||||
activityBx.setUser_id(ShiroUtil.getUserId());
|
||||
activityBx.setYear(DateUtil.year(DateUtil.parseDate(tissue.getApplyTime())));
|
||||
activityBx.setActivity_name(tissue.getName());
|
||||
activityBx.setYear(DateUtil.thisYear());
|
||||
activityBx.setUser_name(ShiroUtil.getPlatformUsername());
|
||||
activityBx.setActivity_type(tissue.getType());
|
||||
activityBx.setProjectTypeCode(tissue.getProjectTypeCode());
|
||||
activityBx.setMobile(tissue.getMobile());
|
||||
activityBx.setProjectCode(tissue.getActivityCode());
|
||||
activityBx.setActivity_content(tissue.getActivityContent());
|
||||
|
||||
List<ActivityBx.Budget> budgets = activityBx.getBudgets();
|
||||
double sum = budgets.stream().mapToDouble(ActivityBx.Budget::getActualPrice).sum();
|
||||
@@ -99,25 +90,40 @@ public class ActivityReimbursementApplyController {
|
||||
activityBx.setReimbursement_apply_time(DateUtil.today());
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(activityBx.getId()) && count > 0) {
|
||||
activityBx.setFiles(null);
|
||||
activityBx.setActivity_content(null);
|
||||
}
|
||||
// if (StrUtil.isNotBlank(activityBx.getId()) && count > 0) {
|
||||
// activityBx.setFiles(null);
|
||||
// activityBx.setActivity_content(null);
|
||||
// }
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.jf.reimbursement.apply")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Object doEdit(@Param("activityBx") ActivityBx activityBx, @Param(value = "sign", required = false) String sign) {
|
||||
if (Strings.isNotBlank(sign)) {
|
||||
activityBx.setUser_signature(sysSignatureService.insert(new Sys_signature(sign)).getId());
|
||||
}
|
||||
public Object doEdit(@Param("activityBx") ActivityBx activityBx) {
|
||||
this.setEntityValue(activityBx);
|
||||
|
||||
boolean isUnionAdmin = ShiroUtil.hasAnyRoles("H04");
|
||||
boolean isClubAdmin = ShiroUtil.hasAnyRoles("club01");
|
||||
|
||||
switch (activityBx.getActivity_type()) {
|
||||
case 40001 -> activityBx.setReimbursement_state_id(1020);
|
||||
case 40002 -> activityBx.setReimbursement_state_id(1010);
|
||||
case 40003 -> activityBx.setReimbursement_state_id(1000);
|
||||
case 40002 -> {
|
||||
// 如果是基层工会管理员申请,则直接进入校工会审核
|
||||
if (isUnionAdmin) {
|
||||
activityBx.setReimbursement_state_id(1020);
|
||||
} else {
|
||||
activityBx.setReimbursement_state_id(1010);
|
||||
}
|
||||
}
|
||||
case 40003 -> {
|
||||
// 如果是协会会长申请,则直接进入校工会审核
|
||||
if (isClubAdmin) {
|
||||
activityBx.setReimbursement_state_id(1020);
|
||||
} else {
|
||||
activityBx.setReimbursement_state_id(1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
activityBxService.insertOrUpdate(activityBx);
|
||||
NutMap map = new NutMap();
|
||||
@@ -129,10 +135,18 @@ public class ActivityReimbursementApplyController {
|
||||
ReimbursementToHandler.CREATE_SCHOOL_DIRECTOR_TASK.exec(activityBx.getId(), map);
|
||||
} else if (activityBx.getActivity_type() == 40002) {
|
||||
//分工会
|
||||
ReimbursementToHandler.CREATE_UNION_TASK.exec(activityBx.getId(), map);
|
||||
if (isUnionAdmin) {
|
||||
ReimbursementToHandler.CREATE_SCHOOL_DIRECTOR_TASK.exec(activityBx.getId(), map);
|
||||
} else {
|
||||
ReimbursementToHandler.CREATE_UNION_TASK.exec(activityBx.getId(), map);
|
||||
}
|
||||
} else if (activityBx.getActivity_type() == 40003) {
|
||||
//协会
|
||||
ReimbursementToHandler.CREATE_CLUB_TASK.exec(activityBx.getId(), map);
|
||||
if (isClubAdmin) {
|
||||
ReimbursementToHandler.CREATE_SCHOOL_DIRECTOR_TASK.exec(activityBx.getId(), map);
|
||||
} else {
|
||||
ReimbursementToHandler.CREATE_CLUB_TASK.exec(activityBx.getId(), map);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
+16
-4
@@ -5,6 +5,7 @@ import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.v.nutz.sys.services.SysLocalProcessService;
|
||||
import io.v.nutz.zhgh.activity.models.ActivityTissuePerson;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
@@ -63,12 +64,12 @@ public class ActivityReimbursementMineController {
|
||||
|
||||
@Inject
|
||||
private Vi vi;
|
||||
|
||||
@Inject
|
||||
private ActivityBxService activityBxService;
|
||||
|
||||
@Inject
|
||||
private FtpService ftpService;
|
||||
@Inject
|
||||
private ActivityBxService activityBxService;
|
||||
@Inject
|
||||
private SysLocalProcessService sysLocalProcessService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/jf/reimbursement/mine.html")
|
||||
@@ -228,6 +229,17 @@ public class ActivityReimbursementMineController {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions("sys.jf.reimbursement.mine")
|
||||
public Object doBack(String id) {
|
||||
activityBxService.update(Chain.make("reimbursement_apply_time", null).add("reimbursement_state_id",999),
|
||||
Cnd.where("id", "=", id));
|
||||
sysLocalProcessService.deleteProcessInstance("activity_reimbursement@" + id);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
|
||||
+4
-4
@@ -80,21 +80,21 @@ public class ActivityReimbursementSchoolChairmanController {
|
||||
@RequiresPermissions("sys.jf.reimbursement.schoolChairman")
|
||||
@SLog(type = "文体活动", tag = "活动报销", msg = "校工会主席审核", param = true, result = true)
|
||||
public Object doAuditing(@Param("id") String id,@Param("audit") Audit audit){
|
||||
audit.setAuditor(ShiroUtil.getPrincipalProperty("id").toString());
|
||||
audit.setAuditor(ShiroUtil.getUserId());
|
||||
audit.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
|
||||
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
|
||||
audit.setAuditTime(new Date());
|
||||
activityBxService.dao().insert(audit);
|
||||
|
||||
Chain chain = Chain.make("reimbursement_school_chairman_id", audit.getId());
|
||||
chain.add("reimbursement_state_id", audit.getAuditPass() ? 1060 : 1045);
|
||||
chain.add("reimbursement_state_id", audit.getAuditPass() ? 1050 : 1045);
|
||||
activityBxService.update(chain,Cnd.where("id","=",id));
|
||||
|
||||
ReimbursementToHandler.COMPLETE_SCHOOL_CHAIRMAN_TASK.exec(id, NutMap.NEW().addv("nodeName",audit.getAuditPass() ? "校工会主席通过" : "校工会主席拒绝"));
|
||||
if (audit.getAuditPass()) {
|
||||
ReimbursementToHandler.COMPLETE_PROCESS.exec(id,null);
|
||||
ReimbursementToHandler.CREATE_SCHOOL_FINANCE_TASK.exec(id, null);
|
||||
} else {
|
||||
ReimbursementToHandler.REFUSE_UNION_TASK.exec(id,NutMap.NEW().addv("nodeName","校工会主席拒绝"));
|
||||
ReimbursementToHandler.REFUSE_UNION_TASK.exec(id, NutMap.NEW().addv("nodeName","校工会主席拒绝"));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
+4
-4
@@ -76,9 +76,9 @@ public class ActivityReimbursementSchoolDirectorController {
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.jf.reimbursement.schoolDirector")
|
||||
@SLog(type = "文体活动", tag = "活动报销", msg = "校工会负责人审核", param = true, result = true)
|
||||
@SLog(type = "文体活动", tag = "活动报销", msg = "校工会办公室主管审核", param = true, result = true)
|
||||
public Object doAuditing(@Param("id") String id,@Param("audit") Audit audit){
|
||||
audit.setAuditor(ShiroUtil.getPrincipalProperty("id").toString());
|
||||
audit.setAuditor(ShiroUtil.getUserId());
|
||||
audit.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
|
||||
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
|
||||
audit.setAuditTime(new Date());
|
||||
@@ -89,11 +89,11 @@ public class ActivityReimbursementSchoolDirectorController {
|
||||
chain.add("reimbursement_state_id", audit.getAuditPass() ? 1040 : 1025);
|
||||
activityBxService.update(chain,Cnd.where("id","=",id));
|
||||
|
||||
ReimbursementToHandler.COMPLETE_SCHOOL_DIRECTOR_TASK.exec(id, NutMap.NEW().addv("nodeName",audit.getAuditPass() ? "校工会负责人通过" : "校工会负责人拒绝"));
|
||||
ReimbursementToHandler.COMPLETE_SCHOOL_DIRECTOR_TASK.exec(id, NutMap.NEW().addv("nodeName",audit.getAuditPass() ? "校办主管通过" : "校办主管拒绝"));
|
||||
if (audit.getAuditPass()) {
|
||||
ReimbursementToHandler.CREATE_SCHOOL_CHAIRMAN_TASK.exec(id,null);
|
||||
} else {
|
||||
ReimbursementToHandler.REFUSE_UNION_TASK.exec(id,NutMap.NEW().addv("nodeName","校工会负责人拒绝"));
|
||||
ReimbursementToHandler.REFUSE_UNION_TASK.exec(id,NutMap.NEW().addv("nodeName","校办主管拒绝"));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
package io.v.nutz.zhgh.jf.controller.reimbursement;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.web.commons.slog.annotation.SLog;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.jf.handle.reimbursement.ReimbursementToHandler;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
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.Date;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:ActivityReimbursementSchoolFinanceController
|
||||
* @Date 2025/6/6 10:13
|
||||
* @注释 报销,校工会财务
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@At("/platform/jf/reimbursement/schoolFinance")
|
||||
public class ActivityReimbursementSchoolFinanceController {
|
||||
|
||||
@Inject
|
||||
private ActivityBxService activityBxService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/jf/reimbursement/schoolFinance.html")
|
||||
@RequiresPermissions("sys.jf.reimbursement.schoolFinance")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.jf.reimbursement.schoolFinance")
|
||||
public Object pageData(PageForm pageForm,
|
||||
@Param(value = "year", required = false) Integer year,
|
||||
@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "unitId", required = false) String unitId,
|
||||
@Param(value = "clubId",required = false) String clubId,
|
||||
@Param(value = "activityName", required = false) String activityName,
|
||||
@Param(value = "isAudit", required = false) String isAudit) {
|
||||
Sql sql = activityBxService.activityReimbursementSql();
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("act.`year`","=",year);
|
||||
if (StrUtil.isNotBlank(activityName)) {
|
||||
cnd.and(Cnd.likeEX("act.activity_name", activityName));
|
||||
}
|
||||
|
||||
//1已审核;2未审核;0全部
|
||||
cnd.and("act.reimbursement_state_id", "1".equals(isAudit) ? ">" : "2".equals(isAudit) ? "=" : ">=", 1050);
|
||||
|
||||
cnd.andEX("u.unionid","=",unionId);
|
||||
cnd.andEX("u.unitId","=",unitId);
|
||||
cnd.andEX("act.clubId","=",clubId);
|
||||
sql.setCondition(cnd);
|
||||
return activityBxService.listPageMap(pageForm.getPageNumber(),pageForm.getPageSize(),sql);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.jf.reimbursement.schoolFinance")
|
||||
@SLog(type = "文体活动", tag = "活动报销", msg = "校工会财务审核", param = true, result = true)
|
||||
public Object doAuditing(@Param("id") String id,@Param("audit") Audit audit){
|
||||
audit.setAuditor(ShiroUtil.getUserId());
|
||||
audit.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
|
||||
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
|
||||
audit.setAuditTime(new Date());
|
||||
activityBxService.dao().insert(audit);
|
||||
|
||||
Chain chain = Chain.make("reimbursement_finance_audit_id", audit.getId());
|
||||
chain.add("reimbursement_state_id", audit.getAuditPass() ? 1060 : 1055);
|
||||
activityBxService.update(chain,Cnd.where("id","=",id));
|
||||
|
||||
ReimbursementToHandler.COMPLETE_SCHOOL_FINANCE_TASK.exec(id, NutMap.NEW().addv("nodeName",audit.getAuditPass() ? "校工会财务通过" : "校工会财务拒绝"));
|
||||
if (audit.getAuditPass()) {
|
||||
ReimbursementToHandler.COMPLETE_PROCESS.exec(id, null);
|
||||
} else {
|
||||
ReimbursementToHandler.REFUSE_UNION_TASK.exec(id, NutMap.NEW().addv("nodeName","校工会财务拒绝"));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,6 +14,9 @@ import io.v.nutz.zhgh.zgfw.service.impl.CondolenceServiceImpl;
|
||||
import lombok.Getter;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.util.List;
|
||||
@@ -39,7 +42,7 @@ public enum ReimbursementToHandler {
|
||||
User user = dao.fetch(User.class, Cnd.where("id", "=", userId));
|
||||
|
||||
localProcessService.startProcess(
|
||||
"【活动报销】" + user.getUnionname() + "(" + user.getUsername() + ")",
|
||||
"【报销】" + user.getUnionname() + "(" + user.getUsername() + ")",
|
||||
"activity_reimbursement@" + reimbursementId,
|
||||
"",
|
||||
userId,
|
||||
@@ -187,19 +190,20 @@ public enum ReimbursementToHandler {
|
||||
},
|
||||
|
||||
/**
|
||||
* 创建校工会负责人任务
|
||||
* 创建校工会办公室主管任务
|
||||
*/
|
||||
CREATE_SCHOOL_DIRECTOR_TASK() {
|
||||
@Override
|
||||
public void exec(String reimbursementId, NutMap extra) {
|
||||
List<Sys_user_role> userRoles = dao.query(Sys_user_role.class, Cnd.where("roleId", "=", Roles.SchoolUnionActivityReimburseAdmin));
|
||||
// ff0e310a1d954054824c0ed85f1904b7 校工会办公室主管(原宣传与文体工作办公室负责人)code是xcywt
|
||||
List<Sys_user_role> userRoles = dao.query(Sys_user_role.class, Cnd.where("roleId", "=", "ff0e310a1d954054824c0ed85f1904b7"));
|
||||
List<String> list = userRoles.stream().map(Sys_user_role::getUserId).toList();
|
||||
List<Sys_user> userList = dao.query(Sys_user.class, Cnd.where("id", "in", list));
|
||||
List<String> userLoginNameList = userList.stream().map(Sys_user::getLoginname).toList();
|
||||
localProcessService.createTask(
|
||||
"activity_reimbursement@" + reimbursementId,
|
||||
"activity_reimbursement_school_director_audit",
|
||||
"校工会负责人审核",
|
||||
"校办主管审核",
|
||||
ShiroUtil.getUserId(),
|
||||
userLoginNameList,
|
||||
"/platform/jf/reimbursement/schoolDirector",
|
||||
@@ -208,7 +212,7 @@ public enum ReimbursementToHandler {
|
||||
"/platform/jf/reimbursement/schoolDirector"
|
||||
);
|
||||
|
||||
localProcessService.updateProcessNodeName("activity_reimbursement@" + reimbursementId, "校工会负责人审核");
|
||||
localProcessService.updateProcessNodeName("activity_reimbursement@" + reimbursementId, "校办主管审核");
|
||||
}
|
||||
},
|
||||
|
||||
@@ -273,6 +277,52 @@ public enum ReimbursementToHandler {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 创建校工会财务任务
|
||||
*/
|
||||
CREATE_SCHOOL_FINANCE_TASK() {
|
||||
@Override
|
||||
public void exec(String reimbursementId, NutMap extra) {
|
||||
//查询校工会财务
|
||||
List<String> schoolUnionFinance = Vi.getSchoolUnionAccountant();
|
||||
if (Lang.isEmpty(schoolUnionFinance)) {
|
||||
throw new RuntimeException("未设置校财务");
|
||||
}
|
||||
localProcessService.createTask(
|
||||
"activity_reimbursement@" + reimbursementId,
|
||||
"activity_reimbursement_school_finance_audit",
|
||||
"校工会财务审核",
|
||||
ShiroUtil.getUserId(),
|
||||
schoolUnionFinance,
|
||||
"/platform/jf/reimbursement/schoolFinance",
|
||||
"/platform/jf/reimbursement/schoolFinance",
|
||||
"/platform/jf/reimbursement/schoolFinance",
|
||||
"/platform/jf/reimbursement/schoolFinance"
|
||||
);
|
||||
|
||||
localProcessService.updateProcessNodeName("activity_reimbursement@" + reimbursementId, "校工会财务审核");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 校工会财务完成
|
||||
*/
|
||||
COMPLETE_SCHOOL_FINANCE_TASK() {
|
||||
@Override
|
||||
public void exec(String reimbursementId, NutMap extra) {
|
||||
String nodeName = extra.getString("nodeName");
|
||||
localProcessService.completeTask(
|
||||
"activity_reimbursement_school_finance_audit",
|
||||
"activity_reimbursement@" + reimbursementId,
|
||||
ShiroUtil.getUserId(),
|
||||
nodeName
|
||||
);
|
||||
|
||||
localProcessService.updateProcessNodeName("activity_reimbursement@" + reimbursementId, nodeName);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 流程结束
|
||||
*/
|
||||
|
||||
@@ -39,6 +39,7 @@ public class ActivityBx {
|
||||
@Comment("申报(承办)单位")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 200)
|
||||
private String fundsUnitName;
|
||||
|
||||
@Column
|
||||
@Comment("协会id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@@ -55,8 +56,8 @@ public class ActivityBx {
|
||||
private String user_id;
|
||||
|
||||
@Column
|
||||
@Comment("用户签字id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("用户签字")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String user_signature;
|
||||
|
||||
@Column
|
||||
@@ -100,7 +101,7 @@ public class ActivityBx {
|
||||
|
||||
@Column
|
||||
@Comment("活动名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
@ColDefine(type = ColType.VARCHAR, width = 200)
|
||||
private String activity_name;
|
||||
|
||||
@Column
|
||||
@@ -364,14 +365,6 @@ public class ActivityBx {
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<Sys_file> files;
|
||||
|
||||
@Column
|
||||
@Comment("附件数量")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String files_num;
|
||||
|
||||
@Many(field = "reid")
|
||||
private List<Goods> goods;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("发票")
|
||||
@@ -389,22 +382,6 @@ public class ActivityBx {
|
||||
private List<Sys_file> otherFiles;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("新闻稿件说明")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String newsRemark;
|
||||
|
||||
@Column
|
||||
@Comment("图片附件")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<Sys_file> picFiles;
|
||||
|
||||
@Column
|
||||
@Comment("新闻附件")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<Sys_file> newsFiles;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("活动经费预算")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
@@ -415,15 +392,17 @@ public class ActivityBx {
|
||||
*/
|
||||
@Data
|
||||
public static class Budget{
|
||||
// 名称
|
||||
// 科目
|
||||
private String category;
|
||||
// 具体内容
|
||||
private String name;
|
||||
// 预算费用
|
||||
private Double budgetPrice;
|
||||
// 实际费用
|
||||
// 类别
|
||||
private String type;
|
||||
// 金额
|
||||
private Double actualPrice;
|
||||
// 收款人id
|
||||
private String payeeId;
|
||||
// 收款人姓名
|
||||
// 收款对象(个人/单位)
|
||||
private String username;
|
||||
// 收款人工号
|
||||
private String loginName;
|
||||
|
||||
@@ -65,10 +65,6 @@ public class ActivityBxServiceImpl extends ViServiceImpl<ActivityBx> implements
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void doAdd(ActivityBx activityBx) {
|
||||
insert(activityBx);
|
||||
activityBx.getGoods().forEach(v -> {
|
||||
v.setReid(activityBx.getId());
|
||||
});
|
||||
this.dao().insert(activityBx.getGoods());
|
||||
// insertWith(activityBx, "goods");
|
||||
}
|
||||
|
||||
@@ -172,6 +168,11 @@ public class ActivityBxServiceImpl extends ViServiceImpl<ActivityBx> implements
|
||||
Audit audit = dao().fetch(Audit.class, Cnd.where("id", "=", record.getString("reimbursement_school_chairman_id")));
|
||||
record.setv("reimbursement_school_chairman",audit);
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(record.getString("reimbursement_finance_audit_id"))){
|
||||
Audit audit = dao().fetch(Audit.class, Cnd.where("id", "=", record.getString("reimbursement_finance_audit_id")));
|
||||
record.setv("reimbursement_school_finance",audit);
|
||||
}
|
||||
return record;
|
||||
}
|
||||
|
||||
|
||||
+82
-4
@@ -6,16 +6,24 @@ import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import com.aspose.words.Document;
|
||||
import com.aspose.words.SaveFormat;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.data.PictureRenderData;
|
||||
import com.deepoove.poi.data.PictureType;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.dao.CndPlus;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.base.utils.ViTool;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationBaseManagement;
|
||||
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLot;
|
||||
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationTravelAgency;
|
||||
@@ -27,6 +35,7 @@ import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.apache.shiro.authz.annotation.RequiresRoles;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.boot.starter.ftp.FtpService;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
@@ -36,12 +45,14 @@ import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.*;
|
||||
import org.nutz.mvc.upload.TempFile;
|
||||
import org.nutz.mvc.upload.UploadAdaptor;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationHandler;
|
||||
import java.lang.reflect.Proxy;
|
||||
@@ -61,11 +72,12 @@ import java.util.stream.Collectors;
|
||||
@Ok("json:full")
|
||||
public class TheRapyRecuperationBaseManagerController {
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Inject
|
||||
private FtpService ftpService;
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
@Inject
|
||||
private TheRapyRecuperationBaseManagerService theRapyRecuperationBaseManagerService;
|
||||
|
||||
@@ -229,7 +241,7 @@ public class TheRapyRecuperationBaseManagerController {
|
||||
@ViReturn
|
||||
@RequiresAuthentication
|
||||
public Object listAllBase(String startYear, String endYear, String year) {
|
||||
Sql sql = Sqls.create("select * from `the_rapy_recuperation_base_management` tb left join `the_rapy_recuperation_lot` lot on lot.id=tb.lotId $condition");
|
||||
Sql sql = Sqls.create("select tb.* from `the_rapy_recuperation_base_management` tb left join `the_rapy_recuperation_lot` lot on lot.id=tb.lotId $condition");
|
||||
CndPlus cnd = new CndPlus();
|
||||
|
||||
cnd.andEX("tb.`year`", ">=", startYear);
|
||||
@@ -255,6 +267,20 @@ public class TheRapyRecuperationBaseManagerController {
|
||||
}
|
||||
|
||||
|
||||
@At("/getTimeArray")
|
||||
@ViReturn
|
||||
@RequiresAuthentication
|
||||
public Object getTimeArray(@Param("id") String id) {
|
||||
if (StrUtil.isBlank(id)) {
|
||||
return Result.error("参数错误");
|
||||
}
|
||||
TheRapyRecuperationBaseManagement management = dao.fetch(TheRapyRecuperationBaseManagement.class, id);
|
||||
return Map.of("minDate", DateUtil.formatDate(management.getActivityStartTime()),
|
||||
"maxDate", DateUtil.formatDate(management.getActivityEndTime()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 目的地导入模版
|
||||
*
|
||||
@@ -358,4 +384,56 @@ public class TheRapyRecuperationBaseManagerController {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@At("/showBaseApplyPdf")
|
||||
@Ok("void")
|
||||
@RequiresAuthentication
|
||||
public void showBaseApplyPdf(String idCard, String specificTime, String baseName,
|
||||
String sign, HttpServletResponse response){
|
||||
NutMap map = NutMap.NEW();
|
||||
map.put("idCard", ObjectUtil.defaultIfBlank(idCard, "--预览展示--"));
|
||||
map.put("specificTime", ObjectUtil.defaultIfBlank(specificTime, "--预览展示--"));
|
||||
map.put("baseName", ObjectUtil.defaultIfBlank(baseName, "--预览展示--"));
|
||||
Sys_user user = (Sys_user) ShiroUtil.getPrincipal();
|
||||
map.put("username", user.getUsername());
|
||||
map.put("unitName", user.getUnit().getName());
|
||||
map.put("appDate", DateUtil.formatChineseDate(new Date(), false, false));
|
||||
if (StrUtil.isNotBlank(sign)) {
|
||||
try {
|
||||
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||
ftpService.download(sign, os);
|
||||
os.close();
|
||||
PictureRenderData data = new PictureRenderData(70, 30, PictureType.PNG, os.toByteArray());
|
||||
map.put("sign", data);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
response.addHeader("Content-Type", "application/octet-stream");
|
||||
response.addHeader("Content-Disposition", "inline; filename=\"" + new String("定点自由行申请表".getBytes("UTF-8"), "ISO-8859-1") + "\".docx");
|
||||
InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("docTemplate/therapyrecuperation/base_apply.docx");
|
||||
|
||||
//将模版写成docx
|
||||
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||
XWPFTemplate.compile(inputStream).render(map, os);
|
||||
|
||||
InputStream resultInputStream = new ByteArrayInputStream(os.toByteArray());
|
||||
|
||||
Document doc = new Document(resultInputStream);
|
||||
doc.save(response.getOutputStream(), SaveFormat.PDF);
|
||||
|
||||
/*File localPdfPath = File.createTempFile("file_convert", ".pdf");
|
||||
File file = new File(targetPath);
|
||||
FileOutputStream os = new FileOutputStream(file);
|
||||
XWPFTemplate.compile(inputStream).render(map, );*/
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+159
-6
@@ -9,8 +9,14 @@ 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.io.FileUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import com.aspose.words.Document;
|
||||
import com.aspose.words.SaveFormat;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.data.PictureRenderData;
|
||||
import com.deepoove.poi.data.PictureType;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
@@ -24,6 +30,7 @@ import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.boot.starter.ftp.FtpService;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
@@ -43,14 +50,10 @@ import org.nutz.mvc.upload.UploadAdaptor;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.*;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
@@ -62,6 +65,8 @@ import java.util.zip.ZipOutputStream;
|
||||
public class TheRapyRecuperationUserQueryController {
|
||||
|
||||
|
||||
@Inject
|
||||
private FtpService ftpService;
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@@ -357,6 +362,14 @@ public class TheRapyRecuperationUserQueryController {
|
||||
date_format( lineu.playStartTime, '%Y-%m-%d' ) playStartTime,
|
||||
lineu.lineId,
|
||||
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id) familyCount,
|
||||
(
|
||||
SELECT
|
||||
GROUP_CONCAT(ec.userName, '-', ec.sex, '-', ec.age, '(', ec.idcard, '、', ec.mobile, ')')
|
||||
FROM
|
||||
the_rapy_recuperation_enroll_companion ec
|
||||
WHERE
|
||||
ec.trreId = enroll.id
|
||||
) AS companionInfo,
|
||||
u.schoolTime
|
||||
FROM
|
||||
`the_rapy_recuperation_enroll` enroll
|
||||
@@ -451,6 +464,9 @@ public class TheRapyRecuperationUserQueryController {
|
||||
lineEntities.add(new ExcelExportEntity("线路名称", "lineName", 20));
|
||||
lineEntities.add(new ExcelExportEntity("旅行社", "travelAgencyName", 20));
|
||||
lineEntities.add(new ExcelExportEntity("随行人数", "familyCount", 20));
|
||||
ExcelExportEntity lineEntity = new ExcelExportEntity("随行人信息", "companionInfo", 50);
|
||||
lineEntity.setWrap(true);
|
||||
lineEntities.add(lineEntity);
|
||||
|
||||
//自由组团表头
|
||||
ArrayList<ExcelExportEntity> travelEntities = new ArrayList<>(commonEntities);
|
||||
@@ -501,4 +517,141 @@ public class TheRapyRecuperationUserQueryController {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@RequiresAuthentication
|
||||
public void doExportBaseApply(@Param(value = "id", required = false) String id,
|
||||
@Param(value = "searchKeyword", required = false) String searchKeyword,
|
||||
@Param(value = "startYear", required = false) Integer startYear,
|
||||
@Param(value = "endYear", required = false) Integer endYear,
|
||||
@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "unitId", required = false) String unitId,
|
||||
@Param(value = "lotId", required = false) String lotId,
|
||||
@Param(value = "takePartInBaseManagementId", required = false) String takePartInBaseManagementId,
|
||||
HttpServletResponse response){
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
enroll.*,
|
||||
base.baseName
|
||||
FROM
|
||||
the_rapy_recuperation_enroll enroll
|
||||
LEFT JOIN the_rapy_recuperation_base_management base ON base.id = enroll.takePartInBaseManagementId
|
||||
$condition
|
||||
""");
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(id)) {
|
||||
cnd.and("enroll.id", "=", id);
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> list = baseService.listMap(sql);
|
||||
|
||||
NutMap nutMap = list.stream().findFirst().orElse(NutMap.NEW());
|
||||
NutMap map = buildBaseApplyFormMap(nutMap);
|
||||
|
||||
try {
|
||||
response.setContentType("application/pdf");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=\"" + new String((map.getString("username") + "定点自由行申请表").getBytes("UTF-8"), StandardCharsets.ISO_8859_1) + "\".pdf");
|
||||
|
||||
InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("docTemplate/therapyrecuperation/base_apply.docx");
|
||||
// 生成 DOCX 内容到字节数组输出流
|
||||
ByteArrayOutputStream docxOut = new ByteArrayOutputStream();
|
||||
XWPFTemplate.compile(inputStream).render(map, docxOut);
|
||||
inputStream.close();
|
||||
|
||||
// 将 DOCX 转换为 PDF
|
||||
Document doc = new com.aspose.words.Document(new ByteArrayInputStream(docxOut.toByteArray()));
|
||||
ByteArrayOutputStream pdfOut = new ByteArrayOutputStream();
|
||||
doc.save(pdfOut, SaveFormat.PDF);
|
||||
|
||||
// 将 PDF 写入响应输出流
|
||||
response.getOutputStream().write(pdfOut.toByteArray());
|
||||
response.getOutputStream().flush();
|
||||
response.getOutputStream().close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
cnd.and("enroll.isNormal", "=", true);
|
||||
cnd.and("enroll.stateId", "=", TheRapyRecuperationState.PASS);
|
||||
if (StrUtil.isNotBlank(searchKeyword)) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("enroll.userName", searchKeyword);
|
||||
seg.orLike("enroll.loginName", searchKeyword);
|
||||
cnd.and(seg);
|
||||
}
|
||||
cnd.andEX("enroll.lotId", "=", lotId);
|
||||
cnd.andEX("YEAR(enroll.signingUptime)", ">=", startYear);
|
||||
cnd.andEX("YEAR(enroll.signingUptime)", "<=", endYear);
|
||||
cnd.and("enroll.takePartInBaseManagementId", "is not", null);
|
||||
cnd.andEX("enroll.takePartInBaseManagementId", "=", takePartInBaseManagementId);
|
||||
cnd.andEX("enroll.selfUnionId", "=", unionId);
|
||||
cnd.andEX("enroll.selfUnitId", "=", unitId);
|
||||
sql.setCondition(cnd);
|
||||
|
||||
List<NutMap> enrollList = baseService.listMap(sql);
|
||||
|
||||
try {
|
||||
response.setContentType("application/octet-stream");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("疗休养报名人员名单.zip", StandardCharsets.UTF_8).replaceAll("\\+", "%20"));
|
||||
|
||||
try (ZipOutputStream zipOutputStream = new ZipOutputStream(response.getOutputStream())) {
|
||||
for (NutMap enroll : enrollList) {
|
||||
NutMap map = buildBaseApplyFormMap(enroll);
|
||||
|
||||
String fileName = map.getString("username") + "定点自由行申请表.pdf";
|
||||
ZipEntry zipEntry = new ZipEntry(fileName);
|
||||
zipOutputStream.putNextEntry(zipEntry);
|
||||
|
||||
InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("docTemplate/therapyrecuperation/base_apply.docx");
|
||||
|
||||
ByteArrayOutputStream docxOut = new ByteArrayOutputStream();
|
||||
XWPFTemplate.compile(inputStream).render(map, docxOut);
|
||||
inputStream.close();
|
||||
|
||||
Document doc = new Document(new ByteArrayInputStream(docxOut.toByteArray()));
|
||||
ByteArrayOutputStream pdfOut = new ByteArrayOutputStream();
|
||||
doc.save(pdfOut, SaveFormat.PDF);
|
||||
|
||||
zipOutputStream.write(pdfOut.toByteArray());
|
||||
zipOutputStream.closeEntry();
|
||||
}
|
||||
zipOutputStream.finish(); // 完成 ZIP 压缩包的写入
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
// Handle exception appropriately
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private NutMap buildBaseApplyFormMap(NutMap enroll){
|
||||
NutMap map = NutMap.NEW();
|
||||
map.put("idCard", enroll.getString("idCard"));
|
||||
map.put("specificTime", enroll.getString("specificTime"));
|
||||
map.put("baseName", enroll.getString("baseName"));
|
||||
map.put("username", enroll.getString("userName"));
|
||||
map.put("unitName", enroll.getString("unitName"));
|
||||
map.put("appDate", DateUtil.formatChineseDate(enroll.getTime("signingUptime"), false, false));
|
||||
String sign = enroll.getString("sign");
|
||||
if (StrUtil.isNotBlank(sign)) {
|
||||
try {
|
||||
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||
ftpService.download(sign, os);
|
||||
os.close();
|
||||
PictureRenderData data = new PictureRenderData(70, 30, PictureType.PNG, os.toByteArray());
|
||||
map.put("sign", data);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -202,5 +202,15 @@ public class TheRapyRecuperationEnroll extends BaseModel {
|
||||
@Comment("家属数量")
|
||||
private Integer familyNumber;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
@Comment("签字")
|
||||
private String sign;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
@Comment("出行时间")
|
||||
private String specificTime;
|
||||
|
||||
private String firstLetter;
|
||||
}
|
||||
|
||||
+7
-6
@@ -147,20 +147,20 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
|
||||
taSql.setCondition(cnd);
|
||||
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), taSql);
|
||||
} else if (TheRapyRecuperationType.provinceInHotel.getValue() == trrt) {
|
||||
cnd.andEX("b.year", "=", year != null ? year : DateUtil.thisYear());
|
||||
Integer queryYear = year != null ? year : DateUtil.thisYear();
|
||||
cnd.andEX("b.year", "=", queryYear);
|
||||
cnd.and("b.isDisabled", "=", false);
|
||||
Sql taSql = Sqls.create("""
|
||||
select
|
||||
b.*,
|
||||
cast(b.files ->> '$[0].id' as char) as fileId,
|
||||
l.lotName,
|
||||
t.travelAgencyName
|
||||
(select count(1) from the_rapy_recuperation_enroll where takePartInBaseManagementId=b.id and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year) as signUpUserNum
|
||||
from
|
||||
the_rapy_recuperation_base_management b
|
||||
left join the_rapy_recuperation_lot l on l.id = b.lotId
|
||||
left join the_rapy_recuperation_travel_agency t on t.id = b.travelAgencyId
|
||||
$condition
|
||||
""");
|
||||
""").setParam("year", queryYear);
|
||||
cnd.asc("sortNumber");
|
||||
taSql.setCondition(cnd);
|
||||
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), taSql);
|
||||
@@ -1409,14 +1409,15 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
|
||||
l.lotName,
|
||||
ta.regionalNature,
|
||||
t.travelAgencyName,
|
||||
ta.changeEndTime
|
||||
ta.changeEndTime,
|
||||
(select count(1) from the_rapy_recuperation_enroll where takePartInBaseManagementId=ta.id and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year) as signUpUserNum
|
||||
FROM
|
||||
the_rapy_recuperation_enroll e
|
||||
LEFT JOIN the_rapy_recuperation_base_management ta ON ta.id = e.takePartInBaseManagementId
|
||||
LEFT JOIN the_rapy_recuperation_lot l on l.id = ta.lotId
|
||||
LEFT JOIN the_rapy_recuperation_travel_agency t on t.id = ta.travelAgencyId
|
||||
$condition
|
||||
""");
|
||||
""").setParam("year", year);
|
||||
cnd.and("e.takePartInBaseManagementId", "is not", null);
|
||||
cnd.and("e.isNormal", "=", true);
|
||||
cnd.andEX("ta.year", "=", year);
|
||||
|
||||
Reference in New Issue
Block a user