Parcourir la source

增加定制材质类表

xiewenjie il y a 3 ans
Parent
commit
c1bb0ed527

+ 43 - 0
sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/custom/CustomMaterialApiController.java

@@ -0,0 +1,43 @@
+package com.fdkk.sxz.webApi.controller.custom;
+
+import com.fdkk.sxz.annotation.auth.NoAuthentication;
+import com.fdkk.sxz.annotation.log.AroundLog;
+import com.fdkk.sxz.base.BaseController;
+import com.fdkk.sxz.base.Result;
+import com.fdkk.sxz.entity.custuom.CustomMaterialEntity;
+import com.fdkk.sxz.vo.request.RequestCustomMaterial;
+import com.fdkk.sxz.webApi.service.custom.ICustomMaterialService;
+import io.swagger.annotations.Api;
+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.RestController;
+
+import java.util.List;
+
+/**
+ * @description: 定制家具——库模块相关API接口
+ * @author: Xiewj
+ * @date: 2021年11月29日18:13:02
+ **/
+@Api(tags = "定制家具材质模块相关API接口 author:Xiewj")
+@RestController
+@RequestMapping("/change/customMaterial")
+public class CustomMaterialApiController extends BaseController {
+
+    @Autowired
+    private ICustomMaterialService customMaterialService;
+
+
+    @ApiOperation("获取定制家具材质列表")
+    @RequestMapping(value = "/findAllCustomMaterialList", method = RequestMethod.POST)
+    @NoAuthentication
+    @AroundLog(name = "定制家具——获取定制家具材质列表")
+    public Result findAllCustomMaterialList(RequestCustomMaterial params) {
+        List<CustomMaterialEntity> listDTO = customMaterialService.findListByQuery(params);
+        return Result.success(listDTO);
+    }
+
+
+}

+ 18 - 0
sxz-core/src/main/java/com/fdkk/sxz/webApi/mapper/custom/ICustomMaterialMapper.java

@@ -0,0 +1,18 @@
+package com.fdkk.sxz.webApi.mapper.custom;
+
+import com.fdkk.sxz.base.IBaseMapper;
+import com.fdkk.sxz.entity.custuom.CustomMaterialEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Component;
+
+/**
+ * @description: 定制家具——成品二级目录 Model
+ * @author: Xiewj
+ * @date: 2021-08-30 14:44:45
+ */
+@Mapper
+@Component("ICustomMaterialMapper")
+public interface ICustomMaterialMapper extends IBaseMapper<CustomMaterialEntity> {
+
+
+}

+ 18 - 0
sxz-core/src/main/java/com/fdkk/sxz/webApi/service/custom/ICustomMaterialService.java

@@ -0,0 +1,18 @@
+package com.fdkk.sxz.webApi.service.custom;
+
+import com.fdkk.sxz.base.IBaseService;
+import com.fdkk.sxz.entity.custuom.CustomMaterialEntity;
+import com.fdkk.sxz.vo.request.RequestCustomMaterial;
+
+import java.util.List;
+
+/**
+ * @description: CustomMaterial 相关的服务接口类
+ * @author: Xiewj
+ * @date: 2021年11月29日18:04:14
+ **/
+public interface ICustomMaterialService extends IBaseService<CustomMaterialEntity> {
+
+    List<CustomMaterialEntity> findListByQuery(RequestCustomMaterial params);
+
+}

+ 34 - 0
sxz-core/src/main/java/com/fdkk/sxz/webApi/service/custom/impl/CustomMaterialServiceImpl.java

@@ -0,0 +1,34 @@
+package com.fdkk.sxz.webApi.service.custom.impl;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.fdkk.sxz.base.impl.BaseServiceImpl;
+import com.fdkk.sxz.entity.custuom.CustomMaterialEntity;
+import com.fdkk.sxz.vo.request.RequestCustomMaterial;
+import com.fdkk.sxz.webApi.mapper.custom.ICustomMaterialMapper;
+import com.fdkk.sxz.webApi.service.custom.ICustomMaterialService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @description: Custom 相关的服务实现类
+ * @author: Xiewj
+ * @date: 2021-08-30 14:44:45
+ **/
+@Service
+public class CustomMaterialServiceImpl extends BaseServiceImpl<ICustomMaterialMapper, CustomMaterialEntity> implements ICustomMaterialService {
+
+    @Override
+    public List<CustomMaterialEntity> findListByQuery(RequestCustomMaterial params) {
+        LambdaQueryWrapper<CustomMaterialEntity> wrapper = Wrappers.lambdaQuery();
+        if (ObjectUtil.isNotNull(params.getId())) {
+            wrapper.eq(CustomMaterialEntity::getId, params.getId());
+        }
+        if (ObjectUtil.isNotNull(params.getName())) {
+            wrapper.eq(CustomMaterialEntity::getName, params.getName());
+        }
+        return list(wrapper);
+    }
+}

+ 26 - 0
sxz-modules/src/main/java/com/fdkk/sxz/entity/custuom/CustomMaterialEntity.java

@@ -0,0 +1,26 @@
+package com.fdkk.sxz.entity.custuom;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fdkk.sxz.entity.BaseEntity;
+import lombok.Data;
+
+
+/**
+ * Created by Hb_zzZ on 2021/4/8.
+ */
+@Data
+@TableName("tb_custom_material")
+public class CustomMaterialEntity extends BaseEntity {
+
+    @TableField("thumb")
+    private String thumb;
+
+    @TableField("name")
+    private String name;
+
+    @TableField("high_img")
+    private String high_img;
+
+
+}

+ 18 - 0
sxz-modules/src/main/java/com/fdkk/sxz/vo/request/RequestCustomMaterial.java

@@ -0,0 +1,18 @@
+package com.fdkk.sxz.vo.request;
+
+import com.fdkk.sxz.base.RequestBase;
+import lombok.Data;
+
+/**
+ * @description: 定制家具——成品 Model
+ * @author: Xiewj
+ * @date: 2021-09-01 11:24:32
+ */
+@Data
+public class RequestCustomMaterial extends RequestBase {
+
+
+    private Long id;
+
+    private String name;
+}