Commit 74cf2737 authored by 韩旭's avatar 韩旭

增加了OriginaSaleAmount字段输出

parent 8b836712
......@@ -176,7 +176,7 @@ public class OrderServiceImpl implements OrderService {
List<Map<String, Object>> orderList = jdbcTemplate.limit(sql, page);
if(orderList.size() > 0) {
List<String> orderIds = orderList.stream().map(o-> (String)o.get("sSalesOrderID")).collect(Collectors.toList());
String sql2 = "select sod.*,PromoSalePrice=CONVERT(NUMERIC(12,2),ROUND((sod.nSaleAmount-sod.nDisAmount)/sod.nSaleQty,2)),RealSaleAmount=sod.nSaleAmount-sod.nDisAmount,ISGift = sod.nTag&1,agp.sURL "
String sql2 = "select sod.*,PromoSalePrice=CONVERT(NUMERIC(12,2),ROUND((sod.nSaleAmount)/sod.nSaleQty,2)),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 in (" + StringUtil.join("', '", "'", "'", orderIds) + ")";
List<Map<String, Object>> orderDtlList = jdbcTemplate.queryForList(sql2);
......@@ -190,7 +190,7 @@ public class OrderServiceImpl implements OrderService {
List<Map<String, Object>> subList = jdbcTemplate.queryForList(sql3);
if(subList.size() > 0) {
List<String> subIds = subList.stream().map(o-> (String)o.get("sSubOrderID")).collect(Collectors.toList());
String sql4 = "select sosd.*,PromoSalePrice=CONVERT(NUMERIC(12,2),ROUND((sosd.nSaleAmount-sosd.nDisAmount)/sosd.nSaleQty,2)),RealSaleAmount=sosd.nSaleAmount-sosd.nDisAmount,ISGift = sosd.nTag&1,"
String sql4 = "select sosd.*,PromoSalePrice=CONVERT(NUMERIC(12,2),ROUND((sosd.nSaleAmount)/sosd.nSaleQty,2)),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 in (" + StringUtil.join("', '", "'", "'", subIds) + ")";
List<Map<String, Object>> subDtlList = jdbcTemplate.queryForList(sql4);
......@@ -221,7 +221,7 @@ public class OrderServiceImpl implements OrderService {
}
List<Map<String, Object>> orderDtlList = new ArrayList<Map<String, Object>>();
if(orderMap.size() > 0) {
String sql2 = "select sod.*,sos.nSendQty, PromoSalePrice=CONVERT(NUMERIC(12,2),ROUND((sod.nSaleAmount-sod.nDisAmount)/sod.nSaleQty,2)),RealSaleAmount=sod.nSaleAmount-sod.nDisAmount,ISGift = sod.nTag&1,"
String sql2 = "select sod.*,sos.nSendQty, PromoSalePrice=CONVERT(NUMERIC(12,2),ROUND((sod.nSaleAmount)/sod.nSaleQty,2)),OriginaSaleAmount=sod.nSaleAmount+sod.nDisAmount,ISGift = sod.nTag&1,"
+ " agp.sURL, pm.sPromoTheme, pm.sPromoActionType sPromoType, pm.sPromoActionTypeID sPromoTypeID "
+ " from tSalesOrderDtl sod left join tYWPromoMain pm on pm.sPromoPaperNO = sod.sPromoPaperNO "
+ " left join V_GetminAgentGoodsPic agp on agp.nAgentID = sod.nAgentID and agp.nGoodsID = sod.nGoodsID and agp.sPicTypeID = 1"
......@@ -322,7 +322,7 @@ public class OrderServiceImpl implements OrderService {
List<Map<String, Object>> subList = jdbcTemplate.queryForList(sql, salesOrderId);
if(subList.size() > 0) {
List<String> subIds = subList.stream().map(o-> (String)o.get("sSubOrderID")).collect(Collectors.toList());
String sql2 = "select sosd.*,PromoSalePrice=CONVERT(NUMERIC(12,2),ROUND((sosd.nSaleAmount-sosd.nDisAmount)/sosd.nSaleQty,2)),RealSaleAmount=sosd.nSaleAmount-sosd.nDisAmount,ISGift = sosd.nTag&1,"
String sql2 = "select sosd.*,PromoSalePrice=CONVERT(NUMERIC(12,2),ROUND((sosd.nSaleAmount)/sosd.nSaleQty,2)),OriginaSaleAmount=sosd.nSaleAmount+sosd.nDisAmount,ISGift = sosd.nTag&1,"
+ " agp.sURL, pm.sPromoTheme, pm.sPromoActionType sPromoType, pm.sPromoActionTypeID sPromoTypeID "
+ " from tSalesOrderSubDtl sosd left join tYWPromoMain pm on pm.sPromoPaperNO = sosd.sPromoPaperNO left join V_GetminAgentGoodsPic agp on agp.nAgentID = sosd.nAgentID and agp.nGoodsID = sosd.nGoodsID and agp.sPicTypeID = 1"
+ " where sosd.sSubOrderID in (" + StringUtil.join("', '", "'", "'", subIds) + ")";
......@@ -404,7 +404,7 @@ public class OrderServiceImpl implements OrderService {
+ "from tSalesOrder so where so.sSalesOrderID = ?", subOrderMap.get("sSalesOrderID"));
String sql = ""
+ "select "
+ "sosd.*, PromoSalePrice=CONVERT(NUMERIC(12,2),ROUND((sosd.nSaleAmount-sosd.nDisAmount)/sosd.nSaleQty,2)),RealSaleAmount=sosd.nSaleAmount-sosd.nDisAmount,ISGift = sosd.nTag&1, "
+ "sosd.*, PromoSalePrice=CONVERT(NUMERIC(12,2),ROUND((sosd.nSaleAmount)/sosd.nSaleQty,2)),OriginaSaleAmount=sosd.nSaleAmount+sosd.nDisAmount,ISGift = sosd.nTag&1, "
+ "sosd.nSendQty - isnull(sosd.nReturnQty,0) LeftReturnQty, ag.nSaleUnits SaleMulti, ag.sSpec sSpec,"
+ "ag.sGoodTypeID GoodTypeID, "
+ "agp.sURL, "
......@@ -1107,8 +1107,8 @@ public class OrderServiceImpl implements OrderService {
" RealSalePrice = ag.nRealSalePrice," +
" 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.nDisAmount)/a.nSaleQty,2))," +
" RealSaleAmount = a.nSaleAmount-a.nDisAmount," +
" 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," +
......
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