Browse Source
# Conflicts: # esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.javadev
48 changed files with 2432 additions and 10 deletions
@ -0,0 +1,115 @@ |
|||
package com.elink.esua.epdc.modules.async; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.constant.SysSmsTemplateConstant; |
|||
import com.elink.esua.epdc.dto.form.SmsNoticeFormDTO; |
|||
import com.elink.esua.epdc.dto.item.form.ItemHandleSubmitFormDTO; |
|||
import com.elink.esua.epdc.enums.ItemHandleCategoryEnum; |
|||
import com.elink.esua.epdc.modules.feign.AdminFeignClient; |
|||
import com.elink.esua.epdc.modules.feign.MessageFeignClient; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.scheduling.annotation.Async; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* |
|||
* 议题审核结果 - 发送短信 |
|||
* |
|||
* @Author:zy |
|||
* @Date:2020/01/08 10:31 |
|||
*/ |
|||
@Component |
|||
public class IssueOverseeResultsTask { |
|||
@Autowired |
|||
private MessageFeignClient messageFeignClient; |
|||
|
|||
@Autowired |
|||
private AdminFeignClient adminFeignClient; |
|||
|
|||
/** |
|||
* 短信通知 关联人 |
|||
* |
|||
* @param smsNoticeFormDTO |
|||
* @return void |
|||
* @author zy |
|||
* @Date:2020/01/08 10:31 |
|||
*/ |
|||
@Async |
|||
public void sendSmsNotice(SmsNoticeFormDTO smsNoticeFormDTO) { |
|||
messageFeignClient.sendSmsNotice(smsNoticeFormDTO); |
|||
} |
|||
|
|||
/** |
|||
* @Description: 根据部门id,异步查询部门下的所有用户手机号 |
|||
* @Description: 根据手机号进行短信推送 |
|||
* @Param: [dto, deptId] |
|||
* @return: void |
|||
* @Author: zy |
|||
* @Date: 2020-01-09 |
|||
*/ |
|||
@Async |
|||
public void getUserPhoneByListDeptId(ItemHandleSubmitFormDTO dto, List<Long> deptId){ |
|||
Result<List<String>> data = adminFeignClient.getUserPhoneByListDeptId(deptId); |
|||
if (data.success() && data.getData() != null && data.getData().size() > 0) { |
|||
this.projectSmsNotification(dto, data.getData());//向部门下的,所有人员发送短信
|
|||
} |
|||
} |
|||
|
|||
/** |
|||
* @Description: 根据议题网格ID 异步查询拥有这个网格数据权限且是网格长的角色,再根据角色查出所有用户手机号 |
|||
* @Description: 根据手机号进行短信推送 |
|||
* @Param: [deptId] |
|||
* @return: void |
|||
* @Author: zy |
|||
* @Date: 2020-01-09 |
|||
*/ |
|||
@Async |
|||
public void getSysGridLeaderPhone(Long deptId){ |
|||
Result<List<String>> data = adminFeignClient.getSysGridLeaderPhone(deptId); |
|||
if (data.success() && data.getData() != null && data.getData().size() > 0) { |
|||
this.issueSmsNotification(data.getData());//短信通知 所有有菜单权限的议题审核员
|
|||
} |
|||
} |
|||
|
|||
/** |
|||
* @Description: 工作端:项目处理,发送短信 |
|||
* @Param: [dto] |
|||
* @Param: userId 用户手机号 |
|||
* @return: void |
|||
* @Author: zy |
|||
* @Date: 2020-01-08 |
|||
*/ |
|||
public void projectSmsNotification(ItemHandleSubmitFormDTO dto, List<String> userMobiles){ |
|||
// 审核操作发送短信
|
|||
SmsNoticeFormDTO sms = new SmsNoticeFormDTO(); |
|||
sms.setMobiles(userMobiles); |
|||
|
|||
if (ItemHandleCategoryEnum.HANDLE_CLOSE.getValue() == dto.getHandleCategory()){ |
|||
sms.setSmsTemplateType(SysSmsTemplateConstant.SMS_TEMPLATE_WORK_ITEM_CLOSED);// 关闭
|
|||
}else if(ItemHandleCategoryEnum.HANDLE_CLOSING_CASE.getValue() == dto.getHandleCategory()){ |
|||
sms.setSmsTemplateType(SysSmsTemplateConstant.SMS_TEMPLATE_WORK_ITEM_SETTLE);// 结案
|
|||
}else if(ItemHandleCategoryEnum.HANDLE_CIRCULATION_ASSISTANCE.getValue() == dto.getHandleCategory()){ |
|||
sms.setSmsTemplateType(SysSmsTemplateConstant.SMS_TEMPLATE_WORK_ITEM_WHISTLE);// 被吹哨
|
|||
}else if(ItemHandleCategoryEnum.HANDLE_I_HANDLE.getValue() == dto.getHandleCategory()){ |
|||
sms.setSmsTemplateType(SysSmsTemplateConstant.SMS_TEMPLATE_WORK_ITEM_WHISTLE_FEEDBACK);// 回应:吹哨反馈
|
|||
} |
|||
this.sendSmsNotice(sms); |
|||
} |
|||
|
|||
/** |
|||
* @Description: 工作端:议题:议题发布短信通知 当前网格下的网格长 |
|||
* @Param: [userMobiles] 手机号列表 |
|||
* @return: void |
|||
* @Author: zy |
|||
* @Date: 2020-01-08 |
|||
*/ |
|||
private void issueSmsNotification(List<String> userMobiles){ |
|||
// 审核操作发送短信
|
|||
SmsNoticeFormDTO sms = new SmsNoticeFormDTO(); |
|||
sms.setMobiles(userMobiles); |
|||
sms.setSmsTemplateType(SysSmsTemplateConstant.SMS_TEMPLATE_WORK_ISSUE_WAIT_REVIEW);//议题发布,状态为待审核
|
|||
this.sendSmsNotice(sms); |
|||
} |
|||
} |
@ -0,0 +1,31 @@ |
|||
package com.elink.esua.epdc.modules.feign; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.form.SmsNoticeFormDTO; |
|||
import com.elink.esua.epdc.modules.feign.fallback.MessageFeignClientFallback; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
|
|||
/** |
|||
* 消息通知模块 |
|||
* |
|||
* @author zy |
|||
* @Date:2020/01/08 10:31 |
|||
*/ |
|||
@FeignClient(name = ServiceConstant.EPDC_MESSAGE_SERVER, fallback = MessageFeignClientFallback.class) |
|||
public interface MessageFeignClient { |
|||
|
|||
/** |
|||
* 议题:待回应事件 审核结果短信通知 议题发起人 |
|||
* |
|||
* @param smsNoticeFormDTO |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|||
* @author zy |
|||
* @Date:2020/01/08 10:31 |
|||
*/ |
|||
@PostMapping(value = "message/epdc-app/smstemplate/sendSmsNotice", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) |
|||
Result sendSmsNotice(@RequestBody SmsNoticeFormDTO smsNoticeFormDTO); |
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.elink.esua.epdc.modules.feign.fallback; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; |
|||
import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.form.SmsNoticeFormDTO; |
|||
import com.elink.esua.epdc.modules.feign.MessageFeignClient; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* @author zy |
|||
* @Date:2020/01/08 10:31 |
|||
*/ |
|||
@Component |
|||
public class MessageFeignClientFallback implements MessageFeignClient { |
|||
|
|||
@Override |
|||
public Result sendSmsNotice(SmsNoticeFormDTO smsNoticeFormDTO) { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPDC_MESSAGE_SERVER, "sendSmsNotice", smsNoticeFormDTO); |
|||
} |
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.elink.esua.epdc.modules.async; |
|||
|
|||
import com.elink.esua.epdc.dto.form.SmsNoticeFormDTO; |
|||
import com.elink.esua.epdc.modules.feign.MessageFeignClient; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.scheduling.annotation.Async; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* |
|||
* 议题审核结果 - 发送短信 |
|||
* |
|||
* @Author:zy |
|||
* @Date:2020/01/08 10:31 |
|||
*/ |
|||
@Component |
|||
public class IssueOverseeResultsTask { |
|||
@Autowired |
|||
private MessageFeignClient messageFeignClient; |
|||
|
|||
/** |
|||
* 社群管理 建群通过、不通过、被邀请入群 短信通知 |
|||
* |
|||
* @param smsNoticeFormDTO |
|||
* @return void |
|||
* @author zy |
|||
* @Date:2020/01/08 10:31 |
|||
*/ |
|||
@Async |
|||
public void sendSmsNotice(SmsNoticeFormDTO smsNoticeFormDTO) { |
|||
messageFeignClient.sendSmsNotice(smsNoticeFormDTO); |
|||
} |
|||
} |
@ -0,0 +1,31 @@ |
|||
package com.elink.esua.epdc.modules.feign; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.form.SmsNoticeFormDTO; |
|||
import com.elink.esua.epdc.modules.feign.fallback.MessageFeignClientFallback; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
|
|||
/** |
|||
* 消息通知模块 |
|||
* |
|||
* @author zy |
|||
* @Date:2020/01/08 10:31 |
|||
*/ |
|||
@FeignClient(name = ServiceConstant.EPDC_MESSAGE_SERVER, fallback = MessageFeignClientFallback.class) |
|||
public interface MessageFeignClient { |
|||
|
|||
/** |
|||
* 社群管理 建群通过、不通过、被邀请入群 短信通知 |
|||
* |
|||
* @param smsNoticeFormDTO |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|||
* @author zy |
|||
* @Date:2020/01/08 10:31 |
|||
*/ |
|||
@PostMapping(value = "message/epdc-app/smstemplate/sendSmsNotice", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) |
|||
Result sendSmsNotice(@RequestBody SmsNoticeFormDTO smsNoticeFormDTO); |
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.elink.esua.epdc.modules.feign.fallback; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; |
|||
import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.form.SmsNoticeFormDTO; |
|||
import com.elink.esua.epdc.modules.feign.MessageFeignClient; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* @author zy |
|||
* @Date:2020/01/08 10:31 |
|||
*/ |
|||
@Component |
|||
public class MessageFeignClientFallback implements MessageFeignClient { |
|||
|
|||
@Override |
|||
public Result sendSmsNotice(SmsNoticeFormDTO smsNoticeFormDTO) { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPDC_MESSAGE_SERVER, "sendSmsNotice", smsNoticeFormDTO); |
|||
} |
|||
} |
@ -0,0 +1,64 @@ |
|||
package com.elink.esua.epdc.constant; |
|||
|
|||
/** |
|||
* |
|||
* 短信模板类型 |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/1/7 11:27 |
|||
*/ |
|||
public interface SysSmsTemplateConstant { |
|||
|
|||
/** |
|||
* 居民端-议题-审核通过 |
|||
*/ |
|||
String SMS_TEMPLATE_RESIDENTS_ISSUE_PASSED = "RESIDENTS_ISSUE_PASSED"; |
|||
/** |
|||
* 居民端-议题-审核不通过 |
|||
*/ |
|||
String SMS_TEMPLATE_RESIDENTS_ISSUE_NOT_PASS = "RESIDENTS_ISSUE_NOT_PASS"; |
|||
/** |
|||
* 居民端-议题-转成项目 |
|||
*/ |
|||
String SMS_TEMPLATE_RESIDENTS_ISSUE_CHANGE_ITEM = "RESIDENTS_ISSUE_CHANGE_ITEM"; |
|||
/** |
|||
* 居民端-项目-结案 |
|||
*/ |
|||
String SMS_TEMPLATE_RESIDENTS_ITEM_SETTLE = "RESIDENTS_ITEM_SETTLE"; |
|||
/** |
|||
* 居民端-项目-关闭 |
|||
*/ |
|||
String SMS_TEMPLATE_RESIDENTS_ITEM_CLOSED = "RESIDENTS_ITEM_CLOSED"; |
|||
/** |
|||
* 居民端-邻里社群-社群审核通过 |
|||
*/ |
|||
String SMS_TEMPLATE_RESIDENTS_GROUP_PASSED = "RESIDENTS_GROUP_PASSED"; |
|||
/** |
|||
* 居民端-邻里社群-社群审核不通过 |
|||
*/ |
|||
String SMS_TEMPLATE_RESIDENTS_GROUP_NOT_PASS = "RESIDENTS_GROUP_NOT_PASS"; |
|||
/** |
|||
* 居民端-邻里社群-被邀请入群 |
|||
*/ |
|||
String SMS_TEMPLATE_RESIDENTS_GROUP_INVITE_JOIN = "RESIDENTS_GROUP_INVITE_JOIN"; |
|||
/** |
|||
* 工作端-议题-待审核 |
|||
*/ |
|||
String SMS_TEMPLATE_WORK_ISSUE_WAIT_REVIEW = "WORK_ISSUE_WAIT_REVIEW"; |
|||
/** |
|||
* 工作端-项目-被吹哨 |
|||
*/ |
|||
String SMS_TEMPLATE_WORK_ITEM_WHISTLE = "WORK_ITEM_WHISTLE"; |
|||
/** |
|||
* 工作端-项目-吹哨反馈 |
|||
*/ |
|||
String SMS_TEMPLATE_WORK_ITEM_WHISTLE_FEEDBACK = "WORK_ITEM_WHISTLE_FEEDBACK"; |
|||
/** |
|||
* 工作端-项目-关闭 |
|||
*/ |
|||
String SMS_TEMPLATE_WORK_ITEM_CLOSED = "WORK_ITEM_CLOSED"; |
|||
/** |
|||
* 工作端-项目-结案 |
|||
*/ |
|||
String SMS_TEMPLATE_WORK_ITEM_SETTLE = "WORK_ITEM_SETTLE"; |
|||
} |
@ -0,0 +1,117 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-01-07 |
|||
*/ |
|||
@Data |
|||
public class SmsLogDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 短信模板表ID |
|||
*/ |
|||
private String smsTemplateId; |
|||
|
|||
/** |
|||
* 手机号 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 参数1 |
|||
*/ |
|||
private String params1; |
|||
|
|||
/** |
|||
* 参数2 |
|||
*/ |
|||
private String params2; |
|||
|
|||
/** |
|||
* 参数3 |
|||
*/ |
|||
private String params3; |
|||
|
|||
/** |
|||
* 参数4 |
|||
*/ |
|||
private String params4; |
|||
|
|||
/** |
|||
* 发送状态 0:失败 1:成功 |
|||
*/ |
|||
private Integer status; |
|||
|
|||
/** |
|||
* 平台类型(1:阿里云,2:腾讯云) |
|||
*/ |
|||
private Integer platform; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
/** |
|||
* 删除标记 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 模板类型名称 |
|||
*/ |
|||
private String templateTypeName; |
|||
|
|||
} |
@ -0,0 +1,102 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-01-07 |
|||
*/ |
|||
@Data |
|||
public class SmsTemplateDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 模板类型 |
|||
*/ |
|||
private String templateType; |
|||
|
|||
/** |
|||
* 模板类型名称 |
|||
*/ |
|||
private String templateTypeName; |
|||
|
|||
/** |
|||
* 短信签名 |
|||
*/ |
|||
private String signName; |
|||
|
|||
/** |
|||
* 短信模板 |
|||
*/ |
|||
private String template; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
private String remark; |
|||
|
|||
/** |
|||
* 启用标识(0-否,1-是) |
|||
*/ |
|||
private String enableFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
/** |
|||
* 删除标记 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.elink.esua.epdc.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* |
|||
* 短信通知Form DTO |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/1/7 15:00 |
|||
*/ |
|||
@Data |
|||
public class SmsNoticeFormDTO implements Serializable { |
|||
private static final long serialVersionUID = 8320411108085513393L; |
|||
|
|||
/** |
|||
* 短信模板类型 |
|||
*/ |
|||
@NotBlank(message = "短信模板类型不能为空") |
|||
private String smsTemplateType; |
|||
|
|||
/** |
|||
* 手机号 |
|||
*/ |
|||
private List<String> mobiles; |
|||
} |
@ -0,0 +1,42 @@ |
|||
package com.elink.esua.epdc.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.constant.Constant; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
|||
import com.elink.esua.epdc.dto.form.SmsNoticeFormDTO; |
|||
import com.elink.esua.epdc.service.SmsTemplateService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
/** |
|||
* |
|||
* 短信-消息通知服务 |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/1/7 14:59 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping(Constant.EPDC_APP + "smstemplate") |
|||
public class AppSmsTemplateController { |
|||
|
|||
@Autowired |
|||
private SmsTemplateService smsTemplateService; |
|||
|
|||
/** |
|||
* |
|||
* 发送短信通知 |
|||
* |
|||
* @params [formDto] |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|||
* @author liuchuang |
|||
* @since 2020/1/7 15:09 |
|||
*/ |
|||
@PostMapping("sendSmsNotice") |
|||
public Result sendSmsNotice(@RequestBody SmsNoticeFormDTO formDto) { |
|||
ValidatorUtils.validateEntity(formDto); |
|||
return smsTemplateService.sendSmsNotice(formDto); |
|||
} |
|||
} |
@ -0,0 +1,95 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
|||
import com.elink.esua.epdc.dto.SmsLogDTO; |
|||
import com.elink.esua.epdc.excel.SmsLogExcel; |
|||
import com.elink.esua.epdc.service.SmsLogService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-01-07 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("smslog") |
|||
public class SmsLogController { |
|||
|
|||
@Autowired |
|||
private SmsLogService smsLogService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<SmsLogDTO>> page(@RequestParam Map<String, Object> params){ |
|||
//PageData<SmsLogDTO> page = smsLogService.page(params);
|
|||
PageData<SmsLogDTO> page = smsLogService.getSmsLogPage(params); |
|||
return new Result<PageData<SmsLogDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<SmsLogDTO> get(@PathVariable("id") String id){ |
|||
SmsLogDTO data = smsLogService.get(id); |
|||
return new Result<SmsLogDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody SmsLogDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
smsLogService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody SmsLogDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
smsLogService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
smsLogService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
@GetMapping("export") |
|||
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<SmsLogDTO> list = smsLogService.list(params); |
|||
ExcelUtils.exportExcelToTarget(response, null, list, SmsLogExcel.class); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,95 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; |
|||
import com.elink.esua.epdc.dto.SmsTemplateDTO; |
|||
import com.elink.esua.epdc.excel.SmsTemplateExcel; |
|||
import com.elink.esua.epdc.service.SmsTemplateService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-01-07 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("smstemplate") |
|||
public class SmsTemplateController { |
|||
|
|||
@Autowired |
|||
private SmsTemplateService smsTemplateService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<SmsTemplateDTO>> page(@RequestParam Map<String, Object> params){ |
|||
//PageData<SmsTemplateDTO> page = smsTemplateService.page(params);
|
|||
PageData<SmsTemplateDTO> page = smsTemplateService.getSmsTemplatePage(params); |
|||
return new Result<PageData<SmsTemplateDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<SmsTemplateDTO> get(@PathVariable("id") String id){ |
|||
SmsTemplateDTO data = smsTemplateService.get(id); |
|||
return new Result<SmsTemplateDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody SmsTemplateDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
smsTemplateService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody SmsTemplateDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
smsTemplateService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
smsTemplateService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
@GetMapping("export") |
|||
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<SmsTemplateDTO> list = smsTemplateService.list(params); |
|||
ExcelUtils.exportExcelToTarget(response, null, list, SmsTemplateExcel.class); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,42 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.dto.SmsLogDTO; |
|||
import com.elink.esua.epdc.entity.SmsLogEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-01-07 |
|||
*/ |
|||
@Mapper |
|||
public interface SmsLogDao extends BaseDao<SmsLogEntity> { |
|||
/** |
|||
* 条件查询 |
|||
* @param params |
|||
* @return |
|||
*/ |
|||
List<SmsLogDTO> getPage(Map<String, Object> params); |
|||
} |
@ -0,0 +1,55 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.dto.SmsTemplateDTO; |
|||
import com.elink.esua.epdc.entity.SmsTemplateEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-01-07 |
|||
*/ |
|||
@Mapper |
|||
public interface SmsTemplateDao extends BaseDao<SmsTemplateEntity> { |
|||
|
|||
/** |
|||
* |
|||
* 根据模板类型获取模板信息 |
|||
* |
|||
* @params [smsTemplateType] |
|||
* @return com.elink.esua.epdc.dto.SmsTemplateDTO |
|||
* @author liuchuang |
|||
* @since 2020/1/7 16:52 |
|||
*/ |
|||
SmsTemplateDTO selectOneSmsTemplateInfoByType(String smsTemplateType); |
|||
|
|||
/** |
|||
* 条件查询 |
|||
* @param params |
|||
* @return |
|||
*/ |
|||
List<SmsTemplateDTO> getPage(Map<String, Object> params); |
|||
|
|||
} |
@ -0,0 +1,85 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
/** |
|||
* |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-01-07 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("epdc_sms_log") |
|||
public class SmsLogEntity extends BaseEpdcEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 短信模板表ID |
|||
*/ |
|||
private String smsTemplateId; |
|||
|
|||
/** |
|||
* 手机号 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 参数1 |
|||
*/ |
|||
private String params1; |
|||
|
|||
/** |
|||
* 参数2 |
|||
*/ |
|||
private String params2; |
|||
|
|||
/** |
|||
* 参数3 |
|||
*/ |
|||
private String params3; |
|||
|
|||
/** |
|||
* 参数4 |
|||
*/ |
|||
private String params4; |
|||
|
|||
/** |
|||
* 发送状态 0:失败 1:成功 |
|||
*/ |
|||
private Integer status; |
|||
|
|||
/** |
|||
* 平台类型(1:阿里云,2:腾讯云) |
|||
*/ |
|||
private Integer platform; |
|||
|
|||
/** |
|||
* 模板类型名称 |
|||
*/ |
|||
@TableField(exist = false) |
|||
private String templateTypeName; |
|||
|
|||
} |
@ -0,0 +1,68 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
/** |
|||
* |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-01-07 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("epdc_sms_template") |
|||
public class SmsTemplateEntity extends BaseEpdcEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 模板类型 |
|||
*/ |
|||
private String templateType; |
|||
|
|||
/** |
|||
* 模板类型名称 |
|||
*/ |
|||
private String templateTypeName; |
|||
|
|||
/** |
|||
* 短信签名 |
|||
*/ |
|||
private String signName; |
|||
|
|||
/** |
|||
* 短信模板 |
|||
*/ |
|||
private String template; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
private String remark; |
|||
|
|||
/** |
|||
* 启用标识(0-否,1-是) |
|||
*/ |
|||
private String enableFlag; |
|||
|
|||
} |
@ -0,0 +1,77 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.excel; |
|||
|
|||
import cn.afterturn.easypoi.excel.annotation.Excel; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-01-07 |
|||
*/ |
|||
@Data |
|||
public class SmsLogExcel { |
|||
|
|||
@Excel(name = "主键") |
|||
private String id; |
|||
|
|||
@Excel(name = "短信模板表ID") |
|||
private String smsTemplateId; |
|||
|
|||
@Excel(name = "手机号") |
|||
private String mobile; |
|||
|
|||
@Excel(name = "参数1") |
|||
private String params1; |
|||
|
|||
@Excel(name = "参数2") |
|||
private String params2; |
|||
|
|||
@Excel(name = "参数3") |
|||
private String params3; |
|||
|
|||
@Excel(name = "参数4") |
|||
private String params4; |
|||
|
|||
@Excel(name = "发送状态 0:失败 1:成功") |
|||
private String status; |
|||
|
|||
@Excel(name = "乐观锁") |
|||
private Integer revision; |
|||
|
|||
@Excel(name = "创建人") |
|||
private String createdBy; |
|||
|
|||
@Excel(name = "创建时间") |
|||
private Date createdTime; |
|||
|
|||
@Excel(name = "更新人") |
|||
private String updatedBy; |
|||
|
|||
@Excel(name = "更新时间") |
|||
private Date updatedTime; |
|||
|
|||
@Excel(name = "删除标记") |
|||
private String delFlag; |
|||
|
|||
|
|||
} |
@ -0,0 +1,68 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.excel; |
|||
|
|||
import cn.afterturn.easypoi.excel.annotation.Excel; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-01-07 |
|||
*/ |
|||
@Data |
|||
public class SmsTemplateExcel { |
|||
|
|||
@Excel(name = "主键") |
|||
private String id; |
|||
|
|||
@Excel(name = "参数编码") |
|||
private String paramCode; |
|||
|
|||
@Excel(name = "参数名称") |
|||
private String paramName; |
|||
|
|||
@Excel(name = "参数值") |
|||
private String paramValue; |
|||
|
|||
@Excel(name = "备注") |
|||
private String remark; |
|||
|
|||
@Excel(name = "乐观锁") |
|||
private Integer revision; |
|||
|
|||
@Excel(name = "创建人") |
|||
private String createdBy; |
|||
|
|||
@Excel(name = "创建时间") |
|||
private Date createdTime; |
|||
|
|||
@Excel(name = "更新人") |
|||
private String updatedBy; |
|||
|
|||
@Excel(name = "更新时间") |
|||
private Date updatedTime; |
|||
|
|||
@Excel(name = "删除标记") |
|||
private String delFlag; |
|||
|
|||
|
|||
} |
@ -0,0 +1,47 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.redis; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.redis.RedisUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-01-07 |
|||
*/ |
|||
@Component |
|||
public class SmsLogRedis { |
|||
@Autowired |
|||
private RedisUtils redisUtils; |
|||
|
|||
public void delete(Object[] ids) { |
|||
|
|||
} |
|||
|
|||
public void set(){ |
|||
|
|||
} |
|||
|
|||
public String get(String id){ |
|||
return null; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,47 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.redis; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.redis.RedisUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-01-07 |
|||
*/ |
|||
@Component |
|||
public class SmsTemplateRedis { |
|||
@Autowired |
|||
private RedisUtils redisUtils; |
|||
|
|||
public void delete(Object[] ids) { |
|||
|
|||
} |
|||
|
|||
public void set(){ |
|||
|
|||
} |
|||
|
|||
public String get(String id){ |
|||
return null; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,102 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.service; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.dto.SmsLogDTO; |
|||
import com.elink.esua.epdc.entity.SmsLogEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-01-07 |
|||
*/ |
|||
public interface SmsLogService extends BaseService<SmsLogEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<SmsLogDTO> |
|||
* @author generator |
|||
* @date 2020-01-07 |
|||
*/ |
|||
PageData<SmsLogDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 分页条件查询 |
|||
* @param params |
|||
* @return |
|||
*/ |
|||
PageData<SmsLogDTO> getSmsLogPage(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<SmsLogDTO> |
|||
* @author generator |
|||
* @date 2020-01-07 |
|||
*/ |
|||
List<SmsLogDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return SmsLogDTO |
|||
* @author generator |
|||
* @date 2020-01-07 |
|||
*/ |
|||
SmsLogDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2020-01-07 |
|||
*/ |
|||
void save(SmsLogDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2020-01-07 |
|||
*/ |
|||
void update(SmsLogDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2020-01-07 |
|||
*/ |
|||
void delete(String[] ids); |
|||
} |
@ -0,0 +1,126 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.service; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.SmsTemplateDTO; |
|||
import com.elink.esua.epdc.dto.form.SmsNoticeFormDTO; |
|||
import com.elink.esua.epdc.entity.SmsTemplateEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-01-07 |
|||
*/ |
|||
public interface SmsTemplateService extends BaseService<SmsTemplateEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<SmsTemplateDTO> |
|||
* @author generator |
|||
* @date 2020-01-07 |
|||
*/ |
|||
PageData<SmsTemplateDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 分页条件查询 |
|||
* @param params |
|||
* @return |
|||
*/ |
|||
PageData<SmsTemplateDTO> getSmsTemplatePage(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<SmsTemplateDTO> |
|||
* @author generator |
|||
* @date 2020-01-07 |
|||
*/ |
|||
List<SmsTemplateDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return SmsTemplateDTO |
|||
* @author generator |
|||
* @date 2020-01-07 |
|||
*/ |
|||
SmsTemplateDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2020-01-07 |
|||
*/ |
|||
void save(SmsTemplateDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2020-01-07 |
|||
*/ |
|||
void update(SmsTemplateDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2020-01-07 |
|||
*/ |
|||
void delete(String[] ids); |
|||
|
|||
/** |
|||
* |
|||
* 发送短信通知 |
|||
* |
|||
* @params [formDto] |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|||
* @author liuchuang |
|||
* @since 2020/1/7 15:11 |
|||
*/ |
|||
Result sendSmsNotice(SmsNoticeFormDTO formDto); |
|||
|
|||
/** |
|||
* |
|||
* 根据模板类型获取模板信息 |
|||
* |
|||
* @params [smsTemplateType] |
|||
* @return com.elink.esua.epdc.dto.SmsTemplateDTO |
|||
* @author liuchuang |
|||
* @since 2020/1/7 16:50 |
|||
*/ |
|||
SmsTemplateDTO getSmsTemplateInfoByType(String smsTemplateType); |
|||
} |
@ -0,0 +1,116 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|||
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|||
import com.elink.esua.epdc.dao.SmsLogDao; |
|||
import com.elink.esua.epdc.dto.SmsLogDTO; |
|||
import com.elink.esua.epdc.entity.SmsLogEntity; |
|||
import com.elink.esua.epdc.redis.SmsLogRedis; |
|||
import com.elink.esua.epdc.service.SmsLogService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-01-07 |
|||
*/ |
|||
@Service |
|||
public class SmsLogServiceImpl extends BaseServiceImpl<SmsLogDao, SmsLogEntity> implements SmsLogService { |
|||
|
|||
@Autowired |
|||
private SmsLogRedis smsLogRedis; |
|||
|
|||
@Override |
|||
public PageData<SmsLogDTO> page(Map<String, Object> params) { |
|||
IPage<SmsLogEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, SmsLogDTO.class); |
|||
} |
|||
|
|||
/** |
|||
* 条件查询 |
|||
* @param params |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public PageData<SmsLogDTO> getSmsLogPage(Map<String, Object> params) { |
|||
IPage<SmsLogDTO> page = getPage(params); |
|||
List<SmsLogDTO> list = baseDao.getPage(params); |
|||
return new PageData<>(list, page.getTotal()); |
|||
} |
|||
|
|||
@Override |
|||
public List<SmsLogDTO> list(Map<String, Object> params) { |
|||
List<SmsLogEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, SmsLogDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<SmsLogEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<SmsLogEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public SmsLogDTO get(String id) { |
|||
SmsLogEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, SmsLogDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(SmsLogDTO dto) { |
|||
SmsLogEntity entity = ConvertUtils.sourceToTarget(dto, SmsLogEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(SmsLogDTO dto) { |
|||
SmsLogEntity entity = ConvertUtils.sourceToTarget(dto, SmsLogEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,245 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|||
import com.elink.esua.epdc.commons.tools.exception.RenException; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dao.SmsTemplateDao; |
|||
import com.elink.esua.epdc.dto.SmsTemplateDTO; |
|||
import com.elink.esua.epdc.dto.SysSmsDTO; |
|||
import com.elink.esua.epdc.dto.form.SmsNoticeFormDTO; |
|||
import com.elink.esua.epdc.entity.SmsLogEntity; |
|||
import com.elink.esua.epdc.entity.SmsTemplateEntity; |
|||
import com.elink.esua.epdc.exception.ModuleErrorCode; |
|||
import com.elink.esua.epdc.service.SmsLogService; |
|||
import com.elink.esua.epdc.service.SmsTemplateService; |
|||
import com.elink.esua.epdc.sms.AbstractSmsService; |
|||
import com.elink.esua.epdc.sms.SmsFactory; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-01-07 |
|||
*/ |
|||
@Service |
|||
public class SmsTemplateServiceImpl extends BaseServiceImpl<SmsTemplateDao, SmsTemplateEntity> implements SmsTemplateService { |
|||
|
|||
@Autowired |
|||
private SmsLogService smsLogService; |
|||
|
|||
@Override |
|||
public PageData<SmsTemplateDTO> page(Map<String, Object> params) { |
|||
IPage<SmsTemplateEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, SmsTemplateDTO.class); |
|||
} |
|||
|
|||
/** |
|||
* 条件查询 |
|||
* @param params |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public PageData<SmsTemplateDTO> getSmsTemplatePage(Map<String, Object> params) { |
|||
IPage<SmsTemplateDTO> page = getPage(params); |
|||
List<SmsTemplateDTO> list = baseDao.getPage(params); |
|||
return new PageData<>(list, page.getTotal()); |
|||
} |
|||
|
|||
@Override |
|||
public List<SmsTemplateDTO> list(Map<String, Object> params) { |
|||
List<SmsTemplateEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, SmsTemplateDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<SmsTemplateEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<SmsTemplateEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public SmsTemplateDTO get(String id) { |
|||
SmsTemplateEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, SmsTemplateDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(SmsTemplateDTO dto) { |
|||
String templateType = dto.getTemplateType(); |
|||
if (StringUtils.isNotBlank(templateType)) { |
|||
if (getTemplateType(dto) > 0) { |
|||
throw new RenException("您输入的模板类型已存在"); |
|||
} |
|||
} |
|||
SmsTemplateEntity entity = ConvertUtils.sourceToTarget(dto, SmsTemplateEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
/** |
|||
* 统计模板类型数量 |
|||
* @param dto |
|||
* @return |
|||
*/ |
|||
public Integer getTemplateType(SmsTemplateDTO dto) { |
|||
QueryWrapper<SmsTemplateEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq("TEMPLATE_TYPE", dto.getTemplateType()); |
|||
String id = dto.getId(); |
|||
wrapper.ne(id != null, "id", dto.getId()); |
|||
wrapper.eq("del_flag", "0"); |
|||
return baseDao.selectCount(wrapper); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(SmsTemplateDTO dto) { |
|||
String templateType = dto.getTemplateType(); |
|||
if (StringUtils.isNotBlank(templateType)) { |
|||
if (getTemplateType(dto) > 0) { |
|||
throw new RenException("您输入的模板类型已存在"); |
|||
} |
|||
} |
|||
SmsTemplateEntity entity = ConvertUtils.sourceToTarget(dto, SmsTemplateEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
@Override |
|||
public SmsTemplateDTO getSmsTemplateInfoByType(String smsTemplateType) { |
|||
return baseDao.selectOneSmsTemplateInfoByType(smsTemplateType); |
|||
} |
|||
|
|||
@Override |
|||
public Result sendSmsNotice(SmsNoticeFormDTO formDto) { |
|||
if (null == formDto.getMobiles() || formDto.getMobiles().size() <= 0) { |
|||
return new Result().error("手机号码不能为空"); |
|||
} |
|||
|
|||
// 获取短信模板信息
|
|||
SmsTemplateDTO templateDto = this.getSmsTemplateInfoByType(formDto.getSmsTemplateType()); |
|||
if (null == templateDto) { |
|||
return new Result().error("未查询到模板信息"); |
|||
} |
|||
|
|||
// 手机号处理
|
|||
List<String> mobiles = this.mobileHandle(formDto.getMobiles()); |
|||
|
|||
// 发送短信通知
|
|||
this.sendNotice(mobiles, templateDto); |
|||
|
|||
return new Result(); |
|||
} |
|||
|
|||
/** |
|||
* |
|||
* 手机号处理 |
|||
* |
|||
* @params [mobiles] |
|||
* @return java.util.List<java.lang.String> |
|||
* @author liuchuang |
|||
* @since 2020/1/7 15:44 |
|||
*/ |
|||
private List<String> mobileHandle(List<String> mobiles) { |
|||
List<String> returnList = new ArrayList<>(); |
|||
int mobilesSize = mobiles.size(); |
|||
if (mobilesSize > 1000) { |
|||
for (int i = 0; i < (mobilesSize / 1000 + 1); i++) { |
|||
List<String> temp; |
|||
if (mobiles.size() > 1000) { |
|||
temp = mobiles.subList(0, 1000); |
|||
} else if (mobiles.size() > 0) { |
|||
temp = mobiles.subList(0, mobiles.size()); |
|||
} else { |
|||
break; |
|||
} |
|||
|
|||
String tempStr = StringUtils.join(temp, ","); |
|||
returnList.add(tempStr); |
|||
mobiles.removeAll(temp); |
|||
} |
|||
} else { |
|||
String mobileStr = StringUtils.join(mobiles, ","); |
|||
returnList.add(mobileStr); |
|||
} |
|||
return returnList; |
|||
} |
|||
|
|||
/** |
|||
* |
|||
* 发送短信通知 |
|||
* |
|||
* @params [mobile, signName, template] |
|||
* @return void |
|||
* @author liuchuang |
|||
* @since 2020/1/7 17:04 |
|||
*/ |
|||
private void sendNotice(List<String> mobiles, SmsTemplateDTO templateDto) { |
|||
//短信服务
|
|||
AbstractSmsService service = SmsFactory.build(); |
|||
if (service == null) { |
|||
throw new RenException(ModuleErrorCode.SMS_CONFIG); |
|||
} |
|||
|
|||
List<SmsLogEntity> smsLogEntities = new ArrayList<>(mobiles.size()); |
|||
for (String mobile: |
|||
mobiles) { |
|||
//发送短信
|
|||
SysSmsDTO sysSmsDto = service.sendSmsNotice(mobile, null, templateDto.getSignName(), templateDto.getTemplate()); |
|||
|
|||
SmsLogEntity entity = new SmsLogEntity(); |
|||
entity.setSmsTemplateId(templateDto.getId()); |
|||
entity.setMobile(mobile); |
|||
entity.setStatus(sysSmsDto.getStatus()); |
|||
entity.setPlatform(sysSmsDto.getPlatform()); |
|||
smsLogEntities.add(entity); |
|||
} |
|||
|
|||
// 保存短信记录
|
|||
smsLogService.insertBatch(smsLogEntities); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,63 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.elink.esua.epdc.dao.SmsLogDao"> |
|||
|
|||
<resultMap type="com.elink.esua.epdc.entity.SmsLogEntity" id="smsLogMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="smsTemplateId" column="SMS_TEMPLATE_ID"/> |
|||
<result property="mobile" column="MOBILE"/> |
|||
<result property="params1" column="PARAMS_1"/> |
|||
<result property="params2" column="PARAMS_2"/> |
|||
<result property="params3" column="PARAMS_3"/> |
|||
<result property="params4" column="PARAMS_4"/> |
|||
<result property="status" column="STATUS"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
</resultMap> |
|||
|
|||
<select id="getPage" resultType="com.elink.esua.epdc.dto.SmsLogDTO"> |
|||
select |
|||
sl.ID, |
|||
sl.SMS_TEMPLATE_ID, |
|||
sl.MOBILE, |
|||
sl.PARAMS1, |
|||
sl.PARAMS2, |
|||
sl.PARAMS3, |
|||
sl.PARAMS4, |
|||
sl.STATUS, |
|||
sl.PLATFORM, |
|||
sl.REVISION, |
|||
sl.CREATED_BY, |
|||
sl.CREATED_TIME, |
|||
sl.UPDATED_BY, |
|||
sl.UPDATED_TIME, |
|||
sl.DEL_FLAG, |
|||
st.TEMPLATE_TYPE_NAME |
|||
from epdc_sms_log sl |
|||
left join epdc_sms_template st on sl.SMS_TEMPLATE_ID = st.ID |
|||
where sl.DEL_FLAG = '0' and st.DEL_FLAG = '0' |
|||
<if test="id != null and id != ''"> |
|||
and sl.ID like '%' #{id} '%' |
|||
</if> |
|||
<if test="mobile != null and mobile != ''"> |
|||
and sl.MOBILE like '%' #{mobile} '%' |
|||
</if> |
|||
<if test="status != null and status != ''"> |
|||
and sl.STATUS = #{status} |
|||
</if> |
|||
<if test="platform != null and platform != ''"> |
|||
and sl.PLATFORM = #{platform} |
|||
</if> |
|||
<if test="templateType != null and templateType != ''"> |
|||
and st.TEMPLATE_TYPE = #{templateType} |
|||
</if> |
|||
order by sl.CREATED_TIME desc |
|||
</select> |
|||
|
|||
|
|||
</mapper> |
@ -0,0 +1,37 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.elink.esua.epdc.dao.SmsTemplateDao"> |
|||
|
|||
<select id="selectOneSmsTemplateInfoByType" resultType="com.elink.esua.epdc.dto.SmsTemplateDTO"> |
|||
SELECT * FROM epdc_sms_template WHERE DEL_FLAG = '0' AND ENABLE_FLAG = '1' AND TEMPLATE_TYPE = #{smsTemplateType} |
|||
</select> |
|||
|
|||
<select id="getPage" resultType="com.elink.esua.epdc.dto.SmsTemplateDTO"> |
|||
select |
|||
sl.ID, |
|||
sl.TEMPLATE_TYPE, |
|||
sl.TEMPLATE_TYPE_NAME, |
|||
sl.SIGN_NAME, |
|||
sl.TEMPLATE, |
|||
sl.REMARK, |
|||
sl.ENABLE_FLAG, |
|||
sl.REVISION, |
|||
sl.CREATED_BY, |
|||
sl.CREATED_TIME, |
|||
sl.UPDATED_BY, |
|||
sl.UPDATED_TIME, |
|||
sl.DEL_FLAG |
|||
from epdc_sms_template sl |
|||
where sl.DEL_FLAG = '0' |
|||
<if test="id != null and id != ''"> |
|||
and sl.ID like '%' #{id} '%' |
|||
</if> |
|||
<if test="templateTypeName != null and templateTypeName != ''"> |
|||
and sl.TEMPLATE_TYPE_NAME like '%' #{templateTypeName} '%' |
|||
</if> |
|||
order by sl.CREATED_TIME desc |
|||
</select> |
|||
|
|||
|
|||
</mapper> |
Loading…
Reference in new issue