java110 5 年 前
コミット
f895453711

+ 3 - 1
java110-db/src/main/resources/mapper/goods/ProductLabelServiceDaoImplMapper.xml

@@ -20,11 +20,13 @@
         select t.label_id,t.label_id labelId,p.product_id productId,p.store_id storeId,t.label_cd,t.label_cd labelCd,
         select t.label_id,t.label_id labelId,p.product_id productId,p.store_id storeId,t.label_cd,t.label_cd labelCd,
         p.unit_name unitName,p.is_postage isPostage,p.sort,p.bar_code barCode,p.postage,p.prod_name prodName,
         p.unit_name unitName,p.is_postage isPostage,p.sort,p.bar_code barCode,p.postage,p.prod_name prodName,
         p.state,p.keyword,p.prod_desc prodDesc,p.category_id categoryId,pc.category_name categoryName,td.name stateName,
         p.state,p.keyword,p.prod_desc prodDesc,p.category_id categoryId,pc.category_name categoryName,td.name stateName,
-        t.create_time createTime
+        t.create_time createTime,
+        psv.cost_price costPrice,psv.ot_price otPrice,psv.price,psv.sales,psv.stock,psv.vip_price vipPrice
         from product p
         from product p
         left join product_category pc on pc.category_id = p.category_id and pc.store_id = p.store_id and pc.status_cd = '0'
         left join product_category pc on pc.category_id = p.category_id and pc.store_id = p.store_id and pc.status_cd = '0'
         left join t_dict td on p.state = td.status_cd and td.table_name= 'product' and td.table_columns = 'state'
         left join t_dict td on p.state = td.status_cd and td.table_name= 'product' and td.table_columns = 'state'
         left join product_label t on t.product_id = p.product_id and t.store_id = p.store_id and t.status_cd = '0'
         left join product_label t on t.product_id = p.product_id and t.store_id = p.store_id and t.status_cd = '0'
+        left join product_spec_value psv on psv.product_id = t.product_id and psv.store_id = t.store_id and psv.is_default = 'T'
         <if test="labelCd !=null and labelCd != ''">
         <if test="labelCd !=null and labelCd != ''">
             and t.label_cd= #{labelCd}
             and t.label_cd= #{labelCd}
         </if>
         </if>

+ 15 - 4
service-goods/src/main/java/com/java110/goods/smo/impl/ProductLabelInnerServiceSMOImpl.java

@@ -3,7 +3,9 @@ package com.java110.goods.smo.impl;
 
 
 import com.java110.core.base.smo.BaseServiceSMO;
 import com.java110.core.base.smo.BaseServiceSMO;
 import com.java110.dto.PageDto;
 import com.java110.dto.PageDto;
+import com.java110.dto.product.ProductDto;
 import com.java110.dto.productLabel.ProductLabelDto;
 import com.java110.dto.productLabel.ProductLabelDto;
+import com.java110.dto.productSpecValue.ProductSpecValueDto;
 import com.java110.goods.dao.IProductLabelServiceDao;
 import com.java110.goods.dao.IProductLabelServiceDao;
 import com.java110.intf.goods.IProductLabelInnerServiceSMO;
 import com.java110.intf.goods.IProductLabelInnerServiceSMO;
 import com.java110.po.productLabel.ProductLabelPo;
 import com.java110.po.productLabel.ProductLabelPo;
@@ -12,7 +14,9 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
+import java.util.Map;
 
 
 /**
 /**
  * @ClassName FloorInnerServiceSMOImpl
  * @ClassName FloorInnerServiceSMOImpl
@@ -61,10 +65,17 @@ public class ProductLabelInnerServiceSMOImpl extends BaseServiceSMO implements I
         if (page != PageDto.DEFAULT_PAGE) {
         if (page != PageDto.DEFAULT_PAGE) {
             productLabelDto.setPage((page - 1) * productLabelDto.getRow());
             productLabelDto.setPage((page - 1) * productLabelDto.getRow());
         }
         }
-
-        List<ProductLabelDto> productLabels = BeanConvertUtil.covertBeanList(productLabelServiceDaoImpl.getProductLabelInfo(BeanConvertUtil.beanCovertMap(productLabelDto)), ProductLabelDto.class);
-
-        return productLabels;
+        List<ProductLabelDto> products = new ArrayList<>();
+        List<Map> prods = productLabelServiceDaoImpl.getProductLabelInfo(BeanConvertUtil.beanCovertMap(productLabelDto));
+        ProductLabelDto tmpProductDto = null;
+        ProductSpecValueDto productSpecValueDto = null;
+        for (Map prod : prods) {
+            tmpProductDto = BeanConvertUtil.covertBean(prod, ProductLabelDto.class);
+            productSpecValueDto = BeanConvertUtil.covertBean(prod, ProductSpecValueDto.class);
+            tmpProductDto.setDefaultSpecValue(productSpecValueDto);
+            products.add(tmpProductDto);
+        }
+        return products;
     }
     }