Commit 6a17fb4c authored by 张永's avatar 张永

1

parent 643decc2
...@@ -187,8 +187,8 @@ public class OrderController { ...@@ -187,8 +187,8 @@ public class OrderController {
public String paySuccess(BigDecimal nPayAmount, String sOpenID, String sTransTraceNO, String sOutTradeNO) { public String paySuccess(BigDecimal nPayAmount, String sOpenID, String sTransTraceNO, String sOutTradeNO) {
try { try {
String[] ary = sOutTradeNO.split("_", 2); String[] ary = sOutTradeNO.split("_", 2);
orderService.paySuccess(ary[0], nPayAmount, sOpenID, sTransTraceNO, sOutTradeNO, new Date()); List<Map<String, Object>> result = orderService.paySuccess(ary[0], nPayAmount, sOpenID, sTransTraceNO, sOutTradeNO, new Date());
return Rjx.jsonOk().toJson(); return Rjx.jsonOk().set("list", result).toJson();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
return Rjx.jsonErr().setMessage(e.getMessage()).toJson(); return Rjx.jsonErr().setMessage(e.getMessage()).toJson();
......
...@@ -22,7 +22,7 @@ public interface OrderService { ...@@ -22,7 +22,7 @@ public interface OrderService {
public String getOrderDetail(String salesOrderId); public String getOrderDetail(String salesOrderId);
public void paySuccess(String sSalesOrderID, BigDecimal nPayAmount, String sOpenID, String sTransTraceNO, String sOutTradeNO, Date dPayDateTime); public List<Map<String, Object>> paySuccess(String sSalesOrderID, BigDecimal nPayAmount, String sOpenID, String sTransTraceNO, String sOutTradeNO, Date dPayDateTime);
public String getSubOrderDetail(String subOrderID); public String getSubOrderDetail(String subOrderID);
......
...@@ -334,7 +334,9 @@ public class OrderServiceImpl implements OrderService { ...@@ -334,7 +334,9 @@ public class OrderServiceImpl implements OrderService {
} }
@Transactional @Transactional
public void paySuccess(String sSalesOrderID, BigDecimal nPayAmount, String sOpenID, String sTransTraceNO, String sOutTradeNO, Date dPayDateTime) { public List<Map<String, Object>> paySuccess(String sSalesOrderID, BigDecimal nPayAmount, String sOpenID, String sTransTraceNO, String sOutTradeNO, Date dPayDateTime) {
List<Map<String, Object>> returnMap = new ArrayList<Map<String, Object>>();
Integer nIdx = jdbcTemplate.queryForInt("select ISNULL(MAX(nIdx),0) from tSalesOrderPay where sSalesOrderID = ?", sSalesOrderID); Integer nIdx = jdbcTemplate.queryForInt("select ISNULL(MAX(nIdx),0) from tSalesOrderPay where sSalesOrderID = ?", sSalesOrderID);
nPayAmount = nPayAmount.multiply(new BigDecimal(0.01)).setScale(2, BigDecimal.ROUND_HALF_UP); nPayAmount = nPayAmount.multiply(new BigDecimal(0.01)).setScale(2, BigDecimal.ROUND_HALF_UP);
...@@ -357,13 +359,11 @@ public class OrderServiceImpl implements OrderService { ...@@ -357,13 +359,11 @@ public class OrderServiceImpl implements OrderService {
jdbcTemplate.update(sql, sqlDesc.getArgs()); jdbcTemplate.update(sql, sqlDesc.getArgs());
jdbcTemplate.update("update tSalesOrder set nOrderStatus = nOrderStatus|32 where sSalesOrderID = ?", sSalesOrderID); jdbcTemplate.update("update tSalesOrder set nOrderStatus = nOrderStatus|32 where sSalesOrderID = ?", sSalesOrderID);
try { try {
jdbcTemplate.executeMutil("exec Up_Ego_SplitOrderPrd '" + sSalesOrderID + "'"); returnMap = jdbcTemplate.executeMutil("exec Up_Ego_SplitOrderPrd '" + sSalesOrderID + "'").getDatas().get(0);
} catch (UncategorizedSQLException e) { } catch (Exception e) {
if(e.getMessage().contains("已拆单")) { e.printStackTrace();
return;
}
throw e;
} }
return returnMap;
} }
@Override @Override
...@@ -1155,26 +1155,9 @@ public class OrderServiceImpl implements OrderService { ...@@ -1155,26 +1155,9 @@ public class OrderServiceImpl implements OrderService {
}else if (OutTradeNO.contains("_S")) { }else if (OutTradeNO.contains("_S")) {
String sql = "exec up_CreateSettlePayCallBack '"+OutTradeNO+"' ,'"+TransactionID+"' , '"+PayCardNO+"' , '"+PayAmount+"' , '"+paydate+"' , '"+PayChannel+"' "; String sql = "exec up_CreateSettlePayCallBack '"+OutTradeNO+"' ,'"+TransactionID+"' , '"+PayCardNO+"' , '"+PayAmount+"' , '"+paydate+"' , '"+PayChannel+"' ";
returnMap = jdbcTemplate.executeMutil(sql).getDatas().get(0); returnMap = jdbcTemplate.executeMutil(sql).getDatas().get(0);
}else { }else {//普通订单
try {
String[] ary = OutTradeNO.split("_", 2); String[] ary = OutTradeNO.split("_", 2);
this.paySuccess(ary[0], new BigDecimal(PayAmount), OpenID, TransactionID, OutTradeNO, new Date()); returnMap = this.paySuccess(ary[0], new BigDecimal(PayAmount), OpenID, TransactionID, OutTradeNO, DateUtil.parse(paydate, DateUtil.FMT_DATE_SECOND));
Map<String,Object> map = new HashMap<String,Object>();
map.put("Status", "00");
map.put("ErrorMsg", "回调成功");
map.put("OutTradeNO", OutTradeNO);
map.put("TransactionID", TransactionID);
returnMap.add(map);
} catch (Exception e) {
e.printStackTrace();
Map<String,Object> map = new HashMap<String,Object>();
map.put("Status", "01");
map.put("ErrorMsg", "回调异常");
returnMap.add(map);
}
//logger.info("订单号不满足条件(补款后缀是_D,结算单后缀是_S )回调失败 ,{} ",OutTradeNO);
} }
} catch (Exception e) { } catch (Exception e) {
......
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