Commit 22c3af96 authored by 张永's avatar 张永

#15246

parent 01d598f1
...@@ -432,17 +432,28 @@ public class OrderServiceImpl implements OrderService { ...@@ -432,17 +432,28 @@ public class OrderServiceImpl implements OrderService {
" sosd.nAvgStockPrice, sosd.nReturnQty, sosd.sReturnTypeID, " + " sosd.nAvgStockPrice, sosd.nReturnQty, sosd.sReturnTypeID, " +
" sosd.sReturnType, sosd.sRetunReson, sosd.nCaseUnits, sosd.sUnit, " + " sosd.sReturnType, sosd.sRetunReson, sosd.nCaseUnits, sosd.sUnit, " +
" sosd.sChangeUser, sosd.dChangeDate, sosd.dProduceDate, sosd.nTaxRate, " + " sosd.sChangeUser, sosd.dChangeDate, sosd.dProduceDate, sosd.nTaxRate, " +
" sosd.nExpressFee, sosd.sPromoPaperNO, " + " sosd.nExpressFee, sosd.sPromoPaperNO, sosd.nOldSaleQty, " +
" nOldSaleQty = case when sosd.nOrderRate > 1 then sosd.nOldSaleQty / sosd.nOrderRate else sosd.nOldSaleQty end, " + " sosd.nOldSalePrice, sosd.nOldLockedQty, sosd.sSaleUnit, " +
" nOldSalePrice = case when sosd.nOrderRate > 1 then sosd.nOldSalePrice*sosd.nOrderRate else sosd.nOldSalePrice end," +
" sosd.nOldLockedQty, sosd.sSaleUnit, " +
" sosd.nPackQty, sosd.nOrderRate, " + " sosd.nPackQty, sosd.nOrderRate, " +
" PromoSalePrice=CONVERT(NUMERIC(12,2),case when sosd.nSaleQty = 0 then 0 else ROUND((sosd.nSaleAmount)/sosd.nSaleQty,2) end)," + " nOldSaleQty = case when sosd.nOrderRate > 1 then sosd.nOldSaleQty / sosd.nOrderRate else sosd.nOldSaleQty end,  " +
" OriginaSaleAmount=sosd.nSaleAmount+sosd.nDisAmount," + " nOldSalePrice = case when sosd.nOrderRate > 1 then sosd.nOldSalePrice*sosd.nOrderRate else sosd.nOldSalePrice end, "+
" ISGift = sosd.nTag&1," + " PromoSalePrice = CONVERT(NUMERIC(12,2),ROUND((sosd.nSaleAmount)/sosd.nSaleQty,2)), " +
" agp.sURL " + " OriginaSaleAmount = sosd.nSaleAmount,sosd.nDisAmount, ISGift = sosd.nTag&1, " +
"from tSalesOrderSubDtl sosd left join V_GetminAgentGoodsPic agp on agp.nAgentID = sosd.nAgentID and agp.nGoodsID = sosd.nGoodsID and agp.sPicTypeID = 1" + " LeftReturnQty = case when sosd.nOrderRate > 1 then (sosd.nSendQty - isnull(sosd.nReturnQty,0)) / sosd.nOrderRate else sosd.nSendQty - isnull(sosd.nReturnQty,0) end, " +
"where sosd.sSubOrderID = ? "; " ag.nSaleUnits SaleMulti, ag.sSpec sSpec," +
" ag.sGoodTypeID GoodTypeID, agp.sURL, pm.sPromoName, pm.sPromoTheme, " +
" pm.sPromoActionType sPromoType, pm.sPromoActionTypeID sPromoTypeID, " +
" BrandID = ag.sBrandID, Brand = ag.sBrand " +
"from tSalesOrderSubDtl sosd left join (select a.sPromoPaperNO, a.sPromoName, a.sPromoTheme, a.sPromoActionTypeID, a.sPromoActionType, b.nGoodsID " +
" from tYWPromoMain a, tYWPromoDtl b " +
" where a.sPromoPaperNO = b.sPromoPaperNO " +
" and a.sPromoPaperNORuleID = b.sPromoPaperNO + isnull(convert(varchar,b.nRuleID),'') " +
" and a.nTag&1=0 " +
" and b.nTag&1=0 " +
" ) pm on pm.sPromoPaperNO = sosd.sPromoPaperNO and pm.nGoodsID = sosd.nGoodsID " +
" left join V_GetminAgentGoodsPic agp on agp.nAgentID = sosd.nAgentID and agp.nGoodsID = sosd.nGoodsID and agp.sPicTypeID = 1 " +
" left join tAgentContractGoods ag on sosd.sAgentContractNO = ag.sAgentContractNO and sosd.nGoodsID = ag.nGoodsID " +
"where sosd.sSubOrderID = ?";
List<Map<String, Object>> dtlList = jdbcTemplate.queryForList(sql, subOrderID); List<Map<String, Object>> dtlList = jdbcTemplate.queryForList(sql, subOrderID);
Map<String, Object> deliver = jdbcTemplate.queryForMap( Map<String, Object> deliver = jdbcTemplate.queryForMap(
......
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