Commit aeab625c authored by 张永's avatar 张永

V1.1.2 需求 #15878

parent 5fe8b35b
......@@ -289,33 +289,43 @@ public class OrderServiceImpl implements OrderService {
List<Map<String, Object>> orderDtlList = new ArrayList<Map<String, Object>>();
if (orderMap.size() > 0) { //需求 #15246
String sql2 = "select sod.sSalesOrderID, sod.nIdx, sod.sAgentContractNO, sod.nAgentID, " +
" sod.sWarehouseNO, sod.sBarcode, sod.nGoodsID, sod.sGoodsDesc, " +
" nSaleQty = case when sod.nOrderRate > 1 then sod.nPackQty else sod.nSaleQty end, " +
" 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.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) " +
" where sod.sSalesOrderID = ? ";
String sql2 = "select sod.sSalesOrderID, sod.nIdx, sod.sAgentContractNO, sod.nAgentID, \r\n" +
" sod.sWarehouseNO, sod.sBarcode, sod.nGoodsID, sod.sGoodsDesc, \r\n" +
" nSaleQty = case when sod.nOrderRate > 1 then sod.nPackQty else sod.nSaleQty end, \r\n" +
" nSalePrice = case when sod.nOrderRate > 1 then sod.nSaleAmount / sod.nPackQty else sod.nSalePrice end, sod.nSaleAmount, \r\n" +
" sod.nDisAmount, sod.sMemo, sod.dUpdate, sod.nTag, \r\n" +
" sod.dLastUpdateTime, sod.sPromoActionTypeID, sod.sPromoActionType, \r\n" +
" sod.sPromoPaperNO, sod.nExpressFee, sod.nOldSaleQty, sod.nOldSalePrice, \r\n" +
" sod.sSaleUnit, sod.nPackQty, sod.nOrderRate, \r\n" +
" nSendQty = case when sod.nOrderRate > 1 then sos.nSendQty / sod.nOrderRate else sos.nSendQty end, \r\n" +
" PromoSalePrice = CONVERT(NUMERIC(12,2),ROUND((sod.nSaleAmount)/case when sod.nSaleQty=0 then 1 else sod.nSaleQty end,2)), \r\n" +
" OriginaSaleAmount = sod.nSaleAmount, sod.nDisAmount, ISGift = sod.nTag&1, \r\n" +
" agp.sURL, \r\n" +
" sPromoName = convert(varchar(1000),(stuff((select ';' + sPromoName \r\n" +
" from tYWPromoMain a, tYWPromoDtl b \r\n" +
" where a.sPromoPaperNO = b.sPromoPaperNO \r\n" +
" and a.sPromoPaperNORuleID = b.sPromoPaperNO + isnull(convert(varchar,b.nRuleID),'') \r\n" +
" and a.nTag&1=0 \r\n" +
" and b.nTag&1=0\r\n" +
" and a.sPromoPaperNO = pm.sPromoPaperNO\r\n" +
" and b.nGoodsID = pm.nGoodsID\r\n" +
" for xml path('')),1,1,''))), \r\n" +
" pm.sPromoTheme, pm.sPromoActionType sPromoType, pm.sPromoActionTypeID sPromoTypeID, \r\n" +
" BrandID = ag.sBrandID, Brand = ag.sBrand \r\n" +
"from tSalesOrderDtl sod join tAgentGoods ag on sod.nAgentID = ag.nAgentID and sod.nGoodsID = ag.nGoodsID \r\n" +
" left join (select distinct a.sPromoPaperNO, sPromoName='', a.sPromoTheme, a.sPromoActionTypeID, a.sPromoActionType, b.nGoodsID \r\n" +
" from tYWPromoMain a, tYWPromoDtl b \r\n" +
" where a.sPromoPaperNO = b.sPromoPaperNO \r\n" +
" and a.sPromoPaperNORuleID = b.sPromoPaperNO + isnull(convert(varchar,b.nRuleID),'') \r\n" +
" and a.nTag&1=0 \r\n" +
" and b.nTag&1=0 \r\n" +
" ) pm on pm.sPromoPaperNO = sod.sPromoPaperNO and pm.nGoodsID = sod.nGoodsID \r\n" +
" left join V_GetminAgentGoodsPic agp on agp.nAgentID = sod.nAgentID and agp.nGoodsID = sod.nGoodsID and agp.sPicTypeID = 1 \r\n" +
" left join tSalesOrderSubDtl sos on sos.sSalesOrderID = sod.sSalesOrderID \r\n" +
" and sos.sAgentContractNO = sod.sAgentContractNO \r\n" +
" and sos.nGoodsID = sod.nGoodsID \r\n" +
" and (sos.nTag&1 = sod.nTag&1 or sos.nTag&1-1 = sod.nTag&1-1) \r\n" +
"where sod.sSalesOrderID = ? ";
orderDtlList = jdbcTemplate.queryForList(sql2, salesOrderId);
}
Map<String, Object> payMap = new HashMap<String,Object>();
......@@ -359,18 +369,19 @@ 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.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 (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"
+ " where sosd.sSubOrderID in (" + StringUtil.join("', '", "'", "'", subIds) + ")";
String sql2 = "select sosd.*, PromoSalePrice = CONVERT(NUMERIC(12,2),ROUND((sosd.nSaleAmount)/case when sosd.nSaleQty=0 then 1 else sosd.nSaleQty end,2)), \r\n" +
" OriginaSaleAmount=sosd.nSaleAmount+sosd.nDisAmount,ISGift = sosd.nTag&1,\r\n" +
" agp.sURL, pm.sPromoTheme, pm.sPromoActionType sPromoType, pm.sPromoActionTypeID sPromoTypeID \r\n" +
"from tSalesOrderSubDtl sosd left join (select distinct a.sPromoPaperNO, a.sPromoTheme, a.sPromoActionTypeID, a.sPromoActionType, b.nGoodsID \r\n" +
" from tYWPromoMain a, tYWPromoDtl b \r\n" +
" where a.sPromoPaperNO = b.sPromoPaperNO \r\n" +
" and a.sPromoPaperNORuleID = b.sPromoPaperNO + isnull(convert(varchar,b.nRuleID),'') \r\n" +
" and a.nTag&1=0 \r\n" +
" and b.nTag&1=0\r\n" +
" ) pm on pm.sPromoPaperNO = sosd.sPromoPaperNO and pm.nGoodsID = sosd.nGoodsID\r\n" +
" left join V_GetminAgentGoodsPic agp on agp.nAgentID = sosd.nAgentID and agp.nGoodsID = sosd.nGoodsID and agp.sPicTypeID = 1\r\n" +
"where sosd.sSubOrderID in (" + StringUtil.join("', '", "'", "'", subIds) + ")";
List<Map<String, Object>> subDtlList = jdbcTemplate.queryForList(sql2);
Map<String, List<Map<String, Object>>> subDtlML = Util.listToML(subDtlList, "sSalesOrderID");
for (Map<String, Object> subMap : subList) {
......@@ -418,44 +429,54 @@ public class OrderServiceImpl implements OrderService {
+ "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"));
//需求 #15246
String sql = "select sosd.sSubOrderID, sosd.nIdx, sosd.sSalesOrderID, sosd.sAgentContractNO, " +
" sosd.nAgentID, sosd.sWarehouseNO, sosd.sBarcode, sosd.nGoodsID, sosd.sGoodsDesc, " +
" nSaleQty = case when sosd.nOrderRate > 1 then sosd.nPackQty else sosd.nSaleQty end, " +
" nSalePrice = case when sosd.nOrderRate > 1 then sosd.nSaleAmount/sosd.nPackQty else sosd.nSalePrice end, " +
" sosd.nSaleAmount, " +
" sosd.nDisAmount, " +
" nSendQty = case when sosd.nOrderRate > 1 then sosd.nSendQty / sosd.nOrderRate else sosd.nSendQty end, " +
" sosd.nSendAmount, " +
" nReceiveQty = case when sosd.nOrderRate > 1 then sosd.nReceiveQty / sosd.nOrderRate else sosd.nReceiveQty end, " +
" sosd.nReceiveAmount, " +
" sosd.sMemo, sosd.dUpdate, sosd.nTag, sosd.dLastUpdateTime, " +
" sosd.sPromoActionTypeID, sosd.sPromoActionType, sosd.sOldSubOrderID, " +
" 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.nPackQty, sosd.nOrderRate, " +
" 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, "+
" 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 = ?";
//需求 #15246 需求 #15878
String sql = "select sosd.sSubOrderID, sosd.nIdx, sosd.sSalesOrderID, sosd.sAgentContractNO, \r\n" +
" sosd.nAgentID, sosd.sWarehouseNO, sosd.sBarcode, sosd.nGoodsID, sosd.sGoodsDesc, \r\n" +
" nSaleQty = case when sosd.nOrderRate > 1 then sosd.nPackQty else sosd.nSaleQty end, \r\n" +
" nSalePrice = case when sosd.nOrderRate > 1 then sosd.nSaleAmount/sosd.nPackQty else sosd.nSalePrice end, \r\n" +
" sosd.nSaleAmount, \r\n" +
" sosd.nDisAmount, \r\n" +
" nSendQty = case when sosd.nOrderRate > 1 then sosd.nSendQty / sosd.nOrderRate else sosd.nSendQty end, \r\n" +
" sosd.nSendAmount, \r\n" +
" nReceiveQty = case when sosd.nOrderRate > 1 then sosd.nReceiveQty / sosd.nOrderRate else sosd.nReceiveQty end, \r\n" +
" sosd.nReceiveAmount, \r\n" +
" sosd.sMemo, sosd.dUpdate, sosd.nTag, sosd.dLastUpdateTime, \r\n" +
" sosd.sPromoActionTypeID, sosd.sPromoActionType, sosd.sOldSubOrderID, \r\n" +
" sosd.nAvgStockPrice, sosd.nReturnQty, sosd.sReturnTypeID, \r\n" +
" sosd.sReturnType, sosd.sRetunReson, sosd.nCaseUnits, sosd.sUnit, \r\n" +
" sosd.sChangeUser, sosd.dChangeDate, sosd.dProduceDate, sosd.nTaxRate, \r\n" +
" sosd.nExpressFee, sosd.sPromoPaperNO, sosd.nOldSaleQty, \r\n" +
" sosd.nOldSalePrice, sosd.nOldLockedQty, sosd.sSaleUnit, \r\n" +
" sosd.nPackQty, sosd.nOrderRate, \r\n" +
" nOldSaleQty = case when sosd.nOrderRate > 1 then sosd.nOldSaleQty / sosd.nOrderRate else sosd.nOldSaleQty end, \r\n" +
" nOldSalePrice = case when sosd.nOrderRate > 1 then sosd.nOldSalePrice*sosd.nOrderRate else sosd.nOldSalePrice end, \r\n" +
" PromoSalePrice = CONVERT(NUMERIC(12,2),ROUND((sosd.nSaleAmount)/(case when sosd.nSaleQty=0 then 1 else sosd.nSaleQty end),2)), \r\n" +
" OriginaSaleAmount = sosd.nSaleAmount,sosd.nDisAmount, ISGift = sosd.nTag&1, \r\n" +
" LeftReturnQty = case when sosd.nOrderRate > 1 then (sosd.nSendQty - isnull(sosd.nReturnQty,0)) / sosd.nOrderRate else sosd.nSendQty - isnull(sosd.nReturnQty,0) end, \r\n" +
" ag.nSaleUnits SaleMulti, ag.sSpec sSpec, \r\n" +
" ag.sGoodTypeID GoodTypeID, agp.sURL, \r\n" +
" sPromoName = convert(varchar(1000),(stuff((select ';' + sPromoName \r\n" +
" from tYWPromoMain a, tYWPromoDtl b \r\n" +
" where a.sPromoPaperNO = b.sPromoPaperNO \r\n" +
" and a.sPromoPaperNORuleID = b.sPromoPaperNO + isnull(convert(varchar,b.nRuleID),'') \r\n" +
" and a.nTag&1=0 \r\n" +
" and b.nTag&1=0\r\n" +
" and a.sPromoPaperNO = pm.sPromoPaperNO\r\n" +
" and b.nGoodsID = pm.nGoodsID\r\n" +
" for xml path('')),1,1,''))), \r\n" +
" pm.sPromoTheme, \r\n" +
" pm.sPromoActionType sPromoType, pm.sPromoActionTypeID sPromoTypeID, \r\n" +
" BrandID = ag.sBrandID, Brand = ag.sBrand \r\n" +
"from tSalesOrderSubDtl sosd left join (select distinct a.sPromoPaperNO, a.sPromoTheme, a.sPromoActionTypeID, a.sPromoActionType, b.nGoodsID \r\n" +
" from tYWPromoMain a, tYWPromoDtl b \r\n" +
" where a.sPromoPaperNO = b.sPromoPaperNO \r\n" +
" and a.sPromoPaperNORuleID = b.sPromoPaperNO + isnull(convert(varchar,b.nRuleID),'') \r\n" +
" and a.nTag&1=0 \r\n" +
" and b.nTag&1=0 \r\n" +
" ) pm on pm.sPromoPaperNO = sosd.sPromoPaperNO and pm.nGoodsID = sosd.nGoodsID \r\n" +
" left join V_GetminAgentGoodsPic agp on agp.nAgentID = sosd.nAgentID and agp.nGoodsID = sosd.nGoodsID and agp.sPicTypeID = 1 \r\n" +
" left join tAgentContractGoods ag on sosd.sAgentContractNO = ag.sAgentContractNO and sosd.nGoodsID = ag.nGoodsID \r\n" +
"where sosd.sSubOrderID = ?";
List<Map<String, Object>> dtlList = jdbcTemplate.queryForList(sql, subOrderID);
Map<String, Object> deliver = jdbcTemplate.queryForMap(
......
......@@ -24,6 +24,7 @@
<div id="app">
<el-divider content-position="left">V1.1.2 2023-10-19</el-divider>
<p class="title">1.接口调用日志通过AOP保存到tIdcServicesLogs表中</p>
<p class="title">2.修改 需求 #15878 </p>
<el-divider content-position="left">V1.1.1</el-divider>
<p class="title">1.修改微企付和网商银行的退款回调过程</p>
<el-divider content-position="left">V1.1.0</el-divider>
......
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