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

需求 #15246

parent 58889776
......@@ -1001,12 +1001,13 @@ public class OrderServiceImpl implements OrderService {
String sql = "select " + " SalesOrderID = a.sSalesOrderID, " + " SubOrderID = a.sSubOrderID, "
+ " OrderDate = a.dOrderDate, " + " SalesOrderTypeID = a.sSalesOrderTypeID,"
+ " SalesOrderType = a.sSalesOrderType," + " TotalSaleQty = a.nTotalSaleQty,"
+ " TotalSaleAmount = a.nTotalSaleAmount," + " TotalDisAmount = a.nTotalDisAmount,"
+ " SalesOrderType = a.sSalesOrderType," + " TotalSaleQty = sum(b.nSaleQty/b.nOrderRate),"
+ " TotalSaleAmount = sum(b.nSaleAmount)," + " TotalDisAmount = sum(b.nDisAmount),"
+ " DeliveryTypeID = a.sDeliveryTypeID," + " DeliveryType = a.sDeliveryType,"
+ " Contacts = a.sContacts," + " Mobile = a.sMobile," + " Address = a.sAddress,"
+ " 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 + "' ";
if (refundStatus == 1) { /* 查询指定状态订单:1=申请售后 */
......@@ -1025,6 +1026,11 @@ public class OrderServiceImpl implements OrderService {
sql += " and a.sSalesOrderTypeID = '2' " + " and isnull(a.sOldSubOrderID,'') <> '' "
+ " 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);
sortList.addAll(orderList);
......@@ -1062,15 +1068,16 @@ public class OrderServiceImpl implements OrderService {
+ " GoodsID = a.nGoodsID," + " GoodsNO = ag.sGoodsNO,"
+ " GoodsDesc = a.sGoodsDesc," + " Spec = ag.sSpec,"
+ " Unit = a.sUnit,"
+ " SaleQty = case when b.sSalesOrderTypeID = '0' then a.nSaleQty else 0 end,"
+ " SalePrice = a.nSalePrice," + " RealSalePrice = ag.nRealSalePrice,"
+ " SaleQty = case when b.sSalesOrderTypeID = '0' then a.nSaleQty/a.nOrderRate else 0 end, "
+ " SalePrice = a.nSalePrice*a.nOrderRate, "
+ " RealSalePrice = a.nSalePrice*a.nOrderRate, "
+ " SaleAmount = case when b.sSalesOrderTypeID = '0' then a.nSaleAmount 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)),"
+ " OriginaSaleAmount = a.nSaleAmount+a.nDisAmount," + " ISGift = a.nTag&1,"
+ " PromoPaperNO = a.sPromoPaperNO," + " PromoActionTypeID = a.sPromoActionTypeID,"
+ " ReturnQty = case when b.sSalesOrderTypeID = '0' then isnull(a.nReturnQty,0) else abs(a.nSendQty) end,"
+ " LeftRefundQty = case when b.sSalesOrderTypeID = '0' then a.nSendQty - isnull(a.nReturnQty,0) else 0 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))/a.nOrderRate else 0 end, "
+ " Memo = a.sMemo," + " Tag = a.nTag,"
+ " GoodsURL = gp.sURL "
+ " 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