bug修改
This commit is contained in:
+9
@@ -87,6 +87,9 @@ public class ActivityReimbursementApplyController {
|
|||||||
.mapToDouble(v -> ObjectUtil.defaultIfNull(v.getActualPrice(), 0D))
|
.mapToDouble(v -> ObjectUtil.defaultIfNull(v.getActualPrice(), 0D))
|
||||||
.sum();
|
.sum();
|
||||||
activityReimbursementInfo.setActualMoney(new BigDecimal(sum));
|
activityReimbursementInfo.setActualMoney(new BigDecimal(sum));
|
||||||
|
if (StrUtil.isBlank(activityReimbursementInfo.getDeclareId())) {
|
||||||
|
activityReimbursementInfo.setDeclareId(activityReimbursementInfo.getId());
|
||||||
|
}
|
||||||
dao.insertOrUpdate(activityReimbursementInfo);
|
dao.insertOrUpdate(activityReimbursementInfo);
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
@@ -107,6 +110,9 @@ public class ActivityReimbursementApplyController {
|
|||||||
.mapToDouble(v -> ObjectUtil.defaultIfNull(v.getActualPrice(), 0D))
|
.mapToDouble(v -> ObjectUtil.defaultIfNull(v.getActualPrice(), 0D))
|
||||||
.sum();
|
.sum();
|
||||||
activityReimbursementInfo.setActualMoney(new BigDecimal(sum));
|
activityReimbursementInfo.setActualMoney(new BigDecimal(sum));
|
||||||
|
if (StrUtil.isBlank(activityReimbursementInfo.getDeclareId())) {
|
||||||
|
activityReimbursementInfo.setDeclareId(activityReimbursementInfo.getId());
|
||||||
|
}
|
||||||
dao.insertOrUpdate(activityReimbursementInfo);
|
dao.insertOrUpdate(activityReimbursementInfo);
|
||||||
|
|
||||||
// 开启流程实例
|
// 开启流程实例
|
||||||
@@ -140,6 +146,9 @@ public class ActivityReimbursementApplyController {
|
|||||||
.mapToDouble(v -> ObjectUtil.defaultIfNull(v.getActualPrice(), 0D))
|
.mapToDouble(v -> ObjectUtil.defaultIfNull(v.getActualPrice(), 0D))
|
||||||
.sum();
|
.sum();
|
||||||
activityReimbursementInfo.setActualMoney(new BigDecimal(sum));
|
activityReimbursementInfo.setActualMoney(new BigDecimal(sum));
|
||||||
|
if (StrUtil.isBlank(activityReimbursementInfo.getDeclareId())) {
|
||||||
|
activityReimbursementInfo.setDeclareId(activityReimbursementInfo.getId());
|
||||||
|
}
|
||||||
dao.insertOrUpdate(activityReimbursementInfo);
|
dao.insertOrUpdate(activityReimbursementInfo);
|
||||||
|
|
||||||
Dict dict = Dict.create();
|
Dict dict = Dict.create();
|
||||||
|
|||||||
+205
@@ -1,19 +1,34 @@
|
|||||||
package com.budwk.app.zhgh.activity.declarereimbursement.reimbursement.controller;
|
package com.budwk.app.zhgh.activity.declarereimbursement.reimbursement.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import cn.hutool.core.convert.NumberChineseFormatter;
|
||||||
|
import cn.hutool.core.convert.NumberWordFormatter;
|
||||||
|
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.result.Result;
|
import com.budwk.app.base.result.Result;
|
||||||
|
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||||
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.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.web.commons.base.Globals;
|
||||||
import com.budwk.app.zhgh.activity.declarereimbursement.reimbursement.models.ActivityReimbursementInfo;
|
import com.budwk.app.zhgh.activity.declarereimbursement.reimbursement.models.ActivityReimbursementInfo;
|
||||||
import com.budwk.app.zhgh.activity.declarereimbursement.reimbursement.service.ActivityReimbursementService;
|
import com.budwk.app.zhgh.activity.declarereimbursement.reimbursement.service.ActivityReimbursementService;
|
||||||
|
import com.budwk.app.zhgh.activity.declarereimbursement.vo.ActivityBudgetVO;
|
||||||
import com.budwk.app.zhgh.activity.declarereimbursement.vo.CommonPageParam;
|
import com.budwk.app.zhgh.activity.declarereimbursement.vo.CommonPageParam;
|
||||||
|
import com.deepoove.poi.XWPFTemplate;
|
||||||
|
import com.deepoove.poi.config.Configure;
|
||||||
|
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
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.Dao;
|
||||||
@@ -28,6 +43,11 @@ import org.nutz.mvc.annotation.Ok;
|
|||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
@@ -38,6 +58,7 @@ import javax.validation.Valid;
|
|||||||
*/
|
*/
|
||||||
@IocBean
|
@IocBean
|
||||||
@Ok("json")
|
@Ok("json")
|
||||||
|
@Slf4j
|
||||||
@ApiOperation("我的活动报销")
|
@ApiOperation("我的活动报销")
|
||||||
@At("/platform/activityReimbursement/mine")
|
@At("/platform/activityReimbursement/mine")
|
||||||
public class ActivityReimbursementMineController {
|
public class ActivityReimbursementMineController {
|
||||||
@@ -47,6 +68,8 @@ public class ActivityReimbursementMineController {
|
|||||||
@Inject
|
@Inject
|
||||||
private FlowEngine flowEngine;
|
private FlowEngine flowEngine;
|
||||||
@Inject
|
@Inject
|
||||||
|
private SysOfficeTemplateUtil sysOfficeTemplateUtil;
|
||||||
|
@Inject
|
||||||
private ActivityReimbursementService activityReimbursementService;
|
private ActivityReimbursementService activityReimbursementService;
|
||||||
|
|
||||||
@At("")
|
@At("")
|
||||||
@@ -62,6 +85,7 @@ public class ActivityReimbursementMineController {
|
|||||||
Sql sql = Sqls.create("""
|
Sql sql = Sqls.create("""
|
||||||
SELECT
|
SELECT
|
||||||
info.id,
|
info.id,
|
||||||
|
info.declareId,
|
||||||
info.userName,
|
info.userName,
|
||||||
info.loginName,
|
info.loginName,
|
||||||
info.applyTime,
|
info.applyTime,
|
||||||
@@ -136,4 +160,185 @@ public class ActivityReimbursementMineController {
|
|||||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@At
|
||||||
|
@Ok("void")
|
||||||
|
@SaCheckPermission("activityReimbursement.mine")
|
||||||
|
@SLog(tag = "活动报销", msg = "导出报销凭证")
|
||||||
|
public void doExportReimbursement(@Valid String id, HttpServletResponse response) {
|
||||||
|
HashMap<String, Object> docData = new HashMap<>();
|
||||||
|
|
||||||
|
Sql sql = Sqls.create("""
|
||||||
|
SELECT
|
||||||
|
info.*,
|
||||||
|
ins.id AS instanceId
|
||||||
|
FROM
|
||||||
|
`activity_reimbursement_info` 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();
|
||||||
|
|
||||||
|
String activityContent = info.getString("activityContent");
|
||||||
|
info.put("activityContent", sysOfficeTemplateUtil.convertRichTextToDocText(activityContent));
|
||||||
|
|
||||||
|
double actualMoneyNum = info.getDouble("actualMoney");
|
||||||
|
|
||||||
|
// 添加预算金额转换逻辑
|
||||||
|
String actualMoneyChinese = NumberChineseFormatter.format(info.getDouble("actualMoney"), false);
|
||||||
|
info.put("actualMoney", actualMoneyChinese);
|
||||||
|
|
||||||
|
docData.put("schoolName", Globals.AppName);
|
||||||
|
docData.put("info", info);
|
||||||
|
// 使用BigDecimal确保精确处理
|
||||||
|
BigDecimal bd = BigDecimal.valueOf(actualMoneyNum).setScale(2, RoundingMode.HALF_UP);
|
||||||
|
String moneyStr = bd.toPlainString();
|
||||||
|
|
||||||
|
// 分割整数和小数部分
|
||||||
|
String[] parts = moneyStr.split("\\.");
|
||||||
|
String integerPart = parts[0];
|
||||||
|
String decimalPart = parts.length > 1 ? parts[1] : "00";
|
||||||
|
|
||||||
|
// 确保小数部分是两位
|
||||||
|
if (decimalPart.length() < 2) {
|
||||||
|
decimalPart = String.format("%-2s", decimalPart).replace(' ', '0');
|
||||||
|
} else if (decimalPart.length() > 2) {
|
||||||
|
decimalPart = decimalPart.substring(0, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理小数部分(角和分)
|
||||||
|
int jiao = 0, fen = 0;
|
||||||
|
if (decimalPart.length() >= 1) jiao = Character.getNumericValue(decimalPart.charAt(0));
|
||||||
|
if (decimalPart.length() >= 2) fen = Character.getNumericValue(decimalPart.charAt(1));
|
||||||
|
|
||||||
|
// 处理整数部分(各位数值)
|
||||||
|
String reversed = new StringBuilder(integerPart).reverse().toString();
|
||||||
|
String[] units = {"元", "十位", "百位", "千位", "万位", "十万位", "百万位"};
|
||||||
|
Map<String, Integer> digits = new HashMap<>();
|
||||||
|
|
||||||
|
for (int i = 0; i < reversed.length(); i++) {
|
||||||
|
if (i >= units.length) break;
|
||||||
|
digits.put(units[i], Character.getNumericValue(reversed.charAt(i)));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 按照one到nine的顺序设置字段(从百万位到分位)
|
||||||
|
Map<String, Object> digitFields = new HashMap<>();
|
||||||
|
|
||||||
|
// one: 百万位
|
||||||
|
digitFields.put("one", digits.getOrDefault("百万位", 0));
|
||||||
|
// two: 十万位
|
||||||
|
digitFields.put("two", digits.getOrDefault("十万位", 0));
|
||||||
|
// three: 万位
|
||||||
|
digitFields.put("three", digits.getOrDefault("万位", 0));
|
||||||
|
// four: 千位
|
||||||
|
digitFields.put("four", digits.getOrDefault("千位", 0));
|
||||||
|
// five: 百位
|
||||||
|
digitFields.put("five", digits.getOrDefault("百位", 0));
|
||||||
|
// six: 十位
|
||||||
|
digitFields.put("six", digits.getOrDefault("十位", 0));
|
||||||
|
// seven: 元位
|
||||||
|
digitFields.put("seven", digits.getOrDefault("元", 0));
|
||||||
|
// eight: 角
|
||||||
|
digitFields.put("eight", jiao);
|
||||||
|
// nine: 分
|
||||||
|
digitFields.put("nine", fen);
|
||||||
|
|
||||||
|
// 将数字字段添加到info中
|
||||||
|
info.putAll(digitFields);
|
||||||
|
|
||||||
|
|
||||||
|
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);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 协会负责人审核
|
||||||
|
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("xh", 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("xfzr", 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);
|
||||||
|
});
|
||||||
|
|
||||||
|
String budgetsStr2 = info.getString("budgets");
|
||||||
|
List<ActivityReimbursementInfo> list = JSONUtil.parseArray(budgetsStr2).toList(ActivityReimbursementInfo.class);
|
||||||
|
|
||||||
|
docData.put("budgets", list);
|
||||||
|
|
||||||
|
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
|
||||||
|
Configure config = Configure.builder()
|
||||||
|
.bind("budgets", policy)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
String fileName = Globals.AppName + "【" + info.getString("activityName") + "】报销凭证表.docx";
|
||||||
|
|
||||||
|
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {
|
||||||
|
XWPFTemplate.compile(sysOfficeTemplateUtil.getTemplate("activity_reimbursement_voucher"), config).render(docData).writeAndClose(byteArrayOutputStream);
|
||||||
|
CommonDownloadUtil.download(fileName, byteArrayOutputStream.toByteArray(), response);
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error("报销凭证表导出失败,id:{},错误信息:{}", id, e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-1
@@ -102,7 +102,9 @@ public class ArticleExamineController {
|
|||||||
""");
|
""");
|
||||||
Cnd cnd = Cnd.NEW();
|
Cnd cnd = Cnd.NEW();
|
||||||
cnd.and("t.taskName", "=", "27f618b9-bff8-4382-87c9-d9abd9f5963c");
|
cnd.and("t.taskName", "=", "27f618b9-bff8-4382-87c9-d9abd9f5963c");
|
||||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
if(!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())){
|
||||||
|
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||||
|
}
|
||||||
|
|
||||||
if (approval) {
|
if (approval) {
|
||||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||||
|
|||||||
+4
@@ -86,6 +86,10 @@ public class ArticleMineController {
|
|||||||
Cnd cnd = Cnd.NEW();
|
Cnd cnd = Cnd.NEW();
|
||||||
cnd.and("info.createdBy", "=", SecurityUtil.getUserId());
|
cnd.and("info.createdBy", "=", SecurityUtil.getUserId());
|
||||||
cnd.andEX("YEAR(info.submitTime)", "=", pageForm.getYear());
|
cnd.andEX("YEAR(info.submitTime)", "=", pageForm.getYear());
|
||||||
|
// 添加标题模糊查询,仅当标题不为空时
|
||||||
|
if (pageForm.getTitle() != null && !pageForm.getTitle().trim().isEmpty()) {
|
||||||
|
cnd.andEX("info.title", "LIKE", "%" + pageForm.getTitle().trim() + "%");
|
||||||
|
}
|
||||||
cnd.desc("info.submitTime");
|
cnd.desc("info.submitTime");
|
||||||
sql.setCondition(cnd);
|
sql.setCondition(cnd);
|
||||||
Pagination<NutMap> pageVO = articleService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
Pagination<NutMap> pageVO = articleService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||||
|
|||||||
+5
-1
@@ -2,12 +2,14 @@ package com.budwk.app.zhgh.dayofficework.article.controller;
|
|||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
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.result.Result;
|
import com.budwk.app.base.result.Result;
|
||||||
import com.budwk.app.base.utils.PageUtil;
|
import com.budwk.app.base.utils.PageUtil;
|
||||||
import com.budwk.app.bpm.service.BpmService;
|
import com.budwk.app.bpm.service.BpmService;
|
||||||
import com.budwk.app.flow.engine.FlowEngine;
|
import com.budwk.app.flow.engine.FlowEngine;
|
||||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||||
|
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.web.controllers.open.commons.service.CommonService;
|
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||||
import com.budwk.app.zhgh.dayofficework.article.param.ArticleInfoPageParam;
|
import com.budwk.app.zhgh.dayofficework.article.param.ArticleInfoPageParam;
|
||||||
@@ -87,7 +89,9 @@ public class ArticleSchoolUnionApprovalController {
|
|||||||
""");
|
""");
|
||||||
Cnd cnd = Cnd.NEW();
|
Cnd cnd = Cnd.NEW();
|
||||||
cnd.and("t.taskName", "=", "749b6917-58ba-4564-8701-4bd2491fcb98");
|
cnd.and("t.taskName", "=", "749b6917-58ba-4564-8701-4bd2491fcb98");
|
||||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
if(!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())){
|
||||||
|
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||||
|
}
|
||||||
|
|
||||||
if (approval) {
|
if (approval) {
|
||||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||||
|
|||||||
+7
-2
@@ -93,7 +93,8 @@ layout("/layouts/platform.html"){
|
|||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onDelete(row.id)" size="mini" type="danger">删除</el-button>
|
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onDelete(row.id)" size="mini" type="danger">删除</el-button>
|
||||||
|
|
||||||
<el-button @click="doExport(row)">导出</el-button>
|
<el-button @click="doExport(row)" size="mini">申请</el-button>
|
||||||
|
<el-button @click="doExportReimbursement(row)" size="mini">报销</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -144,7 +145,11 @@ layout("/layouts/platform.html"){
|
|||||||
methods: {
|
methods: {
|
||||||
// 导出示例
|
// 导出示例
|
||||||
doExport(row){
|
doExport(row){
|
||||||
this.$downLoad('/platform/activityDeclare/mine?id=' + row.declareId)
|
this.$downLoad('/platform/activityDeclare/mine/doExport?id=' + row.declareId)
|
||||||
|
},
|
||||||
|
// 导出报销凭证
|
||||||
|
doExportReimbursement(row){
|
||||||
|
this.$downLoad('/platform/activityReimbursement/mine/doExportReimbursement?id=' + row.id)
|
||||||
},
|
},
|
||||||
onApply() {
|
onApply() {
|
||||||
window.location.href = '/platform/activityReimbursement/apply'
|
window.location.href = '/platform/activityReimbursement/apply'
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ const ARTICLE_INFO = {
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
|
store,
|
||||||
dicts: ["PROCESS_TASK_SUBMIT_TYPE"],
|
dicts: ["PROCESS_TASK_SUBMIT_TYPE"],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ layout("/layouts/platform.html"){
|
|||||||
style="width: 100%"></el-date-picker>
|
style="width: 100%"></el-date-picker>
|
||||||
</search-item>
|
</search-item>
|
||||||
<search-item label="标题">
|
<search-item label="标题">
|
||||||
<el-input v-model="pageForm.title" placeholder="标题" clearable></el-input>
|
<el-input v-model="pageForm.title" placeholder="请输入标题" clearable></el-input>
|
||||||
</search-item>
|
</search-item>
|
||||||
</search>
|
</search>
|
||||||
</el-card>
|
</el-card>
|
||||||
@@ -35,7 +35,7 @@ layout("/layouts/platform.html"){
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" fixed="right" width="300px">
|
<el-table-column label="操作" fixed="right" width="300px">
|
||||||
<template slot-scope="{row}">
|
<template slot-scope="{row}">
|
||||||
<el-button @click="onOpen(row.id)" size="mini" type="primary">查看</el-button>
|
<el-button @click="onOpen(row)" size="mini" type="primary">查看</el-button>
|
||||||
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onEdit(row)"
|
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onEdit(row)"
|
||||||
size="mini" type="primary">编辑
|
size="mini" type="primary">编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|||||||
+68
-8
@@ -39,9 +39,24 @@ const basicForm = {
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item prop="unionId" label="工会"
|
||||||
|
:rules="[{required:true,message:'请选择工会',trigger:['change','blur']}]">
|
||||||
|
<el-select clearable filterable multiple style="width: 100%"
|
||||||
|
v-model="formData.unionId"
|
||||||
|
placeholder="请选择活动线路"
|
||||||
|
@change="onUnionChange">
|
||||||
|
<el-option :value="item.id"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
v-for="item in unionOptions"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item prop="unionQuotaAllocationList" label="工会名额分配">
|
<el-form-item prop="unionQuotaAllocationList" label="工会名额分配">
|
||||||
<el-table :data="formData.unionQuotaAllocationList" size="medium" height="70vh">
|
<el-table :data="filteredUnionQuotaAllocationList" size="medium" height="70vh">
|
||||||
<el-table-column type="index" label="序号"></el-table-column>
|
<el-table-column type="index" label="序号"></el-table-column>
|
||||||
<el-table-column label="工会名称" prop="unionName"></el-table-column>
|
<el-table-column label="工会名称" prop="unionName"></el-table-column>
|
||||||
<el-table-column label="会员人数" prop="memberNum"></el-table-column>
|
<el-table-column label="会员人数" prop="memberNum"></el-table-column>
|
||||||
@@ -87,13 +102,27 @@ const basicForm = {
|
|||||||
</el-row>
|
</el-row>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
`,
|
`,
|
||||||
mixins: [initTableMixins],
|
mixins: [initTableMixins],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
lineList: [],
|
lineList: [],
|
||||||
|
unionOptions: [],
|
||||||
|
allUnionQuotaAllocationList: [], // 保存所有工会名额分配数据
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
// 计算属性:根据选择的工会过滤显示的名额分配列表
|
||||||
|
filteredUnionQuotaAllocationList() {
|
||||||
|
// 如果没有选择任何工会,显示所有工会
|
||||||
|
if (!this.formData.unionId || this.formData.unionId.length === 0) {
|
||||||
|
return this.allUnionQuotaAllocationList;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果选择了工会,只显示选中的工会
|
||||||
|
return this.allUnionQuotaAllocationList.filter(item =>
|
||||||
|
this.formData.unionId.includes(item.unionId)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -107,32 +136,58 @@ const basicForm = {
|
|||||||
listUnion() {
|
listUnion() {
|
||||||
this.$axios.post("/platform/excellentRecuperation/activityList/listUnion").then(res => {
|
this.$axios.post("/platform/excellentRecuperation/activityList/listUnion").then(res => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.formData.unionQuotaAllocationList = res.data
|
this.allUnionQuotaAllocationList = res.data; // 保存所有数据
|
||||||
|
// 如果formData.unionQuotaAllocationList存在,则更新对应数据
|
||||||
|
if (this.formData.unionQuotaAllocationList) {
|
||||||
|
this.updateUnionQuotaAllocationList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 更新名额分配列表数据
|
||||||
|
updateUnionQuotaAllocationList() {
|
||||||
|
this.allUnionQuotaAllocationList.forEach(item => {
|
||||||
|
const existingItem = this.formData.unionQuotaAllocationList.find(
|
||||||
|
formDataItem => formDataItem.unionId === item.unionId
|
||||||
|
);
|
||||||
|
if (existingItem) {
|
||||||
|
item.allocationNum = existingItem.allocationNum || 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 工会选择变化时的处理
|
||||||
|
onUnionChange(selectedUnions) {
|
||||||
|
// 数据会自动根据计算属性更新显示
|
||||||
|
console.log("Selected unions:", selectedUnions);
|
||||||
|
},
|
||||||
clearUnionQuotaAllocation() {
|
clearUnionQuotaAllocation() {
|
||||||
this.$confirm("您确定要清空分配名额吗?", "提示", {
|
this.$confirm("您确定要清空分配名额吗?", "提示", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning"
|
type: "warning"
|
||||||
}).then(async () => {
|
}).then(async () => {
|
||||||
this.listUnion()
|
// 清空所有名额分配
|
||||||
|
this.allUnionQuotaAllocationList.forEach(item => {
|
||||||
|
this.$set(item, 'allocationNum', 0);
|
||||||
|
});
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onOpen(id) {
|
onOpen(id) {
|
||||||
this.formData = {}
|
this.formData = {}
|
||||||
this.$refs.formRef.clearValidate()
|
this.$refs.formRef.clearValidate()
|
||||||
this.getLineList()
|
this.getLineList()
|
||||||
|
this.listUnion(); // 始终加载所有工会数据
|
||||||
if (id) {
|
if (id) {
|
||||||
this.$axios.post("/platform/excellentRecuperation/activityList/findOne", {id}).then(res => {
|
this.$axios.post("/platform/excellentRecuperation/activityList/findOne", {id}).then(res => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.formData = res.data
|
this.formData = res.data
|
||||||
this.$set(this.formData, "signUpTime", [res.data.signUpStartTime, res.data.signUpEndTIme])
|
this.$set(this.formData, "signUpTime", [res.data.signUpStartTime, res.data.signUpEndTIme])
|
||||||
|
// 更新名额分配数据
|
||||||
|
if (this.allUnionQuotaAllocationList.length > 0) {
|
||||||
|
this.updateUnionQuotaAllocationList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
|
||||||
this.listUnion()
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
@@ -146,6 +201,8 @@ const basicForm = {
|
|||||||
const formData = clone(this.formData)
|
const formData = clone(this.formData)
|
||||||
formData.signUpStartTime = formData.signUpTime[0]
|
formData.signUpStartTime = formData.signUpTime[0]
|
||||||
formData.signUpEndTIme = formData.signUpTime[1]
|
formData.signUpEndTIme = formData.signUpTime[1]
|
||||||
|
// 传递过滤后的名额分配列表
|
||||||
|
formData.unionQuotaAllocationList = this.filteredUnionQuotaAllocationList;
|
||||||
const resp = await this.$axios.post("/platform/excellentRecuperation/activityList/onSubmit", {
|
const resp = await this.$axios.post("/platform/excellentRecuperation/activityList/onSubmit", {
|
||||||
data: JSON.stringify(formData)
|
data: JSON.stringify(formData)
|
||||||
})
|
})
|
||||||
@@ -157,6 +214,9 @@ const basicForm = {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
//工会查询
|
||||||
|
this.$businessTool.listUnion().then((res) => (this.unionOptions = res))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user