From 6352c0186a89c4b8500f761bebc7ed9582869ca4 Mon Sep 17 00:00:00 2001 From: yuyang Date: Tue, 11 Jan 2022 16:40:12 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E9=80=80=E6=AC=BE=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AE=8C=E6=88=90=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=9C=BA=E6=9E=84?= =?UTF-8?q?=E5=BF=85=E5=A1=AB=E9=A1=B9=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=B0=8F?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E7=94=B5=E6=B1=A0=E4=BF=9D=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xhpc/common/api/UserTypeService.java | 6 +- .../com/xhpc/common/util/UserTypeUtil.java | 8 + .../order/mapper/XhpcChargeOrderMapper.java | 4 +- .../impl/XhpcChargeOrderServiceImpl.java | 7 +- .../src/main/resources/bootstrap.yml | 3 - .../mapper/XhpcChargeOrderMapper.xml | 34 ++- .../mapper/XhpcHistoryOrderMapper.xml | 4 +- .../controller/AlipayPaymentController.java | 4 +- .../controller/WxPaymentController.java | 5 + .../XhpcRechargeOrderController.java | 4 +- .../controller/XhpcRefundAuditController.java | 286 ++++++++++++------ .../controller/XhpcRefundOrderController.java | 26 +- .../payment/domain/XhpcSettingConfig.java | 2 +- .../mapper/XhpcRechargeOrderMapper.java | 2 +- .../payment/mapper/XhpcRefundAuditMapper.java | 7 + .../payment/mapper/XhpcRefundOrderMapper.java | 16 +- .../service/IXhpcRechargeOrderService.java | 2 +- .../service/IXhpcRefundAuditService.java | 6 + .../service/IXhpcRefundOrderService.java | 7 +- .../impl/XhpcRechargeOrderServiceImpl.java | 4 +- .../impl/XhpcRefundAuditServiceImpl.java | 11 + .../impl/XhpcRefundOrderServiceImpl.java | 41 ++- .../XhpcUserAccountStatementServiceImpl.java | 4 +- .../mapper/XhpcRechargeOrderMapper.xml | 8 +- .../mapper/XhpcRefundAuditMapper.xml | 34 +++ .../mapper/XhpcRefundOrderMapper.xml | 36 ++- .../mapper/XhpcUserAccountStatementMapper.xml | 10 +- .../controller/XhpcAppUserController.java | 5 +- .../xhpc/user/mapper/XhpcAppUserMapper.java | 3 +- .../user/service/IXhpcAppUserUserService.java | 2 +- .../service/impl/XhpcAppUserServiceImpl.java | 42 +-- .../impl/XhpcCommunityServiceImpl.java | 51 ++++ .../impl/XhpcCustomersServiceImpl.java | 58 +++- .../main/resources/mapper/MechanismMapper.xml | 2 +- .../resources/mapper/XhpcAppUserMapper.xml | 9 +- .../resources/mapper/XhpcCommonMapper.xml | 9 +- .../resources/mapper/XhpcCommunityMapper.xml | 2 + 37 files changed, 576 insertions(+), 188 deletions(-) diff --git a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/UserTypeService.java b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/UserTypeService.java index 4508fe61..0597c235 100644 --- a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/UserTypeService.java +++ b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/UserTypeService.java @@ -27,9 +27,9 @@ public interface UserTypeService { /** - * 根据用户类型,用户id,充值记录,增加流水 - * @param money 充值金额 - * @param userId 充值用户 + * 根据用户类型,用户id,充值退款记录,增加流水 + * @param money 充值退款金额 + * @param userId 充值退款用户 * @param userType 用户类型 * @param tenantId 租户id * @param type 充值渠道(1微信 2支付宝 3平台) diff --git a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/UserTypeUtil.java b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/UserTypeUtil.java index da87eb51..f213967b 100644 --- a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/UserTypeUtil.java +++ b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/UserTypeUtil.java @@ -72,5 +72,13 @@ public class UserTypeUtil { */ public static final Integer RECHARGE_STATUS_TWO = 2; + /** + * 退款订单审核-无 + */ + public static final Integer REFUND_APPLICATION_ZERO = 0; + /** + * 退款订单审核-有 + */ + public static final Integer REFUND_APPLICATION_ONE = 1; } diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcChargeOrderMapper.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcChargeOrderMapper.java index c106d027..f682d2e6 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcChargeOrderMapper.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcChargeOrderMapper.java @@ -54,12 +54,12 @@ public interface XhpcChargeOrderMapper { /** * 判断用户是否在充电中 */ - String countXhpcRealTimeOrder(@Param("userId")Long userId); + String countXhpcRealTimeOrder(@Param("userId")Long userId,@Param("source")Integer source,@Param("tenantId")String tenantId); /** * 判断用户是否有异常订单未处理 */ - int countXhpcChargeOrder(@Param("userId")Long userId); + int countXhpcChargeOrder(@Param("userId")Long userId,@Param("source")Integer source,@Param("tenantId")String tenantId); /** * 获取终端信息 diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java index e6ca05bb..0438ae16 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java @@ -124,7 +124,7 @@ public class XhpcChargeOrderServiceImpl implements IXhpcChargeOrderService { return AjaxResult.error(1100, "金额小于5元,不能充电,请充值后再进行充电"); } //充电用户是否存在异常的订单 - int j = xhpcChargeOrderMapper.countXhpcChargeOrder(userId); + int j = xhpcChargeOrderMapper.countXhpcChargeOrder(userId,userType,tenantId); if (j > 0) { return AjaxResult.error(1103, "你有异常订单未解决,请拨打客服电话进行解决"); } @@ -133,7 +133,7 @@ public class XhpcChargeOrderServiceImpl implements IXhpcChargeOrderService { return AjaxResult.error(1101, "你有申请退款订单在审核中,需要充电请取消申请退款"); } //充电用户是否在充电中 - String i = xhpcChargeOrderMapper.countXhpcRealTimeOrder(userId); + String i = xhpcChargeOrderMapper.countXhpcRealTimeOrder(userId,userType,tenantId); if (!"".equals(i) && i!=null) { return AjaxResult.error(1102, "车辆正在充电,请查询车辆充电信息"); } @@ -246,8 +246,9 @@ public class XhpcChargeOrderServiceImpl implements IXhpcChargeOrderService { xhpcChargeOrder.setTerminalId(xhpcTerminal.getTerminalId()); xhpcChargeOrder.setGunId(xhpcTerminal.getSerialNumber()); xhpcChargeOrder.setSerialNumber(orderNo); - xhpcChargeOrder.setSource(0); + xhpcChargeOrder.setSource(userType); xhpcChargeOrder.setStatus(-1); + xhpcChargeOrder.setTenantId(tenantId); if (xhpcChargingPileById != null && xhpcChargingPileById.get("power") != null) { xhpcChargeOrder.setPower(xhpcChargingPileById.get("power").toString()); } diff --git a/xhpc-modules/xhpc-order/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-order/src/main/resources/bootstrap.yml index 5571b791..ea99137c 100644 --- a/xhpc-modules/xhpc-order/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-order/src/main/resources/bootstrap.yml @@ -23,6 +23,3 @@ spring: # 共享配置 shared-configs: - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} -logging: - level: - com.xhpc.order.mapper: debug \ No newline at end of file diff --git a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcChargeOrderMapper.xml b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcChargeOrderMapper.xml index 7d3ef5a2..ece34bd9 100644 --- a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcChargeOrderMapper.xml +++ b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcChargeOrderMapper.xml @@ -128,11 +128,31 @@ update xhpc_app_user set balance=#{balance} where app_user_id=#{userId} @@ -230,6 +230,12 @@ AND xro.type = #{type} + + AND xro.source = #{source} + + + and xro.user_id=#{userId} + ORDER BY xro.create_time DESC diff --git a/xhpc-modules/xhpc-payment/src/main/resources/mapper/XhpcRefundAuditMapper.xml b/xhpc-modules/xhpc-payment/src/main/resources/mapper/XhpcRefundAuditMapper.xml index 0b78d504..b747274e 100644 --- a/xhpc-modules/xhpc-payment/src/main/resources/mapper/XhpcRefundAuditMapper.xml +++ b/xhpc-modules/xhpc-payment/src/main/resources/mapper/XhpcRefundAuditMapper.xml @@ -90,4 +90,38 @@ ORDER BY xra.create_time DESC + + + + UPDATE xhpc_community_personnel + + surplus_money = #{surplusMoney}, + is_refund_application = #{isRefundApplication}, + + WHERE community_personnel_id = #{communityPersonnelId} + + + \ No newline at end of file diff --git a/xhpc-modules/xhpc-payment/src/main/resources/mapper/XhpcRefundOrderMapper.xml b/xhpc-modules/xhpc-payment/src/main/resources/mapper/XhpcRefundOrderMapper.xml index 99a16e8e..d3d5154b 100644 --- a/xhpc-modules/xhpc-payment/src/main/resources/mapper/XhpcRefundOrderMapper.xml +++ b/xhpc-modules/xhpc-payment/src/main/resources/mapper/XhpcRefundOrderMapper.xml @@ -171,7 +171,7 @@ @@ -302,11 +308,31 @@ + + + UPDATE xhpc_community_personnel set is_refund_application=#{isRefundApplication} where community_personnel_id=#{userId} + \ No newline at end of file diff --git a/xhpc-modules/xhpc-payment/src/main/resources/mapper/XhpcUserAccountStatementMapper.xml b/xhpc-modules/xhpc-payment/src/main/resources/mapper/XhpcUserAccountStatementMapper.xml index ce2dd28a..0f020fd3 100644 --- a/xhpc-modules/xhpc-payment/src/main/resources/mapper/XhpcUserAccountStatementMapper.xml +++ b/xhpc-modules/xhpc-payment/src/main/resources/mapper/XhpcUserAccountStatementMapper.xml @@ -69,7 +69,10 @@ remark, - source + source, + + + tenant_id @@ -116,7 +119,10 @@ #{remark}, - #{source} + #{source}, + + + #{tenantId}, diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcAppUserController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcAppUserController.java index 146449dc..d8999905 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcAppUserController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcAppUserController.java @@ -286,8 +286,8 @@ public class XhpcAppUserController extends BaseController { */ @ApiOperation("注销账号") @PostMapping("/logout") - public R logout(String phone, String code) { - return iXhpcAppUserUserService.logout(phone, code); + public R logout(HttpServletRequest request,String phone, String code) { + return iXhpcAppUserUserService.logout(request,phone, code); } @@ -315,7 +315,6 @@ public class XhpcAppUserController extends BaseController { @PostMapping("/batteryProtect") public R batteryProtect(HttpServletRequest request,@RequestBody Map map) { if(map !=null){ - Integer soc = Integer.parseInt(map.get("soc").toString()); Integer socProtect = Integer.parseInt(map.get("socProtect").toString()); Integer userType = Integer.parseInt(map.get("userType").toString()); diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcAppUserMapper.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcAppUserMapper.java index 6d28be21..3e5085af 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcAppUserMapper.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcAppUserMapper.java @@ -3,6 +3,7 @@ package com.xhpc.user.mapper; import com.xhpc.user.domain.XhpcAppUser; import org.apache.ibatis.annotations.Param; +import java.util.Date; import java.util.List; import java.util.Map; @@ -81,7 +82,7 @@ public interface XhpcAppUserMapper { /** * 记录登录用户的最后一次数据 */ - int addUserLoginTime(@Param("appUserId")Long appUserId, @Param("account")String account, @Param("userType")Integer userType, @Param("openId")String openId,@Param("type")Integer type,@Param("status")Integer status,@Param("tenantId")String tenantId); + int addUserLoginTime(@Param("appUserId")Long appUserId, @Param("account")String account, @Param("userType")Integer userType, @Param("openId")String openId, @Param("type")Integer type, @Param("status")Integer status, @Param("tenantId")String tenantId, @Param("createTime") Date createTime); /** * 修改社区用户信息 diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcAppUserUserService.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcAppUserUserService.java index 42812998..32c75c39 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcAppUserUserService.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcAppUserUserService.java @@ -97,7 +97,7 @@ public interface IXhpcAppUserUserService { * @param code * @return */ - public R logout(String phone, String code); + public R logout(HttpServletRequest request,String phone, String code); /** * 设置小程序用户自动退款功能 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 d527c3c7..09124672 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 @@ -162,7 +162,7 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService { } } //添加最后一次登录数据 - xhpcAppUserMapper.addUserLoginTime(info.getAppUserId(),info.getPhone(),UserTypeUtil.USER_TYPE,openid,Integer.valueOf(type),null,tenantId); + xhpcAppUserMapper.addUserLoginTime(info.getAppUserId(),info.getPhone(),UserTypeUtil.USER_TYPE,openid,Integer.valueOf(type),null,tenantId,new Date()); return R.fail(HttpStatus.ALREADY_EXISTING, "账号已存在"); } XhpcAppUser xhpcAppUser = new XhpcAppUser(); @@ -259,7 +259,7 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService { } } //添加最后一次登录数据 - xhpcAppUserMapper.addUserLoginTime(appUserId,username,userInfo.getUserType(),openid,Integer.valueOf(type),null,tenantId); + xhpcAppUserMapper.addUserLoginTime(appUserId,username,userInfo.getUserType(),openid,Integer.valueOf(type),null,tenantId,new Date()); redisService.deleteObject("pvToken:" + username); // 获取登录token @@ -323,7 +323,7 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService { redisService.deleteObject("pvToken:" + user.getPhone()); //添加最后一次登录数据 - xhpcAppUserMapper.addUserLoginTime(user.getAppUserId(),username,userInfo.getUserType(),openid,Integer.valueOf(type),UserConstants.LOGIN,tenantId); + xhpcAppUserMapper.addUserLoginTime(user.getAppUserId(),username,userInfo.getUserType(),openid,Integer.valueOf(type),UserConstants.LOGIN,tenantId,new Date()); // 获取登录token return R.ok(tokenService.createToken(userInfo)); } @@ -356,7 +356,7 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService { } xhpcAppUserMapper.update(appUser); //添加最后一次登录数据 - xhpcAppUserMapper.addUserLoginTime(appUser.getAppUserId(),username,userType,openId,Integer.valueOf(type),UserConstants.NO_LOGIN,tenantId); + xhpcAppUserMapper.addUserLoginTime(appUser.getAppUserId(),username,userType,openId,Integer.valueOf(type),UserConstants.NO_LOGIN,tenantId,new Date()); } }else if(UserTypeUtil.COMMUNIT_TYPE.equals(userType)){ if (StatusConstants.OPERATION_WX_TYPE.equals(type)) { @@ -365,7 +365,7 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService { xhpcAppUserMapper.updateCommunityPersonnel(userid,null,null,null,UserConstants.NO_LOGIN); } //添加最后一次登录数据 - xhpcAppUserMapper.addUserLoginTime(userid,username,userType,openId,Integer.valueOf(type),UserConstants.NO_LOGIN,tenantId); + xhpcAppUserMapper.addUserLoginTime(userid,username,userType,openId,Integer.valueOf(type),UserConstants.NO_LOGIN,tenantId,new Date()); }else if(UserTypeUtil.CUSTOMERS_TYPE.equals(userType)){ if (StatusConstants.OPERATION_WX_TYPE.equals(type)) { xhpcAppUserMapper.updateCustomersPersonnel(userid,null,null,UserConstants.NO_LOGIN,null); @@ -373,7 +373,7 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService { xhpcAppUserMapper.updateCustomersPersonnel(userid,null,null,null,UserConstants.NO_LOGIN); } //添加最后一次登录数据 - xhpcAppUserMapper.addUserLoginTime(userid,username,userType,openId,Integer.valueOf(type),UserConstants.NO_LOGIN,tenantId); + xhpcAppUserMapper.addUserLoginTime(userid,username,userType,openId,Integer.valueOf(type),UserConstants.NO_LOGIN,tenantId,new Date()); } } // 删除用户缓存记录 @@ -440,10 +440,8 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService { map.put("servicePhone",servicePhone); map.put("activity",1); map.put("activitySize",1); - map.put("activityImg","https://www.scxhua.cn/static/img/logo1.8460b7f4.png"); - map.put("socSize",98); - map.put("socUser",80); - map.put("socProtect",1); + map.put("activityImg","https://xhpc-bucket1.oss-cn-hangzhou.aliyuncs.com/bunengshanchu/1.png"); + map.put("socSize",redisService.getCacheObject("global:SOC")); return AjaxResult.success(map); }else{ @@ -460,7 +458,8 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService { */ @Override @Transactional - public R logout(String phone, String code) { + public R logout(HttpServletRequest request,String phone, String code) { + if (StringUtils.isEmpty(code)) { return R.fail(HttpStatus.NOT_NULL, "验证码不能为空"); } @@ -471,11 +470,19 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService { if (!code.equalsIgnoreCase(captcha)) { return R.fail(HttpStatus.ERROR_STATUS, "验证码错误"); } - XhpcAppUser xhpcAppUser = xhpcAppUserMapper.getAppUserByPhone(phone); - if (StringUtils.isNull(xhpcAppUser)) { - return R.fail(HttpStatus.ERROR_STATUS, "用户不存在"); + LoginUser loginUser = tokenService.getLoginUser(request); + Long userid = loginUser.getUserid(); + Integer userType = loginUser.getUserType(); + String tenantId = loginUser.getTenantId(); + if(UserTypeUtil.USER_TYPE.equals(userType)){ + XhpcAppUser xhpcAppUser = xhpcAppUserMapper.getAppUserByPhone(phone); + if (StringUtils.isNull(xhpcAppUser)) { + return R.fail(HttpStatus.ERROR_STATUS, "用户不存在"); + } + xhpcAppUserMapper.deleteById(xhpcAppUser.getAppUserId()); + }else{ + return R.fail(HttpStatus.ERROR_STATUS, "用户不能注销"); } - xhpcAppUserMapper.deleteById(xhpcAppUser.getAppUserId()); redisService.deleteObject("pvToken:" + phone); return R.ok(); } @@ -507,11 +514,8 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService { @Override public R batteryProtect(HttpServletRequest request, Integer soc,Integer socProtect,Integer userType) { LoginUser loginUser = logUserUtils.getLogUser(request); - Object version = redisService.getCacheObject("global:version"); - Object servicePhone = redisService.getCacheObject("global:phone"); //根据不同的用户类型查询不同的信息 Long userid = loginUser.getUserid(); - R user = userTypeService.getUser(null, loginUser.getUserid(), loginUser.getUserType(), null,loginUser.getTenantId()); if(user !=null && user.getData() !=null){ Map map = (Map)user.getData(); @@ -525,7 +529,7 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService { }else if(UserTypeUtil.CUSTOMERS_TYPE.equals(userType)){ xhpcAppUserMapper.updateCustomersSocProtect(userid,socProtect,soc); } - return R.fail(HttpStatus.ERROR_STATUS, "设置失败"); + return R.fail(HttpStatus.SUCCESS, "设置成功"); } return R.fail(HttpStatus.ERROR_STATUS, "设置失败"); } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommunityServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommunityServiceImpl.java index a1dcd9ab..0df70871 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommunityServiceImpl.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommunityServiceImpl.java @@ -48,6 +48,10 @@ public class XhpcCommunityServiceImpl implements IXhpcCommunityService { @Override public AjaxResult addCommunity(XhpcCommunity xhpcCommunity) { + boolean judge = judgeXhpcCommunity(xhpcCommunity); + if(!judge){ + return AjaxResult.error("参数必填"); + } //名称重复不能入库 Map communityById = xhpcCommunityMapper.getCommunityById(null, xhpcCommunity.getName(), null); if(communityById !=null){ @@ -84,6 +88,11 @@ public class XhpcCommunityServiceImpl implements IXhpcCommunityService { @Override public AjaxResult updateCommunity(XhpcCommunity xhpcCommunity) { + + boolean judge = judgeXhpcCommunity(xhpcCommunity); + if(!judge){ + return AjaxResult.error("参数必填"); + } //名称重复不能入库 Map communityById = xhpcCommunityMapper.getCommunityById(xhpcCommunity.getCommunityId(), xhpcCommunity.getName(), 2); if(communityById !=null){ @@ -118,6 +127,10 @@ public class XhpcCommunityServiceImpl implements IXhpcCommunityService { @Override @Transactional public AjaxResult addCommunityPersonnel(XhpcCommunityPersonnel xhpcCommunityPersonnel) { + boolean judge = judgeXhpcCommunityPersonnel(xhpcCommunityPersonnel); + if(!judge){ + return AjaxResult.error("参数必填"); + } String phone = xhpcCommunityPersonnel.getPhone(); String account = xhpcCommunityPersonnel.getAccount(); Map communityPersonnelById = xhpcCommunityMapper.getCommunityPersonnelById(null, phone, account, 3); @@ -149,6 +162,10 @@ public class XhpcCommunityServiceImpl implements IXhpcCommunityService { @Override public AjaxResult updateCommunityPersonnel(XhpcCommunityPersonnel xhpcCommunityPersonnel) { + boolean judge = judgeXhpcCommunityPersonnel(xhpcCommunityPersonnel); + if(!judge){ + return AjaxResult.error("参数必填"); + } Long communityPersonnelId = xhpcCommunityPersonnel.getCommunityPersonnelId(); String phone = xhpcCommunityPersonnel.getPhone(); String account = xhpcCommunityPersonnel.getAccount(); @@ -217,4 +234,38 @@ public class XhpcCommunityServiceImpl implements IXhpcCommunityService { } return AjaxResult.error("充值金额必需大于0"); } + + public boolean judgeXhpcCommunity(XhpcCommunity xhpcCommunity){ + + if(xhpcCommunity.getName()==null || "".equals(xhpcCommunity.getName())){ + return false; + } + if(xhpcCommunity.getContactName()==null || "".equals(xhpcCommunity.getContactName())){ + return false; + } + if(xhpcCommunity.getContactPhone()==null || "".equals(xhpcCommunity.getContactPhone())){ + return false; + } + if(xhpcCommunity.getAddress()==null || "".equals(xhpcCommunity.getAddress())){ + return false; + } + return true; + } + + public boolean judgeXhpcCommunityPersonnel(XhpcCommunityPersonnel xhpcCommunityPersonnel){ + + if(xhpcCommunityPersonnel.getName()==null || "".equals(xhpcCommunityPersonnel.getName())){ + return false; + } + if(xhpcCommunityPersonnel.getAccount()==null || "".equals(xhpcCommunityPersonnel.getAccount()) || !"ST".equals(xhpcCommunityPersonnel.getAccount().substring(0,2))){ + return false; + } + if(xhpcCommunityPersonnel.getPhone()==null || "".equals(xhpcCommunityPersonnel.getPhone()) || xhpcCommunityPersonnel.getPhone().length()!=11){ + return false; + } + + return true; + } + + } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCustomersServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCustomersServiceImpl.java index 6e0a20c8..0a0c2e67 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCustomersServiceImpl.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCustomersServiceImpl.java @@ -5,6 +5,7 @@ import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.security.service.TokenService; import com.xhpc.common.util.UserTypeUtil; import com.xhpc.system.api.model.LoginUser; +import com.xhpc.user.domain.XhpcCommunity; import com.xhpc.user.domain.XhpcCustomers; import com.xhpc.user.domain.XhpcCustomersPersonnel; import com.xhpc.user.mapper.XhpcCustomersMapper; @@ -53,7 +54,10 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService { @Override public AjaxResult addCustomers(HttpServletRequest request, XhpcCustomers xhpcCustomers) { - + boolean b = judgeXhpcCustomers(xhpcCustomers); + if(b){ + return AjaxResult.error("参数比传"); + } //名称重复不能入库 Map communityById = xhpcCustomersMapper.getCustomersById(null, xhpcCustomers.getName(), null); if(communityById !=null){ @@ -109,6 +113,10 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService { @Override public AjaxResult updateCustomers(XhpcCustomers xhpcCustomers) { + boolean b = judgeXhpcCustomers(xhpcCustomers); + if(b){ + return AjaxResult.error("参数比传"); + } //名称重复不能入库 Map customersById = xhpcCustomersMapper.getCustomersById(xhpcCustomers.getCustomersId(), xhpcCustomers.getName(), 2); if(customersById !=null){ @@ -135,6 +143,10 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService { @Override public AjaxResult addCustomersPersonnel(XhpcCustomersPersonnel xhpcCustomersPersonnel) { + boolean b = judgeXhpcCustomersPersonnel(xhpcCustomersPersonnel); + if(b){ + return AjaxResult.error("参数比传"); + } String phone = xhpcCustomersPersonnel.getPhone(); String account = xhpcCustomersPersonnel.getAccount(); Map communityPersonnelById = xhpcCustomersMapper.getCustomersPersonnelById(null, phone, account, 3); @@ -147,9 +159,11 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService { } } BigDecimal rechargeMoney = xhpcCustomersPersonnel.getRechargeMoney(); - if(new BigDecimal(0).compareTo(rechargeMoney)==-1){ - //增加社区用户的剩余金额 - xhpcCustomersPersonnel.setSurplusMoney(rechargeMoney); + if(rechargeMoney !=null){ + if(new BigDecimal(0).compareTo(rechargeMoney)==-1){ + //增加社区用户的剩余金额 + xhpcCustomersPersonnel.setSurplusMoney(rechargeMoney); + } } xhpcCustomersMapper.addCustomersPersonnel(xhpcCustomersPersonnel); //增加一条充值记录 @@ -166,6 +180,10 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService { @Override public AjaxResult updateCustomersPersonnel(XhpcCustomersPersonnel xhpcCustomersPersonnel) { + boolean b = judgeXhpcCustomersPersonnel(xhpcCustomersPersonnel); + if(b){ + return AjaxResult.error("参数比传"); + } Long customersPersonnelId = xhpcCustomersPersonnel.getCustomersPersonnelId(); String phone = xhpcCustomersPersonnel.getPhone(); String account = xhpcCustomersPersonnel.getAccount(); @@ -231,4 +249,36 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService { public void updateCustomersPersonnelStatus(XhpcCustomersPersonnel xhpcCustomersPersonnel) { xhpcCustomersMapper.updateCustomersPersonnelStatus(xhpcCustomersPersonnel.getCustomersPersonnelId(),xhpcCustomersPersonnel.getStatus()); } + + public boolean judgeXhpcCustomers(XhpcCustomers xhpcCustomers){ + + if(xhpcCustomers.getName()==null || "".equals(xhpcCustomers.getName())){ + return false; + } + if(xhpcCustomers.getContactName()==null || "".equals(xhpcCustomers.getContactName())){ + return false; + } + if(xhpcCustomers.getContactPhone()==null || "".equals(xhpcCustomers.getContactPhone())){ + return false; + } + if(xhpcCustomers.getAddress()==null || "".equals(xhpcCustomers.getAddress())){ + return false; + } + return true; + } + + public boolean judgeXhpcCustomersPersonnel(XhpcCustomersPersonnel xhpcCustomersPersonnel){ + + if(xhpcCustomersPersonnel.getName()==null || "".equals(xhpcCustomersPersonnel.getName())){ + return false; + } + if(xhpcCustomersPersonnel.getAccount()==null || "".equals(xhpcCustomersPersonnel.getAccount()) || "BE".equals(xhpcCustomersPersonnel.getAccount().substring(0,2))){ + return false; + } + if(xhpcCustomersPersonnel.getPhone()==null || "".equals(xhpcCustomersPersonnel.getPhone()) || xhpcCustomersPersonnel.getPhone().length() !=11){ + return false; + } + return true; + } + } diff --git a/xhpc-modules/xhpc-user/src/main/resources/mapper/MechanismMapper.xml b/xhpc-modules/xhpc-user/src/main/resources/mapper/MechanismMapper.xml index fae76807..b1c3105a 100644 --- a/xhpc-modules/xhpc-user/src/main/resources/mapper/MechanismMapper.xml +++ b/xhpc-modules/xhpc-user/src/main/resources/mapper/MechanismMapper.xml @@ -296,5 +296,5 @@ #{source}, -= + diff --git a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcAppUserMapper.xml b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcAppUserMapper.xml index 77f5dadb..cd7d2321 100644 --- a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcAppUserMapper.xml +++ b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcAppUserMapper.xml @@ -277,7 +277,10 @@ status, - tenant_id + tenant_id, + + + create_time, @@ -302,6 +305,9 @@ #{tenantId}, + + #{createTime}, + @@ -338,6 +344,7 @@ and tenant_id=#{tenantId} + order by create_time desc limit 1 diff --git a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommonMapper.xml b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommonMapper.xml index c100293e..ccb3e0c2 100644 --- a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommonMapper.xml +++ b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommonMapper.xml @@ -12,7 +12,7 @@ phone as phone, is_refund_application as isRefundApplication, is_refund as isRefund, - soc as soc, + soc as socUser, balance as balance, avatar as avatar, status, @@ -24,6 +24,7 @@ concat(0) as userType, concat("C") as userTypeName, tenant_id tenantId, + soc_protect socProtect, create_time as createTime from xhpc_app_user where del_flag=0 @@ -45,7 +46,7 @@ phone as phone, is_refund_application as isRefundApplication, is_refund as isRefund, - soc as soc, + soc as socUser, surplus_money as balance, avatar as avatar, status, @@ -56,6 +57,7 @@ tenant_id tenantId, del_flag delFlag, concat(2) as userType, + soc_protect socProtect, concat("ST") as userTypeName, (select count(charging_station_id) from xhpc_mechanism where community_id=mechanism_id and source=0 and charging_station_id in (select charging_station_id from xhpc_terminal where 1=1 and del_flag=0 and serial_number=#{serialNumber})) as number, @@ -81,7 +83,7 @@ phone as phone, is_refund_application as isRefundApplication, is_refund as isRefund, - soc as soc, + soc as socUser, surplus_money as balance, avatar as avatar, status, @@ -92,6 +94,7 @@ del_flag delFlag, tenant_id tenantId, concat(3) as userType, + soc_protect socProtect, concat("BE") as userTypeName, (select count(charging_station_id) from xhpc_mechanism where customers_id=mechanism_id and source=1 and charging_station_id in (select charging_station_id from xhpc_terminal where 1=1 and del_flag=0 and serial_number=#{serialNumber})) as number, diff --git a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommunityMapper.xml b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommunityMapper.xml index c5849223..38fa96e1 100644 --- a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommunityMapper.xml +++ b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommunityMapper.xml @@ -379,6 +379,7 @@ update_time = #{updateTime}, update_by = #{updateBy}, remark = #{remark}, + is_refund_application = #{isRefundApplication}, where community_personnel_id=#{communityPersonnelId} @@ -390,4 +391,5 @@ update xhpc_community_personnel set status=#{status} where community_personnel_id=#{communityPersonnelId} + From 4501480a00528a06d9bed4e9c13a9e31f947d4d1 Mon Sep 17 00:00:00 2001 From: ZZ Date: Tue, 11 Jan 2022 17:01:54 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E5=88=87=E9=9D=A2+=E6=B3=A8=E8=A7=A3?= =?UTF-8?q?=E9=98=B2=E9=87=8D=E5=A4=8D=E6=8F=90=E4=BA=A4,@NoRepeatSubmit?= =?UTF-8?q?=E9=BB=98=E8=AE=A410=E7=A7=92=E5=86=85=E5=8F=AA=E8=83=BD?= =?UTF-8?q?=E6=8F=90=E4=BA=A41=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/annotation/NoRepeatSubmit.java | 19 +++++ .../common/data/redis/StaticBeanUtil.java | 16 +++++ .../com/xhpc/common/util/RequestUtils.java | 16 +++++ .../payment/aspect/RepeatSubmitAspect.java | 71 +++++++++++++++++++ .../controller/XhpcRefundOrderController.java | 35 ++++----- 5 files changed, 136 insertions(+), 21 deletions(-) create mode 100644 ruoyi-common/ruoyi-common-core/src/main/java/com/xhpc/common/core/annotation/NoRepeatSubmit.java create mode 100644 xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/RequestUtils.java create mode 100644 xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/aspect/RepeatSubmitAspect.java diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/xhpc/common/core/annotation/NoRepeatSubmit.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xhpc/common/core/annotation/NoRepeatSubmit.java new file mode 100644 index 00000000..697fb04b --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/xhpc/common/core/annotation/NoRepeatSubmit.java @@ -0,0 +1,19 @@ +package com.xhpc.common.core.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface NoRepeatSubmit { + + /* + * 防止重复提交标记注解 + * 设置请求锁定时间 + * @return + */ + int lockTime() default 10; + +} diff --git a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/data/redis/StaticBeanUtil.java b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/data/redis/StaticBeanUtil.java index 734b19dc..57a5a0f3 100644 --- a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/data/redis/StaticBeanUtil.java +++ b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/data/redis/StaticBeanUtil.java @@ -4,12 +4,14 @@ import cn.hutool.core.date.DateUtil; import com.xhpc.common.api.PileOrderService; import com.xhpc.common.redis.service.RedisService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.support.atomic.RedisAtomicInteger; import org.springframework.data.redis.support.atomic.RedisAtomicLong; import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; import java.util.Calendar; import java.util.Date; +import java.util.concurrent.TimeUnit; @Component public class StaticBeanUtil { @@ -30,6 +32,20 @@ public class StaticBeanUtil { REDIS = redisService; } + public static Boolean tryLock(String key, long expr) { + + System.out.println("try lock..."); + RedisAtomicInteger counter = new RedisAtomicInteger(key, REDIS.redisTemplate.getConnectionFactory()); + counter.expire(expr, TimeUnit.SECONDS); + long result = counter.incrementAndGet(); + return result == 1; + } + + public static Boolean releaseLock(String key) { + + return REDIS.deleteObject(key); + } + public synchronized static String seqHex(String key) { String upperCode = ""; diff --git a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/RequestUtils.java b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/RequestUtils.java new file mode 100644 index 00000000..5dc05a1c --- /dev/null +++ b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/RequestUtils.java @@ -0,0 +1,16 @@ +package com.xhpc.common.util; + +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; + +public class RequestUtils { + + public static HttpServletRequest getRequest() { + + ServletRequestAttributes ra = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + return ra.getRequest(); + } + +} diff --git a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/aspect/RepeatSubmitAspect.java b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/aspect/RepeatSubmitAspect.java new file mode 100644 index 00000000..d38a6b6e --- /dev/null +++ b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/aspect/RepeatSubmitAspect.java @@ -0,0 +1,71 @@ +package com.xhpc.payment.aspect; + +import com.xhpc.common.core.annotation.NoRepeatSubmit; +import com.xhpc.common.core.web.domain.AjaxResult; +import com.xhpc.common.data.redis.StaticBeanUtil; +import com.xhpc.common.util.RequestUtils; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; +import org.springframework.util.Assert; + +import javax.servlet.http.HttpServletRequest; + +@Aspect +@Component +public class RepeatSubmitAspect { + + private static final Logger LOGGER = LoggerFactory.getLogger(RepeatSubmitAspect.class); + + + @Pointcut("@annotation(noRepeatSubmit)") + public void pointCut(NoRepeatSubmit noRepeatSubmit) { + + } + + @Around("pointCut(noRepeatSubmit)") + public Object around(ProceedingJoinPoint pjp, NoRepeatSubmit noRepeatSubmit) throws Throwable { + + int lockSeconds = noRepeatSubmit.lockTime(); + + HttpServletRequest request = RequestUtils.getRequest(); + Assert.notNull(request, "request can't be null"); + + // 此处可以用token或者JSessionId + String token = request.getHeader("Authorization"); + String path = request.getServletPath(); + String key = getKey(token, path); + + boolean isSuccess = StaticBeanUtil.tryLock(key, lockSeconds); + LOGGER.info("tryLock key = [{}]", key); + // 主要逻辑 + if (isSuccess) { + LOGGER.info("tryLock success, key = [{}]", key); + // 获取锁成功 + Object result; +// try { + // 执行进程 + result = pjp.proceed(); +// } finally { + // 解锁 +// StaticBeanUtil.releaseLock(key); +// LOGGER.info("releaseLock success, key = [{}]", key); +// } + return result; + } else { + // 获取锁失败,认为是重复提交的请求。 + LOGGER.info("tryLock fail, key = [{}]", key); + return new AjaxResult(200, "重复请求,请稍后再试", null); + } + } + + private String getKey(String token, String path) { + + return "lock".concat(path.replace("/", ":").concat(token.replaceAll(" ", ""))); + } + +} diff --git a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundOrderController.java b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundOrderController.java index f9a5f49a..24a79ddd 100644 --- a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundOrderController.java +++ b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundOrderController.java @@ -1,6 +1,6 @@ package com.xhpc.payment.controller; -import com.xhpc.common.api.UserTypeService; +import com.xhpc.common.core.annotation.NoRepeatSubmit; import com.xhpc.common.core.constant.HttpStatus; import com.xhpc.common.core.constant.StatusConstants; import com.xhpc.common.core.utils.StringUtils; @@ -8,8 +8,6 @@ import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; import com.xhpc.common.security.service.TokenService; -import com.xhpc.common.util.UserTypeUtil; -import com.xhpc.payment.service.IXhpcCommonPayment; import com.xhpc.payment.service.IXhpcRefundOrderService; import com.xhpc.system.api.model.LoginUser; import io.swagger.annotations.Api; @@ -33,30 +31,22 @@ public class XhpcRefundOrderController extends BaseController { private IXhpcRefundOrderService iXhpcRefundOrderService; @Autowired private TokenService tokenService; - @Autowired - private IXhpcCommonPayment xhpcCommonPayment; - @Autowired - private UserTypeService userTypeService; + /** * 申请退款 * * @return */ + @NoRepeatSubmit @PostMapping("/checkOut") @ApiOperation(value = "申请退款") - public AjaxResult enterpriseCheckOut(HttpServletRequest request,@RequestBody Map map) { - LoginUser loginUser = tokenService.getLoginUser(request); - Long userid = loginUser.getUserid(); - Integer userType = loginUser.getUserType(); - String tenantId = loginUser.getTenantId(); - if(UserTypeUtil.CUSTOMERS_TYPE.equals(userType)){ - return AjaxResult.error(HttpStatus.ERROR_STATUS, "大客户不支持退款"); - } + public AjaxResult enterpriseCheckOut(@RequestBody Map map) { + String amount = StringUtils.valueOf(map.get("amount")); if (StringUtils.isEmpty(amount)) { return AjaxResult.error(HttpStatus.NOT_NULL, "退款金额不能为空"); - }else{ - if(new BigDecimal(1).compareTo(new BigDecimal(amount))==1){ + } else { + if (new BigDecimal(1).compareTo(new BigDecimal(amount)) == 1) { return AjaxResult.error(HttpStatus.NOT_NULL, "退款金额不能少于1元"); } } @@ -74,20 +64,23 @@ public class XhpcRefundOrderController extends BaseController { if (StringUtils.isEmpty(type)) { return AjaxResult.error(HttpStatus.NOT_NULL, "退款渠道不能为空"); } + //是否有实时数据 - int i =iXhpcRefundOrderService.countXhpcRealTimeOrder(userid,userType,tenantId); + int i = iXhpcRefundOrderService.countXhpcRealTimeOrder(Long.valueOf(userId)); if (i > 0) { return AjaxResult.error(1103, "车辆正在充电,不能退款"); } // 是否有异常订单 - int j =iXhpcRefundOrderService.countXhpcChargeOrder(userid,userType,tenantId); + int j = iXhpcRefundOrderService.countXhpcChargeOrder(Long.valueOf(userId)); if (j > 0) { return AjaxResult.error(1103, "你有异常订单未解决,请拨打客服电话进行解决"); } + //生成退款订单 - String orderOutNumber = StringUtils.numFormat(userid, Integer.parseInt(type), StatusConstants.FLOWING_WATER_REFUND_TYPE); + String orderOutNumber = StringUtils.numFormat(Long.parseLong(userId), Integer.parseInt(type), + StatusConstants.FLOWING_WATER_REFUND_TYPE); String remark = StringUtils.valueOf(map.get("remark")); - return iXhpcRefundOrderService.addRefundOrder(""+userid, BigDecimal.valueOf(Double.parseDouble(amount)), type, orderOutNumber, openid, remark,userType,tenantId); + return iXhpcRefundOrderService.addRefundOrder(userId, BigDecimal.valueOf(Double.parseDouble(amount)), type, orderOutNumber, openid, remark); } /** From 9f41267206f3e39f78f9810f10c2a9de8b80ffd2 Mon Sep 17 00:00:00 2001 From: ZZ Date: Tue, 11 Jan 2022 17:06:18 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E9=80=80=E6=AC=BE=E7=94=B3=E8=AF=B710?= =?UTF-8?q?=E7=A7=92=E5=86=85=E5=8F=AA=E8=83=BD=E6=8F=90=E4=BA=A41?= =?UTF-8?q?=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/XhpcRefundOrderController.java | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundOrderController.java b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundOrderController.java index 24a79ddd..5a894afb 100644 --- a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundOrderController.java +++ b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundOrderController.java @@ -1,5 +1,6 @@ package com.xhpc.payment.controller; +import com.xhpc.common.api.UserTypeService; import com.xhpc.common.core.annotation.NoRepeatSubmit; import com.xhpc.common.core.constant.HttpStatus; import com.xhpc.common.core.constant.StatusConstants; @@ -8,6 +9,8 @@ import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; import com.xhpc.common.security.service.TokenService; +import com.xhpc.common.util.UserTypeUtil; +import com.xhpc.payment.service.IXhpcCommonPayment; import com.xhpc.payment.service.IXhpcRefundOrderService; import com.xhpc.system.api.model.LoginUser; import io.swagger.annotations.Api; @@ -31,6 +34,10 @@ public class XhpcRefundOrderController extends BaseController { private IXhpcRefundOrderService iXhpcRefundOrderService; @Autowired private TokenService tokenService; + @Autowired + private IXhpcCommonPayment xhpcCommonPayment; + @Autowired + private UserTypeService userTypeService; /** * 申请退款 @@ -40,8 +47,15 @@ public class XhpcRefundOrderController extends BaseController { @NoRepeatSubmit @PostMapping("/checkOut") @ApiOperation(value = "申请退款") - public AjaxResult enterpriseCheckOut(@RequestBody Map map) { + public AjaxResult enterpriseCheckOut(HttpServletRequest request, @RequestBody Map map) { + LoginUser loginUser = tokenService.getLoginUser(request); + Long userid = loginUser.getUserid(); + Integer userType = loginUser.getUserType(); + String tenantId = loginUser.getTenantId(); + if (UserTypeUtil.CUSTOMERS_TYPE.equals(userType)) { + return AjaxResult.error(HttpStatus.ERROR_STATUS, "大客户不支持退款"); + } String amount = StringUtils.valueOf(map.get("amount")); if (StringUtils.isEmpty(amount)) { return AjaxResult.error(HttpStatus.NOT_NULL, "退款金额不能为空"); @@ -64,23 +78,22 @@ public class XhpcRefundOrderController extends BaseController { if (StringUtils.isEmpty(type)) { return AjaxResult.error(HttpStatus.NOT_NULL, "退款渠道不能为空"); } - //是否有实时数据 - int i = iXhpcRefundOrderService.countXhpcRealTimeOrder(Long.valueOf(userId)); + int i = iXhpcRefundOrderService.countXhpcRealTimeOrder(userid, userType, tenantId); if (i > 0) { return AjaxResult.error(1103, "车辆正在充电,不能退款"); } // 是否有异常订单 - int j = iXhpcRefundOrderService.countXhpcChargeOrder(Long.valueOf(userId)); + int j = iXhpcRefundOrderService.countXhpcChargeOrder(userid, userType, tenantId); if (j > 0) { return AjaxResult.error(1103, "你有异常订单未解决,请拨打客服电话进行解决"); } - //生成退款订单 - String orderOutNumber = StringUtils.numFormat(Long.parseLong(userId), Integer.parseInt(type), + String orderOutNumber = StringUtils.numFormat(userid, Integer.parseInt(type), StatusConstants.FLOWING_WATER_REFUND_TYPE); String remark = StringUtils.valueOf(map.get("remark")); - return iXhpcRefundOrderService.addRefundOrder(userId, BigDecimal.valueOf(Double.parseDouble(amount)), type, orderOutNumber, openid, remark); + return iXhpcRefundOrderService.addRefundOrder("" + userid, BigDecimal.valueOf(Double.parseDouble(amount)), type, + orderOutNumber, openid, remark, userType, tenantId); } /** From 060054078f99e1b62f831b5875c15f5788c6331f Mon Sep 17 00:00:00 2001 From: yuyang Date: Tue, 11 Jan 2022 17:26:29 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9C=BA=E6=9E=84?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/XhpcCommunityServiceImpl.java | 2 +- .../service/impl/XhpcCustomersServiceImpl.java | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommunityServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommunityServiceImpl.java index 0df70871..7f8926f5 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommunityServiceImpl.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommunityServiceImpl.java @@ -206,7 +206,7 @@ public class XhpcCommunityServiceImpl implements IXhpcCommunityService { BigDecimal rechargeMoney = xhpcCommunityPersonnel.getRechargeMoney(); Long communityPersonnelId = xhpcCommunityPersonnel.getCommunityPersonnelId(); - if(new BigDecimal(0).compareTo(rechargeMoney)==-1){ + if(rechargeMoney !=null &&new BigDecimal(0).compareTo(rechargeMoney)==-1){ //增加社区用户的剩余金额 Map communityPersonnelById = xhpcCommunityMapper.getCommunityPersonnelById(communityPersonnelId, null, null, 1); if(communityPersonnelById !=null){ diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCustomersServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCustomersServiceImpl.java index 0a0c2e67..a7f59f76 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCustomersServiceImpl.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCustomersServiceImpl.java @@ -55,7 +55,7 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService { @Override public AjaxResult addCustomers(HttpServletRequest request, XhpcCustomers xhpcCustomers) { boolean b = judgeXhpcCustomers(xhpcCustomers); - if(b){ + if(!b){ return AjaxResult.error("参数比传"); } //名称重复不能入库 @@ -114,7 +114,7 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService { @Override public AjaxResult updateCustomers(XhpcCustomers xhpcCustomers) { boolean b = judgeXhpcCustomers(xhpcCustomers); - if(b){ + if(!b){ return AjaxResult.error("参数比传"); } //名称重复不能入库 @@ -166,9 +166,11 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService { } } xhpcCustomersMapper.addCustomersPersonnel(xhpcCustomersPersonnel); - //增加一条充值记录 - if(new BigDecimal(0).compareTo(rechargeMoney)==-1){ - mechanismService.addRechargeOrder(xhpcCustomersPersonnel.getCustomersPersonnelId(),UserTypeUtil.CUSTOMERS_TYPE,rechargeMoney,rechargeMoney,UserTypeUtil.RECHARGE_PT); + if(rechargeMoney !=null){ + //增加一条充值记录 + if(new BigDecimal(0).compareTo(rechargeMoney)==-1){ + mechanismService.addRechargeOrder(xhpcCustomersPersonnel.getCustomersPersonnelId(),UserTypeUtil.CUSTOMERS_TYPE,rechargeMoney,rechargeMoney,UserTypeUtil.RECHARGE_PT); + } } return AjaxResult.success(); } @@ -217,7 +219,7 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService { public AjaxResult addRecharge(XhpcCustomersPersonnel xhpcCustomersPersonnel) { BigDecimal rechargeMoney = xhpcCustomersPersonnel.getRechargeMoney(); Long customersPersonnelId = xhpcCustomersPersonnel.getCustomersPersonnelId(); - if(new BigDecimal(0).compareTo(rechargeMoney)==-1){ + if(rechargeMoney !=null && new BigDecimal(0).compareTo(rechargeMoney)==-1){ //增加社区用户的剩余金额 Map communityPersonnelById = xhpcCustomersMapper.getCustomersPersonnelById(customersPersonnelId, null, null, 1); if(communityPersonnelById !=null){ From e2bdce5d6aaa52d5dcd578605fbe2ac5e931d4f9 Mon Sep 17 00:00:00 2001 From: yuyang Date: Tue, 11 Jan 2022 17:44:44 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=AE=9D=E3=80=81?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=94=AF=E4=BB=98=E5=A2=9E=E5=8A=A0=E6=B3=A8?= =?UTF-8?q?=E8=A7=A3=EF=BC=8C=E5=90=8C=E4=B8=80=E4=B8=AAtoken=E5=8F=AA?= =?UTF-8?q?=E8=83=BD10S=EF=BC=8C=E6=8F=90=E4=BA=A4=E4=B8=80=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xhpc/payment/controller/AlipayPaymentController.java | 2 ++ .../java/com/xhpc/payment/controller/WxPaymentController.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/AlipayPaymentController.java b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/AlipayPaymentController.java index 1e14844b..855dab4a 100644 --- a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/AlipayPaymentController.java +++ b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/AlipayPaymentController.java @@ -12,6 +12,7 @@ import com.alipay.api.request.AlipayTradeCreateRequest; import com.alipay.api.response.AlipayTradeCreateResponse; import com.xhpc.common.api.PowerPileService; import com.xhpc.common.api.UserTypeService; +import com.xhpc.common.core.annotation.NoRepeatSubmit; import com.xhpc.common.core.constant.HttpStatus; import com.xhpc.common.core.constant.StatusConstants; import com.xhpc.common.core.domain.R; @@ -67,6 +68,7 @@ public class AlipayPaymentController { private static final Logger logger = LoggerFactory.getLogger(AlipayPaymentController.class); + @NoRepeatSubmit @PostMapping("/payment") @ApiOperation(value = "支付宝支付") private AjaxResult payment(HttpServletRequest servletRequest, @RequestBody Map map) throws Exception { diff --git a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/WxPaymentController.java b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/WxPaymentController.java index 29278edb..0d418809 100644 --- a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/WxPaymentController.java +++ b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/WxPaymentController.java @@ -2,6 +2,7 @@ package com.xhpc.payment.controller; import com.xhpc.common.api.PowerPileService; import com.xhpc.common.api.UserTypeService; +import com.xhpc.common.core.annotation.NoRepeatSubmit; import com.xhpc.common.core.constant.HttpStatus; import com.xhpc.common.core.constant.StatusConstants; import com.xhpc.common.core.domain.R; @@ -77,6 +78,7 @@ public class WxPaymentController { private static final Logger logger = LoggerFactory.getLogger(WxPaymentController.class); + @NoRepeatSubmit @PostMapping("/payment") @ApiOperation(value = "微信支付") public AjaxResult payment(HttpServletRequest servletRequest, @RequestBody Map map) throws Exception { From 3d9040c10c972cc37813574355564420ff55e32d Mon Sep 17 00:00:00 2001 From: yuyang Date: Wed, 12 Jan 2022 14:33:45 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/web/controller/BaseController.java | 12 ++++ .../common/core/web/service/BaseService.java | 27 ++++++++ .../XhpcChargingPileController.java | 2 - .../XhpcChargingStationController.java | 1 - .../controller/XhpcTerminalController.java | 2 - .../service/IXhpcChargingPileService.java | 2 +- .../service/XhpcChargingPileServiceImpl.java | 7 +- .../XhpcChargingStationServiceImpl.java | 5 +- .../service/XhpcTerminalServiceImpl.java | 4 +- .../com/xhpc/common/util/UserTypeUtil.java | 8 +++ .../order/api/XhpcChargeOrderController.java | 3 - .../order/api/XhpcPileOrderController.java | 9 --- .../XhpcHistoryOrderController.java | 6 -- ...ryOrderReconciliationStatusController.java | 1 - ...pcHistoryOrderSortingStatusController.java | 1 - .../XhpcRealTimeOrderController.java | 1 - .../controller/XhpcStatisticsController.java | 5 -- .../impl/XhpcChargeOrderServiceImpl.java | 5 +- ...yOrderReconciliationStatusServiceImpl.java | 5 +- .../impl/XhpcHistoryOrderServiceImpl.java | 6 +- ...cHistoryOrderSortingStatusServiceImpl.java | 5 +- .../impl/XhpcRealTimeOrderServiceImpl.java | 5 +- .../impl/XhpcStatisticsServiceImpl.java | 13 +++- .../controller/XhpcRefundAuditController.java | 1 + .../XhpcUserAccountStatementController.java | 1 - .../XhpcUserAccountStatementServiceImpl.java | 4 +- .../controller/XhpcAppUserController.java | 1 - .../controller/XhpcCommunityController.java | 6 +- .../controller/XhpcCustomersController.java | 5 +- .../XhpcInternetUserController.java | 1 + ...pcOperatorInternetBlacklistController.java | 1 + ...hpcStationInternetBlacklistController.java | 5 +- .../user/controller/XhpcUserController.java | 1 - .../xhpc/user/mapper/XhpcCommunityMapper.java | 2 +- .../xhpc/user/mapper/XhpcCustomersMapper.java | 2 +- .../user/service/IXhpcCommunityService.java | 3 +- .../user/service/IXhpcCustomersService.java | 2 +- .../service/impl/XhpcAppUserServiceImpl.java | 5 +- .../impl/XhpcCommunityServiceImpl.java | 67 ++++++++++-------- .../impl/XhpcCustomersServiceImpl.java | 69 +++++++++---------- .../service/impl/XhpcUserServiceImpl.java | 4 +- .../resources/mapper/XhpcCommunityMapper.xml | 8 ++- .../resources/mapper/XhpcCustomersMapper.xml | 7 +- 43 files changed, 198 insertions(+), 132 deletions(-) create mode 100644 ruoyi-common/ruoyi-common-core/src/main/java/com/xhpc/common/core/web/service/BaseService.java diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/xhpc/common/core/web/controller/BaseController.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xhpc/common/core/web/controller/BaseController.java index 1f6bd1da..6b5473b4 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xhpc/common/core/web/controller/BaseController.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/xhpc/common/core/web/controller/BaseController.java @@ -59,7 +59,19 @@ public class BaseController PageHelper.startPage(pageNum, pageSize, orderBy); } } + /** + * 设置请求分页数据 + */ + protected void startPage(Integer pageNum,Integer pageSize) + { + PageDomain pageDomain = TableSupport.buildPageRequest(); + if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) + { + String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); + PageHelper.startPage(pageNum, pageSize, orderBy); + } + } /** * 响应请求分页数据 */ diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/xhpc/common/core/web/service/BaseService.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xhpc/common/core/web/service/BaseService.java new file mode 100644 index 00000000..f205e37b --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/xhpc/common/core/web/service/BaseService.java @@ -0,0 +1,27 @@ +package com.xhpc.common.core.web.service; + +import com.github.pagehelper.PageHelper; +import com.xhpc.common.core.utils.StringUtils; +import com.xhpc.common.core.utils.sql.SqlUtil; +import com.xhpc.common.core.web.page.PageDomain; +import com.xhpc.common.core.web.page.TableSupport; + +/** + * @author yuyang + * @date 2022/1/12 10:54 + */ +public class BaseService { + + protected void startPage() + { + PageDomain pageDomain = TableSupport.buildPageRequest(); + Integer pageNum = pageDomain.getPageNum(); + Integer pageSize = pageDomain.getPageSize(); + if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) + { + String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); + PageHelper.startPage(pageNum, pageSize, orderBy); + } + } + +} diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingPileController.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingPileController.java index 6e908c0c..6d783c28 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingPileController.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingPileController.java @@ -38,8 +38,6 @@ public class XhpcChargingPileController extends BaseController { */ @GetMapping("/list") public TableDataInfo list(HttpServletRequest request,String name, Integer type, String serialNumber, Long chargingStationId) { - - startPage(); List> list = xhpcChargingPileService.selectXhpcChargingPileList(request,name, type, serialNumber, chargingStationId); return getDataTable(list); } diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingStationController.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingStationController.java index a7d2f176..39c08b04 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingStationController.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingStationController.java @@ -71,7 +71,6 @@ public class XhpcChargingStationController extends BaseController { //@PreAuthorize(hasPermi = "system:station:list") @GetMapping("/list") public TableDataInfo list(HttpServletRequest request,String name, String operatorName) { - startPage(); List> list = xhpcChargingStationService.selectXhpcChargingStationList(request,name, operatorName); return getDataTable(list); } diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcTerminalController.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcTerminalController.java index f498ed7b..e46c38ff 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcTerminalController.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcTerminalController.java @@ -39,8 +39,6 @@ public class XhpcTerminalController extends BaseController { //@PreAuthorize(hasPermi = "system:station:list") @GetMapping("/list") public TableDataInfo list(HttpServletRequest request, String serialNumber, Integer type, Integer status, String workStatus, Long chargingStationId) { - - startPage(); List> list = xhpcTerminalService.getXhpcTerminalList(request,serialNumber, type, status, workStatus, chargingStationId); return getDataTable(list); } diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcChargingPileService.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcChargingPileService.java index 0515f0e5..d3457f96 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcChargingPileService.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcChargingPileService.java @@ -21,7 +21,7 @@ public interface IXhpcChargingPileService { * @param name 桩名称 * @return */ - List> selectXhpcChargingPileList(HttpServletRequest request, String name, Integer type, String serialNumber, Long chargingStationId); + List> selectXhpcChargingPileList(HttpServletRequest request,String name, Integer type, String serialNumber, Long chargingStationId); /** diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java index 9f0f0b6a..799351a5 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java @@ -15,6 +15,7 @@ import com.xhpc.common.core.exception.CustomException; import com.xhpc.common.core.utils.SecurityUtils; import com.xhpc.common.core.utils.StringUtils; import com.xhpc.common.core.web.domain.AjaxResult; +import com.xhpc.common.core.web.service.BaseService; import com.xhpc.common.domain.XhpcChargingPile; import com.xhpc.common.domain.XhpcChargingStation; import com.xhpc.common.domain.XhpcTerminal; @@ -41,7 +42,7 @@ import static com.aliyun.oss.internal.OSSConstants.URL_ENCODING; * @date 2021/7/27 14:36 */ @Service -public class XhpcChargingPileServiceImpl implements IXhpcChargingPileService { +public class XhpcChargingPileServiceImpl extends BaseService implements IXhpcChargingPileService{ @Autowired private XhpcChargingPileMapper xhpcChargingPileMapper; @@ -92,6 +93,7 @@ public class XhpcChargingPileServiceImpl implements IXhpcChargingPileService { Map landUser = xhpcChargingStationService.getLandUser(userId); if(landUser !=null){ if(landUser.get("userType") !=null){ + startPage(); if("01".equals(landUser.get("userType").toString())){ Long operatorId = Long.valueOf(landUser.get("operatorId").toString()); list= xhpcChargingPileMapper.selectXhpcChargingPileList(name, type, serialNumber, chargingStationId,operatorId,1,tenantId); @@ -101,10 +103,9 @@ public class XhpcChargingPileServiceImpl implements IXhpcChargingPileService { } } }else{ + startPage(); list= xhpcChargingPileMapper.selectXhpcChargingPileList(name, type, serialNumber, chargingStationId,userId,0,tenantId); } - - return list; } diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java index 856838be..c42e327d 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java @@ -12,6 +12,7 @@ import com.xhpc.common.core.domain.R; import com.xhpc.common.core.utils.DateUtils; import com.xhpc.common.core.utils.SecurityUtils; import com.xhpc.common.core.web.domain.AjaxResult; +import com.xhpc.common.core.web.service.BaseService; import com.xhpc.common.data.redis.CacheRateModel; import com.xhpc.common.domain.XhpcChargingStation; import com.xhpc.common.domain.XhpcRate; @@ -41,7 +42,7 @@ import java.util.regex.Pattern; * @date 2021-07-19 */ @Service -public class XhpcChargingStationServiceImpl implements IXhpcChargingStationService { +public class XhpcChargingStationServiceImpl extends BaseService implements IXhpcChargingStationService { @Autowired private XhpcChargingStationMapper xhpcChargingStationMapper; @@ -133,6 +134,7 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi Map landUser = xhpcChargingStationMapper.getLandUser(userId); if(landUser !=null){ if(landUser.get("userType") !=null){ + startPage(); if("01".equals(landUser.get("userType").toString())){ Long operatorId = Long.valueOf(landUser.get("operatorId").toString()); //运营商看自己的场站 @@ -144,6 +146,7 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi } } }else{ + startPage(); list = xhpcChargingStationMapper.selectXhpcChargingStationList(name, operatorName,userId,0,tenantId); } diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcTerminalServiceImpl.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcTerminalServiceImpl.java index 493917d7..b8adbcb9 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcTerminalServiceImpl.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcTerminalServiceImpl.java @@ -3,6 +3,7 @@ package com.xhpc.charging.station.service; import cn.hutool.core.date.DateUtil; import com.xhpc.charging.station.mapper.XhpcTerminalMapper; import com.xhpc.common.core.web.domain.AjaxResult; +import com.xhpc.common.core.web.service.BaseService; import com.xhpc.common.domain.XhpcTerminal; import com.xhpc.common.util.LogUserUtils; import com.xhpc.system.api.model.LoginUser; @@ -19,7 +20,7 @@ import java.util.*; * @date 2021-07-20 */ @Service -public class XhpcTerminalServiceImpl implements IXhpcTerminalService { +public class XhpcTerminalServiceImpl extends BaseService implements IXhpcTerminalService { @Autowired private XhpcTerminalMapper xhpcTerminalMapper; @@ -46,6 +47,7 @@ public class XhpcTerminalServiceImpl implements IXhpcTerminalService { @Override public List> getXhpcTerminalList(HttpServletRequest request, String serialNumber, Integer type, Integer status, String workStatus, Long chargingStationId) { LoginUser logUser = logUserUtils.getLogUser(request); + startPage(); List> list = xhpcTerminalMapper.getXhpcTerminalList(serialNumber, type, status, workStatus, chargingStationId,logUser.getTenantId()); if(list !=null && list.size()>0){ for (int i = 0; i > list = iXhpcChargeOrderService.getHistotyChargeOrderStatusList(request); return getDataTable(list); } @@ -107,7 +105,6 @@ public class XhpcChargeOrderController extends BaseController { @GetMapping("/list") public TableDataInfo list(HttpServletRequest request) { - startPage(); List> list = xhpcHistoryOrderService.list(request); return getDataTable(list); } diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcPileOrderController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcPileOrderController.java index 8339dc94..7856827a 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcPileOrderController.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcPileOrderController.java @@ -55,16 +55,7 @@ public class XhpcPileOrderController extends BaseController { @Autowired private UserTypeService userTypeService; - private static final Logger logger = LoggerFactory.getLogger(XhpcPileOrderController.class); - /** - * 测试 - */ - @GetMapping("/test/chargeOrder/pileStartup") - private R test(@RequestParam String orderNo, @RequestParam Integer status, @RequestParam String remark) { - return null; - } - /** * 桩启动回调接口 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 b0ac2605..bca87578 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 @@ -82,7 +82,6 @@ public class XhpcHistoryOrderController extends BaseController { String affiliationOrganization,String evcsOrderNo,String plateNum,Integer internetId,String internetSerialNumber,String terminalName,String vinCode,String overStartTime,String overEndTime,Long personnelId) { - startPage(); List> listPage = xhpcHistoryOrderService.getListPage(phone, transactionNumber, status, chargingStationName, operatorId, source, beginStartTime, beginEndTime, userId, type, affiliationOrganization,evcsOrderNo,plateNum,internetId,internetSerialNumber,terminalName,vinCode,overStartTime,overEndTime,personnelId); return getDataTable(listPage); } @@ -426,14 +425,11 @@ public class XhpcHistoryOrderController extends BaseController { @GetMapping("/test") @Scheduled(cron = "0 0/2 * * * ?") public void test(){ - logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务>>>>>>>>>>>>>>>>>>>>>"); - logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务>>>>>>>>>>>>>>>>>>>>>"); logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务>>>>>>>>>>>>>>>>>>>>>"); //小时统计 List list = xhpcHistoryOrderService.getStatistisList(3000,0); if(list !=null && list.size()>0){ for (XhpcChargeHistoryOrder xhpc:list) { - try{ //开始时间、结束时间、模型id、状态、用户id、运营商、订单id、场站id、终端id、历史订单id、时间 Date startTime = xhpc.getStartTime(); @@ -508,8 +504,6 @@ public class XhpcHistoryOrderController extends BaseController { @GetMapping("/test8") //@Scheduled(cron = "0 0/5 * * * ?") public void test8(){ - logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务>>>>>>>>>>>>>>>>>>>>>"); - logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务>>>>>>>>>>>>>>>>>>>>>"); logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务>>>>>>>>>>>>>>>>>>>>>"); //获取500条待统计历史订单 //跨时段,跨费率,计费模型 diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderReconciliationStatusController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderReconciliationStatusController.java index 6a477e0c..04eeeede 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderReconciliationStatusController.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderReconciliationStatusController.java @@ -66,7 +66,6 @@ public class XhpcHistoryOrderReconciliationStatusController extends BaseControll @GetMapping("/page") @ApiOperation(value = "流量用户对账分页列表") public TableDataInfo page(@RequestParam Long userId, String serialNumber, String createTimeStart, String createTimeEnd, String chargingStationName, String status) { - startPage(); List> list = iXhpcHistoryOrderReconciliationStatusService.page(userId, serialNumber, createTimeStart, createTimeEnd, chargingStationName, status); return getDataTable(list); } diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderSortingStatusController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderSortingStatusController.java index 5c5907a7..cbb246fe 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderSortingStatusController.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderSortingStatusController.java @@ -68,7 +68,6 @@ public class XhpcHistoryOrderSortingStatusController extends BaseController { @GetMapping("/page") @ApiOperation(value = "运营商清分分页列表") public TableDataInfo page(@RequestParam Long userId, String serialNumber, String createTimeStart, String createTimeEnd, String chargingStationName, String status) { - startPage(); List> list = iXhpcHistoryOrderSortingStatusService.page(userId, serialNumber, createTimeStart, createTimeEnd, chargingStationName, status); return getDataTable(list); } diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcRealTimeOrderController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcRealTimeOrderController.java index d96eea0b..a3fe89db 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcRealTimeOrderController.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcRealTimeOrderController.java @@ -50,7 +50,6 @@ public class XhpcRealTimeOrderController extends BaseController { public TableDataInfo list(String phone,String transactionNumber,Integer source,String chargingStationName,String terminalName,Long operatorId,String startTime,String endTime,@RequestParam("status") Integer status,@RequestParam("userId") Long userId,@RequestParam("type") Integer type, String affiliationOrganization,String plateNum,Integer internetId,String internetSerialNumber) { - startPage(); List> list = xhpcRealTimeOrderService.list(phone, transactionNumber, source, chargingStationName,terminalName, operatorId, startTime, endTime,status,userId,type,affiliationOrganization,plateNum,internetId,internetSerialNumber); return getDataTable(list); } diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcStatisticsController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcStatisticsController.java index b5ce35e4..c99ff053 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcStatisticsController.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcStatisticsController.java @@ -44,7 +44,6 @@ public class XhpcStatisticsController extends BaseController { @GetMapping("/getTimeIntervalPage") public TableDataInfo getTimeIntervalPage(String chargingStationIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) { - startPage(); List> list = xhpcStatisticsService.getTimeIntervalPage(chargingStationIds,internetUserId,operatorId,startTime,endTime,userId,type); return getDataTable(list); } @@ -63,7 +62,6 @@ public class XhpcStatisticsController extends BaseController { @GetMapping("/getDateIntervalPage") public TableDataInfo getDateIntervalPage(String chargingStationIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) { - startPage(); List> list = xhpcStatisticsService.getDateIntervalPage(chargingStationIds,internetUserId,operatorId,startTime,endTime,userId,type); return getDataTable(list); } @@ -82,7 +80,6 @@ public class XhpcStatisticsController extends BaseController { @GetMapping("/getStationIntervalPage") public TableDataInfo getStationIntervalPage(String chargingStationIds,String operatorIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) { - startPage(); List> list = xhpcStatisticsService.getStationIntervalPage(chargingStationIds,operatorIds,internetUserId,operatorId,startTime,endTime,userId,type); return getDataTable(list); } @@ -100,7 +97,6 @@ public class XhpcStatisticsController extends BaseController { @GetMapping("/getOperatorIntervalPage") public TableDataInfo getOperatorIntervalPage(String operatorIds, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) { - startPage(); List> list = xhpcStatisticsService.getOperatorIntervalPage(operatorIds,operatorId,startTime,endTime,userId,type); return getDataTable(list); } @@ -138,7 +134,6 @@ public class XhpcStatisticsController extends BaseController { @GetMapping("/getTerminalIntervalPage") public TableDataInfo getTerminalIntervalPage(String chargingStationId,String terminalId,Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) { - startPage(); List> list = xhpcStatisticsService.getTerminalIntervalPage(chargingStationId,terminalId,operatorId,startTime,endTime,userId,type); return getDataTable(list); } diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java index 0438ae16..76be4198 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java @@ -6,6 +6,7 @@ import com.xhpc.common.api.UserTypeService; import com.xhpc.common.core.domain.R; import com.xhpc.common.core.utils.StringUtils; import com.xhpc.common.core.web.domain.AjaxResult; +import com.xhpc.common.core.web.service.BaseService; import com.xhpc.common.data.down.StartChargingData; import com.xhpc.common.data.redis.CacheRealtimeData; import com.xhpc.common.data.redis.StaticBeanUtil; @@ -20,6 +21,7 @@ import com.xhpc.order.mapper.XhpcChargeOrderMapper; import com.xhpc.order.mapper.XhpcInternetUserMapper; import com.xhpc.order.service.IXhpcChargeOrderService; import com.xhpc.system.api.model.LoginUser; +import org.bouncycastle.jcajce.provider.asymmetric.util.BaseAgreementSpi; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -40,7 +42,7 @@ import static com.xhpc.common.data.redis.StaticBeanUtil.genOrder; * @date 2021/8/4 9:54 */ @Service -public class XhpcChargeOrderServiceImpl implements IXhpcChargeOrderService { +public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChargeOrderService { public static RedisService REDIS; @@ -87,6 +89,7 @@ public class XhpcChargeOrderServiceImpl implements IXhpcChargeOrderService { @Override public List> getHistotyChargeOrderStatusList(HttpServletRequest request) { LoginUser loginUser = tokenService.getLoginUser(request); + startPage(); return xhpcChargeOrderMapper.getHistotyChargeOrderStatusList(loginUser.getUserid(),loginUser.getTenantId(),loginUser.getUserType()); } diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderReconciliationStatusServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderReconciliationStatusServiceImpl.java index f298f344..27482127 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderReconciliationStatusServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderReconciliationStatusServiceImpl.java @@ -4,6 +4,7 @@ import com.xhpc.common.core.constant.HttpStatus; import com.xhpc.common.core.constant.StatusConstants; import com.xhpc.common.core.utils.StringUtils; import com.xhpc.common.core.web.domain.AjaxResult; +import com.xhpc.common.core.web.service.BaseService; import com.xhpc.common.redis.service.RedisService; import com.xhpc.order.domain.XhpcHistoryOrder; import com.xhpc.order.domain.XhpcHistoryOrderReconciliationStatus; @@ -23,7 +24,7 @@ import java.util.Map; * @author ruoyi */ @Service -public class XhpcHistoryOrderReconciliationStatusServiceImpl implements IXhpcHistoryOrderReconciliationStatusService { +public class XhpcHistoryOrderReconciliationStatusServiceImpl extends BaseService implements IXhpcHistoryOrderReconciliationStatusService { @Autowired private XhpcHistoryOrderReconciliationStatusMapper xhpcHistoryOrderReconciliationStatusMapper; @@ -126,6 +127,7 @@ public class XhpcHistoryOrderReconciliationStatusServiceImpl implements IXhpcHis if (StringUtils.isNotNull(map)) { String privilege = StringUtils.valueOf(map.get("privilege")); if (StringUtils.isNotEmpty(privilege)) { + startPage(); if (StatusConstants.OPERATION_POWER_TYPE == Integer.parseInt(privilege)) { String operatorId = StringUtils.valueOf(map.get("operatorId")); return xhpcHistoryOrderReconciliationStatusMapper.page(userId, serialNumber, createTimeStart, createTimeEnd, chargingStationName, status, operatorId, null); @@ -134,6 +136,7 @@ public class XhpcHistoryOrderReconciliationStatusServiceImpl implements IXhpcHis } } } + startPage(); return xhpcHistoryOrderReconciliationStatusMapper.page(userId, serialNumber, createTimeStart, createTimeEnd, chargingStationName, status, null, null); } 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 9919f83b..4b339a87 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 @@ -12,6 +12,7 @@ import com.xhpc.common.api.UserTypeService; import com.xhpc.common.core.domain.R; import com.xhpc.common.core.utils.SecurityUtils; import com.xhpc.common.core.web.domain.AjaxResult; +import com.xhpc.common.core.web.service.BaseService; import com.xhpc.common.data.redis.CacheRealtimeData; import com.xhpc.common.redis.service.RedisService; import com.xhpc.common.security.service.TokenService; @@ -47,7 +48,7 @@ import java.util.concurrent.Executors; * @date 2021/8/3 21:23 */ @Service -public class XhpcHistoryOrderServiceImpl implements IXhpcHistoryOrderService { +public class XhpcHistoryOrderServiceImpl extends BaseService implements IXhpcHistoryOrderService { @Resource private XhpcHistoryOrderMapper xhpcHistoryOrderMapper; @@ -87,6 +88,7 @@ public class XhpcHistoryOrderServiceImpl implements IXhpcHistoryOrderService { if(user !=null && user.getData() !=null){ Map userMessage = (Map)user.getData(); if (userMessage == null) { + startPage(); return xhpcHistoryOrderMapper.list(userid,userType,tenantId); } } @@ -134,6 +136,7 @@ public class XhpcHistoryOrderServiceImpl implements IXhpcHistoryOrderService { Map landUser = xhpcHistoryOrderMapper.getLandUser(logUserId); if (landUser != null) { if (landUser.get("userType") != null) { + startPage(); if ("01".equals(landUser.get("userType").toString())) { Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); //运营商看自己的场站 @@ -146,6 +149,7 @@ public class XhpcHistoryOrderServiceImpl implements IXhpcHistoryOrderService { } } else { + startPage(); list = xhpcHistoryOrderMapper.getListPage(phone, transactionNumber, 0, chargingStationName, operatorId, source, beginStartTime, beginEndTime, userId, type, number,affiliationOrganization,evcsOrderNo,plateNum,internetId,internetSerialNumber,terminalName,vinCode,overStartTime,overEndTime,personnelId); } return list; diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderSortingStatusServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderSortingStatusServiceImpl.java index 4a38c6aa..b44abdc2 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderSortingStatusServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderSortingStatusServiceImpl.java @@ -4,6 +4,7 @@ import com.xhpc.common.core.constant.HttpStatus; import com.xhpc.common.core.constant.StatusConstants; import com.xhpc.common.core.utils.StringUtils; import com.xhpc.common.core.web.domain.AjaxResult; +import com.xhpc.common.core.web.service.BaseService; import com.xhpc.common.redis.service.RedisService; import com.xhpc.order.domain.XhpcHistoryOrder; import com.xhpc.order.domain.XhpcHistoryOrderSortingStatus; @@ -23,7 +24,7 @@ import java.util.Map; * @author ruoyi */ @Service -public class XhpcHistoryOrderSortingStatusServiceImpl implements IXhpcHistoryOrderSortingStatusService { +public class XhpcHistoryOrderSortingStatusServiceImpl extends BaseService implements IXhpcHistoryOrderSortingStatusService { @Autowired private XhpcHistoryOrderSortingStatusMapper xhpcHistoryOrderSortingStatusMapper; @@ -127,6 +128,7 @@ public class XhpcHistoryOrderSortingStatusServiceImpl implements IXhpcHistoryOrd if (StringUtils.isNotNull(map)) { String privilege = StringUtils.valueOf(map.get("privilege")); if (StringUtils.isNotEmpty(privilege)) { + startPage(); if (StatusConstants.OPERATION_POWER_TYPE == Integer.parseInt(privilege)) { String operatorId = StringUtils.valueOf(map.get("operatorId")); return xhpcHistoryOrderSortingStatusMapper.page(userId, serialNumber, createTimeStart, createTimeEnd, chargingStationName, status, operatorId, null); @@ -135,6 +137,7 @@ public class XhpcHistoryOrderSortingStatusServiceImpl implements IXhpcHistoryOrd } } } + startPage(); return xhpcHistoryOrderSortingStatusMapper.page(userId, serialNumber, createTimeStart, createTimeEnd, chargingStationName, status, null, null); } 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 233204ed..030ba1fc 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 @@ -7,6 +7,7 @@ import com.xhpc.common.api.RefundOrderService; import com.xhpc.common.api.SmsService; import com.xhpc.common.core.utils.SecurityUtils; import com.xhpc.common.core.web.domain.AjaxResult; +import com.xhpc.common.core.web.service.BaseService; import com.xhpc.common.data.redis.CacheOrderData; import com.xhpc.common.data.redis.CacheRealtimeData; import com.xhpc.common.redis.service.RedisService; @@ -33,7 +34,7 @@ import java.util.concurrent.Executors; * @date 2021/8/7 15:07 */ @Service -public class XhpcRealTimeOrderServiceImpl implements IXhpcRealTimeOrderService { +public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRealTimeOrderService { @Autowired private XhpcRealTimeOrderMapper xhpcRealTimeOrderMapper; @@ -84,6 +85,7 @@ public class XhpcRealTimeOrderServiceImpl implements IXhpcRealTimeOrderService { if(logUserId !=1) { Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); if(landUser !=null){ + startPage(); if(landUser.get("userType") !=null){ if("01".equals(landUser.get("userType").toString())){ Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); @@ -96,6 +98,7 @@ public class XhpcRealTimeOrderServiceImpl implements IXhpcRealTimeOrderService { } } }else{ + startPage(); list = xhpcRealTimeOrderMapper.list(phone,transactionNumber,source,chargingStationName,terminalName,operatorId,startTime,endTime,number,status,logUserId,0,affiliationOrganization,plateNum,internetId,internetSerialNumber); } diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcStatisticsServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcStatisticsServiceImpl.java index 96dc351a..61333dea 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcStatisticsServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcStatisticsServiceImpl.java @@ -7,6 +7,7 @@ import cn.hutool.poi.excel.ExcelUtil; import cn.hutool.poi.excel.ExcelWriter; import com.xhpc.common.core.utils.SecurityUtils; import com.xhpc.common.core.web.domain.AjaxResult; +import com.xhpc.common.core.web.service.BaseService; import com.xhpc.order.domain.XhpcStatisticsStation; import com.xhpc.order.domain.XhpcStatisticsTimeInterval; import com.xhpc.order.mapper.XhpcStatisticsServiceMapper; @@ -28,7 +29,7 @@ import java.util.*; * @Version 1.0 */ @Service -public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { +public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStatisticsService { @Autowired private XhpcStatisticsServiceMapper xhpcStatisticsServiceMapper; @@ -49,6 +50,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { if(logUserId !=1){ Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); if(landUser !=null){ + startPage(); if(landUser.get("userType") !=null){ if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){ Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); @@ -61,6 +63,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { } } }else{ + startPage(); list =xhpcStatisticsServiceMapper.getTimeIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 0,logUserId); } List> page =new ArrayList<>(); @@ -171,6 +174,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { if(logUserId !=1){ Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); if(landUser !=null){ + startPage(); if(landUser.get("userType") !=null){ if("01".equals(landUser.get("userType").toString())){ Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); @@ -183,6 +187,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { } } }else{ + startPage(); list =xhpcStatisticsServiceMapper.getDateIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 0,logUserId); } @@ -209,6 +214,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { if(logUserId !=1){ Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); if(landUser !=null){ + startPage(); if(landUser.get("userType") !=null){ if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){ Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); @@ -221,6 +227,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { } } }else{ + startPage(); list =xhpcStatisticsServiceMapper.getStationIntervalPage(chargingStationId,operatorUserId,internetUserId,operatorId,startTime,endTime,0,logUserId); } @@ -244,6 +251,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { if(logUserId !=1){ Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); if(landUser !=null){ + startPage(); if(landUser.get("userType") !=null){ if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){ Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); @@ -256,6 +264,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { } } }else{ + startPage(); list =xhpcStatisticsServiceMapper.getOperatorIntervalPage(operatorUserId, operatorId, startTime, endTime, 0,logUserId); } @@ -286,6 +295,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { if(logUserId !=1){ Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); if(landUser !=null){ + startPage(); if(landUser.get("userType") !=null){ if("01".equals(landUser.get("userType").toString())){ Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); @@ -298,6 +308,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { } } }else{ + startPage(); list =xhpcStatisticsServiceMapper.getTerminalIntervalPage(chargingStationId, terminalId, operatorId, startTime, endTime, 0,logUserId); } diff --git a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundAuditController.java b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundAuditController.java index 47b47e63..0a380825 100644 --- a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundAuditController.java +++ b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundAuditController.java @@ -228,6 +228,7 @@ public class XhpcRefundAuditController extends BaseController { //@PreAuthorize(hasPermi = "refund:audit:list") @GetMapping("/list") public TableDataInfo page(@RequestParam Long refundOrderId) { + startPage(); List> list = iXhpcRefundAuditService.list(refundOrderId); return getDataTable(list); } diff --git a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcUserAccountStatementController.java b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcUserAccountStatementController.java index 9391edf6..78f83573 100644 --- a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcUserAccountStatementController.java +++ b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcUserAccountStatementController.java @@ -32,7 +32,6 @@ public class XhpcUserAccountStatementController extends BaseController { @ApiOperation(value = "用户流水分页列表") @GetMapping("/page") public TableDataInfo page(HttpServletRequest request) { - startPage(); List> list = iXhpcUserAccountStatementService.page(request); return getDataTable(list); } diff --git a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/service/impl/XhpcUserAccountStatementServiceImpl.java b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/service/impl/XhpcUserAccountStatementServiceImpl.java index aac431f7..4dbacb4c 100644 --- a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/service/impl/XhpcUserAccountStatementServiceImpl.java +++ b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/service/impl/XhpcUserAccountStatementServiceImpl.java @@ -4,6 +4,7 @@ import com.xhpc.common.api.UserTypeService; import com.xhpc.common.core.constant.StatusConstants; import com.xhpc.common.core.domain.R; import com.xhpc.common.core.utils.StringUtils; +import com.xhpc.common.core.web.service.BaseService; import com.xhpc.common.security.service.TokenService; import com.xhpc.payment.domain.XhpcUserAccountStatement; import com.xhpc.payment.mapper.XhpcUserAccountStatementMapper; @@ -26,7 +27,7 @@ import java.util.Map; * @author ruoyi */ @Service -public class XhpcUserAccountStatementServiceImpl implements IXhpcUserAccountStatementService { +public class XhpcUserAccountStatementServiceImpl extends BaseService implements IXhpcUserAccountStatementService { @Autowired private XhpcUserAccountStatementMapper xhpcUserAccountStatementMapper; @@ -64,6 +65,7 @@ public class XhpcUserAccountStatementServiceImpl implements IXhpcUserAccountStat if(user !=null && user.getData() !=null){ Map userMessage = (Map)user.getData(); if (userMessage == null) { + startPage(); return xhpcUserAccountStatementMapper.page(userid,userType,tenantId); } } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcAppUserController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcAppUserController.java index d8999905..0a7ed380 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcAppUserController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcAppUserController.java @@ -73,7 +73,6 @@ public class XhpcAppUserController extends BaseController { //@PreAuthorize(hasPermi = "app:user:page") @GetMapping("/page") public TableDataInfo page(HttpServletRequest request,String phone) { - startPage(); List> list = iXhpcAppUserUserService.selectAppUserList(request,phone); return getDataTable(list); } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommunityController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommunityController.java index 8accd938..e70eb708 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommunityController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommunityController.java @@ -11,6 +11,7 @@ import com.xhpc.user.service.IXhpcCommunityService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletRequest; import java.util.List; import java.util.Map; @@ -29,9 +30,8 @@ public class XhpcCommunityController extends BaseController { * 社区组树列表 */ @GetMapping("/list") - public TableDataInfo list(String name) { - startPage(); - List> list = xhpcCommunityService.list(name); + public TableDataInfo list(HttpServletRequest request, String name) { + List> list = xhpcCommunityService.list(request,name); return getDataTable(list); } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCustomersController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCustomersController.java index a372f622..baf20483 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCustomersController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCustomersController.java @@ -29,9 +29,8 @@ public class XhpcCustomersController extends BaseController { * 大客户组树列表 */ @GetMapping("/list") - public TableDataInfo list(String name) { - startPage(); - List> list = xhpcCustomersService.list(name); + public TableDataInfo list(HttpServletRequest request,String name) { + List> list = xhpcCustomersService.list(request,name); return getDataTable(list); } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcInternetUserController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcInternetUserController.java index 55e7aa99..249a49ec 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcInternetUserController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcInternetUserController.java @@ -173,6 +173,7 @@ public class XhpcInternetUserController extends BaseController { //@PreAuthorize(hasPermi = "user:internet:list") @GetMapping("/list") public TableDataInfo list(String name) { + startPage(); List> list = iXhpcInternetUserService.list(name); return getDataTable(list); } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcOperatorInternetBlacklistController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcOperatorInternetBlacklistController.java index ef090e2f..efc9cb8f 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcOperatorInternetBlacklistController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcOperatorInternetBlacklistController.java @@ -49,6 +49,7 @@ public class XhpcOperatorInternetBlacklistController extends BaseController { //@PreAuthorize(hasPermi = "operator:internet:list") @GetMapping("/list") public TableDataInfo list(@RequestParam String operatorId) { + startPage(); List> list = xhpcOperatorInternetBlacklistService.list(operatorId); return getDataTable(list); } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcStationInternetBlacklistController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcStationInternetBlacklistController.java index cc6dd9f7..6be2c863 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcStationInternetBlacklistController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcStationInternetBlacklistController.java @@ -59,16 +59,15 @@ public class XhpcStationInternetBlacklistController extends BaseController { //@PreAuthorize(hasPermi = "station:internet:list") @GetMapping("/list") public TableDataInfo list(@RequestParam String internetUserId) { + startPage(); List> list = iXhpcStationInternetBlacklistService.list(internetUserId); return getDataTable(list); } @GetMapping("/list1") public TableDataInfo list1(@RequestParam String internetUserId) { + startPage(); List> list = iXhpcStationInternetBlacklistService.list(internetUserId); - - - return getDataTable(list); } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcUserController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcUserController.java index 500de840..fc97e669 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcUserController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcUserController.java @@ -115,7 +115,6 @@ public class XhpcUserController extends BaseController { //@PreAuthorize(hasPermi = "user:operator:page") @GetMapping("/operator/page") public TableDataInfo operatorPage(String userName, String nickName, Long operatorId) { - startPage(); List> list = iXhpcUserService.selectOperatorUserList(userName, nickName, operatorId); return getDataTable(list); } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcCommunityMapper.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcCommunityMapper.java index b65c810d..2b64041f 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcCommunityMapper.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcCommunityMapper.java @@ -20,7 +20,7 @@ public interface XhpcCommunityMapper { * @param name 桩名称 * @return */ - List> list(@Param("name") String name); + List> list(@Param("name") String name,@Param("tenantId") String tenantId); /** * 添加社区组 diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcCustomersMapper.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcCustomersMapper.java index d758e985..5fef93b9 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcCustomersMapper.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcCustomersMapper.java @@ -25,7 +25,7 @@ public interface XhpcCustomersMapper { * @param name 桩名称 * @return */ - List> list(@Param("name") String name,@Param("operatorId") Long operatorId); + List> list(@Param("name") String name,@Param("operatorId") Long operatorId,@Param("tenantId") String tenantId); /** * 查询大客户组 diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcCommunityService.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcCommunityService.java index f1a12a81..11a5ab2c 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcCommunityService.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcCommunityService.java @@ -5,6 +5,7 @@ import com.xhpc.common.domain.XhpcChargingPile; import com.xhpc.user.domain.XhpcCommunity; import com.xhpc.user.domain.XhpcCommunityPersonnel; +import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.util.List; import java.util.Map; @@ -21,7 +22,7 @@ public interface IXhpcCommunityService { * @param name 桩名称 * @return */ - List> list(String name); + List> list(HttpServletRequest request, String name); /** * 新增社区组树 diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcCustomersService.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcCustomersService.java index a55526bc..d30fdaea 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcCustomersService.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcCustomersService.java @@ -21,7 +21,7 @@ public interface IXhpcCustomersService { * @param name 桩名称 * @return */ - List> list(String name); + List> list(HttpServletRequest request,String name); /** * 新增大客户组树 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 09124672..a700e5eb 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 @@ -11,6 +11,7 @@ import com.xhpc.common.core.enums.UserStatus; import com.xhpc.common.core.utils.SecurityUtils; import com.xhpc.common.core.utils.StringUtils; import com.xhpc.common.core.web.domain.AjaxResult; +import com.xhpc.common.core.web.service.BaseService; import com.xhpc.common.redis.service.RedisService; import com.xhpc.common.security.service.TokenService; import com.xhpc.common.util.UserTypeUtil; @@ -37,7 +38,7 @@ import java.util.Map; * @author ruoyi */ @Service -public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService { +public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserUserService { @Autowired private XhpcAppUserMapper xhpcAppUserMapper; @@ -88,7 +89,7 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService { @Override public List> selectAppUserList(HttpServletRequest request,String phone) { LoginUser logUser = logUserUtils.getLogUser(request); - + startPage(); return xhpcAppUserMapper.selectAppUserList(phone,logUser.getTenantId()); } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommunityServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommunityServiceImpl.java index 7f8926f5..463ac272 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommunityServiceImpl.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommunityServiceImpl.java @@ -1,8 +1,12 @@ package com.xhpc.user.service.impl; +import com.xhpc.common.core.domain.R; import com.xhpc.common.core.utils.SecurityUtils; import com.xhpc.common.core.web.domain.AjaxResult; +import com.xhpc.common.core.web.service.BaseService; +import com.xhpc.common.security.service.TokenService; import com.xhpc.common.util.UserTypeUtil; +import com.xhpc.system.api.model.LoginUser; import com.xhpc.user.domain.XhpcCommunity; import com.xhpc.user.domain.XhpcCommunityPersonnel; import com.xhpc.user.mapper.XhpcCommunityMapper; @@ -12,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; @@ -23,23 +28,25 @@ import java.util.Map; * @date 2021/12/20 9:59 */ @Service -public class XhpcCommunityServiceImpl implements IXhpcCommunityService { +public class XhpcCommunityServiceImpl extends BaseService implements IXhpcCommunityService { @Autowired private XhpcCommunityMapper xhpcCommunityMapper; @Autowired private IMechanismService mechanismService; + @Autowired + private TokenService tokenService; @Override - public List> list(String name) { + public List> list(HttpServletRequest request, String name) { Long userId = SecurityUtils.getUserId(); List> list =new ArrayList<>(); + LoginUser loginUser = tokenService.getLoginUser(request); if(userId !=null){ - Map landUser = xhpcCommunityMapper.getLandUser(userId); - if(landUser !=null && landUser.get("userType") !=null){ - if("00".equals(landUser.get("userType").toString())){ - list = xhpcCommunityMapper.list(name); - } + startPage(); + String userType = loginUser.getSysUser().getUserType(); + if(UserTypeUtil.SYS_USER_TYPE_ZERO.equals(userType)){ + list = xhpcCommunityMapper.list(name,loginUser.getTenantId()); } } return list; @@ -48,9 +55,9 @@ public class XhpcCommunityServiceImpl implements IXhpcCommunityService { @Override public AjaxResult addCommunity(XhpcCommunity xhpcCommunity) { - boolean judge = judgeXhpcCommunity(xhpcCommunity); - if(!judge){ - return AjaxResult.error("参数必填"); + R r= judgeXhpcCommunity(xhpcCommunity); + if(r.getCode() !=200){ + return AjaxResult.error(r.getMsg()); } //名称重复不能入库 Map communityById = xhpcCommunityMapper.getCommunityById(null, xhpcCommunity.getName(), null); @@ -89,9 +96,9 @@ public class XhpcCommunityServiceImpl implements IXhpcCommunityService { @Override public AjaxResult updateCommunity(XhpcCommunity xhpcCommunity) { - boolean judge = judgeXhpcCommunity(xhpcCommunity); - if(!judge){ - return AjaxResult.error("参数必填"); + R r = judgeXhpcCommunity(xhpcCommunity); + if(r.getCode()!=200){ + return AjaxResult.error(r.getMsg()); } //名称重复不能入库 Map communityById = xhpcCommunityMapper.getCommunityById(xhpcCommunity.getCommunityId(), xhpcCommunity.getName(), 2); @@ -127,9 +134,9 @@ public class XhpcCommunityServiceImpl implements IXhpcCommunityService { @Override @Transactional public AjaxResult addCommunityPersonnel(XhpcCommunityPersonnel xhpcCommunityPersonnel) { - boolean judge = judgeXhpcCommunityPersonnel(xhpcCommunityPersonnel); - if(!judge){ - return AjaxResult.error("参数必填"); + R r = judgeXhpcCommunityPersonnel(xhpcCommunityPersonnel); + if(r.getCode()!=200){ + return AjaxResult.error(r.getMsg()); } String phone = xhpcCommunityPersonnel.getPhone(); String account = xhpcCommunityPersonnel.getAccount(); @@ -162,9 +169,9 @@ public class XhpcCommunityServiceImpl implements IXhpcCommunityService { @Override public AjaxResult updateCommunityPersonnel(XhpcCommunityPersonnel xhpcCommunityPersonnel) { - boolean judge = judgeXhpcCommunityPersonnel(xhpcCommunityPersonnel); - if(!judge){ - return AjaxResult.error("参数必填"); + R r = judgeXhpcCommunityPersonnel(xhpcCommunityPersonnel); + if(r.getCode()!=200){ + return AjaxResult.error(r.getMsg()); } Long communityPersonnelId = xhpcCommunityPersonnel.getCommunityPersonnelId(); String phone = xhpcCommunityPersonnel.getPhone(); @@ -235,36 +242,36 @@ public class XhpcCommunityServiceImpl implements IXhpcCommunityService { return AjaxResult.error("充值金额必需大于0"); } - public boolean judgeXhpcCommunity(XhpcCommunity xhpcCommunity){ + public R judgeXhpcCommunity(XhpcCommunity xhpcCommunity){ if(xhpcCommunity.getName()==null || "".equals(xhpcCommunity.getName())){ - return false; + return R.fail("名称必填"); } if(xhpcCommunity.getContactName()==null || "".equals(xhpcCommunity.getContactName())){ - return false; + return R.fail("联系人必填"); } if(xhpcCommunity.getContactPhone()==null || "".equals(xhpcCommunity.getContactPhone())){ - return false; + return R.fail("联系人电话必填"); } if(xhpcCommunity.getAddress()==null || "".equals(xhpcCommunity.getAddress())){ - return false; + return R.fail("地址必填"); } - return true; + return R.ok(); } - public boolean judgeXhpcCommunityPersonnel(XhpcCommunityPersonnel xhpcCommunityPersonnel){ + public R judgeXhpcCommunityPersonnel(XhpcCommunityPersonnel xhpcCommunityPersonnel){ if(xhpcCommunityPersonnel.getName()==null || "".equals(xhpcCommunityPersonnel.getName())){ - return false; + return R.fail("名称必填"); } if(xhpcCommunityPersonnel.getAccount()==null || "".equals(xhpcCommunityPersonnel.getAccount()) || !"ST".equals(xhpcCommunityPersonnel.getAccount().substring(0,2))){ - return false; + return R.fail("账号必填且ST开头10位"); } if(xhpcCommunityPersonnel.getPhone()==null || "".equals(xhpcCommunityPersonnel.getPhone()) || xhpcCommunityPersonnel.getPhone().length()!=11){ - return false; + return R.fail("绑定手机号必填"); } - return true; + return R.ok(); } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCustomersServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCustomersServiceImpl.java index a7f59f76..d5c71d37 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCustomersServiceImpl.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCustomersServiceImpl.java @@ -1,7 +1,9 @@ package com.xhpc.user.service.impl; +import com.xhpc.common.core.domain.R; import com.xhpc.common.core.utils.SecurityUtils; import com.xhpc.common.core.web.domain.AjaxResult; +import com.xhpc.common.core.web.service.BaseService; import com.xhpc.common.security.service.TokenService; import com.xhpc.common.util.UserTypeUtil; import com.xhpc.system.api.model.LoginUser; @@ -27,7 +29,7 @@ import java.util.Map; * @date 2021/12/23 15:53 */ @Service -public class XhpcCustomersServiceImpl implements IXhpcCustomersService { +public class XhpcCustomersServiceImpl extends BaseService implements IXhpcCustomersService { @Autowired private XhpcCustomersMapper xhpcCustomersMapper; @@ -36,27 +38,24 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService { @Autowired private TokenService tokenService; @Override - public List> list(String name) { - Long userId = SecurityUtils.getUserId(); + public List> list(HttpServletRequest request,String name) { List> list =new ArrayList<>(); - if(userId !=null){ - Map landUser = xhpcCustomersMapper.getLandUser(userId); - if(landUser !=null && landUser.get("userType") !=null){ - if("00".equals(landUser.get("userType").toString()) ){ - list = xhpcCustomersMapper.list(name,null); - }else{ - list = xhpcCustomersMapper.list(name,Long.parseLong(landUser.get("operatorId").toString())); - } - } + LoginUser loginUser = tokenService.getLoginUser(request); + startPage(); + String userType = loginUser.getSysUser().getUserType(); + if(UserTypeUtil.SYS_USER_TYPE_ZERO.equals(userType)){ + list = xhpcCustomersMapper.list(name,null,loginUser.getTenantId()); + }else{ + list = xhpcCustomersMapper.list(name,loginUser.getSysUser().getOperatorId(),loginUser.getTenantId()); } return list; } @Override public AjaxResult addCustomers(HttpServletRequest request, XhpcCustomers xhpcCustomers) { - boolean b = judgeXhpcCustomers(xhpcCustomers); - if(!b){ - return AjaxResult.error("参数比传"); + R r = judgeXhpcCustomers(xhpcCustomers); + if(r.getCode()!=200){ + return AjaxResult.error(r.getMsg()); } //名称重复不能入库 Map communityById = xhpcCustomersMapper.getCustomersById(null, xhpcCustomers.getName(), null); @@ -113,9 +112,9 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService { @Override public AjaxResult updateCustomers(XhpcCustomers xhpcCustomers) { - boolean b = judgeXhpcCustomers(xhpcCustomers); - if(!b){ - return AjaxResult.error("参数比传"); + R r = judgeXhpcCustomers(xhpcCustomers); + if(r.getCode()!=200){ + return AjaxResult.error(r.getMsg()); } //名称重复不能入库 Map customersById = xhpcCustomersMapper.getCustomersById(xhpcCustomers.getCustomersId(), xhpcCustomers.getName(), 2); @@ -143,9 +142,9 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService { @Override public AjaxResult addCustomersPersonnel(XhpcCustomersPersonnel xhpcCustomersPersonnel) { - boolean b = judgeXhpcCustomersPersonnel(xhpcCustomersPersonnel); - if(b){ - return AjaxResult.error("参数比传"); + R r = judgeXhpcCustomersPersonnel(xhpcCustomersPersonnel); + if(r.getCode()!=200){ + return AjaxResult.error(r.getMsg()); } String phone = xhpcCustomersPersonnel.getPhone(); String account = xhpcCustomersPersonnel.getAccount(); @@ -182,9 +181,9 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService { @Override public AjaxResult updateCustomersPersonnel(XhpcCustomersPersonnel xhpcCustomersPersonnel) { - boolean b = judgeXhpcCustomersPersonnel(xhpcCustomersPersonnel); - if(b){ - return AjaxResult.error("参数比传"); + R r = judgeXhpcCustomersPersonnel(xhpcCustomersPersonnel); + if(r.getCode()!=200){ + return AjaxResult.error(r.getMsg()); } Long customersPersonnelId = xhpcCustomersPersonnel.getCustomersPersonnelId(); String phone = xhpcCustomersPersonnel.getPhone(); @@ -252,35 +251,35 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService { xhpcCustomersMapper.updateCustomersPersonnelStatus(xhpcCustomersPersonnel.getCustomersPersonnelId(),xhpcCustomersPersonnel.getStatus()); } - public boolean judgeXhpcCustomers(XhpcCustomers xhpcCustomers){ + public R judgeXhpcCustomers(XhpcCustomers xhpcCustomers){ if(xhpcCustomers.getName()==null || "".equals(xhpcCustomers.getName())){ - return false; + return R.fail("名称必填"); } if(xhpcCustomers.getContactName()==null || "".equals(xhpcCustomers.getContactName())){ - return false; + return R.fail("联系人必填"); } if(xhpcCustomers.getContactPhone()==null || "".equals(xhpcCustomers.getContactPhone())){ - return false; + return R.fail("联系人电话必填"); } if(xhpcCustomers.getAddress()==null || "".equals(xhpcCustomers.getAddress())){ - return false; + return R.fail("地址必填"); } - return true; + return R.ok(); } - public boolean judgeXhpcCustomersPersonnel(XhpcCustomersPersonnel xhpcCustomersPersonnel){ + public R judgeXhpcCustomersPersonnel(XhpcCustomersPersonnel xhpcCustomersPersonnel){ if(xhpcCustomersPersonnel.getName()==null || "".equals(xhpcCustomersPersonnel.getName())){ - return false; + return R.fail("名称必填"); } if(xhpcCustomersPersonnel.getAccount()==null || "".equals(xhpcCustomersPersonnel.getAccount()) || "BE".equals(xhpcCustomersPersonnel.getAccount().substring(0,2))){ - return false; + return R.fail("账号必填且BE开头10位"); } if(xhpcCustomersPersonnel.getPhone()==null || "".equals(xhpcCustomersPersonnel.getPhone()) || xhpcCustomersPersonnel.getPhone().length() !=11){ - return false; + return R.fail("绑定手机号必填"); } - return true; + return R.ok(); } } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcUserServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcUserServiceImpl.java index ca0dd144..e365a4a8 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcUserServiceImpl.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcUserServiceImpl.java @@ -4,6 +4,7 @@ import com.xhpc.common.core.constant.StatusConstants; import com.xhpc.common.core.constant.UserConstants; import com.xhpc.common.core.utils.SecurityUtils; import com.xhpc.common.core.utils.StringUtils; +import com.xhpc.common.core.web.service.BaseService; import com.xhpc.system.api.domain.SysRole; import com.xhpc.system.api.domain.SysUser; import com.xhpc.user.domain.SysUserRole; @@ -23,7 +24,7 @@ import java.util.Map; * @author ruoyi */ @Service -public class XhpcUserServiceImpl implements IXhpcUserService { +public class XhpcUserServiceImpl extends BaseService implements IXhpcUserService { @Autowired private XhpcUserMapper xhpcUserMapper; @@ -74,6 +75,7 @@ public class XhpcUserServiceImpl implements IXhpcUserService { public List> selectOperatorUserList(String userName, String nickName, Long operatorId) { Long userId = SecurityUtils.getUserId(); SysUser sysUser = xhpcUserMapper.selectUserByUserId(userId); + startPage(); if (StatusConstants.SYSTEM_USER_TYPE.equals(sysUser.getUserType())) { return xhpcUserMapper.selectOperatorUserList(userName, nickName, operatorId,sysUser.getUserType()); } else { diff --git a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommunityMapper.xml b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommunityMapper.xml index 38fa96e1..ef6c311f 100644 --- a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommunityMapper.xml +++ b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommunityMapper.xml @@ -2,6 +2,7 @@ + @@ -37,6 +38,9 @@ and name like CONCAT('%',#{name},'%') + + and tenant_id=#{tenantId} + order by create_time desc @@ -147,8 +151,8 @@ contact_name = #{contactName}, contact_phone = #{contactPhone}, address = #{address}, - address = #{dimension}, - address = #{status}, + dimension = #{dimension}, + status = #{status}, del_flag = #{delFlag}, create_time = #{createTime}, create_by = #{createBy}, diff --git a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCustomersMapper.xml b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCustomersMapper.xml index 4d156835..a4e4ff34 100644 --- a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCustomersMapper.xml +++ b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCustomersMapper.xml @@ -39,6 +39,9 @@ and operator_id=#{operatorId} + + and tenant_id=#{tenantId} + order by create_time desc @@ -142,8 +145,8 @@ contact_name = #{contactName}, contact_phone = #{contactPhone}, address = #{address}, - address = #{dimension}, - address = #{status}, + dimension = #{dimension}, + status = #{status}, del_flag = #{delFlag}, create_time = #{createTime}, create_by = #{createBy}, From 830d13a927feb18792369a48d71a5177b4bbbdb0 Mon Sep 17 00:00:00 2001 From: yuyang Date: Wed, 12 Jan 2022 16:24:45 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E5=92=8C=E7=A7=9F=E6=88=B7=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xhpc/common/util/UserTypeUtil.java | 3 + .../controller/XhpcAgreementController.java | 7 + .../controller/XhpcDictBizController.java | 3 + .../controller/XhpcEtTokenController.java | 4 + .../controller/XhpcHelpController.java | 6 + .../XhpcServiceDataUpdateController.java | 3 + .../resources/mapper/XhpcAgreementMapper.xml | 1 - .../resources/mapper/XhpcEtTokenMapper.xml | 1 - xhpc-modules/xhpc-order/pom.xml | 4 + .../order/api/XhpcChargeOrderController.java | 3 - ...ryOrderReconciliationStatusController.java | 3 + ...pcHistoryOrderSortingStatusController.java | 3 + .../controller/XhpcStatisticsController.java | 73 ++-- .../mapper/XhpcStatisticsServiceMapper.java | 24 +- .../order/service/IXhpcStatisticsService.java | 37 +- .../impl/XhpcStatisticsServiceImpl.java | 356 +++++++++--------- .../resources/mapper/XhpcStatisticsMapper.xml | 38 +- xhpc-modules/xhpc-payment/pom.xml | 4 + .../controller/AlipayPaymentController.java | 3 + .../controller/WxPaymentController.java | 3 + .../controller/XhpcRefundAuditController.java | 3 + .../controller/XhpcRefundOrderController.java | 3 + .../controller/XhpcCommunityController.java | 7 + .../controller/XhpcCustomersController.java | 10 + .../XhpcInternetUserController.java | 6 + .../controller/XhpcOperatorController.java | 6 + ...pcOperatorInternetBlacklistController.java | 3 + ...hpcStationInternetBlacklistController.java | 3 + .../user/controller/XhpcUserController.java | 9 + 29 files changed, 374 insertions(+), 255 deletions(-) diff --git a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/UserTypeUtil.java b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/UserTypeUtil.java index d42975d1..f8e605f9 100644 --- a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/UserTypeUtil.java +++ b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/UserTypeUtil.java @@ -88,5 +88,8 @@ public class UserTypeUtil { */ public static final String SYS_USER_TYPE_ZERO = "00"; public static final String SYS_USER_TYPE_ONE = "01"; + public static final String SYS_USER_TYPE_TWO = "02"; public static final String SYS_USER_TYPE_THREE = "03"; + + public static final Long SYS_USER_TYPE_ADMIN = 1L; } diff --git a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcAgreementController.java b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcAgreementController.java index a2756b26..1e63467d 100644 --- a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcAgreementController.java +++ b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcAgreementController.java @@ -3,6 +3,8 @@ package com.xhpc.general.controller; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.general.domain.XhpcAgreement; import com.xhpc.general.service.IXhpcAgreementService; import org.springframework.beans.factory.annotation.Autowired; @@ -20,18 +22,22 @@ public class XhpcAgreementController extends BaseController { @Autowired IXhpcAgreementService iXhpcAgreementService; + + @Log(title = "协议-删除", businessType = BusinessType.DELETE) @PostMapping("/delete") public AjaxResult delete(@RequestBody XhpcAgreement xhpcAgreement){ return iXhpcAgreementService.deleteAgreementItem(xhpcAgreement.getAgreementId()); } + @Log(title = "协议-添加", businessType = BusinessType.DELETE) @PostMapping("/add") public AjaxResult add(@RequestBody XhpcAgreement xhpcAgreement){ return iXhpcAgreementService.insertAgreementItem(xhpcAgreement.getTitle(),xhpcAgreement.getType(),xhpcAgreement.getContent()); } + @Log(title = "协议-编辑", businessType = BusinessType.UPDATE) @PostMapping("/update") public AjaxResult update(@RequestBody XhpcAgreement xhpcAgreement){ @@ -51,6 +57,7 @@ public class XhpcAgreementController extends BaseController { return AjaxResult.success(iXhpcAgreementService.selectAgreementItem(agreementId)); } + @GetMapping("/getContent") public AjaxResult getContent(@RequestParam Integer type){ diff --git a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcDictBizController.java b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcDictBizController.java index ae6e2d50..d92d5ea2 100644 --- a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcDictBizController.java +++ b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcDictBizController.java @@ -3,6 +3,8 @@ package com.xhpc.general.controller; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.general.domain.XhpcDictionary; import com.xhpc.general.dto.XhpcDictionaryChild; import com.xhpc.general.service.IXhpcDictBizService; @@ -42,6 +44,7 @@ public class XhpcDictBizController extends BaseController { * @param sort the dictionary's sortValue * @return */ + @Log(title = "字典-添加", businessType = BusinessType.INSERT) @PostMapping("/addMainItem") public AjaxResult addMainDictionaryItem(@RequestBody XhpcDictionary xhpcDictionary){ diff --git a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcEtTokenController.java b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcEtTokenController.java index 16360e06..96d6ded3 100644 --- a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcEtTokenController.java +++ b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcEtTokenController.java @@ -3,6 +3,8 @@ package com.xhpc.general.controller; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.general.domain.EtTokenEntity; import com.xhpc.general.service.IXhpcEtTokenService; import org.springframework.beans.factory.annotation.Autowired; @@ -28,12 +30,14 @@ public class XhpcEtTokenController extends BaseController { return getDataTable(iXhpcEtTokenService.list(operatorId, operatorId3irdpty)); } + @Log(title = "第三方token-删除", businessType = BusinessType.DELETE) @PostMapping(value = "/delete") public AjaxResult delete(@RequestBody EtTokenEntity etTokenEntity){ return iXhpcEtTokenService.delete(etTokenEntity.getId()); } + @Log(title = "第三方token-添加", businessType = BusinessType.INSERT) @PostMapping(value = "/add") public AjaxResult add(@RequestBody EtTokenEntity etTokenEntity){ diff --git a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcHelpController.java b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcHelpController.java index a17144d5..6901de2d 100644 --- a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcHelpController.java +++ b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcHelpController.java @@ -3,6 +3,8 @@ package com.xhpc.general.controller; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.general.domain.HelpEntity; import com.xhpc.general.service.IXhpcHelpService; import org.springframework.beans.factory.annotation.Autowired; @@ -22,18 +24,22 @@ public class XhpcHelpController extends BaseController { @Autowired IXhpcHelpService iXhpcHelpService; + + @Log(title = "帮助-删除", businessType = BusinessType.DELETE) @PostMapping("/delete") public AjaxResult deleteHelpItem(@RequestBody HelpEntity helpEntity){ return iXhpcHelpService.deleteHelpItem(helpEntity.getHelpId()); } + @Log(title = "帮助-添加", businessType = BusinessType.INSERT) @PostMapping("/add") public AjaxResult insertHelpItem(@RequestBody HelpEntity helpEntity){ return iXhpcHelpService.insertHelpItem(helpEntity.getTitle(),helpEntity.getContent(),helpEntity.getType()); } + @Log(title = "帮助-修改", businessType = BusinessType.UPDATE) @PostMapping("/update") public AjaxResult updateHelpItem(@RequestBody HelpEntity helpEntity){ diff --git a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcServiceDataUpdateController.java b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcServiceDataUpdateController.java index 80703e03..58bf8604 100644 --- a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcServiceDataUpdateController.java +++ b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcServiceDataUpdateController.java @@ -1,6 +1,8 @@ package com.xhpc.general.controller; import com.xhpc.common.core.web.domain.AjaxResult; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.general.service.IXhpcServiceDataUpdateService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -23,6 +25,7 @@ public class XhpcServiceDataUpdateController { return AjaxResult.success(xhpcServiceDataUpdateService.list()); } + @Log(title = "小程序设置-修改", businessType = BusinessType.UPDATE) @PostMapping("/update") public AjaxResult update(@RequestParam(required = false) String SOC, @RequestParam(required = false) String version, @RequestParam(required = false) String phone, @RequestParam(required = false) String aliyunMessageCount) { diff --git a/xhpc-modules/xhpc-general/src/main/resources/mapper/XhpcAgreementMapper.xml b/xhpc-modules/xhpc-general/src/main/resources/mapper/XhpcAgreementMapper.xml index 4966c1ec..533c8494 100644 --- a/xhpc-modules/xhpc-general/src/main/resources/mapper/XhpcAgreementMapper.xml +++ b/xhpc-modules/xhpc-general/src/main/resources/mapper/XhpcAgreementMapper.xml @@ -19,7 +19,6 @@ - update xhpc_agreement set del_flag=1 where agreement_id=#{agreementId} diff --git a/xhpc-modules/xhpc-general/src/main/resources/mapper/XhpcEtTokenMapper.xml b/xhpc-modules/xhpc-general/src/main/resources/mapper/XhpcEtTokenMapper.xml index 94ab0063..823957d3 100644 --- a/xhpc-modules/xhpc-general/src/main/resources/mapper/XhpcEtTokenMapper.xml +++ b/xhpc-modules/xhpc-general/src/main/resources/mapper/XhpcEtTokenMapper.xml @@ -34,7 +34,6 @@ - delete from et_auth_sec_token where id = #{id} diff --git a/xhpc-modules/xhpc-order/pom.xml b/xhpc-modules/xhpc-order/pom.xml index 121691b4..f1a31b0a 100644 --- a/xhpc-modules/xhpc-order/pom.xml +++ b/xhpc-modules/xhpc-order/pom.xml @@ -99,6 +99,10 @@ com.squareup.okhttp3 okhttp + + com.ruoyi + ruoyi-common-log + diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcChargeOrderController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcChargeOrderController.java index 78a7a2e0..142be756 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcChargeOrderController.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcChargeOrderController.java @@ -1,6 +1,5 @@ package com.xhpc.order.api; -import cn.hutool.core.date.DateUtil; import com.alibaba.fastjson.JSONObject; import com.xhpc.common.api.WebSocketService; import com.xhpc.common.core.web.controller.BaseController; @@ -22,7 +21,6 @@ import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; -import java.util.Calendar; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -68,7 +66,6 @@ public class XhpcChargeOrderController extends BaseController { } - /** * 启动充电 * @param userId diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderReconciliationStatusController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderReconciliationStatusController.java index 04eeeede..01aaefeb 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderReconciliationStatusController.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderReconciliationStatusController.java @@ -4,6 +4,8 @@ import com.xhpc.common.core.utils.StringUtils; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.order.service.IXhpcHistoryOrderReconciliationStatusService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -25,6 +27,7 @@ public class XhpcHistoryOrderReconciliationStatusController extends BaseControll * 修改对账状态 * @return */ + @Log(title = "对账-修改对账状态", businessType = BusinessType.UPDATE) @PostMapping("/status") @ApiOperation(value = "修改对账状态") public AjaxResult status(@RequestBody Map map) { diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderSortingStatusController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderSortingStatusController.java index cbb246fe..6c097111 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderSortingStatusController.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderSortingStatusController.java @@ -5,6 +5,8 @@ import com.xhpc.common.core.utils.StringUtils; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.order.service.IXhpcHistoryOrderSortingStatusService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -27,6 +29,7 @@ public class XhpcHistoryOrderSortingStatusController extends BaseController { * 修改清分状态 * @return */ + @Log(title = "清分-修改清分状态", businessType = BusinessType.UPDATE) @PostMapping("/status") @ApiOperation(value = "修改清分状态") public AjaxResult status(@RequestBody Map map) { diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcStatisticsController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcStatisticsController.java index c99ff053..52bc164b 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcStatisticsController.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcStatisticsController.java @@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.UnsupportedEncodingException; @@ -42,9 +43,9 @@ public class XhpcStatisticsController extends BaseController { * @return */ @GetMapping("/getTimeIntervalPage") - public TableDataInfo getTimeIntervalPage(String chargingStationIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + public TableDataInfo getTimeIntervalPage(HttpServletRequest request,String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) { - List> list = xhpcStatisticsService.getTimeIntervalPage(chargingStationIds,internetUserId,operatorId,startTime,endTime,userId,type); + List> list = xhpcStatisticsService.getTimeIntervalPage(request,chargingStationIds,internetUserId,operatorId,startTime,endTime,userId,type); return getDataTable(list); } @@ -60,9 +61,9 @@ public class XhpcStatisticsController extends BaseController { * @return */ @GetMapping("/getDateIntervalPage") - public TableDataInfo getDateIntervalPage(String chargingStationIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + public TableDataInfo getDateIntervalPage(HttpServletRequest request,String chargingStationIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) { - List> list = xhpcStatisticsService.getDateIntervalPage(chargingStationIds,internetUserId,operatorId,startTime,endTime,userId,type); + List> list = xhpcStatisticsService.getDateIntervalPage(request,chargingStationIds,internetUserId,operatorId,startTime,endTime,userId,type); return getDataTable(list); } /** @@ -78,9 +79,9 @@ public class XhpcStatisticsController extends BaseController { * @return */ @GetMapping("/getStationIntervalPage") - public TableDataInfo getStationIntervalPage(String chargingStationIds,String operatorIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + public TableDataInfo getStationIntervalPage(HttpServletRequest request,String chargingStationIds,String operatorIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) { - List> list = xhpcStatisticsService.getStationIntervalPage(chargingStationIds,operatorIds,internetUserId,operatorId,startTime,endTime,userId,type); + List> list = xhpcStatisticsService.getStationIntervalPage(request,chargingStationIds,operatorIds,internetUserId,operatorId,startTime,endTime,userId,type); return getDataTable(list); } @@ -95,9 +96,9 @@ public class XhpcStatisticsController extends BaseController { * @return */ @GetMapping("/getOperatorIntervalPage") - public TableDataInfo getOperatorIntervalPage(String operatorIds, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + public TableDataInfo getOperatorIntervalPage(HttpServletRequest request,String operatorIds, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) { - List> list = xhpcStatisticsService.getOperatorIntervalPage(operatorIds,operatorId,startTime,endTime,userId,type); + List> list = xhpcStatisticsService.getOperatorIntervalPage(request,operatorIds,operatorId,startTime,endTime,userId,type); return getDataTable(list); } @@ -112,10 +113,10 @@ public class XhpcStatisticsController extends BaseController { * @return */ @GetMapping("/getInternetUserIntervalPage") - public TableDataInfo getInternetUserIntervalPage(String internetUserIds,Long internetUserId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + public TableDataInfo getInternetUserIntervalPage(HttpServletRequest request,String internetUserIds,Long internetUserId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) { startPage(); - List> list = xhpcStatisticsService.getInternetUserIntervalPage(internetUserIds,internetUserId,startTime,endTime,userId,type); + List> list = xhpcStatisticsService.getInternetUserIntervalPage(request,internetUserIds,internetUserId,startTime,endTime,userId,type); return getDataTable(list); } @@ -132,9 +133,9 @@ public class XhpcStatisticsController extends BaseController { * @return */ @GetMapping("/getTerminalIntervalPage") - public TableDataInfo getTerminalIntervalPage(String chargingStationId,String terminalId,Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + public TableDataInfo getTerminalIntervalPage(HttpServletRequest request,String chargingStationId,String terminalId,Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) { - List> list = xhpcStatisticsService.getTerminalIntervalPage(chargingStationId,terminalId,operatorId,startTime,endTime,userId,type); + List> list = xhpcStatisticsService.getTerminalIntervalPage(request,chargingStationId,terminalId,operatorId,startTime,endTime,userId,type); return getDataTable(list); } @@ -146,12 +147,12 @@ public class XhpcStatisticsController extends BaseController { * @return */ @GetMapping("/getChargingStationList") - public AjaxResult getChargingStationList(Long operatorId, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + public AjaxResult getChargingStationList(HttpServletRequest request,Long operatorId, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) { if (type == null || type==3) { return AjaxResult.success(); } - return xhpcStatisticsService.getChargingStationList(operatorId, userId, type); + return xhpcStatisticsService.getChargingStationList(request,operatorId, userId, type); } /** @@ -162,12 +163,12 @@ public class XhpcStatisticsController extends BaseController { * @return */ @GetMapping("/getOperatorList") - public AjaxResult getOperatorList(Long operatorId, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + public AjaxResult getOperatorList(HttpServletRequest request,Long operatorId, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) { if (type == null || type==3) { return AjaxResult.success(); } - return xhpcStatisticsService.getOperatorList(operatorId, userId, type); + return xhpcStatisticsService.getOperatorList(request,operatorId, userId, type); } /** @@ -178,12 +179,12 @@ public class XhpcStatisticsController extends BaseController { * @return */ @GetMapping("/getInternetUserIList") - public AjaxResult getInternetUserIList(Long internetUserId, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + public AjaxResult getInternetUserIList(HttpServletRequest request,Long internetUserId, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) { if (type == null || type==2) { return AjaxResult.success(); } - return xhpcStatisticsService.getInternetUserIList(internetUserId, userId, type); + return xhpcStatisticsService.getInternetUserIList(request,internetUserId, userId, type); } /** @@ -194,11 +195,11 @@ public class XhpcStatisticsController extends BaseController { * @return */ @GetMapping("/getTerminalList") - public AjaxResult getTerminalList(Long chargingStationId, @RequestParam("userId") Long userId, @RequestParam("type") Integer type) { + public AjaxResult getTerminalList(HttpServletRequest request,Long chargingStationId, @RequestParam("userId") Long userId, @RequestParam("type") Integer type) { if (type == null || type == 3) { return AjaxResult.success(); } - return xhpcStatisticsService.getTerminalList(chargingStationId, userId, type); + return xhpcStatisticsService.getTerminalList(request,chargingStationId, userId, type); } /** @@ -208,8 +209,8 @@ public class XhpcStatisticsController extends BaseController { * @return */ @GetMapping("/getSourceList") - public AjaxResult getSourceList(@RequestParam("userId") Long userId, @RequestParam("type") Integer type) { - return xhpcStatisticsService.getSourceList(userId, type); + public AjaxResult getSourceList(HttpServletRequest request,@RequestParam("userId") Long userId, @RequestParam("type") Integer type) { + return xhpcStatisticsService.getSourceList(request,userId, type); } /** @@ -220,9 +221,9 @@ public class XhpcStatisticsController extends BaseController { * @return */ @GetMapping("/getSumSourceList") - public TableDataInfo getSumSourceList(String startTime, String endTime, String internetUserIds,@RequestParam("userId") Long userId, @RequestParam("type") Integer type, String chargingStationIds) { + public TableDataInfo getSumSourceList(HttpServletRequest request,String startTime, String endTime, String internetUserIds,@RequestParam("userId") Long userId, @RequestParam("type") Integer type, String chargingStationIds) { startPage(); - List> list = xhpcStatisticsService.getSumSourceList(startTime,endTime,internetUserIds,userId, type,chargingStationIds); + List> list = xhpcStatisticsService.getSumSourceList(request,startTime,endTime,internetUserIds,userId, type,chargingStationIds); return getDataTable(list); } @@ -242,8 +243,8 @@ public class XhpcStatisticsController extends BaseController { * @return */ @PostMapping("/timeInterval/export") - public void timeIntervalExport(HttpServletResponse response, String chargingStationIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) throws IOException { - xhpcStatisticsService.timeIntervalExport(response, chargingStationIds,internetUserId,operatorId,startTime,endTime,userId,type); + public void timeIntervalExport(HttpServletRequest request,HttpServletResponse response, String chargingStationIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) throws IOException { + xhpcStatisticsService.timeIntervalExport(request,response, chargingStationIds,internetUserId,operatorId,startTime,endTime,userId,type); } /** @@ -258,8 +259,8 @@ public class XhpcStatisticsController extends BaseController { * @return */ @PostMapping("/dateInterval/export") - public void dateIntervalExport(HttpServletResponse response, String chargingStationIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) throws IOException { - xhpcStatisticsService.dateIntervalExport(response, chargingStationIds,internetUserId,operatorId,startTime,endTime,userId,type); + public void dateIntervalExport(HttpServletRequest request,HttpServletResponse response, String chargingStationIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) throws IOException { + xhpcStatisticsService.dateIntervalExport(request,response, chargingStationIds,internetUserId,operatorId,startTime,endTime,userId,type); } /** * 电站统计导出 @@ -274,8 +275,8 @@ public class XhpcStatisticsController extends BaseController { * @return */ @PostMapping("/stationInterval/export") - public void stationIntervalExport(HttpServletResponse response, String chargingStationIds,String operatorIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) throws IOException { - xhpcStatisticsService.stationIntervalExport(response, chargingStationIds,operatorIds,internetUserId,operatorId,startTime,endTime,userId,type); + public void stationIntervalExport(HttpServletRequest request,HttpServletResponse response, String chargingStationIds,String operatorIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) throws IOException { + xhpcStatisticsService.stationIntervalExport(request,response, chargingStationIds,operatorIds,internetUserId,operatorId,startTime,endTime,userId,type); } /** @@ -289,8 +290,8 @@ public class XhpcStatisticsController extends BaseController { * @return */ @PostMapping("/operatorInterval/export") - public void operatorIntervalExport(HttpServletResponse response, String operatorIds, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) throws IOException { - xhpcStatisticsService.operatorIntervalExport(response, operatorIds,operatorId,startTime,endTime,userId,type); + public void operatorIntervalExport(HttpServletRequest request,HttpServletResponse response, String operatorIds, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) throws IOException { + xhpcStatisticsService.operatorIntervalExport(request,response, operatorIds,operatorId,startTime,endTime,userId,type); } /** @@ -298,8 +299,8 @@ public class XhpcStatisticsController extends BaseController { * @return */ @PostMapping("/internetUserInterval/export") - public void internetUserIntervalExport(HttpServletResponse response, String startTime, String endTime,String internetUserIds, @RequestParam("userId") Long userId, @RequestParam("type")Integer type, String chargingStationIds) throws IOException { - xhpcStatisticsService.getSumSourceListExport(response, startTime,endTime,internetUserIds,userId,type,chargingStationIds); + public void internetUserIntervalExport(HttpServletRequest request,HttpServletResponse response, String startTime, String endTime,String internetUserIds, @RequestParam("userId") Long userId, @RequestParam("type")Integer type, String chargingStationIds) throws IOException { + xhpcStatisticsService.getSumSourceListExport(request,response, startTime,endTime,internetUserIds,userId,type,chargingStationIds); } @@ -315,8 +316,8 @@ public class XhpcStatisticsController extends BaseController { * @return */ @PostMapping("/terminalInterval/export") - public void terminalIntervalExport(HttpServletResponse response, String chargingStationId,String terminalId,Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) throws IOException { - xhpcStatisticsService.terminalIntervalExport(response, chargingStationId,terminalId,operatorId,startTime,endTime,userId,type); + public void terminalIntervalExport(HttpServletRequest request,HttpServletResponse response, String chargingStationId,String terminalId,Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) throws IOException { + xhpcStatisticsService.terminalIntervalExport(request,response, chargingStationId,terminalId,operatorId,startTime,endTime,userId,type); } } diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcStatisticsServiceMapper.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcStatisticsServiceMapper.java index a3667492..b36de127 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcStatisticsServiceMapper.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcStatisticsServiceMapper.java @@ -27,7 +27,7 @@ public interface XhpcStatisticsServiceMapper { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getTimeIntervalPage(@Param("chargingStationIds") List chargingStationIds,@Param("internetUserId") Long internetUserId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type,@Param("userId") Long userId); + List> getTimeIntervalPage(@Param("chargingStationIds") List chargingStationIds,@Param("internetUserId") Long internetUserId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type,@Param("userId") Long userId,@Param("tenantId")String tenantId); /** @@ -40,7 +40,7 @@ public interface XhpcStatisticsServiceMapper { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getDateIntervalPage(@Param("chargingStationIds") List chargingStationIds,@Param("internetUserId") Long internetUserId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type,@Param("userId")Long userId); + List> getDateIntervalPage(@Param("chargingStationIds") List chargingStationIds,@Param("internetUserId") Long internetUserId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type,@Param("userId")Long userId,@Param("tenantId")String tenantId); /** * 电站统计 @@ -53,7 +53,7 @@ public interface XhpcStatisticsServiceMapper { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getStationIntervalPage(@Param("chargingStationIds") List chargingStationIds,@Param("operatorUserId") List operatorUserId,@Param("internetUserId") Long internetUserId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type,@Param("userId") Long userId); + List> getStationIntervalPage(@Param("chargingStationIds") List chargingStationIds,@Param("operatorUserId") List operatorUserId,@Param("internetUserId") Long internetUserId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type,@Param("userId") Long userId,@Param("tenantId")String tenantId); /** * 运营商统计 @@ -64,7 +64,7 @@ public interface XhpcStatisticsServiceMapper { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getOperatorIntervalPage(@Param("operatorUserId") List operatorUserId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type,@Param("userId") Long userId); + List> getOperatorIntervalPage(@Param("operatorUserId") List operatorUserId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type,@Param("userId") Long userId,@Param("tenantId")String tenantId); /** * 流量方统计 @@ -75,7 +75,7 @@ public interface XhpcStatisticsServiceMapper { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getInternetUserIntervalPage(@Param("internetIds") List internetIds,@Param("internetUserId") Long internetUserId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type,@Param("userId") Long userId); + List> getInternetUserIntervalPage(@Param("internetIds") List internetIds,@Param("internetUserId") Long internetUserId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type,@Param("userId") Long userId,@Param("tenantId")String tenantId); /** @@ -88,7 +88,7 @@ public interface XhpcStatisticsServiceMapper { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getTerminalIntervalPage(@Param("chargingStationId") String chargingStationId,@Param("terminalId") String terminalId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type,@Param("userId") Long userId); + List> getTerminalIntervalPage(@Param("chargingStationId") String chargingStationId,@Param("terminalId") String terminalId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type,@Param("userId") Long userId,@Param("tenantId")String tenantId); /** @@ -98,7 +98,7 @@ public interface XhpcStatisticsServiceMapper { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getChargingStationList(@Param("operatorId")Long operatorId,@Param("userId")Long userId,@Param("type")Integer type); + List> getChargingStationList(@Param("operatorId")Long operatorId,@Param("userId")Long userId,@Param("type")Integer type,@Param("tenantId")String tenantId); /** * 运营商列表 @@ -107,7 +107,7 @@ public interface XhpcStatisticsServiceMapper { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getOperatorList(@Param("operatorId")Long operatorId,@Param("userId")Long userId,@Param("type")Integer type); + List> getOperatorList(@Param("operatorId")Long operatorId,@Param("userId")Long userId,@Param("type")Integer type,@Param("tenantId")String tenantId); /** @@ -117,7 +117,7 @@ public interface XhpcStatisticsServiceMapper { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getInternetUserIList(@Param("internetUserId")Long internetUserId,@Param("userId")Long userId,@Param("type")Integer type); + List> getInternetUserIList(@Param("internetUserId")Long internetUserId,@Param("userId")Long userId,@Param("type")Integer type,@Param("tenantId")String tenantId); /** * 终端列表 @@ -126,7 +126,7 @@ public interface XhpcStatisticsServiceMapper { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getTerminalList(@Param("chargingStationId")Long chargingStationId,@Param("userId")Long userId,@Param("type")Integer type); + List> getTerminalList(@Param("chargingStationId")Long chargingStationId,@Param("userId")Long userId,@Param("type")Integer type,@Param("tenantId")String tenantId); /** * 添加时段订单统计 @@ -144,7 +144,7 @@ public interface XhpcStatisticsServiceMapper { * 获取流量方列表 * @return */ - List> getInternetList(@Param("userId")Long userId); + List> getInternetList(@Param("userId")Long userId,@Param("tenantId")String tenantId); /** @@ -153,7 +153,7 @@ public interface XhpcStatisticsServiceMapper { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getSumSourceList(@Param("startTime")String startTime, @Param("endTime")String endTime,@Param("sourceIds")List sourceIds, @Param("userId")Long userId, @Param("type")Integer type,@Param("chargingStationIdList")List chargingStationIdList); + List> getSumSourceList(@Param("startTime")String startTime, @Param("endTime")String endTime,@Param("sourceIds")List sourceIds, @Param("userId")Long userId, @Param("type")Integer type,@Param("chargingStationIdList")List chargingStationIdList,@Param("tenantId")String tenantId); /** * 获取登陆用户信息 diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcStatisticsService.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcStatisticsService.java index 4cf4c5c9..2210ef8f 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcStatisticsService.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcStatisticsService.java @@ -6,6 +6,7 @@ import com.xhpc.order.domain.XhpcStatisticsTimeInterval; import org.springframework.web.bind.annotation.RequestParam; import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.List; @@ -29,7 +30,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getTimeIntervalPage(String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type); + List> getTimeIntervalPage(HttpServletRequest request,String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type); /** @@ -43,7 +44,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getDateIntervalPage(String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type); + List> getDateIntervalPage(HttpServletRequest request,String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type); /** * 电站统计 @@ -57,7 +58,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getStationIntervalPage(String chargingStationIds,String operatorIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type); + List> getStationIntervalPage(HttpServletRequest request,String chargingStationIds,String operatorIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type); /** * 运营商统计 @@ -69,7 +70,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getOperatorIntervalPage(String operatorIds,Long operatorId, String startTime, String endTime, Long userId, Integer type); + List> getOperatorIntervalPage(HttpServletRequest request,String operatorIds,Long operatorId, String startTime, String endTime, Long userId, Integer type); /** @@ -82,7 +83,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getInternetUserIntervalPage(String internetUserIds, Long internetUserId, String startTime, String endTime, Long userId, Integer type); + List> getInternetUserIntervalPage(HttpServletRequest request,String internetUserIds, Long internetUserId, String startTime, String endTime, Long userId, Integer type); /** @@ -96,7 +97,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getTerminalIntervalPage(String chargingStationId, String terminalId, Long operatorId, String startTime, String endTime, Long userId, Integer type); + List> getTerminalIntervalPage(HttpServletRequest request,String chargingStationId, String terminalId, Long operatorId, String startTime, String endTime, Long userId, Integer type); /** * 电站列表 @@ -105,7 +106,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - AjaxResult getChargingStationList(Long operatorId,Long userId,Integer type); + AjaxResult getChargingStationList(HttpServletRequest request,Long operatorId,Long userId,Integer type); /** * 运营商列表 @@ -114,7 +115,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - AjaxResult getOperatorList(Long operatorId,Long userId,Integer type); + AjaxResult getOperatorList(HttpServletRequest request,Long operatorId,Long userId,Integer type); /** * 流量方列表 @@ -123,7 +124,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - AjaxResult getInternetUserIList(Long internetUserId,Long userId,Integer type); + AjaxResult getInternetUserIList(HttpServletRequest request,Long internetUserId,Long userId,Integer type); /** @@ -133,7 +134,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - AjaxResult getTerminalList(Long chargingStationId,Long userId,Integer type); + AjaxResult getTerminalList(HttpServletRequest request,Long chargingStationId,Long userId,Integer type); /** * 订单来源列表 @@ -141,7 +142,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - AjaxResult getSourceList(Long userId,Integer type); + AjaxResult getSourceList(HttpServletRequest request,Long userId,Integer type); /** * 订单来源列表 @@ -149,7 +150,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getSumSourceList(String startTime, String endTime, String sourceIds,Long userId,Integer type, String chargingStationIds); + List> getSumSourceList(HttpServletRequest request,String startTime, String endTime, String sourceIds,Long userId,Integer type, String chargingStationIds); /** * 添加时段订单统计 @@ -180,7 +181,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - void timeIntervalExport(HttpServletResponse response, String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException; + void timeIntervalExport(HttpServletRequest request,HttpServletResponse response, String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException; /** @@ -194,7 +195,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - void dateIntervalExport(HttpServletResponse response, String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException; + void dateIntervalExport(HttpServletRequest request,HttpServletResponse response, String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException; /** * 电站统计导出 @@ -208,7 +209,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - void stationIntervalExport(HttpServletResponse response, String chargingStationIds,String operatorIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException; + void stationIntervalExport(HttpServletRequest request,HttpServletResponse response, String chargingStationIds,String operatorIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException; /** * 运营商统计导出 @@ -220,14 +221,14 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - void operatorIntervalExport(HttpServletResponse response, String operatorIds,Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException; + void operatorIntervalExport(HttpServletRequest request,HttpServletResponse response, String operatorIds,Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException; /** * 订单来源统计导出 * @return */ - void getSumSourceListExport(HttpServletResponse response, String startTime, String endTime, String sourceIds,Long userId,Integer type, String chargingStationIds) throws IOException; + void getSumSourceListExport(HttpServletRequest request,HttpServletResponse response, String startTime, String endTime, String sourceIds,Long userId,Integer type, String chargingStationIds) throws IOException; /** @@ -241,7 +242,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - void terminalIntervalExport(HttpServletResponse response, String chargingStationId, String terminalId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException; + void terminalIntervalExport(HttpServletRequest request,HttpServletResponse response, String chargingStationId, String terminalId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException; } diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcStatisticsServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcStatisticsServiceImpl.java index 61333dea..284ca74e 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcStatisticsServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcStatisticsServiceImpl.java @@ -8,17 +8,22 @@ import cn.hutool.poi.excel.ExcelWriter; import com.xhpc.common.core.utils.SecurityUtils; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.service.BaseService; +import com.xhpc.common.security.service.TokenService; +import com.xhpc.common.util.UserTypeUtil; import com.xhpc.order.domain.XhpcStatisticsStation; import com.xhpc.order.domain.XhpcStatisticsTimeInterval; import com.xhpc.order.mapper.XhpcStatisticsServiceMapper; import com.xhpc.order.service.IXhpcHistoryOrderService; import com.xhpc.order.service.IXhpcStatisticsService; +import com.xhpc.system.api.domain.SysUser; +import com.xhpc.system.api.model.LoginUser; import org.checkerframework.checker.units.qual.A; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.*; @@ -35,8 +40,11 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati private XhpcStatisticsServiceMapper xhpcStatisticsServiceMapper; @Autowired private IXhpcHistoryOrderService xhpcHistoryOrderService; + @Autowired + private TokenService tokenService; + @Override - public List> getTimeIntervalPage(String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) { + public List> getTimeIntervalPage(HttpServletRequest request,String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) { if (getJudge(internetUserId, operatorId, type)){ return new ArrayList<>(); } @@ -45,26 +53,24 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati chargingStationId= Arrays.asList(chargingStationIds.split(",")); } //获取登陆用户 - Long logUserId = SecurityUtils.getUserId(); + LoginUser loginUser = tokenService.getLoginUser(request); List> list =new ArrayList<>(); - if(logUserId !=1){ - Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); - if(landUser !=null){ - startPage(); - if(landUser.get("userType") !=null){ - if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){ - Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); - //运营商看自己的场站 - list = xhpcStatisticsServiceMapper.getTimeIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 1,logOperatorId); - }else{ - //查询赋值的场站 - list = xhpcStatisticsServiceMapper.getTimeIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 2,logUserId); - } - } + SysUser sysUser = loginUser.getSysUser(); + String tenantId = loginUser.getTenantId(); + Long sysUserId = sysUser.getUserId(); + if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){ + startPage(); + if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){ + Long logOperatorId = sysUser.getOperatorId(); + //运营商看自己的场站 + list = xhpcStatisticsServiceMapper.getTimeIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 1,logOperatorId,tenantId); + }else{ + //查询赋值的场站 + list = xhpcStatisticsServiceMapper.getTimeIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 2,sysUserId,tenantId); } }else{ startPage(); - list =xhpcStatisticsServiceMapper.getTimeIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 0,logUserId); + list =xhpcStatisticsServiceMapper.getTimeIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 0,sysUserId,tenantId); } List> page =new ArrayList<>(); if(list !=null && list.size()>0){ @@ -159,7 +165,7 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati return page; } @Override - public List> getDateIntervalPage(String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) { + public List> getDateIntervalPage(HttpServletRequest request,String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) { if (getJudge(internetUserId, operatorId, type)){ return new ArrayList<>(); } @@ -167,35 +173,33 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati if(!"".equals(chargingStationIds) && chargingStationIds !=null){ chargingStationId= Arrays.asList(chargingStationIds.split(",")); } - //获取登陆用户 - Long logUserId = SecurityUtils.getUserId(); + LoginUser loginUser = tokenService.getLoginUser(request); + SysUser sysUser = loginUser.getSysUser(); + String tenantId = loginUser.getTenantId(); + Long sysUserId = sysUser.getUserId(); + //获取登陆用户 List> list =new ArrayList<>(); - if(logUserId !=1){ - Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); - if(landUser !=null){ - startPage(); - if(landUser.get("userType") !=null){ - if("01".equals(landUser.get("userType").toString())){ - Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); - //运营商看自己的场站 - list = xhpcStatisticsServiceMapper.getDateIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 1,logOperatorId); - }else{ - //查询赋值的场站 - list = xhpcStatisticsServiceMapper.getDateIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 2,logUserId); - } - } + if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){ + startPage(); + if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){ + Long logOperatorId = sysUser.getOperatorId(); + //运营商看自己的场站 + list = xhpcStatisticsServiceMapper.getDateIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 1,logOperatorId,tenantId); + }else{ + //查询赋值的场站 + list = xhpcStatisticsServiceMapper.getDateIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 2,sysUserId,tenantId); } }else{ startPage(); - list =xhpcStatisticsServiceMapper.getDateIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 0,logUserId); + list =xhpcStatisticsServiceMapper.getDateIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 0,sysUserId,tenantId); } return list; } @Override - public List> getStationIntervalPage(String chargingStationIds, String operatorIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) { + public List> getStationIntervalPage(HttpServletRequest request,String chargingStationIds, String operatorIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) { if (getJudge(internetUserId, operatorId, type)){ return new ArrayList<>(); } @@ -207,28 +211,24 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati if(!"".equals(operatorIds) && operatorIds !=null){ operatorUserId= Arrays.asList(operatorIds.split(",")); } - - //获取登陆用户 - Long logUserId = SecurityUtils.getUserId(); + LoginUser loginUser = tokenService.getLoginUser(request); + SysUser sysUser = loginUser.getSysUser(); + String tenantId = loginUser.getTenantId(); + Long sysUserId = sysUser.getUserId(); List> list =new ArrayList<>(); - if(logUserId !=1){ - Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); - if(landUser !=null){ - startPage(); - if(landUser.get("userType") !=null){ - if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){ - Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); - //运营商看自己的场站 - list = xhpcStatisticsServiceMapper.getStationIntervalPage(chargingStationId,operatorUserId,internetUserId,operatorId,startTime,endTime,1,logOperatorId); - }else{ - //查询赋值的场站 - list = xhpcStatisticsServiceMapper.getStationIntervalPage(chargingStationId,operatorUserId,internetUserId,operatorId,startTime,endTime,2,logUserId); - } - } + if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){ + startPage(); + if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){ + Long logOperatorId = sysUser.getOperatorId(); + //运营商看自己的场站 + list = xhpcStatisticsServiceMapper.getStationIntervalPage(chargingStationId,operatorUserId,internetUserId,operatorId,startTime,endTime,1,logOperatorId,tenantId); + }else{ + //查询赋值的场站 + list = xhpcStatisticsServiceMapper.getStationIntervalPage(chargingStationId,operatorUserId,internetUserId,operatorId,startTime,endTime,2,sysUserId,tenantId); } }else{ startPage(); - list =xhpcStatisticsServiceMapper.getStationIntervalPage(chargingStationId,operatorUserId,internetUserId,operatorId,startTime,endTime,0,logUserId); + list =xhpcStatisticsServiceMapper.getStationIntervalPage(chargingStationId,operatorUserId,internetUserId,operatorId,startTime,endTime,0,sysUserId,tenantId); } @@ -236,7 +236,7 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati } @Override - public List> getOperatorIntervalPage(String operatorIds, Long operatorId, String startTime, String endTime, Long userId, Integer type) { + public List> getOperatorIntervalPage(HttpServletRequest request,String operatorIds, Long operatorId, String startTime, String endTime, Long userId, Integer type) { if(getJudge(null,operatorId,type)){ return new ArrayList<>(); } @@ -244,35 +244,31 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati if(!"".equals(operatorIds) && operatorIds !=null){ operatorUserId= Arrays.asList(operatorIds.split(",")); } - - //获取登陆用户 - Long logUserId = SecurityUtils.getUserId(); + LoginUser loginUser = tokenService.getLoginUser(request); + SysUser sysUser = loginUser.getSysUser(); + String tenantId = loginUser.getTenantId(); + Long sysUserId = sysUser.getUserId(); List> list =new ArrayList<>(); - if(logUserId !=1){ - Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); - if(landUser !=null){ - startPage(); - if(landUser.get("userType") !=null){ - if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){ - Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); - //运营商看自己的场站 - list = xhpcStatisticsServiceMapper.getOperatorIntervalPage(operatorUserId, operatorId, startTime, endTime, 1,logOperatorId); - }else{ - //查询赋值的场站 - list = xhpcStatisticsServiceMapper.getOperatorIntervalPage(operatorUserId, operatorId, startTime, endTime, 2,logUserId); - } - } + if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){ + startPage(); + if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){ + Long logOperatorId = sysUser.getOperatorId(); + //运营商看自己的场站 + list = xhpcStatisticsServiceMapper.getOperatorIntervalPage(operatorUserId, operatorId, startTime, endTime, 1,logOperatorId,tenantId); + }else{ + //查询赋值的场站 + list = xhpcStatisticsServiceMapper.getOperatorIntervalPage(operatorUserId, operatorId, startTime, endTime, 2,sysUserId,tenantId); } }else{ startPage(); - list =xhpcStatisticsServiceMapper.getOperatorIntervalPage(operatorUserId, operatorId, startTime, endTime, 0,logUserId); + list =xhpcStatisticsServiceMapper.getOperatorIntervalPage(operatorUserId, operatorId, startTime, endTime, 0,sysUserId,tenantId); } return list; } @Override - public List> getInternetUserIntervalPage(String internetUserIds, Long internetUserId, String startTime, String endTime, Long userId, Integer type) { + public List> getInternetUserIntervalPage(HttpServletRequest request,String internetUserIds, Long internetUserId, String startTime, String endTime, Long userId, Integer type) { if(getJudge(internetUserId,null,type)){ return new ArrayList<>(); } @@ -280,36 +276,38 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati if(!"".equals(internetUserIds) && internetUserIds !=null){ internetIds= Arrays.asList(internetUserIds.split(",")); } + LoginUser loginUser = tokenService.getLoginUser(request); + SysUser sysUser = loginUser.getSysUser(); + String tenantId = loginUser.getTenantId(); + Long sysUserId = sysUser.getUserId(); // if(("".equals(startTime) && "".equals(endTime)) ||(startTime==null && endTime==null)){ // startTime =date(1); // endTime =date(2); // } - return xhpcStatisticsServiceMapper.getInternetUserIntervalPage(internetIds, internetUserId, startTime, endTime, type,userId); + return xhpcStatisticsServiceMapper.getInternetUserIntervalPage(internetIds, internetUserId, startTime, endTime, type,sysUserId,tenantId); } @Override - public List> getTerminalIntervalPage(String chargingStationId, String terminalId, Long operatorId, String startTime, String endTime, Long userId, Integer type) { + public List> getTerminalIntervalPage(HttpServletRequest request,String chargingStationId, String terminalId, Long operatorId, String startTime, String endTime, Long userId, Integer type) { //获取登陆用户 - Long logUserId = SecurityUtils.getUserId(); + LoginUser loginUser = tokenService.getLoginUser(request); List> list =new ArrayList<>(); - if(logUserId !=1){ - Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); - if(landUser !=null){ - startPage(); - if(landUser.get("userType") !=null){ - if("01".equals(landUser.get("userType").toString())){ - Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); - //运营商看自己的场站 - list = xhpcStatisticsServiceMapper.getTerminalIntervalPage(chargingStationId, terminalId, operatorId, startTime, endTime, 1,logOperatorId); - }else{ - //查询赋值的场站 - list = xhpcStatisticsServiceMapper.getTerminalIntervalPage(chargingStationId, terminalId, operatorId, startTime, endTime, 2,logUserId); - } - } + SysUser sysUser = loginUser.getSysUser(); + String tenantId = loginUser.getTenantId(); + Long sysUserId = sysUser.getUserId(); + if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){ + startPage(); + if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){ + Long logOperatorId = sysUser.getOperatorId(); + //运营商看自己的场站 + list = xhpcStatisticsServiceMapper.getTerminalIntervalPage(chargingStationId, terminalId, operatorId, startTime, endTime, 1,logOperatorId,tenantId); + }else{ + //查询赋值的场站 + list = xhpcStatisticsServiceMapper.getTerminalIntervalPage(chargingStationId, terminalId, operatorId, startTime, endTime, 2,sysUserId,tenantId); } }else{ startPage(); - list =xhpcStatisticsServiceMapper.getTerminalIntervalPage(chargingStationId, terminalId, operatorId, startTime, endTime, 0,logUserId); + list =xhpcStatisticsServiceMapper.getTerminalIntervalPage(chargingStationId, terminalId, operatorId, startTime, endTime, 0,sysUserId,tenantId); } @@ -317,114 +315,104 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati } @Override - public AjaxResult getChargingStationList(Long operatorId, Long userId, Integer type) { - + public AjaxResult getChargingStationList(HttpServletRequest request,Long operatorId, Long userId, Integer type) { + LoginUser loginUser = tokenService.getLoginUser(request); + SysUser sysUser = loginUser.getSysUser(); + String tenantId = loginUser.getTenantId(); + Long sysUserId = sysUser.getUserId(); //获取登陆用户 - Long logUserId = SecurityUtils.getUserId(); - if(logUserId !=1){ - Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); - if(landUser !=null){ - if(landUser.get("userType") !=null){ - if("01".equals(landUser.get("userType").toString())){ - Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); - //运营商看自己的场站 - return AjaxResult.success(xhpcStatisticsServiceMapper.getChargingStationList(operatorId, logOperatorId, 1)); - }else{ - //查询赋值的场站 - return AjaxResult.success(xhpcStatisticsServiceMapper.getChargingStationList(operatorId, logUserId, 2)); - } - } + if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){ + if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){ + Long logOperatorId = sysUser.getOperatorId(); + //运营商看自己的场站 + return AjaxResult.success(xhpcStatisticsServiceMapper.getChargingStationList(operatorId, logOperatorId, 1,tenantId)); + }else{ + //查询赋值的场站 + return AjaxResult.success(xhpcStatisticsServiceMapper.getChargingStationList(operatorId, sysUserId, 2,tenantId)); } }else{ - return AjaxResult.success(xhpcStatisticsServiceMapper.getChargingStationList(operatorId, logUserId, 0)); + return AjaxResult.success(xhpcStatisticsServiceMapper.getChargingStationList(operatorId, sysUserId, 0,tenantId)); } - return AjaxResult.success(); } @Override - public AjaxResult getOperatorList(Long operatorId, Long userId, Integer type) { + public AjaxResult getOperatorList(HttpServletRequest request,Long operatorId, Long userId, Integer type) { //获取登陆用户 - Long logUserId = SecurityUtils.getUserId(); - if(logUserId !=1){ - Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); - if(landUser !=null){ - if(landUser.get("userType") !=null){ - if("01".equals(landUser.get("userType").toString())){ - Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); - //运营商看自己的场站 - return AjaxResult.success(xhpcStatisticsServiceMapper.getOperatorList(operatorId, logOperatorId, 1)); - }else{ - //查询赋值的场站 - return AjaxResult.success(xhpcStatisticsServiceMapper.getOperatorList(operatorId, logUserId, 2)); - } - } + LoginUser loginUser = tokenService.getLoginUser(request); + SysUser sysUser = loginUser.getSysUser(); + String tenantId = loginUser.getTenantId(); + Long sysUserId = sysUser.getUserId(); + if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){ + if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){ + Long logOperatorId = sysUser.getOperatorId(); + //运营商看自己的场站 + return AjaxResult.success(xhpcStatisticsServiceMapper.getOperatorList(operatorId, logOperatorId, 1,tenantId)); + }else{ + //查询赋值的场站 + return AjaxResult.success(xhpcStatisticsServiceMapper.getOperatorList(operatorId, sysUserId, 2,tenantId)); } }else{ - return AjaxResult.success(xhpcStatisticsServiceMapper.getOperatorList(operatorId, logUserId, 0)); + return AjaxResult.success(xhpcStatisticsServiceMapper.getOperatorList(operatorId, sysUserId, 0,tenantId)); } - return AjaxResult.success(); } @Override - public AjaxResult getInternetUserIList(Long internetUserId, Long userId, Integer type) { - return AjaxResult.success(xhpcStatisticsServiceMapper.getInternetUserIList(internetUserId, userId, type)); + public AjaxResult getInternetUserIList(HttpServletRequest request,Long internetUserId, Long userId, Integer type) { + LoginUser loginUser = tokenService.getLoginUser(request); + SysUser sysUser = loginUser.getSysUser(); + String tenantId = loginUser.getTenantId(); + Long sysUserId = sysUser.getUserId(); + return AjaxResult.success(xhpcStatisticsServiceMapper.getInternetUserIList(internetUserId, sysUserId, type,tenantId)); } @Override - public AjaxResult getTerminalList(Long chargingStationId, Long userId, Integer type) { - - //获取登陆用户 - Long logUserId = SecurityUtils.getUserId(); - if(logUserId !=1){ - Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); - if(landUser !=null){ - if(landUser.get("userType") !=null){ - if("01".equals(landUser.get("userType").toString())){ - Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); - //运营商看自己的场站 - return AjaxResult.success(xhpcStatisticsServiceMapper.getTerminalList(chargingStationId, logOperatorId, 1)); - }else{ - //查询赋值的场站 - return AjaxResult.success(xhpcStatisticsServiceMapper.getTerminalList(chargingStationId, logUserId, 2)); - } - } + public AjaxResult getTerminalList(HttpServletRequest request,Long chargingStationId, Long userId, Integer type) { +//获取登陆用户 + LoginUser loginUser = tokenService.getLoginUser(request); + SysUser sysUser = loginUser.getSysUser(); + String tenantId = loginUser.getTenantId(); + Long sysUserId = sysUser.getUserId(); + if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){ + if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){ + Long logOperatorId = sysUser.getOperatorId(); + //运营商看自己的场站 + return AjaxResult.success(xhpcStatisticsServiceMapper.getTerminalList(chargingStationId, logOperatorId, 1,tenantId)); + }else{ + //查询赋值的场站 + return AjaxResult.success(xhpcStatisticsServiceMapper.getTerminalList(chargingStationId, sysUserId, 2,tenantId)); } }else{ - return AjaxResult.success(xhpcStatisticsServiceMapper.getTerminalList(chargingStationId, logUserId, 0)); + return AjaxResult.success(xhpcStatisticsServiceMapper.getTerminalList(chargingStationId, sysUserId, 0,tenantId)); } - - - - return AjaxResult.success(); } @Override - public AjaxResult getSourceList(Long userId, Integer type) { + public AjaxResult getSourceList(HttpServletRequest request,Long userId, Integer type) { //获取登陆用户 - Long logUserId = SecurityUtils.getUserId(); + LoginUser loginUser = tokenService.getLoginUser(request); + SysUser sysUser = loginUser.getSysUser(); + String tenantId = loginUser.getTenantId(); + Long sysUserId = sysUser.getUserId(); //桩的统计、该时段金额 List> list = new ArrayList<>(); - Map landUser = xhpcStatisticsServiceMapper.getLandUser(logUserId); - if (landUser != null) { - if (landUser.get("userType") != null && "02".equals(landUser.get("userType").toString())) { - list = xhpcStatisticsServiceMapper.getInternetList(logUserId); - }else{ - list = xhpcStatisticsServiceMapper.getInternetList(null); - Map map1 =new HashMap<>(); - Map map2 =new HashMap<>(); - map1.put("name","微信"); - map1.put("id","微信"); - map2.put("name","支付宝"); - map2.put("id","支付宝"); - list.add(map1); - list.add(map2); - } + if (UserTypeUtil.SYS_USER_TYPE_TWO.equals(sysUser.getUserType())) { + list = xhpcStatisticsServiceMapper.getInternetList(sysUserId,tenantId); + }else{ + list = xhpcStatisticsServiceMapper.getInternetList(null,tenantId); + Map map1 =new HashMap<>(); + Map map2 =new HashMap<>(); + map1.put("name","微信"); + map1.put("id","微信"); + map2.put("name","支付宝"); + map2.put("id","支付宝"); + list.add(map1); + list.add(map2); } return AjaxResult.success(list); } @Override - public List> getSumSourceList(String startTime, String endTime, String sourceIds, Long userId, Integer type,String chargingStationIds) { + public List> getSumSourceList(HttpServletRequest request,String startTime, String endTime, String sourceIds, Long userId, Integer type,String chargingStationIds) { List sourceList =new ArrayList<>(); if(!"".equals(sourceIds) && sourceIds !=null){ sourceList= Arrays.asList(sourceIds.split(",")); @@ -433,7 +421,11 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati if(!"".equals(chargingStationIds) && chargingStationIds !=null){ chargingStationIdList= Arrays.asList(chargingStationIds.split(",")); } - return xhpcStatisticsServiceMapper.getSumSourceList(startTime, endTime, sourceList, userId, type,chargingStationIdList); + LoginUser loginUser = tokenService.getLoginUser(request); + SysUser sysUser = loginUser.getSysUser(); + String tenantId = loginUser.getTenantId(); + Long sysUserId = sysUser.getUserId(); + return xhpcStatisticsServiceMapper.getSumSourceList(startTime, endTime, sourceList, sysUserId, type,chargingStationIdList,tenantId); } @Override @@ -507,8 +499,8 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati @Override - public void timeIntervalExport(HttpServletResponse response, String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException { - List> list = getTimeIntervalPage(chargingStationIds, internetUserId, operatorId, startTime, endTime, userId, type); + public void timeIntervalExport(HttpServletRequest request,HttpServletResponse response, String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException { + List> list = getTimeIntervalPage(request,chargingStationIds, internetUserId, operatorId, startTime, endTime, userId, type); // 通过工具类创建writer,默认创建xls格式 ExcelWriter writer = ExcelUtil.getWriter(true); @@ -546,8 +538,8 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati @Override - public void dateIntervalExport(HttpServletResponse response, String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException { - List> list = getDateIntervalPage(chargingStationIds, internetUserId, operatorId, startTime, endTime, userId, type); + public void dateIntervalExport(HttpServletRequest request,HttpServletResponse response, String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException { + List> list = getDateIntervalPage(request,chargingStationIds, internetUserId, operatorId, startTime, endTime, userId, type); // 通过工具类创建writer,默认创建xls格式 ExcelWriter writer = ExcelUtil.getWriter(true); @@ -588,8 +580,8 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati } @Override - public void stationIntervalExport(HttpServletResponse response, String chargingStationIds,String operatorIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException { - List> list = getStationIntervalPage(chargingStationIds, operatorIds, internetUserId, operatorId, startTime, endTime, userId, type); + public void stationIntervalExport(HttpServletRequest request,HttpServletResponse response, String chargingStationIds,String operatorIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException { + List> list = getStationIntervalPage(request,chargingStationIds, operatorIds, internetUserId, operatorId, startTime, endTime, userId, type); // 通过工具类创建writer,默认创建xls格式 ExcelWriter writer = ExcelUtil.getWriter(true); @@ -632,8 +624,8 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati } @Override - public void operatorIntervalExport(HttpServletResponse response, String operatorIds,Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException { - List> list = getOperatorIntervalPage(operatorIds, operatorId, startTime, endTime, userId, type); + public void operatorIntervalExport(HttpServletRequest request,HttpServletResponse response, String operatorIds,Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException { + List> list = getOperatorIntervalPage(request,operatorIds, operatorId, startTime, endTime, userId, type); // 通过工具类创建writer,默认创建xls格式 ExcelWriter writer = ExcelUtil.getWriter(true); @@ -676,9 +668,9 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati @Override - public void getSumSourceListExport(HttpServletResponse response, String startTime, String endTime, String sourceIds,Long userId,Integer type, String chargingStationIds) throws IOException { + public void getSumSourceListExport(HttpServletRequest request,HttpServletResponse response, String startTime, String endTime, String sourceIds,Long userId,Integer type, String chargingStationIds) throws IOException { - List> list = getSumSourceList(startTime, endTime, sourceIds, userId, type,chargingStationIds); + List> list = getSumSourceList(request,startTime, endTime, sourceIds, userId, type,chargingStationIds); // 通过工具类创建writer,默认创建xls格式 ExcelWriter writer = ExcelUtil.getWriter(true); @@ -721,8 +713,8 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati @Override - public void terminalIntervalExport(HttpServletResponse response, String chargingStationId, String terminalId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException { - List> list = getTerminalIntervalPage(chargingStationId, terminalId, operatorId, startTime, endTime, userId, type); + public void terminalIntervalExport(HttpServletRequest request,HttpServletResponse response, String chargingStationId, String terminalId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException { + List> list = getTerminalIntervalPage(request,chargingStationId, terminalId, operatorId, startTime, endTime, userId, type); // 通过工具类创建writer,默认创建xls格式 ExcelWriter writer = ExcelUtil.getWriter(true); 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 e81c2180..e6bd2a26 100644 --- a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml +++ b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml @@ -101,6 +101,9 @@ and charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{userId}) + + and tenant_id = #{tenantId} + group by status order by status @@ -145,6 +148,9 @@ and charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{userId}) + + and tenant_id = #{tenantId} + group by DATE_FORMAT(create_time,'%Y-%m-%d') order by DATE_FORMAT(create_time,'%Y-%m-%d') desc @@ -199,6 +205,9 @@ #{operatorId} + + and ss.tenant_id = #{tenantId} + group by ss.charging_station_id @@ -244,6 +253,9 @@ and ss.charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{userId}) + + and ss.tenant_id = #{tenantId} + group by ss.operator_id @@ -286,6 +298,9 @@ and ss.internet_user_id =#{internetUserId} + + and ss.tenant_id = #{tenantId} + group by ss.internet_user_id @@ -333,6 +348,9 @@ and ss.charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{userId}) + + and ss.tenant_id = #{tenantId} + group by ss.terminal_id @@ -348,6 +366,9 @@ and charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{userId}) + + and tenant_id = #{tenantId} + @@ -357,13 +378,15 @@ name as operatorName from xhpc_operator where 1=1 - and operator_id in (select operator_id from xhpc_charging_station where operator_id=#{userId}) and 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})) + + and tenant_id = #{tenantId} + @@ -766,6 +794,9 @@ and internet_user_id=#{userId} + + and tenant_id = #{tenantId} + diff --git a/xhpc-modules/xhpc-payment/pom.xml b/xhpc-modules/xhpc-payment/pom.xml index bb3ef119..3c43cfbf 100644 --- a/xhpc-modules/xhpc-payment/pom.xml +++ b/xhpc-modules/xhpc-payment/pom.xml @@ -81,6 +81,10 @@ 3.0.0 compile + + com.ruoyi + ruoyi-common-log + diff --git a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/AlipayPaymentController.java b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/AlipayPaymentController.java index 855dab4a..9c18eb43 100644 --- a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/AlipayPaymentController.java +++ b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/AlipayPaymentController.java @@ -35,6 +35,8 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.web.bind.annotation.*; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; @@ -68,6 +70,7 @@ public class AlipayPaymentController { private static final Logger logger = LoggerFactory.getLogger(AlipayPaymentController.class); + @Log(title = "支付宝-支付", businessType = BusinessType.INSERT) @NoRepeatSubmit @PostMapping("/payment") @ApiOperation(value = "支付宝支付") diff --git a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/WxPaymentController.java b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/WxPaymentController.java index 0d418809..c1af930b 100644 --- a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/WxPaymentController.java +++ b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/WxPaymentController.java @@ -10,6 +10,8 @@ import com.xhpc.common.core.utils.StringUtils; import com.xhpc.common.core.utils.WXPayUtil; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.data.down.StartChargingData; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.common.security.service.TokenService; import com.xhpc.common.util.UserTypeUtil; import com.xhpc.payment.domain.XhpcAppUser; @@ -78,6 +80,7 @@ public class WxPaymentController { private static final Logger logger = LoggerFactory.getLogger(WxPaymentController.class); + @Log(title = "微信-支付", businessType = BusinessType.INSERT) @NoRepeatSubmit @PostMapping("/payment") @ApiOperation(value = "微信支付") diff --git a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundAuditController.java b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundAuditController.java index 0a380825..90158226 100644 --- a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundAuditController.java +++ b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundAuditController.java @@ -18,6 +18,8 @@ import com.xhpc.common.core.utils.WXPayUtil; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.common.security.service.TokenService; import com.xhpc.common.util.UserTypeUtil; import com.xhpc.payment.domain.XhpcAppUser; @@ -99,6 +101,7 @@ public class XhpcRefundAuditController extends BaseController { * @param xhpcRefundAudit * @return */ + @Log(title = "退款-审核", businessType = BusinessType.UPDATE) @PostMapping("/examine") @ApiOperation(value = "退款审核") @Transactional diff --git a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundOrderController.java b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundOrderController.java index 5a894afb..cdc749ac 100644 --- a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundOrderController.java +++ b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundOrderController.java @@ -8,6 +8,8 @@ import com.xhpc.common.core.utils.StringUtils; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.common.security.service.TokenService; import com.xhpc.common.util.UserTypeUtil; import com.xhpc.payment.service.IXhpcCommonPayment; @@ -44,6 +46,7 @@ public class XhpcRefundOrderController extends BaseController { * * @return */ + @Log(title = "申请退款", businessType = BusinessType.INSERT) @NoRepeatSubmit @PostMapping("/checkOut") @ApiOperation(value = "申请退款") diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommunityController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommunityController.java index e70eb708..9f16aa45 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommunityController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommunityController.java @@ -49,6 +49,7 @@ public class XhpcCommunityController extends BaseController { /** * 删除社区组树 */ + @Log(title = "社区", businessType = BusinessType.DELETE) @PostMapping(value = "/deleteCommunity") public AjaxResult deleteCommunity(@RequestBody XhpcCommunity xhpcCommunity) { return xhpcCommunityService.deleteCommunity(xhpcCommunity); @@ -67,6 +68,7 @@ public class XhpcCommunityController extends BaseController { * * @return */ + @Log(title = "社区", businessType = BusinessType.UPDATE) @PostMapping(value = "/updateCommunity") public AjaxResult updateCommunity(@RequestBody XhpcCommunity xhpcCommunity) { return xhpcCommunityService.updateCommunity(xhpcCommunity); @@ -89,6 +91,7 @@ public class XhpcCommunityController extends BaseController { * 社区人员添加 * */ + @Log(title = "社区人员", businessType = BusinessType.INSERT) @PostMapping(value = "/addCommunityPersonnel") public AjaxResult addCommunityPersonnel(@RequestBody XhpcCommunityPersonnel xhpcCommunityPersonnel) { return xhpcCommunityService.addCommunityPersonnel(xhpcCommunityPersonnel); @@ -107,6 +110,7 @@ public class XhpcCommunityController extends BaseController { * 编辑社区人员 * */ + @Log(title = "社区人员", businessType = BusinessType.UPDATE) @PostMapping(value = "/updateCommunityPersonnel") public AjaxResult updateCommunityPersonnel(@RequestBody XhpcCommunityPersonnel xhpcCommunityPersonnel) { return xhpcCommunityService.updateCommunityPersonnel(xhpcCommunityPersonnel); @@ -115,6 +119,7 @@ public class XhpcCommunityController extends BaseController { /** * 删除社区人员 */ + @Log(title = "社区人员", businessType = BusinessType.DELETE) @PostMapping(value = "/deleteCommunityPersonnel") public AjaxResult deleteCommunityPersonnel(@RequestBody XhpcCommunityPersonnel xhpcCommunityPersonnel) { xhpcCommunityService.deleteCommunityPersonnel(xhpcCommunityPersonnel); @@ -124,6 +129,7 @@ public class XhpcCommunityController extends BaseController { /** * 改变社区人员状态 */ + @Log(title = "社区人员-状态", businessType = BusinessType.UPDATE) @PostMapping(value = "/updateCommunityPersonnelStatus") public AjaxResult updateCommunityPersonnelStatus(@RequestBody XhpcCommunityPersonnel xhpcCommunityPersonnel) { xhpcCommunityService.updateCommunityPersonnelStatus(xhpcCommunityPersonnel); @@ -133,6 +139,7 @@ public class XhpcCommunityController extends BaseController { /** * 充值 */ + @Log(title = "社区人员-充值", businessType = BusinessType.INSERT) @PostMapping(value = "/addRecharge") public AjaxResult addRecharge(@RequestBody XhpcCommunityPersonnel xhpcCommunityPersonnel) { return xhpcCommunityService.addRecharge(xhpcCommunityPersonnel); diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCustomersController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCustomersController.java index baf20483..b36c2cb4 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCustomersController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCustomersController.java @@ -3,6 +3,8 @@ package com.xhpc.user.controller; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.user.domain.XhpcCustomers; import com.xhpc.user.domain.XhpcCustomersPersonnel; import com.xhpc.user.service.IXhpcCustomersService; @@ -39,6 +41,7 @@ public class XhpcCustomersController extends BaseController { * * @return */ + @Log(title = "大客户组", businessType = BusinessType.INSERT) @PostMapping(value = "/addCustomers") public AjaxResult addCustomers(HttpServletRequest request, @RequestBody XhpcCustomers xhpcCustomers) { return xhpcCustomersService.addCustomers(request,xhpcCustomers); @@ -47,6 +50,7 @@ public class XhpcCustomersController extends BaseController { /** * 删除大客户 */ + @Log(title = "大客户组", businessType = BusinessType.DELETE) @PostMapping(value = "/deleteCustomers") public AjaxResult deleteCustomers(@RequestBody XhpcCustomers xhpcCustomers) { return xhpcCustomersService.deleteCustomers(xhpcCustomers); @@ -65,6 +69,7 @@ public class XhpcCustomersController extends BaseController { * * @return */ + @Log(title = "大客户组", businessType = BusinessType.UPDATE) @PostMapping(value = "/updateCustomers") public AjaxResult updateCustomers(@RequestBody XhpcCustomers xhpcCustomers) { return xhpcCustomersService.updateCustomers(xhpcCustomers); @@ -83,6 +88,7 @@ public class XhpcCustomersController extends BaseController { * 大客户人员添加 * */ + @Log(title = "大客户人员", businessType = BusinessType.INSERT) @PostMapping(value = "/addCustomersPersonnel") public AjaxResult addCustomersPersonnel(@RequestBody XhpcCustomersPersonnel xhpcCustomersPersonnel) { return xhpcCustomersService.addCustomersPersonnel(xhpcCustomersPersonnel); @@ -101,6 +107,7 @@ public class XhpcCustomersController extends BaseController { * 编辑大客户人员 * */ + @Log(title = "大客户人员", businessType = BusinessType.UPDATE) @PostMapping(value = "/updateCustomersPersonnel") public AjaxResult updateCustomersPersonnel(@RequestBody XhpcCustomersPersonnel xhpcCustomersPersonnel) { return xhpcCustomersService.updateCustomersPersonnel(xhpcCustomersPersonnel); @@ -109,6 +116,7 @@ public class XhpcCustomersController extends BaseController { /** * 删除社区人员 */ + @Log(title = "大客户人员", businessType = BusinessType.DELETE) @PostMapping(value = "/deleteCustomersPersonnel") public AjaxResult deleteCustomersPersonnel(@RequestBody XhpcCustomersPersonnel xhpcCustomersPersonnel) { xhpcCustomersService.deleteCustomersPersonnel(xhpcCustomersPersonnel); @@ -118,6 +126,7 @@ public class XhpcCustomersController extends BaseController { /** * 充值 */ + @Log(title = "大客户人员-充值", businessType = BusinessType.INSERT) @PostMapping(value = "/addRecharge") public AjaxResult addRecharge(@RequestBody XhpcCustomersPersonnel xhpcCustomersPersonnel) { return xhpcCustomersService.addRecharge(xhpcCustomersPersonnel); @@ -126,6 +135,7 @@ public class XhpcCustomersController extends BaseController { /** * 改变社区人员状态 */ + @Log(title = "大客户人员-状态", businessType = BusinessType.UPDATE) @PostMapping(value = "/updateCustomersPersonnelStatus") public AjaxResult updateCustomersPersonnelStatus(@RequestBody XhpcCustomersPersonnel xhpcCustomersPersonnel) { xhpcCustomersService.updateCustomersPersonnelStatus(xhpcCustomersPersonnel); diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcInternetUserController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcInternetUserController.java index 249a49ec..530a4432 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcInternetUserController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcInternetUserController.java @@ -8,6 +8,8 @@ import com.xhpc.common.core.utils.StringUtils; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.common.security.annotation.PreAuthorize; import com.xhpc.system.api.domain.SysUser; import com.xhpc.user.domain.XhpcInternetUser; @@ -43,6 +45,7 @@ public class XhpcInternetUserController extends BaseController { /** * 新增流量用户 */ + @Log(title = "流量用户", businessType = BusinessType.INSERT) @ApiOperation("新增流量用户") @RequiresRoles("admin") @PostMapping("/add") @@ -81,6 +84,7 @@ public class XhpcInternetUserController extends BaseController { /** * 修改流量用户 */ + @Log(title = "流量用户", businessType = BusinessType.UPDATE) @ApiOperation("修改流量用户") @RequiresRoles("admin") @PostMapping("/edit") @@ -118,6 +122,7 @@ public class XhpcInternetUserController extends BaseController { /** * 删除流量用户 */ + @Log(title = "流量用户", businessType = BusinessType.DELETE) @ApiOperation("删除流量用户") @RequiresRoles("admin") @PostMapping("/remove") @@ -154,6 +159,7 @@ public class XhpcInternetUserController extends BaseController { /** * 禁用/启用流量用户 */ + @Log(title = "流量用户-禁用启用", businessType = BusinessType.UPDATE) @ApiOperation("禁用/启用流量用户") @RequiresRoles("admin") @PostMapping("/status") diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcOperatorController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcOperatorController.java index e3cfe8b1..5a3e9b1e 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcOperatorController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcOperatorController.java @@ -7,6 +7,8 @@ import com.xhpc.common.core.utils.StringUtils; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.common.security.annotation.PreAuthorize; import com.xhpc.system.api.domain.SysUser; import com.xhpc.user.domain.XhpcOperator; @@ -40,6 +42,7 @@ public class XhpcOperatorController extends BaseController { /** * 新增运营商 */ + @Log(title = "运营商", businessType = BusinessType.INSERT) @ApiOperation("新增运营商") @RequiresRoles("admin") @PostMapping("/add") @@ -101,6 +104,7 @@ public class XhpcOperatorController extends BaseController { /** * 修改运营商 */ + @Log(title = "运营商", businessType = BusinessType.UPDATE) @ApiOperation("修改运营商") @PreAuthorize(hasPermi = "user:operator:edit") @RequiresRoles("admin") @@ -121,6 +125,7 @@ public class XhpcOperatorController extends BaseController { /** * 删除运营商 */ + @Log(title = "运营商", businessType = BusinessType.DELETE) @ApiOperation("删除运营商") @RequiresRoles("admin") @PostMapping("/remove") @@ -157,6 +162,7 @@ public class XhpcOperatorController extends BaseController { /** * 禁用/启用运营商 */ + @Log(title = "运营商-禁用启用", businessType = BusinessType.UPDATE) @ApiOperation("禁用/启用运营商") @RequiresRoles("admin") @PostMapping("/status") diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcOperatorInternetBlacklistController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcOperatorInternetBlacklistController.java index efc9cb8f..924051c7 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcOperatorInternetBlacklistController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcOperatorInternetBlacklistController.java @@ -3,6 +3,8 @@ package com.xhpc.user.controller; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.user.domain.XhpcOperatorInternetBlacklist; import com.xhpc.user.service.IXhpcOperatorInternetBlacklistService; import io.swagger.annotations.ApiOperation; @@ -28,6 +30,7 @@ public class XhpcOperatorInternetBlacklistController extends BaseController { /** * 新增运营商设置流量方黑名单 */ + @Log(title = "运营商-设置流量方黑名单", businessType = BusinessType.INSERT) @ApiOperation("新增运营商设置流量方黑名单") //@PreAuthorize(hasPermi = "operator:internet:add") @PostMapping("/add") diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcStationInternetBlacklistController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcStationInternetBlacklistController.java index 6be2c863..a81417db 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcStationInternetBlacklistController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcStationInternetBlacklistController.java @@ -3,6 +3,8 @@ package com.xhpc.user.controller; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.user.domain.XhpcStationInternetBlacklist; import com.xhpc.user.service.IXhpcInternetUserService; import com.xhpc.user.service.IXhpcStationInternetBlacklistService; @@ -32,6 +34,7 @@ public class XhpcStationInternetBlacklistController extends BaseController { /** * 新增电站流量方黑名单 */ + @Log(title = "场站-设置流量方黑名单", businessType = BusinessType.INSERT) @ApiOperation("新增电站流量方黑名单") // @PreAuthorize(hasPermi = "station:internet:add") @PostMapping("/add") diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcUserController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcUserController.java index fc97e669..9a07b170 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcUserController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcUserController.java @@ -7,6 +7,8 @@ import com.xhpc.common.core.utils.StringUtils; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.common.security.annotation.PreAuthorize; import com.xhpc.system.api.domain.SysRole; import com.xhpc.system.api.domain.SysUser; @@ -52,6 +54,7 @@ public class XhpcUserController extends BaseController { /** * 新增平台用户 */ + @Log(title = "平台用户", businessType = BusinessType.INSERT) @ApiOperation("新增平台用户") @RequiresRoles("admin") @PostMapping("/pc/add") @@ -82,6 +85,7 @@ public class XhpcUserController extends BaseController { /** * 修改平台用户 */ + @Log(title = "平台用户", businessType = BusinessType.UPDATE) @ApiOperation("修改平台用户") @RequiresRoles("admin") @PostMapping("/pc/edit") @@ -122,6 +126,7 @@ public class XhpcUserController extends BaseController { /** * 新增运营商用户 */ + @Log(title = "运营商用户", businessType = BusinessType.INSERT) @ApiOperation("新增运营商用户") @RequiresPermissions("user:operator:add") @PostMapping("/operator/add") @@ -154,6 +159,7 @@ public class XhpcUserController extends BaseController { /** * 修改运营商用户 */ + @Log(title = "运营商用户", businessType = BusinessType.UPDATE) @ApiOperation("修改运营商用户") @RequiresPermissions("user:operator:edit") @PostMapping("/operator/edit") @@ -181,6 +187,7 @@ public class XhpcUserController extends BaseController { /** * 禁用/启用平台和运营商子账号 */ + @Log(title = "平台和运营商子账号-禁用启用", businessType = BusinessType.UPDATE) @ApiOperation("禁用/启用平台和运营商子账号") //@PreAuthorize(hasPermi = "user:pc:status") @PostMapping("/status") @@ -196,6 +203,7 @@ public class XhpcUserController extends BaseController { /** * 禁用/启用平台和运营商子账号 */ + @Log(title = "平台和运营商子账号-禁用启用", businessType = BusinessType.UPDATE) @ApiOperation("禁用/启用平台和运营商子账号") //@PreAuthorize(hasPermi = "user:pc:status") @PostMapping("/remove") @@ -212,6 +220,7 @@ public class XhpcUserController extends BaseController { /** * 重置密码 */ + @Log(title = "重置密码", businessType = BusinessType.UPDATE) @PostMapping("/reset") public AjaxResult reset(@RequestParam Long userId){