Explorar o código

获取产品信息列表接口

shudonghui hai 1 ano
pai
achega
45f68f3af1

+ 5 - 1
sop-business/src/main/resources/db/log/shudonghui_update_log.sql

@@ -208,4 +208,8 @@ INSERT INTO sys_privilege
 VALUES(1039, '客户表查询', '/api/sys/custom/list', 'URL', 64, 25, 'SYS', NULL, 1, 1, 0);
 ---2023.8.17
 UPDATE `sys_privilege` SET `name` = '我的工作台', `url` = 'workManage', `type` = 'MENU', `parent_id` = NULL, `sequence` = 1, `property` = NULL, `related` = '1009,1011,1012', `enable` = 1, `default_auth` = 0, `front_display` = 1 WHERE `id` = 58;
-UPDATE `sys_privilege` SET `name` = '工作台', `url` = 'workChildManage', `type` = 'MENU', `parent_id` = 58, `sequence` = 1, `property` = NULL, `related` = '1009,1011,1012', `enable` = 1, `default_auth` = 0, `front_display` = 1 WHERE `id` = 59;
+UPDATE `sys_privilege` SET `name` = '工作台', `url` = 'workChildManage', `type` = 'MENU', `parent_id` = 58, `sequence` = 1, `property` = NULL, `related` = '1009,1011,1012', `enable` = 1, `default_auth` = 0, `front_display` = 1 WHERE `id` = 59;
+
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(1040, '获取产品信息列表接口', '/api/admin/tb/product/list', 'URL', 64, 26, 'SYS', NULL, 1, 1, 0);

+ 2 - 0
sop-common/src/main/java/com/qmth/sop/common/contant/SystemConstant.java

@@ -28,6 +28,7 @@ import java.util.StringJoiner;
  */
 public class SystemConstant {
 
+
     private final static Logger log = LoggerFactory.getLogger(SystemConstant.class);
 
     /**
@@ -151,6 +152,7 @@ public class SystemConstant {
     public static final String PREFIX_URL_QUALITY_PROBLEM_APPLY= "/admin/tb/quality/problem/apply";
     public static final String PREFIX_URL_CRM= "/admin/tb/crm";
     public static final String PREFIX_URL_DING_EXCEPTION_APPLY= "/admin/ding/exception/apply";
+    public static final String PREFIX_URL_PRODUCT = "/admin/tb/product";
 
     /**
      * 缓存配置

+ 38 - 6
sop-server/src/main/java/com/qmth/sop/server/api/TBProductController.java

@@ -1,20 +1,52 @@
 package com.qmth.sop.server.api;
 
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.qmth.boot.api.annotation.Aac;
+import com.qmth.boot.api.annotation.BOOL;
+import com.qmth.boot.api.constant.ApiConstant;
+import com.qmth.sop.business.entity.SysLevel;
+import com.qmth.sop.business.entity.TBProduct;
+import com.qmth.sop.business.service.SysLevelService;
+import com.qmth.sop.business.service.TBProductService;
+import com.qmth.sop.common.contant.SystemConstant;
+import com.qmth.sop.common.enums.ProductTypeEnum;
+import com.qmth.sop.common.util.Result;
+import com.qmth.sop.common.util.ResultUtil;
+import io.swagger.annotations.*;
 import org.springframework.web.bind.annotation.RequestMapping;
 
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.annotation.Resource;
+import java.util.Objects;
+
+
 /**
- * <p>
- * 产品表 前端控制器
- * </p>
+ * 产品信息 控制器.
  *
- * @author wangliang
- * @since 2023-08-01
+ * @author: shudonghui
+ * @date: 2023-08-17 09:37:24
+ * @version: 1.0
+ * @email: shudonghui@qmth.com.cn
+ * @Company: www.qmth.com.cn
  */
+@Api(tags = "产品信息 Controller")
 @RestController
-@RequestMapping("/t-bproduct")
+@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + SystemConstant.PREFIX_URL_PRODUCT)
 public class TBProductController {
 
+
+    @Resource
+    TBProductService tbProductService;
+
+    @ApiOperation(value = "获取产品信息列表接口")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    @ApiResponses({@ApiResponse(code = 200, message = "产品信息列表", response = TBProduct.class)})
+    public Result list(@ApiParam(value = "是否启用", required = false) @RequestParam(required = false) Boolean enable) {
+        return ResultUtil.ok(tbProductService.list(new QueryWrapper<TBProduct>().lambda().eq(Objects.nonNull(enable),TBProduct::getEnable, enable)));
+    }
+
 }