|
|
|
@ -79,34 +79,41 @@ public class YltController extends Controller {
|
|
|
|
|
String name = thirdPartyStation.getStr("third_party_name");
|
|
|
|
|
//闸机所在车场ID
|
|
|
|
|
int parkId = thirdPartyStation.getInt("third_party_station_id");
|
|
|
|
|
//最小充电费用
|
|
|
|
|
int mini_receivable_total_fee = thirdPartyStation.getInt("mini_receivable_total_fee");
|
|
|
|
|
//最小充电度数
|
|
|
|
|
int mini_charge_ah = thirdPartyStation.getInt("mini_charge_ah");
|
|
|
|
|
|
|
|
|
|
log.info("发现闸机提供商:" + name + ",parkId=" + parkId);
|
|
|
|
|
|
|
|
|
|
//订单信息
|
|
|
|
|
Record dingDanRecord = ym.getOrderByNo(order_no);
|
|
|
|
|
String charge_begin_time = dingDanRecord.getStr("charge_begin_time");//充电开始时间
|
|
|
|
|
String charge_end_time = dingDanRecord.getStr("charge_end_time");//充电结束时间
|
|
|
|
|
int stationId = dingDanRecord.getInt("station_id");//电站ID
|
|
|
|
|
Record ddRecord = ym.getOrderByNo(order_no);
|
|
|
|
|
String charge_begin_time = ddRecord.getStr("charge_begin_time");//充电开始时间
|
|
|
|
|
String charge_end_time = ddRecord.getStr("charge_end_time");//充电结束时间
|
|
|
|
|
int stationId = ddRecord.getInt("station_id");//电站ID
|
|
|
|
|
//获取车场名称
|
|
|
|
|
String stationName = ym.getStationById(stationId).getStr("station_name");
|
|
|
|
|
//设备号
|
|
|
|
|
int deviceId = dingDanRecord.getInt("equipment_id");//充电桩ID
|
|
|
|
|
int deviceId = ddRecord.getInt("equipment_id");//充电桩ID
|
|
|
|
|
//充电桩名称
|
|
|
|
|
String deviceName = ym.getEquipmentById(deviceId).getStr("equipment_name");
|
|
|
|
|
//车位号
|
|
|
|
|
String spaceNo = dingDanRecord.getInt("connector_id").toString();
|
|
|
|
|
String spaceNo = ddRecord.getInt("connector_id").toString();
|
|
|
|
|
//充电量
|
|
|
|
|
String power = dingDanRecord.getDouble("charge_ah").toString();
|
|
|
|
|
Double power = ddRecord.getDouble("charge_ah");
|
|
|
|
|
//电费
|
|
|
|
|
int elecMoney = (int) (dingDanRecord.getDouble("receivable_electric_fee") * 100);
|
|
|
|
|
int elecMoney = (int) (ddRecord.getDouble("receivable_electric_fee") * 100);
|
|
|
|
|
//服务费
|
|
|
|
|
int seviceMoney = (int) (dingDanRecord.getDouble("receivable_service_fee") * 100);
|
|
|
|
|
int seviceMoney = (int) (ddRecord.getDouble("receivable_service_fee") * 100);
|
|
|
|
|
//总费用
|
|
|
|
|
int totalMoney = (int) (dingDanRecord.getDouble("receivable_total_fee") * 100);
|
|
|
|
|
int totalMoney = (int) (ddRecord.getDouble("receivable_total_fee") * 100);
|
|
|
|
|
//本地车场配置减免规则,根据充电时长换算
|
|
|
|
|
int freeType = 1;
|
|
|
|
|
int freeMoney = 0;//免费0元
|
|
|
|
|
int freeTime = 2 * 60 * 60;//2小时
|
|
|
|
|
//
|
|
|
|
|
//必须保证满足最低收费规则
|
|
|
|
|
if(totalMoney>=mini_receivable_total_fee && power>=mini_charge_ah){
|
|
|
|
|
// 科拓闸机
|
|
|
|
|
if ("科拓".equals(name)) {
|
|
|
|
|
JSONObject jo = new JSONObject();
|
|
|
|
|
jo.put("appId", appId);
|
|
|
|
@ -145,6 +152,7 @@ public class YltController extends Controller {
|
|
|
|
|
renderJson(CommonUtil.getRet(true, "已经向科拓闸机平台发送了减免消息!"));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
renderJson(CommonUtil.getRet(false, "发现了一个未知的闸机厂商,请联系开发人员!"));
|
|
|
|
|
}
|
|
|
|
|
}
|