|
@@ -8,6 +8,7 @@ import com.gqy.document.mapper.DcSystemProductMapper;
|
|
|
import com.gqy.document.mapper.DcWorkSystemMapper;
|
|
|
import com.gqy.document.service.IDcProductService;
|
|
|
import com.gqy.system.mapper.DcPsParamMapper;
|
|
|
+import org.apache.commons.compress.utils.Lists;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
@@ -15,6 +16,7 @@ import org.springframework.util.CollectionUtils;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 产品信息
|
|
@@ -39,14 +41,29 @@ public class DcProductServiceImpl implements IDcProductService {
|
|
|
private DcPsParamMapper dcPsParamMapper;
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据id查询产品
|
|
|
+ * @param dcpId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
public Map selectDcProductByIdMap(Long dcpId){
|
|
|
Map result = new HashMap();
|
|
|
DcProduct dcProduct = dcProductMapper.selectDcProductById(dcpId);
|
|
|
DcSpec dcSpecQuery = new DcSpec();
|
|
|
Map content = BeanUtils.beanToMap(dcProduct);
|
|
|
+
|
|
|
+ List<Map> listMaps = dcSystemProductMapper.selectWorkSystemByProductId(dcpId);
|
|
|
+ content.putAll(listMaps.get(0));
|
|
|
result.put("content",content);
|
|
|
+
|
|
|
dcSpecQuery.setPs_p_id(dcProduct.getDcp_id());
|
|
|
List<DcSpec> list = dcSpecMapper.selectDcSpecList(dcSpecQuery);
|
|
|
+ List<Map> listDcSpec = Lists.newArrayList();
|
|
|
for (DcSpec dcSpec :list){
|
|
|
Map contentDcSpec = BeanUtils.beanToMap(dcSpec);
|
|
|
|
|
@@ -59,10 +76,9 @@ public class DcProductServiceImpl implements IDcProductService {
|
|
|
Map contentDcPsParam = BeanUtils.beanToMap(dcPsParam);
|
|
|
contentDcSpec.putAll(contentDcPsParam);
|
|
|
}
|
|
|
-
|
|
|
- result.put("specs",contentDcSpec);
|
|
|
-
|
|
|
+ listDcSpec.add(contentDcSpec);
|
|
|
}
|
|
|
+ result.put("specs",listDcSpec);
|
|
|
|
|
|
return result;
|
|
|
}
|