|
|
@@ -0,0 +1,122 @@
|
|
|
+package com.fs.company;
|
|
|
+
|
|
|
+import com.fs.common.annotation.Log;
|
|
|
+import com.fs.common.core.controller.BaseController;
|
|
|
+import com.fs.common.core.domain.AjaxResult;
|
|
|
+import com.fs.common.core.page.TableDataInfo;
|
|
|
+import com.fs.common.enums.BusinessType;
|
|
|
+import com.fs.common.utils.StringUtils;
|
|
|
+import com.fs.common.utils.poi.ExcelUtil;
|
|
|
+import com.fs.company.domain.CompanySmsLogs;
|
|
|
+import com.fs.company.param.CompanySmsLogsListParam;
|
|
|
+import com.fs.company.service.ICompanySmsLogsService;
|
|
|
+import com.fs.company.vo.CompanySmsLogsListVO;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 短信发送记录Controller
|
|
|
+ *
|
|
|
+ * @author fs
|
|
|
+ * @date 2023-01-09
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/company/companySmsLogs")
|
|
|
+public class CompanySmsLogsController extends BaseController
|
|
|
+{
|
|
|
+ @Autowired
|
|
|
+ private ICompanySmsLogsService companySmsLogsService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询短信发送记录列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('company:companySmsLogs:list')")
|
|
|
+ @GetMapping("/list")
|
|
|
+ public TableDataInfo list(CompanySmsLogsListParam companySmsLogs)
|
|
|
+ {
|
|
|
+ startPage();
|
|
|
+ if(!StringUtils.isEmpty(companySmsLogs.getCreateTimeRange())){
|
|
|
+ companySmsLogs.setCreateTimeList(companySmsLogs.getCreateTimeRange().split("--"));
|
|
|
+ }
|
|
|
+ List<CompanySmsLogsListVO> list = companySmsLogsService.selectCompanySmsLogsList(companySmsLogs);
|
|
|
+ if (list != null) {
|
|
|
+ for (CompanySmsLogsListVO vo : list) {
|
|
|
+ if(vo.getPhone()!=null){
|
|
|
+ vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出短信发送记录列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('company:companySmsLogs:export')")
|
|
|
+ @Log(title = "短信发送记录", businessType = BusinessType.EXPORT)
|
|
|
+ @GetMapping("/export")
|
|
|
+ public AjaxResult export(CompanySmsLogsListParam companySmsLogs)
|
|
|
+ {
|
|
|
+ if(!StringUtils.isEmpty(companySmsLogs.getCreateTimeRange())){
|
|
|
+ companySmsLogs.setCreateTimeList(companySmsLogs.getCreateTimeRange().split("--"));
|
|
|
+ }
|
|
|
+ List<CompanySmsLogsListVO> list = companySmsLogsService.selectCompanySmsLogsList(companySmsLogs);
|
|
|
+ if (list != null) {
|
|
|
+ for (CompanySmsLogsListVO vo : list) {
|
|
|
+ if(vo.getPhone()!=null){
|
|
|
+ vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ExcelUtil<CompanySmsLogsListVO> util = new ExcelUtil<CompanySmsLogsListVO>(CompanySmsLogsListVO.class);
|
|
|
+ return util.exportExcel(list, "companySmsLogs");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取短信发送记录详细信息
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('company:companySmsLogs:query')")
|
|
|
+ @GetMapping(value = "/{logsId}")
|
|
|
+ public AjaxResult getInfo(@PathVariable("logsId") Long logsId)
|
|
|
+ {
|
|
|
+ return AjaxResult.success(companySmsLogsService.selectCompanySmsLogsById(logsId));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增短信发送记录
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('company:companySmsLogs:add')")
|
|
|
+ @Log(title = "短信发送记录", businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping
|
|
|
+ public AjaxResult add(@RequestBody CompanySmsLogs companySmsLogs)
|
|
|
+ {
|
|
|
+ return toAjax(companySmsLogsService.insertCompanySmsLogs(companySmsLogs));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改短信发送记录
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('company:companySmsLogs:edit')")
|
|
|
+ @Log(title = "短信发送记录", businessType = BusinessType.UPDATE)
|
|
|
+ @PutMapping
|
|
|
+ public AjaxResult edit(@RequestBody CompanySmsLogs companySmsLogs)
|
|
|
+ {
|
|
|
+ return toAjax(companySmsLogsService.updateCompanySmsLogs(companySmsLogs));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除短信发送记录
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('company:companySmsLogs:remove')")
|
|
|
+ @Log(title = "短信发送记录", businessType = BusinessType.DELETE)
|
|
|
+ @DeleteMapping("/{logsIds}")
|
|
|
+ public AjaxResult remove(@PathVariable Long[] logsIds)
|
|
|
+ {
|
|
|
+ return toAjax(companySmsLogsService.deleteCompanySmsLogsByIds(logsIds));
|
|
|
+ }
|
|
|
+}
|