diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderController.java index bc6d189b..6f64f066 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderController.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderController.java @@ -429,7 +429,7 @@ public class XhpcHistoryOrderController extends BaseController { Long historyOrderId = xhpc.getHistoryOrderId(); int count = xhpcStatisticsService.getStatisticsTimeHistoryOrderId(historyOrderId); if(count>0){ - XhpcHistoryOrder historyOrder = xhpcHistoryOrderService.getHistoryOrderById(historyOrderId); + XhpcHistoryOrder historyOrder = xhpcHistoryOrderService.getHistoryOrderById(historyOrderId,null); if(historyOrder.getState()==0){ xhpcHistoryOrderService.updateXhpcHistoryOrder(historyOrderId,1); } diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcHistoryOrderMapper.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcHistoryOrderMapper.java index 1c737d28..4ccda87c 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcHistoryOrderMapper.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcHistoryOrderMapper.java @@ -102,7 +102,7 @@ public interface XhpcHistoryOrderMapper { */ List getStatistisList(@Param("number")int number,@Param("state")int state); - XhpcHistoryOrder getHistoryOrderById(@Param("historyOrderId")Long historyOrderId); + XhpcHistoryOrder getHistoryOrderById(@Param("historyOrderId")Long historyOrderId,@Param("serialNumber")String serialNumber); /** * 更新历史订单 * diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcHistoryOrderService.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcHistoryOrderService.java index 917a0705..e36afbf9 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcHistoryOrderService.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcHistoryOrderService.java @@ -74,7 +74,7 @@ public interface IXhpcHistoryOrderService { AjaxResult getById(Long historyOrderId); - XhpcHistoryOrder getHistoryOrderById(Long historyOrderId); + XhpcHistoryOrder getHistoryOrderById(Long historyOrderId,String serialNumber); /** * 获取费率时段 diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderServiceImpl.java index b7cea1eb..0d02f256 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderServiceImpl.java @@ -381,8 +381,8 @@ public class XhpcHistoryOrderServiceImpl extends BaseService implements IXhpcHis } @Override - public XhpcHistoryOrder getHistoryOrderById(Long historyOrderId) { - return xhpcHistoryOrderMapper.getHistoryOrderById(historyOrderId); + public XhpcHistoryOrder getHistoryOrderById(Long historyOrderId,String serialNumber) { + return xhpcHistoryOrderMapper.getHistoryOrderById(historyOrderId,serialNumber); } @Override diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java index 7602436b..22cec6eb 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java @@ -330,7 +330,14 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe @Override @Transactional public AjaxResult getExamine(Long chargingOrderId, BigDecimal powerPrice, BigDecimal servicePrice) { - + XhpcChargeOrder xhpcChargeOrder = xhpcChargeOrderService.getChargingOrderId(chargingOrderId); + //查询是否已存在结算信息 + XhpcHistoryOrder historyOrderById = xhpcHistoryOrderService.getHistoryOrderById(null, xhpcChargeOrder.getSerialNumber()); + if(historyOrderById !=null){ + xhpcChargeOrder.setStatus(3); + xhpcChargeOrderService.updateXhpcChargeOrder(xhpcChargeOrder); + return AjaxResult.success(); + } //总金额 BigDecimal money = powerPrice.add(servicePrice); //总服务费 servicePrice @@ -340,7 +347,7 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe //剩余的服务费 BigDecimal surplusServicePrice = servicePrice; - XhpcChargeOrder xhpcChargeOrder = xhpcChargeOrderService.getChargingOrderId(chargingOrderId); + if(xhpcChargeOrder.getStatus()==1 || xhpcChargeOrder.getStatus()==3){ return AjaxResult.error("订单已结算,请联系技术人员解决"); } @@ -552,7 +559,7 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe for (int j = 0; j < activityFormulaTime2.size(); j++) { //计费类型 int computeType = activityInternet1.getComputeType(); - XhpcActivityFormulaDomainDto activityFormula = activityFormulaTime1.get(j); + XhpcActivityFormulaDomainDto activityFormula = activityFormulaTime2.get(j); BigDecimal activityServicePriceFormula = activityFormula.getServicePrice(); BigDecimal activityPowerPriceFormula = activityFormula.getPowerPrice(); //计算公式 diff --git a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcHistoryOrderMapper.xml b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcHistoryOrderMapper.xml index 30b7b612..657f8b23 100644 --- a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcHistoryOrderMapper.xml +++ b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcHistoryOrderMapper.xml @@ -1116,6 +1116,13 @@ diff --git a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml index 961c8c41..32248ea7 100644 --- a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml +++ b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml @@ -440,14 +440,14 @@ select xt.tenant_id as tenantId, xt.tenant_name as tenantName - from xhpc_charging_station as xcs - join xhpc_tenant as xt on xt.tenant_id = xcs.tenant_id + from xhpc_operator as xo + join xhpc_tenant as xt on xt.tenant_id = xo.tenant_id where 1=1 - and operator_id=#{userId} + and xo.operator_id=#{userId} - and charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{userId}) + and xo.operator_id in (select operator_id from xhpc_charging_station where charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{userId})) group by xt.tenant_id diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcAppUserServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcAppUserServiceImpl.java index 2e1a67d2..c6bdd354 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcAppUserServiceImpl.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcAppUserServiceImpl.java @@ -450,19 +450,18 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU @Override public AjaxResult appInfo(HttpServletRequest request) { try{ - LoginUser loginUser = logUserUtils.getLogUser(request); + LoginUser loginUser = tokenService.getLoginUser(); String tenantId = loginUser.getTenantId(); Object version = redisService.getCacheObject("global:"+tenantId+":version"); Object servicePhone = redisService.getCacheObject("global:"+tenantId+":phone"); //根据不同的用户类型查询不同的信息 Long userid = loginUser.getUserid(); Integer userType = loginUser.getUserType(); - R user = xhpcCommonController.getMechanism(null, loginUser.getUserid(), loginUser.getUserType(), null, tenantId); if(user !=null && user.getData() !=null){ Map map = (Map)user.getData(); //发票、留言板、版本、客服电话 - Integer invoice =null; + Long invoice =null; String globalInvoice="global:invoice:"+ tenantId +":"; if(UserTypeUtil.USER_TYPE.equals(userType)){ invoice = redisService.getCacheObject(globalInvoice + UserTypeUtil.USER + userid); @@ -504,6 +503,7 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU return AjaxResult.error("请重新登录",HttpStatus.USER_LOGIN); } }catch (Exception e){ + e.printStackTrace(); return AjaxResult.error("请重新登录",HttpStatus.USER_LOGIN); } }