Explorar o código

Merge branch 'blue' of http://39.105.160.25:10880/post-project-api/post

 Conflicts:
	ruoyi-admin/src/main/resources/application-druid.yml
	ruoyi-admin/src/main/resources/application.yml
tangzetong %!s(int64=2) %!d(string=hai) anos
pai
achega
ea3b459efe
Modificáronse 39 ficheiros con 3978 adicións e 9 borrados
  1. 4 0
      Dockerfile
  2. 33 0
      Jenkinsfile
  3. 10 0
      docker-compose.yml
  4. 194 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/PoNewsController.java
  5. 110 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/PoNewsFileController.java
  6. 104 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/PoNoticeController.java
  7. 104 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/PoOperLogController.java
  8. 185 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/PoUserController.java
  9. 51 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/UploadAndDownloadController.java
  10. 3 2
      ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java
  11. 27 5
      ruoyi-admin/src/main/resources/application-druid.yml
  12. 79 0
      ruoyi-admin/src/main/resources/application-prod.yml
  13. 2 2
      ruoyi-admin/src/main/resources/application.yml
  14. 37 0
      ruoyi-common/src/main/java/com/ruoyi/common/utils/sql/List2VarcharHandler.java
  15. 162 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/PoNews.java
  16. 79 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/PoNewsFile.java
  17. 157 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/PoNotice.java
  18. 263 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/PoOperLog.java
  19. 238 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/PoUser.java
  20. 40 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/PoNewsFileMapper.java
  21. 120 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/PoNewsMapper.java
  22. 60 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/PoNoticeMapper.java
  23. 61 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/PoOperLogMapper.java
  24. 92 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/PoUserMapper.java
  25. 45 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/IPoNewsFileService.java
  26. 104 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/IPoNewsService.java
  27. 60 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/IPoNoticeService.java
  28. 60 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/IPoOperLogService.java
  29. 109 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/IPoUserService.java
  30. 75 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PoNewsFileServiceImpl.java
  31. 279 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PoNewsServiceImpl.java
  32. 86 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PoNoticeServiceImpl.java
  33. 93 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PoOperLogServiceImpl.java
  34. 182 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PoUserServiceImpl.java
  35. 68 0
      ruoyi-system/src/main/resources/mapper/system/PoNewsFileMapper.xml
  36. 179 0
      ruoyi-system/src/main/resources/mapper/system/PoNewsMapper.xml
  37. 128 0
      ruoyi-system/src/main/resources/mapper/system/PoNoticeMapper.xml
  38. 138 0
      ruoyi-system/src/main/resources/mapper/system/PoOperLogMapper.xml
  39. 157 0
      ruoyi-system/src/main/resources/mapper/system/PoUserMapper.xml

+ 4 - 0
Dockerfile

@@ -0,0 +1,4 @@
+FROM openjdk:8
+COPY ./ruoyi-admin/target/ruoyi-admin.jar /tmp/app.jar
+EXPOSE 8080
+ENTRYPOINT java -Xms256m -Xmx512m -jar /tmp/app.jar --spring.profiles.active=prod

+ 33 - 0
Jenkinsfile

@@ -0,0 +1,33 @@
+pipeline {
+    agent any
+    environment {
+        BRANCH_NAME="${env.BRANCH_NAME}".toLowerCase()
+    }
+    stages {
+        stage('pullCode'){
+            steps{
+                echo 'This is a pullCode step'
+                checkout scm
+            }
+        }
+        stage('Build') {
+            steps {
+                echo 'Building..'
+                sh 'docker-compose down'
+                sh '~/tools/apache-maven-3.6.3/bin/mvn  clean install -Dmaven.test.skip=true'
+                sh 'docker build -t ${BRANCH_NAME}:${BUILD_NUMBER} .'
+            }
+        }
+        stage('Test') {
+            steps {
+                echo 'Testing..'
+            }
+        }
+        stage('Deploy') {
+            steps {
+                echo 'Deploying....'
+                sh 'docker-compose up -d'
+            }
+        }
+    }
+}

+ 10 - 0
docker-compose.yml

@@ -0,0 +1,10 @@
+services:
+  post-project-api:
+    image: ${BRANCH_NAME}:${BUILD_NUMBER}
+    ports:
+      - 8181:8080
+    networks:
+      - local_public
+networks:
+  local_public:
+    external: true

+ 194 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/PoNewsController.java

@@ -0,0 +1,194 @@
+package com.ruoyi.web.controller.system;
+
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.constant.UserConstants;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.domain.PoNews;
+import com.ruoyi.system.domain.PoUser;
+import com.ruoyi.system.service.IPoNewsService;
+import com.ruoyi.system.service.impl.PoUserServiceImpl;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.repository.query.Param;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 消息模块Controller
+ *
+ * @date 2023-01-15
+ */
+@RestController
+@RequestMapping("/system/news")
+public class PoNewsController extends BaseController
+{
+    @Autowired
+    private IPoNewsService poNewsService;
+
+    @Autowired
+    private PoUserServiceImpl poUserService;
+
+    /**
+     * 导入用户手机号
+     */
+    @Log(title = "用户手机导入", businessType = BusinessType.IMPORT)
+    @PreAuthorize("@ss.hasPermi('system:news:import')")
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
+    {
+        ExcelUtil<PoNews> util = new ExcelUtil<PoNews>(PoNews.class);
+        List<PoNews> phoneList = util.importExcel(file.getInputStream());
+        String userName = getUsername();
+        String message = poNewsService.importPhone(phoneList, updateSupport, userName);
+        return success(message);
+    }
+
+    /**
+     * 对list数据源将其里面的数据导入到excel表单
+     * @param response
+     */
+    @PostMapping("/importTemplate")
+    public void importTemplate(HttpServletResponse response)
+    {
+        ExcelUtil<PoNews> util = new ExcelUtil<PoNews>(PoNews.class);
+        util.importTemplateExcel(response, "消息数据");
+    }
+
+
+    /**
+     * 查看详情
+     * 点击详情获取一个消息详细内容根据newsId
+     */
+    @ApiOperation("点击详情获取一个消息详细内容根据newsId")
+    @Log(title = "获取一个消息详细内容")
+    @PreAuthorize("@ss.hasPermi('system:news:querycontent')")
+    @GetMapping("/content/{newsId}")
+    public AjaxResult getContent(@PathVariable("newsId")String newsId){
+        return success(poNewsService.selectContentByNewsId(newsId));
+    }
+
+    /**
+     * 标题和时间搜索消息列表
+     */
+    @ApiOperation("标题和时间搜索消息列表")
+    @Log(title = "标题和时间搜索")
+    @PreAuthorize("@ss.hasPermi('system:news:querynews')")
+    @GetMapping("/queryNews")
+    public TableDataInfo list(@RequestParam(value="title",required = false)String title,
+                              @RequestParam(value="newsTimeStart",required = false)Date newsTimeStart,
+                              @RequestParam(value="newsTimeEnd",required = false) Date newsTimeEnd)
+    {
+        startPage();
+        List<PoNews> list= poNewsService.selectListByTitleAndTime(title,newsTimeStart,newsTimeEnd);
+        return getDataTable(list);
+    }
+
+    /**
+     * 查询消息列表
+     */
+    @ApiOperation("查询消息列表")
+    @Log(title = "分页查询消息列表")
+    @PreAuthorize("@ss.hasPermi('system:news:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(PoNews poNews)
+    {
+        startPage();
+        List<PoNews> list = poNewsService.selectPoNewsList(poNews);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出消息列表
+     */
+    @ApiOperation("导出消息列表")
+    @PreAuthorize("@ss.hasPermi('system:news:export')")
+    @Log(title = "导出消息列表", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, PoNews poNews)
+    {
+        List<PoNews> list = poNewsService.selectPoNewsList(poNews);
+        ExcelUtil<PoNews> util = new ExcelUtil<PoNews>(PoNews.class);
+        util.exportExcel(response, list, "消息数据");
+    }
+
+    /**
+     * 获取消息详细信息
+     */
+    @ApiOperation("获取消息详细内容")
+    @Log(title = "获取所有消息详情")
+    @PreAuthorize("@ss.hasPermi('system:news:query')")
+    @GetMapping(value = "/{newsId}")
+    public AjaxResult getInfo(@PathVariable("newsId") String newsId)
+    {
+        return success(poNewsService.selectPoNewsByNewsId(newsId));
+    }
+
+    /**
+     * 新增消息
+     */
+    @ApiOperation("新增消息")
+    @PreAuthorize("@ss.hasPermi('system:news:add')")
+    @Log(title = "新增消息", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    public AjaxResult add(@RequestBody @Param("poNews") PoNews poNews, @RequestBody @Param("poUser") PoUser poUser)
+    {
+        //判断当前用户是否有操作的权限
+        poUserService.checkUserAllowed(poUser);
+
+        if (UserConstants.NOT_UNIQUE.equals(poNewsService.checkPostNewsTitleUnique(poNews))){
+            return AjaxResult.error("新增失败"+poNews.getNewsTitle()+"已经存在");
+        }
+        if(UserConstants.NOT_UNIQUE.equals(poNewsService.checkPostNewsImageUnique(poNews))){
+            return AjaxResult.error("新增失败"+poNews.getImage()+"已经存在");
+        }
+        return toAjax(poNewsService.insertPoNews(poNews));
+    }
+
+    /**
+     * 修改消息
+     */
+    @ApiOperation("修改消息")
+    @PreAuthorize("@ss.hasPermi('system:news:edit')")
+    @Log(title = "修改消息", businessType = BusinessType.UPDATE)
+    @PutMapping("/edit")
+    public AjaxResult edit(@RequestBody PoNews poNews ,@RequestBody PoUser poUser)
+    {
+        //校验是否有操作的权限
+        poUserService.checkUserAllowed(poUser);
+
+        //校验是否可以访问到数据
+        poUserService.checkUserDataScope(poUser.getUserId());
+
+        if (UserConstants.NOT_UNIQUE.equals(poNewsService.checkPostNewsTitleUnique(poNews))
+            ){
+            return AjaxResult.error("修改失败"+poNews.getNewsTitle()+"已经存在");
+        }
+        return toAjax(poNewsService.updatePoNews(poNews));
+    }
+
+    /**
+     * 删除消息
+     */
+    @ApiOperation("删除消息")
+    @PreAuthorize("@ss.hasPermi('system:news:remove')")
+    @Log(title = "删除消息", businessType = BusinessType.DELETE)
+    @DeleteMapping("/remove/{newsIds}")
+    public AjaxResult remove(@PathVariable String[] newsIds)
+    {
+        if (!getUsername().equals("admin")){
+            return AjaxResult.error("删除消息失败当前用户不是管理员");
+        }
+        return toAjax(poNewsService.deletePoNewsByNewsIds(newsIds));
+    }
+}
+

+ 110 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/PoNewsFileController.java

@@ -0,0 +1,110 @@
+package com.ruoyi.web.controller.system;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import io.swagger.annotations.ApiOperation;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.system.domain.PoNewsFile;
+import com.ruoyi.system.service.IPoNewsFileService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 信息文件Controller
+ * @date 2023-01-25
+ */
+@RestController
+@RequestMapping("/system/file")
+public class PoNewsFileController extends BaseController
+{
+    @Autowired
+    private IPoNewsFileService poNewsFileService;
+
+    /**
+     * 查询信息文件列表
+     */
+    @ApiOperation("查询信息文件列表")
+    @PreAuthorize("@ss.hasPermi('system:file:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(PoNewsFile poNewsFile)
+    {
+        startPage();
+        List<PoNewsFile> list = poNewsFileService.selectPoNewsFileList(poNewsFile);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出信息文件列表
+     */
+    @ApiOperation("导出信息文件列表")
+    @PreAuthorize("@ss.hasPermi('system:file:export')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, PoNewsFile poNewsFile)
+    {
+        List<PoNewsFile> list = poNewsFileService.selectPoNewsFileList(poNewsFile);
+        ExcelUtil<PoNewsFile> util = new ExcelUtil<PoNewsFile>(PoNewsFile.class);
+        util.exportExcel(response, list, "信息文件数据");
+    }
+
+    /**
+     * 获取信息文件详细信息
+     */
+    @ApiOperation("获取信息文件详细信息")
+    @PreAuthorize("@ss.hasPermi('system:file:query')")
+    @GetMapping(value = "/{fileId}")
+    public AjaxResult getInfo(@PathVariable("fileId") Long fileId)
+    {
+        return success(poNewsFileService.selectPoNewsFileByFileId(fileId));
+    }
+
+    /**
+     * 新增信息文件
+     */
+    @ApiOperation("新增信息文件")
+    @PreAuthorize("@ss.hasPermi('system:file:add')")
+    @Log(title = "信息文件", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody PoNewsFile poNewsFile)
+    {
+        return toAjax(poNewsFileService.insertPoNewsFile(poNewsFile));
+    }
+
+    /**
+     * 修改信息文件
+     */
+    @ApiOperation("修改信息文件")
+    @PreAuthorize("@ss.hasPermi('system:file:edit')")
+    @Log(title = "信息文件", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody PoNewsFile poNewsFile)
+    {
+        return toAjax(poNewsFileService.updatePoNewsFile(poNewsFile));
+    }
+
+    /**
+     * 删除信息文件
+     */
+    @ApiOperation("删除信息文件")
+    @PreAuthorize("@ss.hasPermi('system:file:remove')")
+    @Log(title = "信息文件", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{fileIds}")
+    public AjaxResult remove(@PathVariable Long[] fileIds)
+    {
+        return toAjax(poNewsFileService.deletePoNewsFileByFileIds(fileIds));
+    }
+}

+ 104 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/PoNoticeController.java

@@ -0,0 +1,104 @@
+package com.ruoyi.web.controller.system;
+
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.domain.PoNotice;
+import com.ruoyi.system.service.IPoNoticeService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 公告 信息操作处理
+ *
+ * @author ruoyi
+ */
+@RestController
+@RequestMapping("/system/poNotice")
+public class PoNoticeController extends BaseController {
+    @Autowired
+    private IPoNoticeService poNoticeService;
+
+    /**
+     * 获取通知公告列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:notice:list')")
+    @GetMapping("/list")
+    @ApiOperation("获取通知公告")
+    public TableDataInfo list(PoNotice poNotice) {
+        startPage();
+        List<PoNotice> list = poNoticeService.selectPoNoticeList(poNotice);
+        return getDataTable(list);
+    }
+
+    /**
+     * 获取通知公告列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:notice:list')")
+    @GetMapping("/export")
+    @ApiOperation("导出通知公告")
+    public AjaxResult export(PoNotice poNotice) {
+        List<PoNotice> list = poNoticeService.selectPoNoticeList(poNotice);
+        ExcelUtil<PoNotice> util = new ExcelUtil<>(PoNotice.class);
+        return util.exportExcel(list, "通知公告列表");
+    }
+
+    /**
+     * 根据通知公告编号获取详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:notice:query')")
+    @GetMapping(value = "/{poNoticeId}")
+    @ApiOperation("获取通知公告内容")
+    public AjaxResult getInfo(@PathVariable("poNoticeId") Long poNoticeId) {
+        return success(poNoticeService.selectPoNoticeById(poNoticeId));
+    }
+
+    /**
+     * 新增通知公告
+     */
+    @PreAuthorize("@ss.hasPermi('system:notice:add')")
+    @Log(title = "通知公告", businessType = BusinessType.INSERT)
+    @ApiOperation("添加通知公告")
+    @PostMapping
+    public AjaxResult add(@Validated @RequestBody PoNotice poNotice) {
+        List<PoNotice> poNoticeList = poNoticeService.selectPoNoticeList(poNotice);
+        if (poNoticeList == null || poNoticeList.isEmpty())
+            return toAjax(poNoticeService.insertPoNotice(poNotice));
+        return error("重复的公告");
+    }
+
+    /**
+     * 修改通知公告
+     */
+    @PreAuthorize("@ss.hasPermi('system:notice:edit')")
+    @Log(title = "通知公告", businessType = BusinessType.UPDATE)
+    @ApiOperation("编辑通知公告")
+    @PutMapping
+    public AjaxResult edit(@Validated @RequestBody PoNotice poNotice) {
+        List<PoNotice> poNotice1 = poNoticeService.selectPoNoticeList(poNotice);
+        if (poNotice1 == null || poNotice1.isEmpty())
+            return error("要修改的公告不存在");
+        poNotice.setUpdateBy(getUsername());
+        poNotice.setPublisherId(getUserId());
+        return toAjax(poNoticeService.updatePoNotice(poNotice));
+    }
+
+    /**
+     * 删除通知公告
+     */
+    @PreAuthorize("@ss.hasPermi('system:notice:remove')")
+    @Log(title = "通知公告", businessType = BusinessType.DELETE)
+    @ApiOperation("删除通知公告")
+    @DeleteMapping("/{poNoticeIds}")
+    public AjaxResult remove(@PathVariable Long[] poNoticeIds) {
+        return toAjax(poNoticeService.deletePoNoticeByIds(poNoticeIds));
+    }
+}

+ 104 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/PoOperLogController.java

@@ -0,0 +1,104 @@
+package com.ruoyi.web.controller.system;
+
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.domain.PoOperLog;
+import com.ruoyi.system.service.IPoOperLogService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 操作日志记录Controller
+ * @date 2023-01-15
+ */
+@RestController
+@RequestMapping("/post/operlog")
+public class PoOperLogController extends BaseController
+{
+    @Autowired
+    private IPoOperLogService poOperLogService;
+
+    /**
+     * 查询操作日志记录列表
+     */
+    @ApiOperation("查询操作日志记录列表")
+    @PreAuthorize("@ss.hasPermi('post:operlog:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(PoOperLog poOperLog)
+    {
+        startPage();
+        List<PoOperLog> list = poOperLogService.selectPoOperLogList(poOperLog);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出操作日志记录列表
+     */
+    @ApiOperation("导出日志列表")
+    @PreAuthorize("@ss.hasPermi('post:operlog:export')")
+    @Log(title = "操作日志记录", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, PoOperLog poOperLog)
+    {
+        List<PoOperLog> list = poOperLogService.selectPoOperLogList(poOperLog);
+        ExcelUtil<PoOperLog> util = new ExcelUtil<PoOperLog>(PoOperLog.class);
+        util.exportExcel(response, list, "操作日志记录数据");
+    }
+
+    /**
+     * 获取操作日志记录详细信息
+     */
+    @ApiOperation("获取操作日志详细信息")
+    @PreAuthorize("@ss.hasPermi('post:operlog:query')")
+    @GetMapping(value = "/{operId}")
+    public AjaxResult getInfo(@PathVariable("operId") Long operId)
+    {
+        return success(poOperLogService.selectPoOperLogByOperId(operId));
+    }
+
+    /**
+     * 新增操作日志记录
+     */
+    @ApiOperation("新增操作日志")
+    @PreAuthorize("@ss.hasPermi('post:operlog:add')")
+    @Log(title = "操作日志记录", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    public AjaxResult add(@RequestBody PoOperLog poOperLog)
+    {
+        return toAjax(poOperLogService.insertPoOperLog(poOperLog));
+    }
+
+    /**
+     * 修改操作日志记录
+     */
+    @ApiOperation("修改操作日志")
+    @PreAuthorize("@ss.hasPermi('post:operlog:edit')")
+    @Log(title = "操作日志记录", businessType = BusinessType.UPDATE)
+    @PutMapping("/edit")
+    public AjaxResult edit(@RequestBody PoOperLog poOperLog)
+    {
+        return toAjax(poOperLogService.updatePoOperLog(poOperLog));
+    }
+
+    /**
+     * 删除操作日志记录
+     */
+    @ApiOperation("删除操作日志")
+    @PreAuthorize("@ss.hasPermi('post:operlog:remove')")
+    @Log(title = "操作日志记录", businessType = BusinessType.DELETE)
+    @DeleteMapping("/remove/{operIds}")
+    public AjaxResult remove(@PathVariable Long[] operIds)
+    {
+        return toAjax(poOperLogService.deletePoOperLogByOperIds(operIds));
+    }
+}
+

+ 185 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/PoUserController.java

@@ -0,0 +1,185 @@
+package com.ruoyi.web.controller.system;
+
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.constant.UserConstants;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysRole;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.domain.PoUser;
+import com.ruoyi.system.service.IPoUserService;
+import io.swagger.annotations.ApiOperation;
+import org.apache.catalina.User;
+import org.apache.commons.lang3.ArrayUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 被分配用户Controller
+ *
+ * @author ruoyi
+ * @date 2023-01-17
+ */
+@RestController
+@RequestMapping("/system/users")
+public class PoUserController extends BaseController
+{
+    @Autowired
+    private IPoUserService poUserService;
+
+    /**
+     * 查询用户列表
+     */
+    @ApiOperation("查询用户列表")
+    @PreAuthorize("@ss.hasPermi('system:users:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(PoUser poUser)
+    {
+        startPage();
+        List<PoUser> list = poUserService.selectPoUserList(poUser);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出用户列表
+     */
+    @ApiOperation("导出用户列表")
+    @PreAuthorize("@ss.hasPermi('system:users:export')")
+    @Log(title = "被分配权限的用户", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, PoUser poUser)
+    {
+        List<PoUser> list = poUserService.selectPoUserList(poUser);
+        ExcelUtil<PoUser> util = new ExcelUtil<PoUser>(PoUser.class);
+        util.exportExcel(response, list, "用户数据");
+    }
+
+    /**
+     * 根据用户编号获取详细信息
+     */
+    @ApiOperation("根据用户编号获取详细信息")
+    @PreAuthorize("@ss.hasPermi('system:users:query')")
+    @GetMapping(value = { "/", "/{userId}" })
+    public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
+    {
+        poUserService.checkUserDataScope(userId);
+        AjaxResult ajax = AjaxResult.success();
+        if (StringUtils.isNotNull(userId))
+        {
+            PoUser poUser = poUserService.selectPoUserByUserId(userId);
+            ajax.put(AjaxResult.DATA_TAG, poUser);
+        }
+        return ajax;
+    }
+
+    /**
+     * 新增分配权限用户
+     */
+    @ApiOperation("新增用户")
+    @PreAuthorize("@ss.hasPermi('system:users:add')")
+    @Log(title = "获得权限用户", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    public AjaxResult add(@Validated  @RequestBody PoUser poUser)
+    {
+        if(UserConstants.NOT_UNIQUE.equals(poUserService.checkUserNameUnique(poUser))){
+            return error("新增用户"+poUser.getUserName()+"失败,用户账号已经存在");
+        } else if (StringUtils.isNotEmpty(poUser.getPhonenumber())&& UserConstants.NOT_UNIQUE.equals(poUserService.checkPhoneUnique(poUser))) {
+            return error("新增用户"+poUser.getPhonenumber()+"失败,用户手机号已经存在");
+        }else if(StringUtils.isNotEmpty(poUser.getEmail()) && UserConstants.NOT_UNIQUE.equals(poUserService.checkEmailUnique(poUser))){
+            return error("新增用户"+poUser.getEmail()+"失败,用户邮箱账号已经存在");
+        }
+        poUser.setCreateBy(getUsername());
+        poUser.setPassword(SecurityUtils.encryptPassword(poUser.getPassword()));
+        return toAjax(poUserService.insertPoUser(poUser));
+    }
+
+    /**
+     * 修改用户
+     */
+    @ApiOperation("修改用户")
+    @PreAuthorize("@ss.hasPermi('system:users:edit')")
+    @Log(title = "修改权限用户", businessType = BusinessType.UPDATE)
+    @PutMapping("/edit")
+    public AjaxResult edit( @Validated @RequestBody PoUser poUser)
+    {
+
+        poUserService.checkUserAllowed(poUser);
+
+        poUserService.checkUserDataScope(poUser.getUserId());
+        if (UserConstants.NOT_UNIQUE.equals(poUserService.checkUserNameUnique(poUser)))
+        {
+            return error("修改用户'" + poUser.getUserName() + "'失败,登录账号已存在");
+        }
+        else if (StringUtils.isNotEmpty(poUser.getPhonenumber())
+                && UserConstants.NOT_UNIQUE.equals(poUserService.checkPhoneUnique(poUser)))
+        {
+            return error("修改用户'" + poUser.getUserName() + "'失败,手机号码已存在");
+        }
+        else if (StringUtils.isNotEmpty(poUser.getEmail())
+                && UserConstants.NOT_UNIQUE.equals(poUserService.checkEmailUnique(poUser)))
+        {
+            return error("修改用户'" + poUser.getUserName() + "'失败,邮箱账号已存在");
+        }
+        return toAjax(poUserService.updatePoUser(poUser));
+    }
+
+    /**
+     * 删除用户
+     */
+    @ApiOperation("删除用户")
+    @PreAuthorize("@ss.hasPermi('system:users:remove')")
+    @Log(title = "删除权限用户", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{userIds}")
+    public AjaxResult remove(@PathVariable Long[] userIds)
+    {
+        if (ArrayUtils.contains(userIds, getUserId()))
+        {
+            return error("当前用户不能删除");
+        }
+
+        return toAjax(poUserService.deletePoUserByUserIds(userIds));
+    }
+    /**
+     * 重置密码
+     */
+    @ApiOperation("重置密码")
+    @PreAuthorize("@ss.hasPermi('system:users:resetPwd')")
+    @Log(title = "用户管理", businessType = BusinessType.UPDATE)
+    @PutMapping("/resetPwd")
+    public AjaxResult resetPwd(@RequestBody PoUser poUser)
+    {
+        //检验是否有操作权限
+        poUserService.checkUserAllowed(poUser);
+        //检验是否有访问数据权限
+        poUserService.checkUserDataScope(poUser.getUserId());
+        poUser.setPassword(SecurityUtils.encryptPassword(poUser.getPassword()));
+        poUser.setUpdateBy(getUsername());
+        return toAjax(poUserService.resetPwd(poUser));
+    }
+    /**
+     * 状态修改
+     */
+    @ApiOperation("状态修改")
+    @PreAuthorize("@ss.hasPermi('system:users:edit')")
+    @Log(title = "用户管理", businessType = BusinessType.UPDATE)
+    @PutMapping("/changeStatus")
+    public AjaxResult changeStatus(@RequestBody PoUser poUser)
+    {
+        poUserService.checkUserAllowed(poUser);
+        poUserService.checkUserDataScope(poUser.getUserId());
+        poUser.setUpdateBy(getUsername());
+        return toAjax(poUserService.updateUserStatus(poUser));
+    }
+}
+

+ 51 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/UploadAndDownloadController.java

@@ -0,0 +1,51 @@
+package com.ruoyi.web.controller.system;
+
+import com.ruoyi.common.config.RuoYiConfig;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.utils.file.FileUploadUtils;
+import com.ruoyi.framework.config.ServerConfig;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestPart;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+@RestController
+@RequestMapping("/file")
+public class UploadAndDownloadController {
+    @Autowired
+    private ServerConfig serverConfig;
+
+    /**
+     * 上传文件
+     */
+    /**
+     * 文件上传接口
+     */
+    @ApiOperation(value = "上传文件", notes = "上传文件接口")
+    @RequestMapping(value = "/upload", method = RequestMethod.POST, headers = "content-type=multipart/form-data")
+    public AjaxResult uploadFile(@RequestPart("file") MultipartFile file) throws Exception
+    {
+        try {
+            // 上传文件路径
+            String filePath = RuoYiConfig.getUploadPath();
+            if (filePath == null){
+                throw new RuntimeException("文件路径不存在");
+            }
+            //上传并返回文件名
+            String filename = FileUploadUtils.upload(filePath, file);
+            if (filename == null){
+                throw new RuntimeException("文件名称不存在");
+            }
+            String url = serverConfig.getUrl()+filename;
+            AjaxResult ajax = AjaxResult.success();
+            ajax.put("fileName",filename);
+            ajax.put("url",url);
+            return ajax;
+        }catch (Exception e){
+            return AjaxResult.error(e.getMessage());
+        }
+    }
+}

+ 3 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java

@@ -58,8 +58,9 @@ public class SwaggerConfig
                 // 扫描所有有注解的api,用这种方式更灵活
                 .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
                 // 扫描指定包中的swagger注解
-                // .apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.tool.swagger"))
-                // 扫描所有 .apis(RequestHandlerSelectors.any())
+                .apis(RequestHandlerSelectors.basePackage("com.ruoyi.web.controller"))
+                // 扫描所有
+                .apis(RequestHandlerSelectors.any())
                 .paths(PathSelectors.any())
                 .build()
                 /* 设置安全模式,swagger可以设置访问token */

+ 27 - 5
ruoyi-admin/src/main/resources/application-druid.yml

@@ -6,9 +6,9 @@ spring:
         druid:
             # 主库数据源
             master:
-                url: jdbc:mysql://mysql8-compose:3306/post?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-                username: post
-                password: post
+                url: jdbc:mysql://localhost:3306/ruoyi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                username: root
+                password: zhangyang0311
             # 从库数据源
             slave:
                 # 从数据源开关/默认关闭
@@ -43,7 +43,7 @@ spring:
                 allow:
                 url-pattern: /druid/*
                 # 控制台管理用户名和密码
-                login-username: ruoyi
+                login-username: admin
                 login-password: 123456
             filter:
                 stat:
@@ -54,4 +54,26 @@ spring:
                     merge-sql: true
                 wall:
                     config:
-                        multi-statement-allow: true
+                        multi-statement-allow: true   
+    # redis 配置
+    redis:
+        # 地址
+        host: localhost
+        # 端口,默认为6379
+        port: 6379
+        # 数据库索引
+        database: 0
+        # 密码
+        password: 
+        # 连接超时时间
+        timeout: 10s
+        lettuce:
+          pool:
+            # 连接池中的最小空闲连接
+            min-idle: 0
+            # 连接池中的最大空闲连接
+            max-idle: 8
+            # 连接池的最大数据库连接数
+            max-active: 8
+            # #连接池最大阻塞等待时间(使用负值表示没有限制)
+            max-wait: -1ms

+ 79 - 0
ruoyi-admin/src/main/resources/application-prod.yml

@@ -0,0 +1,79 @@
+# 数据源配置
+spring:
+    datasource:
+        type: com.alibaba.druid.pool.DruidDataSource
+        driverClassName: com.mysql.cj.jdbc.Driver
+        druid:
+            # 主库数据源
+            master:
+                url: jdbc:mysql://mysql8-compose:3306/blue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                username: post
+                password: post
+            # 从库数据源
+            slave:
+                # 从数据源开关/默认关闭
+                enabled: false
+                url: 
+                username: 
+                password: 
+            # 初始连接数
+            initialSize: 5
+            # 最小连接池数量
+            minIdle: 10
+            # 最大连接池数量
+            maxActive: 20
+            # 配置获取连接等待超时的时间
+            maxWait: 60000
+            # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+            timeBetweenEvictionRunsMillis: 60000
+            # 配置一个连接在池中最小生存的时间,单位是毫秒
+            minEvictableIdleTimeMillis: 300000
+            # 配置一个连接在池中最大生存的时间,单位是毫秒
+            maxEvictableIdleTimeMillis: 900000
+            # 配置检测连接是否有效
+            validationQuery: SELECT 1 FROM DUAL
+            testWhileIdle: true
+            testOnBorrow: false
+            testOnReturn: false
+            webStatFilter: 
+                enabled: true
+            statViewServlet:
+                enabled: true
+                # 设置白名单,不填则允许所有访问
+                allow:
+                url-pattern: /druid/*
+                # 控制台管理用户名和密码
+                login-username: admin
+                login-password: 123456
+            filter:
+                stat:
+                    enabled: true
+                    # 慢SQL记录
+                    log-slow-sql: true
+                    slow-sql-millis: 1000
+                    merge-sql: true
+                wall:
+                    config:
+                        multi-statement-allow: true   
+    # redis 配置
+    redis:
+        # 地址
+        host: redis-compose
+        # 端口,默认为6379
+        port: 6379
+        # 数据库索引
+        database: 1
+        # 密码
+        password: 
+        # 连接超时时间
+        timeout: 10s
+        lettuce:
+          pool:
+            # 连接池中的最小空闲连接
+            min-idle: 0
+            # 连接池中的最大空闲连接
+            max-idle: 8
+            # 连接池的最大数据库连接数
+            max-active: 8
+            # #连接池最大阻塞等待时间(使用负值表示没有限制)
+            max-wait: -1ms

+ 2 - 2
ruoyi-admin/src/main/resources/application.yml

@@ -70,9 +70,9 @@ spring:
   # redis 配置
   redis:
     # 地址
-    host: redis-compose
+    host: localhost
     # 端口,默认为6379
-    port: 6379
+    port: 26379
     # 数据库索引
     database: 0
     # 密码

+ 37 - 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/sql/List2VarcharHandler.java

@@ -0,0 +1,37 @@
+package com.ruoyi.common.utils.sql;
+
+import com.ruoyi.common.utils.StringUtils;
+import org.apache.ibatis.type.JdbcType;
+import org.apache.ibatis.type.TypeHandler;
+
+import java.sql.CallableStatement;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.List;
+
+public class List2VarcharHandler implements TypeHandler<List<String>> {
+    @Override
+    public void setParameter(PreparedStatement preparedStatement, int i, List<String> strings, JdbcType jdbcType) throws SQLException {
+        StringBuilder sb = new StringBuilder();
+        for (String userId : strings) {
+            sb.append(userId).append(",");
+        }
+        preparedStatement.setString(i, sb.toString());
+    }
+
+    @Override
+    public List<String> getResult(ResultSet rs, String s) throws SQLException {
+        return StringUtils.str2List(rs.getString(s), ",", true, true);
+    }
+
+    @Override
+    public List<String> getResult(ResultSet rs, int i) throws SQLException {
+        return StringUtils.str2List(rs.getString(i), ",", true, true);
+    }
+
+    @Override
+    public List<String> getResult(CallableStatement cs, int i) throws SQLException {
+        return StringUtils.str2List(cs.getString(i), ",", true, true);
+    }
+}

+ 162 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/PoNews.java

@@ -0,0 +1,162 @@
+package com.ruoyi.system.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.Date;
+
+
+/**
+ * 消息对象 po_news
+ * @date 2023-01-15
+ */
+public class PoNews extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 消息Id */
+    private String newsId;
+
+    /** 消息标题 */
+    @Excel(name = "消息标题")
+    private String newsTitle;
+
+    /** 消息内容 */
+    @Excel(name = "消息内容")
+    private String newsContent;
+
+    /** 状态(0正常 1关闭) */
+    @Excel(name = "状态", readConverterExp = "0=正常,1=关闭")
+    private String status;
+
+    /** 逻辑删除(0未删除 2删除) */
+    @Excel(name = "逻辑删除", readConverterExp = "0=未删除,2=删除")
+    private String delFlag;
+
+    /** 排序 */
+    @Excel(name = "排序")
+    private Long sort;
+
+    /** 发布人员 */
+    @Excel(name = "发布人员")
+    private String publisherId;
+
+    /** 接收人电话 */
+    @Excel(name = "接收人")
+    private String phonenumber;
+
+    @Excel(name = "图片")
+    private String image;
+
+    @Excel(name = "发布信息时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date newsTime;
+
+    public void setPhonenumber(String phonenumber) {
+        this.phonenumber = phonenumber;
+    }
+
+    public String getPhonenumber() {
+        return phonenumber;
+    }
+
+    public void setNewsTime(Date newsTime){
+        this.newsTime = newsTime;
+    }
+    public Date getNewsTime(){
+        return newsTime;
+    }
+
+    public void setImage(String image){
+        this.image = image;
+    }
+
+    public String getImage() {
+        return image;
+    }
+
+    public void setNewsId(String newsId)
+    {
+        this.newsId = newsId;
+    }
+
+    public String getNewsId()
+    {
+        return newsId;
+    }
+    public void setNewsTitle(String newsTitle)
+    {
+        this.newsTitle = newsTitle;
+    }
+
+    public String getNewsTitle()
+    {
+        return newsTitle;
+    }
+    public void setNewsContent(String newsContent)
+    {
+        this.newsContent = newsContent;
+    }
+
+    public String getNewsContent()
+    {
+        return newsContent;
+    }
+    public void setStatus(String status)
+    {
+        this.status = status;
+    }
+
+    public String getStatus()
+    {
+        return status;
+    }
+    public void setDelFlag(String delFlag){
+        this.delFlag = delFlag;
+    }
+    public String getDelFlag(){
+        return delFlag;
+    }
+    public void setSort(Long sort)
+    {
+        this.sort = sort;
+    }
+
+    public Long getSort()
+    {
+        return sort;
+    }
+    public void setPublisherId(String publisherId)
+    {
+        this.publisherId = publisherId;
+    }
+
+    public String getPublisherId()
+    {
+        return publisherId;
+    }
+
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+                .append("newsId", getNewsId())
+                .append("newsTitle", getNewsTitle())
+                .append("newsContent", getNewsContent())
+                .append("status", getStatus())
+                .append("createBy", getCreateBy())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateTime", getUpdateTime())
+                .append("remark", getRemark())
+                .append("sort", getSort())
+                .append("publisherId", getPublisherId())
+                .append("delFlag",getDelFlag())
+                .append("image",getImage())
+                .append("newsTime",getNewsTime())
+                .toString();
+    }
+}

+ 79 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/PoNewsFile.java

@@ -0,0 +1,79 @@
+package com.ruoyi.system.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 信息文件对象 po_news_file
+ *
+ * @author ruoyi
+ * @date 2023-01-25
+ */
+public class PoNewsFile extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 文件Id */
+    private Long fileId;
+
+    /** 文件名 */
+    @Excel(name = "文件名")
+    private String fileName;
+
+    /** 文件图片 */
+    @Excel(name = "文件图片")
+    private String image;
+
+    /** 文件路径 */
+    @Excel(name = "文件路径")
+    private String filePath;
+
+    public void setFileId(Long fileId)
+    {
+        this.fileId = fileId;
+    }
+
+    public Long getFileId()
+    {
+        return fileId;
+    }
+    public void setFileName(String fileName)
+    {
+        this.fileName = fileName;
+    }
+
+    public String getFileName()
+    {
+        return fileName;
+    }
+    public void setImage(String image)
+    {
+        this.image = image;
+    }
+
+    public String getImage()
+    {
+        return image;
+    }
+    public void setFilePath(String filePath)
+    {
+        this.filePath = filePath;
+    }
+
+    public String getFilePath()
+    {
+        return filePath;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+                .append("fileId", getFileId())
+                .append("fileName", getFileName())
+                .append("image", getImage())
+                .append("filePath", getFilePath())
+                .toString();
+    }
+}

+ 157 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/PoNotice.java

@@ -0,0 +1,157 @@
+package com.ruoyi.system.domain;
+
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import java.util.List;
+
+/**
+ * 通知公告表 po_notice
+ *
+ * @author blue
+ */
+
+public class PoNotice extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+    /**
+     * 通知公告ID
+     */
+    @Excel(name = "通知公告ID", cellType = Excel.ColumnType.NUMERIC)
+    private Long noticeId;
+
+    /**
+     * 通知公告标题
+     */
+    @Excel(name = "通知公告标题")
+    private String noticeTitle;
+
+    /**
+     * 通知公告内容
+     */
+    @Excel(name = "通知公告内容")
+    private String noticeContent;
+
+    /**
+     * 通知公告类型 1通知 2公告
+     */
+    @Excel(name = "通知公告类型", readConverterExp = "1通知,2公告")
+    private Integer noticeType;
+
+    /**
+     * 通知公告状态 0正常 1关闭
+     */
+    @Excel(name = "通知公告状态", readConverterExp = "0=正常,1=关闭")
+    private Integer status;
+
+    /**
+     * 通知公告发布人ID
+     */
+    @Excel(name = "通知公告发布人ID", cellType = Excel.ColumnType.NUMERIC)
+    private Long publisherId;
+
+    /**
+     * 通知公告接收人ID
+     */
+    @Excel(name = "通知公告接收人ID")
+    private List<String> userId;
+
+    /**
+     * 通知公告已读人ID
+     */
+    @Excel(name = "通知公告接收人ID")
+    private List<String> readUserId;
+
+    /**
+     * 通知公告逻辑删除状态 0未删除 1删除
+     */
+    @Excel(name = "逻辑删除状态", readConverterExp = "0未删除,1删除")
+    private Boolean delFlag;
+
+    public Long getNoticeId() {
+        return noticeId;
+    }
+
+    public void setNoticeId(Long noticeId) {
+        this.noticeId = noticeId;
+    }
+
+    public String getNoticeTitle() {
+        return noticeTitle;
+    }
+
+    public void setNoticeTitle(String noticeTitle) {
+        this.noticeTitle = noticeTitle;
+    }
+
+    public String getNoticeContent() {
+        return noticeContent;
+    }
+
+    public void setNoticeContent(String noticeContent) {
+        this.noticeContent = noticeContent;
+    }
+
+    public Integer getNoticeType() {
+        return noticeType;
+    }
+
+    public void setNoticeType(Integer noticeType) {
+        this.noticeType = noticeType;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Long getPublisherId() {
+        return publisherId;
+    }
+
+    public void setPublisherId(Long publisherId) {
+        this.publisherId = publisherId;
+    }
+
+    public List<String> getUserId() {
+        return userId;
+    }
+
+    public void setUserId(List<String> userId) {
+        this.userId = userId;
+    }
+
+    public List<String> getReadUserId() {
+        return readUserId;
+    }
+
+    public void setReadUserId(List<String> readUserId) {
+        this.readUserId = readUserId;
+    }
+
+    public Boolean getDelFlag() {
+        return delFlag;
+    }
+
+    public void setDelFlag(Boolean delFlag) {
+        this.delFlag = delFlag;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this)
+                .append("noticeId", noticeId)
+                .append("noticeTitle", noticeTitle)
+                .append("noticeContent", noticeContent)
+                .append("noticeType", noticeType)
+                .append("status", status)
+                .append("publisherId", publisherId)
+                .append("userId", userId)
+                .append("readUserId", readUserId)
+                .append("delFlag", delFlag)
+                .toString();
+    }
+}

+ 263 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/PoOperLog.java

@@ -0,0 +1,263 @@
+package com.ruoyi.system.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.Date;
+
+/**
+ * 操作日志记录对象 po_oper_log
+ * @date 2023-01-15
+ */
+public class PoOperLog extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 日志主键 */
+    private Long operId;
+
+    /** 模块标题 */
+    @Excel(name = "模块标题")
+    private String title;
+
+    /** 业务类型(0其它 1新增 2修改 3删除) */
+    @Excel(name = "业务类型", readConverterExp = "0=其它,1=新增,2=修改,3=删除")
+    private Long businessType;
+
+    /** 方法名称 */
+    @Excel(name = "方法名称")
+    private String method;
+
+    /** 请求方式 */
+    @Excel(name = "请求方式")
+    private String requestMethod;
+
+    /** 操作类别(0其它 1后台用户 2手机端用户) */
+    @Excel(name = "操作类别", readConverterExp = "0=其它,1=后台用户,2=手机端用户")
+    private Long operatorType;
+
+    /** 操作人员 */
+    @Excel(name = "操作人员")
+    private String operName;
+
+    /** 部门名称 */
+    @Excel(name = "部门名称")
+    private String deptName;
+
+    /** 请求URL */
+    @Excel(name = "请求URL")
+    private String operUrl;
+
+    /** 主机地址 */
+    @Excel(name = "主机地址")
+    private String operIp;
+
+    /** 操作地点 */
+    @Excel(name = "操作地点")
+    private String operLocation;
+
+    /** 请求参数 */
+    @Excel(name = "请求参数")
+    private String operParam;
+
+    /** 返回参数 */
+    @Excel(name = "返回参数")
+    private String jsonResult;
+
+    /** 操作状态(0正常 1异常) */
+    @Excel(name = "操作状态", readConverterExp = "0=正常,1=异常")
+    private Long status;
+
+    /** 错误消息 */
+    @Excel(name = "错误消息")
+    private String errorMsg;
+
+    /** 操作时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date operTime;
+
+    /** 排序 */
+    @Excel(name = "排序")
+    private Long sort;
+
+    public void setOperId(Long operId)
+    {
+        this.operId = operId;
+    }
+
+    public Long getOperId()
+    {
+        return operId;
+    }
+    public void setTitle(String title)
+    {
+        this.title = title;
+    }
+
+    public String getTitle()
+    {
+        return title;
+    }
+    public void setBusinessType(Long businessType)
+    {
+        this.businessType = businessType;
+    }
+
+    public Long getBusinessType()
+    {
+        return businessType;
+    }
+    public void setMethod(String method)
+    {
+        this.method = method;
+    }
+
+    public String getMethod()
+    {
+        return method;
+    }
+    public void setRequestMethod(String requestMethod)
+    {
+        this.requestMethod = requestMethod;
+    }
+
+    public String getRequestMethod()
+    {
+        return requestMethod;
+    }
+    public void setOperatorType(Long operatorType)
+    {
+        this.operatorType = operatorType;
+    }
+
+    public Long getOperatorType()
+    {
+        return operatorType;
+    }
+    public void setOperName(String operName)
+    {
+        this.operName = operName;
+    }
+
+    public String getOperName()
+    {
+        return operName;
+    }
+    public void setDeptName(String deptName)
+    {
+        this.deptName = deptName;
+    }
+
+    public String getDeptName()
+    {
+        return deptName;
+    }
+    public void setOperUrl(String operUrl)
+    {
+        this.operUrl = operUrl;
+    }
+
+    public String getOperUrl()
+    {
+        return operUrl;
+    }
+    public void setOperIp(String operIp)
+    {
+        this.operIp = operIp;
+    }
+
+    public String getOperIp()
+    {
+        return operIp;
+    }
+    public void setOperLocation(String operLocation)
+    {
+        this.operLocation = operLocation;
+    }
+
+    public String getOperLocation()
+    {
+        return operLocation;
+    }
+    public void setOperParam(String operParam)
+    {
+        this.operParam = operParam;
+    }
+
+    public String getOperParam()
+    {
+        return operParam;
+    }
+    public void setJsonResult(String jsonResult)
+    {
+        this.jsonResult = jsonResult;
+    }
+
+    public String getJsonResult()
+    {
+        return jsonResult;
+    }
+    public void setStatus(Long status)
+    {
+        this.status = status;
+    }
+
+    public Long getStatus()
+    {
+        return status;
+    }
+    public void setErrorMsg(String errorMsg)
+    {
+        this.errorMsg = errorMsg;
+    }
+
+    public String getErrorMsg()
+    {
+        return errorMsg;
+    }
+    public void setOperTime(Date operTime)
+    {
+        this.operTime = operTime;
+    }
+
+    public Date getOperTime()
+    {
+        return operTime;
+    }
+    public void setSort(Long sort)
+    {
+        this.sort = sort;
+    }
+
+    public Long getSort()
+    {
+        return sort;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+                .append("operId", getOperId())
+                .append("title", getTitle())
+                .append("businessType", getBusinessType())
+                .append("method", getMethod())
+                .append("requestMethod", getRequestMethod())
+                .append("operatorType", getOperatorType())
+                .append("operName", getOperName())
+                .append("deptName", getDeptName())
+                .append("operUrl", getOperUrl())
+                .append("operIp", getOperIp())
+                .append("operLocation", getOperLocation())
+                .append("operParam", getOperParam())
+                .append("jsonResult", getJsonResult())
+                .append("status", getStatus())
+                .append("errorMsg", getErrorMsg())
+                .append("operTime", getOperTime())
+                .append("sort", getSort())
+                .toString();
+    }
+}

+ 238 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/PoUser.java

@@ -0,0 +1,238 @@
+package com.ruoyi.system.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.Date;
+
+/**
+ * 被分配用户对象 po_user
+ *
+ * @author ruoyi
+ * @date 2023-01-17
+ */
+public class PoUser extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 用户Id */
+    private Long userId;
+
+    /** 部门id */
+    @Excel(name = "部门id")
+    private Long deptId;
+
+    /** 用户账号 */
+    @Excel(name = "用户账号")
+    private String userName;
+
+    /** 用户昵称 */
+    @Excel(name = "用户昵称")
+    private String nickName;
+
+    /** 用户类型(00系统用户) */
+    @Excel(name = "用户类型", readConverterExp = "0=0系统用户")
+    private String userType;
+
+    /** 用户邮箱 */
+    @Excel(name = "用户邮箱")
+    private String email;
+
+    /** 电话号码 */
+    @Excel(name = "电话号码")
+    private String phonenumber;
+
+    /** 性别(0男 1女 2未知) */
+    @Excel(name = "性别", readConverterExp = "0=男,1=女,2=未知")
+    private String sex;
+
+    /** 头像地址 */
+    @Excel(name = "头像地址")
+    private String avatar;
+
+    /** 用户密码 */
+    @Excel(name = "用户密码")
+    private String password;
+
+    /** 用户状态 */
+    @Excel(name = "用户状态")
+    private String status;
+
+    /** 逻辑删除(0未删除 2删除) */
+    private String delFlag;
+
+    /** 最后登陆ip */
+    @Excel(name = "最后登陆ip")
+    private String loginIp;
+
+    /** 最后登陆时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "最后登陆时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date loginDate;
+
+
+    public boolean isAdmin()
+    {
+        return isAdmin(this.userId);
+    }
+
+    public static boolean isAdmin(Long userId)
+    {
+        return userId != null && 1L == userId;
+    }
+    public void setUserId(Long userId)
+    {
+        this.userId = userId;
+    }
+
+    public Long getUserId()
+    {
+        return userId;
+    }
+    public void setDeptId(Long deptId)
+    {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId()
+    {
+        return deptId;
+    }
+    public void setUserName(String userName)
+    {
+        this.userName = userName;
+    }
+
+    public String getUserName()
+    {
+        return userName;
+    }
+    public void setNickName(String nickName)
+    {
+        this.nickName = nickName;
+    }
+
+    public String getNickName()
+    {
+        return nickName;
+    }
+    public void setUserType(String userType)
+    {
+        this.userType = userType;
+    }
+
+    public String getUserType()
+    {
+        return userType;
+    }
+    public void setEmail(String email)
+    {
+        this.email = email;
+    }
+
+    public String getEmail()
+    {
+        return email;
+    }
+    public void setPhonenumber(String phonenumber)
+    {
+        this.phonenumber = phonenumber;
+    }
+
+    public String getPhonenumber()
+    {
+        return phonenumber;
+    }
+    public void setSex(String sex)
+    {
+        this.sex = sex;
+    }
+
+    public String getSex()
+    {
+        return sex;
+    }
+    public void setAvatar(String avatar)
+    {
+        this.avatar = avatar;
+    }
+
+    public String getAvatar()
+    {
+        return avatar;
+    }
+    public void setPassword(String password)
+    {
+        this.password = password;
+    }
+
+    public String getPassword()
+    {
+        return password;
+    }
+    public void setStatus(String status)
+    {
+        this.status = status;
+    }
+
+    public String getStatus()
+    {
+        return status;
+    }
+    public void setDelFlag(String delFlag)
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag()
+    {
+        return delFlag;
+    }
+    public void setLoginIp(String loginIp)
+    {
+        this.loginIp = loginIp;
+    }
+
+    public String getLoginIp()
+    {
+        return loginIp;
+    }
+    public void setLoginDate(Date loginDate)
+    {
+        this.loginDate = loginDate;
+    }
+
+    public Date getLoginDate()
+    {
+        return loginDate;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+                .append("userId", getUserId())
+                .append("deptId", getDeptId())
+                .append("userName", getUserName())
+                .append("nickName", getNickName())
+                .append("userType", getUserType())
+                .append("email", getEmail())
+                .append("phonenumber", getPhonenumber())
+                .append("sex", getSex())
+                .append("avatar", getAvatar())
+                .append("password", getPassword())
+                .append("status", getStatus())
+                .append("delFlag", getDelFlag())
+                .append("loginIp", getLoginIp())
+                .append("loginDate", getLoginDate())
+                .append("createBy", getCreateBy())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateTime", getUpdateTime())
+                .append("remark", getRemark())
+                .toString();
+    }
+}
+

+ 40 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/PoNewsFileMapper.java

@@ -0,0 +1,40 @@
+package com.ruoyi.system.mapper;
+
+import java.util.List;
+import com.ruoyi.system.domain.PoNewsFile;
+
+/**
+ * 信息文件Mapper接口
+ */
+public interface PoNewsFileMapper
+{
+    /**
+     * 查询信息文件
+     */
+    public PoNewsFile selectPoNewsFileByFileId(Long fileId);
+
+    /**
+     * 查询信息文件列表
+     */
+    public List<PoNewsFile> selectPoNewsFileList(PoNewsFile poNewsFile);
+
+    /**
+     * 新增信息文件
+     */
+    public int insertPoNewsFile(PoNewsFile poNewsFile);
+
+    /**
+     * 修改信息文件
+     */
+    public int updatePoNewsFile(PoNewsFile poNewsFile);
+
+    /**
+     * 删除信息文件
+     */
+    public int deletePoNewsFileByFileId(Long fileId);
+
+    /**
+     * 批量删除信息文件
+     */
+    public int deletePoNewsFileByFileIds(Long[] fileIds);
+}

+ 120 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/PoNewsMapper.java

@@ -0,0 +1,120 @@
+package com.ruoyi.system.mapper;
+
+import com.ruoyi.system.domain.PoNews;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 消息Mapper接口
+ * @date 2023-01-15
+ */
+public interface PoNewsMapper
+{
+    /**
+     * 根据Id查询
+     * @param newsId
+     * @return
+     */
+    public PoNews selectPoNewsByNewsId(String newsId);
+
+    /**
+     * 分页查询
+     * @param poNews
+     * @return
+     */
+    public List<PoNews> selectPoNewsList(PoNews poNews);
+
+    /**
+     * 新增
+     * @param poNews
+     * @return
+     */
+    public int insertPoNews(PoNews poNews);
+
+    /**
+     * 修改
+     * @param poNews
+     * @return
+     */
+    public int updatePoNews(PoNews poNews);
+
+    /**
+     * 删除
+     * @param newsId
+     * @return
+     */
+    public int deletePoNewsByNewsId(String newsId);
+
+    /**
+     * 批量删除
+     * @param newsIds
+     * @return
+     */
+    public int deletePoNewsByNewsIds(String[] newsIds);
+
+    /**
+     * 标题时间都不为空
+     * @param title
+     * @param newsTimeStart
+     * @param newsTimeEnd
+     * @return
+     */
+    List<PoNews> selectPoNewsListByTitleAndNewsTimeStartAndNewsTimeEnd(String title, Date newsTimeStart, Date newsTimeEnd);
+
+    /**
+     * 标题不为空时间为空
+     * @param title
+     * @return
+     */
+    List<PoNews> selectPoNewsListByTitle(String title);
+
+    /**
+     * 标题为空时间不为空
+     * @param newsTimeStart
+     * @param newsTimeEnd
+     * @return
+     */
+    List<PoNews> selectPoNewsByTime(Date newsTimeStart, Date newsTimeEnd);
+
+    /**
+     * 获取详细消息内容
+     * @param newsId
+     * @return
+     */
+    PoNews selectContentByNewsId(String newsId);
+
+    /**
+     * 检验消息标题是否重复
+     * @param newsTitle
+     * @return
+     */
+    PoNews checkPostNewsTitleUnique(String newsTitle);
+
+    /**
+     * 检验消息图片是否重复
+     * @param image
+     * @return
+     */
+    PoNews checkPostNewsImageUnique(String image);
+
+
+
+    /**
+     * 查询用户Id
+     *
+     * @param newsId
+     * @return
+     */
+    List<PoNews> selectUserByNewsId(String newsId);
+
+
+    /**
+     * 校验时间是否相同
+     * @param createTime
+     * @return
+     */
+    PoNews checkPostNewsTimeUnique(Date createTime);
+
+}
+

+ 60 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/PoNoticeMapper.java

@@ -0,0 +1,60 @@
+package com.ruoyi.system.mapper;
+
+import com.ruoyi.system.domain.PoNotice;
+
+import java.util.List;
+
+/**
+ * 通知公告表 数据层
+ *
+ * @author blue
+ */
+public interface PoNoticeMapper {
+    /**
+     * 查询公告信息
+     *
+     * @param newsId 公告ID
+     * @return 公告信息
+     */
+    PoNotice selectPoNoticeById(Long newsId);
+
+    /**
+     * 查询公告列表
+     *
+     * @param news 公告信息
+     * @return 公告集合
+     */
+    List<PoNotice> selectPoNoticeList(PoNotice news);
+
+    /**
+     * 新增公告
+     *
+     * @param news 公告信息
+     * @return 结果
+     */
+    int insertPoNotice(PoNotice news);
+
+    /**
+     * 修改公告
+     *
+     * @param news 公告信息
+     * @return 结果
+     */
+    int updatePoNotice(PoNotice news);
+
+    /**
+     * 批量删除公告
+     *
+     * @param newsId 公告ID
+     * @return 结果
+     */
+    int deletePoNoticeById(Long newsId);
+
+    /**
+     * 批量删除公告信息
+     *
+     * @param newsIds 需要删除的公告ID
+     * @return 结果
+     */
+    int deletePoNoticeByIds(Long[] newsIds);
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/PoOperLogMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.mapper;
+
+import com.ruoyi.system.domain.PoOperLog;
+
+import java.util.List;
+
+/**
+ * 操作日志记录Mapper接口
+ * @date 2023-01-15
+ */
+public interface PoOperLogMapper
+{
+    /**
+     * 查询操作日志记录
+     *
+     * @param operId 操作日志记录主键
+     * @return 操作日志记录
+     */
+    public PoOperLog selectPoOperLogByOperId(Long operId);
+
+    /**
+     * 查询操作日志记录列表
+     *
+     * @param poOperLog 操作日志记录
+     * @return 操作日志记录集合
+     */
+    public List<PoOperLog> selectPoOperLogList(PoOperLog poOperLog);
+
+    /**
+     * 新增操作日志记录
+     *
+     * @param poOperLog 操作日志记录
+     * @return 结果
+     */
+    public int insertPoOperLog(PoOperLog poOperLog);
+
+    /**
+     * 修改操作日志记录
+     *
+     * @param poOperLog 操作日志记录
+     * @return 结果
+     */
+    public int updatePoOperLog(PoOperLog poOperLog);
+
+    /**
+     * 删除操作日志记录
+     *
+     * @param operId 操作日志记录主键
+     * @return 结果
+     */
+    public int deletePoOperLogByOperId(Long operId);
+
+    /**
+     * 批量删除操作日志记录
+     *
+     * @param operIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deletePoOperLogByOperIds(Long[] operIds);
+}
+

+ 92 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/PoUserMapper.java

@@ -0,0 +1,92 @@
+package com.ruoyi.system.mapper;
+
+import com.ruoyi.system.domain.PoUser;
+
+import java.util.List;
+
+/**
+ * 用户Mapper接口
+ *
+ * @author ruoyi
+ * @date 2023-01-17
+ */
+public interface PoUserMapper
+{
+    /**
+     * 查询用户
+     *
+     * @param userId 用户主键
+     * @return 用户
+     */
+    public PoUser selectPoUserByUserId(Long userId);
+
+    /**
+     * 查询用户列表
+     *
+     * @param poUser 用户
+     * @return 用户集合
+     */
+    public List<PoUser> selectPoUserList(PoUser poUser);
+
+    /**
+     * 新增用户
+     *
+     * @param poUser 用户
+     * @return 结果
+     */
+    public int insertPoUser(PoUser poUser);
+
+    /**
+     * 修改用户
+     *
+     * @param poUser 用户
+     * @return 结果
+     */
+    public int updatePoUser(PoUser poUser);
+
+    /**
+     * 删除用户
+     *
+     * @param userId 用户主键
+     * @return 结果
+     */
+    public int deletePoUserByUserId(Long userId);
+
+    /**
+     * 批量删除用户
+     *
+     * @param userIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deletePoUserByUserIds(Long[] userIds);
+
+    /**
+     * 检验用户账号是否存在
+     * @param poUser
+     * @return
+     */
+    String checkUserNameUnique(PoUser poUser);
+
+    /**
+     * 检验用户手机号是否存在
+     * @param poUser
+     * @return
+     */
+    String checkPhoneUnique(PoUser poUser);
+
+    /**
+     * 检验邮箱是否存在
+     * @param poUser
+     * @return
+     */
+    String checkEmailUnique(PoUser poUser);
+
+
+    /**
+     * 通过手机号查询用户是否存在
+     *
+     * @param phonenumber
+     * @return
+     */
+    PoUser selectUserByUserPhoneNumber(String phonenumber);
+}

+ 45 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IPoNewsFileService.java

@@ -0,0 +1,45 @@
+package com.ruoyi.system.service;
+
+import java.util.List;
+import com.ruoyi.system.domain.PoNewsFile;
+
+/**
+ * 信息文件Service接口
+ *
+ * @author ruoyi
+ * @date 2023-01-25
+ */
+public interface IPoNewsFileService
+{
+    /**
+     * 查询信息文件
+     *
+     * @param fileId 主键
+     */
+    public PoNewsFile selectPoNewsFileByFileId(Long fileId);
+
+    /**
+     * 查询信息文件列表
+     */
+    public List<PoNewsFile> selectPoNewsFileList(PoNewsFile poNewsFile);
+
+    /**
+     * 新增信息文件
+     */
+    public int insertPoNewsFile(PoNewsFile poNewsFile);
+
+    /**
+     * 修改信息文件
+     */
+    public int updatePoNewsFile(PoNewsFile poNewsFile);
+
+    /**
+     * 批量删除信息文件
+     */
+    public int deletePoNewsFileByFileIds(Long[] fileIds);
+
+    /**
+     * 删除信息文件信息
+     */
+    public int deletePoNewsFileByFileId(Long fileId);
+}

+ 104 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IPoNewsService.java

@@ -0,0 +1,104 @@
+package com.ruoyi.system.service;
+
+import com.ruoyi.system.domain.PoNews;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 消息接口
+ */
+public interface IPoNewsService
+{
+    /**
+     * 根据Id查询
+     *
+     * @param newsId
+     * @return
+     */
+    public List<PoNews> selectPoNewsByNewsId(String newsId);
+
+    /**
+     * 分页查询
+     * @param poNews
+     * @return
+     */
+    public List<PoNews> selectPoNewsList(PoNews poNews);
+
+    /**
+     * 增加
+     * @param poNews
+     * @return
+     */
+    public int insertPoNews(PoNews poNews);
+
+    /**
+     * 修改
+     * @param poNews
+     * @return
+     */
+    public int updatePoNews(PoNews poNews);
+
+    /**
+     * 批量删除
+     * @param newsIds
+     * @return
+     */
+    public int deletePoNewsByNewsIds(String[] newsIds);
+
+    /**
+     * 删除
+     * @param newsId
+     * @return
+     */
+    public int deletePoNewsByNewsId(String newsId);
+
+    /**
+     * 校验标题是否重复
+     * @param poNews
+     * @return
+     */
+    String checkPostNewsTitleUnique(PoNews poNews);
+
+    /**
+     * 标题时间都不为空
+     * @param title
+     * @param newsTimeStart
+     * @param newsTimeEnd
+     * @return
+     */
+    List<PoNews> selectListByTitleAndTime(String title, Date newsTimeStart, Date newsTimeEnd);
+
+    /**
+     * 获取详细内容
+     * @param newsId
+     * @return
+     */
+    PoNews selectContentByNewsId(String newsId);
+
+    /**
+     * 校验图片是否为空
+     * @param poNews
+     * @return
+     */
+    String checkPostNewsImageUnique(PoNews poNews);
+
+
+    /**
+     * 校验时间是否相等
+     * @param poNews
+     * @return
+     */
+    String checkPostNewsTimeUnique(PoNews poNews);
+
+    /**
+     * 导入手机号
+     * @param phoneList
+     * @param updateSupport
+     * @param userName
+     * @return
+     */
+    String importPhone(List<PoNews> phoneList, boolean updateSupport, String userName);
+
+}
+

+ 60 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IPoNoticeService.java

@@ -0,0 +1,60 @@
+package com.ruoyi.system.service;
+
+import com.ruoyi.system.domain.PoNotice;
+
+import java.util.List;
+
+/**
+ * 公告 服务层
+ *
+ * @author ruoyi
+ */
+public interface IPoNoticeService {
+    /**
+     * 查询公告信息
+     *
+     * @param newsId 公告ID
+     * @return 公告信息
+     */
+    PoNotice selectPoNoticeById(Long newsId);
+
+    /**
+     * 查询公告列表
+     *
+     * @param poNotice 公告信息
+     * @return 公告集合
+     */
+    List<PoNotice> selectPoNoticeList(PoNotice poNotice);
+
+    /**
+     * 新增公告
+     *
+     * @param poNotice 公告信息
+     * @return 结果
+     */
+    int insertPoNotice(PoNotice poNotice);
+
+    /**
+     * 修改公告
+     *
+     * @param poNotice 公告信息
+     * @return 结果
+     */
+    int updatePoNotice(PoNotice poNotice);
+
+    /**
+     * 删除公告信息
+     *
+     * @param poNoticeId 公告ID
+     * @return 结果
+     */
+    int deletePoNoticeById(Long poNoticeId);
+
+    /**
+     * 批量删除公告信息
+     *
+     * @param poNoticeIds 需要删除的公告ID
+     * @return 结果
+     */
+    int deletePoNoticeByIds(Long[] poNoticeIds);
+}

+ 60 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IPoOperLogService.java

@@ -0,0 +1,60 @@
+package com.ruoyi.system.service;
+
+import com.ruoyi.system.domain.PoOperLog;
+
+import java.util.List;
+
+/**
+ * 操作日志记录Service接口
+ * @date 2023-01-15
+ */
+public interface IPoOperLogService
+{
+    /**
+     * 查询操作日志记录
+     *
+     * @param operId 操作日志记录主键
+     * @return 操作日志记录
+     */
+    public PoOperLog selectPoOperLogByOperId(Long operId);
+
+    /**
+     * 查询操作日志记录列表
+     *
+     * @param poOperLog 操作日志记录
+     * @return 操作日志记录集合
+     */
+    public List<PoOperLog> selectPoOperLogList(PoOperLog poOperLog);
+
+    /**
+     * 新增操作日志记录
+     *
+     * @param poOperLog 操作日志记录
+     * @return 结果
+     */
+    public int insertPoOperLog(PoOperLog poOperLog);
+
+    /**
+     * 修改操作日志记录
+     *
+     * @param poOperLog 操作日志记录
+     * @return 结果
+     */
+    public int updatePoOperLog(PoOperLog poOperLog);
+
+    /**
+     * 批量删除操作日志记录
+     *
+     * @param operIds 需要删除的操作日志记录主键集合
+     * @return 结果
+     */
+    public int deletePoOperLogByOperIds(Long[] operIds);
+
+    /**
+     * 删除操作日志记录信息
+     *
+     * @param operId 操作日志记录主键
+     * @return 结果
+     */
+    public int deletePoOperLogByOperId(Long operId);
+}

+ 109 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IPoUserService.java

@@ -0,0 +1,109 @@
+package com.ruoyi.system.service;
+
+import com.ruoyi.system.domain.PoUser;
+
+import java.util.List;
+
+/**
+ * 用户Service接口
+ *
+ * @author ruoyi
+ * @date 2023-01-17
+ */
+public interface IPoUserService
+{
+    /**
+     * 查询用户
+     *
+     * @param userId 用户主键
+     * @return 用户
+     */
+    public PoUser selectPoUserByUserId(Long userId);
+
+    /**
+     * 查询用户列表
+     *
+     * @param poUser 用户
+     * @return 用户集合
+     */
+    public List<PoUser> selectPoUserList(PoUser poUser);
+
+    /**
+     * 新增用户
+     *
+     * @param poUser 用户
+     * @return 结果
+     */
+    public int insertPoUser(PoUser poUser);
+
+    /**
+     * 修改用户
+     *
+     * @param poUser 用户
+     * @return 结果
+     */
+    public int updatePoUser(PoUser poUser);
+
+    /**
+     * 批量删除用户
+     *
+     * @param userIds 需要删除的用户主键集合
+     * @return 结果
+     */
+    public int deletePoUserByUserIds(Long[] userIds);
+
+    /**
+     * 删除用户信息
+     *
+     * @param userId 用户主键
+     * @return 结果
+     */
+    public int deletePoUserByUserId(Long userId);
+
+    /**
+     * 检验用户账号是否存在
+     * @param poUser
+     * @return
+     */
+    String checkUserNameUnique(PoUser poUser);
+
+    /**
+     * 检验用户手机号是否存在
+     * @param poUser
+     * @return
+     */
+    String checkPhoneUnique(PoUser poUser);
+
+    /**
+     * 检验邮箱是否存在
+     * @param poUser
+     * @return
+     */
+    String checkEmailUnique(PoUser poUser);
+
+    /**
+     * 检验当前用户是否可以操作
+     * @param poUser
+     */
+    void checkUserAllowed(PoUser poUser);
+
+    /**
+     * 检验用户是否有访问数据的权限
+     * @param userId
+     */
+    void checkUserDataScope(Long userId);
+
+    /**
+     * 重置密码
+     * @param poUser
+     * @return
+     */
+    int resetPwd(PoUser poUser);
+
+    /**
+     * 状态修改
+     * @param poUser
+     * @return
+     */
+    int updateUserStatus(PoUser poUser);
+}

+ 75 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PoNewsFileServiceImpl.java

@@ -0,0 +1,75 @@
+package com.ruoyi.system.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.PoNewsFileMapper;
+import com.ruoyi.system.domain.PoNewsFile;
+import com.ruoyi.system.service.IPoNewsFileService;
+
+/**
+ * 信息文件Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2023-01-25
+ */
+@Service
+public class PoNewsFileServiceImpl implements IPoNewsFileService
+{
+    @Autowired
+    private PoNewsFileMapper poNewsFileMapper;
+
+    /**
+     * 查询信息文件
+     */
+    @Override
+    public PoNewsFile selectPoNewsFileByFileId(Long fileId)
+    {
+        return poNewsFileMapper.selectPoNewsFileByFileId(fileId);
+    }
+
+    /**
+     * 查询信息文件列表
+     */
+    @Override
+    public List<PoNewsFile> selectPoNewsFileList(PoNewsFile poNewsFile)
+    {
+        return poNewsFileMapper.selectPoNewsFileList(poNewsFile);
+    }
+
+    /**
+     * 新增信息文件
+     */
+    @Override
+    public int insertPoNewsFile(PoNewsFile poNewsFile)
+    {
+        return poNewsFileMapper.insertPoNewsFile(poNewsFile);
+    }
+
+    /**
+     * 修改信息文件
+     */
+    @Override
+    public int updatePoNewsFile(PoNewsFile poNewsFile)
+    {
+        return poNewsFileMapper.updatePoNewsFile(poNewsFile);
+    }
+
+    /**
+     * 批量删除信息文件
+     */
+    @Override
+    public int deletePoNewsFileByFileIds(Long[] fileIds)
+    {
+        return poNewsFileMapper.deletePoNewsFileByFileIds(fileIds);
+    }
+
+    /**
+     * 删除信息文件信息
+     */
+    @Override
+    public int deletePoNewsFileByFileId(Long fileId)
+    {
+        return poNewsFileMapper.deletePoNewsFileByFileId(fileId);
+    }
+}

+ 279 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PoNewsServiceImpl.java

@@ -0,0 +1,279 @@
+package com.ruoyi.system.service.impl;
+
+import com.ruoyi.common.constant.UserConstants;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.exception.ServiceException;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.bean.BeanUtils;
+import com.ruoyi.common.utils.bean.BeanValidators;
+import com.ruoyi.system.domain.PoNews;
+import com.ruoyi.system.domain.PoUser;
+import com.ruoyi.system.mapper.PoNewsMapper;
+import com.ruoyi.system.mapper.PoUserMapper;
+import com.ruoyi.system.service.IPoNewsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.validation.Validator;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 消息Service业务层处理
+ * @date 2023-01-15
+ */
+@Service
+public class PoNewsServiceImpl implements IPoNewsService {
+    @Autowired
+    private PoNewsMapper poNewsMapper;
+    @Autowired
+    private PoUserMapper poUserMapper;
+    @Autowired
+    protected Validator validator;
+
+
+    /**
+     * 根据Id查询
+     *
+     * @param newsId
+     * @return
+     */
+    @Override
+    public List<PoNews> selectPoNewsByNewsId(String newsId) {
+
+        List list = new ArrayList();
+        List<PoNews> poNewsList = new ArrayList<>();
+        poNewsList.add(poNewsMapper.selectPoNewsByNewsId(newsId));
+        List<PoNews> collect = poNewsList.stream().map((item) -> {
+            PoNews poNews = new PoNews();
+            //将所有消息数据拷贝到消息用户链接对象实例
+            BeanUtils.copyProperties(item, poNews);
+            List<PoNews> newsAndUserVos = poNewsMapper.selectUserByNewsId(newsId);
+            list.add(newsAndUserVos);
+            poNews.setPhonenumber(list.toString());
+            return poNews;
+        }).collect(Collectors.toList());
+        return collect;
+    }
+
+    /**
+     * 分页查询
+     *
+     * @param poNews
+     * @return
+     */
+    @Override
+    public List<PoNews> selectPoNewsList(PoNews poNews) {
+        return poNewsMapper.selectPoNewsList(poNews);
+    }
+
+    /**
+     * 新增
+     *
+     * @param poNews
+     * @return
+     */
+    @Override
+    public int insertPoNews(PoNews poNews) {
+        poNews.setCreateTime(DateUtils.getNowDate());
+        return poNewsMapper.insertPoNews(poNews);
+    }
+
+    /**
+     * 修改
+     *
+     * @param poNews
+     * @return
+     */
+    @Override
+    public int updatePoNews(PoNews poNews) {
+        poNews.setUpdateTime(DateUtils.getNowDate());
+        return poNewsMapper.updatePoNews(poNews);
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param newsIds
+     * @return
+     */
+    @Override
+    public int deletePoNewsByNewsIds(String[] newsIds) {
+        return poNewsMapper.deletePoNewsByNewsIds(newsIds);
+    }
+
+    /**
+     * 删除
+     *
+     * @param newsId
+     * @return
+     */
+    @Override
+    public int deletePoNewsByNewsId(String newsId) {
+        return poNewsMapper.deletePoNewsByNewsId(newsId);
+    }
+
+    /**
+     * 校验标题是否重复
+     *
+     * @param poNews
+     * @return
+     */
+    @Override
+    public String checkPostNewsTitleUnique(PoNews poNews) {
+        String poNewsId = StringUtils.isNull(poNews.getNewsId()) ? "消息不存在" : poNews.getNewsId();
+        PoNews info = poNewsMapper.checkPostNewsTitleUnique(poNews.getNewsTitle());
+        if (StringUtils.isNotNull(info) && info.getNewsId() != poNewsId) {
+            return UserConstants.NOT_UNIQUE;
+        }
+        return UserConstants.UNIQUE;
+    }
+
+    /**
+     * 搜索消息
+     *
+     * @param title
+     * @param newsTimeStart
+     * @param newsTimeEnd
+     * @return
+     */
+
+    @Override
+    public List<PoNews> selectListByTitleAndTime(String title, Date newsTimeStart, Date newsTimeEnd) {
+        if (title != null) {
+            //标题不为空且开始时间和结束时间都不为空
+            if (newsTimeStart != null && newsTimeEnd != null) {
+
+                if (DateUtils.getNowDate().before(newsTimeEnd)){
+                    newsTimeEnd = DateUtils.getNowDate();
+                }
+                if (newsTimeStart.before(newsTimeEnd)) {
+                    return poNewsMapper.selectPoNewsListByTitleAndNewsTimeStartAndNewsTimeEnd(title, newsTimeStart, newsTimeEnd);
+                } else if ((newsTimeStart != null && newsTimeEnd == null) || (newsTimeStart == null && newsTimeEnd != null)) {
+                    //有一个时间不为空返回提示信息
+                    List list = new ArrayList();
+                    list.add("请选择正确的时间段");
+                    return list;
+                }
+            } else {//时间都为空
+                return poNewsMapper.selectPoNewsListByTitle(title);
+            }
+        }
+        //标题为空
+        else {
+            //时间不为空
+            if (newsTimeStart != null && newsTimeEnd != null) {
+                return poNewsMapper.selectPoNewsByTime(newsTimeStart, newsTimeEnd);
+            }
+        }
+        //都为空执行分页查询
+        PoNews poNews = new PoNews();
+        return poNewsMapper.selectPoNewsList(poNews);
+    }
+
+    /**
+     * 获取详细消息内容
+     *
+     * @param newsId
+     * @return
+     */
+    @Override
+    public PoNews selectContentByNewsId(String newsId) {
+        return poNewsMapper.selectContentByNewsId(newsId);
+    }
+
+    /**
+     * 校验图片是否重复
+     *
+     * @param poNews
+     * @return
+     */
+    @Override
+    public String checkPostNewsImageUnique(PoNews poNews) {
+
+        String poNewsId = StringUtils.isNull(poNews.getNewsId()) ? "图片不存在" : poNews.getNewsId();
+
+        PoNews info = poNewsMapper.checkPostNewsImageUnique(poNews.getImage());
+        if (StringUtils.isNotNull(info) && info.getNewsId() != poNewsId) {
+            return UserConstants.NOT_UNIQUE;
+        }
+        return UserConstants.UNIQUE;
+    }
+
+    /**
+     * 校验时间是否相等
+     *
+     * @param poNews
+     * @return
+     */
+    @Override
+    public String checkPostNewsTimeUnique(PoNews poNews) {
+        String poNewsId = StringUtils.isNull(poNews.getNewsId()) ? "图片不存在" : poNews.getNewsId();
+        PoNews info = poNewsMapper.checkPostNewsTimeUnique(poNews.getCreateTime());
+        if (StringUtils.isNotNull(info) && info.getNewsId() != poNewsId) {
+            return UserConstants.NOT_UNIQUE;
+        }
+        return UserConstants.UNIQUE;
+    }
+
+
+    /**
+     * 导入用户手机号
+     *
+     * @param phoneList     手机号数据
+     * @param updateSupport 是否支持更新 存在则更新
+     * @param userName      操作用户
+     * @return
+     */
+    @Override
+    public String importPhone(List<PoNews> phoneList, boolean updateSupport, String userName) {
+        if (StringUtils.isNull(phoneList) || phoneList.size() == 0) {
+            throw new ServiceException("导入用户电话数据不能为空!");
+        }
+        int successNum = 0;
+        int failureNum = 0;
+        StringBuilder successMsg = new StringBuilder();
+        StringBuilder failureMsg = new StringBuilder();
+
+        for (PoNews phone : phoneList) {
+            try {
+                // 验证是否存在这个用户
+                PoUser u = poUserMapper.selectUserByUserPhoneNumber(phone.getPhonenumber());
+                if (StringUtils.isNull(u)) {
+                    BeanValidators.validateWithException(validator, phone);
+                    phone.setPhonenumber(phone.getPhonenumber());
+                    phone.setCreateBy(userName);
+                    this.insertPoNews(phone);
+                    successNum++;
+                    successMsg.append("<br/>" + successNum + "、电话号 " + phone.getPhonenumber() + " 导入成功");
+                }
+                else if (updateSupport){
+                    BeanValidators.validateWithException(validator, phone);
+                    phone.setUpdateBy(userName);
+                    this.updatePoNews(phone);
+                    successNum++;
+                    successMsg.append("<br/>" + successNum + "、手机 " + phone.getPhonenumber() + " 更新成功");
+                }
+                else{
+                    failureNum++;
+                    failureMsg.append("<br/>" + failureNum + "、手机 " + phone.getPhonenumber()+ " 已经存在");
+                }
+            } catch (Exception e) {
+                failureNum++;
+                String msg = "<br/>" + failureNum + "、电话号 " + phone.getPhonenumber() + " 导入失败:";
+                failureMsg.append(msg + e.getMessage());
+            }
+        }
+        if (failureNum > 0){
+            failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
+            throw new ServiceException(failureMsg.toString());
+        }else{
+            successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
+        }
+                return successMsg.toString();
+    }
+}
+

+ 86 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PoNoticeServiceImpl.java

@@ -0,0 +1,86 @@
+package com.ruoyi.system.service.impl;
+
+import com.ruoyi.system.domain.PoNotice;
+import com.ruoyi.system.mapper.PoNoticeMapper;
+import com.ruoyi.system.service.IPoNoticeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 公告 服务层实现
+ *
+ * @author blue
+ */
+@Service
+public class PoNoticeServiceImpl implements IPoNoticeService {
+    @Autowired
+    private PoNoticeMapper noticeMapper;
+
+    /**
+     * 查询公告信息
+     *
+     * @param noticeId 公告ID
+     * @return 公告信息
+     */
+    @Override
+    public PoNotice selectPoNoticeById(Long noticeId) {
+        return noticeMapper.selectPoNoticeById(noticeId);
+    }
+
+    /**
+     * 查询公告列表
+     *
+     * @param notice 公告信息
+     * @return 公告集合
+     */
+    @Override
+    public List<PoNotice> selectPoNoticeList(PoNotice notice) {
+        return noticeMapper.selectPoNoticeList(notice);
+    }
+
+    /**
+     * 新增公告
+     *
+     * @param notice 公告信息
+     * @return 结果
+     */
+    @Override
+    public int insertPoNotice(PoNotice notice) {
+        return noticeMapper.insertPoNotice(notice);
+    }
+
+    /**
+     * 修改公告
+     *
+     * @param notice 公告信息
+     * @return 结果
+     */
+    @Override
+    public int updatePoNotice(PoNotice notice) {
+        return noticeMapper.updatePoNotice(notice);
+    }
+
+    /**
+     * 删除公告对象
+     *
+     * @param noticeId 公告ID
+     * @return 结果
+     */
+    @Override
+    public int deletePoNoticeById(Long noticeId) {
+        return noticeMapper.deletePoNoticeById(noticeId);
+    }
+
+    /**
+     * 批量删除公告信息
+     *
+     * @param noticeIds 需要删除的公告ID
+     * @return 结果
+     */
+    @Override
+    public int deletePoNoticeByIds(Long[] noticeIds) {
+        return noticeMapper.deletePoNoticeByIds(noticeIds);
+    }
+}

+ 93 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PoOperLogServiceImpl.java

@@ -0,0 +1,93 @@
+package com.ruoyi.system.service.impl;
+
+import com.ruoyi.system.domain.PoOperLog;
+import com.ruoyi.system.mapper.PoOperLogMapper;
+import com.ruoyi.system.service.IPoOperLogService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 操作日志记录Service业务层处理
+ * @date 2023-01-15
+ */
+@Service
+public class PoOperLogServiceImpl implements IPoOperLogService
+{
+    @Autowired
+    private PoOperLogMapper poOperLogMapper;
+
+    /**
+     * 查询操作日志记录
+     *
+     * @param operId 操作日志记录主键
+     * @return 操作日志记录
+     */
+    @Override
+    public PoOperLog selectPoOperLogByOperId(Long operId)
+    {
+        return poOperLogMapper.selectPoOperLogByOperId(operId);
+    }
+
+    /**
+     * 查询操作日志记录列表
+     *
+     * @param poOperLog 操作日志记录
+     * @return 操作日志记录
+     */
+    @Override
+    public List<PoOperLog> selectPoOperLogList(PoOperLog poOperLog)
+    {
+        return poOperLogMapper.selectPoOperLogList(poOperLog);
+    }
+
+    /**
+     * 新增操作日志记录
+     *
+     * @param poOperLog 操作日志记录
+     * @return 结果
+     */
+    @Override
+    public int insertPoOperLog(PoOperLog poOperLog)
+    {
+        return poOperLogMapper.insertPoOperLog(poOperLog);
+    }
+
+    /**
+     * 修改操作日志记录
+     *
+     * @param poOperLog 操作日志记录
+     * @return 结果
+     */
+    @Override
+    public int updatePoOperLog(PoOperLog poOperLog)
+    {
+        return poOperLogMapper.updatePoOperLog(poOperLog);
+    }
+
+    /**
+     * 批量删除操作日志记录
+     *
+     * @param operIds 需要删除的操作日志记录主键
+     * @return 结果
+     */
+    @Override
+    public int deletePoOperLogByOperIds(Long[] operIds)
+    {
+        return poOperLogMapper.deletePoOperLogByOperIds(operIds);
+    }
+
+    /**
+     * 删除操作日志记录信息
+     *
+     * @param operId 操作日志记录主键
+     * @return 结果
+     */
+    @Override
+    public int deletePoOperLogByOperId(Long operId)
+    {
+        return poOperLogMapper.deletePoOperLogByOperId(operId);
+    }
+}
+

+ 182 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PoUserServiceImpl.java

@@ -0,0 +1,182 @@
+package com.ruoyi.system.service.impl;
+
+import com.ruoyi.common.exception.ServiceException;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.spring.SpringUtils;
+import com.ruoyi.system.domain.PoUser;
+import com.ruoyi.system.mapper.PoUserMapper;
+import com.ruoyi.system.service.IPoUserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 用户Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2023-01-17
+ */
+@Service
+public class PoUserServiceImpl implements IPoUserService {
+    @Autowired
+    private PoUserMapper poUserMapper;
+
+    /**
+     * 查询用户
+     *
+     * @param userId 用户主键
+     * @return 用户
+     */
+    @Override
+    public PoUser selectPoUserByUserId(Long userId) {
+        return poUserMapper.selectPoUserByUserId(userId);
+    }
+
+    /**
+     * 查询用户列表
+     *
+     * @param poUser 用户
+     * @return 用户
+     */
+    @Override
+    public List<PoUser> selectPoUserList(PoUser poUser) {
+        return poUserMapper.selectPoUserList(poUser);
+    }
+
+    /**
+     * 新增用户
+     *
+     * @param poUser 用户
+     * @return 结果
+     */
+    @Override
+    public int insertPoUser(PoUser poUser) {
+        poUser.setCreateTime(DateUtils.getNowDate());
+        return poUserMapper.insertPoUser(poUser);
+    }
+
+    /**
+     * 修改用户
+     *
+     * @param poUser 用户
+     * @return 结果
+     */
+    @Override
+    public int updatePoUser(PoUser poUser) {
+        poUser.setUpdateTime(DateUtils.getNowDate());
+        return poUserMapper.updatePoUser(poUser);
+    }
+
+    /**
+     * 批量删除用户
+     *
+     * @param userIds 需要删除的用户主键
+     * @return 结果
+     */
+    @Override
+    public int deletePoUserByUserIds(Long[] userIds) {
+        return poUserMapper.deletePoUserByUserIds(userIds);
+    }
+
+    /**
+     * 删除用户信息
+     *
+     * @param userId 用户主键
+     * @return 结果
+     */
+    @Override
+    public int deletePoUserByUserId(Long userId) {
+        return poUserMapper.deletePoUserByUserId(userId);
+    }
+
+    /**
+     * 检验用户账号是否存在
+     *
+     * @param poUser
+     * @return
+     */
+    @Override
+    public String checkUserNameUnique(PoUser poUser) {
+
+        return poUserMapper.checkUserNameUnique(poUser);
+    }
+
+    /**
+     * 检验用户手机号是否存在
+     *
+     * @param poUser
+     * @return
+     */
+    @Override
+    public String checkPhoneUnique(PoUser poUser) {
+
+        return poUserMapper.checkPhoneUnique(poUser);
+    }
+
+    /**
+     * 检验邮箱是否存在
+     *
+     * @param poUser
+     * @return
+     */
+    @Override
+    public String checkEmailUnique(PoUser poUser) {
+
+        return poUserMapper.checkEmailUnique(poUser);
+    }
+
+    /**
+     * 检验用户是否有操作权限
+     *
+     * @param poUser
+     */
+    @Override
+    public void checkUserAllowed(PoUser poUser) {
+        if (StringUtils.isNotNull(poUser.getUserId()) && poUser.isAdmin()) {
+            throw new ServiceException("不允许操作超级管理员用户");
+        }
+
+    }
+
+    /**
+     * 检验用户是否有数据权限
+     *
+     * @param userId
+     */
+    @Override
+    public void checkUserDataScope(Long userId) {
+        {
+            if (!PoUser.isAdmin(SecurityUtils.getUserId())) {
+                PoUser poUser = new PoUser();
+                poUser.setUserId(userId);
+                List<PoUser> poUsers = SpringUtils.getAopProxy(this).selectPoUserList(poUser);
+                if (StringUtils.isEmpty(poUsers)) {
+                    throw new ServiceException("没有权限访问用户数据!");
+                }
+            }
+        }
+    }
+
+    /**
+     * 重置密码
+     * @param poUser
+     * @return
+     */
+    @Override
+    public int resetPwd(PoUser poUser) {
+        return poUserMapper.updatePoUser(poUser);
+    }
+
+    /**
+     * 状态修改
+     * @param poUser
+     * @return
+     */
+    @Override
+    public int updateUserStatus(PoUser poUser) {
+        return poUserMapper.updatePoUser(poUser);
+    }
+}

+ 68 - 0
ruoyi-system/src/main/resources/mapper/system/PoNewsFileMapper.xml

@@ -0,0 +1,68 @@
+<?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.ruoyi.system.mapper.PoNewsFileMapper">
+
+    <resultMap type="PoNewsFile" id="PoNewsFileResult">
+        <result property="fileId"    column="file_id"    />
+        <result property="fileName"    column="file_name"    />
+        <result property="image"    column="image"    />
+        <result property="filePath"    column="file_path"    />
+    </resultMap>
+
+    <sql id="selectPoNewsFileVo">
+        select file_id, file_name, image, file_path from po_news_file
+    </sql>
+
+    <select id="selectPoNewsFileList" parameterType="PoNewsFile" resultMap="PoNewsFileResult">
+        <include refid="selectPoNewsFileVo"/>
+        <where>
+            <if test="fileName != null  and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
+            <if test="image != null  and image != ''"> and image = #{image}</if>
+            <if test="filePath != null  and filePath != ''"> and file_path = #{filePath}</if>
+        </where>
+    </select>
+
+    <select id="selectPoNewsFileByFileId" parameterType="Long" resultMap="PoNewsFileResult">
+        <include refid="selectPoNewsFileVo"/>
+        where file_id = #{fileId}
+    </select>
+
+    <insert id="insertPoNewsFile" parameterType="PoNewsFile">
+        insert into po_news_file
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="fileId != null">file_id,</if>
+            <if test="fileName != null and fileName != ''">file_name,</if>
+            <if test="image != null and image != ''">image,</if>
+            <if test="filePath != null">file_path,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="fileId != null">#{fileId},</if>
+            <if test="fileName != null and fileName != ''">#{fileName},</if>
+            <if test="image != null and image != ''">#{image},</if>
+            <if test="filePath != null">#{filePath},</if>
+        </trim>
+    </insert>
+
+    <update id="updatePoNewsFile" parameterType="PoNewsFile">
+        update po_news_file
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="fileName != null and fileName != ''">file_name = #{fileName},</if>
+            <if test="image != null and image != ''">image = #{image},</if>
+            <if test="filePath != null">file_path = #{filePath},</if>
+        </trim>
+        where file_id = #{fileId}
+    </update>
+
+    <delete id="deletePoNewsFileByFileId" parameterType="Long">
+        delete from po_news_file where file_id = #{fileId}
+    </delete>
+
+    <delete id="deletePoNewsFileByFileIds" parameterType="String">
+        delete from po_news_file where file_id in
+        <foreach item="fileId" collection="array" open="(" separator="," close=")">
+            #{fileId}
+        </foreach>
+    </delete>
+</mapper>

+ 179 - 0
ruoyi-system/src/main/resources/mapper/system/PoNewsMapper.xml

@@ -0,0 +1,179 @@
+<?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.ruoyi.system.mapper.PoNewsMapper">
+
+    <resultMap type="PoNews" id="PoNewsResult">
+        <result property="newsId"    column="news_id"    />
+        <result property="newsTitle"    column="news_title"    />
+        <result property="newsContent"    column="news_content"    />
+        <result property="status"    column="status"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+        <result property="sort"    column="sort"    />
+        <result property="publisherId"    column="publisher_id"    />
+        <result property="delFlag" column="del_flag"/>
+        <result property="image"   column="image"/>
+        <result property="newsTime" column="news_time"/>
+        <result property="phonenumber" column="phonenumber"/>
+    </resultMap>
+<!--查询po_news表所有-->
+    <sql id="selectPoNewsVo">
+        select news_id, news_title, news_content, status, create_by, create_time, update_by, update_time,
+               remark, sort, publisher_id, del_flag ,image ,news_time ,phonenumber from po_news
+    </sql>
+
+<!--    分页查询-->
+    <select id="selectPoNewsList" parameterType="PoNews" resultMap="PoNewsResult">
+        <include refid="selectPoNewsVo"/>
+        <where>
+            <if test="newsTitle != null  and newsTitle != ''"> and news_title = #{newsTitle}</if>
+            <if test="newsContent != null  and newsContent != ''"> and news_content = #{newsContent}</if>
+            <if test="status != null  and status != ''"> and status = #{status}</if>
+            <if test="sort != null "> and sort = #{sort}</if>
+            <if test="publisherId != null "> and publisher_id = #{publisherId}</if>
+            <if test="delFlag != null and delFlag != ''">and del_flag = #{delFlag}</if>
+            <if test="image != null and image != ''">and image = #{image}</if>
+            <if test="newsTime != null ">and news_time = #{newsTime}</if>
+            <if test="phonenumber != null ">and phonenumber = #{phonenumber}</if>
+        </where>
+    </select>
+
+<!--    通过Id查询-->
+    <select id="selectPoNewsByNewsId" parameterType="String" resultMap="PoNewsResult">
+        <include refid="selectPoNewsVo"/>
+        where news_id = #{newsId}
+    </select>
+
+<!--    增加-->
+    <insert id="insertPoNews" parameterType="PoNews">
+        insert into po_news
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="newsId != null">news_id,</if>
+            <if test="newsTitle != null and newsTitle != ''">news_title,</if>
+            <if test="newsContent != null and newsContent != ''">news_content,</if>
+            <if test="status != null">status,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+            <if test="sort != null">sort,</if>
+            <if test="publisherId != null">publisher_id,</if>
+            <if test="delFlag != null and delFlag != ''">del_flag,</if>
+            <if test="image != null and image != ''">image,</if>
+            <if test="newsTime != null">news_time,</if>
+            <if test="phonenumber != null">phonenumber,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="newsId != null">#{newsId},</if>
+            <if test="newsTitle != null and newsTitle != ''">#{newsTitle},</if>
+            <if test="newsContent != null and newsContent != ''">#{newsContent},</if>
+            <if test="status != null">#{status},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="sort != null">#{sort},</if>
+            <if test="publisherId != null">#{publisherId},</if>
+            <if test="delFlag != null and delFlag != '' ">#{delFlag},</if>
+            <if test="image != null and image != ''">#{image},</if>
+            <if test="newsTime != null">#{newsTime},</if>
+            <if test="phonenumber != null ">#{phonenumber},</if>
+        </trim>
+    </insert>
+
+<!--    修改-->
+    <update id="updatePoNews" parameterType="PoNews">
+        update po_news
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="newsTitle != null and newsTitle != ''">news_title = #{newsTitle},</if>
+            <if test="newsContent != null and newsContent != ''">news_content = #{newsContent},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="sort != null">sort = #{sort},</if>
+            <if test="publisherId != null">publisher_id = #{publisherId},</if>
+            <if test="delFlag != null and delFlag != ''">del_flag = #{delFlag}</if>
+            <if test="image != null and image != ''">image = #{image}</if>
+            <if test="newsTime != null">news_time = #{newsTime}</if>
+            <if test="phonenumber != null">phonenumber = #{phonenumber}</if>
+        </trim>
+        where news_id = #{newsId}
+    </update>
+
+<!--    删除-->
+    <delete id="deletePoNewsByNewsId" parameterType="Long">
+        delete from po_news where news_id = #{newsId}
+    </delete>
+
+<!--    批量删除-->
+    <delete id="deletePoNewsByNewsIds" parameterType="String">
+        delete from po_news where news_id in
+        <foreach item="newsId" collection="array" open="(" separator="," close=")">
+            #{newsId}
+        </foreach>
+    </delete>
+
+
+    <!--    标题时间都不为空-->
+    <select id="selectPoNewsListByTitleAndNewsTimeStartAndNewsTimeEnd"
+            resultType="PoNews" resultMap="PoNewsResult">
+    <include refid="selectPoNewsVo"></include>
+    <where>
+        <if test="newsTitle != null  and newsTitle != ''"> and news_title like concat('%', #{newsTitle}, '%')</if>
+        <if test="newsTimeStart != null and newsTimeEnd != null "> and news_time between #{newsTimeStart} and #{newsTimeEnd}</if>
+    </where>
+    </select>
+
+<!--    标题不为空时间为空-->
+    <select id="selectPoNewsListByTitle" resultType="PoNews" resultMap="PoNewsResult">
+        <include refid="selectPoNewsVo"></include>
+        <where>
+            <if test="newsTitle != null and newsTitle != ''">and news_title like concat('%', #{newsTitle}, '%')</if>
+        </where>
+    </select>
+
+<!--    标题为空时间不为空-->
+    <select id="selectPoNewsByTime" resultType="PoNews" resultMap="PoNewsResult">
+        <include refid="selectPoNewsVo"></include>
+        <where>
+            <if test="newsTimeStart != null and newsTimeEnd != null "> and news_time between #{newsTimeStart} and #{newsTimeEnd}</if>
+        </where>
+    </select>
+
+<!--    查询详细内容-->
+    <select id="selectContentByNewsId" resultType="PoNews" resultMap="PoNewsResult">
+         select news_content from po_news where news_id = #{newsId}
+    </select>
+
+<!--    校验标题是否重复-->
+    <select id="checkPostNewsTitleUnique" resultType="String" resultMap="PoNewsResult">
+        select news_id, news_title from po_news where news_title = #{newsTitle} and del_flag = '0' limit 1
+    </select>
+
+    <!--    校验图片是否重复-->
+    <select id="checkPostNewsImageUnique" resultType="String" resultMap="PoNewsResult">
+        select news_id,image from po_news where image = #{image} and del_flag = '0' limit 1
+    </select>
+
+    <!--    通过消息Id查询用户Id-->
+    <select id="selectUserByNewsId" resultType="String">
+            select u.phonenumber from po_news n LEFT JOIN po_user u ON n.phonenumber = u.phonenumber
+            where n.news_id = #{newsId}
+    </select>
+<!--    校验时间是否相同-->
+    <select id="checkPostNewsTimeUnique" resultType="String" resultMap="PoNewsResult">
+        select news_id,create_time from po_news where create_time = #{createTime} and del_flag = '0' limit 1
+    </select>
+
+
+</mapper>

+ 128 - 0
ruoyi-system/src/main/resources/mapper/system/PoNoticeMapper.xml

@@ -0,0 +1,128 @@
+<?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.ruoyi.system.mapper.PoNoticeMapper">
+
+    <resultMap type="PoNotice" id="PoNoticeResult">
+        <result property="noticeId" column="notice_id"/>
+        <result property="noticeTitle" column="notice_title"/>
+        <result property="noticeContent" column="notice_content"/>
+        <result property="noticeType" column="notice_type"/>
+        <result property="status" column="status"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="remark" column="remark"/>
+        <result property="publisherId" column="publisher_id"/>
+        <result property="userId" column="user_id" typeHandler="com.ruoyi.common.utils.sql.List2VarcharHandler"/>
+        <result property="readUserId" column="read_userid"
+                typeHandler="com.ruoyi.common.utils.sql.List2VarcharHandler"/>
+        <result property="delFlag" column="del_flag"/>
+    </resultMap>
+
+    <sql id="selectPoNoticeVo">
+        select notice_id,
+               notice_title,
+               cast(notice_content as char) as notice_content,
+               notice_type,
+               status,
+               create_by,
+               create_time,
+               update_by,
+               update_time,
+               remark,
+               publisher_id,
+               user_id,
+               read_userid,
+               del_flag
+        from po_notice
+    </sql>
+
+    <select id="selectPoNoticeById" parameterType="Long" resultMap="PoNoticeResult">
+        <include refid="selectPoNoticeVo"/>
+        where notice_id = #{noticeId}
+    </select>
+
+    <select id="selectPoNoticeList" parameterType="PoNotice" resultMap="PoNoticeResult">
+        <include refid="selectPoNoticeVo"/>
+        <where>
+            <if test="noticeTitle != null and noticeTitle != ''">
+                AND notice_title like concat('%', #{noticeTitle}, '%')
+            </if>
+            <if test="createBy != null and createBy != ''">
+                AND create_by like concat('%', #{createBy}, '%')
+            </if>
+            <if test="publisherId != null and publisherId != ''">
+                AND publisher_id like concat('%', #{publisherId}, '%')
+            </if>
+            <if test="delFlag != null and delFlag != ''">
+                AND del_flag like concat('%', #{delFlag}, '%')
+            </if>
+            <if test="noticeType != null and noticeType != ''">
+                AND notice_type like concat('%', #{noticeType}, '%')
+            </if>
+        </where>
+    </select>
+
+    <insert id="insertPoNotice" parameterType="PoNotice">
+        insert into po_notice (
+        <if test="noticeTitle != null and noticeTitle != '' ">notice_title,</if>
+        <if test="noticeContent != null and noticeContent != '' ">notice_content,</if>
+        <if test="noticeType != null and noticeType != '' ">notice_type,</if>
+        <if test="status != null and status != '' ">status,</if>
+        <if test="remark != null and remark != ''">remark,</if>
+        <if test="createBy != null and createBy != ''">create_by,</if>
+        <if test="publisherId != null and publisherId != ''">publisher_id,</if>
+        <if test="userId != null and userId != ''">user_id,</if>
+        <if test="readUserId != null and readUserId != ''">read_userid,</if>
+        del_flag,
+        create_time
+        )values(
+        <if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle},</if>
+        <if test="noticeContent != null and noticeContent != ''">#{noticeContent},</if>
+        <if test="noticeType != null and noticeType != ''">#{noticeType},</if>
+        <if test="status != null and status != ''">#{status},</if>
+        <if test="remark != null and remark != ''">#{remark},</if>
+        <if test="createBy != null and createBy != ''">#{createBy},</if>
+        <if test="publisherId != null and publisherId != ''">#{publisher_id},</if>
+        <if test="userId != null and userId != ''">#{user_id},</if>
+        <if test="readUserId != null and readUserId != ''">#{read_userid},</if>
+        0,
+        sysdate()
+        )
+    </insert>
+
+    <update id="updatePoNotice" parameterType="PoNotice">
+        update po_notice
+        <set>
+            <if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle},</if>
+            <if test="noticeContent != null">notice_content = #{noticeContent},</if>
+            <if test="noticeType != null and noticeType != ''">notice_type = #{noticeType},</if>
+            <if test="status != null and status != ''">status = #{status},</if>
+            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+            <if test="remark != null and remark != ''">remark = #{remark},</if>
+            <if test="publisherId != null and publisherId != ''">publisher_id = #{publisherId},</if>
+            <if test="userId != null and userId != ''">user_id = #{userId},</if>
+            <if test="readUserId != null and readUserId != ''">read_userid = #{readUserId},</if>
+            <if test="delFlag != null and delFlag != ''">del_flag = #{del_flag},</if>
+            update_time = sysdate()
+        </set>
+        where notice_id = #{noticeId}
+    </update>
+
+    <delete id="deletePoNoticeById" parameterType="Long">
+        delete
+        from po_notice
+        where notice_id = #{noticeId}
+    </delete>
+
+    <delete id="deletePoNoticeByIds" parameterType="Long">
+        delete from po_notice where notice_id in
+        <foreach item="noticeId" collection="array" open="(" separator="," close=")">
+            #{noticeId}
+        </foreach>
+    </delete>
+
+</mapper>

+ 138 - 0
ruoyi-system/src/main/resources/mapper/system/PoOperLogMapper.xml

@@ -0,0 +1,138 @@
+<?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.ruoyi.system.mapper.PoOperLogMapper">
+
+    <resultMap type="PoOperLog" id="PoOperLogResult">
+        <result property="operId"    column="oper_id"    />
+        <result property="title"    column="title"    />
+        <result property="businessType"    column="business_type"    />
+        <result property="method"    column="method"    />
+        <result property="requestMethod"    column="request_method"    />
+        <result property="operatorType"    column="operator_type"    />
+        <result property="operName"    column="oper_name"    />
+        <result property="deptName"    column="dept_name"    />
+        <result property="operUrl"    column="oper_url"    />
+        <result property="operIp"    column="oper_ip"    />
+        <result property="operLocation"    column="oper_location"    />
+        <result property="operParam"    column="oper_param"    />
+        <result property="jsonResult"    column="json_result"    />
+        <result property="status"    column="status"    />
+        <result property="errorMsg"    column="error_msg"    />
+        <result property="operTime"    column="oper_time"    />
+        <result property="sort"    column="sort"    />
+    </resultMap>
+<!--查询po_oper_log表所有-->
+    <sql id="selectPoOperLogVo">
+        select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time, sort from po_oper_log
+    </sql>
+
+<!--    分页查询-->
+    <select id="selectPoOperLogList" parameterType="PoOperLog" resultMap="PoOperLogResult">
+        <include refid="selectPoOperLogVo"/>
+        <where>
+            <if test="title != null  and title != ''"> and title = #{title}</if>
+            <if test="businessType != null "> and business_type = #{businessType}</if>
+            <if test="method != null  and method != ''"> and method = #{method}</if>
+            <if test="requestMethod != null  and requestMethod != ''"> and request_method = #{requestMethod}</if>
+            <if test="operatorType != null "> and operator_type = #{operatorType}</if>
+            <if test="operName != null  and operName != ''"> and oper_name like concat('%', #{operName}, '%')</if>
+            <if test="deptName != null  and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
+            <if test="operUrl != null  and operUrl != ''"> and oper_url = #{operUrl}</if>
+            <if test="operIp != null  and operIp != ''"> and oper_ip = #{operIp}</if>
+            <if test="operLocation != null  and operLocation != ''"> and oper_location = #{operLocation}</if>
+            <if test="operParam != null  and operParam != ''"> and oper_param = #{operParam}</if>
+            <if test="jsonResult != null  and jsonResult != ''"> and json_result = #{jsonResult}</if>
+            <if test="status != null "> and status = #{status}</if>
+            <if test="errorMsg != null  and errorMsg != ''"> and error_msg = #{errorMsg}</if>
+            <if test="operTime != null "> and oper_time = #{operTime}</if>
+            <if test="sort != null "> and sort = #{sort}</if>
+        </where>
+    </select>
+
+<!--    根据Id查询-->
+    <select id="selectPoOperLogByOperId" parameterType="Long" resultMap="PoOperLogResult">
+        <include refid="selectPoOperLogVo"/>
+        where oper_id = #{operId}
+    </select>
+
+<!--    增加-->
+    <insert id="insertPoOperLog" parameterType="PoOperLog" useGeneratedKeys="true" keyProperty="operId">
+        insert into po_oper_log
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="title != null">title,</if>
+            <if test="businessType != null">business_type,</if>
+            <if test="method != null and method != ''">method,</if>
+            <if test="requestMethod != null">request_method,</if>
+            <if test="operatorType != null">operator_type,</if>
+            <if test="operName != null">oper_name,</if>
+            <if test="deptName != null">dept_name,</if>
+            <if test="operUrl != null">oper_url,</if>
+            <if test="operIp != null">oper_ip,</if>
+            <if test="operLocation != null">oper_location,</if>
+            <if test="operParam != null">oper_param,</if>
+            <if test="jsonResult != null">json_result,</if>
+            <if test="status != null">status,</if>
+            <if test="errorMsg != null">error_msg,</if>
+            <if test="operTime != null">oper_time,</if>
+            <if test="sort != null">sort,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="title != null">#{title},</if>
+            <if test="businessType != null">#{businessType},</if>
+            <if test="method != null and method != ''">#{method},</if>
+            <if test="requestMethod != null">#{requestMethod},</if>
+            <if test="operatorType != null">#{operatorType},</if>
+            <if test="operName != null">#{operName},</if>
+            <if test="deptName != null">#{deptName},</if>
+            <if test="operUrl != null">#{operUrl},</if>
+            <if test="operIp != null">#{operIp},</if>
+            <if test="operLocation != null">#{operLocation},</if>
+            <if test="operParam != null">#{operParam},</if>
+            <if test="jsonResult != null">#{jsonResult},</if>
+            <if test="status != null">#{status},</if>
+            <if test="errorMsg != null">#{errorMsg},</if>
+            <if test="operTime != null">#{operTime},</if>
+            <if test="sort != null">#{sort},</if>
+        </trim>
+    </insert>
+
+<!--    修改-->
+    <update id="updatePoOperLog" parameterType="PoOperLog">
+        update po_oper_log
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="title != null">title = #{title},</if>
+            <if test="businessType != null">business_type = #{businessType},</if>
+            <if test="method != null and method != ''">method = #{method},</if>
+            <if test="requestMethod != null">request_method = #{requestMethod},</if>
+            <if test="operatorType != null">operator_type = #{operatorType},</if>
+            <if test="operName != null">oper_name = #{operName},</if>
+            <if test="deptName != null">dept_name = #{deptName},</if>
+            <if test="operUrl != null">oper_url = #{operUrl},</if>
+            <if test="operIp != null">oper_ip = #{operIp},</if>
+            <if test="operLocation != null">oper_location = #{operLocation},</if>
+            <if test="operParam != null">oper_param = #{operParam},</if>
+            <if test="jsonResult != null">json_result = #{jsonResult},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="errorMsg != null">error_msg = #{errorMsg},</if>
+            <if test="operTime != null">oper_time = #{operTime},</if>
+            <if test="sort != null">sort = #{sort},</if>
+        </trim>
+        where oper_id = #{operId}
+    </update>
+
+<!--    删除-->
+    <delete id="deletePoOperLogByOperId" parameterType="Long">
+        delete from po_oper_log where oper_id = #{operId}
+    </delete>
+
+<!--    批量删除-->
+    <delete id="deletePoOperLogByOperIds" parameterType="String">
+        delete from po_oper_log where oper_id in
+        <foreach item="operId" collection="array" open="(" separator="," close=")">
+            #{operId}
+        </foreach>
+    </delete>
+</mapper>
+

+ 157 - 0
ruoyi-system/src/main/resources/mapper/system/PoUserMapper.xml

@@ -0,0 +1,157 @@
+<?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.ruoyi.system.mapper.PoUserMapper">
+
+    <resultMap type="PoUser" id="PoUserResult">
+        <result property="userId"    column="user_id"    />
+        <result property="deptId"    column="dept_id"    />
+        <result property="userName"    column="user_name"    />
+        <result property="nickName"    column="nick_name"    />
+        <result property="userType"    column="user_type"    />
+        <result property="email"    column="email"    />
+        <result property="phonenumber"    column="phonenumber"    />
+        <result property="sex"    column="sex"    />
+        <result property="avatar"    column="avatar"    />
+        <result property="password"    column="password"    />
+        <result property="status"    column="status"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="loginIp"    column="login_ip"    />
+        <result property="loginDate"    column="login_date"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectPoUserVo">
+        select user_id, dept_id, user_name, nick_name, user_type, email, phonenumber, sex, avatar, password, status, del_flag, login_ip, login_date, create_by, create_time, update_by, update_time, remark from po_user
+    </sql>
+
+    <select id="selectPoUserList" parameterType="PoUser" resultMap="PoUserResult">
+        <include refid="selectPoUserVo"/>
+        <where>
+            <if test="deptId != null "> and dept_id = #{deptId}</if>
+            <if test="userName != null  and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
+            <if test="nickName != null  and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
+            <if test="userType != null  and userType != ''"> and user_type = #{userType}</if>
+            <if test="email != null  and email != ''"> and email = #{email}</if>
+            <if test="phonenumber != null  and phonenumber != ''"> and phonenumber = #{phonenumber}</if>
+            <if test="sex != null  and sex != ''"> and sex = #{sex}</if>
+            <if test="avatar != null  and avatar != ''"> and avatar = #{avatar}</if>
+            <if test="password != null  and password != ''"> and password = #{password}</if>
+            <if test="status != null  and status != ''"> and status = #{status}</if>
+            <if test="loginIp != null  and loginIp != ''"> and login_ip = #{loginIp}</if>
+            <if test="loginDate != null "> and login_date = #{loginDate}</if>
+        </where>
+    </select>
+
+<!--    通过Id查询-->
+    <select id="selectPoUserByUserId" parameterType="String" resultMap="PoUserResult">
+        <include refid="selectPoUserVo"/>
+        where user_id = #{userId}
+    </select>
+<!-- 校验用户名-->
+    <select id="checkUserNameUnique" parameterType="String" resultMap="PoUserResult">
+        select user_id, user_name from po_user where user_name = #{userName} and del_flag = '0' limit 1
+    </select>
+<!--校验手机号-->
+    <select id="checkPhoneUnique" parameterType="String" resultMap="PoUserResult">
+        select user_id, phonenumber from po_user where phonenumber = #{phonenumber} and del_flag = '0' limit 1
+    </select>
+<!--校验email-->
+    <select id="checkEmailUnique" parameterType="String" resultMap="PoUserResult">
+        select user_id, email from po_user where email = #{email} and del_flag = '0' limit 1
+    </select>
+<!--    通过手机号查询-->
+    <select id="selectUserByUserPhoneNumber" parameterType="String" resultMap="PoUserResult">
+        <include refid="selectPoUserVo"></include>
+        where phonenumber = #{phonenumber} and del_flag = '0'
+    </select>
+
+    <insert id="insertPoUser" parameterType="PoUser">
+        insert into po_user
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="userId != null">user_id,</if>
+            <if test="deptId != null">dept_id,</if>
+            <if test="userName != null and userName != ''">user_name,</if>
+            <if test="nickName != null and nickName != ''">nick_name,</if>
+            <if test="userType != null">user_type,</if>
+            <if test="email != null">email,</if>
+            <if test="phonenumber != null">phonenumber,</if>
+            <if test="sex != null">sex,</if>
+            <if test="avatar != null">avatar,</if>
+            <if test="password != null">password,</if>
+            <if test="status != null">status,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="loginIp != null">login_ip,</if>
+            <if test="loginDate != null">login_date,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="userId != null">#{userId},</if>
+            <if test="deptId != null">#{deptId},</if>
+            <if test="userName != null and userName != ''">#{userName},</if>
+            <if test="nickName != null and nickName != ''">#{nickName},</if>
+            <if test="userType != null">#{userType},</if>
+            <if test="email != null">#{email},</if>
+            <if test="phonenumber != null">#{phonenumber},</if>
+            <if test="sex != null">#{sex},</if>
+            <if test="avatar != null">#{avatar},</if>
+            <if test="password != null">#{password},</if>
+            <if test="status != null">#{status},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="loginIp != null">#{loginIp},</if>
+            <if test="loginDate != null">#{loginDate},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+        </trim>
+    </insert>
+
+    <update id="updatePoUser" parameterType="PoUser">
+        update po_user
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="userName != null and userName != ''">user_name = #{userName},</if>
+            <if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
+            <if test="userType != null">user_type = #{userType},</if>
+            <if test="email != null">email = #{email},</if>
+            <if test="phonenumber != null">phonenumber = #{phonenumber},</if>
+            <if test="sex != null">sex = #{sex},</if>
+            <if test="avatar != null">avatar = #{avatar},</if>
+            <if test="password != null">password = #{password},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="loginIp != null">login_ip = #{loginIp},</if>
+            <if test="loginDate != null">login_date = #{loginDate},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where user_id = #{userId}
+    </update>
+
+    <delete id="deletePoUserByUserId" parameterType="String">
+        delete from po_user where user_id = #{userId}
+    </delete>
+
+    <delete id="deletePoUserByUserIds" parameterType="String">
+        delete from po_user where user_id in
+        <foreach item="userId" collection="array" open="(" separator="," close=")">
+            #{userId}
+        </foreach>
+    </delete>
+
+</mapper>
+