Commit 2e7379b4 authored by Quxl's avatar Quxl

x

parent 8cfceba7
......@@ -215,19 +215,6 @@ public class GoodsController {
return goodsService.goodsDetail(params);
}
@ApiOperation("批量查询商品价格 (参数为json对象)")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", dataType = "String", required = false, value = "JSON格式", defaultValue = "{\"goodsList\": [\"10\",\"12\"],\"custNO\": \"15996801133\",\"shopNO\": \"00029975\",\"terminal\": \"wechat\",\"langID\": 936}"),
})
@RequestMapping(value = "/queryGoodsPrice",method=RequestMethod.POST,produces = "application/json")
public String queryGoodsPrice(HttpServletRequest request, HttpServletResponse response) {
String reqJson = ServletUtil.readReqJson(request);
JSONObject jsonObj = JSONObject.parseObject(reqJson);
System.out.println("reqJson-------"+reqJson);
return goodsService.queryGoodsPrice(jsonObj);
}
@ApiOperation("查询库存价格")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "uid", dataType = "String", required = true, value = "商品唯一标识"),
......@@ -244,6 +231,7 @@ public class GoodsController {
uid = uid.replaceAll("\\s+", "");
String[] uidAry = uid.split(",");
Map<String, Map<String, Object>> map = goodsService.queryStockPrice(orgNo, shopNo, uidAry);
return Rjx.jsonOk().setData(map).toJson();
}
......
......@@ -506,6 +506,7 @@ 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)");
for(String uid : uidAry) {
if(StringUtil.isBlank(uid)) {
continue;
......@@ -517,6 +518,13 @@ public class GoodsServiceImpl implements GoodsService {
String sql = "select sAgentContractNO, nGoodsID, nStockQty, nRealSalePrice from V_OrgGoods where 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";
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()) {
mm.get(key).put("promoList", pmm.get(key));
}
return mm;
}
}
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