Commit ac93bbc3 authored by Quxl's avatar Quxl

x

parent c7133b47
package com.egolm.shop.service.impl;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
......@@ -372,6 +373,10 @@ public class GoodsServiceImpl implements GoodsService {
String contractNo=(String) map.get("contractNo");
String sql = "select acg.*, asa.sWarehouseNO, w.sWarehouseName, asa.nStockQty, asa.nOnlineStockQty, asa.nLockedQty from tAgentContractGoods acg LEFT JOIN tAgentContractWarehouse acw on acw.sAgentContractNO = acg.sAgentContractNO left join tWarehouse w on w.sWarehouseNO = acw.sWarehouseNO left join tAgentStockAccount asa on asa.nAgentID = acg.nAgentID and asa.nGoodsID = acg.nGoodsID and asa.sWarehouseNO = acw.sWarehouseNO where acg.sAgentContractNO = ? and acg.nGoodsID = ?";
Map<String, Object> detail = jdbcTemplate.queryForMap(sql, contractNo, goodsId);
BigDecimal nMarketPrice = (BigDecimal)detail.get("nMarketPrice");
BigDecimal nRealSalePrice = (BigDecimal)detail.get("nRealSalePrice");
BigDecimal nProfitMargin = nMarketPrice.subtract(nRealSalePrice).multiply(new BigDecimal(100)).divide(nRealSalePrice).setScale(2, BigDecimal.ROUND_UP);
detail.put("nProfitMargin", nProfitMargin);
Map<String, List<Map<String, Object>>> picList = goodsPicList(goodsId, contractNo);
Rjx rjx = Rjx.jsonOk().set("goodsDetail", detail);
rjx.putAll(picList);
......
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