Commit d63e4806 authored by Quxl's avatar Quxl

x

parent cb1e8bee
...@@ -70,7 +70,7 @@ public class CartController { ...@@ -70,7 +70,7 @@ public class CartController {
@ApiOperation("加入购物车(JSON格式)") @ApiOperation("加入购物车(JSON格式)")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "orgNo", dataType = "String", required = true), @ApiImplicitParam(paramType = "query", name = "orgNo", dataType = "String", required = true),
@ApiImplicitParam(paramType = "query", name = "data", dataType = "String", required = false, value = "JSON格式", defaultValue = "{\"shopNO\": \"00029975\",\"cartList\": [{\"goodsID\": \"30771\",\"goodsTypeID\": 0,\"saleQty\": \"24\",\"agentContractNO\": \"600327002\",\"promoGroupNO\":\"\",\"promoPaperNO\":\"00001810100007\", \"warehouseNO\": 'xxx'}]}"), @ApiImplicitParam(paramType = "query", name = "data", dataType = "String", required = false, value = "JSON格式", defaultValue = "{\"shopNO\": \"00029975\",\"cartList\": [{\"goodsID\": \"30771\",\"goodsTypeID\": 0,\"saleQty\": \"24\",\"agentContractNO\": \"600327002\",\"promoGroupNO\":\"\",\"promoPaperNO\":\"00001810100007\"}]}"),
@ApiImplicitParam(paramType = "query", name = "terminal", dataType = "String", required = true, value = "终端标识", defaultValue = "wechat"), @ApiImplicitParam(paramType = "query", name = "terminal", dataType = "String", required = true, value = "终端标识", defaultValue = "wechat"),
@ApiImplicitParam(paramType = "query", name = "langID", dataType = "String", required = true, value = "语言", defaultValue = "936"), @ApiImplicitParam(paramType = "query", name = "langID", dataType = "String", required = true, value = "语言", defaultValue = "936"),
@ApiImplicitParam(paramType = "query", name = "sign", dataType = "String", required = true, value = "签名", defaultValue = ""), @ApiImplicitParam(paramType = "query", name = "sign", dataType = "String", required = true, value = "签名", defaultValue = ""),
......
...@@ -47,7 +47,6 @@ public class CartServiceImpl implements CartService { ...@@ -47,7 +47,6 @@ public class CartServiceImpl implements CartService {
String sAgentContractNO = Util.objTo(cartObj.get("agentContractNO"), String.class); String sAgentContractNO = Util.objTo(cartObj.get("agentContractNO"), String.class);
String sPromoPaperNO = Util.objTo(cartObj.get("promoPaperNO"), String.class, null); String sPromoPaperNO = Util.objTo(cartObj.get("promoPaperNO"), String.class, null);
String sPromoGroupNO = Util.objTo(cartObj.get("promoGroupNO"), String.class, null); String sPromoGroupNO = Util.objTo(cartObj.get("promoGroupNO"), String.class, null);
String sWarehouseNO = Util.objTo(cartObj.get("warehouseNO"), String.class, null);
if(StringUtil.isNotBlank(sPromoPaperNO) && StringUtil.isNotBlank(sPromoGroupNO)) { if(StringUtil.isNotBlank(sPromoPaperNO) && StringUtil.isNotBlank(sPromoGroupNO)) {
...@@ -57,7 +56,6 @@ public class CartServiceImpl implements CartService { ...@@ -57,7 +56,6 @@ public class CartServiceImpl implements CartService {
strs.add("sShopNO = '" + shopNO + "'"); strs.add("sShopNO = '" + shopNO + "'");
strs.add("nTag = " + nGoodsTypeID); strs.add("nTag = " + nGoodsTypeID);
strs.add("sAgentContractNO = '" + sAgentContractNO + "'"); strs.add("sAgentContractNO = '" + sAgentContractNO + "'");
strs.add("sWarehouseNO = '" + sWarehouseNO + "'");
strs.add("nGoodsID = " + nGoodsID); strs.add("nGoodsID = " + nGoodsID);
if(StringUtil.isNotBlank(sPromoPaperNO)) { if(StringUtil.isNotBlank(sPromoPaperNO)) {
strs.add("sPromoPaperNO = '" + sPromoPaperNO + "'"); strs.add("sPromoPaperNO = '" + sPromoPaperNO + "'");
...@@ -71,8 +69,8 @@ public class CartServiceImpl implements CartService { ...@@ -71,8 +69,8 @@ public class CartServiceImpl implements CartService {
} }
List<Map<String, Object>> list = jdbcTemplate.queryForList("select nIdx, nSaleQty, sPromoPaperNO from tCart" + StringUtil.join(" and ", " where ", "", strs)); List<Map<String, Object>> list = jdbcTemplate.queryForList("select nIdx, nSaleQty, sPromoPaperNO from tCart" + StringUtil.join(" and ", " where ", "", strs));
if(list.size() == 0) { if(list.size() == 0) {
Object[] args = new Object[]{shopNO, orgNo, ++nMaxIdx, nGoodsTypeID, sAgentContractNO, nGoodsID, sWarehouseNO, nSaleQty, sPromoPaperNO, sPromoGroupNO}; Object[] args = new Object[]{shopNO, orgNo, ++nMaxIdx, nGoodsTypeID, sAgentContractNO, nGoodsID, nSaleQty, sPromoPaperNO, sPromoGroupNO};
jdbcTemplate.executeUpdate("insert into tCart (sShopNO, sOrgNO, nIdx, nTag, sAgentContractNO, nGoodsID, sWarehouseNO, nSaleQty, dLastUpdateTime, sPromoPaperNO, sPromoGroupNO) values (?, ?, ?, ?, ?, ?, ?, ?, getdate(), ?, ?)", args); jdbcTemplate.executeUpdate("insert into tCart (sShopNO, sOrgNO, nIdx, nTag, sAgentContractNO, nGoodsID, nSaleQty, dLastUpdateTime, sPromoPaperNO, sPromoGroupNO) values (?, ?, ?, ?, ?, ?, ?, getdate(), ?, ?)", args);
} else { } else {
Integer nIdx = Util.objTo(list.get(0).get("nIdx"), Integer.class); Integer nIdx = Util.objTo(list.get(0).get("nIdx"), Integer.class);
Double nQty = Util.objTo(list.get(0).get("nSaleQty"), Double.class); Double nQty = Util.objTo(list.get(0).get("nSaleQty"), Double.class);
......
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