|
|
@@ -3,17 +3,14 @@ package com.tuoheng.api.service.impl; |
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.tuoheng.api.entity.domain.Feedback; |
|
|
|
import com.tuoheng.api.entity.domain.Stream; |
|
|
|
import com.tuoheng.api.entity.domain.Tenant; |
|
|
|
import com.tuoheng.api.entity.domain.User; |
|
|
|
import com.tuoheng.api.constants.DictConstants; |
|
|
|
import com.tuoheng.api.entity.domain.*; |
|
|
|
import com.tuoheng.api.entity.request.FeedbackQuery; |
|
|
|
import com.tuoheng.api.mapper.FeedbackMapper; |
|
|
|
import com.tuoheng.api.mapper.StreamMapper; |
|
|
|
import com.tuoheng.api.mapper.TenantMapper; |
|
|
|
import com.tuoheng.api.mapper.UserMapper; |
|
|
|
import com.tuoheng.api.mapper.*; |
|
|
|
import com.tuoheng.api.service.IFeedbackService; |
|
|
|
import com.tuoheng.api.utils.SmsUtil; |
|
|
|
import com.tuoheng.common.common.BaseServiceImpl; |
|
|
|
import com.tuoheng.common.config.CommonConfig; |
|
|
|
import com.tuoheng.common.exception.ServiceException; |
|
|
@@ -24,6 +21,8 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.http.HttpStatus; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
@@ -43,9 +42,16 @@ public class FeedbackServiceImpl extends BaseServiceImpl<FeedbackMapper, Feedbac |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private UserMapper userMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private TenantMapper tenantMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ThDictMapper thDictMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ThDictDataMapper thDictDataMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public JsonResult submit(Feedback feedback) { |
|
|
@@ -64,7 +70,24 @@ public class FeedbackServiceImpl extends BaseServiceImpl<FeedbackMapper, Feedbac |
|
|
|
return JsonResult.error("河流信息不存在"); |
|
|
|
} |
|
|
|
super.add(feedback); |
|
|
|
//TODO 发送短信 |
|
|
|
//发送短信 |
|
|
|
ThDict thDict = thDictMapper.selectOne(new LambdaQueryWrapper<ThDict>() |
|
|
|
.eq(ThDict::getTenantId, stream.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(); |
|
|
|
} |
|
|
|
|