Commit dec725a4 authored by 张永's avatar 张永

1

parent 097982bf
......@@ -333,7 +333,6 @@ public class OrderServiceImpl implements OrderService {
System.out.println(nPayAmount);
}
@Override
@Transactional
public void paySuccess(String sSalesOrderID, BigDecimal nPayAmount, String sOpenID, String sTransTraceNO, String sOutTradeNO, Date dPayDateTime) {
Integer nIdx = jdbcTemplate.queryForInt("select ISNULL(MAX(nIdx),0) from tSalesOrderPay where sSalesOrderID = ?", sSalesOrderID);
......@@ -1138,6 +1137,7 @@ public class OrderServiceImpl implements OrderService {
//回调标记已补款
public List<Map<String, Object>> payCallback(WxPayResponse postData) {
List<Map<String, Object>> returnMap = new ArrayList<Map<String, Object>>();
try {
String OutTradeNO = postData.getOut_trade_no();
String TransactionID = postData.getTransaction_id();
......@@ -1145,8 +1145,9 @@ public class OrderServiceImpl implements OrderService {
String PayAmount= postData.getTotal_fee().toString();
String PayDate = postData.getTime_end();
String PayChannel = postData.getPay_type();
String OpenID = postData.getOpenid();
String paydate = DateUtil.format(DateUtil.parse(PayDate,DateUtil.FMT_YYYYMMddHHMMSS),DateUtil.FMT_DATE_SECOND);
logger.info("支付回调单号: ",OutTradeNO);
//补款后缀是_D,结算单后缀是_S
if(OutTradeNO.contains("_D")) {
String sql = "exec up_B2BSalesOrderDebtPayCallBack '"+OutTradeNO+"' ,'"+TransactionID+"' , '"+PayCardNO+"' , '"+PayAmount+"' , '"+paydate+"' , '"+PayChannel+"' ";
......@@ -1155,7 +1156,25 @@ public class OrderServiceImpl implements OrderService {
String sql = "exec up_CreateSettlePayCallBack '"+OutTradeNO+"' ,'"+TransactionID+"' , '"+PayCardNO+"' , '"+PayAmount+"' , '"+paydate+"' , '"+PayChannel+"' ";
returnMap = jdbcTemplate.executeMutil(sql).getDatas().get(0);
}else {
logger.info("订单号不满足条件(补款后缀是_D,结算单后缀是_S )回调失败 ,{} ",OutTradeNO);
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);
}
} 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