xgb 2 месяцев назад
Родитель
Сommit
e80352cebf

+ 98 - 0
fs-admin-saas/src/main/java/com/fs/company/CompanySmsController.java

@@ -0,0 +1,98 @@
+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.poi.ExcelUtil;
+import com.fs.company.domain.CompanySms;
+import com.fs.company.service.ICompanySmsService;
+import com.fs.company.vo.CompanySmsListVO;
+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/companySms")
+public class CompanySmsController extends BaseController
+{
+    @Autowired
+    private ICompanySmsService companySmsService;
+
+    /**
+     * 查询公司短信列表
+     */
+    @PreAuthorize("@ss.hasPermi('company:companySms:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(CompanySms companySms)
+    {
+        startPage();
+        List<CompanySmsListVO> list = companySmsService.selectCompanySmsList(companySms);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出公司短信列表
+     */
+    @PreAuthorize("@ss.hasPermi('company:companySms:export')")
+    @Log(title = "公司短信", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(CompanySms companySms)
+    {
+        List<CompanySmsListVO> list = companySmsService.selectCompanySmsList(companySms);
+        ExcelUtil<CompanySmsListVO> util = new ExcelUtil<CompanySmsListVO>(CompanySmsListVO.class);
+        return util.exportExcel(list, "companySms");
+    }
+
+    /**
+     * 获取公司短信详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('company:companySms:query')")
+    @GetMapping(value = "/{smsId}")
+    public AjaxResult getInfo(@PathVariable("smsId") Long smsId)
+    {
+        return AjaxResult.success(companySmsService.selectCompanySmsById(smsId));
+    }
+
+    /**
+     * 新增公司短信
+     */
+    @PreAuthorize("@ss.hasPermi('company:companySms:add')")
+    @Log(title = "公司短信", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CompanySms companySms)
+    {
+        return toAjax(companySmsService.insertCompanySms(companySms));
+    }
+
+    /**
+     * 修改公司短信
+     */
+    @PreAuthorize("@ss.hasPermi('company:companySms:edit')")
+    @Log(title = "公司短信", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody CompanySms companySms)
+    {
+        return toAjax(companySmsService.updateCompanySms(companySms));
+    }
+
+    /**
+     * 删除公司短信
+     */
+    @PreAuthorize("@ss.hasPermi('company:companySms:remove')")
+    @Log(title = "公司短信", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{smsIds}")
+    public AjaxResult remove(@PathVariable Long[] smsIds)
+    {
+        return toAjax(companySmsService.deleteCompanySmsByIds(smsIds));
+    }
+}

+ 122 - 0
fs-admin-saas/src/main/java/com/fs/company/CompanySmsLogsController.java

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

+ 99 - 0
fs-admin-saas/src/main/java/com/fs/company/CompanySmsOrderController.java

@@ -0,0 +1,99 @@
+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.poi.ExcelUtil;
+import com.fs.company.domain.CompanySmsOrder;
+import com.fs.company.param.CompanySmsOrderListParam;
+import com.fs.company.service.ICompanySmsOrderService;
+import com.fs.company.vo.CompanySmsOrderListVO;
+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/companySmsOrder")
+public class CompanySmsOrderController extends BaseController
+{
+    @Autowired
+    private ICompanySmsOrderService companySmsOrderService;
+
+    /**
+     * 查询短信购买订单列表
+     */
+    @PreAuthorize("@ss.hasPermi('company:companySmsOrder:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(CompanySmsOrderListParam param)
+    {
+        startPage();
+        List<CompanySmsOrderListVO> list = companySmsOrderService.selectCompanySmsOrderList(param);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出短信购买订单列表
+     */
+    @PreAuthorize("@ss.hasPermi('company:companySmsOrder:export')")
+    @Log(title = "短信购买订单", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(CompanySmsOrderListParam param)
+    {
+        List<CompanySmsOrderListVO> list = companySmsOrderService.selectCompanySmsOrderList(param);
+        ExcelUtil<CompanySmsOrderListVO> util = new ExcelUtil<CompanySmsOrderListVO>(CompanySmsOrderListVO.class);
+        return util.exportExcel(list, "companySmsOrder");
+    }
+
+    /**
+     * 获取短信购买订单详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('company:companySmsOrder:query')")
+    @GetMapping(value = "/{orderId}")
+    public AjaxResult getInfo(@PathVariable("orderId") Long orderId)
+    {
+        return AjaxResult.success(companySmsOrderService.selectCompanySmsOrderById(orderId));
+    }
+
+    /**
+     * 新增短信购买订单
+     */
+    @PreAuthorize("@ss.hasPermi('company:companySmsOrder:add')")
+    @Log(title = "短信购买订单", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CompanySmsOrder companySmsOrder)
+    {
+        return toAjax(companySmsOrderService.insertCompanySmsOrder(companySmsOrder));
+    }
+
+    /**
+     * 修改短信购买订单
+     */
+    @PreAuthorize("@ss.hasPermi('company:companySmsOrder:edit')")
+    @Log(title = "短信购买订单", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody CompanySmsOrder companySmsOrder)
+    {
+        return toAjax(companySmsOrderService.updateCompanySmsOrder(companySmsOrder));
+    }
+
+    /**
+     * 删除短信购买订单
+     */
+    @PreAuthorize("@ss.hasPermi('company:companySmsOrder:remove')")
+    @Log(title = "短信购买订单", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{orderIds}")
+    public AjaxResult remove(@PathVariable Long[] orderIds)
+    {
+        return toAjax(companySmsOrderService.deleteCompanySmsOrderByIds(orderIds));
+    }
+}

+ 115 - 0
fs-admin-saas/src/main/java/com/fs/company/CompanySmsTempController.java

@@ -0,0 +1,115 @@
+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.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.company.domain.CompanySmsTemp;
+import com.fs.company.service.ICompanySmsTempService;
+import com.fs.company.vo.CompanySmsTempListVO;
+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/companySmsTemp")
+public class CompanySmsTempController extends BaseController
+{
+    @Autowired
+    private ICompanySmsTempService companySmsTempService;
+
+    /**
+     * 查询短信模板列表
+     */
+    @PreAuthorize("@ss.hasPermi('company:companySmsTemp:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(CompanySmsTemp companySmsTemp)
+    {
+        startPage();
+        List<CompanySmsTempListVO> list = companySmsTempService.selectCompanySmsTempListVO(companySmsTemp);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出短信模板列表
+     */
+    @PreAuthorize("@ss.hasPermi('company:companySmsTemp:export')")
+    @Log(title = "短信模板", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(CompanySmsTemp companySmsTemp)
+    {
+        List<CompanySmsTemp> list = companySmsTempService.selectCompanySmsTempList(companySmsTemp);
+        ExcelUtil<CompanySmsTemp> util = new ExcelUtil<CompanySmsTemp>(CompanySmsTemp.class);
+        return util.exportExcel(list, "companySmsTemp");
+    }
+
+    /**
+     * 获取短信模板详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('company:companySmsTemp:query')")
+    @GetMapping(value = "/{tempId}")
+    public AjaxResult getInfo(@PathVariable("tempId") Long tempId)
+    {
+        return AjaxResult.success(companySmsTempService.selectCompanySmsTempById(tempId));
+    }
+
+    /**
+     * 新增短信模板
+     */
+    @PreAuthorize("@ss.hasPermi('company:companySmsTemp:add')")
+    @Log(title = "短信模板", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CompanySmsTemp companySmsTemp)
+    {
+        return toAjax(companySmsTempService.insertCompanySmsTemp(companySmsTemp));
+    }
+
+    /**
+     * 修改短信模板
+     */
+    @PreAuthorize("@ss.hasPermi('company:companySmsTemp:edit')")
+    @Log(title = "短信模板", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody CompanySmsTemp companySmsTemp)
+    {
+        return toAjax(companySmsTempService.updateCompanySmsTemp(companySmsTemp));
+    }
+
+    /**
+     * 删除短信模板
+     */
+    @PreAuthorize("@ss.hasPermi('company:companySmsTemp:remove')")
+    @Log(title = "短信模板", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{tempIds}")
+    public AjaxResult remove(@PathVariable Long[] tempIds)
+    {
+        return toAjax(companySmsTempService.deleteCompanySmsTempByIds(tempIds));
+    }
+
+
+    @PreAuthorize("@ss.hasPermi('company:companySmsTemp:audit')")
+    @PostMapping("/audit")
+    public R audit(@RequestBody CompanySmsTemp companySmsTemp)
+    {
+        CompanySmsTemp map=new CompanySmsTemp();
+        map.setIsAudit(1);
+        map.setTempId(companySmsTemp.getTempId());
+        if(companySmsTempService.updateCompanySmsTemp(map)>0){
+            return R.ok("操作成功");
+        }
+        else{
+            return R.error("操作失败");
+        }
+    }
+}