Commit 785da618 authored by 张永's avatar 张永

需求 #14954

parent 2f51b6c5
...@@ -368,22 +368,24 @@ public class OrderServiceImpl implements OrderService { ...@@ -368,22 +368,24 @@ public class OrderServiceImpl implements OrderService {
+ "case when so.nOrderStatus&145 = 144 then '16' when so.nOrderStatus&145 = 128 then '8' when so.nOrderStatus&145 = 0 then '4' when so.nOrderStatus&5 = 4 then '2' else '0' end nOrderStatus, " + "case when so.nOrderStatus&145 = 144 then '16' when so.nOrderStatus&145 = 128 then '8' when so.nOrderStatus&145 = 0 then '4' when so.nOrderStatus&5 = 4 then '2' else '0' end nOrderStatus, "
+ "case when so.nOrderStatus&145 = 144 then '已完成' when so.nOrderStatus&145 = 128 then '配送中' when so.nOrderStatus&145 = 0 then '待发货' when so.nOrderStatus&5 = 4 then '已审核' else '未审核' end sOrderStatusText " + "case when so.nOrderStatus&145 = 144 then '已完成' when so.nOrderStatus&145 = 128 then '配送中' when so.nOrderStatus&145 = 0 then '待发货' when so.nOrderStatus&5 = 4 then '已审核' else '未审核' end sOrderStatusText "
+ "from tSalesOrder so where so.sSalesOrderID = ?", subOrderMap.get("sSalesOrderID")); + "from tSalesOrder so where so.sSalesOrderID = ?", subOrderMap.get("sSalesOrderID"));
String sql = "" + "select " String sql = "select sosd.*, PromoSalePrice=CONVERT(NUMERIC(12,2),ROUND((sosd.nSaleAmount)/sosd.nSaleQty,2)), "
+ "sosd.*, PromoSalePrice=CONVERT(NUMERIC(12,2),ROUND((sosd.nSaleAmount)/sosd.nSaleQty,2)),OriginaSaleAmount=sosd.nSaleAmount+sosd.nDisAmount,ISGift = sosd.nTag&1, " + " OriginaSaleAmount=sosd.nSaleAmount+sosd.nDisAmount, ISGift = sosd.nTag&1, "
+ "sosd.nSendQty - isnull(sosd.nReturnQty,0) LeftReturnQty, ag.nSaleUnits SaleMulti, ag.sSpec sSpec," + " sosd.nSendQty - isnull(sosd.nReturnQty,0) LeftReturnQty, ag.nSaleUnits SaleMulti, ag.sSpec sSpec,"
+ "ag.sGoodTypeID GoodTypeID, " + "agp.sURL, " + "pm.sPromoName, " + "pm.sPromoTheme, " + " ag.sGoodTypeID GoodTypeID, agp.sURL, pm.sPromoName, pm.sPromoTheme, "
+ "pm.sPromoActionType sPromoType, " + "pm.sPromoActionTypeID sPromoTypeID " + " pm.sPromoActionType sPromoType, pm.sPromoActionTypeID sPromoTypeID, "
+ "from tSalesOrderSubDtl sosd " + " BrandID = ag.sBrandID, Brand = ag.sBrand "
+ "left join (select a.sPromoPaperNO, a.sPromoName, a.sPromoTheme, a.sPromoActionTypeID, a.sPromoActionType, b.nGoodsID " + " from tSalesOrderSubDtl sosd "
+ " from tYWPromoMain a, tYWPromoDtl b " + " left join (select a.sPromoPaperNO, a.sPromoName, a.sPromoTheme, a.sPromoActionTypeID, a.sPromoActionType, b.nGoodsID "
+ " where a.sPromoPaperNO = b.sPromoPaperNO " + " from tYWPromoMain a, tYWPromoDtl b "
+ " and a.sPromoPaperNORuleID = b.sPromoPaperNO + isnull(convert(varchar,b.nRuleID),'') " + " where a.sPromoPaperNO = b.sPromoPaperNO "
+ " and a.nTag&1=0 " + " and a.sPromoPaperNORuleID = b.sPromoPaperNO + isnull(convert(varchar,b.nRuleID),'') "
+ " and b.nTag&1=0 " + " and a.nTag&1=0 "
+ " ) pm on pm.sPromoPaperNO = sosd.sPromoPaperNO and pm.nGoodsID = sosd.nGoodsID " + " and b.nTag&1=0 "
+ "left join V_GetminAgentGoodsPic agp on agp.nAgentID = sosd.nAgentID and agp.nGoodsID = sosd.nGoodsID and agp.sPicTypeID = 1 " + " ) pm on pm.sPromoPaperNO = sosd.sPromoPaperNO and pm.nGoodsID = sosd.nGoodsID "
+ "left join tAgentContractGoods ag on sosd.sAgentContractNO = ag.sAgentContractNO and sosd.nGoodsID = ag.nGoodsID " + " left join V_GetminAgentGoodsPic agp on agp.nAgentID = sosd.nAgentID and agp.nGoodsID = sosd.nGoodsID and agp.sPicTypeID = 1 "
+ " where sosd.sSubOrderID = ?"; + " 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(
"SELECT sum(a.nNum) nTotalCount, sum(a.nPrice * a.nNum) nTotalAmount FROM tSalesOrderDeliverSubDtl a where a.sSubOrderID = ?", "SELECT sum(a.nNum) nTotalCount, sum(a.nPrice * a.nNum) nTotalAmount FROM tSalesOrderDeliverSubDtl a where a.sSubOrderID = ?",
......
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