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

#15246

parent 01d598f1
......@@ -432,17 +432,28 @@ public class OrderServiceImpl implements OrderService {
" sosd.nAvgStockPrice, sosd.nReturnQty, sosd.sReturnTypeID, " +
" sosd.sReturnType, sosd.sRetunReson, sosd.nCaseUnits, sosd.sUnit, " +
" sosd.sChangeUser, sosd.dChangeDate, sosd.dProduceDate, sosd.nTaxRate, " +
" sosd.nExpressFee, sosd.sPromoPaperNO, " +
" nOldSaleQty = case when sosd.nOrderRate > 1 then sosd.nOldSaleQty / sosd.nOrderRate else sosd.nOldSaleQty end, " +
" nOldSalePrice = case when sosd.nOrderRate > 1 then sosd.nOldSalePrice*sosd.nOrderRate else sosd.nOldSalePrice end," +
" sosd.nOldLockedQty, sosd.sSaleUnit, " +
" sosd.nExpressFee, sosd.sPromoPaperNO, sosd.nOldSaleQty, " +
" sosd.nOldSalePrice, sosd.nOldLockedQty, sosd.sSaleUnit, " +
" sosd.nPackQty, sosd.nOrderRate, " +
" PromoSalePrice=CONVERT(NUMERIC(12,2),case when sosd.nSaleQty = 0 then 0 else ROUND((sosd.nSaleAmount)/sosd.nSaleQty,2) end)," +
" OriginaSaleAmount=sosd.nSaleAmount+sosd.nDisAmount," +
" ISGift = sosd.nTag&1," +
" agp.sURL " +
"from tSalesOrderSubDtl sosd left join V_GetminAgentGoodsPic agp on agp.nAgentID = sosd.nAgentID and agp.nGoodsID = sosd.nGoodsID and agp.sPicTypeID = 1" +
"where sosd.sSubOrderID = ? ";
" nOldSaleQty = case when sosd.nOrderRate > 1 then sosd.nOldSaleQty / sosd.nOrderRate else sosd.nOldSaleQty end,  " +
" nOldSalePrice = case when sosd.nOrderRate > 1 then sosd.nOldSalePrice*sosd.nOrderRate else sosd.nOldSalePrice end, "+
" PromoSalePrice = CONVERT(NUMERIC(12,2),ROUND((sosd.nSaleAmount)/sosd.nSaleQty,2)), " +
" OriginaSaleAmount = sosd.nSaleAmount,sosd.nDisAmount, ISGift = sosd.nTag&1, " +
" LeftReturnQty = case when sosd.nOrderRate > 1 then (sosd.nSendQty - isnull(sosd.nReturnQty,0)) / sosd.nOrderRate else sosd.nSendQty - isnull(sosd.nReturnQty,0) end, " +
" 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);
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