Commit 5bff5393 authored by 张永's avatar 张永

走主库

parent 2e623f60
...@@ -46,7 +46,7 @@ public class CartQueryServiceImpl implements CartQueryService { ...@@ -46,7 +46,7 @@ public class CartQueryServiceImpl implements CartQueryService {
@Autowired @Autowired
@Qualifier("readonly") @Qualifier("readonly")
private JdbcTemplate readJdbcTemplate; //private JdbcTemplate readJdbcTemplate;
public Map<String, Object> query(String orgNo, String shopNo, String terminal,String isCalcPromo,String agentID) { public Map<String, Object> query(String orgNo, String shopNo, String terminal,String isCalcPromo,String agentID) {
Rjx rjx = Rjx.json().set("IsValid", true); Rjx rjx = Rjx.json().set("IsValid", true);
...@@ -658,7 +658,7 @@ public class CartQueryServiceImpl implements CartQueryService { ...@@ -658,7 +658,7 @@ public class CartQueryServiceImpl implements CartQueryService {
String sqlGoods = "select distinct nGoodsID, sAgentContractNO, sGoodsDesc, nRealSalePrice, nTag, sSpec, sUnit, sBrandID, sCategoryNO, sURL, nStockQty, sWarehouseNO from V_CategoryGoods where sShopNO = '" String sqlGoods = "select distinct nGoodsID, sAgentContractNO, sGoodsDesc, nRealSalePrice, nTag, sSpec, sUnit, sBrandID, sCategoryNO, sURL, nStockQty, sWarehouseNO from V_CategoryGoods where sShopNO = '"
+ shopNo + "'" + StringUtil.join(" OR ", " AND (", ")", promoGoodsArgs); + shopNo + "'" + StringUtil.join(" OR ", " AND (", ")", promoGoodsArgs);
List<Map<String, Object>> productInfo = readJdbcTemplate.queryForList(sqlGoods); List<Map<String, Object>> productInfo = jdbcTemplate.queryForList(sqlGoods);
Map<String, Map<String, Object>> pmm = Util.listToMM(productInfo, "$", "sAgentContractNO", "nGoodsID"); Map<String, Map<String, Object>> pmm = Util.listToMM(productInfo, "$", "sAgentContractNO", "nGoodsID");
for (Map<String, Object> promo : promos) { for (Map<String, Object> promo : promos) {
List<Map<String, Object>> productList = (List) promo.get("productGroup");// 参与活动的商品的集合 List<Map<String, Object>> productList = (List) promo.get("productGroup");// 参与活动的商品的集合
...@@ -728,7 +728,7 @@ public class CartQueryServiceImpl implements CartQueryService { ...@@ -728,7 +728,7 @@ public class CartQueryServiceImpl implements CartQueryService {
String sqlPromoLimit = "SELECT sop.sPromoPaperNO, sop.sAgentContractNO, sop.nGoodsID, SUM(sop.nValidQty) nValidQty FROM tSalesOrderPromo sop WHERE sop.sPromoPaperNO IN ('" String sqlPromoLimit = "SELECT sop.sPromoPaperNO, sop.sAgentContractNO, sop.nGoodsID, SUM(sop.nValidQty) nValidQty FROM tSalesOrderPromo sop WHERE sop.sPromoPaperNO IN ('"
+ StringUtil.join("', '", promosNo) + StringUtil.join("', '", promosNo)
+ "') GROUP BY sop.sPromoPaperNO, sop.sAgentContractNO, sop.nGoodsID"; + "') GROUP BY sop.sPromoPaperNO, sop.sAgentContractNO, sop.nGoodsID";
ResultMutil resultMutil = readJdbcTemplate ResultMutil resultMutil = jdbcTemplate
.executeMutil(sqlPromo + Util.LINE_SEPARATOR + sqlPromoDtl + Util.LINE_SEPARATOR + sqlPromoLimit); .executeMutil(sqlPromo + Util.LINE_SEPARATOR + sqlPromoDtl + Util.LINE_SEPARATOR + sqlPromoLimit);
List<Map<String, Object>> promos = resultMutil.getDatas().get(0); List<Map<String, Object>> promos = resultMutil.getDatas().get(0);
List<Map<String, Object>> promosDtl = resultMutil.getDatas().get(1); List<Map<String, Object>> promosDtl = resultMutil.getDatas().get(1);
...@@ -867,7 +867,7 @@ public class CartQueryServiceImpl implements CartQueryService { ...@@ -867,7 +867,7 @@ public class CartQueryServiceImpl implements CartQueryService {
int countCheckSql = 0; int countCheckSql = 0;
try { try {
String checkSql = "select count(1) from tSalesOrder where sShopNO = '"+shopNo+"' and dOrderDate = convert(date,getdate()) and nOrderStatus&1=0"; String checkSql = "select count(1) from tSalesOrder where sShopNO = '"+shopNo+"' and dOrderDate = convert(date,getdate()) and nOrderStatus&1=0";
countCheckSql = readJdbcTemplate.queryForInt(checkSql); countCheckSql = jdbcTemplate.queryForInt(checkSql);
} catch (Exception e) { } catch (Exception e) {
} }
...@@ -965,10 +965,10 @@ public class CartQueryServiceImpl implements CartQueryService { ...@@ -965,10 +965,10 @@ public class CartQueryServiceImpl implements CartQueryService {
Map<String,Object> qM = new HashMap<String,Object>(); Map<String,Object> qM = new HashMap<String,Object>();
if(StringUtil.isNotBlank(agentID)) { if(StringUtil.isNotBlank(agentID)) {
sqll += " and s.nAgentID = ?"; sqll += " and s.nAgentID = ?";
qM = readJdbcTemplate.queryForMap(sqll, shopNo,agentID); qM = jdbcTemplate.queryForMap(sqll, shopNo,agentID);
}else { }else {
qM = readJdbcTemplate.queryForMap(sqll, shopNo); qM = jdbcTemplate.queryForMap(sqll, shopNo);
} }
if(!qM.isEmpty()) { if(!qM.isEmpty()) {
sCustTypeID = qM.get("sCustTypeID")+""; sCustTypeID = qM.get("sCustTypeID")+"";
...@@ -1079,7 +1079,7 @@ public class CartQueryServiceImpl implements CartQueryService { ...@@ -1079,7 +1079,7 @@ public class CartQueryServiceImpl implements CartQueryService {
+ " sPromoPaperNO "; + " sPromoPaperNO ";
//ResultMutil resultMutil = jdbcTemplate.executeMutil(sqlClear + Util.LINE_SEPARATOR + sqlACart + (sqlp.replaceAll("\\s+", " ")) + Util.LINE_SEPARATOR); //ResultMutil resultMutil = jdbcTemplate.executeMutil(sqlClear + Util.LINE_SEPARATOR + sqlACart + (sqlp.replaceAll("\\s+", " ")) + Util.LINE_SEPARATOR);
ResultMutil resultMutil = readJdbcTemplate.executeMutil( sqlACart + (sqlp.replaceAll("\\s+", " ")) + Util.LINE_SEPARATOR); ResultMutil resultMutil = jdbcTemplate.executeMutil( sqlACart + (sqlp.replaceAll("\\s+", " ")) + Util.LINE_SEPARATOR);
List<Map<String, Object>> datas = resultMutil.getDatas().get(0); List<Map<String, Object>> datas = resultMutil.getDatas().get(0);
List<Map<String, Object>> pds = resultMutil.getDatas().get(1); List<Map<String, Object>> pds = resultMutil.getDatas().get(1);
......
...@@ -25,9 +25,9 @@ public class CartServiceImpl implements CartService { ...@@ -25,9 +25,9 @@ public class CartServiceImpl implements CartService {
@Autowired @Autowired
private JdbcTemplate jdbcTemplate; private JdbcTemplate jdbcTemplate;
@Autowired //@Autowired
@Qualifier("readonly") //@Qualifier("readonly")
private JdbcTemplate readJdbcTemplate; //private JdbcTemplate readJdbcTemplate;
@Autowired @Autowired
...@@ -141,7 +141,7 @@ public class CartServiceImpl implements CartService { ...@@ -141,7 +141,7 @@ public class CartServiceImpl implements CartService {
* @throws * @throws
*/ */
public Map<String, Object> count(String orgNo, String shopNO) { public Map<String, Object> count(String orgNo, String shopNO) {
return readJdbcTemplate.queryForMap("select count(nSaleQty) totalCount , isnull(sum(nSaleQty), 0) totalSaleQty from V_Cart where sOrgNO = '" + orgNo + "' and sShopNO = '" + shopNO + "'"); return jdbcTemplate.queryForMap("select count(nSaleQty) totalCount , isnull(sum(nSaleQty), 0) totalSaleQty from V_Cart where sOrgNO = '" + orgNo + "' and sShopNO = '" + 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