Pārlūkot izejas kodu

公告类型管理

hexiao 2 gadi atpakaļ
vecāks
revīzija
6226fa03d8

+ 10 - 8
purchase-admin/src/main/java/com/ozs/web/controller/base/BaseAgencyController.java

@@ -8,6 +8,7 @@ import com.ozs.base.domain.BaseAgency;
 import com.ozs.base.service.BaseAgencyService;
 import com.ozs.base.vo.BaseAgentPageReqVo;
 import com.ozs.common.annotation.Log;
+import com.ozs.common.constant.ModularConstans;
 import com.ozs.common.core.controller.BaseController;
 import com.ozs.common.core.domain.AjaxResult;
 import com.ozs.common.enums.BusinessType;
@@ -23,7 +24,7 @@ import javax.validation.constraints.NotEmpty;
 import java.util.Date;
 
 
-@Api(tags = "招标代理机构管理")
+@Api(tags = ModularConstans.agency)
 @RestController
 @RequestMapping("/base/agency")
 public class BaseAgencyController extends BaseController {
@@ -34,8 +35,9 @@ public class BaseAgencyController extends BaseController {
     @ApiOperation(value = "新增招标代理机构")
     @PostMapping("/insertBaseAgency")
     @PreAuthorize("@ss.hasPermi('base:agency:add')")
-    @Log(title = "招标代理机构管理", businessType = BusinessType.INSERT)
-    public AjaxResult insertBaseAgency(@NotEmpty(message = "数据为空") @RequestBody BaseAgency baseAgency) {
+    @Log(title = ModularConstans.agency, businessType = BusinessType.INSERT)
+    public AjaxResult insertBaseAgency(@NotEmpty(message = "数据为空")
+                                           @RequestBody BaseAgency baseAgency) {
 //        if (ObjectUtils.isEmpty(baseAgency)) {
 //            return error("数据为空");
 //        }
@@ -51,7 +53,7 @@ public class BaseAgencyController extends BaseController {
     @ApiOperation(value = "查看招标代理机构")
     @PostMapping("/getInfo")
     @PreAuthorize("@ss.hasPermi('base:agency:query')")
-    @Log(title = "招标代理机构管理", businessType = BusinessType.QUERY)
+    @Log(title = ModularConstans.agency, businessType = BusinessType.QUERY)
     public AjaxResult getInfo(@NotEmpty(message = "主键id不能为空")
                               @RequestParam(value = "id", required = true)
                                       Long id) {
@@ -62,7 +64,7 @@ public class BaseAgencyController extends BaseController {
     @ApiOperation(value = "修改招标代理机构信息")
     @PostMapping("/updateInfo")
     @PreAuthorize("@ss.hasPermi('base:agency:edit')")
-    @Log(title = "招标代理机构管理", businessType = BusinessType.UPDATE)
+    @Log(title = ModularConstans.agency, businessType = BusinessType.UPDATE)
     public AjaxResult updateInfo(@NotEmpty(message = "数据为空")
                                              @RequestBody BaseAgency baseAgency) {
         baseAgency.setUpdateTime(new Date());
@@ -73,7 +75,7 @@ public class BaseAgencyController extends BaseController {
     @ApiOperation(value = "操作招标代理机构黑白名单")
     @PostMapping("/operationBlacklist")
     @PreAuthorize("@ss.hasPermi('base:agency:edit')")
-    @Log(title = "招标代理机构管理", businessType = BusinessType.UPDATE)
+    @Log(title = ModularConstans.agency, businessType = BusinessType.UPDATE)
     public AjaxResult operationBlacklist(@NotEmpty(message = "主键id不能为空")
                                          @RequestParam(value = "id", required = true)
                                                  Long id,
@@ -90,7 +92,7 @@ public class BaseAgencyController extends BaseController {
     @ApiOperation(value = "删除招标代理机构信息")
     @PostMapping("/remove")
     @PreAuthorize("@ss.hasPermi('base:agency:remove')")
-    @Log(title = "招标代理机构管理", businessType = BusinessType.DELETE)
+    @Log(title = ModularConstans.agency, businessType = BusinessType.DELETE)
     public AjaxResult remove(@NotEmpty(message = "主键id不能为空")
                              @RequestParam(value = "id", required = true)
                                      Long id) {
@@ -100,7 +102,7 @@ public class BaseAgencyController extends BaseController {
     @ApiOperation(value = "分页查询招标代理机构信息")
     @PostMapping("/page")
     @PreAuthorize("@ss.hasPermi('base:agency:list')")
-    @Log(title = "招标代理机构管理", businessType = BusinessType.QUERY)
+    @Log(title = ModularConstans.agency, businessType = BusinessType.QUERY)
     public AjaxResult page(@NotEmpty(message = "数据为空") @RequestBody BaseAgentPageReqVo vo) {
         LambdaQueryWrapper<BaseAgency> lw = new LambdaQueryWrapper<BaseAgency>();
         if(!StringUtils.isBlank(vo.getCompanyName())){

+ 5 - 7
purchase-admin/src/main/java/com/ozs/web/controller/base/BaseFileTemplateController.java

@@ -4,12 +4,11 @@ package com.ozs.web.controller.base;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.ozs.base.domain.BaseAgency;
 import com.ozs.base.domain.BaseFileTemplate;
 import com.ozs.base.service.BaseFileTemplateService;
-import com.ozs.base.vo.BaseAgentPageReqVo;
 import com.ozs.base.vo.BaseFileTemplatePageReqVo;
 import com.ozs.common.annotation.Log;
+import com.ozs.common.constant.ModularConstans;
 import com.ozs.common.core.controller.BaseController;
 import com.ozs.common.core.domain.AjaxResult;
 import com.ozs.common.enums.BusinessType;
@@ -18,14 +17,13 @@ import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.util.ObjectUtils;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.constraints.NotEmpty;
 import java.util.Date;
 import java.util.List;
 
-@Api(tags = "文件模板管理")
+@Api(tags = ModularConstans.fileTemplate)
 @RestController
 @RequestMapping("/base/file")
 public class BaseFileTemplateController extends BaseController {
@@ -37,7 +35,7 @@ public class BaseFileTemplateController extends BaseController {
     @ApiOperation(value = "分页查询文件模板信息")
     @PostMapping("/page")
     @PreAuthorize("@ss.hasPermi('base:file:list')")
-    @Log(title = "文件模板管理", businessType = BusinessType.QUERY)
+    @Log(title = ModularConstans.fileTemplate, businessType = BusinessType.QUERY)
     public AjaxResult page(@NotEmpty(message = "数据为空") @RequestBody BaseFileTemplatePageReqVo vo) {
         LambdaQueryWrapper<BaseFileTemplate> lw = new LambdaQueryWrapper<BaseFileTemplate>();
         if(!StringUtils.isBlank(vo.getFileName())){
@@ -53,7 +51,7 @@ public class BaseFileTemplateController extends BaseController {
     @ApiOperation(value = "新增文件模板信息")
     @PostMapping("/insert")
     @PreAuthorize("@ss.hasPermi('base:file:add')")
-    @Log(title = "文件模板管理", businessType = BusinessType.INSERT)
+    @Log(title = ModularConstans.fileTemplate, businessType = BusinessType.INSERT)
     public AjaxResult insert(@NotEmpty(message = "数据为空")
                                  @RequestBody BaseFileTemplate baseFileTemplate) {
         baseFileTemplate.setCreated(getUserId().toString());
@@ -66,7 +64,7 @@ public class BaseFileTemplateController extends BaseController {
     @ApiOperation(value = "删除文件模板信息")
     @PostMapping("/remove")
     @PreAuthorize("@ss.hasPermi('base:file:remove')")
-    @Log(title = "文件模板管理", businessType = BusinessType.DELETE)
+    @Log(title = ModularConstans.fileTemplate, businessType = BusinessType.DELETE)
     public AjaxResult remove(@NotEmpty(message = "主键id不能为空")
                              @RequestBody  List<Long> ids) {
         return toAjax(baseFileTemplateService.removeBatchByIds(ids));

+ 83 - 0
purchase-admin/src/main/java/com/ozs/web/controller/base/BaseNoticeTypeController.java

@@ -0,0 +1,83 @@
+package com.ozs.web.controller.base;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ozs.base.domain.BaseNoticeType;
+import com.ozs.base.service.BaseNoticeTypeService;
+import com.ozs.base.vo.BaseNoticeTypePageReqVo;
+import com.ozs.common.annotation.Log;
+import com.ozs.common.constant.ModularConstans;
+import com.ozs.common.core.controller.BaseController;
+import com.ozs.common.core.domain.AjaxResult;
+import com.ozs.common.enums.BusinessType;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.constraints.NotEmpty;
+import java.util.Date;
+import java.util.List;
+
+@Api(tags = ModularConstans.noticeType)
+@RestController
+@RequestMapping("/base/notice/type")
+public class BaseNoticeTypeController extends BaseController {
+
+
+    @Autowired
+    private BaseNoticeTypeService baseNoticeTypeService;
+
+    @ApiOperation(value = "分页查询公告类型信息")
+    @PostMapping("/page")
+    @PreAuthorize("@ss.hasPermi('base:noticeType:list')")
+    @Log(title = ModularConstans.noticeType, businessType = BusinessType.QUERY)
+    public AjaxResult page(@NotEmpty(message = "数据为空")
+                               @RequestBody BaseNoticeTypePageReqVo vo) {
+        LambdaQueryWrapper<BaseNoticeType> lw = new LambdaQueryWrapper<>();
+        if(!StringUtils.isBlank(vo.getName())){
+            lw.like(BaseNoticeType::getName,vo.getName());
+        }
+        IPage<BaseNoticeType> page = baseNoticeTypeService.page(new Page<>(vo.getPageNum(), vo.getPageSize()), lw);
+        return success(page);
+    }
+
+    @ApiOperation(value = "修改公告类型信息")
+    @PostMapping("/updateInfo")
+    @PreAuthorize("@ss.hasPermi('base:noticeType:edit')")
+    @Log(title = ModularConstans.noticeType, businessType = BusinessType.UPDATE)
+    public AjaxResult updateInfo(@NotEmpty(message = "数据为空")
+                                 @RequestBody BaseNoticeType vo) {
+        vo.setUpdateTime(new Date());
+        vo.setUpdated(getUserId().toString());
+        return toAjax(baseNoticeTypeService.updateById(vo));
+    }
+
+    @ApiOperation(value = "新增公告类型信息")
+    @PostMapping("/insert")
+    @PreAuthorize("@ss.hasPermi('base:noticeType:add')")
+    @Log(title = ModularConstans.noticeType, businessType = BusinessType.INSERT)
+    public AjaxResult insert(@NotEmpty(message = "数据为空")
+                                 @RequestBody BaseNoticeType vo) {
+        vo.setCreated(getUserId().toString());
+        vo.setCreateTime(new Date());
+        vo.setUpdated(vo.getCreated());
+        vo.setUpdateTime(vo.getCreateTime());
+        return toAjax(baseNoticeTypeService.save(vo));
+    }
+
+    @ApiOperation(value = "删除公告类型信息")
+    @PostMapping("/remove")
+    @PreAuthorize("@ss.hasPermi('base:noticeType:remove')")
+    @Log(title = ModularConstans.noticeType, businessType = BusinessType.DELETE)
+    public AjaxResult remove(@NotEmpty(message = "主键id不能为空")
+                             @RequestBody List<Long> ids) {
+        return toAjax(baseNoticeTypeService.removeBatchByIds(ids));
+    }
+}

+ 2 - 1
purchase-admin/src/main/resources/application-dev.yml

@@ -72,7 +72,8 @@ spring:
     database: 0
     # 密码
     password: 106@qwe123
-    # 连接超时时间    timeout: 100s
+    # 连接超时时间
+    timeout: 100s
     lettuce:
       pool:
         # 连接池中的最小空闲连接

+ 2 - 1
purchase-admin/src/main/resources/application-test.yml

@@ -70,7 +70,8 @@ spring:
     database: 0
     # 密码
     password: 106@qwe123
-    # 连接超时时间    timeout: 100s
+    # 连接超时时间
+    timeout: 100s
     lettuce:
       pool:
         # 连接池中的最小空闲连接

+ 10 - 0
purchase-common/src/main/java/com/ozs/common/constant/ModularConstans.java

@@ -0,0 +1,10 @@
+package com.ozs.common.constant;
+
+public class ModularConstans {
+
+    public static final String  noticeType = "公告类型管理";
+
+    public static final String agency = "招标代理机构管理";
+
+    public static final String fileTemplate = "文件模板管理";
+}

+ 47 - 0
purchase-system/src/main/java/com/ozs/base/domain/BaseNoticeType.java

@@ -0,0 +1,47 @@
+package com.ozs.base.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.ozs.common.annotation.Excel;
+import com.ozs.common.vo.BaseDto;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * 公告类型管理对象 base_announcement_type
+ *
+ * @author ruoyi
+ * @date 2023-01-14
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+@ApiModel("公告类型管理对象")
+public class BaseNoticeType extends BaseDto
+{
+
+    /** 主键id */
+    @ApiModelProperty("主键ID")
+    @TableId(type = IdType.AUTO)
+    private Long id;
+
+    /** 名称 */
+    @Excel(name = "公告类型名称")
+    @ApiModelProperty("公告类型名称")
+    @NotBlank(message = "公告类型名称不能为空")
+    private String name;
+
+    /** 备注 */
+    @Excel(name = "备注")
+    @ApiModelProperty("公告类型名称")
+    private String remark;
+
+
+}

+ 18 - 0
purchase-system/src/main/java/com/ozs/base/mapper/BaseNoticeTypeMapper.java

@@ -0,0 +1,18 @@
+package com.ozs.base.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ozs.base.domain.BaseNoticeType;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 公告类型管理Mapper接口
+ *
+ * @author ruoyi
+ * @date 2023-01-14
+ */
+@Mapper
+public interface BaseNoticeTypeMapper extends BaseMapper<BaseNoticeType>
+{
+
+}

+ 1 - 4
purchase-system/src/main/java/com/ozs/base/service/BaseFileTemplateService.java

@@ -1,12 +1,9 @@
 package com.ozs.base.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.ozs.base.domain.BaseAgency;
 import com.ozs.base.domain.BaseFileTemplate;
 
-/**
- * 代理机构
- */
+
 public interface BaseFileTemplateService extends IService<BaseFileTemplate> {
 
 

+ 10 - 0
purchase-system/src/main/java/com/ozs/base/service/BaseNoticeTypeService.java

@@ -0,0 +1,10 @@
+package com.ozs.base.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ozs.base.domain.BaseNoticeType;
+
+
+public interface BaseNoticeTypeService extends IService<BaseNoticeType> {
+
+
+}

+ 0 - 22
purchase-system/src/main/java/com/ozs/base/service/impl/BaseAgencyServiceImpl.java

@@ -1,20 +1,13 @@
 package com.ozs.base.service.impl;
 
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ozs.base.domain.BaseAgency;
 import com.ozs.base.mapper.BaseAgencyMapper;
 import com.ozs.base.service.BaseAgencyService;
-import com.ozs.base.vo.BaseAgentPageReqVo;
 import com.ozs.common.constant.HttpStatus;
-import com.ozs.common.core.domain.entity.SysProcurementStandard;
 import com.ozs.common.exception.base.BaseException;
-import com.ozs.system.mapper.SysProcurementStandardMapper;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.ObjectUtils;
@@ -57,21 +50,6 @@ public class BaseAgencyServiceImpl extends ServiceImpl<BaseAgencyMapper, BaseAge
         return baseAgencyMapper.update(null, lambdaUpdateWrapper);
     }
 
-//    @Override
-//    public IPage<BaseAgency> page(Page<BaseAgency> baseAgencyPage, BaseAgentPageReqVo vo) {
-//        LambdaQueryWrapper<BaseAgency> lw = new LambdaQueryWrapper<BaseAgency>();
-//        if(!StringUtils.isBlank(vo.getCompanyName())){
-//            lw.like(BaseAgency::getCompanyName,vo.getCompanyName());
-//        }
-//        if(!StringUtils.isBlank(vo.getCompanyNature())){
-//            lw.eq(BaseAgency::getCompanyNature,vo.getCompanyNature());
-//        }
-//        if(!ObjectUtils.isEmpty(vo.getStatus())){
-//            lw.eq(BaseAgency::getStatus,vo.getStatus());
-//        }
-//        return baseAgencyMapper.selectPage(baseAgencyPage, lw);
-//
-//    }
 
     @Override
     public int remove(Long id) {

+ 13 - 0
purchase-system/src/main/java/com/ozs/base/service/impl/BaseNoticeTypeServiceImpl.java

@@ -0,0 +1,13 @@
+package com.ozs.base.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ozs.base.domain.BaseNoticeType;
+import com.ozs.base.mapper.BaseNoticeTypeMapper;
+import com.ozs.base.service.BaseNoticeTypeService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+@Service
+@Slf4j
+public class BaseNoticeTypeServiceImpl extends ServiceImpl<BaseNoticeTypeMapper, BaseNoticeType> implements BaseNoticeTypeService {
+}

+ 20 - 0
purchase-system/src/main/java/com/ozs/base/vo/BaseNoticeTypePageReqVo.java

@@ -0,0 +1,20 @@
+package com.ozs.base.vo;
+
+import com.ozs.common.constant.ModularConstans;
+import com.ozs.common.vo.PageVo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@ApiModel(value = "BaseNoticeTypePageReqVo", description = ModularConstans.noticeType+ "分页查询实体")
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class BaseNoticeTypePageReqVo extends PageVo {
+
+    @ApiModelProperty("公告类型名称")
+    private String name;
+
+}