|
|
|
@@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.RequestBody; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
import java.text.ParseException; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.HashMap; |
|
|
|
@@ -382,13 +383,24 @@ public class WxCarCallBackController extends BaseController { |
|
|
|
if(StringUtils.isNotBlank(tenantId)) { |
|
|
|
map.put("tenantId", tenantId); |
|
|
|
} |
|
|
|
String paidServiceFee = paramMap.get(ETCPUtil.ETCP_PAID_SERVICE_FEE); |
|
|
|
String fee = paramMap.get(ETCPUtil.ETCP_FEE); |
|
|
|
Date feeTime = null; |
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(etcpTime)) { |
|
|
|
try { |
|
|
|
feeTime = dateFormat.parse(etcpTime); |
|
|
|
} catch (ParseException e) { |
|
|
|
logger.error("解析fee time出错" + etcpTime); |
|
|
|
} |
|
|
|
} |
|
|
|
map.put("plateNumber", carNumber); |
|
|
|
map.put("orderId", orderId); |
|
|
|
map.put("fee", fee); |
|
|
|
map.put("feeTime", etcpTime); |
|
|
|
WxCarCmdLog carCmdLog = wxCarCmdLogService.getByOrderId(map); |
|
|
|
if(carCmdLog != null) { |
|
|
|
logger.error("ETCP order已入库: " + orderId); |
|
|
|
return new Result(EnumETCPCode.SUCCESS.getCode(), EnumETCPCode.SUCCESS.getMessage()); |
|
|
|
logger.error("ETCP order paid 已入库: " + orderId); |
|
|
|
} |
|
|
|
|
|
|
|
Date currentDate = new Date(); |
|
|
|
@@ -396,6 +408,10 @@ public class WxCarCallBackController extends BaseController { |
|
|
|
if(StringUtils.isNotBlank(tenantId)) { |
|
|
|
wxCarCmdLog.setTenantId(tenantId); |
|
|
|
} |
|
|
|
if(carCmdLog != null) { |
|
|
|
// 如果有15分钟的已支付的数据,自动覆盖 |
|
|
|
wxCarCmdLog.setId(carCmdLog.getId()); |
|
|
|
} |
|
|
|
wxCarCmdLog.setVendorType(EnumCarVendor.CAR_ETCP.getCode()); |
|
|
|
wxCarCmdLog.setCmdType(EnumCarCmd.CAR_ETCP_CALLBACK_PAY_MANUAL.getCode()); |
|
|
|
wxCarCmdLog.setCmdJson(JSON.toJSONString(paramMap)); |
|
|
|
@@ -408,16 +424,13 @@ public class WxCarCallBackController extends BaseController { |
|
|
|
return new Result(ErrorCode.DB_FAIL.getCode(), "入库错误" + paramMap.toString()); |
|
|
|
} |
|
|
|
|
|
|
|
String paidServiceFee = paramMap.get(ETCPUtil.ETCP_PAID_SERVICE_FEE); |
|
|
|
String fee = paramMap.get(ETCPUtil.ETCP_FEE); |
|
|
|
|
|
|
|
try { |
|
|
|
// 保存WxCarPayRecord |
|
|
|
WxCarPayRecord record = new WxCarPayRecord(); |
|
|
|
record.setSynId(orderId); |
|
|
|
record.setFee(fee); |
|
|
|
if(StringUtils.isNotBlank(etcpTime)) { |
|
|
|
record.setFeeTime(dateFormat.parse(etcpTime)); |
|
|
|
if(feeTime != null) { |
|
|
|
record.setFeeTime(feeTime); |
|
|
|
} |
|
|
|
record.setPaidServiceFee(paidServiceFee); |
|
|
|
record.setVendorType(wxCarCmdLog.getVendorType()); |
|
|
|
@@ -426,9 +439,10 @@ public class WxCarCallBackController extends BaseController { |
|
|
|
|
|
|
|
WxCarPayRecord query = new WxCarPayRecord(); |
|
|
|
query.setSynId(orderId); |
|
|
|
if(StringUtils.isNotBlank(etcpTime)) { |
|
|
|
query.setFeeTime(dateFormat.parse(etcpTime)); |
|
|
|
if(feeTime != null) { |
|
|
|
query.setFeeTime(feeTime); |
|
|
|
} |
|
|
|
// 缴费时间在15分钟以内,更新之前的数据, ETCP会把之前的缴费自动退款 |
|
|
|
PageInfo<WxCarPayRecord> page = wxCarPayRecordService.findCarPayListByPage(query,1,2); |
|
|
|
if(page != null && page.getList().size() > 0){ |
|
|
|
if(page.getList().size() >= 2){ |
|
|
|
|