Browse Source

短信管理,短信日志模块

dev
wanggongfeng 6 years ago
parent
commit
99f92fbeb4
  1. 107
      esua-epdc/epdc-module/epdc-message/epdc-message-client/src/main/java/com/elink/esua/epdc/dto/SmsLogDTO.java
  2. 92
      esua-epdc/epdc-module/epdc-message/epdc-message-client/src/main/java/com/elink/esua/epdc/dto/SmsTemplateDTO.java
  3. 94
      esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/java/com/elink/esua/epdc/controller/SmsLogController.java
  4. 94
      esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/java/com/elink/esua/epdc/controller/SmsTemplateController.java
  5. 33
      esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/java/com/elink/esua/epdc/dao/SmsLogDao.java
  6. 33
      esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/java/com/elink/esua/epdc/dao/SmsTemplateDao.java
  7. 73
      esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/java/com/elink/esua/epdc/entity/SmsLogEntity.java
  8. 58
      esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/java/com/elink/esua/epdc/entity/SmsTemplateEntity.java
  9. 77
      esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/java/com/elink/esua/epdc/excel/SmsLogExcel.java
  10. 68
      esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/java/com/elink/esua/epdc/excel/SmsTemplateExcel.java
  11. 47
      esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/java/com/elink/esua/epdc/redis/SmsLogRedis.java
  12. 47
      esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/java/com/elink/esua/epdc/redis/SmsTemplateRedis.java
  13. 95
      esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/java/com/elink/esua/epdc/service/SmsLogService.java
  14. 95
      esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/java/com/elink/esua/epdc/service/SmsTemplateService.java
  15. 104
      esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/java/com/elink/esua/epdc/service/impl/SmsLogServiceImpl.java
  16. 104
      esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/java/com/elink/esua/epdc/service/impl/SmsTemplateServiceImpl.java
  17. 24
      esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/resources/mapper/SmsLogDao.xml
  18. 21
      esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/resources/mapper/SmsTemplateDao.xml

107
esua-epdc/epdc-module/epdc-message/epdc-message-client/src/main/java/com/elink/esua/epdc/dto/SmsLogDTO.java

@ -0,0 +1,107 @@
/**
* 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 String status;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 删除标记
*/
private String delFlag;
}

92
esua-epdc/epdc-module/epdc-message/epdc-message-client/src/main/java/com/elink/esua/epdc/dto/SmsTemplateDTO.java

@ -0,0 +1,92 @@
/**
* 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 paramCode;
/**
* 参数名称
*/
private String paramName;
/**
* 参数值
*/
private String paramValue;
/**
* 备注
*/
private String remark;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 删除标记
*/
private String delFlag;
}

94
esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/java/com/elink/esua/epdc/controller/SmsLogController.java

@ -0,0 +1,94 @@
/**
* 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);
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);
}
}

94
esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/java/com/elink/esua/epdc/controller/SmsTemplateController.java

@ -0,0 +1,94 @@
/**
* 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.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);
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);
}
}

33
esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/java/com/elink/esua/epdc/dao/SmsLogDao.java

@ -0,0 +1,33 @@
/**
* 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.entity.SmsLogEntity;
import org.apache.ibatis.annotations.Mapper;
/**
*
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-01-07
*/
@Mapper
public interface SmsLogDao extends BaseDao<SmsLogEntity> {
}

33
esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/java/com/elink/esua/epdc/dao/SmsTemplateDao.java

@ -0,0 +1,33 @@
/**
* 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.entity.SmsTemplateEntity;
import org.apache.ibatis.annotations.Mapper;
/**
*
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-01-07
*/
@Mapper
public interface SmsTemplateDao extends BaseDao<SmsTemplateEntity> {
}

73
esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/java/com/elink/esua/epdc/entity/SmsLogEntity.java

@ -0,0 +1,73 @@
/**
* 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_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 String status;
}

58
esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/java/com/elink/esua/epdc/entity/SmsTemplateEntity.java

@ -0,0 +1,58 @@
/**
* 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 paramCode;
/**
* 参数名称
*/
private String paramName;
/**
* 参数值
*/
private String paramValue;
/**
* 备注
*/
private String remark;
}

77
esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/java/com/elink/esua/epdc/excel/SmsLogExcel.java

@ -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;
}

68
esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/java/com/elink/esua/epdc/excel/SmsTemplateExcel.java

@ -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;
}

47
esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/java/com/elink/esua/epdc/redis/SmsLogRedis.java

@ -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;
}
}

47
esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/java/com/elink/esua/epdc/redis/SmsTemplateRedis.java

@ -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;
}
}

95
esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/java/com/elink/esua/epdc/service/SmsLogService.java

@ -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.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 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);
}

95
esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/java/com/elink/esua/epdc/service/SmsTemplateService.java

@ -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.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.SmsTemplateDTO;
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 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);
}

104
esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/java/com/elink/esua/epdc/service/impl/SmsLogServiceImpl.java

@ -0,0 +1,104 @@
/**
* 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);
}
@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));
}
}

104
esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/java/com/elink/esua/epdc/service/impl/SmsTemplateServiceImpl.java

@ -0,0 +1,104 @@
/**
* 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.SmsTemplateDao;
import com.elink.esua.epdc.dto.SmsTemplateDTO;
import com.elink.esua.epdc.entity.SmsTemplateEntity;
import com.elink.esua.epdc.redis.SmsTemplateRedis;
import com.elink.esua.epdc.service.SmsTemplateService;
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 SmsTemplateServiceImpl extends BaseServiceImpl<SmsTemplateDao, SmsTemplateEntity> implements SmsTemplateService {
@Autowired
private SmsTemplateRedis smsTemplateRedis;
@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);
}
@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) {
SmsTemplateEntity entity = ConvertUtils.sourceToTarget(dto, SmsTemplateEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(SmsTemplateDTO dto) {
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));
}
}

24
esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/resources/mapper/SmsLogDao.xml

@ -0,0 +1,24 @@
<?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>
</mapper>

21
esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/resources/mapper/SmsTemplateDao.xml

@ -0,0 +1,21 @@
<?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">
<resultMap type="com.elink.esua.epdc.entity.SmsTemplateEntity" id="smsTemplateMap">
<result property="id" column="ID"/>
<result property="paramCode" column="PARAM_CODE"/>
<result property="paramName" column="PARAM_NAME"/>
<result property="paramValue" column="PARAM_VALUE"/>
<result property="remark" column="REMARK"/>
<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>
</mapper>
Loading…
Cancel
Save