Commit 132abc9e authored by Quxl's avatar Quxl

x

parent 5b056c2d
......@@ -7,6 +7,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
......@@ -184,6 +185,13 @@ public class GoodsServiceImpl implements GoodsService {
}
String sql = "select t.nGoodsID, t.sSubCode, t.nParentID, t.sSpecName, t.sSpec, isnull(ap.nRealSalePrice, og.nRealSalePrice) nRealSalePrice, og.nStockQty, og.nLockedQty from tGoodsSubCode t left join V_OrgGoods og on og.sOrgNO = ? and og.sAgentContractNO = ? and og.nGoodsID = t.nGoodsID left join tAgentCustTypePrice ap on ap.sCustTypeID = ? and ap.sAgentContractNO = og.sAgentContractNO and ap.nGoodsID = og.nGoodsID, tGoodsSubCode p where t.nParentID = p.nParentID and p.nGoodsID = ? and t.nTag&1 = 0";
List<Map<String, Object>> specList = jdbcTemplate.queryForList(sql, orgNo, contractNo, custTypeId, goodsId);
Map<String, Map<String, Object>> specMap = Util.listToMM(specList, ";", "sSpecName", "sSpec");
List<String> specNames = specList.stream().map(o -> (String)o.get("sSpecName")).collect(Collectors.toList());
List<String> specs = specList.stream().map(o -> (String)o.get("sSpec")).collect(Collectors.toList());
BigDecimal nMarketPrice = (BigDecimal)detail.get("nMarketPrice");
BigDecimal nRealSalePrice = (BigDecimal)detail.get("nRealSalePrice");
......@@ -197,7 +205,7 @@ public class GoodsServiceImpl implements GoodsService {
Object[] args = new Object[] {custTypeId, orgNo, contractNo, goodsId};
List<Map<String, Object>> promoList = jdbcTemplate.queryForList(promoSql, args);
detail.put("promoList", promoList);
Rjx rjx = Rjx.jsonOk().set("goodsDetail", detail).set("specList", specList);
Rjx rjx = Rjx.jsonOk().set("goodsDetail", detail).set("specList", specList).set("specMap", specMap).set("specNames", specNames).set("specs", specs);
rjx.putAll(picList);
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