Commit 0850230c authored by 张永's avatar 张永

需求 #15246

parent 58889776
...@@ -1001,12 +1001,13 @@ public class OrderServiceImpl implements OrderService { ...@@ -1001,12 +1001,13 @@ public class OrderServiceImpl implements OrderService {
String sql = "select " + " SalesOrderID = a.sSalesOrderID, " + " SubOrderID = a.sSubOrderID, " String sql = "select " + " SalesOrderID = a.sSalesOrderID, " + " SubOrderID = a.sSubOrderID, "
+ " OrderDate = a.dOrderDate, " + " SalesOrderTypeID = a.sSalesOrderTypeID," + " OrderDate = a.dOrderDate, " + " SalesOrderTypeID = a.sSalesOrderTypeID,"
+ " SalesOrderType = a.sSalesOrderType," + " TotalSaleQty = a.nTotalSaleQty," + " SalesOrderType = a.sSalesOrderType," + " TotalSaleQty = sum(b.nSaleQty/b.nOrderRate),"
+ " TotalSaleAmount = a.nTotalSaleAmount," + " TotalDisAmount = a.nTotalDisAmount," + " TotalSaleAmount = sum(b.nSaleAmount)," + " TotalDisAmount = sum(b.nDisAmount),"
+ " DeliveryTypeID = a.sDeliveryTypeID," + " DeliveryType = a.sDeliveryType," + " DeliveryTypeID = a.sDeliveryTypeID," + " DeliveryType = a.sDeliveryType,"
+ " Contacts = a.sContacts," + " Mobile = a.sMobile," + " Address = a.sAddress," + " Contacts = a.sContacts," + " Mobile = a.sMobile," + " Address = a.sAddress,"
+ " ExpressFee = a.nExpressFee," + " OrderStatus = a.nOrderStatus," + " ExpressFee = a.nExpressFee," + " OrderStatus = a.nOrderStatus,"
+ " OrderStatusName = a.nOrderStatusName," + " OrderMemo = a.sOrderMemo" + " from tSalesOrderSub a " + " OrderStatusName = a.nOrderStatusName," + " OrderMemo = a.sOrderMemo" + " "
+ " from tSalesOrderSub a join tSalesOrderSubDtl b on a.sSubOrderID = b.sSubOrderID "
+ " where a.sShopNO = '" + shopNo + "' "; + " where a.sShopNO = '" + shopNo + "' ";
if (refundStatus == 1) { /* 查询指定状态订单:1=申请售后 */ if (refundStatus == 1) { /* 查询指定状态订单:1=申请售后 */
...@@ -1026,6 +1027,11 @@ public class OrderServiceImpl implements OrderService { ...@@ -1026,6 +1027,11 @@ public class OrderServiceImpl implements OrderService {
+ " and a.nOrderStatus&1=0 " + " and a.nOrderStatus&16=16 "; + " and a.nOrderStatus&1=0 " + " and a.nOrderStatus&16=16 ";
} }
sql += " group by a.sSalesOrderID, a.sSubOrderID, a.dOrderDate, a.sSalesOrderTypeID, a.sSalesOrderType, " +
" a.sDeliveryTypeID, a.sDeliveryType, a.sContacts, a.sMobile, a.sAddress, a.nExpressFee, " +
" a.nOrderStatus, a.nOrderStatusName, a.sOrderMemo "
+ " order by a.dOrderDate DESC ";
List<Map<String, Object>> orderList = jdbcTemplate.limit(sql, page); List<Map<String, Object>> orderList = jdbcTemplate.limit(sql, page);
sortList.addAll(orderList); sortList.addAll(orderList);
...@@ -1062,15 +1068,16 @@ public class OrderServiceImpl implements OrderService { ...@@ -1062,15 +1068,16 @@ public class OrderServiceImpl implements OrderService {
+ " GoodsID = a.nGoodsID," + " GoodsNO = ag.sGoodsNO," + " GoodsID = a.nGoodsID," + " GoodsNO = ag.sGoodsNO,"
+ " GoodsDesc = a.sGoodsDesc," + " Spec = ag.sSpec," + " GoodsDesc = a.sGoodsDesc," + " Spec = ag.sSpec,"
+ " Unit = a.sUnit," + " Unit = a.sUnit,"
+ " SaleQty = case when b.sSalesOrderTypeID = '0' then a.nSaleQty else 0 end," + " SaleQty = case when b.sSalesOrderTypeID = '0' then a.nSaleQty/a.nOrderRate else 0 end, "
+ " SalePrice = a.nSalePrice," + " RealSalePrice = ag.nRealSalePrice," + " SalePrice = a.nSalePrice*a.nOrderRate, "
+ " RealSalePrice = a.nSalePrice*a.nOrderRate, "
+ " SaleAmount = case when b.sSalesOrderTypeID = '0' then a.nSaleAmount else 0 end," + " SaleAmount = case when b.sSalesOrderTypeID = '0' then a.nSaleAmount else 0 end,"
+ " DisAmount = case when b.sSalesOrderTypeID = '0' then a.nDisAmount else 0 end," + " DisAmount = case when b.sSalesOrderTypeID = '0' then a.nDisAmount else 0 end,"
+ " PromoSalePrice = CONVERT(NUMERIC(12,2),ROUND((a.nSaleAmount)/a.nSaleQty,2))," + " PromoSalePrice = CONVERT(NUMERIC(12,2),ROUND((a.nSaleAmount)/a.nSaleQty,2)),"
+ " OriginaSaleAmount = a.nSaleAmount+a.nDisAmount," + " ISGift = a.nTag&1," + " OriginaSaleAmount = a.nSaleAmount+a.nDisAmount," + " ISGift = a.nTag&1,"
+ " PromoPaperNO = a.sPromoPaperNO," + " PromoActionTypeID = a.sPromoActionTypeID," + " PromoPaperNO = a.sPromoPaperNO," + " PromoActionTypeID = a.sPromoActionTypeID,"
+ " ReturnQty = case when b.sSalesOrderTypeID = '0' then isnull(a.nReturnQty,0) else abs(a.nSendQty) end," + " ReturnQty = case when b.sSalesOrderTypeID = '0' then isnull(a.nReturnQty,0)/a.nOrderRate else abs(a.nSendQty)/a.nOrderRate end, "
+ " LeftRefundQty = case when b.sSalesOrderTypeID = '0' then a.nSendQty - isnull(a.nReturnQty,0) else 0 end," + " LeftRefundQty = case when b.sSalesOrderTypeID = '0' then (a.nSendQty - isnull(a.nReturnQty,0))/a.nOrderRate else 0 end, "
+ " Memo = a.sMemo," + " Tag = a.nTag," + " Memo = a.sMemo," + " Tag = a.nTag,"
+ " GoodsURL = gp.sURL " + " GoodsURL = gp.sURL "
+ " from tSalesOrderSubDtl a join tSalesOrderSub b on a.sSubOrderID = b.sSubOrderID left join tAgentContractGoods ag on a.nAgentID = ag.nAgentID " + " from tSalesOrderSubDtl a join tSalesOrderSub b on a.sSubOrderID = b.sSubOrderID left join tAgentContractGoods ag on a.nAgentID = ag.nAgentID "
......
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