小程序用户登录及注册,统计修改,桩列表详情修改
This commit is contained in:
parent
a1268eec83
commit
6eaebea373
@ -196,7 +196,7 @@ public interface IXhpcChargingStationService {
|
|||||||
* @param serialNumber
|
* @param serialNumber
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Integer getTerminalStatus(String serialNumber);
|
int getTerminalStatus(String serialNumber);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过id查找对应的场站
|
* 通过id查找对应的场站
|
||||||
|
|||||||
@ -180,7 +180,7 @@ public class XhpcChargingPileServiceImpl implements IXhpcChargingPileService {
|
|||||||
if(list !=null && list.size()>0){
|
if(list !=null && list.size()>0){
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
Map<String, Object> listMap =list.get(i);
|
Map<String, Object> listMap =list.get(i);
|
||||||
Integer pileSerialNumber = xhpcChargingStationService.getTerminalStatus(listMap.get("serialNumber").toString());
|
int pileSerialNumber = xhpcChargingStationService.getTerminalStatus(listMap.get("serialNumber").toString());
|
||||||
listMap.put("workStatus",pileSerialNumber);
|
listMap.put("workStatus",pileSerialNumber);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -369,21 +369,28 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi
|
|||||||
XhpcRateDto xhpcRateDto = xhpcRateList.get(k);
|
XhpcRateDto xhpcRateDto = xhpcRateList.get(k);
|
||||||
XhpcRate xhpcRate = new XhpcRate();
|
XhpcRate xhpcRate = new XhpcRate();
|
||||||
xhpcRate.setChargingStationId(chargingStationId);
|
xhpcRate.setChargingStationId(chargingStationId);
|
||||||
if ("00".equals(xhpcRateDto.getId())) {
|
|
||||||
xhpcRate.setName("尖费率");
|
if ("00".equals(xhpcRateDto.getId()) || "01".equals(xhpcRateDto.getId()) || "02".equals(xhpcRateDto.getId()) || "03".equals(xhpcRateDto.getId())) {
|
||||||
} else if ("01".equals(xhpcRateDto.getId())) {
|
|
||||||
xhpcRate.setName("峰费率");
|
if ("00".equals(xhpcRateDto.getId())) {
|
||||||
} else if ("02".equals(xhpcRateDto.getId())) {
|
xhpcRate.setName("尖费率");
|
||||||
xhpcRate.setName("平费率");
|
} else if ("01".equals(xhpcRateDto.getId())) {
|
||||||
} else {
|
xhpcRate.setName("峰费率");
|
||||||
xhpcRate.setName("谷费率");
|
} else if ("02".equals(xhpcRateDto.getId())) {
|
||||||
|
xhpcRate.setName("平费率");
|
||||||
|
} else {
|
||||||
|
xhpcRate.setName("谷费率");
|
||||||
|
}
|
||||||
|
xhpcRate.setPowerFee(xhpcRateDto.getPowerFee());
|
||||||
|
xhpcRate.setServiceFee(xhpcRateDto.getServiceFee());
|
||||||
|
xhpcRate.setRateModelId(rateModelId);
|
||||||
|
xhpcRate.setRateValue(xhpcRateDto.getId());
|
||||||
|
xhpcChargingStationMapper.addXhpcRate(xhpcRate);
|
||||||
|
map.put(xhpcRateDto.getId(), xhpcRate.getRateId());
|
||||||
|
}else{
|
||||||
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
|
return AjaxResult.error("添加费率错误,请稍后在试");
|
||||||
}
|
}
|
||||||
xhpcRate.setPowerFee(xhpcRateDto.getPowerFee());
|
|
||||||
xhpcRate.setServiceFee(xhpcRateDto.getServiceFee());
|
|
||||||
xhpcRate.setRateModelId(rateModelId);
|
|
||||||
xhpcRate.setRateValue(xhpcRateDto.getId());
|
|
||||||
xhpcChargingStationMapper.addXhpcRate(xhpcRate);
|
|
||||||
map.put(xhpcRateDto.getId(), xhpcRate.getRateId());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//添加费率时段
|
//添加费率时段
|
||||||
@ -826,7 +833,6 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//添加费率计费模型
|
//添加费率计费模型
|
||||||
XhpcRateModel xhpcRateModel = new XhpcRateModel();
|
XhpcRateModel xhpcRateModel = new XhpcRateModel();
|
||||||
BeanUtils.copyProperties(xhpcChargingStationDto, xhpcRateModel);
|
BeanUtils.copyProperties(xhpcChargingStationDto, xhpcRateModel);
|
||||||
@ -853,15 +859,20 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi
|
|||||||
for (int k = 0; k < xhpcRateList.size(); k++) {
|
for (int k = 0; k < xhpcRateList.size(); k++) {
|
||||||
//存费率信息,并存储Map,费率时段使用,找到费率id
|
//存费率信息,并存储Map,费率时段使用,找到费率id
|
||||||
XhpcRateDto xhpcRateDto = xhpcRateList.get(k);
|
XhpcRateDto xhpcRateDto = xhpcRateList.get(k);
|
||||||
XhpcRate xhpcRate = new XhpcRate();
|
if ("00".equals(xhpcRateDto.getId()) || "01".equals(xhpcRateDto.getId()) || "02".equals(xhpcRateDto.getId()) || "03".equals(xhpcRateDto.getId())) {
|
||||||
xhpcRate.setChargingStationId(chargingStationId);
|
XhpcRate xhpcRate = new XhpcRate();
|
||||||
xhpcRate.setName(xhpcRateDto.getName());
|
xhpcRate.setChargingStationId(chargingStationId);
|
||||||
xhpcRate.setPowerFee(xhpcRateDto.getPowerFee());
|
xhpcRate.setName(xhpcRateDto.getName());
|
||||||
xhpcRate.setServiceFee(xhpcRateDto.getServiceFee());
|
xhpcRate.setPowerFee(xhpcRateDto.getPowerFee());
|
||||||
xhpcRate.setRateModelId(rateModelId);
|
xhpcRate.setServiceFee(xhpcRateDto.getServiceFee());
|
||||||
xhpcRate.setRateValue(xhpcRateDto.getId());
|
xhpcRate.setRateModelId(rateModelId);
|
||||||
xhpcChargingStationMapper.addXhpcRate(xhpcRate);
|
xhpcRate.setRateValue(xhpcRateDto.getId());
|
||||||
map.put(xhpcRateDto.getId(), xhpcRate.getRateId());
|
xhpcChargingStationMapper.addXhpcRate(xhpcRate);
|
||||||
|
map.put(xhpcRateDto.getId(), xhpcRate.getRateId());
|
||||||
|
}else{
|
||||||
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
|
return AjaxResult.error("添加费率错误,请稍后在试");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//添加费率时段
|
//添加费率时段
|
||||||
@ -1126,30 +1137,32 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer getTerminalStatus(String serialNumber) {
|
public int getTerminalStatus(String serialNumber) {
|
||||||
|
//0离线 1故障 2空闲 3充电 4 已插枪 5未知
|
||||||
Integer status =5;
|
// Integer status =5;
|
||||||
//终端状态用 redis数据
|
//终端状态用 redis数据
|
||||||
if(!"".equals(serialNumber) && serialNumber!=null){
|
if(!"".equals(serialNumber) && serialNumber!=null){
|
||||||
Map<String, Object> cacheMap =redisService.getCacheMap("gun:"+serialNumber);
|
Map<String, Object> cacheMap =redisService.getCacheMap("gun:"+serialNumber);
|
||||||
if(cacheMap !=null && cacheMap.get("status") !=null){
|
if(cacheMap !=null && cacheMap.get("status") !=null){
|
||||||
if ("离线".equals(cacheMap.get("status").toString())){
|
if ("离线".equals(cacheMap.get("status").toString())){
|
||||||
status =0;
|
return 0;
|
||||||
}else if("故障".equals(cacheMap.get("status").toString())){
|
}else if("故障".equals(cacheMap.get("status").toString())){
|
||||||
status =1;
|
return 1;
|
||||||
}else if("空闲".equals(cacheMap.get("status").toString())){
|
}else if("空闲".equals(cacheMap.get("status").toString())){
|
||||||
if("是".equals(cacheMap.get("vehicleGunStatus").toString())){
|
if("是".equals(cacheMap.get("vehicleGunStatus").toString())){
|
||||||
status =4;
|
return 4;
|
||||||
}else{
|
}else{
|
||||||
status =2;
|
return 2;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
//充电桩
|
//充电桩
|
||||||
status = 3;
|
return 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return 5;
|
||||||
|
}else{
|
||||||
|
return 5;
|
||||||
}
|
}
|
||||||
return status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -47,7 +47,7 @@ public class XhpcTerminalServiceImpl implements IXhpcTerminalService {
|
|||||||
for (int i = 0; i <list.size() ; i++) {
|
for (int i = 0; i <list.size() ; i++) {
|
||||||
Map<String, Object> map = list.get(i);
|
Map<String, Object> map = list.get(i);
|
||||||
//状态
|
//状态
|
||||||
Integer pileSerialNumber = xhpcChargingStationService.getTerminalStatus(map.get("serialNumber").toString());
|
int pileSerialNumber = xhpcChargingStationService.getTerminalStatus(map.get("serialNumber").toString());
|
||||||
map.put("workStatus",pileSerialNumber);
|
map.put("workStatus",pileSerialNumber);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -99,7 +99,7 @@ public class XhpcTerminalServiceImpl implements IXhpcTerminalService {
|
|||||||
if(map.get("chargingDegreeSum")==null || map.get("chargingDegreeSum").toString()==null || "".equals(map.get("chargingDegreeSum").toString())){
|
if(map.get("chargingDegreeSum")==null || map.get("chargingDegreeSum").toString()==null || "".equals(map.get("chargingDegreeSum").toString())){
|
||||||
map.put("chargingDegreeSum",0);
|
map.put("chargingDegreeSum",0);
|
||||||
}
|
}
|
||||||
Integer status = xhpcChargingStationService.getTerminalStatus(map.get("serialNumber").toString());
|
int status = xhpcChargingStationService.getTerminalStatus(map.get("serialNumber").toString());
|
||||||
|
|
||||||
map.put("workStatus",status);
|
map.put("workStatus",status);
|
||||||
|
|
||||||
|
|||||||
@ -82,7 +82,7 @@
|
|||||||
ct.name as chargingStationName,
|
ct.name as chargingStationName,
|
||||||
te.pile_serial_number as pileSerialNumber,
|
te.pile_serial_number as pileSerialNumber,
|
||||||
cp.power as power,
|
cp.power as power,
|
||||||
cp.serial_number as serialNumber,
|
te.serial_number as serialNumber,
|
||||||
cp.brand_model as brandModel,
|
cp.brand_model as brandModel,
|
||||||
cp.type as pileType,
|
cp.type as pileType,
|
||||||
te.status as status,
|
te.status as status,
|
||||||
|
|||||||
@ -364,9 +364,10 @@ public class XhpcPileOrderController extends BaseController {
|
|||||||
R.ok();
|
R.ok();
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
// Map<String, Object> pushOrder = redisService.getCacheMap("pushOrder:"+orderNo);
|
Map<String, Object> pushOrder = redisService.getCacheMap("pushOrder:"+orderNo);
|
||||||
// xhpcHistoryOrder.setInternetSerialNumber(pushOrder.get("internetSerialNumber").toString());
|
xhpcHistoryOrder.setInternetSerialNumber(pushOrder.get("internetSerialNumber").toString());
|
||||||
// xhpcChargeOrder.setOperatorId3rdptyEvcs((String) pushOrder.get("operatorId3rdpty"));
|
xhpcHistoryOrder.setOperatorId3rdptyEvcs((String) pushOrder.get("operatorId3rdpty"));
|
||||||
|
xhpcChargeOrder.setOperatorId3rdptyEvcs((String) pushOrder.get("operatorId3rdpty"));
|
||||||
}
|
}
|
||||||
|
|
||||||
//结算
|
//结算
|
||||||
|
|||||||
@ -88,7 +88,7 @@ public class XhpcHistoryOrderController extends BaseController {
|
|||||||
* 终端统计
|
* 终端统计
|
||||||
*/
|
*/
|
||||||
@GetMapping("/test3")
|
@GetMapping("/test3")
|
||||||
//@Scheduled(cron = "0 0/8 * * * ?")
|
@Scheduled(cron = "0 0/8 * * * ?")
|
||||||
public void test3(){
|
public void test3(){
|
||||||
logger.info(">>>>>>>>>>>>>>>>>>>>>>>终端统计定时任务>>>>>>>>>>>>>>>>>>>>>");
|
logger.info(">>>>>>>>>>>>>>>>>>>>>>>终端统计定时任务>>>>>>>>>>>>>>>>>>>>>");
|
||||||
logger.info(">>>>>>>>>>>>>>>>>>>>>>>终端统计定时任务>>>>>>>>>>>>>>>>>>>>>");
|
logger.info(">>>>>>>>>>>>>>>>>>>>>>>终端统计定时任务>>>>>>>>>>>>>>>>>>>>>");
|
||||||
@ -99,7 +99,7 @@ public class XhpcHistoryOrderController extends BaseController {
|
|||||||
* 场站统计
|
* 场站统计
|
||||||
*/
|
*/
|
||||||
@GetMapping("/test2")
|
@GetMapping("/test2")
|
||||||
//@Scheduled(cron = "0 0/7 * * * ?")
|
@Scheduled(cron = "0 0/7 * * * ?")
|
||||||
public void test2(){
|
public void test2(){
|
||||||
logger.info(">>>>>>>>>>>>>>>>>>>>>>>场站统计定时任务>>>>>>>>>>>>>>>>>>>>>");
|
logger.info(">>>>>>>>>>>>>>>>>>>>>>>场站统计定时任务>>>>>>>>>>>>>>>>>>>>>");
|
||||||
logger.info(">>>>>>>>>>>>>>>>>>>>>>>场站统计定时任务>>>>>>>>>>>>>>>>>>>>>");
|
logger.info(">>>>>>>>>>>>>>>>>>>>>>>场站统计定时任务>>>>>>>>>>>>>>>>>>>>>");
|
||||||
@ -111,8 +111,16 @@ public class XhpcHistoryOrderController extends BaseController {
|
|||||||
* 日期统计
|
* 日期统计
|
||||||
*/
|
*/
|
||||||
@GetMapping("/test1")
|
@GetMapping("/test1")
|
||||||
//@Scheduled(cron = "0 0/6 * * * ?")
|
@Scheduled(cron = "0 0/6 * * * ?")
|
||||||
public void test1(){
|
public void test1(){
|
||||||
|
add(1000,1);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 日期统计(已废弃)
|
||||||
|
*/
|
||||||
|
@GetMapping("/test7")
|
||||||
|
//@Scheduled(cron = "0 0/6 * * * ?")
|
||||||
|
public void test7(){
|
||||||
logger.info(">>>>>>>>>>>>>>>>>>>>>>>日期统计定时任务>>>>>>>>>>>>>>>>>>>>>");
|
logger.info(">>>>>>>>>>>>>>>>>>>>>>>日期统计定时任务>>>>>>>>>>>>>>>>>>>>>");
|
||||||
logger.info(">>>>>>>>>>>>>>>>>>>>>>>日期统计定时任务>>>>>>>>>>>>>>>>>>>>>");
|
logger.info(">>>>>>>>>>>>>>>>>>>>>>>日期统计定时任务>>>>>>>>>>>>>>>>>>>>>");
|
||||||
logger.info(">>>>>>>>>>>>>>>>>>>>>>>日期统计定时任务>>>>>>>>>>>>>>>>>>>>>");
|
logger.info(">>>>>>>>>>>>>>>>>>>>>>>日期统计定时任务>>>>>>>>>>>>>>>>>>>>>");
|
||||||
@ -173,7 +181,7 @@ public class XhpcHistoryOrderController extends BaseController {
|
|||||||
xhpcSt.setHistoryOrderId(xhpc.getHistoryOrderId());
|
xhpcSt.setHistoryOrderId(xhpc.getHistoryOrderId());
|
||||||
xhpcSt.setChargingPileId(xhpc.getChargingPileId());
|
xhpcSt.setChargingPileId(xhpc.getChargingPileId());
|
||||||
xhpcSt.setType(type);
|
xhpcSt.setType(type);
|
||||||
xhpcSt.setCreateTime(xhpc.getCreateTime());
|
xhpcSt.setCreateTime(xhpc.getEndTime());
|
||||||
xhpcStatisticsService.addStatisticsStation(xhpcSt);
|
xhpcStatisticsService.addStatisticsStation(xhpcSt);
|
||||||
//修改历史订单表状态
|
//修改历史订单表状态
|
||||||
xhpcHistoryOrderService.updateXhpcHistoryOrder(xhpc.getHistoryOrderId(),type + 1);
|
xhpcHistoryOrderService.updateXhpcHistoryOrder(xhpc.getHistoryOrderId(),type + 1);
|
||||||
@ -376,11 +384,7 @@ public class XhpcHistoryOrderController extends BaseController {
|
|||||||
xhpcSt.setHistoryOrderId(xhpc.getHistoryOrderId());
|
xhpcSt.setHistoryOrderId(xhpc.getHistoryOrderId());
|
||||||
xhpcSt.setChargingPileId(xhpc.getChargingPileId());
|
xhpcSt.setChargingPileId(xhpc.getChargingPileId());
|
||||||
xhpcSt.setType(type);
|
xhpcSt.setType(type);
|
||||||
if(number==1){
|
xhpcSt.setCreateTime(xhpc.getEndTime());
|
||||||
xhpcSt.setCreateTime(xhpc.getCreateTime());
|
|
||||||
}else{
|
|
||||||
xhpcSt.setCreateTime(DateUtil.offset(xhpc.getCreateTime(), DateField.DAY_OF_MONTH, 1));
|
|
||||||
}
|
|
||||||
xhpcStatisticsService.addStatisticsStation(xhpcSt);
|
xhpcStatisticsService.addStatisticsStation(xhpcSt);
|
||||||
|
|
||||||
//修改历史订单表状态
|
//修改历史订单表状态
|
||||||
@ -403,8 +407,91 @@ public class XhpcHistoryOrderController extends BaseController {
|
|||||||
* 小时统计
|
* 小时统计
|
||||||
*/
|
*/
|
||||||
@GetMapping("/test")
|
@GetMapping("/test")
|
||||||
//@Scheduled(cron = "0 0/5 * * * ?")
|
@Scheduled(cron = "0 0/5 * * * ?")
|
||||||
public void test(){
|
public void test(){
|
||||||
|
logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务>>>>>>>>>>>>>>>>>>>>>");
|
||||||
|
logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务>>>>>>>>>>>>>>>>>>>>>");
|
||||||
|
logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务>>>>>>>>>>>>>>>>>>>>>");
|
||||||
|
try{
|
||||||
|
//小时统计
|
||||||
|
List<XhpcChargeHistoryOrder> list = xhpcHistoryOrderService.getStatistisList(500,0);
|
||||||
|
if(list !=null && list.size()>0){
|
||||||
|
for (XhpcChargeHistoryOrder xhpc:list) {
|
||||||
|
//开始时间、结束时间、模型id、状态、用户id、运营商、订单id、场站id、终端id、历史订单id、时间
|
||||||
|
Date startTime = xhpc.getStartTime();
|
||||||
|
Date endTime = xhpc.getEndTime();
|
||||||
|
Long rateModelId = xhpc.getRateModelId();
|
||||||
|
Long operatorId =xhpc.getOperatorId();
|
||||||
|
Long chargingStationId = xhpc.getChargingStationId();
|
||||||
|
Long terminalId = xhpc.getTerminalId();
|
||||||
|
Long historyOrderId = xhpc.getHistoryOrderId();
|
||||||
|
Date data = Calendar.getInstance().getTime();
|
||||||
|
if(xhpc.getTotalPrice().compareTo(new BigDecimal(0)) !=1){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if(xhpc.getChargingDegree().compareTo(new BigDecimal(0)) !=1){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//每分钟多少度电
|
||||||
|
BigDecimal v = new BigDecimal((endTime.getTime() - startTime.getTime())).divide(new BigDecimal(60000),2,BigDecimal.ROUND_DOWN);
|
||||||
|
if(v.compareTo(new BigDecimal(0)) !=1){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
int endHour = DateUtil.hour(endTime, true);
|
||||||
|
|
||||||
|
//没有跨时段
|
||||||
|
XhpcStatisticsTimeInterval xhpcSt = new XhpcStatisticsTimeInterval();
|
||||||
|
xhpcSt.setStatus(endHour+1);
|
||||||
|
xhpcSt.setChargingDegree(xhpc.getChargingDegree());
|
||||||
|
xhpcSt.setChargingTime(new BigDecimal(xhpc.getChargingTimeNumber()).divide(new BigDecimal(3600),2, BigDecimal.ROUND_DOWN));
|
||||||
|
xhpcSt.setChargingNumber(1);
|
||||||
|
xhpcSt.setPowerPrice(xhpc.getPowerPriceTotal());
|
||||||
|
xhpcSt.setServicePrice(xhpc.getServicePriceTotal());
|
||||||
|
xhpcSt.setTotalPrice(xhpc.getTotalPrice());
|
||||||
|
xhpcSt.setPromotionDiscount(xhpc.getPromotionDiscount());
|
||||||
|
xhpcSt.setActPrice(xhpc.getActPrice());
|
||||||
|
xhpcSt.setActPowerPrice(xhpc.getActPowerPrice());
|
||||||
|
xhpcSt.setActServicePrice(xhpc.getActServicePrice());
|
||||||
|
xhpcSt.setInternetCommission(xhpc.getInternetCommission());
|
||||||
|
xhpcSt.setInternetSvcCommission(xhpc.getInternetSvcCommission());
|
||||||
|
xhpcSt.setPlatformCommission(xhpc.getPlatformCommission());
|
||||||
|
xhpcSt.setPlatformSvcCommisssion(xhpc.getPlatformSvcCommisssion());
|
||||||
|
xhpcSt.setOperationCommission(xhpc.getOperationCommission());
|
||||||
|
xhpcSt.setOperationSvcCommission(xhpc.getOperationSvcCommission());
|
||||||
|
xhpcSt.setOperatorId(operatorId);
|
||||||
|
xhpcSt.setChargingStationId(chargingStationId);
|
||||||
|
xhpcSt.setCreateTime(data);
|
||||||
|
xhpcSt.setTerminalId(terminalId);
|
||||||
|
xhpcSt.setHistoryOrderId(historyOrderId);
|
||||||
|
if(xhpc.getSource()==1){
|
||||||
|
xhpcSt.setInternetUserId(xhpc.getUserId());
|
||||||
|
}
|
||||||
|
List<Map<String, Object>> reatTimeList = xhpcHistoryOrderService.getReatTimeList(DateUtil.formatTime(startTime), DateUtil.formatTime(endTime), rateModelId);
|
||||||
|
Map<String, Object> map = reatTimeList.get(0);
|
||||||
|
xhpcSt.setElecPriceEvcs(new BigDecimal(map.get("powerFee").toString()));
|
||||||
|
xhpcSt.setServicePriceEvcs(new BigDecimal(map.get("serviceFee").toString()));
|
||||||
|
xhpcSt.setStartTimeEvcs(DateUtil.format(startTime, "yyyy-MM-dd HH:mm:ss"));
|
||||||
|
xhpcSt.setEndTimeEvcs(DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss"));
|
||||||
|
xhpcSt.setCreateTime(xhpc.getEndTime());
|
||||||
|
xhpcStatisticsService.addStatisticsTime(xhpcSt);
|
||||||
|
//修改历史订单表状态
|
||||||
|
xhpcHistoryOrderService.updateXhpcHistoryOrder(xhpc.getHistoryOrderId(),1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小时统计(精确统计)
|
||||||
|
*/
|
||||||
|
@GetMapping("/test8")
|
||||||
|
//@Scheduled(cron = "0 0/5 * * * ?")
|
||||||
|
public void test8(){
|
||||||
logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务>>>>>>>>>>>>>>>>>>>>>");
|
logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务>>>>>>>>>>>>>>>>>>>>>");
|
||||||
logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务>>>>>>>>>>>>>>>>>>>>>");
|
logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务>>>>>>>>>>>>>>>>>>>>>");
|
||||||
logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务>>>>>>>>>>>>>>>>>>>>>");
|
logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务>>>>>>>>>>>>>>>>>>>>>");
|
||||||
@ -478,7 +565,7 @@ public class XhpcHistoryOrderController extends BaseController {
|
|||||||
xhpcSt.setServicePriceEvcs(new BigDecimal(map.get("serviceFee").toString()));
|
xhpcSt.setServicePriceEvcs(new BigDecimal(map.get("serviceFee").toString()));
|
||||||
xhpcSt.setStartTimeEvcs(DateUtil.format(startTime, "yyyy-MM-dd HH:mm:ss"));
|
xhpcSt.setStartTimeEvcs(DateUtil.format(startTime, "yyyy-MM-dd HH:mm:ss"));
|
||||||
xhpcSt.setEndTimeEvcs(DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss"));
|
xhpcSt.setEndTimeEvcs(DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss"));
|
||||||
xhpcSt.setCreateTime(xhpc.getCreateTime());
|
xhpcSt.setCreateTime(xhpc.getEndTime());
|
||||||
xhpcStatisticsService.addStatisticsTime(xhpcSt);
|
xhpcStatisticsService.addStatisticsTime(xhpcSt);
|
||||||
//修改历史订单表状态
|
//修改历史订单表状态
|
||||||
xhpcHistoryOrderService.updateXhpcHistoryOrder(xhpc.getHistoryOrderId(),1);
|
xhpcHistoryOrderService.updateXhpcHistoryOrder(xhpc.getHistoryOrderId(),1);
|
||||||
@ -730,11 +817,7 @@ public class XhpcHistoryOrderController extends BaseController {
|
|||||||
xhpcSt.setOperatorId(xhpc.getOperatorId());
|
xhpcSt.setOperatorId(xhpc.getOperatorId());
|
||||||
xhpcSt.setChargingStationId(xhpc.getChargingStationId());
|
xhpcSt.setChargingStationId(xhpc.getChargingStationId());
|
||||||
xhpcSt.setDelFlag(0);
|
xhpcSt.setDelFlag(0);
|
||||||
if(type!=3){
|
xhpcSt.setCreateTime(xhpc.getEndTime());
|
||||||
xhpcSt.setCreateTime(xhpc.getCreateTime());
|
|
||||||
}else{
|
|
||||||
xhpcSt.setCreateTime(DateUtil.offset(xhpc.getCreateTime(), DateField.DAY_OF_MONTH, 1));
|
|
||||||
}
|
|
||||||
xhpcSt.setTerminalId(xhpc.getTerminalId());
|
xhpcSt.setTerminalId(xhpc.getTerminalId());
|
||||||
xhpcSt.setHistoryOrderId(xhpc.getHistoryOrderId());
|
xhpcSt.setHistoryOrderId(xhpc.getHistoryOrderId());
|
||||||
xhpcSt.setStartTimeEvcs(yyyyMMdd+" "+srt);
|
xhpcSt.setStartTimeEvcs(yyyyMMdd+" "+srt);
|
||||||
@ -803,8 +886,7 @@ public class XhpcHistoryOrderController extends BaseController {
|
|||||||
for (XhpcChargeHistoryOrder xhpc:list) {
|
for (XhpcChargeHistoryOrder xhpc:list) {
|
||||||
XhpcStatisticsStation xhpcSt =new XhpcStatisticsStation();
|
XhpcStatisticsStation xhpcSt =new XhpcStatisticsStation();
|
||||||
xhpcSt.setChargingDegree(xhpc.getChargingDegree());
|
xhpcSt.setChargingDegree(xhpc.getChargingDegree());
|
||||||
BigDecimal decimal = new BigDecimal(xhpc.getChargingTimeNumber() / 3600).setScale(2, BigDecimal.ROUND_DOWN);
|
xhpcSt.setChargingTime(new BigDecimal(xhpc.getChargingTimeNumber()).divide(new BigDecimal(3600), 2, BigDecimal.ROUND_DOWN));
|
||||||
xhpcSt.setChargingTime(decimal);
|
|
||||||
xhpcSt.setChargingNumber(1);
|
xhpcSt.setChargingNumber(1);
|
||||||
xhpcSt.setPowerPrice(xhpc.getPowerPriceTotal());
|
xhpcSt.setPowerPrice(xhpc.getPowerPriceTotal());
|
||||||
xhpcSt.setServicePrice(xhpc.getServicePriceTotal());
|
xhpcSt.setServicePrice(xhpc.getServicePriceTotal());
|
||||||
@ -829,7 +911,7 @@ public class XhpcHistoryOrderController extends BaseController {
|
|||||||
xhpcSt.setHistoryOrderId(xhpc.getHistoryOrderId());
|
xhpcSt.setHistoryOrderId(xhpc.getHistoryOrderId());
|
||||||
xhpcSt.setChargingPileId(xhpc.getChargingPileId());
|
xhpcSt.setChargingPileId(xhpc.getChargingPileId());
|
||||||
xhpcSt.setType(type);
|
xhpcSt.setType(type);
|
||||||
xhpcSt.setCreateTime(xhpc.getCreateTime());
|
xhpcSt.setCreateTime(xhpc.getEndTime());
|
||||||
xhpcStatisticsService.addStatisticsStation(xhpcSt);
|
xhpcStatisticsService.addStatisticsStation(xhpcSt);
|
||||||
|
|
||||||
//修改历史订单表状态
|
//修改历史订单表状态
|
||||||
@ -848,5 +930,19 @@ public class XhpcHistoryOrderController extends BaseController {
|
|||||||
|
|
||||||
System.out.println(date1.getTime()-date.getTime());
|
System.out.println(date1.getTime()-date.getTime());
|
||||||
|
|
||||||
|
|
||||||
|
DateTime startTime = DateUtil.parse("2021-10-19 17:35:19");
|
||||||
|
DateTime endTime = DateUtil.parse("2021-10-19 17:36:02");
|
||||||
|
|
||||||
|
//充电时长
|
||||||
|
Long tiem = (endTime.getTime() - startTime.getTime())/1000;
|
||||||
|
System.out.println(">>>>"+tiem);
|
||||||
|
|
||||||
|
|
||||||
|
BigDecimal decimal = new BigDecimal(72);
|
||||||
|
BigDecimal decimal1 = new BigDecimal(3600);
|
||||||
|
|
||||||
|
System.out.println(decimal.divide(decimal1,2,BigDecimal.ROUND_DOWN));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -204,6 +204,7 @@ public class XhpcChargeOrderServiceImpl implements IXhpcChargeOrderService {
|
|||||||
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<充电返回>>>>>>>>>>>>>>>>>");
|
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<充电返回>>>>>>>>>>>>>>>>>");
|
||||||
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<" + r1.getCode() + ">>>>>>>>>>>>>>>>>");
|
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<" + r1.getCode() + ">>>>>>>>>>>>>>>>>");
|
||||||
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<" + r1.getMsg() + ">>>>>>>>>>>>>>>>>");
|
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<" + r1.getMsg() + ">>>>>>>>>>>>>>>>>");
|
||||||
|
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<" + r1.getData() + ">>>>>>>>>>>>>>>>>");
|
||||||
if (r1.getCode() != 200) {
|
if (r1.getCode() != 200) {
|
||||||
return AjaxResult.error(r1.getMsg());
|
return AjaxResult.error(r1.getMsg());
|
||||||
}
|
}
|
||||||
@ -460,9 +461,11 @@ public class XhpcChargeOrderServiceImpl implements IXhpcChargeOrderService {
|
|||||||
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<Soc>>>>>>>>>>>>>>>>>:" + startChargingData.getSoc());
|
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<Soc>>>>>>>>>>>>>>>>>:" + startChargingData.getSoc());
|
||||||
|
|
||||||
R r1 = powerPileService.startCharging(startChargingData);
|
R r1 = powerPileService.startCharging(startChargingData);
|
||||||
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<充电返回>>>>>>>>>>>>>>>>>");
|
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<第三方充电返回>>>>>>>>>>>>>>>>>");
|
||||||
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<" + r1.getCode() + ">>>>>>>>>>>>>>>>>");
|
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<" + r1.getCode() + ">>>>>>>>>>>>>>>>>");
|
||||||
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<" + r1.getMsg() + ">>>>>>>>>>>>>>>>>");
|
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<" + r1.getMsg() + ">>>>>>>>>>>>>>>>>");
|
||||||
|
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<" + r1.getData() + ">>>>>>>>>>>>>>>>>");
|
||||||
|
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<第三方充电返回>>>>>>>>>>>>>>>>>");
|
||||||
if (r1.getCode() != 200) {
|
if (r1.getCode() != 200) {
|
||||||
r.setCode(500);
|
r.setCode(500);
|
||||||
r.setMsg(r1.getMsg());
|
r.setMsg(r1.getMsg());
|
||||||
@ -470,7 +473,7 @@ public class XhpcChargeOrderServiceImpl implements IXhpcChargeOrderService {
|
|||||||
}
|
}
|
||||||
String startTime = DateUtil.format(date, "yyyy-MM-dd HH: mm: ss");
|
String startTime = DateUtil.format(date, "yyyy-MM-dd HH: mm: ss");
|
||||||
Map<String, Object> extraData1 = xhpcChargeOrderMapper.selectDate3rdNeedBy(connectorId).get(0);
|
Map<String, Object> extraData1 = xhpcChargeOrderMapper.selectDate3rdNeedBy(connectorId).get(0);
|
||||||
Long rateModelId = (Long) extraData1.get("rateModelId");
|
Long rateModelId = Long.valueOf(r1.getData().toString());
|
||||||
Long terminalId = (Long) extraData1.get("terminalId");
|
Long terminalId = (Long) extraData1.get("terminalId");
|
||||||
Double power = (Double) extraData1.get("power");
|
Double power = (Double) extraData1.get("power");
|
||||||
Long chargingStationId = (Long) extraData1.get("chargingStationId");
|
Long chargingStationId = (Long) extraData1.get("chargingStationId");
|
||||||
|
|||||||
@ -244,14 +244,16 @@ public class XhpcRealTimeOrderServiceImpl implements IXhpcRealTimeOrderService {
|
|||||||
//0总金额提成 1服务费提成
|
//0总金额提成 1服务费提成
|
||||||
if(new BigDecimal(0).compareTo(commissionRate)==-1){
|
if(new BigDecimal(0).compareTo(commissionRate)==-1){
|
||||||
if("0".equals(operatorIdEvcs.get("commissionType").toString())){
|
if("0".equals(operatorIdEvcs.get("commissionType").toString())){
|
||||||
internetCommission = actPrice.divide(commissionRate).setScale(2,BigDecimal.ROUND_DOWN);
|
//流量方的钱
|
||||||
actPrice = actPrice.multiply(internetCommission);
|
internetCommission=actPrice.multiply(commissionRate).setScale(2,BigDecimal.ROUND_DOWN);
|
||||||
surplusPowerPrice = surplusPowerPrice.subtract(internetCommission.divide(new BigDecimal(2),2,BigDecimal.ROUND_DOWN));
|
|
||||||
surplusServicePrice =surplusServicePrice.subtract(internetCommission.divide(new BigDecimal(2),2,BigDecimal.ROUND_DOWN));
|
actPrice = actPrice.subtract(internetCommission);
|
||||||
|
surplusPowerPrice = surplusPowerPrice.multiply(commissionRate).setScale(2,BigDecimal.ROUND_DOWN);
|
||||||
|
surplusServicePrice =surplusServicePrice.multiply(commissionRate).setScale(2,BigDecimal.ROUND_DOWN);
|
||||||
}else{
|
}else{
|
||||||
internetSvcCommission = actPrice.divide(commissionRate).setScale(2,BigDecimal.ROUND_DOWN);
|
internetSvcCommission = actPrice.multiply(commissionRate).setScale(2,BigDecimal.ROUND_DOWN);
|
||||||
actPrice = actPrice.multiply(internetSvcCommission);
|
actPrice = actPrice.subtract(internetSvcCommission);
|
||||||
surplusServicePrice =surplusServicePrice.subtract(internetCommission.divide(new BigDecimal(2),2,BigDecimal.ROUND_DOWN));
|
surplusServicePrice =surplusServicePrice.multiply(commissionRate).setScale(2,BigDecimal.ROUND_DOWN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -284,22 +286,22 @@ public class XhpcRealTimeOrderServiceImpl implements IXhpcRealTimeOrderService {
|
|||||||
if(fan){
|
if(fan){
|
||||||
promotionDiscount=money.multiply(discount).setScale(2,BigDecimal.ROUND_DOWN);
|
promotionDiscount=money.multiply(discount).setScale(2,BigDecimal.ROUND_DOWN);
|
||||||
actPrice = money.subtract(promotionDiscount);
|
actPrice = money.subtract(promotionDiscount);
|
||||||
surplusPowerPrice = surplusPowerPrice.subtract(promotionDiscount.divide(new BigDecimal(2),BigDecimal.ROUND_DOWN));
|
surplusPowerPrice = surplusPowerPrice.multiply(discount).setScale(2,BigDecimal.ROUND_DOWN);
|
||||||
surplusServicePrice= surplusServicePrice.subtract(promotionDiscount.divide(new BigDecimal(2),BigDecimal.ROUND_DOWN));
|
surplusServicePrice= surplusServicePrice.multiply(discount).setScale(2,BigDecimal.ROUND_DOWN);
|
||||||
}
|
}
|
||||||
}else if("2".equals(state)){
|
}else if("2".equals(state)){
|
||||||
if(fan){
|
if(fan){
|
||||||
//电费
|
//电费
|
||||||
promotionDiscount =powerPrice.multiply(balance).setScale(2,BigDecimal.ROUND_DOWN);
|
promotionDiscount =powerPrice.multiply(balance).setScale(2,BigDecimal.ROUND_DOWN);
|
||||||
actPrice = money.subtract(promotionDiscount);
|
actPrice = money.subtract(promotionDiscount);
|
||||||
surplusPowerPrice=surplusPowerPrice.subtract(promotionDiscount);
|
surplusPowerPrice=surplusPowerPrice.multiply(balance).setScale(2,BigDecimal.ROUND_DOWN);
|
||||||
}
|
}
|
||||||
}else if("3".equals(state)){
|
}else if("3".equals(state)){
|
||||||
if(fan){
|
if(fan){
|
||||||
//服务费
|
//服务费
|
||||||
promotionDiscount = servicePrice.multiply(balance).setScale(2,BigDecimal.ROUND_DOWN);
|
promotionDiscount = servicePrice.multiply(balance).setScale(2,BigDecimal.ROUND_DOWN);
|
||||||
actPrice = money.subtract(promotionDiscount);
|
actPrice = money.subtract(promotionDiscount);
|
||||||
surplusServicePrice =surplusServicePrice.subtract(promotionDiscount);
|
surplusServicePrice =surplusServicePrice.multiply(balance).setScale(2,BigDecimal.ROUND_DOWN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -330,10 +332,11 @@ public class XhpcRealTimeOrderServiceImpl implements IXhpcRealTimeOrderService {
|
|||||||
BigDecimal multiply2 = surplusServicePrice.multiply(platformCommissionRate).setScale(2,BigDecimal.ROUND_DOWN);
|
BigDecimal multiply2 = surplusServicePrice.multiply(platformCommissionRate).setScale(2,BigDecimal.ROUND_DOWN);
|
||||||
platformCommission = multiply1.add(multiply2);
|
platformCommission = multiply1.add(multiply2);
|
||||||
//剩下的钱
|
//剩下的钱
|
||||||
surplusPowerPrice = surplusPowerPrice.subtract(multiply1);
|
surplusPowerPrice = surplusPowerPrice.multiply(platformCommissionRate).setScale(2,BigDecimal.ROUND_DOWN);
|
||||||
surplusServicePrice = surplusServicePrice.subtract(multiply2);
|
surplusServicePrice = surplusServicePrice.multiply(platformCommissionRate).setScale(2,BigDecimal.ROUND_DOWN);
|
||||||
BigDecimal multiply3 = surplusPowerPrice.multiply(maintenanceCommissionRate).setScale(2,BigDecimal.ROUND_DOWN);
|
BigDecimal multiply3 = surplusPowerPrice.multiply(maintenanceCommissionRate).setScale(2,BigDecimal.ROUND_DOWN);
|
||||||
BigDecimal multiply4 = surplusServicePrice.multiply(maintenanceCommissionRate).setScale(2,BigDecimal.ROUND_DOWN);
|
BigDecimal multiply4 = surplusServicePrice.multiply(maintenanceCommissionRate).setScale(2,BigDecimal.ROUND_DOWN);
|
||||||
|
|
||||||
operationCommission = multiply1.add(multiply2);
|
operationCommission = multiply1.add(multiply2);
|
||||||
//剩下的钱
|
//剩下的钱
|
||||||
surplusPowerPrice = surplusPowerPrice.subtract(multiply3);
|
surplusPowerPrice = surplusPowerPrice.subtract(multiply3);
|
||||||
@ -343,7 +346,7 @@ public class XhpcRealTimeOrderServiceImpl implements IXhpcRealTimeOrderService {
|
|||||||
BigDecimal multiply2 = surplusServicePrice.multiply(platformCommissionRate).setScale(2,BigDecimal.ROUND_DOWN);
|
BigDecimal multiply2 = surplusServicePrice.multiply(platformCommissionRate).setScale(2,BigDecimal.ROUND_DOWN);
|
||||||
platformSvcCommission=multiply2;
|
platformSvcCommission=multiply2;
|
||||||
//剩下的钱
|
//剩下的钱
|
||||||
surplusServicePrice = surplusServicePrice.subtract(multiply2);
|
surplusServicePrice = surplusServicePrice.multiply(platformCommissionRate).setScale(2,BigDecimal.ROUND_DOWN);
|
||||||
|
|
||||||
BigDecimal multiply4 = surplusServicePrice.multiply(maintenanceCommissionRate).setScale(2,BigDecimal.ROUND_DOWN);
|
BigDecimal multiply4 = surplusServicePrice.multiply(maintenanceCommissionRate).setScale(2,BigDecimal.ROUND_DOWN);
|
||||||
operationCommission = multiply4;
|
operationCommission = multiply4;
|
||||||
|
|||||||
@ -586,11 +586,11 @@
|
|||||||
|
|
||||||
select xt.charging_station_id as chargingStationId,
|
select xt.charging_station_id as chargingStationId,
|
||||||
xt.terminal_id as terminalId,
|
xt.terminal_id as terminalId,
|
||||||
xt.rate_model_id as rateModelId,
|
cs.rate_model_id as rateModelId,
|
||||||
power
|
power
|
||||||
from xhpc_terminal as xt
|
from xhpc_terminal as xt
|
||||||
left join xhpc_charging_pile as xcp
|
left join xhpc_charging_pile as xcp on xcp.serial_number = substring(#{serialNumber}, 1, 14)
|
||||||
on xcp.serial_number = substring(#{serialNumber}, 1, 14)
|
left join xhpc_charging_station as cs on xt.charging_station_id = cs.charging_station_id
|
||||||
where xt.serial_number = #{serialNumber}
|
where xt.serial_number = #{serialNumber}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
@ -88,9 +88,11 @@
|
|||||||
#{chargingStationId}
|
#{chargingStationId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
<if test="startTime !=null and startTime !='' and endTime !=null and endTime !=''">
|
<if test="startTime !=null and startTime !=''">
|
||||||
and #{startTime} <=create_time
|
and create_time >= #{startTime}
|
||||||
and create_time <=#{endTime}
|
</if>
|
||||||
|
<if test="endTime !=null and endTime !=''">
|
||||||
|
and create_time <= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
<if test="type==2">
|
<if test="type==2">
|
||||||
and operator_id=#{operatorId}
|
and operator_id=#{operatorId}
|
||||||
@ -135,9 +137,11 @@
|
|||||||
#{chargingStationId}
|
#{chargingStationId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
<if test="startTime !=null and startTime !='' and endTime !=null and endTime !=''">
|
<if test="startTime !=null and startTime !=''">
|
||||||
and #{startTime} <=create_time
|
and create_time >= #{startTime}
|
||||||
and create_time <=#{endTime}
|
</if>
|
||||||
|
<if test="endTime !=null and endTime !=''">
|
||||||
|
and create_time <= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
<if test="type==2">
|
<if test="type==2">
|
||||||
and operator_id=#{operatorId}
|
and operator_id=#{operatorId}
|
||||||
@ -179,9 +183,11 @@
|
|||||||
left join xhpc_charging_station as cs on cs.charging_station_id = ss.charging_station_id
|
left join xhpc_charging_station as cs on cs.charging_station_id = ss.charging_station_id
|
||||||
left join xhpc_operator as op on op.operator_id = ss.operator_id
|
left join xhpc_operator as op on op.operator_id = ss.operator_id
|
||||||
where ss.del_flag=0 and ss.type=2
|
where ss.del_flag=0 and ss.type=2
|
||||||
<if test="startTime !=null and startTime !='' and endTime !=null and endTime !=''">
|
<if test="startTime !=null and startTime !=''">
|
||||||
and #{startTime} <=ss.create_time
|
and ss.create_time >= #{startTime}
|
||||||
and ss.create_time <=#{endTime}
|
</if>
|
||||||
|
<if test="endTime !=null and endTime !=''">
|
||||||
|
and ss.create_time <= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
<if test="type==2">
|
<if test="type==2">
|
||||||
and ss.operator_id=#{operatorId}
|
and ss.operator_id=#{operatorId}
|
||||||
@ -232,9 +238,11 @@
|
|||||||
from xhpc_statistics_station as ss
|
from xhpc_statistics_station as ss
|
||||||
left join xhpc_operator as op on op.operator_id = ss.operator_id
|
left join xhpc_operator as op on op.operator_id = ss.operator_id
|
||||||
where ss.del_flag=0 and ss.type=2
|
where ss.del_flag=0 and ss.type=2
|
||||||
<if test="startTime !=null and startTime !='' and endTime !=null and endTime !=''">
|
<if test="startTime !=null and startTime !=''">
|
||||||
and #{startTime} <=ss.create_time
|
and ss.create_time >= #{startTime}
|
||||||
and ss.create_time <=#{endTime}
|
</if>
|
||||||
|
<if test="endTime !=null and endTime !=''">
|
||||||
|
and ss.create_time <= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
<if test="operatorUserId !=null and operatorUserId.size()>0">
|
<if test="operatorUserId !=null and operatorUserId.size()>0">
|
||||||
and ss.operator_id in
|
and ss.operator_id in
|
||||||
@ -281,9 +289,11 @@
|
|||||||
from xhpc_statistics_station as ss
|
from xhpc_statistics_station as ss
|
||||||
left join xhpc_internet_user as iu on iu.internet_user_id = ss.internet_user_id
|
left join xhpc_internet_user as iu on iu.internet_user_id = ss.internet_user_id
|
||||||
where ss.del_flag=0 and ss.type=2 and ss.internet_user_id !=null
|
where ss.del_flag=0 and ss.type=2 and ss.internet_user_id !=null
|
||||||
<if test="startTime !=null and startTime !='' and endTime !=null and endTime !=''">
|
<if test="startTime !=null and startTime !=''">
|
||||||
and #{startTime} <=ss.create_time
|
and ss.create_time >= #{startTime}
|
||||||
and ss.create_time <=#{endTime}
|
</if>
|
||||||
|
<if test="endTime !=null and endTime !=''">
|
||||||
|
and ss.create_time <= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
<if test="internetIds !=null and internetIds.size()>0">
|
<if test="internetIds !=null and internetIds.size()>0">
|
||||||
and ss.internet_user_id in
|
and ss.internet_user_id in
|
||||||
@ -322,9 +332,11 @@
|
|||||||
left join xhpc_charging_station as cs on cs.charging_station_id = ss.charging_station_id
|
left join xhpc_charging_station as cs on cs.charging_station_id = ss.charging_station_id
|
||||||
left join xhpc_terminal as te on te.terminal_id = ss.terminal_id
|
left join xhpc_terminal as te on te.terminal_id = ss.terminal_id
|
||||||
where ss.del_flag=0 and ss.type=3
|
where ss.del_flag=0 and ss.type=3
|
||||||
<if test="startTime !=null and startTime !='' and endTime !=null and endTime !=''">
|
<if test="startTime !=null and startTime !=''">
|
||||||
and #{startTime} <=ss.create_time
|
and ss.create_time >= #{startTime}
|
||||||
and ss.create_time <=#{endTime}
|
</if>
|
||||||
|
<if test="endTime !=null and endTime !=''">
|
||||||
|
and ss.create_time <= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
<if test="type==2">
|
<if test="type==2">
|
||||||
and ss.operator_id=#{operatorId}
|
and ss.operator_id=#{operatorId}
|
||||||
|
|||||||
@ -206,7 +206,24 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService {
|
|||||||
// 查询用户信息
|
// 查询用户信息
|
||||||
XhpcAppUser user = xhpcAppUserMapper.getAppUserByPhone(username);
|
XhpcAppUser user = xhpcAppUserMapper.getAppUserByPhone(username);
|
||||||
if (StringUtils.isNull(user)) {
|
if (StringUtils.isNull(user)) {
|
||||||
return R.fail(HttpStatus.DATA_ERROR, "登录用户:" + username + " 不存在");
|
//注册
|
||||||
|
XhpcAppUser xhpcAppUser = new XhpcAppUser();
|
||||||
|
xhpcAppUser.setPhone(username);
|
||||||
|
String password = username.substring(username.length() - 6);
|
||||||
|
xhpcAppUser.setPassword(SecurityUtils.encryptPassword(password));
|
||||||
|
xhpcAppUser.setCreateTime(new Date());
|
||||||
|
if (StatusConstants.OPERATION_WX_TYPE.equals(type)) {
|
||||||
|
xhpcAppUser.setWeixinOpenId(openid);
|
||||||
|
xhpcAppUser.setWeixinLogin(1);
|
||||||
|
} else {
|
||||||
|
xhpcAppUser.setAlipayOpenId(openid);
|
||||||
|
xhpcAppUser.setAlipayLogin(1);
|
||||||
|
}
|
||||||
|
xhpcAppUserMapper.insert(xhpcAppUser);
|
||||||
|
user = xhpcAppUserMapper.getAppUserByPhone(username);
|
||||||
|
// 获取登录token
|
||||||
|
//return R.ok(tokenService.createToken(userInfo));
|
||||||
|
//return R.fail(HttpStatus.DATA_ERROR, "登录用户:" + username + " 不存在");
|
||||||
}
|
}
|
||||||
LoginUser userInfo = new LoginUser();
|
LoginUser userInfo = new LoginUser();
|
||||||
SysUser sysUser = new SysUser();
|
SysUser sysUser = new SysUser();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user