Commit 4905b68b authored by 张永's avatar 张永

1

parent 724a4248
...@@ -34,14 +34,17 @@ public class CartServiceImpl implements CartService { ...@@ -34,14 +34,17 @@ public class CartServiceImpl implements CartService {
System.out.println(StringUtil.join(",", a)); System.out.println(StringUtil.join(",", a));
} }
public List<Map<String, Object>> CartToCartTempItem(String shopNO) { public Map<String, Object> CartToCartTempItem(String shopNO) {
try { try {
jdbcTemplate.executeUpdate("EXEC up_RestorePromoGiftRec ? ",shopNO); jdbcTemplate.executeUpdate("EXEC up_RestorePromoGiftRec ? ",shopNO);
String sql = "EXEC up_B2BCartToCartTempItem '" + shopNO + "'"; String sql = "EXEC up_B2BCartToCartTempItem '" + shopNO + "'";
//jdbcTemplate.executeUpdate("EXEC up_B2BCartToCartTempItem ?",shopNO); //jdbcTemplate.executeUpdate("EXEC up_B2BCartToCartTempItem ?",shopNO);
List<Map<String, Object>> resultMap = jdbcTemplate.executeMutil(sql).getDatas().get(0); List<Map<String, Object>> resultList = jdbcTemplate.executeMutil(sql).getDatas().get(0);
return resultMap; if(resultList != null && resultList.size() >0 ) {
return resultList.get(0);
}
return null;
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -100,7 +103,7 @@ public class CartServiceImpl implements CartService { ...@@ -100,7 +103,7 @@ public class CartServiceImpl implements CartService {
} }
} }
List<Map<String, Object>> rmap = this.CartToCartTempItem(shopNO); Map<String, Object> rmap = this.CartToCartTempItem(shopNO);
return Rjx.jsonOk().set("count", count(orgNo, shopNO)).setData(rmap).toJson(); return Rjx.jsonOk().set("count", count(orgNo, shopNO)).setData(rmap).toJson();
} }
...@@ -192,7 +195,7 @@ public class CartServiceImpl implements CartService { ...@@ -192,7 +195,7 @@ public class CartServiceImpl implements CartService {
String sql = "update tCart set nSaleQty = ?,sSaleUnit = ? where sOrgNO = ? and sShopNO = ? and nIdx = ?"; String sql = "update tCart set nSaleQty = ?,sSaleUnit = ? where sOrgNO = ? and sShopNO = ? and nIdx = ?";
jdbcTemplate.executeUpdate(sql, saleQty,saleUnit, orgNo, shopNO, idx); jdbcTemplate.executeUpdate(sql, saleQty,saleUnit, orgNo, shopNO, idx);
} }
List<Map<String, Object>> rmap = this.CartToCartTempItem(shopNO); Map<String, Object> rmap = this.CartToCartTempItem(shopNO);
return Rjx.jsonOk().set("count", count(orgNo, shopNO)).setData(rmap).toJson(); return Rjx.jsonOk().set("count", count(orgNo, shopNO)).setData(rmap).toJson();
} }
...@@ -224,7 +227,7 @@ public class CartServiceImpl implements CartService { ...@@ -224,7 +227,7 @@ public class CartServiceImpl implements CartService {
} }
jdbcTemplate.executeUpdate("update tCart set nIsSelected= "+IsSelected+",dLastUpdateTime = getdate() where sOrgNO = '" + orgNo + "' and sShopNO = '" + shopNO + "'" + StringUtil.join(", ", " and nIdx in (", ")", nIdx)); jdbcTemplate.executeUpdate("update tCart set nIsSelected= "+IsSelected+",dLastUpdateTime = getdate() where sOrgNO = '" + orgNo + "' and sShopNO = '" + shopNO + "'" + StringUtil.join(", ", " and nIdx in (", ")", nIdx));
List<Map<String, Object>> rmap = this.CartToCartTempItem(shopNO); Map<String, Object> rmap = this.CartToCartTempItem(shopNO);
return Rjx.jsonOk().set("count", count(orgNo, shopNO)).setData(rmap).toJson(); return Rjx.jsonOk().set("count", count(orgNo, shopNO)).setData(rmap).toJson();
...@@ -239,7 +242,7 @@ public class CartServiceImpl implements CartService { ...@@ -239,7 +242,7 @@ public class CartServiceImpl implements CartService {
BigDecimal setPrice = obj.getBigDecimal("setPrice"); BigDecimal setPrice = obj.getBigDecimal("setPrice");
String sql = "update tCart set nSetPrice = ? where sOrgNO = ? and sShopNO = ? and nIdx = ?"; String sql = "update tCart set nSetPrice = ? where sOrgNO = ? and sShopNO = ? and nIdx = ?";
jdbcTemplate.executeUpdate(sql, setPrice, orgNo, shopNO, idx); jdbcTemplate.executeUpdate(sql, setPrice, orgNo, shopNO, idx);
List<Map<String, Object>> rmap = this.CartToCartTempItem(shopNO); Map<String, Object> rmap = this.CartToCartTempItem(shopNO);
return Rjx.jsonOk().setData(rmap).toJson(); return Rjx.jsonOk().setData(rmap).toJson();
} }
......
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