Procházet zdrojové kódy

租户设置及钉钉消息pc端接口校验

lipenghui před 2 měsíci
rodič
revize
c92b83e57c

+ 1 - 1
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/message/BpmMessageServiceImpl.java

@@ -101,7 +101,7 @@ public class BpmMessageServiceImpl implements BpmMessageService {
             notifyMessageSendApi.sendSingleMessageToAdmin(new NotifySendSingleToUserReqDTO()
                     .setUserId(reqDTO.getAssigneeUserId()).setTemplateCode(templateCode).setTemplateParams(templateParams));
             msg = "您有新的委外维修流程,请审批。"+"["+ DateUtil.format(new Date(),"yyyy-MM-dd hh:mm:ss")+"]";
-            url="https://iot.deepoil.cc/dingding?id="+reqDTO.getProcessInstanceId()+"&type=maintainOut";
+            url="https://iot.deepoil.cc/dingding?id="+reqDTO.getProcessInstanceId()+"&type=maintainOut&userId="+reqDTO.getAssigneeUserId();
         }
         dingtalkSendApi.send(user.getMobile(), msg,"link",url);
     }

+ 1 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/message/PmsMessage.java

@@ -37,7 +37,7 @@ public class PmsMessage {
             if (PmsConstants.GENERATE_MAINTENANCE.equals(businessType)) {
                 msg = "您有新的保养工单 " + name + ",请处理。"+"["+ DateUtil.format(new Date(),"yyyy-MM-dd hh:mm:ss")+"]";
             }
-            String url="https://iot.deepoil.cc/dingding?id="+businessId+"&type="+businessType;
+            String url="http://localhost/dingding?id="+businessId+"&type="+businessType+"&userId="+userId;
             dingtalkSendApi.send(mobile, msg,"link", url);
         }
     }

+ 6 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java

@@ -74,6 +74,12 @@ public class AuthController {
         return success(authService.login(reqVO));
     }
 
+    @PostMapping("/simple/login/{id}")
+    @PermitAll
+    public CommonResult<AuthLoginRespVO> simpleLogin(@PathVariable("id") Long id) {
+        return success(authService.simpleLogin(id));
+    }
+
     @PostMapping("/logout")
     @PermitAll
     @Operation(summary = "登出系统")

+ 1 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthService.java

@@ -23,6 +23,7 @@ public interface AdminAuthService {
      */
     AdminUserDO authenticate(String username, String password);
 
+    AuthLoginRespVO simpleLogin(Long id);
     /**
      * 账号登录
      *

+ 7 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java

@@ -102,6 +102,13 @@ public class AdminAuthServiceImpl implements AdminAuthService {
         return user;
     }
 
+    @Override
+    public AuthLoginRespVO simpleLogin(Long id) {
+        AdminUserDO user = userService.getUser(id);
+
+        return createTokenAfterLoginSuccess(user.getId(), user.getUsername(), LoginLogTypeEnum.LOGIN_USERNAME);
+    }
+
     @Override
     public AuthLoginRespVO login(AuthLoginReqVO reqVO) {
         // 校验验证码

+ 2 - 1
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/notify/NotifyMessageServiceImpl.java

@@ -1,6 +1,7 @@
 package cn.iocoder.yudao.module.system.service.notify;
 
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils;
 import cn.iocoder.yudao.module.system.controller.admin.notify.vo.message.NotifyMessageMyPageReqVO;
 import cn.iocoder.yudao.module.system.controller.admin.notify.vo.message.NotifyMessagePageReqVO;
 import cn.iocoder.yudao.module.system.dal.dataobject.notify.NotifyMessageDO;
@@ -35,7 +36,7 @@ public class NotifyMessageServiceImpl implements NotifyMessageService {
                 .setTemplateType(template.getType()).setTemplateNickname(template.getNickname())
                 .setTemplateContent(templateContent).setTemplateParams(templateParams).setReadStatus(false).setBusinessType(Objects.nonNull(templateParams.get("businessType"))?String.valueOf(templateParams.get("businessType")):null)
                 .setBusinessId(Objects.nonNull(templateParams.get("businessId"))?String.valueOf(templateParams.get("businessId")):"");
-        notifyMessageMapper.insert(message);
+        TenantUtils.execute(1L, () -> notifyMessageMapper.insert(message));
         return message.getId();
     }