小程序审批通知页面跳转地址调整
This commit is contained in:
parent
38cddda869
commit
23576a5286
@ -5,13 +5,11 @@ import cn.iocoder.yudao.module.system.api.notify.dto.NotifySendSingleToUserReqDT
|
|||||||
import cn.iocoder.yudao.module.system.api.sms.dto.send.SmsSendSingleToUserReqDTO;
|
import cn.iocoder.yudao.module.system.api.sms.dto.send.SmsSendSingleToUserReqDTO;
|
||||||
import cn.iocoder.yudao.module.system.api.subscribe.dto.MsgData;
|
import cn.iocoder.yudao.module.system.api.subscribe.dto.MsgData;
|
||||||
import cn.iocoder.yudao.module.system.api.subscribe.dto.SubscribeMessageReqDTO;
|
import cn.iocoder.yudao.module.system.api.subscribe.dto.SubscribeMessageReqDTO;
|
||||||
import org.flowable.bpmn.model.UserTask;
|
|
||||||
import org.mapstruct.Mapper;
|
import org.mapstruct.Mapper;
|
||||||
import org.mapstruct.Mapping;
|
import org.mapstruct.Mapping;
|
||||||
import org.mapstruct.factory.Mappers;
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
@ -32,7 +30,6 @@ public interface BpmMessageConvert {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @param openId 微信小程序唯一id
|
* @param openId 微信小程序唯一id
|
||||||
* @param processInstanceName 流程名称
|
* @param processInstanceName 流程名称
|
||||||
* @param result 审批结果
|
* @param result 审批结果
|
||||||
@ -40,7 +37,8 @@ public interface BpmMessageConvert {
|
|||||||
* @param miniProgramState 小程序的状态
|
* @param miniProgramState 小程序的状态
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
default SubscribeMessageReqDTO convertApprovalResultNotification(String openId, String processInstanceName, String time, String result, String reason, String miniProgramState) {
|
default SubscribeMessageReqDTO convertApprovalResultNotification(String openId, String processInstanceName, String time, String result, String reason, String processInstanceId,
|
||||||
|
String miniProgramState) {
|
||||||
SubscribeMessageReqDTO message = new SubscribeMessageReqDTO();
|
SubscribeMessageReqDTO message = new SubscribeMessageReqDTO();
|
||||||
message.setToUser(openId);
|
message.setToUser(openId);
|
||||||
message.setTemplateId("OnJjp5pdjG1PHMoELYaqp3Xq8jWZ5E6ndO0clEIQ4tk");
|
message.setTemplateId("OnJjp5pdjG1PHMoELYaqp3Xq8jWZ5E6ndO0clEIQ4tk");
|
||||||
@ -76,11 +74,11 @@ public interface BpmMessageConvert {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message.setMiniprogramState(miniProgramState);
|
message.setMiniprogramState(miniProgramState);
|
||||||
|
message.setPage("pages/home/index?id=" + processInstanceId);
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @param openId 微信小程序唯一id
|
* @param openId 微信小程序唯一id
|
||||||
* @param processInstanceName 流程名称
|
* @param processInstanceName 流程名称
|
||||||
* @param startUserNickname 申请人
|
* @param startUserNickname 申请人
|
||||||
@ -89,7 +87,7 @@ public interface BpmMessageConvert {
|
|||||||
* @param miniProgramState 小程序的状态
|
* @param miniProgramState 小程序的状态
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
default SubscribeMessageReqDTO convertProcessToDoReminder(String openId, String processInstanceName,String startUserNickname, String time, String schedule, String miniProgramState) {
|
default SubscribeMessageReqDTO convertProcessToDoReminder(String openId, String processInstanceName, String startUserNickname, String time, String schedule, String processInstanceId, String miniProgramState) {
|
||||||
SubscribeMessageReqDTO message = new SubscribeMessageReqDTO();
|
SubscribeMessageReqDTO message = new SubscribeMessageReqDTO();
|
||||||
message.setToUser(openId);
|
message.setToUser(openId);
|
||||||
message.setTemplateId("3cP4btlFSSiZk65qVewN_WoT_bh0OfUkYzzTsADOrR4");
|
message.setTemplateId("3cP4btlFSSiZk65qVewN_WoT_bh0OfUkYzzTsADOrR4");
|
||||||
@ -118,6 +116,7 @@ public interface BpmMessageConvert {
|
|||||||
message.addData(currentSchedule);
|
message.addData(currentSchedule);
|
||||||
|
|
||||||
message.setMiniprogramState(miniProgramState);
|
message.setMiniprogramState(miniProgramState);
|
||||||
|
message.setPage("pages/bpm/task/todo/examineApprove?id=" + processInstanceId);
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package cn.iocoder.yudao.module.bpm.service.message;
|
package cn.iocoder.yudao.module.bpm.service.message;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
|
||||||
import cn.iocoder.yudao.framework.web.config.WebProperties;
|
import cn.iocoder.yudao.framework.web.config.WebProperties;
|
||||||
import cn.iocoder.yudao.module.bpm.convert.message.BpmMessageConvert;
|
import cn.iocoder.yudao.module.bpm.convert.message.BpmMessageConvert;
|
||||||
import cn.iocoder.yudao.module.bpm.enums.message.BpmMessageEnum;
|
import cn.iocoder.yudao.module.bpm.enums.message.BpmMessageEnum;
|
||||||
@ -17,7 +16,8 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.*;
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BPM 消息 Service 实现类
|
* BPM 消息 Service 实现类
|
||||||
@ -58,6 +58,7 @@ public class BpmMessageServiceImpl implements BpmMessageService {
|
|||||||
subscribeMessageSendApi.sendApprovalResultNotification(
|
subscribeMessageSendApi.sendApprovalResultNotification(
|
||||||
BpmMessageConvert.INSTANCE.convertApprovalResultNotification(
|
BpmMessageConvert.INSTANCE.convertApprovalResultNotification(
|
||||||
openId, reqDTO.getProcessInstanceName(), reqDTO.getCreateTime(), "通过", reqDTO.getReason(),
|
openId, reqDTO.getProcessInstanceName(), reqDTO.getCreateTime(), "通过", reqDTO.getReason(),
|
||||||
|
reqDTO.getProcessInstanceId(),
|
||||||
/**
|
/**
|
||||||
* 跳转小程序类型:developer为开发版;trial为体验版;formal为正式版;默认为正式版
|
* 跳转小程序类型:developer为开发版;trial为体验版;formal为正式版;默认为正式版
|
||||||
*/
|
*/
|
||||||
@ -83,6 +84,7 @@ public class BpmMessageServiceImpl implements BpmMessageService {
|
|||||||
subscribeMessageSendApi.sendApprovalResultNotification(
|
subscribeMessageSendApi.sendApprovalResultNotification(
|
||||||
BpmMessageConvert.INSTANCE.convertApprovalResultNotification(
|
BpmMessageConvert.INSTANCE.convertApprovalResultNotification(
|
||||||
openId, reqDTO.getProcessInstanceName(), reqDTO.getCreateTime(), "不通过", reqDTO.getReason(),
|
openId, reqDTO.getProcessInstanceName(), reqDTO.getCreateTime(), "不通过", reqDTO.getReason(),
|
||||||
|
reqDTO.getProcessInstanceId(),
|
||||||
/**
|
/**
|
||||||
* 跳转小程序类型:developer为开发版;trial为体验版;formal为正式版;默认为正式版
|
* 跳转小程序类型:developer为开发版;trial为体验版;formal为正式版;默认为正式版
|
||||||
*/
|
*/
|
||||||
@ -116,6 +118,7 @@ public class BpmMessageServiceImpl implements BpmMessageService {
|
|||||||
if (openId != null) {
|
if (openId != null) {
|
||||||
subscribeMessageSendApi.sendProcessToDoReminder(BpmMessageConvert.INSTANCE.convertProcessToDoReminder(
|
subscribeMessageSendApi.sendProcessToDoReminder(BpmMessageConvert.INSTANCE.convertProcessToDoReminder(
|
||||||
openId, reqDTO.getProcessInstanceName(), reqDTO.getStartUserNickname(), reqDTO.getCreateTime(), reqDTO.getSchedule(),
|
openId, reqDTO.getProcessInstanceName(), reqDTO.getStartUserNickname(), reqDTO.getCreateTime(), reqDTO.getSchedule(),
|
||||||
|
reqDTO.getProcessInstanceId(),
|
||||||
"formal"));
|
"formal"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -128,6 +131,7 @@ public class BpmMessageServiceImpl implements BpmMessageService {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private AdminUserApi adminUserApi;
|
private AdminUserApi adminUserApi;
|
||||||
|
|
||||||
private String getUserOpenId(Long userId) {
|
private String getUserOpenId(Long userId) {
|
||||||
AdminUserRespDTO adminUserRespDTO = adminUserApi.getUser(userId).getData();
|
AdminUserRespDTO adminUserRespDTO = adminUserApi.getUser(userId).getData();
|
||||||
String openId = adminUserRespDTO.getOpenId();
|
String openId = adminUserRespDTO.getOpenId();
|
||||||
|
@ -69,7 +69,7 @@ public class BpmOAProcurePayServiceImpl extends BpmOABaseService implements BpmO
|
|||||||
private BpmProcessInstanceService bpmProcessInstanceService;
|
private BpmProcessInstanceService bpmProcessInstanceService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OA 请假对应的流程定义 KEY
|
* OA 采购支付对应的流程定义 KEY
|
||||||
*/
|
*/
|
||||||
public static final String PROCESS_KEY = "oa_procure_pay";
|
public static final String PROCESS_KEY = "oa_procure_pay";
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ public class BpmOAProcureServiceImpl extends BpmOABaseService implements BpmOAPr
|
|||||||
@Resource
|
@Resource
|
||||||
private BpmProcessInstanceApi processInstanceApi;
|
private BpmProcessInstanceApi processInstanceApi;
|
||||||
/**
|
/**
|
||||||
* OA 请假对应的流程定义 KEY
|
* OA 采购申请对应的流程定义 KEY
|
||||||
*/
|
*/
|
||||||
public static final String PROCESS_KEY = "oa_procure";
|
public static final String PROCESS_KEY = "oa_procure";
|
||||||
|
|
||||||
|
@ -32,6 +32,10 @@ public class SubscribeMessageReqDTO {
|
|||||||
@NotNull(message = "跳转小程序类型不能为空")
|
@NotNull(message = "跳转小程序类型不能为空")
|
||||||
private String miniprogramState = "formal";
|
private String miniprogramState = "formal";
|
||||||
|
|
||||||
|
@Schema(description = "小程序页面地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "pages/home/index")
|
||||||
|
@NotNull(message = "小程序页面地址不能为空")
|
||||||
|
private String page;
|
||||||
|
|
||||||
public void addData(MsgData data) {
|
public void addData(MsgData data) {
|
||||||
this.data.add(data);
|
this.data.add(data);
|
||||||
}
|
}
|
||||||
|
@ -1,29 +1,15 @@
|
|||||||
package cn.iocoder.yudao.module.system.api.subscribe;
|
package cn.iocoder.yudao.module.system.api.subscribe;
|
||||||
|
|
||||||
import cn.binarywang.wx.miniapp.api.WxMaService;
|
|
||||||
import cn.binarywang.wx.miniapp.api.WxMaSubscribeService;
|
|
||||||
import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl;
|
|
||||||
import cn.binarywang.wx.miniapp.bean.WxMaSubscribeMessage;
|
import cn.binarywang.wx.miniapp.bean.WxMaSubscribeMessage;
|
||||||
import cn.binarywang.wx.miniapp.config.impl.WxMaRedisBetterConfigImpl;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
import cn.iocoder.yudao.framework.common.util.cache.CacheUtils;
|
|
||||||
import cn.iocoder.yudao.module.system.api.subscribe.dto.MsgData;
|
import cn.iocoder.yudao.module.system.api.subscribe.dto.MsgData;
|
||||||
import cn.iocoder.yudao.module.system.api.subscribe.dto.SubscribeMessageReqDTO;
|
import cn.iocoder.yudao.module.system.api.subscribe.dto.SubscribeMessageReqDTO;
|
||||||
import cn.iocoder.yudao.module.system.service.social.SocialClientService;
|
import cn.iocoder.yudao.module.system.service.social.SocialClientService;
|
||||||
import com.binarywang.spring.starter.wxjava.miniapp.properties.WxMaProperties;
|
|
||||||
import com.binarywang.spring.starter.wxjava.mp.properties.WxMpProperties;
|
|
||||||
import com.google.common.cache.CacheLoader;
|
|
||||||
import com.google.common.cache.LoadingCache;
|
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
import me.chanjar.weixin.common.error.WxErrorException;
|
|
||||||
import me.chanjar.weixin.common.redis.RedisTemplateWxRedisOps;
|
|
||||||
import me.chanjar.weixin.mp.api.WxMpService;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
import java.time.Duration;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
@ -68,7 +54,7 @@ public class SubscribeMessageSendApiImpl implements SubscribeMessageSendApi{
|
|||||||
wxMsgData.setValue(msgData.getValue());
|
wxMsgData.setValue(msgData.getValue());
|
||||||
message.addData(wxMsgData);
|
message.addData(wxMsgData);
|
||||||
}
|
}
|
||||||
message.setPage("pages/home/index") ;
|
message.setPage(reqDTO.getPage());
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user