From 286fc5b74aacbcae86965204fb9f6cac68b1a8c2 Mon Sep 17 00:00:00 2001 From: chenqp <965586934@qq.com> Date: Wed, 2 Aug 2023 00:05:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=94=B3=E8=AF=B7=E5=8D=95=E5=BC=80?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../expenseapply/ExpenseApplyController.java | 2 ++ .../expenseapply/ExpenseApplyService.java | 1 + .../expenseapply/ExpenseApplyServiceImpl.java | 28 +++++++++++---- .../message/BpmMessageServiceImpl.java | 36 +++++++++---------- .../vo/ExpenseApplyTripBaseVO.java | 15 ++++---- .../expenseapply/ExpenseApplyDO.java | 6 ++++ .../expenseapplytrip/ExpenseApplyTripDO.java | 19 +++++----- 7 files changed, 64 insertions(+), 43 deletions(-) diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/expenseapply/ExpenseApplyController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/expenseapply/ExpenseApplyController.java index 9a39031f..0801a9a3 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/expenseapply/ExpenseApplyController.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/expenseapply/ExpenseApplyController.java @@ -67,6 +67,8 @@ public class ExpenseApplyController { queryWrapper.eq(ExpenseApplyTripDO::getApplyId, expenseApply.getId()); List list = expenseApplyTripService.list(queryWrapper); expenseApply.setExpenseApplyTrips(list); + //cqptodo 需要设置用户名,部门返回前端 +// expenseApplyService.setRepField(expenseApply); } return success(expenseApply); } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/expenseapply/ExpenseApplyService.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/expenseapply/ExpenseApplyService.java index 93b16e24..f252e6e5 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/expenseapply/ExpenseApplyService.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/expenseapply/ExpenseApplyService.java @@ -71,4 +71,5 @@ public interface ExpenseApplyService extends IService { List getExpenseApplyList(ExpenseApplyExportReqVO exportReqVO); void processInstanceCallBack(long id, Integer result); + } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/expenseapply/ExpenseApplyServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/expenseapply/ExpenseApplyServiceImpl.java index a4f3d574..15f47cb2 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/expenseapply/ExpenseApplyServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/expenseapply/ExpenseApplyServiceImpl.java @@ -3,9 +3,12 @@ package cn.iocoder.yudao.module.bpm.service.expenseapply; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.RandomUtil; +import cn.iocoder.yudao.framework.common.exception.ErrorCode; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; import cn.iocoder.yudao.framework.security.core.LoginUser; import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi; import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO; @@ -32,6 +35,7 @@ import javax.annotation.Resource; import javax.validation.Validator; import java.math.BigDecimal; import java.util.Collection; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -58,7 +62,7 @@ public class ExpenseApplyServiceImpl extends ServiceImpl().eq(ExpenseApplyTripDO::getApplyId, expenseApply.getId())); + expenseApplyTripService.saveBatch(trips); } if (expenseApply.getStatus().equals(ExpenseApplyStatusEnum.PROCESS.getValue())) { - Map variables = BeanUtil.beanToMap(expenseApply); - //cqptodo 提交单据,创建工作流 + Map variables = new HashMap<>(); + variables.put("billType", expenseApply.getBillType()); + variables.put("amount", expenseApply.getAmount()); + variables.put("deptId", expenseApply.getDeptId()); String processInstanceId = processInstanceApi.createProcessInstance(expenseApply.getUserId(), new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY) .setVariables(variables).setBusinessKey(String.valueOf(expenseApply.getId()))); - //cqptodo 待测试是否会更新其它字段 将工作流的编号,更新到单据中 updateById(new ExpenseApplyDO().setId(expenseApply.getId()).setProcessInstanceId(processInstanceId)); } // 返回 @@ -120,7 +128,7 @@ public class ExpenseApplyServiceImpl extends ServiceImpl().eq(ExpenseApplyTripDO::getApplyId, apply.getId())); } private ExpenseApplyDO validateExpenseApplyExists(Long id) { diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/message/BpmMessageServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/message/BpmMessageServiceImpl.java index 03237015..90c47763 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/message/BpmMessageServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/message/BpmMessageServiceImpl.java @@ -33,32 +33,32 @@ public class BpmMessageServiceImpl implements BpmMessageService { @Override public void sendMessageWhenProcessInstanceApprove(BpmMessageSendWhenProcessInstanceApproveReqDTO reqDTO) { - Map templateParams = new HashMap<>(); - templateParams.put("processInstanceName", reqDTO.getProcessInstanceName()); - templateParams.put("detailUrl", getProcessInstanceDetailUrl(reqDTO.getProcessInstanceId())); - smsSendApi.sendSingleSmsToAdmin(BpmMessageConvert.INSTANCE.convert(reqDTO.getStartUserId(), - BpmMessageEnum.PROCESS_INSTANCE_APPROVE.getSmsTemplateCode(), templateParams)); +// Map templateParams = new HashMap<>(); +// templateParams.put("processInstanceName", reqDTO.getProcessInstanceName()); +// templateParams.put("detailUrl", getProcessInstanceDetailUrl(reqDTO.getProcessInstanceId())); +// smsSendApi.sendSingleSmsToAdmin(BpmMessageConvert.INSTANCE.convert(reqDTO.getStartUserId(), +// BpmMessageEnum.PROCESS_INSTANCE_APPROVE.getSmsTemplateCode(), templateParams)); } @Override public void sendMessageWhenProcessInstanceReject(BpmMessageSendWhenProcessInstanceRejectReqDTO reqDTO) { - Map templateParams = new HashMap<>(); - templateParams.put("processInstanceName", reqDTO.getProcessInstanceName()); - templateParams.put("reason", reqDTO.getReason()); - templateParams.put("detailUrl", getProcessInstanceDetailUrl(reqDTO.getProcessInstanceId())); - smsSendApi.sendSingleSmsToAdmin(BpmMessageConvert.INSTANCE.convert(reqDTO.getStartUserId(), - BpmMessageEnum.PROCESS_INSTANCE_REJECT.getSmsTemplateCode(), templateParams)); +// Map templateParams = new HashMap<>(); +// templateParams.put("processInstanceName", reqDTO.getProcessInstanceName()); +// templateParams.put("reason", reqDTO.getReason()); +// templateParams.put("detailUrl", getProcessInstanceDetailUrl(reqDTO.getProcessInstanceId())); +// smsSendApi.sendSingleSmsToAdmin(BpmMessageConvert.INSTANCE.convert(reqDTO.getStartUserId(), +// BpmMessageEnum.PROCESS_INSTANCE_REJECT.getSmsTemplateCode(), templateParams)); } @Override public void sendMessageWhenTaskAssigned(BpmMessageSendWhenTaskCreatedReqDTO reqDTO) { - Map templateParams = new HashMap<>(); - templateParams.put("processInstanceName", reqDTO.getProcessInstanceName()); - templateParams.put("taskName", reqDTO.getTaskName()); - templateParams.put("startUserNickname", reqDTO.getStartUserNickname()); - templateParams.put("detailUrl", getProcessInstanceDetailUrl(reqDTO.getProcessInstanceId())); - smsSendApi.sendSingleSmsToAdmin(BpmMessageConvert.INSTANCE.convert(reqDTO.getAssigneeUserId(), - BpmMessageEnum.TASK_ASSIGNED.getSmsTemplateCode(), templateParams)); +// Map templateParams = new HashMap<>(); +// templateParams.put("processInstanceName", reqDTO.getProcessInstanceName()); +// templateParams.put("taskName", reqDTO.getTaskName()); +// templateParams.put("startUserNickname", reqDTO.getStartUserNickname()); +// templateParams.put("detailUrl", getProcessInstanceDetailUrl(reqDTO.getProcessInstanceId())); +// smsSendApi.sendSingleSmsToAdmin(BpmMessageConvert.INSTANCE.convert(reqDTO.getAssigneeUserId(), +// BpmMessageEnum.TASK_ASSIGNED.getSmsTemplateCode(), templateParams)); } private String getProcessInstanceDetailUrl(String taskId) { diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/expenseapplytrip/vo/ExpenseApplyTripBaseVO.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/expenseapplytrip/vo/ExpenseApplyTripBaseVO.java index ba881b44..2eb69273 100644 --- a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/expenseapplytrip/vo/ExpenseApplyTripBaseVO.java +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/expenseapplytrip/vo/ExpenseApplyTripBaseVO.java @@ -1,17 +1,14 @@ package cn.iocoder.yudao.module.bs.controller.admin.expenseapplytrip.vo; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import java.util.*; -import java.time.LocalDateTime; -import java.time.LocalDateTime; -import java.time.LocalDateTime; -import java.time.LocalDateTime; -import java.math.BigDecimal; -import java.math.BigDecimal; -import javax.validation.constraints.*; +import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; +import javax.validation.constraints.NotNull; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.Set; + import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; /** diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/dal/dataobject/expenseapply/ExpenseApplyDO.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/dal/dataobject/expenseapply/ExpenseApplyDO.java index d9b87f50..a43bcfa3 100644 --- a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/dal/dataobject/expenseapply/ExpenseApplyDO.java +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/dal/dataobject/expenseapply/ExpenseApplyDO.java @@ -91,4 +91,10 @@ public class ExpenseApplyDO extends TenantBaseDO { @TableField(exist = false) private List expenseApplyTrips; + @TableField(exist = false) + private Boolean deleted; + @TableField(exist = false) + private String nickname; + @TableField(exist = false) + private String detpName; } diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/dal/dataobject/expenseapplytrip/ExpenseApplyTripDO.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/dal/dataobject/expenseapplytrip/ExpenseApplyTripDO.java index 969500de..bed5db48 100644 --- a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/dal/dataobject/expenseapplytrip/ExpenseApplyTripDO.java +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/dal/dataobject/expenseapplytrip/ExpenseApplyTripDO.java @@ -3,17 +3,17 @@ package cn.iocoder.yudao.module.bs.dal.dataobject.expenseapplytrip; import cn.iocoder.yudao.framework.common.pojo.ImageVo; import cn.iocoder.yudao.framework.mybatis.core.type.JsonLongSetTypeHandler; import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; +import com.baomidou.mybatisplus.annotation.KeySequence; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; import lombok.*; -import java.util.*; -import java.time.LocalDateTime; -import java.time.LocalDateTime; -import java.time.LocalDateTime; -import java.time.LocalDateTime; -import java.math.BigDecimal; + import java.math.BigDecimal; -import com.baomidou.mybatisplus.annotation.*; -import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import java.time.LocalDateTime; +import java.util.List; +import java.util.Set; /** * 申请单行程明细 DO @@ -91,5 +91,6 @@ public class ExpenseApplyTripDO extends TenantBaseDO { * 预计费用 */ private BigDecimal amount; - + @TableField(exist = false) + private Boolean deleted; }