diff --git a/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/dto/CDChargeOrderInfo4BonusReq.java b/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/dto/CDChargeOrderInfo4BonusReq.java index eb01d1fb..e6a64bc4 100644 --- a/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/dto/CDChargeOrderInfo4BonusReq.java +++ b/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/dto/CDChargeOrderInfo4BonusReq.java @@ -96,7 +96,7 @@ public class CDChargeOrderInfo4BonusReq { this.totalElecMoney = xhpcHistoryOrder.getTotalPrice().doubleValue(); this.totalSeviceMoney = xhpcHistoryOrder.getServicePriceTotal().doubleValue(); this.totalMoney = xhpcHistoryOrder.getTotalPrice().doubleValue(); - this.stopReason = xhpcHistoryOrder.getStopReasonEvcs(); + //this.stopReason = xhpcHistoryOrder.getStopReasonEvcs(); this.sumPeriod = xhpcHistoryOrder.getXhpcStatisticsTimeIntervalList().size(); this.chargeDetails = translate(xhpcHistoryOrder.getXhpcStatisticsTimeIntervalList()); this.userName = xhpcHistoryOrder.getUserNameEvcs(); diff --git a/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/dto/ChargeOrderInfo.java b/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/dto/ChargeOrderInfo.java index be35422e..2004b987 100644 --- a/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/dto/ChargeOrderInfo.java +++ b/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/dto/ChargeOrderInfo.java @@ -95,7 +95,7 @@ public class ChargeOrderInfo { this.totalElecMoney = xhpcHistoryOrder.getPowerPriceTotal().doubleValue(); this.totalSeviceMoney = xhpcHistoryOrder.getServicePriceTotal().doubleValue(); this.totalMoney = xhpcHistoryOrder.getTotalPrice().doubleValue(); - this.stopReason = xhpcHistoryOrder.getStopReasonEvcs(); + //this.stopReason = xhpcHistoryOrder.getStopReasonEvcs(); this.sumPeriod = xhpcHistoryOrder.getXhpcStatisticsTimeIntervalList().size(); this.chargeDetails = calcemChargeDetails;//translate(xhpcHistoryOrder.getXhpcStatisticsTimeIntervalList()); Date starttime = xhpcHistoryOrder.getStartTime(); @@ -122,7 +122,7 @@ public class ChargeOrderInfo { this.totalSeviceMoney = servicePriceTotal == null ? 0.0 : servicePriceTotal.doubleValue(); final BigDecimal totalPrice = xhpcHistoryOrder.getTotalPrice(); this.totalMoney = totalPrice == null ? 0.0 : totalPrice.doubleValue(); - this.stopReason = xhpcHistoryOrder.getStopReasonEvcs(); + //this.stopReason = xhpcHistoryOrder.getStopReasonEvcs(); final List xhpcStatisticsTimeIntervalList = xhpcHistoryOrder.getXhpcStatisticsTimeIntervalList(); this.sumPeriod = xhpcStatisticsTimeIntervalList == null ? 0 : xhpcStatisticsTimeIntervalList.size(); diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/api/QueryStartChargeController.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/api/QueryStartChargeController.java index ed558aad..98b705ec 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/api/QueryStartChargeController.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/api/QueryStartChargeController.java @@ -136,7 +136,7 @@ public class QueryStartChargeController { emptyHorder.setEndTime(now); emptyHorder.setCreateTime(now); emptyHorder.setUpdateTime(now); - emptyHorder.setStopReasonEvcs(9); + emptyHorder.setStopReasonEvcs("平台停止"); String sn = genOrder(connectorId); etOrderMapping.setXhOrderNo(sn); emptyHorder.setSerialNumber(sn); diff --git a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/controller/XhpcActivityInternetController.java b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/controller/XhpcActivityInternetController.java index dcc26eba..8fadfd63 100644 --- a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/controller/XhpcActivityInternetController.java +++ b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/controller/XhpcActivityInternetController.java @@ -103,13 +103,4 @@ public class XhpcActivityInternetController extends BaseController { return R.ok(internetService.deleteByPk(activityId)); } - @GetMapping("/getActivityStationTime") - public R getActivityStationTime(Long internetUserId,String startTime,String endTime,Long chargingStationId,String tenantId){ - return R.ok(internetService.getActivityStationTime(internetUserId, startTime,endTime, chargingStationId, tenantId)); - } - - @GetMapping("/getActivityFormulaTime") - public R getActivityFormulaTime(Integer activityId,String startTime,String endTime){ - return R.ok(internetService.getActivityFormulaTime(activityId, startTime, endTime)); - } } diff --git a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/mapper/XhpcActivityFormulaMapper.java b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/mapper/XhpcActivityFormulaMapper.java index e64d50bd..a3d9031d 100644 --- a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/mapper/XhpcActivityFormulaMapper.java +++ b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/mapper/XhpcActivityFormulaMapper.java @@ -19,9 +19,4 @@ public interface XhpcActivityFormulaMapper { List selectByActivityId(Integer activityId); int deleteByActivityId(Integer activityId); - - /** - * 查询该时段的计费公式 - */ - List getActivityFormulaTime(@Param("activityId") Integer activityId,@Param("startTime") String startTime,@Param("endTime") String endTime); } \ No newline at end of file diff --git a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/mapper/XhpcActivityInternetMapper.java b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/mapper/XhpcActivityInternetMapper.java index 2aceda4e..4268fcbb 100644 --- a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/mapper/XhpcActivityInternetMapper.java +++ b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/mapper/XhpcActivityInternetMapper.java @@ -29,9 +29,4 @@ public interface XhpcActivityInternetMapper { List selectByDateBetween(@Param("startTime")String startTime, @Param("endTime")String endTime); - /** - * 查询该时间段是否有流量方活动 - */ - List getActivityStationTime(@Param("internetUserId")Long internetUserId,@Param("startTime")String startTime,@Param("endTime")String endTime,@Param("chargingStationId")Long chargingStationId,@Param("tenantId")String tenantId); - } \ No newline at end of file diff --git a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/XhpcActivityInternetService.java b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/XhpcActivityInternetService.java index 4e6faa32..08a53db2 100644 --- a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/XhpcActivityInternetService.java +++ b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/XhpcActivityInternetService.java @@ -24,15 +24,4 @@ public interface XhpcActivityInternetService { boolean deleteByPk(Integer activityId); - /** - * 查询该时间段是否有流量方活动 - */ - List getActivityStationTime(Long internetUserId,String startTime,String endTime,Long chargingStationId,String tenantId); - - /** - * 查询该时段的计费公式 - */ - List getActivityFormulaTime(Integer activityId,String startTime,String endTime); - - } diff --git a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/impl/XhpcActivityInternetServiceImpl.java b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/impl/XhpcActivityInternetServiceImpl.java index b5e1d0a1..8f1943c9 100644 --- a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/impl/XhpcActivityInternetServiceImpl.java +++ b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/impl/XhpcActivityInternetServiceImpl.java @@ -156,27 +156,4 @@ public class XhpcActivityInternetServiceImpl implements XhpcActivityInternetServ return internetMapper.deleteLogicByPrimaryKey(activityId) > 0; } - /** - * 查询该时间段是否有流量方活动 - * - * @param internetUserId - * @param time - * @param chargingStationId - */ - @Override - public List getActivityStationTime(Long internetUserId,String startTime,String endTime, Long chargingStationId ,String tenantId) { - return internetMapper.getActivityStationTime(internetUserId,startTime,endTime, chargingStationId,tenantId); - } - - /** - * 查询该时段的计费公式 - * - * @param activityId - * @param startTime - * @param endTime - */ - @Override - public List getActivityFormulaTime(Integer activityId, String startTime, String endTime) { - return formulaMapper.getActivityFormulaTime(activityId, startTime, endTime); - } } diff --git a/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcActivityFormulaMapper.xml b/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcActivityFormulaMapper.xml index b95eea16..32459f7e 100644 --- a/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcActivityFormulaMapper.xml +++ b/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcActivityFormulaMapper.xml @@ -87,13 +87,4 @@ where activity_formula_id = #{activityComputeId,jdbcType=BIGINT} - \ No newline at end of file diff --git a/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcActivityInternetMapper.xml b/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcActivityInternetMapper.xml index 0aa9dabd..b07d7bb0 100644 --- a/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcActivityInternetMapper.xml +++ b/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcActivityInternetMapper.xml @@ -140,21 +140,4 @@ where activity_id = #{activityId,jdbcType=INTEGER} - - \ No newline at end of file diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcDownCodeController.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcDownCodeController.java index 56d3a170..2ae0a286 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcDownCodeController.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcDownCodeController.java @@ -27,7 +27,6 @@ public class XhpcDownCodeController extends BaseController { @GetMapping(value = "/listStations") public TableDataInfo listStations(String stationName){ - startPage(); return getDataTable(iXhpcDownCodeService.listStations(stationName)); } diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcDownCodeMapper.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcDownCodeMapper.java index 66f25fdd..1bac48e1 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcDownCodeMapper.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcDownCodeMapper.java @@ -14,7 +14,7 @@ import java.util.Map; @Mapper public interface XhpcDownCodeMapper { - List> selectStationsBy(@Param(value = "stationName") String stationName,@Param("tenantId") String tenantId); + List> selectStationsBy(@Param(value = "stationName") String stationName,@Param("type") Integer type,@Param("userId") Long userId,@Param("tenantId") String tenantId); List> selectPilesBy(@Param(value = "stationId") Long stationId); diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcDownCodeServiceImpl.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcDownCodeServiceImpl.java index ce94247e..7677c1c0 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcDownCodeServiceImpl.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcDownCodeServiceImpl.java @@ -2,7 +2,10 @@ package com.xhpc.charging.station.service; import com.xhpc.charging.station.mapper.XhpcDownCodeMapper; import com.xhpc.charging.station.utils.img.DownMaterialUtil; +import com.xhpc.common.core.web.service.BaseService; import com.xhpc.common.security.service.TokenService; +import com.xhpc.common.util.UserTypeUtil; +import com.xhpc.system.api.domain.SysUser; import com.xhpc.system.api.model.LoginUser; import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFRow; @@ -17,6 +20,7 @@ import org.springframework.stereotype.Service; import java.io.File; import java.io.FileOutputStream; import java.io.OutputStream; +import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -26,7 +30,7 @@ import java.util.Map; * Date:2021-09-30 15 */ @Service -public class XhpcDownCodeServiceImpl implements IXhpcDownCodeService { +public class XhpcDownCodeServiceImpl extends BaseService implements IXhpcDownCodeService { @Autowired private XhpcDownCodeMapper xhpcDownCodeMapper; @@ -41,7 +45,25 @@ public class XhpcDownCodeServiceImpl implements IXhpcDownCodeService { @Override public List> listStations(String stationName) { LoginUser loginUser = tokenService.getLoginUser(); - return xhpcDownCodeMapper.selectStationsBy(stationName,loginUser.getTenantId()); + List> list =new ArrayList<>(); + SysUser sysUser = loginUser.getSysUser(); + String tenantId = loginUser.getTenantId(); + Long sysUserId = sysUser.getUserId(); + if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){ + startPage(); + if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){ + Long logOperatorId = sysUser.getOperatorId(); + //运营商看自己的场站 + list = xhpcDownCodeMapper.selectStationsBy(stationName,1,logOperatorId,loginUser.getTenantId()); + }else{ + //查询赋值的场站 + list = xhpcDownCodeMapper.selectStationsBy(stationName,2,sysUserId,loginUser.getTenantId()); + } + }else{ + startPage(); + list = xhpcDownCodeMapper.selectStationsBy(stationName,0,sysUserId,loginUser.getTenantId()); + } + return list; } @Override diff --git a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcDownCodeMapper.xml b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcDownCodeMapper.xml index 75c54f4e..cc053231 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcDownCodeMapper.xml +++ b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcDownCodeMapper.xml @@ -18,6 +18,12 @@ and xcs.tenant_id =#{tenantId} + + and xcs.charging_station_id in (select charging_station_id from xhpc_charging_station where operator_id=#{userId}) + + + and xcs.charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{userId}) + group by xcs.charging_station_id, xcs.name, xo.name diff --git a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/DateUtil.java b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/DateUtil.java index 303d37fe..dfc352fc 100644 --- a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/DateUtil.java +++ b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/DateUtil.java @@ -5,6 +5,7 @@ package com.xhpc.common.util; import cn.hutool.Hutool; import cn.hutool.core.date.DateField; import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUnit; import java.math.BigDecimal; import java.text.DateFormat; @@ -496,9 +497,38 @@ public class DateUtil { // DateUtil.isWeekend(DateUtil.string2Date("2016-06-12", "yyyy-MM-dd")); // DateUtil.isWeekend(DateUtil.string2Date("2016-06-13", "yyyy-MM-dd")); // DateUtil.isWeekend(DateUtil.string2Date("2016-06-14", "yyyy-MM-dd")); - String data = DateUtil.week(new Date()); +// String data = DateUtil.week(new Date()); +// +// System.out.println("data"+data); +// +// String dateStr = "2017-03-01 22:33:23"; +// Date date = cn.hutool.core.date.DateUtil.parse(dateStr); +// +// String formatDate = cn.hutool.core.date.DateUtil.formatDate(date); +// System.out.println("formatDate:"+formatDate); +// +// +// //跨天 +// DateTime tomorrow = cn.hutool.core.date.DateUtil.offsetDay(date,1); +// Date startTime3 = cn.hutool.core.date.DateUtil.beginOfDay(tomorrow); +// //yyyy-mm-dd +// String parse2 = cn.hutool.core.date.DateUtil.formatDate(startTime3); +// System.out.println("parse2:"+parse2); + String dateStr1 = "2017-03-01 22:33:23"; + Date date1 = cn.hutool.core.date.DateUtil.parse(dateStr1); + + String dateStr2 = "2017-04-01 20:33:23"; + Date date2 =cn.hutool.core.date.DateUtil.parse(dateStr2); + + long between = cn.hutool.core.date.DateUtil.between(date1, date2, DateUnit.MINUTE); + + String formatDate = cn.hutool.core.date.DateUtil.format(date2, "yyyy-MM-dd HH:mm:ss"); + System.out.println("formatDate:"+formatDate); + + + + - System.out.println("data"+data); } } diff --git a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/order/domain/XhpcHistoryOrder.java b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/order/domain/XhpcHistoryOrder.java index a353e985..d63c5d4d 100644 --- a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/order/domain/XhpcHistoryOrder.java +++ b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/order/domain/XhpcHistoryOrder.java @@ -164,6 +164,21 @@ public class XhpcHistoryOrder extends BaseEntity { */ private BigDecimal servicePriceTotal; + /** + * 活动总电费 + */ + private BigDecimal activityPowerPriceTotal; + + /** + * 活动总服务费 + */ + private BigDecimal activityServicePriceTotal; + + /** + * 活动总金额 + */ + private BigDecimal activityTotalPrice; + /** * 0未统计 1已统计 */ @@ -193,7 +208,7 @@ public class XhpcHistoryOrder extends BaseEntity { * 4:连接器断开 * 5-99 自定义 */ - private Integer stopReasonEvcs = 0; + private String stopReasonEvcs ; /** * 运营商/场站OperatorID @@ -263,6 +278,11 @@ public class XhpcHistoryOrder extends BaseEntity { */ private Integer source; + /** + * 活动id + */ + private String activityId; + public Integer getConfirmResult() { return confirmResult; @@ -626,12 +646,12 @@ public class XhpcHistoryOrder extends BaseEntity { this.startTime = startTime; } - public Integer getStopReasonEvcs() { + public String getStopReasonEvcs() { - return stopReasonEvcs == null ? 0 : stopReasonEvcs; + return stopReasonEvcs = stopReasonEvcs; } - public void setStopReasonEvcs(Integer stopReasonEvcs) { + public void setStopReasonEvcs(String stopReasonEvcs) { this.stopReasonEvcs = stopReasonEvcs; } @@ -739,4 +759,40 @@ public class XhpcHistoryOrder extends BaseEntity { public void setSource(Integer source) { this.source = source; } + + public BigDecimal getActivityPowerPriceTotal() { + return activityPowerPriceTotal; + } + + public void setActivityPowerPriceTotal(BigDecimal activityPowerPriceTotal) { + this.activityPowerPriceTotal = activityPowerPriceTotal; + } + + public BigDecimal getActivityServicePriceTotal() { + return activityServicePriceTotal; + } + + public void setActivityServicePriceTotal(BigDecimal activityServicePriceTotal) { + this.activityServicePriceTotal = activityServicePriceTotal; + } + + public BigDecimal getActivityTotalPrice() { + return activityTotalPrice; + } + + public void setActivityTotalPrice(BigDecimal activityTotalPrice) { + this.activityTotalPrice = activityTotalPrice; + } + + public void setChargeModelEvcs(Integer chargeModelEvcs) { + this.chargeModelEvcs = chargeModelEvcs; + } + + public String getActivityId() { + return activityId; + } + + public void setActivityId(String activityId) { + this.activityId = activityId; + } } diff --git a/xhpc-modules/xhpc-general/src/main/resources/mapper/XhpcSmsMapper.xml b/xhpc-modules/xhpc-general/src/main/resources/mapper/XhpcSmsMapper.xml index 620290f1..6b2de728 100644 --- a/xhpc-modules/xhpc-general/src/main/resources/mapper/XhpcSmsMapper.xml +++ b/xhpc-modules/xhpc-general/src/main/resources/mapper/XhpcSmsMapper.xml @@ -110,6 +110,7 @@ and phone like concat('%',#{phone},'%') + order by create_time desc @@ -862,18 +879,7 @@ (SELECT account from xhpc_customers_personnel where customers_personnel_id = co.user_id and ho.source=3) as customersAccount, co.Plate_num as plateNum, (SELECT name from xhpc_internet_user where internet_user_id = co.user_id and co.source =1) as internetName, - case when ho.stop_reason_evcs=40 then "APP远程停止" - when ho.stop_reason_evcs=41 then "SOC达到100%" - when ho.stop_reason_evcs=42 then "充电电量满足设定条件" - when ho.stop_reason_evcs=43 then "充电金额满足设定条件" - when ho.stop_reason_evcs=44 then "充电时间满足设定条件" - when ho.stop_reason_evcs=45 then "手动停止充电" - when ho.stop_reason_evcs=46 then "手动停止充电." - when ho.stop_reason_evcs=47 then "手动停止充电.." - when ho.stop_reason_evcs=48 then "急停停止充电" - when ho.stop_reason_evcs=49 then "手动停止充电..." - else "手动停止充电!" - end stopReasonRvcsName + ho.StopReasonEvcs as stopReasonRvcsName from xhpc_history_order ho left join xhpc_charging_station as ct on ct.charging_station_id = ho.charging_station_id left join xhpc_operator as op on op.operator_id = ct.operator_id @@ -947,30 +953,7 @@ co.type AS type, cs. NAME AS chargingStationName, te. NAME AS terminalName, - CASE - WHEN co.type = 40 THEN - "APP远程停止" - WHEN co.type = 41 THEN - "SOC达到100%" - WHEN co.type = 42 THEN - "充电电量满足设定条件" - WHEN co.type = 43 THEN - "充电金额满足设定条件" - WHEN co.type = 44 THEN - "充电时间满足设定条件" - WHEN co.type = 45 THEN - "手动停止充电" - WHEN co.type = 46 THEN - "手动停止充电." - WHEN co.type = 47 THEN - "手动停止充电.." - WHEN co.type = 48 THEN - "急停停止充电" - WHEN co.type = 49 THEN - "手动停止充电..." - ELSE - "手动停止充电!" - END typeName + co.type as typeName from xhpc_charge_order co LEFT JOIN xhpc_terminal AS te ON te.terminal_id = co.terminal_id LEFT JOIN xhpc_charging_station AS cs ON cs.charging_station_id = co.charging_station_id @@ -1128,7 +1111,7 @@ where internet_serial_number = #{internetSerialNumber} - select * from xhpc_history_order where history_order_id=#{historyOrderId} diff --git a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcRealTimeOrderMapper.xml b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcRealTimeOrderMapper.xml index a28e21e5..53d03a69 100644 --- a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcRealTimeOrderMapper.xml +++ b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcRealTimeOrderMapper.xml @@ -649,6 +649,55 @@ limit 1 + + + + + + + + + + + + + \ No newline at end of file diff --git a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml index 286e98db..7339c629 100644 --- a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml +++ b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml @@ -83,7 +83,7 @@ when status=24 then "23:00-24:00" end time from xhpc_statistics_time_interval - where del_flag=0 + where del_flag=0 and total_price >=0 and charging_station_id in @@ -131,7 +131,7 @@ format(sum(act_power_price + act_service_price), 2) actTotalPrice, DATE_FORMAT(create_time,'%Y-%m-%d') createTime from xhpc_statistics_station - where del_flag=0 and type=1 + where del_flag=0 and type=1 and total_price >=0 and charging_station_id in @@ -183,7 +183,7 @@ from xhpc_statistics_station as ss left join xhpc_charging_station as cs on cs.charging_station_id = ss.charging_station_id left join xhpc_operator as op on op.operator_id = ss.operator_id - where ss.del_flag=0 and ss.type=2 + where ss.del_flag=0 and ss.type=2 and ss.total_price >=0 and ss.create_time >= #{startTime} @@ -238,7 +238,7 @@ DATE_FORMAT(ss.create_time,'%Y-%m-%d') createTime from xhpc_statistics_station as ss left join xhpc_operator as op on op.operator_id = ss.operator_id - where ss.del_flag=0 and ss.type=2 + where ss.del_flag=0 and ss.type=2 and ss.total_price >=0 and ss.create_time >= #{startTime} @@ -286,7 +286,7 @@ DATE_FORMAT(ss.create_time,'%Y-%m-%d') createTime from xhpc_statistics_station as ss left join xhpc_internet_user as iu on iu.internet_user_id = ss.internet_user_id - where ss.del_flag=0 and ss.type=2 and ss.internet_user_id is not null + where ss.del_flag=0 and ss.type=2 and ss.internet_user_id is not null and ss.total_price >=0 and ss.create_time >= #{startTime} @@ -334,7 +334,7 @@ from xhpc_statistics_station as ss left join xhpc_charging_station as cs on cs.charging_station_id = ss.charging_station_id left join xhpc_terminal as te on te.terminal_id = ss.terminal_id - where ss.del_flag=0 and ss.type=3 + where ss.del_flag=0 and ss.type=3 and ss.total_price >=0 and ss.create_time >= #{startTime} @@ -376,6 +376,27 @@ + @@ -933,7 +960,7 @@ select count(statistics_station_id) from xhpc_statistics_station where history_order_id=#{historyOrderId} and type=#{type} - SELECT COUNT(status) value, case when status=-1 then "无效订单" @@ -968,6 +995,34 @@ group by status + + + SELECT - sum(total_power) number + IFNULL(sum(total_power),0) number FROM xhpc_history_order WHERE @@ -1098,7 +1153,7 @@ and charging_station_id=#{chargingStationId} - and charging_pile_id=#{chargingPileId} + and terminal_id in (select terminal_id from xhpc_terminal where charging_pile_id=#{chargingPileId}) and charging_station_id in (select charging_station_id from xhpc_charging_station where operator_id=#{logOperatorId}) @@ -1113,7 +1168,7 @@