From c350485fbefbb93b8eb6d68420eec92feb1a2bd2 Mon Sep 17 00:00:00 2001 From: hongqiwei <1143662660@qq.com> Date: Wed, 14 Oct 2026 18:59:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E5=8C=96=E6=B4=BB=E5=8A=A8=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8=E6=97=B6=E9=97=B4=E5=8F=AF=E4=BB=A5=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E6=97=B6=E5=88=86=E7=A7=92=EF=BC=9B=E8=81=8C=E5=B7=A5=E6=85=B0?= =?UTF-8?q?=E9=97=AE=E6=94=B6=E6=AC=BE=E4=BA=BA=E5=9B=BA=E5=AE=9A=E4=B8=BA?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CondolenceApplyController.java | 13 ++---- .../condolence/service/CondolenceService.java | 6 +++ .../service/impl/CondolenceServiceImpl.java | 15 +++++++ .../activity/culture/common/applyActivity.js | 11 +++-- .../staffbenefit/condolence/apply/index.html | 38 +++-------------- .../staffbenefit/condolence/apply/index.html | 41 +------------------ 6 files changed, 38 insertions(+), 86 deletions(-) diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/controller/CondolenceApplyController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/controller/CondolenceApplyController.java index db85772..501be5a 100644 --- a/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/controller/CondolenceApplyController.java +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/controller/CondolenceApplyController.java @@ -3,7 +3,6 @@ package com.budwk.app.zhgh.staffbenefit.condolence.controller; import cn.dev33.satoken.annotation.SaCheckLogin; import cn.dev33.satoken.annotation.SaCheckPermission; 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 com.budwk.app.base.annotation.SLog; @@ -26,7 +25,6 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.dao.Cnd; -import org.nutz.dao.Dao; import org.nutz.dao.Sqls; import org.nutz.dao.sql.Sql; import org.nutz.dao.util.cri.SqlExpressionGroup; @@ -52,8 +50,6 @@ import java.util.List; @Ok("json:full") public class CondolenceApplyController { - @Inject - private Dao dao; @Inject private FlowEngine flowEngine; @Inject @@ -75,9 +71,9 @@ public class CondolenceApplyController { @ApiOperation("保存申请") @SaCheckPermission(value = {"condolence.apply", "h5.condolence.apply"}, mode = SaMode.OR) @SLog(tag = "职工慰问系统-慰问申请", msg = "保存申请") + @Aop(TransAop.READ_COMMITTED) public Result save(@Param("data") Condolence condolence) { - if(StrUtil.isBlank(condolence.getId())) condolence.setCreateTime(DateUtil.now()); - dao.insertOrUpdate(condolence); + condolenceService.saveApplication(condolence); return Result.success(); } @@ -87,8 +83,7 @@ public class CondolenceApplyController { @SLog(tag = "职工慰问系统-慰问申请", msg = "提交申请") @Aop(TransAop.READ_COMMITTED) public Result submit(@Param("data") Condolence condolence) { - if(StrUtil.isBlank(condolence.getId())) condolence.setCreateTime(DateUtil.now()); - dao.insertOrUpdate(condolence); + condolenceService.saveApplication(condolence); // 开启流程实例 Dict args = Dict.create(); args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode()); @@ -108,7 +103,7 @@ public class CondolenceApplyController { @Aop(TransAop.READ_COMMITTED) @SaCheckPermission(value = {"condolence.apply", "h5.condolence.apply"}, mode = SaMode.OR) public Result submitAgain(@Param("data") Condolence condolence, @Param("taskId") Long taskId) { - dao.insertOrUpdate(condolence); + condolenceService.saveApplication(condolence); Dict dict = Dict.create(); dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId); diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/service/CondolenceService.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/service/CondolenceService.java index 86c08be..fb80e99 100644 --- a/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/service/CondolenceService.java +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/service/CondolenceService.java @@ -14,6 +14,12 @@ import com.budwk.app.zhgh.staffbenefit.condolence.model.Condolence; * @Description TODO */ public interface CondolenceService extends BaseService { + /** + * 保存慰问申请,并使收款人始终与申请人一致;返回类型为 void,无返回数据。 + * @param condolence 表单中的慰问申请,申请人 ID、姓名和工号用于确定收款人 + */ + void saveApplication(Condolence condolence); + /** * 按工会备案节点查询慰问任务,节点尚未配置时返回空分页。 * @param pageForm 页码、每页条数、姓名/工号关键字及排序参数 diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/service/impl/CondolenceServiceImpl.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/service/impl/CondolenceServiceImpl.java index 7dea616..9d4432c 100644 --- a/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/service/impl/CondolenceServiceImpl.java +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/service/impl/CondolenceServiceImpl.java @@ -20,6 +20,8 @@ import org.nutz.lang.util.NutMap; import java.util.List; import lombok.extern.slf4j.Slf4j; import org.nutz.dao.Dao; +import org.nutz.aop.interceptor.ioc.TransAop; +import org.nutz.ioc.aop.Aop; import org.nutz.ioc.loader.annotation.IocBean; /** @@ -37,6 +39,19 @@ public class CondolenceServiceImpl extends BaseServiceImpl implement super(dao); } + @Override + @Aop(TransAop.READ_COMMITTED) + public void saveApplication(Condolence condolence) { + // 收款人以申请表中的申请人为准,覆盖旧草稿及请求中单独提交的收款人信息。 + condolence.setPayUserId(condolence.getApplyUserId()); + condolence.setPayUserName(condolence.getApplyUserName()); + condolence.setPayLoginName(condolence.getApplyLoginName()); + if (StrUtil.isBlank(condolence.getId())) { + condolence.setCreateTime(DateUtil.now()); + } + dao().insertOrUpdate(condolence); + } + // 工会备案的 wf 节点代码,与流程定义中的 taskName 保持一致。 private static final String UNION_RECORD_TASK_KEY = "80c3d6f8-978a-4f00-816e-338005240c7e"; diff --git a/src/main/resources/views/platform/zhgh/activity/culture/common/applyActivity.js b/src/main/resources/views/platform/zhgh/activity/culture/common/applyActivity.js index f489702..e615f33 100644 --- a/src/main/resources/views/platform/zhgh/activity/culture/common/applyActivity.js +++ b/src/main/resources/views/platform/zhgh/activity/culture/common/applyActivity.js @@ -116,14 +116,17 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = { + + value-format="yyyy-MM-dd HH:mm:ss"> diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/condolence/apply/index.html b/src/main/resources/views/platform/zhgh/staffbenefit/condolence/apply/index.html index 8924295..fb42ed3 100644 --- a/src/main/resources/views/platform/zhgh/staffbenefit/condolence/apply/index.html +++ b/src/main/resources/views/platform/zhgh/staffbenefit/condolence/apply/index.html @@ -3,7 +3,7 @@ layout("/layouts/platform.html"){ #-->
- + @@ -89,24 +89,7 @@ layout("/layouts/platform.html"){ - - - - - - + {{formData.applyUserName}} @@ -239,7 +222,7 @@ layout("/layouts/platform.html"){ - + +