Commit c136fe69 authored by Quxl's avatar Quxl

x

parent 2e7379b4
......@@ -506,20 +506,20 @@ public class GoodsServiceImpl implements GoodsService {
@Override
public Map<String, Map<String, Object>> queryStockPrice(String orgNo, String shopNo, String[] uidAry) {
List<String> args = new ArrayList<String>();
args.add("((sAgentContractNO is null or sAgentContractNO = '') and nGoodsID is null)");
args.add("((t.sAgentContractNO is null or t.sAgentContractNO = '') and t.nGoodsID is null)");
for(String uid : uidAry) {
if(StringUtil.isBlank(uid)) {
continue;
}
String[] kv = uid.split(":", 2);
args.add("(sAgentContractNO = '" + kv[0] + "' and nGoodsID = " + kv[1] + ")");
args.add("(t.sAgentContractNO = '" + kv[0] + "' and t.nGoodsID = " + kv[1] + ")");
}
String sql = "select sAgentContractNO, nGoodsID, nStockQty, nRealSalePrice from V_OrgGoods where sOrgNO = '" + orgNo + "' " + StringUtil.join(" OR ", " and (", ")", " and (1 = 0) ", args);
String sql = "select t.sAgentContractNO, t.nGoodsID, t.nStockQty, t.nRealSalePrice from V_OrgGoods t where t.sOrgNO = '" + orgNo + "' " + StringUtil.join(" OR ", " and (", ")", " and (1 = 0) ", args);
List<Map<String, Object>> datas = jdbcTemplate.queryForList(sql);
Map<String, Map<String, Object>> mm = Util.listToMM(datas, ":", "sAgentContractNO", "nGoodsID");
String sql1 = "select prg.sPromoPaperNO, sPromoActionTypeID, sPromoGroupNO from tPromoRuleGoods prg, tPromo p where prg.sPromoPaperNO = p.sPromoPaperNO and p.sOrgNO = '" + orgNo + "' " + StringUtil.join(" OR ", " and (", ")", " and (1 = 0) ", args) + " group by prg.sPromoPaperNO, sPromoActionTypeID, sPromoGroupNO";
String sql1 = "select t.sPromoPaperNO, t.sPromoActionTypeID, t.sPromoGroupNO from tPromoRuleGoods t, tPromo p where t.sPromoPaperNO = p.sPromoPaperNO and p.sOrgNO = '" + orgNo + "' " + StringUtil.join(" OR ", " and (", ")", " and (1 = 0) ", args) + " group by t.sPromoPaperNO, t.sPromoActionTypeID, t.sPromoGroupNO";
List<Map<String, Object>> plist = jdbcTemplate.queryForList(sql1);
Map<String, List<Map<String, Object>>> pmm = Util.listToML(plist, ":", "sAgentContractNO", "nGoodsID");
for(String key : mm.keySet()) {
......
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