修改充电订单叠加备注,增加小程序用户详情留言板信息提示

This commit is contained in:
yuyang 2022-01-18 16:58:12 +08:00
parent d465d9ca31
commit 604e019955
8 changed files with 65 additions and 16 deletions

View File

@ -260,7 +260,7 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
public InvoicedOrderResponse findUserHistoryOrders(InvoicedOrdersRequest invoicedOrdersRequest) {
//自动生成当前时间
if (invoicedOrdersRequest.getCurrentTime() == null) {
if (invoicedOrdersRequest.getCurrentTime() == null || "".equals(invoicedOrdersRequest.getCurrentTime())) {
Date currentDate = new Date();
String strTime = DateUtils.parseDateToStr(currentDate);
invoicedOrdersRequest.setCurrentTime(strTime);

View File

@ -383,7 +383,7 @@ public class XhpcPileOrderController extends BaseController {
//订单异常
xhpcChargeOrder.setStatus(2);
//异常原因
xhpcChargeOrder.setErroRemark("桩异常:" + stopReason + ">>>>用户id:" + userId + "为空");
xhpcChargeOrder.setErroRemark("".equals(xhpcChargeOrder.getErroRemark())?"桩异常:" + stopReason + ">>>>用户id:" + userId + "为空":xhpcChargeOrder.getErroRemark()+"桩异常:" + stopReason + ">>>>用户id:" + userId + "为空");
xhpcChargeOrderService.updateXhpcChargeOrder(xhpcChargeOrder);
R.ok();
}

View File

@ -888,6 +888,30 @@ public class XhpcHistoryOrderController extends BaseController {
}
}
@GetMapping("/getManualAudit")
public void getManualAudit(Long chargeOrderId){
//获取异常的订单 24小时之外的异常订单
XhpcChargeOrder xhpcChargeOrder = chargeOrderService.getChargingOrderId(chargeOrderId);
if(xhpcChargeOrder !=null){
Integer source = xhpcChargeOrder.getSource();
String tenantId = xhpcChargeOrder.getTenantId();
xhpcChargeOrder.getChargeOrderId();
if(!UserTypeUtil.INTERNET_TYPE.equals(source)){
R user = userTypeService.getUser(null, xhpcChargeOrder.getUserId(), source, null, tenantId);
if(user !=null && user.getData() !=null){
Map<String, Object> userMessage = (Map<String, Object>)user.getData();
if (userMessage != null && userMessage.get("balance") != null) {
xhpcHistoryOrderService.addXhpcChargeOrder(userMessage,xhpcChargeOrder.getSerialNumber(),2);
}
}
}else{
xhpcHistoryOrderService.addXhpcChargeOrder(null,xhpcChargeOrder.getSerialNumber(),2);
}
}
}
/**
* 标记异常大于创建4小时标记为异常
* @param

View File

@ -600,19 +600,24 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar
List<XhpcChargeOrder> list = xhpcChargeOrderMapper.getFourTimsStatus();
if(list !=null && list.size()>0){
for (XhpcChargeOrder xhpcChargeOrder:list) {
CacheRealtimeData cacheRealtimeData = redisService.getCacheObject("order:" + xhpcChargeOrder.getSerialNumber() + ".lord");
Long chargeOrderId = xhpcChargeOrder.getChargeOrderId();
if(cacheRealtimeData ==null){
int count = xhpcChargeOrderMapper.getSerialNumberLike(xhpcChargeOrder.getSerialNumber().substring(0, 16), chargeOrderId);
if(count>0){
//有充电改为 由充电中变为启动充电中
xhpcChargeOrderMapper.updateStatus(-1,chargeOrderId);
if(UserTypeUtil.INTERNET_TYPE.equals(xhpcChargeOrder.getSource())){
//标记异常
xhpcChargeOrderMapper.updateStatus(2,chargeOrderId);
}else{
CacheRealtimeData cacheRealtimeData = redisService.getCacheObject("order:" + xhpcChargeOrder.getSerialNumber() + ".lord");
if(cacheRealtimeData ==null){
int count = xhpcChargeOrderMapper.getSerialNumberLike(xhpcChargeOrder.getSerialNumber().substring(0, 16), chargeOrderId);
if(count>0){
//有充电改为 由充电中变为启动充电中
xhpcChargeOrderMapper.updateStatus(-1,chargeOrderId);
}else{
//标记异常
xhpcChargeOrderMapper.updateStatus(2,chargeOrderId);
}
}else{
//标记异常
xhpcChargeOrderMapper.updateStatus(2,chargeOrderId);
}
}else{
xhpcChargeOrderMapper.updateStatus(2,chargeOrderId);
}
}
}

View File

@ -160,6 +160,7 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
//获取该订单最后一条实时数据
Map<String, Object> cacheMap = redisService.getCacheMap("order:" + chargeOrder.getSerialNumber());
List<CacheRealtimeData> list = (List<CacheRealtimeData>) cacheMap.get("realtimeDataList");
CacheRealtimeData startData =new CacheRealtimeData();
CacheRealtimeData endData =new CacheRealtimeData();
@ -175,7 +176,7 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
Long rateModelId = chargeOrder.getRateModelId();
if(endData !=null && endData.getAmountCharged() !=null){
if(endData !=null && endData.getAmountCharged() !=null && startData.getChargingTime()>0){
message.put("soc",endData.getSoc());
//最后一祯时间
@ -220,6 +221,12 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
chargeOrder.setChargingTime(endRealTimeOrder.getChargingTime());
message.put("chargingTime",endRealTimeOrder.getChargingTime());
if(chargeOrder.getStartTime().equals(chargeOrder.getEndTime())){
message.put("powerPriceTotal",0);
message.put("servicePriceTotal",0);
return AjaxResult.success(message);
}
chargeOrder.setStartTime(startTime);
chargeOrder.setEndTime(endTime);
chargeOrder.setStartSoc(startRealTimeOrder.getSoc());
@ -233,6 +240,7 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
chargeOrder.setChargingDegree(chargingDegree);
chargeOrder.setType(0);
chargeOrder.setAmountCharged(endRealTimeOrder.getAmountCharged());
}
Date startTime2 = chargeOrder.getStartTime();
@ -307,7 +315,7 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
//订单异常
xhpcChargeOrder.setStatus(2);
//异常原因
xhpcChargeOrder.setErroRemark("用户id:" + userId + "为空");
xhpcChargeOrder.setErroRemark("".equals(xhpcChargeOrder.getErroRemark())?"用户id:" + userId + "为空":xhpcChargeOrder.getErroRemark()+"用户id:" + userId + "为空");
xhpcChargeOrderService.updateXhpcChargeOrder(xhpcChargeOrder);
return AjaxResult.error("用户id:" + userId + "为空");
}

View File

@ -644,7 +644,7 @@
from xhpc_terminal as xt
left join xhpc_charging_pile as xcp on xcp.serial_number = substring(#{serialNumber}, 1, 14)
left join xhpc_charging_station as cs on xt.charging_station_id = cs.charging_station_id
where xt.serial_number = #{serialNumber}
where xt.serial_number = #{serialNumber} and xt.del_falg = 0
</select>
<select id="select3rdNameBy" resultType="map">

View File

@ -671,6 +671,8 @@
when ho.charging_mode="2" then "恒大"
when ho.charging_mode="3" then "新电途"
when ho.charging_mode="4" then "小桔"
when ho.charging_mode="微信" then "微信"
when ho.charging_mode="支付宝" then "支付宝"
else "C端客户"
end chargingModeName
from xhpc_history_order as ho

View File

@ -421,7 +421,7 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU
if(user !=null && user.getData() !=null){
Map<String, Object> map = (Map<String, Object>)user.getData();
//发票留言板版本客服电话
Object invoice =null;
String invoice =null;
if(UserTypeUtil.USER_TYPE.equals(userType)){
invoice = redisService.getCacheObject("global:invoice:" + UserTypeUtil.USER + userid);
}else if(UserTypeUtil.INTERNET_TYPE.equals(userType)){
@ -436,7 +436,17 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU
}else{
map.put("invoiceNumber",invoice);
}
map.put("guestbook","0");
String guestbook =null;
if(UserTypeUtil.USER_TYPE.equals(userType)){
guestbook = redisService.getCacheObject("userNotReadMessageCount:" + UserTypeUtil.USER +":"+map.get("phone").toString()+":0:"+ loginUser.getTenantId());
}else if(UserTypeUtil.INTERNET_TYPE.equals(userType)){
guestbook = redisService.getCacheObject("userNotReadMessageCount:" + UserTypeUtil.INTERNET +":"+map.get("phone").toString()+":0:"+ loginUser.getTenantId());
}else if(UserTypeUtil.COMMUNIT_TYPE.equals(userType)){
guestbook = redisService.getCacheObject("userNotReadMessageCount:" + UserTypeUtil.COMMUNIT +":"+map.get("account").toString()+":0:"+ loginUser.getTenantId());
}else{
guestbook = redisService.getCacheObject("userNotReadMessageCount:" + UserTypeUtil.CUSTOMERS +":"+map.get("account").toString()+":0:"+ loginUser.getTenantId());
}
map.put("guestbook",guestbook);
map.put("version",version);
map.put("servicePhone",servicePhone);
map.put("activity",1);