修改多租户访问问题
This commit is contained in:
parent
1453125794
commit
9bbb9e5e3f
@ -14,7 +14,10 @@ public class EquipBizRequest {
|
||||
//将json当中的键值对为equipBizSeq的数据,封装到该属性中
|
||||
@JsonProperty("EquipBizSeq")
|
||||
String equipBizSeq;
|
||||
@JsonProperty("TraceId")
|
||||
String traceId;
|
||||
@JsonProperty("ConnectorID")
|
||||
String connectorId;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,13 +1,28 @@
|
||||
package com.xhpc.evcs.api;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.xhpc.evcs.dto.*;
|
||||
import com.xhpc.evcs.encryption.Aes128Cbc;
|
||||
import com.xhpc.evcs.encryption.EvcsConst;
|
||||
import com.xhpc.evcs.encryption.HMAC;
|
||||
import com.xhpc.evcs.utils.JSONUtil;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.crypto.BadPaddingException;
|
||||
import javax.crypto.IllegalBlockSizeException;
|
||||
import javax.crypto.NoSuchPaddingException;
|
||||
import java.io.IOException;
|
||||
import java.security.InvalidAlgorithmParameterException;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController()
|
||||
public class CheckChargeOrderController {
|
||||
@ -39,5 +54,42 @@ public class CheckChargeOrderController {
|
||||
response.setData(JSONUtil.toJSONString(resp));
|
||||
return response;
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
|
||||
try {
|
||||
CommonRequest<StationStatusRequest> commonRequest = new CommonRequest<>();
|
||||
StationStatusRequest stationStatusRequest =new StationStatusRequest();
|
||||
String[] strings = new String[]{"4"};
|
||||
stationStatusRequest.setStationIds(strings);
|
||||
String data = JSONUtil.toJSONString(stationStatusRequest);
|
||||
commonRequest.setData(data);
|
||||
commonRequest.setOperatorId("MA005DBW1");
|
||||
String s = encryptReqOut("8LpncubmWiPCzY3V", "av6A8QdnRaVRMXu6", "wAeYIVQUwd0iGZsV", commonRequest);
|
||||
|
||||
System.out.println("==========sss==============="+s);
|
||||
|
||||
|
||||
}catch (Exception e){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static String encryptReqOut(String dataSecret, String dataSecretIV, String sigSecret, CommonRequest commonRequest)
|
||||
throws BadPaddingException, InvalidAlgorithmParameterException, NoSuchAlgorithmException,
|
||||
IllegalBlockSizeException, NoSuchPaddingException, InvalidKeyException, JsonProcessingException {
|
||||
|
||||
String data = Aes128Cbc.encrypt(commonRequest.getData(), dataSecret, dataSecretIV);
|
||||
commonRequest.setData(data);
|
||||
Calendar cal = Calendar.getInstance();
|
||||
DateTime dt = new DateTime(cal);
|
||||
commonRequest.setTimeStamp(dt.toString(DatePattern.PURE_DATETIME_PATTERN));
|
||||
commonRequest.setSeq(String.valueOf(DateUtil.millisecond(dt)));
|
||||
String sig =
|
||||
HMAC.hmacDigest(commonRequest.getOperatorId() + data + commonRequest.getTimeStamp() + commonRequest.getSeq(),
|
||||
sigSecret);
|
||||
commonRequest.setSig(sig);
|
||||
final String jsonString = JSONUtil.toJSONString(commonRequest);
|
||||
// log.debug("enc to out:{} ", jsonString);
|
||||
return jsonString;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.xhpc.evcs.api;
|
||||
|
||||
import com.xhpc.common.core.web.controller.BaseController;
|
||||
import com.xhpc.common.data.redis.CacheRateModel;
|
||||
import com.xhpc.evcs.dto.*;
|
||||
import com.xhpc.evcs.jpa.XhpcTerminalRepository;
|
||||
@ -20,7 +21,7 @@ import static com.xhpc.common.data.redis.StaticBeanUtil.REDIS;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
public class QueryEquipBusinessPolicyController {
|
||||
public class QueryEquipBusinessPolicyController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private XhpcTerminalRepository xhpcTerminalRepository;
|
||||
|
||||
@ -78,9 +78,6 @@ public class QueryStopChargeController {
|
||||
pileInfo.getCommunicationProtocolVersion() :
|
||||
"0A";
|
||||
//给对应的枪发送停止充电指令
|
||||
System.out.println("=================111========给对应的枪发送停止充电指令==================停止 充电=================="+xhOrderNo);
|
||||
System.out.println("=================111========给对应的枪发送停止充电指令==================停止 充电=================="+xhOrderNo);
|
||||
System.out.println("=================111========给对应的枪发送停止充电指令==================停止 充电=================="+xhOrderNo);
|
||||
|
||||
R r = powerPileService.stopCharging(xhOrderNo, pileNum, connectorId, versionNum);
|
||||
// 判断停止指令发送是否成功
|
||||
|
||||
@ -137,10 +137,10 @@ public class CDNotificationStationInfoController extends CoreDispatcher {
|
||||
Map<String,Object> mapStationInfo =new HashMap<>();
|
||||
mapStationInfo.put("StationInfo",cdStationInfo);
|
||||
String data =JSONUtil.toJSONString(mapStationInfo);
|
||||
System.out.println("=======data========"+data);
|
||||
// System.out.println("=======data========"+data);
|
||||
commonRequest.setData(data);
|
||||
String result =ok(commonRequest,"/notification_stationInfo",authSecretTokenOut);
|
||||
System.out.println("=======result========"+result);
|
||||
// System.out.println("=======result========"+result);
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
@ -157,7 +157,7 @@ public class CDNotificationStationInfoController extends CoreDispatcher {
|
||||
@PostMapping("/v10/query_stations_info")
|
||||
public CommonResponse queryStationsInfo(@RequestBody(required = false) CommonRequest<PageRequest> commonRequest) {
|
||||
|
||||
System.out.println("================查询充电站信息=======================");
|
||||
// System.out.println("================查询充电站信息=======================");
|
||||
CommonResponse resp = new CommonResponse();
|
||||
try{
|
||||
//当前页数
|
||||
@ -242,7 +242,7 @@ public class CDNotificationStationInfoController extends CoreDispatcher {
|
||||
*/
|
||||
@PostMapping("/v10/getNotificationConnectorChargeStatus")
|
||||
public void getNotificationConnectorChargeStatus(@RequestBody Map<String, Object> orderMap){
|
||||
System.out.println("==================设备充电中状态变化推送(我们平台推送成都市平台) ==========================");
|
||||
//System.out.println("==================设备充电中状态变化推送(我们平台推送成都市平台) ==========================");
|
||||
//先查订单号 在查实时数据 最后计算金额
|
||||
try {
|
||||
String orderNo = orderMap.get("orderNo").toString();
|
||||
@ -327,7 +327,7 @@ public class CDNotificationStationInfoController extends CoreDispatcher {
|
||||
CommonRequest<ConnectorStatusInfoReq> commonRequest = new CommonRequest<>();
|
||||
commonRequest.setData(data);
|
||||
String result = ok(commonRequest, "/notification_connector_charge_status", authSecretTokenOut);
|
||||
System.out.println("===设备充电中状态变化推送====result========"+result);
|
||||
// System.out.println("===设备充电中状态变化推送====result========"+result);
|
||||
}
|
||||
} catch (JsonProcessingException e) {
|
||||
e.printStackTrace();
|
||||
@ -493,7 +493,7 @@ public class CDNotificationStationInfoController extends CoreDispatcher {
|
||||
CommonRequest<CDStationFee> commonRequest = new CommonRequest<>();
|
||||
commonRequest.setData(data);
|
||||
String ok = ok(commonRequest, "/notification_stationFee", authSecretTokenOut);
|
||||
log.info("===============notification_stationFee=================="+ok);
|
||||
//log.info("===============notification_stationFee=================="+ok);
|
||||
REDIS.deleteObject(stationKey);
|
||||
}
|
||||
}
|
||||
@ -894,7 +894,7 @@ public class CDNotificationStationInfoController extends CoreDispatcher {
|
||||
String dataSecretIV="av6A8QdnRaVRMXu6";
|
||||
String data = Aes128Cbc.encrypt(rawData, dataSecret, dataSecretIV);
|
||||
|
||||
System.out.println("==========data=============="+data);
|
||||
// System.out.println("==========data=============="+data);
|
||||
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
|
||||
@ -81,8 +81,8 @@ public class CDQueryStopChargeController {
|
||||
pileInfo.getCommunicationProtocolVersion() :
|
||||
"0A";
|
||||
//给对应的枪发送停止充电指令
|
||||
System.out.println("=================22========给对应的枪发送停止充电指令==================停止 充电=================="+xhOrderNo);
|
||||
System.out.println("=================22========给对应的枪发送停止充电指令==================停止 充电=================="+xhOrderNo);
|
||||
// System.out.println("=================22========给对应的枪发送停止充电指令==================停止 充电=================="+xhOrderNo);
|
||||
// System.out.println("=================22========给对应的枪发送停止充电指令==================停止 充电=================="+xhOrderNo);
|
||||
|
||||
R r = powerPileService.stopCharging(xhOrderNo, pileNum, connectorId, versionNum);
|
||||
// 判断停止指令发送是否成功
|
||||
|
||||
@ -39,12 +39,29 @@ public class CDConnectorChargeStatusInfoTask extends CoreDispatcher {
|
||||
private XhpcStationInternetBlacklistRepository xhpcStationInternetBlacklistRepo;
|
||||
private final Logger logger = LoggerFactory.getLogger(CDConnectorChargeStatusInfoTask.class);
|
||||
|
||||
//9099开放定时任务 9009不开放
|
||||
/**
|
||||
* 清除3天前数据
|
||||
* 实时数据没40秒
|
||||
*/
|
||||
@Scheduled(fixedDelay = 1000 * 60)
|
||||
public void runY() throws Exception{
|
||||
Collection<String> realtimeOrder = REDIS.keys("cdjgpc:realTime:*");
|
||||
for (String okey : realtimeOrder) {
|
||||
String orderNo = REDIS.getCacheObject(okey);
|
||||
String format = DateUtil.format(DateUtil.offsetDay(new Date(),-3), "yyMMdd");
|
||||
if(Integer.parseInt(format)>Integer.parseInt(orderNo.substring(16,22))){
|
||||
REDIS.deleteObject(okey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//9099开放定时任务 9009不开放
|
||||
/**
|
||||
* 设备充电中状态变化推送(我们平台推送成都市平台) --已推送
|
||||
* 实时数据没40秒
|
||||
*/
|
||||
// @Scheduled(fixedDelay = 1000 * 40)
|
||||
@Scheduled(fixedDelay = 1000 * 40)
|
||||
public void run() throws Exception{
|
||||
|
||||
List<Long> longList =new ArrayList<>();
|
||||
@ -79,6 +96,10 @@ public class CDConnectorChargeStatusInfoTask extends CoreDispatcher {
|
||||
}
|
||||
if(falen){ continue;}
|
||||
CacheRealtimeData lord = REDIS.getCacheObject("order:"+orderNo+".lord");
|
||||
if(lord ==null){
|
||||
REDIS.deleteObject(okey);
|
||||
continue;
|
||||
}
|
||||
String formatTime = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss");
|
||||
Map<String, Object> cacheMap =REDIS.getCacheMap("order:"+orderNo+".notification");
|
||||
if(cacheMap==null || cacheMap.get("startTime")==null || "".equals(cacheMap.get("startTime"))){
|
||||
@ -157,15 +178,32 @@ public class CDConnectorChargeStatusInfoTask extends CoreDispatcher {
|
||||
CommonRequest<ConnectorStatusInfoReq> commonRequest = new CommonRequest<>();
|
||||
commonRequest.setData(data);
|
||||
String result = ok(commonRequest, "/notification_connector_charge_status", authSecretTokenOut);
|
||||
System.out.println("===设备充电中状态变化推送====lord.getOrderNo()========"+lord.getOrderNo());
|
||||
System.out.println("===设备充电中状态变化推送====result========"+result);
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
if("0".equals(jsonObject.get("Ret").toString())){
|
||||
System.out.println("===设备充电中状态变化推送====okey========"+okey);
|
||||
REDIS.deleteObject(okey);
|
||||
}
|
||||
//System.out.println("===设备充电中状态变化推送====result========"+result);
|
||||
}
|
||||
} catch (JsonProcessingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String num ="80836000010001022504092251329998";
|
||||
String format = DateUtil.format(DateUtil.offsetDay(new Date(),-3), "yyMMdd");
|
||||
System.out.println(format);
|
||||
System.out.println(num.substring(16,22));
|
||||
if(Integer.parseInt(format)>Integer.parseInt(num.substring(16,22))){
|
||||
System.out.println("==============");
|
||||
}else{
|
||||
System.out.println("=======4444=======");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ public class CDNotificationChargeOrderInfoTask extends CoreDispatcher {
|
||||
private final Logger logger = LoggerFactory.getLogger(NotificationChargeOrderInfoTask.class);
|
||||
|
||||
//9099开放定时任务 9009不开放
|
||||
//@Scheduled(fixedRate = 1000 * 15)
|
||||
@Scheduled(fixedRate = 1000 * 15)
|
||||
public void run() throws JsonProcessingException {
|
||||
|
||||
Collection<String> orderKeys = REDIS.keys("order:*");
|
||||
|
||||
@ -94,10 +94,10 @@ public class CDNotificationEquipmentV2GPowerInfoTask extends CoreDispatcher {
|
||||
Map<String,Object> mapStationInfo =new HashMap<>();
|
||||
mapStationInfo.put("EquipmentV2GPowerInfo",cdEquipmentV2GPowerInfo);
|
||||
String data = JSONUtil.toJSONString(mapStationInfo);
|
||||
System.out.println("=======data========"+data);
|
||||
// System.out.println("=======data========"+data);
|
||||
commonRequest.setData(data);
|
||||
String result =ok(commonRequest,"/notification_equipmentV2GPowerInfo",authSecretTokenOut);
|
||||
System.out.println("=====V2G 实时负荷信息推送==result========"+result);
|
||||
// System.out.println("=====V2G 实时负荷信息推送==result========"+result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,6 +22,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Example;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
@ -39,6 +42,8 @@ import static com.xhpc.evcs.domain.AuthSecretToken.SECRET_TOKEN_TYPE_OUT;
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/orderInfoTask")
|
||||
public class CDNotificationOrderInfoTask extends CoreDispatcher {
|
||||
@Autowired
|
||||
private XhpcHistoryOrderRepository xhpcHistoryOrderRepository;
|
||||
@ -54,26 +59,24 @@ public class CDNotificationOrderInfoTask extends CoreDispatcher {
|
||||
private XhpcChargingStationRepository chargingStationRepo;
|
||||
@Autowired
|
||||
private XhpcStationInternetBlacklistRepository xhpcStationInternetBlacklistRepo;
|
||||
private final Logger logger = LoggerFactory.getLogger(NotificationChargeOrderInfo4BonusTask.class);
|
||||
private final Logger logger = LoggerFactory.getLogger(CDNotificationOrderInfoTask.class);
|
||||
|
||||
/**
|
||||
*订单信息推送 ---已推送--推送服务使用
|
||||
* @throws IOException
|
||||
*/
|
||||
//9099开放定时任务 9009不开放
|
||||
//@Scheduled(fixedDelay = 1000 * 60)
|
||||
@GetMapping("/infoTask")
|
||||
@Scheduled(fixedRate = 1000 * 30)
|
||||
public void run() throws IOException {
|
||||
|
||||
AuthSecretToken authSecretTokenOut =
|
||||
authSecretTokenRepository.findByOperatorId3irdptyAndOperatorIdAndSecretTokenType(
|
||||
"MA6CC2LK7", "MA6DFCTD5", SECRET_TOKEN_TYPE_OUT).orElse(null); //todo
|
||||
// maybe对接第三方
|
||||
if (authSecretTokenOut != null) {
|
||||
|
||||
final List<XhpcHistoryOrder> notYetPushOrder =
|
||||
xhpcHistoryOrderRepository.findTop100ByHistoryOrderIdGreaterThanAndStateGreaterThanOrderByHistoryOrderIdAsc(authSecretTokenOut.getLastPushOrder(), 0);
|
||||
xhpcHistoryOrderRepository.findTop1000ByHistoryOrderIdGreaterThanEqualOrderByHistoryOrderIdAsc(authSecretTokenOut.getLastPushOrder());
|
||||
for (XhpcHistoryOrder xhpcHistoryOrder : notYetPushOrder) {
|
||||
|
||||
XhpcStationInternetBlacklist xhpcStationInternetBlacklist =
|
||||
xhpcStationInternetBlacklistRepo.findByChargingStationIdAndInternetUserId(xhpcHistoryOrder.getChargingStationId(),
|
||||
6L).orElse(null);
|
||||
@ -85,7 +88,7 @@ public class CDNotificationOrderInfoTask extends CoreDispatcher {
|
||||
notify(xhpcHistoryOrder, authSecretTokenOut, false);
|
||||
}else{
|
||||
//充电时长不能小于或等于0 不能推送
|
||||
logger.info("========新平台推送=======responseBody===================充电时长不能小于或等于0==========");
|
||||
// logger.info("========新平台推送=======responseBody===================充电时长不能小于或等于0==========");
|
||||
}
|
||||
|
||||
}
|
||||
@ -146,10 +149,11 @@ public class CDNotificationOrderInfoTask extends CoreDispatcher {
|
||||
commonRequest.setData(data);
|
||||
String responseBody = ok(commonRequest, "/notification_orderInfo", authSecretTokenOut);
|
||||
logger.info("========新平台推送=======responseBody============================="+cdChargeOrderInfo4BonusReq.getStartChargeSeq());
|
||||
logger.info("========新平台推送=======responseBody============================="+cdChargeOrderInfo4BonusReq.getStartChargeSeq());
|
||||
|
||||
|
||||
CDCancelOrderResponse cdChargeOrder4BonusInfoRes = DTOJsonHelper.parseResponseData(responseBody,
|
||||
CDCancelOrderResponse.class, authSecretTokenOut);
|
||||
//logger.info("========新平台推送=======responseBody==状态==========================="+cdChargeOrder4BonusInfoRes.getStatus());
|
||||
if (!isRepush) {
|
||||
authSecretTokenOut.setLastPushOrder(xhpcHistoryOrder.getHistoryOrderId());
|
||||
authSecretTokenRepository.save(authSecretTokenOut);
|
||||
|
||||
@ -31,7 +31,7 @@ public class CDNotificationStationFeeTask extends CoreDispatcher {
|
||||
private final Logger logger = LoggerFactory.getLogger(CDNotificationStationFeeTask.class);
|
||||
|
||||
//9099开放定时任务 9009不开放
|
||||
//@Scheduled(fixedDelay = 1000 * 60)
|
||||
@Scheduled(fixedDelay = 1000 * 60)
|
||||
public void run() throws IOException {
|
||||
|
||||
AuthSecretToken authSecretTokenOut =
|
||||
@ -48,7 +48,7 @@ public class CDNotificationStationFeeTask extends CoreDispatcher {
|
||||
CommonRequest<CDStationFee> commonRequest = new CommonRequest<>();
|
||||
commonRequest.setData(data);
|
||||
String ok = ok(commonRequest, "/notification_stationFee", authSecretTokenOut);
|
||||
log.info("======站点费率推送=========notification_stationFee=================="+ok);
|
||||
// log.info("======站点费率推送=========notification_stationFee=================="+ok);
|
||||
REDIS.deleteObject(stationKey);
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,7 +32,7 @@ public class CDNotificationStationInfoTask extends CoreDispatcher {
|
||||
private final Logger logger = LoggerFactory.getLogger(CDNotificationStationInfoTask.class);
|
||||
|
||||
//9099开放定时任务 9009不开放
|
||||
//@Scheduled(cron = "0 0 0 1/15 * ? ")
|
||||
@Scheduled(cron = "0 0 0 1/15 * ? ")
|
||||
public void run() throws IOException {
|
||||
try{
|
||||
List<XhpcStationInternetBlacklist> xhpcStationInternetBlacklist =
|
||||
@ -114,10 +114,10 @@ public class CDNotificationStationInfoTask extends CoreDispatcher {
|
||||
Map<String,Object> mapStationInfo =new HashMap<>();
|
||||
mapStationInfo.put("StationInfo",cdStationInfo);
|
||||
String data = JSONUtil.toJSONString(mapStationInfo);
|
||||
System.out.println("=======data========"+data);
|
||||
// System.out.println("=======data========"+data);
|
||||
commonRequest.setData(data);
|
||||
String result =ok(commonRequest,"/notification_stationInfo",authSecretTokenOut);
|
||||
System.out.println("=====推送充电站信息==result========"+result);
|
||||
// System.out.println("=====推送充电站信息==result========"+result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ public class CDNotificationStationPowerInfoTask extends CoreDispatcher {
|
||||
private final Logger logger = LoggerFactory.getLogger(CDNotificationStationPowerInfoTask.class);
|
||||
|
||||
//9099开放定时任务 9009不开放
|
||||
//@Scheduled(cron = "0 0/1 * * * ? ")
|
||||
//@Scheduled(cron = "0 0/1 * * * ? ")
|
||||
public void run() throws IOException {
|
||||
//不参与合作的电站
|
||||
List<XhpcStationInternetBlacklist> xhpcStationInternetBlacklist =xhpcStationInternetBlacklistRepo.findByInternetUserId(6L);
|
||||
@ -98,10 +98,10 @@ public class CDNotificationStationPowerInfoTask extends CoreDispatcher {
|
||||
Map<String,Object> mapStationInfo =new HashMap<>();
|
||||
mapStationInfo.put("StationPowerInfo",cdStationPowerlnfo);
|
||||
String data = JSONUtil.toJSONString(mapStationInfo);
|
||||
System.out.println("=======data========"+data);
|
||||
// System.out.println("=======data========"+data);
|
||||
commonRequest.setData(data);
|
||||
String result =ok(commonRequest,"/notification_stationPowerInfo",authSecretTokenOut);
|
||||
System.out.println("=====充电站实时负荷信息推送==result========"+result);
|
||||
// System.out.println("=====充电站实时负荷信息推送==result========"+result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ public class CDNotificationStationStatusTask extends CoreDispatcher {
|
||||
@Resource
|
||||
private XhpcTerminalRepository terminalRepository;
|
||||
//9099开放定时任务 9009不开放
|
||||
//@Scheduled(fixedRate = 1000 * 45)
|
||||
@Scheduled(fixedRate = 1000 * 180)
|
||||
protected void run() throws IOException {
|
||||
|
||||
Collection<String> stationTerminalKeys = REDIS.keys("stationTerminalStatus:*");
|
||||
@ -124,9 +124,9 @@ public class CDNotificationStationStatusTask extends CoreDispatcher {
|
||||
|
||||
CDConnectorStatusInfoReq connectorStatusInfoReq = new CDConnectorStatusInfoReq();
|
||||
|
||||
System.out.println("=========stationTerminalKey=========="+stationTerminalKey);
|
||||
//System.out.println("=========stationTerminalKey=========="+stationTerminalKey+"======ConnectorID======="+connectorStatusInfo.getConnectorID());
|
||||
String key =stationTerminalKey.replace("stationTerminalStatus","cdjgpc:station")+".notification";
|
||||
System.out.println("=========key=========="+key);
|
||||
// System.out.println("=========key=========="+key);
|
||||
CDStationInfo cdStationInfo =REDIS.getCacheObject(key);
|
||||
CDConnectorStatusInfo cdConnectorStatusInfo =new CDConnectorStatusInfo();
|
||||
cdConnectorStatusInfo.setOperatorID(cdStationInfo.getOperatorId());
|
||||
|
||||
@ -50,7 +50,7 @@ public class CDSuperviseNotificationOperationStatusInfoTask extends CoreDispatch
|
||||
|
||||
R r = powerPileService.getSuperviseNotificationOperationStatusInfo(replace);
|
||||
if(r.getCode() !=200){
|
||||
logger.info("========推送充电站用能统计信息失败,时间:"+ DateUtil.format(DateUtil.yesterday(), "yyyy-MM-dd"));
|
||||
// logger.info("========推送充电站用能统计信息失败,时间:"+ DateUtil.format(DateUtil.yesterday(), "yyyy-MM-dd"));
|
||||
}
|
||||
String key ="cdjgpc:station:"+replace+".getSuperviseNotificationOperationStatusInfo";
|
||||
List<CDStationStatslnfo> stationStatsInfoList =REDIS.getCacheObject(key);
|
||||
@ -63,8 +63,8 @@ public class CDSuperviseNotificationOperationStatusInfoTask extends CoreDispatch
|
||||
CommonRequest<CDStationStatslnfo> commonRequest = new CommonRequest<>();
|
||||
commonRequest.setData(data);
|
||||
String ok = ok(commonRequest, "/supervise_notification_operation_status_info", authSecretTokenOut);
|
||||
System.out.println("=====ok======"+ok);
|
||||
logger.info("========推送充电站用能统计信息成功,时间:========="+DateUtil.format(DateUtil.yesterday(), "yyyy-MM-dd"));
|
||||
// System.out.println("=====ok======"+ok);
|
||||
// logger.info("========推送充电站用能统计信息成功,时间:========="+DateUtil.format(DateUtil.yesterday(), "yyyy-MM-dd"));
|
||||
REDIS.deleteObject(key);
|
||||
}
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ public class CDSuperviseNotificationRealtimePowerInfoTask extends CoreDispatcher
|
||||
|
||||
R r = powerPileService.getSuperviseNotificationRealtimePowerInfo(authSecretTokenOut.getOperatorId3irdpty(),replace);
|
||||
if(r.getCode() !=200){
|
||||
logger.info("========推送充电站实时功率失败,时间:"+ DateUtil.format(DateUtil.yesterday(), "yyyy-MM-dd"));
|
||||
// logger.info("========推送充电站实时功率失败,时间:"+ DateUtil.format(DateUtil.yesterday(), "yyyy-MM-dd"));
|
||||
}
|
||||
String key ="cdjgpc:station:"+replace+".getSuperviseNotificationRealtimePowerInfo";
|
||||
List<CDSupStationPowerInfo> supStationPowerInfos =REDIS.getCacheObject(key);
|
||||
@ -62,8 +62,8 @@ public class CDSuperviseNotificationRealtimePowerInfoTask extends CoreDispatcher
|
||||
CommonRequest<CDSupStationPowerInfo> commonRequest = new CommonRequest<>();
|
||||
commonRequest.setData(data);
|
||||
String ok = ok(commonRequest, "/supervise_notification_realtime_power_info", authSecretTokenOut);
|
||||
System.out.println("=====ok======"+ok);
|
||||
logger.info("========推送充电站实时功率成功,时间:========="+DateUtil.format(DateUtil.yesterday(), "yyyy-MM-dd"));
|
||||
//System.out.println("=====ok======"+ok);
|
||||
//logger.info("========推送充电站实时功率成功,时间:========="+DateUtil.format(DateUtil.yesterday(), "yyyy-MM-dd"));
|
||||
REDIS.deleteObject(key);
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,7 +75,7 @@ public class EvcsFilter extends OncePerRequestFilter {
|
||||
if (!ObjectUtils.isEmpty(bodyString)) {
|
||||
String servletPath = request.getServletPath();
|
||||
log.debug("servletPath: " + servletPath);
|
||||
log.info("=================servletPath=========================="+servletPath);
|
||||
//log.info("=================servletPath=========================="+servletPath);
|
||||
CommonRequest commonRequest = JSONUtil.readParams(bodyString, CommonRequest.class);
|
||||
resp.setRet(EvcsConst.RET_FAIL);
|
||||
ContentCachingResponseWrapper responseWrapper = new ContentCachingResponseWrapper(response);
|
||||
@ -89,7 +89,7 @@ public class EvcsFilter extends OncePerRequestFilter {
|
||||
} else {
|
||||
String operatorId = commonRequest.getOperatorId();
|
||||
|
||||
log.info("=================operatorId=========================="+operatorId);
|
||||
// log.info("=================operatorId=========================="+operatorId);
|
||||
|
||||
String authorization = request.getHeader("Authorization");
|
||||
log.debug("Authorization: {}", authorization);
|
||||
@ -97,19 +97,19 @@ public class EvcsFilter extends OncePerRequestFilter {
|
||||
Date now = Calendar.getInstance().getTime();
|
||||
|
||||
if (servletPath.endsWith("/v1/query_token")) {
|
||||
log.info("================老接口过滤 token========operatorId=========="+operatorId);
|
||||
// log.info("================老接口过滤 token========operatorId=========="+operatorId);
|
||||
authSecretTokenIn = authSecretTokenRepository.findByStatusAndOperatorId3irdptyAndSecretTokenType(1,operatorId,
|
||||
AuthSecretToken.SECRET_TOKEN_TYPE_IN).orElse(null);
|
||||
handleQueryToken(request, response, chain, requestWrapper, bodyString, commonRequest,
|
||||
responseWrapper, authSecretTokenIn);
|
||||
}else if (servletPath.endsWith("/v10/query_token")) {
|
||||
log.info("================新监管平台(蓉城充) token========operatorId=========="+operatorId);
|
||||
// log.info("================新监管平台(蓉城充) token========operatorId=========="+operatorId);
|
||||
authSecretTokenIn = authSecretTokenRepository.findByStatusAndOperatorId3irdptyAndSecretTokenType(2,operatorId,
|
||||
AuthSecretToken.SECRET_TOKEN_TYPE_IN).orElse(null);
|
||||
handleQueryToken(request, response, chain, requestWrapper, bodyString, commonRequest,
|
||||
responseWrapper, authSecretTokenIn);
|
||||
}else if (servletPath.endsWith("/v20/query_token")) {
|
||||
log.info("================川逸充 token========operatorId=========="+operatorId);
|
||||
// log.info("================川逸充 token========operatorId=========="+operatorId);
|
||||
authSecretTokenIn = authSecretTokenRepository.findByStatusAndOperatorId3irdptyAndSecretTokenType(3,operatorId,
|
||||
AuthSecretToken.SECRET_TOKEN_TYPE_IN).orElse(null);
|
||||
handleQueryToken(request, response, chain, requestWrapper, bodyString, commonRequest,
|
||||
@ -118,21 +118,22 @@ public class EvcsFilter extends OncePerRequestFilter {
|
||||
if (authorization != null && authorization.startsWith("Bearer ")) {
|
||||
String token = authorization.replace("Bearer ", "");
|
||||
|
||||
if(servletPath.endsWith("/v1/")){
|
||||
authSecretTokenIn =
|
||||
authSecretTokenRepository.findByStatusAndOperatorId3irdptyAndSecretTokenTypeAndTokenExpiryGreaterThan(1,
|
||||
operatorId, AuthSecretToken.SECRET_TOKEN_TYPE_IN, now).orElse(null);
|
||||
}else if(servletPath.endsWith("/v10/")){
|
||||
authSecretTokenIn =
|
||||
authSecretTokenRepository.findByStatusAndOperatorId3irdptyAndSecretTokenTypeAndTokenExpiryGreaterThan(2,
|
||||
operatorId, AuthSecretToken.SECRET_TOKEN_TYPE_IN, now).orElse(null);
|
||||
}else if(servletPath.endsWith("/v20/")){
|
||||
authSecretTokenIn =
|
||||
authSecretTokenRepository.findByStatusAndOperatorId3irdptyAndSecretTokenTypeAndTokenExpiryGreaterThan(3,
|
||||
operatorId, AuthSecretToken.SECRET_TOKEN_TYPE_IN, now).orElse(null);
|
||||
}
|
||||
|
||||
// if(servletPath.endsWith("/v1/")){
|
||||
// authSecretTokenIn =
|
||||
// authSecretTokenRepository.findByStatusAndOperatorId3irdptyAndSecretTokenTypeAndTokenExpiryGreaterThan(1,
|
||||
// operatorId, AuthSecretToken.SECRET_TOKEN_TYPE_IN, now).orElse(null);
|
||||
// }else if(servletPath.endsWith("/v10/")){
|
||||
// authSecretTokenIn =
|
||||
// authSecretTokenRepository.findByStatusAndOperatorId3irdptyAndSecretTokenTypeAndTokenExpiryGreaterThan(2,
|
||||
// operatorId, AuthSecretToken.SECRET_TOKEN_TYPE_IN, now).orElse(null);
|
||||
// }else if(servletPath.endsWith("/v20/")){
|
||||
// authSecretTokenIn =
|
||||
// authSecretTokenRepository.findByStatusAndOperatorId3irdptyAndSecretTokenTypeAndTokenExpiryGreaterThan(3,
|
||||
// operatorId, AuthSecretToken.SECRET_TOKEN_TYPE_IN, now).orElse(null);
|
||||
// }
|
||||
|
||||
authSecretTokenIn =authSecretTokenRepository.findByOperatorId3irdptyAndSecretTokenTypeAndTokenExpiryGreaterThan(
|
||||
operatorId, AuthSecretToken.SECRET_TOKEN_TYPE_IN, now).orElse(null);
|
||||
if (authSecretTokenIn == null) {
|
||||
resp.setRet("4002");
|
||||
resp.setMsg("Invalid token(db)");
|
||||
@ -185,7 +186,7 @@ public class EvcsFilter extends OncePerRequestFilter {
|
||||
final String encout = request.getHeader("enc.out");
|
||||
chain.doFilter(requestWrapper, responseWrapper);
|
||||
byte[] buf = responseWrapper.getContentAsByteArray();
|
||||
log.debug("out.plain: {}", new String(buf, StandardCharsets.UTF_8));
|
||||
// log.debug("out.plain: {}", new String(buf, StandardCharsets.UTF_8));
|
||||
String encryptedData;
|
||||
if (encout == null) {
|
||||
encryptedData = encryptRespOut(authSecretTokenIn.getDataSecret(), authSecretTokenIn.getDataSecretIV(),
|
||||
@ -358,7 +359,7 @@ public class EvcsFilter extends OncePerRequestFilter {
|
||||
equipBizRequest.setConnectorId("8083600001000801");
|
||||
|
||||
String data = JSONUtil.toJSONString(equipBizRequest);
|
||||
System.out.println("========data========"+data);
|
||||
//System.out.println("========data========"+data);
|
||||
|
||||
|
||||
commonRequest.setData(data);
|
||||
|
||||
@ -41,8 +41,8 @@ public class CYCNotificationStationInfoController extends CoreDispatcher {
|
||||
*/
|
||||
@PostMapping("/v20/getCYCNotificationConnectorChargeStatus")
|
||||
public void getCYCNotificationConnectorChargeStatus(@RequestBody Map<String, Object> orderMap){
|
||||
System.out.println("==================设备充电中状态变化推送(川逸充) ==========================");
|
||||
System.out.println("==================设备充电中状态变化推送(川逸充) =============orderMap============="+orderMap.toString());
|
||||
//System.out.println("==================设备充电中状态变化推送(川逸充) ==========================");
|
||||
//System.out.println("==================设备充电中状态变化推送(川逸充) =============orderMap============="+orderMap.toString());
|
||||
//先查订单号 在查实时数据 最后计算金额
|
||||
try {
|
||||
String orderNo = orderMap.get("orderNo").toString();
|
||||
@ -99,14 +99,14 @@ public class CYCNotificationStationInfoController extends CoreDispatcher {
|
||||
//Map<String, Object> map =new HashMap<>();
|
||||
//map.put("ConnectorChargeStatusInfo",cdConnectorChargeStatusInfo);
|
||||
String data = JSONUtil.toJSONString(cdConnectorChargeStatusInfo);
|
||||
System.out.println("===川逸充设备充电中状态变化推送====data========"+data);
|
||||
// System.out.println("===川逸充设备充电中状态变化推送====data========"+data);
|
||||
CommonRequest<Object> commonRequest = new CommonRequest<>();
|
||||
commonRequest.setData(data);
|
||||
String result = ok(commonRequest, "/notification_equip_charge_status", authSecretTokenOut);
|
||||
System.out.println("===川逸充设备充电中状态变化推送====result========"+result);
|
||||
// System.out.println("===川逸充设备充电中状态变化推送====result========"+result);
|
||||
CYCChargeChargeStatusResponse chargeStatusResponse = DTOJsonHelper.parseResponseData(result, CYCChargeChargeStatusResponse.class, authSecretTokenOut);
|
||||
|
||||
System.out.println("===川逸充设备充电中状态变化推送====cycChargeOrderInfoResponse========"+chargeStatusResponse.toString());
|
||||
// System.out.println("===川逸充设备充电中状态变化推送====cycChargeOrderInfoResponse========"+chargeStatusResponse.toString());
|
||||
}
|
||||
} catch (JsonProcessingException e) {
|
||||
e.printStackTrace();
|
||||
@ -141,13 +141,13 @@ public class CYCNotificationStationInfoController extends CoreDispatcher {
|
||||
|
||||
String result = ok(commonRequest, "/notification_start_charge_result", authSecretToken.get());
|
||||
|
||||
System.out.println("===川逸充启动结果推送====result========"+result);
|
||||
// System.out.println("===川逸充启动结果推送====result========"+result);
|
||||
CYCChargeOrderInfoResponse cycChargeOrderInfoResponse = DTOJsonHelper.parseResponseData(result, CYCChargeOrderInfoResponse.class, authSecretToken.get());
|
||||
|
||||
System.out.println("===川逸充设备充电中状态变化推送====cycChargeOrderInfoResponse========"+cycChargeOrderInfoResponse.toString());
|
||||
// System.out.println("===川逸充设备充电中状态变化推送====cycChargeOrderInfoResponse========"+cycChargeOrderInfoResponse.toString());
|
||||
}
|
||||
}else{
|
||||
System.out.println("===川逸充启动结果失败====result========");
|
||||
// System.out.println("===川逸充启动结果失败====result========");
|
||||
}
|
||||
}
|
||||
|
||||
@ -176,7 +176,7 @@ public class CYCNotificationStationInfoController extends CoreDispatcher {
|
||||
//String result="pCA3UNQO1CqxRS6KvcNDpw==";
|
||||
CYCChargeOrderInfoResponse cycChargeOrderInfoResponse = DTOJsonHelper.parseResponseData(result, CYCChargeOrderInfoResponse.class, authSecretToken.get());
|
||||
|
||||
System.out.println("===川逸充设备充电中状态变化推送====cycChargeOrderInfoResponse========"+cycChargeOrderInfoResponse.toString());
|
||||
// System.out.println("===川逸充设备充电中状态变化推送====cycChargeOrderInfoResponse========"+cycChargeOrderInfoResponse.toString());
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -20,15 +20,21 @@ public interface XhpcHistoryOrderRepository extends JpaRepository<XhpcHistoryOrd
|
||||
|
||||
List<XhpcHistoryOrder> findTop100ByHistoryOrderIdGreaterThanAndStateGreaterThanOrderByHistoryOrderIdAsc(Long hisOrderId, int i);
|
||||
|
||||
List<XhpcHistoryOrder> findTop100ByHistoryOrderIdGreaterThanEqualAndConfirmResultAndUserIdOrderByHistoryOrderIdAsc(Long hisOrderId,int confirmResult, Long userId);
|
||||
|
||||
List<XhpcHistoryOrder> findByConfirmResultNotAndOperatorId3rdptyEvcsIsNotNull(int succCode);
|
||||
|
||||
List<XhpcHistoryOrder> findByConfirmResultNotAndSource(int confirmResult, int source);
|
||||
|
||||
List<XhpcHistoryOrder> findByConfirmResultAndSource(int confirmResult, int source);
|
||||
|
||||
List<XhpcHistoryOrder> findTop1000ByHistoryOrderIdGreaterThanEqualOrderByHistoryOrderIdAsc(Long hisOrderId);
|
||||
|
||||
@Query("select ho from XhpcHistoryOrder ho join EtPushFailedOrder fo on ho.historyOrderId = fo.id where fo.operatorId3rdpty = ?1")
|
||||
List<XhpcHistoryOrder> findJoinPushFailedOrders(@Param("operatorId3irdpty")String operatorId3irdpty, Pageable pageable);
|
||||
|
||||
default List<XhpcHistoryOrder> findTop10JoinPushFailedOrders(String operatorId3irdpty) {
|
||||
|
||||
return findJoinPushFailedOrders(operatorId3irdpty, PageRequest.of(0, 100));
|
||||
return findJoinPushFailedOrders(operatorId3irdpty, PageRequest.of(0, 500));
|
||||
}
|
||||
}
|
||||
|
||||
@ -117,13 +117,13 @@ public class CoreDispatcher {
|
||||
bearerToken = authSecretTokenOut.getToken();
|
||||
commonRequest.setData(originalData);
|
||||
tData = JSONUtil.toJSONString(commonRequest);
|
||||
System.out.println("=========加密前data=============="+tData);
|
||||
log.debug("to [{}] {} out plain data:\n{}", authSecretTokenOut.getOperatorId3irdpty(), url, tData);
|
||||
// System.out.println("=========加密前data=============="+tData);
|
||||
//log.debug("to [{}] {} out plain data:\n{}", authSecretTokenOut.getOperatorId3irdpty(), url, tData);
|
||||
if (authSecretTokenOut.isEncrypt()) {
|
||||
tData = encryptReqOut(authSecretTokenOut.getDataSecret(), authSecretTokenOut.getDataSecretIV(),
|
||||
authSecretTokenOut.getSigSecret(), commonRequest);
|
||||
// log.debug("notify out encrypt data:\n{}", tData);
|
||||
System.out.println("=========加密data=============="+tData);
|
||||
// System.out.println("=========加密data=============="+tData);
|
||||
}
|
||||
body = okhttp3.RequestBody.create(JSON, tData);
|
||||
// logger.info("==============平台推送值================="+tData);
|
||||
@ -239,7 +239,7 @@ public class CoreDispatcher {
|
||||
bearerToken = authSecretTokenOut.getToken();
|
||||
commonRequest.setData(originalData);
|
||||
tData = JSONUtil.toJSONString(commonRequest);
|
||||
log.debug("to [{}] {} out plain data:\n{}", authSecretTokenOut.getOperatorId3irdpty(), url, tData);
|
||||
// log.debug("to [{}] {} out plain data:\n{}", authSecretTokenOut.getOperatorId3irdpty(), url, tData);
|
||||
if (authSecretTokenOut.isEncrypt()) {
|
||||
tData = encryptReqOut(authSecretTokenOut.getDataSecret(), authSecretTokenOut.getDataSecretIV(),
|
||||
authSecretTokenOut.getSigSecret(), commonRequest);
|
||||
|
||||
@ -32,7 +32,7 @@ public class NotificationCancelOrderTask extends CoreDispatcher {
|
||||
|
||||
//推送不开放(evcs 放开)
|
||||
//9009开放定时任务 9099不开放
|
||||
//@Scheduled(fixedRate = 1000 * 15)
|
||||
@Scheduled(fixedRate = 1000 * 15)
|
||||
public void run() throws JsonProcessingException {
|
||||
|
||||
//Getting the orders, which need to be notified.
|
||||
|
||||
@ -47,7 +47,7 @@ public class NotificationChargeOrderInfo4BonusTask extends CoreDispatcher {
|
||||
* @throws IOException
|
||||
*/
|
||||
//9099开放定时任务 9009不开放
|
||||
//@Scheduled(fixedDelay = 1000 * 60)
|
||||
//@Scheduled(fixedRate = 1000 * 180)
|
||||
public void run() throws IOException {
|
||||
|
||||
AuthSecretToken authSecretTokenOut =
|
||||
@ -116,8 +116,8 @@ public class NotificationChargeOrderInfo4BonusTask extends CoreDispatcher {
|
||||
commonRequest.setData(data);
|
||||
String responseBody = ok(commonRequest, "/notification_charge_order_info_for_bonus", authSecretTokenOut,
|
||||
operatorIdEvcs);
|
||||
logger.info("========老平台推送=======operatorIdEvcs============================="+operatorIdEvcs);
|
||||
logger.info("========老平台推送=======responseBody============================="+cdChargeOrderInfo4BonusReq.getStartChargeSeq());
|
||||
//logger.info("========老平台推送=======operatorIdEvcs============================="+operatorIdEvcs);
|
||||
//logger.info("========老平台推送=======responseBody============================="+cdChargeOrderInfo4BonusReq.getStartChargeSeq());
|
||||
|
||||
CDChargeOrder4BonusInfoRes cdChargeOrder4BonusInfoRes = DTOJsonHelper.parseResponseData(responseBody,
|
||||
CDChargeOrder4BonusInfoRes.class, authSecretTokenOut);
|
||||
|
||||
@ -0,0 +1,98 @@
|
||||
package com.xhpc.evcs.notification;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.xhpc.evcs.domain.AuthSecretToken;
|
||||
import com.xhpc.evcs.dto.ChargeOrderInfo;
|
||||
import com.xhpc.evcs.dto.ChargeOrderInfoResponse;
|
||||
import com.xhpc.evcs.dto.CommonRequest;
|
||||
import com.xhpc.evcs.dto.DTOJsonHelper;
|
||||
import com.xhpc.evcs.jpa.AuthSecretTokenRepository;
|
||||
import com.xhpc.evcs.jpa.XhpcHistoryOrderRepository;
|
||||
import com.xhpc.evcs.utils.JSONUtil;
|
||||
import com.xhpc.order.domain.XhpcHistoryOrder;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.xhpc.common.data.redis.StaticBeanUtil.REDIS;
|
||||
import static com.xhpc.evcs.domain.AuthSecretToken.SECRET_TOKEN_TYPE_OUT;
|
||||
|
||||
/**
|
||||
* 恒大推送订单
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class NotificationChargeOrderInfoHenDaTask extends CoreDispatcher {
|
||||
|
||||
@Autowired
|
||||
private XhpcHistoryOrderRepository xhpcHistoryOrderRepository;
|
||||
@Autowired
|
||||
private AuthSecretTokenRepository authSecretTokenRepository;
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(NotificationChargeOrderInfoHenDaTask.class);
|
||||
/**
|
||||
* 推送充电恒大订单信息
|
||||
* * @throws IOException
|
||||
*/
|
||||
//9099开放定时任务 9009不开放
|
||||
//@Scheduled(fixedDelay = 1000 * 15)
|
||||
//@Scheduled(cron = "0/30 * * * * ? ")
|
||||
public void run() throws IOException {
|
||||
|
||||
AuthSecretToken authSecretTokenOut =
|
||||
authSecretTokenRepository.findByOperatorId3irdptyAndOperatorIdAndSecretTokenType(
|
||||
"MA5FF58R7", "MA6DFCTD5", SECRET_TOKEN_TYPE_OUT).orElse(null); //todo
|
||||
|
||||
// maybe对接第三方
|
||||
if (authSecretTokenOut != null) {
|
||||
final List<XhpcHistoryOrder> notYetPushOrder =
|
||||
xhpcHistoryOrderRepository.findTop100ByHistoryOrderIdGreaterThanEqualAndConfirmResultAndUserIdOrderByHistoryOrderIdAsc(authSecretTokenOut.getLastPushOrder(), -1,2L);
|
||||
for (XhpcHistoryOrder horder : notYetPushOrder) {
|
||||
|
||||
String operatorId3rdptyEvcs = horder.getOperatorId3rdptyEvcs();
|
||||
if (operatorId3rdptyEvcs == null) {
|
||||
if (horder.getInternetSerialNumber() != null) {
|
||||
operatorId3rdptyEvcs = horder.getInternetSerialNumber().substring(0, 9);
|
||||
horder.setOperatorId3rdptyEvcs(operatorId3rdptyEvcs);
|
||||
xhpcHistoryOrderRepository.save(horder); // mending
|
||||
}
|
||||
}
|
||||
|
||||
ChargeOrderInfo chargeOrderInfo = new ChargeOrderInfo(horder);
|
||||
final ChargeOrderInfoResponse pushResp = notify(chargeOrderInfo, authSecretTokenOut);
|
||||
if (pushResp != null) {
|
||||
horder.setConfirmResult(pushResp.getConfirmResult());
|
||||
logger.debug("恒大3rd part order {} push result: {}", horder.getSerialNumber(),
|
||||
pushResp.getConfirmResult());
|
||||
//logger.info("==============推送返回值================="+pushResp.toString());
|
||||
xhpcHistoryOrderRepository.save(horder);
|
||||
REDIS.setCacheMapValue("pushOrder:".concat(horder.getSerialNumber()), "horderpushed", true);
|
||||
|
||||
authSecretTokenOut.setLastPushOrder(horder.getHistoryOrderId());
|
||||
authSecretTokenRepository.save(authSecretTokenOut);
|
||||
} else {
|
||||
logger.error("恒大3dp[{}] order[{}/{}] push fail", operatorId3rdptyEvcs,
|
||||
horder.getSerialNumber(), horder.getInternetSerialNumber());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public ChargeOrderInfoResponse notify(ChargeOrderInfo chargeOrderInfo, AuthSecretToken authSecretTokenOut) throws JsonProcessingException {
|
||||
|
||||
String data = JSONUtil.toJSONString(chargeOrderInfo);
|
||||
CommonRequest<ChargeOrderInfo> commonRequest = new CommonRequest<>();
|
||||
commonRequest.setData(data);
|
||||
String responseBody = ok(commonRequest, "/notification_charge_order_info", authSecretTokenOut);
|
||||
return DTOJsonHelper.parseResponseData(responseBody,
|
||||
ChargeOrderInfoResponse.class, authSecretTokenOut);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,99 @@
|
||||
package com.xhpc.evcs.notification;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.xhpc.evcs.domain.AuthSecretToken;
|
||||
import com.xhpc.evcs.dto.ChargeOrderInfo;
|
||||
import com.xhpc.evcs.dto.ChargeOrderInfoResponse;
|
||||
import com.xhpc.evcs.dto.CommonRequest;
|
||||
import com.xhpc.evcs.dto.DTOJsonHelper;
|
||||
import com.xhpc.evcs.jpa.AuthSecretTokenRepository;
|
||||
import com.xhpc.evcs.jpa.XhpcHistoryOrderRepository;
|
||||
import com.xhpc.evcs.utils.JSONUtil;
|
||||
import com.xhpc.order.domain.XhpcHistoryOrder;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.xhpc.common.data.redis.StaticBeanUtil.REDIS;
|
||||
import static com.xhpc.evcs.domain.AuthSecretToken.SECRET_TOKEN_TYPE_OUT;
|
||||
|
||||
/**
|
||||
* 快电推送订单
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class NotificationChargeOrderInfoKuaiDianTask extends CoreDispatcher {
|
||||
|
||||
@Autowired
|
||||
private XhpcHistoryOrderRepository xhpcHistoryOrderRepository;
|
||||
@Autowired
|
||||
private AuthSecretTokenRepository authSecretTokenRepository;
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(NotificationChargeOrderInfoKuaiDianTask.class);
|
||||
/**
|
||||
* 推送充电快电订单信息
|
||||
* * @throws IOException
|
||||
*/
|
||||
//9099开放定时任务 9009不开放
|
||||
//@Scheduled(fixedDelay = 1000 * 26)
|
||||
//@Scheduled(cron = "0/20 * * * * ? ")
|
||||
public void run() throws IOException {
|
||||
|
||||
AuthSecretToken authSecretTokenOut =
|
||||
authSecretTokenRepository.findByOperatorId3irdptyAndOperatorIdAndSecretTokenType(
|
||||
"MA005DBW1", "MA6DFCTD5", SECRET_TOKEN_TYPE_OUT).orElse(null); //todo
|
||||
|
||||
// maybe对接第三方
|
||||
if (authSecretTokenOut != null) {
|
||||
final List<XhpcHistoryOrder> notYetPushOrder =
|
||||
xhpcHistoryOrderRepository.findTop100ByHistoryOrderIdGreaterThanEqualAndConfirmResultAndUserIdOrderByHistoryOrderIdAsc(authSecretTokenOut.getLastPushOrder(), -1,1L);
|
||||
for (XhpcHistoryOrder horder : notYetPushOrder) {
|
||||
|
||||
String operatorId3rdptyEvcs = horder.getOperatorId3rdptyEvcs();
|
||||
if (operatorId3rdptyEvcs == null) {
|
||||
if (horder.getInternetSerialNumber() != null) {
|
||||
operatorId3rdptyEvcs = horder.getInternetSerialNumber().substring(0, 9);
|
||||
horder.setOperatorId3rdptyEvcs(operatorId3rdptyEvcs);
|
||||
xhpcHistoryOrderRepository.save(horder); // mending
|
||||
}
|
||||
}
|
||||
|
||||
ChargeOrderInfo chargeOrderInfo = new ChargeOrderInfo(horder);
|
||||
final ChargeOrderInfoResponse pushResp = notify(chargeOrderInfo, authSecretTokenOut);
|
||||
if (pushResp != null) {
|
||||
horder.setConfirmResult(pushResp.getConfirmResult());
|
||||
logger.debug("快电3rd part order {} push result: {}", horder.getSerialNumber(),
|
||||
pushResp.getConfirmResult());
|
||||
//logger.info("==============推送返回值================="+pushResp.toString());
|
||||
xhpcHistoryOrderRepository.save(horder);
|
||||
REDIS.setCacheMapValue("pushOrder:".concat(horder.getSerialNumber()), "horderpushed", true);
|
||||
|
||||
authSecretTokenOut.setLastPushOrder(horder.getHistoryOrderId());
|
||||
authSecretTokenRepository.save(authSecretTokenOut);
|
||||
|
||||
} else {
|
||||
logger.error("快电3dp[{}] order[{}/{}] push fail", operatorId3rdptyEvcs,
|
||||
horder.getSerialNumber(), horder.getInternetSerialNumber());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public ChargeOrderInfoResponse notify(ChargeOrderInfo chargeOrderInfo, AuthSecretToken authSecretTokenOut) throws JsonProcessingException {
|
||||
|
||||
String data = JSONUtil.toJSONString(chargeOrderInfo);
|
||||
CommonRequest<ChargeOrderInfo> commonRequest = new CommonRequest<>();
|
||||
commonRequest.setData(data);
|
||||
String responseBody = ok(commonRequest, "/notification_charge_order_info", authSecretTokenOut);
|
||||
return DTOJsonHelper.parseResponseData(responseBody,
|
||||
ChargeOrderInfoResponse.class, authSecretTokenOut);
|
||||
}
|
||||
}
|
||||
@ -40,7 +40,7 @@ public class NotificationChargeOrderInfoTask extends CoreDispatcher {
|
||||
private final Logger logger = LoggerFactory.getLogger(NotificationChargeOrderInfoTask.class);
|
||||
//推送不开放(evcs 放开)
|
||||
//9009开放定时任务 9099不开放
|
||||
//@Scheduled(fixedRate = 1000 * 15)
|
||||
@Scheduled(fixedDelay = 1000 * 15)
|
||||
public void run() throws JsonProcessingException {
|
||||
|
||||
Collection<String> orderKeys = REDIS.keys("order:*");
|
||||
@ -61,7 +61,7 @@ public class NotificationChargeOrderInfoTask extends CoreDispatcher {
|
||||
}
|
||||
List<AuthSecretToken> authSecretTokenList = authSecretTokenRepository.findBySecretTokenType(SECRET_TOKEN_TYPE_OUT);
|
||||
List<XhpcHistoryOrder> xhpcHistoryOrderList =
|
||||
xhpcHistoryOrderRepository.findByConfirmResultNotAndSource(0, 1);
|
||||
xhpcHistoryOrderRepository.findByConfirmResultAndSource(-1, 1);
|
||||
for (XhpcHistoryOrder horder : xhpcHistoryOrderList) {
|
||||
|
||||
if("765367656".equals(horder.getInternetSerialNumber().substring(0, 9))){
|
||||
|
||||
@ -0,0 +1,97 @@
|
||||
package com.xhpc.evcs.notification;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.xhpc.evcs.domain.*;
|
||||
import com.xhpc.evcs.dto.*;
|
||||
import com.xhpc.evcs.jpa.*;
|
||||
import com.xhpc.evcs.utils.DateUtil;
|
||||
import com.xhpc.evcs.utils.JSONUtil;
|
||||
import com.xhpc.order.domain.XhpcHistoryOrder;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Example;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.xhpc.common.data.redis.StaticBeanUtil.REDIS;
|
||||
import static com.xhpc.evcs.domain.AuthSecretToken.SECRET_TOKEN_TYPE_OUT;
|
||||
|
||||
/**
|
||||
* 新电途推送订单
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class NotificationChargeOrderInfoXinDianTuTask extends CoreDispatcher {
|
||||
|
||||
@Autowired
|
||||
private XhpcHistoryOrderRepository xhpcHistoryOrderRepository;
|
||||
@Autowired
|
||||
private AuthSecretTokenRepository authSecretTokenRepository;
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(NotificationChargeOrderInfoXinDianTuTask.class);
|
||||
/**
|
||||
* 推送充电新电途订单信息
|
||||
* * @throws IOException
|
||||
*/
|
||||
//9099开放定时任务 9009不开放
|
||||
//@Scheduled(fixedDelay = 1000 * 23)
|
||||
//@Scheduled(cron = "0/15 * * * * ? ")
|
||||
public void run() throws IOException {
|
||||
logger.info("==============开始推送新电途订单=================");
|
||||
AuthSecretToken authSecretTokenOut =
|
||||
authSecretTokenRepository.findByOperatorId3irdptyAndOperatorIdAndSecretTokenType(
|
||||
"MA25CNM38", "MA6DFCTD5", SECRET_TOKEN_TYPE_OUT).orElse(null); //todo
|
||||
// maybe对接第三方
|
||||
if (authSecretTokenOut != null) {
|
||||
final List<XhpcHistoryOrder> notYetPushOrder =
|
||||
xhpcHistoryOrderRepository.findTop100ByHistoryOrderIdGreaterThanEqualAndConfirmResultAndUserIdOrderByHistoryOrderIdAsc(authSecretTokenOut.getLastPushOrder(),-1, 3L);
|
||||
for (XhpcHistoryOrder horder : notYetPushOrder) {
|
||||
|
||||
String operatorId3rdptyEvcs = horder.getOperatorId3rdptyEvcs();
|
||||
logger.info("==============开始推送新电途订单================="+horder.getInternetSerialNumber());
|
||||
if (operatorId3rdptyEvcs == null) {
|
||||
if (horder.getInternetSerialNumber() != null) {
|
||||
operatorId3rdptyEvcs = horder.getInternetSerialNumber().substring(0, 9);
|
||||
horder.setOperatorId3rdptyEvcs(operatorId3rdptyEvcs);
|
||||
xhpcHistoryOrderRepository.save(horder); // mending
|
||||
}
|
||||
}
|
||||
|
||||
ChargeOrderInfo chargeOrderInfo = new ChargeOrderInfo(horder);
|
||||
final ChargeOrderInfoResponse pushResp = notify(chargeOrderInfo, authSecretTokenOut);
|
||||
if (pushResp != null) {
|
||||
horder.setConfirmResult(pushResp.getConfirmResult());
|
||||
logger.debug("新电途3rd part order {} push result: {}", horder.getSerialNumber(),
|
||||
pushResp.getConfirmResult());
|
||||
//logger.info("==============推送返回值================="+pushResp.toString());
|
||||
xhpcHistoryOrderRepository.save(horder);
|
||||
REDIS.setCacheMapValue("pushOrder:".concat(horder.getSerialNumber()), "horderpushed", true);
|
||||
|
||||
authSecretTokenOut.setLastPushOrder(horder.getHistoryOrderId());
|
||||
authSecretTokenRepository.save(authSecretTokenOut);
|
||||
} else {
|
||||
logger.error("新电途3dp[{}] order[{}/{}] push fail", operatorId3rdptyEvcs,
|
||||
horder.getSerialNumber(), horder.getInternetSerialNumber());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public ChargeOrderInfoResponse notify(ChargeOrderInfo chargeOrderInfo, AuthSecretToken authSecretTokenOut) throws JsonProcessingException {
|
||||
|
||||
String data = JSONUtil.toJSONString(chargeOrderInfo);
|
||||
CommonRequest<ChargeOrderInfo> commonRequest = new CommonRequest<>();
|
||||
commonRequest.setData(data);
|
||||
String responseBody = ok(commonRequest, "/notification_charge_order_info", authSecretTokenOut);
|
||||
return DTOJsonHelper.parseResponseData(responseBody,
|
||||
ChargeOrderInfoResponse.class, authSecretTokenOut);
|
||||
}
|
||||
}
|
||||
@ -50,7 +50,7 @@ public class NotificationEquipChargeStatusTask extends CoreDispatcher {
|
||||
*/
|
||||
//推送不开放
|
||||
//9009开放定时任务 9099不开放
|
||||
//@Scheduled(fixedRate = 1000 * 30)
|
||||
@Scheduled(fixedRate = 1000 * 30)
|
||||
public void run() throws IOException {
|
||||
|
||||
List<AuthSecretToken> authSecretTokenOutList = authSecretTokenRepository.findBySecretTokenType(SECRET_TOKEN_TYPE_OUT);
|
||||
@ -224,14 +224,14 @@ public class NotificationEquipChargeStatusTask extends CoreDispatcher {
|
||||
}
|
||||
String data = JSONUtil.toJSONString(equipChargeStatus);
|
||||
CommonRequest<CDChargeOrderInfo4BonusReq> commonRequest = new CommonRequest<>();
|
||||
System.out.println("===============充电结束状态推送========================");
|
||||
System.out.println("===============充电结束状态推送============data============"+data);
|
||||
System.out.println("===============充电结束状态推送========================");
|
||||
//System.out.println("===============充电结束状态推送========================");
|
||||
//System.out.println("===============充电结束状态推送============data============"+data);
|
||||
//System.out.println("===============充电结束状态推送========================");
|
||||
commonRequest.setData(data);
|
||||
String responseBody = ok(commonRequest, "/notification_equip_charge_status", authSecretTokenOut);
|
||||
|
||||
System.out.println("===============充电结束状态推送===========responseBody============="+responseBody);
|
||||
System.out.println("===============充电结束状态推送========================");
|
||||
//System.out.println("===============充电结束状态推送===========responseBody============="+responseBody);
|
||||
//System.out.println("===============充电结束状态推送========================");
|
||||
EquipChargeStatusRes equipChargeStatusRes = DTOJsonHelper.parseResponseData(responseBody,
|
||||
EquipChargeStatusRes.class, authSecretTokenOut);
|
||||
if (equipChargeStatusRes != null && equipChargeStatusRes.getSuccStat() != 0) {
|
||||
|
||||
@ -35,7 +35,7 @@ public class NotificationStartChargeResultTask extends CoreDispatcher {
|
||||
*/
|
||||
//(evcs 放开 30 秒, 测试平台开放 15秒)
|
||||
//9009开放定时任务 9099不开放
|
||||
//@Scheduled(fixedRate = 1000 * 15)
|
||||
@Scheduled(fixedRate = 1000 * 15)
|
||||
public void run() throws IOException {
|
||||
|
||||
//Getting the charge orders which from 3rd.
|
||||
@ -46,7 +46,7 @@ public class NotificationStartChargeResultTask extends CoreDispatcher {
|
||||
if(pushOrder.get("operatorId3rdptyName") !=null && "CYC".equals((String)pushOrder.get("operatorId3rdptyName"))){
|
||||
continue;
|
||||
}
|
||||
logger.info("===============启动推送============================"+pushOrderKey);
|
||||
//logger.info("===============启动推送============================"+pushOrderKey);
|
||||
Integer startChargeNotificationStat = (Integer) pushOrder.get("startChargeNotificationStat");
|
||||
if (null != startChargeNotificationStat && 1 != startChargeNotificationStat && startChargeNotificationStat <= 20) {
|
||||
String startChargeSeq = (String) pushOrder.get("internetSerialNumber");
|
||||
|
||||
@ -51,7 +51,7 @@ public class NotificationStationStatusTask extends CoreDispatcher {
|
||||
|
||||
//推送不开放(evcs 放开)
|
||||
//9009开放定时任务 9099不开放
|
||||
//@Scheduled(fixedRate = 1000 * 45)
|
||||
@Scheduled(fixedRate = 1000 * 60)
|
||||
protected void run() throws IOException {
|
||||
|
||||
Collection<String> stationTerminalKeys = REDIS.keys("stationTerminalStatus:*");
|
||||
@ -71,10 +71,14 @@ public class NotificationStationStatusTask extends CoreDispatcher {
|
||||
Set<ConnectorStatusInfo> changeStatus = ChangePoleStatus.getChangeStatus(connectorStatusInfos);
|
||||
if (!changeStatus.isEmpty()) {
|
||||
for (XhpcInternetUser xhpcInternetUser : xhpcInternetUserList) {
|
||||
if("5".equals(xhpcInternetUser.getInternetUserId().toString()) || "6".equals(xhpcInternetUser.getInternetUserId().toString())){
|
||||
continue;
|
||||
}
|
||||
XhpcStationInternetBlacklist xhpcStationInternetBlacklist =
|
||||
xhpcStationInternetBlacklistRepo.findByChargingStationIdAndInternetUserId(Long.valueOf(stationTerminalKey.split(":")[1]),
|
||||
xhpcInternetUser.getInternetUserId()).orElse(null);
|
||||
if (xhpcStationInternetBlacklist != null) continue;
|
||||
|
||||
AuthSecretToken authSecretTokenOut =
|
||||
authSecretTokenRepository.findByOperatorId3irdptyAndSecretTokenType(xhpcInternetUser.getOperatorIdEvcs(), SECRET_TOKEN_TYPE_OUT).orElse(null);
|
||||
log.debug("nss pushing to: {}", authSecretTokenOut.getOperatorId3irdpty());
|
||||
@ -122,13 +126,20 @@ public class NotificationStationStatusTask extends CoreDispatcher {
|
||||
}
|
||||
|
||||
public void notify(ConnectorStatusInfo connectorStatusInfo, AuthSecretToken authSecretTokenOut) throws IOException {
|
||||
try{
|
||||
ConnectorStatusInfoReq connectorStatusInfoReq = new ConnectorStatusInfoReq();
|
||||
connectorStatusInfoReq.setConnectorStatusInfo(connectorStatusInfo);
|
||||
String data = JSONUtil.toJSONString(connectorStatusInfoReq);
|
||||
CommonRequest<ConnectorStatusInfoReq> commonRequest = new CommonRequest<>();
|
||||
commonRequest.setData(data);
|
||||
|
||||
//System.out.println("=====================所有设备状态============================");
|
||||
String ok = ok(commonRequest, "/notification_stationStatus", authSecretTokenOut);
|
||||
// System.out.println("=====================所有设备状态===========ok================="+ok);
|
||||
}catch (Exception e){
|
||||
|
||||
}
|
||||
|
||||
ConnectorStatusInfoReq connectorStatusInfoReq = new ConnectorStatusInfoReq();
|
||||
connectorStatusInfoReq.setConnectorStatusInfo(connectorStatusInfo);
|
||||
String data = JSONUtil.toJSONString(connectorStatusInfoReq);
|
||||
CommonRequest<ConnectorStatusInfoReq> commonRequest = new CommonRequest<>();
|
||||
commonRequest.setData(data);
|
||||
ok(commonRequest, "/notification_stationStatus", authSecretTokenOut);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ public class NotificationStopChargeResultTask extends CoreDispatcher {
|
||||
|
||||
//(evcs 放开)
|
||||
//9009开放定时任务 9099不开放
|
||||
//@Scheduled(fixedRate = 1000 * 3)
|
||||
@Scheduled(fixedRate = 1000 * 3)
|
||||
public void run() throws Exception {
|
||||
|
||||
notifyService();
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
# Tomcat 9009 不走推送 9099走推送
|
||||
# Tomcat 9009 不走推送 name: evcs 9099走推送 name: jp 120.26.46.180:8858
|
||||
server:
|
||||
port: 9009
|
||||
port: 9099
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: evcs
|
||||
name: jp
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
@ -14,10 +14,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
@ -14,6 +14,7 @@ import org.springframework.format.annotation.DateTimeFormat;
|
||||
import javax.validation.constraints.Email;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@ -91,6 +92,9 @@ public class SysUser extends BaseEntity
|
||||
@Excel(name = "权限类型", readConverterExp = "0=所有,1=运营商所有,2=子账号,3=流量账号")
|
||||
private Integer dataPowerType;
|
||||
|
||||
|
||||
|
||||
private Integer superType;
|
||||
/**
|
||||
* 流量用户id
|
||||
*/
|
||||
@ -426,19 +430,28 @@ public class SysUser extends BaseEntity
|
||||
return corpNo;
|
||||
}
|
||||
|
||||
public Integer getSuperType() {
|
||||
return superType;
|
||||
}
|
||||
|
||||
public void setSuperType(Integer superType) {
|
||||
this.superType = superType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("userId", getUserId())
|
||||
.append("deptId", getDeptId())
|
||||
.append("userId", getUserId())
|
||||
.append("deptId", getDeptId())
|
||||
.append("userType", getUserType())
|
||||
.append("userName", getUserName())
|
||||
.append("nickName", getNickName())
|
||||
.append("email", getEmail())
|
||||
.append("phonenumber", getPhonenumber())
|
||||
.append("sex", getSex())
|
||||
.append("avatar", getAvatar())
|
||||
.append("password", getPassword())
|
||||
.append("userName", getUserName())
|
||||
.append("superType", getSuperType())
|
||||
.append("nickName", getNickName())
|
||||
.append("email", getEmail())
|
||||
.append("phonenumber", getPhonenumber())
|
||||
.append("sex", getSex())
|
||||
.append("avatar", getAvatar())
|
||||
.append("password", getPassword())
|
||||
.append("salt", getSalt())
|
||||
.append("operatorId", getOperatorId())
|
||||
.append("dataPowerType", getDataPowerType())
|
||||
@ -455,6 +468,6 @@ public class SysUser extends BaseEntity
|
||||
.append("tenantId", getTenantId())
|
||||
.append("tenantName", getTenantName())
|
||||
.append("corpNo", getCorpNo())
|
||||
.toString();
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,6 +34,11 @@ public class LoginUser implements Serializable
|
||||
*/
|
||||
private Integer userType;
|
||||
|
||||
/**
|
||||
* 是否超管 0 是系统超管 1 某个租户超管 2普通用户
|
||||
*/
|
||||
private Integer superType;
|
||||
|
||||
|
||||
private String userTypeUtil;
|
||||
|
||||
@ -219,6 +224,14 @@ public class LoginUser implements Serializable
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Integer getSuperType() {
|
||||
return superType;
|
||||
}
|
||||
|
||||
public void setSuperType(Integer superType) {
|
||||
this.superType = superType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "LoginUser{" +
|
||||
@ -226,6 +239,7 @@ public class LoginUser implements Serializable
|
||||
", userid=" + userid +
|
||||
", username='" + username + '\'' +
|
||||
", userType=" + userType +
|
||||
", superType=" + superType +
|
||||
", userTypeUtil='" + userTypeUtil + '\'' +
|
||||
", tenantId='" + tenantId + '\'' +
|
||||
", openId='" + openId + '\'' +
|
||||
|
||||
@ -58,15 +58,12 @@ public class TokenController extends BaseController
|
||||
@PostMapping("login")
|
||||
public R<?> login(@RequestBody LoginBody form)
|
||||
{
|
||||
String tenantId = "000000";
|
||||
if(tenantId==null || "".equals(tenantId)){
|
||||
throw new BaseException("租户ID码必须填写");
|
||||
}
|
||||
//查询租户是否在有效期内
|
||||
// R r = tenantService.gettenantIdTime(form.getTenantId());
|
||||
// if(r.getCode() !=200){
|
||||
// return R.fail("该租户已过期或已停用,请联系管理员");
|
||||
// }
|
||||
R r = tenantService.gettenantIdTime(form.getTenantId());
|
||||
if(r.getCode() !=200){
|
||||
return R.fail("该租户已过期或已停用,请联系管理员");
|
||||
}
|
||||
String tenantId = form.getTenantId();
|
||||
// 用户登录
|
||||
LoginUser userInfo = sysLoginService.login(form.getUsername(), form.getPassword(),0,tenantId);
|
||||
// 获取登录token
|
||||
|
||||
@ -14,10 +14,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
@ -45,6 +45,7 @@ public class TokenService {
|
||||
loginUser.setIpaddr(IpUtils.getIpAddr(ServletUtils.getRequest()));
|
||||
loginUser.setTenantId(loginUser.getTenantId());
|
||||
loginUser.setUserType(loginUser.getUserType());
|
||||
loginUser.setSuperType(loginUser.getSuperType());
|
||||
loginUser.setOpenId(loginUser.getOpenId());
|
||||
loginUser.setUserTypeUtil(loginUser.getUserTypeUtil());
|
||||
loginUser.setStatus(loginUser.getStatus());
|
||||
|
||||
@ -16,10 +16,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
@ -35,7 +35,7 @@ spring:
|
||||
datasource:
|
||||
ds1:
|
||||
nacos:
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
dataId: sentinel-ruoyi-gateway
|
||||
groupId: DEFAULT_GROUP
|
||||
data-type: json
|
||||
|
||||
@ -14,10 +14,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
@ -14,10 +14,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
@ -14,10 +14,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
@ -20,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
@ -78,7 +79,7 @@ public class SysRoleController extends BaseController
|
||||
@PreAuthorize(hasPermi = "system:role:add")
|
||||
@Log(title = "角色管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysRole role)
|
||||
public AjaxResult add(HttpServletRequest request, @Validated @RequestBody SysRole role)
|
||||
{
|
||||
if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
|
||||
{
|
||||
@ -88,6 +89,9 @@ public class SysRoleController extends BaseController
|
||||
{
|
||||
return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
||||
}
|
||||
//获取登陆用户
|
||||
LoginUser loginUser = tokenService.getLoginUser(request);
|
||||
role.setTenantId(loginUser.getTenantId());
|
||||
role.setCreateBy(SecurityUtils.getUsername());
|
||||
return toAjax(roleService.insertRole(role));
|
||||
|
||||
|
||||
@ -62,8 +62,9 @@ public class SysUserController extends BaseController {
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysUser user) {
|
||||
LoginUser loginUser = tokenService.getLoginUser();
|
||||
user.setTenantId(loginUser.getTenantId());
|
||||
user.setUserId(loginUser.getUserid());
|
||||
if(loginUser.getUserid()!=1){
|
||||
user.setTenantId(loginUser.getTenantId());
|
||||
}
|
||||
startPage();
|
||||
List<SysUser> list = userService.selectUserList(user);
|
||||
return getDataTable(list);
|
||||
@ -121,6 +122,7 @@ public class SysUserController extends BaseController {
|
||||
sysUserVo.setUserType(UserTypeUtil.USER_TYPE);
|
||||
sysUserVo.setUserTypeUtil(UserTypeUtil.USER);
|
||||
sysUserVo.setUserid(sysUser.getUserId());
|
||||
sysUserVo.setSuperType(sysUser.getSuperType());
|
||||
return R.ok(sysUserVo);
|
||||
}
|
||||
|
||||
|
||||
@ -42,6 +42,10 @@ public class SysNoticeServiceImpl implements ISysNoticeService
|
||||
@Override
|
||||
public List<SysNotice> selectNoticeList(SysNotice notice)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
return noticeMapper.selectNoticeList(notice);
|
||||
}
|
||||
|
||||
|
||||
@ -14,10 +14,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
@ -106,7 +106,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="countNotRead" resultType="java.lang.Integer">
|
||||
|
||||
select count(notice_id)
|
||||
from sys_notice
|
||||
where notice_id
|
||||
|
||||
@ -114,6 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="tenantId != null and tenantId != ''">tenant_id,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="roleId != null and roleId != 0">#{roleId},</if>
|
||||
@ -126,6 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="tenantId != null and tenantId != ''">#{tenantId},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="remark" property="remark"/>
|
||||
<result column="tenant_id" property="tenantId"/>
|
||||
<result column="tenant_name" property="tenantName"/>
|
||||
<result column="super_type" property="superType"/>
|
||||
<result column="operator_id" property="operatorId"/>
|
||||
<association column="dept_id" property="dept" javaType="com.xhpc.system.api.domain.SysDept" resultMap="deptResult"/>
|
||||
<collection property="roles" javaType="java.util.List" resultMap="RoleResult"/>
|
||||
@ -81,6 +81,7 @@
|
||||
r.role_key,
|
||||
r.role_sort,
|
||||
r.data_scope,
|
||||
u.super_type,
|
||||
r.status as role_status,
|
||||
u.user_type,
|
||||
u.tenant_id,
|
||||
@ -96,7 +97,7 @@
|
||||
<select id="selectUserList" parameterType="com.xhpc.system.api.domain.SysUser" resultMap="SysUserResult">
|
||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex,
|
||||
u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader,
|
||||
u.tenant_id,ten.tenant_name tenant_name
|
||||
d.super_type,u.tenant_id,ten.tenant_name tenant_name
|
||||
from
|
||||
sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
@ -217,6 +218,7 @@
|
||||
<if test="tenantId != null and tenantId != ''">tenant_id,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="superType != null and superType != ''">super_type,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="userId != null and userId != ''">#{userId},</if>
|
||||
@ -235,6 +237,7 @@
|
||||
<if test="tenantId != null and tenantId != ''">#{tenantId},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="superType != null and superType != ''">#{superType},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
@ -259,6 +262,7 @@
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="tenantId != null and ''!=tenantId">tenant_id = #{tenantId},</if>
|
||||
<if test="superType != null and superType != ''">super_type=#{superType},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where user_id = #{userId}
|
||||
|
||||
@ -14,10 +14,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
@ -5,6 +5,8 @@ import com.xhpc.common.core.web.controller.BaseController;
|
||||
import com.xhpc.common.core.web.page.TableDataInfo;
|
||||
import com.xhpc.common.util.LogUserUtils;
|
||||
import com.xhpc.activity.service.OrderLogService;
|
||||
import com.xhpc.common.util.UserTypeUtil;
|
||||
import com.xhpc.system.api.domain.SysUser;
|
||||
import com.xhpc.system.api.model.LoginUser;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -35,7 +37,7 @@ public class OrderLogController extends BaseController {
|
||||
@RequestParam(required = false) String phone,
|
||||
@RequestParam(required = false) String startTime,
|
||||
@RequestParam(required = false) String endTime,
|
||||
@RequestParam(required = false) Integer number){
|
||||
@RequestParam(required = false) Integer number){
|
||||
|
||||
LoginUser loginUser = logUserUtils.getLogUser(request);
|
||||
|
||||
@ -46,7 +48,27 @@ public class OrderLogController extends BaseController {
|
||||
params.put("startTime", startTime);
|
||||
params.put("endTime", endTime);
|
||||
params.put("number", number);
|
||||
params.put("tenantId", loginUser.getTenantId());
|
||||
|
||||
SysUser sysUser = loginUser.getSysUser();
|
||||
Long sysUserId = sysUser.getUserId();
|
||||
|
||||
if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){
|
||||
if(UserTypeUtil.SYS_SUPER_TYPE_ONE == loginUser.getSuperType()){
|
||||
params.put("tenantId",loginUser.getTenantId());
|
||||
}
|
||||
if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){
|
||||
Long logOperatorId = sysUser.getOperatorId();
|
||||
params.put("logOperatorId",logOperatorId);
|
||||
params.put("number",1);
|
||||
//运营商看自己的场站
|
||||
}else{
|
||||
params.put("number",2);
|
||||
params.put("logOperatorId",sysUserId);
|
||||
//查询赋值的场站
|
||||
}
|
||||
}else{
|
||||
params.put("number",0);
|
||||
}
|
||||
return getDataTable(orderLogService.getOrderPage(params));
|
||||
}
|
||||
|
||||
|
||||
@ -7,6 +7,8 @@ import com.xhpc.common.core.web.page.TableDataInfo;
|
||||
import com.xhpc.common.enums.StationDeviceEnum;
|
||||
import com.xhpc.common.util.LogUserUtils;
|
||||
import com.xhpc.activity.service.PileLogService;
|
||||
import com.xhpc.common.util.UserTypeUtil;
|
||||
import com.xhpc.system.api.domain.SysUser;
|
||||
import com.xhpc.system.api.model.LoginUser;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -41,9 +43,6 @@ public class PileLogController extends BaseController {
|
||||
@RequestParam(required = false) Long operatorId,
|
||||
@RequestParam(required = false) Long chargingStationId,
|
||||
@RequestParam(required = false) Long chargingPileId) {
|
||||
|
||||
LoginUser loginUser = logUserUtils.getLogUser(request);
|
||||
|
||||
startPage();
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
@ -54,7 +53,7 @@ public class PileLogController extends BaseController {
|
||||
params.put("chargingPileId", chargingPileId);
|
||||
params.put("number", number);
|
||||
params.put("pileSerialNumber", pileSerialNumber);
|
||||
params.put("tenantId", loginUser.getTenantId());
|
||||
|
||||
return getDataTable(pileLogService.getPilePage(params));
|
||||
}
|
||||
|
||||
|
||||
@ -26,12 +26,14 @@ public class StationLogController extends BaseController {
|
||||
HttpServletRequest request,
|
||||
@RequestParam(required = false) String tenantId,
|
||||
@RequestParam(required = false) Integer number,
|
||||
@RequestParam(required = false) Long operatorId) {
|
||||
@RequestParam(required = false) Long operatorId,
|
||||
@RequestParam(required = false) Long chargingStationId) {
|
||||
startPage();
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("operatorId", operatorId);
|
||||
params.put("number", number);
|
||||
params.put("tenantId", tenantId);
|
||||
params.put("chargingStationId", chargingStationId);
|
||||
return getDataTable(stationLogService.getStationPage(request,params));
|
||||
}
|
||||
|
||||
|
||||
@ -135,10 +135,10 @@ public class WorkStationController extends BaseController {
|
||||
@Log(title = "场站设备-新增设备", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/")
|
||||
public R insertNewDevice(HttpServletRequest request, @RequestBody XhpcStationDeviceDomain domain) throws Exception {
|
||||
|
||||
LoginUser logUser = logUserUtils.getLogUser(request);
|
||||
domain.setCreateBy(logUser.getUserid().toString());
|
||||
domain.setUpdateBy(logUser.getUserid().toString());
|
||||
domain.setTenantId(logUser.getTenantId());
|
||||
return R.ok(stationService.insertDevice(domain));
|
||||
}
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ import java.util.Date;
|
||||
|
||||
/**
|
||||
* xhpc_station_device
|
||||
* @author
|
||||
* @author
|
||||
*/
|
||||
@Data
|
||||
public class XhpcStationDeviceDomain implements Serializable {
|
||||
@ -102,5 +102,7 @@ public class XhpcStationDeviceDomain implements Serializable {
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
private String tenantId;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,6 +10,7 @@ import com.xhpc.activity.mapper.XhpcDeviceMessageMapper;
|
||||
import com.xhpc.activity.service.PileLogService;
|
||||
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;
|
||||
@ -36,37 +37,34 @@ public class PileLogServiceImpl extends BaseService implements PileLogService {
|
||||
@Override
|
||||
public List<Map<String, Object>> getPilePage(Map<String, Object> params){
|
||||
LoginUser loginUser = tokenService.getLoginUser();
|
||||
|
||||
SysUser sysUser = loginUser.getSysUser();
|
||||
Long userId = loginUser.getUserid();
|
||||
//桩的统计、该时段金额
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
if (userId != UserTypeUtil.USER_ID) {
|
||||
Map<String, Object> landUser = pileMapper.getLandUser(userId);
|
||||
if (landUser != null) {
|
||||
if (landUser.get("userType") != null) {
|
||||
startPage();
|
||||
if (UserTypeUtil.SYS_USER_TYPE_ONE.equals(landUser.get("userType").toString())) {
|
||||
Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString());
|
||||
|
||||
params.put("logOperatorId", logOperatorId);
|
||||
params.put("status", 1);
|
||||
//运营商看自己的场站
|
||||
list = pileMapper.selectXhpcChargingPileList(params);
|
||||
} else {
|
||||
params.put("logOperatorId", userId);
|
||||
params.put("status", 2);
|
||||
//查询赋值的场站
|
||||
list = pileMapper.selectXhpcChargingPileList(params);
|
||||
}
|
||||
}
|
||||
if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){
|
||||
if(UserTypeUtil.SYS_SUPER_TYPE_ONE == loginUser.getSuperType()){
|
||||
params.put("tenantId",loginUser.getTenantId());
|
||||
return pileMapper.selectXhpcChargingPileList(params);
|
||||
}
|
||||
|
||||
} else {
|
||||
if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){
|
||||
Long logOperatorId = sysUser.getOperatorId();
|
||||
params.put("logOperatorId",logOperatorId);
|
||||
params.put("status",1);
|
||||
//运营商看自己的场站
|
||||
list = pileMapper.selectXhpcChargingPileList(params);
|
||||
}else{
|
||||
params.put("status",2);
|
||||
params.put("logOperatorId",userId);
|
||||
//查询赋值的场站
|
||||
list = pileMapper.selectXhpcChargingPileList(params);
|
||||
}
|
||||
}else{
|
||||
startPage();
|
||||
params.put("logOperatorId", userId);
|
||||
params.put("status", 0);
|
||||
list = pileMapper.selectXhpcChargingPileList(params);
|
||||
}
|
||||
|
||||
return list;
|
||||
|
||||
}
|
||||
|
||||
@ -41,6 +41,10 @@ public class StationLogServiceImpl extends BaseService implements StationLogServ
|
||||
params.put("operatorId",sysUserId);
|
||||
list = stationMapper.selectXhpcChargingStationList(params);
|
||||
}else{
|
||||
if(UserTypeUtil.SYS_SUPER_TYPE_ONE == loginUser.getSuperType()){
|
||||
params.put("tenantId",loginUser.getTenantId());
|
||||
return stationMapper.selectXhpcChargingStationList(params);
|
||||
}
|
||||
if(sysUser.getUserId() !=UserTypeUtil.USER_ID){
|
||||
Long logOperatorId = sysUser.getOperatorId();
|
||||
startPage();
|
||||
@ -52,7 +56,7 @@ public class StationLogServiceImpl extends BaseService implements StationLogServ
|
||||
}else{
|
||||
startPage();
|
||||
params.put("type",2);
|
||||
params.put("operatorId",sysUserId);
|
||||
params.put("operatorIdYu",sysUserId);
|
||||
list = stationMapper.selectXhpcChargingStationList(params);
|
||||
}
|
||||
}else{
|
||||
|
||||
@ -19,10 +19,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
@ -190,7 +190,7 @@
|
||||
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from xhpc_station_device
|
||||
where device_id = #{deviceId,jdbcType=INTEGER}
|
||||
@ -203,7 +203,7 @@
|
||||
<insert id="insert" keyColumn="device_id" keyProperty="deviceId" parameterType="com.xhpc.activity.domain.XhpcStationDeviceDomain" useGeneratedKeys="true">
|
||||
insert into xhpc_station_device (device_name, device_type, current_type, station_id,
|
||||
parent_device_id, serial_number, brand_model,sorted, `status`,
|
||||
del_flag, create_time, create_by,
|
||||
del_flag, create_time, create_by,
|
||||
update_time, update_by)
|
||||
values (#{deviceName,jdbcType=VARCHAR}, #{deviceType,jdbcType=VARCHAR}, #{currentType,jdbcType=VARCHAR}, #{stationId,jdbcType=BIGINT},
|
||||
#{parentDeviceId,jdbcType=BIGINT}, #{serialNumber,jdbcType=VARCHAR}, #{brandModel,jdbcType=VARCHAR},#{sorted, jdbcType=SMALLINT}, #{status,jdbcType=SMALLINT},
|
||||
@ -248,6 +248,9 @@
|
||||
<if test="updateBy != null">
|
||||
update_by,
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
tenant_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceName != null">
|
||||
@ -286,6 +289,9 @@
|
||||
<if test="updateBy != null">
|
||||
#{updateBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
#{tenantId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.xhpc.activity.domain.XhpcStationDeviceDomain">
|
||||
@ -348,4 +354,4 @@
|
||||
from xhpc_station_device
|
||||
where serial_number = #{serialNumber}
|
||||
</select>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
@ -14,10 +14,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
@ -0,0 +1,89 @@
|
||||
package com.xhpc.charging.station.controller;
|
||||
|
||||
import com.xhpc.charging.station.dto.XhpcPlaceholderDto;
|
||||
import com.xhpc.charging.station.service.IXhpcPlaceholderService;
|
||||
import com.xhpc.common.core.domain.R;
|
||||
import com.xhpc.common.core.web.controller.BaseController;
|
||||
import com.xhpc.common.core.web.page.TableDataInfo;
|
||||
import com.xhpc.common.util.LogUserUtils;
|
||||
import com.xhpc.system.api.model.LoginUser;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 占位费
|
||||
*
|
||||
* @author yuyang
|
||||
* @Date 2025-04-22 22:06
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/placeholder")
|
||||
public class XhpcPlaceholderController extends BaseController {
|
||||
|
||||
@Resource
|
||||
IXhpcPlaceholderService xhpcPlaceholderService;
|
||||
@Resource
|
||||
LogUserUtils logUserUtils;
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(HttpServletRequest request, Long chargingStationId,Integer status,Long operatorId,String startTime,String endTime) {
|
||||
|
||||
LoginUser loginUser = logUserUtils.getLogUser(request);
|
||||
startPage();
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("tenantId", loginUser.getTenantId());
|
||||
params.put("status", status);
|
||||
params.put("chargingStationId", chargingStationId);
|
||||
params.put("operatorId", operatorId);
|
||||
params.put("startTime", startTime);
|
||||
params.put("endTime", endTime);
|
||||
List<Map<String, Object>> list = xhpcPlaceholderService.getXhpcPlaceholderList(request,params);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/detail")
|
||||
public R getXhpcPlaceholderDetail(@RequestParam("placeholderId") Long placeholderId) {
|
||||
|
||||
return R.ok(xhpcPlaceholderService.getXhpcPlaceholderDetail(placeholderId));
|
||||
}
|
||||
|
||||
@PostMapping("/updateXhpcPlaceholder")
|
||||
public R updateXhpcPlaceholder(HttpServletRequest request, @RequestBody XhpcPlaceholderDto xhpcPlaceholder) {
|
||||
|
||||
LoginUser loginUser = logUserUtils.getLogUser(request);
|
||||
|
||||
xhpcPlaceholder.setUpdateBy(loginUser.getUserid().toString());
|
||||
xhpcPlaceholder.setUpdateTime(new Date());
|
||||
xhpcPlaceholder.setChargingStationId(xhpcPlaceholder.getChargingStationId());
|
||||
return xhpcPlaceholderService.updateXhpcPlaceholder(xhpcPlaceholder);
|
||||
}
|
||||
|
||||
@PostMapping("/installXhpcPlaceholder")
|
||||
public R installXhpcPlaceholder(HttpServletRequest request, @RequestBody XhpcPlaceholderDto xhpcPlaceholder) {
|
||||
|
||||
LoginUser loginUser = logUserUtils.getLogUser(request);
|
||||
xhpcPlaceholder.setCreateBy(loginUser.getUserid().toString());
|
||||
xhpcPlaceholder.setCreateTime(new Date());
|
||||
return xhpcPlaceholderService.installXhpcPlaceholder(xhpcPlaceholder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 桩-删除
|
||||
*/
|
||||
@DeleteMapping("/{placeholderId}")
|
||||
public R remove(HttpServletRequest request,@PathVariable Long placeholderId) {
|
||||
LoginUser loginUser = logUserUtils.getLogUser(request);
|
||||
XhpcPlaceholderDto xhpcPlaceholder= new XhpcPlaceholderDto();
|
||||
xhpcPlaceholder.setCreateBy(loginUser.getUserid().toString());
|
||||
xhpcPlaceholder.setCreateTime(new Date());
|
||||
xhpcPlaceholder.setPlaceholderId(placeholderId);
|
||||
return xhpcPlaceholderService.removeXhpcPlaceholderById(request,xhpcPlaceholder);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package com.xhpc.charging.station.dto;
|
||||
|
||||
import com.xhpc.common.domain.XhpcPlaceholder;
|
||||
import com.xhpc.common.domain.XhpcPlaceholderTime;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yuyang
|
||||
* @Date 2025-04-22 23:22
|
||||
*/
|
||||
@Data
|
||||
public class XhpcPlaceholderDto extends XhpcPlaceholder {
|
||||
|
||||
List<XhpcPlaceholderTimeDto> xhpcPlaceholderTimeList;
|
||||
|
||||
String price;
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.xhpc.charging.station.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author yuyang
|
||||
* @Date 2025-04-24 11:35
|
||||
*/
|
||||
@Data
|
||||
public class XhpcPlaceholderTimeDto {
|
||||
/** 启始时间 */
|
||||
private String startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
private String endTime;
|
||||
|
||||
/** 费率id(非数据库id,用于绑定费率使用) */
|
||||
private String price;
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package com.xhpc.charging.station.mapper;
|
||||
|
||||
import com.xhpc.charging.station.dto.XhpcPlaceholderDto;
|
||||
import com.xhpc.common.domain.XhpcPlaceholder;
|
||||
import com.xhpc.common.domain.XhpcPlaceholderTime;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author yuyang
|
||||
* @Date 2025-04-22 22:32
|
||||
*/
|
||||
public interface XhpcPlaceholderMapper {
|
||||
|
||||
List<Map<String, Object>> getXhpcPlaceholderList(@Param("params") Map<String, Object> params);
|
||||
|
||||
Map<String,Object> getXhpcPlaceholderDetail(@Param("placeholderId")Long placeholderId);
|
||||
|
||||
List<Map<String,Object>> getXhpcPlaceholderTimeList(@Param("placeholderId")Long placeholderId);
|
||||
|
||||
int updateXhpcPlaceholder(XhpcPlaceholderDto xhpcPlaceholder);
|
||||
|
||||
int updateXhpcPlaceholderTime(@Param("placeholderId")Long placeholderId);
|
||||
|
||||
int insertXhpcPlaceholderTime(XhpcPlaceholderTime xhpcPlaceholderTime);
|
||||
|
||||
int insertXhpcPlaceholder(XhpcPlaceholderDto xhpcPlaceholder);
|
||||
|
||||
|
||||
int getXhpcPlaceholderChargingStationId(@Param("chargingStationId")Long chargingStationId,@Param("type")Integer type,@Param("placeholderId")Long placeholderId);
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
package com.xhpc.charging.station.service;
|
||||
|
||||
import com.xhpc.charging.station.dto.XhpcPlaceholderDto;
|
||||
import com.xhpc.common.core.domain.R;
|
||||
import com.xhpc.common.domain.XhpcPlaceholder;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author yuyang
|
||||
* @Date 2025-04-22 22:30
|
||||
*/
|
||||
public interface IXhpcPlaceholderService {
|
||||
List<Map<String, Object>> getXhpcPlaceholderList(HttpServletRequest request,Map<String, Object> params);
|
||||
|
||||
Map<String,Object> getXhpcPlaceholderDetail(Long placeholderId);
|
||||
|
||||
R updateXhpcPlaceholder(XhpcPlaceholderDto xhpcPlaceholder);
|
||||
|
||||
R installXhpcPlaceholder(XhpcPlaceholderDto xhpcPlaceholder);
|
||||
|
||||
R removeXhpcPlaceholderById(HttpServletRequest request,XhpcPlaceholderDto xhpcPlaceholder);
|
||||
}
|
||||
@ -0,0 +1,354 @@
|
||||
package com.xhpc.charging.station.service;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.xhpc.charging.station.dto.XhpcPlaceholderDto;
|
||||
import com.xhpc.charging.station.dto.XhpcPlaceholderTimeDto;
|
||||
import com.xhpc.charging.station.mapper.XhpcPlaceholderMapper;
|
||||
import com.xhpc.common.api.dto.XhpcRateTimeDto;
|
||||
import com.xhpc.common.core.domain.R;
|
||||
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.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.transaction.interceptor.TransactionAspectSupport;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @author yuyang
|
||||
* @Date 2025-04-22 22:31
|
||||
*/
|
||||
@Service
|
||||
public class XhpcPlaceholderServiceImpl extends BaseService implements IXhpcPlaceholderService{
|
||||
|
||||
@Resource
|
||||
XhpcPlaceholderMapper xhpcPlaceholderMapper;
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
@Override
|
||||
public List<Map<String, Object>> getXhpcPlaceholderList(HttpServletRequest request, Map<String, Object> params) {
|
||||
|
||||
//获取登陆用户
|
||||
LoginUser loginUser = tokenService.getLoginUser(request);
|
||||
SysUser sysUser = loginUser.getSysUser();
|
||||
Long sysUserId = sysUser.getUserId();
|
||||
//桩的统计、该时段金额
|
||||
List<Map<String, Object>> list =new ArrayList<>();
|
||||
if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){
|
||||
if(UserTypeUtil.SYS_SUPER_TYPE_ONE == loginUser.getSuperType()){
|
||||
params.put("tenantId",loginUser.getTenantId());
|
||||
return xhpcPlaceholderMapper.getXhpcPlaceholderList(params);
|
||||
}
|
||||
if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){
|
||||
Long logOperatorId = sysUser.getOperatorId();
|
||||
params.put("logOperatorId",logOperatorId);
|
||||
params.put("type",1);
|
||||
//运营商看自己的场站
|
||||
list = xhpcPlaceholderMapper.getXhpcPlaceholderList(params);
|
||||
}else{
|
||||
params.put("type",2);
|
||||
params.put("logOperatorId",sysUserId);
|
||||
//查询赋值的场站
|
||||
list = xhpcPlaceholderMapper.getXhpcPlaceholderList(params);
|
||||
}
|
||||
}else{
|
||||
startPage();
|
||||
params.put("type",0);
|
||||
list = xhpcPlaceholderMapper.getXhpcPlaceholderList(params);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getXhpcPlaceholderDetail(Long placeholderId) {
|
||||
|
||||
Map<String, Object> map = xhpcPlaceholderMapper.getXhpcPlaceholderDetail(placeholderId);
|
||||
|
||||
if(map !=null && map.get("placeholderId") !=null){
|
||||
List<Map<String, Object>> xhpcPlaceholderTimeList = xhpcPlaceholderMapper.getXhpcPlaceholderTimeList(placeholderId);
|
||||
map.put("xhpcPlaceholderTimeList",xhpcPlaceholderTimeList);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public R updateXhpcPlaceholder(XhpcPlaceholderDto xhpcPlaceholder) {
|
||||
Long chargingStationId =xhpcPlaceholder.getChargingStationId();
|
||||
//查询场站是否存在
|
||||
int num = xhpcPlaceholderMapper.getXhpcPlaceholderChargingStationId(chargingStationId,2,xhpcPlaceholder.getPlaceholderId());
|
||||
if(num>0){
|
||||
return R.fail("1003", "该场站已存在,请进行编辑");
|
||||
}
|
||||
int k = xhpcPlaceholderMapper.updateXhpcPlaceholder(xhpcPlaceholder);
|
||||
if(k>0){
|
||||
Long placeholderId = xhpcPlaceholder.getPlaceholderId();
|
||||
//删除之前所有的时间段,添加新的时间段
|
||||
xhpcPlaceholderMapper.updateXhpcPlaceholderTime(placeholderId);
|
||||
//添加时段段
|
||||
List<XhpcPlaceholderTimeDto> list = xhpcPlaceholder.getXhpcPlaceholderTimeList();
|
||||
|
||||
//判断是否有重叠
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
XhpcPlaceholderTimeDto xhpcRateTimeOne = list.get(i);
|
||||
Date startOne = DateUtil.parse(xhpcRateTimeOne.getStartTime());
|
||||
Date endOne = DateUtil.parse(xhpcRateTimeOne.getEndTime());
|
||||
for (int j = i + 1; j < list.size(); j++) {
|
||||
XhpcPlaceholderTimeDto xhpcRateTimeTwo = list.get(j);
|
||||
Date startTwo = DateUtil.parse(xhpcRateTimeTwo.getStartTime());
|
||||
Date endTwo = DateUtil.parse(xhpcRateTimeTwo.getEndTime());
|
||||
if (DateUtil.compare(startOne, endTwo) < 0 && DateUtil.compare(startTwo, endOne) < 0) {
|
||||
return R.fail("1004", "时间段有重叠");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int n = 0; n <list.size() ; n++) {
|
||||
XhpcPlaceholderTimeDto xhpcPlaceholderTimeDto = list.get(n);
|
||||
String start = xhpcPlaceholderTimeDto.getStartTime();
|
||||
String end = xhpcPlaceholderTimeDto.getEndTime();
|
||||
String price = xhpcPlaceholder.getPrice();
|
||||
String pattern = "^([0-2][0-9]:([0]|[3])[0]:[0][0])";
|
||||
Pattern compile = Pattern.compile(pattern);
|
||||
Matcher m = compile.matcher(start);
|
||||
boolean isMatch = m.matches();
|
||||
if (!isMatch) {
|
||||
return R.fail("1003", "时间格式不对");
|
||||
}
|
||||
Matcher m1 = compile.matcher(end);
|
||||
boolean isMatch1 = m1.matches();
|
||||
if (!isMatch1) {
|
||||
return R.fail("1003", "时间格式不对");
|
||||
}
|
||||
//判断结束时间是否小于开始时间
|
||||
Date startTime = DateUtil.parse(start);
|
||||
Date endTime = DateUtil.parse(end);
|
||||
if (startTime.getTime() > endTime.getTime()) {
|
||||
return R.fail("1002", "开始时间不能大于结束时间");
|
||||
}
|
||||
|
||||
String rateValue = xhpcPlaceholderTimeDto.getPrice();
|
||||
if(list.size() == 1){
|
||||
if(!"00:00:00".equals(xhpcPlaceholderTimeDto.getStartTime())){
|
||||
if(rateValue ==null || "".equals(rateValue)){
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return R.fail("1004", "请填写默认时间段费率");
|
||||
}
|
||||
addXhpcPlaceholderTime("00:00:00",start,price,placeholderId,chargingStationId);
|
||||
}
|
||||
addXhpcPlaceholderTime(start,end,rateValue,placeholderId,chargingStationId);
|
||||
if(!endTime.equals("24:00:00")) {
|
||||
if(rateValue ==null || "".equals(rateValue)){
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return R.fail("1004", "请填写默认时间段费率");
|
||||
}
|
||||
addXhpcPlaceholderTime(end,"24:00:00",price,placeholderId,chargingStationId);
|
||||
}
|
||||
}else{
|
||||
if(n == 0){
|
||||
if(!"00:00:00".equals(xhpcPlaceholderTimeDto.getStartTime())){
|
||||
if(rateValue ==null || "".equals(rateValue)){
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return R.fail("1004","请填写默认时间段费率");
|
||||
}
|
||||
addXhpcPlaceholderTime("00:00:00",start,price,placeholderId,chargingStationId);
|
||||
}
|
||||
addXhpcPlaceholderTime(start,end,rateValue,placeholderId,chargingStationId);
|
||||
}else if(n < list.size()-1){
|
||||
String endTimeK = list.get(n - 1).getEndTime();
|
||||
if (!endTimeK.equals(start)) {
|
||||
if(rateValue ==null || "".equals(rateValue)){
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return R.fail("1004","请填写默认时间段费率");
|
||||
}
|
||||
addXhpcPlaceholderTime(endTimeK,start,price,placeholderId,chargingStationId);
|
||||
}
|
||||
//并把本条数据也添加上
|
||||
addXhpcPlaceholderTime(start,end,rateValue,placeholderId,chargingStationId);
|
||||
}else{
|
||||
String endTimeK = list.get(n - 1).getEndTime();
|
||||
if (!endTimeK.equals(start)) {
|
||||
if(rateValue ==null || "".equals(rateValue)){
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return R.fail("1004","请填写默认时间段费率");
|
||||
}
|
||||
//添加一条默认费率时段
|
||||
addXhpcPlaceholderTime(endTimeK,start,price,placeholderId,chargingStationId);
|
||||
}
|
||||
//并把本条数据也添加上
|
||||
addXhpcPlaceholderTime(start,end,rateValue,placeholderId,chargingStationId);
|
||||
if (!end.equals("24:00:00")) {
|
||||
if(rateValue ==null || "".equals(rateValue)){
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return R.fail("1004","请填写默认时间段费率");
|
||||
}
|
||||
//添加一条默认费率时段
|
||||
addXhpcPlaceholderTime(end,"24:00:00",price,placeholderId,chargingStationId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return R.ok("修改成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public R installXhpcPlaceholder(XhpcPlaceholderDto xhpcPlaceholder) {
|
||||
|
||||
Long chargingStationId =xhpcPlaceholder.getChargingStationId();
|
||||
//查询场站是否存在
|
||||
int num = xhpcPlaceholderMapper.getXhpcPlaceholderChargingStationId(chargingStationId,1,null);
|
||||
if(num>0){
|
||||
return R.fail("1003", "该场站已存在,请进行编辑");
|
||||
}
|
||||
int k = xhpcPlaceholderMapper.insertXhpcPlaceholder(xhpcPlaceholder);
|
||||
if(k>0){
|
||||
Long placeholderId = xhpcPlaceholder.getPlaceholderId();
|
||||
//删除之前所有的时间段,添加新的时间段
|
||||
xhpcPlaceholderMapper.updateXhpcPlaceholderTime(placeholderId);
|
||||
//添加时段段
|
||||
List<XhpcPlaceholderTimeDto> list = xhpcPlaceholder.getXhpcPlaceholderTimeList();
|
||||
|
||||
//判断是否有重叠
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
XhpcPlaceholderTimeDto xhpcRateTimeOne = list.get(i);
|
||||
Date startOne = DateUtil.parse(xhpcRateTimeOne.getStartTime());
|
||||
Date endOne = DateUtil.parse(xhpcRateTimeOne.getEndTime());
|
||||
for (int j = i + 1; j < list.size(); j++) {
|
||||
XhpcPlaceholderTimeDto xhpcRateTimeTwo = list.get(j);
|
||||
Date startTwo = DateUtil.parse(xhpcRateTimeTwo.getStartTime());
|
||||
Date endTwo = DateUtil.parse(xhpcRateTimeTwo.getEndTime());
|
||||
if (DateUtil.compare(startOne, endTwo) < 0 && DateUtil.compare(startTwo, endOne) < 0) {
|
||||
return R.fail("1004", "时间段有重叠");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int n = 0; n <list.size() ; n++) {
|
||||
XhpcPlaceholderTimeDto xhpcPlaceholderTimeDto = list.get(n);
|
||||
String start = xhpcPlaceholderTimeDto.getStartTime();
|
||||
String end = xhpcPlaceholderTimeDto.getEndTime();
|
||||
String price = xhpcPlaceholder.getPrice();
|
||||
String pattern = "^([0-2][0-9]:([0]|[3])[0]:[0][0])";
|
||||
Pattern compile = Pattern.compile(pattern);
|
||||
Matcher m = compile.matcher(start);
|
||||
boolean isMatch = m.matches();
|
||||
if (!isMatch) {
|
||||
return R.fail("1003", "时间格式不对");
|
||||
}
|
||||
Matcher m1 = compile.matcher(end);
|
||||
boolean isMatch1 = m1.matches();
|
||||
if (!isMatch1) {
|
||||
return R.fail("1003", "时间格式不对");
|
||||
}
|
||||
//判断结束时间是否小于开始时间
|
||||
Date startTime = DateUtil.parse(start);
|
||||
Date endTime = DateUtil.parse(end);
|
||||
if (startTime.getTime() > endTime.getTime()) {
|
||||
return R.fail("1002", "开始时间不能大于结束时间");
|
||||
}
|
||||
|
||||
String rateValue = xhpcPlaceholderTimeDto.getPrice();
|
||||
if(list.size() == 1){
|
||||
if(!"00:00:00".equals(xhpcPlaceholderTimeDto.getStartTime())){
|
||||
if(rateValue ==null || "".equals(rateValue)){
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return R.fail("1004", "请填写默认时间段费率");
|
||||
}
|
||||
addXhpcPlaceholderTime("00:00:00",start,price,placeholderId,chargingStationId);
|
||||
}
|
||||
addXhpcPlaceholderTime(start,end,rateValue,placeholderId,chargingStationId);
|
||||
if(!endTime.equals("24:00:00")) {
|
||||
if(rateValue ==null || "".equals(rateValue)){
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return R.fail("1004", "请填写默认时间段费率");
|
||||
}
|
||||
addXhpcPlaceholderTime(end,"24:00:00",price,placeholderId,chargingStationId);
|
||||
}
|
||||
}else{
|
||||
if(n == 0){
|
||||
if(!"00:00:00".equals(xhpcPlaceholderTimeDto.getStartTime())){
|
||||
if(rateValue ==null || "".equals(rateValue)){
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return R.fail("1004","请填写默认时间段费率");
|
||||
}
|
||||
addXhpcPlaceholderTime("00:00:00",start,price,placeholderId,chargingStationId);
|
||||
}
|
||||
addXhpcPlaceholderTime(start,end,rateValue,placeholderId,chargingStationId);
|
||||
}else if(n < list.size()-1){
|
||||
String endTimeK = list.get(n - 1).getEndTime();
|
||||
if (!endTimeK.equals(start)) {
|
||||
if(rateValue ==null || "".equals(rateValue)){
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return R.fail("1004","请填写默认时间段费率");
|
||||
}
|
||||
addXhpcPlaceholderTime(endTimeK,start,price,placeholderId,chargingStationId);
|
||||
}
|
||||
//并把本条数据也添加上
|
||||
addXhpcPlaceholderTime(start,end,rateValue,placeholderId,chargingStationId);
|
||||
}else{
|
||||
String endTimeK = list.get(n - 1).getEndTime();
|
||||
if (!endTimeK.equals(start)) {
|
||||
if(rateValue ==null || "".equals(rateValue)){
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return R.fail("1004","请填写默认时间段费率");
|
||||
}
|
||||
//添加一条默认费率时段
|
||||
addXhpcPlaceholderTime(endTimeK,start,price,placeholderId,chargingStationId);
|
||||
}
|
||||
//并把本条数据也添加上
|
||||
addXhpcPlaceholderTime(start,end,rateValue,placeholderId,chargingStationId);
|
||||
if (!end.equals("24:00:00")) {
|
||||
if(rateValue ==null || "".equals(rateValue)){
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return R.fail("1004","请填写默认时间段费率");
|
||||
}
|
||||
//添加一条默认费率时段
|
||||
addXhpcPlaceholderTime(end,"24:00:00",price,placeholderId,chargingStationId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
return R.fail("添加失败");
|
||||
}
|
||||
return R.ok("添加成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public R removeXhpcPlaceholderById(HttpServletRequest request,XhpcPlaceholderDto xhpcPlaceholder) {
|
||||
|
||||
int i = xhpcPlaceholderMapper.updateXhpcPlaceholder(xhpcPlaceholder);
|
||||
if(i>0){
|
||||
//删除之前所有的时间段,添加新的时间段
|
||||
xhpcPlaceholderMapper.updateXhpcPlaceholderTime(xhpcPlaceholder.getPlaceholderId());
|
||||
}
|
||||
return R.ok("修改成功");
|
||||
}
|
||||
|
||||
private void addXhpcPlaceholderTime(String startTime,String endTime,String price,Long placeholderId,Long chargingStationId){
|
||||
XhpcPlaceholderTime xhpcPlaceholderTime =new XhpcPlaceholderTime();
|
||||
Date start = DateUtil.parse(startTime);
|
||||
Date emd = DateUtil.parse(endTime);
|
||||
xhpcPlaceholderTime.setStartTime(start);
|
||||
xhpcPlaceholderTime.setEndTime(emd);
|
||||
xhpcPlaceholderTime.setPrice(new BigDecimal(price));
|
||||
xhpcPlaceholderTime.setPlaceholderId(placeholderId);
|
||||
xhpcPlaceholderTime.setChargingStationId(chargingStationId);
|
||||
xhpcPlaceholderMapper.insertXhpcPlaceholderTime(xhpcPlaceholderTime);
|
||||
}
|
||||
|
||||
}
|
||||
@ -14,10 +14,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
@ -0,0 +1,290 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xhpc.charging.station.mapper.XhpcPlaceholderMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.xhpc.common.domain.XhpcPlaceholder">
|
||||
<result property="placeholderId" column="placeholder_id"/>
|
||||
<result property="chargingStationId" column="charging_station_id"/>
|
||||
<result property="startTime" column="start_time"/>
|
||||
<result property="endTime" column="end_time"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="content" column="content"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="maxFee" column="max_fee"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="getXhpcPlaceholderList" resultType="map">
|
||||
select
|
||||
xp.placeholder_id as placeholderId,
|
||||
xp.start_time as startTime,
|
||||
xp.end_time as endTime,
|
||||
xp.status as status,
|
||||
xp.free_time as freeTime,
|
||||
xp.max_fee as maxFee,
|
||||
xp.create_time createTime,
|
||||
xcs.name as chargingStationName,
|
||||
xp.charging_station_id as chargingStationId
|
||||
from xhpc_placeholder xp
|
||||
left join xhpc_charging_station xcs on xcs.charging_station_id = xp.charging_station_id
|
||||
where xp.del_flag=0
|
||||
<if test="params.tenantId!= null and params.tenantId!=''">
|
||||
and xp.tenant_id=#{params.tenantId}
|
||||
</if>
|
||||
<if test="params.chargingStationId!= null and params.chargingStationId!=''">
|
||||
and xp.charging_station_id=#{params.chargingStationId}
|
||||
</if>
|
||||
<if test="params.status!= null and params.status!=''">
|
||||
and xp.status=#{params.status}
|
||||
</if>
|
||||
<if test="params.chargingStationId!= null and params.chargingStationId!=''">
|
||||
and xp.charging_station_id=#{params.chargingStationId}
|
||||
</if>
|
||||
|
||||
<if test="params.startTime!= null and params.startTime!=''">
|
||||
and xp.start_time >=#{params.startTime}
|
||||
</if>
|
||||
|
||||
<if test="params.endTime!= null and params.endTime!=''">
|
||||
and xp.end_time <=#{params.endTime}
|
||||
</if>
|
||||
<if test="params.status!= null and params.status!=''">
|
||||
and xp.status=#{params.status}
|
||||
</if>
|
||||
<if test="params.type ==1">
|
||||
and xp.charging_station_id in(select charging_station_id from xhpc_charging_station where operator_id=#{params.logOperatorId})
|
||||
</if>
|
||||
<if test="params.type ==2">
|
||||
and xp.charging_station_id in(select charging_station_id from xhpc_user_privilege where user_id=#{params.logOperatorId})
|
||||
</if>
|
||||
order by xp.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="getXhpcPlaceholderDetail" resultType="map">
|
||||
select
|
||||
xp.placeholder_id as placeholderId,
|
||||
xp.start_time as startTime,
|
||||
xp.end_time as endTime,
|
||||
xp.status as status,
|
||||
xp.free_time as freeTime,
|
||||
xp.max_fee as maxFee,
|
||||
xp.content as content,
|
||||
xcs.name as chargingStationName,
|
||||
xp.charging_station_id as chargingStationId
|
||||
from xhpc_placeholder xp
|
||||
left join xhpc_charging_station xcs on xcs.charging_station_id = xp.charging_station_id
|
||||
where xp.del_flag=0 and xp.placeholder_id =#{placeholderId}
|
||||
</select>
|
||||
|
||||
<select id="getXhpcPlaceholderTimeList" resultType="map">
|
||||
select
|
||||
start_time as startTime,
|
||||
replace(end_time, '00:00:00', '24:00:00') as endTime,
|
||||
price as price
|
||||
from xhpc_placeholder_time
|
||||
where placeholder_id=#{placeholderId} and del_flag =0
|
||||
</select>
|
||||
|
||||
<update id="updateXhpcPlaceholder">
|
||||
update xhpc_placeholder
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="startTime != null">start_time = #{startTime},</if>
|
||||
<if test="endTime != null ">end_time = #{endTime},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="content != null and content !=''">content = #{content},</if>
|
||||
<if test="maxFee != null and maxFee !=''">max_fee = #{maxFee},</if>
|
||||
<if test="freeTime != null and freeTime !=''">free_time = #{freeTime},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where placeholder_id = #{placeholderId}
|
||||
</update>
|
||||
|
||||
<update id="updateXhpcPlaceholderTime">
|
||||
update xhpc_placeholder_time set del_flag =1 where placeholder_id=#{placeholderId}
|
||||
</update>
|
||||
|
||||
<insert id="insertXhpcPlaceholderTime">
|
||||
insert into xhpc_placeholder_time
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="null != placeholderId ">
|
||||
placeholder_id,
|
||||
</if>
|
||||
<if test="null != startTime">
|
||||
start_time,
|
||||
</if>
|
||||
<if test="null != endTime">
|
||||
end_time,
|
||||
</if>
|
||||
<if test="null != price ">
|
||||
price,
|
||||
</if>
|
||||
<if test="null != delFlag ">
|
||||
del_flag,
|
||||
</if>
|
||||
<if test="null != createTime ">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="null != createBy and '' != createBy">
|
||||
create_by,
|
||||
</if>
|
||||
<if test="null != updateTime ">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="null != updateBy and '' != updateBy">
|
||||
update_by,
|
||||
</if>
|
||||
<if test="null != remark and '' != remark">
|
||||
remark,
|
||||
</if>
|
||||
<if test="null != tenantId and '' != tenantId">
|
||||
tenant_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="null != placeholderId ">
|
||||
#{placeholderId},
|
||||
</if>
|
||||
<if test="null != startTime">
|
||||
#{startTime},
|
||||
</if>
|
||||
<if test="null != endTime">
|
||||
#{endTime},
|
||||
</if>
|
||||
<if test="null != price ">
|
||||
#{price},
|
||||
</if>
|
||||
<if test="null != delFlag ">
|
||||
#{delFlag},
|
||||
</if>
|
||||
<if test="null != createTime ">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="null != createBy and '' != createBy">
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="null != updateTime ">
|
||||
#{updateTime},
|
||||
</if>
|
||||
<if test="null != updateBy and '' != updateBy">
|
||||
#{updateBy},
|
||||
</if>
|
||||
<if test="null != remark and '' != remark">
|
||||
#{remark},
|
||||
</if>
|
||||
<if test="null != tenantId and '' != tenantId">
|
||||
#{tenantId},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertXhpcPlaceholder" parameterType="com.xhpc.common.domain.XhpcPlaceholder"
|
||||
useGeneratedKeys="true" keyProperty="placeholderId">
|
||||
insert into xhpc_placeholder
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="null != chargingStationId ">
|
||||
charging_station_id,
|
||||
</if>
|
||||
<if test="null != startTime ">
|
||||
start_time,
|
||||
</if>
|
||||
<if test="null != endTime ">
|
||||
end_time,
|
||||
</if>
|
||||
<if test="null != maxFee ">
|
||||
max_fee,
|
||||
</if>
|
||||
<if test="null != freeTime ">
|
||||
free_time,
|
||||
</if>
|
||||
<if test="null != content and content !=''">
|
||||
content,
|
||||
</if>
|
||||
<if test="null != delFlag ">
|
||||
del_flag,
|
||||
</if>
|
||||
<if test="null != createTime ">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="null != createBy and '' != createBy">
|
||||
create_by,
|
||||
</if>
|
||||
<if test="null != updateTime ">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="null != updateBy and '' != updateBy">
|
||||
update_by,
|
||||
</if>
|
||||
<if test="null != remark and '' != remark">
|
||||
remark,
|
||||
</if>
|
||||
<if test="null != tenantId and '' != tenantId">
|
||||
tenant_id,
|
||||
</if>
|
||||
<if test="null != status ">
|
||||
status,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="null != chargingStationId ">
|
||||
#{chargingStationId},
|
||||
</if>
|
||||
<if test="null != startTime ">
|
||||
#{startTime},
|
||||
</if>
|
||||
<if test="null != endTime ">
|
||||
#{endTime},
|
||||
</if>
|
||||
<if test="null != maxFee ">
|
||||
#{maxFee},
|
||||
</if>
|
||||
<if test="null != freeTime ">
|
||||
#{freeTime},
|
||||
</if>
|
||||
<if test="null != content and content !=''">
|
||||
#{content},
|
||||
</if>
|
||||
<if test="null != delFlag ">
|
||||
#{delFlag},
|
||||
</if>
|
||||
<if test="null != createTime ">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="null != createBy and '' != createBy">
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="null != updateTime ">
|
||||
#{updateTime},
|
||||
</if>
|
||||
<if test="null != updateBy and '' != updateBy">
|
||||
#{updateBy},
|
||||
</if>
|
||||
<if test="null != remark and '' != remark">
|
||||
#{remark},
|
||||
</if>
|
||||
<if test="null != tenantId and '' != tenantId">
|
||||
#{tenantId},
|
||||
</if>
|
||||
<if test="null != status ">
|
||||
#{status},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<select id="getXhpcPlaceholderChargingStationId" resultType="int">
|
||||
select count(*) from xhpc_placeholder where charging_station_id=#{chargingStationId} and del_flag =0
|
||||
<if test="type ==2">
|
||||
and placeholder_id !=#{placeholderId}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,28 @@
|
||||
package com.xhpc.common.domain;
|
||||
|
||||
import com.xhpc.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 占位表
|
||||
*
|
||||
* @author yuyang
|
||||
* @Date 2025-04-22 21:59
|
||||
*/
|
||||
@Data
|
||||
public class XhpcPlaceholder extends BaseEntity {
|
||||
|
||||
private Long placeholderId;
|
||||
private Date startTime;
|
||||
private Date endTime;
|
||||
private BigDecimal maxFee;
|
||||
private Integer freeTime;
|
||||
private Long chargingStationId;
|
||||
private String content;
|
||||
private Integer status;
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package com.xhpc.common.domain;
|
||||
|
||||
import com.xhpc.common.core.annotation.Excel;
|
||||
import com.xhpc.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 占位费时间段
|
||||
*
|
||||
* @author yuyang
|
||||
* @Date 2025-04-22 21:55
|
||||
*/
|
||||
@Data
|
||||
public class XhpcPlaceholderTime extends BaseEntity {
|
||||
|
||||
private Long placeholderTimeId;
|
||||
|
||||
private Long placeholderId;
|
||||
|
||||
private Date startTime;
|
||||
|
||||
private Date endTime;
|
||||
|
||||
private BigDecimal price;
|
||||
|
||||
private Long chargingStationId;
|
||||
|
||||
private Integer delFlag;
|
||||
|
||||
|
||||
}
|
||||
@ -100,6 +100,14 @@ public class UserTypeUtil {
|
||||
public static final String SYS_USER_TYPE_THREE = "03";
|
||||
public static final String SYS_USER_TYPE_FOUR = "04";
|
||||
|
||||
|
||||
/**
|
||||
* 系统租户管理员(0 是系统超管 1 某个租户超管 2普通用户)
|
||||
*/
|
||||
public static final Integer SYS_SUPER_TYPE_FOUR = 0;
|
||||
public static final Integer SYS_SUPER_TYPE_ONE = 1;
|
||||
public static final Integer SYS_SUPER_TYPE_TWO = 2;
|
||||
|
||||
/**
|
||||
* 启动方式 微信、支付宝、刷卡
|
||||
*/
|
||||
|
||||
@ -0,0 +1,50 @@
|
||||
package com.xhpc.order.domain;
|
||||
|
||||
import com.xhpc.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author yuyang
|
||||
* @Date 2025-04-23 14:15
|
||||
*/
|
||||
@Data
|
||||
@Entity
|
||||
@Table(name = "xhpc_placeholder_order")
|
||||
public class XhpcPlaceholderOrder extends BaseEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long placeholderOrderId;
|
||||
private Long historyOrderId;
|
||||
private Long chargingStationId;
|
||||
private Long chargeOrderId;
|
||||
private Long terminalId;
|
||||
private Long userId;
|
||||
private String serialNumber;
|
||||
private String internetSerialNumber;
|
||||
private Integer confirmResult;
|
||||
private Integer source;
|
||||
private Long placeholderId;
|
||||
private Integer freeTime;
|
||||
private Integer maxFee;
|
||||
private String operatorId;
|
||||
private String placeholderOrderNumber;
|
||||
private Integer status;
|
||||
private String terminalNumber;
|
||||
private Integer billEquipment;
|
||||
private Date startTime;
|
||||
private Date endTime;
|
||||
private Integer totalTimeSpan;
|
||||
private BigDecimal overtimePrice;
|
||||
private BigDecimal totalMoney;
|
||||
private BigDecimal price;
|
||||
private String tenantId;
|
||||
|
||||
public XhpcPlaceholderOrder() {
|
||||
|
||||
}
|
||||
}
|
||||
@ -14,10 +14,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
@ -58,7 +58,15 @@ public class XhpcPileRegularInspectController extends BaseController {
|
||||
xhpcPileRegularInspectService.getRateTime();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//定期抄发管理员定时任务
|
||||
|
||||
//占位费定时任务
|
||||
@Scheduled(cron = "0/10 * * * * ? ")
|
||||
public void getxhpcPlaceholderOrderTime()
|
||||
{
|
||||
xhpcPileRegularInspectService.getTimingPriceTime();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -213,4 +213,9 @@ public interface XhpcRealTimeOrderMapper {
|
||||
|
||||
void insertXhpcBarrierGateRecord(XhpcBarrierGateRecord xhpcBarrierGateRecord);
|
||||
|
||||
|
||||
//查询该场站是否有占位费设置
|
||||
Map<String, Object> getXhpcPlaceholder(@Param("chargingStationId")Long chargingStationId);
|
||||
|
||||
int insertXhpcPlaceholderOrder(XhpcPlaceholderOrder placeholderOrder );
|
||||
}
|
||||
|
||||
@ -45,6 +45,9 @@ import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static cn.hutool.core.date.DatePattern.NORM_DATETIME_FORMAT;
|
||||
import static com.xhpc.common.data.redis.StaticBeanUtil.*;
|
||||
|
||||
/**
|
||||
* @author yuyang
|
||||
* @date 2021/8/7 15:07
|
||||
@ -1595,6 +1598,46 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
//查询该场站是否有占位费
|
||||
Map<String, Object> xhpcPlaceholderMap = xhpcRealTimeOrderMapper.getXhpcPlaceholder(xhpcHistoryOrder.getChargingStationId());
|
||||
|
||||
if(xhpcPlaceholderMap !=null){
|
||||
//占位订单生成
|
||||
XhpcPlaceholderOrder placeholderOrder = new XhpcPlaceholderOrder();
|
||||
placeholderOrder.setHistoryOrderId(xhpcHistoryOrder.getHistoryOrderId());
|
||||
placeholderOrder.setChargingStationId(xhpcHistoryOrder.getChargingStationId());
|
||||
placeholderOrder.setChargeOrderId(xhpcHistoryOrder.getChargeOrderId());
|
||||
placeholderOrder.setTerminalId(xhpcHistoryOrder.getTerminalId());
|
||||
placeholderOrder.setUserId(xhpcHistoryOrder.getUserId());
|
||||
placeholderOrder.setSerialNumber(xhpcHistoryOrder.getSerialNumber());
|
||||
placeholderOrder.setInternetSerialNumber(xhpcHistoryOrder.getInternetSerialNumber());
|
||||
placeholderOrder.setConfirmResult(-1);
|
||||
placeholderOrder.setSource(xhpcHistoryOrder.getSource());
|
||||
placeholderOrder.setPlaceholderId(Long.valueOf(xhpcPlaceholderMap.get("placeholderId").toString()));
|
||||
placeholderOrder.setFreeTime(Integer.valueOf(xhpcPlaceholderMap.get("freeTime").toString()));
|
||||
placeholderOrder.setMaxFee(new BigDecimal(xhpcPlaceholderMap.get("maxFee").toString()).intValue());
|
||||
placeholderOrder.setOperatorId("MA6DFCTD5");
|
||||
//订单流水号 终端号+年月日时分秒+自增4位 共32位
|
||||
String substring = xhpcHistoryOrder.getSerialNumber().substring(0, 16);
|
||||
String orderNo = genOrder(substring);
|
||||
placeholderOrder.setPlaceholderOrderNumber(orderNo);
|
||||
placeholderOrder.setStatus(1);
|
||||
placeholderOrder.setTerminalNumber(substring);
|
||||
placeholderOrder.setBillEquipment(1);
|
||||
placeholderOrder.setStartTime(xhpcHistoryOrder.getEndTime());
|
||||
placeholderOrder.setCreateTime(new Date());
|
||||
placeholderOrder.setTenantId(xhpcHistoryOrder.getTenantId());
|
||||
xhpcRealTimeOrderMapper.insertXhpcPlaceholderOrder(placeholderOrder);
|
||||
logger.info("<<<<<<<<<<<<<<getPlaceholderOrderId>>>>>>>>>>>>>>>>"+placeholderOrder.getPlaceholderOrderId());
|
||||
String gunkey = "placeholderOrder:"+substring+":"+xhpcHistoryOrder.getSerialNumber();
|
||||
Map<String, Object> cacheGun =new HashMap<>();
|
||||
cacheGun.put("source",xhpcHistoryOrder.getSource());
|
||||
cacheGun.put("placeholderOrderId",placeholderOrder.getPlaceholderOrderId());
|
||||
cacheGun.put("status",0);
|
||||
cacheGun.put("serialNumber",xhpcHistoryOrder.getSerialNumber());
|
||||
cacheGun.put("internetSerialNumber",xhpcHistoryOrder.getInternetSerialNumber());
|
||||
REDIS.setCacheMap(gunkey, cacheGun);
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
logger.info("<<<<<<<<<<<<<<<<运行异常,结算失败,数据回滚>>>>>>>>>>>>>>>>>"+xhpcChargeOrder.getSerialNumber());
|
||||
@ -2238,7 +2281,14 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
|
||||
|
||||
}
|
||||
}
|
||||
public static String genOrder(String terminalSerialNumber) {
|
||||
|
||||
Date date = Calendar.getInstance().getTime();
|
||||
String format = DateUtil.format(date, "yyMMddHHmmss");
|
||||
//自增
|
||||
String orderNo = terminalSerialNumber + format ;
|
||||
return orderNo;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// WxMessageSend("ot6ul4nlSC5ZZOC4rTLS5hedFTGk","69_G2hFrelhCsfOPuFB6OPP5I8j_DKdP-N6QF-shvpUFT2mQ-KjonSxbS_mrP5P9nYyat9OsJLZAcbYA4g5rWdn0i6whxueiU3hWfguoeqSnick1zAGvu7SKa50_VkKPAcAGABGR","黄金东二路","80","76.6");
|
||||
|
||||
@ -14,10 +14,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
@ -688,8 +688,6 @@
|
||||
inner join (
|
||||
select xco.charge_order_id as charge_order_id from xhpc_charge_order as xco INNER JOIN xhpc_app_user as xau on xau.app_user_id = xco.user_id where xco.source=0 and xau.phone LIKE concat('%',#{phone}, '%')
|
||||
union
|
||||
co.driver_id LIKE concat('%',#{phone}, '%')
|
||||
union
|
||||
select xco.charge_order_id as charge_order_id from xhpc_charge_order as xco INNER JOIN xhpc_community_personnel as xcp on xcp.community_personnel_id = xco.user_id where xco.source=2 and xcp.account LIKE concat('%',#{phone}, '%')
|
||||
union
|
||||
select xco.charge_order_id as charge_order_id from xhpc_charge_order as xco INNER JOIN xhpc_customers_personnel as xcup on xcup.customers_personnel_id = xco.user_id where xco.source=3 and xcup.account LIKE concat('%',#{phone}, '%')
|
||||
@ -1312,4 +1310,194 @@
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<select id="getXhpcPlaceholder" resultType="map">
|
||||
select
|
||||
max_fee as maxFee,
|
||||
free_time as freeTime,
|
||||
placeholder_id as placeholderId
|
||||
from xhpc_placeholder where del_flag =0 and status =1 and NOW() >= start_time AND NOW() <= end_time
|
||||
</select>
|
||||
|
||||
<insert id="insertXhpcPlaceholderOrder" parameterType="com.xhpc.order.domain.XhpcPlaceholderOrder"
|
||||
useGeneratedKeys="true" keyProperty="placeholderOrderId">
|
||||
insert into xhpc_placeholder_order
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="null != historyOrderId">
|
||||
history_order_id,
|
||||
</if>
|
||||
<if test="null != chargingStationId ">
|
||||
charging_station_id,
|
||||
</if>
|
||||
<if test="null != chargeOrderId ">
|
||||
charge_order_id,
|
||||
</if>
|
||||
<if test="null != userId">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="null != terminalId">
|
||||
terminal_id,
|
||||
</if>
|
||||
<if test="null != serialNumber and '' != serialNumber">
|
||||
serial_number,
|
||||
</if>
|
||||
<if test="null != internetSerialNumber and '' != internetSerialNumber">
|
||||
internet_serial_number,
|
||||
</if>
|
||||
<if test="null != confirmResult and '' != confirmResult">
|
||||
confirm_Result,
|
||||
</if>
|
||||
<if test="null != source ">
|
||||
source,
|
||||
</if>
|
||||
<if test="null != placeholderId">
|
||||
placeholder_id,
|
||||
</if>
|
||||
<if test="null != freeTime">
|
||||
free_time,
|
||||
</if>
|
||||
<if test="null != maxFee ">
|
||||
max_fee,
|
||||
</if>
|
||||
<if test="null != operatorId and '' != operatorId">
|
||||
operator_id,
|
||||
</if>
|
||||
<if test="null != placeholderOrderNumber and '' != placeholderOrderNumber">
|
||||
placeholder_order_number,
|
||||
</if>
|
||||
<if test="null != status ">
|
||||
status,
|
||||
</if>
|
||||
<if test="null != terminalNumber and '' != terminalNumber">
|
||||
terminal_number,
|
||||
</if>
|
||||
<if test="null != billEquipment ">
|
||||
bill_equipment,
|
||||
</if>
|
||||
<if test="null != startTime ">
|
||||
start_time,
|
||||
</if>
|
||||
<if test="null != endTime ">
|
||||
end_time,
|
||||
</if>
|
||||
<if test="null != totalTimeSpan ">
|
||||
total_time_span,
|
||||
</if>
|
||||
<if test="null != overtimePrice ">
|
||||
overtime_price,
|
||||
</if>
|
||||
<if test="null != totalMoney ">
|
||||
total_money,
|
||||
</if>
|
||||
<if test="null != price ">
|
||||
price,
|
||||
</if>
|
||||
<if test="null != createTime ">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="null != createBy and '' != createBy">
|
||||
create_by,
|
||||
</if>
|
||||
<if test="null != updateTime ">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="null != updateBy and '' != updateBy">
|
||||
update_by,
|
||||
</if>
|
||||
<if test="null != remark and '' != remark">
|
||||
remark,
|
||||
</if>
|
||||
<if test="null != tenantId ">
|
||||
tenant_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="null != historyOrderId">
|
||||
#{historyOrderId},
|
||||
</if>
|
||||
<if test="null != chargingStationId ">
|
||||
#{chargingStationId},
|
||||
</if>
|
||||
<if test="null != chargeOrderId ">
|
||||
#{chargeOrderId},
|
||||
</if>
|
||||
<if test="null != userId">
|
||||
#{userId},
|
||||
</if>
|
||||
<if test="null != terminalId">
|
||||
#{terminalId},
|
||||
</if>
|
||||
<if test="null != serialNumber and '' != serialNumber">
|
||||
#{serialNumber},
|
||||
</if>
|
||||
<if test="null != internetSerialNumber and '' != internetSerialNumber">
|
||||
#{internetSerialNumber},
|
||||
</if>
|
||||
<if test="null != confirmResult and '' != confirmResult">
|
||||
#{confirmResult},
|
||||
</if>
|
||||
<if test="null != source ">
|
||||
#{source},
|
||||
</if>
|
||||
<if test="null != placeholderId">
|
||||
#{placeholderId},
|
||||
</if>
|
||||
<if test="null != freeTime">
|
||||
#{freeTime},
|
||||
</if>
|
||||
<if test="null != maxFee ">
|
||||
#{maxFee},
|
||||
</if>
|
||||
<if test="null != operatorId and '' != operatorId">
|
||||
#{operatorId},
|
||||
</if>
|
||||
<if test="null != placeholderOrderNumber and '' != placeholderOrderNumber">
|
||||
#{placeholderOrderNumber},
|
||||
</if>
|
||||
<if test="null != status ">
|
||||
#{status},
|
||||
</if>
|
||||
<if test="null != terminalNumber and '' != terminalNumber">
|
||||
#{terminalNumber},
|
||||
</if>
|
||||
<if test="null != billEquipment ">
|
||||
#{billEquipment},
|
||||
</if>
|
||||
<if test="null != startTime ">
|
||||
#{startTime},
|
||||
</if>
|
||||
<if test="null != endTime ">
|
||||
#{endTime},
|
||||
</if>
|
||||
<if test="null != totalTimeSpan ">
|
||||
#{totalTimeSpan},
|
||||
</if>
|
||||
<if test="null != overtimePrice ">
|
||||
#{overtimePrice},
|
||||
</if>
|
||||
<if test="null != totalMoney ">
|
||||
#{totalMoney},
|
||||
</if>
|
||||
<if test="null != price ">
|
||||
#{price},
|
||||
</if>
|
||||
<if test="null != createTime ">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="null != createBy and '' != createBy">
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="null != updateTime ">
|
||||
#{updateTime},
|
||||
</if>
|
||||
<if test="null != updateBy and '' != updateBy">
|
||||
#{updateBy},
|
||||
</if>
|
||||
<if test="null != remark and '' != remark">
|
||||
#{remark},
|
||||
</if>
|
||||
<if test="null != tenantId ">
|
||||
#{tenantId},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
</mapper>
|
||||
|
||||
@ -14,10 +14,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
@ -28,6 +28,8 @@ import org.springframework.stereotype.Component;
|
||||
import javax.annotation.Resource;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
@ -80,6 +82,7 @@ public class RealtimeDataLogic implements ServiceLogic {
|
||||
String statusplain = stable[statusInt];
|
||||
cacheGun.put("pileGunStatus", stable[Integer.parseInt(realtimeData.getPileGunStatus())]);
|
||||
cacheGun.put("vehicleGunStatus", pvgstable[Integer.parseInt(realtimeData.getVehicleGunStatus())]);
|
||||
|
||||
double wv = reverseHexInt(realtimeData.getWorkingVoltage()) / 10.0;
|
||||
cacheGun.put("voltage", wv);
|
||||
double wc = reverseHexInt(realtimeData.getWorkingCurrent()) / 10.0;
|
||||
@ -294,6 +297,20 @@ public class RealtimeDataLogic implements ServiceLogic {
|
||||
@Override
|
||||
public void run() {
|
||||
REDIS.setCacheObject("cdjgpc:realTime:"+orderNo,orderNo);
|
||||
//插枪状态发生变化进行判断是否收停车费
|
||||
String vehicleGunStatus = pvgstable[Integer.parseInt(realtimeData.getVehicleGunStatus())];
|
||||
if("否".equals(vehicleGunStatus)){
|
||||
String gunkey = "placeholderOrder:"+terminalId+":*";
|
||||
|
||||
Collection<String> orderKeys = REDIS.keys(gunkey);
|
||||
for (String okey : orderKeys) {
|
||||
Map<String, Object> cacheGun = REDIS.getCacheMap(gunkey);
|
||||
if(cacheGun !=null){
|
||||
cacheGun.put("status",1);
|
||||
REDIS.setCacheMap(gunkey, cacheGun);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return new ServiceResult(false);
|
||||
|
||||
@ -18,10 +18,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
@ -118,6 +118,9 @@ public class XhpcOperatorServiceImpl implements IXhpcOperatorService {
|
||||
Long sysUserId = sysUser.getUserId();
|
||||
//获取登陆用户
|
||||
if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){
|
||||
if (UserTypeUtil.SYS_SUPER_TYPE_ONE.equals(loginUser.getSuperType())) {
|
||||
return xhpcOperatorMapper.selectOperatorList(operatorId,name, contactName, contactPhone, createTimeStart, createTimeEnd,loginUser.getTenantId(),0,sysUserId);
|
||||
}
|
||||
if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){
|
||||
Long logOperatorId = sysUser.getOperatorId();
|
||||
return xhpcOperatorMapper.selectOperatorList(operatorId,name, contactName, contactPhone, createTimeStart, createTimeEnd,tenantId,1,logOperatorId);
|
||||
|
||||
@ -14,10 +14,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
@ -253,6 +253,7 @@
|
||||
weixin_open_id as weixinOpenId,
|
||||
alipay_open_id AS alipayOpenId,
|
||||
account AS account,
|
||||
tenant_id as tenantId,
|
||||
phone AS phone,
|
||||
recharge_money AS rechargeMoney,
|
||||
consume_money AS consumeMoney,
|
||||
|
||||
@ -260,6 +260,7 @@
|
||||
recharge_money AS rechargeMoney,
|
||||
consume_money AS consumeMoney,
|
||||
red_packet AS redPacket,
|
||||
tenant_id as tenantId,
|
||||
surplus_money AS surplusMoney,
|
||||
create_time as createTime,
|
||||
type,
|
||||
|
||||
@ -173,7 +173,7 @@
|
||||
and type =#{type}
|
||||
</if>
|
||||
|
||||
order by tyep desc,create_time desc limit 1
|
||||
order by type desc,create_time desc limit 1
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
@ -16,10 +16,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
server-addr: 120.26.46.180:8858
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user