Commit 4e0cbebe authored by 张永's avatar 张永

111

parent 9a29262b
......@@ -1760,80 +1760,97 @@ public class OrderServiceImpl implements OrderService {
BigDecimal PayAmount = (BigDecimal)payObj.get("PayAmount");
String OutTradeNO = (String)payObj.get("OutTradeNO");
BigDecimal PayPoint = (BigDecimal)payObj.get("PayPoint");
Date PayDateTime = (Date)payObj.get("PayDateTime");
if(PayDateTime == null) {
Date PayDateTime = null;
if(payObj.containsKey("PayDateTime")) {
PayDateTime = (Date)payObj.get("PayDateTime");
if(PayDateTime == null || PayDateTime.equals("1900-01-01 0:00:00")) {
PayDateTime = now;
}
}else {
PayDateTime = now;
}
String posno = "999";
String cashier = PayCardNO;
String hostname = "localhost";
Number Tag = (Number)payObj.get("Tag");
OutParameter pOrderStatus = new OutParameter(Types.VARCHAR);
/* OutParameter pOrderStatus = new OutParameter(Types.VARCHAR);
OutParameter pOrderStatusName = new OutParameter(Types.VARCHAR);
OutParameter pStatus = new OutParameter(Types.INTEGER);
OutParameter pErrorMsg = new OutParameter(Types.VARCHAR);
*/
String agentId = payObj.get("AgentID")+"";
if(PayTypeID != null && Tag != null && ( PayTypeID.equals("81") || PayTypeID.equals("882") ) && Tag.intValue() == 0) { //优会券和提货券
crmService.couponVerification(shopNO, PayCardNO, salesOrderID, PayAmount, TotalRealSaleAmount, OutTradeNO, goodsList, cashier,"1",PayTypeID,agentId);
jdbcTemplate.exec("exec up_B2BSalesOrderPayConfirm ?, ?, ?, ?, ?, ?, ?, ?, ?, ?", new Object[] {salesOrderID, PayTypeID, PayAmount, shopNO, PayDateTime, OutTradeNO, pOrderStatus, pOrderStatusName, pStatus, pErrorMsg});
Integer rStatus = (Integer)pStatus.getValue();
String rErrorMsg = (String)pErrorMsg.getValue();
String rOrderStatus = (String)pOrderStatus.getValue();
List<Map<String, Object>> returnMap = jdbcTemplate.executeMutil("exec up_B2BSalesOrderPayCallBack ?, ?, ?, ?, ?, ?, ?", new Object[] {OutTradeNO,"",PayAmount,now, PayTypeID, "0", "1"}).getDatas().get(0);
String returnStr = GsonUtil.toJson(returnMap);
logger.info("优惠券回写:{}",returnStr);
Map<String,Object> aMap = returnMap.get(0);
Integer rStatus = (Integer)aMap.get("Status");
String rErrorMsg = (String)aMap.get("ErrorMsg");
String rOrderStatus = (String)aMap.get("OrderStatus");
if(rStatus <= 0 && rOrderStatus.equals("2")) {
payObj.put("Status", rStatus);
payObj.put("ErrorMsg", rErrorMsg);
payObj.put("OrderStatus", rOrderStatus);
payObj.put("OrderStatusName", pOrderStatusName.getValue());
payObj.put("OrderStatusName", aMap.get("OrderStatusName"));
return Rjx.jsonOk().setData(payObj).toJson();
} else if(rStatus > 0) {
payObj.put("Status", 1);
payObj.put("OrderStatus", rOrderStatus);
payObj.put("OrderStatusName", pOrderStatusName.getValue());
payObj.put("OrderStatusName", aMap.get("OrderStatusName"));
payObj.put("ErrorMsg", PayTypeID.equals("81") ? "优惠券核销确认异常" :"提货券核销确认异常" );
return Rjx.jsonOk().setData(payObj).toJson();
}
} else if(PayTypeID != null && Tag != null && PayTypeID.equals("103") && Tag.intValue() == 0) {
crmService.vUpdateMemPoint(0, shopNO, shopNO, PayPoint, OutTradeNO, cashier, hostname, ipaddress);
jdbcTemplate.exec("EXEC up_B2BSalesOrderPayConfirm ?, ?, ?, ?, ?, ?, ?, ?, ?, ?", new Object[] {salesOrderID, PayTypeID, PayAmount, PayCardNO, PayDateTime, OutTradeNO, pOrderStatus, pOrderStatusName, pStatus, pErrorMsg});
Integer rStatus = (Integer)pStatus.getValue();
String rErrorMsg = (String)pErrorMsg.getValue();
String rOrderStatus = (String)pOrderStatus.getValue();
List<Map<String, Object>> returnMap = jdbcTemplate.executeMutil("exec up_B2BSalesOrderPayCallBack ?, ?, ?, ?, ?, ?, ?", new Object[] {OutTradeNO,"",PayAmount,now, PayTypeID, "0", "1"}).getDatas().get(0);
String returnStr = GsonUtil.toJson(returnMap);
logger.info("积分回写:{}",returnStr);
Map<String,Object> aMap = returnMap.get(0);
Integer rStatus = (Integer)aMap.get("Status");
String rErrorMsg = (String)aMap.get("ErrorMsg");
String rOrderStatus = (String)aMap.get("OrderStatus");
if(rStatus <= 0 && rOrderStatus.equals("2")) {
payObj.put("Status", rStatus);
payObj.put("ErrorMsg", rErrorMsg);
payObj.put("OrderStatus", rOrderStatus);
payObj.put("OrderStatusName", pOrderStatusName.getValue());
payObj.put("OrderStatusName", aMap.get("OrderStatusName"));
return Rjx.jsonOk().setData(payObj).toJson();
} else if(rStatus > 0) {
payObj.put("Status", 1);
payObj.put("ErrorMsg", "积分扣减确认异常");
payObj.put("OrderStatus", rOrderStatus);
payObj.put("OrderStatusName", pOrderStatusName.getValue());
payObj.put("OrderStatusName", aMap.get("OrderStatusName"));
return Rjx.jsonOk().setData(payObj).toJson();
}
} else if(PayTypeID != null && Tag != null && PayTypeID.equals("112") && Tag.intValue() == 0) {
crmService.vCardPay(shopNO, shopNO, PayAmount, posno, OutTradeNO, cashier, hostname, ipaddress);
jdbcTemplate.exec("EXEC up_B2BSalesOrderPayConfirm ?, ?, ?, ?, ?, ?, ?, ?, ?, ?", new Object[] {salesOrderID, PayTypeID, PayAmount, PayCardNO, PayDateTime, OutTradeNO, pOrderStatus, pOrderStatusName, pStatus, pErrorMsg});
Integer rStatus = (Integer)pStatus.getValue();
String rErrorMsg = (String)pErrorMsg.getValue();
String rOrderStatus = (String)pOrderStatus.getValue();
List<Map<String, Object>> returnMap = jdbcTemplate.executeMutil("exec up_B2BSalesOrderPayCallBack ?, ?, ?, ?, ?, ?, ?", new Object[] {OutTradeNO,"",PayAmount,now, PayTypeID, "0", "1"}).getDatas().get(0);
String returnStr = GsonUtil.toJson(returnMap);
logger.info("储值余额支付回写:{}",returnStr);
Map<String,Object> aMap = returnMap.get(0);
Integer rStatus = (Integer)aMap.get("Status");
String rErrorMsg = (String)aMap.get("ErrorMsg");
String rOrderStatus = (String)aMap.get("OrderStatus");
if(rStatus <= 0 && rOrderStatus.equals("2")) {
payObj.put("Status", rStatus);
payObj.put("ErrorMsg", rErrorMsg);
payObj.put("OrderStatus", rOrderStatus);
payObj.put("OrderStatusName", pOrderStatusName.getValue());
payObj.put("OrderStatusName",aMap.get("OrderStatusName"));
return Rjx.jsonOk().setData(payObj).toJson();
} else if(rStatus > 0) {
payObj.put("Status", 1);
payObj.put("ErrorMsg", "储值余额支付确认异常");
payObj.put("OrderStatus", rOrderStatus);
payObj.put("OrderStatusName", pOrderStatusName.getValue());
payObj.put("OrderStatusName", aMap.get("OrderStatusName"));
return Rjx.jsonOk().setData(payObj).toJson();
}
} else if(PayTypeID != null && Tag != null && Tag.intValue() == 0 && (PayTypeID.equals("120") ||PayTypeID.equals("121") || PayTypeID.equals("170") || PayTypeID.equals("122") || PayTypeID.equals("130") || PayTypeID.equals("140") || PayTypeID.equals("150") || PayTypeID.equals("900") || PayTypeID.equals("901") || PayTypeID.equals("902") || PayTypeID.equals("903"))) {
......
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