慰问报销单导出
This commit is contained in:
@@ -0,0 +1,166 @@
|
|||||||
|
package com.budwk.app.base.utils;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author : hongqiwei
|
||||||
|
* @description :
|
||||||
|
* @createDate : 2026/1/20 15:41
|
||||||
|
*/
|
||||||
|
public class MoneyUtil {
|
||||||
|
public MoneyUtil() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String toRMBUpper(String money) throws Exception {
|
||||||
|
boolean lessZero = false;
|
||||||
|
if (money.contains("E")) {
|
||||||
|
BigDecimal bg = new BigDecimal(Double.valueOf(money));
|
||||||
|
money = bg.toPlainString();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (money.startsWith("-")) {
|
||||||
|
money = money.substring(1);
|
||||||
|
lessZero = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!money.matches("^[0-9]*$|^0+\\.[0-9]+$|^[1-9]+[0-9]*$|^[1-9]+[0-9]*.[0-9]+$")) {
|
||||||
|
throw new Exception("钱数格式错误!");
|
||||||
|
} else {
|
||||||
|
String[] part = money.split("\\.");
|
||||||
|
String integerData = part[0];
|
||||||
|
String decimalData = part.length > 1 ? part[1] : "";
|
||||||
|
if (integerData.matches("^0+$")) {
|
||||||
|
integerData = "0";
|
||||||
|
} else if (integerData.matches("^0+(\\d+)$")) {
|
||||||
|
integerData = integerData.replaceAll("^0+(\\d+)$", "$1");
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuffer integer = new StringBuffer();
|
||||||
|
|
||||||
|
for(int i = 0; i < integerData.length(); ++i) {
|
||||||
|
char perchar = integerData.charAt(i);
|
||||||
|
integer.append(upperNumber(perchar));
|
||||||
|
integer.append(upperNumber(integerData.length() - i - 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuffer decimal = new StringBuffer();
|
||||||
|
if (part.length > 1 && !"00".equals(decimalData)) {
|
||||||
|
int length = decimalData.length() >= 2 ? 2 : decimalData.length();
|
||||||
|
|
||||||
|
for(int i = 0; i < length; ++i) {
|
||||||
|
char perchar = decimalData.charAt(i);
|
||||||
|
decimal.append(upperNumber(perchar));
|
||||||
|
if (i == 0) {
|
||||||
|
decimal.append('角');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i == 1) {
|
||||||
|
decimal.append('分');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String var10000 = integer.toString();
|
||||||
|
String result = var10000 + decimal.toString();
|
||||||
|
result = dispose(result);
|
||||||
|
if (lessZero && !"零圆整".equals(result)) {
|
||||||
|
result = "负" + result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static char upperNumber(char number) {
|
||||||
|
switch (number) {
|
||||||
|
case '0' -> {
|
||||||
|
return '零';
|
||||||
|
}
|
||||||
|
case '1' -> {
|
||||||
|
return '壹';
|
||||||
|
}
|
||||||
|
case '2' -> {
|
||||||
|
return '贰';
|
||||||
|
}
|
||||||
|
case '3' -> {
|
||||||
|
return '叁';
|
||||||
|
}
|
||||||
|
case '4' -> {
|
||||||
|
return '肆';
|
||||||
|
}
|
||||||
|
case '5' -> {
|
||||||
|
return '伍';
|
||||||
|
}
|
||||||
|
case '6' -> {
|
||||||
|
return '陆';
|
||||||
|
}
|
||||||
|
case '7' -> {
|
||||||
|
return '柒';
|
||||||
|
}
|
||||||
|
case '8' -> {
|
||||||
|
return '捌';
|
||||||
|
}
|
||||||
|
case '9' -> {
|
||||||
|
return '玖';
|
||||||
|
}
|
||||||
|
default -> {
|
||||||
|
return '0';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static char upperNumber(int index) {
|
||||||
|
int realIndex = index % 9;
|
||||||
|
if (index > 8) {
|
||||||
|
realIndex = (index - 9) % 8;
|
||||||
|
++realIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (realIndex) {
|
||||||
|
case 0 -> {
|
||||||
|
return '圆';
|
||||||
|
}
|
||||||
|
case 1 -> {
|
||||||
|
return '拾';
|
||||||
|
}
|
||||||
|
case 2 -> {
|
||||||
|
return '佰';
|
||||||
|
}
|
||||||
|
case 3 -> {
|
||||||
|
return '仟';
|
||||||
|
}
|
||||||
|
case 4 -> {
|
||||||
|
return '万';
|
||||||
|
}
|
||||||
|
case 5 -> {
|
||||||
|
return '拾';
|
||||||
|
}
|
||||||
|
case 6 -> {
|
||||||
|
return '佰';
|
||||||
|
}
|
||||||
|
case 7 -> {
|
||||||
|
return '仟';
|
||||||
|
}
|
||||||
|
case 8 -> {
|
||||||
|
return '亿';
|
||||||
|
}
|
||||||
|
default -> {
|
||||||
|
return '0';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String dispose(String result) {
|
||||||
|
result = result.replaceAll("0", "");
|
||||||
|
result = result.replaceAll("零仟零佰零拾|零仟零佰|零佰零拾|零仟|零佰|零拾", "零");
|
||||||
|
result = result.replaceAll("零+", "零").replace("零亿", "亿");
|
||||||
|
result = result.matches("^.*亿零万[^零]仟.*$") ? result.replace("零万", "零") : result.replace("零万", "万");
|
||||||
|
result = result.replace("亿万", "亿");
|
||||||
|
result = result.replace("零角", "零").replace("零分", "");
|
||||||
|
result = result.replaceAll("(^[零圆]*)(.+$)", "$2");
|
||||||
|
result = result.replaceAll("(^.*)([零]+圆)(.+$)", "$1圆零$3");
|
||||||
|
result = result.replaceAll("圆零角零分|圆零角$|圆$|^零$|圆零$|圆零零$|零圆$", "圆整");
|
||||||
|
result = result.replaceAll("^圆整$", "零圆整");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
+254
-2
@@ -3,25 +3,41 @@ package com.budwk.app.zhgh.staffbenefit.condolence.controller;
|
|||||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import cn.dev33.satoken.annotation.SaMode;
|
import cn.dev33.satoken.annotation.SaMode;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.lang.Dict;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.budwk.app.base.annotation.SLog;
|
import com.budwk.app.base.annotation.SLog;
|
||||||
import com.budwk.app.base.constant.RoleConstant;
|
import com.budwk.app.base.constant.RoleConstant;
|
||||||
import com.budwk.app.base.page.Pagination;
|
import com.budwk.app.base.page.Pagination;
|
||||||
import com.budwk.app.base.param.PageForm;
|
import com.budwk.app.base.param.PageForm;
|
||||||
import com.budwk.app.base.result.Result;
|
import com.budwk.app.base.result.Result;
|
||||||
import com.budwk.app.base.sms.SmsService;
|
import com.budwk.app.base.sms.SmsService;
|
||||||
|
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||||
|
import com.budwk.app.base.utils.MoneyUtil;
|
||||||
import com.budwk.app.base.utils.PageUtil;
|
import com.budwk.app.base.utils.PageUtil;
|
||||||
|
import com.budwk.app.base.utils.SysOfficeTemplateUtil;
|
||||||
import com.budwk.app.flow.engine.FlowEngine;
|
import com.budwk.app.flow.engine.FlowEngine;
|
||||||
|
import com.budwk.app.flow.entity.ProcessTask;
|
||||||
|
import com.budwk.app.flow.vo.ProcessTaskVO;
|
||||||
import com.budwk.app.sys.views.View_user;
|
import com.budwk.app.sys.views.View_user;
|
||||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||||
|
import com.budwk.app.zhgh.dayofficework.unionReimburse.model.UnionReimburse;
|
||||||
import com.budwk.app.zhgh.staffbenefit.condolence.model.Condolence;
|
import com.budwk.app.zhgh.staffbenefit.condolence.model.Condolence;
|
||||||
import com.budwk.app.zhgh.staffbenefit.condolence.model.CondolenceType;
|
import com.budwk.app.zhgh.staffbenefit.condolence.model.CondolenceType;
|
||||||
import com.budwk.app.zhgh.staffbenefit.condolence.service.CondolenceService;
|
import com.budwk.app.zhgh.staffbenefit.condolence.service.CondolenceService;
|
||||||
|
import com.deepoove.poi.XWPFTemplate;
|
||||||
|
import com.deepoove.poi.config.Configure;
|
||||||
|
import com.deepoove.poi.data.PictureRenderData;
|
||||||
|
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.beetl.ext.fn.Print;
|
||||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||||
import org.nutz.dao.Cnd;
|
import org.nutz.dao.Cnd;
|
||||||
|
import org.nutz.dao.Dao;
|
||||||
import org.nutz.dao.Sqls;
|
import org.nutz.dao.Sqls;
|
||||||
import org.nutz.dao.sql.Sql;
|
import org.nutz.dao.sql.Sql;
|
||||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||||
@@ -34,6 +50,21 @@ import org.nutz.mvc.annotation.At;
|
|||||||
import org.nutz.mvc.annotation.Ok;
|
import org.nutz.mvc.annotation.Ok;
|
||||||
import org.nutz.mvc.annotation.Param;
|
import org.nutz.mvc.annotation.Param;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.zip.ZipEntry;
|
||||||
|
import java.util.zip.ZipOutputStream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName CondolenceApplyController
|
* @ClassName CondolenceApplyController
|
||||||
* @Author JyuHsin
|
* @Author JyuHsin
|
||||||
@@ -45,12 +76,19 @@ import org.nutz.mvc.annotation.Param;
|
|||||||
@At("/platform/condolence/mine")
|
@At("/platform/condolence/mine")
|
||||||
@Api("职工慰问我的")
|
@Api("职工慰问我的")
|
||||||
@Ok("json:full")
|
@Ok("json:full")
|
||||||
|
@Slf4j
|
||||||
public class CondolenceMineController {
|
public class CondolenceMineController {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private CondolenceService condolenceService;
|
private CondolenceService condolenceService;
|
||||||
@Inject
|
@Inject
|
||||||
|
private Dao dao;
|
||||||
|
@Inject
|
||||||
private FlowEngine flowEngine;
|
private FlowEngine flowEngine;
|
||||||
|
@Inject
|
||||||
|
private SmsService smsService;
|
||||||
|
@Inject
|
||||||
|
private SysOfficeTemplateUtil sysOfficeTemplateUtil;
|
||||||
|
|
||||||
@At("/")
|
@At("/")
|
||||||
@Ok("beetl:/platform/zhgh/staffbenefit/condolence/mine/index.html")
|
@Ok("beetl:/platform/zhgh/staffbenefit/condolence/mine/index.html")
|
||||||
@@ -140,6 +178,220 @@ public class CondolenceMineController {
|
|||||||
//smsService.send("20182040", "这是一条由智慧工会系统发出的测试消息。");
|
//smsService.send("20182040", "这是一条由智慧工会系统发出的测试消息。");
|
||||||
return Result.success(nutMap);
|
return Result.success(nutMap);
|
||||||
}
|
}
|
||||||
@Inject
|
|
||||||
private SmsService smsService;
|
|
||||||
|
@At
|
||||||
|
@Ok("void")
|
||||||
|
public void doExport(String id, HttpServletResponse response) throws Exception {
|
||||||
|
Condolence condolence = condolenceService.fetch(id);
|
||||||
|
if (condolence == null) {
|
||||||
|
throw new RuntimeException("慰问记录不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
Sql sql = Sqls.create("""
|
||||||
|
SELECT
|
||||||
|
info.*,
|
||||||
|
ins.id AS instanceId
|
||||||
|
FROM
|
||||||
|
`condolence` info
|
||||||
|
LEFT JOIN wf_process_instance ins ON ins.businessNo = info.id
|
||||||
|
WHERE
|
||||||
|
ins.state = 20 AND info.id = @id
|
||||||
|
""").setParam("id", id);
|
||||||
|
sql.setCallback(Sqls.callback.map());
|
||||||
|
dao.execute(sql);
|
||||||
|
NutMap info = (NutMap) sql.getResult();
|
||||||
|
|
||||||
|
HashMap<String, Object> docData = new HashMap<>();
|
||||||
|
HashMap<String, Object> docData2 = new HashMap<>();
|
||||||
|
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
|
LocalDateTime createTime = LocalDateTime.parse(condolence.getCreateTime(), formatter);
|
||||||
|
|
||||||
|
docData.put("createTime", DateUtil.format(createTime, "yyyy年MM月dd日"));
|
||||||
|
docData.put("applyUnionName", condolence.getApplyUnionName());
|
||||||
|
docData.put("info", info);
|
||||||
|
|
||||||
|
docData2.put("createTime", DateUtil.format(createTime, "yyyy年MM月dd日"));
|
||||||
|
docData2.put("applyUnionName", condolence.getApplyUnionName());
|
||||||
|
docData2.put("bankUserName", condolence.getBankUserName());
|
||||||
|
docData2.put("bankCardNumber", condolence.getBankCardNumber());
|
||||||
|
docData2.put("bankOfDeposit", condolence.getBankOfDeposit());
|
||||||
|
docData2.put("info", info);
|
||||||
|
|
||||||
|
// 金额转大写
|
||||||
|
// if (condolence.getMoney() != null) {
|
||||||
|
// docData.put("money_big", MoneyUtil.toRMBUpper(String.valueOf(condolence.getMoney())));
|
||||||
|
// } else {
|
||||||
|
// docData.put("money_big", "");
|
||||||
|
// }
|
||||||
|
// docData.put("money", condolence.getMoney());
|
||||||
|
|
||||||
|
String fileName;
|
||||||
|
String templateName;
|
||||||
|
String type = condolence.getType();
|
||||||
|
|
||||||
|
if (("6fb2ae129e674c0dbadc21d9abc22943").equals(type)) {
|
||||||
|
fileName = "工会会员结婚慰问报销审批单"+ "_" +
|
||||||
|
DateUtil.format(createTime, "yyyyMMdd") + ".docx";
|
||||||
|
templateName = "condolence_marry";
|
||||||
|
|
||||||
|
docData.put("type", "会员结婚慰问");
|
||||||
|
docData.put("way", "现金");
|
||||||
|
docData.put("occurTime", condolence.getOccurTime());
|
||||||
|
|
||||||
|
docData2.put("type", "会员结婚慰问");
|
||||||
|
docData2.put("money", "1000");
|
||||||
|
docData2.put("money_big", "壹仟元整");
|
||||||
|
} else if (("cf4ce7af322d464f8f86d818fcc00203").equals(type)){
|
||||||
|
fileName = "工会会员生病住院慰问报销审批单"+ "_" +
|
||||||
|
DateUtil.format(createTime, "yyyyMMdd") + ".docx";
|
||||||
|
templateName = "condolence_hospitalization";
|
||||||
|
|
||||||
|
docData.put("type", "会员生病慰问");
|
||||||
|
docData.put("way", "现金");
|
||||||
|
docData.put("hospitalizationTime", condolence.getHospitalizationTime());
|
||||||
|
docData.put("leaveHospitalTime", condolence.getLeaveHospitalTime());
|
||||||
|
docData.put("thisYearHospitalizationNum", condolence.getThisYearHospitalizationNum());
|
||||||
|
|
||||||
|
docData2.put("type", "会员生病慰问");
|
||||||
|
docData2.put("money", "1000");
|
||||||
|
docData2.put("money_big", "壹仟元整");
|
||||||
|
} else if (("c90cb10dce6542e99ae271bee6fe8cc0").equals(type)){
|
||||||
|
fileName = "工会会员生育慰问报销审批单"+ "_" +
|
||||||
|
DateUtil.format(createTime, "yyyyMMdd") + ".docx";
|
||||||
|
templateName = "condolence_birth";
|
||||||
|
|
||||||
|
docData.put("type", "会员生育慰问");
|
||||||
|
docData.put("way", "现金");
|
||||||
|
docData.put("occurTime", condolence.getOccurTime());
|
||||||
|
docData.put("hospitalizationTime", condolence.getHospitalizationTime());
|
||||||
|
docData.put("leaveHospitalTime", condolence.getLeaveHospitalTime());
|
||||||
|
|
||||||
|
docData2.put("type", "会员生育慰问");
|
||||||
|
docData2.put("money", "1000");
|
||||||
|
docData2.put("money_big", "壹仟元整");
|
||||||
|
}else if (("4e316737e71047e0b01aea78524c1416").equals(type)){
|
||||||
|
fileName = "工会会员直系亲属去世报销审批单"+ "_" +
|
||||||
|
DateUtil.format(createTime, "yyyyMMdd") + ".docx";
|
||||||
|
templateName = "condolence_relative_died";
|
||||||
|
|
||||||
|
docData.put("type", "会员直系亲属去世慰问");
|
||||||
|
docData.put("way", "现金");
|
||||||
|
docData.put("relation", condolence.getRelation());
|
||||||
|
docData.put("occurTime", condolence.getOccurTime());
|
||||||
|
|
||||||
|
docData2.put("type", "会员直系亲属去世慰问");
|
||||||
|
docData2.put("money", "1000");
|
||||||
|
docData2.put("money_big", "壹仟元整");
|
||||||
|
}else if (("b8ee30faacb2469593dfedb5b52565aa").equals(type)){
|
||||||
|
fileName = "工会会员职工去世慰问报销审批单"+ "_" +
|
||||||
|
DateUtil.format(createTime, "yyyyMMdd") + ".docx";
|
||||||
|
templateName = "condolence_died";
|
||||||
|
|
||||||
|
docData.put("type", "会员职工去世慰问");
|
||||||
|
docData.put("way", "现金");
|
||||||
|
docData.put("occurTime", condolence.getOccurTime());
|
||||||
|
|
||||||
|
docData2.put("type", "会员职工去世慰问");
|
||||||
|
docData2.put("money", "3000");
|
||||||
|
docData2.put("money_big", "叁仟元整");
|
||||||
|
}else if (("1a2f7e8decb649a6ba8ca76e2af07779").equals(type)){
|
||||||
|
fileName = "工会会员退休慰问报销审批单"+ "_" +
|
||||||
|
DateUtil.format(createTime, "yyyyMMdd") + ".docx";
|
||||||
|
templateName = "condolence_retirement";
|
||||||
|
|
||||||
|
docData.put("type", "会员退休慰问");
|
||||||
|
docData.put("way", "工会统一发放慰问信及慰问卷");
|
||||||
|
docData.put("occurTime", condolence.getOccurTime());
|
||||||
|
|
||||||
|
docData2.put("type", "会员退休慰问");
|
||||||
|
docData2.put("money", "1000");
|
||||||
|
docData2.put("money_big", "壹仟元整");
|
||||||
|
} else {
|
||||||
|
fileName = "工会会员慰问报销审批单"+ "_" +
|
||||||
|
DateUtil.format(createTime, "yyyyMMdd") + ".docx";
|
||||||
|
templateName = "condolence_other";
|
||||||
|
|
||||||
|
docData.put("type", "会员其他慰问");
|
||||||
|
docData.put("way", "现金");
|
||||||
|
docData.put("occurTime", condolence.getOccurTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
List<ProcessTaskVO> doneTaskVos = new ArrayList<>();
|
||||||
|
List<ProcessTask> doneTaskList = flowEngine.processTaskService().getDoneTaskList(info.getLong("instanceId"), null);
|
||||||
|
for (ProcessTask doneTask : doneTaskList) {
|
||||||
|
ProcessTaskVO taskVO = flowEngine.processTaskService().findById(doneTask.getId());
|
||||||
|
doneTaskVos.add(taskVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 分工会审核
|
||||||
|
doneTaskVos.stream().filter(task -> "分工会审核".equals(task.getDisplayName()))
|
||||||
|
.max(Comparator.comparing(ProcessTaskVO::getCreatedAt))
|
||||||
|
.ifPresent(v -> {
|
||||||
|
Dict taskFormData = v.getTaskFormData();
|
||||||
|
HashMap<String, Object> approval = new HashMap<>();
|
||||||
|
|
||||||
|
approval.put("date", DateUtil.format(v.getFinishTime(), "yyyy年MM月dd日"));
|
||||||
|
approval.put("user", taskFormData.getStr("tf_userName"));
|
||||||
|
if (StrUtil.isNotBlank(taskFormData.getStr("tf_sign"))) {
|
||||||
|
approval.put("sign", sysOfficeTemplateUtil.createPictureRenderData(taskFormData.getStr("tf_sign")));
|
||||||
|
}
|
||||||
|
approval.put("opinion", taskFormData.getStr("tf_opinion"));
|
||||||
|
docData.put("fgh", approval);
|
||||||
|
docData2.put("fgh", approval);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 校工会副主席审核
|
||||||
|
doneTaskVos.stream().filter(task -> "校工会审核".equals(task.getDisplayName()))
|
||||||
|
.max(Comparator.comparing(ProcessTaskVO::getCreatedAt))
|
||||||
|
.ifPresent(v -> {
|
||||||
|
Dict taskFormData = v.getTaskFormData();
|
||||||
|
HashMap<String, Object> approval = new HashMap<>();
|
||||||
|
|
||||||
|
approval.put("date", DateUtil.format(v.getFinishTime(), "yyyy年MM月dd日"));
|
||||||
|
approval.put("user", taskFormData.getStr("tf_userName"));
|
||||||
|
if (StrUtil.isNotBlank(taskFormData.getStr("tf_sign"))) {
|
||||||
|
approval.put("sign", sysOfficeTemplateUtil.createPictureRenderData(taskFormData.getStr("tf_sign")));
|
||||||
|
}
|
||||||
|
approval.put("opinion", taskFormData.getStr("tf_opinion"));
|
||||||
|
docData.put("xzx", approval);
|
||||||
|
docData2.put("xzx", approval);
|
||||||
|
});
|
||||||
|
|
||||||
|
response.setContentType("application/octet-stream");
|
||||||
|
response.setHeader("content-disposition", "attachment;filename="
|
||||||
|
+ URLEncoder.encode("报销审批单.zip", "UTF-8"));
|
||||||
|
|
||||||
|
try (ZipOutputStream zipOut = new ZipOutputStream(response.getOutputStream())) {
|
||||||
|
ZipEntry zipEntry = new ZipEntry(fileName);
|
||||||
|
zipOut.putNextEntry(zipEntry);
|
||||||
|
|
||||||
|
try (ByteArrayOutputStream wordOut = new ByteArrayOutputStream()) {
|
||||||
|
XWPFTemplate.compile(sysOfficeTemplateUtil.getTemplate(templateName))
|
||||||
|
.render(docData)
|
||||||
|
.writeAndClose(wordOut);
|
||||||
|
zipOut.write(wordOut.toByteArray());
|
||||||
|
}
|
||||||
|
|
||||||
|
zipOut.closeEntry();
|
||||||
|
|
||||||
|
String fileName2 = "武汉城市职业学院报销审批单" + ".docx";
|
||||||
|
ZipEntry zipEntry2 = new ZipEntry(fileName2);
|
||||||
|
zipOut.putNextEntry(zipEntry2);
|
||||||
|
|
||||||
|
try (ByteArrayOutputStream wordOut2 = new ByteArrayOutputStream()) {
|
||||||
|
XWPFTemplate.compile(sysOfficeTemplateUtil.getTemplate("reimbursement_approval"))
|
||||||
|
.render(docData2)
|
||||||
|
.writeAndClose(wordOut2);
|
||||||
|
zipOut.write(wordOut2.toByteArray());
|
||||||
|
}
|
||||||
|
|
||||||
|
zipOut.closeEntry();
|
||||||
|
zipOut.finish();
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error("导出 ZIP 文件失败,ID: {}, 错误信息: {}", id, e.getMessage());
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -293,4 +293,9 @@ public class Condolence extends BaseModel {
|
|||||||
@ColDefine(type = ColType.INT)
|
@ColDefine(type = ColType.INT)
|
||||||
private Integer thisYearHospitalizationNum;
|
private Integer thisYearHospitalizationNum;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@Comment("与会员的关系")
|
||||||
|
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||||
|
private String relation;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -380,7 +380,7 @@ let ACTIVITY_SPORTS_ADD_ACTIVITY = {
|
|||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="8" v-if="formData.applyType===2&&projectType==='1'">
|
<el-col :span="8" v-if="formData.applyType===2&&projectType==='1'">
|
||||||
<el-form-item prop="restrictRegNumber" label="每人限报项目(如是单项趣味这不受此控制)"
|
<el-form-item prop="restrictRegNumber" label="每人限报项目(如是单项趣味则不受此控制)"
|
||||||
class="restrictTotalTeam">
|
class="restrictTotalTeam">
|
||||||
<el-input-number style="width: 100%" v-model="eventForm.restrictRegNumber"
|
<el-input-number style="width: 100%" v-model="eventForm.restrictRegNumber"
|
||||||
placeholder="请填写每人限报项目数" controls-position="right" :precision="0"
|
placeholder="请填写每人限报项目数" controls-position="right" :precision="0"
|
||||||
|
|||||||
@@ -99,7 +99,15 @@ layout("/layouts/platform.html"){
|
|||||||
:max="10000"></el-input>
|
:max="10000"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="慰问时间">
|
<el-descriptions-item >
|
||||||
|
<template slot="label">
|
||||||
|
<span v-if="formData.type === '6fb2ae129e674c0dbadc21d9abc22943'">结婚时间</span>
|
||||||
|
<span v-else-if="formData.type === 'c90cb10dce6542e99ae271bee6fe8cc0'">生育时间</span>
|
||||||
|
<span v-else-if="formData.type === '1a2f7e8decb649a6ba8ca76e2af07779'">退休时间</span>
|
||||||
|
<span v-else-if="formData.type === '4e316737e71047e0b01aea78524c1416'">死亡时间</span>
|
||||||
|
<span v-else-if="formData.type === 'b8ee30faacb2469593dfedb5b52565aa'">死亡时间</span>
|
||||||
|
<span v-else>慰问时间</span>
|
||||||
|
</template>
|
||||||
<el-form-item label="慰问时间" prop="occurTime">
|
<el-form-item label="慰问时间" prop="occurTime">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
clearable
|
clearable
|
||||||
@@ -107,11 +115,18 @@ layout("/layouts/platform.html"){
|
|||||||
v-model="formData.occurTime"
|
v-model="formData.occurTime"
|
||||||
type="date"
|
type="date"
|
||||||
value-format="yyyy-MM-dd"
|
value-format="yyyy-MM-dd"
|
||||||
placeholder="请选择慰问时间">
|
placeholder="请选择时间">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
|
|
||||||
|
<el-descriptions-item label="与会员的关系" v-if="formData.type === '4e316737e71047e0b01aea78524c1416'">
|
||||||
|
<el-form-item prop="relation" label="与会员的关系">
|
||||||
|
<el-input maxlength="20" v-model="formData.relation" placeholder="请填写与会员的关系"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-descriptions-item>
|
||||||
|
|
||||||
<el-descriptions-item label="收款账户">
|
<el-descriptions-item label="收款账户">
|
||||||
<el-form-item prop="bankCardNumber" label="收款账户">
|
<el-form-item prop="bankCardNumber" label="收款账户">
|
||||||
<el-input maxlength="20" v-model="formData.bankCardNumber" placeholder="请填写收款账户"
|
<el-input maxlength="20" v-model="formData.bankCardNumber" placeholder="请填写收款账户"
|
||||||
@@ -135,7 +150,7 @@ layout("/layouts/platform.html"){
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
|
|
||||||
<template v-if="['2'].includes(formData.typeCode)">
|
<template v-if="['2','3'].includes(formData.typeCode)">
|
||||||
<el-descriptions-item label="入院时间">
|
<el-descriptions-item label="入院时间">
|
||||||
<el-form-item label="入院时间" prop="hospitalizationTime">
|
<el-form-item label="入院时间" prop="hospitalizationTime">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
|
|||||||
@@ -15,11 +15,21 @@ const condolenceInfo = {
|
|||||||
<el-descriptions-item label="证明人">{{ viewData.certifierUserName }}</el-descriptions-item>
|
<el-descriptions-item label="证明人">{{ viewData.certifierUserName }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="慰问类型">{{ viewData.typeName }}</el-descriptions-item>
|
<el-descriptions-item label="慰问类型">{{ viewData.typeName }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="慰问金额">{{ viewData.money }}</el-descriptions-item>
|
<el-descriptions-item label="慰问金额">{{ viewData.money }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="慰问时间">{{ viewData.occurTime }}</el-descriptions-item>
|
<el-descriptions-item >
|
||||||
|
<template slot="label">
|
||||||
|
<span v-if="viewData.type === '6fb2ae129e674c0dbadc21d9abc22943'">结婚时间</span>
|
||||||
|
<span v-else-if="viewData.type === 'c90cb10dce6542e99ae271bee6fe8cc0'">生育时间</span>
|
||||||
|
<span v-else-if="viewData.type === '1a2f7e8decb649a6ba8ca76e2af07779'">退休时间</span>
|
||||||
|
<span v-else-if="viewData.type === '4e316737e71047e0b01aea78524c1416'">死亡时间</span>
|
||||||
|
<span v-else-if="viewData.type === 'b8ee30faacb2469593dfedb5b52565aa'">死亡时间</span>
|
||||||
|
<span v-else>慰问时间</span>
|
||||||
|
</template>
|
||||||
|
{{ viewData.occurTime }}
|
||||||
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="收款账户">{{ viewData.bankCardNumber }}</el-descriptions-item>
|
<el-descriptions-item label="收款账户">{{ viewData.bankCardNumber }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="户名">{{ viewData.bankUserName }}</el-descriptions-item>
|
<el-descriptions-item label="户名">{{ viewData.bankUserName }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="开户行">{{ viewData.bankOfDeposit }}</el-descriptions-item>
|
<el-descriptions-item label="开户行">{{ viewData.bankOfDeposit }}</el-descriptions-item>
|
||||||
<template v-if="['2'].includes(viewData.typeCode)">
|
<template v-if="['2','3'].includes(viewData.typeCode)">
|
||||||
<el-descriptions-item label="入院时间">{{ viewData.hospitalizationTime }}</el-descriptions-item>
|
<el-descriptions-item label="入院时间">{{ viewData.hospitalizationTime }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="出院时间">{{ viewData.leaveHospitalTime }}</el-descriptions-item>
|
<el-descriptions-item label="出院时间">{{ viewData.leaveHospitalTime }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="当年第几次住院">{{ viewData.thisYearHospitalizationNum }}
|
<el-descriptions-item label="当年第几次住院">{{ viewData.thisYearHospitalizationNum }}
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ layout("/layouts/platform.html"){
|
|||||||
<el-button @click="onView(row)" size="mini" type="primary">查看</el-button>
|
<el-button @click="onView(row)" size="mini" type="primary">查看</el-button>
|
||||||
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onEdit(row)" size="mini" type="primary">编辑</el-button>
|
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onEdit(row)" size="mini" type="primary">编辑</el-button>
|
||||||
<el-button v-if="row.canRevoke" size="mini" type="danger" @click="onRevoke(row)">撤回</el-button>
|
<el-button v-if="row.canRevoke" size="mini" type="danger" @click="onRevoke(row)">撤回</el-button>
|
||||||
|
<el-button v-if="row.instanceState === 20" @click="doExport(row)" size="mini" type="primary">导出报销单</el-button>
|
||||||
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onDelete(row.id)" size="mini" type="danger">
|
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onDelete(row.id)" size="mini" type="danger">
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -102,6 +103,9 @@ layout("/layouts/platform.html"){
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
doExport(row) {
|
||||||
|
window.location.href = "/platform/condolence/mine/doExport?id=" + (row.id || '')
|
||||||
|
},
|
||||||
onAdd() {
|
onAdd() {
|
||||||
commonUtil.pjaxPush('/platform/condolence/apply')
|
commonUtil.pjaxPush('/platform/condolence/apply')
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -173,10 +173,10 @@ layout("/layouts/platform_h5.html"){
|
|||||||
<van-field
|
<van-field
|
||||||
v-model="formData.occurTime"
|
v-model="formData.occurTime"
|
||||||
name="occurTime"
|
name="occurTime"
|
||||||
label="慰问时间"
|
:label="getDynamicLabel()"
|
||||||
required
|
required
|
||||||
:rules="[{ required: true }]"
|
:rules="[{ required: true }]"
|
||||||
placeholder="请点击选择慰问时间"
|
placeholder="请点击选择时间"
|
||||||
clickable
|
clickable
|
||||||
is-link
|
is-link
|
||||||
readonly
|
readonly
|
||||||
@@ -227,7 +227,7 @@ layout("/layouts/platform_h5.html"){
|
|||||||
name="bankOfDeposit"
|
name="bankOfDeposit"
|
||||||
></van-field>
|
></van-field>
|
||||||
|
|
||||||
<template v-if="['2'].includes(formData.typeCode)">
|
<template v-if="['2','3'].includes(formData.typeCode)">
|
||||||
<van-field
|
<van-field
|
||||||
v-model="formData.hospitalizationTime"
|
v-model="formData.hospitalizationTime"
|
||||||
name="hospitalizationTime"
|
name="hospitalizationTime"
|
||||||
@@ -370,6 +370,21 @@ layout("/layouts/platform_h5.html"){
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getDynamicLabel() {
|
||||||
|
switch (this.formData.type) {
|
||||||
|
case '6fb2ae129e674c0dbadc21d9abc22943':
|
||||||
|
return '结婚时间';
|
||||||
|
case 'c90cb10dce6542e99ae271bee6fe8cc0':
|
||||||
|
return '生育时间';
|
||||||
|
case '1a2f7e8decb649a6ba8ca76e2af07779':
|
||||||
|
return '退休时间';
|
||||||
|
case '4e316737e71047e0b01aea78524c1416':
|
||||||
|
case 'b8ee30faacb2469593dfedb5b52565aa':
|
||||||
|
return '死亡时间';
|
||||||
|
default:
|
||||||
|
return '慰问时间';
|
||||||
|
}
|
||||||
|
},
|
||||||
// 选择出院时间
|
// 选择出院时间
|
||||||
showLeaveHospitalTimePickerClick() {
|
showLeaveHospitalTimePickerClick() {
|
||||||
if (this.formData.leaveHospitalTime) {
|
if (this.formData.leaveHospitalTime) {
|
||||||
|
|||||||
@@ -14,13 +14,23 @@ const condolenceInfo = {
|
|||||||
<van-cell title="证明人">{{ viewData.certifierUserName }}</van-cell>
|
<van-cell title="证明人">{{ viewData.certifierUserName }}</van-cell>
|
||||||
<van-cell title="慰问类型">{{ viewData.typeName }}</van-cell>
|
<van-cell title="慰问类型">{{ viewData.typeName }}</van-cell>
|
||||||
<van-cell title="慰问金额">{{ viewData.money }}</van-cell>
|
<van-cell title="慰问金额">{{ viewData.money }}</van-cell>
|
||||||
<van-cell title="慰问时间">{{ viewData.occurTime }}</van-cell>
|
<van-cell>
|
||||||
|
<template #title>
|
||||||
|
<span v-if="viewData.type === '6fb2ae129e674c0dbadc21d9abc22943'">结婚时间</span>
|
||||||
|
<span v-else-if="viewData.type === 'c90cb10dce6542e99ae271bee6fe8cc0'">生育时间</span>
|
||||||
|
<span v-else-if="viewData.type === '1a2f7e8decb649a6ba8ca76e2af07779'">退休时间</span>
|
||||||
|
<span v-else-if="viewData.type === '4e316737e71047e0b01aea78524c1416'">死亡时间</span>
|
||||||
|
<span v-else-if="viewData.type === 'b8ee30faacb2469593dfedb5b52565aa'">死亡时间</span>
|
||||||
|
<span v-else>慰问时间</span>
|
||||||
|
</template>
|
||||||
|
{{ viewData.occurTime }}
|
||||||
|
</van-cell>
|
||||||
<van-cell title="收款账户">{{ viewData.bankCardNumber }}</van-cell>
|
<van-cell title="收款账户">{{ viewData.bankCardNumber }}</van-cell>
|
||||||
<van-cell title="户名">{{ viewData.bankUserName }}</van-cell>
|
<van-cell title="户名">{{ viewData.bankUserName }}</van-cell>
|
||||||
<van-cell class="direction-column-cell" title="开户行">
|
<van-cell class="direction-column-cell" title="开户行">
|
||||||
{{ viewData.bankOfDeposit || '暂无' }}
|
{{ viewData.bankOfDeposit || '暂无' }}
|
||||||
</van-cell>
|
</van-cell>
|
||||||
<template v-if="['2'].includes(viewData.typeCode)">
|
<template v-if="['2','3'].includes(viewData.typeCode)">
|
||||||
<van-cell title="入院时间">{{ viewData.hospitalizationTime }}</van-cell>
|
<van-cell title="入院时间">{{ viewData.hospitalizationTime }}</van-cell>
|
||||||
<van-cell title="出院时间">{{ viewData.leaveHospitalTime }}</van-cell>
|
<van-cell title="出院时间">{{ viewData.leaveHospitalTime }}</van-cell>
|
||||||
<van-cell title="当年第几次住院(次)">{{ viewData.thisYearHospitalizationNum }}</van-cell>
|
<van-cell title="当年第几次住院(次)">{{ viewData.thisYearHospitalizationNum }}</van-cell>
|
||||||
|
|||||||
Reference in New Issue
Block a user