Commit 4d207ea7 authored by 张永's avatar 张永

1

parent 723d22c4
...@@ -193,10 +193,18 @@ public class GoodsServiceImpl implements GoodsService { ...@@ -193,10 +193,18 @@ public class GoodsServiceImpl implements GoodsService {
specList = jdbcTemplate.queryForList(sql, orgNo, contractNo, custTypeId, goodsId); specList = jdbcTemplate.queryForList(sql, orgNo, contractNo, custTypeId, goodsId);
} }
Map<String, Map<String, Object>> specMap = Util.listToMM(specList, ";", "sSpecName", "sSpec"); Rjx rjx = Rjx.jsonOk();
Set<String> specNames = specList.stream().map(o -> (String)o.get("sSpecName")).collect(Collectors.toSet());
Set<String> specs = specList.stream().map(o -> (String)o.get("sSpec")).collect(Collectors.toSet()); if( specList.size() > 0) {
Map<String, Map<String, Object>> specMap = Util.listToMM(specList, ";", "sSpecName", "sSpec");
Set<String> specNames = specList.stream().map(o -> (String)o.get("sSpecName")).collect(Collectors.toSet());
Set<String> specs = specList.stream().map(o -> (String)o.get("sSpec")).collect(Collectors.toSet());
rjx.set("specList", specList).set("specMap", specMap).set("specNames", specNames).set("specs", specs);
}else {
rjx.set("specList", null).set("specMap", null).set("specNames", null).set("specs", null);
}
BigDecimal nMarketPrice = (BigDecimal)detail.get("nMarketPrice"); BigDecimal nMarketPrice = (BigDecimal)detail.get("nMarketPrice");
BigDecimal nRealSalePrice = (BigDecimal)detail.get("nRealSalePrice"); BigDecimal nRealSalePrice = (BigDecimal)detail.get("nRealSalePrice");
BigDecimal nProfitMargin = BigDecimal.ZERO; BigDecimal nProfitMargin = BigDecimal.ZERO;
...@@ -234,7 +242,7 @@ public class GoodsServiceImpl implements GoodsService { ...@@ -234,7 +242,7 @@ public class GoodsServiceImpl implements GoodsService {
detail.put("promoList", promoList); detail.put("promoList", promoList);
Rjx rjx = Rjx.jsonOk().set("goodsDetail", detail).set("specList", specList).set("specMap", specMap).set("specNames", specNames).set("specs", specs); rjx.set("goodsDetail", detail);
rjx.putAll(picList); rjx.putAll(picList);
return rjx.toJson(); return rjx.toJson();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment