Przeglądaj źródła

add ComponentTypeName Attributes

xiewenjie 4 lat temu
rodzic
commit
49c8a63ec7

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

@@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil;
 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.CustomComponentClassifyEntity;
 import com.fdkk.sxz.entity.custuom.CustomComponentEntity;
 import com.fdkk.sxz.entity.custuom.CustomProductEntity;
 import com.fdkk.sxz.vo.request.RequestCustom;
@@ -12,6 +13,7 @@ import com.fdkk.sxz.vo.request.RequestCustomComponent;
 import com.fdkk.sxz.vo.response.ResponseCustomComponent;
 import com.fdkk.sxz.vo.response.ResponseCustomProduct;
 import com.fdkk.sxz.webApi.mapper.custom.ICustomComponentMapper;
+import com.fdkk.sxz.webApi.service.custom.ICustomComponentClassifyService;
 import com.fdkk.sxz.webApi.service.custom.ICustomComponentService;
 import com.github.pagehelper.PageInfo;
 import org.springframework.beans.BeanUtils;
@@ -34,6 +36,9 @@ public class CustomComponentServiceImpl extends BaseServiceImpl<ICustomComponent
     @Autowired
     private ICustomComponentMapper customComponentMapper;
 
+    @Autowired
+    private ICustomComponentClassifyService componentClassifyService;
+
 
 
     @Override
@@ -84,6 +89,10 @@ public class CustomComponentServiceImpl extends BaseServiceImpl<ICustomComponent
         return list(wrapper).stream().map(a ->{
             ResponseCustomComponent customComponent=new ResponseCustomComponent();
             BeanUtils.copyProperties(a, customComponent);
+            CustomComponentClassifyEntity componentClassifyEntity = componentClassifyService.findById(a.getComponentTypeId());
+            if (ObjectUtil.isNotNull(componentClassifyEntity)){
+                customComponent.setComponentTypeName(componentClassifyEntity.getName());
+            }
             customComponent.setType("component");
             return customComponent;
         }).collect(Collectors.toList());

+ 2 - 0
sxz-modules/src/main/java/com/fdkk/sxz/vo/response/ResponseCustomComponent.java

@@ -16,4 +16,6 @@ public class ResponseCustomComponent extends CustomComponentEntity {
     private JSONObject origin;
     private String type;
 
+    private String componentTypeName;
+
 }