Commit e82e0950 authored by 张永's avatar 张永

需求 #15246

parent c6fca7aa
......@@ -255,26 +255,14 @@ public class OrderServiceImpl implements OrderService {
" nSalePrice = case when sod.nOrderRate > 1 then sod.nSaleAmount / sod.nPackQty else sod.nSalePrice end, sod.nSaleAmount, " +
" sod.nDisAmount, sod.sMemo, sod.dUpdate, sod.nTag, " +
" sod.dLastUpdateTime, sod.sPromoActionTypeID, sod.sPromoActionType, " +
" sod.sPromoPaperNO, sod.nExpressFee, sod.nOldSaleQty, sod.nOldSalePrice, " +
" sod.sPromoPaperNO, sod.nExpressFee, " +
" nOldSaleQty = case when sod.nOrderRate > 1 then sod.nOldSaleQty / sod.nOrderRate else sod.nOldSaleQty end, " +
" nOldSalePrice = case when sod.nOrderRate > 1 then sod.nOldSalePrice * sod.nOrderRate else sod.nOldSalePrice end, " +
" sod.sSaleUnit, sod.nPackQty, sod.nOrderRate," +
" nSendQty = case when sod.nOrderRate > 1 then sos.nSendQty / sod.nOrderRate else sos.nSendQty end, " +
" PromoSalePrice = CONVERT(NUMERIC(12,2),ROUND((sod.nSaleAmount)/sod.nSaleQty,2)), " +
" OriginaSaleAmount = sod.nSaleAmount, sod.nDisAmount, ISGift = sod.nTag&1, " +
" agp.sURL, pm.sPromoName, pm.sPromoTheme, pm.sPromoActionType sPromoType, pm.sPromoActionTypeID sPromoTypeID, " +
" BrandID = ag.sBrandID, Brand = ag.sBrand " +
" from tSalesOrderDtl sod join tAgentGoods ag on sod.nAgentID = ag.nAgentID and sod.nGoodsID = ag.nGoodsID " +
" 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 = sod.sPromoPaperNO and pm.nGoodsID = sod.nGoodsID " +
" left join V_GetminAgentGoodsPic agp on agp.nAgentID = sod.nAgentID and agp.nGoodsID = sod.nGoodsID and agp.sPicTypeID = 1 " +
" left join tSalesOrderSubDtl sos on sos.sSalesOrderID = sod.sSalesOrderID " +
" and sos.sAgentContractNO = sod.sAgentContractNO " +
" and sos.nGoodsID = sod.nGoodsID " +
" and (sos.nTag&1 = sod.nTag&1 or sos.nTag&1-1 = sod.nTag&1-1) " +
" PromoSalePrice=CONVERT(NUMERIC(12,2),case when sod.nSaleQty = 0 then 0 else ROUND((sod.nSaleAmount)/sod.nSaleQty,2) end)," +
" OriginaSaleAmount=sod.nSaleAmount+sod.nDisAmount," +
" ISGift = sod.nTag&1, agp.sURL" +
"from tSalesOrderDtl sod left join V_GetminAgentGoodsPic agp on agp.nAgentID = sod.nAgentID and agp.nGoodsID = sod.nGoodsID and agp.sPicTypeID = 1 " +
"where sod.sSalesOrderID = ? ";
orderDtlList = jdbcTemplate.queryForList(sql2, salesOrderId);
}
......@@ -394,26 +382,17 @@ 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, sosd.nOldSaleQty, " +
" sosd.nOldSalePrice, sosd.nOldLockedQty, sosd.sSaleUnit, " +
" 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.nPackQty, sosd.nOrderRate, " +
" 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 = ?";
" 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 = ? ";
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