韦忠喜提交
parent
a6f8f02314
commit
dc44d17446
@ -0,0 +1,79 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019-2020 Zheng Jie
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package me.zhengjie.modules.smscontent.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import cn.hutool.core.bean.copier.CopyOptions;
|
||||||
|
import javax.persistence.*;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @website https://el-admin.vip
|
||||||
|
* @description /
|
||||||
|
* @author weizhongxi
|
||||||
|
* @date 2021-04-16
|
||||||
|
**/
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@Table(name="tb_send_sms_content")
|
||||||
|
public class TbSendSmsContent implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@Column(name = "id")
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Column(name = "gmt_create")
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Timestamp gmtCreate;
|
||||||
|
|
||||||
|
@Column(name = "gmt_modified")
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private Timestamp gmtModified;
|
||||||
|
|
||||||
|
@Column(name = "operation")
|
||||||
|
@ApiModelProperty(value = "操作人")
|
||||||
|
private String operation;
|
||||||
|
|
||||||
|
@Column(name = "task_name")
|
||||||
|
@ApiModelProperty(value = "任务名称")
|
||||||
|
private String taskName;
|
||||||
|
|
||||||
|
@Column(name = "sms_content")
|
||||||
|
@ApiModelProperty(value = "短信内容")
|
||||||
|
private String smsContent;
|
||||||
|
|
||||||
|
@Column(name = "send_status")
|
||||||
|
@ApiModelProperty(value = "推送状态")
|
||||||
|
private Integer sendStatus;
|
||||||
|
|
||||||
|
@Column(name = "push_time")
|
||||||
|
@ApiModelProperty(value = "推送时间")
|
||||||
|
private Timestamp pushTime;
|
||||||
|
|
||||||
|
@Column(name = "link_url")
|
||||||
|
@ApiModelProperty(value = "推送时间")
|
||||||
|
private String linkUrl;
|
||||||
|
|
||||||
|
public void copy(TbSendSmsContent source){
|
||||||
|
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019-2020 Zheng Jie
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package me.zhengjie.modules.smscontent.repository;
|
||||||
|
|
||||||
|
import me.zhengjie.modules.smscontent.domain.TbSendSmsContent;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @website https://el-admin.vip
|
||||||
|
* @author weizhongxi
|
||||||
|
* @date 2021-04-16
|
||||||
|
**/
|
||||||
|
public interface TbSendSmsContentRepository extends JpaRepository<TbSendSmsContent, Long>, JpaSpecificationExecutor<TbSendSmsContent> {
|
||||||
|
}
|
@ -0,0 +1,87 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019-2020 Zheng Jie
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package me.zhengjie.modules.smscontent.rest;
|
||||||
|
|
||||||
|
import me.zhengjie.annotation.Log;
|
||||||
|
import me.zhengjie.modules.smscontent.domain.TbSendSmsContent;
|
||||||
|
import me.zhengjie.modules.smscontent.service.TbSendSmsContentService;
|
||||||
|
import me.zhengjie.modules.smscontent.service.dto.TbSendSmsContentQueryCriteria;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @website https://el-admin.vip
|
||||||
|
* @author weizhongxi
|
||||||
|
* @date 2021-04-16
|
||||||
|
**/
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "发送短信内容管理")
|
||||||
|
@RequestMapping("/api/tbSendSmsContent")
|
||||||
|
public class TbSendSmsContentController {
|
||||||
|
|
||||||
|
private final TbSendSmsContentService tbSendSmsContentService;
|
||||||
|
|
||||||
|
@Log("导出数据")
|
||||||
|
@ApiOperation("导出数据")
|
||||||
|
@GetMapping(value = "/download")
|
||||||
|
@PreAuthorize("@el.check('tbSendSmsContent:list')")
|
||||||
|
public void download(HttpServletResponse response, TbSendSmsContentQueryCriteria criteria) throws IOException {
|
||||||
|
tbSendSmsContentService.download(tbSendSmsContentService.queryAll(criteria), response);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping
|
||||||
|
@Log("查询发送短信内容")
|
||||||
|
@ApiOperation("查询发送短信内容")
|
||||||
|
@PreAuthorize("@el.check('tbSendSmsContent:list')")
|
||||||
|
public ResponseEntity<Object> query(TbSendSmsContentQueryCriteria criteria, Pageable pageable){
|
||||||
|
return new ResponseEntity<>(tbSendSmsContentService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
@Log("新增发送短信内容")
|
||||||
|
@ApiOperation("新增发送短信内容")
|
||||||
|
@PreAuthorize("@el.check('tbSendSmsContent:add')")
|
||||||
|
public ResponseEntity<Object> create(@Validated @RequestBody TbSendSmsContent resources){
|
||||||
|
return new ResponseEntity<>(tbSendSmsContentService.create(resources),HttpStatus.CREATED);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping
|
||||||
|
@Log("修改发送短信内容")
|
||||||
|
@ApiOperation("修改发送短信内容")
|
||||||
|
@PreAuthorize("@el.check('tbSendSmsContent:edit')")
|
||||||
|
public ResponseEntity<Object> update(@Validated @RequestBody TbSendSmsContent resources){
|
||||||
|
tbSendSmsContentService.update(resources);
|
||||||
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log("删除发送短信内容")
|
||||||
|
@ApiOperation("删除发送短信内容")
|
||||||
|
@PreAuthorize("@el.check('tbSendSmsContent:del')")
|
||||||
|
@DeleteMapping
|
||||||
|
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||||
|
tbSendSmsContentService.deleteAll(ids);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,83 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019-2020 Zheng Jie
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package me.zhengjie.modules.smscontent.service;
|
||||||
|
|
||||||
|
import me.zhengjie.modules.smscontent.domain.TbSendSmsContent;
|
||||||
|
import me.zhengjie.modules.smscontent.service.dto.TbSendSmsContentDto;
|
||||||
|
import me.zhengjie.modules.smscontent.service.dto.TbSendSmsContentQueryCriteria;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.List;
|
||||||
|
import java.io.IOException;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @website https://el-admin.vip
|
||||||
|
* @description 服务接口
|
||||||
|
* @author weizhongxi
|
||||||
|
* @date 2021-04-16
|
||||||
|
**/
|
||||||
|
public interface TbSendSmsContentService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询数据分页
|
||||||
|
* @param criteria 条件
|
||||||
|
* @param pageable 分页参数
|
||||||
|
* @return Map<String,Object>
|
||||||
|
*/
|
||||||
|
Map<String,Object> queryAll(TbSendSmsContentQueryCriteria criteria, Pageable pageable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有数据不分页
|
||||||
|
* @param criteria 条件参数
|
||||||
|
* @return List<TbSendSmsContentDto>
|
||||||
|
*/
|
||||||
|
List<TbSendSmsContentDto> queryAll(TbSendSmsContentQueryCriteria criteria);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID查询
|
||||||
|
* @param id ID
|
||||||
|
* @return TbSendSmsContentDto
|
||||||
|
*/
|
||||||
|
TbSendSmsContentDto findById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建
|
||||||
|
* @param resources /
|
||||||
|
* @return TbSendSmsContentDto
|
||||||
|
*/
|
||||||
|
TbSendSmsContentDto create(TbSendSmsContent resources);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
* @param resources /
|
||||||
|
*/
|
||||||
|
void update(TbSendSmsContent resources);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多选删除
|
||||||
|
* @param ids /
|
||||||
|
*/
|
||||||
|
void deleteAll(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出数据
|
||||||
|
* @param all 待导出的数据
|
||||||
|
* @param response /
|
||||||
|
* @throws IOException /
|
||||||
|
*/
|
||||||
|
void download(List<TbSendSmsContentDto> all, HttpServletResponse response) throws IOException;
|
||||||
|
}
|
@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019-2020 Zheng Jie
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package me.zhengjie.modules.smscontent.service.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @website https://el-admin.vip
|
||||||
|
* @description /
|
||||||
|
* @author weizhongxi
|
||||||
|
* @date 2021-04-16
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class TbSendSmsContentDto implements Serializable {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 创建时间 */
|
||||||
|
private Timestamp gmtCreate;
|
||||||
|
|
||||||
|
/** 修改时间 */
|
||||||
|
private Timestamp gmtModified;
|
||||||
|
|
||||||
|
/** 操作人 */
|
||||||
|
private String operation;
|
||||||
|
|
||||||
|
/** 任务名称 */
|
||||||
|
private String taskName;
|
||||||
|
|
||||||
|
/** 短信内容 */
|
||||||
|
private String smsContent;
|
||||||
|
|
||||||
|
/** 推送状态 */
|
||||||
|
private Integer sendStatus;
|
||||||
|
|
||||||
|
/** 推送时间 */
|
||||||
|
private Timestamp pushTime;
|
||||||
|
}
|
@ -0,0 +1,47 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019-2020 Zheng Jie
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package me.zhengjie.modules.smscontent.service.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
import java.util.List;
|
||||||
|
import me.zhengjie.annotation.Query;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @website https://el-admin.vip
|
||||||
|
* @author weizhongxi
|
||||||
|
* @date 2021-04-16
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class TbSendSmsContentQueryCriteria{
|
||||||
|
|
||||||
|
/** 模糊 */
|
||||||
|
@Query(type = Query.Type.INNER_LIKE)
|
||||||
|
private String operation;
|
||||||
|
|
||||||
|
/** 模糊 */
|
||||||
|
@Query(type = Query.Type.INNER_LIKE)
|
||||||
|
private String taskName;
|
||||||
|
|
||||||
|
/** 模糊 */
|
||||||
|
@Query(type = Query.Type.INNER_LIKE)
|
||||||
|
private String smsContent;
|
||||||
|
/** BETWEEN */
|
||||||
|
@Query(type = Query.Type.BETWEEN)
|
||||||
|
private List<Timestamp> createTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,110 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019-2020 Zheng Jie
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package me.zhengjie.modules.smscontent.service.impl;
|
||||||
|
|
||||||
|
import me.zhengjie.modules.smscontent.domain.TbSendSmsContent;
|
||||||
|
import me.zhengjie.utils.ValidationUtil;
|
||||||
|
import me.zhengjie.utils.FileUtil;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import me.zhengjie.modules.smscontent.repository.TbSendSmsContentRepository;
|
||||||
|
import me.zhengjie.modules.smscontent.service.TbSendSmsContentService;
|
||||||
|
import me.zhengjie.modules.smscontent.service.dto.TbSendSmsContentDto;
|
||||||
|
import me.zhengjie.modules.smscontent.service.dto.TbSendSmsContentQueryCriteria;
|
||||||
|
import me.zhengjie.modules.smscontent.service.mapstruct.TbSendSmsContentMapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import me.zhengjie.utils.PageUtil;
|
||||||
|
import me.zhengjie.utils.QueryHelp;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.io.IOException;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @website https://el-admin.vip
|
||||||
|
* @description 服务实现
|
||||||
|
* @author weizhongxi
|
||||||
|
* @date 2021-04-16
|
||||||
|
**/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class TbSendSmsContentServiceImpl implements TbSendSmsContentService {
|
||||||
|
|
||||||
|
private final TbSendSmsContentRepository tbSendSmsContentRepository;
|
||||||
|
private final TbSendSmsContentMapper tbSendSmsContentMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String,Object> queryAll(TbSendSmsContentQueryCriteria criteria, Pageable pageable){
|
||||||
|
Page<TbSendSmsContent> page = tbSendSmsContentRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||||
|
return PageUtil.toPage(page.map(tbSendSmsContentMapper::toDto));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TbSendSmsContentDto> queryAll(TbSendSmsContentQueryCriteria criteria){
|
||||||
|
return tbSendSmsContentMapper.toDto(tbSendSmsContentRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public TbSendSmsContentDto findById(Long id) {
|
||||||
|
TbSendSmsContent tbSendSmsContent = tbSendSmsContentRepository.findById(id).orElseGet(TbSendSmsContent::new);
|
||||||
|
ValidationUtil.isNull(tbSendSmsContent.getId(),"TbSendSmsContent","id",id);
|
||||||
|
return tbSendSmsContentMapper.toDto(tbSendSmsContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public TbSendSmsContentDto create(TbSendSmsContent resources) {
|
||||||
|
return tbSendSmsContentMapper.toDto(tbSendSmsContentRepository.save(resources));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void update(TbSendSmsContent resources) {
|
||||||
|
TbSendSmsContent tbSendSmsContent = tbSendSmsContentRepository.findById(resources.getId()).orElseGet(TbSendSmsContent::new);
|
||||||
|
ValidationUtil.isNull( tbSendSmsContent.getId(),"TbSendSmsContent","id",resources.getId());
|
||||||
|
tbSendSmsContent.copy(resources);
|
||||||
|
tbSendSmsContentRepository.save(tbSendSmsContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteAll(Long[] ids) {
|
||||||
|
for (Long id : ids) {
|
||||||
|
tbSendSmsContentRepository.deleteById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void download(List<TbSendSmsContentDto> all, HttpServletResponse response) throws IOException {
|
||||||
|
List<Map<String, Object>> list = new ArrayList<>();
|
||||||
|
for (TbSendSmsContentDto tbSendSmsContent : all) {
|
||||||
|
Map<String,Object> map = new LinkedHashMap<>();
|
||||||
|
map.put("创建时间", tbSendSmsContent.getGmtCreate());
|
||||||
|
map.put("修改时间", tbSendSmsContent.getGmtModified());
|
||||||
|
map.put("操作人", tbSendSmsContent.getOperation());
|
||||||
|
map.put("任务名称", tbSendSmsContent.getTaskName());
|
||||||
|
map.put("短信内容", tbSendSmsContent.getSmsContent());
|
||||||
|
map.put("推送状态", tbSendSmsContent.getSendStatus());
|
||||||
|
map.put("推送时间", tbSendSmsContent.getPushTime());
|
||||||
|
list.add(map);
|
||||||
|
}
|
||||||
|
FileUtil.downloadExcel(list, response);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019-2020 Zheng Jie
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package me.zhengjie.modules.smscontent.service.mapstruct;
|
||||||
|
|
||||||
|
import me.zhengjie.base.BaseMapper;
|
||||||
|
import me.zhengjie.modules.smscontent.domain.TbSendSmsContent;
|
||||||
|
import me.zhengjie.modules.smscontent.service.dto.TbSendSmsContentDto;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.ReportingPolicy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @website https://el-admin.vip
|
||||||
|
* @author weizhongxi
|
||||||
|
* @date 2021-04-16
|
||||||
|
**/
|
||||||
|
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||||
|
public interface TbSendSmsContentMapper extends BaseMapper<TbSendSmsContentDto, TbSendSmsContent> {
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue