修改发送消息
This commit is contained in:
parent
8717335cae
commit
6c0bf83002
@ -127,6 +127,7 @@ public class XhpcChargingPileServiceImpl extends BaseService implements IXhpcCha
|
|||||||
public AjaxResult addXhpcChargingPile(XhpcChargingPile xhpcChargingPile) {
|
public AjaxResult addXhpcChargingPile(XhpcChargingPile xhpcChargingPile) {
|
||||||
Long chargingStationId = xhpcChargingPile.getChargingStationId();
|
Long chargingStationId = xhpcChargingPile.getChargingStationId();
|
||||||
LoginUser loginUser = tokenService.getLoginUser();
|
LoginUser loginUser = tokenService.getLoginUser();
|
||||||
|
String tenantId = loginUser.getTenantId();
|
||||||
R r1 = tenantService.gettenantIdTime(loginUser.getTenantId());
|
R r1 = tenantService.gettenantIdTime(loginUser.getTenantId());
|
||||||
if(r1.getCode()!=200){
|
if(r1.getCode()!=200){
|
||||||
return AjaxResult.error(1001, "请重新登录");
|
return AjaxResult.error(1001, "请重新登录");
|
||||||
@ -157,6 +158,7 @@ public class XhpcChargingPileServiceImpl extends BaseService implements IXhpcCha
|
|||||||
xhpcChargingPile.setRateModelId(rateModelId);
|
xhpcChargingPile.setRateModelId(rateModelId);
|
||||||
String serialNumber = xhpcChargingPile.getSerialNumber();
|
String serialNumber = xhpcChargingPile.getSerialNumber();
|
||||||
xhpcChargingPile.setCreateTime(new Date());
|
xhpcChargingPile.setCreateTime(new Date());
|
||||||
|
xhpcChargingPile.setTenantId(tenantId);
|
||||||
//判断桩编号是否重复
|
//判断桩编号是否重复
|
||||||
int count = xhpcChargingPileMapper.getXhpcChargingPileSerialNumberCount(serialNumber);
|
int count = xhpcChargingPileMapper.getXhpcChargingPileSerialNumberCount(serialNumber);
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
@ -170,7 +172,7 @@ public class XhpcChargingPileServiceImpl extends BaseService implements IXhpcCha
|
|||||||
if (xhpcChargingPile.getGunNumber() > 0) {
|
if (xhpcChargingPile.getGunNumber() > 0) {
|
||||||
int number = xhpcChargingPileMapper.countXhpcTerminal(chargingStationId);
|
int number = xhpcChargingPileMapper.countXhpcTerminal(chargingStationId);
|
||||||
for (int i = 1; i <= xhpcChargingPile.getGunNumber(); i++) {
|
for (int i = 1; i <= xhpcChargingPile.getGunNumber(); i++) {
|
||||||
addXhpcTerminal(xhpcChargingPile.getName(), chargingStationId, rateModelId, serialNumber, chargingPileId, i, number + 1, xhpcChargingPile.getConnectorType());
|
addXhpcTerminal(xhpcChargingPile.getName(), chargingStationId, rateModelId, serialNumber, chargingPileId, i, number + 1, xhpcChargingPile.getConnectorType(),tenantId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -196,7 +198,7 @@ public class XhpcChargingPileServiceImpl extends BaseService implements IXhpcCha
|
|||||||
* @date 2022/2/17 15:31
|
* @date 2022/2/17 15:31
|
||||||
* @since version-1.0
|
* @since version-1.0
|
||||||
*/
|
*/
|
||||||
private void addXhpcTerminal(String name, Long chargingStationId, Long rateModelId, String serialNumber, Long chargingPileId, int i, int number, int conType) {
|
private void addXhpcTerminal(String name, Long chargingStationId, Long rateModelId, String serialNumber, Long chargingPileId, int i, int number, int conType,String tenantId) {
|
||||||
|
|
||||||
XhpcTerminal xhpcTerminal = new XhpcTerminal();
|
XhpcTerminal xhpcTerminal = new XhpcTerminal();
|
||||||
xhpcTerminal.setChargingStationId(chargingStationId);
|
xhpcTerminal.setChargingStationId(chargingStationId);
|
||||||
@ -213,6 +215,7 @@ public class XhpcChargingPileServiceImpl extends BaseService implements IXhpcCha
|
|||||||
xhpcTerminal.setRateModelId(rateModelId);
|
xhpcTerminal.setRateModelId(rateModelId);
|
||||||
xhpcTerminal.setNumber(number);
|
xhpcTerminal.setNumber(number);
|
||||||
xhpcTerminal.setConnectorType(conType);
|
xhpcTerminal.setConnectorType(conType);
|
||||||
|
xhpcTerminal.setTenantId(tenantId);
|
||||||
xhpcTerminalMapper.insertXhpcTerminal(xhpcTerminal);
|
xhpcTerminalMapper.insertXhpcTerminal(xhpcTerminal);
|
||||||
|
|
||||||
//获取场站名称:
|
//获取场站名称:
|
||||||
@ -257,7 +260,7 @@ public class XhpcChargingPileServiceImpl extends BaseService implements IXhpcCha
|
|||||||
// 删除阿里云上面之前可能存在的桩图片文件夹
|
// 删除阿里云上面之前可能存在的桩图片文件夹
|
||||||
// clearRepetition(environment, serialNumber);
|
// clearRepetition(environment, serialNumber);
|
||||||
for (int i = 1; i <= xhpcChargingPile.getGunNumber(); i++) {
|
for (int i = 1; i <= xhpcChargingPile.getGunNumber(); i++) {
|
||||||
addXhpcTerminal(xhpcChargingPile.getName(), chargingStationId, rateModelId, serialNumber, chargingPileId, i, number + 1, xhpcChargingPile.getConnectorType());
|
addXhpcTerminal(xhpcChargingPile.getName(), chargingStationId, rateModelId, serialNumber, chargingPileId, i, number + 1, xhpcChargingPile.getConnectorType(),xhpc.getTenantId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//插入redis 桩的编号
|
//插入redis 桩的编号
|
||||||
|
|||||||
@ -213,7 +213,10 @@
|
|||||||
current,
|
current,
|
||||||
</if>
|
</if>
|
||||||
<if test="null != equipmentType ">
|
<if test="null != equipmentType ">
|
||||||
equipment_type
|
equipment_type,
|
||||||
|
</if>
|
||||||
|
<if test="null != tenantId ">
|
||||||
|
tenant_id
|
||||||
</if>
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
@ -311,7 +314,10 @@
|
|||||||
#{current},
|
#{current},
|
||||||
</if>
|
</if>
|
||||||
<if test="null != equipmentType ">
|
<if test="null != equipmentType ">
|
||||||
#{equipmentType}
|
#{equipmentType},
|
||||||
|
</if>
|
||||||
|
<if test="null != tenantId ">
|
||||||
|
#{tenantId}
|
||||||
</if>
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|||||||
@ -190,7 +190,10 @@
|
|||||||
number
|
number
|
||||||
</if>
|
</if>
|
||||||
<if test="null != operatorIdEvcs">
|
<if test="null != operatorIdEvcs">
|
||||||
operator_id_evcs
|
operator_id_evcs,
|
||||||
|
</if>
|
||||||
|
<if test="null != tenantId">
|
||||||
|
tenant_id,
|
||||||
</if>
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
@ -243,7 +246,10 @@
|
|||||||
#{number}
|
#{number}
|
||||||
</if>
|
</if>
|
||||||
<if test="null != operatorIdEvcs">
|
<if test="null != operatorIdEvcs">
|
||||||
#{operatorIdEvcs}
|
#{operatorIdEvcs},
|
||||||
|
</if>
|
||||||
|
<if test="null != tenantId">
|
||||||
|
#{tenantId},
|
||||||
</if>
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|||||||
@ -136,7 +136,8 @@ public class XhpcChargeOrderController extends BaseController {
|
|||||||
LoginUser loginUser = tokenService.getLoginUser(request);
|
LoginUser loginUser = tokenService.getLoginUser(request);
|
||||||
String tenantId = loginUser.getTenantId();
|
String tenantId = loginUser.getTenantId();
|
||||||
String userTypeUtil = loginUser.getUserTypeUtil();
|
String userTypeUtil = loginUser.getUserTypeUtil();
|
||||||
String message = tenantId + userTypeUtil + userId;
|
String message = tenantId + userTypeUtil + loginUser.getUserid();
|
||||||
|
logger.info("<<<<<<<<<<再次<<<<<<<<<<<<<<"+message+">>>>>>>>>>>>>>>>>");
|
||||||
Map<String, Object> cacheMap = redisService.getCacheMap("realTimeTenantId:"+message);
|
Map<String, Object> cacheMap = redisService.getCacheMap("realTimeTenantId:"+message);
|
||||||
Map<String,Object> map =new HashMap<>();
|
Map<String,Object> map =new HashMap<>();
|
||||||
map.put("code", 200);
|
map.put("code", 200);
|
||||||
@ -160,8 +161,11 @@ public class XhpcChargeOrderController extends BaseController {
|
|||||||
data.put("type","-1");
|
data.put("type","-1");
|
||||||
data.put("parkingInstructions","充电完成请尽快离场,超时车位占用费10元/小时");
|
data.put("parkingInstructions","充电完成请尽快离场,超时车位占用费10元/小时");
|
||||||
map.put("data", data);
|
map.put("data", data);
|
||||||
|
logger.info("<<<<<<<<<<不是缓存数据<<<<<<<<<<<<<<");
|
||||||
}else{
|
}else{
|
||||||
map.put("data",cacheMap);
|
map.put("data",cacheMap);
|
||||||
|
logger.info("<<<<<<<<<<是缓存数据<<<<<<<<<<<<<<");
|
||||||
|
logger.info("<<<<<<<<<<是缓存数据<<<<<<<<<<<<<<");
|
||||||
}
|
}
|
||||||
JSONObject json = new JSONObject(map);
|
JSONObject json = new JSONObject(map);
|
||||||
webSocketService.getMessage(message,json.toString());
|
webSocketService.getMessage(message,json.toString());
|
||||||
|
|||||||
@ -64,7 +64,7 @@ public class XhpcPileOrderController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@GetMapping("/chargeOrder/pileStartup")
|
@GetMapping("/chargeOrder/pileStartup")
|
||||||
public R pileStartup(@RequestParam(value = "orderNo")String orderNo, @RequestParam(value = "status")Integer status,@RequestParam(value = "remark") String remark) {
|
public R pileStartup(@RequestParam(value = "orderNo")String orderNo, @RequestParam(value = "status")Integer status,@RequestParam(value = "remark") String remark) {
|
||||||
logger.info("桩启动回调接口>>>>>状态:"+status+"备注++"+"remark"+"订单号"+orderNo);
|
logger.info("桩启动回调接口>>>>>状态:"+status+"备注++"+remark+"订单号"+orderNo);
|
||||||
|
|
||||||
//解析订单编号
|
//解析订单编号
|
||||||
Long userId =0L;
|
Long userId =0L;
|
||||||
@ -86,9 +86,19 @@ public class XhpcPileOrderController extends BaseController {
|
|||||||
map.put("message", remark);
|
map.put("message", remark);
|
||||||
JSONObject json = new JSONObject(map);
|
JSONObject json = new JSONObject(map);
|
||||||
logger.info("桩启动回调接口>>>>>json:"+json.toString());
|
logger.info("桩启动回调接口>>>>>json:"+json.toString());
|
||||||
|
Integer source = xhpcChargeOrder.getSource();
|
||||||
|
String tenantId = xhpcChargeOrder.getTenantId();
|
||||||
|
String message = "";
|
||||||
|
if(UserTypeUtil.USER_TYPE.equals(source)){
|
||||||
|
message = tenantId + UserTypeUtil.USER + userId;
|
||||||
|
}else if(UserTypeUtil.COMMUNIT_TYPE.equals(source)){
|
||||||
|
message = tenantId + UserTypeUtil.COMMUNIT + userId;
|
||||||
|
}else{
|
||||||
|
message = tenantId + UserTypeUtil.CUSTOMERS + userId;
|
||||||
|
}
|
||||||
//消息对了内容
|
//消息对了内容
|
||||||
if(xhpcChargeOrder.getSource()==0){
|
if(xhpcChargeOrder.getSource()==0){
|
||||||
webSocketService.getMessage(userId+"",json.toString());
|
webSocketService.getMessage(message,json.toString());
|
||||||
}
|
}
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
@ -173,11 +183,23 @@ public class XhpcPileOrderController extends BaseController {
|
|||||||
}else{
|
}else{
|
||||||
//修改订单,判断订单
|
//修改订单,判断订单
|
||||||
}
|
}
|
||||||
|
Integer source = xhpcChargeOrder.getSource();
|
||||||
|
String tenantId = xhpcChargeOrder.getTenantId();
|
||||||
|
String message = "";
|
||||||
|
if(UserTypeUtil.USER_TYPE.equals(source)){
|
||||||
|
message = tenantId + UserTypeUtil.USER + userId;
|
||||||
|
}else if(UserTypeUtil.COMMUNIT_TYPE.equals(source)){
|
||||||
|
message = tenantId + UserTypeUtil.COMMUNIT + userId;
|
||||||
|
}else{
|
||||||
|
message = tenantId + UserTypeUtil.CUSTOMERS + userId;
|
||||||
|
}
|
||||||
if(xhpcChargeOrder.getSource()==0){
|
if(xhpcChargeOrder.getSource()==0){
|
||||||
map.put("code", code);
|
map.put("code", code);
|
||||||
JSONObject json = new JSONObject(map);
|
JSONObject json = new JSONObject(map);
|
||||||
//消息对了内容
|
//消息对了内容
|
||||||
webSocketService.getMessage(userId+"",json.toString());
|
if(code !=500){
|
||||||
|
webSocketService.getMessage(message,json.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
@ -201,15 +223,16 @@ public class XhpcPileOrderController extends BaseController {
|
|||||||
return R.fail(500,"无效订单号");
|
return R.fail(500,"无效订单号");
|
||||||
}
|
}
|
||||||
Long userId = xhpcChargeOrder.getUserId();
|
Long userId = xhpcChargeOrder.getUserId();
|
||||||
|
Integer source = xhpcChargeOrder.getSource();
|
||||||
|
String tenantId = xhpcChargeOrder.getTenantId();
|
||||||
try {
|
try {
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
xhpcChargeOrder.setEndTime(date);
|
xhpcChargeOrder.setEndTime(date);
|
||||||
xhpcChargeOrder.setUpdateTime(date);
|
xhpcChargeOrder.setUpdateTime(date);
|
||||||
xhpcChargeOrderService.updateXhpcChargeOrder(xhpcChargeOrder);
|
xhpcChargeOrderService.updateXhpcChargeOrder(xhpcChargeOrder);
|
||||||
Map<String, Object> map = xhpcRealTimeOrderService.addOrderTime(cacheRealtimeData, xhpcChargeOrder, orderNo, 1);
|
Map<String, Object> map = xhpcRealTimeOrderService.addOrderTime(cacheRealtimeData, xhpcChargeOrder, orderNo, 1);
|
||||||
Integer source = xhpcChargeOrder.getSource();
|
|
||||||
if(!UserTypeUtil.INTERNET_TYPE.equals(source)){
|
if(!UserTypeUtil.INTERNET_TYPE.equals(source)){
|
||||||
String tenantId = xhpcChargeOrder.getTenantId();
|
|
||||||
//存入换成
|
//存入换成
|
||||||
JSONObject json = new JSONObject(map);
|
JSONObject json = new JSONObject(map);
|
||||||
String message = "";
|
String message = "";
|
||||||
@ -230,9 +253,17 @@ public class XhpcPileOrderController extends BaseController {
|
|||||||
map.put("code", 500);
|
map.put("code", 500);
|
||||||
map.put("userId", xhpcChargeOrder.getUserId());
|
map.put("userId", xhpcChargeOrder.getUserId());
|
||||||
JSONObject json = new JSONObject(map);
|
JSONObject json = new JSONObject(map);
|
||||||
|
String message = "";
|
||||||
|
if(UserTypeUtil.USER_TYPE.equals(source)){
|
||||||
|
message = tenantId + UserTypeUtil.USER + userId;
|
||||||
|
}else if(UserTypeUtil.COMMUNIT_TYPE.equals(source)){
|
||||||
|
message = tenantId + UserTypeUtil.COMMUNIT + userId;
|
||||||
|
}else{
|
||||||
|
message = tenantId + UserTypeUtil.CUSTOMERS + userId;
|
||||||
|
}
|
||||||
if(xhpcChargeOrder.getSource()==0){
|
if(xhpcChargeOrder.getSource()==0){
|
||||||
//消息对了内容
|
//消息对了内容
|
||||||
webSocketService.getMessage(userId+"",json.toString());
|
webSocketService.getMessage(message,json.toString());
|
||||||
}
|
}
|
||||||
return R.fail(500,"无实时数据");
|
return R.fail(500,"无实时数据");
|
||||||
}
|
}
|
||||||
@ -399,17 +430,21 @@ public class XhpcPileOrderController extends BaseController {
|
|||||||
Integer source = xhpcChargeOrder.getSource();
|
Integer source = xhpcChargeOrder.getSource();
|
||||||
String tenantId = xhpcChargeOrder.getTenantId();
|
String tenantId = xhpcChargeOrder.getTenantId();
|
||||||
if(!UserTypeUtil.INTERNET_TYPE.equals(source)){
|
if(!UserTypeUtil.INTERNET_TYPE.equals(source)){
|
||||||
|
long l1 = System.currentTimeMillis();
|
||||||
|
logger.info("<<<<<<<"+orderNo+"开始获取用户时间>>>>>:"+l1);
|
||||||
R user = userTypeService.getUser(null, userId, source, null, tenantId);
|
R user = userTypeService.getUser(null, userId, source, null, tenantId);
|
||||||
if(user !=null && user.getData() !=null){
|
long l2 = System.currentTimeMillis();
|
||||||
|
logger.info("<<<<<<<"+orderNo+"结束获取用户时间>>>>>:"+l2);
|
||||||
|
logger.info("<<<<<<<"+orderNo+"时间差>>>>>:"+(l2-l1));
|
||||||
|
if(user !=null && user.getData() !=null ){
|
||||||
userMessage = (Map<String, Object>)user.getData();
|
userMessage = (Map<String, Object>)user.getData();
|
||||||
if (userMessage == null || userMessage.get("balance") == null) {
|
if (userMessage == null || userMessage.get("balance") == null) {
|
||||||
//订单异常
|
logger.info("获取用户信息失败>>userMessage>>>orderNo:"+orderNo);
|
||||||
xhpcChargeOrder.setStatus(2);
|
return R.fail(500,"添加订单回调失败");
|
||||||
//异常原因
|
|
||||||
xhpcChargeOrder.setErroRemark("".equals(xhpcChargeOrder.getErroRemark())?"桩异常:" + stopReason + ">>>>用户id:" + userId + "为空":xhpcChargeOrder.getErroRemark()+"桩异常:" + stopReason + ">>>>用户id:" + userId + "为空");
|
|
||||||
xhpcChargeOrderService.updateXhpcChargeOrder(xhpcChargeOrder);
|
|
||||||
R.ok();
|
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
logger.info("获取用户信息失败>>user>>>orderNo:"+orderNo);
|
||||||
|
return R.fail(500,"添加订单回调失败");
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
Map<String, Object> pushOrder = redisService.getCacheMap("pushOrder:"+orderNo);
|
Map<String, Object> pushOrder = redisService.getCacheMap("pushOrder:"+orderNo);
|
||||||
@ -429,6 +464,8 @@ public class XhpcPileOrderController extends BaseController {
|
|||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
map.put("code", 500);
|
map.put("code", 500);
|
||||||
map.put("userId", userId);
|
map.put("userId", userId);
|
||||||
|
map.put("type", 2);
|
||||||
|
map.put("chargingOrderId", xhpcChargeOrder.getChargeOrderId());
|
||||||
JSONObject json = new JSONObject(map);
|
JSONObject json = new JSONObject(map);
|
||||||
|
|
||||||
if(!UserTypeUtil.INTERNET_TYPE.equals(source)){
|
if(!UserTypeUtil.INTERNET_TYPE.equals(source)){
|
||||||
@ -443,10 +480,30 @@ public class XhpcPileOrderController extends BaseController {
|
|||||||
webSocketService.getMessage(message,json.toString());
|
webSocketService.getMessage(message,json.toString());
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
map.put("code", 300);
|
||||||
|
map.put("userId", userId);
|
||||||
|
map.put("type", 2);
|
||||||
|
map.put("chargingOrderId", xhpcChargeOrder.getChargeOrderId());
|
||||||
|
map.put("msg", "请重新点击停止充电");
|
||||||
|
JSONObject json = new JSONObject(map);
|
||||||
|
|
||||||
|
if(!UserTypeUtil.INTERNET_TYPE.equals(source)){
|
||||||
|
String message ="";
|
||||||
|
if(UserTypeUtil.USER_TYPE.equals(source)){
|
||||||
|
message=tenantId+UserTypeUtil.USER+userId;
|
||||||
|
}else if(UserTypeUtil.COMMUNIT_TYPE.equals(source)){
|
||||||
|
message=tenantId+UserTypeUtil.COMMUNIT+userId;
|
||||||
|
}else{
|
||||||
|
message=tenantId+UserTypeUtil.CUSTOMERS+userId;
|
||||||
|
}
|
||||||
|
webSocketService.getMessage(message,json.toString());
|
||||||
|
}
|
||||||
return R.fail();
|
return R.fail();
|
||||||
}
|
}
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
logger.info("添加订单回调失败>>>>>orderNo:"+orderNo);
|
||||||
return R.fail(500,"添加订单回调失败");
|
return R.fail(500,"添加订单回调失败");
|
||||||
}
|
}
|
||||||
return R.ok();
|
return R.ok();
|
||||||
@ -507,7 +564,7 @@ public class XhpcPileOrderController extends BaseController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Long update(Integer status, String remark, String serialNumber, Integer type) {
|
private Long update(Integer status, String remark, String serialNumber, Integer type) {
|
||||||
logger.info("状态:"+status+"备注++"+"remark"+"订单号"+serialNumber);
|
logger.info("状态:"+status+"备注++"+remark+"订单号"+serialNumber);
|
||||||
XhpcChargeOrder xhpcChargeOrder = xhpcChargeOrderService.getSerialNumberMessage(serialNumber);
|
XhpcChargeOrder xhpcChargeOrder = xhpcChargeOrderService.getSerialNumberMessage(serialNumber);
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
if(status==0){
|
if(status==0){
|
||||||
|
|||||||
@ -50,8 +50,6 @@ public class XhpcHistoryOrderController extends BaseController {
|
|||||||
private IXhpcChargeOrderService chargeOrderService;
|
private IXhpcChargeOrderService chargeOrderService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserTypeService userTypeService;
|
private UserTypeService userTypeService;
|
||||||
@Autowired
|
|
||||||
private RefundOrderService refundOrderService;
|
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(XhpcHistoryOrderController.class);
|
private static final Logger logger = LoggerFactory.getLogger(XhpcHistoryOrderController.class);
|
||||||
|
|
||||||
|
|||||||
@ -135,7 +135,12 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar
|
|||||||
logger.info("<<<<<<<<<<<<<<<<<<<<<<<桩号>>>>>>>>>>>>>>>>>"+terminalSerialNumber);
|
logger.info("<<<<<<<<<<<<<<<<<<<<<<<桩号>>>>>>>>>>>>>>>>>"+terminalSerialNumber);
|
||||||
String openId = loginUser.getOpenId();
|
String openId = loginUser.getOpenId();
|
||||||
String tenantId = loginUser.getTenantId();
|
String tenantId = loginUser.getTenantId();
|
||||||
|
long l1 = System.currentTimeMillis();
|
||||||
|
logger.info("<<<<<<<"+terminalSerialNumber+"开始启动充电获取用户时间>>>>>:"+l1);
|
||||||
R user = userTypeService.getUser(null, userid, userType, terminalSerialNumber,loginUser.getTenantId());
|
R user = userTypeService.getUser(null, userid, userType, terminalSerialNumber,loginUser.getTenantId());
|
||||||
|
long l2 = System.currentTimeMillis();
|
||||||
|
logger.info("<<<<<<<"+terminalSerialNumber+"结束启动充电获取用户时间>>>>>:"+l2);
|
||||||
|
logger.info("<<<<<<<"+terminalSerialNumber+"启动充电时间差>>>>>:"+(l2-l1));
|
||||||
if (!userid.equals(userId) || user == null || user.getData() == null) {
|
if (!userid.equals(userId) || user == null || user.getData() == null) {
|
||||||
return AjaxResult.error(UserTypeUtil.LOGIN_TYPE, "请重新登录");
|
return AjaxResult.error(UserTypeUtil.LOGIN_TYPE, "请重新登录");
|
||||||
}
|
}
|
||||||
@ -566,7 +571,7 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar
|
|||||||
|
|
||||||
}
|
}
|
||||||
startChargingData.setSoc(number);
|
startChargingData.setSoc(number);
|
||||||
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<number>>>>>>>>>>>>>>>>>:" + soc);
|
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<number>>>>>>>>>>>>>>>>>:" + number);
|
||||||
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<Soc>>>>>>>>>>>>>>>>>:" + startChargingData.getSoc());
|
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<Soc>>>>>>>>>>>>>>>>>:" + startChargingData.getSoc());
|
||||||
String startTime = DateUtil.format(date, "yyyy-MM-dd HH: mm: ss");
|
String startTime = DateUtil.format(date, "yyyy-MM-dd HH: mm: ss");
|
||||||
Map<String, Object> extraData1 = xhpcChargeOrderMapper.selectDate3rdNeedBy(connectorId).get(0);
|
Map<String, Object> extraData1 = xhpcChargeOrderMapper.selectDate3rdNeedBy(connectorId).get(0);
|
||||||
|
|||||||
@ -672,32 +672,20 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
|
|||||||
try{
|
try{
|
||||||
logger.info("<<<<<<<<<<<<<<<<进行入短信发送>>>>>>>>>>>>>>>>>");
|
logger.info("<<<<<<<<<<<<<<<<进行入短信发送>>>>>>>>>>>>>>>>>");
|
||||||
if(!UserTypeUtil.INTERNET_TYPE.equals(source)){
|
if(!UserTypeUtil.INTERNET_TYPE.equals(source)){
|
||||||
R<Map<String, Object>> user = userTypeService.getUser(null, userId, source, null, xhpcChargeOrder.getTenantId());
|
if(userMessage !=null && userMessage.get("phone") != null){
|
||||||
if(user !=null && user.getData() !=null){
|
if("1".equals(xhpcChargingPile.get("type").toString())){
|
||||||
logger.info("<<<<<<<<<<<<<<<<进行入短信发送1111>>>>>>>>>>>>>>>>>");
|
HashMap<String, String> paramMap = new HashMap<>();
|
||||||
Map<String, Object> userMessage = (Map<String, Object>)user.getData();
|
paramMap.put("elec", xhpcChargeOrder.getEndSoc());
|
||||||
if (userMessage != null && userMessage.get("phone") != null) {
|
paramMap.put("sumMoney", balance.toString());
|
||||||
logger.info("<<<<<<<<<<<<<<<<进行入短信发送222>>>>>>>>>>>>>>>>>");
|
paramMap.put("phone", userMessage.get("phone").toString());
|
||||||
// HashMap<String, String> paramMap = new HashMap<>();
|
paramMap.put("content", "【小华停止充电】尊敬的用户,你的爱车已停止充电,电量为:" + xhpcChargeOrder.getEndSoc() + "%,总费用为:" + balance + "元,充电费用明细,请查询小华充电小程序,谢谢。");
|
||||||
// paramMap.put("elec", xhpcChargeOrder.getEndSoc());
|
smsService.sendNotice(paramMap);
|
||||||
// paramMap.put("sumMoney", balance.toString());
|
}else {
|
||||||
// paramMap.put("phone", userMessage.get("phone").toString());
|
HashMap<String, String> paramMap = new HashMap<>();
|
||||||
// paramMap.put("content", "【小华停止充电】尊敬的用户,你的爱车已停止充电,电量为:" + xhpcChargeOrder.getEndSoc() + "%,总费用为:" + balance + "元,充电费用明细,请查询小华充电小程序,谢谢。");
|
paramMap.put("sumMoney", balance.toString());
|
||||||
// smsService.sendNotice(paramMap);
|
paramMap.put("phone", userMessage.get("phone").toString());
|
||||||
if("1".equals(xhpcChargingPile.get("type").toString())){
|
paramMap.put("content", "【小华停止充电】尊敬的用户,你的爱车已停止充电,总费用为:" + balance.toString() + "元,充电费用明细,请查询小华充电小程序,谢谢。");
|
||||||
HashMap<String, String> paramMap = new HashMap<>();
|
smsService.sendNotice(paramMap);
|
||||||
paramMap.put("elec", xhpcChargeOrder.getEndSoc());
|
|
||||||
paramMap.put("sumMoney", balance.toString());
|
|
||||||
paramMap.put("phone", userMessage.get("phone").toString());
|
|
||||||
paramMap.put("content", "【小华停止充电】尊敬的用户,你的爱车已停止充电,电量为:" + xhpcChargeOrder.getEndSoc() + "%,总费用为:" + balance + "元,充电费用明细,请查询小华充电小程序,谢谢。");
|
|
||||||
smsService.sendNotice(paramMap);
|
|
||||||
}else {
|
|
||||||
HashMap<String, String> paramMap = new HashMap<>();
|
|
||||||
paramMap.put("sumMoney", balance.toString());
|
|
||||||
paramMap.put("phone", userMessage.get("phone").toString());
|
|
||||||
paramMap.put("content", "【小华停止充电】尊敬的用户,你的爱车已停止充电,总费用为:" + balance.toString() + "元,充电费用明细,请查询小华充电小程序,谢谢。");
|
|
||||||
smsService.sendNotice(paramMap);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -723,7 +711,7 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
logger.info("<<<<<<<<<<<<<<<<运行异常,结算失败,数据回滚>>>>>>>>>>>>>>>>>");
|
logger.info("<<<<<<<<<<<<<<<<运行异常,结算失败,数据回滚>>>>>>>>>>>>>>>>>"+xhpcChargeOrder.getSerialNumber());
|
||||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
return R.fail();
|
return R.fail();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user