Commit 776ae624 authored by 张永's avatar 张永

1

parent 33daa5da
......@@ -16,6 +16,7 @@ import com.egolm.common.bean.Rjx;
import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.shop.api.service.CartQueryService;
import com.egolm.shop.api.service.CartService;
import com.jcraft.jsch.Logger;
@Service
public class CartServiceImpl implements CartService {
......@@ -29,6 +30,15 @@ public class CartServiceImpl implements CartService {
System.out.println(Util.objTo("190.0999", BigDecimal.class, null));
}
public void CartToCartTempItem(String shopNO) {
try {
jdbcTemplate.executeUpdate("EXEC up_B2BCartToCartTempItem ?",shopNO);
} catch (Exception e) {
e.printStackTrace();
}
}
public String append(JSONObject obj,String terminal) {
String shopNO = obj.getString("shopNO");
String orgNo = obj.getString("orgNo");
......@@ -80,6 +90,7 @@ public class CartServiceImpl implements CartService {
}
}
this.CartToCartTempItem(shopNO);
return Rjx.jsonOk().set("count", count(orgNo, shopNO)).toJson();
}
......@@ -164,6 +175,7 @@ public class CartServiceImpl implements CartService {
String sql = "update tCart set nSaleQty = ? where sOrgNO = ? and sShopNO = ? and nIdx = ?";
jdbcTemplate.executeUpdate(sql, saleQty, orgNo, shopNO, idx);
}
this.CartToCartTempItem(shopNO);
return Rjx.jsonOk().set("count", count(orgNo, shopNO)).toJson();
}
......@@ -176,6 +188,7 @@ public class CartServiceImpl implements CartService {
BigDecimal setPrice = obj.getBigDecimal("setPrice");
String sql = "update tCart set nSetPrice = ? where sOrgNO = ? and sShopNO = ? and nIdx = ?";
jdbcTemplate.executeUpdate(sql, setPrice, orgNo, shopNO, idx);
this.CartToCartTempItem(shopNO);
return Rjx.jsonOk().toJson();
}
......@@ -202,6 +215,7 @@ public class CartServiceImpl implements CartService {
@Override
public void clear(String orgNo, String shopNo) {
jdbcTemplate.executeUpdate("delete from tCart where sOrgNO = ? and sShopNO = ?", orgNo, shopNo);
jdbcTemplate.executeUpdate("delete from tCartTempItem where sOrgNO = ? and sShopNO = ?", orgNo, shopNo);
}
}
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