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

1

parent 643decc2
......@@ -187,8 +187,8 @@ public class OrderController {
public String paySuccess(BigDecimal nPayAmount, String sOpenID, String sTransTraceNO, String sOutTradeNO) {
try {
String[] ary = sOutTradeNO.split("_", 2);
orderService.paySuccess(ary[0], nPayAmount, sOpenID, sTransTraceNO, sOutTradeNO, new Date());
return Rjx.jsonOk().toJson();
List<Map<String, Object>> result = orderService.paySuccess(ary[0], nPayAmount, sOpenID, sTransTraceNO, sOutTradeNO, new Date());
return Rjx.jsonOk().set("list", result).toJson();
} catch (Exception e) {
e.printStackTrace();
return Rjx.jsonErr().setMessage(e.getMessage()).toJson();
......
......@@ -22,7 +22,7 @@ public interface OrderService {
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);
......
......@@ -334,7 +334,9 @@ public class OrderServiceImpl implements OrderService {
}
@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);
nPayAmount = nPayAmount.multiply(new BigDecimal(0.01)).setScale(2, BigDecimal.ROUND_HALF_UP);
......@@ -357,13 +359,11 @@ public class OrderServiceImpl implements OrderService {
jdbcTemplate.update(sql, sqlDesc.getArgs());
jdbcTemplate.update("update tSalesOrder set nOrderStatus = nOrderStatus|32 where sSalesOrderID = ?", sSalesOrderID);
try {
jdbcTemplate.executeMutil("exec Up_Ego_SplitOrderPrd '" + sSalesOrderID + "'");
} catch (UncategorizedSQLException e) {
if(e.getMessage().contains("已拆单")) {
return;
}
throw e;
returnMap = jdbcTemplate.executeMutil("exec Up_Ego_SplitOrderPrd '" + sSalesOrderID + "'").getDatas().get(0);
} catch (Exception e) {
e.printStackTrace();
}
return returnMap;
}
@Override
......@@ -1155,26 +1155,9 @@ public class OrderServiceImpl implements OrderService {
}else if (OutTradeNO.contains("_S")) {
String sql = "exec up_CreateSettlePayCallBack '"+OutTradeNO+"' ,'"+TransactionID+"' , '"+PayCardNO+"' , '"+PayAmount+"' , '"+paydate+"' , '"+PayChannel+"' ";
returnMap = jdbcTemplate.executeMutil(sql).getDatas().get(0);
}else {
try {
String[] ary = OutTradeNO.split("_", 2);
this.paySuccess(ary[0], new BigDecimal(PayAmount), OpenID, TransactionID, OutTradeNO, new Date());
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);
}else {//普通订单
String[] ary = OutTradeNO.split("_", 2);
returnMap = this.paySuccess(ary[0], new BigDecimal(PayAmount), OpenID, TransactionID, OutTradeNO, DateUtil.parse(paydate, DateUtil.FMT_DATE_SECOND));
}
} 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