소스 검색

身份申请发送短信

tags/V1.7.0
wanghaoran 1 년 전
부모
커밋
3b030778a1
2개의 변경된 파일32개의 추가작업 그리고 10개의 파일을 삭제
  1. +31
    -7
      tuoheng-api/src/main/java/com/tuoheng/api/service/impl/IdentityServiceImpl.java
  2. +1
    -3
      tuoheng-api/src/main/java/com/tuoheng/api/service/impl/WestreamSceneryServiceImpl.java

+ 31
- 7
tuoheng-api/src/main/java/com/tuoheng/api/service/impl/IdentityServiceImpl.java 파일 보기

@@ -2,20 +2,20 @@ package com.tuoheng.api.service.impl;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.api.entity.domain.Identity;
import com.tuoheng.api.entity.domain.IdentityApply;
import com.tuoheng.api.entity.domain.WestreamUser;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.tuoheng.api.constants.DictConstants;
import com.tuoheng.api.entity.domain.*;
import com.tuoheng.api.entity.request.IdentityQuery;
import com.tuoheng.api.mapper.IdentityApplyMapper;
import com.tuoheng.api.mapper.IdentityMapper;
import com.tuoheng.api.mapper.WestreamUserMapper;
import com.tuoheng.api.mapper.*;
import com.tuoheng.api.service.IIdentityService;
import com.tuoheng.api.utils.SmsUtil;
import com.tuoheng.common.common.BaseServiceImpl;
import com.tuoheng.common.utils.JsonResult;
import com.tuoheng.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;

/**
@@ -36,6 +36,12 @@ public class IdentityServiceImpl extends BaseServiceImpl<IdentityMapper, Identit
@Autowired
private WestreamUserMapper westreamUserMapper;

@Autowired
private ThDictMapper thDictMapper;

@Autowired
private ThDictDataMapper thDictDataMapper;

@Override
public JsonResult getListInfo(IdentityQuery identityQuery) {
if(null == identityQuery.getTenantId()){
@@ -73,7 +79,25 @@ public class IdentityServiceImpl extends BaseServiceImpl<IdentityMapper, Identit
}
identityApplyMapper.insert(identityApply);

//TODO 发送短信

//发送短信
ThDict thDict = thDictMapper.selectOne(new LambdaQueryWrapper<ThDict>()
.eq(ThDict::getTenantId, identityApply.getTenantId())
.eq(ThDict::getCode, DictConstants.MSG_RULE_CODE)
.eq(ThDict::getMark, 1));
if(ObjectUtils.isNotNull(thDict)){
ThDictData thDictData = thDictDataMapper.selectOne(new LambdaQueryWrapper<ThDictData>()
.eq(ThDictData::getDictId, thDict.getId())
.eq(ThDictData::getName, DictConstants.MSG_RULE_PHONE));
if(ObjectUtils.isNotNull(thDictData)){
if(StringUtils.isNotEmpty(thDictData.getValue())){
List<String> phoneList = Arrays.asList(thDictData.getValue().split(","));
for (String phone : phoneList) {
SmsUtil.sendSyncSms(phone,DictConstants.SMS_276426880,DictConstants.SMS_SMART_LAKE,null);
}
}
}
}
return JsonResult.success();
}
}

+ 1
- 3
tuoheng-api/src/main/java/com/tuoheng/api/service/impl/WestreamSceneryServiceImpl.java 파일 보기

@@ -116,15 +116,13 @@ public class WestreamSceneryServiceImpl extends BaseServiceImpl<WestreamSceneryM
.eq(ThDictData::getName, DictConstants.MSG_RULE_PHONE));
if(ObjectUtils.isNotNull(thDictData)){
if(StringUtils.isNotEmpty(thDictData.getValue())){
List<String> phoneList = Arrays.asList(thDictData.getValue().split(""));
List<String> phoneList = Arrays.asList(thDictData.getValue().split(","));
for (String phone : phoneList) {
SmsUtil.sendSyncSms(phone,DictConstants.SMS_276426880,DictConstants.SMS_SMART_LAKE,null);
}
}
}
}


return JsonResult.success();
}


Loading…
취소
저장