diff --git a/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcClearingHistoryOrderMapper.xml b/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcClearingHistoryOrderMapper.xml
index d7a92373..c0bd2b23 100644
--- a/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcClearingHistoryOrderMapper.xml
+++ b/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcClearingHistoryOrderMapper.xml
@@ -68,32 +68,32 @@
ho.clearing_order_id, ho.charging_station_id, ho.charge_order_id, ho.user_id, ho.terminal_id, ho.serial_number,
- ho.internet_serial_number,
- ifnull(ho.power_price_total, 0) as 'power_price_total',
- ifnull(ho.service_price_total, 0) as 'service_price_total',
- ifnull(ho.total_price, 0) as 'total_price',
- ifnull(ho.promotion_discount, 0) as 'promotion_discount',
- ifnull(ho.act_price, 0) as 'act_price',
- ifnull(ho.act_power_price, 0) as 'act_power_price',
- ifnull(ho.act_service_price, 0) as 'act_service_price',
- ifnull(ho.internet_commission, 0) as 'internet_commission',
- ifnull( ho.internet_svc_commission, 0) as 'internet_svc_commission',
- ifnull(ho.platform_commission, 0) as 'platform_commission',
- ifnull(ho.platform_svc_commisssion, 0) as 'platform_svc_commisssion',
- ifnull(ho.operation_commission, 0) as 'operation_commission',
- ifnull(ho.operation_svc_commission, 0) as 'operation_svc_commission',
- ho.start_soc, ho.end_soc, ho.reconciliation_status, ho.sorting_status, ho.`type`, ho.`status`, ho.del_flag,
- ho.create_time, ho.create_by, ho.update_time, ho.update_by, ho.remark, ho.`state`, ho.vin_normal, ho.search_value,
- ho.operator_id_evcs, ho.charge_model_evcs, ho.connector_power_evcs, ho.meter_value_end_evcs,
- ho.meter_value_start_evcs, ho.operator_id3rdpty_evcs, ho.start_time, ho.end_time, ho.stop_reason_evcs,
- ho.total_power, ho.user_name_evcs, ho.phone, ho.evcs_order_no, ho.confirm_Result, ho.rate_model_id,
- ho.charging_mode,
- ifnull(ho.internet_degree_commission, 0) as 'internet_degree_commission',
- ho.`source`, ho.tenant_id, ho.operator_id, ho.operator_name,
- ho.clearing_checkout_id, ho.check_status, ho.check_by, ho.check_time,
- ifnull(ho.activity_power_price_total, 0) as 'activity_power_price_total',
- ifnull(ho.activity_service_price_total, 0) as 'activity_service_price_total',
- ifnull(ho.activity_total_price, 0) as 'activity_total_price'
+ ho.internet_serial_number,
+ ifnull(ho.power_price_total, 0) as 'power_price_total',
+ ifnull(ho.service_price_total, 0) as 'service_price_total',
+ ifnull(ho.total_price, 0) as 'total_price',
+ ifnull(ho.promotion_discount, 0) as 'promotion_discount',
+ ifnull(ho.act_price, 0) as 'act_price',
+ ifnull(ho.act_power_price, 0) as 'act_power_price',
+ ifnull(ho.act_service_price, 0) as 'act_service_price',
+ ifnull(ho.internet_commission, 0) as 'internet_commission',
+ ifnull( ho.internet_svc_commission, 0) as 'internet_svc_commission',
+ ifnull(ho.platform_commission, 0) as 'platform_commission',
+ ifnull(ho.platform_svc_commisssion, 0) as 'platform_svc_commisssion',
+ ifnull(ho.operation_commission, 0) as 'operation_commission',
+ ifnull(ho.operation_svc_commission, 0) as 'operation_svc_commission',
+ ho.start_soc, ho.end_soc, ho.reconciliation_status, ho.sorting_status, ho.`type`, ho.`status`, ho.del_flag,
+ ho.create_time, ho.create_by, ho.update_time, ho.update_by, ho.remark, ho.`state`, ho.vin_normal, ho.search_value,
+ ho.operator_id_evcs, ho.charge_model_evcs, ho.connector_power_evcs, ho.meter_value_end_evcs,
+ ho.meter_value_start_evcs, ho.operator_id3rdpty_evcs, ho.start_time, ho.end_time, ho.stop_reason_evcs,
+ ho.total_power, ho.user_name_evcs, ho.phone, ho.evcs_order_no, ho.confirm_Result, ho.rate_model_id,
+ ho.charging_mode,
+ ifnull(ho.internet_degree_commission, 0) as 'internet_degree_commission',
+ ho.`source`, ho.tenant_id, ho.operator_id, ho.operator_name,
+ ho.clearing_checkout_id, ho.check_status, ho.check_by, ho.check_time,
+ ifnull(ho.activity_power_price_total, 0) as 'activity_power_price_total',
+ ifnull(ho.activity_service_price_total, 0) as 'activity_service_price_total',
+ ifnull(ho.activity_total_price, 0) as 'activity_total_price'
diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/PileController.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/PileController.java
index 9436d641..d63dba4a 100644
--- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/PileController.java
+++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/PileController.java
@@ -4,21 +4,37 @@ import cn.hutool.core.date.DateUtil;
import com.xhpc.common.api.dto.ChargingStationDto;
import com.xhpc.common.core.domain.R;
import com.xhpc.common.core.utils.HttpUtils;
+import com.xhpc.common.enums.StationDeviceEnum;
+import com.xhpc.pp.domain.XhpcDeviceMessage;
import com.xhpc.pp.logic.RateModelRequestLogic;
+import com.xhpc.pp.logic.RemoteUpgradeDataLogic;
+import com.xhpc.pp.mapper.XhpcDeviceMessageMapper;
import com.xhpc.pp.utils.HexUtils;
import lombok.extern.slf4j.Slf4j;
import org.quickserver.net.server.ClientHandler;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+import javax.annotation.Resource;
import java.io.IOException;
-import java.util.*;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.Date;
+import java.util.Map;
+import java.util.Set;
import java.util.concurrent.TimeUnit;
import static cn.hutool.core.date.DatePattern.NORM_DATETIME_FORMAT;
import static cn.hutool.core.util.NumberUtil.isInteger;
import static com.xhpc.common.data.redis.StaticBeanUtil.REDIS;
import static com.xhpc.common.data.redis.StaticBeanUtil.seqHex;
-import static com.xhpc.pp.controller.ChargingController.*;
+import static com.xhpc.pp.controller.ChargingController.checkPile;
+import static com.xhpc.pp.controller.ChargingController.fmt;
+import static com.xhpc.pp.controller.ChargingController.getRR;
import static com.xhpc.pp.server.ChargingPileBinaryHandler.getTimeBin;
import static com.xhpc.pp.server.ChargingPileServer.getHandler;
import static com.xhpc.pp.server.ChargingPileServer.removeHandler;
@@ -27,6 +43,10 @@ import static com.xhpc.pp.server.ChargingPileServer.removeHandler;
@Slf4j
public class PileController {
+
+ @Resource
+ XhpcDeviceMessageMapper deviceMessageMapper;
+
@PostMapping("pile/whitelist/add/{stationId}/{version}")
public Object addWhitelist(@PathVariable("stationId") Long stationId,
@PathVariable("version") String version,
@@ -133,6 +153,14 @@ public class PileController {
String configTimeReply = pk.concat(".configTimeReply");
REDIS.setCacheObject(configTimeReply, "已下发", 30L, TimeUnit.MINUTES);
r = R.ok("校时校费下发成功.");
+
+ XhpcDeviceMessage deviceMessage = new XhpcDeviceMessage();
+ deviceMessage.setType(StationDeviceEnum.PILE.getCode());
+ deviceMessage.setSerialNumber(pileNo);
+ deviceMessage.setRemark("充电桩计费模型请求");
+ deviceMessage.setStatus(0);
+ deviceMessage.setContent(rsmsg);
+ deviceMessageMapper.insertByDomain(deviceMessage);
} catch (IOException | InterruptedException e) {
r = R.fail("校时|校费下发失败,请重试.");
}
@@ -148,4 +176,67 @@ public class PileController {
return r;
}
+
+ @PostMapping("pile/{pileNo}/softwareUpgrade")
+ public R pileSoftwareUpgrade(@PathVariable("pileNo") String pileNo) {
+
+ String pkey = "pile:".concat(pileNo);
+ Map cachePile = REDIS.getCacheMap(pkey);
+ R