|
@@ -2,11 +2,13 @@ package com.gqy.document.service.impl;
|
|
|
|
|
|
import com.gqy.common.utils.bean.BeanUtils;
|
|
import com.gqy.common.utils.bean.BeanUtils;
|
|
import com.gqy.document.domain.DcProduct;
|
|
import com.gqy.document.domain.DcProduct;
|
|
|
|
+import com.gqy.document.domain.DcSpec;
|
|
import com.gqy.document.mapper.DcProductMapper;
|
|
import com.gqy.document.mapper.DcProductMapper;
|
|
import com.gqy.document.mapper.DcSpecMapper;
|
|
import com.gqy.document.mapper.DcSpecMapper;
|
|
import com.gqy.document.service.IDcProductService;
|
|
import com.gqy.document.service.IDcProductService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
+import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -30,8 +32,20 @@ public class DcProductServiceImpl implements IDcProductService {
|
|
BeanUtils.copyProperties(params, product);
|
|
BeanUtils.copyProperties(params, product);
|
|
// 保存
|
|
// 保存
|
|
dcProductMapper.insertDcProduct(product);
|
|
dcProductMapper.insertDcProduct(product);
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ // 产品id
|
|
|
|
+ int dcpId = product.getDcp_id();
|
|
|
|
+
|
|
|
|
+ // 规格管理
|
|
|
|
+ List<Map> specs = (List<Map>) params.get("specs");
|
|
|
|
+ for (Map spec : specs) {
|
|
|
|
+ // 规格
|
|
|
|
+ DcSpec dcSpec = new DcSpec();
|
|
|
|
+ //设置 产品id
|
|
|
|
+ dcSpec.setPs_p_id(dcpId);
|
|
|
|
+ // 拷贝参数
|
|
|
|
+ BeanUtils.copyProperties(spec, dcSpec);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|