Commit 790fc1d2 authored by 张永's avatar 张永

需求 #16555

parent ea222825
...@@ -166,6 +166,7 @@ public class GoodsServiceImpl implements GoodsService { ...@@ -166,6 +166,7 @@ public class GoodsServiceImpl implements GoodsService {
String goodsId=(String) map.get("goodsId"); String goodsId=(String) map.get("goodsId");
String contractNo=(String) map.get("contractNo"); String contractNo=(String) map.get("contractNo");
String custTypeId=(String) map.get("custTypeId"); String custTypeId=(String) map.get("custTypeId");
String shopPriceTypeId=(String) map.get("shopPriceTypeId");
String agentID = map.get("agentID")+""; String agentID = map.get("agentID")+"";
boolean isCheckAgentID = StringUtil.isNotBlank(agentID)?true:false; boolean isCheckAgentID = StringUtil.isNotBlank(agentID)?true:false;
...@@ -186,16 +187,22 @@ public class GoodsServiceImpl implements GoodsService { ...@@ -186,16 +187,22 @@ public class GoodsServiceImpl implements GoodsService {
e1.printStackTrace(); e1.printStackTrace();
} }
String gSql = "select t.*, ap.nRealSalePrice nApSalePrice from V_OrgGoods t left join tAgentCustTypePrice ap on ap.sCustTypeID = ? and ap.sAgentContractNO = t.sAgentContractNO and ap.nGoodsID = t.nGoodsID where t.sOrgNO = ? and t.sAgentContractNO = ? and t.nGoodsID = ? "; String gSql = "select t.*, ap.nRealSalePrice nApSalePrice from V_OrgGoods t " +
" left join tAgentCustTypePrice ap on ap.sCustTypeID = ? " +
" and ap.sShopTypeID = ? " +
" and ap.sUnitTypeID = '' " +
" and ap.sAgentContractNO = t.sAgentContractNO " +
" and ap.nGoodsID = t.nGoodsID " +
"where t.sOrgNO = ? and t.sAgentContractNO = ? and t.nGoodsID = ? ";
Map<String, Object> detail = null; Map<String, Object> detail = null;
try { try {
if(isCheckAgentID) { if(isCheckAgentID) {
gSql += " and t.nAgentID = ? "; gSql += " and t.nAgentID = ? ";
detail = readJdbcTemplate.queryForMap(gSql, custTypeId, orgNo, contractNo, goodsId,agentID); detail = readJdbcTemplate.queryForMap(gSql, custTypeId, shopPriceTypeId, orgNo, contractNo, goodsId, agentID);
}else { }else {
detail = readJdbcTemplate.queryForMap(gSql, custTypeId, orgNo, contractNo, goodsId); detail = readJdbcTemplate.queryForMap(gSql, custTypeId, shopPriceTypeId, orgNo, contractNo, goodsId);
} }
BigDecimal nApSalePrice = (BigDecimal) detail.get("nApSalePrice"); BigDecimal nApSalePrice = (BigDecimal) detail.get("nApSalePrice");
...@@ -206,13 +213,23 @@ public class GoodsServiceImpl implements GoodsService { ...@@ -206,13 +213,23 @@ public class GoodsServiceImpl implements GoodsService {
} catch (EmptyResultDataAccessException e) { } catch (EmptyResultDataAccessException e) {
throw new XException("商品已下架"); throw new XException("商品已下架");
} }
String sql = "select t.nGoodsID, t.sSubCode, t.nParentID, t.sSpecName, t.sSpec, isnull(ap.nRealSalePrice, og.nRealSalePrice) nRealSalePrice, nStockQty = og.nRealStockQty, og.nLockedQty from tGoodsSubCode t left join V_OrgGoods og on og.sOrgNO = ? and og.sAgentContractNO = ? and og.nGoodsID = t.nGoodsID left join tAgentCustTypePrice ap on ap.sCustTypeID = ? and ap.sAgentContractNO = og.sAgentContractNO and ap.nGoodsID = og.nGoodsID where t.nParentID = ? and t.nTag&1 = 0 "; String sql = "select t.nGoodsID, t.sSubCode, t.nParentID, t.sSpecName, t.sSpec, isnull(ap.nRealSalePrice, og.nRealSalePrice) nRealSalePrice, " +
" nStockQty = og.nRealStockQty, og.nLockedQty from tGoodsSubCode t " +
" left join V_OrgGoods og on og.sOrgNO = ? " +
" and og.sAgentContractNO = ? " +
" and og.nGoodsID = t.nGoodsID " +
" left join tAgentCustTypePrice ap on ap.sCustTypeID = ? " +
" and ap.sShopTypeID = ? " +
" and ap.sUnitTypeId = '' " +
" and ap.sAgentContractNO = og.sAgentContractNO " +
" and ap.nGoodsID = og.nGoodsID " +
" where t.nParentID = ? and t.nTag&1 = 0 ";
List<Map<String, Object>> specList = new ArrayList<Map<String,Object>>(); List<Map<String, Object>> specList = new ArrayList<Map<String,Object>>();
if(isCheckAgentID) { if(isCheckAgentID) {
sql += " and og.nAgentID = ? "; sql += " and og.nAgentID = ? ";
specList = readJdbcTemplate.queryForList(sql, orgNo, contractNo, custTypeId, goodsId,agentID); specList = readJdbcTemplate.queryForList(sql, orgNo, contractNo, custTypeId, shopPriceTypeId, goodsId, agentID);
}else { }else {
specList = readJdbcTemplate.queryForList(sql, orgNo, contractNo, custTypeId, goodsId); specList = readJdbcTemplate.queryForList(sql, orgNo, contractNo, custTypeId, shopPriceTypeId, goodsId);
} }
...@@ -408,8 +425,6 @@ public class GoodsServiceImpl implements GoodsService { ...@@ -408,8 +425,6 @@ public class GoodsServiceImpl implements GoodsService {
} catch (Exception e) { } catch (Exception e) {
//shopNo为空,没有登陆 //shopNo为空,没有登陆
} }
//需求 #16555
String sShopTypeID = "99999999999999"; String sShopTypeID = "99999999999999";
try { try {
String sqll = "select s.sPriceTypeID from tCustomer c, tShop s where c.sCustNO = s.sCustNO and s.sShopNO = ? "; String sqll = "select s.sPriceTypeID from tCustomer c, tShop s where c.sCustNO = s.sCustNO and s.sShopNO = ? ";
...@@ -423,17 +438,13 @@ public class GoodsServiceImpl implements GoodsService { ...@@ -423,17 +438,13 @@ public class GoodsServiceImpl implements GoodsService {
} catch (Exception e) { } catch (Exception e) {
//shopNo为空,没有登陆 //shopNo为空,没有登陆
} }
//String sql = "select t.sAgentContractNO, t.nGoodsID, nStockQty = t.nRealStockQty, t.nDefaultPrice, isnull(ap.nRealSalePrice, t.nRealSalePrice) nRealSalePrice, t.sStockTag from V_OrgGoods t left join tAgentCustTypePrice ap on ap.sCustTypeID = '" + sCustTypeID + "' and t.sAgentContractNO = ap.sAgentContractNO and t.nGoodsID = ap.nGoodsID where t.sOrgNO = '" + orgNo + "' " + StringUtil.join(" OR ", " and (", ")", " and (1 = 0) ", args);
String sql = "select t.sAgentContractNO, t.nGoodsID, nStockQty = t.nRealStockQty, t.nDefaultPrice, isnull(ap.nRealSalePrice, t.nRealSalePrice) nRealSalePrice, t.sStockTag " + String sql = "select t.sAgentContractNO, t.nGoodsID, nStockQty = t.nRealStockQty, t.nDefaultPrice, isnull(ap.nRealSalePrice, t.nRealSalePrice) nRealSalePrice, t.sStockTag " +
" from V_OrgGoods t left join tAgentCustTypePrice ap on ap.sCustTypeID = '" + sCustTypeID + "' " + " from V_OrgGoods t left join tAgentCustTypePrice ap on ap.sCustTypeID = '" + sCustTypeID + "' " +
" and ap.sShopTypeID = '" + sShopTypeID + "' " + " and ap.sShopTypeID = '" + sShopTypeID + "' " +
" and ap.sUnitTypeID = '' " + " and ap.sUnitTypeID = '' " +
" and t.sAgentContractNO = ap.sAgentContractNO " + " and t.sAgentContractNO = ap.sAgentContractNO " +
" and t.nGoodsID = ap.nGoodsID " + " and t.nGoodsID = ap.nGoodsID " +
" where t.sOrgNO = '" + orgNo + "' " + StringUtil.join(" OR ", " and (", ")", " and (1 = 0) ", args); " where t.sOrgNO = '" + orgNo + "' " + StringUtil.join(" OR ", " and (", ")", " and (1 = 0) ", args);
if(StringUtil.isNotBlank(agentID)) { if(StringUtil.isNotBlank(agentID)) {
sql += " and t.nAgentID = "+agentID+" "; sql += " and t.nAgentID = "+agentID+" ";
} }
......
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