瀏覽代碼

增加自定义灯光,组件贴图查询

xiewenjie 3 年之前
父節點
當前提交
f60f8653c9

+ 22 - 18
sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/SceneLightStyleController.java

@@ -5,12 +5,12 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.fdkk.sxz.annotation.auth.NoAuthentication;
 import com.fdkk.sxz.annotation.log.AroundLog;
 import com.fdkk.sxz.base.BaseController;
-import com.github.pagehelper.util.StringUtil;
+import com.fdkk.sxz.base.Result;
 import com.fdkk.sxz.constant.CodeConstant;
 import com.fdkk.sxz.entity.SceneLightStyleEntity;
-import com.fdkk.sxz.webApi.service.ISceneLightStyleService;
-import com.fdkk.sxz.base.Result;
 import com.fdkk.sxz.vo.request.RequestSceneLightStyle;
+import com.fdkk.sxz.webApi.service.ISceneLightStyleService;
+import com.github.pagehelper.util.StringUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -30,14 +30,15 @@ import java.util.Date;
 @Slf4j
 @RestController
 @RequestMapping("/change/sceneLightStyle")
-@Api(tags = "灯光方案管理模块")
-public class SceneLightStyleController  extends BaseController {
+@Api(tags = "灯光自定义方案管理模块")
+public class SceneLightStyleController extends BaseController {
 
     @Autowired
     private ISceneLightStyleService sceneLightStyleService;
 
     /**
      * 保存或者修改
+     *
      * @param lightStyle
      * @return
      */
@@ -46,14 +47,14 @@ public class SceneLightStyleController  extends BaseController {
             @ApiImplicitParam(name = "id", value = "灯光方案id,有则修改,无则新增", dataType = "String"),
             @ApiImplicitParam(name = "sceneStyleId", value = "风格方案id", dataType = "String"),
             @ApiImplicitParam(name = "lightStyleName", value = "灯光方案名称", dataType = "String"),
-            @ApiImplicitParam(name = "proLightJson", value = "proLight.json的数据", dataType = "String")})
+            @ApiImplicitParam(name = "proLightJson", value = "json的数据", dataType = "String")})
     @RequestMapping(value = "/saveOrUpdate", method = RequestMethod.POST)
     @NoAuthentication
     @AroundLog(name = "保存或者修改灯光方案")
-    public Result saveOrUpdate(@RequestBody RequestSceneLightStyle lightStyle){
+    public Result saveOrUpdate(@RequestBody RequestSceneLightStyle lightStyle) {
 
-        if(StringUtil.isEmpty(lightStyle.getLightStyleName()) || StringUtil.isEmpty(lightStyle.getProLightJson())
-                || lightStyle.getSceneStyleId() == null){
+        if (StringUtil.isEmpty(lightStyle.getLightStyleName()) || StringUtil.isEmpty(lightStyle.getProLightJson())
+                || lightStyle.getSceneStyleId() == null) {
             return Result.failure(CodeConstant.FAILURE_CODE_3001, CodeConstant.FAILURE_MSG_3001);
         }
 
@@ -61,7 +62,7 @@ public class SceneLightStyleController  extends BaseController {
         entity.setSceneStyleId(lightStyle.getSceneStyleId());
         entity.setLightStyleName(lightStyle.getLightStyleName());
         entity.setProLightJson(lightStyle.getProLightJson());
-        if(lightStyle.getId() != null){
+        if (lightStyle.getId() != null) {
             entity.setId(lightStyle.getId());
             entity.setUpdateTime(new Date());
             sceneLightStyleService.updateById(entity);
@@ -74,6 +75,7 @@ public class SceneLightStyleController  extends BaseController {
 
     /**
      * 根据风格id查询全部灯光方案
+     *
      * @param lightStyle
      * @return
      */
@@ -83,14 +85,14 @@ public class SceneLightStyleController  extends BaseController {
     @RequestMapping(value = "/findListByStyleId", method = RequestMethod.POST)
     @NoAuthentication
     @AroundLog(name = "根据风格id查询全部灯光方案")
-    public Result findListByStyleId(@RequestBody RequestSceneLightStyle lightStyle){
+    public Result findListByStyleId(@RequestBody RequestSceneLightStyle lightStyle) {
 
-        if(lightStyle.getSceneStyleId() == null){
+        if (lightStyle.getSceneStyleId() == null) {
             return Result.failure(CodeConstant.FAILURE_CODE_3001, CodeConstant.FAILURE_MSG_3001);
         }
-        LambdaQueryWrapper<SceneLightStyleEntity> wrapper =  Wrappers.lambdaQuery();
+        LambdaQueryWrapper<SceneLightStyleEntity> wrapper = Wrappers.lambdaQuery();
         wrapper.eq(SceneLightStyleEntity::getSceneStyleId, lightStyle.getSceneStyleId())
-                .eq(SceneLightStyleEntity::getRecStatus,"A");
+                .eq(SceneLightStyleEntity::getRecStatus, "A");
         wrapper.orderByDesc(SceneLightStyleEntity::getId);
 
         return Result.success(sceneLightStyleService.list(wrapper));
@@ -98,6 +100,7 @@ public class SceneLightStyleController  extends BaseController {
 
     /**
      * 保存或者修改
+     *
      * @param lightStyle
      * @return
      */
@@ -107,9 +110,9 @@ public class SceneLightStyleController  extends BaseController {
     @RequestMapping(value = "/delete", method = RequestMethod.POST)
     @NoAuthentication
     @AroundLog(name = "保存或者修改")
-    public Result delete(@RequestBody RequestSceneLightStyle lightStyle){
+    public Result delete(@RequestBody RequestSceneLightStyle lightStyle) {
 
-        if(lightStyle.getId() == null){
+        if (lightStyle.getId() == null) {
             return Result.failure(CodeConstant.FAILURE_CODE_3001, CodeConstant.FAILURE_MSG_3001);
         }
 
@@ -123,6 +126,7 @@ public class SceneLightStyleController  extends BaseController {
 
     /**
      * 根据id查询灯光方案
+     *
      * @param lightStyle
      * @return
      */
@@ -132,9 +136,9 @@ public class SceneLightStyleController  extends BaseController {
     @RequestMapping(value = "/findById", method = RequestMethod.POST)
     @NoAuthentication
     @AroundLog(name = "根据id查询灯光方案")
-    public Result findById(@RequestBody RequestSceneLightStyle lightStyle){
+    public Result findById(@RequestBody RequestSceneLightStyle lightStyle) {
 
-        if(lightStyle.getId() == null){
+        if (lightStyle.getId() == null) {
             return Result.failure(CodeConstant.FAILURE_CODE_3001, CodeConstant.FAILURE_MSG_3001);
         }
 

+ 43 - 0
sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/custom/CustomComponentMaterialApiController.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.CustomComponentMaterialEntity;
+import com.fdkk.sxz.vo.request.RequestComponentMaterial;
+import com.fdkk.sxz.webApi.service.custom.ICustomComponentMaterialService;
+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/componentMaterial")
+public class CustomComponentMaterialApiController extends BaseController {
+
+    @Autowired
+    private ICustomComponentMaterialService componentMaterialService;
+
+
+    @ApiOperation("定制家具——获取定制家具-组件材质列表")
+    @RequestMapping(value = "/findAllCustomMaterialList", method = RequestMethod.POST)
+    @NoAuthentication
+    @AroundLog(name = "定制家具——获取定制家具-组件材质列表")
+    public Result findAllCustomMaterialList(RequestComponentMaterial params) {
+        List<CustomComponentMaterialEntity> listDTO = componentMaterialService.findListByQuery(params);
+        return Result.success(listDTO);
+    }
+
+
+}

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

@@ -0,0 +1,18 @@
+package com.fdkk.sxz.webApi.mapper.custom;
+
+import com.fdkk.sxz.base.IBaseMapper;
+import com.fdkk.sxz.entity.custuom.CustomComponentMaterialEntity;
+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 IComponentMaterialMapper extends IBaseMapper<CustomComponentMaterialEntity> {
+
+
+}

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

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

+ 34 - 0
sxz-core/src/main/java/com/fdkk/sxz/webApi/service/custom/impl/CustomComponentMaterialServiceImpl.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.CustomComponentMaterialEntity;
+import com.fdkk.sxz.vo.request.RequestComponentMaterial;
+import com.fdkk.sxz.webApi.mapper.custom.IComponentMaterialMapper;
+import com.fdkk.sxz.webApi.service.custom.ICustomComponentMaterialService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @description: Custom 相关的服务实现类
+ * @author: Xiewj
+ * @date: 2021-08-30 14:44:45
+ **/
+@Service
+public class CustomComponentMaterialServiceImpl extends BaseServiceImpl<IComponentMaterialMapper, CustomComponentMaterialEntity> implements ICustomComponentMaterialService {
+
+    @Override
+    public List<CustomComponentMaterialEntity> findListByQuery(RequestComponentMaterial params) {
+        LambdaQueryWrapper<CustomComponentMaterialEntity> wrapper = Wrappers.lambdaQuery();
+        if (ObjectUtil.isNotNull(params.getId())) {
+            wrapper.eq(CustomComponentMaterialEntity::getId, params.getId());
+        }
+        if (ObjectUtil.isNotNull(params.getName())) {
+            wrapper.eq(CustomComponentMaterialEntity::getName, params.getName());
+        }
+        return list(wrapper);
+    }
+}

+ 26 - 0
sxz-modules/src/main/java/com/fdkk/sxz/entity/custuom/CustomComponentMaterialEntity.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_component_material")
+public class CustomComponentMaterialEntity 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/RequestComponentMaterial.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 RequestComponentMaterial extends RequestBase {
+
+
+    private Long id;
+
+    private String name;
+}