修改数据权限、修改BMS电流计算问题
This commit is contained in:
parent
b20365948e
commit
f5b70781bd
@ -1,4 +1,4 @@
|
|||||||
# Tomcat 9009 不走推送 name: evcs 9099走推送 name: jp 120.26.46.180:8858
|
# Tomcat 9009 不走推送 name: evcs 9099走推送 name: jp mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
server:
|
server:
|
||||||
port: 9099
|
port: 9099
|
||||||
|
|
||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -16,10 +16,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
@ -35,7 +35,7 @@ spring:
|
|||||||
datasource:
|
datasource:
|
||||||
ds1:
|
ds1:
|
||||||
nacos:
|
nacos:
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
dataId: sentinel-ruoyi-gateway
|
dataId: sentinel-ruoyi-gateway
|
||||||
groupId: DEFAULT_GROUP
|
groupId: DEFAULT_GROUP
|
||||||
data-type: json
|
data-type: json
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import java.util.Date;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* xhpc_work_station
|
* xhpc_work_station
|
||||||
* @author
|
* @author
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class XhpcWorkStationDomain implements Serializable {
|
public class XhpcWorkStationDomain implements Serializable {
|
||||||
@ -146,5 +146,7 @@ public class XhpcWorkStationDomain implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String tenantId;
|
private String tenantId;
|
||||||
|
|
||||||
|
private Long chargingStationId;
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,7 +18,12 @@ import com.xhpc.common.api.SmsService;
|
|||||||
import com.xhpc.common.core.domain.R;
|
import com.xhpc.common.core.domain.R;
|
||||||
import com.xhpc.common.core.exception.CustomException;
|
import com.xhpc.common.core.exception.CustomException;
|
||||||
import com.xhpc.common.core.utils.StringUtils;
|
import com.xhpc.common.core.utils.StringUtils;
|
||||||
|
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 lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@ -53,10 +58,33 @@ public class WorkOrderServiceImpl implements WorkOrderService {
|
|||||||
WorkUserService workUserService;
|
WorkUserService workUserService;
|
||||||
@Resource
|
@Resource
|
||||||
WorkTypeService typeService;
|
WorkTypeService typeService;
|
||||||
|
@Autowired
|
||||||
|
private TokenService tokenService;
|
||||||
@Override
|
@Override
|
||||||
public List<Map<String, Object>> getOrderPage(Map<String, Object> params) {
|
public List<Map<String, Object>> getOrderPage(Map<String, Object> params) {
|
||||||
return orderMapper.findOrderListByParams(params);
|
LoginUser loginUser = tokenService.getLoginUser();
|
||||||
|
Long sysUserId = loginUser.getUserid();
|
||||||
|
SysUser sysUser = loginUser.getSysUser();
|
||||||
|
//获取登陆用户
|
||||||
|
if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){
|
||||||
|
if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){
|
||||||
|
Long logOperatorId = sysUser.getOperatorId();
|
||||||
|
params.put("type", 1);
|
||||||
|
params.put("userId", logOperatorId);
|
||||||
|
|
||||||
|
//运营商看自己的场站
|
||||||
|
return deviceMapper.selectStationGunDeviceListByParams(params);
|
||||||
|
}else{
|
||||||
|
params.put("type", 2);
|
||||||
|
params.put("userId", sysUserId);
|
||||||
|
//查询赋值的场站
|
||||||
|
return deviceMapper.selectStationGunDeviceListByParams(params);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
params.put("type", 0);
|
||||||
|
params.put("userId", sysUserId);
|
||||||
|
return deviceMapper.selectStationGunDeviceListByParams(params);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package com.xhpc.activity.service.impl;
|
|||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.xhpc.common.core.exception.CustomException;
|
import com.xhpc.common.core.exception.CustomException;
|
||||||
import com.xhpc.common.core.utils.StringUtils;
|
import com.xhpc.common.core.utils.StringUtils;
|
||||||
|
import com.xhpc.common.core.web.service.BaseService;
|
||||||
import com.xhpc.common.redis.service.RedisService;
|
import com.xhpc.common.redis.service.RedisService;
|
||||||
import com.xhpc.activity.domain.XhpcStationDeviceDomain;
|
import com.xhpc.activity.domain.XhpcStationDeviceDomain;
|
||||||
import com.xhpc.activity.domain.XhpcWorkStationDomain;
|
import com.xhpc.activity.domain.XhpcWorkStationDomain;
|
||||||
@ -10,10 +11,16 @@ import com.xhpc.activity.mapper.XhpcStationDeviceMapper;
|
|||||||
import com.xhpc.activity.mapper.XhpcWorkStationMapper;
|
import com.xhpc.activity.mapper.XhpcWorkStationMapper;
|
||||||
import com.xhpc.activity.service.WorkStationService;
|
import com.xhpc.activity.service.WorkStationService;
|
||||||
import com.xhpc.activity.vo.XhpcStationDeviceVo;
|
import com.xhpc.activity.vo.XhpcStationDeviceVo;
|
||||||
|
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.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -21,7 +28,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
@Service
|
@Service
|
||||||
@Transactional
|
@Transactional
|
||||||
public class WorkStationServiceImpl implements WorkStationService {
|
public class WorkStationServiceImpl extends BaseService implements WorkStationService {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
XhpcStationDeviceMapper deviceMapper;
|
XhpcStationDeviceMapper deviceMapper;
|
||||||
@ -31,7 +38,8 @@ public class WorkStationServiceImpl implements WorkStationService {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
RedisService redisService;
|
RedisService redisService;
|
||||||
|
@Autowired
|
||||||
|
private TokenService tokenService;
|
||||||
|
|
||||||
private int getTerminalStatus(String serialNumber) {
|
private int getTerminalStatus(String serialNumber) {
|
||||||
//0离线 1故障 2空闲 3充电 4 已插枪 5未知
|
//0离线 1故障 2空闲 3充电 4 已插枪 5未知
|
||||||
@ -65,8 +73,30 @@ public class WorkStationServiceImpl implements WorkStationService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Map<String, Object>> getStationDevice(Map<String, Object> params){
|
public List<Map<String, Object>> getStationDevice(Map<String, Object> params){
|
||||||
|
LoginUser loginUser = tokenService.getLoginUser();
|
||||||
|
Long sysUserId = loginUser.getUserid();
|
||||||
|
List<Map<String, Object>> deviceList = new ArrayList<>();
|
||||||
|
SysUser sysUser = loginUser.getSysUser();
|
||||||
|
//获取登陆用户
|
||||||
|
if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){
|
||||||
|
if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){
|
||||||
|
Long logOperatorId = sysUser.getOperatorId();
|
||||||
|
params.put("type", 1);
|
||||||
|
params.put("userId", logOperatorId);
|
||||||
|
|
||||||
List<Map<String, Object>> deviceList = deviceMapper.selectStationGunDeviceListByParams(params);
|
//运营商看自己的场站
|
||||||
|
deviceList =deviceMapper.selectStationGunDeviceListByParams(params);
|
||||||
|
}else{
|
||||||
|
params.put("type", 2);
|
||||||
|
params.put("userId", sysUserId);
|
||||||
|
//查询赋值的场站
|
||||||
|
deviceList=deviceMapper.selectStationGunDeviceListByParams(params);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
params.put("type", 0);
|
||||||
|
params.put("userId", sysUserId);
|
||||||
|
deviceList=deviceMapper.selectStationGunDeviceListByParams(params);
|
||||||
|
}
|
||||||
for(Map<String, Object> map : deviceList){
|
for(Map<String, Object> map : deviceList){
|
||||||
//状态
|
//状态
|
||||||
int pileSerialNumber = getTerminalStatus(map.get("gunSerialNumber").toString());
|
int pileSerialNumber = getTerminalStatus(map.get("gunSerialNumber").toString());
|
||||||
@ -84,7 +114,30 @@ public class WorkStationServiceImpl implements WorkStationService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<XhpcWorkStationDomain> getStationList(Map<String, Object> params){
|
public List<XhpcWorkStationDomain> getStationList(Map<String, Object> params){
|
||||||
return stationMapper.selectListByParams(params);
|
LoginUser loginUser = tokenService.getLoginUser();
|
||||||
|
Long sysUserId = loginUser.getUserid();
|
||||||
|
List<Map<String, Object>> list = new ArrayList<>();
|
||||||
|
SysUser sysUser = loginUser.getSysUser();
|
||||||
|
//获取登陆用户
|
||||||
|
if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){
|
||||||
|
if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){
|
||||||
|
Long logOperatorId = sysUser.getOperatorId();
|
||||||
|
params.put("type", 1);
|
||||||
|
params.put("userId", logOperatorId);
|
||||||
|
|
||||||
|
//运营商看自己的场站
|
||||||
|
return stationMapper.selectListByParams(params);
|
||||||
|
}else{
|
||||||
|
params.put("type", 2);
|
||||||
|
params.put("userId", sysUserId);
|
||||||
|
//查询赋值的场站
|
||||||
|
return stationMapper.selectListByParams(params);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
params.put("type", 0);
|
||||||
|
params.put("userId", sysUserId);
|
||||||
|
return stationMapper.selectListByParams(params);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -177,16 +177,23 @@ public class XhpcClearingCheckoutServiceImpl extends BaseService implements Xhpc
|
|||||||
domain.setStatus(99);
|
domain.setStatus(99);
|
||||||
checkoutMapper.insert(domain);
|
checkoutMapper.insert(domain);
|
||||||
|
|
||||||
executorService.execute(new Runnable() {
|
if (StringUtils.isEmpty(domain.getClearingOrderIds())) {
|
||||||
@Override
|
asyncService.updateCheckoutByOperatorAsync(domain.getOperatorId(), domain.getClearingCheckoutId());
|
||||||
public void run() {
|
} else {
|
||||||
if (StringUtils.isEmpty(domain.getClearingOrderIds())) {
|
asyncService.updateCheckoutByOrderIdsAsync(domain.getClearingOrderIds(), domain.getClearingCheckoutId());
|
||||||
asyncService.updateCheckoutByOperatorAsync(domain.getOperatorId(), domain.getClearingCheckoutId());
|
}
|
||||||
} else {
|
|
||||||
asyncService.updateCheckoutByOrderIdsAsync(domain.getClearingOrderIds(), domain.getClearingCheckoutId());
|
|
||||||
}
|
// executorService.execute(new Runnable() {
|
||||||
}
|
// @Override
|
||||||
});
|
// public void run() {
|
||||||
|
// if (StringUtils.isEmpty(domain.getClearingOrderIds())) {
|
||||||
|
// asyncService.updateCheckoutByOperatorAsync(domain.getOperatorId(), domain.getClearingCheckoutId());
|
||||||
|
// } else {
|
||||||
|
// asyncService.updateCheckoutByOrderIdsAsync(domain.getClearingOrderIds(), domain.getClearingCheckoutId());
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// });
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -108,21 +108,21 @@ public class XhpcClearingHistoryOrderServiceImpl extends BaseService implements
|
|||||||
params.put("chargingPileId", orderVo.getChargingPileId());
|
params.put("chargingPileId", orderVo.getChargingPileId());
|
||||||
params.put("terminalId", orderVo.getTerminalId());
|
params.put("terminalId", orderVo.getTerminalId());
|
||||||
|
|
||||||
// List<XhpcClearingHistoryOrderDomain> orderDomainList = historyOrderMapper.getListPage(params);
|
List<XhpcClearingHistoryOrderDomain> orderDomainList = historyOrderMapper.getListPage(params);
|
||||||
// String orderIds = orderDomainList.stream().map(n -> n.getClearingOrderId().toString()).collect(Collectors.joining(","));
|
String orderIds = orderDomainList.stream().map(n -> n.getClearingOrderId().toString()).collect(Collectors.joining(","));
|
||||||
//
|
|
||||||
// if (StringUtils.isNotEmpty(orderIds)){
|
if (StringUtils.isNotEmpty(orderIds)){
|
||||||
// asyncService.updateCheckStatusAsync(orderIds, orderVo.getStatus(), orderVo.getCheckBy());
|
asyncService.updateCheckStatusAsync(orderIds, orderVo.getStatus(), orderVo.getCheckBy());
|
||||||
// }
|
}
|
||||||
executorService.execute(new Runnable() {
|
// executorService.execute(new Runnable() {
|
||||||
@Override
|
// @Override
|
||||||
public void run() {
|
// public void run() {
|
||||||
String clearingOrderIds = historyOrderMapper.getClearingOrderIds(params);
|
// String clearingOrderIds = historyOrderMapper.getClearingOrderIds(params);
|
||||||
if (StringUtils.isNotEmpty(clearingOrderIds)){
|
// if (StringUtils.isNotEmpty(clearingOrderIds)){
|
||||||
asyncService.updateCheckStatusAsync(clearingOrderIds, orderVo.getStatus(), orderVo.getCheckBy());
|
// asyncService.updateCheckStatusAsync(clearingOrderIds, orderVo.getStatus(), orderVo.getCheckBy());
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,13 +1,17 @@
|
|||||||
package com.xhpc.activity.task;
|
package com.xhpc.activity.task;
|
||||||
|
|
||||||
|
|
||||||
import com.xhpc.common.util.DateUtil;
|
|
||||||
import com.xhpc.activity.mapper.XhpcDeviceMessageMapper;
|
import com.xhpc.activity.mapper.XhpcDeviceMessageMapper;
|
||||||
|
import com.xhpc.common.util.DateUtil;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static com.xhpc.common.data.redis.StaticBeanUtil.REDIS;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
public class AutoClearDataTask {
|
public class AutoClearDataTask {
|
||||||
@ -22,8 +26,29 @@ public class AutoClearDataTask {
|
|||||||
@Scheduled(cron = "0 0 5 * * ?")
|
@Scheduled(cron = "0 0 5 * * ?")
|
||||||
private void autoClearDeviceMessageData(){
|
private void autoClearDeviceMessageData(){
|
||||||
|
|
||||||
String date = DateUtil.date2String(DateUtil.addDay(new Date(), -7), "yyyy-MM-dd");
|
String date = DateUtil.date2String(DateUtil.addDay(new Date(), -3), "yyyy-MM-dd");
|
||||||
messageMapper.deleteMessageByDate(date);
|
messageMapper.deleteMessageByDate(date);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Scheduled(cron = "0 0/10 * * * ? ")
|
||||||
|
private void getNotificationPlaceholderOrderInfo(){
|
||||||
|
String orderKey = "notificationPlaceholderOrderInfo:*";
|
||||||
|
|
||||||
|
Collection<String> orderKeys = REDIS.keys(orderKey);
|
||||||
|
for (String okey : orderKeys) {
|
||||||
|
REDIS.deleteObject(okey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
String substring = "notificationPlaceholderOrderInfo:80836000010001012505142200439549".substring(49, 57);
|
||||||
|
|
||||||
|
System.out.println("substring="+substring);
|
||||||
|
|
||||||
|
String format = cn.hutool.core.date.DateUtil.format(cn.hutool.core.date.DateUtil.offsetDay(new Date(), -3), "yyMMdd");
|
||||||
|
|
||||||
|
System.out.println("format="+format);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,7 +38,7 @@ public class SyncHistoryOrderTask {
|
|||||||
@Scheduled(cron = "0 0 0/1 * * ?")
|
@Scheduled(cron = "0 0 0/1 * * ?")
|
||||||
@Transactional
|
@Transactional
|
||||||
@GetMapping("/syncTask")
|
@GetMapping("/syncTask")
|
||||||
void ExpiredTenantStatusTask() {
|
public void ExpiredTenantStatusTask() {
|
||||||
System.out.println(" ============== 自动同步订单到清分 开始 ==========================");
|
System.out.println(" ============== 自动同步订单到清分 开始 ==========================");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -19,10 +19,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -67,6 +67,12 @@
|
|||||||
<if test="params.tenantId!=null and params.tenantId!=''">
|
<if test="params.tenantId!=null and params.tenantId!=''">
|
||||||
and s.tenant_id=#{params.tenantId}
|
and s.tenant_id=#{params.tenantId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="params.type==1">
|
||||||
|
and s.charging_station_id in (select charging_station_id from xhpc_charging_station where operator_id=#{params.userId})
|
||||||
|
</if>
|
||||||
|
<if test="params.type==2">
|
||||||
|
and s.charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{params.userId})
|
||||||
|
</if>
|
||||||
GROUP BY d2.device_id
|
GROUP BY d2.device_id
|
||||||
order by s.work_station_id, d1.device_type,d1.device_id, d1.sorted, d2.device_type,d2.device_id, d2.sorted
|
order by s.work_station_id, d1.device_type,d1.device_id, d1.sorted, d2.device_type,d2.device_id, d2.sorted
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@ -29,13 +29,14 @@
|
|||||||
<result column="service_tel" jdbcType="VARCHAR" property="serviceTel" />
|
<result column="service_tel" jdbcType="VARCHAR" property="serviceTel" />
|
||||||
<result column="park_nums" jdbcType="INTEGER" property="parkNums" />
|
<result column="park_nums" jdbcType="INTEGER" property="parkNums" />
|
||||||
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
|
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
|
||||||
|
<result column="charging_station_id" jdbcType="VARCHAR" property="chargingStationId" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
work_station_id, `name`, operator_id, `type`, construction_site, service_facilities,
|
work_station_id, `name`, operator_id, `type`, construction_site, service_facilities,
|
||||||
periphery_facilities, address, detailed_address, longitude, latitude, parking_instructions,
|
periphery_facilities, address, detailed_address, longitude, latitude, parking_instructions,
|
||||||
serial_number, `status`, del_flag, create_time, create_by, update_time, update_by,
|
serial_number, `status`, del_flag, create_time, create_by, update_time, update_by,
|
||||||
remark, business_instructions, reminder_instructions, img_id, station_type, service_tel,
|
remark, business_instructions, reminder_instructions, img_id, station_type, service_tel,
|
||||||
park_nums, tenant_id
|
park_nums, tenant_id,charging_station_id
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectListByParams" resultType="com.xhpc.activity.domain.XhpcWorkStationDomain">
|
<select id="selectListByParams" resultType="com.xhpc.activity.domain.XhpcWorkStationDomain">
|
||||||
@ -46,6 +47,12 @@
|
|||||||
<if test="params.name != null and params.name !=''">
|
<if test="params.name != null and params.name !=''">
|
||||||
and name like concat('%', #{params.name}, '%')
|
and name like concat('%', #{params.name}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="params.type==1">
|
||||||
|
and charging_station_id in (select charging_station_id from xhpc_charging_station where operator_id=#{params.userId})
|
||||||
|
</if>
|
||||||
|
<if test="params.type==2">
|
||||||
|
and charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{params.userId})
|
||||||
|
</if>
|
||||||
<if test="params.tenantId!=null and params.tenantId!=''">
|
<if test="params.tenantId!=null and params.tenantId!=''">
|
||||||
and tenant_id = #{params.tenantId}
|
and tenant_id = #{params.tenantId}
|
||||||
</if>
|
</if>
|
||||||
@ -93,7 +100,7 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||||
select
|
select
|
||||||
<include refid="Base_Column_List" />
|
<include refid="Base_Column_List" />
|
||||||
from xhpc_work_station
|
from xhpc_work_station
|
||||||
where work_station_id = #{workStationId,jdbcType=BIGINT}
|
where work_station_id = #{workStationId,jdbcType=BIGINT}
|
||||||
@ -104,24 +111,24 @@
|
|||||||
where work_station_id = #{workStationId,jdbcType=BIGINT}
|
where work_station_id = #{workStationId,jdbcType=BIGINT}
|
||||||
</update>
|
</update>
|
||||||
<insert id="insert" keyColumn="work_station_id" keyProperty="workStationId" parameterType="com.xhpc.activity.domain.XhpcWorkStationDomain" useGeneratedKeys="true">
|
<insert id="insert" keyColumn="work_station_id" keyProperty="workStationId" parameterType="com.xhpc.activity.domain.XhpcWorkStationDomain" useGeneratedKeys="true">
|
||||||
insert into xhpc_work_station (`name`, operator_id, `type`,
|
insert into xhpc_work_station (`name`, operator_id, `type`,
|
||||||
construction_site, service_facilities, periphery_facilities,
|
construction_site, service_facilities, periphery_facilities,
|
||||||
address, detailed_address, longitude,
|
address, detailed_address, longitude,
|
||||||
latitude, parking_instructions, serial_number,
|
latitude, parking_instructions, serial_number,
|
||||||
`status`, del_flag, create_time,
|
`status`, del_flag, create_time,
|
||||||
create_by, update_time, update_by,
|
create_by, update_time, update_by,
|
||||||
remark, business_instructions, reminder_instructions,
|
remark, business_instructions, reminder_instructions,
|
||||||
img_id, station_type, service_tel,
|
img_id, station_type, service_tel,
|
||||||
park_nums, tenant_id)
|
park_nums, tenant_id,charging_station_id)
|
||||||
values (#{name,jdbcType=VARCHAR}, #{operatorId,jdbcType=BIGINT}, #{type,jdbcType=INTEGER},
|
values (#{name,jdbcType=VARCHAR}, #{operatorId,jdbcType=BIGINT}, #{type,jdbcType=INTEGER},
|
||||||
#{constructionSite,jdbcType=SMALLINT}, #{serviceFacilities,jdbcType=VARCHAR}, #{peripheryFacilities,jdbcType=VARCHAR},
|
#{constructionSite,jdbcType=SMALLINT}, #{serviceFacilities,jdbcType=VARCHAR}, #{peripheryFacilities,jdbcType=VARCHAR},
|
||||||
#{address,jdbcType=VARCHAR}, #{detailedAddress,jdbcType=VARCHAR}, #{longitude,jdbcType=VARCHAR},
|
#{address,jdbcType=VARCHAR}, #{detailedAddress,jdbcType=VARCHAR}, #{longitude,jdbcType=VARCHAR},
|
||||||
#{latitude,jdbcType=VARCHAR}, #{parkingInstructions,jdbcType=VARCHAR}, #{serialNumber,jdbcType=VARCHAR},
|
#{latitude,jdbcType=VARCHAR}, #{parkingInstructions,jdbcType=VARCHAR}, #{serialNumber,jdbcType=VARCHAR},
|
||||||
#{status,jdbcType=INTEGER}, 0, sysdate(),
|
#{status,jdbcType=INTEGER}, 0, sysdate(),
|
||||||
#{createBy,jdbcType=VARCHAR}, sysdate(), #{updateBy,jdbcType=VARCHAR},
|
#{createBy,jdbcType=VARCHAR}, sysdate(), #{updateBy,jdbcType=VARCHAR},
|
||||||
#{remark,jdbcType=VARCHAR}, #{businessInstructions,jdbcType=VARCHAR}, #{reminderInstructions,jdbcType=VARCHAR},
|
#{remark,jdbcType=VARCHAR}, #{businessInstructions,jdbcType=VARCHAR}, #{reminderInstructions,jdbcType=VARCHAR},
|
||||||
#{imgId,jdbcType=VARCHAR}, #{stationType,jdbcType=SMALLINT}, #{serviceTel,jdbcType=VARCHAR},
|
#{imgId,jdbcType=VARCHAR}, #{stationType,jdbcType=SMALLINT}, #{serviceTel,jdbcType=VARCHAR},
|
||||||
#{parkNums,jdbcType=INTEGER}, #{tenantId,jdbcType=VARCHAR})
|
#{parkNums,jdbcType=INTEGER}, #{tenantId,jdbcType=VARCHAR}, #{chargingStationId,jdbcType=BIGINT})
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertSelective" keyColumn="work_station_id" keyProperty="workStationId" parameterType="com.xhpc.activity.domain.XhpcWorkStationDomain" useGeneratedKeys="true">
|
<insert id="insertSelective" keyColumn="work_station_id" keyProperty="workStationId" parameterType="com.xhpc.activity.domain.XhpcWorkStationDomain" useGeneratedKeys="true">
|
||||||
insert into xhpc_work_station
|
insert into xhpc_work_station
|
||||||
@ -418,4 +425,4 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -147,7 +147,7 @@ public class XhpcChargingPileServiceImpl extends BaseService implements IXhpcCha
|
|||||||
}else{
|
}else{
|
||||||
Map<String, Object> map = (Map<String, Object>)r1.getData();
|
Map<String, Object> map = (Map<String, Object>)r1.getData();
|
||||||
if(map !=null){
|
if(map !=null){
|
||||||
if(!map.get("stationPileQuote").equals("-1")){
|
if(!map.get("stationPileQuote").toString().equals("-1")){
|
||||||
int count = xhpcChargingPileMapper.getCountXhpcChargingPile(chargingStationId,loginUser.getTenantId());
|
int count = xhpcChargingPileMapper.getCountXhpcChargingPile(chargingStationId,loginUser.getTenantId());
|
||||||
if(Integer.parseInt(map.get("stationPileQuote").toString())<count){
|
if(Integer.parseInt(map.get("stationPileQuote").toString())<count){
|
||||||
return AjaxResult.error(1001, "桩已达到限额,如要在创建桩请联系管理员");
|
return AjaxResult.error(1001, "桩已达到限额,如要在创建桩请联系管理员");
|
||||||
|
|||||||
@ -271,7 +271,7 @@ public class XhpcPlaceholderServiceImpl extends BaseService implements IXhpcPlac
|
|||||||
addXhpcPlaceholderTime("00:00:00",start,price,placeholderId,chargingStationId);
|
addXhpcPlaceholderTime("00:00:00",start,price,placeholderId,chargingStationId);
|
||||||
}
|
}
|
||||||
addXhpcPlaceholderTime(start,end,rateValue,placeholderId,chargingStationId);
|
addXhpcPlaceholderTime(start,end,rateValue,placeholderId,chargingStationId);
|
||||||
if(!endTime.equals("24:00:00")) {
|
if(!("24:00:00").equals(xhpcPlaceholderTimeDto.getEndTime())) {
|
||||||
if(rateValue ==null || "".equals(rateValue)){
|
if(rateValue ==null || "".equals(rateValue)){
|
||||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
return R.fail("1004", "请填写默认时间段费率");
|
return R.fail("1004", "请填写默认时间段费率");
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -622,7 +622,7 @@
|
|||||||
<select id="getPlaceholderTimeMassage" resultType="map">
|
<select id="getPlaceholderTimeMassage" resultType="map">
|
||||||
select
|
select
|
||||||
start_time as startTime,
|
start_time as startTime,
|
||||||
replace(end_time, '00:00:00', '24:00:00') as endTime,
|
replace(end_time, '00:00:00', '23:59:59') as endTime,
|
||||||
price as price
|
price as price
|
||||||
from xhpc_placeholder_time
|
from xhpc_placeholder_time
|
||||||
where charging_station_id=#{chargingStationId} and del_flag =0
|
where charging_station_id=#{chargingStationId} and del_flag =0
|
||||||
@ -632,11 +632,11 @@
|
|||||||
select
|
select
|
||||||
price as placeholderPrice,
|
price as placeholderPrice,
|
||||||
start_time as placeholderStartTime,
|
start_time as placeholderStartTime,
|
||||||
end_time as placeholderEndTime
|
replace(end_time, '00:00:00', '23:59:59') as placeholderEndTime
|
||||||
from xhpc_placeholder_time
|
from xhpc_placeholder_time
|
||||||
where charging_station_id = #{datchargingStationId}
|
where charging_station_id = #{datchargingStationId}
|
||||||
and start_time <= #{date}
|
and start_time <= #{date}
|
||||||
and replace(end_time, '00:00:00', '24:00:00') >= #{date}
|
and replace(end_time, '00:00:00', '23:59:59') >= #{date}
|
||||||
and del_flag = 0
|
and del_flag = 0
|
||||||
limit 1
|
limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@ -365,7 +365,6 @@
|
|||||||
cp.auxiliary_power_supply as auxiliaryPowerSupply,
|
cp.auxiliary_power_supply as auxiliaryPowerSupply,
|
||||||
ct.parking_instructions as parkingInstructions,
|
ct.parking_instructions as parkingInstructions,
|
||||||
ct.create_time as createTime,
|
ct.create_time as createTime,
|
||||||
xp.content as content,
|
|
||||||
xp.max_fee as maxFee,
|
xp.max_fee as maxFee,
|
||||||
xp.free_time as freeTime,
|
xp.free_time as freeTime,
|
||||||
ter.charging_station_id as chargingStationId
|
ter.charging_station_id as chargingStationId
|
||||||
@ -437,11 +436,11 @@
|
|||||||
select
|
select
|
||||||
price as placeholderPrice,
|
price as placeholderPrice,
|
||||||
start_time as placeholderStartTime,
|
start_time as placeholderStartTime,
|
||||||
end_time as placeholderEndTime
|
replace(end_time, '00:00:00', '23:59:59') as placeholderEndTime
|
||||||
from xhpc_placeholder_time
|
from xhpc_placeholder_time
|
||||||
where charging_station_id = #{datchargingStationId}
|
where charging_station_id = #{datchargingStationId}
|
||||||
and start_time <= #{date}
|
and start_time <= #{date}
|
||||||
and replace(end_time, '00:00:00', '24:00:00') >= #{date}
|
and replace(end_time, '00:00:00', '23:59:59') >= #{date}
|
||||||
and del_flag = 0
|
and del_flag = 0
|
||||||
limit 1
|
limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@ -0,0 +1,47 @@
|
|||||||
|
package com.xhpc.pp.utils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电流算法
|
||||||
|
*
|
||||||
|
* @author yuyang
|
||||||
|
* @Date 2025-06-06 11:02
|
||||||
|
*/
|
||||||
|
public class BMSCurrentParser {
|
||||||
|
/**
|
||||||
|
* 解析BMS电流需求值
|
||||||
|
* @param hexString 2字节十六进制字符串(小端序),如"18FC"
|
||||||
|
* @return 电流值(单位:A)
|
||||||
|
*/
|
||||||
|
public static double parseBmsCurrent(String hexString,int number) {
|
||||||
|
// 验证输入格式
|
||||||
|
if (hexString == null || hexString.length() != 4) {
|
||||||
|
throw new IllegalArgumentException("输入必须是4位十六进制字符串");
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 解析低字节(前2位字符)
|
||||||
|
int lowByte = Integer.parseInt(hexString.substring(0, 2), 16);
|
||||||
|
// 解析高字节(后2位字符)
|
||||||
|
int highByte = Integer.parseInt(hexString.substring(2, 4), 16);
|
||||||
|
|
||||||
|
// 组合为16位无符号整数(小端序)
|
||||||
|
int unsignedValue = (highByte << 8) | lowByte;
|
||||||
|
|
||||||
|
// 转换为有符号16位整数
|
||||||
|
int signedValue = unsignedValue;
|
||||||
|
if (unsignedValue >= 32768) {
|
||||||
|
signedValue = unsignedValue - 65536;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 应用单位换算和偏移量
|
||||||
|
return (signedValue * 0.1) - number;
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
throw new IllegalArgumentException("无效的十六进制格式");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -86,7 +86,7 @@ public class XhpcPlaceholderOrderController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//定时任务,查询状态
|
//定时任务,查询状态
|
||||||
@Scheduled(cron = "0/30 * * * * ? ")
|
//@Scheduled(cron = "0/30 * * * * ? ")
|
||||||
public void getxhpcPlaceholderOrderTime() {
|
public void getxhpcPlaceholderOrderTime() {
|
||||||
xhpcPlaceholderOrderService.getTimingPriceTime();
|
xhpcPlaceholderOrderService.getTimingPriceTime();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import com.xhpc.common.api.UserTypeService;
|
|||||||
import com.xhpc.common.core.domain.R;
|
import com.xhpc.common.core.domain.R;
|
||||||
import com.xhpc.common.core.utils.SecurityUtils;
|
import com.xhpc.common.core.utils.SecurityUtils;
|
||||||
import com.xhpc.common.core.web.domain.AjaxResult;
|
import com.xhpc.common.core.web.domain.AjaxResult;
|
||||||
|
import com.xhpc.common.core.web.service.BaseService;
|
||||||
import com.xhpc.common.domain.XhpcPlaceholderTime;
|
import com.xhpc.common.domain.XhpcPlaceholderTime;
|
||||||
import com.xhpc.common.enums.StopReasonEnum;
|
import com.xhpc.common.enums.StopReasonEnum;
|
||||||
import com.xhpc.common.security.service.TokenService;
|
import com.xhpc.common.security.service.TokenService;
|
||||||
@ -38,7 +39,7 @@ import static com.xhpc.common.data.redis.StaticBeanUtil.REDIS;
|
|||||||
* @Date 2025-05-06 10:07
|
* @Date 2025-05-06 10:07
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class XhpcPlaceholderOrderServiceImpl implements IXhpcPlaceholderOrderService {
|
public class XhpcPlaceholderOrderServiceImpl extends BaseService implements IXhpcPlaceholderOrderService {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
XhpcPlaceholderOrderMapper xhpcPlaceholderOrderMapper;
|
XhpcPlaceholderOrderMapper xhpcPlaceholderOrderMapper;
|
||||||
@ -75,7 +76,9 @@ public class XhpcPlaceholderOrderServiceImpl implements IXhpcPlaceholderOrderSer
|
|||||||
|
|
||||||
String start = DateUtil.formatTime(startTime);
|
String start = DateUtil.formatTime(startTime);
|
||||||
String end = DateUtil.formatTime(endTime);
|
String end = DateUtil.formatTime(endTime);
|
||||||
long betweenDay = DateUtil.between(endTime, startTime, DateUnit.DAY);
|
DateTime parse = DateUtil.parse(DateUtil.format(startTime, "yyyy-MM-dd"), "yyyy-MM-dd");
|
||||||
|
DateTime parse1 = DateUtil.parse(DateUtil.format(endTime, "yyyy-MM-dd"), "yyyy-MM-dd");
|
||||||
|
long betweenDay = DateUtil.between(parse,parse1, DateUnit.DAY);
|
||||||
long between = DateUtil.between(endTime, startTime, DateUnit.MINUTE);
|
long between = DateUtil.between(endTime, startTime, DateUnit.MINUTE);
|
||||||
xhpcPlaceholderOrder.setEndTime(endTime);
|
xhpcPlaceholderOrder.setEndTime(endTime);
|
||||||
xhpcPlaceholderOrder.setTotalTimeSpan((int) between);
|
xhpcPlaceholderOrder.setTotalTimeSpan((int) between);
|
||||||
@ -86,105 +89,159 @@ public class XhpcPlaceholderOrderServiceImpl implements IXhpcPlaceholderOrderSer
|
|||||||
} else {
|
} else {
|
||||||
between = between - freeTime;
|
between = between - freeTime;
|
||||||
if (betweenDay > 0) {
|
if (betweenDay > 0) {
|
||||||
List<XhpcPlaceholderTime> xhpcPlaceholderTimeOne = xhpcPlaceholderOrderMapper.getXhpcPlaceholderTime(start, "23:59:59", xhpcPlaceholderOrder.getPlaceholderId());
|
for (int m = 0; m <= betweenDay; m++) {
|
||||||
for (int i = 0; i < xhpcPlaceholderTimeOne.size(); i++) {
|
if(m==0){
|
||||||
XhpcPlaceholderTime xhpcPlaceholderTime = xhpcPlaceholderTimeOne.get(i);
|
List<XhpcPlaceholderTime> xhpcPlaceholderTimeOne = xhpcPlaceholderOrderMapper.getXhpcPlaceholderTime(start, "23:59:59", xhpcPlaceholderOrder.getPlaceholderId());
|
||||||
BigDecimal price = xhpcPlaceholderTime.getPrice();
|
for (int i = 0; i < xhpcPlaceholderTimeOne.size(); i++) {
|
||||||
String pattern = "HH:mm:ss";
|
XhpcPlaceholderTime xhpcPlaceholderTime = xhpcPlaceholderTimeOne.get(i);
|
||||||
Long startOne = DateUtil.parse(start, pattern).getTime();
|
BigDecimal price = xhpcPlaceholderTime.getPrice();
|
||||||
Long endOne = DateUtil.parse("23:59:59", pattern).getTime();
|
String pattern = "HH:mm:ss";
|
||||||
|
Long startOne = DateUtil.parse(start, pattern).getTime();
|
||||||
|
Long endOne = DateUtil.parse("23:59:59", pattern).getTime();
|
||||||
|
|
||||||
String format1 = DateUtil.format(xhpcPlaceholderTime.getStartTime(), pattern);
|
String format1 = DateUtil.format(xhpcPlaceholderTime.getStartTime(), pattern);
|
||||||
String format2 = DateUtil.format(xhpcPlaceholderTime.getEndTime(), pattern);
|
String format2 = DateUtil.format(xhpcPlaceholderTime.getEndTime(), pattern);
|
||||||
|
|
||||||
Long time1 = DateUtil.parse(format1, pattern).getTime();
|
Long time1 = DateUtil.parse(format1, pattern).getTime();
|
||||||
Long time2 = DateUtil.parse(format2, pattern).getTime();
|
Long time2 = DateUtil.parse(format2, pattern).getTime();
|
||||||
XhpcPlaceholderTimeOrderDto placeholderTimeOrderDto = new XhpcPlaceholderTimeOrderDto();
|
XhpcPlaceholderTimeOrderDto placeholderTimeOrderDto = new XhpcPlaceholderTimeOrderDto();
|
||||||
if (startOne < time1) {
|
if (startOne < time1) {
|
||||||
startOne = time1;
|
startOne = time1;
|
||||||
placeholderTimeOrderDto.setStartTime(xhpcPlaceholderTime.getStartTime());
|
placeholderTimeOrderDto.setStartTime(xhpcPlaceholderTime.getStartTime());
|
||||||
|
}else{
|
||||||
|
placeholderTimeOrderDto.setStartTime(DateUtil.parse(start, pattern));
|
||||||
|
}
|
||||||
|
if (endOne > time2) {
|
||||||
|
endOne = time2;
|
||||||
|
placeholderTimeOrderDto.setEndTime(xhpcPlaceholderTime.getEndTime());
|
||||||
|
}else{
|
||||||
|
placeholderTimeOrderDto.setEndTime(DateUtil.parse("23:59:59", pattern));
|
||||||
|
}
|
||||||
|
long betweOne = (endOne - startOne) / 60000;
|
||||||
|
int i1 = (int) (betweOne);
|
||||||
|
|
||||||
|
if (freeTime - i1 > 0) {
|
||||||
|
freeTime = freeTime - i1;
|
||||||
|
;
|
||||||
|
i1 = 0;
|
||||||
|
} else {
|
||||||
|
i1 = i1 - freeTime;
|
||||||
|
freeTime = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
BigDecimal multiply = new BigDecimal(i1).multiply(price);
|
||||||
|
totalMoney = totalMoney.add(multiply);
|
||||||
|
|
||||||
|
placeholderTimeOrderDto.setPlaceholderOrderId(xhpcPlaceholderOrder.getPlaceholderOrderId());
|
||||||
|
placeholderTimeOrderDto.setPrice(price);
|
||||||
|
placeholderTimeOrderDto.setTotalMoney(multiply);
|
||||||
|
placeholderTimeOrderDto.setTotalTimeSpan(i1);
|
||||||
|
xhpcPlaceholderOrderMapper.insertXhpcPlaceholderTimeOrder(placeholderTimeOrderDto);
|
||||||
|
|
||||||
|
}
|
||||||
|
}else if(m>0 && m<betweenDay){
|
||||||
|
List<XhpcPlaceholderTime> xhpcPlaceholderTimeOne = xhpcPlaceholderOrderMapper.getXhpcPlaceholderTime("00:00:00", "23:59:59", xhpcPlaceholderOrder.getPlaceholderId());
|
||||||
|
for (int i = 0; i < xhpcPlaceholderTimeOne.size(); i++) {
|
||||||
|
XhpcPlaceholderTime xhpcPlaceholderTime = xhpcPlaceholderTimeOne.get(i);
|
||||||
|
BigDecimal price = xhpcPlaceholderTime.getPrice();
|
||||||
|
String pattern = "HH:mm:ss";
|
||||||
|
Long startOne = DateUtil.parse("00:00:00", pattern).getTime();
|
||||||
|
Long endOne = DateUtil.parse("23:59:59", pattern).getTime();
|
||||||
|
|
||||||
|
String format1 = DateUtil.format(xhpcPlaceholderTime.getStartTime(), pattern);
|
||||||
|
String format2 = DateUtil.format(xhpcPlaceholderTime.getEndTime(), pattern);
|
||||||
|
|
||||||
|
Long time1 = DateUtil.parse(format1, pattern).getTime();
|
||||||
|
Long time2 = DateUtil.parse(format2, pattern).getTime();
|
||||||
|
XhpcPlaceholderTimeOrderDto placeholderTimeOrderDto = new XhpcPlaceholderTimeOrderDto();
|
||||||
|
if (startOne < time1) {
|
||||||
|
startOne = time1;
|
||||||
|
placeholderTimeOrderDto.setStartTime(xhpcPlaceholderTime.getStartTime());
|
||||||
|
}else{
|
||||||
|
placeholderTimeOrderDto.setStartTime(DateUtil.parse("00:00:00", pattern));
|
||||||
|
}
|
||||||
|
if (endOne > time2) {
|
||||||
|
endOne = time2;
|
||||||
|
placeholderTimeOrderDto.setEndTime(xhpcPlaceholderTime.getEndTime());
|
||||||
|
}else{
|
||||||
|
placeholderTimeOrderDto.setEndTime(DateUtil.parse("23:59:59", pattern));
|
||||||
|
}
|
||||||
|
long betweOne = (endOne - startOne) / 60000;
|
||||||
|
int i1 = (int) (betweOne);
|
||||||
|
|
||||||
|
if (freeTime - i1 > 0) {
|
||||||
|
freeTime = freeTime - i1;
|
||||||
|
;
|
||||||
|
i1 = 0;
|
||||||
|
} else {
|
||||||
|
i1 = i1 - freeTime;
|
||||||
|
freeTime = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
BigDecimal multiply = new BigDecimal(i1).multiply(price);
|
||||||
|
totalMoney = totalMoney.add(multiply);
|
||||||
|
|
||||||
|
placeholderTimeOrderDto.setPlaceholderOrderId(xhpcPlaceholderOrder.getPlaceholderOrderId());
|
||||||
|
placeholderTimeOrderDto.setPrice(price);
|
||||||
|
placeholderTimeOrderDto.setTotalMoney(multiply);
|
||||||
|
placeholderTimeOrderDto.setTotalTimeSpan(i1);
|
||||||
|
xhpcPlaceholderOrderMapper.insertXhpcPlaceholderTimeOrder(placeholderTimeOrderDto);
|
||||||
|
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
placeholderTimeOrderDto.setStartTime(DateUtil.parse(start, pattern));
|
List<XhpcPlaceholderTime> xhpcPlaceholderTimeTwo = xhpcPlaceholderOrderMapper.getXhpcPlaceholderTime("00:00:00", end, xhpcPlaceholderOrder.getPlaceholderId());
|
||||||
|
for (int i = 0; i < xhpcPlaceholderTimeTwo.size(); i++) {
|
||||||
|
XhpcPlaceholderTime xhpcPlaceholderTime = xhpcPlaceholderTimeTwo.get(i);
|
||||||
|
BigDecimal price = xhpcPlaceholderTime.getPrice();
|
||||||
|
String pattern = "HH:mm:ss";
|
||||||
|
Long startOne = DateUtil.parse("00:00:00", pattern).getTime();
|
||||||
|
Long endOne = DateUtil.parse(end, pattern).getTime();
|
||||||
|
|
||||||
|
String format1 = DateUtil.format(xhpcPlaceholderTime.getStartTime(), pattern);
|
||||||
|
String format2 = DateUtil.format(xhpcPlaceholderTime.getEndTime(), pattern);
|
||||||
|
|
||||||
|
Long time1 = DateUtil.parse(format1, pattern).getTime();
|
||||||
|
Long time2 = DateUtil.parse(format2, pattern).getTime();
|
||||||
|
|
||||||
|
XhpcPlaceholderTimeOrderDto placeholderTimeOrderDto = new XhpcPlaceholderTimeOrderDto();
|
||||||
|
if (startOne < time1) {
|
||||||
|
startOne = time1;
|
||||||
|
placeholderTimeOrderDto.setStartTime(xhpcPlaceholderTime.getStartTime());
|
||||||
|
}else{
|
||||||
|
placeholderTimeOrderDto.setStartTime(DateUtil.parse("00:00:00", pattern));
|
||||||
|
}
|
||||||
|
if (endOne > time2) {
|
||||||
|
endOne = time2;
|
||||||
|
placeholderTimeOrderDto.setEndTime(xhpcPlaceholderTime.getEndTime());
|
||||||
|
}else{
|
||||||
|
placeholderTimeOrderDto.setEndTime(DateUtil.parse(end, pattern));
|
||||||
|
}
|
||||||
|
long betweOne = (endOne - startOne) / 60000;
|
||||||
|
int i1 = (int) (betweOne);
|
||||||
|
|
||||||
|
if (freeTime - i1 > 0) {
|
||||||
|
freeTime = freeTime - i1;
|
||||||
|
;
|
||||||
|
i1 = 0;
|
||||||
|
} else {
|
||||||
|
i1 = i1 - freeTime;
|
||||||
|
freeTime = 0;
|
||||||
|
}
|
||||||
|
BigDecimal multiply = new BigDecimal(i1).multiply(price);
|
||||||
|
totalMoney = totalMoney.add(multiply);
|
||||||
|
|
||||||
|
|
||||||
|
placeholderTimeOrderDto.setPlaceholderOrderId(xhpcPlaceholderOrder.getPlaceholderOrderId());
|
||||||
|
placeholderTimeOrderDto.setPrice(price);
|
||||||
|
placeholderTimeOrderDto.setTotalMoney(multiply);
|
||||||
|
placeholderTimeOrderDto.setTotalTimeSpan(i1);
|
||||||
|
xhpcPlaceholderOrderMapper.insertXhpcPlaceholderTimeOrder(placeholderTimeOrderDto);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (endOne > time2) {
|
|
||||||
endOne = time2;
|
|
||||||
placeholderTimeOrderDto.setEndTime(xhpcPlaceholderTime.getEndTime());
|
|
||||||
}else{
|
|
||||||
placeholderTimeOrderDto.setEndTime(DateUtil.parse("23:59:59", pattern));
|
|
||||||
}
|
|
||||||
long betweOne = (endOne - startOne) / 60000;
|
|
||||||
int i1 = (int) (betweOne);
|
|
||||||
|
|
||||||
if (freeTime - i1 > 0) {
|
|
||||||
freeTime = freeTime - i1;
|
|
||||||
;
|
|
||||||
i1 = 0;
|
|
||||||
} else {
|
|
||||||
i1 = i1 - freeTime;
|
|
||||||
freeTime = 0;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
BigDecimal multiply = new BigDecimal(i1).multiply(price);
|
|
||||||
totalMoney = totalMoney.add(multiply);
|
|
||||||
|
|
||||||
placeholderTimeOrderDto.setPlaceholderOrderId(xhpcPlaceholderOrder.getPlaceholderOrderId());
|
|
||||||
placeholderTimeOrderDto.setPrice(price);
|
|
||||||
placeholderTimeOrderDto.setTotalMoney(multiply);
|
|
||||||
placeholderTimeOrderDto.setTotalTimeSpan(i1);
|
|
||||||
xhpcPlaceholderOrderMapper.insertXhpcPlaceholderTimeOrder(placeholderTimeOrderDto);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
List<XhpcPlaceholderTime> xhpcPlaceholderTimeTwo = xhpcPlaceholderOrderMapper.getXhpcPlaceholderTime("00:00:00", end, xhpcPlaceholderOrder.getPlaceholderId());
|
|
||||||
for (int i = 0; i < xhpcPlaceholderTimeTwo.size(); i++) {
|
|
||||||
XhpcPlaceholderTime xhpcPlaceholderTime = xhpcPlaceholderTimeOne.get(i);
|
|
||||||
BigDecimal price = xhpcPlaceholderTime.getPrice();
|
|
||||||
String pattern = "HH:mm:ss";
|
|
||||||
Long startOne = DateUtil.parse("00:00:00", pattern).getTime();
|
|
||||||
Long endOne = DateUtil.parse(end, pattern).getTime();
|
|
||||||
|
|
||||||
String format1 = DateUtil.format(xhpcPlaceholderTime.getStartTime(), pattern);
|
|
||||||
String format2 = DateUtil.format(xhpcPlaceholderTime.getEndTime(), pattern);
|
|
||||||
|
|
||||||
Long time1 = DateUtil.parse(format1, pattern).getTime();
|
|
||||||
Long time2 = DateUtil.parse(format2, pattern).getTime();
|
|
||||||
|
|
||||||
XhpcPlaceholderTimeOrderDto placeholderTimeOrderDto = new XhpcPlaceholderTimeOrderDto();
|
|
||||||
if (startOne < time1) {
|
|
||||||
startOne = time1;
|
|
||||||
placeholderTimeOrderDto.setStartTime(xhpcPlaceholderTime.getStartTime());
|
|
||||||
}else{
|
|
||||||
placeholderTimeOrderDto.setStartTime(DateUtil.parse("00:00:00", pattern));
|
|
||||||
}
|
|
||||||
if (endOne > time2) {
|
|
||||||
endOne = time2;
|
|
||||||
placeholderTimeOrderDto.setEndTime(xhpcPlaceholderTime.getEndTime());
|
|
||||||
}else{
|
|
||||||
placeholderTimeOrderDto.setEndTime(DateUtil.parse(end, pattern));
|
|
||||||
}
|
|
||||||
long betweOne = (endOne - startOne) / 60000;
|
|
||||||
int i1 = (int) (betweOne);
|
|
||||||
|
|
||||||
if (freeTime - i1 > 0) {
|
|
||||||
freeTime = freeTime - i1;
|
|
||||||
;
|
|
||||||
i1 = 0;
|
|
||||||
} else {
|
|
||||||
i1 = i1 - freeTime;
|
|
||||||
freeTime = 0;
|
|
||||||
}
|
|
||||||
BigDecimal multiply = new BigDecimal(i1).multiply(price);
|
|
||||||
totalMoney = totalMoney.add(multiply);
|
|
||||||
|
|
||||||
|
|
||||||
placeholderTimeOrderDto.setPlaceholderOrderId(xhpcPlaceholderOrder.getPlaceholderOrderId());
|
|
||||||
placeholderTimeOrderDto.setPrice(price);
|
|
||||||
placeholderTimeOrderDto.setTotalMoney(multiply);
|
|
||||||
placeholderTimeOrderDto.setTotalTimeSpan(i1);
|
|
||||||
xhpcPlaceholderOrderMapper.insertXhpcPlaceholderTimeOrder(placeholderTimeOrderDto);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
List<XhpcPlaceholderTime> xhpcPlaceholderTimeOne = xhpcPlaceholderOrderMapper.getXhpcPlaceholderTime(start, end, xhpcPlaceholderOrder.getPlaceholderId());
|
List<XhpcPlaceholderTime> xhpcPlaceholderTimeOne = xhpcPlaceholderOrderMapper.getXhpcPlaceholderTime(start, end, xhpcPlaceholderOrder.getPlaceholderId());
|
||||||
for (int i = 0; i < xhpcPlaceholderTimeOne.size(); i++) {
|
for (int i = 0; i < xhpcPlaceholderTimeOne.size(); i++) {
|
||||||
XhpcPlaceholderTime xhpcPlaceholderTime = xhpcPlaceholderTimeOne.get(i);
|
XhpcPlaceholderTime xhpcPlaceholderTime = xhpcPlaceholderTimeOne.get(i);
|
||||||
@ -235,6 +292,9 @@ public class XhpcPlaceholderOrderServiceImpl implements IXhpcPlaceholderOrderSer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(totalMoney.compareTo(new BigDecimal(50)) == 1){
|
||||||
|
totalMoney = new BigDecimal(50);
|
||||||
|
}
|
||||||
xhpcPlaceholderOrder.setTotalMoney(totalMoney);
|
xhpcPlaceholderOrder.setTotalMoney(totalMoney);
|
||||||
if (new BigDecimal(0).compareTo(new BigDecimal(between)) == 1) {
|
if (new BigDecimal(0).compareTo(new BigDecimal(between)) == 1) {
|
||||||
xhpcPlaceholderOrder.setOvertimePrice(totalMoney.divide(new BigDecimal(between), 2, BigDecimal.ROUND_HALF_UP));
|
xhpcPlaceholderOrder.setOvertimePrice(totalMoney.divide(new BigDecimal(between), 2, BigDecimal.ROUND_HALF_UP));
|
||||||
@ -299,6 +359,7 @@ public class XhpcPlaceholderOrderServiceImpl implements IXhpcPlaceholderOrderSer
|
|||||||
//桩的统计、该时段金额
|
//桩的统计、该时段金额
|
||||||
List<Map<String, Object>> list = new ArrayList<>();
|
List<Map<String, Object>> list = new ArrayList<>();
|
||||||
if (!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())) {
|
if (!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())) {
|
||||||
|
startPage();
|
||||||
if (UserTypeUtil.SYS_SUPER_TYPE_ONE.equals(loginUser.getSuperType())) {
|
if (UserTypeUtil.SYS_SUPER_TYPE_ONE.equals(loginUser.getSuperType())) {
|
||||||
tenantId = loginUser.getTenantId();
|
tenantId = loginUser.getTenantId();
|
||||||
Long logOperatorId = sysUser.getOperatorId();
|
Long logOperatorId = sysUser.getOperatorId();
|
||||||
@ -312,6 +373,7 @@ public class XhpcPlaceholderOrderServiceImpl implements IXhpcPlaceholderOrderSer
|
|||||||
list = xhpcPlaceholderOrderMapper.getListPage(chargingStationId, chargingPileId, terminalId, phone, transactionNumber, 2, chargingStationName, operatorId, source, beginStartTime, beginEndTime, logUserId, type, number, affiliationOrganization, evcsOrderNo, plateNum, internetId, internetSerialNumber, terminalName, vinCode, overStartTime, overEndTime, personnelId, confirmResult, tenantId, 0);
|
list = xhpcPlaceholderOrderMapper.getListPage(chargingStationId, chargingPileId, terminalId, phone, transactionNumber, 2, chargingStationName, operatorId, source, beginStartTime, beginEndTime, logUserId, type, number, affiliationOrganization, evcsOrderNo, plateNum, internetId, internetSerialNumber, terminalName, vinCode, overStartTime, overEndTime, personnelId, confirmResult, tenantId, 0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
startPage();
|
||||||
list = xhpcPlaceholderOrderMapper.getListPage(chargingStationId, chargingPileId, terminalId, phone, transactionNumber, 0, chargingStationName, operatorId, source, beginStartTime, beginEndTime, userId, type, number, affiliationOrganization, evcsOrderNo, plateNum, internetId, internetSerialNumber, terminalName, vinCode, overStartTime, overEndTime, personnelId, confirmResult, tenantId, 0);
|
list = xhpcPlaceholderOrderMapper.getListPage(chargingStationId, chargingPileId, terminalId, phone, transactionNumber, 0, chargingStationName, operatorId, source, beginStartTime, beginEndTime, userId, type, number, affiliationOrganization, evcsOrderNo, plateNum, internetId, internetSerialNumber, terminalName, vinCode, overStartTime, overEndTime, personnelId, confirmResult, tenantId, 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1633,17 +1633,18 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
|
|||||||
placeholderOrder.setStartTime(xhpcHistoryOrder.getEndTime());
|
placeholderOrder.setStartTime(xhpcHistoryOrder.getEndTime());
|
||||||
placeholderOrder.setCreateTime(new Date());
|
placeholderOrder.setCreateTime(new Date());
|
||||||
placeholderOrder.setTenantId(xhpcHistoryOrder.getTenantId());
|
placeholderOrder.setTenantId(xhpcHistoryOrder.getTenantId());
|
||||||
|
placeholderOrder.setPlateNum(xhpcChargeOrder.getPlateNum());
|
||||||
placeholderOrderService.insertXhpcPlaceholderOrder(placeholderOrder);
|
placeholderOrderService.insertXhpcPlaceholderOrder(placeholderOrder);
|
||||||
logger.info("<<<<<<<<<<<<<<getPlaceholderOrderId>>>>>>>>>>>>>>>>"+placeholderOrder.getPlaceholderOrderId());
|
logger.info("<<<<<<<<<<<<<<getPlaceholderOrderId>>>>>>>>>>>>>>>>"+placeholderOrder.getPlaceholderOrderId());
|
||||||
String gunkey = "placeholderOrder:"+substring+":"+xhpcHistoryOrder.getSerialNumber();
|
// String gunkey = "placeholderOrder:"+substring+":"+xhpcHistoryOrder.getSerialNumber();
|
||||||
Map<String, Object> cacheGun =new HashMap<>();
|
// Map<String, Object> cacheGun =new HashMap<>();
|
||||||
cacheGun.put("source",xhpcHistoryOrder.getSource());
|
// cacheGun.put("source",xhpcHistoryOrder.getSource());
|
||||||
cacheGun.put("placeholderOrderId",placeholderOrder.getPlaceholderOrderId());
|
// cacheGun.put("placeholderOrderId",placeholderOrder.getPlaceholderOrderId());
|
||||||
cacheGun.put("status",0);
|
// cacheGun.put("status",0);
|
||||||
cacheGun.put("serialNumber",xhpcHistoryOrder.getSerialNumber());
|
// cacheGun.put("serialNumber",xhpcHistoryOrder.getSerialNumber());
|
||||||
cacheGun.put("internetSerialNumber",xhpcHistoryOrder.getInternetSerialNumber());
|
// cacheGun.put("internetSerialNumber",xhpcHistoryOrder.getInternetSerialNumber());
|
||||||
cacheGun.put("startTime",DateUtil.format(xhpcHistoryOrder.getEndTime(),"yyyy-MM-dd HH:mm:ss"));
|
// cacheGun.put("startTime",DateUtil.format(xhpcHistoryOrder.getEndTime(),"yyyy-MM-dd HH:mm:ss"));
|
||||||
REDIS.setCacheMap(gunkey, cacheGun);
|
//REDIS.setCacheMap(gunkey, cacheGun);
|
||||||
}
|
}
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -35,6 +35,9 @@
|
|||||||
<result column="tenant_id" property="tenantId"/>
|
<result column="tenant_id" property="tenantId"/>
|
||||||
<result column="charging_capacity" property="chargingCapacity"/>
|
<result column="charging_capacity" property="chargingCapacity"/>
|
||||||
<result column="suncha_status" property="sunchaStatus"/>
|
<result column="suncha_status" property="sunchaStatus"/>
|
||||||
|
<result column="Plate_num" property="plateNum"/>
|
||||||
|
<result column="driver_id" property="driverId"/>
|
||||||
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<resultMap id="BaseResultMap" type="com.xhpc.common.domain.XhpcTerminal">
|
<resultMap id="BaseResultMap" type="com.xhpc.common.domain.XhpcTerminal">
|
||||||
@ -473,7 +476,7 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getSerialNumberMessage" resultMap="XhpcChargeOrderResult">
|
<select id="getSerialNumberMessage" resultMap="XhpcChargeOrderResult">
|
||||||
select *,Plate_num as PlateNum
|
select *,Plate_num as plateNum
|
||||||
from xhpc_charge_order
|
from xhpc_charge_order
|
||||||
where serial_number = #{serialNumber}
|
where serial_number = #{serialNumber}
|
||||||
limit 1
|
limit 1
|
||||||
|
|||||||
@ -255,7 +255,7 @@
|
|||||||
<select id="getXhpcPlaceholderTime" resultType="com.xhpc.common.domain.XhpcPlaceholderTime">
|
<select id="getXhpcPlaceholderTime" resultType="com.xhpc.common.domain.XhpcPlaceholderTime">
|
||||||
select
|
select
|
||||||
start_time as startTime,
|
start_time as startTime,
|
||||||
end_time as endTime,
|
replace(end_time, '00:00:00', '23:59:59') as endTime,
|
||||||
price as price
|
price as price
|
||||||
from xhpc_placeholder_time
|
from xhpc_placeholder_time
|
||||||
where placeholder_time_id in (
|
where placeholder_time_id in (
|
||||||
@ -458,6 +458,7 @@
|
|||||||
select
|
select
|
||||||
ho.placeholder_order_id as placeholderOrderId,
|
ho.placeholder_order_id as placeholderOrderId,
|
||||||
ho.serial_number as serialNumber,
|
ho.serial_number as serialNumber,
|
||||||
|
ho.placeholder_id as placeholderId,
|
||||||
ct.name as chargingStationName,
|
ct.name as chargingStationName,
|
||||||
ter.pile_serial_number as pileSerialNumber,
|
ter.pile_serial_number as pileSerialNumber,
|
||||||
ter.name as terminalName,
|
ter.name as terminalName,
|
||||||
@ -533,7 +534,7 @@
|
|||||||
|
|
||||||
<select id="getXhpcPlaceholderTimeOrder" resultType="map">
|
<select id="getXhpcPlaceholderTimeOrder" resultType="map">
|
||||||
select
|
select
|
||||||
concat(start_time,"-",end_time) as time,
|
concat(start_time,"-",replace(end_time, '00:00:00', '23:59:59')) as time,
|
||||||
price as price,
|
price as price,
|
||||||
total_money as totalMoney,
|
total_money as totalMoney,
|
||||||
total_time_span as totalTimeSpan
|
total_time_span as totalTimeSpan
|
||||||
@ -626,12 +627,6 @@
|
|||||||
<if test="null != tenantId ">
|
<if test="null != tenantId ">
|
||||||
#{tenantId},
|
#{tenantId},
|
||||||
</if>
|
</if>
|
||||||
<if test="null != chargingMode and '' != chargingMode">
|
|
||||||
#{chargingMode},
|
|
||||||
</if>
|
|
||||||
<if test="null != driverId and '' != driverId">
|
|
||||||
#{driverId},
|
|
||||||
</if>
|
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -1481,6 +1481,15 @@
|
|||||||
</if>
|
</if>
|
||||||
GROUP BY xcs.charging_station_id) us on us.charging_station_id = xcs.charging_station_id
|
GROUP BY xcs.charging_station_id) us on us.charging_station_id = xcs.charging_station_id
|
||||||
where xcs.del_flag =0
|
where xcs.del_flag =0
|
||||||
|
<if test="status==1">
|
||||||
|
and xcs.charging_station_id in (select charging_station_id from xhpc_charging_station where operator_id=#{logOperatorId})
|
||||||
|
</if>
|
||||||
|
<if test="status==2">
|
||||||
|
and xcs.charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{logOperatorId})
|
||||||
|
</if>
|
||||||
|
<if test="status==3">
|
||||||
|
and find_in_set (xcs.charging_station_id,(select station_ids from xhpc_work_user where work_user_id=#{logOperatorId}))
|
||||||
|
</if>
|
||||||
GROUP BY xcs.charging_station_id
|
GROUP BY xcs.charging_station_id
|
||||||
order by xcs.charging_station_id
|
order by xcs.charging_station_id
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -418,7 +418,7 @@ public class ChargingController {
|
|||||||
|
|
||||||
String pileNo = startChargingData.getPileNo();
|
String pileNo = startChargingData.getPileNo();
|
||||||
String pkey = "pile:".concat(pileNo);
|
String pkey = "pile:".concat(pileNo);
|
||||||
log.info("==================pkey======================"+pkey);
|
//log.info("==================pkey======================"+pkey);
|
||||||
Map<String, Object> cachePile = REDIS.getCacheMap(pkey);
|
Map<String, Object> cachePile = REDIS.getCacheMap(pkey);
|
||||||
R<Object> r = checkPile(cachePile);
|
R<Object> r = checkPile(cachePile);
|
||||||
if (r.getCode() == 200) {
|
if (r.getCode() == 200) {
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import com.xhpc.pp.mapper.XhpcDeviceMessageMapper;
|
|||||||
import com.xhpc.pp.tx.ServiceParameter;
|
import com.xhpc.pp.tx.ServiceParameter;
|
||||||
import com.xhpc.pp.tx.ServiceResult;
|
import com.xhpc.pp.tx.ServiceResult;
|
||||||
import com.xhpc.pp.tx.logic.ServiceLogic;
|
import com.xhpc.pp.tx.logic.ServiceLogic;
|
||||||
|
import com.xhpc.pp.utils.BMSCurrentParser;
|
||||||
import com.xhpc.pp.utils.HexUtils;
|
import com.xhpc.pp.utils.HexUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@ -49,20 +50,20 @@ public class BmsReqChargerOutputDataLogic implements ServiceLogic {
|
|||||||
int bmsVoltageRequest = HexUtils.reverseHexInt(hex.substring(idxStart, 4 + idxStart));//BMS 电压需求
|
int bmsVoltageRequest = HexUtils.reverseHexInt(hex.substring(idxStart, 4 + idxStart));//BMS 电压需求
|
||||||
|
|
||||||
idxStart = 4 + idxStart;
|
idxStart = 4 + idxStart;
|
||||||
|
double bmsCurrentRequest = BMSCurrentParser.parseBmsCurrent(hex.substring(idxStart, 4 + idxStart),400);
|
||||||
int bmsCurrentRequest = HexUtils.reverseHexInt(hex.substring(idxStart, 4 + idxStart));//BMS 电流需求
|
//int bmsCurrentRequest = HexUtils.reverseHexInt(hex.substring(idxStart, 4 + idxStart));//BMS 电流需求
|
||||||
idxStart = 6 + idxStart;
|
idxStart = 6 + idxStart;
|
||||||
|
|
||||||
int bmsChargingVolt = HexUtils.reverseHexInt(hex.substring(idxStart, 4 + idxStart));//BMS 充电电压测量值
|
int bmsChargingVolt = HexUtils.reverseHexInt(hex.substring(idxStart, 4 + idxStart));//BMS 充电电压测量值
|
||||||
idxStart = 4 + idxStart;
|
idxStart = 4 + idxStart;
|
||||||
int bmsChargingCurrent = HexUtils.reverseHexInt(hex.substring(idxStart, 4 + idxStart));//BMS 充电电流测量值
|
|
||||||
|
|
||||||
|
|
||||||
|
double bmsChargingCurrent = BMSCurrentParser.parseBmsCurrent(hex.substring(idxStart, 4 + idxStart),400);
|
||||||
idxStart = 88;
|
idxStart = 88;
|
||||||
|
|
||||||
int pileVoltageOutput = HexUtils.reverseHexInt(hex.substring(idxStart, 4 + idxStart));//电桩电压输出值
|
int pileVoltageOutput = HexUtils.reverseHexInt(hex.substring(idxStart, 4 + idxStart));//电桩电压输出值
|
||||||
idxStart = 4 + idxStart;
|
idxStart = 4 + idxStart;
|
||||||
int pileCurrentOutput = HexUtils.reverseHexInt(hex.substring(idxStart, 4 + idxStart));//电桩电流输出值
|
double pileCurrentOutput = BMSCurrentParser.parseBmsCurrent(hex.substring(idxStart, 4 + idxStart),400);//电桩电流输出值
|
||||||
|
|
||||||
|
|
||||||
String orderNo = (String) req.get("orderNo");
|
String orderNo = (String) req.get("orderNo");
|
||||||
String orderKey = "order:".concat(orderNo).concat(".bms");
|
String orderKey = "order:".concat(orderNo).concat(".bms");
|
||||||
@ -85,43 +86,45 @@ public class BmsReqChargerOutputDataLogic implements ServiceLogic {
|
|||||||
cacheBmsReqChargerOutputData.setPileNo(orderData.getPileNo());
|
cacheBmsReqChargerOutputData.setPileNo(orderData.getPileNo());
|
||||||
cacheBmsReqChargerOutputData.setGunId(orderData.getGunId());
|
cacheBmsReqChargerOutputData.setGunId(orderData.getGunId());
|
||||||
cacheBmsReqChargerOutputData.setBmsVoltageRequest(new BigDecimal(bmsVoltageRequest).divide(new BigDecimal(10),BigDecimal.ROUND_DOWN).doubleValue());
|
cacheBmsReqChargerOutputData.setBmsVoltageRequest(new BigDecimal(bmsVoltageRequest).divide(new BigDecimal(10),BigDecimal.ROUND_DOWN).doubleValue());
|
||||||
try{
|
// try{
|
||||||
BigDecimal subtract1 = new BigDecimal(bmsCurrentRequest).divide(new BigDecimal(10), BigDecimal.ROUND_DOWN).subtract(new BigDecimal(400));
|
// BigDecimal subtract1 = new BigDecimal(bmsCurrentRequest).divide(new BigDecimal(10), BigDecimal.ROUND_DOWN).subtract(new BigDecimal(400));
|
||||||
if(subtract1.compareTo(new BigDecimal(0))<0){
|
// if(subtract1.compareTo(new BigDecimal(0))<0){
|
||||||
subtract1 =subtract1.abs();
|
// subtract1 =subtract1.abs();
|
||||||
}
|
// }
|
||||||
cacheBmsReqChargerOutputData.setBmsCurrentRequest(subtract1.doubleValue());
|
// cacheBmsReqChargerOutputData.setBmsCurrentRequest(subtract1.doubleValue());
|
||||||
}catch (Exception e){
|
// }catch (Exception e){
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
|
cacheBmsReqChargerOutputData.setBmsCurrentRequest(new BigDecimal(orderData.getBmsCurrentRequest()).abs().setScale(2,RoundingMode.DOWN).doubleValue());
|
||||||
cacheBmsReqChargerOutputData.setBmsChargingMod(HexUtils.reverseHexInt(orderData.getBmsChargingMod()));
|
cacheBmsReqChargerOutputData.setBmsChargingMod(HexUtils.reverseHexInt(orderData.getBmsChargingMod()));
|
||||||
cacheBmsReqChargerOutputData.setBmsChargingVolt(new BigDecimal(bmsChargingVolt).divide(new BigDecimal(10),BigDecimal.ROUND_DOWN).doubleValue());
|
cacheBmsReqChargerOutputData.setBmsChargingVolt(new BigDecimal(bmsChargingVolt).divide(new BigDecimal(10),BigDecimal.ROUND_DOWN).doubleValue());
|
||||||
|
|
||||||
try{
|
// try{
|
||||||
BigDecimal subtract2 = new BigDecimal(bmsChargingCurrent).divide(new BigDecimal(10), BigDecimal.ROUND_DOWN).subtract(new BigDecimal(400));
|
// BigDecimal subtract2 = new BigDecimal(bmsChargingCurrent).divide(new BigDecimal(10), BigDecimal.ROUND_DOWN).subtract(new BigDecimal(400));
|
||||||
if(subtract2.compareTo(new BigDecimal(0))<0){
|
// if(subtract2.compareTo(new BigDecimal(0))<0){
|
||||||
subtract2 =subtract2.abs();
|
// subtract2 =subtract2.abs();
|
||||||
}
|
// }
|
||||||
cacheBmsReqChargerOutputData.setBmsChargingCurrent(subtract2.doubleValue());
|
// cacheBmsReqChargerOutputData.setBmsChargingCurrent(subtract2.doubleValue());
|
||||||
|
//
|
||||||
}catch (Exception e){
|
// }catch (Exception e){
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
|
cacheBmsReqChargerOutputData.setBmsChargingCurrent(new BigDecimal(orderData.getBmsChargingCurrent()).abs().setScale(2,RoundingMode.DOWN).doubleValue());
|
||||||
cacheBmsReqChargerOutputData.setMonoBatteryVolt(convertDouble(Integer.parseInt(orderData.getMonoBatteryVoltGroupId().substring(0, 3), 16) * 0.01));
|
cacheBmsReqChargerOutputData.setMonoBatteryVolt(convertDouble(Integer.parseInt(orderData.getMonoBatteryVoltGroupId().substring(0, 3), 16) * 0.01));
|
||||||
cacheBmsReqChargerOutputData.setSoc(HexUtils.reverseHexInt(orderData.getSoc()));
|
cacheBmsReqChargerOutputData.setSoc(HexUtils.reverseHexInt(orderData.getSoc()));
|
||||||
cacheBmsReqChargerOutputData.setBmsEstRemainingTime(HexUtils.reverseHexInt(orderData.getBmsEstRemainingTime()));
|
cacheBmsReqChargerOutputData.setBmsEstRemainingTime(HexUtils.reverseHexInt(orderData.getBmsEstRemainingTime()));
|
||||||
cacheBmsReqChargerOutputData.setPileVoltageOutput(new BigDecimal(pileVoltageOutput).divide(new BigDecimal(10),BigDecimal.ROUND_DOWN).doubleValue());
|
cacheBmsReqChargerOutputData.setPileVoltageOutput(new BigDecimal(pileVoltageOutput).divide(new BigDecimal(10),BigDecimal.ROUND_DOWN).doubleValue());
|
||||||
try{
|
// try{
|
||||||
|
//
|
||||||
BigDecimal subtract = new BigDecimal(pileCurrentOutput).divide(new BigDecimal(10), BigDecimal.ROUND_DOWN).subtract(new BigDecimal(400));
|
// BigDecimal subtract = new BigDecimal(pileCurrentOutput).divide(new BigDecimal(10), BigDecimal.ROUND_DOWN).subtract(new BigDecimal(400));
|
||||||
if(subtract.compareTo(new BigDecimal(0))<0){
|
// if(subtract.compareTo(new BigDecimal(0))<0){
|
||||||
subtract =subtract.abs();
|
// subtract =subtract.abs();
|
||||||
}
|
// }
|
||||||
cacheBmsReqChargerOutputData.setPileCurrentOutput(subtract.doubleValue());
|
// cacheBmsReqChargerOutputData.setPileCurrentOutput(subtract.doubleValue());
|
||||||
}catch (Exception e){
|
// }catch (Exception e){
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
|
cacheBmsReqChargerOutputData.setPileCurrentOutput(new BigDecimal(orderData.getPileCurrentOutput()).abs().setScale(2,RoundingMode.DOWN).doubleValue());
|
||||||
cacheBmsReqChargerOutputData.setChargingTimeSummary(HexUtils.reverseHexInt(orderData.getChargingTimeSummary()));
|
cacheBmsReqChargerOutputData.setChargingTimeSummary(HexUtils.reverseHexInt(orderData.getChargingTimeSummary()));
|
||||||
cacheBmsReqChargerOutputData.setMonoBatteryVoltGroupId(Integer.parseInt(orderData.getMonoBatteryVoltGroupId().substring(3), 16));
|
cacheBmsReqChargerOutputData.setMonoBatteryVoltGroupId(Integer.parseInt(orderData.getMonoBatteryVoltGroupId().substring(3), 16));
|
||||||
cacheBmsReqChargerOutputData.setHex(orderData.getHex());
|
cacheBmsReqChargerOutputData.setHex(orderData.getHex());
|
||||||
@ -211,18 +214,18 @@ public class BmsReqChargerOutputDataLogic implements ServiceLogic {
|
|||||||
int idxStart = 60;
|
int idxStart = 60;
|
||||||
|
|
||||||
int bmsVoltageRequest = HexUtils.reverseHexInt(hex.substring(idxStart, 4 + idxStart));//BMS 电压需求
|
int bmsVoltageRequest = HexUtils.reverseHexInt(hex.substring(idxStart, 4 + idxStart));//BMS 电压需求
|
||||||
System.out.println("===================bmsVoltageRequest========================="+bmsVoltageRequest);
|
// System.out.println("===================bmsVoltageRequest========================="+bmsVoltageRequest);
|
||||||
|
|
||||||
idxStart =idxStart+4;
|
idxStart =idxStart+4;
|
||||||
int bmsCurrentRequest = HexUtils.reverseHexInt(hex.substring(idxStart, 4 + idxStart));//BMS 电流需求
|
int bmsCurrentRequest = HexUtils.reverseHexInt(hex.substring(idxStart, 4 + idxStart));//BMS 电流需求
|
||||||
System.out.println("===================bmsCurrentRequest========================="+bmsCurrentRequest);
|
//System.out.println("===================bmsCurrentRequest========================="+bmsCurrentRequest);
|
||||||
idxStart = 88;
|
idxStart = 88;
|
||||||
|
|
||||||
int pileVoltageOutput = HexUtils.reverseHexInt(hex.substring(idxStart, 4 + idxStart));//电桩电压输出值
|
int pileVoltageOutput = HexUtils.reverseHexInt(hex.substring(idxStart, 4 + idxStart));//电桩电压输出值
|
||||||
System.out.println("===================pileVoltageOutput========================="+pileVoltageOutput);
|
// System.out.println("===================pileVoltageOutput========================="+pileVoltageOutput);
|
||||||
idxStart = 4 + idxStart;
|
idxStart = 4 + idxStart;
|
||||||
int pileCurrentOutput = HexUtils.reverseHexInt(hex.substring(idxStart, 4 + idxStart));//电桩电流输出值
|
int pileCurrentOutput = HexUtils.reverseHexInt(hex.substring(idxStart, 4 + idxStart));//电桩电流输出值
|
||||||
System.out.println("===================pileCurrentOutput========================="+pileCurrentOutput);
|
// System.out.println("===================pileCurrentOutput========================="+pileCurrentOutput);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -230,11 +233,17 @@ public class BmsReqChargerOutputDataLogic implements ServiceLogic {
|
|||||||
if(subtract1.compareTo(new BigDecimal(0))<0){
|
if(subtract1.compareTo(new BigDecimal(0))<0){
|
||||||
subtract1 =subtract1.abs();
|
subtract1 =subtract1.abs();
|
||||||
}
|
}
|
||||||
System.out.println("===================subtract1========================="+subtract1);
|
// System.out.println("===================subtract1========================="+subtract1);
|
||||||
BigDecimal subtract = new BigDecimal(2905).divide(new BigDecimal(10), BigDecimal.ROUND_DOWN).subtract(new BigDecimal(400));
|
BigDecimal subtract = new BigDecimal(2905).divide(new BigDecimal(10), BigDecimal.ROUND_DOWN).subtract(new BigDecimal(400));
|
||||||
if(subtract.compareTo(new BigDecimal(0))<0){
|
if(subtract.compareTo(new BigDecimal(0))<0){
|
||||||
subtract =subtract.abs();
|
subtract =subtract.abs();
|
||||||
}
|
}
|
||||||
System.out.println("===================subtract========================="+subtract);
|
// System.out.println("===================subtract========================="+subtract);
|
||||||
|
|
||||||
|
|
||||||
|
String bmsData = "800C"; // 从BMS获取的实际数据
|
||||||
|
double current = BMSCurrentParser.parseBmsCurrent(bmsData,400);
|
||||||
|
System.out.println("BMS电流需求: " + current + " A");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,9 +57,9 @@ public class OrderDataLogic implements ServiceLogic {
|
|||||||
public ServiceResult service(ServiceParameter sp) throws Exception {
|
public ServiceResult service(ServiceParameter sp) throws Exception {
|
||||||
|
|
||||||
Map<String, Object> req = sp.getParameters();
|
Map<String, Object> req = sp.getParameters();
|
||||||
log.info("================订单结束报文==============================");
|
//log.info("================订单结束报文==============================");
|
||||||
log.info("================订单结束报文================req=============="+req.toString());
|
//log.info("================订单结束报文================req=============="+req.toString());
|
||||||
log.info("================订单结束报文==============================");
|
//log.info("================订单结束报文==============================");
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
OrderData orderData = objectMapper.convertValue(req, OrderData.class);
|
OrderData orderData = objectMapper.convertValue(req, OrderData.class);
|
||||||
String orderNo = orderData.getOrderNo();
|
String orderNo = orderData.getOrderNo();
|
||||||
|
|||||||
@ -134,6 +134,18 @@ public class RealtimeDataLogic implements ServiceLogic {
|
|||||||
cacheGun.put("orderkey","order:"+orderNo);
|
cacheGun.put("orderkey","order:"+orderNo);
|
||||||
final String orderstarttime = DateUtil.format(Calendar.getInstance().getTime(), NORM_DATETIME_FORMAT);
|
final String orderstarttime = DateUtil.format(Calendar.getInstance().getTime(), NORM_DATETIME_FORMAT);
|
||||||
cacheGun.put("pileStartTime", orderstarttime);
|
cacheGun.put("pileStartTime", orderstarttime);
|
||||||
|
|
||||||
|
// String key = "placeholderOrder:"+terminalId+":*";
|
||||||
|
// Collection<String> orderKeys = REDIS.keys(key);
|
||||||
|
// for (String okey : orderKeys) {
|
||||||
|
// Map<String, Object> cacheGunYu = REDIS.getCacheMap(okey);
|
||||||
|
// if(cacheGunYu !=null && "0".equals(cacheGunYu.get("status").toString()) && !okey.equals("placeholderOrder:"+terminalId+":"+orderNo)){
|
||||||
|
// cacheGunYu.put("status",1);
|
||||||
|
// cacheGunYu.put("endTime",DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss"));
|
||||||
|
// REDIS.setCacheMap(okey, cacheGunYu);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<CacheRealtimeData> realtimeDataList = (List<CacheRealtimeData>) cacheOrder.get("realtimeDataList");
|
List<CacheRealtimeData> realtimeDataList = (List<CacheRealtimeData>) cacheOrder.get("realtimeDataList");
|
||||||
@ -298,20 +310,20 @@ public class RealtimeDataLogic implements ServiceLogic {
|
|||||||
public void run() {
|
public void run() {
|
||||||
REDIS.setCacheObject("cdjgpc:realTime:"+orderNo,orderNo);
|
REDIS.setCacheObject("cdjgpc:realTime:"+orderNo,orderNo);
|
||||||
//插枪状态发生变化进行判断是否收停车费
|
//插枪状态发生变化进行判断是否收停车费
|
||||||
String vehicleGunStatus = pvgstable[Integer.parseInt(realtimeData.getVehicleGunStatus())];
|
// String vehicleGunStatus = pvgstable[Integer.parseInt(realtimeData.getVehicleGunStatus())];
|
||||||
if("否".equals(vehicleGunStatus)){
|
// if("否".equals(vehicleGunStatus)){
|
||||||
String gunkey = "placeholderOrder:"+terminalId+":*";
|
// String gunkey = "placeholderOrder:"+terminalId+":*";
|
||||||
|
// Collection<String> orderKeys = REDIS.keys(gunkey);
|
||||||
|
// for (String okey : orderKeys) {
|
||||||
|
// Map<String, Object> cacheGun = REDIS.getCacheMap(okey);
|
||||||
|
// if(cacheGun !=null && "0".equals(cacheGun.get("status").toString())){
|
||||||
|
// cacheGun.put("status",1);
|
||||||
|
// cacheGun.put("endTime",DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss"));
|
||||||
|
// REDIS.setCacheMap(okey, cacheGun);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
Collection<String> orderKeys = REDIS.keys(gunkey);
|
|
||||||
for (String okey : orderKeys) {
|
|
||||||
Map<String, Object> cacheGun = REDIS.getCacheMap(okey);
|
|
||||||
if(cacheGun !=null && "0".equals(cacheGun.get("status").toString())){
|
|
||||||
cacheGun.put("status",1);
|
|
||||||
cacheGun.put("endTime",DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss"));
|
|
||||||
REDIS.setCacheMap(okey, cacheGun);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return new ServiceResult(false);
|
return new ServiceResult(false);
|
||||||
|
|||||||
@ -52,7 +52,7 @@ public class HBCheckTask {
|
|||||||
String pkey = "pile:".concat(pileId);
|
String pkey = "pile:".concat(pileId);
|
||||||
Map<String, Object> cachePile = REDIS.getCacheMap(pkey);
|
Map<String, Object> cachePile = REDIS.getCacheMap(pkey);
|
||||||
String stationId = cachePile.get("stationId").toString();
|
String stationId = cachePile.get("stationId").toString();
|
||||||
System.out.println("================gunkey===="+gunkey+"======pileId========"+pileId+"========stationId==="+stationId);
|
// System.out.println("================gunkey===="+gunkey+"======pileId========"+pileId+"========stationId==="+stationId);
|
||||||
if(1==Integer.parseInt(gunkey.substring(gunkey.length() - 1))){
|
if(1==Integer.parseInt(gunkey.substring(gunkey.length() - 1))){
|
||||||
deviceMessageMapper.insertChargingPileStatus(gunkey.substring(gunkey.lastIndexOf(":") + 1),pileId,stationId,"A枪");
|
deviceMessageMapper.insertChargingPileStatus(gunkey.substring(gunkey.lastIndexOf(":") + 1),pileId,stationId,"A枪");
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@ -18,10 +18,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -16,10 +16,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 120.26.46.180:8858
|
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user