修改空订单率统计,修改PC端进行停止充电,修改桩停用提示语
This commit is contained in:
parent
133c95d793
commit
98e37b78b6
@ -100,9 +100,11 @@ public class XhpcChargingPileController extends BaseController {
|
||||
@Log(title = "桩-停用", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/updateStatus")
|
||||
public AjaxResult updateStatus(@RequestBody XhpcChargingPile xhpcChargingPile) {
|
||||
if(xhpcChargingPile.getStatus()==1){
|
||||
if(null==xhpcChargingPile.getPrompt() || xhpcChargingPile.getPrompt().length()>50){
|
||||
return AjaxResult.error("桩提示语为空且50字之内");
|
||||
}
|
||||
}
|
||||
return xhpcChargingPileService.updateStatus(xhpcChargingPile.getChargingPileId(), xhpcChargingPile.getStatus(),xhpcChargingPile.getPrompt());
|
||||
}
|
||||
|
||||
|
||||
@ -58,9 +58,11 @@ public class XhpcTerminalController extends BaseController {
|
||||
if(null==xhpcTerminal.getStatus()){
|
||||
return AjaxResult.error("桩数据状态为空");
|
||||
}
|
||||
if(xhpcTerminal.getStatus()==1){
|
||||
if(null==xhpcTerminal.getPrompt() || xhpcTerminal.getPrompt().length()>50){
|
||||
return AjaxResult.error("桩提示语为空且50字之内");
|
||||
}
|
||||
}
|
||||
return xhpcTerminalService.updateStatus(xhpcTerminal.getTerminalId(), xhpcTerminal.getStatus(),xhpcTerminal.getPrompt());
|
||||
}
|
||||
|
||||
|
||||
@ -432,7 +432,7 @@ public class XhpcStatisticsController extends BaseController {
|
||||
* @param type 1 近30天 2上个月 3本月 4.近12月
|
||||
*/
|
||||
@GetMapping("/getWorkHistoryOrderList")
|
||||
public AjaxResult getWorkHistoryOrderList(Long operatorId,Long chargingStationId,Long chargingPileId,Long terminalId,String stopReason,@RequestParam(value = "startTime")String startTime,@RequestParam(value = "endTime")String endTime,Integer type){
|
||||
public AjaxResult getWorkHistoryOrderList(Long operatorId,Long chargingStationId,Long chargingPileId,Long terminalId,String stopReason,@RequestParam(value = "startTime", required = true)String startTime,@RequestParam(value = "endTime", required = true)String endTime,Integer type){
|
||||
return AjaxResult.success(xhpcStatisticsService.getWorkHistoryOrderList(operatorId,chargingStationId,chargingPileId,terminalId,stopReason,startTime,endTime,type));
|
||||
}
|
||||
|
||||
|
||||
@ -54,16 +54,17 @@ public class XhpcStopChargingOrderController extends BaseController {
|
||||
//查询缓存是否该终端在充电
|
||||
Map<String, Object> cacheMap = redisService.getCacheMap("gun:" + serialNumber);
|
||||
|
||||
if(cacheMap!=null){
|
||||
|
||||
Map<String, Object> serialNumberOrder = xhpcChargeOrderService.getSerialNumberOrder(serialNumber);
|
||||
if(cacheMap !=null && serialNumberOrder!=null && serialNumberOrder.get("serialNumber") !=null){
|
||||
if(cacheMap.get("orderkey") !=null){
|
||||
String orderNumber = cacheMap.get("orderkey").toString().substring(6);
|
||||
String orderkey = cacheMap.get("orderkey").toString();
|
||||
String serialNumberOrderMap = serialNumberOrder.get("serialNumber").toString();
|
||||
|
||||
String version ="0A";
|
||||
if(cacheMap.get("version") !=null){
|
||||
version =cacheMap.get("version").toString();
|
||||
}
|
||||
R r = powerPileService.stopCharging(orderNumber, orderkey.substring(0,14), orderkey.substring(0,16), version);
|
||||
R r = powerPileService.stopCharging(serialNumberOrderMap, serialNumberOrderMap.substring(0,14), serialNumberOrderMap.substring(0,16), version);
|
||||
|
||||
if(r.getCode()==200){
|
||||
return AjaxResult.success("停止充电命令已下发");
|
||||
|
||||
@ -226,5 +226,5 @@ public interface XhpcChargeOrderMapper {
|
||||
|
||||
List<Map<String, Object>> select3rdNameBy(@Param(value = "operatorIdEvcs") String operatorIdEvcs);
|
||||
|
||||
|
||||
Map<String,Object> getSerialNumberOrder(@Param("serialNumber")String serialNumber);
|
||||
}
|
||||
|
||||
@ -172,4 +172,7 @@ public interface IXhpcChargeOrderService {
|
||||
R cardStartup(Long userId,String serialNumber,Integer userType,String tenantId, Integer type, String grantOperator,String rateModelId);
|
||||
|
||||
R pileVin(String serialNumber,String vinNumber);
|
||||
|
||||
//根据终端号查询最近的一个在充电的订单
|
||||
Map<String,Object> getSerialNumberOrder(String serialNumber);
|
||||
}
|
||||
|
||||
@ -1059,6 +1059,12 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar
|
||||
return R.fail();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getSerialNumberOrder(String serialNumber) {
|
||||
|
||||
return xhpcChargeOrderMapper.getSerialNumberOrder(serialNumber);
|
||||
}
|
||||
|
||||
public static boolean isValidDate(String str) {
|
||||
try {
|
||||
if (0 != str.length()) {
|
||||
|
||||
@ -725,4 +725,8 @@
|
||||
<select id="getSerialNumberLike" resultType="int">
|
||||
select count(charge_order_id) from xhpc_charge_order where serial_number like concat('%', #{serialNumber}, '%') and charge_order_id > #{chargeOrderId} and status=1
|
||||
</select>
|
||||
|
||||
<select id="getSerialNumberOrder" resultType="map">
|
||||
select max(charge_order_id),serial_number serialNumber from xhpc_charge_order where terminal_id = (select terminal_id from xhpc_terminal where serial_number=#{serialNumber} and del_flag =0)
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -1439,7 +1439,7 @@
|
||||
xcs.`name` name,
|
||||
IFNULL(us.totalOrder,0) totalOrder,
|
||||
IFNULL(us.emptyorder,0) emptyorder,
|
||||
IFNULL(us.emptyOrderRate,0) emptyOrderRate
|
||||
concat(IFNULL(us.emptyOrderRate,0),'%') emptyOrderRate
|
||||
from xhpc_charging_station xcs
|
||||
LEFT JOIN(
|
||||
SELECT
|
||||
@ -1479,6 +1479,7 @@
|
||||
and find_in_set (xh.charging_station_id,(select station_ids from xhpc_work_user where work_user_id=#{logOperatorId}))
|
||||
</if>
|
||||
GROUP BY xcs.charging_station_id) us on us.charging_station_id = xcs.charging_station_id
|
||||
where xcs.del_flag =0
|
||||
GROUP BY xcs.charging_station_id
|
||||
order by xcs.charging_station_id
|
||||
</select>
|
||||
@ -1488,12 +1489,13 @@
|
||||
xte.`name` name,
|
||||
IFNULL(us.totalOrder,0) totalOrder,
|
||||
IFNULL(us.emptyorder,0) emptyorder,
|
||||
IFNULL(us.emptyOrderRate,0) emptyOrderRate
|
||||
concat(IFNULL(us.emptyOrderRate,0),'%') emptyOrderRate
|
||||
from xhpc_terminal xte
|
||||
LEFT JOIN(SELECT
|
||||
COUNT(xh.history_order_id) totalOrder,
|
||||
xt.`name` name,
|
||||
IFNULL(ut.empty,0) emptyorder,
|
||||
xh.terminal_id,
|
||||
concat(format(ifnull(empty/COUNT(xh.history_order_id)*100,0), 2),'%') emptyOrderRate
|
||||
FROM `xhpc_history_order` as xh
|
||||
LEFT JOIN xhpc_charging_station xcs on xcs.charging_station_id =xh.charging_station_id
|
||||
@ -1526,7 +1528,7 @@
|
||||
<if test="status==2">
|
||||
and xh.charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{logOperatorId})
|
||||
</if>
|
||||
GROUP BY xh.terminal_id)
|
||||
GROUP BY xh.terminal_id)us on us.terminal_id = xte.terminal_id
|
||||
where xte.del_flag =0 and xte.charging_station_id = #{chargingStationId}
|
||||
|
||||
GROUP BY xte.terminal_id
|
||||
|
||||
@ -59,7 +59,7 @@ public interface XhpcRechargeOrderMapper {
|
||||
* @param createTimeEnd
|
||||
* @return
|
||||
*/
|
||||
public String sumMoney(@Param("phone")String phone,@Param("rechargeOrderNumber") String rechargeOrderNumber,@Param("status") String status,@Param("createTimeStart") String createTimeStart,@Param("createTimeEnd") String createTimeEnd,@Param("type")Integer type,@Param("source")Integer source,@Param("userId")Integer userId,@Param("tenantId")String tenantId);
|
||||
public Map<String, Object> sumMoney(@Param("phone")String phone,@Param("rechargeOrderNumber") String rechargeOrderNumber,@Param("status") String status,@Param("createTimeStart") String createTimeStart,@Param("createTimeEnd") String createTimeEnd,@Param("type")Integer type,@Param("source")Integer source,@Param("userId")Integer userId,@Param("tenantId")String tenantId,@Param("time1")String time1,@Param("time2")String time2,@Param("time3")String time3,@Param("time4")String time4);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -76,7 +76,7 @@ public interface XhpcRefundOrderMapper {
|
||||
* @param createTimeEnd
|
||||
* @return
|
||||
*/
|
||||
public String sumMoney(@Param("phone") String phone, @Param("refundOrderNumber") String refundOrderNumber, @Param("status") String status, @Param("createTimeStart") String createTimeStart, @Param("createTimeEnd") String createTimeEnd,@Param("type")Integer type,@Param("tenantId")String tenantId);
|
||||
public Map<String, Object> sumMoney(@Param("phone") String phone, @Param("refundOrderNumber") String refundOrderNumber, @Param("status") String status, @Param("createTimeStart") String createTimeStart, @Param("createTimeEnd") String createTimeEnd,@Param("type")Integer type,@Param("tenantId")String tenantId,@Param("time1")String time1,@Param("time2")String time2,@Param("time3")String time3,@Param("time4")String time4);
|
||||
|
||||
|
||||
|
||||
|
||||
@ -66,7 +66,7 @@ public interface IXhpcRechargeOrderService {
|
||||
* @param createTimeEnd
|
||||
* @return
|
||||
*/
|
||||
public String sumMoney(String phone, String rechargeOrderNumber, String status, String createTimeStart, String createTimeEnd,Integer type,Integer source,Integer userId);
|
||||
public Map<String, Object> sumMoney(String phone, String rechargeOrderNumber, String status, String createTimeStart, String createTimeEnd,Integer type,Integer source,Integer userId);
|
||||
|
||||
/**
|
||||
* 新增 充值订单
|
||||
|
||||
@ -68,7 +68,7 @@ public interface IXhpcRefundOrderService {
|
||||
* @param createTimeEnd
|
||||
* @return
|
||||
*/
|
||||
public String sumMoney(String phone, String refundOrderNumber, String status, String createTimeStart, String createTimeEnd,Integer type);
|
||||
public Map<String, Object> sumMoney(String phone, String refundOrderNumber, String status, String createTimeStart, String createTimeEnd,Integer type);
|
||||
|
||||
/**
|
||||
* 新增 退款订单
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package com.xhpc.payment.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateField;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.poi.excel.BigExcelWriter;
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
@ -121,9 +123,21 @@ public class XhpcRechargeOrderServiceImpl implements IXhpcRechargeOrderService {
|
||||
|
||||
|
||||
@Override
|
||||
public String sumMoney(String phone, String rechargeOrderNumber, String status, String createTimeStart, String createTimeEnd, Integer type,Integer source,Integer userId) {
|
||||
public Map<String, Object> sumMoney(String phone, String rechargeOrderNumber, String status, String createTimeStart, String createTimeEnd, Integer type,Integer source,Integer userId) {
|
||||
LoginUser loginUser = tokenService.getLoginUser();
|
||||
return xhpcRechargeOrderMapper.sumMoney(phone, rechargeOrderNumber, status, createTimeStart, createTimeEnd, type,source,userId,loginUser.getTenantId());
|
||||
//昨日用户的活跃度
|
||||
Date newDate1 = DateUtil.offset(new Date(), DateField.DAY_OF_MONTH, -1);
|
||||
String time1 = DateUtil.format(newDate1, "yyyy-MM-dd HH:mm:ss");
|
||||
//7天用户的活跃度
|
||||
Date newDate2 = DateUtil.offset(new Date(), DateField.DAY_OF_MONTH, -7);
|
||||
String time2 = DateUtil.format(newDate2, "yyyy-MM-dd HH:mm:ss");
|
||||
//一个月用户的活跃度
|
||||
Date newDate3 = DateUtil.offset(new Date(), DateField.DAY_OF_MONTH, -30);
|
||||
String time3 = DateUtil.format(newDate3, "yyyy-MM-dd HH:mm:ss");
|
||||
//3个月天用户的活跃度
|
||||
Date newDate4 = DateUtil.offset(new Date(), DateField.DAY_OF_MONTH, -90);
|
||||
String time4 = DateUtil.format(newDate4, "yyyy-MM-dd HH:mm:ss");
|
||||
return xhpcRechargeOrderMapper.sumMoney(phone, rechargeOrderNumber, status, createTimeStart, createTimeEnd, type,source,userId,loginUser.getTenantId(),time1,time2,time3,time4);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package com.xhpc.payment.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateField;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.poi.excel.BigExcelWriter;
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
@ -129,9 +131,22 @@ public class XhpcRefundOrderServiceImpl implements IXhpcRefundOrderService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String sumMoney(String phone, String refundOrderNumber, String status, String createTimeStart, String createTimeEnd, Integer type) {
|
||||
public Map<String, Object> sumMoney(String phone, String refundOrderNumber, String status, String createTimeStart, String createTimeEnd, Integer type) {
|
||||
LoginUser loginUser = tokenService.getLoginUser();
|
||||
return xhpcRefundOrderMapper.sumMoney(phone, refundOrderNumber, status, createTimeStart, createTimeEnd, type,loginUser.getTenantId());
|
||||
//昨日用户的活跃度
|
||||
Date newDate1 = DateUtil.offset(new Date(), DateField.DAY_OF_MONTH, -1);
|
||||
String time1 = DateUtil.format(newDate1, "yyyy-MM-dd HH:mm:ss");
|
||||
//7天用户的活跃度
|
||||
Date newDate2 = DateUtil.offset(new Date(), DateField.DAY_OF_MONTH, -7);
|
||||
String time2 = DateUtil.format(newDate2, "yyyy-MM-dd HH:mm:ss");
|
||||
//一个月用户的活跃度
|
||||
Date newDate3 = DateUtil.offset(new Date(), DateField.DAY_OF_MONTH, -30);
|
||||
String time3 = DateUtil.format(newDate3, "yyyy-MM-dd HH:mm:ss");
|
||||
//3个月天用户的活跃度
|
||||
Date newDate4 = DateUtil.offset(new Date(), DateField.DAY_OF_MONTH, -90);
|
||||
String time4 = DateUtil.format(newDate4, "yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
return xhpcRefundOrderMapper.sumMoney(phone, refundOrderNumber, status, createTimeStart, createTimeEnd, type,loginUser.getTenantId(),time1,time2,time3,time4);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -212,8 +212,14 @@
|
||||
ORDER BY xro.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="sumMoney" resultType="String">
|
||||
select sum(xro.amount) amount
|
||||
<select id="sumMoney" resultType="map">
|
||||
select
|
||||
sum(xro.amount) amount,
|
||||
(select sum(amount) from xhpc_recharge_order where create_time >= #{time1} and tenant_id =#{tenantId} and del_flag = 0 and status=1) one,
|
||||
(select sum(amount) from xhpc_recharge_order where create_time >= #{time2} and tenant_id =#{tenantId} and del_flag = 0 and status=1) two,
|
||||
(select sum(amount) from xhpc_recharge_order where create_time >= #{time3} and tenant_id =#{tenantId} and del_flag = 0 and status=1) three,
|
||||
(select sum(amount) from xhpc_recharge_order where create_time >= #{time4} and tenant_id =#{tenantId} and del_flag = 0 and status=1) four
|
||||
|
||||
from xhpc_recharge_order xro
|
||||
LEFT JOIN xhpc_app_user xau on xau.app_user_id = xro.user_id
|
||||
LEFT JOIN sys_dict_data sdd on sdd.`dict_type` = 'recharge_order_status' and sdd.dict_value = xro.`status`
|
||||
|
||||
@ -244,8 +244,13 @@
|
||||
ORDER BY xro.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="sumMoney" resultType="String">
|
||||
select sum(xro.amount) amount
|
||||
<select id="sumMoney" resultType="map">
|
||||
select
|
||||
sum(xro.amount) amount,
|
||||
(select sum(amount) from xhpc_refund_order where create_time >= #{time1} and tenant_id =#{tenantId} and del_flag = 0 and examine_status=1 and status =1) one,
|
||||
(select sum(amount) from xhpc_refund_order where create_time >= #{time2} and tenant_id =#{tenantId} and del_flag = 0 and examine_status=1 and status =1) two,
|
||||
(select sum(amount) from xhpc_refund_order where create_time >= #{time3} and tenant_id =#{tenantId} and del_flag = 0 and examine_status=1 and status =1) three,
|
||||
(select sum(amount) from xhpc_refund_order where create_time >= #{time4} and tenant_id =#{tenantId} and del_flag = 0 and examine_status=1 and status =1) four
|
||||
from xhpc_refund_order xro
|
||||
LEFT JOIN xhpc_app_user xau on xau.app_user_id = xro.user_id
|
||||
LEFT JOIN sys_dict_data sdd on sdd.`dict_type` = 'refund_order_status' and sdd.dict_value = xro.`status`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user