Commit a342aeb8 authored by Quxl's avatar Quxl

x

parent 1ddd0647
...@@ -18,6 +18,7 @@ import com.egolm.common.StringUtil; ...@@ -18,6 +18,7 @@ import com.egolm.common.StringUtil;
import com.egolm.common.bean.Rjx; import com.egolm.common.bean.Rjx;
import com.egolm.common.jdbc.Page; import com.egolm.common.jdbc.Page;
import com.egolm.common.web.ServletUtil; import com.egolm.common.web.ServletUtil;
import com.egolm.shop.config.XException;
import com.egolm.shop.service.GoodsService; import com.egolm.shop.service.GoodsService;
import com.egolm.shop.util.I18NUtils; import com.egolm.shop.util.I18NUtils;
...@@ -227,6 +228,25 @@ public class GoodsController { ...@@ -227,6 +228,25 @@ public class GoodsController {
return goodsService.queryGoodsPrice(jsonObj); return goodsService.queryGoodsPrice(jsonObj);
} }
@ApiOperation("收藏及取消收藏")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "uid", dataType = "String", required = true, value = "商品唯一标识"),
@ApiImplicitParam(paramType = "query", name = "shopNo", dataType = "String", required = true),
@ApiImplicitParam(paramType = "query", name = "orgNo", dataType = "String", required = true),
@ApiImplicitParam(paramType = "query", name = "terminal", dataType = "String", required = false, value = "终端标识", defaultValue = "wechat"),
@ApiImplicitParam(paramType = "query", name = "langID", dataType = "String", required = false, value = "语言", defaultValue = "936"),
@ApiImplicitParam(paramType = "query", name = "sign", dataType = "String", required = true, value = "签名", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "timestamp", dataType = "String", required = true, value = "时间戳", defaultValue = "")
})
@RequestMapping(value = "/queryStockPrice",method=RequestMethod.GET)
public String queryStockPrice(String uid, String shopNo, String orgNo) {
XException.assertNotBlank(uid, "商品唯一标识不能为空");
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();
}
@ApiOperation("收藏及取消收藏") @ApiOperation("收藏及取消收藏")
@ApiImplicitParams({ @ApiImplicitParams({
......
...@@ -50,4 +50,6 @@ public interface GoodsService { ...@@ -50,4 +50,6 @@ public interface GoodsService {
* @throws * @throws
*/ */
public String updateFlavor(Map<String,Object> params); public String updateFlavor(Map<String,Object> params);
public Map<String, Map<String, Object>> queryStockPrice(String orgNo, String shopNo, String[] uid);
} }
...@@ -502,4 +502,18 @@ public class GoodsServiceImpl implements GoodsService { ...@@ -502,4 +502,18 @@ public class GoodsServiceImpl implements GoodsService {
String sql = "insert into tShopSearchLog (sShopNO, sKeyword, sOriginalKeyWord, sTypeID, dLastUpdateTime) values (?, ?, ?, ?, ?)"; String sql = "insert into tShopSearchLog (sShopNO, sKeyword, sOriginalKeyWord, sTypeID, dLastUpdateTime) values (?, ?, ?, ?, ?)";
jdbcTemplate.update(sql, new Object[]{ShopNO, key, key, typeID, new Date()}); jdbcTemplate.update(sql, new Object[]{ShopNO, key, key, typeID, new Date()});
} }
@Override
public Map<String, Map<String, Object>> queryStockPrice(String orgNo, String shopNo, String[] uidAry) {
List<String> args = new ArrayList<String>();
for(String uid : uidAry) {
String[] kv = uid.split(":", 2);
args.add("(sAgentContractNO = '" + kv[0] + "' and nGoodsID = " + kv[1] + ")");
}
String sql = "select sAgentContractNO, nGoodsID, nStockQty, nRealSalePrice from V_OrgGoods where sOrgNO = ? " + 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");
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