From 226d7007a30c9cbe871812f7a73caf0be0ace72b Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期一, 30 九月 2024 15:57:54 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java | 251
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TAccountingStrategyServiceImpl.java | 2
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TShoppingOrderServiceImpl.java | 73
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/UserListQueryDto.java | 2
ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/feignClient/ChargingPileClient.java | 7
ruoyi-service/ruoyi-other/src/main/resources/template/充电桩申请记录.xlsx | 0
ruoyi-api/ruoyi-api-chargingPile/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports | 3
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/AccountingStrategyDetailOrderClient.java | 10
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/OtherFallbackFactory.java | 5
ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysLoginLog.java | 2
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TOrderInvoiceController.java | 3
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/FileUploadUtils.java | 4
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingGunServiceImpl.java | 56
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/CarNumDto.java | 3
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/Constants.java | 4
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ChargingOrderClient.java | 38
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/UserSiteFallbackFactory.java | 14
ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TChargingOrderMapper.xml | 54
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/OrderClient.java | 3
ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/vo/PaymentOrder.java | 2
ruoyi-api/ruoyi-api-account/pom.xml | 4
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/filter/AuthFilter.java | 2
ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/vo/GunStatusStatisticsVO.java | 6
ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/feignClient/PartnerClient.java | 27
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileServiceImpl.java | 5
ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/ChargingPileFallbackFactory.java | 5
ruoyi-auth/src/main/java/com/ruoyi/auth/controller/TokenController.java | 12
ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/PartnerFallbackFactory.java | 32
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingPileController.java | 13
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TShoppingOrderController.java | 227
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ShoppingOrderClient.java | 29
ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml | 4
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderInvoiceServiceImpl.java | 48
ruoyi-api/ruoyi-api-account/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports | 3
ruoyi-api/ruoyi-api-payment/pom.xml | 4
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AlipayOpenAppQrcodeCreate.java | 59
ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/vo/SiteInfoVO.java | 6
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/wx/tools/WxAppletTools.java | 1
ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java | 1
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/OtherClient.java | 7
ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/MinioSysFileServiceImpl.java | 2
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingGunController.java | 18
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TExchangeOrderServiceImpl.java | 37
ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/SysUserFallbackFactory.java | 14
ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/AccountingStrategyFallbackFactory.java | 8
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TGoodsController.java | 20
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/AccountingStrategyDetailOrderController.java | 15
ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml | 2
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyController.java | 29
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java | 86
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserTagController.java | 33
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/dto/TEnterpriseExport.java | 3
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/GoodsFallbackFactory.java | 8
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserClient.java | 4
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java | 182
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/filter/AuthFilter.java | 2
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/AccountingStrategyOrder.java | 4
ruoyi-service/ruoyi-payment/src/main/java/com/ruoyi/payment/wx/utils/WxV3Pay.java | 2
ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/feignClient/IntegrationClient.java | 14707 +++++++++++++++++++++++++++++++++++
ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/feignClient/WxPaymentClient.java | 20
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/query/SysOperLogQuery.java | 5
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserCarClient.java | 2
ruoyi-api/ruoyi-api-other/pom.xml | 4
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TAdvertisingController.java | 24
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TUserTagController.java | 16
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TVipOrder.java | 3
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserTagFallbackFactory.java | 40
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/AccountingStrategyDetailOrderFallbackFactory.java | 5
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TIntegralRuleController.java | 25
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/dto/PointChangeDto.java | 1
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/TAppCouponServiceImpl.java | 2
ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TShoppingOrderMapper.xml | 31
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TCouponServiceImpl.java | 7
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java | 796
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserFallbackFactory.java | 13
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserVipDetailFallbackFactory.java | 14
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TChargingOrderRefund.java | 11
ruoyi-api/ruoyi-api-integration/pom.xml | 4
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TCouponController.java | 19
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserTagClient.java | 32
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TOrderInvoice.java | 1
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/AccountingStrategyOrderFallbackFactory.java | 34
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppUserIntegralChange.java | 3
ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/factory/WxPaymentFallbackFactory.java | 41
ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/aspect/LogAspect.java | 391
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/OrderFallbackFactory.java | 3
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppUserVipDetail.java | 4
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/dto/ExchangeBackDto.java | 9
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java | 4
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TInvoiceInformationController.java | 5
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserVipDetailController.java | 2
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TExchangeOrderController.java | 14
ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/ChargingGunFallbackFactory.java | 8
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/AccountingStrategyOrderClient.java | 26
ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/AccountingStrategyDetailFallbackFactory.java | 8
ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/factory/IntegrationFallbackFactory.java | 5
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/PartnerServiceImpl.java | 32
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/TExchangeOrderService.java | 2
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/GiveVipUtil.java | 44
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/UserTagClient.java | 25
ruoyi-api/ruoyi-api-order/pom.xml | 4
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/mapper/TChargingGunMapper.java | 2
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderAppealServiceImpl.java | 49
ruoyi-auth/pom.xml | 4
ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/factory/AliPaymentFallbackFactory.java | 26
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/UserTagFallbackFactory.java | 33
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/ChargingOrderFallbackFactory.java | 16
ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/handler/GlobalExceptionHandler.java | 4
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TCompanyController.java | 2
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TApplyChargingPileController.java | 2
ruoyi-api/ruoyi-api-system/pom.xml | 4
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/CarUtil.java | 5108 ++++++-----
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TVipOrderServiceImpl.java | 11
ruoyi-service/ruoyi-account/pom.xml | 5
ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/LocalSysFileServiceImpl.java | 2
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/PointDetailUtil.java | 3
ruoyi-api/ruoyi-api-chargingPile/pom.xml | 4
ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/factory/SendMessageFallbackFactory.java | 14
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/util/RedisLock.java | 51
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/PartnerController.java | 10
ruoyi-service/ruoyi-chargingPile/src/main/resources/mapper/chargingPile/SiteMapper.xml | 2
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/AccountingStrategyOrderController.java | 35
ruoyi-api/ruoyi-api-order/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports | 4
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/CouponFallbackFactory.java | 10
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/SiteController.java | 38
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppCouponController.java | 25
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/AccountingStrategyDetailOrder.java | 8
ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TExchangeOrderMapper.xml | 23
ruoyi-service/ruoyi-payment/src/main/java/com/ruoyi/payment/controller/WxPayController.java | 33
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/ShoppingOrderFallbackFactory.java | 31
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileNotificationServiceImpl.java | 3
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/WxLoginController.java | 84
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/task/TaskUtil.java | 3
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TShoppingOrder.java | 2
ruoyi-api/ruoyi-api-other/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports | 3
ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysLoginService.java | 222
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/util/task/TaskUtil.java | 120
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/filter/AuthFilter.java | 15
ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TVipOrderMapper.xml | 4
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java | 1
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/SiteServiceImpl.java | 5
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TVipOrderController.java | 8
ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/feignClient/SysLoginLogClient.java | 2
ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/utils/listener/IotMessageListener.java | 2
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/InvoiceTypeFallbackFactory.java | 8
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java | 1076 +-
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TGoodsMapper.xml | 3
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/GoodsDTO.java | 2
148 files changed, 20,680 insertions(+), 4,388 deletions(-)
diff --git a/ruoyi-api/ruoyi-api-account/pom.xml b/ruoyi-api/ruoyi-api-account/pom.xml
index 526cd85..773136f 100644
--- a/ruoyi-api/ruoyi-api-account/pom.xml
+++ b/ruoyi-api/ruoyi-api-account/pom.xml
@@ -28,10 +28,6 @@
</exclusion>
</exclusions>
</dependency>
- <dependency>
- <groupId>com.alibaba.cloud</groupId>
- <artifactId>spring-cloud-starter-alibaba-seata</artifactId>
- </dependency>
</dependencies>
</project>
\ No newline at end of file
diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/UserListQueryDto.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/UserListQueryDto.java
index 54ad4db..960bcaf 100644
--- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/UserListQueryDto.java
+++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/UserListQueryDto.java
@@ -8,6 +8,8 @@
public class UserListQueryDto extends BasePage {
@ApiModelProperty(value = "用户手机号")
String userPhone;
+ @ApiModelProperty(value = "所在省code")
+ String provinceCode;
@ApiModelProperty(value = "所在地code")
String cityCode;
@ApiModelProperty(value = "状态 1正常2冻结 3注销")
diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserFallbackFactory.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserFallbackFactory.java
index e0b6d42..67b6a52 100644
--- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserFallbackFactory.java
@@ -7,8 +7,6 @@
import com.ruoyi.account.api.model.TAppUserAddress;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.dto.PointChangeDto;
-import io.seata.core.exception.TransactionException;
-import io.seata.tm.api.GlobalTransactionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
@@ -38,12 +36,6 @@
@Override
public R<TAppUser> getUserById(Long id) {
- // 手动进行全局事务回滚
- try {
- GlobalTransactionContext.getCurrent().rollback();
- } catch (TransactionException e) {
- throw new RuntimeException(e);
- }
return R.fail("根据id查询用户失败:"+throwable.getMessage());
}
@@ -57,10 +49,7 @@
return R.fail("修改用户失败:"+throwable.getMessage());
}
- @Override
- public R change(PointChangeDto points) {
- return null;
- }
+
@Override
public R changeDown(PointChangeDto points) {
diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserTagFallbackFactory.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserTagFallbackFactory.java
new file mode 100644
index 0000000..e9cad57
--- /dev/null
+++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserTagFallbackFactory.java
@@ -0,0 +1,40 @@
+package com.ruoyi.account.api.factory;
+
+import com.ruoyi.account.api.feignClient.AppUserTagClient;
+import com.ruoyi.account.api.feignClient.InviteUserClient;
+import com.ruoyi.account.api.model.TAppUserTag;
+import com.ruoyi.account.api.model.TInviteUser;
+import com.ruoyi.account.api.vo.GetInviteUser;
+import com.ruoyi.common.core.domain.R;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+
+/**
+ *
+ * @author ruoyi
+ */
+@Component
+public class AppUserTagFallbackFactory implements org.springframework.cloud.openfeign.FallbackFactory<AppUserTagClient>
+{
+ private static final Logger log = LoggerFactory.getLogger(AppUserTagFallbackFactory.class);
+
+ @Override
+ public AppUserTagClient create(Throwable throwable) {
+ log.error("调用失败:{}", throwable.getMessage());
+ return new AppUserTagClient() {
+
+
+ @Override
+ public R<TAppUserTag> getUserTag(TAppUserTag appUserTag) {
+ return R.fail("获取用户标签关系失败:" + throwable.getMessage());
+ }
+
+ @Override
+ public void addUserTag(TAppUserTag appUserTag) {
+
+ }
+ };
+ }
+}
diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserVipDetailFallbackFactory.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserVipDetailFallbackFactory.java
index 21f6809..3a99a05 100644
--- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserVipDetailFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserVipDetailFallbackFactory.java
@@ -4,8 +4,6 @@
import com.ruoyi.account.api.model.TAppUserVipDetail;
import com.ruoyi.account.api.vo.GetAppUserVipDetail;
import com.ruoyi.common.core.domain.R;
-import io.seata.core.exception.TransactionException;
-import io.seata.tm.api.GlobalTransactionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
@@ -28,23 +26,11 @@
@Override
public R<TAppUserVipDetail> getAppUserVipDetail(GetAppUserVipDetail getAppUserVipDetail) {
- // 手动进行全局事务回滚
- try {
- GlobalTransactionContext.getCurrent().rollback();
- } catch (TransactionException e) {
- throw new RuntimeException(e);
- }
return R.fail("获取用户当前有效的VIP明细调用失败:" + throwable.getMessage());
}
@Override
public void updateAppUserVipDetail(TAppUserVipDetail appUserVipDetail) {
- // 手动进行全局事务回滚
- try {
- GlobalTransactionContext.getCurrent().rollback();
- } catch (TransactionException e) {
- throw new RuntimeException(e);
- }
R.fail(throwable.getMessage());
}
};
diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserCarClient.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserCarClient.java
index 80a88a5..a0a477c 100644
--- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserCarClient.java
+++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserCarClient.java
@@ -26,7 +26,7 @@
* @param carIds 车辆id集合
* @return
*/
- @PostMapping(value = "/t-app-user-car/getCarByIds")
+ @PostMapping(value = "/t-app-user-car/t-app-user-car/getCarByIds")
public R<List<TAppUserCar>> getCarByIds(@RequestBody List<Long> carIds);
diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserClient.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserClient.java
index 3cc881d..0f42ada 100644
--- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserClient.java
+++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserClient.java
@@ -57,8 +57,8 @@
@PostMapping("/t-app-user/user/updateAppUser")
R updateAppUser(@RequestBody TAppUser appUser);
- @PostMapping("/t-app-user/user/points/change")
- R change(@RequestBody PointChangeDto points);
+// @PostMapping("/t-app-user/user/points/change")
+// R change(@RequestBody PointChangeDto points);
@PostMapping("/t-app-user/user/points/change/down")
R changeDown(@RequestBody PointChangeDto points);
diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserTagClient.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserTagClient.java
new file mode 100644
index 0000000..4a4966a
--- /dev/null
+++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserTagClient.java
@@ -0,0 +1,32 @@
+package com.ruoyi.account.api.feignClient;
+
+import com.ruoyi.account.api.factory.AppUserTagFallbackFactory;
+import com.ruoyi.account.api.model.TAppUserTag;
+import com.ruoyi.common.core.constant.ServiceNameConstants;
+import com.ruoyi.common.core.domain.R;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+/**
+ * @author zhibing.pu
+ * @Date 2024/9/25 16:17
+ */
+@FeignClient(contextId = "AppUserTagClient", value = ServiceNameConstants.ACCOUNT_SERVICE, fallbackFactory = AppUserTagFallbackFactory.class)
+public interface AppUserTagClient {
+
+ /**
+ * 获取用户标签关系
+ * @param appUserTag
+ * @return
+ */
+ @PostMapping(value = "/t-app-user-tag/tags/getUserTag")
+ R<TAppUserTag> getUserTag(@RequestBody TAppUserTag appUserTag);
+
+ /**
+ * 添加用户标签关系数据
+ * @param appUserTag
+ */
+ @PostMapping(value = "/t-app-user-tag/tags/addUserTag")
+ void addUserTag(@RequestBody TAppUserTag appUserTag);
+}
diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppUserIntegralChange.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppUserIntegralChange.java
index abd7964..1b5f369 100644
--- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppUserIntegralChange.java
+++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppUserIntegralChange.java
@@ -39,6 +39,9 @@
@TableField("code")
private String code;
+ @ApiModelProperty(value = "对应跳转订单号")
+ @TableField("order_code")
+ private String orderCode;
@ApiModelProperty(value = "用户id")
@TableField("app_user_id")
private Long appUserId;
diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppUserVipDetail.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppUserVipDetail.java
index 72e134f..046b4b8 100644
--- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppUserVipDetail.java
+++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppUserVipDetail.java
@@ -56,6 +56,10 @@
@TableField("vip_id")
private Integer vipId;
+ @ApiModelProperty(value = "1月卡2季卡3年卡")
+ @TableField("vip_type")
+ private Integer vipType;
+
@ApiModelProperty(value = "会员开始时间")
@TableField("start_time")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
diff --git a/ruoyi-api/ruoyi-api-account/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/ruoyi-api/ruoyi-api-account/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index d32b3a0..385a667 100644
--- a/ruoyi-api/ruoyi-api-account/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/ruoyi-api/ruoyi-api-account/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -4,4 +4,5 @@
com.ruoyi.account.api.factory.AppUserIntegralChangeFallbackFactory
com.ruoyi.account.api.factory.AppUserAddressFallbackFactory
com.ruoyi.account.api.factory.AppUserVipDetailFallbackFactory
-com.ruoyi.account.api.factory.InviteUserFallbackFactory
\ No newline at end of file
+com.ruoyi.account.api.factory.InviteUserFallbackFactory
+com.ruoyi.account.api.factory.AppUserTagFallbackFactory
\ No newline at end of file
diff --git a/ruoyi-api/ruoyi-api-chargingPile/pom.xml b/ruoyi-api/ruoyi-api-chargingPile/pom.xml
index c39d339..ac294c6 100644
--- a/ruoyi-api/ruoyi-api-chargingPile/pom.xml
+++ b/ruoyi-api/ruoyi-api-chargingPile/pom.xml
@@ -28,10 +28,6 @@
</exclusion>
</exclusions>
</dependency>
- <dependency>
- <groupId>com.alibaba.cloud</groupId>
- <artifactId>spring-cloud-starter-alibaba-seata</artifactId>
- </dependency>
</dependencies>
</project>
\ No newline at end of file
diff --git a/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/AccountingStrategyDetailFallbackFactory.java b/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/AccountingStrategyDetailFallbackFactory.java
index d8a1054..97e74d5 100644
--- a/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/AccountingStrategyDetailFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/AccountingStrategyDetailFallbackFactory.java
@@ -4,8 +4,6 @@
import com.ruoyi.chargingPile.api.feignClient.AccountingStrategyDetailClient;
import com.ruoyi.chargingPile.api.model.TAccountingStrategyDetail;
import com.ruoyi.common.core.domain.R;
-import io.seata.core.exception.TransactionException;
-import io.seata.tm.api.GlobalTransactionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
@@ -44,12 +42,6 @@
@Override
public R<List<TAccountingStrategyDetail>> getListByAccountingStrategyId(Integer id) {
- // 手动进行全局事务回滚
- try {
- GlobalTransactionContext.getCurrent().rollback();
- } catch (TransactionException e) {
- throw new RuntimeException(e);
- }
return R.fail("根据计费策略主表id策略明细失败:" + throwable.getMessage());
}
diff --git a/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/AccountingStrategyFallbackFactory.java b/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/AccountingStrategyFallbackFactory.java
index 8d883c3..5cb8a3e 100644
--- a/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/AccountingStrategyFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/AccountingStrategyFallbackFactory.java
@@ -3,8 +3,6 @@
import com.ruoyi.chargingPile.api.feignClient.AccountingStrategyClient;
import com.ruoyi.chargingPile.api.model.TAccountingStrategy;
import com.ruoyi.common.core.domain.R;
-import io.seata.core.exception.TransactionException;
-import io.seata.tm.api.GlobalTransactionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
@@ -27,12 +25,6 @@
@Override
public R<TAccountingStrategy> getAccountingStrategyById(Integer id) {
- // 手动进行全局事务回滚
- try {
- GlobalTransactionContext.getCurrent().rollback();
- } catch (TransactionException e) {
- throw new RuntimeException(e);
- }
return R.fail("根据id查询计费策略失败:" + throwable.getMessage());
}
};
diff --git a/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/ChargingGunFallbackFactory.java b/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/ChargingGunFallbackFactory.java
index ad57df7..56d4782 100644
--- a/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/ChargingGunFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/ChargingGunFallbackFactory.java
@@ -7,8 +7,6 @@
import com.ruoyi.chargingPile.api.model.TFaultMessage;
import com.ruoyi.chargingPile.api.vo.SiteNameVO;
import com.ruoyi.common.core.domain.R;
-import io.seata.core.exception.TransactionException;
-import io.seata.tm.api.GlobalTransactionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
@@ -38,12 +36,6 @@
@Override
public R<TChargingGun> getChargingGunById(Integer id) {
- // 手动进行全局事务回滚
- try {
- GlobalTransactionContext.getCurrent().rollback();
- } catch (TransactionException e) {
- throw new RuntimeException(e);
- }
return R.fail("根据id获取充电枪失败:" + throwable.getMessage());
}
diff --git a/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/ChargingPileFallbackFactory.java b/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/ChargingPileFallbackFactory.java
index 60dfdf2..cbb357e 100644
--- a/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/ChargingPileFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/ChargingPileFallbackFactory.java
@@ -48,6 +48,11 @@
}
@Override
+ public R<SiteInfoVO> getSiteInfoByNumber1(String number) {
+ return R.fail("通过桩编号获取电站信息失败:"+throwable.getMessage());
+ }
+
+ @Override
public R<TChargingPile> getChargingPileById(Integer id) {
return R.fail(throwable.getMessage());
}
diff --git a/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/PartnerFallbackFactory.java b/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/PartnerFallbackFactory.java
new file mode 100644
index 0000000..d2f3666
--- /dev/null
+++ b/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/PartnerFallbackFactory.java
@@ -0,0 +1,32 @@
+package com.ruoyi.chargingPile.api.factory;
+
+import com.ruoyi.chargingPile.api.feignClient.PartnerClient;
+import com.ruoyi.chargingPile.api.model.Partner;
+import com.ruoyi.common.core.domain.R;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+
+/**
+ * 充电桩服务降级处理
+ *
+ * @author ruoyi
+ */
+@Component
+public class PartnerFallbackFactory implements org.springframework.cloud.openfeign.FallbackFactory<PartnerClient> {
+ private static final Logger log = LoggerFactory.getLogger(PartnerFallbackFactory.class);
+
+ @Override
+ public PartnerClient create(Throwable throwable) {
+ log.error("调用失败:{}", throwable.getMessage());
+ return new PartnerClient() {
+
+
+ @Override
+ public R<Partner> getPartnerById(Integer id) {
+ return R.fail("根据id获取合作商信息失败:" + throwable.getMessage());
+ }
+ };
+ }
+}
diff --git a/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/feignClient/ChargingPileClient.java b/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/feignClient/ChargingPileClient.java
index c85317a..f61dd25 100644
--- a/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/feignClient/ChargingPileClient.java
+++ b/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/feignClient/ChargingPileClient.java
@@ -7,6 +7,7 @@
import com.ruoyi.common.core.domain.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
@@ -39,9 +40,11 @@
@PostMapping(value = "/t-accounting-strategy/getServiceMoney")
R<BigDecimal> getServiceMoney(@RequestParam("param") String param);
- @PostMapping("/site/getSiteInfoByNumber")
- @ApiOperation(value = "扫一扫后通过桩编号获取电站信息", tags = {"小程序-扫一扫"})
+ @GetMapping("/site/getSiteInfoByNumber")
R<SiteInfoVO> getSiteInfoByNumber(@RequestParam("number") String number);
+
+ @PostMapping("/site/getSiteInfoByNumber1")
+ R<SiteInfoVO> getSiteInfoByNumber1(@RequestParam("number") String number);
@PostMapping("/t-charging-pile/getChargingPileById/{id}")
diff --git a/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/feignClient/PartnerClient.java b/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/feignClient/PartnerClient.java
new file mode 100644
index 0000000..198aeaa
--- /dev/null
+++ b/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/feignClient/PartnerClient.java
@@ -0,0 +1,27 @@
+package com.ruoyi.chargingPile.api.feignClient;
+
+import com.ruoyi.chargingPile.api.factory.PartnerFallbackFactory;
+import com.ruoyi.chargingPile.api.model.Partner;
+import com.ruoyi.common.core.constant.ServiceNameConstants;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+
+/**
+ * @author zhibing.pu
+ * @Date 2024/9/30 9:36
+ */
+@FeignClient(contextId = "PartnerClient", value = ServiceNameConstants.CHARGINGPILE_SERVICE, fallbackFactory = PartnerFallbackFactory.class)
+public interface PartnerClient {
+
+
+ /**
+ * 根据id获取合作商信息
+ * @param id
+ * @return
+ */
+ @PostMapping("/partner/getPartnerById/{id}")
+ R<Partner> getPartnerById(@PathVariable("id") Integer id);
+}
diff --git a/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/vo/GunStatusStatisticsVO.java b/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/vo/GunStatusStatisticsVO.java
index 1fa2248..2611653 100644
--- a/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/vo/GunStatusStatisticsVO.java
+++ b/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/vo/GunStatusStatisticsVO.java
@@ -10,12 +10,12 @@
@Data
@ApiModel(value = "设备状态统计VO")
-public class GunStatusStatisticsVO implements Serializable {
+public class GunStatusStatisticsVO {
@ApiModelProperty(value = "充电桩类型统计 key:充电模式(1=超级快充,2=快充,3=慢充)")
- private List<Map<Integer,Integer>> modeStatistics;
+ private List<Map<String,Object>> modeStatistics;
@ApiModelProperty(value = "状态统计 key:充电模式(1=离线,2=故障,3=充电中)")
- private Map<Integer,Integer> statusStatistics;
+ private List<Map<String,Integer>> statusStatistics;
@ApiModelProperty(value = "状态统计根据类型分组")
private List<StatusModeStatisticsVO> statusModeStatistics;
}
diff --git a/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/vo/SiteInfoVO.java b/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/vo/SiteInfoVO.java
index 2d71dfa..c3d2f73 100644
--- a/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/vo/SiteInfoVO.java
+++ b/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/vo/SiteInfoVO.java
@@ -12,6 +12,8 @@
public class SiteInfoVO {
@ApiModelProperty(value = "电站名称")
private String name;
+ @ApiModelProperty(value = "桩id")
+ private Integer chargingPileId;
@ApiModelProperty(value = "桩编号")
private String number;
@ApiModelProperty(value = "充电枪id")
@@ -26,6 +28,10 @@
private Integer couponCount;
@ApiModelProperty(value = "超时占位费说明")
private String spaceChargeExplain;
+ @ApiModelProperty(value = "添加车辆最高可得积分 车辆信息为空 展示提示语")
+ private Integer integral;
+ @ApiModelProperty(value = "充电模式(1=超级快充,2=快充,3=慢充")
+ private Integer chargeMode;
@ApiModelProperty(value = "上次选择车辆logo")
private String carLogo;
diff --git a/ruoyi-api/ruoyi-api-chargingPile/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/ruoyi-api/ruoyi-api-chargingPile/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index 3de243c..ed69db2 100644
--- a/ruoyi-api/ruoyi-api-chargingPile/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/ruoyi-api/ruoyi-api-chargingPile/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -5,4 +5,5 @@
com.ruoyi.chargingPile.api.factory.AccountingStrategyDetailFallbackFactory
com.ruoyi.chargingPile.api.factory.AccountingStrategyFallbackFactory
com.ruoyi.chargingPile.api.factory.ParkingRecordFallbackFactory
-com.ruoyi.chargingPile.api.factory.FaultMessageFallbackFactory
\ No newline at end of file
+com.ruoyi.chargingPile.api.factory.FaultMessageFallbackFactory
+com.ruoyi.chargingPile.api.factory.PartnerFallbackFactory
\ No newline at end of file
diff --git a/ruoyi-api/ruoyi-api-integration/pom.xml b/ruoyi-api/ruoyi-api-integration/pom.xml
index ac96969..d0c6f2d 100644
--- a/ruoyi-api/ruoyi-api-integration/pom.xml
+++ b/ruoyi-api/ruoyi-api-integration/pom.xml
@@ -32,10 +32,6 @@
</exclusion>
</exclusions>
</dependency>
- <dependency>
- <groupId>com.alibaba.cloud</groupId>
- <artifactId>spring-cloud-starter-alibaba-seata</artifactId>
- </dependency>
</dependencies>
</project>
\ No newline at end of file
diff --git a/ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/factory/IntegrationFallbackFactory.java b/ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/factory/IntegrationFallbackFactory.java
index 87a7d65..b30f0fe 100644
--- a/ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/factory/IntegrationFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/factory/IntegrationFallbackFactory.java
@@ -122,6 +122,11 @@
public R<String> platformRemoteUpdate(PlatformRemoteUpdate platformRemoteUpdate) {
return R.fail("远程更新调用失败:" + throwable.getMessage());
}
+
+ @Override
+ public R<String> setupBillingModel1(String deviceId) {
+ return R.fail("远程更新硬件:" + throwable.getMessage());
+ }
};
}
}
diff --git a/ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/factory/SendMessageFallbackFactory.java b/ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/factory/SendMessageFallbackFactory.java
index c88ddbe..89f13bb 100644
--- a/ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/factory/SendMessageFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/factory/SendMessageFallbackFactory.java
@@ -6,8 +6,6 @@
import com.ruoyi.integration.api.model.ChargingHandshake;
import com.ruoyi.integration.api.model.PlatformStartCharging;
import com.ruoyi.integration.api.model.PlatformStopCharging;
-import io.seata.core.exception.TransactionException;
-import io.seata.tm.api.GlobalTransactionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
@@ -31,23 +29,11 @@
@Override
public String platformStartCharging(PlatformStartCharging platformStartCharging) {
- // 手动进行全局事务回滚
- try {
- GlobalTransactionContext.getCurrent().rollback();
- } catch (TransactionException e) {
- throw new RuntimeException(e);
- }
return "远程启机失败";
}
@Override
public String platformStopCharging(PlatformStopCharging platformStopCharging) {
- // 手动进行全局事务回滚
- try {
- GlobalTransactionContext.getCurrent().rollback();
- } catch (TransactionException e) {
- throw new RuntimeException(e);
- }
return "远程停机失败";
}
};
diff --git a/ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/feignClient/IntegrationClient.java b/ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/feignClient/IntegrationClient.java
index a6f1d64..8aae620 100644
--- a/ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/feignClient/IntegrationClient.java
+++ b/ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/feignClient/IntegrationClient.java
@@ -7,6 +7,7 @@
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
/**
* 充电服务
@@ -149,7 +150,7 @@
* @param setupBillingModel 实体对象
* @return
*/
- @PostMapping("/sendMessage/sendMessagesetupBillingModel")
+ @PostMapping("/sendMessage/setupBillingModel")
public R<String> setupBillingModel(@RequestBody SetupBillingModel setupBillingModel);
/**
@@ -173,5 +174,14707 @@
*/
@PostMapping("/sendMessage/sendMessageplatformRemoteUpdate")
public R<String> platformRemoteUpdate(@RequestBody PlatformRemoteUpdate platformRemoteUpdate);
-
+
+ @PostMapping("/iot/setupBillingModel")
+ public R<String> setupBillingModel1(@RequestParam("deviceId") String deviceId);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
}
diff --git a/ruoyi-api/ruoyi-api-order/pom.xml b/ruoyi-api/ruoyi-api-order/pom.xml
index d3feb2c..0a4b4ba 100644
--- a/ruoyi-api/ruoyi-api-order/pom.xml
+++ b/ruoyi-api/ruoyi-api-order/pom.xml
@@ -32,10 +32,6 @@
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-api-other</artifactId>
</dependency>
- <dependency>
- <groupId>com.alibaba.cloud</groupId>
- <artifactId>spring-cloud-starter-alibaba-seata</artifactId>
- </dependency>
</dependencies>
</project>
\ No newline at end of file
diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/AccountingStrategyDetailOrderFallbackFactory.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/AccountingStrategyDetailOrderFallbackFactory.java
index d08a51c..d949791 100644
--- a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/AccountingStrategyDetailOrderFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/AccountingStrategyDetailOrderFallbackFactory.java
@@ -32,6 +32,11 @@
public R<AccountingStrategyDetailOrder> getNowAccountingStrategyDetailOrder(Long orderId) {
return R.fail("根据订单id获取当前有效的策略失败:" + throwable.getMessage());
}
+
+ @Override
+ public R<List<AccountingStrategyDetailOrder>> getAllAccountingStrategyDetailOrder(Long orderId) {
+ return R.fail("获取订单对应的计费策略数据失败:" + throwable.getMessage());
+ }
};
}
}
diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/AccountingStrategyOrderFallbackFactory.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/AccountingStrategyOrderFallbackFactory.java
new file mode 100644
index 0000000..dd92b7c
--- /dev/null
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/AccountingStrategyOrderFallbackFactory.java
@@ -0,0 +1,34 @@
+package com.ruoyi.order.api.factory;
+
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.order.api.feignClient.AccountingStrategyDetailOrderClient;
+import com.ruoyi.order.api.feignClient.AccountingStrategyOrderClient;
+import com.ruoyi.order.api.model.AccountingStrategyDetailOrder;
+import com.ruoyi.order.api.model.AccountingStrategyOrder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+/**
+ * 充电订单服务降级处理
+ *
+ * @author ruoyi
+ */
+@Component
+public class AccountingStrategyOrderFallbackFactory implements org.springframework.cloud.openfeign.FallbackFactory<AccountingStrategyOrderClient>
+{
+ private static final Logger log = LoggerFactory.getLogger(AccountingStrategyOrderFallbackFactory.class);
+
+ @Override
+ public AccountingStrategyOrderClient create(Throwable throwable) {
+ log.error("调用失败:{}", throwable.getMessage());
+ return new AccountingStrategyOrderClient() {
+
+
+ @Override
+ public R<AccountingStrategyOrder> getAccountingStrategyOrderById(Integer id) {
+ return R.fail("根据id获取计费策略失败:" + throwable.getMessage());
+ }
+ };
+ }
+}
diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/ChargingOrderFallbackFactory.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/ChargingOrderFallbackFactory.java
index 72ebc17..011684c 100644
--- a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/ChargingOrderFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/ChargingOrderFallbackFactory.java
@@ -118,6 +118,22 @@
public R<String> stopCharging(String id) {
return R.fail("手动停止充电失败:" + throwable.getMessage());
}
+
+ @Override
+ public void chargingOrderWXCallback(String out_trade_no, String transaction_id, String attach) {
+ log.error("充电支付成功回调通知失败:" + throwable.getMessage());
+ }
+
+ @Override
+ public void chargingOrderStartupFailureWxRefund(String out_refund_no, String refund_id, String tradeState, String success_time) {
+ log.error("远程启动失败后退款通知失败:" + throwable.getMessage());
+ }
+
+ @Override
+ public void shoppingOrderWxRefund(String out_refund_no, String refund_id, String tradeState, String success_time) {
+ log.error("购物订单退款回调通知失败:" + throwable.getMessage());
+
+ }
};
}
}
diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/OrderFallbackFactory.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/OrderFallbackFactory.java
index 7f2650b..ab55bc6 100644
--- a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/OrderFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/OrderFallbackFactory.java
@@ -1,6 +1,7 @@
package com.ruoyi.order.api.factory;
import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.dto.ExchangeBackDto;
import com.ruoyi.common.core.dto.ExchangeDto;
import com.ruoyi.order.api.feignClient.OrderClient;
import com.ruoyi.order.api.model.ChargingListQuery;
@@ -49,7 +50,7 @@
}
@Override
- public R<Long> exchangeCreate(ExchangeDto exchangeDto) {
+ public R<ExchangeBackDto> exchangeCreate(ExchangeDto exchangeDto) {
return R.fail("创建订单" + cause.getMessage());
}
diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/ShoppingOrderFallbackFactory.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/ShoppingOrderFallbackFactory.java
new file mode 100644
index 0000000..9ce69c9
--- /dev/null
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/ShoppingOrderFallbackFactory.java
@@ -0,0 +1,31 @@
+package com.ruoyi.order.api.factory;
+
+import com.ruoyi.order.api.feignClient.ShoppingOrderClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+
+/**
+ * 充电订单服务降级处理
+ *
+ * @author ruoyi
+ */
+@Component
+public class ShoppingOrderFallbackFactory implements org.springframework.cloud.openfeign.FallbackFactory<ShoppingOrderClient> {
+ private static final Logger log = LoggerFactory.getLogger(ShoppingOrderFallbackFactory.class);
+
+
+ @Override
+ public ShoppingOrderClient create(Throwable cause) {
+ log.error("调用失败:{}", cause.getMessage());
+ return new ShoppingOrderClient() {
+
+
+ @Override
+ public void cancelShoppingOrderWxRefund(String out_refund_no, String refund_id, String tradeState, String success_time) {
+ log.error("商城订单去掉退款回调通知失败:" + cause.getMessage());
+ }
+ };
+ }
+}
diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/AccountingStrategyDetailOrderClient.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/AccountingStrategyDetailOrderClient.java
index dd73fbc..a6d5018 100644
--- a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/AccountingStrategyDetailOrderClient.java
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/AccountingStrategyDetailOrderClient.java
@@ -8,6 +8,8 @@
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
+import java.util.List;
+
/**
* @author zhibing.pu
* @Date 2024/9/4 16:11
@@ -23,4 +25,12 @@
*/
@PostMapping("/accountingStrategyDetailOrder/getNowAccountingStrategyDetailOrder")
R<AccountingStrategyDetailOrder> getNowAccountingStrategyDetailOrder(@RequestParam("orderId") Long orderId);
+
+ /**
+ * 获取订单对应的计费策略数据
+ * @param orderId
+ * @return
+ */
+ @PostMapping("/accountingStrategyDetailOrder/getAllAccountingStrategyDetailOrder")
+ R<List<AccountingStrategyDetailOrder>> getAllAccountingStrategyDetailOrder(@RequestParam("orderId") Long orderId);
}
diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/AccountingStrategyOrderClient.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/AccountingStrategyOrderClient.java
new file mode 100644
index 0000000..22a314c
--- /dev/null
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/AccountingStrategyOrderClient.java
@@ -0,0 +1,26 @@
+package com.ruoyi.order.api.feignClient;
+
+import com.ruoyi.common.core.constant.ServiceNameConstants;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.order.api.factory.AccountingStrategyOrderFallbackFactory;
+import com.ruoyi.order.api.model.AccountingStrategyOrder;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+/**
+ * @author zhibing.pu
+ * @Date 2024/9/26 9:09
+ */
+@FeignClient(contextId = "AccountingStrategyOrderClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = AccountingStrategyOrderFallbackFactory.class)
+public interface AccountingStrategyOrderClient {
+
+
+ /**
+ * 根据id获取数据
+ * @param id
+ * @return
+ */
+ @PostMapping("/accountingStrategyOrder/getAccountingStrategyOrderById")
+ R<AccountingStrategyOrder> getAccountingStrategyOrderById(@RequestParam("id") Integer id);
+}
diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ChargingOrderClient.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ChargingOrderClient.java
index b395682..1d33c9a 100644
--- a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ChargingOrderClient.java
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ChargingOrderClient.java
@@ -137,4 +137,42 @@
*/
@PutMapping(value = "/t-charging-order/stopCharging/{id}")
R<String> stopCharging(@PathVariable("id") String id);
+
+
+ /**
+ * 充电支付成功回调通知
+ * @param out_trade_no
+ * @param transaction_id
+ * @param attach
+ */
+ @PostMapping("/t-charging-order/chargingOrderWXCallback")
+ void chargingOrderWXCallback(@RequestParam("out_trade_no") String out_trade_no,
+ @RequestParam("transaction_id") String transaction_id,
+ @RequestParam("attach") String attach);
+
+
+ /**
+ * 远程启动失败后退款回调
+ * @param out_refund_no
+ * @param refund_id
+ * @param tradeState
+ * @param success_time
+ */
+ @PostMapping("/t-charging-order/chargingOrderStartupFailureWxRefund")
+ void chargingOrderStartupFailureWxRefund(@RequestParam("out_trade_no") String out_refund_no,
+ @RequestParam("out_trade_no") String refund_id,
+ @RequestParam("out_trade_no") String tradeState,
+ @RequestParam("out_trade_no") String success_time);
+ /**
+ * 管理后台取消购物订单后退款回调
+ * @param out_refund_no
+ * @param refund_id
+ * @param tradeState
+ * @param success_time
+ */
+ @PostMapping("/t-shopping-order/shoppingOrderWxRefund")
+ void shoppingOrderWxRefund(@RequestParam("out_trade_no") String out_refund_no,
+ @RequestParam("out_trade_no") String refund_id,
+ @RequestParam("out_trade_no") String tradeState,
+ @RequestParam("out_trade_no") String success_time);
}
diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/OrderClient.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/OrderClient.java
index 9e49992..9678610 100644
--- a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/OrderClient.java
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/OrderClient.java
@@ -2,6 +2,7 @@
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.dto.ExchangeBackDto;
import com.ruoyi.common.core.dto.ExchangeDto;
import com.ruoyi.order.api.factory.OrderFallbackFactory;
import com.ruoyi.order.api.model.ChargingListQuery;
@@ -38,7 +39,7 @@
public R<Long> getExchangeById(@RequestParam("goodId") Integer goodId,@RequestParam("userId") Long userId,@RequestParam("goodType") Integer goodType);
@PostMapping("/t-exchange-order/create")
- public R<Long> exchangeCreate(@RequestBody ExchangeDto exchangeDto);
+ public R<ExchangeBackDto> exchangeCreate(@RequestBody ExchangeDto exchangeDto);
@PostMapping("/t-vip-order//addVipOrder")
public R<Long> addVipOrder(@RequestBody TVipOrder vipOrder);
@PostMapping("/t-shopping-order/create")
diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ShoppingOrderClient.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ShoppingOrderClient.java
new file mode 100644
index 0000000..94901e0
--- /dev/null
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ShoppingOrderClient.java
@@ -0,0 +1,29 @@
+package com.ruoyi.order.api.feignClient;
+
+import com.ruoyi.common.core.constant.ServiceNameConstants;
+import com.ruoyi.order.api.factory.ShoppingOrderFallbackFactory;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+/**
+ * @author zhibing.pu
+ * @Date 2024/9/29 16:23
+ */
+@FeignClient(contextId = "ShoppingOrderClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = ShoppingOrderFallbackFactory.class)
+public interface ShoppingOrderClient {
+
+
+ /**
+ * 商城订单去掉退款回调通知
+ * @param out_refund_no
+ * @param refund_id
+ * @param tradeState
+ * @param success_time
+ */
+ @PostMapping("/t-shopping-order/cancelShoppingOrderWxRefund")
+ void cancelShoppingOrderWxRefund(@RequestParam("out_refund_no") String out_refund_no,
+ @RequestParam("refund_id") String refund_id,
+ @RequestParam("tradeState") String tradeState,
+ @RequestParam("success_time") String success_time);
+}
diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/AccountingStrategyDetailOrder.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/AccountingStrategyDetailOrder.java
index abe6a4f..776c46c 100644
--- a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/AccountingStrategyDetailOrder.java
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/AccountingStrategyDetailOrder.java
@@ -1,6 +1,8 @@
package com.ruoyi.order.api.model;
+import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -17,11 +19,11 @@
/**
* 主键
*/
- @TableField(value = "id")
+ @TableId(type = IdType.INPUT, value = "id")
private Integer id;
@ApiModelProperty(value = "策略id")
- @TableField("accounting_strategy_id")
- private Integer accountingStrategyId;
+ @TableField("accounting_strategy_order_id")
+ private Integer accountingStrategyOrderId;
@ApiModelProperty(value = "阶段(1=尖阶段,2=峰阶段,3=平阶段,4=谷阶段)")
@TableField("type")
diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/AccountingStrategyOrder.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/AccountingStrategyOrder.java
index 2736da3..01633e8 100644
--- a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/AccountingStrategyOrder.java
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/AccountingStrategyOrder.java
@@ -21,6 +21,10 @@
@TableName("t_accounting_strategy_order")
public class AccountingStrategyOrder extends BasePojo {
+ @ApiModelProperty(value = "策略id")
+ @TableId(type = IdType.INPUT, value = "id")
+ private Integer id;
+
@ApiModelProperty(value = "站点id")
@TableField("site_id")
private Integer siteId;
diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TChargingOrderRefund.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TChargingOrderRefund.java
index c95a809..4f762b6 100644
--- a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TChargingOrderRefund.java
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TChargingOrderRefund.java
@@ -5,6 +5,8 @@
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -56,6 +58,7 @@
@ApiModelProperty(value = "退款成功时间")
@TableField("refund_time")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime refundTime;
@ApiModelProperty(value = "订单编号")
@@ -96,7 +99,11 @@
private BigDecimal paymentAmount;
@ApiModelProperty(value = "支付时间")
@TableField(exist = false)
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime payTime;
-
-
+ @ApiModelProperty(value = "订单id")
+ @TableField(exist = false)
+ private String orderId;
+ @TableField(exist = false)
+ private String userId;
}
diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TOrderInvoice.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TOrderInvoice.java
index 5eef671..133959d 100644
--- a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TOrderInvoice.java
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TOrderInvoice.java
@@ -112,6 +112,7 @@
@ApiModelProperty(value = "添加时间")
@TableField("create_time")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime createTime;
@ApiModelProperty(value = "开票时间")
diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TShoppingOrder.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TShoppingOrder.java
index 44c70a3..b1e370b 100644
--- a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TShoppingOrder.java
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TShoppingOrder.java
@@ -105,7 +105,7 @@
@TableField("remark")
private String remark;
- @ApiModelProperty(value = "状态(1=待发货,2=待收货,3=已完成,4=已取消)")
+ @ApiModelProperty(value = "状态(1=待发货,2=待收货,3=已完成,4=已取消 5=交易关闭)")
@TableField("status")
private Integer status;
diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TVipOrder.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TVipOrder.java
index 541c529..beebeea 100644
--- a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TVipOrder.java
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TVipOrder.java
@@ -101,5 +101,8 @@
@ApiModelProperty(value = "userUid")
@TableField(exist = false)
private String userUid;
+ @ApiModelProperty(value = "购买用户")
+ @TableField(exist = false)
+ private String userPhone;
}
diff --git a/ruoyi-api/ruoyi-api-order/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/ruoyi-api/ruoyi-api-order/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index d5bf5d5..108adca 100644
--- a/ruoyi-api/ruoyi-api-order/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/ruoyi-api/ruoyi-api-order/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -2,4 +2,6 @@
com.ruoyi.order.api.factory.OrderFallbackFactory
com.ruoyi.order.api.factory.ExchangeOrderFallbackFactory
com.ruoyi.order.api.factory.ChargingOrderAccountingStrategyFallbackFactory
-com.ruoyi.order.api.factory.AccountingStrategyDetailOrderFallbackFactory
\ No newline at end of file
+com.ruoyi.order.api.factory.AccountingStrategyDetailOrderFallbackFactory
+com.ruoyi.order.api.factory.AccountingStrategyOrderFallbackFactory
+com.ruoyi.order.api.factory.ShoppingOrderFallbackFactory
\ No newline at end of file
diff --git a/ruoyi-api/ruoyi-api-other/pom.xml b/ruoyi-api/ruoyi-api-other/pom.xml
index 3f6a651..df1d49e 100644
--- a/ruoyi-api/ruoyi-api-other/pom.xml
+++ b/ruoyi-api/ruoyi-api-other/pom.xml
@@ -32,10 +32,6 @@
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-api-account</artifactId>
</dependency>
- <dependency>
- <groupId>com.alibaba.cloud</groupId>
- <artifactId>spring-cloud-starter-alibaba-seata</artifactId>
- </dependency>
</dependencies>
</project>
\ No newline at end of file
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/GoodsDTO.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/GoodsDTO.java
index ea83f00..5f79b6b 100644
--- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/GoodsDTO.java
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/GoodsDTO.java
@@ -14,6 +14,6 @@
private String name;
@ApiModelProperty(value = "1现金购买 2积分兑换 ")
private Integer type;
- @ApiModelProperty(value = "1全部 2已售罄 ")
+ @ApiModelProperty(value = "1全部 2已售罄 3已下架")
private Integer otherState;
}
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/CouponFallbackFactory.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/CouponFallbackFactory.java
index e61f478..71f33d3 100644
--- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/CouponFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/CouponFallbackFactory.java
@@ -2,11 +2,7 @@
import com.ruoyi.common.core.domain.R;
import com.ruoyi.other.api.domain.TCoupon;
-import com.ruoyi.other.api.domain.TGoods;
import com.ruoyi.other.api.feignClient.CouponClient;
-import com.ruoyi.other.api.feignClient.GoodsClient;
-import io.seata.core.exception.TransactionException;
-import io.seata.tm.api.GlobalTransactionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
@@ -40,12 +36,6 @@
@Override
public R updateCoupon(TCoupon coupon) {
- // 手动进行全局事务回滚
- try {
- GlobalTransactionContext.getCurrent().rollback();
- } catch (TransactionException e) {
- throw new RuntimeException(e);
- }
return R.fail("修改优惠券失败");
}
};
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/GoodsFallbackFactory.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/GoodsFallbackFactory.java
index bb82c32..c59d9a9 100644
--- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/GoodsFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/GoodsFallbackFactory.java
@@ -3,8 +3,6 @@
import com.ruoyi.common.core.domain.R;
import com.ruoyi.other.api.domain.TGoods;
import com.ruoyi.other.api.feignClient.GoodsClient;
-import io.seata.core.exception.TransactionException;
-import io.seata.tm.api.GlobalTransactionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
@@ -38,12 +36,6 @@
@Override
public R updateGoods(TGoods goods) {
- // 手动进行全局事务回滚
- try {
- GlobalTransactionContext.getCurrent().rollback();
- } catch (TransactionException e) {
- throw new RuntimeException(e);
- }
return R.fail("修改商品异常");
}
};
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/InvoiceTypeFallbackFactory.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/InvoiceTypeFallbackFactory.java
index 1a7c645..136fcda 100644
--- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/InvoiceTypeFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/InvoiceTypeFallbackFactory.java
@@ -3,8 +3,6 @@
import com.ruoyi.common.core.domain.R;
import com.ruoyi.other.api.domain.TInvoiceType;
import com.ruoyi.other.api.feignClient.InvoiceTypeClient;
-import io.seata.core.exception.TransactionException;
-import io.seata.tm.api.GlobalTransactionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
@@ -29,12 +27,6 @@
@Override
public R<TInvoiceType> getInvoiceType(Integer id) {
- // 手动进行全局事务回滚
- try {
- GlobalTransactionContext.getCurrent().rollback();
- } catch (TransactionException e) {
- throw new RuntimeException(e);
- }
return R.fail(throwable.getMessage());
}
};
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/OtherFallbackFactory.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/OtherFallbackFactory.java
index 32ee877..a1e3ea3 100644
--- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/OtherFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/OtherFallbackFactory.java
@@ -34,6 +34,11 @@
return new OtherClient() {
@Override
+ public R<Integer> getAddCarIntegral() {
+ return R.fail("查询首次添加车辆可获积分:" + throwable.getMessage());
+ }
+
+ @Override
public R<Page<TCompany>> queryUnitPage(UnitListQueryDto unitListQueryDto) {
return R.fail("查询单位列表失败:" + throwable.getMessage());
}
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/UserSiteFallbackFactory.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/UserSiteFallbackFactory.java
index 06e0917..7e63bb3 100644
--- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/UserSiteFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/UserSiteFallbackFactory.java
@@ -3,8 +3,6 @@
import com.ruoyi.common.core.domain.R;
import com.ruoyi.other.api.domain.TUserSite;
import com.ruoyi.other.api.feignClient.UserSiteClient;
-import io.seata.core.exception.TransactionException;
-import io.seata.tm.api.GlobalTransactionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
@@ -33,23 +31,11 @@
@Override
public R addUserSite(List<TUserSite> userSite) {
- // 手动进行全局事务回滚
- try {
- GlobalTransactionContext.getCurrent().rollback();
- } catch (TransactionException e) {
- throw new RuntimeException(e);
- }
return R.fail("添加用户站点失败:" + throwable.getMessage());
}
@Override
public R delUserSite(Long userId) {
- // 手动进行全局事务回滚
- try {
- GlobalTransactionContext.getCurrent().rollback();
- } catch (TransactionException e) {
- throw new RuntimeException(e);
- }
return R.fail("删除用户站点失败:" + throwable.getMessage());
}
};
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/UserTagFallbackFactory.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/UserTagFallbackFactory.java
new file mode 100644
index 0000000..7f31bc3
--- /dev/null
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/UserTagFallbackFactory.java
@@ -0,0 +1,33 @@
+package com.ruoyi.other.api.factory;
+
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.other.api.domain.TUserTag;
+import com.ruoyi.other.api.feignClient.UserTagClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+
+/**
+ * 商品服务降级处理
+ *
+ * @author ruoyi
+ */
+@Component
+public class UserTagFallbackFactory implements org.springframework.cloud.openfeign.FallbackFactory<UserTagClient> {
+ private static final Logger log = LoggerFactory.getLogger(UserTagFallbackFactory.class);
+
+ @Override
+ public UserTagClient create(Throwable throwable) {
+ log.error("调用失败:{}", throwable.getMessage());
+ return new UserTagClient() {
+
+ @Override
+ public R<List<TUserTag>> getAllUserTag() {
+ return R.fail("获取所有用户标签数据失败:" + throwable.getMessage());
+ }
+ };
+ }
+}
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/OtherClient.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/OtherClient.java
index 3c08f02..606bbc1 100644
--- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/OtherClient.java
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/OtherClient.java
@@ -20,7 +20,12 @@
*/
@FeignClient(contextId = "UnitClient", value = ServiceNameConstants.OTHER_SERVICE, fallbackFactory = OtherFallbackFactory.class)
public interface OtherClient {
-
+ /**
+ * 远程调用 获取首次添加车辆可获得积分
+ * @return
+ */
+ @PostMapping("/integral/getAddCarIntegral")
+ public R<Integer> getAddCarIntegral();
//单位分页
@PostMapping(value = "/t-company/unit/page")
R<Page<TCompany>> queryUnitPage(@RequestBody UnitListQueryDto unitListQueryDto);
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/UserTagClient.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/UserTagClient.java
new file mode 100644
index 0000000..3be9297
--- /dev/null
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/UserTagClient.java
@@ -0,0 +1,25 @@
+package com.ruoyi.other.api.feignClient;
+
+import com.ruoyi.common.core.constant.ServiceNameConstants;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.other.api.domain.TUserTag;
+import com.ruoyi.other.api.factory.UserTagFallbackFactory;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+
+import java.util.List;
+
+/**
+ * @author zhibing.pu
+ * @Date 2024/9/25 15:53
+ */
+@FeignClient(contextId = "UserTagClient", value = ServiceNameConstants.OTHER_SERVICE, fallbackFactory = UserTagFallbackFactory.class)
+public interface UserTagClient {
+
+ /**
+ * 获取所有用户标签数据
+ * @return
+ */
+ @PostMapping(value = "/t-user-tag/getAllUserTag")
+ R<List<TUserTag>> getAllUserTag();
+}
diff --git a/ruoyi-api/ruoyi-api-other/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/ruoyi-api/ruoyi-api-other/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index df6e634..1d2b67a 100644
--- a/ruoyi-api/ruoyi-api-other/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/ruoyi-api/ruoyi-api-other/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -7,4 +7,5 @@
com.ruoyi.other.api.factory.GoodsFallbackFactory
com.ruoyi.other.api.factory.CouponFallbackFactory
com.ruoyi.other.api.factory.InvoiceTypeFallbackFactory
-com.ruoyi.other.api.factory.WebSocketFallbackFactory
\ No newline at end of file
+com.ruoyi.other.api.factory.WebSocketFallbackFactory
+com.ruoyi.other.api.factory.UserTagFallbackFactory
\ No newline at end of file
diff --git a/ruoyi-api/ruoyi-api-payment/pom.xml b/ruoyi-api/ruoyi-api-payment/pom.xml
index 31bbeee..75a1088 100644
--- a/ruoyi-api/ruoyi-api-payment/pom.xml
+++ b/ruoyi-api/ruoyi-api-payment/pom.xml
@@ -28,10 +28,6 @@
</exclusion>
</exclusions>
</dependency>
- <dependency>
- <groupId>com.alibaba.cloud</groupId>
- <artifactId>spring-cloud-starter-alibaba-seata</artifactId>
- </dependency>
</dependencies>
</project>
\ No newline at end of file
diff --git a/ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/factory/AliPaymentFallbackFactory.java b/ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/factory/AliPaymentFallbackFactory.java
index 3c7b402..58d0545 100644
--- a/ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/factory/AliPaymentFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/factory/AliPaymentFallbackFactory.java
@@ -7,8 +7,6 @@
import com.ruoyi.payment.api.vo.AliPaymentReq;
import com.ruoyi.payment.api.vo.AliPaymentResp;
import com.ruoyi.payment.api.vo.AliQueryOrder;
-import io.seata.core.exception.TransactionException;
-import io.seata.tm.api.GlobalTransactionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
@@ -32,45 +30,21 @@
@Override
public R<AliPaymentResp> payment(AliPaymentReq req) {
- // 手动进行全局事务回滚
- try {
- GlobalTransactionContext.getCurrent().rollback();
- } catch (TransactionException e) {
- throw new RuntimeException(e);
- }
return R.fail("调起支付宝小程序支付失败:" + throwable.getMessage());
}
@Override
public R<AliQueryOrder> query(String outTradeNo) {
- // 手动进行全局事务回滚
- try {
- GlobalTransactionContext.getCurrent().rollback();
- } catch (TransactionException e) {
- throw new RuntimeException(e);
- }
return R.fail("查询支付订单失败:" + throwable.getMessage());
}
@Override
public void close(String outTradeNo) {
- // 手动进行全局事务回滚
- try {
- GlobalTransactionContext.getCurrent().rollback();
- } catch (TransactionException e) {
- throw new RuntimeException(e);
- }
R.fail("关闭支付订单失败:" + throwable.getMessage());
}
@Override
public R<RefundResp> refund(RefundReq dto) {
- // 手动进行全局事务回滚
- try {
- GlobalTransactionContext.getCurrent().rollback();
- } catch (TransactionException e) {
- throw new RuntimeException(e);
- }
return R.fail("支付宝退款失败:" + throwable.getMessage());
}
};
diff --git a/ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/factory/WxPaymentFallbackFactory.java b/ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/factory/WxPaymentFallbackFactory.java
index bab0b46..763ea46 100644
--- a/ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/factory/WxPaymentFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/factory/WxPaymentFallbackFactory.java
@@ -6,8 +6,6 @@
import com.ruoyi.payment.api.vo.NotifyV3PayDecodeRespBody;
import com.ruoyi.payment.api.vo.PaymentOrder;
import com.ruoyi.payment.api.vo.WxRefundNotifyResp;
-import io.seata.core.exception.TransactionException;
-import io.seata.tm.api.GlobalTransactionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
@@ -33,61 +31,22 @@
@Override
public R<NotifyV3PayDecodeRespBody> queryOrderInfo(String orderId) {
- // 手动进行全局事务回滚
- try {
- GlobalTransactionContext.getCurrent().rollback();
- } catch (TransactionException e) {
- throw new RuntimeException(e);
- }
return R.fail("查询支付订单信息失败:" + throwable.getMessage());
}
@Override
public R<Map<String, Object>> orderPay(PaymentOrder paymentOrder) {
- // 手动进行全局事务回滚
- try {
- GlobalTransactionContext.getCurrent().rollback();
- } catch (TransactionException e) {
- throw new RuntimeException(e);
- }
return R.fail("调起微信支付失败:" + throwable.getMessage());
- }
-
- @Override
- public R<Map<String, Object>> payNotify(HttpServletRequest request) {
- return R.fail("微信支付回调失败:" + throwable.getMessage());
- }
-
- @Override
- public void ack() {
-
}
@Override
public void close(String outTradeNo) {
- // 手动进行全局事务回滚
- try {
- GlobalTransactionContext.getCurrent().rollback();
- } catch (TransactionException e) {
- throw new RuntimeException(e);
- }
R.fail("关闭支付订单失败:" + throwable.getMessage());
}
@Override
public R<String> refundOrderR(WxPaymentRefundModel model) {
- // 手动进行全局事务回滚
- try {
- GlobalTransactionContext.getCurrent().rollback();
- } catch (TransactionException e) {
- throw new RuntimeException(e);
- }
return R.fail("微信退款失败:" + throwable.getMessage());
- }
-
- @Override
- public R<WxRefundNotifyResp> refundNotify(HttpServletRequest request) {
- return R.fail("微信退款回调失败:" + throwable.getMessage());
}
};
}
diff --git a/ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/feignClient/WxPaymentClient.java b/ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/feignClient/WxPaymentClient.java
index 8f6e6c2..b96a0d5 100644
--- a/ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/feignClient/WxPaymentClient.java
+++ b/ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/feignClient/WxPaymentClient.java
@@ -41,20 +41,6 @@
R<Map<String, Object>> orderPay(@RequestBody PaymentOrder paymentOrder);
- /**
- * 支付回调
- * @param request
- * @return
- */
- @PostMapping("/wx/pay/notify")
- R<Map<String, Object>> payNotify(HttpServletRequest request);
-
- /**
- * 支付回调成功后的成功应答
- */
- @PostMapping("/wx/pay/ack")
- void ack();
-
/**
* 关闭订单
@@ -66,10 +52,4 @@
@ApiOperation("订单退款")
@PostMapping(value = "/wx/refundOrderR")
public R<String> refundOrderR(@RequestBody WxPaymentRefundModel model);
-
-
-
- @ApiOperation("订单退款回调")
- @PostMapping(value = "/wx/refund/notify")
- R<WxRefundNotifyResp> refundNotify(HttpServletRequest request);
}
diff --git a/ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/vo/PaymentOrder.java b/ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/vo/PaymentOrder.java
index 08d54c1..3fac737 100644
--- a/ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/vo/PaymentOrder.java
+++ b/ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/vo/PaymentOrder.java
@@ -29,5 +29,5 @@
/**
* 回调地址
*/
- private String notifyUrl ="http://221.182.45.100:9000/payment/wx/pay/notify";
+ private String notifyUrl ="/payment/wx/pay/notify";
}
diff --git a/ruoyi-api/ruoyi-api-system/pom.xml b/ruoyi-api/ruoyi-api-system/pom.xml
index b2f0bcd..2670f57 100644
--- a/ruoyi-api/ruoyi-api-system/pom.xml
+++ b/ruoyi-api/ruoyi-api-system/pom.xml
@@ -28,10 +28,6 @@
</exclusion>
</exclusions>
</dependency>
- <dependency>
- <groupId>com.alibaba.cloud</groupId>
- <artifactId>spring-cloud-starter-alibaba-seata</artifactId>
- </dependency>
</dependencies>
</project>
\ No newline at end of file
diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysLoginLog.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysLoginLog.java
index 1c74644..326c448 100644
--- a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysLoginLog.java
+++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysLoginLog.java
@@ -8,6 +8,7 @@
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@@ -66,6 +67,7 @@
@TableField("login_time")
@ApiModelProperty(value = "登录时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime loginTime;
/**
* 登录状态(1=成功,2=失败)
diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java
index 6ec6741..05bac54 100644
--- a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java
+++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java
@@ -66,7 +66,6 @@
private String avatar;
/** 密码 */
- @NotBlank(message = "密码不能为空")
private String password;
/** 帐号状态(0正常 1停用) */
diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/SysUserFallbackFactory.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/SysUserFallbackFactory.java
index 44713a0..d8d4994 100644
--- a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/SysUserFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/SysUserFallbackFactory.java
@@ -5,8 +5,6 @@
import com.ruoyi.system.api.domain.SysUser;
import com.ruoyi.system.api.feignClient.SysUserClient;
import com.ruoyi.system.api.model.*;
-import io.seata.core.exception.TransactionException;
-import io.seata.tm.api.GlobalTransactionContext;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
@@ -29,12 +27,6 @@
@Override
public R<Boolean> updateSysUser(SysUser sysUser) {
- // 手动进行全局事务回滚
- try {
- GlobalTransactionContext.getCurrent().rollback();
- } catch (TransactionException e) {
- throw new RuntimeException(e);
- }
return R.fail("更新用户失败:" + cause.getMessage());
}
@@ -105,12 +97,6 @@
@Override
public R resetPassword(SysUser user) {
- // 手动进行全局事务回滚
- try {
- GlobalTransactionContext.getCurrent().rollback();
- } catch (TransactionException e) {
- throw new RuntimeException(e);
- }
return R.fail("重置用户密码失败:" + cause.getMessage());
}
};
diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/feignClient/SysLoginLogClient.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/feignClient/SysLoginLogClient.java
index e7d3e70..cc7712c 100644
--- a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/feignClient/SysLoginLogClient.java
+++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/feignClient/SysLoginLogClient.java
@@ -21,6 +21,6 @@
* @param loginLog
* @return
*/
- @PostMapping("/saveLoginLog")
+ @PostMapping("/sysLoginLog/saveLoginLog")
R saveLoginLog(@RequestBody SysLoginLog loginLog);
}
diff --git a/ruoyi-auth/pom.xml b/ruoyi-auth/pom.xml
index 17035c7..6be75c3 100644
--- a/ruoyi-auth/pom.xml
+++ b/ruoyi-auth/pom.xml
@@ -89,6 +89,10 @@
<artifactId>hutool-crypto</artifactId>
<version>${hutool.version}</version>
</dependency>
+ <dependency>
+ <groupId>com.ruoyi</groupId>
+ <artifactId>ruoyi-api-chargingPile</artifactId>
+ </dependency>
</dependencies>
diff --git a/ruoyi-auth/src/main/java/com/ruoyi/auth/controller/TokenController.java b/ruoyi-auth/src/main/java/com/ruoyi/auth/controller/TokenController.java
index 1cc1d79..da2ac38 100644
--- a/ruoyi-auth/src/main/java/com/ruoyi/auth/controller/TokenController.java
+++ b/ruoyi-auth/src/main/java/com/ruoyi/auth/controller/TokenController.java
@@ -3,6 +3,8 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
+import com.ruoyi.chargingPile.api.feignClient.PartnerClient;
+import com.ruoyi.chargingPile.api.model.Partner;
import com.ruoyi.system.api.domain.SysRole;
import com.ruoyi.system.api.domain.SysUser;
import com.ruoyi.system.api.feignClient.SysUserClient;
@@ -40,6 +42,12 @@
@Resource
private SysUserClient userClient;
+ @Resource
+ private PartnerClient partnerClient;
+
+
+
+
@PostMapping("login")
@GlobalTransactional(rollbackFor = Exception.class)//分布式事务
@@ -55,6 +63,10 @@
map.put("roleName",roles.get(0).getRoleName());
map.put("info", userInfo);
+ if(userInfo.getSysUser().getRoleType() == 2){
+ Partner partner = partnerClient.getPartnerById(userInfo.getSysUser().getObjectId()).getData();
+ map.put("partnerName", partner.getName());
+ }
// 修改用户最后登录时间
SysUser sysUser = new SysUser();
sysUser.setUserId(userInfo.getSysUser().getUserId());
diff --git a/ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysLoginService.java b/ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysLoginService.java
index 3223a6b..c443059 100644
--- a/ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysLoginService.java
+++ b/ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysLoginService.java
@@ -22,125 +22,111 @@
/**
* 登录校验方法
- *
+ *
* @author ruoyi
*/
@Component
-public class SysLoginService
-{
- @Autowired
- private RemoteUserService remoteUserService;
-
- @Autowired
- private SysPasswordService passwordService;
-
- @Autowired
- private SysRecordLogService recordLogService;
-
- @Autowired
- private RedisService redisService;
-
- /**
- * 登录
- */
- public LoginUser login(String username, String password, HttpServletRequest request) {
- // 查询用户信息
- R<LoginUser> userResult = remoteUserService.getUserInfo(username, SecurityConstants.INNER);
-
- if (StringUtils.isNull(userResult) || StringUtils.isNull(userResult.getData()))
- {
- recordLogService.recordLogininfor(request, null, username, Constants.LOGIN_FAIL_STATUS, "登录用户不存在");
- throw new ServiceException("登录用户:" + username + " 不存在");
- }
- LoginUser userInfo = userResult.getData();
- SysUser user = userResult.getData().getSysUser();
-
- // 用户名或密码为空 错误
- if (StringUtils.isAnyBlank(username, password))
- {
- recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, "用户/密码必须填写");
- throw new ServiceException("用户/密码必须填写");
- }
- // 密码如果不在指定范围内 错误
- if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
- || password.length() > UserConstants.PASSWORD_MAX_LENGTH)
- {
- recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, "用户密码不在指定范围");
- throw new ServiceException("用户密码不在指定范围");
- }
- // 用户名不在指定范围内 错误
- if (username.length() < UserConstants.USERNAME_MIN_LENGTH
- || username.length() > UserConstants.USERNAME_MAX_LENGTH)
- {
- recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, "用户名不在指定范围");
- throw new ServiceException("用户名不在指定范围");
- }
- // IP黑名单校验
- String blackStr = Convert.toStr(redisService.getCacheObject(CacheConstants.SYS_LOGIN_BLACKIPLIST));
- if (IpUtils.isMatchedIp(blackStr, IpUtils.getIpAddr()))
- {
- recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, "很遗憾,访问IP已被列入系统黑名单");
- throw new ServiceException("很遗憾,访问IP已被列入系统黑名单");
- }
-
- if (R.FAIL == userResult.getCode())
- {
- throw new ServiceException(userResult.getMsg());
- }
-
-
- if (UserStatus.DELETED.getCode().equals(user.getDelFlag()))
- {
- recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, "对不起,您的账号已被删除");
- throw new ServiceException("对不起,您的账号:" + username + " 已被删除");
- }
- if (UserStatus.DISABLE.getCode().equals(user.getStatus()))
- {
- recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, "用户已停用,请联系管理员");
- throw new ServiceException("对不起,您的账号:" + username + " 已停用");
- }
- passwordService.validate(user, password, request);
- recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_SUCCESS_STATUS, "登录成功");
- return userInfo;
- }
-
- public void logout(String loginName, HttpServletRequest request)
- {
- recordLogService.recordLogininfor(request, null, loginName, Constants.LOGIN_SUCCESS_STATUS, "退出成功");
- }
-
- /**
- * 注册
- */
- public void register(String username, String password, HttpServletRequest request)
- {
- // 用户名或密码为空 错误
- if (StringUtils.isAnyBlank(username, password))
- {
- throw new ServiceException("用户/密码必须填写");
- }
- if (username.length() < UserConstants.USERNAME_MIN_LENGTH
- || username.length() > UserConstants.USERNAME_MAX_LENGTH)
- {
- throw new ServiceException("账户长度必须在2到20个字符之间");
- }
- if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
- || password.length() > UserConstants.PASSWORD_MAX_LENGTH)
- {
- throw new ServiceException("密码长度必须在5到20个字符之间");
- }
-
- // 注册用户信息
- SysUser sysUser = new SysUser();
- sysUser.setUserName(username);
- sysUser.setNickName(username);
- sysUser.setPassword(SecurityUtils.encryptPassword(password));
- R<?> registerResult = remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER);
-
- if (R.FAIL == registerResult.getCode())
- {
- throw new ServiceException(registerResult.getMsg());
- }
- recordLogService.recordLogininfor(request, sysUser.getUserId().intValue(), username, Constants.LOGIN_SUCCESS_STATUS, "注册成功");
- }
+public class SysLoginService {
+ @Autowired
+ private RemoteUserService remoteUserService;
+
+ @Autowired
+ private SysPasswordService passwordService;
+
+ @Autowired
+ private SysRecordLogService recordLogService;
+
+ @Autowired
+ private RedisService redisService;
+
+ /**
+ * 登录
+ */
+ public LoginUser login(String username, String password, HttpServletRequest request) {
+ username = username.trim();
+ // 查询用户信息
+ R<LoginUser> userResult = remoteUserService.getUserInfo(username, SecurityConstants.INNER);
+
+ if (StringUtils.isNull(userResult) || StringUtils.isNull(userResult.getData())) {
+ recordLogService.recordLogininfor(request, null, username, Constants.LOGIN_FAIL_STATUS, "登录用户不存在");
+ throw new ServiceException("登录用户:" + username + " 不存在");
+ }
+ LoginUser userInfo = userResult.getData();
+ SysUser user = userResult.getData().getSysUser();
+
+ // 用户名或密码为空 错误
+ if (StringUtils.isAnyBlank(username, password)) {
+ recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, "用户/密码必须填写");
+ throw new ServiceException("用户/密码必须填写");
+ }
+ // 密码如果不在指定范围内 错误
+ if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
+ || password.length() > UserConstants.PASSWORD_MAX_LENGTH) {
+ recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, "用户密码不在指定范围");
+ throw new ServiceException("用户密码不在指定范围");
+ }
+ // 用户名不在指定范围内 错误
+ if (username.length() < UserConstants.USERNAME_MIN_LENGTH
+ || username.length() > UserConstants.USERNAME_MAX_LENGTH) {
+ recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, "用户名不在指定范围");
+ throw new ServiceException("用户名不在指定范围");
+ }
+ // IP黑名单校验
+ String blackStr = Convert.toStr(redisService.getCacheObject(CacheConstants.SYS_LOGIN_BLACKIPLIST));
+ if (IpUtils.isMatchedIp(blackStr, IpUtils.getIpAddr())) {
+ recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, "很遗憾,访问IP已被列入系统黑名单");
+ throw new ServiceException("很遗憾,访问IP已被列入系统黑名单");
+ }
+
+ if (R.FAIL == userResult.getCode()) {
+ throw new ServiceException(userResult.getMsg());
+ }
+
+
+ if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) {
+ recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, "对不起,您的账号已被删除");
+ throw new ServiceException("对不起,您的账号:" + username + " 已被删除");
+ }
+ if (UserStatus.DISABLE.getCode().equals(user.getStatus())) {
+ recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, "用户已停用,请联系管理员");
+ throw new ServiceException("对不起,您的账号:" + username + " 已停用");
+ }
+ passwordService.validate(user, password, request);
+ recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_SUCCESS_STATUS, "登录成功");
+ return userInfo;
+ }
+
+ public void logout(String loginName, HttpServletRequest request) {
+ recordLogService.recordLogininfor(request, null, loginName, Constants.LOGIN_SUCCESS_STATUS, "退出成功");
+ }
+
+ /**
+ * 注册
+ */
+ public void register(String username, String password, HttpServletRequest request) {
+ // 用户名或密码为空 错误
+ if (StringUtils.isAnyBlank(username, password)) {
+ throw new ServiceException("用户/密码必须填写");
+ }
+ if (username.length() < UserConstants.USERNAME_MIN_LENGTH
+ || username.length() > UserConstants.USERNAME_MAX_LENGTH) {
+ throw new ServiceException("账户长度必须在2到20个字符之间");
+ }
+ if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
+ || password.length() > UserConstants.PASSWORD_MAX_LENGTH) {
+ throw new ServiceException("密码长度必须在5到20个字符之间");
+ }
+
+ // 注册用户信息
+ SysUser sysUser = new SysUser();
+ sysUser.setUserName(username);
+ sysUser.setNickName(username);
+ sysUser.setPassword(SecurityUtils.encryptPassword(password));
+ R<?> registerResult = remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER);
+
+ if (R.FAIL == registerResult.getCode()) {
+ throw new ServiceException(registerResult.getMsg());
+ }
+ recordLogService.recordLogininfor(request, sysUser.getUserId().intValue(), username, Constants.LOGIN_SUCCESS_STATUS, "注册成功");
+ }
}
diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/Constants.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/Constants.java
index ca886c7..1598576 100644
--- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/Constants.java
+++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/Constants.java
@@ -60,12 +60,12 @@
/**
* 登录成功状态
*/
- public static final String LOGIN_SUCCESS_STATUS = "0";
+ public static final String LOGIN_SUCCESS_STATUS = "1";
/**
* 登录失败状态
*/
- public static final String LOGIN_FAIL_STATUS = "1";
+ public static final String LOGIN_FAIL_STATUS = "2";
/**
* 登录成功
diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/dto/ExchangeBackDto.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/dto/ExchangeBackDto.java
new file mode 100644
index 0000000..102ecb9
--- /dev/null
+++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/dto/ExchangeBackDto.java
@@ -0,0 +1,9 @@
+package com.ruoyi.common.core.dto;
+
+import lombok.Data;
+
+@Data
+public class ExchangeBackDto {
+ private Long id;
+ private String code;
+}
diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/dto/PointChangeDto.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/dto/PointChangeDto.java
index 4a6d0fb..3417d40 100644
--- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/dto/PointChangeDto.java
+++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/dto/PointChangeDto.java
@@ -8,4 +8,5 @@
private Integer points;
private String remark;
private Integer type;
+ private String code;
}
diff --git a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/utils/FileUploadUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/FileUploadUtils.java
similarity index 97%
rename from ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/utils/FileUploadUtils.java
rename to ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/FileUploadUtils.java
index 8109d34..9512737 100644
--- a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/utils/FileUploadUtils.java
+++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/FileUploadUtils.java
@@ -1,4 +1,4 @@
-package com.ruoyi.file.utils;
+package com.ruoyi.common.core.utils;
import java.io.File;
import java.io.IOException;
@@ -10,8 +10,6 @@
import com.ruoyi.common.core.exception.file.FileNameLengthLimitExceededException;
import com.ruoyi.common.core.exception.file.FileSizeLimitExceededException;
import com.ruoyi.common.core.exception.file.InvalidExtensionException;
-import com.ruoyi.common.core.utils.DateUtils;
-import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.common.core.utils.file.FileTypeUtils;
import com.ruoyi.common.core.utils.file.MimeTypeUtils;
import com.ruoyi.common.core.utils.uuid.Seq;
diff --git a/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/aspect/LogAspect.java b/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/aspect/LogAspect.java
index e4f2dd0..a3220ef 100644
--- a/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/aspect/LogAspect.java
+++ b/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/aspect/LogAspect.java
@@ -31,219 +31,188 @@
/**
* 操作日志记录处理
- *
+ *
* @author ruoyi
*/
@Aspect
@Component
-public class LogAspect
-{
- private static final Logger log = LoggerFactory.getLogger(LogAspect.class);
-
- /** 排除敏感属性字段 */
- public static final String[] EXCLUDE_PROPERTIES = { "password", "oldPassword", "newPassword", "confirmPassword" };
-
- /** 计算操作消耗时间 */
- private static final ThreadLocal<Long> TIME_THREADLOCAL = new NamedThreadLocal<Long>("Cost Time");
-
- @Autowired
- private AsyncLogService asyncLogService;
-
- /**
- * 处理请求前执行
- */
- @Before(value = "@annotation(controllerLog)")
- public void boBefore(JoinPoint joinPoint, Log controllerLog)
- {
- TIME_THREADLOCAL.set(System.currentTimeMillis());
- }
-
- /**
- * 处理完请求后执行
- *
- * @param joinPoint 切点
- */
- @AfterReturning(pointcut = "@annotation(controllerLog)", returning = "jsonResult")
- public void doAfterReturning(JoinPoint joinPoint, Log controllerLog, Object jsonResult)
- {
- handleLog(joinPoint, controllerLog, null, jsonResult);
- }
-
- /**
- * 拦截异常操作
- *
- * @param joinPoint 切点
- * @param e 异常
- */
- @AfterThrowing(value = "@annotation(controllerLog)", throwing = "e")
- public void doAfterThrowing(JoinPoint joinPoint, Log controllerLog, Exception e)
- {
- handleLog(joinPoint, controllerLog, e, null);
- }
-
- protected void handleLog(final JoinPoint joinPoint, Log controllerLog, final Exception e, Object jsonResult)
- {
- try
- {
- // *========数据库日志=========*//
- SysOperLog operLog = new SysOperLog();
- operLog.setStatus(BusinessStatus.SUCCESS.ordinal());
- // 请求的地址
- String ip = IpUtils.getIpAddr();
- operLog.setOperIp(ip);
- operLog.setOperUrl(StringUtils.substring(ServletUtils.getRequest().getRequestURI(), 0, 255));
- String username = SecurityUtils.getUsername();
- if (StringUtils.isNotBlank(username))
- {
- operLog.setOperName(username);
- }
-
- if (e != null)
- {
- operLog.setStatus(BusinessStatus.FAIL.ordinal());
- operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 2000));
- }
- // 设置方法名称
- String className = joinPoint.getTarget().getClass().getName();
- String methodName = joinPoint.getSignature().getName();
- operLog.setMethod(className + "." + methodName + "()");
- // 设置请求方式
- operLog.setRequestMethod(ServletUtils.getRequest().getMethod());
- // 处理设置注解上的参数
- getControllerMethodDescription(joinPoint, controllerLog, operLog, jsonResult);
- // 设置消耗时间
- operLog.setCostTime(System.currentTimeMillis() - TIME_THREADLOCAL.get());
- // 保存数据库
- asyncLogService.saveSysLog(operLog);
- }
- catch (Exception exp)
- {
- // 记录本地异常日志
- log.error("异常信息:{}", exp.getMessage());
- exp.printStackTrace();
- }
- finally
- {
- TIME_THREADLOCAL.remove();
- }
- }
-
- /**
- * 获取注解中对方法的描述信息 用于Controller层注解
- *
- * @param log 日志
- * @param operLog 操作日志
- * @throws Exception
- */
- public void getControllerMethodDescription(JoinPoint joinPoint, Log log, SysOperLog operLog, Object jsonResult) throws Exception
- {
- // 设置action动作
- operLog.setBusinessType(log.businessType().ordinal());
- // 设置标题
- operLog.setTitle(log.title());
- // 设置操作人类别
- operLog.setOperatorType(log.operatorType().ordinal());
- // 是否需要保存request,参数和值
- if (log.isSaveRequestData())
- {
- // 获取参数的信息,传入到数据库中。
- setRequestValue(joinPoint, operLog, log.excludeParamNames());
- }
- // 是否需要保存response,参数和值
- if (log.isSaveResponseData() && StringUtils.isNotNull(jsonResult))
- {
- operLog.setJsonResult(StringUtils.substring(JSON.toJSONString(jsonResult), 0, 2000));
- }
- }
-
- /**
- * 获取请求的参数,放到log中
- *
- * @param operLog 操作日志
- * @throws Exception 异常
- */
- private void setRequestValue(JoinPoint joinPoint, SysOperLog operLog, String[] excludeParamNames) throws Exception
- {
- String requestMethod = operLog.getRequestMethod();
- Map<?, ?> paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest());
- if (StringUtils.isEmpty(paramsMap)
- && (HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod)))
- {
- String params = argsArrayToString(joinPoint.getArgs(), excludeParamNames);
- operLog.setOperParam(StringUtils.substring(params, 0, 2000));
- }
- else
- {
- operLog.setOperParam(StringUtils.substring(JSON.toJSONString(paramsMap, excludePropertyPreFilter(excludeParamNames)), 0, 2000));
- }
- }
-
- /**
- * 参数拼装
- */
- private String argsArrayToString(Object[] paramsArray, String[] excludeParamNames)
- {
- String params = "";
- if (paramsArray != null && paramsArray.length > 0)
- {
- for (Object o : paramsArray)
- {
- if (StringUtils.isNotNull(o) && !isFilterObject(o))
- {
- try
- {
- String jsonObj = JSON.toJSONString(o, excludePropertyPreFilter(excludeParamNames));
- params += jsonObj.toString() + " ";
- }
- catch (Exception e)
- {
- }
- }
- }
- }
- return params.trim();
- }
-
- /**
- * 忽略敏感属性
- */
- public PropertyPreExcludeFilter excludePropertyPreFilter(String[] excludeParamNames)
- {
- return new PropertyPreExcludeFilter().addExcludes(ArrayUtils.addAll(EXCLUDE_PROPERTIES, excludeParamNames));
- }
-
- /**
- * 判断是否需要过滤的对象。
- *
- * @param o 对象信息。
- * @return 如果是需要过滤的对象,则返回true;否则返回false。
- */
- @SuppressWarnings("rawtypes")
- public boolean isFilterObject(final Object o)
- {
- Class<?> clazz = o.getClass();
- if (clazz.isArray())
- {
- return clazz.getComponentType().isAssignableFrom(MultipartFile.class);
- }
- else if (Collection.class.isAssignableFrom(clazz))
- {
- Collection collection = (Collection) o;
- for (Object value : collection)
- {
- return value instanceof MultipartFile;
- }
- }
- else if (Map.class.isAssignableFrom(clazz))
- {
- Map map = (Map) o;
- for (Object value : map.entrySet())
- {
- Map.Entry entry = (Map.Entry) value;
- return entry.getValue() instanceof MultipartFile;
- }
- }
- return o instanceof MultipartFile || o instanceof HttpServletRequest || o instanceof HttpServletResponse
- || o instanceof BindingResult;
- }
+public class LogAspect {
+ private static final Logger log = LoggerFactory.getLogger(LogAspect.class);
+
+ /**
+ * 排除敏感属性字段
+ */
+ public static final String[] EXCLUDE_PROPERTIES = {"password", "oldPassword", "newPassword", "confirmPassword"};
+
+ /**
+ * 计算操作消耗时间
+ */
+ private static final ThreadLocal<Long> TIME_THREADLOCAL = new NamedThreadLocal<Long>("Cost Time");
+
+ @Autowired
+ private AsyncLogService asyncLogService;
+
+ /**
+ * 处理请求前执行
+ */
+ @Before(value = "@annotation(controllerLog)")
+ public void boBefore(JoinPoint joinPoint, Log controllerLog) {
+ TIME_THREADLOCAL.set(System.currentTimeMillis());
+ }
+
+ /**
+ * 处理完请求后执行
+ *
+ * @param joinPoint 切点
+ */
+ @AfterReturning(pointcut = "@annotation(controllerLog)", returning = "jsonResult")
+ public void doAfterReturning(JoinPoint joinPoint, Log controllerLog, Object jsonResult) {
+ handleLog(joinPoint, controllerLog, null, jsonResult);
+ }
+
+ /**
+ * 拦截异常操作
+ *
+ * @param joinPoint 切点
+ * @param e 异常
+ */
+ @AfterThrowing(value = "@annotation(controllerLog)", throwing = "e")
+ public void doAfterThrowing(JoinPoint joinPoint, Log controllerLog, Exception e) {
+ handleLog(joinPoint, controllerLog, e, null);
+ }
+
+ protected void handleLog(final JoinPoint joinPoint, Log controllerLog, final Exception e, Object jsonResult) {
+ try {
+ // *========数据库日志=========*//
+ SysOperLog operLog = new SysOperLog();
+ operLog.setStatus(BusinessStatus.SUCCESS.ordinal());
+ // 请求的地址
+ String ip = IpUtils.getIpAddr();
+ operLog.setOperIp(ip);
+ operLog.setOperUrl(StringUtils.substring(ServletUtils.getRequest().getRequestURI(), 0, 255));
+ String username = SecurityUtils.getUsername();
+ if (StringUtils.isNotBlank(username)) {
+ operLog.setOperName(username);
+ }
+
+ if (e != null) {
+ operLog.setStatus(BusinessStatus.FAIL.ordinal());
+ operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 2000));
+ }
+ // 设置方法名称
+ String className = joinPoint.getTarget().getClass().getName();
+ String methodName = joinPoint.getSignature().getName();
+ operLog.setMethod(className + "." + methodName + "()");
+ // 设置请求方式
+ operLog.setRequestMethod(ServletUtils.getRequest().getMethod());
+ // 处理设置注解上的参数
+ getControllerMethodDescription(joinPoint, controllerLog, operLog, jsonResult);
+ // 设置消耗时间
+ operLog.setCostTime(System.currentTimeMillis() - TIME_THREADLOCAL.get());
+ // 保存数据库
+ asyncLogService.saveSysLog(operLog);
+ } catch (Exception exp) {
+ // 记录本地异常日志
+ log.error("异常信息:{}", exp.getMessage());
+ exp.printStackTrace();
+ } finally {
+ TIME_THREADLOCAL.remove();
+ }
+ }
+
+ /**
+ * 获取注解中对方法的描述信息 用于Controller层注解
+ *
+ * @param log 日志
+ * @param operLog 操作日志
+ * @throws Exception
+ */
+ public void getControllerMethodDescription(JoinPoint joinPoint, Log log, SysOperLog operLog, Object jsonResult) throws Exception {
+ // 设置action动作
+ operLog.setBusinessType(log.businessType().ordinal());
+ // 设置标题
+ operLog.setTitle(log.title());
+ // 设置操作人类别
+ operLog.setOperatorType(log.operatorType().ordinal());
+ // 是否需要保存request,参数和值
+ if (log.isSaveRequestData()) {
+ // 获取参数的信息,传入到数据库中。
+ setRequestValue(joinPoint, operLog, log.excludeParamNames());
+ }
+ // 是否需要保存response,参数和值
+ if (log.isSaveResponseData() && StringUtils.isNotNull(jsonResult)) {
+ operLog.setJsonResult(StringUtils.substring(JSON.toJSONString(jsonResult), 0, 2000));
+ }
+ }
+
+ /**
+ * 获取请求的参数,放到log中
+ *
+ * @param operLog 操作日志
+ * @throws Exception 异常
+ */
+ private void setRequestValue(JoinPoint joinPoint, SysOperLog operLog, String[] excludeParamNames) throws Exception {
+ String requestMethod = operLog.getRequestMethod();
+ Map<?, ?> paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest());
+ if (StringUtils.isEmpty(paramsMap)
+ && (HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod))) {
+ String params = argsArrayToString(joinPoint.getArgs(), excludeParamNames);
+ operLog.setOperParam(StringUtils.substring(params, 0, 2000));
+ } else {
+ operLog.setOperParam(StringUtils.substring(JSON.toJSONString(paramsMap, excludePropertyPreFilter(excludeParamNames)), 0, 2000));
+ }
+ }
+
+ /**
+ * 参数拼装
+ */
+ private String argsArrayToString(Object[] paramsArray, String[] excludeParamNames) {
+ String params = "";
+ if (paramsArray != null && paramsArray.length > 0) {
+ for (Object o : paramsArray) {
+ if (StringUtils.isNotNull(o) && !isFilterObject(o)) {
+ try {
+ String jsonObj = JSON.toJSONString(o, excludePropertyPreFilter(excludeParamNames));
+ params += jsonObj.toString() + " ";
+ } catch (Exception e) {
+ }
+ }
+ }
+ }
+ return params.trim();
+ }
+
+ /**
+ * 忽略敏感属性
+ */
+ public PropertyPreExcludeFilter excludePropertyPreFilter(String[] excludeParamNames) {
+ return new PropertyPreExcludeFilter().addExcludes(ArrayUtils.addAll(EXCLUDE_PROPERTIES, excludeParamNames));
+ }
+
+ /**
+ * 判断是否需要过滤的对象。
+ *
+ * @param o 对象信息。
+ * @return 如果是需要过滤的对象,则返回true;否则返回false。
+ */
+ @SuppressWarnings("rawtypes")
+ public boolean isFilterObject(final Object o) {
+ Class<?> clazz = o.getClass();
+ if (clazz.isArray()) {
+ return clazz.getComponentType().isAssignableFrom(MultipartFile.class);
+ } else if (Collection.class.isAssignableFrom(clazz)) {
+ Collection collection = (Collection) o;
+ for (Object value : collection) {
+ return value instanceof MultipartFile;
+ }
+ } else if (Map.class.isAssignableFrom(clazz)) {
+ Map map = (Map) o;
+ for (Object value : map.entrySet()) {
+ Map.Entry entry = (Map.Entry) value;
+ return entry.getValue() instanceof MultipartFile;
+ }
+ }
+ return o instanceof MultipartFile || o instanceof HttpServletRequest || o instanceof HttpServletResponse
+ || o instanceof BindingResult;
+ }
}
diff --git a/ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/handler/GlobalExceptionHandler.java b/ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/handler/GlobalExceptionHandler.java
index 897d0c3..ff52f59 100644
--- a/ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/handler/GlobalExceptionHandler.java
+++ b/ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/handler/GlobalExceptionHandler.java
@@ -34,7 +34,7 @@
public class GlobalExceptionHandler {
private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class);
- @Value("${spring.servlet.multipart.max-file-size:10MB}")
+ @Value("${spring.servlet.multipart.max-file-size:50MB}")
private String maxFileSize;
@Value("${spring.servlet.multipart.max-request-size:100MB}")
private String maxRequestSize;
@@ -88,7 +88,7 @@
public AjaxResult handleRuntimeException(RuntimeException e, HttpServletRequest request) {
String requestURI = request.getRequestURI();
log.error("请求地址'{}',发生未知异常.", requestURI, e);
- throw new RuntimeException(e.getMessage());
+ return AjaxResult.error(e.getMessage());
}
/**
diff --git a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/LocalSysFileServiceImpl.java b/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/LocalSysFileServiceImpl.java
index 3247e9b..6b0606e 100644
--- a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/LocalSysFileServiceImpl.java
+++ b/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/LocalSysFileServiceImpl.java
@@ -4,7 +4,7 @@
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
-import com.ruoyi.file.utils.FileUploadUtils;
+import com.ruoyi.common.core.utils.FileUploadUtils;
/**
* 本地文件存储
diff --git a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/MinioSysFileServiceImpl.java b/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/MinioSysFileServiceImpl.java
index f53d86f..790c36b 100644
--- a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/MinioSysFileServiceImpl.java
+++ b/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/MinioSysFileServiceImpl.java
@@ -6,7 +6,7 @@
import org.springframework.web.multipart.MultipartFile;
import com.alibaba.nacos.common.utils.IoUtils;
import com.ruoyi.file.config.MinioConfig;
-import com.ruoyi.file.utils.FileUploadUtils;
+import com.ruoyi.common.core.utils.FileUploadUtils;
import io.minio.MinioClient;
import io.minio.PutObjectArgs;
diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java
index 4780d71..752e3d0 100644
--- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java
@@ -680,7 +680,6 @@
@PostMapping("/addSysUser")
@Transactional(rollbackFor = Exception.class)
public R addSysUser(@RequestBody SysUser user) {
- System.err.println("事务ID:" + RootContext.getXID());
if(StringUtils.isEmpty(user.getUserName())){
user.setUserName(user.getPhonenumber());
}
diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/filter/AuthFilter.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/filter/AuthFilter.java
index 392bd32..b7e595a 100644
--- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/filter/AuthFilter.java
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/filter/AuthFilter.java
@@ -82,7 +82,7 @@
return;
}
}
- filterChain.doFilter(request, response);
+ filterChain.doFilter(servletRequest, servletResponse);
}
diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/query/SysOperLogQuery.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/query/SysOperLogQuery.java
index fcb7a5b..0dbb38e 100644
--- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/query/SysOperLogQuery.java
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/query/SysOperLogQuery.java
@@ -5,6 +5,7 @@
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@@ -17,11 +18,11 @@
private String title;
@ApiModelProperty(value = "状态(0=正常,1=异常)")
private Integer status;
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "操作开始时间", notes = "yyyy-MM-dd HH:mm:ss")
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime startTime;
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "操作结束时间", notes = "yyyy-MM-dd HH:mm:ss")
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime endTime;
}
diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java
index e5cc275..3c52cfc 100644
--- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java
@@ -29,427 +29,389 @@
/**
* 角色 业务层处理
- *
+ *
* @author ruoyi
*/
@Service
-public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements ISysRoleService
-{
- @Autowired
- private SysRoleMapper roleMapper;
-
- @Autowired
- private SysRoleMenuMapper roleMenuMapper;
-
- @Autowired
- private SysUserRoleMapper userRoleMapper;
-
- @Autowired
- private SysRoleDeptMapper roleDeptMapper;
-
- /**
- * 根据条件分页查询角色数据
- *
- * @param role 角色信息
- * @return 角色数据集合信息
- */
- @Override
- @DataScope(deptAlias = "d")
- public List<SysRole> selectRoleList(SysRole role)
- {
- return roleMapper.selectRoleList(role);
- }
-
- /**
- * 根据用户ID查询角色
- *
- * @param userId 用户ID
- * @return 角色列表
- */
- @Override
- public List<SysRole> selectRolesByUserId(Long userId)
- {
- List<SysRole> userRoles = roleMapper.selectRolePermissionByUserId(userId);
- List<SysRole> roles = selectRoleAll();
- for (SysRole role : roles)
- {
- for (SysRole userRole : userRoles)
- {
- if (role.getRoleId().longValue() == userRole.getRoleId().longValue())
- {
- role.setFlag(true);
- break;
- }
- }
- }
- return roles;
- }
-
- /**
- * 根据用户ID查询权限
- *
- * @param userId 用户ID
- * @return 权限列表
- */
- @Override
- public Set<String> selectRolePermissionByUserId(Long userId)
- {
- List<SysRole> perms = roleMapper.selectRolePermissionByUserId(userId);
- Set<String> permsSet = new HashSet<>();
- for (SysRole perm : perms)
- {
- if (StringUtils.isNotNull(perm))
- {
- permsSet.addAll(Arrays.asList(perm.getRoleKey().trim().split(",")));
- }
- }
- return permsSet;
- }
-
- /**
- * 查询所有角色
- *
- * @return 角色列表
- */
- @Override
- public List<SysRole> selectRoleAll()
- {
- return SpringUtils.getAopProxy(this).selectRoleList(new SysRole());
- }
-
- /**
- * 根据用户ID获取角色选择框列表
- *
- * @param userId 用户ID
- * @return 选中角色ID列表
- */
- @Override
- public List<Long> selectRoleListByUserId(Long userId)
- {
- return roleMapper.selectRoleListByUserId(userId);
- }
-
- /**
- * 通过角色ID查询角色
- *
- * @param roleId 角色ID
- * @return 角色对象信息
- */
- @Override
- public SysRole selectRoleById(Long roleId)
- {
- return roleMapper.selectRoleById(roleId);
- }
-
- /**
- * 校验角色名称是否唯一
- *
- * @param role 角色信息
- * @return 结果
- */
- @Override
- public boolean checkRoleNameUnique(SysRole role)
- {
- Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
- SysRole info = roleMapper.checkRoleNameUnique(role.getRoleName());
- if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue())
- {
- return UserConstants.NOT_UNIQUE;
- }
- return UserConstants.UNIQUE;
- }
-
- /**
- * 校验角色权限是否唯一
- *
- * @param role 角色信息
- * @return 结果
- */
- @Override
- public boolean checkRoleKeyUnique(SysRole role)
- {
- Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
- SysRole info = roleMapper.checkRoleKeyUnique(role.getRoleKey());
- if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue())
- {
- return UserConstants.NOT_UNIQUE;
- }
- return UserConstants.UNIQUE;
- }
-
- /**
- * 校验角色是否允许操作
- *
- * @param role 角色信息
- */
- @Override
- public void checkRoleAllowed(SysRole role)
- {
- if (StringUtils.isNotNull(role.getRoleId()) && role.isAdmin())
- {
- throw new ServiceException("不允许操作超级管理员角色");
- }
- }
-
- /**
- * 校验角色是否有数据权限
- *
- * @param roleId 角色id
- */
- @Override
- public void checkRoleDataScope(Long roleId)
- {
- if (!SysUser.isAdmin(SecurityUtils.getUserId()))
- {
- SysRole role = new SysRole();
- role.setRoleId(roleId);
- List<SysRole> roles = SpringUtils.getAopProxy(this).selectRoleList(role);
- if (StringUtils.isEmpty(roles))
- {
- throw new ServiceException("没有权限访问角色数据!");
- }
- }
- }
-
- /**
- * 通过角色ID查询角色使用数量
- *
- * @param roleId 角色ID
- * @return 结果
- */
- @Override
- public int countUserRoleByRoleId(Long roleId)
- {
- return userRoleMapper.countUserRoleByRoleId(roleId);
- }
-
- /**
- * 新增保存角色信息
- *
- * @param role 角色信息
- * @return 结果
- */
- @Override
- @Transactional(rollbackFor = Exception.class)
- public int insertRole(SysRole role)
- {
- // 新增角色信息
- roleMapper.insertRole(role);
- return insertRoleMenu(role);
- }
-
- /**
- * 修改保存角色信息
- *
- * @param role 角色信息
- * @return 结果
- */
- @Override
- @Transactional(rollbackFor = Exception.class)
- public int updateRole(SysRole role)
- {
- // 修改角色信息
+public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements ISysRoleService {
+ @Autowired
+ private SysRoleMapper roleMapper;
+
+ @Autowired
+ private SysRoleMenuMapper roleMenuMapper;
+
+ @Autowired
+ private SysUserRoleMapper userRoleMapper;
+
+ @Autowired
+ private SysRoleDeptMapper roleDeptMapper;
+
+ /**
+ * 根据条件分页查询角色数据
+ *
+ * @param role 角色信息
+ * @return 角色数据集合信息
+ */
+ @Override
+ @DataScope(deptAlias = "d")
+ public List<SysRole> selectRoleList(SysRole role) {
+ return roleMapper.selectRoleList(role);
+ }
+
+ /**
+ * 根据用户ID查询角色
+ *
+ * @param userId 用户ID
+ * @return 角色列表
+ */
+ @Override
+ public List<SysRole> selectRolesByUserId(Long userId) {
+ List<SysRole> userRoles = roleMapper.selectRolePermissionByUserId(userId);
+ List<SysRole> roles = selectRoleAll();
+ for (SysRole role : roles) {
+ for (SysRole userRole : userRoles) {
+ if (role.getRoleId().longValue() == userRole.getRoleId().longValue()) {
+ role.setFlag(true);
+ break;
+ }
+ }
+ }
+ return roles;
+ }
+
+ /**
+ * 根据用户ID查询权限
+ *
+ * @param userId 用户ID
+ * @return 权限列表
+ */
+ @Override
+ public Set<String> selectRolePermissionByUserId(Long userId) {
+ List<SysRole> perms = roleMapper.selectRolePermissionByUserId(userId);
+ Set<String> permsSet = new HashSet<>();
+ for (SysRole perm : perms) {
+ if (StringUtils.isNotNull(perm)) {
+ permsSet.addAll(Arrays.asList(perm.getRoleKey().trim().split(",")));
+ }
+ }
+ return permsSet;
+ }
+
+ /**
+ * 查询所有角色
+ *
+ * @return 角色列表
+ */
+ @Override
+ public List<SysRole> selectRoleAll() {
+ return SpringUtils.getAopProxy(this).selectRoleList(new SysRole());
+ }
+
+ /**
+ * 根据用户ID获取角色选择框列表
+ *
+ * @param userId 用户ID
+ * @return 选中角色ID列表
+ */
+ @Override
+ public List<Long> selectRoleListByUserId(Long userId) {
+ return roleMapper.selectRoleListByUserId(userId);
+ }
+
+ /**
+ * 通过角色ID查询角色
+ *
+ * @param roleId 角色ID
+ * @return 角色对象信息
+ */
+ @Override
+ public SysRole selectRoleById(Long roleId) {
+ return roleMapper.selectRoleById(roleId);
+ }
+
+ /**
+ * 校验角色名称是否唯一
+ *
+ * @param role 角色信息
+ * @return 结果
+ */
+ @Override
+ public boolean checkRoleNameUnique(SysRole role) {
+ Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
+ SysRole info = roleMapper.checkRoleNameUnique(role.getRoleName());
+ if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) {
+ return UserConstants.NOT_UNIQUE;
+ }
+ return UserConstants.UNIQUE;
+ }
+
+ /**
+ * 校验角色权限是否唯一
+ *
+ * @param role 角色信息
+ * @return 结果
+ */
+ @Override
+ public boolean checkRoleKeyUnique(SysRole role) {
+ Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
+ SysRole info = roleMapper.checkRoleKeyUnique(role.getRoleKey());
+ if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) {
+ return UserConstants.NOT_UNIQUE;
+ }
+ return UserConstants.UNIQUE;
+ }
+
+ /**
+ * 校验角色是否允许操作
+ *
+ * @param role 角色信息
+ */
+ @Override
+ public void checkRoleAllowed(SysRole role) {
+ if (StringUtils.isNotNull(role.getRoleId()) && role.isAdmin()) {
+ throw new ServiceException("不允许操作超级管理员角色");
+ }
+ }
+
+ /**
+ * 校验角色是否有数据权限
+ *
+ * @param roleId 角色id
+ */
+ @Override
+ public void checkRoleDataScope(Long roleId) {
+ if (!SysUser.isAdmin(SecurityUtils.getUserId())) {
+ SysRole role = new SysRole();
+ role.setRoleId(roleId);
+ List<SysRole> roles = SpringUtils.getAopProxy(this).selectRoleList(role);
+ if (StringUtils.isEmpty(roles)) {
+ throw new ServiceException("没有权限访问角色数据!");
+ }
+ }
+ }
+
+ /**
+ * 通过角色ID查询角色使用数量
+ *
+ * @param roleId 角色ID
+ * @return 结果
+ */
+ @Override
+ public int countUserRoleByRoleId(Long roleId) {
+ return userRoleMapper.countUserRoleByRoleId(roleId);
+ }
+
+ /**
+ * 新增保存角色信息
+ *
+ * @param role 角色信息
+ * @return 结果
+ */
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public int insertRole(SysRole role) {
+ // 新增角色信息
+ roleMapper.insertRole(role);
+ return insertRoleMenu(role);
+ }
+
+ /**
+ * 修改保存角色信息
+ *
+ * @param role 角色信息
+ * @return 结果
+ */
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public int updateRole(SysRole role) {
+ // 修改角色信息
// roleMapper.updateRole(role);
- // 删除角色与菜单关联
+ // 删除角色与菜单关联
// roleMenuMapper.deleteRoleMenuByRoleId(role.getRoleId());
- return roleMapper.updateRole(role);
- }
-
- /**
- * 修改角色状态
- *
- * @param role 角色信息
- * @return 结果
- */
- @Override
- public int updateRoleStatus(SysRole role)
- {
- return roleMapper.updateRole(role);
- }
-
- /**
- * 修改数据权限信息
- *
- * @param role 角色信息
- * @return 结果
- */
- @Override
- @Transactional(rollbackFor = Exception.class)
- public int authDataScope(SysRole role)
- {
- // 修改角色信息
- roleMapper.updateRole(role);
- // 删除角色与部门关联
- roleDeptMapper.deleteRoleDeptByRoleId(role.getRoleId());
- // 新增角色和部门信息(数据权限)
- return insertRoleDept(role);
- }
-
- /**
- * 新增角色菜单信息
- *
- * @param role 角色对象
- */
- public int insertRoleMenu(SysRole role)
- {
- int rows = 1;
- // 新增用户与角色管理
- List<SysRoleMenu> list = new ArrayList<SysRoleMenu>();
- Long[] menuIds = role.getMenuIds();
+ return roleMapper.updateRole(role);
+ }
+
+ /**
+ * 修改角色状态
+ *
+ * @param role 角色信息
+ * @return 结果
+ */
+ @Override
+ public int updateRoleStatus(SysRole role) {
+ return roleMapper.updateRole(role);
+ }
+
+ /**
+ * 修改数据权限信息
+ *
+ * @param role 角色信息
+ * @return 结果
+ */
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public int authDataScope(SysRole role) {
+ // 修改角色信息
+ roleMapper.updateRole(role);
+ // 删除角色与部门关联
+ roleDeptMapper.deleteRoleDeptByRoleId(role.getRoleId());
+ // 新增角色和部门信息(数据权限)
+ return insertRoleDept(role);
+ }
+
+ /**
+ * 新增角色菜单信息
+ *
+ * @param role 角色对象
+ */
+ public int insertRoleMenu(SysRole role) {
+ int rows = 1;
+ // 新增用户与角色管理
+ List<SysRoleMenu> list = new ArrayList<SysRoleMenu>();
+ Long[] menuIds = role.getMenuIds();
// List<Long> longs = Arrays.asList(menuIds);
- List<Long> longs = new ArrayList<>();
- for (Long menuId : menuIds) {
- longs.add(menuId);
- }
- if(!longs.contains(1061L)){
- longs.add(1061L);
- longs.add(1062L);
- longs.add(1065L);
- longs.add(1073L);
- longs.add(1161L);
- longs.add(1203L);
- }
-
- for (Long menuId : longs)
- {
- SysRoleMenu rm = new SysRoleMenu();
- rm.setRoleId(role.getRoleId());
- rm.setMenuId(menuId);
- list.add(rm);
- }
- if (list.size() > 0)
- {
- rows = roleMenuMapper.batchRoleMenu(list);
- }
- return rows;
- }
-
- /**
- * 新增角色部门信息(数据权限)
- *
- * @param role 角色对象
- */
- public int insertRoleDept(SysRole role)
- {
- int rows = 1;
- // 新增角色与部门(数据权限)管理
- List<SysRoleDept> list = new ArrayList<SysRoleDept>();
- for (Long deptId : role.getDeptIds())
- {
- SysRoleDept rd = new SysRoleDept();
- rd.setRoleId(role.getRoleId());
- rd.setDeptId(deptId);
- list.add(rd);
- }
- if (list.size() > 0)
- {
- rows = roleDeptMapper.batchRoleDept(list);
- }
- return rows;
- }
-
- /**
- * 通过角色ID删除角色
- *
- * @param roleId 角色ID
- * @return 结果
- */
- @Override
- @Transactional(rollbackFor = Exception.class)
- public int deleteRoleById(Long roleId)
- {
- // 删除角色与菜单关联
- roleMenuMapper.deleteRoleMenuByRoleId(roleId);
- // 删除角色与部门关联
- roleDeptMapper.deleteRoleDeptByRoleId(roleId);
- return roleMapper.deleteRoleById(roleId);
- }
-
- /**
- * 批量删除角色信息
- *
- * @param roleIds 需要删除的角色ID
- * @return 结果
- */
- @Override
- @Transactional(rollbackFor = Exception.class)
- public int deleteRoleByIds(Long[] roleIds) {
- for (Long roleId : roleIds)
- {
- checkRoleAllowed(new SysRole(roleId));
- checkRoleDataScope(roleId);
- SysRole role = selectRoleById(roleId);
- if (countUserRoleByRoleId(roleId) > 0)
- {
- throw new ServiceException(String.format("%1$s已分配,不能删除", role.getRoleName()));
- }
- }
- // 删除角色与菜单关联
- roleMenuMapper.deleteRoleMenu(roleIds);
- // 删除角色与部门关联
- roleDeptMapper.deleteRoleDept(roleIds);
- return roleMapper.deleteRoleByIds(roleIds);
- }
-
- /**
- * 取消授权用户角色
- *
- * @param userRole 用户和角色关联信息
- * @return 结果
- */
- @Override
- public int deleteAuthUser(SysUserRole userRole)
- {
- return userRoleMapper.deleteUserRoleInfo(userRole);
- }
-
- /**
- * 批量取消授权用户角色
- *
- * @param roleId 角色ID
- * @param userIds 需要取消授权的用户数据ID
- * @return 结果
- */
- @Override
- public int deleteAuthUsers(Long roleId, Long[] userIds)
- {
- return userRoleMapper.deleteUserRoleInfos(roleId, userIds);
- }
-
- /**
- * 批量选择授权用户角色
- *
- * @param roleId 角色ID
- * @param userIds 需要授权的用户数据ID
- * @return 结果
- */
- @Override
- public int insertAuthUsers(Long roleId, Long[] userIds)
- {
- // 新增用户与角色管理
- List<SysUserRole> list = new ArrayList<SysUserRole>();
- for (Long userId : userIds)
- {
- SysUserRole ur = new SysUserRole();
- ur.setUserId(userId);
- ur.setRoleId(roleId);
- list.add(ur);
- }
- return userRoleMapper.batchUserRole(list);
- }
-
- @Override
- public List<SysRole> isExitUpdate(String roleName, Long roleId,Integer companyId) {
- return roleMapper.isExitUpdate(roleName,roleId,companyId);
- }
-
- /**
- * 根据id获取数据
- * @param ids 数据id集合
- * @return
- */
- @Override
- public List<SysRole> getSysRoleByIds(List<Integer> ids) {
- return this.baseMapper.getSysRoleByIds(ids);
- }
+ List<Long> longs = new ArrayList<>();
+ for (Long menuId : menuIds) {
+ longs.add(menuId);
+ }
+ if (!longs.contains(1061L)) {
+ longs.add(1061L);
+ longs.add(1062L);
+ longs.add(1065L);
+ longs.add(1073L);
+ longs.add(1161L);
+ longs.add(1203L);
+ }
+
+ for (Long menuId : longs) {
+ SysRoleMenu rm = new SysRoleMenu();
+ rm.setRoleId(role.getRoleId());
+ rm.setMenuId(menuId);
+ list.add(rm);
+ }
+ if (list.size() > 0) {
+ rows = roleMenuMapper.batchRoleMenu(list);
+ }
+ return rows;
+ }
+
+ /**
+ * 新增角色部门信息(数据权限)
+ *
+ * @param role 角色对象
+ */
+ public int insertRoleDept(SysRole role) {
+ int rows = 1;
+ // 新增角色与部门(数据权限)管理
+ List<SysRoleDept> list = new ArrayList<SysRoleDept>();
+ for (Long deptId : role.getDeptIds()) {
+ SysRoleDept rd = new SysRoleDept();
+ rd.setRoleId(role.getRoleId());
+ rd.setDeptId(deptId);
+ list.add(rd);
+ }
+ if (list.size() > 0) {
+ rows = roleDeptMapper.batchRoleDept(list);
+ }
+ return rows;
+ }
+
+ /**
+ * 通过角色ID删除角色
+ *
+ * @param roleId 角色ID
+ * @return 结果
+ */
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public int deleteRoleById(Long roleId) {
+ // 删除角色与菜单关联
+ roleMenuMapper.deleteRoleMenuByRoleId(roleId);
+ // 删除角色与部门关联
+ roleDeptMapper.deleteRoleDeptByRoleId(roleId);
+ return roleMapper.deleteRoleById(roleId);
+ }
+
+ /**
+ * 批量删除角色信息
+ *
+ * @param roleIds 需要删除的角色ID
+ * @return 结果
+ */
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public int deleteRoleByIds(Long[] roleIds) {
+ for (Long roleId : roleIds) {
+ checkRoleAllowed(new SysRole(roleId));
+ checkRoleDataScope(roleId);
+ SysRole role = selectRoleById(roleId);
+ if (countUserRoleByRoleId(roleId) > 0) {
+ throw new ServiceException(String.format("%1$s已分配,不能删除", role.getRoleName()));
+ }
+ }
+ // 删除角色与菜单关联
+ roleMenuMapper.deleteRoleMenu(roleIds);
+ // 删除角色与部门关联
+ roleDeptMapper.deleteRoleDept(roleIds);
+ return roleMapper.deleteRoleByIds(roleIds);
+ }
+
+ /**
+ * 取消授权用户角色
+ *
+ * @param userRole 用户和角色关联信息
+ * @return 结果
+ */
+ @Override
+ public int deleteAuthUser(SysUserRole userRole) {
+ return userRoleMapper.deleteUserRoleInfo(userRole);
+ }
+
+ /**
+ * 批量取消授权用户角色
+ *
+ * @param roleId 角色ID
+ * @param userIds 需要取消授权的用户数据ID
+ * @return 结果
+ */
+ @Override
+ public int deleteAuthUsers(Long roleId, Long[] userIds) {
+ return userRoleMapper.deleteUserRoleInfos(roleId, userIds);
+ }
+
+ /**
+ * 批量选择授权用户角色
+ *
+ * @param roleId 角色ID
+ * @param userIds 需要授权的用户数据ID
+ * @return 结果
+ */
+ @Override
+ public int insertAuthUsers(Long roleId, Long[] userIds) {
+ // 新增用户与角色管理
+ List<SysUserRole> list = new ArrayList<SysUserRole>();
+ for (Long userId : userIds) {
+ SysUserRole ur = new SysUserRole();
+ ur.setUserId(userId);
+ ur.setRoleId(roleId);
+ list.add(ur);
+ }
+ return userRoleMapper.batchUserRole(list);
+ }
+
+ @Override
+ public List<SysRole> isExitUpdate(String roleName, Long roleId, Integer companyId) {
+ return roleMapper.isExitUpdate(roleName, roleId, companyId);
+ }
+
+ /**
+ * 根据id获取数据
+ *
+ * @param ids 数据id集合
+ * @return
+ */
+ @Override
+ public List<SysRole> getSysRoleByIds(List<Integer> ids) {
+ return this.baseMapper.getSysRoleByIds(ids);
+ }
}
diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
index 247bbe3..766820b 100644
--- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
@@ -47,280 +47,254 @@
/**
* 用户 业务层处理
- *
+ *
* @author ruoyi
*/
@Service
-public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService
-{
- private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class);
-
- @Resource
- private SysUserMapper userMapper;
-
- @Resource
- private SysRoleMapper roleMapper;
-
- @Resource
- private SysPostMapper postMapper;
-
- @Resource
- private SysUserRoleMapper userRoleMapper;
-
- @Resource
- private SysUserPostMapper userPostMapper;
-
- @Resource
- private ISysConfigService configService;
-
- @Resource
- protected Validator validator;
-
- @Resource
- private ISysUserRoleService sysUserRoleService;
-
- @Resource
- private RoleSiteClient roleSiteClient;
-
- @Resource
- private UserSiteClient userSiteClient;
-
- @Resource
- private SiteClient siteClient;
-
- @Resource
- private ISysRoleService sysRoleService;
-
-
-
-
- /**
- * 根据条件分页查询用户列表
- *
- * @param user 用户信息
- * @return 用户信息集合信息
- */
- @Override
- @DataScope(deptAlias = "d", userAlias = "u")
- public List<SysUser> selectUserList(SysUser user)
- {
- return userMapper.selectUserList(user);
- }
-
- /**
- * 根据条件分页查询已分配用户角色列表
- *
- * @param user 用户信息
- * @return 用户信息集合信息
- */
- @Override
- @DataScope(deptAlias = "d", userAlias = "u")
- public List<SysUser> selectAllocatedList(SysUser user)
- {
- return userMapper.selectAllocatedList(user);
- }
-
- /**
- * 根据条件分页查询未分配用户角色列表
- *
- * @param user 用户信息
- * @return 用户信息集合信息
- */
- @Override
- @DataScope(deptAlias = "d", userAlias = "u")
- public List<SysUser> selectUnallocatedList(SysUser user)
- {
- return userMapper.selectUnallocatedList(user);
- }
-
- /**
- * 通过用户名查询用户
- *
- * @param userName 用户名
- * @return 用户对象信息
- */
- @Override
- public SysUser selectUserByUserName(String userName)
- {
- return userMapper.selectUserByUserName(userName);
- }
-
- /**
- * 通过用户ID查询用户
- *
- * @param userId 用户ID
- * @return 用户对象信息
- */
- @Override
- public SysUser selectUserById(Long userId)
- {
- return userMapper.selectUserById(userId);
- }
-
- /**
- * 查询用户所属角色组
- *
- * @param userName 用户名
- * @return 结果
- */
- @Override
- public String selectUserRoleGroup(String userName)
- {
- List<SysRole> list = roleMapper.selectRolesByUserName(userName);
- if (CollectionUtils.isEmpty(list))
- {
- return StringUtils.EMPTY;
- }
- return list.stream().map(SysRole::getRoleName).collect(Collectors.joining(","));
- }
-
- /**
- * 查询用户所属岗位组
- *
- * @param userName 用户名
- * @return 结果
- */
- @Override
- public String selectUserPostGroup(String userName)
- {
- List<SysPost> list = postMapper.selectPostsByUserName(userName);
- if (CollectionUtils.isEmpty(list))
- {
- return StringUtils.EMPTY;
- }
- return list.stream().map(SysPost::getPostName).collect(Collectors.joining(","));
- }
-
- /**
- * 校验用户名称是否唯一
- *
- * @param user 用户信息
- * @return 结果
- */
- @Override
- public boolean checkUserNameUnique(SysUser user)
- {
- Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
- SysUser info = userMapper.checkUserNameUnique(user.getUserName());
- if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
- {
- return UserConstants.NOT_UNIQUE;
- }
- return UserConstants.UNIQUE;
- }
-
- /**
- * 校验手机号码是否唯一
- *
- * @param user 用户信息
- * @return
- */
- @Override
- public boolean checkPhoneUnique(SysUser user)
- {
- Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
- SysUser info = userMapper.checkPhoneUnique(user.getPhonenumber());
- if (StringUtils.isNotNull(info) )
- {
- return UserConstants.NOT_UNIQUE;
- }
- return UserConstants.UNIQUE;
- }
-
-
- /**
- * 校验email是否唯一
- *
- * @param user 用户信息
- * @return
- */
- @Override
- public boolean checkEmailUnique(SysUser user)
- {
- Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
- SysUser info = userMapper.checkEmailUnique(user.getEmail());
- if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
- {
- return UserConstants.NOT_UNIQUE;
- }
- return UserConstants.UNIQUE;
- }
-
- /**
- * 校验用户是否允许操作
- *
- * @param user 用户信息
- */
- @Override
- public void checkUserAllowed(SysUser user)
- {
- if (StringUtils.isNotNull(user.getUserId()) && user.isAdmin())
- {
- throw new ServiceException("不允许操作超级管理员用户");
- }
- }
-
- /**
- * 校验用户是否有数据权限
- *
- * @param userId 用户id
- */
- @Override
- public void checkUserDataScope(Long userId)
- {
- if (!SysUser.isAdmin(SecurityUtils.getUserId()))
- {
- SysUser user = new SysUser();
- user.setUserId(userId);
- List<SysUser> users = SpringUtils.getAopProxy(this).selectUserList(user);
- if (StringUtils.isEmpty(users))
- {
- throw new ServiceException("没有权限访问用户数据!");
- }
- }
- }
-
- /**
- * 新增保存用户信息
- *
- * @param user 用户信息
- * @return 结果
- */
- @Override
- @Transactional(rollbackFor = Exception.class)
- public int insertUser(SysUser user)
- {
- // 新增用户信息
- int rows = userMapper.insertUser(user);
+public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService {
+ private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class);
+
+ @Resource
+ private SysUserMapper userMapper;
+
+ @Resource
+ private SysRoleMapper roleMapper;
+
+ @Resource
+ private SysPostMapper postMapper;
+
+ @Resource
+ private SysUserRoleMapper userRoleMapper;
+
+ @Resource
+ private SysUserPostMapper userPostMapper;
+
+ @Resource
+ private ISysConfigService configService;
+
+ @Resource
+ protected Validator validator;
+
+ @Resource
+ private ISysUserRoleService sysUserRoleService;
+
+ @Resource
+ private RoleSiteClient roleSiteClient;
+
+ @Resource
+ private UserSiteClient userSiteClient;
+
+ @Resource
+ private SiteClient siteClient;
+
+ @Resource
+ private ISysRoleService sysRoleService;
+
+
+ /**
+ * 根据条件分页查询用户列表
+ *
+ * @param user 用户信息
+ * @return 用户信息集合信息
+ */
+ @Override
+ @DataScope(deptAlias = "d", userAlias = "u")
+ public List<SysUser> selectUserList(SysUser user) {
+ return userMapper.selectUserList(user);
+ }
+
+ /**
+ * 根据条件分页查询已分配用户角色列表
+ *
+ * @param user 用户信息
+ * @return 用户信息集合信息
+ */
+ @Override
+ @DataScope(deptAlias = "d", userAlias = "u")
+ public List<SysUser> selectAllocatedList(SysUser user) {
+ return userMapper.selectAllocatedList(user);
+ }
+
+ /**
+ * 根据条件分页查询未分配用户角色列表
+ *
+ * @param user 用户信息
+ * @return 用户信息集合信息
+ */
+ @Override
+ @DataScope(deptAlias = "d", userAlias = "u")
+ public List<SysUser> selectUnallocatedList(SysUser user) {
+ return userMapper.selectUnallocatedList(user);
+ }
+
+ /**
+ * 通过用户名查询用户
+ *
+ * @param userName 用户名
+ * @return 用户对象信息
+ */
+ @Override
+ public SysUser selectUserByUserName(String userName) {
+ return userMapper.selectUserByUserName(userName);
+ }
+
+ /**
+ * 通过用户ID查询用户
+ *
+ * @param userId 用户ID
+ * @return 用户对象信息
+ */
+ @Override
+ public SysUser selectUserById(Long userId) {
+ return userMapper.selectUserById(userId);
+ }
+
+ /**
+ * 查询用户所属角色组
+ *
+ * @param userName 用户名
+ * @return 结果
+ */
+ @Override
+ public String selectUserRoleGroup(String userName) {
+ List<SysRole> list = roleMapper.selectRolesByUserName(userName);
+ if (CollectionUtils.isEmpty(list)) {
+ return StringUtils.EMPTY;
+ }
+ return list.stream().map(SysRole::getRoleName).collect(Collectors.joining(","));
+ }
+
+ /**
+ * 查询用户所属岗位组
+ *
+ * @param userName 用户名
+ * @return 结果
+ */
+ @Override
+ public String selectUserPostGroup(String userName) {
+ List<SysPost> list = postMapper.selectPostsByUserName(userName);
+ if (CollectionUtils.isEmpty(list)) {
+ return StringUtils.EMPTY;
+ }
+ return list.stream().map(SysPost::getPostName).collect(Collectors.joining(","));
+ }
+
+ /**
+ * 校验用户名称是否唯一
+ *
+ * @param user 用户信息
+ * @return 结果
+ */
+ @Override
+ public boolean checkUserNameUnique(SysUser user) {
+ Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
+ SysUser info = userMapper.checkUserNameUnique(user.getUserName());
+ if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) {
+ return UserConstants.NOT_UNIQUE;
+ }
+ return UserConstants.UNIQUE;
+ }
+
+ /**
+ * 校验手机号码是否唯一
+ *
+ * @param user 用户信息
+ * @return
+ */
+ @Override
+ public boolean checkPhoneUnique(SysUser user) {
+ Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
+ SysUser info = userMapper.checkPhoneUnique(user.getPhonenumber());
+ if (StringUtils.isNotNull(info)) {
+ return UserConstants.NOT_UNIQUE;
+ }
+ return UserConstants.UNIQUE;
+ }
+
+
+ /**
+ * 校验email是否唯一
+ *
+ * @param user 用户信息
+ * @return
+ */
+ @Override
+ public boolean checkEmailUnique(SysUser user) {
+ Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
+ SysUser info = userMapper.checkEmailUnique(user.getEmail());
+ if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) {
+ return UserConstants.NOT_UNIQUE;
+ }
+ return UserConstants.UNIQUE;
+ }
+
+ /**
+ * 校验用户是否允许操作
+ *
+ * @param user 用户信息
+ */
+ @Override
+ public void checkUserAllowed(SysUser user) {
+ if (StringUtils.isNotNull(user.getUserId()) && user.isAdmin()) {
+ throw new ServiceException("不允许操作超级管理员用户");
+ }
+ }
+
+ /**
+ * 校验用户是否有数据权限
+ *
+ * @param userId 用户id
+ */
+ @Override
+ public void checkUserDataScope(Long userId) {
+ if (!SysUser.isAdmin(SecurityUtils.getUserId())) {
+ SysUser user = new SysUser();
+ user.setUserId(userId);
+ List<SysUser> users = SpringUtils.getAopProxy(this).selectUserList(user);
+ if (StringUtils.isEmpty(users)) {
+ throw new ServiceException("没有权限访问用户数据!");
+ }
+ }
+ }
+
+ /**
+ * 新增保存用户信息
+ *
+ * @param user 用户信息
+ * @return 结果
+ */
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public int insertUser(SysUser user) {
+ // 新增用户信息
+ int rows = userMapper.insertUser(user);
// // 新增用户岗位关联
// insertUserPost(user);
// // 新增用户与角色管理
// insertUserRole(user);
- return rows;
- }
-
- /**
- * 注册用户信息
- *
- * @param user 用户信息
- * @return 结果
- */
- @Override
- public boolean registerUser(SysUser user)
- {
- return userMapper.insertUser(user) > 0;
- }
-
- /**
- * 修改保存用户信息
- *
- * @param user 用户信息
- * @return 结果
- */
- @Override
- @Transactional(rollbackFor = Exception.class)
- public int updateUser(SysUser user)
- {
+ return rows;
+ }
+
+ /**
+ * 注册用户信息
+ *
+ * @param user 用户信息
+ * @return 结果
+ */
+ @Override
+ public boolean registerUser(SysUser user) {
+ return userMapper.insertUser(user) > 0;
+ }
+
+ /**
+ * 修改保存用户信息
+ *
+ * @param user 用户信息
+ * @return 结果
+ */
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public int updateUser(SysUser user) {
// Long userId = user.getUserId();
// // 删除用户与角色关联
// userRoleMapper.deleteUserRoleByUserId(userId);
@@ -330,307 +304,277 @@
// userPostMapper.deleteUserPostByUserId(userId);
// // 新增用户与岗位管理
// insertUserPost(user);
- return userMapper.updateUser(user);
- }
-
- /**
- * 用户授权角色
- *
- * @param userId 用户ID
- * @param roleIds 角色组
- */
- @Override
- @Transactional(rollbackFor = Exception.class)
- public void insertUserAuth(Long userId, Long[] roleIds)
- {
- userRoleMapper.deleteUserRoleByUserId(userId);
- insertUserRole(userId, roleIds);
- }
-
- /**
- * 修改用户状态
- *
- * @param user 用户信息
- * @return 结果
- */
- @Override
- public int updateUserStatus(SysUser user)
- {
- return userMapper.updateUser(user);
- }
-
- /**
- * 修改用户基本信息
- *
- * @param user 用户信息
- * @return 结果
- */
- @Override
- public int updateUserProfile(SysUser user)
- {
- return userMapper.updateUser(user);
- }
-
- /**
- * 修改用户头像
- *
- * @param userName 用户名
- * @param avatar 头像地址
- * @return 结果
- */
- @Override
- public boolean updateUserAvatar(String userName, String avatar)
- {
- return userMapper.updateUserAvatar(userName, avatar) > 0;
- }
-
- /**
- * 重置用户密码
- *
- * @param user 用户信息
- * @return 结果
- */
- @Override
- public int resetPwd(SysUser user)
- {
- return userMapper.updateUser(user);
- }
-
- /**
- * 重置用户密码
- *
- * @param userName 用户名
- * @param password 密码
- * @return 结果
- */
- @Override
- public int resetUserPwd(String userName, String password)
- {
- return userMapper.resetUserPwd(userName, password);
- }
-
- /**
- * 新增用户角色信息
- *
- * @param user 用户对象
- */
- public void insertUserRole(SysUser user)
- {
- this.insertUserRole(user.getUserId(), user.getRoleIds());
- }
-
- /**
- * 新增用户岗位信息
- *
- * @param user 用户对象
- */
- public void insertUserPost(SysUser user)
- {
- Long[] posts = user.getPostIds();
- if (StringUtils.isNotEmpty(posts))
- {
- // 新增用户与岗位管理
- List<SysUserPost> list = new ArrayList<SysUserPost>();
- for (Long postId : posts)
- {
- SysUserPost up = new SysUserPost();
- up.setUserId(user.getUserId());
- up.setPostId(postId);
- list.add(up);
- }
- userPostMapper.batchUserPost(list);
- }
- }
-
- /**
- * 新增用户角色信息
- *
- * @param userId 用户ID
- * @param roleIds 角色组
- */
- public void insertUserRole(Long userId, Long[] roleIds)
- {
- if (StringUtils.isNotEmpty(roleIds))
- {
- // 新增用户与角色管理
- List<SysUserRole> list = new ArrayList<SysUserRole>();
- for (Long roleId : roleIds)
- {
- SysUserRole ur = new SysUserRole();
- ur.setUserId(userId);
- ur.setRoleId(roleId);
- list.add(ur);
- }
- userRoleMapper.batchUserRole(list);
- }
- }
-
- /**
- * 通过用户ID删除用户
- *
- * @param userId 用户ID
- * @return 结果
- */
- @Override
- @Transactional(rollbackFor = Exception.class)
- public int deleteUserById(Long userId)
- {
- // 删除用户与角色关联
- userRoleMapper.deleteUserRoleByUserId(userId);
- // 删除用户与岗位表
- userPostMapper.deleteUserPostByUserId(userId);
- return userMapper.deleteUserById(userId);
- }
-
- /**
- * 批量删除用户信息
- *
- * @param userIds 需要删除的用户ID
- * @return 结果
- */
- @Override
- @Transactional(rollbackFor = Exception.class)
- public int deleteUserByIds(Long[] userIds)
- {
- for (Long userId : userIds)
- {
- checkUserAllowed(new SysUser(userId));
+ return userMapper.updateUser(user);
+ }
+
+ /**
+ * 用户授权角色
+ *
+ * @param userId 用户ID
+ * @param roleIds 角色组
+ */
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void insertUserAuth(Long userId, Long[] roleIds) {
+ userRoleMapper.deleteUserRoleByUserId(userId);
+ insertUserRole(userId, roleIds);
+ }
+
+ /**
+ * 修改用户状态
+ *
+ * @param user 用户信息
+ * @return 结果
+ */
+ @Override
+ public int updateUserStatus(SysUser user) {
+ return userMapper.updateUser(user);
+ }
+
+ /**
+ * 修改用户基本信息
+ *
+ * @param user 用户信息
+ * @return 结果
+ */
+ @Override
+ public int updateUserProfile(SysUser user) {
+ return userMapper.updateUser(user);
+ }
+
+ /**
+ * 修改用户头像
+ *
+ * @param userName 用户名
+ * @param avatar 头像地址
+ * @return 结果
+ */
+ @Override
+ public boolean updateUserAvatar(String userName, String avatar) {
+ return userMapper.updateUserAvatar(userName, avatar) > 0;
+ }
+
+ /**
+ * 重置用户密码
+ *
+ * @param user 用户信息
+ * @return 结果
+ */
+ @Override
+ public int resetPwd(SysUser user) {
+ return userMapper.updateUser(user);
+ }
+
+ /**
+ * 重置用户密码
+ *
+ * @param userName 用户名
+ * @param password 密码
+ * @return 结果
+ */
+ @Override
+ public int resetUserPwd(String userName, String password) {
+ return userMapper.resetUserPwd(userName, password);
+ }
+
+ /**
+ * 新增用户角色信息
+ *
+ * @param user 用户对象
+ */
+ public void insertUserRole(SysUser user) {
+ this.insertUserRole(user.getUserId(), user.getRoleIds());
+ }
+
+ /**
+ * 新增用户岗位信息
+ *
+ * @param user 用户对象
+ */
+ public void insertUserPost(SysUser user) {
+ Long[] posts = user.getPostIds();
+ if (StringUtils.isNotEmpty(posts)) {
+ // 新增用户与岗位管理
+ List<SysUserPost> list = new ArrayList<SysUserPost>();
+ for (Long postId : posts) {
+ SysUserPost up = new SysUserPost();
+ up.setUserId(user.getUserId());
+ up.setPostId(postId);
+ list.add(up);
+ }
+ userPostMapper.batchUserPost(list);
+ }
+ }
+
+ /**
+ * 新增用户角色信息
+ *
+ * @param userId 用户ID
+ * @param roleIds 角色组
+ */
+ public void insertUserRole(Long userId, Long[] roleIds) {
+ if (StringUtils.isNotEmpty(roleIds)) {
+ // 新增用户与角色管理
+ List<SysUserRole> list = new ArrayList<SysUserRole>();
+ for (Long roleId : roleIds) {
+ SysUserRole ur = new SysUserRole();
+ ur.setUserId(userId);
+ ur.setRoleId(roleId);
+ list.add(ur);
+ }
+ userRoleMapper.batchUserRole(list);
+ }
+ }
+
+ /**
+ * 通过用户ID删除用户
+ *
+ * @param userId 用户ID
+ * @return 结果
+ */
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public int deleteUserById(Long userId) {
+ // 删除用户与角色关联
+ userRoleMapper.deleteUserRoleByUserId(userId);
+ // 删除用户与岗位表
+ userPostMapper.deleteUserPostByUserId(userId);
+ return userMapper.deleteUserById(userId);
+ }
+
+ /**
+ * 批量删除用户信息
+ *
+ * @param userIds 需要删除的用户ID
+ * @return 结果
+ */
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public int deleteUserByIds(Long[] userIds) {
+ for (Long userId : userIds) {
+ checkUserAllowed(new SysUser(userId));
// checkUserDataScope(userId);
- }
- // 删除用户与角色关联
+ }
+ // 删除用户与角色关联
// userRoleMapper.deleteUserRole(userIds);
// // 删除用户与岗位关联
// userPostMapper.deleteUserPost(userIds);
- return userMapper.deleteUserByIds(userIds);
- }
-
- /**
- * 导入用户数据
- *
- * @param userList 用户数据列表
- * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
- * @param operName 操作用户
- * @return 结果
- */
- @Override
- public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName)
- {
- if (StringUtils.isNull(userList) || userList.size() == 0)
- {
- throw new ServiceException("导入用户数据不能为空!");
- }
- int successNum = 0;
- int failureNum = 0;
- StringBuilder successMsg = new StringBuilder();
- StringBuilder failureMsg = new StringBuilder();
- String password = configService.selectConfigByKey("sys.user.initPassword");
- for (SysUser user : userList)
- {
- try
- {
- // 验证是否存在这个用户
- SysUser u = userMapper.selectUserByUserName(user.getUserName());
- if (StringUtils.isNull(u))
- {
- BeanValidators.validateWithException(validator, user);
- user.setPassword(SecurityUtils.encryptPassword(password));
- user.setCreateBy(operName);
- userMapper.insertUser(user);
- successNum++;
- successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 导入成功");
- }
- else if (isUpdateSupport)
- {
- BeanValidators.validateWithException(validator, user);
- checkUserAllowed(u);
- checkUserDataScope(u.getUserId());
- user.setUserId(u.getUserId());
- user.setUpdateBy(operName);
- userMapper.updateUser(user);
- successNum++;
- successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 更新成功");
- }
- else
- {
- failureNum++;
- failureMsg.append("<br/>" + failureNum + "、账号 " + user.getUserName() + " 已存在");
- }
- }
- catch (Exception e)
- {
- failureNum++;
- String msg = "<br/>" + failureNum + "、账号 " + user.getUserName() + " 导入失败:";
- failureMsg.append(msg + e.getMessage());
- log.error(msg, e);
- }
- }
- if (failureNum > 0)
- {
- failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
- throw new ServiceException(failureMsg.toString());
- }
- else
- {
- successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
- }
- return successMsg.toString();
- }
-
- @Override
- public PageInfo<SysUser> getList(PageInfo<SysUser> pageInfo, GetSysUserList getSysUserList) {
- List<SysUser> list = this.baseMapper.getList(pageInfo, getSysUserList);
- for (SysUser sysUser : list) {
- List<SysUserRole> list1 = sysUserRoleService.list(new LambdaQueryWrapper<SysUserRole>().eq(SysUserRole::getUserId, sysUser.getUserId()));
- List<Integer> data1 = userSiteClient.getSiteIds(sysUser.getUserId()).getData();
- if(null == data1){
- data1 = new ArrayList<>();
- }
- for (SysUserRole sysUserRole : list1) {
- List<Integer> data = roleSiteClient.getSiteIds(sysUserRole.getRoleId()).getData();
- if (null == data){
- continue;
- }
- data1.addAll(data);
- }
- Set<Integer> siteIds = new HashSet<>(data1);
- sysUser.setSiteIds(siteIds.stream().collect(Collectors.toList()));
- List<Site> data = siteClient.getSiteByIds(siteIds.stream().collect(Collectors.toList())).getData();
- if(null != data){
- List<String> siteNames = data.stream().map(Site::getName).collect(Collectors.toList());
- sysUser.setSiteNames(siteNames);
- }
- List<String> roleNames = new ArrayList<>();
- for (SysUserRole sysUserRole : list1) {
- SysRole sysRole = sysRoleService.selectRoleById(sysUserRole.getRoleId());
- roleNames.add(sysRole.getRoleName());
- }
- Long[] roleIds = new Long[]{};
- sysUser.setRoleIds(list1.stream().map(SysUserRole::getRoleId).collect(Collectors.toList()).toArray(roleIds));
- sysUser.setRoleNames(roleNames);
- }
- return pageInfo.setRecords(list);
- }
-
- @Override
- public PageInfo<SysUser> getAllList(PageInfo<SysUser> pageInfo, List<Integer> collect) {
- return this.baseMapper.getAllList(pageInfo,collect);
- }
-
- @Override
- public List<Long> getSysUserFromPhone(String phoneNumber) {
- return this.baseMapper.getSysUserFromPhone(phoneNumber);
- }
-
- @Override
- public void deleteSysUser(ArrayList<Integer> userIds) {
- this.baseMapper.deleteSysUser(userIds);
- }
-
- @Override
- public PageInfo<SysUser> getChangeUserList(ChangeUserQuery query) {
- PageInfo<SysUser> pageInfo = new PageInfo<>(query.getPageCurr(), query.getPageSize());
- List<SysUser> list = this.baseMapper.getChangeUserList(pageInfo, query);
- return pageInfo.setRecords(list);
- }
-
+ return userMapper.deleteUserByIds(userIds);
+ }
+
+ /**
+ * 导入用户数据
+ *
+ * @param userList 用户数据列表
+ * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
+ * @param operName 操作用户
+ * @return 结果
+ */
+ @Override
+ public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName) {
+ if (StringUtils.isNull(userList) || userList.size() == 0) {
+ throw new ServiceException("导入用户数据不能为空!");
+ }
+ int successNum = 0;
+ int failureNum = 0;
+ StringBuilder successMsg = new StringBuilder();
+ StringBuilder failureMsg = new StringBuilder();
+ String password = configService.selectConfigByKey("sys.user.initPassword");
+ for (SysUser user : userList) {
+ try {
+ // 验证是否存在这个用户
+ SysUser u = userMapper.selectUserByUserName(user.getUserName());
+ if (StringUtils.isNull(u)) {
+ BeanValidators.validateWithException(validator, user);
+ user.setPassword(SecurityUtils.encryptPassword(password));
+ user.setCreateBy(operName);
+ userMapper.insertUser(user);
+ successNum++;
+ successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 导入成功");
+ } else if (isUpdateSupport) {
+ BeanValidators.validateWithException(validator, user);
+ checkUserAllowed(u);
+ checkUserDataScope(u.getUserId());
+ user.setUserId(u.getUserId());
+ user.setUpdateBy(operName);
+ userMapper.updateUser(user);
+ successNum++;
+ successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 更新成功");
+ } else {
+ failureNum++;
+ failureMsg.append("<br/>" + failureNum + "、账号 " + user.getUserName() + " 已存在");
+ }
+ } catch (Exception e) {
+ failureNum++;
+ String msg = "<br/>" + failureNum + "、账号 " + user.getUserName() + " 导入失败:";
+ failureMsg.append(msg + e.getMessage());
+ log.error(msg, e);
+ }
+ }
+ if (failureNum > 0) {
+ failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
+ throw new ServiceException(failureMsg.toString());
+ } else {
+ successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
+ }
+ return successMsg.toString();
+ }
+
+ @Override
+ public PageInfo<SysUser> getList(PageInfo<SysUser> pageInfo, GetSysUserList getSysUserList) {
+ List<SysUser> list = this.baseMapper.getList(pageInfo, getSysUserList);
+ for (SysUser sysUser : list) {
+ List<SysUserRole> list1 = sysUserRoleService.list(new LambdaQueryWrapper<SysUserRole>().eq(SysUserRole::getUserId, sysUser.getUserId()));
+ List<Integer> data1 = userSiteClient.getSiteIds(sysUser.getUserId()).getData();
+ if (null == data1) {
+ data1 = new ArrayList<>();
+ }
+ for (SysUserRole sysUserRole : list1) {
+ List<Integer> data = roleSiteClient.getSiteIds(sysUserRole.getRoleId()).getData();
+ if (null == data) {
+ continue;
+ }
+ data1.addAll(data);
+ }
+ Set<Integer> siteIds = new HashSet<>(data1);
+ sysUser.setSiteIds(siteIds.stream().collect(Collectors.toList()));
+ List<Site> data = siteClient.getSiteByIds(siteIds.stream().collect(Collectors.toList())).getData();
+ if (null != data) {
+ List<String> siteNames = data.stream().map(Site::getName).collect(Collectors.toList());
+ sysUser.setSiteNames(siteNames);
+ }
+ List<String> roleNames = new ArrayList<>();
+ for (SysUserRole sysUserRole : list1) {
+ SysRole sysRole = sysRoleService.selectRoleById(sysUserRole.getRoleId());
+ roleNames.add(sysRole.getRoleName());
+ }
+ Long[] roleIds = new Long[]{};
+ sysUser.setRoleIds(list1.stream().map(SysUserRole::getRoleId).collect(Collectors.toList()).toArray(roleIds));
+ sysUser.setRoleNames(roleNames);
+ }
+ return pageInfo.setRecords(list);
+ }
+
+ @Override
+ public PageInfo<SysUser> getAllList(PageInfo<SysUser> pageInfo, List<Integer> collect) {
+ return this.baseMapper.getAllList(pageInfo, collect);
+ }
+
+ @Override
+ public List<Long> getSysUserFromPhone(String phoneNumber) {
+ return this.baseMapper.getSysUserFromPhone(phoneNumber);
+ }
+
+ @Override
+ public void deleteSysUser(ArrayList<Integer> userIds) {
+ this.baseMapper.deleteSysUser(userIds);
+ }
+
+ @Override
+ public PageInfo<SysUser> getChangeUserList(ChangeUserQuery query) {
+ PageInfo<SysUser> pageInfo = new PageInfo<>(query.getPageCurr(), query.getPageSize());
+ List<SysUser> list = this.baseMapper.getChangeUserList(pageInfo, query);
+ return pageInfo.setRecords(list);
+ }
+
}
diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml
index 30c1036..d837d2b 100644
--- a/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml
+++ b/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml
@@ -25,8 +25,8 @@
service: ${spring.application.name}
group: DEFAULT_GROUP
namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb
- username: nacos
- password: nacos
+ username: nacos
+ password: nacos
config:
# 配置中心地址
server-addr: 192.168.110.169:8848
diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
index c440e24..47651b2 100644
--- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
+++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
@@ -126,7 +126,7 @@
<select id="getList" resultMap="SysUserResult">
select * from sys_user where 1=1
<if test="req.search !=null and req.search !=''">
- and (phonenumber like concat("%", #{phonenumber},"%") or nick_name like concat("%", #{phonenumber},"%"))
+ and (phonenumber like concat("%", #{req.search},"%") or nick_name like concat("%", #{req.search},"%"))
</if>
<if test="null != req.siteId">
and user_id in (select user_id from t_user_site where site_id = #{req.siteId})
diff --git a/ruoyi-service/ruoyi-account/pom.xml b/ruoyi-service/ruoyi-account/pom.xml
index a464162..23763ed 100644
--- a/ruoyi-service/ruoyi-account/pom.xml
+++ b/ruoyi-service/ruoyi-account/pom.xml
@@ -16,6 +16,11 @@
<dependencies>
<dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-mock</artifactId>
+ <version>2.0.8</version>
+ </dependency>
+ <dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-api-order</artifactId>
</dependency>
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AlipayOpenAppQrcodeCreate.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AlipayOpenAppQrcodeCreate.java
new file mode 100644
index 0000000..ee97430
--- /dev/null
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AlipayOpenAppQrcodeCreate.java
@@ -0,0 +1,59 @@
+package com.ruoyi.account.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.alipay.api.AlipayApiException;
+import com.alipay.api.AlipayClient;
+import com.alipay.api.DefaultAlipayClient;
+import com.alipay.api.AlipayConfig;
+import com.alipay.api.response.AlipayOpenAppQrcodeCreateResponse;
+import com.alipay.api.request.AlipayOpenAppQrcodeCreateRequest;
+import com.alipay.api.domain.AlipayOpenAppQrcodeCreateModel;
+
+import com.alipay.api.FileItem;
+import java.util.Base64;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 生成支付宝小程序二维码
+ */
+public class AlipayOpenAppQrcodeCreate {
+
+ public static void main(String[] args) throws AlipayApiException {
+ // 初始化SDK
+ AlipayClient alipayClient = new DefaultAlipayClient(getAlipayConfig());
+ // 构造请求参数以调用接口
+ AlipayOpenAppQrcodeCreateRequest request = new AlipayOpenAppQrcodeCreateRequest();
+ AlipayOpenAppQrcodeCreateModel model = new AlipayOpenAppQrcodeCreateModel();
+ // 设置跳转小程序的页面路径
+ model.setUrlParam("pages/index/index");
+ // 设置小程序的启动参数
+ model.setQueryParam("x=1");
+ // 设置码描述
+ model.setDescribe("二维码描述");
+ request.setBizModel(model);
+ AlipayOpenAppQrcodeCreateResponse response = alipayClient.execute(request);
+ System.out.println(response.getBody());
+ String qrCodeUrl = response.getQrCodeUrl();
+ System.err.println(qrCodeUrl);
+ if (response.isSuccess()) {
+ System.out.println("调用成功");
+ } else {
+ System.out.println("调用失败");
+ }
+ }
+
+ private static AlipayConfig getAlipayConfig() {
+ String privateKey = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCxWgLykkSXsj6zz5kVohKb6yAaOK8d4wnbWLrabBQSHZg+UZj9HknzQvgrSdfiMd6Dlv70OYQBRynWb2OSGaIKpWLbDKQDT+hDBcbZQ3nVTKExC7w8t/5mUc0CH4DkMsMMDcDW2synh9Lv4fmw7eNnRgd6g6csGIZyOUgt34eMcmCUBP58bEkYhuPm9rLBMw7fCRl9zZbKNAiE5j9FNL1/oAWhET6BCHRqKpiDHvKLQDZdXUwI+sA/JSolNlU+x052YBPGxjH9zqD8mpRLZRTPCb5pV5wCG+EqQkiCauyhAJSCVo2Dx3uXe4nP/6UDlQmgxyiZ+uuMtPsDFjKd7EIXAgMBAAECggEBAKXBfufAFSPCkB/2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MkS2aKYSF9wNeKYCYl2/ZYhilom4Mst/uxAl/8aLwDM9Cg29KfmMakst521IXv2Jrk2MiXXJMV5wowE8kbdb4Hkzsn1km2tBnng7Jyyek2HH737Jd1R";
+ String alipayPublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAh+tCVKqUmlHDL8Ki1TUJtzE5IKV1irJuoHWZTvndJCKJJ8bdWxL9mu5xsy8KkfrnS6wJIKBMLTxMoYQHG7l2Gt07YyUCYHS5+yvbHtTkyFFy2KRPeUEWXz1Tm4juvInDvvr+n7v9ETepToGhC+UDlQcBvuSppw8N+463E+1GRrC4APwXYGLzaIvYvDHcQAULkWhXsjzxJSmeSi12kqWKlgnVJC1y0FT8xQtvhwShfaIqKwzErn9S2z7JjdXboJMUYQHoqF1A4SmWY8c0qawqvx2hGP36W3RDQ4cczzFwUHS1Cylhsbgh1COc4OdANCX4Np2NUzaRDCNzN0WVFKtK+QIDAQAB";
+ AlipayConfig alipayConfig = new AlipayConfig();
+ alipayConfig.setServerUrl("https://openapi.alipay.com/gateway.do");
+ alipayConfig.setAppId("2021004173610331");
+ alipayConfig.setPrivateKey(privateKey);
+ alipayConfig.setFormat("json");
+ alipayConfig.setAlipayPublicKey(alipayPublicKey);
+ alipayConfig.setCharset("UTF-8");
+ alipayConfig.setSignType("RSA2");
+ return alipayConfig;
+ }
+}
\ No newline at end of file
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppCouponController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppCouponController.java
index 7ff943a..e5e83f0 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppCouponController.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppCouponController.java
@@ -103,16 +103,19 @@
* @return
*/
@ApiOperation(value = "通过充电枪id和预付金额获取电站详情", tags = {"小程序-扫一扫"})
- @GetMapping(value = "/scan/siteInfo")
+ @PostMapping(value = "/scan/siteInfo")
public AjaxResult<SiteInfoVO> siteInfo(Integer id, BigDecimal money) {
TChargingGun chargingGun = chargingGunClient.getChargingGunById(id).getData();
TChargingPile chargingPile = chargingPileClient.getChargingPileById(chargingGun.getChargingPileId()).getData();
- SiteInfoVO data = chargingPileClient.getSiteInfoByNumber(chargingPile.getNumber().toString()).getData();
+ SiteInfoVO data = chargingPileClient.getSiteInfoByNumber1(chargingPile.getCode().toString()).getData();
data.setChargingGunId(id);
+ data.setChargeMode(chargingGun.getChargeMode());
List<TAppUserCar> cars = appUserCarService.list(new QueryWrapper<TAppUserCar>()
.eq("app_user_id",tokenService.getLoginUserApplet().getUserId())
.orderByDesc("create_time"));
Long data1 = chargingOrderClient.getCar().getData();
+ Integer data2 = otherClient.getAddCarIntegral().getData();
+ data.setIntegral(data2);
if (!cars.isEmpty()){
if (data1 == -1){
// 没有充电订单 展示最新添加的车辆
@@ -221,6 +224,7 @@
*/
@PostMapping("/grantCoupon")
public R grantCoupon(@RequestBody GrantCouponDto dto){
+ dto.setWaysToObtain(3);
List<TAppCoupon> res = new ArrayList<>();
TCoupon coupon = otherClient.getCouponById(dto.getCouponId()).getData();
@@ -244,9 +248,20 @@
break;
case 2:
// 根据市codes 查询用户ids
- List<Long> collect1 = appUserService.list(new QueryWrapper<TAppUser>()
- .in("city_code", Arrays.asList(dto.getCityCode().split(","))))
- .stream().map(TAppUser::getId).collect(Collectors.toList());
+ List<Long> collect1 = new ArrayList<>();
+ // 根据市codes 查询用户ids
+ if (StringUtils.hasLength(dto.getProvinceCode())){
+ List<Long> collect2 = appUserService.list(new QueryWrapper<TAppUser>()
+ .in("province_code", Arrays.asList(dto.getProvinceCode().split(","))))
+ .stream().map(TAppUser::getId).collect(Collectors.toList());
+ collect1.addAll(collect2);
+ }
+ if (StringUtils.hasLength(dto.getCityCode())){
+ List<Long> collect2 = appUserService.list(new QueryWrapper<TAppUser>()
+ .in("city_code", Arrays.asList(dto.getCityCode().split(","))))
+ .stream().map(TAppUser::getId).collect(Collectors.toList());
+ collect1.addAll(collect2);
+ }
for (Long l : collect1) {
TAppCoupon tAppCoupon = new TAppCoupon();
tAppCoupon.setAppUserId(l);
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java
index 6d7b268..cf76b85 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java
@@ -198,6 +198,10 @@
@DeleteMapping(value = "/unit/delete")
@Log(title = "【单位管理】删除单位", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE)
public R add(@RequestParam String ids) {
+ List<TAppUser> list = appUserService.lambdaQuery().in(TAppUser::getCompanyId, Arrays.asList(ids.split(","))).list();
+ if (!list.isEmpty()){
+ return R.fail("当前单位已存在用户,无法删除!");
+ }
String[] split = ids.split(",");
for (String s : split) {
otherClient.unitDelete(Integer.valueOf(s));
@@ -219,6 +223,7 @@
Page<TAppUser> page = appUserService.lambdaQuery()
.like(userListQueryDto.getUserPhone() != null && !"".equals(userListQueryDto.getUserPhone()), TAppUser::getPhone, userListQueryDto.getUserPhone())
.eq(userListQueryDto.getCompanyId() != null, TAppUser::getCompanyId, userListQueryDto.getCompanyId())
+ .eq(userListQueryDto.getProvinceCode() != null && !"".equals(userListQueryDto.getProvinceCode()), TAppUser::getProvinceCode, userListQueryDto.getProvinceCode())
.eq(userListQueryDto.getCityCode() != null && !"".equals(userListQueryDto.getCityCode()), TAppUser::getCityCode, userListQueryDto.getCityCode())
.eq(userListQueryDto.getStatus() != null, TAppUser::getStatus, userListQueryDto.getStatus())
.eq(userListQueryDto.getVipTypeId() != null, TAppUser::getVipId, userListQueryDto.getVipTypeId())
@@ -277,16 +282,25 @@
if (userListQueryDto.getUserTagId() != null){
userIds = appUserTagService.lambdaQuery().eq(TAppUserTag::getUserTagId, userListQueryDto.getUserTagId()).list().stream().map(TAppUserTag::getAppUserId).collect(Collectors.toList());
}
+ LocalDateTime end1 = null;
+ LocalDateTime end2 = null ;
+ if (userListQueryDto.getVipEndTime1()!=null) {
+ end1 = LocalDateTime.now().plusDays(userListQueryDto.getVipEndTime1());
+ }
+ if (userListQueryDto.getVipEndTime2()!=null){
+ end2 = LocalDateTime.now().plusDays(userListQueryDto.getVipEndTime2());
+ }
//列表查询
Page<TAppUser> page = appUserService.lambdaQuery()
.ge(TAppUser::getVipEndTime, LocalDateTime.now())
.like(userListQueryDto.getUserPhone() != null && !"".equals(userListQueryDto.getUserPhone()), TAppUser::getPhone, userListQueryDto.getUserPhone())
.eq(userListQueryDto.getCompanyId() != null, TAppUser::getCompanyId, userListQueryDto.getCompanyId())
+ .eq(userListQueryDto.getProvinceCode() != null && !"".equals(userListQueryDto.getProvinceCode()), TAppUser::getProvinceCode, userListQueryDto.getProvinceCode())
.eq(userListQueryDto.getCityCode() != null && !"".equals(userListQueryDto.getCityCode()), TAppUser::getCityCode, userListQueryDto.getCityCode())
.eq(userListQueryDto.getStatus() != null, TAppUser::getStatus, userListQueryDto.getStatus())
.eq(userListQueryDto.getVipTypeId() != null, TAppUser::getVipId, userListQueryDto.getVipTypeId())
- .ge(userListQueryDto.getVipEndTime1() != null, TAppUser::getVipEndTime, userListQueryDto.getVipEndTime1() == null ? null : LocalDateTime.now().plusDays(userListQueryDto.getVipEndTime1()))
- .le(userListQueryDto.getVipEndTime2() != null, TAppUser::getVipEndTime, userListQueryDto.getVipEndTime2() == null ? null : LocalDateTime.now().plusDays(userListQueryDto.getVipEndTime2()))
+ .ge(userListQueryDto.getVipEndTime1() != null, TAppUser::getVipEndTime, end1 )
+ .le(userListQueryDto.getVipEndTime2() != null, TAppUser::getVipEndTime, end2)
.in(!userIds.isEmpty(), TAppUser::getId, userIds)
.page(Page.of(userListQueryDto.getPageCurr(), userListQueryDto.getPageSize()));
if (page.getRecords().isEmpty()){
@@ -335,7 +349,6 @@
Page<TAppUser> page = appUserService.lambdaQuery()
.like(userListQueryDto.getUserPhone() != null && !"".equals(userListQueryDto.getUserPhone()), TAppUser::getPhone, userListQueryDto.getUserPhone())
.eq(userListQueryDto.getCityCode() != null && !"".equals(userListQueryDto.getCityCode()), TAppUser::getCityCode, userListQueryDto.getCityCode())
- .eq(userListQueryDto.getProvinceCode() != null && !"".equals(userListQueryDto.getProvinceCode()), TAppUser::getProvinceCode, userListQueryDto.getProvinceCode())
.in(!userIds.isEmpty(),TAppUser::getId,userIds)
.eq(TAppUser::getStatus,1)
.page(Page.of(userListQueryDto.getPageCurr(), userListQueryDto.getPageSize()));
@@ -406,6 +419,11 @@
}
}
+ }else {
+ List<TAppUser> list = appUserService.lambdaQuery().eq(TAppUser::getPhone, tAppUser.getPhone()).list();
+ if (!list.isEmpty()){
+ return R.fail("该手机号已注册");
+ }
}
appUserService.saveOrUpdate(tAppUser);
return R.ok();
@@ -415,12 +433,16 @@
@GetMapping(value = "/user/detail/{id}")
public R<UserDetailDto> userDetail(@PathVariable Long id) {
TAppUser user = appUserService.getById(id);
- UserDetailDto userDetailDto = new UserDetailDto();
- BeanUtils.copyProperties(user,userDetailDto);
- if (user.getVipId()!=null) {
- R<Map<Integer, String>> vipMap = otherClient.getVipMap(Arrays.asList(user.getVipId()));
+ R<Map<Integer, String>> vipMap = otherClient.getVipMap(Collections.singletonList(user.getVipId()));
+ if (user.getVipEndTime()!=null&&user.getVipEndTime().isAfter(LocalDateTime.now())) {
+ //匹配vipMap的值
user.setVipName(vipMap.getData().get(user.getVipId()));
}
+
+
+ UserDetailDto userDetailDto = new UserDetailDto();
+ BeanUtils.copyProperties(user,userDetailDto);
+
//获取累计充电数量
R<Long> useOrderCount = chargingOrderClient.useOrderCount(user.getId());
userDetailDto.setOrderCount(useOrderCount.getData());
@@ -436,6 +458,9 @@
userDetailDto.setTagName(tagMap.getData().values()
.stream()
.collect(Collectors.joining(",")));
+
+
+
return R.ok(userDetailDto);
}
@@ -551,7 +576,7 @@
Long count = signService.lambdaQuery().eq(TAppUserSign::getAppUserId,userId).eq(TAppUserSign::getSignDay, LocalDate.now()).count();
appUserInfoDto.setIsSign(count>0?1:0);
//获取当前拥有的优惠卷数量
- Long coupons = appCouponService.lambdaQuery().eq(TAppCoupon::getAppUserId, userId).eq(TAppCoupon::getStatus, 1).count();
+ Long coupons = appCouponService.lambdaQuery().eq(TAppCoupon::getAppUserId, userId).ge(TAppCoupon::getEndTime, LocalDateTime.now()).eq(TAppCoupon::getStatus, 1).count();
appUserInfoDto.setCouponNum(Math.toIntExact(coupons));
//当前绑定的车辆
List<TAppUserCar> list = carService.lambdaQuery().eq(TAppUserCar::getAppUserId, userId).list();
@@ -648,7 +673,7 @@
plusDay = 12;
}
//增加vipDetail
- giveVipUtil.sendVip(nowUser, giveVipDto.getVipId(),plusDay);
+ giveVipUtil.sendVip(nowUser, giveVipDto.getVipId(),plusDay,giveVipDto.getType());
appUserService.updateById(nowUser);
}
return R.ok();
@@ -834,7 +859,7 @@
signService.updateById(appUserSign);
}
}
- pointDetailUtil.addDetail(byId.getPoints(),byId.getPoints()+points,1,userId,"每日签到","JF");
+ pointDetailUtil.addDetail(byId.getPoints(),byId.getPoints()+points,1,userId,"每日签到","JF","");
byId.setPoints(byId.getPoints()+points);
appUserService.updateById(byId);
return R.ok();
@@ -873,19 +898,19 @@
//积分变化记录用
- @PostMapping(value = "/user/points/change")
- public R change(@RequestBody PointChangeDto points) {
- TAppUser byId = appUserService.getById(points.getUserId());
- pointDetailUtil.addDetail(byId.getPoints(),byId.getPoints()+points.getPoints(),points.getType(),points.getUserId(),points.getRemark(),"JF");
- byId.setPoints(byId.getPoints()+points.getPoints());
- appUserService.updateById(byId);
- return R.ok();
- }
+// @PostMapping(value = "/user/points/change")
+// public R change(@RequestBody PointChangeDto points) {
+// TAppUser byId = appUserService.getById(points.getUserId());
+// pointDetailUtil.addDetail(byId.getPoints(),byId.getPoints()+points.getPoints(),points.getType(),points.getUserId(),points.getRemark(),"JF");
+// byId.setPoints(byId.getPoints()+points.getPoints());
+// appUserService.updateById(byId);
+// return R.ok();
+// }
@PostMapping(value = "/user/points/change/down")
public R changeDown(@RequestBody PointChangeDto points) {
TAppUser byId = appUserService.getById(points.getUserId());
- pointDetailUtil.addDetail(byId.getPoints(),byId.getPoints()-points.getPoints(),points.getType(),points.getUserId(),points.getRemark(),"JF");
+ pointDetailUtil.addDetail(byId.getPoints(),byId.getPoints()-points.getPoints(),points.getType(),points.getUserId(),points.getRemark(),"JF",points.getCode());
byId.setPoints(byId.getPoints()-points.getPoints());
appUserService.updateById(byId);
return R.ok();
@@ -949,13 +974,20 @@
}
//增加积分记录
- pointDetailUtil.addDetail(byId.getPoints(),byId.getPoints()+point,5,userId,appUserCar.getLicensePlate(),"");
+ pointDetailUtil.addDetail(byId.getPoints(),byId.getPoints()+point,5,userId,appUserCar.getLicensePlate(),"","");
byId.setPoints(byId.getPoints()+point);
byId.setFirstAdd(1);
- appUserService.updateById(byId);
}
+ CarNumDto carNumDto = CarUtil.carNum(appUserCar.getLicensePlate());
+ if (carNumDto==null){
+ return R.fail("请输入正确的车牌");
+ }
+
+ byId.setCityCode(carNumDto.getAreaCode());
+ byId.setProvinceCode(carNumDto.getAreaCode().substring(0,2)+"0000");
+ appUserService.updateById(byId);
//
appUserCarService.saveOrUpdate(appUserCar);
@@ -1025,5 +1057,17 @@
return R.ok(jsonObject.getJSONObject("data"));
}
+
+
+
+
+ @PostMapping(value = "/user/editAppUserInfo")
+ @ApiOperation(value = "修改个人信息", tags = {"小程序-个人中心"})
+ public AjaxResult editAppUserInfo(@RequestBody TAppUser appUser){
+ Long userId = tokenService.getLoginUserApplet().getUserId();
+ appUser.setId(userId);
+ appUserService.updateById(appUser);
+ return AjaxResult.success();
+ }
}
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserTagController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserTagController.java
index ec0648d..6c8218b 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserTagController.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserTagController.java
@@ -1,6 +1,7 @@
package com.ruoyi.account.controller;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
@@ -71,14 +72,38 @@
public R delete(String ids) {
//拿到单位列表
String[] split = ids.split(",");
+
+ List<TAppUserTag> list = appUserTagService.lambdaQuery().in(TAppUserTag::getUserTagId).list();
+ if (!list.isEmpty()){
+ return R.fail("当前标签已有用户获取,无法删除");
+ }
for (String id : split) {
otherClient.deleteTag(Integer.valueOf(id));
}
return R.ok();
}
-
-
-
-
+
+
+ /**
+ * 获取用户标签关系
+ * @param appUserTag
+ * @return
+ */
+ @PostMapping(value = "/tags/getUserTag")
+ public R<TAppUserTag> getUserTag(@RequestBody TAppUserTag appUserTag){
+ TAppUserTag one = appUserTagService.getOne(new LambdaQueryWrapper<TAppUserTag>().eq(TAppUserTag::getAppUserId, appUserTag.getAppUserId())
+ .eq(TAppUserTag::getUserTagId, appUserTag.getUserTagId()));
+ return R.ok(one);
+ }
+
+
+ /**
+ * 保存用户标签关系数据
+ * @param appUserTag
+ */
+ @PostMapping(value = "/tags/addUserTag")
+ public void addUserTag(@RequestBody TAppUserTag appUserTag){
+ appUserTagService.save(appUserTag);
+ }
}
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserVipDetailController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserVipDetailController.java
index 47aab16..2bedb36 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserVipDetailController.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserVipDetailController.java
@@ -48,7 +48,7 @@
@ApiOperation(value = "生效会员列表", tags = {"小程序-个人中心"})
public R<List<TAppUserVipDetail>> getVipUseDetail(){
Long userId = tokenService.getLoginUserApplet().getUserId();
- List<TAppUserVipDetail> list = appUserVipDetailService.lambdaQuery().eq(TAppUserVipDetail::getAppUserId, userId).last(" and now() between start_time and end_time order by start_time desc").list();
+ List<TAppUserVipDetail> list = appUserVipDetailService.lambdaQuery().eq(TAppUserVipDetail::getAppUserId, userId).last(" and now() between start_time and end_time order by start_time asc").list();
for (TAppUserVipDetail tAppUserVipDetail : list) {
if(null != tAppUserVipDetail.getVipId()){
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TInvoiceInformationController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TInvoiceInformationController.java
index 5eb18cf..f501947 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TInvoiceInformationController.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TInvoiceInformationController.java
@@ -39,7 +39,8 @@
@ApiOperation(value = "获取开票抬头数据列表", tags = {"小程序-充电发票"})
public AjaxResult<List<InvoiceInformationVo>> getInvoiceInformationList(){
Long userId = tokenService.getLoginUserApplet().getUserId();
- List<TInvoiceInformation> list = invoiceInformationService.list(new LambdaQueryWrapper<TInvoiceInformation>().eq(TInvoiceInformation::getAppUserId, userId).eq(TInvoiceInformation::getDelFlag, 0));
+ List<TInvoiceInformation> list = invoiceInformationService.list(new LambdaQueryWrapper<TInvoiceInformation>()
+ .eq(TInvoiceInformation::getAppUserId, userId).eq(TInvoiceInformation::getDelFlag, 0).orderByDesc(TInvoiceInformation::getIsDefault));
List<InvoiceInformationVo> lists = new ArrayList<>();
for (TInvoiceInformation tInvoiceInformation : list) {
InvoiceInformationVo vo = new InvoiceInformationVo();
@@ -89,7 +90,7 @@
public AjaxResult editInvoiceInformation(@RequestBody TInvoiceInformation invoiceInformation){
Long userId = tokenService.getLoginUserApplet().getUserId();
//如果当前是默认抬头,则需要去除其他的默认配置
- if(1 == invoiceInformation.getIsDefault()){
+ if(null != invoiceInformation.getIsDefault() && 1 == invoiceInformation.getIsDefault()){
TInvoiceInformation one = invoiceInformationService.getOne(new LambdaQueryWrapper<TInvoiceInformation>().eq(TInvoiceInformation::getDelFlag, 0)
.eq(TInvoiceInformation::getIsDefault, 1).eq(TInvoiceInformation::getAppUserId, userId));
if(null != one && !one.getId().equals(invoiceInformation.getId())){
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/WxLoginController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/WxLoginController.java
index de9af48..b640f7d 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/WxLoginController.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/WxLoginController.java
@@ -1,6 +1,7 @@
package com.ruoyi.account.controller;
import com.alibaba.fastjson.JSONObject;
+import com.alipay.api.internal.util.codec.Base64;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
@@ -15,6 +16,7 @@
import com.ruoyi.account.wx.tools.WxAppletTools;
import com.ruoyi.account.wx.tools.WxUtils;
import com.ruoyi.common.core.exception.ServiceException;
+import com.ruoyi.common.core.utils.FileUploadUtils;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.redis.service.RedisService;
@@ -24,12 +26,25 @@
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+import org.springframework.mock.web.MockMultipartFile;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
+import org.springframework.web.multipart.MultipartFile;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Objects;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.security.SecureRandom;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
/**
* <p>
* 微信小程序登录 前端控制器
@@ -48,6 +63,11 @@
private WeixinProperties wxConfig;
@Autowired
private RestTemplate wxRestTemplate;
+ /**
+ * 上传文件存储在本地的根路径
+ */
+ @Value("${file.path}")
+ private String localFilePath;
@ApiOperation(value = "通过code获得openid,获取用户信息",tags = {"微信小程序登录"})
@PostMapping("/openIdByJsCode")
public AjaxResult<Map<String, Object>> openIdByJsCode(@RequestBody AppletUserEncrypteData data) {
@@ -79,4 +99,62 @@
public AjaxResult<Map<String, Object>> openIdByJsCode(@RequestBody AppletUserDecodeData appletUserDecodeData) {
return AjaxResult.success(appUserService.wxLogin(appletUserDecodeData, null));
}
+ public static MultipartFile convertInputStreamToMultipartFile(InputStream inputStream, String fileName, String contentType) throws IOException {
+ return new MockMultipartFile(fileName, fileName, contentType, inputStream);
+ }
+ @ApiOperation(value = "获取微信小程序二维码",tags = {"获取微信小程序二维码"})
+ @PostMapping("/getQRCode")
+ public AjaxResult getQRCode() {
+ InputStream inputStream = null;
+ OutputStream outputStream = null;
+ WxAppletTools appletTools = new WxAppletTools(wxRestTemplate, wxConfig);
+ String accessToken = appletTools.getAccessToken("");
+ try {
+ String url = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + accessToken;
+ Map<String, Object> param = new HashMap<>();
+// param.put("page", "pageA/houseDetail");
+ param.put("check_path", false);
+ param.put("env_version", "trial");
+ param.put("width", 200); //二维码尺寸
+ param.put("is_hyaline", true); // 是否需要透明底色, is_hyaline 为true时,生成透明底色的小程序码 参数仅对小程序码生效
+ param.put("auto_color", true); // 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调 参数仅对小程序码生效
+ Map<String, Object> line_color = new HashMap<>();
+ line_color.put("r", 0);
+ line_color.put("g", 0);
+ line_color.put("b", 0);
+ param.put("line_color", line_color);
+ System.err.println("调用生成微信URL接口传参:" + param);
+ MultiValueMap<String, String> headers = new LinkedMultiValueMap<>();
+ HttpEntity requestEntity = new HttpEntity(param, headers);
+ ResponseEntity<byte[]> entity = wxRestTemplate.exchange(url, HttpMethod.POST, requestEntity, byte[].class, new Object[0]);
+ System.err.println("调用小程序生成微信永久小程序码URL接口返回结果:" + entity.getBody());
+ byte[] result = entity.getBody();
+ System.err.println(Base64.encodeBase64String(result));
+ inputStream = new ByteArrayInputStream(result);
+ String finalFileName = System.currentTimeMillis() + "" + new SecureRandom().nextInt(0x0400) + ".jpeg";
+ MultipartFile multipartFile = convertInputStreamToMultipartFile(inputStream, finalFileName, "image/jpeg");
+ String name = FileUploadUtils.upload(localFilePath, multipartFile);
+ System.err.println(name);
+ return AjaxResult.success(name);
+ } catch (Exception e) {
+ System.err.println("调用小程序生成微信永久小程序码URL接口异常" + e);
+ } finally {
+ if (inputStream != null) {
+ try {
+ inputStream.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ if (outputStream != null) {
+ try {
+ outputStream.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ return AjaxResult.success();
+ }
+
}
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/filter/AuthFilter.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/filter/AuthFilter.java
index 68fa2ca..0181d72 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/filter/AuthFilter.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/filter/AuthFilter.java
@@ -44,6 +44,11 @@
@Override
+ public void init(FilterConfig filterConfig) throws ServletException {
+
+ }
+
+ @Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
HttpServletRequest request = (HttpServletRequest) servletRequest;
HttpServletResponse response = (HttpServletResponse) servletResponse;
@@ -83,9 +88,13 @@
}
filterChain.doFilter(request, response);
}
-
-
-
+
+ @Override
+ public void destroy() {
+
+ }
+
+
private void unauthorizedResponse(HttpServletResponse response, String msg) {
response.setStatus(HttpStatus.OK.value());
response.setHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_UTF8_VALUE);
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/TAppCouponServiceImpl.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/TAppCouponServiceImpl.java
index 0d25253..aaee34a 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/TAppCouponServiceImpl.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/TAppCouponServiceImpl.java
@@ -88,7 +88,7 @@
if(collect.isEmpty()){
collect.add(-1L);
}
- wrapper.in("id",collect);
+ wrapper.in("app_user_id",collect);
}
if (dto.getStatus()!=null){
wrapper.eq("status",dto.getStatus());
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/task/TaskUtil.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/task/TaskUtil.java
index 7e87177..122ca09 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/task/TaskUtil.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/task/TaskUtil.java
@@ -12,6 +12,7 @@
import javax.annotation.Resource;
import java.time.LocalDate;
+import java.time.LocalDateTime;
import java.util.List;
@@ -61,7 +62,7 @@
@Scheduled(fixedRate = 1000 * 60)
public void changeVipId(){
- LocalDate currentDate = LocalDate.now();
+ LocalDateTime currentDate = LocalDateTime.now();
List<TAppUserVipDetail> recentDetails = tAppUserVipDetailService.lambdaQuery()
.le(TAppUserVipDetail::getStartTime, currentDate)
.ge(TAppUserVipDetail::getEndTime, currentDate)
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/CarNumDto.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/CarNumDto.java
index ed30b43..1c41268 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/CarNumDto.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/CarNumDto.java
@@ -8,5 +8,6 @@
private String pcode;
private String province;
private String city;
- private String code;
+ private String Hp;
+ private String AreaCode;
}
\ No newline at end of file
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/CarUtil.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/CarUtil.java
index 532cc5d..8087a9e 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/CarUtil.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/CarUtil.java
@@ -9,2370 +9,2766 @@
public class CarUtil {
public static CarNumDto carNum(String num) {
- String jsonStr = "{\"date\":[\n" +
- "{\n" +
- "\"code\":\"冀A\",\n" +
- "\"city\":\"石家庄\",\n" +
- "\"province\":\"河北\",\n" +
- "\"pcode\":\"HB\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"冀B\",\n" +
- "\"city\":\"唐山\",\n" +
- "\"province\":\"河北\",\n" +
- "\"pcode\":\"HB\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"冀C\",\n" +
- "\"city\":\"秦皇岛\",\n" +
- "\"province\":\"河北\",\n" +
- "\"pcode\":\"HB\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"冀D\",\n" +
- "\"city\":\"邯郸\",\n" +
- "\"province\":\"河北\",\n" +
- "\"pcode\":\"HB\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"冀E\",\n" +
- "\"city\":\"邢台\",\n" +
- "\"province\":\"河北\",\n" +
- "\"pcode\":\"HB\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"冀F\",\n" +
- "\"city\":\"保定\",\n" +
- "\"province\":\"河北\",\n" +
- "\"pcode\":\"HB\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"冀G\",\n" +
- "\"city\":\"张家口\",\n" +
- "\"province\":\"河北\",\n" +
- "\"pcode\":\"HB\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"冀H\",\n" +
- "\"city\":\"承德\",\n" +
- "\"province\":\"河北\",\n" +
- "\"pcode\":\"HB\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"冀J\",\n" +
- "\"city\":\"沧州\",\n" +
- "\"province\":\"河北\",\n" +
- "\"pcode\":\"HB\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"冀R\",\n" +
- "\"city\":\"廊坊\",\n" +
- "\"province\":\"河北\",\n" +
- "\"pcode\":\"HB\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"冀S\",\n" +
- "\"city\":\"沧州\",\n" +
- "\"province\":\"河北\",\n" +
- "\"pcode\":\"HB\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"冀T\",\n" +
- "\"city\":\"衡水\",\n" +
- "\"province\":\"河北\",\n" +
- "\"pcode\":\"HB\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"辽A\",\n" +
- "\"city\":\"沈阳\",\n" +
- "\"province\":\"辽宁\",\n" +
- "\"pcode\":\"LN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"辽B\",\n" +
- "\"city\":\"大连\",\n" +
- "\"province\":\"辽宁\",\n" +
- "\"pcode\":\"LN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"辽C\",\n" +
- "\"city\":\"鞍山\",\n" +
- "\"province\":\"辽宁\",\n" +
- "\"pcode\":\"LN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"辽D\",\n" +
- "\"city\":\"抚顺\",\n" +
- "\"province\":\"辽宁\",\n" +
- "\"pcode\":\"LN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"辽E\",\n" +
- "\"city\":\"本溪\",\n" +
- "\"province\":\"辽宁\",\n" +
- "\"pcode\":\"LN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"辽F\",\n" +
- "\"city\":\"丹东\",\n" +
- "\"province\":\"辽宁\",\n" +
- "\"pcode\":\"LN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"辽G\",\n" +
- "\"city\":\"锦州\",\n" +
- "\"province\":\"辽宁\",\n" +
- "\"pcode\":\"LN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"辽H\",\n" +
- "\"city\":\"营口\",\n" +
- "\"province\":\"辽宁\",\n" +
- "\"pcode\":\"LN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"辽J\",\n" +
- "\"city\":\"阜新\",\n" +
- "\"province\":\"辽宁\",\n" +
- "\"pcode\":\"LN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"辽K\",\n" +
- "\"city\":\"辽阳\",\n" +
- "\"province\":\"辽宁\",\n" +
- "\"pcode\":\"LN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"辽L\",\n" +
- "\"city\":\"盘锦\",\n" +
- "\"province\":\"辽宁\",\n" +
- "\"pcode\":\"LN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"辽M\",\n" +
- "\"city\":\"铁岭\",\n" +
- "\"province\":\"辽宁\",\n" +
- "\"pcode\":\"LN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"辽N\",\n" +
- "\"city\":\"朝阳\",\n" +
- "\"province\":\"辽宁\",\n" +
- "\"pcode\":\"LN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"辽p\",\n" +
- "\"city\":\"葫芦岛\",\n" +
- "\"province\":\"辽宁\",\n" +
- "\"pcode\":\"LN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"皖A\",\n" +
- "\"city\":\"合肥\",\n" +
- "\"province\":\"安徽\",\n" +
- "\"pcode\":\"AH\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"皖B\",\n" +
- "\"city\":\"芜湖\",\n" +
- "\"province\":\"安徽\",\n" +
- "\"pcode\":\"AH\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"皖C\",\n" +
- "\"city\":\"蚌埠\",\n" +
- "\"province\":\"安徽\",\n" +
- "\"pcode\":\"AH\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"皖D\",\n" +
- "\"city\":\"淮南\",\n" +
- "\"province\":\"安徽\",\n" +
- "\"pcode\":\"AH\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"皖E\",\n" +
- "\"city\":\"马鞍山\",\n" +
- "\"province\":\"安徽\",\n" +
- "\"pcode\":\"AH\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"皖F\",\n" +
- "\"city\":\"淮北\",\n" +
- "\"province\":\"安徽\",\n" +
- "\"pcode\":\"AH\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"皖G\",\n" +
- "\"city\":\"铜陵\",\n" +
- "\"province\":\"安徽\",\n" +
- "\"pcode\":\"AH\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"皖H\",\n" +
- "\"city\":\"安庆\",\n" +
- "\"province\":\"安徽\",\n" +
- "\"pcode\":\"AH\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"皖J\",\n" +
- "\"city\":\"黄山\",\n" +
- "\"province\":\"安徽\",\n" +
- "\"pcode\":\"AH\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"皖K\",\n" +
- "\"city\":\"阜阳\",\n" +
- "\"province\":\"安徽\",\n" +
- "\"pcode\":\"AH\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"皖L\",\n" +
- "\"city\":\"宿州\",\n" +
- "\"province\":\"安徽\",\n" +
- "\"pcode\":\"AH\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"皖M\",\n" +
- "\"city\":\"滁州\",\n" +
- "\"province\":\"安徽\",\n" +
- "\"pcode\":\"AH\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"皖N\",\n" +
- "\"city\":\"六安\",\n" +
- "\"province\":\"安徽\",\n" +
- "\"pcode\":\"AH\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"皖p\",\n" +
- "\"city\":\"宣城\",\n" +
- "\"province\":\"安徽\",\n" +
- "\"pcode\":\"AH\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"皖Q\",\n" +
- "\"city\":\"巢湖\",\n" +
- "\"province\":\"安徽\",\n" +
- "\"pcode\":\"AH\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"皖R\",\n" +
- "\"city\":\"池州\",\n" +
- "\"province\":\"安徽\",\n" +
- "\"pcode\":\"AH\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"皖S\",\n" +
- "\"city\":\"亳州\",\n" +
- "\"province\":\"安徽\",\n" +
- "\"pcode\":\"AH\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"苏A\",\n" +
- "\"city\":\"南京\",\n" +
- "\"province\":\"江苏\",\n" +
- "\"pcode\":\"JS\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"苏B\",\n" +
- "\"city\":\"无锡\",\n" +
- "\"province\":\"江苏\",\n" +
- "\"pcode\":\"JS\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"苏C\",\n" +
- "\"city\":\"徐州\",\n" +
- "\"province\":\"江苏\",\n" +
- "\"pcode\":\"JS\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"苏D\",\n" +
- "\"city\":\"常州\",\n" +
- "\"province\":\"江苏\",\n" +
- "\"pcode\":\"JS\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"苏E\",\n" +
- "\"city\":\"苏州\",\n" +
- "\"province\":\"江苏\",\n" +
- "\"pcode\":\"JS\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"苏F\",\n" +
- "\"city\":\"南通\",\n" +
- "\"province\":\"江苏\",\n" +
- "\"pcode\":\"JS\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"苏G\",\n" +
- "\"city\":\"连云港\",\n" +
- "\"province\":\"江苏\",\n" +
- "\"pcode\":\"JS\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"苏H\",\n" +
- "\"city\":\"淮安\",\n" +
- "\"province\":\"江苏\",\n" +
- "\"pcode\":\"JS\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"苏J\",\n" +
- "\"city\":\"盐城\",\n" +
- "\"province\":\"江苏\",\n" +
- "\"pcode\":\"JS\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"苏K\",\n" +
- "\"city\":\"扬州\",\n" +
- "\"province\":\"江苏\",\n" +
- "\"pcode\":\"JS\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"苏L\",\n" +
- "\"city\":\"镇江\",\n" +
- "\"province\":\"江苏\",\n" +
- "\"pcode\":\"JS\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"苏M\",\n" +
- "\"city\":\"泰州\",\n" +
- "\"province\":\"江苏\",\n" +
- "\"pcode\":\"JS\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"苏N\",\n" +
- "\"city\":\"宿迁\",\n" +
- "\"province\":\"江苏\",\n" +
- "\"pcode\":\"JS\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鄂A\",\n" +
- "\"city\":\"武汉\",\n" +
- "\"province\":\"湖北\",\n" +
- "\"pcode\":\"HB\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鄂B\",\n" +
- "\"city\":\"黄石\",\n" +
- "\"province\":\"湖北\",\n" +
- "\"pcode\":\"HB\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鄂C\",\n" +
- "\"city\":\"十堰\",\n" +
- "\"province\":\"湖北\",\n" +
- "\"pcode\":\"HB\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鄂D\",\n" +
- "\"city\":\"荆州\",\n" +
- "\"province\":\"湖北\",\n" +
- "\"pcode\":\"HB\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鄂E\",\n" +
- "\"city\":\"宜昌\",\n" +
- "\"province\":\"湖北\",\n" +
- "\"pcode\":\"HB\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鄂F\",\n" +
- "\"city\":\"襄樊\",\n" +
- "\"province\":\"湖北\",\n" +
- "\"pcode\":\"HB\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鄂G\",\n" +
- "\"city\":\"鄂州\",\n" +
- "\"province\":\"湖北\",\n" +
- "\"pcode\":\"HB\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鄂H\",\n" +
- "\"city\":\"荆门 \",\n" +
- "\"province\":\"湖北\",\n" +
- "\"pcode\":\"HB\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鄂J\",\n" +
- "\"city\":\"黄冈\",\n" +
- "\"province\":\"湖北\",\n" +
- "\"pcode\":\"HB\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鄂K\",\n" +
- "\"city\":\"孝感\",\n" +
- "\"province\":\"湖北\",\n" +
- "\"pcode\":\"HB\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鄂L\",\n" +
- "\"city\":\"咸宁\",\n" +
- "\"province\":\"湖北\",\n" +
- "\"pcode\":\"HB\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鄂M\",\n" +
- "\"city\":\"仙桃\",\n" +
- "\"province\":\"湖北\",\n" +
- "\"pcode\":\"HB\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鄂N\",\n" +
- "\"city\":\"潜江\",\n" +
- "\"province\":\"湖北\",\n" +
- "\"pcode\":\"HB\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鄂p\",\n" +
- "\"city\":\"神农架林区\",\n" +
- "\"province\":\"湖北\",\n" +
- "\"pcode\":\"HB\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鄂Q\",\n" +
- "\"city\":\"恩施土家族苗族自治州\",\n" +
- "\"province\":\"湖北\",\n" +
- "\"pcode\":\"HB\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鄂R\",\n" +
- "\"city\":\"天门\",\n" +
- "\"province\":\"湖北\",\n" +
- "\"pcode\":\"HB\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鄂S\",\n" +
- "\"city\":\"随州\",\n" +
- "\"province\":\"湖北\",\n" +
- "\"pcode\":\"HB\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"晋A\",\n" +
- "\"city\":\"太原\",\n" +
- "\"province\":\"山西\",\n" +
- "\"pcode\":\"SX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"晋B\",\n" +
- "\"city\":\"大同\",\n" +
- "\"province\":\"山西\",\n" +
- "\"pcode\":\"SX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"晋C\",\n" +
- "\"city\":\"阳泉\",\n" +
- "\"province\":\"山西\",\n" +
- "\"pcode\":\"SX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"晋D\",\n" +
- "\"city\":\"长治\",\n" +
- "\"province\":\"山西\",\n" +
- "\"pcode\":\"SX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"晋E\",\n" +
- "\"city\":\"晋城\",\n" +
- "\"province\":\"山西\",\n" +
- "\"pcode\":\"SX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"晋F\",\n" +
- "\"city\":\"朔州\",\n" +
- "\"province\":\"山西\",\n" +
- "\"pcode\":\"SX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"晋H\",\n" +
- "\"city\":\"忻州\",\n" +
- "\"province\":\"山西\",\n" +
- "\"pcode\":\"SX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"晋J\",\n" +
- "\"city\":\"吕梁地区\",\n" +
- "\"province\":\"山西\",\n" +
- "\"pcode\":\"SX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"晋K\",\n" +
- "\"city\":\"晋中\",\n" +
- "\"province\":\"山西\",\n" +
- "\"pcode\":\"SX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"晋L\",\n" +
- "\"city\":\"临汾\",\n" +
- "\"province\":\"山西\",\n" +
- "\"pcode\":\"SX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"晋M\",\n" +
- "\"city\":\"运城\",\n" +
- "\"province\":\"山西\",\n" +
- "\"pcode\":\"SX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"吉A\",\n" +
- "\"city\":\"长春\",\n" +
- "\"province\":\"吉林\",\n" +
- "\"pcode\":\"JL\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"吉B\",\n" +
- "\"city\":\"吉林\",\n" +
- "\"province\":\"吉林\",\n" +
- "\"pcode\":\"JL\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"吉C\",\n" +
- "\"city\":\"四平\",\n" +
- "\"province\":\"吉林\",\n" +
- "\"pcode\":\"JL\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"吉D\",\n" +
- "\"city\":\"辽源\",\n" +
- "\"province\":\"吉林\",\n" +
- "\"pcode\":\"JL\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"吉E\",\n" +
- "\"city\":\"通化\",\n" +
- "\"province\":\"吉林\",\n" +
- "\"pcode\":\"JL\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"吉F\",\n" +
- "\"city\":\"白山\",\n" +
- "\"province\":\"吉林\",\n" +
- "\"pcode\":\"JL\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"吉G\",\n" +
- "\"city\":\"白城\",\n" +
- "\"province\":\"吉林\",\n" +
- "\"pcode\":\"JL\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"吉H\",\n" +
- "\"city\":\"延边朝鲜族自治州\",\n" +
- "\"province\":\"吉林\",\n" +
- "\"pcode\":\"JL\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"吉J\",\n" +
- "\"city\":\"松原\",\n" +
- "\"province\":\"吉林\",\n" +
- "\"pcode\":\"JL\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"吉K\",\n" +
- "\"city\":\"长白山\",\n" +
- "\"province\":\"吉林\",\n" +
- "\"pcode\":\"JL\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"粤A\",\n" +
- "\"city\":\"广州\",\n" +
- "\"province\":\"广东\",\n" +
- "\"pcode\":\"GD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"粤B\",\n" +
- "\"city\":\"深圳\",\n" +
- "\"province\":\"广东\",\n" +
- "\"pcode\":\"GD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"粤C\",\n" +
- "\"city\":\"珠海\",\n" +
- "\"province\":\"广东\",\n" +
- "\"pcode\":\"GD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"粤D\",\n" +
- "\"city\":\"汕头\",\n" +
- "\"province\":\"广东\",\n" +
- "\"pcode\":\"GD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"粤E\",\n" +
- "\"city\":\"佛山\",\n" +
- "\"province\":\"广东\",\n" +
- "\"pcode\":\"GD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"粤F\",\n" +
- "\"city\":\"韶关\",\n" +
- "\"province\":\"广东\",\n" +
- "\"pcode\":\"GD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"粤G\",\n" +
- "\"city\":\"湛江\",\n" +
- "\"province\":\"广东\",\n" +
- "\"pcode\":\"GD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"粤H\",\n" +
- "\"city\":\"肇庆\",\n" +
- "\"province\":\"广东\",\n" +
- "\"pcode\":\"GD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"粤J\",\n" +
- "\"city\":\"江门\",\n" +
- "\"province\":\"广东\",\n" +
- "\"pcode\":\"GD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"粤K\",\n" +
- "\"city\":\"茂名\",\n" +
- "\"province\":\"广东\",\n" +
- "\"pcode\":\"GD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"粤L\",\n" +
- "\"city\":\"惠州\",\n" +
- "\"province\":\"广东\",\n" +
- "\"pcode\":\"GD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"粤M\",\n" +
- "\"city\":\"梅州\",\n" +
- "\"province\":\"广东\",\n" +
- "\"pcode\":\"GD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"粤N\",\n" +
- "\"city\":\"汕尾\",\n" +
- "\"province\":\"广东\",\n" +
- "\"pcode\":\"GD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"粤p\",\n" +
- "\"city\":\"河源\",\n" +
- "\"province\":\"广东\",\n" +
- "\"pcode\":\"GD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"粤Q\",\n" +
- "\"city\":\"阳江\",\n" +
- "\"province\":\"广东\",\n" +
- "\"pcode\":\"GD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"粤R\",\n" +
- "\"city\":\"清远\",\n" +
- "\"province\":\"广东\",\n" +
- "\"pcode\":\"GD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"粤S\",\n" +
- "\"city\":\"东莞\",\n" +
- "\"province\":\"广东\",\n" +
- "\"pcode\":\"GD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"粤T\",\n" +
- "\"city\":\"中山\",\n" +
- "\"province\":\"广东\",\n" +
- "\"pcode\":\"GD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"粤U\",\n" +
- "\"city\":\"潮州\",\n" +
- "\"province\":\"广东\",\n" +
- "\"pcode\":\"GD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"粤V\",\n" +
- "\"city\":\"揭阳\",\n" +
- "\"province\":\"广东\",\n" +
- "\"pcode\":\"GD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"粤W\",\n" +
- "\"city\":\"云浮\",\n" +
- "\"province\":\"广东\",\n" +
- "\"pcode\":\"GD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"粤X\",\n" +
- "\"city\":\"顺德区\",\n" +
- "\"province\":\"广东\",\n" +
- "\"pcode\":\"GD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"粤Y\",\n" +
- "\"city\":\"南海区\",\n" +
- "\"province\":\"广东\",\n" +
- "\"pcode\":\"GD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"粤Z\",\n" +
- "\"city\":\"港澳进入内地车辆\",\n" +
- "\"province\":\"广东\",\n" +
- "\"pcode\":\"GD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"宁A\",\n" +
- "\"city\":\"银川\",\n" +
- "\"province\":\"宁夏\",\n" +
- "\"pcode\":\"NX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"宁B\",\n" +
- "\"city\":\"石嘴山\",\n" +
- "\"province\":\"宁夏\",\n" +
- "\"pcode\":\"NX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"宁C\",\n" +
- "\"city\":\"银南\",\n" +
- "\"province\":\"宁夏\",\n" +
- "\"pcode\":\"NX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"宁D\",\n" +
- "\"city\":\"固原\",\n" +
- "\"province\":\"宁夏\",\n" +
- "\"pcode\":\"NX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"宁E\",\n" +
- "\"city\":\"中卫\",\n" +
- "\"province\":\"宁夏\",\n" +
- "\"pcode\":\"NX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"京A\",\n" +
- "\"city\":\"北京\",\n" +
- "\"province\":\"北京\",\n" +
- "\"pcode\":\"BJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"京B\",\n" +
- "\"city\":\"北京\",\n" +
- "\"province\":\"北京\",\n" +
- "\"pcode\":\"BJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"京C\",\n" +
- "\"city\":\"北京\",\n" +
- "\"province\":\"北京\",\n" +
- "\"pcode\":\"BJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"京D\",\n" +
- "\"city\":\"北京\",\n" +
- "\"province\":\"北京\",\n" +
- "\"pcode\":\"BJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"京E\",\n" +
- "\"city\":\"北京\",\n" +
- "\"province\":\"北京\",\n" +
- "\"pcode\":\"BJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"京F\",\n" +
- "\"city\":\"北京\",\n" +
- "\"province\":\"北京\",\n" +
- "\"pcode\":\"BJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"京G\",\n" +
- "\"city\":\"北京\",\n" +
- "\"province\":\"北京\",\n" +
- "\"pcode\":\"BJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"京H\",\n" +
- "\"city\":\"北京\",\n" +
- "\"province\":\"北京\",\n" +
- "\"pcode\":\"BJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"京J\",\n" +
- "\"city\":\"北京\",\n" +
- "\"province\":\"北京\",\n" +
- "\"pcode\":\"BJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"京K\",\n" +
- "\"city\":\"北京\",\n" +
- "\"province\":\"北京\",\n" +
- "\"pcode\":\"BJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"京L\",\n" +
- "\"city\":\"北京\",\n" +
- "\"province\":\"北京\",\n" +
- "\"pcode\":\"BJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"京M\",\n" +
- "\"city\":\"北京\",\n" +
- "\"province\":\"北京\",\n" +
- "\"pcode\":\"BJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"京Y\",\n" +
- "\"city\":\"北京\",\n" +
- "\"province\":\"北京\",\n" +
- "\"pcode\":\"BJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"豫A\",\n" +
- "\"city\":\"郑州\",\n" +
- "\"province\":\"河南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"豫B\",\n" +
- "\"city\":\"开封\",\n" +
- "\"province\":\"河南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"豫C\",\n" +
- "\"city\":\"洛阳\",\n" +
- "\"province\":\"河南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"豫D\",\n" +
- "\"city\":\"平顶山\",\n" +
- "\"province\":\"河南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"豫E\",\n" +
- "\"city\":\"安阳\",\n" +
- "\"province\":\"河南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"豫F\",\n" +
- "\"city\":\"鹤壁\",\n" +
- "\"province\":\"河南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"豫G\",\n" +
- "\"city\":\"新乡\",\n" +
- "\"province\":\"河南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"豫H\",\n" +
- "\"city\":\"焦作\",\n" +
- "\"province\":\"河南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"豫J\",\n" +
- "\"city\":\"濮阳\",\n" +
- "\"province\":\"河南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"豫K\",\n" +
- "\"city\":\"许昌\",\n" +
- "\"province\":\"河南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"豫L\",\n" +
- "\"city\":\"漯河\",\n" +
- "\"province\":\"河南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"豫M\",\n" +
- "\"city\":\"三门峡\",\n" +
- "\"province\":\"河南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"豫N\",\n" +
- "\"city\":\"商丘\",\n" +
- "\"province\":\"河南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"豫p\",\n" +
- "\"city\":\"周口\",\n" +
- "\"province\":\"河南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"豫Q\",\n" +
- "\"city\":\"驻马店\",\n" +
- "\"province\":\"河南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"豫R\",\n" +
- "\"city\":\"南阳\",\n" +
- "\"province\":\"河南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"豫S\",\n" +
- "\"city\":\"信阳\",\n" +
- "\"province\":\"河南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"豫U\",\n" +
- "\"city\":\"济源\",\n" +
- "\"province\":\"河南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"黑A\",\n" +
- "\"city\":\"哈尔滨\",\n" +
- "\"province\":\"黑龙江\",\n" +
- "\"pcode\":\"HLJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"黑B\",\n" +
- "\"city\":\"齐齐哈尔\",\n" +
- "\"province\":\"黑龙江\",\n" +
- "\"pcode\":\"HLJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"黑C\",\n" +
- "\"city\":\"牡丹江\",\n" +
- "\"province\":\"黑龙江\",\n" +
- "\"pcode\":\"HLJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"黑D\",\n" +
- "\"city\":\"佳木斯\",\n" +
- "\"province\":\"黑龙江\",\n" +
- "\"pcode\":\"HLJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"黑E\",\n" +
- "\"city\":\"大庆\",\n" +
- "\"province\":\"黑龙江\",\n" +
- "\"pcode\":\"HLJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"黑F\",\n" +
- "\"city\":\"伊春\",\n" +
- "\"province\":\"黑龙江\",\n" +
- "\"pcode\":\"HLJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"黑G\",\n" +
- "\"city\":\"鸡西\",\n" +
- "\"province\":\"黑龙江\",\n" +
- "\"pcode\":\"HLJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"黑H\",\n" +
- "\"city\":\"鹤岗\",\n" +
- "\"province\":\"黑龙江\",\n" +
- "\"pcode\":\"HLJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"黑J\",\n" +
- "\"city\":\"双鸭山\",\n" +
- "\"province\":\"黑龙江\",\n" +
- "\"pcode\":\"HLJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"黑K\",\n" +
- "\"city\":\"七台河\",\n" +
- "\"province\":\"黑龙江\",\n" +
- "\"pcode\":\"HLJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"黑L\",\n" +
- "\"city\":\"松花江地区\",\n" +
- "\"province\":\"黑龙江\",\n" +
- "\"pcode\":\"HLJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"黑M\",\n" +
- "\"city\":\"绥化\",\n" +
- "\"province\":\"黑龙江\",\n" +
- "\"pcode\":\"HLJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"黑N\",\n" +
- "\"city\":\"黑河\",\n" +
- "\"province\":\"黑龙江\",\n" +
- "\"pcode\":\"HLJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"黑p\",\n" +
- "\"city\":\"大兴安岭地区\",\n" +
- "\"province\":\"黑龙江\",\n" +
- "\"pcode\":\"HLJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"黑R\",\n" +
- "\"city\":\"农垦系统\",\n" +
- "\"province\":\"黑龙江\",\n" +
- "\"pcode\":\"HLJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鲁A \",\n" +
- "\"city\":\"济南\",\n" +
- "\"province\":\"山东\",\n" +
- "\"pcode\":\"SD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鲁B\",\n" +
- "\"city\":\"青岛\",\n" +
- "\"province\":\"山东\",\n" +
- "\"pcode\":\"SD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鲁C\",\n" +
- "\"city\":\"淄博\",\n" +
- "\"province\":\"山东\",\n" +
- "\"pcode\":\"SD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鲁D\",\n" +
- "\"city\":\"枣庄\",\n" +
- "\"province\":\"山东\",\n" +
- "\"pcode\":\"SD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鲁E\",\n" +
- "\"city\":\"东营\",\n" +
- "\"province\":\"山东\",\n" +
- "\"pcode\":\"SD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鲁F\",\n" +
- "\"city\":\"烟台\",\n" +
- "\"province\":\"山东\",\n" +
- "\"pcode\":\"SD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鲁G\",\n" +
- "\"city\":\"潍坊\",\n" +
- "\"province\":\"山东\",\n" +
- "\"pcode\":\"SD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鲁H\",\n" +
- "\"city\":\"济宁\",\n" +
- "\"province\":\"山东\",\n" +
- "\"pcode\":\"SD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鲁J\",\n" +
- "\"city\":\"泰安\",\n" +
- "\"province\":\"山东\",\n" +
- "\"pcode\":\"SD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鲁K\",\n" +
- "\"city\":\"威海\",\n" +
- "\"province\":\"山东\",\n" +
- "\"pcode\":\"SD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鲁L\",\n" +
- "\"city\":\"日照\",\n" +
- "\"province\":\"山东\",\n" +
- "\"pcode\":\"SD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鲁M\",\n" +
- "\"city\":\"滨州\",\n" +
- "\"province\":\"山东\",\n" +
- "\"pcode\":\"SD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鲁N\",\n" +
- "\"city\":\"德州\",\n" +
- "\"province\":\"山东\",\n" +
- "\"pcode\":\"SD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鲁p\",\n" +
- "\"city\":\"聊城\",\n" +
- "\"province\":\"山东\",\n" +
- "\"pcode\":\"SD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鲁Q\",\n" +
- "\"city\":\"临沂\",\n" +
- "\"province\":\"山东\",\n" +
- "\"pcode\":\"SD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鲁R\",\n" +
- "\"city\":\"菏泽\",\n" +
- "\"province\":\"山东\",\n" +
- "\"pcode\":\"SD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鲁S\",\n" +
- "\"city\":\"莱芜\",\n" +
- "\"province\":\"山东\",\n" +
- "\"pcode\":\"SD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鲁U\",\n" +
- "\"city\":\"青岛增补\",\n" +
- "\"province\":\"山东\",\n" +
- "\"pcode\":\"SD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鲁V\",\n" +
- "\"city\":\"潍坊增补\",\n" +
- "\"province\":\"山东\",\n" +
- "\"pcode\":\"SD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"鲁Y\",\n" +
- "\"city\":\"烟台\",\n" +
- "\"province\":\"山东\",\n" +
- "\"pcode\":\"SD\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"浙A\",\n" +
- "\"city\":\"杭州\",\n" +
- "\"province\":\"浙江\",\n" +
- "\"pcode\":\"ZJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"浙B\",\n" +
- "\"city\":\"宁波\",\n" +
- "\"province\":\"浙江\",\n" +
- "\"pcode\":\"ZJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"浙C\",\n" +
- "\"city\":\"温州\",\n" +
- "\"province\":\"浙江\",\n" +
- "\"pcode\":\"ZJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"浙D\",\n" +
- "\"city\":\"绍兴\",\n" +
- "\"province\":\"浙江\",\n" +
- "\"pcode\":\"ZJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"浙E\",\n" +
- "\"city\":\"湖州\",\n" +
- "\"province\":\"浙江\",\n" +
- "\"pcode\":\"ZJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"浙F\",\n" +
- "\"city\":\"嘉兴\",\n" +
- "\"province\":\"浙江\",\n" +
- "\"pcode\":\"ZJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"浙G\",\n" +
- "\"city\":\"金华\",\n" +
- "\"province\":\"浙江\",\n" +
- "\"pcode\":\"ZJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"浙H\",\n" +
- "\"city\":\"衢州\",\n" +
- "\"province\":\"浙江\",\n" +
- "\"pcode\":\"ZJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"浙J\",\n" +
- "\"city\":\"台州\",\n" +
- "\"province\":\"浙江\",\n" +
- "\"pcode\":\"ZJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"浙K\",\n" +
- "\"city\":\"丽水\",\n" +
- "\"province\":\"浙江\",\n" +
- "\"pcode\":\"ZJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"浙L\",\n" +
- "\"city\":\"舟山\",\n" +
- "\"province\":\"浙江\",\n" +
- "\"pcode\":\"ZJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"桂A\",\n" +
- "\"city\":\"南宁\",\n" +
- "\"province\":\"广西\",\n" +
- "\"pcode\":\"GX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"桂B\",\n" +
- "\"city\":\"柳州\",\n" +
- "\"province\":\"广西\",\n" +
- "\"pcode\":\"GX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"桂C\",\n" +
- "\"city\":\"桂林\",\n" +
- "\"province\":\"广西\",\n" +
- "\"pcode\":\"GX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"桂D\",\n" +
- "\"city\":\"梧州\",\n" +
- "\"province\":\"广西\",\n" +
- "\"pcode\":\"GX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"桂E\",\n" +
- "\"city\":\"北海\",\n" +
- "\"province\":\"广西\",\n" +
- "\"pcode\":\"GX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"桂F\",\n" +
- "\"city\":\"崇左\",\n" +
- "\"province\":\"广西\",\n" +
- "\"pcode\":\"GX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"桂G\",\n" +
- "\"city\":\"来宾\",\n" +
- "\"province\":\"广西\",\n" +
- "\"pcode\":\"GX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"桂H\",\n" +
- "\"city\":\"桂林地区\",\n" +
- "\"province\":\"广西\",\n" +
- "\"pcode\":\"GX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"桂J\",\n" +
- "\"city\":\"贺州\",\n" +
- "\"province\":\"广西\",\n" +
- "\"pcode\":\"GX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"桂K\",\n" +
- "\"city\":\"玉林\",\n" +
- "\"province\":\"广西\",\n" +
- "\"pcode\":\"GX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"桂L\",\n" +
- "\"city\":\"百色\",\n" +
- "\"province\":\"广西\",\n" +
- "\"pcode\":\"GX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"桂M\",\n" +
- "\"city\":\"河池\",\n" +
- "\"province\":\"广西\",\n" +
- "\"pcode\":\"GX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"桂N\",\n" +
- "\"city\":\"钦州\",\n" +
- "\"province\":\"广西\",\n" +
- "\"pcode\":\"GX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"桂p\",\n" +
- "\"city\":\"防城港\",\n" +
- "\"province\":\"广西\",\n" +
- "\"pcode\":\"GX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"桂R\",\n" +
- "\"city\":\"贵港\",\n" +
- "\"province\":\"广西\",\n" +
- "\"pcode\":\"GX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"蒙A\",\n" +
- "\"city\":\"呼和浩特\",\n" +
- "\"province\":\"内蒙古\",\n" +
- "\"pcode\":\"NMG\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"蒙B\",\n" +
- "\"city\":\"包头\",\n" +
- "\"province\":\"内蒙古\",\n" +
- "\"pcode\":\"NMG\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"蒙C\",\n" +
- "\"city\":\"乌海\",\n" +
- "\"province\":\"内蒙古\",\n" +
- "\"pcode\":\"NMG\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"蒙D\",\n" +
- "\"city\":\"赤峰\",\n" +
- "\"province\":\"内蒙古\",\n" +
- "\"pcode\":\"NMG\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"蒙E\",\n" +
- "\"city\":\"呼伦贝尔 \",\n" +
- "\"province\":\"内蒙古\",\n" +
- "\"pcode\":\"NMG\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"蒙F\",\n" +
- "\"city\":\"兴安盟\",\n" +
- "\"province\":\"内蒙古\",\n" +
- "\"pcode\":\"NMG\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"蒙G\",\n" +
- "\"city\":\"通辽\",\n" +
- "\"province\":\"内蒙古\",\n" +
- "\"pcode\":\"NMG\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"蒙H\",\n" +
- "\"city\":\"锡林郭勒盟\",\n" +
- "\"province\":\"内蒙古\",\n" +
- "\"pcode\":\"NMG\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"蒙J\",\n" +
- "\"city\":\"乌兰察布盟\",\n" +
- "\"province\":\"内蒙古\",\n" +
- "\"pcode\":\"NMG\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"蒙K\",\n" +
- "\"city\":\"鄂尔多斯 \",\n" +
- "\"province\":\"内蒙古\",\n" +
- "\"pcode\":\"NMG\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"蒙L\",\n" +
- "\"city\":\"巴彦淖尔盟\",\n" +
- "\"province\":\"内蒙古\",\n" +
- "\"pcode\":\"NMG\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"蒙M \",\n" +
- "\"city\":\" 阿拉善盟\",\n" +
- "\"province\":\"内蒙古\",\n" +
- "\"pcode\":\"NMG\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"闽A\",\n" +
- "\"city\":\"福州\",\n" +
- "\"province\":\"福建\",\n" +
- "\"pcode\":\"FJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"闽B\",\n" +
- "\"city\":\"莆田\",\n" +
- "\"province\":\"福建\",\n" +
- "\"pcode\":\"FJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"闽C\",\n" +
- "\"city\":\"泉州\",\n" +
- "\"province\":\"福建\",\n" +
- "\"pcode\":\"FJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"闽D\",\n" +
- "\"city\":\"厦门\",\n" +
- "\"province\":\"福建\",\n" +
- "\"pcode\":\"FJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"闽E\",\n" +
- "\"city\":\"漳州\",\n" +
- "\"province\":\"福建\",\n" +
- "\"pcode\":\"FJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"闽F\",\n" +
- "\"city\":\"龙岩\",\n" +
- "\"province\":\"福建\",\n" +
- "\"pcode\":\"FJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"闽G\",\n" +
- "\"city\":\"三明\",\n" +
- "\"province\":\"福建\",\n" +
- "\"pcode\":\"FJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"闽H\",\n" +
- "\"city\":\"南平\",\n" +
- "\"province\":\"福建\",\n" +
- "\"pcode\":\"FJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"闽J\",\n" +
- "\"city\":\"宁德\",\n" +
- "\"province\":\"福建\",\n" +
- "\"pcode\":\"FJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"闽K\",\n" +
- "\"city\":\"直系统\",\n" +
- "\"province\":\"福建\",\n" +
- "\"pcode\":\"FJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"川A\",\n" +
- "\"city\":\"成都\",\n" +
- "\"province\":\"四川\",\n" +
- "\"pcode\":\"SC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"川B\",\n" +
- "\"city\":\"绵阳\",\n" +
- "\"province\":\"四川\",\n" +
- "\"pcode\":\"SC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"川C\",\n" +
- "\"city\":\"自贡\",\n" +
- "\"province\":\"四川\",\n" +
- "\"pcode\":\"SC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"川D\",\n" +
- "\"city\":\"攀枝花\",\n" +
- "\"province\":\"四川\",\n" +
- "\"pcode\":\"SC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"川E\",\n" +
- "\"city\":\"泸州\",\n" +
- "\"province\":\"四川\",\n" +
- "\"pcode\":\"SC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"川F\",\n" +
- "\"city\":\"德阳\",\n" +
- "\"province\":\"四川\",\n" +
- "\"pcode\":\"SC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"川H\",\n" +
- "\"city\":\"广元\",\n" +
- "\"province\":\"四川\",\n" +
- "\"pcode\":\"SC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"川J\",\n" +
- "\"city\":\"遂宁\",\n" +
- "\"province\":\"四川\",\n" +
- "\"pcode\":\"SC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"川K\",\n" +
- "\"city\":\"内江\",\n" +
- "\"province\":\"四川\",\n" +
- "\"pcode\":\"SC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"川L\",\n" +
- "\"city\":\"乐山\",\n" +
- "\"province\":\"四川\",\n" +
- "\"pcode\":\"SC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"川M\",\n" +
- "\"city\":\"资阳\",\n" +
- "\"province\":\"四川\",\n" +
- "\"pcode\":\"SC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"川Q\",\n" +
- "\"city\":\"宜宾\",\n" +
- "\"province\":\"四川\",\n" +
- "\"pcode\":\"SC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"川R\",\n" +
- "\"city\":\"南充\",\n" +
- "\"province\":\"四川\",\n" +
- "\"pcode\":\"SC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"川S\",\n" +
- "\"city\":\"达州\",\n" +
- "\"province\":\"四川\",\n" +
- "\"pcode\":\"SC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"川T\",\n" +
- "\"city\":\"雅安\",\n" +
- "\"province\":\"四川\",\n" +
- "\"pcode\":\"SC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"川U\",\n" +
- "\"city\":\"阿坝藏族羌族自治州\",\n" +
- "\"province\":\"四川\",\n" +
- "\"pcode\":\"SC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"川V\",\n" +
- "\"city\":\"甘孜藏族自治州\",\n" +
- "\"province\":\"四川\",\n" +
- "\"pcode\":\"SC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"川W\",\n" +
- "\"city\":\"凉山彝族自治州\",\n" +
- "\"province\":\"四川\",\n" +
- "\"pcode\":\"SC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"川X\",\n" +
- "\"city\":\"广安\",\n" +
- "\"province\":\"四川\",\n" +
- "\"pcode\":\"SC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"川Y\",\n" +
- "\"city\":\"巴中\",\n" +
- "\"province\":\"四川\",\n" +
- "\"pcode\":\"SC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"川Z\",\n" +
- "\"city\":\"眉山\",\n" +
- "\"province\":\"四川\",\n" +
- "\"pcode\":\"SC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"渝A\",\n" +
- "\"city\":\"重庆区(江南)\",\n" +
- "\"province\":\"重庆\",\n" +
- "\"pcode\":\"ZQ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"渝B\",\n" +
- "\"city\":\"重庆区(江北)\",\n" +
- "\"province\":\"重庆\",\n" +
- "\"pcode\":\"ZQ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"渝C\",\n" +
- "\"city\":\"永川区\",\n" +
- "\"province\":\"重庆\",\n" +
- "\"pcode\":\"ZQ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"渝F\",\n" +
- "\"city\":\"万州区\",\n" +
- "\"province\":\"重庆\",\n" +
- "\"pcode\":\"ZQ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"渝G\",\n" +
- "\"city\":\"涪陵区\",\n" +
- "\"province\":\"重庆\",\n" +
- "\"pcode\":\"ZQ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"渝H\",\n" +
- "\"city\":\"黔江区\",\n" +
- "\"province\":\"重庆\",\n" +
- "\"pcode\":\"ZQ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"津A\",\n" +
- "\"city\":\"天津\",\n" +
- "\"province\":\"天津\",\n" +
- "\"pcode\":\"TJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"津B\",\n" +
- "\"city\":\"天津\",\n" +
- "\"province\":\"天津\",\n" +
- "\"pcode\":\"TJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"津C\",\n" +
- "\"city\":\"天津\",\n" +
- "\"province\":\"天津\",\n" +
- "\"pcode\":\"TJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"津D\",\n" +
- "\"city\":\"天津\",\n" +
- "\"province\":\"天津\",\n" +
- "\"pcode\":\"TJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"津E\",\n" +
- "\"city\":\"天津\",\n" +
- "\"province\":\"天津\",\n" +
- "\"pcode\":\"TJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"津F\",\n" +
- "\"city\":\"天津\",\n" +
- "\"province\":\"天津\",\n" +
- "\"pcode\":\"TJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"津G\",\n" +
- "\"city\":\"天津\",\n" +
- "\"province\":\"天津\",\n" +
- "\"pcode\":\"TJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"津H\",\n" +
- "\"city\":\"天津\",\n" +
- "\"province\":\"天津\",\n" +
- "\"pcode\":\"TJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"云A\",\n" +
- "\"city\":\"昆明\",\n" +
- "\"province\":\"云南\",\n" +
- "\"pcode\":\"YN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"云A-V\",\n" +
- "\"city\":\"东川\",\n" +
- "\"province\":\"云南\",\n" +
- "\"pcode\":\"YN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"云C\",\n" +
- "\"city\":\"昭通\",\n" +
- "\"province\":\"云南\",\n" +
- "\"pcode\":\"YN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"云D\",\n" +
- "\"city\":\"曲靖\",\n" +
- "\"province\":\"云南\",\n" +
- "\"pcode\":\"YN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"云E\",\n" +
- "\"city\":\"楚雄彝族自治州\",\n" +
- "\"province\":\"云南\",\n" +
- "\"pcode\":\"YN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"云F\",\n" +
- "\"city\":\"玉溪\",\n" +
- "\"province\":\"云南\",\n" +
- "\"pcode\":\"YN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"云G\",\n" +
- "\"city\":\"红河哈尼族彝族自治州\",\n" +
- "\"province\":\"云南\",\n" +
- "\"pcode\":\"YN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"云H\",\n" +
- "\"city\":\"文山壮族苗族自治州\",\n" +
- "\"province\":\"云南\",\n" +
- "\"pcode\":\"YN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"云J\",\n" +
- "\"city\":\"思茅\",\n" +
- "\"province\":\"云南\",\n" +
- "\"pcode\":\"YN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"云K\",\n" +
- "\"city\":\"西双版纳傣族自治州\",\n" +
- "\"province\":\"云南\",\n" +
- "\"pcode\":\"YN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"云L\",\n" +
- "\"city\":\"大理白族自治州\",\n" +
- "\"province\":\"云南\",\n" +
- "\"pcode\":\"YN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"云M\",\n" +
- "\"city\":\"保山\",\n" +
- "\"province\":\"云南\",\n" +
- "\"pcode\":\"YN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"云N\",\n" +
- "\"city\":\"德宏傣族景颇族自治州\",\n" +
- "\"province\":\"云南\",\n" +
- "\"pcode\":\"YN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"云p\",\n" +
- "\"city\":\"丽江\",\n" +
- "\"province\":\"云南\",\n" +
- "\"pcode\":\"YN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"云Q\",\n" +
- "\"city\":\"怒江傈僳族自治州\",\n" +
- "\"province\":\"云南\",\n" +
- "\"pcode\":\"YN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"云R\",\n" +
- "\"city\":\"迪庆藏族自治州\",\n" +
- "\"province\":\"云南\",\n" +
- "\"pcode\":\"YN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"云S\",\n" +
- "\"city\":\"临沧地区\",\n" +
- "\"province\":\"云南\",\n" +
- "\"pcode\":\"YN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"湘A \",\n" +
- "\"city\":\"长沙\",\n" +
- "\"province\":\"湖南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"湘B\",\n" +
- "\"city\":\"株洲\",\n" +
- "\"province\":\"湖南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"湘C\",\n" +
- "\"city\":\"湘潭\",\n" +
- "\"province\":\"湖南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"湘D\",\n" +
- "\"city\":\"衡阳\",\n" +
- "\"province\":\"湖南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"湘E\",\n" +
- "\"city\":\"邵阳\",\n" +
- "\"province\":\"湖南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"湘F\",\n" +
- "\"city\":\"岳阳\",\n" +
- "\"province\":\"湖南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"湘G\",\n" +
- "\"city\":\"张家界\",\n" +
- "\"province\":\"湖南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"湘H\",\n" +
- "\"city\":\"益阳\",\n" +
- "\"province\":\"湖南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"湘J\",\n" +
- "\"city\":\"常德\",\n" +
- "\"province\":\"湖南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"湘K\",\n" +
- "\"city\":\"娄底\",\n" +
- "\"province\":\"湖南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"湘L\",\n" +
- "\"city\":\"郴州\",\n" +
- "\"province\":\"湖南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"湘M\",\n" +
- "\"city\":\"永州\",\n" +
- "\"province\":\"湖南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"湘N\",\n" +
- "\"city\":\"怀化\",\n" +
- "\"province\":\"湖南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"湘U\",\n" +
- "\"city\":\"湘西土家族苗族自治州\",\n" +
- "\"province\":\"湖南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"新A\",\n" +
- "\"city\":\"乌鲁木齐\",\n" +
- "\"province\":\"新疆\",\n" +
- "\"pcode\":\"XJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"新B\",\n" +
- "\"city\":\"昌吉回族自治州\",\n" +
- "\"province\":\"新疆\",\n" +
- "\"pcode\":\"XJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"新C\",\n" +
- "\"city\":\"石河子\",\n" +
- "\"province\":\"新疆\",\n" +
- "\"pcode\":\"XJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"新D\",\n" +
- "\"city\":\"奎屯\",\n" +
- "\"province\":\"新疆\",\n" +
- "\"pcode\":\"XJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"新E\",\n" +
- "\"city\":\"博尔塔拉蒙古自治州\",\n" +
- "\"province\":\"新疆\",\n" +
- "\"pcode\":\"XJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"新F\",\n" +
- "\"city\":\"伊犁哈萨克自治州直辖县\",\n" +
- "\"province\":\"新疆\",\n" +
- "\"pcode\":\"XJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"新G\",\n" +
- "\"city\":\"塔城\",\n" +
- "\"province\":\"新疆\",\n" +
- "\"pcode\":\"XJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"新H\",\n" +
- "\"city\":\"阿勒泰\",\n" +
- "\"province\":\"新疆\",\n" +
- "\"pcode\":\"XJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"新J\",\n" +
- "\"city\":\"克拉玛依\",\n" +
- "\"province\":\"新疆\",\n" +
- "\"pcode\":\"XJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"新K\",\n" +
- "\"city\":\"吐鲁番\",\n" +
- "\"province\":\"新疆\",\n" +
- "\"pcode\":\"XJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"新L\",\n" +
- "\"city\":\"哈密\",\n" +
- "\"province\":\"新疆\",\n" +
- "\"pcode\":\"XJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"新M\",\n" +
- "\"city\":\"巴音郭愣蒙古自治州\",\n" +
- "\"province\":\"新疆\",\n" +
- "\"pcode\":\"XJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"新N\",\n" +
- "\"city\":\"阿克苏\",\n" +
- "\"province\":\"新疆\",\n" +
- "\"pcode\":\"XJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"新p\",\n" +
- "\"city\":\"克孜勒苏柯尔克孜自治州\",\n" +
- "\"province\":\"新疆\",\n" +
- "\"pcode\":\"XJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"新Q\",\n" +
- "\"city\":\"喀什\",\n" +
- "\"province\":\"新疆\",\n" +
- "\"pcode\":\"XJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"新R\",\n" +
- "\"city\":\"和田\",\n" +
- "\"province\":\"新疆\",\n" +
- "\"pcode\":\"XJ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"赣A\",\n" +
- "\"city\":\"南昌\",\n" +
- "\"province\":\"江西\",\n" +
- "\"pcode\":\"JX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"赣B\",\n" +
- "\"city\":\"赣州\",\n" +
- "\"province\":\"江西\",\n" +
- "\"pcode\":\"JX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"赣C\",\n" +
- "\"city\":\"宜春\",\n" +
- "\"province\":\"江西\",\n" +
- "\"pcode\":\"JX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"赣D\",\n" +
- "\"city\":\"吉安\",\n" +
- "\"province\":\"江西\",\n" +
- "\"pcode\":\"JX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"赣E\",\n" +
- "\"city\":\"上饶\",\n" +
- "\"province\":\"江西\",\n" +
- "\"pcode\":\"JX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"赣F\",\n" +
- "\"city\":\"抚州\",\n" +
- "\"province\":\"江西\",\n" +
- "\"pcode\":\"JX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"赣G\",\n" +
- "\"city\":\"九江\",\n" +
- "\"province\":\"江西\",\n" +
- "\"pcode\":\"JX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"赣H\",\n" +
- "\"city\":\"景德镇\",\n" +
- "\"province\":\"江西\",\n" +
- "\"pcode\":\"JX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"赣J\",\n" +
- "\"city\":\"萍乡\",\n" +
- "\"province\":\"江西\",\n" +
- "\"pcode\":\"JX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"赣K\",\n" +
- "\"city\":\"新余\",\n" +
- "\"province\":\"江西\",\n" +
- "\"pcode\":\"JX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"赣L\",\n" +
- "\"city\":\"鹰潭\",\n" +
- "\"province\":\"江西\",\n" +
- "\"pcode\":\"JX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"赣M\",\n" +
- "\"city\":\"南昌,直系统\",\n" +
- "\"province\":\"江西\",\n" +
- "\"pcode\":\"JX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"甘A\",\n" +
- "\"city\":\"兰州\",\n" +
- "\"province\":\"甘肃\",\n" +
- "\"pcode\":\"GS\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"甘B\",\n" +
- "\"city\":\"嘉峪关\",\n" +
- "\"province\":\"甘肃\",\n" +
- "\"pcode\":\"GS\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"甘C\",\n" +
- "\"city\":\"金昌\",\n" +
- "\"province\":\"甘肃\",\n" +
- "\"pcode\":\"GS\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"甘D\",\n" +
- "\"city\":\"白银\",\n" +
- "\"province\":\"甘肃\",\n" +
- "\"pcode\":\"GS\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"甘E\",\n" +
- "\"city\":\"天水\",\n" +
- "\"province\":\"甘肃\",\n" +
- "\"pcode\":\"GS\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"甘F\",\n" +
- "\"city\":\"酒泉\",\n" +
- "\"province\":\"甘肃\",\n" +
- "\"pcode\":\"GS\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"甘G\",\n" +
- "\"city\":\"张掖\",\n" +
- "\"province\":\"甘肃\",\n" +
- "\"pcode\":\"GS\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"甘H\",\n" +
- "\"city\":\"武威\",\n" +
- "\"province\":\"甘肃\",\n" +
- "\"pcode\":\"GS\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"甘J\",\n" +
- "\"city\":\"定西\",\n" +
- "\"province\":\"甘肃\",\n" +
- "\"pcode\":\"GS\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"甘K\",\n" +
- "\"city\":\"陇南\",\n" +
- "\"province\":\"甘肃\",\n" +
- "\"pcode\":\"GS\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"甘L\",\n" +
- "\"city\":\"平凉\",\n" +
- "\"province\":\"甘肃\",\n" +
- "\"pcode\":\"GS\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"甘M\",\n" +
- "\"city\":\"庆阳\",\n" +
- "\"province\":\"甘肃\",\n" +
- "\"pcode\":\"GS\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"甘N\",\n" +
- "\"city\":\"临夏回族自治州\",\n" +
- "\"province\":\"甘肃\",\n" +
- "\"pcode\":\"GS\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"甘p\",\n" +
- "\"city\":\"甘南藏族自治州\",\n" +
- "\"province\":\"甘肃\",\n" +
- "\"pcode\":\"GS\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"陕A\",\n" +
- "\"city\":\"西安\",\n" +
- "\"province\":\"陕西\",\n" +
- "\"pcode\":\"SX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"陕B\",\n" +
- "\"city\":\"铜川\",\n" +
- "\"province\":\"陕西\",\n" +
- "\"pcode\":\"SX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"陕C\",\n" +
- "\"city\":\"宝鸡\",\n" +
- "\"province\":\"陕西\",\n" +
- "\"pcode\":\"SX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"陕D\",\n" +
- "\"city\":\"咸阳\",\n" +
- "\"province\":\"陕西\",\n" +
- "\"pcode\":\"SX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"陕E\",\n" +
- "\"city\":\"渭南\",\n" +
- "\"province\":\"陕西\",\n" +
- "\"pcode\":\"SX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"陕F\",\n" +
- "\"city\":\"汉中\",\n" +
- "\"province\":\"陕西\",\n" +
- "\"pcode\":\"SX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"陕G\",\n" +
- "\"city\":\"安康\",\n" +
- "\"province\":\"陕西\",\n" +
- "\"pcode\":\"SX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"陕H\",\n" +
- "\"city\":\"商洛\",\n" +
- "\"province\":\"陕西\",\n" +
- "\"pcode\":\"SX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"陕J\",\n" +
- "\"city\":\"延安\",\n" +
- "\"province\":\"陕西\",\n" +
- "\"pcode\":\"SX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"陕K\",\n" +
- "\"city\":\"榆林\",\n" +
- "\"province\":\"陕西\",\n" +
- "\"pcode\":\"SX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"陕V\",\n" +
- "\"city\":\"杨凌高新农业示范区\",\n" +
- "\"province\":\"陕西\",\n" +
- "\"pcode\":\"SX\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"贵A\",\n" +
- "\"city\":\"贵阳\",\n" +
- "\"province\":\"贵州\",\n" +
- "\"pcode\":\"GZ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"贵B\",\n" +
- "\"city\":\"六盘水\",\n" +
- "\"province\":\"贵州\",\n" +
- "\"pcode\":\"GZ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"贵C\",\n" +
- "\"city\":\"遵义\",\n" +
- "\"province\":\"贵州\",\n" +
- "\"pcode\":\"GZ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"贵D\",\n" +
- "\"city\":\"铜仁\",\n" +
- "\"province\":\"贵州\",\n" +
- "\"pcode\":\"GZ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"贵E\",\n" +
- "\"city\":\"黔西南布依族苗族自治州\",\n" +
- "\"province\":\"贵州\",\n" +
- "\"pcode\":\"GZ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"贵F\",\n" +
- "\"city\":\"毕节\",\n" +
- "\"province\":\"贵州\",\n" +
- "\"pcode\":\"GZ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"贵G\",\n" +
- "\"city\":\"安顺\",\n" +
- "\"province\":\"贵州\",\n" +
- "\"pcode\":\"GZ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"贵H\",\n" +
- "\"city\":\"黔东南苗族侗族自治州\",\n" +
- "\"province\":\"贵州\",\n" +
- "\"pcode\":\"GZ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"贵J\",\n" +
- "\"city\":\"黔南布依族苗族自治州\",\n" +
- "\"province\":\"贵州\",\n" +
- "\"pcode\":\"GZ\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"青A\",\n" +
- "\"city\":\"西宁\",\n" +
- "\"province\":\"青海\",\n" +
- "\"pcode\":\"QH\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"青B\",\n" +
- "\"city\":\"海东\",\n" +
- "\"province\":\"青海\",\n" +
- "\"pcode\":\"QH\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"青C\",\n" +
- "\"city\":\"海北藏族自治州\",\n" +
- "\"province\":\"青海\",\n" +
- "\"pcode\":\"QH\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"青D\",\n" +
- "\"city\":\"黄南藏族自治州\",\n" +
- "\"province\":\"青海\",\n" +
- "\"pcode\":\"QH\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"青E\",\n" +
- "\"city\":\"藏族自治州\",\n" +
- "\"province\":\"青海\",\n" +
- "\"pcode\":\"QH\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"青F\",\n" +
- "\"city\":\"果洛藏族自治州\",\n" +
- "\"province\":\"青海\",\n" +
- "\"pcode\":\"QH\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"青G\",\n" +
- "\"city\":\"玉树藏族自治州\",\n" +
- "\"province\":\"青海\",\n" +
- "\"pcode\":\"QH\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"青H\",\n" +
- "\"city\":\"海西蒙古族藏族自治州\",\n" +
- "\"province\":\"青海\",\n" +
- "\"pcode\":\"QH\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"藏A\",\n" +
- "\"city\":\"拉萨\",\n" +
- "\"province\":\"西藏\",\n" +
- "\"pcode\":\"XC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"藏B\",\n" +
- "\"city\":\"昌都地区\",\n" +
- "\"province\":\"西藏\",\n" +
- "\"pcode\":\"XC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"藏C\",\n" +
- "\"city\":\"山南地区\",\n" +
- "\"province\":\"西藏\",\n" +
- "\"pcode\":\"XC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"藏D\",\n" +
- "\"city\":\"日喀则地区\",\n" +
- "\"province\":\"西藏\",\n" +
- "\"pcode\":\"XC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"藏E\",\n" +
- "\"city\":\"那曲地区\",\n" +
- "\"province\":\"西藏\",\n" +
- "\"pcode\":\"XC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"藏F\",\n" +
- "\"city\":\"阿里地区\",\n" +
- "\"province\":\"西藏\",\n" +
- "\"pcode\":\"XC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"藏G\",\n" +
- "\"city\":\"林芝地区\",\n" +
- "\"province\":\"西藏\",\n" +
- "\"pcode\":\"XC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"藏H\",\n" +
- "\"city\":\"天全县车辆管理所\",\n" +
- "\"province\":\"西藏\",\n" +
- "\"pcode\":\"XC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"藏J\",\n" +
- "\"city\":\"格尔木车辆管理所\",\n" +
- "\"province\":\"西藏\",\n" +
- "\"pcode\":\"XC\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"琼A\",\n" +
- "\"city\":\"海口\",\n" +
- "\"province\":\"海南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"琼B\",\n" +
- "\"city\":\"三亚\",\n" +
- "\"province\":\"海南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"琼C\",\n" +
- "\"city\":\"琼海\",\n" +
- "\"province\":\"海南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"琼D\",\n" +
- "\"city\":\"五指山\",\n" +
- "\"province\":\"海南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"琼E\",\n" +
- "\"city\":\"洋浦开发区\",\n" +
- "\"province\":\"海南\",\n" +
- "\"pcode\":\"HN\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"沪A\",\n" +
- "\"city\":\"上海\",\n" +
- "\"province\":\"上海\",\n" +
- "\"pcode\":\"SH\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"沪B\",\n" +
- "\"city\":\"上海\",\n" +
- "\"province\":\"上海\",\n" +
- "\"pcode\":\"SH\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"沪C\",\n" +
- "\"city\":\"上海\",\n" +
- "\"province\":\"上海\",\n" +
- "\"pcode\":\"SH\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"沪D\",\n" +
- "\"city\":\"上海\",\n" +
- "\"province\":\"上海\",\n" +
- "\"pcode\":\"SH\"\n" +
- "},\n" +
- "{\n" +
- "\"code\":\"沪R\",\n" +
- "\"city\":\"崇明、长兴、横沙\",\n" +
- "\"province\":\"上海\",\n" +
- "\"pcode\":\"SH\"\n" +
+ String jsonStr ="{\n" +
+ " \"codeInfo\": [\n" +
+ " {\n" +
+ " \"Hp\": \"冀A\",\n" +
+ " \"city\": \"石家庄\",\n" +
+ " \"province\": \"河北\",\n" +
+ " \"Pcode\": \"HB\",\n" +
+ " \"AreaCode\": \"130100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"冀B\",\n" +
+ " \"city\": \"唐山\",\n" +
+ " \"province\": \"河北\",\n" +
+ " \"Pcode\": \"HB\",\n" +
+ " \"AreaCode\": \"130200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"冀C\",\n" +
+ " \"city\": \"秦皇岛\",\n" +
+ " \"province\": \"河北\",\n" +
+ " \"Pcode\": \"HB\",\n" +
+ " \"AreaCode\": \"130300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"冀D\",\n" +
+ " \"city\": \"邯郸\",\n" +
+ " \"province\": \"河北\",\n" +
+ " \"Pcode\": \"HB\",\n" +
+ " \"AreaCode\": \"130421\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"冀E\",\n" +
+ " \"city\": \"邢台\",\n" +
+ " \"province\": \"河北\",\n" +
+ " \"Pcode\": \"HB\",\n" +
+ " \"AreaCode\": \"130521\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"冀F\",\n" +
+ " \"city\": \"保定\",\n" +
+ " \"province\": \"河北\",\n" +
+ " \"Pcode\": \"HB\",\n" +
+ " \"AreaCode\": \"130600\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"冀G\",\n" +
+ " \"city\": \"张家口\",\n" +
+ " \"province\": \"河北\",\n" +
+ " \"Pcode\": \"HB\",\n" +
+ " \"AreaCode\": \"130700\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"冀H\",\n" +
+ " \"city\": \"承德\",\n" +
+ " \"province\": \"河北\",\n" +
+ " \"Pcode\": \"HB\",\n" +
+ " \"AreaCode\": \"130821\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"冀J\",\n" +
+ " \"city\": \"沧州\",\n" +
+ " \"province\": \"河北\",\n" +
+ " \"Pcode\": \"HB\",\n" +
+ " \"AreaCode\": \"130900\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"冀R\",\n" +
+ " \"city\": \"廊坊\",\n" +
+ " \"province\": \"河北\",\n" +
+ " \"Pcode\": \"HB\",\n" +
+ " \"AreaCode\": \"131000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"冀S\",\n" +
+ " \"city\": \"沧州\",\n" +
+ " \"province\": \"河北\",\n" +
+ " \"Pcode\": \"HB\",\n" +
+ " \"AreaCode\": \"130900\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"冀T\",\n" +
+ " \"city\": \"衡水\",\n" +
+ " \"province\": \"河北\",\n" +
+ " \"Pcode\": \"HB\",\n" +
+ " \"AreaCode\": \"131100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"辽A\",\n" +
+ " \"city\": \"沈阳\",\n" +
+ " \"province\": \"辽宁\",\n" +
+ " \"Pcode\": \"LN\",\n" +
+ " \"AreaCode\": \"210100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"辽B\",\n" +
+ " \"city\": \"大连\",\n" +
+ " \"province\": \"辽宁\",\n" +
+ " \"Pcode\": \"LN\",\n" +
+ " \"AreaCode\": \"231182\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"辽C\",\n" +
+ " \"city\": \"鞍山\",\n" +
+ " \"province\": \"辽宁\",\n" +
+ " \"Pcode\": \"LN\",\n" +
+ " \"AreaCode\": \"340500\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"辽D\",\n" +
+ " \"city\": \"抚顺\",\n" +
+ " \"province\": \"辽宁\",\n" +
+ " \"Pcode\": \"LN\",\n" +
+ " \"AreaCode\": \"210421\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"辽E\",\n" +
+ " \"city\": \"本溪\",\n" +
+ " \"province\": \"辽宁\",\n" +
+ " \"Pcode\": \"LN\",\n" +
+ " \"AreaCode\": \"210521\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"辽F\",\n" +
+ " \"city\": \"丹东\",\n" +
+ " \"province\": \"辽宁\",\n" +
+ " \"Pcode\": \"LN\",\n" +
+ " \"AreaCode\": \"210600\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"辽G\",\n" +
+ " \"city\": \"锦州\",\n" +
+ " \"province\": \"辽宁\",\n" +
+ " \"Pcode\": \"LN\",\n" +
+ " \"AreaCode\": \"210700\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"辽H\",\n" +
+ " \"city\": \"营口\",\n" +
+ " \"province\": \"辽宁\",\n" +
+ " \"Pcode\": \"LN\",\n" +
+ " \"AreaCode\": \"210800\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"辽J\",\n" +
+ " \"city\": \"阜新\",\n" +
+ " \"province\": \"辽宁\",\n" +
+ " \"Pcode\": \"LN\",\n" +
+ " \"AreaCode\": \"210921\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"辽K\",\n" +
+ " \"city\": \"辽阳\",\n" +
+ " \"province\": \"辽宁\",\n" +
+ " \"Pcode\": \"LN\",\n" +
+ " \"AreaCode\": \"211021\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"辽L\",\n" +
+ " \"city\": \"盘锦\",\n" +
+ " \"province\": \"辽宁\",\n" +
+ " \"Pcode\": \"LN\",\n" +
+ " \"AreaCode\": \"211100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"辽M\",\n" +
+ " \"city\": \"铁岭\",\n" +
+ " \"province\": \"辽宁\",\n" +
+ " \"Pcode\": \"LN\",\n" +
+ " \"AreaCode\": \"211221\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"辽N\",\n" +
+ " \"city\": \"朝阳\",\n" +
+ " \"province\": \"辽宁\",\n" +
+ " \"Pcode\": \"LN\",\n" +
+ " \"AreaCode\": \"220104\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"辽P\",\n" +
+ " \"city\": \"葫芦岛\",\n" +
+ " \"province\": \"辽宁\",\n" +
+ " \"Pcode\": \"LN\",\n" +
+ " \"AreaCode\": \"211400\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"皖A\",\n" +
+ " \"city\": \"合肥\",\n" +
+ " \"province\": \"安徽\",\n" +
+ " \"Pcode\": \"AH\",\n" +
+ " \"AreaCode\": \"340100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"皖B\",\n" +
+ " \"city\": \"芜湖\",\n" +
+ " \"province\": \"安徽\",\n" +
+ " \"Pcode\": \"AH\",\n" +
+ " \"AreaCode\": \"340221\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"皖C\",\n" +
+ " \"city\": \"蚌埠\",\n" +
+ " \"province\": \"安徽\",\n" +
+ " \"Pcode\": \"AH\",\n" +
+ " \"AreaCode\": \"340300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"皖D\",\n" +
+ " \"city\": \"淮南\",\n" +
+ " \"province\": \"安徽\",\n" +
+ " \"Pcode\": \"AH\",\n" +
+ " \"AreaCode\": \"340400\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"皖E\",\n" +
+ " \"city\": \"马鞍山\",\n" +
+ " \"province\": \"安徽\",\n" +
+ " \"Pcode\": \"AH\",\n" +
+ " \"AreaCode\": \"340500\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"皖F\",\n" +
+ " \"city\": \"淮北\",\n" +
+ " \"province\": \"安徽\",\n" +
+ " \"Pcode\": \"AH\",\n" +
+ " \"AreaCode\": \"340600\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"皖G\",\n" +
+ " \"city\": \"铜陵\",\n" +
+ " \"province\": \"安徽\",\n" +
+ " \"Pcode\": \"AH\",\n" +
+ " \"AreaCode\": \"340700\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"皖H\",\n" +
+ " \"city\": \"安庆\",\n" +
+ " \"province\": \"安徽\",\n" +
+ " \"Pcode\": \"AH\",\n" +
+ " \"AreaCode\": \"340800\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"皖J\",\n" +
+ " \"city\": \"黄山\",\n" +
+ " \"province\": \"安徽\",\n" +
+ " \"Pcode\": \"AH\",\n" +
+ " \"AreaCode\": \"341003\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"皖K\",\n" +
+ " \"city\": \"阜阳\",\n" +
+ " \"province\": \"安徽\",\n" +
+ " \"Pcode\": \"AH\",\n" +
+ " \"AreaCode\": \"341200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"皖L\",\n" +
+ " \"city\": \"宿州\",\n" +
+ " \"province\": \"安徽\",\n" +
+ " \"Pcode\": \"AH\",\n" +
+ " \"AreaCode\": \"341300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"皖M\",\n" +
+ " \"city\": \"滁州\",\n" +
+ " \"province\": \"安徽\",\n" +
+ " \"Pcode\": \"AH\",\n" +
+ " \"AreaCode\": \"341100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"皖N\",\n" +
+ " \"city\": \"六安\",\n" +
+ " \"province\": \"安徽\",\n" +
+ " \"Pcode\": \"AH\",\n" +
+ " \"AreaCode\": \"341500\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"皖P\",\n" +
+ " \"city\": \"宣城\",\n" +
+ " \"province\": \"安徽\",\n" +
+ " \"Pcode\": \"AH\",\n" +
+ " \"AreaCode\": \"341800\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"皖Q\",\n" +
+ " \"city\": \"巢湖\",\n" +
+ " \"province\": \"安徽\",\n" +
+ " \"Pcode\": \"AH\",\n" +
+ " \"AreaCode\": \"340181\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"皖R\",\n" +
+ " \"city\": \"池州\",\n" +
+ " \"province\": \"安徽\",\n" +
+ " \"Pcode\": \"AH\",\n" +
+ " \"AreaCode\": \"341700\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"皖S\",\n" +
+ " \"city\": \"亳州\",\n" +
+ " \"province\": \"安徽\",\n" +
+ " \"Pcode\": \"AH\",\n" +
+ " \"AreaCode\": \"341600\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"苏A\",\n" +
+ " \"city\": \"南京\",\n" +
+ " \"province\": \"江苏\",\n" +
+ " \"Pcode\": \"JS\",\n" +
+ " \"AreaCode\": \"320100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"苏B\",\n" +
+ " \"city\": \"无锡\",\n" +
+ " \"province\": \"江苏\",\n" +
+ " \"Pcode\": \"JS\",\n" +
+ " \"AreaCode\": \"320200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"苏C\",\n" +
+ " \"city\": \"徐州\",\n" +
+ " \"province\": \"江苏\",\n" +
+ " \"Pcode\": \"JS\",\n" +
+ " \"AreaCode\": \"320300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"苏D\",\n" +
+ " \"city\": \"常州\",\n" +
+ " \"province\": \"江苏\",\n" +
+ " \"Pcode\": \"JS\",\n" +
+ " \"AreaCode\": \"320400\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"苏E\",\n" +
+ " \"city\": \"苏州\",\n" +
+ " \"province\": \"江苏\",\n" +
+ " \"Pcode\": \"JS\",\n" +
+ " \"AreaCode\": \"320500\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"苏F\",\n" +
+ " \"city\": \"南通\",\n" +
+ " \"province\": \"江苏\",\n" +
+ " \"Pcode\": \"JS\",\n" +
+ " \"AreaCode\": \"320600\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"苏G\",\n" +
+ " \"city\": \"连云港\",\n" +
+ " \"province\": \"江苏\",\n" +
+ " \"Pcode\": \"JS\",\n" +
+ " \"AreaCode\": \"320700\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"苏H\",\n" +
+ " \"city\": \"淮安\",\n" +
+ " \"province\": \"江苏\",\n" +
+ " \"Pcode\": \"JS\",\n" +
+ " \"AreaCode\": \"320803\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"苏J\",\n" +
+ " \"city\": \"盐城\",\n" +
+ " \"province\": \"江苏\",\n" +
+ " \"Pcode\": \"JS\",\n" +
+ " \"AreaCode\": \"320900\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"苏K\",\n" +
+ " \"city\": \"扬州\",\n" +
+ " \"province\": \"江苏\",\n" +
+ " \"Pcode\": \"JS\",\n" +
+ " \"AreaCode\": \"321000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"苏L\",\n" +
+ " \"city\": \"镇江\",\n" +
+ " \"province\": \"江苏\",\n" +
+ " \"Pcode\": \"JS\",\n" +
+ " \"AreaCode\": \"321100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"苏M\",\n" +
+ " \"city\": \"泰州\",\n" +
+ " \"province\": \"江苏\",\n" +
+ " \"Pcode\": \"JS\",\n" +
+ " \"AreaCode\": \"321200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"苏N\",\n" +
+ " \"city\": \"宿迁\",\n" +
+ " \"province\": \"江苏\",\n" +
+ " \"Pcode\": \"JS\",\n" +
+ " \"AreaCode\": \"321300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鄂A\",\n" +
+ " \"city\": \"武汉\",\n" +
+ " \"province\": \"湖北\",\n" +
+ " \"Pcode\": \"HB\",\n" +
+ " \"AreaCode\": \"420100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鄂B\",\n" +
+ " \"city\": \"黄石\",\n" +
+ " \"province\": \"湖北\",\n" +
+ " \"Pcode\": \"HB\",\n" +
+ " \"AreaCode\": \"420202\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鄂C\",\n" +
+ " \"city\": \"十堰\",\n" +
+ " \"province\": \"湖北\",\n" +
+ " \"Pcode\": \"HB\",\n" +
+ " \"AreaCode\": \"420300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鄂D\",\n" +
+ " \"city\": \"荆州\",\n" +
+ " \"province\": \"湖北\",\n" +
+ " \"Pcode\": \"HB\",\n" +
+ " \"AreaCode\": \"421003\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鄂E\",\n" +
+ " \"city\": \"宜昌\",\n" +
+ " \"province\": \"湖北\",\n" +
+ " \"Pcode\": \"HB\",\n" +
+ " \"AreaCode\": \"420500\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鄂F\",\n" +
+ " \"city\": \"襄阳\",\n" +
+ " \"province\": \"湖北\",\n" +
+ " \"Pcode\": \"HB\",\n" +
+ " \"AreaCode\": \"420600\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鄂G\",\n" +
+ " \"city\": \"鄂州\",\n" +
+ " \"province\": \"湖北\",\n" +
+ " \"Pcode\": \"HB\",\n" +
+ " \"AreaCode\": \"420700\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鄂H\",\n" +
+ " \"city\": \"荆门 \",\n" +
+ " \"province\": \"湖北\",\n" +
+ " \"Pcode\": \"HB\",\n" +
+ " \"AreaCode\": \"420800\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鄂J\",\n" +
+ " \"city\": \"黄冈\",\n" +
+ " \"province\": \"湖北\",\n" +
+ " \"Pcode\": \"HB\",\n" +
+ " \"AreaCode\": \"421100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鄂K\",\n" +
+ " \"city\": \"孝感\",\n" +
+ " \"province\": \"湖北\",\n" +
+ " \"Pcode\": \"HB\",\n" +
+ " \"AreaCode\": \"420900\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鄂L\",\n" +
+ " \"city\": \"咸宁\",\n" +
+ " \"province\": \"湖北\",\n" +
+ " \"Pcode\": \"HB\",\n" +
+ " \"AreaCode\": \"421200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鄂M\",\n" +
+ " \"city\": \"仙桃\",\n" +
+ " \"province\": \"湖北\",\n" +
+ " \"Pcode\": \"HB\",\n" +
+ " \"AreaCode\": \"429004\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鄂N\",\n" +
+ " \"city\": \"潜江\",\n" +
+ " \"province\": \"湖北\",\n" +
+ " \"Pcode\": \"HB\",\n" +
+ " \"AreaCode\": \"429005\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鄂P\",\n" +
+ " \"city\": \"神农架林区\",\n" +
+ " \"province\": \"湖北\",\n" +
+ " \"Pcode\": \"HB\",\n" +
+ " \"AreaCode\": \"429021\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鄂Q\",\n" +
+ " \"city\": \"恩施土家族苗族自治州\",\n" +
+ " \"province\": \"湖北\",\n" +
+ " \"Pcode\": \"HB\",\n" +
+ " \"AreaCode\": \"422800\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鄂R\",\n" +
+ " \"city\": \"天门\",\n" +
+ " \"province\": \"湖北\",\n" +
+ " \"Pcode\": \"HB\",\n" +
+ " \"AreaCode\": \"429006\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鄂S\",\n" +
+ " \"city\": \"随州\",\n" +
+ " \"province\": \"湖北\",\n" +
+ " \"Pcode\": \"HB\",\n" +
+ " \"AreaCode\": \"421300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"晋A\",\n" +
+ " \"city\": \"太原\",\n" +
+ " \"province\": \"山西\",\n" +
+ " \"Pcode\": \"SX\",\n" +
+ " \"AreaCode\": \"140100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"晋B\",\n" +
+ " \"city\": \"大同\",\n" +
+ " \"province\": \"山西\",\n" +
+ " \"Pcode\": \"SX\",\n" +
+ " \"AreaCode\": \"230606\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"晋C\",\n" +
+ " \"city\": \"阳泉\",\n" +
+ " \"province\": \"山西\",\n" +
+ " \"Pcode\": \"SX\",\n" +
+ " \"AreaCode\": \"140300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"晋D\",\n" +
+ " \"city\": \"长治\",\n" +
+ " \"province\": \"山西\",\n" +
+ " \"Pcode\": \"SX\",\n" +
+ " \"AreaCode\": \"140421\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"晋E\",\n" +
+ " \"city\": \"晋城\",\n" +
+ " \"province\": \"山西\",\n" +
+ " \"Pcode\": \"SX\",\n" +
+ " \"AreaCode\": \"140500\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"晋F\",\n" +
+ " \"city\": \"朔州\",\n" +
+ " \"province\": \"山西\",\n" +
+ " \"Pcode\": \"SX\",\n" +
+ " \"AreaCode\": \"140600\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"晋H\",\n" +
+ " \"city\": \"忻州\",\n" +
+ " \"province\": \"山西\",\n" +
+ " \"Pcode\": \"SX\",\n" +
+ " \"AreaCode\": \"140900\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"晋J\",\n" +
+ " \"city\": \"吕梁\",\n" +
+ " \"province\": \"山西\",\n" +
+ " \"Pcode\": \"SX\",\n" +
+ " \"AreaCode\": \"141100 \"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"晋K\",\n" +
+ " \"city\": \"晋中\",\n" +
+ " \"province\": \"山西\",\n" +
+ " \"Pcode\": \"SX\",\n" +
+ " \"AreaCode\": \"140700\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"晋L\",\n" +
+ " \"city\": \"临汾\",\n" +
+ " \"province\": \"山西\",\n" +
+ " \"Pcode\": \"SX\",\n" +
+ " \"AreaCode\": \"141000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"晋M\",\n" +
+ " \"city\": \"运城\",\n" +
+ " \"province\": \"山西\",\n" +
+ " \"Pcode\": \"SX\",\n" +
+ " \"AreaCode\": \"140800\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"吉A\",\n" +
+ " \"city\": \"长春\",\n" +
+ " \"province\": \"吉林\",\n" +
+ " \"Pcode\": \"JL\",\n" +
+ " \"AreaCode\": \"220100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"吉B\",\n" +
+ " \"city\": \"吉林\",\n" +
+ " \"province\": \"吉林\",\n" +
+ " \"Pcode\": \"JL\",\n" +
+ " \"AreaCode\": \"220200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"吉C\",\n" +
+ " \"city\": \"四平\",\n" +
+ " \"province\": \"吉林\",\n" +
+ " \"Pcode\": \"JL\",\n" +
+ " \"AreaCode\": \"220300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"吉D\",\n" +
+ " \"city\": \"辽源\",\n" +
+ " \"province\": \"吉林\",\n" +
+ " \"Pcode\": \"JL\",\n" +
+ " \"AreaCode\": \"220400\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"吉E\",\n" +
+ " \"city\": \"通化\",\n" +
+ " \"province\": \"吉林\",\n" +
+ " \"Pcode\": \"JL\",\n" +
+ " \"AreaCode\": \"220521\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"吉F\",\n" +
+ " \"city\": \"白山\",\n" +
+ " \"province\": \"吉林\",\n" +
+ " \"Pcode\": \"JL\",\n" +
+ " \"AreaCode\": \"220600\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"吉G\",\n" +
+ " \"city\": \"白城\",\n" +
+ " \"province\": \"吉林\",\n" +
+ " \"Pcode\": \"JL\",\n" +
+ " \"AreaCode\": \"220800\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"吉H\",\n" +
+ " \"city\": \"延边朝鲜族自治州\",\n" +
+ " \"province\": \"吉林\",\n" +
+ " \"Pcode\": \"JL\",\n" +
+ " \"AreaCode\": \"222400\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"吉J\",\n" +
+ " \"city\": \"松原\",\n" +
+ " \"province\": \"吉林\",\n" +
+ " \"Pcode\": \"JL\",\n" +
+ " \"AreaCode\": \"220700\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"吉K\",\n" +
+ " \"city\": \"长白山\",\n" +
+ " \"province\": \"吉林\",\n" +
+ " \"Pcode\": \"JL\",\n" +
+ " \"AreaCode\": null\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"粤A\",\n" +
+ " \"city\": \"广州\",\n" +
+ " \"province\": \"广东\",\n" +
+ " \"Pcode\": \"GD\",\n" +
+ " \"AreaCode\": \"440100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"粤B\",\n" +
+ " \"city\": \"深圳\",\n" +
+ " \"province\": \"广东\",\n" +
+ " \"Pcode\": \"GD\",\n" +
+ " \"AreaCode\": \"440300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"粤C\",\n" +
+ " \"city\": \"珠海\",\n" +
+ " \"province\": \"广东\",\n" +
+ " \"Pcode\": \"GD\",\n" +
+ " \"AreaCode\": \"440400\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"粤D\",\n" +
+ " \"city\": \"汕头\",\n" +
+ " \"province\": \"广东\",\n" +
+ " \"Pcode\": \"GD\",\n" +
+ " \"AreaCode\": \"440500\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"粤E\",\n" +
+ " \"city\": \"佛山\",\n" +
+ " \"province\": \"广东\",\n" +
+ " \"Pcode\": \"GD\",\n" +
+ " \"AreaCode\": \"440600\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"粤F\",\n" +
+ " \"city\": \"韶关\",\n" +
+ " \"province\": \"广东\",\n" +
+ " \"Pcode\": \"GD\",\n" +
+ " \"AreaCode\": \"440200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"粤G\",\n" +
+ " \"city\": \"湛江\",\n" +
+ " \"province\": \"广东\",\n" +
+ " \"Pcode\": \"GD\",\n" +
+ " \"AreaCode\": \"440800\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"粤H\",\n" +
+ " \"city\": \"肇庆\",\n" +
+ " \"province\": \"广东\",\n" +
+ " \"Pcode\": \"GD\",\n" +
+ " \"AreaCode\": \"441200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"粤J\",\n" +
+ " \"city\": \"江门\",\n" +
+ " \"province\": \"广东\",\n" +
+ " \"Pcode\": \"GD\",\n" +
+ " \"AreaCode\": \"440700\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"粤K\",\n" +
+ " \"city\": \"茂名\",\n" +
+ " \"province\": \"广东\",\n" +
+ " \"Pcode\": \"GD\",\n" +
+ " \"AreaCode\": \"440900\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"粤L\",\n" +
+ " \"city\": \"惠州\",\n" +
+ " \"province\": \"广东\",\n" +
+ " \"Pcode\": \"GD\",\n" +
+ " \"AreaCode\": \"441300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"粤M\",\n" +
+ " \"city\": \"梅州\",\n" +
+ " \"province\": \"广东\",\n" +
+ " \"Pcode\": \"GD\",\n" +
+ " \"AreaCode\": \"441400\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"粤N\",\n" +
+ " \"city\": \"汕尾\",\n" +
+ " \"province\": \"广东\",\n" +
+ " \"Pcode\": \"GD\",\n" +
+ " \"AreaCode\": \"441500\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"粤P\",\n" +
+ " \"city\": \"河源\",\n" +
+ " \"province\": \"广东\",\n" +
+ " \"Pcode\": \"GD\",\n" +
+ " \"AreaCode\": \"441600\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"粤Q\",\n" +
+ " \"city\": \"阳江\",\n" +
+ " \"province\": \"广东\",\n" +
+ " \"Pcode\": \"GD\",\n" +
+ " \"AreaCode\": \"441700\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"粤R\",\n" +
+ " \"city\": \"清远\",\n" +
+ " \"province\": \"广东\",\n" +
+ " \"Pcode\": \"GD\",\n" +
+ " \"AreaCode\": \"441800\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"粤S\",\n" +
+ " \"city\": \"东莞\",\n" +
+ " \"province\": \"广东\",\n" +
+ " \"Pcode\": \"GD\",\n" +
+ " \"AreaCode\": \"441900\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"粤T\",\n" +
+ " \"city\": \"中山\",\n" +
+ " \"province\": \"广东\",\n" +
+ " \"Pcode\": \"GD\",\n" +
+ " \"AreaCode\": \"442000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"粤U\",\n" +
+ " \"city\": \"潮州\",\n" +
+ " \"province\": \"广东\",\n" +
+ " \"Pcode\": \"GD\",\n" +
+ " \"AreaCode\": \"445100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"粤V\",\n" +
+ " \"city\": \"揭阳\",\n" +
+ " \"province\": \"广东\",\n" +
+ " \"Pcode\": \"GD\",\n" +
+ " \"AreaCode\": \"445200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"粤W\",\n" +
+ " \"city\": \"云浮\",\n" +
+ " \"province\": \"广东\",\n" +
+ " \"Pcode\": \"GD\",\n" +
+ " \"AreaCode\": \"445300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"粤X\",\n" +
+ " \"city\": \"顺德区\",\n" +
+ " \"province\": \"广东\",\n" +
+ " \"Pcode\": \"GD\",\n" +
+ " \"AreaCode\": \"440606\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"粤Y\",\n" +
+ " \"city\": \"南海区\",\n" +
+ " \"province\": \"广东\",\n" +
+ " \"Pcode\": \"GD\",\n" +
+ " \"AreaCode\": \"440605\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"粤Z\",\n" +
+ " \"city\": \"港澳进入内地车辆\",\n" +
+ " \"province\": \"广东\",\n" +
+ " \"Pcode\": \"GD\",\n" +
+ " \"AreaCode\": null\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"宁A\",\n" +
+ " \"city\": \"银川\",\n" +
+ " \"province\": \"宁夏\",\n" +
+ " \"Pcode\": \"NX\",\n" +
+ " \"AreaCode\": \"640100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"宁B\",\n" +
+ " \"city\": \"石嘴山\",\n" +
+ " \"province\": \"宁夏\",\n" +
+ " \"Pcode\": \"NX\",\n" +
+ " \"AreaCode\": \"640200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"宁C\",\n" +
+ " \"city\": \"银南\",\n" +
+ " \"province\": \"宁夏\",\n" +
+ " \"Pcode\": \"NX\",\n" +
+ " \"AreaCode\": null\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"宁D\",\n" +
+ " \"city\": \"固原\",\n" +
+ " \"province\": \"宁夏\",\n" +
+ " \"Pcode\": \"NX\",\n" +
+ " \"AreaCode\": \"640400\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"宁E\",\n" +
+ " \"city\": \"中卫\",\n" +
+ " \"province\": \"宁夏\",\n" +
+ " \"Pcode\": \"NX\",\n" +
+ " \"AreaCode\": \"640500\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"京A\",\n" +
+ " \"city\": \"北京\",\n" +
+ " \"province\": \"北京\",\n" +
+ " \"Pcode\": \"BJ\",\n" +
+ " \"AreaCode\": \"110000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"京B\",\n" +
+ " \"city\": \"北京\",\n" +
+ " \"province\": \"北京\",\n" +
+ " \"Pcode\": \"BJ\",\n" +
+ " \"AreaCode\": \"110000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"京C\",\n" +
+ " \"city\": \"北京\",\n" +
+ " \"province\": \"北京\",\n" +
+ " \"Pcode\": \"BJ\",\n" +
+ " \"AreaCode\": \"110000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"京D\",\n" +
+ " \"city\": \"北京\",\n" +
+ " \"province\": \"北京\",\n" +
+ " \"Pcode\": \"BJ\",\n" +
+ " \"AreaCode\": \"110000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"京E\",\n" +
+ " \"city\": \"北京\",\n" +
+ " \"province\": \"北京\",\n" +
+ " \"Pcode\": \"BJ\",\n" +
+ " \"AreaCode\": \"110000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"京F\",\n" +
+ " \"city\": \"北京\",\n" +
+ " \"province\": \"北京\",\n" +
+ " \"Pcode\": \"BJ\",\n" +
+ " \"AreaCode\": \"110000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"京G\",\n" +
+ " \"city\": \"北京\",\n" +
+ " \"province\": \"北京\",\n" +
+ " \"Pcode\": \"BJ\",\n" +
+ " \"AreaCode\": \"110000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"京H\",\n" +
+ " \"city\": \"北京\",\n" +
+ " \"province\": \"北京\",\n" +
+ " \"Pcode\": \"BJ\",\n" +
+ " \"AreaCode\": \"110000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"京J\",\n" +
+ " \"city\": \"北京\",\n" +
+ " \"province\": \"北京\",\n" +
+ " \"Pcode\": \"BJ\",\n" +
+ " \"AreaCode\": \"110000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"京K\",\n" +
+ " \"city\": \"北京\",\n" +
+ " \"province\": \"北京\",\n" +
+ " \"Pcode\": \"BJ\",\n" +
+ " \"AreaCode\": \"110000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"京L\",\n" +
+ " \"city\": \"北京\",\n" +
+ " \"province\": \"北京\",\n" +
+ " \"Pcode\": \"BJ\",\n" +
+ " \"AreaCode\": \"110000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"京M\",\n" +
+ " \"city\": \"北京\",\n" +
+ " \"province\": \"北京\",\n" +
+ " \"Pcode\": \"BJ\",\n" +
+ " \"AreaCode\": \"110000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"京Y\",\n" +
+ " \"city\": \"北京\",\n" +
+ " \"province\": \"北京\",\n" +
+ " \"Pcode\": \"BJ\",\n" +
+ " \"AreaCode\": \"110000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"豫A\",\n" +
+ " \"city\": \"郑州\",\n" +
+ " \"province\": \"河南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"410100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"豫B\",\n" +
+ " \"city\": \"开封\",\n" +
+ " \"province\": \"河南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"410200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"豫C\",\n" +
+ " \"city\": \"洛阳\",\n" +
+ " \"province\": \"河南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"410300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"豫D\",\n" +
+ " \"city\": \"平顶山\",\n" +
+ " \"province\": \"河南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"410400\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"豫E\",\n" +
+ " \"city\": \"安阳\",\n" +
+ " \"province\": \"河南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"410522\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"豫F\",\n" +
+ " \"city\": \"鹤壁\",\n" +
+ " \"province\": \"河南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"410600\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"豫G\",\n" +
+ " \"city\": \"新乡\",\n" +
+ " \"province\": \"河南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"410721\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"豫H\",\n" +
+ " \"city\": \"焦作\",\n" +
+ " \"province\": \"河南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"410800\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"豫J\",\n" +
+ " \"city\": \"濮阳\",\n" +
+ " \"province\": \"河南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"410928\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"豫K\",\n" +
+ " \"city\": \"许昌\",\n" +
+ " \"province\": \"河南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"411023\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"豫L\",\n" +
+ " \"city\": \"漯河\",\n" +
+ " \"province\": \"河南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"411100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"豫M\",\n" +
+ " \"city\": \"三门峡\",\n" +
+ " \"province\": \"河南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"411200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"豫N\",\n" +
+ " \"city\": \"商丘\",\n" +
+ " \"province\": \"河南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"411400\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"豫P\",\n" +
+ " \"city\": \"周口\",\n" +
+ " \"province\": \"河南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"411600\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"豫Q\",\n" +
+ " \"city\": \"驻马店\",\n" +
+ " \"province\": \"河南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"411700\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"豫R\",\n" +
+ " \"city\": \"南阳\",\n" +
+ " \"province\": \"河南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"411300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"豫S\",\n" +
+ " \"city\": \"信阳\",\n" +
+ " \"province\": \"河南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"411500\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"豫U\",\n" +
+ " \"city\": \"济源\",\n" +
+ " \"province\": \"河南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"419001\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"黑A\",\n" +
+ " \"city\": \"哈尔滨\",\n" +
+ " \"province\": \"黑龙江\",\n" +
+ " \"Pcode\": \"HLJ\",\n" +
+ " \"AreaCode\": \"230100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"黑B\",\n" +
+ " \"city\": \"齐齐哈尔\",\n" +
+ " \"province\": \"黑龙江\",\n" +
+ " \"Pcode\": \"HLJ\",\n" +
+ " \"AreaCode\": \"230200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"黑C\",\n" +
+ " \"city\": \"牡丹江\",\n" +
+ " \"province\": \"黑龙江\",\n" +
+ " \"Pcode\": \"HLJ\",\n" +
+ " \"AreaCode\": \"231000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"黑D\",\n" +
+ " \"city\": \"佳木斯\",\n" +
+ " \"province\": \"黑龙江\",\n" +
+ " \"Pcode\": \"HLJ\",\n" +
+ " \"AreaCode\": \"230800\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"黑E\",\n" +
+ " \"city\": \"大庆\",\n" +
+ " \"province\": \"黑龙江\",\n" +
+ " \"Pcode\": \"HLJ\",\n" +
+ " \"AreaCode\": \"230600\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"黑F\",\n" +
+ " \"city\": \"伊春\",\n" +
+ " \"province\": \"黑龙江\",\n" +
+ " \"Pcode\": \"HLJ\",\n" +
+ " \"AreaCode\": \"230702\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"黑G\",\n" +
+ " \"city\": \"鸡西\",\n" +
+ " \"province\": \"黑龙江\",\n" +
+ " \"Pcode\": \"HLJ\",\n" +
+ " \"AreaCode\": \"230300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"黑H\",\n" +
+ " \"city\": \"鹤岗\",\n" +
+ " \"province\": \"黑龙江\",\n" +
+ " \"Pcode\": \"HLJ\",\n" +
+ " \"AreaCode\": \"230400\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"黑J\",\n" +
+ " \"city\": \"双鸭山\",\n" +
+ " \"province\": \"黑龙江\",\n" +
+ " \"Pcode\": \"HLJ\",\n" +
+ " \"AreaCode\": \"230500\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"黑K\",\n" +
+ " \"city\": \"七台河\",\n" +
+ " \"province\": \"黑龙江\",\n" +
+ " \"Pcode\": \"HLJ\",\n" +
+ " \"AreaCode\": \"230900\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"黑L\",\n" +
+ " \"city\": \"松花江地区\",\n" +
+ " \"province\": \"黑龙江\",\n" +
+ " \"Pcode\": \"HLJ\",\n" +
+ " \"AreaCode\": null\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"黑M\",\n" +
+ " \"city\": \"绥化\",\n" +
+ " \"province\": \"黑龙江\",\n" +
+ " \"Pcode\": \"HLJ\",\n" +
+ " \"AreaCode\": \"231200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"黑N\",\n" +
+ " \"city\": \"黑河\",\n" +
+ " \"province\": \"黑龙江\",\n" +
+ " \"Pcode\": \"HLJ\",\n" +
+ " \"AreaCode\": \"231100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"黑P\",\n" +
+ " \"city\": \"大兴安岭地区\",\n" +
+ " \"province\": \"黑龙江\",\n" +
+ " \"Pcode\": \"HLJ\",\n" +
+ " \"AreaCode\": \"232700\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"黑R\",\n" +
+ " \"city\": \"农垦系统\",\n" +
+ " \"province\": \"黑龙江\",\n" +
+ " \"Pcode\": \"HLJ\",\n" +
+ " \"AreaCode\": null\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鲁A\",\n" +
+ " \"city\": \"济南\",\n" +
+ " \"province\": \"山东\",\n" +
+ " \"Pcode\": \"SD\",\n" +
+ " \"AreaCode\": \"370100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鲁B\",\n" +
+ " \"city\": \"青岛\",\n" +
+ " \"province\": \"山东\",\n" +
+ " \"Pcode\": \"SD\",\n" +
+ " \"AreaCode\": \"370200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鲁C\",\n" +
+ " \"city\": \"淄博\",\n" +
+ " \"province\": \"山东\",\n" +
+ " \"Pcode\": \"SD\",\n" +
+ " \"AreaCode\": \"370300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鲁D\",\n" +
+ " \"city\": \"枣庄\",\n" +
+ " \"province\": \"山东\",\n" +
+ " \"Pcode\": \"SD\",\n" +
+ " \"AreaCode\": \"370400\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鲁E\",\n" +
+ " \"city\": \"东营\",\n" +
+ " \"province\": \"山东\",\n" +
+ " \"Pcode\": \"SD\",\n" +
+ " \"AreaCode\": \"370502\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鲁F\",\n" +
+ " \"city\": \"烟台\",\n" +
+ " \"province\": \"山东\",\n" +
+ " \"Pcode\": \"SD\",\n" +
+ " \"AreaCode\": \"370600\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鲁G\",\n" +
+ " \"city\": \"潍坊\",\n" +
+ " \"province\": \"山东\",\n" +
+ " \"Pcode\": \"SD\",\n" +
+ " \"AreaCode\": \"370700\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鲁H\",\n" +
+ " \"city\": \"济宁\",\n" +
+ " \"province\": \"山东\",\n" +
+ " \"Pcode\": \"SD\",\n" +
+ " \"AreaCode\": \"370800\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鲁J\",\n" +
+ " \"city\": \"泰安\",\n" +
+ " \"province\": \"山东\",\n" +
+ " \"Pcode\": \"SD\",\n" +
+ " \"AreaCode\": \"370900\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鲁K\",\n" +
+ " \"city\": \"威海\",\n" +
+ " \"province\": \"山东\",\n" +
+ " \"Pcode\": \"SD\",\n" +
+ " \"AreaCode\": \"371000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鲁L\",\n" +
+ " \"city\": \"日照\",\n" +
+ " \"province\": \"山东\",\n" +
+ " \"Pcode\": \"SD\",\n" +
+ " \"AreaCode\": \"371100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鲁M\",\n" +
+ " \"city\": \"滨州\",\n" +
+ " \"province\": \"山东\",\n" +
+ " \"Pcode\": \"SD\",\n" +
+ " \"AreaCode\": \"371600\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鲁N\",\n" +
+ " \"city\": \"德州\",\n" +
+ " \"province\": \"山东\",\n" +
+ " \"Pcode\": \"SD\",\n" +
+ " \"AreaCode\": \"371400\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鲁P\",\n" +
+ " \"city\": \"聊城\",\n" +
+ " \"province\": \"山东\",\n" +
+ " \"Pcode\": \"SD\",\n" +
+ " \"AreaCode\": \"371500\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鲁Q\",\n" +
+ " \"city\": \"临沂\",\n" +
+ " \"province\": \"山东\",\n" +
+ " \"Pcode\": \"SD\",\n" +
+ " \"AreaCode\": \"371300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鲁R\",\n" +
+ " \"city\": \"菏泽\",\n" +
+ " \"province\": \"山东\",\n" +
+ " \"Pcode\": \"SD\",\n" +
+ " \"AreaCode\": \"371700\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鲁S\",\n" +
+ " \"city\": \"莱芜\",\n" +
+ " \"province\": \"山东\",\n" +
+ " \"Pcode\": \"SD\",\n" +
+ " \"AreaCode\": \"371200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鲁U\",\n" +
+ " \"city\": \"青岛\",\n" +
+ " \"province\": \"山东\",\n" +
+ " \"Pcode\": \"SD\",\n" +
+ " \"AreaCode\": \"370200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鲁V\",\n" +
+ " \"city\": \"潍坊\",\n" +
+ " \"province\": \"山东\",\n" +
+ " \"Pcode\": \"SD\",\n" +
+ " \"AreaCode\": \"370700\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"鲁Y\",\n" +
+ " \"city\": \"烟台\",\n" +
+ " \"province\": \"山东\",\n" +
+ " \"Pcode\": \"SD\",\n" +
+ " \"AreaCode\": \"370600\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"浙A\",\n" +
+ " \"city\": \"杭州\",\n" +
+ " \"province\": \"浙江\",\n" +
+ " \"Pcode\": \"ZJ\",\n" +
+ " \"AreaCode\": \"330100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"浙B\",\n" +
+ " \"city\": \"宁波\",\n" +
+ " \"province\": \"浙江\",\n" +
+ " \"Pcode\": \"ZJ\",\n" +
+ " \"AreaCode\": \"330200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"浙C\",\n" +
+ " \"city\": \"温州\",\n" +
+ " \"province\": \"浙江\",\n" +
+ " \"Pcode\": \"ZJ\",\n" +
+ " \"AreaCode\": \"330300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"浙D\",\n" +
+ " \"city\": \"绍兴\",\n" +
+ " \"province\": \"浙江\",\n" +
+ " \"Pcode\": \"ZJ\",\n" +
+ " \"AreaCode\": \"330600\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"浙E\",\n" +
+ " \"city\": \"湖州\",\n" +
+ " \"province\": \"浙江\",\n" +
+ " \"Pcode\": \"ZJ\",\n" +
+ " \"AreaCode\": \"330500\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"浙F\",\n" +
+ " \"city\": \"嘉兴\",\n" +
+ " \"province\": \"浙江\",\n" +
+ " \"Pcode\": \"ZJ\",\n" +
+ " \"AreaCode\": \"330400\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"浙G\",\n" +
+ " \"city\": \"金华\",\n" +
+ " \"province\": \"浙江\",\n" +
+ " \"Pcode\": \"ZJ\",\n" +
+ " \"AreaCode\": \"330700\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"浙H\",\n" +
+ " \"city\": \"衢州\",\n" +
+ " \"province\": \"浙江\",\n" +
+ " \"Pcode\": \"ZJ\",\n" +
+ " \"AreaCode\": \"330800\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"浙J\",\n" +
+ " \"city\": \"台州\",\n" +
+ " \"province\": \"浙江\",\n" +
+ " \"Pcode\": \"ZJ\",\n" +
+ " \"AreaCode\": \"331000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"浙K\",\n" +
+ " \"city\": \"丽水\",\n" +
+ " \"province\": \"浙江\",\n" +
+ " \"Pcode\": \"ZJ\",\n" +
+ " \"AreaCode\": \"331100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"浙L\",\n" +
+ " \"city\": \"舟山\",\n" +
+ " \"province\": \"浙江\",\n" +
+ " \"Pcode\": \"ZJ\",\n" +
+ " \"AreaCode\": \"330900\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"桂A\",\n" +
+ " \"city\": \"南宁\",\n" +
+ " \"province\": \"广西\",\n" +
+ " \"Pcode\": \"GX\",\n" +
+ " \"AreaCode\": \"450100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"桂B\",\n" +
+ " \"city\": \"柳州\",\n" +
+ " \"province\": \"广西\",\n" +
+ " \"Pcode\": \"GX\",\n" +
+ " \"AreaCode\": \"450200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"桂C\",\n" +
+ " \"city\": \"桂林\",\n" +
+ " \"province\": \"广西\",\n" +
+ " \"Pcode\": \"GX\",\n" +
+ " \"AreaCode\": \"450300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"桂D\",\n" +
+ " \"city\": \"梧州\",\n" +
+ " \"province\": \"广西\",\n" +
+ " \"Pcode\": \"GX\",\n" +
+ " \"AreaCode\": \"450400\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"桂E\",\n" +
+ " \"city\": \"北海\",\n" +
+ " \"province\": \"广西\",\n" +
+ " \"Pcode\": \"GX\",\n" +
+ " \"AreaCode\": \"450500\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"桂F\",\n" +
+ " \"city\": \"崇左\",\n" +
+ " \"province\": \"广西\",\n" +
+ " \"Pcode\": \"GX\",\n" +
+ " \"AreaCode\": \"451400\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"桂G\",\n" +
+ " \"city\": \"来宾\",\n" +
+ " \"province\": \"广西\",\n" +
+ " \"Pcode\": \"GX\",\n" +
+ " \"AreaCode\": \"451300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"桂H\",\n" +
+ " \"city\": \"桂林地区\",\n" +
+ " \"province\": \"广西\",\n" +
+ " \"Pcode\": \"GX\",\n" +
+ " \"AreaCode\": null\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"桂J\",\n" +
+ " \"city\": \"贺州\",\n" +
+ " \"province\": \"广西\",\n" +
+ " \"Pcode\": \"GX\",\n" +
+ " \"AreaCode\": \"451100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"桂K\",\n" +
+ " \"city\": \"玉林\",\n" +
+ " \"province\": \"广西\",\n" +
+ " \"Pcode\": \"GX\",\n" +
+ " \"AreaCode\": \"450900\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"桂L\",\n" +
+ " \"city\": \"百色\",\n" +
+ " \"province\": \"广西\",\n" +
+ " \"Pcode\": \"GX\",\n" +
+ " \"AreaCode\": \"451000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"桂M\",\n" +
+ " \"city\": \"河池\",\n" +
+ " \"province\": \"广西\",\n" +
+ " \"Pcode\": \"GX\",\n" +
+ " \"AreaCode\": \"451200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"桂N\",\n" +
+ " \"city\": \"钦州\",\n" +
+ " \"province\": \"广西\",\n" +
+ " \"Pcode\": \"GX\",\n" +
+ " \"AreaCode\": \"450700\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"桂P\",\n" +
+ " \"city\": \"防城港\",\n" +
+ " \"province\": \"广西\",\n" +
+ " \"Pcode\": \"GX\",\n" +
+ " \"AreaCode\": \"450600\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"桂R\",\n" +
+ " \"city\": \"贵港\",\n" +
+ " \"province\": \"广西\",\n" +
+ " \"Pcode\": \"GX\",\n" +
+ " \"AreaCode\": \"450800\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"蒙A\",\n" +
+ " \"city\": \"呼和浩特\",\n" +
+ " \"province\": \"内蒙古\",\n" +
+ " \"Pcode\": \"NMG\",\n" +
+ " \"AreaCode\": \"150100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"蒙B\",\n" +
+ " \"city\": \"包头\",\n" +
+ " \"province\": \"内蒙古\",\n" +
+ " \"Pcode\": \"NMG\",\n" +
+ " \"AreaCode\": \"150200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"蒙C\",\n" +
+ " \"city\": \"乌海\",\n" +
+ " \"province\": \"内蒙古\",\n" +
+ " \"Pcode\": \"NMG\",\n" +
+ " \"AreaCode\": \"150300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"蒙D\",\n" +
+ " \"city\": \"赤峰\",\n" +
+ " \"province\": \"内蒙古\",\n" +
+ " \"Pcode\": \"NMG\",\n" +
+ " \"AreaCode\": \"150400\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"蒙E\",\n" +
+ " \"city\": \"呼伦贝尔 \",\n" +
+ " \"province\": \"内蒙古\",\n" +
+ " \"Pcode\": \"NMG\",\n" +
+ " \"AreaCode\": \"150700\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"蒙F\",\n" +
+ " \"city\": \"兴安盟\",\n" +
+ " \"province\": \"内蒙古\",\n" +
+ " \"Pcode\": \"NMG\",\n" +
+ " \"AreaCode\": \"152200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"蒙G\",\n" +
+ " \"city\": \"通辽\",\n" +
+ " \"province\": \"内蒙古\",\n" +
+ " \"Pcode\": \"NMG\",\n" +
+ " \"AreaCode\": \"150500\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"蒙H\",\n" +
+ " \"city\": \"锡林郭勒盟\",\n" +
+ " \"province\": \"内蒙古\",\n" +
+ " \"Pcode\": \"NMG\",\n" +
+ " \"AreaCode\": \"152500\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"蒙J\",\n" +
+ " \"city\": \"乌兰察布盟\",\n" +
+ " \"province\": \"内蒙古\",\n" +
+ " \"Pcode\": \"NMG\",\n" +
+ " \"AreaCode\": \"150900\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"蒙K\",\n" +
+ " \"city\": \"鄂尔多斯 \",\n" +
+ " \"province\": \"内蒙古\",\n" +
+ " \"Pcode\": \"NMG\",\n" +
+ " \"AreaCode\": \"150600\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"蒙L\",\n" +
+ " \"city\": \"巴彦淖尔盟\",\n" +
+ " \"province\": \"内蒙古\",\n" +
+ " \"Pcode\": \"NMG\",\n" +
+ " \"AreaCode\": \"150800\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"蒙M \",\n" +
+ " \"city\": \" 阿拉善盟\",\n" +
+ " \"province\": \"内蒙古\",\n" +
+ " \"Pcode\": \"NMG\",\n" +
+ " \"AreaCode\": \"152900\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"闽A\",\n" +
+ " \"city\": \"福州\",\n" +
+ " \"province\": \"福建\",\n" +
+ " \"Pcode\": \"FJ\",\n" +
+ " \"AreaCode\": \"350100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"闽B\",\n" +
+ " \"city\": \"莆田\",\n" +
+ " \"province\": \"福建\",\n" +
+ " \"Pcode\": \"FJ\",\n" +
+ " \"AreaCode\": \"350300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"闽C\",\n" +
+ " \"city\": \"泉州\",\n" +
+ " \"province\": \"福建\",\n" +
+ " \"Pcode\": \"FJ\",\n" +
+ " \"AreaCode\": \"350500\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"闽D\",\n" +
+ " \"city\": \"厦门\",\n" +
+ " \"province\": \"福建\",\n" +
+ " \"Pcode\": \"FJ\",\n" +
+ " \"AreaCode\": \"350200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"闽E\",\n" +
+ " \"city\": \"漳州\",\n" +
+ " \"province\": \"福建\",\n" +
+ " \"Pcode\": \"FJ\",\n" +
+ " \"AreaCode\": \"350600\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"闽F\",\n" +
+ " \"city\": \"龙岩\",\n" +
+ " \"province\": \"福建\",\n" +
+ " \"Pcode\": \"FJ\",\n" +
+ " \"AreaCode\": \"350800\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"闽G\",\n" +
+ " \"city\": \"三明\",\n" +
+ " \"province\": \"福建\",\n" +
+ " \"Pcode\": \"FJ\",\n" +
+ " \"AreaCode\": \"350400\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"闽H\",\n" +
+ " \"city\": \"南平\",\n" +
+ " \"province\": \"福建\",\n" +
+ " \"Pcode\": \"FJ\",\n" +
+ " \"AreaCode\": \"350700\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"闽J\",\n" +
+ " \"city\": \"宁德\",\n" +
+ " \"province\": \"福建\",\n" +
+ " \"Pcode\": \"FJ\",\n" +
+ " \"AreaCode\": \"350900\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"闽K\",\n" +
+ " \"city\": \"直系统\",\n" +
+ " \"province\": \"福建\",\n" +
+ " \"Pcode\": \"FJ\",\n" +
+ " \"AreaCode\": null\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"川A\",\n" +
+ " \"city\": \"成都\",\n" +
+ " \"province\": \"四川\",\n" +
+ " \"Pcode\": \"SC\",\n" +
+ " \"AreaCode\": \"510100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"川B\",\n" +
+ " \"city\": \"绵阳\",\n" +
+ " \"province\": \"四川\",\n" +
+ " \"Pcode\": \"SC\",\n" +
+ " \"AreaCode\": \"510700\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"川C\",\n" +
+ " \"city\": \"自贡\",\n" +
+ " \"province\": \"四川\",\n" +
+ " \"Pcode\": \"SC\",\n" +
+ " \"AreaCode\": \"510300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"川D\",\n" +
+ " \"city\": \"攀枝花\",\n" +
+ " \"province\": \"四川\",\n" +
+ " \"Pcode\": \"SC\",\n" +
+ " \"AreaCode\": \"510400\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"川E\",\n" +
+ " \"city\": \"泸州\",\n" +
+ " \"province\": \"四川\",\n" +
+ " \"Pcode\": \"SC\",\n" +
+ " \"AreaCode\": \"510500\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"川F\",\n" +
+ " \"city\": \"德阳\",\n" +
+ " \"province\": \"四川\",\n" +
+ " \"Pcode\": \"SC\",\n" +
+ " \"AreaCode\": \"510600\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"川H\",\n" +
+ " \"city\": \"广元\",\n" +
+ " \"province\": \"四川\",\n" +
+ " \"Pcode\": \"SC\",\n" +
+ " \"AreaCode\": \"510800\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"川J\",\n" +
+ " \"city\": \"遂宁\",\n" +
+ " \"province\": \"四川\",\n" +
+ " \"Pcode\": \"SC\",\n" +
+ " \"AreaCode\": \"510900\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"川K\",\n" +
+ " \"city\": \"内江\",\n" +
+ " \"province\": \"四川\",\n" +
+ " \"Pcode\": \"SC\",\n" +
+ " \"AreaCode\": \"511000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"川L\",\n" +
+ " \"city\": \"乐山\",\n" +
+ " \"province\": \"四川\",\n" +
+ " \"Pcode\": \"SC\",\n" +
+ " \"AreaCode\": \"511100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"川M\",\n" +
+ " \"city\": \"资阳\",\n" +
+ " \"province\": \"四川\",\n" +
+ " \"Pcode\": \"SC\",\n" +
+ " \"AreaCode\": \"512000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"川Q\",\n" +
+ " \"city\": \"宜宾\",\n" +
+ " \"province\": \"四川\",\n" +
+ " \"Pcode\": \"SC\",\n" +
+ " \"AreaCode\": \"511521\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"川R\",\n" +
+ " \"city\": \"南充\",\n" +
+ " \"province\": \"四川\",\n" +
+ " \"Pcode\": \"SC\",\n" +
+ " \"AreaCode\": \"511300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"川S\",\n" +
+ " \"city\": \"达州\",\n" +
+ " \"province\": \"四川\",\n" +
+ " \"Pcode\": \"SC\",\n" +
+ " \"AreaCode\": \"511700\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"川T\",\n" +
+ " \"city\": \"雅安\",\n" +
+ " \"province\": \"四川\",\n" +
+ " \"Pcode\": \"SC\",\n" +
+ " \"AreaCode\": \"511800\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"川U\",\n" +
+ " \"city\": \"阿坝藏族羌族自治州\",\n" +
+ " \"province\": \"四川\",\n" +
+ " \"Pcode\": \"SC\",\n" +
+ " \"AreaCode\": \"513200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"川V\",\n" +
+ " \"city\": \"甘孜藏族自治州\",\n" +
+ " \"province\": \"四川\",\n" +
+ " \"Pcode\": \"SC\",\n" +
+ " \"AreaCode\": \"513300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"川W\",\n" +
+ " \"city\": \"凉山彝族自治州\",\n" +
+ " \"province\": \"四川\",\n" +
+ " \"Pcode\": \"SC\",\n" +
+ " \"AreaCode\": \"513400\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"川X\",\n" +
+ " \"city\": \"广安\",\n" +
+ " \"province\": \"四川\",\n" +
+ " \"Pcode\": \"SC\",\n" +
+ " \"AreaCode\": \"511602\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"川Y\",\n" +
+ " \"city\": \"巴中\",\n" +
+ " \"province\": \"四川\",\n" +
+ " \"Pcode\": \"SC\",\n" +
+ " \"AreaCode\": \"511900\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"川Z\",\n" +
+ " \"city\": \"眉山\",\n" +
+ " \"province\": \"四川\",\n" +
+ " \"Pcode\": \"SC\",\n" +
+ " \"AreaCode\": \"511400\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"渝A\",\n" +
+ " \"city\": \"重庆区(江南)\",\n" +
+ " \"province\": \"重庆\",\n" +
+ " \"Pcode\": \"ZQ\",\n" +
+ " \"AreaCode\": \"500100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"渝B\",\n" +
+ " \"city\": \"重庆区(江北)\",\n" +
+ " \"province\": \"重庆\",\n" +
+ " \"Pcode\": \"ZQ\",\n" +
+ " \"AreaCode\": \"500100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"渝C\",\n" +
+ " \"city\": \"永川区\",\n" +
+ " \"province\": \"重庆\",\n" +
+ " \"Pcode\": \"ZQ\",\n" +
+ " \"AreaCode\": \"500118\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"渝F\",\n" +
+ " \"city\": \"万州区\",\n" +
+ " \"province\": \"重庆\",\n" +
+ " \"Pcode\": \"ZQ\",\n" +
+ " \"AreaCode\": \"500101\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"渝G\",\n" +
+ " \"city\": \"涪陵区\",\n" +
+ " \"province\": \"重庆\",\n" +
+ " \"Pcode\": \"ZQ\",\n" +
+ " \"AreaCode\": \"500102\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"渝H\",\n" +
+ " \"city\": \"黔江区\",\n" +
+ " \"province\": \"重庆\",\n" +
+ " \"Pcode\": \"ZQ\",\n" +
+ " \"AreaCode\": \"500114\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"津A\",\n" +
+ " \"city\": \"天津\",\n" +
+ " \"province\": \"天津\",\n" +
+ " \"Pcode\": \"TJ\",\n" +
+ " \"AreaCode\": \"120000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"津B\",\n" +
+ " \"city\": \"天津\",\n" +
+ " \"province\": \"天津\",\n" +
+ " \"Pcode\": \"TJ\",\n" +
+ " \"AreaCode\": \"120000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"津C\",\n" +
+ " \"city\": \"天津\",\n" +
+ " \"province\": \"天津\",\n" +
+ " \"Pcode\": \"TJ\",\n" +
+ " \"AreaCode\": \"120000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"津D\",\n" +
+ " \"city\": \"天津\",\n" +
+ " \"province\": \"天津\",\n" +
+ " \"Pcode\": \"TJ\",\n" +
+ " \"AreaCode\": \"120000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"津E\",\n" +
+ " \"city\": \"天津\",\n" +
+ " \"province\": \"天津\",\n" +
+ " \"Pcode\": \"TJ\",\n" +
+ " \"AreaCode\": \"120000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"津F\",\n" +
+ " \"city\": \"天津\",\n" +
+ " \"province\": \"天津\",\n" +
+ " \"Pcode\": \"TJ\",\n" +
+ " \"AreaCode\": \"120000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"津G\",\n" +
+ " \"city\": \"天津\",\n" +
+ " \"province\": \"天津\",\n" +
+ " \"Pcode\": \"TJ\",\n" +
+ " \"AreaCode\": \"120000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"津H\",\n" +
+ " \"city\": \"天津\",\n" +
+ " \"province\": \"天津\",\n" +
+ " \"Pcode\": \"TJ\",\n" +
+ " \"AreaCode\": \"120000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"云A\",\n" +
+ " \"city\": \"昆明\",\n" +
+ " \"province\": \"云南\",\n" +
+ " \"Pcode\": \"YN\",\n" +
+ " \"AreaCode\": \"530100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"云A-V\",\n" +
+ " \"city\": \"东川\",\n" +
+ " \"province\": \"云南\",\n" +
+ " \"Pcode\": \"YN\",\n" +
+ " \"AreaCode\": \"530113\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"云C\",\n" +
+ " \"city\": \"昭通\",\n" +
+ " \"province\": \"云南\",\n" +
+ " \"Pcode\": \"YN\",\n" +
+ " \"AreaCode\": \"530600\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"云D\",\n" +
+ " \"city\": \"曲靖\",\n" +
+ " \"province\": \"云南\",\n" +
+ " \"Pcode\": \"YN\",\n" +
+ " \"AreaCode\": \"530300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"云E\",\n" +
+ " \"city\": \"楚雄彝族自治州\",\n" +
+ " \"province\": \"云南\",\n" +
+ " \"Pcode\": \"YN\",\n" +
+ " \"AreaCode\": \"532300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"云F\",\n" +
+ " \"city\": \"玉溪\",\n" +
+ " \"province\": \"云南\",\n" +
+ " \"Pcode\": \"YN\",\n" +
+ " \"AreaCode\": \"530400\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"云G\",\n" +
+ " \"city\": \"红河哈尼族彝族自治州\",\n" +
+ " \"province\": \"云南\",\n" +
+ " \"Pcode\": \"YN\",\n" +
+ " \"AreaCode\": \"532500\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"云H\",\n" +
+ " \"city\": \"文山壮族苗族自治州\",\n" +
+ " \"province\": \"云南\",\n" +
+ " \"Pcode\": \"YN\",\n" +
+ " \"AreaCode\": \"532600\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"云J\",\n" +
+ " \"city\": \"思茅\",\n" +
+ " \"province\": \"云南\",\n" +
+ " \"Pcode\": \"YN\",\n" +
+ " \"AreaCode\": \"530802\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"云K\",\n" +
+ " \"city\": \"西双版纳傣族自治州\",\n" +
+ " \"province\": \"云南\",\n" +
+ " \"Pcode\": \"YN\",\n" +
+ " \"AreaCode\": \"532800\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"云L\",\n" +
+ " \"city\": \"大理白族自治州\",\n" +
+ " \"province\": \"云南\",\n" +
+ " \"Pcode\": \"YN\",\n" +
+ " \"AreaCode\": \"532900\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"云M\",\n" +
+ " \"city\": \"保山\",\n" +
+ " \"province\": \"云南\",\n" +
+ " \"Pcode\": \"YN\",\n" +
+ " \"AreaCode\": \"530500\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"云N\",\n" +
+ " \"city\": \"德宏傣族景颇族自治州\",\n" +
+ " \"province\": \"云南\",\n" +
+ " \"Pcode\": \"YN\",\n" +
+ " \"AreaCode\": \"533100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"云P\",\n" +
+ " \"city\": \"丽江\",\n" +
+ " \"province\": \"云南\",\n" +
+ " \"Pcode\": \"YN\",\n" +
+ " \"AreaCode\": \"530700\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"云Q\",\n" +
+ " \"city\": \"怒江傈僳族自治州\",\n" +
+ " \"province\": \"云南\",\n" +
+ " \"Pcode\": \"YN\",\n" +
+ " \"AreaCode\": \"533300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"云R\",\n" +
+ " \"city\": \"迪庆藏族自治州\",\n" +
+ " \"province\": \"云南\",\n" +
+ " \"Pcode\": \"YN\",\n" +
+ " \"AreaCode\": \"533400\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"云S\",\n" +
+ " \"city\": \"临沧地区\",\n" +
+ " \"province\": \"云南\",\n" +
+ " \"Pcode\": \"YN\",\n" +
+ " \"AreaCode\": \"530900\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"湘A \",\n" +
+ " \"city\": \"长沙\",\n" +
+ " \"province\": \"湖南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"430121\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"湘B\",\n" +
+ " \"city\": \"株洲\",\n" +
+ " \"province\": \"湖南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"430221\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"湘C\",\n" +
+ " \"city\": \"湘潭\",\n" +
+ " \"province\": \"湖南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"430321\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"湘D\",\n" +
+ " \"city\": \"衡阳\",\n" +
+ " \"province\": \"湖南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"430421\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"湘E\",\n" +
+ " \"city\": \"邵阳\",\n" +
+ " \"province\": \"湖南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"430523\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"湘F\",\n" +
+ " \"city\": \"岳阳\",\n" +
+ " \"province\": \"湖南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"430621\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"湘G\",\n" +
+ " \"city\": \"张家界\",\n" +
+ " \"province\": \"湖南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"430800\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"湘H\",\n" +
+ " \"city\": \"益阳\",\n" +
+ " \"province\": \"湖南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"430900\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"湘J\",\n" +
+ " \"city\": \"常德\",\n" +
+ " \"province\": \"湖南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"430700\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"湘K\",\n" +
+ " \"city\": \"娄底\",\n" +
+ " \"province\": \"湖南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"431300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"湘L\",\n" +
+ " \"city\": \"郴州\",\n" +
+ " \"province\": \"湖南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"431000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"湘M\",\n" +
+ " \"city\": \"永州\",\n" +
+ " \"province\": \"湖南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"431100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"湘N\",\n" +
+ " \"city\": \"怀化\",\n" +
+ " \"province\": \"湖南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"431200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"湘U\",\n" +
+ " \"city\": \"湘西土家族苗族自治州\",\n" +
+ " \"province\": \"湖南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"433100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"新A\",\n" +
+ " \"city\": \"乌鲁木齐\",\n" +
+ " \"province\": \"新疆\",\n" +
+ " \"Pcode\": \"XJ\",\n" +
+ " \"AreaCode\": \"650121\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"新B\",\n" +
+ " \"city\": \"昌吉回族自治州\",\n" +
+ " \"province\": \"新疆\",\n" +
+ " \"Pcode\": \"XJ\",\n" +
+ " \"AreaCode\": \"652300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"新C\",\n" +
+ " \"city\": \"石河子\",\n" +
+ " \"province\": \"新疆\",\n" +
+ " \"Pcode\": \"XJ\",\n" +
+ " \"AreaCode\": \"659001\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"新D\",\n" +
+ " \"city\": \"奎屯\",\n" +
+ " \"province\": \"新疆\",\n" +
+ " \"Pcode\": \"XJ\",\n" +
+ " \"AreaCode\": \"654003\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"新E\",\n" +
+ " \"city\": \"博尔塔拉蒙古自治州\",\n" +
+ " \"province\": \"新疆\",\n" +
+ " \"Pcode\": \"XJ\",\n" +
+ " \"AreaCode\": \"652700\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"新F\",\n" +
+ " \"city\": \"伊犁哈萨克自治州直辖县\",\n" +
+ " \"province\": \"新疆\",\n" +
+ " \"Pcode\": \"XJ\",\n" +
+ " \"AreaCode\": \"654000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"新G\",\n" +
+ " \"city\": \"塔城\",\n" +
+ " \"province\": \"新疆\",\n" +
+ " \"Pcode\": \"XJ\",\n" +
+ " \"AreaCode\": \"654201\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"新H\",\n" +
+ " \"city\": \"阿勒泰\",\n" +
+ " \"province\": \"新疆\",\n" +
+ " \"Pcode\": \"XJ\",\n" +
+ " \"AreaCode\": \"654301\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"新J\",\n" +
+ " \"city\": \"克拉玛依\",\n" +
+ " \"province\": \"新疆\",\n" +
+ " \"Pcode\": \"XJ\",\n" +
+ " \"AreaCode\": \"650203\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"新K\",\n" +
+ " \"city\": \"吐鲁番\",\n" +
+ " \"province\": \"新疆\",\n" +
+ " \"Pcode\": \"XJ\",\n" +
+ " \"AreaCode\": \"650400\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"新L\",\n" +
+ " \"city\": \"哈密\",\n" +
+ " \"province\": \"新疆\",\n" +
+ " \"Pcode\": \"XJ\",\n" +
+ " \"AreaCode\": \"650500\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"新M\",\n" +
+ " \"city\": \"巴音郭愣蒙古自治州\",\n" +
+ " \"province\": \"新疆\",\n" +
+ " \"Pcode\": \"XJ\",\n" +
+ " \"AreaCode\": \"652800\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"新N\",\n" +
+ " \"city\": \"阿克苏\",\n" +
+ " \"province\": \"新疆\",\n" +
+ " \"Pcode\": \"XJ\",\n" +
+ " \"AreaCode\": \"652901\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"新P\",\n" +
+ " \"city\": \"克孜勒苏柯尔克孜自治州\",\n" +
+ " \"province\": \"新疆\",\n" +
+ " \"Pcode\": \"XJ\",\n" +
+ " \"AreaCode\": \"653000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"新Q\",\n" +
+ " \"city\": \"喀什\",\n" +
+ " \"province\": \"新疆\",\n" +
+ " \"Pcode\": \"XJ\",\n" +
+ " \"AreaCode\": \"653101\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"新R\",\n" +
+ " \"city\": \"和田\",\n" +
+ " \"province\": \"新疆\",\n" +
+ " \"Pcode\": \"XJ\",\n" +
+ " \"AreaCode\": \"653221\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"赣A\",\n" +
+ " \"city\": \"南昌\",\n" +
+ " \"province\": \"江西\",\n" +
+ " \"Pcode\": \"JX\",\n" +
+ " \"AreaCode\": \"360121\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"赣B\",\n" +
+ " \"city\": \"赣州\",\n" +
+ " \"province\": \"江西\",\n" +
+ " \"Pcode\": \"JX\",\n" +
+ " \"AreaCode\": \"360700\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"赣C\",\n" +
+ " \"city\": \"宜春\",\n" +
+ " \"province\": \"江西\",\n" +
+ " \"Pcode\": \"JX\",\n" +
+ " \"AreaCode\": \"360900\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"赣D\",\n" +
+ " \"city\": \"吉安\",\n" +
+ " \"province\": \"江西\",\n" +
+ " \"Pcode\": \"JX\",\n" +
+ " \"AreaCode\": \"360821\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"赣E\",\n" +
+ " \"city\": \"上饶\",\n" +
+ " \"province\": \"江西\",\n" +
+ " \"Pcode\": \"JX\",\n" +
+ " \"AreaCode\": \"361121\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"赣F\",\n" +
+ " \"city\": \"抚州\",\n" +
+ " \"province\": \"江西\",\n" +
+ " \"Pcode\": \"JX\",\n" +
+ " \"AreaCode\": \"361000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"赣G\",\n" +
+ " \"city\": \"九江\",\n" +
+ " \"province\": \"江西\",\n" +
+ " \"Pcode\": \"JX\",\n" +
+ " \"AreaCode\": \"360421\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"赣H\",\n" +
+ " \"city\": \"景德镇\",\n" +
+ " \"province\": \"江西\",\n" +
+ " \"Pcode\": \"JX\",\n" +
+ " \"AreaCode\": \"360200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"赣J\",\n" +
+ " \"city\": \"萍乡\",\n" +
+ " \"province\": \"江西\",\n" +
+ " \"Pcode\": \"JX\",\n" +
+ " \"AreaCode\": \"360300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"赣K\",\n" +
+ " \"city\": \"新余\",\n" +
+ " \"province\": \"江西\",\n" +
+ " \"Pcode\": \"JX\",\n" +
+ " \"AreaCode\": \"360500\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"赣L\",\n" +
+ " \"city\": \"鹰潭\",\n" +
+ " \"province\": \"江西\",\n" +
+ " \"Pcode\": \"JX\",\n" +
+ " \"AreaCode\": \"360600\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"赣M\",\n" +
+ " \"city\": \"南昌,直系统\",\n" +
+ " \"province\": \"江西\",\n" +
+ " \"Pcode\": \"JX\",\n" +
+ " \"AreaCode\": null\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"甘A\",\n" +
+ " \"city\": \"兰州\",\n" +
+ " \"province\": \"甘肃\",\n" +
+ " \"Pcode\": \"GS\",\n" +
+ " \"AreaCode\": \"620100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"甘B\",\n" +
+ " \"city\": \"嘉峪关\",\n" +
+ " \"province\": \"甘肃\",\n" +
+ " \"Pcode\": \"GS\",\n" +
+ " \"AreaCode\": \"620200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"甘C\",\n" +
+ " \"city\": \"金昌\",\n" +
+ " \"province\": \"甘肃\",\n" +
+ " \"Pcode\": \"GS\",\n" +
+ " \"AreaCode\": \"620300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"甘D\",\n" +
+ " \"city\": \"白银\",\n" +
+ " \"province\": \"甘肃\",\n" +
+ " \"Pcode\": \"GS\",\n" +
+ " \"AreaCode\": \"620402\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"甘E\",\n" +
+ " \"city\": \"天水\",\n" +
+ " \"province\": \"甘肃\",\n" +
+ " \"Pcode\": \"GS\",\n" +
+ " \"AreaCode\": \"620500\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"甘F\",\n" +
+ " \"city\": \"酒泉\",\n" +
+ " \"province\": \"甘肃\",\n" +
+ " \"Pcode\": \"GS\",\n" +
+ " \"AreaCode\": \"620900\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"甘G\",\n" +
+ " \"city\": \"张掖\",\n" +
+ " \"province\": \"甘肃\",\n" +
+ " \"Pcode\": \"GS\",\n" +
+ " \"AreaCode\": \"620700\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"甘H\",\n" +
+ " \"city\": \"武威\",\n" +
+ " \"province\": \"甘肃\",\n" +
+ " \"Pcode\": \"GS\",\n" +
+ " \"AreaCode\": \"620600\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"甘J\",\n" +
+ " \"city\": \"定西\",\n" +
+ " \"province\": \"甘肃\",\n" +
+ " \"Pcode\": \"GS\",\n" +
+ " \"AreaCode\": \"621100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"甘K\",\n" +
+ " \"city\": \"陇南\",\n" +
+ " \"province\": \"甘肃\",\n" +
+ " \"Pcode\": \"GS\",\n" +
+ " \"AreaCode\": \"621200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"甘L\",\n" +
+ " \"city\": \"平凉\",\n" +
+ " \"province\": \"甘肃\",\n" +
+ " \"Pcode\": \"GS\",\n" +
+ " \"AreaCode\": \"620800\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"甘M\",\n" +
+ " \"city\": \"庆阳\",\n" +
+ " \"province\": \"甘肃\",\n" +
+ " \"Pcode\": \"GS\",\n" +
+ " \"AreaCode\": \"621000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"甘N\",\n" +
+ " \"city\": \"临夏回族自治州\",\n" +
+ " \"province\": \"甘肃\",\n" +
+ " \"Pcode\": \"GS\",\n" +
+ " \"AreaCode\": \"622900\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"甘P\",\n" +
+ " \"city\": \"甘南藏族自治州\",\n" +
+ " \"province\": \"甘肃\",\n" +
+ " \"Pcode\": \"GS\",\n" +
+ " \"AreaCode\": \"623000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"陕A\",\n" +
+ " \"city\": \"西安\",\n" +
+ " \"province\": \"陕西\",\n" +
+ " \"Pcode\": \"SX\",\n" +
+ " \"AreaCode\": \"610100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"陕B\",\n" +
+ " \"city\": \"铜川\",\n" +
+ " \"province\": \"陕西\",\n" +
+ " \"Pcode\": \"SX\",\n" +
+ " \"AreaCode\": \"610200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"陕C\",\n" +
+ " \"city\": \"宝鸡\",\n" +
+ " \"province\": \"陕西\",\n" +
+ " \"Pcode\": \"SX\",\n" +
+ " \"AreaCode\": \"610300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"陕D\",\n" +
+ " \"city\": \"咸阳\",\n" +
+ " \"province\": \"陕西\",\n" +
+ " \"Pcode\": \"SX\",\n" +
+ " \"AreaCode\": \"610400\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"陕E\",\n" +
+ " \"city\": \"渭南\",\n" +
+ " \"province\": \"陕西\",\n" +
+ " \"Pcode\": \"SX\",\n" +
+ " \"AreaCode\": \"610500\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"陕F\",\n" +
+ " \"city\": \"汉中\",\n" +
+ " \"province\": \"陕西\",\n" +
+ " \"Pcode\": \"SX\",\n" +
+ " \"AreaCode\": \"610700\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"陕G\",\n" +
+ " \"city\": \"安康\",\n" +
+ " \"province\": \"陕西\",\n" +
+ " \"Pcode\": \"SX\",\n" +
+ " \"AreaCode\": \"610900\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"陕H\",\n" +
+ " \"city\": \"商洛\",\n" +
+ " \"province\": \"陕西\",\n" +
+ " \"Pcode\": \"SX\",\n" +
+ " \"AreaCode\": \"611000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"陕J\",\n" +
+ " \"city\": \"延安\",\n" +
+ " \"province\": \"陕西\",\n" +
+ " \"Pcode\": \"SX\",\n" +
+ " \"AreaCode\": \"610600\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"陕K\",\n" +
+ " \"city\": \"榆林\",\n" +
+ " \"province\": \"陕西\",\n" +
+ " \"Pcode\": \"SX\",\n" +
+ " \"AreaCode\": \"610800\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"陕V\",\n" +
+ " \"city\": \"杨凌高新农业示范区\",\n" +
+ " \"province\": \"陕西\",\n" +
+ " \"Pcode\": \"SX\",\n" +
+ " \"AreaCode\": \"610403\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"贵A\",\n" +
+ " \"city\": \"贵阳\",\n" +
+ " \"province\": \"贵州\",\n" +
+ " \"Pcode\": \"GZ\",\n" +
+ " \"AreaCode\": \"520100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"贵B\",\n" +
+ " \"city\": \"六盘水\",\n" +
+ " \"province\": \"贵州\",\n" +
+ " \"Pcode\": \"GZ\",\n" +
+ " \"AreaCode\": \"520200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"贵C\",\n" +
+ " \"city\": \"遵义\",\n" +
+ " \"province\": \"贵州\",\n" +
+ " \"Pcode\": \"GZ\",\n" +
+ " \"AreaCode\": \"520300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"贵D\",\n" +
+ " \"city\": \"铜仁\",\n" +
+ " \"province\": \"贵州\",\n" +
+ " \"Pcode\": \"GZ\",\n" +
+ " \"AreaCode\": \"520600\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"贵E\",\n" +
+ " \"city\": \"黔西南布依族苗族自治州\",\n" +
+ " \"province\": \"贵州\",\n" +
+ " \"Pcode\": \"GZ\",\n" +
+ " \"AreaCode\": \"522300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"贵F\",\n" +
+ " \"city\": \"毕节\",\n" +
+ " \"province\": \"贵州\",\n" +
+ " \"Pcode\": \"GZ\",\n" +
+ " \"AreaCode\": \"520500\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"贵G\",\n" +
+ " \"city\": \"安顺\",\n" +
+ " \"province\": \"贵州\",\n" +
+ " \"Pcode\": \"GZ\",\n" +
+ " \"AreaCode\": \"520400\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"贵H\",\n" +
+ " \"city\": \"黔东南苗族侗族自治州\",\n" +
+ " \"province\": \"贵州\",\n" +
+ " \"Pcode\": \"GZ\",\n" +
+ " \"AreaCode\": \"522600\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"贵J\",\n" +
+ " \"city\": \"黔南布依族苗族自治州\",\n" +
+ " \"province\": \"贵州\",\n" +
+ " \"Pcode\": \"GZ\",\n" +
+ " \"AreaCode\": \"522700\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"青A\",\n" +
+ " \"city\": \"西宁\",\n" +
+ " \"province\": \"青海\",\n" +
+ " \"Pcode\": \"QH\",\n" +
+ " \"AreaCode\": \"630100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"青B\",\n" +
+ " \"city\": \"海东\",\n" +
+ " \"province\": \"青海\",\n" +
+ " \"Pcode\": \"QH\",\n" +
+ " \"AreaCode\": \"630200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"青C\",\n" +
+ " \"city\": \"海北藏族自治州\",\n" +
+ " \"province\": \"青海\",\n" +
+ " \"Pcode\": \"QH\",\n" +
+ " \"AreaCode\": \"632200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"青D\",\n" +
+ " \"city\": \"黄南藏族自治州\",\n" +
+ " \"province\": \"青海\",\n" +
+ " \"Pcode\": \"QH\",\n" +
+ " \"AreaCode\": \"632300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"青E\",\n" +
+ " \"city\": \"藏族自治州\",\n" +
+ " \"province\": \"青海\",\n" +
+ " \"Pcode\": \"QH\",\n" +
+ " \"AreaCode\": \"632800\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"青F\",\n" +
+ " \"city\": \"果洛藏族自治州\",\n" +
+ " \"province\": \"青海\",\n" +
+ " \"Pcode\": \"QH\",\n" +
+ " \"AreaCode\": \"632600\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"青G\",\n" +
+ " \"city\": \"玉树藏族自治州\",\n" +
+ " \"province\": \"青海\",\n" +
+ " \"Pcode\": \"QH\",\n" +
+ " \"AreaCode\": \"632700\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"青H\",\n" +
+ " \"city\": \"海西蒙古族藏族自治州\",\n" +
+ " \"province\": \"青海\",\n" +
+ " \"Pcode\": \"QH\",\n" +
+ " \"AreaCode\": \"632800\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"藏A\",\n" +
+ " \"city\": \"拉萨\",\n" +
+ " \"province\": \"西藏\",\n" +
+ " \"Pcode\": \"XC\",\n" +
+ " \"AreaCode\": \"540100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"藏B\",\n" +
+ " \"city\": \"昌都地区\",\n" +
+ " \"province\": \"西藏\",\n" +
+ " \"Pcode\": \"XC\",\n" +
+ " \"AreaCode\": \"540300\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"藏C\",\n" +
+ " \"city\": \"山南地区\",\n" +
+ " \"province\": \"西藏\",\n" +
+ " \"Pcode\": \"XC\",\n" +
+ " \"AreaCode\": \"542200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"藏D\",\n" +
+ " \"city\": \"日喀则地区\",\n" +
+ " \"province\": \"西藏\",\n" +
+ " \"Pcode\": \"XC\",\n" +
+ " \"AreaCode\": \"540200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"藏E\",\n" +
+ " \"city\": \"那曲地区\",\n" +
+ " \"province\": \"西藏\",\n" +
+ " \"Pcode\": \"XC\",\n" +
+ " \"AreaCode\": \"542400\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"藏F\",\n" +
+ " \"city\": \"阿里地区\",\n" +
+ " \"province\": \"西藏\",\n" +
+ " \"Pcode\": \"XC\",\n" +
+ " \"AreaCode\": \"542500\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"藏G\",\n" +
+ " \"city\": \"林芝地区\",\n" +
+ " \"province\": \"西藏\",\n" +
+ " \"Pcode\": \"XC\",\n" +
+ " \"AreaCode\": \"540400\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"藏H\",\n" +
+ " \"city\": \"天全县车辆管理所\",\n" +
+ " \"province\": \"西藏\",\n" +
+ " \"Pcode\": \"XC\",\n" +
+ " \"AreaCode\": null\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"藏J\",\n" +
+ " \"city\": \"格尔木车辆管理所\",\n" +
+ " \"province\": \"西藏\",\n" +
+ " \"Pcode\": \"XC\",\n" +
+ " \"AreaCode\": null\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"琼A\",\n" +
+ " \"city\": \"海口\",\n" +
+ " \"province\": \"海南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"460100\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"琼B\",\n" +
+ " \"city\": \"三亚\",\n" +
+ " \"province\": \"海南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"460200\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"琼C\",\n" +
+ " \"city\": \"琼海\",\n" +
+ " \"province\": \"海南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"469002\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"琼D\",\n" +
+ " \"city\": \"五指山\",\n" +
+ " \"province\": \"海南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": \"469001\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"琼E\",\n" +
+ " \"city\": \"洋浦开发区\",\n" +
+ " \"province\": \"海南\",\n" +
+ " \"Pcode\": \"HN\",\n" +
+ " \"AreaCode\": null\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"沪A\",\n" +
+ " \"city\": \"上海\",\n" +
+ " \"province\": \"上海\",\n" +
+ " \"Pcode\": \"SH\",\n" +
+ " \"AreaCode\": \"310000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"沪B\",\n" +
+ " \"city\": \"上海\",\n" +
+ " \"province\": \"上海\",\n" +
+ " \"Pcode\": \"SH\",\n" +
+ " \"AreaCode\": \"310000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"沪C\",\n" +
+ " \"city\": \"上海\",\n" +
+ " \"province\": \"上海\",\n" +
+ " \"Pcode\": \"SH\",\n" +
+ " \"AreaCode\": \"310000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"沪D\",\n" +
+ " \"city\": \"上海\",\n" +
+ " \"province\": \"上海\",\n" +
+ " \"Pcode\": \"SH\",\n" +
+ " \"AreaCode\": \"310000\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"Hp\": \"沪R\",\n" +
+ " \"city\": \"崇明\",\n" +
+ " \"province\": \"上海\",\n" +
+ " \"Pcode\": \"SH\",\n" +
+ " \"AreaCode\": \"310151\"\n" +
+ " }\n" +
+ " ]\n" +
"}\n" +
- "]}";
+ "\n";
String hp = num.substring(0, 2);//
JSONObject jsonObject = JSONObject.parseObject(jsonStr);
- JSONArray data = jsonObject.getJSONArray("date");
+ JSONArray data = jsonObject.getJSONArray("codeInfo");
List<CarNumDto> carNumDtos = JSONObject.parseArray(data.toJSONString(), CarNumDto.class);
CarNumDto carNumDto = new CarNumDto();
for (CarNumDto carNumDtoTemp : carNumDtos) {
- if (carNumDtoTemp.getCode().equals(hp)) {
+ if (carNumDtoTemp.getHp().equals(hp)) {
carNumDto.setCity(carNumDtoTemp.getCity());
- carNumDto.setCode(carNumDtoTemp.getCode());
+ carNumDto.setHp(carNumDtoTemp.getHp());
carNumDto.setProvince(carNumDtoTemp.getProvince());
+ carNumDto.setAreaCode(carNumDtoTemp.getAreaCode());
break;
}
}
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/GiveVipUtil.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/GiveVipUtil.java
index 4090c02..b33e709 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/GiveVipUtil.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/GiveVipUtil.java
@@ -31,11 +31,11 @@
private OtherClient otherClient;
@Resource
private TAppCouponService appCouponService;
- public void sendVip(TAppUser nowUser,Integer vipId,Integer plusDay){
+ public void sendVip(TAppUser nowUser,Integer vipId,Integer plusDay,Integer type){
if (nowUser.getVipEndTime()==null||nowUser.getVipEndTime().isBefore(LocalDateTime.now())) {
- nowUser.setVipEndTime(LocalDateTime.now().plusMonths(plusDay));
-
+ nowUser.setVipEndTime(LocalDateTime.now().plusMonths(plusDay).minusDays(1));
+ nowUser.setVipId(vipId);
//直接再detail里新增数据,因为不是续费
TAppUserVipDetail tAppUserVipDetail = new TAppUserVipDetail();
tAppUserVipDetail.setAppUserId(nowUser.getId());
@@ -56,6 +56,7 @@
tAppUserVipDetail.setDiscountMoney(vip.getMaximumDeduction());
tAppUserVipDetail.setSendMonth(1);
tAppUserVipDetail.setVipJson(JSON.toJSONString(info.getData()));
+ tAppUserVipDetail.setVipType(type);
tAppUserVipDetailService.save(tAppUserVipDetail);
//直接赠送优惠卷
for (SendCouponDto sendCouponDto : javaList) {
@@ -83,20 +84,21 @@
}else {
- nowUser.setVipEndTime(nowUser.getVipEndTime().plusDays(plusDay).minusDays(1));
+// nowUser.setVipEndTime(nowUser.getVipEndTime().plusDays(plusDay).minusDays(1));
//获取detail里结束时间大于当前时间的数据,并将enttime延长
- TAppUserVipDetail tAppUserVipDetail = tAppUserVipDetailService.lambdaQuery().eq(TAppUserVipDetail::getVipId,vipId).eq(TAppUserVipDetail::getAppUserId, nowUser.getId()).orderByDesc(TAppUserVipDetail::getEndTime).last("limit 1").one();
- if (tAppUserVipDetail!=null) {
- List<TAppUserVipDetail> list = tAppUserVipDetailService.lambdaQuery().eq(TAppUserVipDetail::getAppUserId, nowUser.getId()).ge(TAppUserVipDetail::getStartTime, tAppUserVipDetail.getEndTime()).list();
- for (TAppUserVipDetail appUserVipDetail : list) {
- appUserVipDetail.setStartTime(appUserVipDetail.getStartTime().plusMonths(plusDay).minusDays(1));
- appUserVipDetail.setEndTime(appUserVipDetail.getEndTime().plusMonths(plusDay).minusDays(1));
- }
- tAppUserVipDetailService.updateBatchById(list);
- tAppUserVipDetail.setEndTime(tAppUserVipDetail.getEndTime().plusMonths(plusDay).minusDays(1));
-
- tAppUserVipDetailService.updateById(tAppUserVipDetail);
- }else {
+// TAppUserVipDetail tAppUserVipDetail = tAppUserVipDetailService.lambdaQuery().eq(TAppUserVipDetail::getVipId,vipId).eq(TAppUserVipDetail::getAppUserId, nowUser.getId()).orderByDesc(TAppUserVipDetail::getEndTime).last("limit 1").one();
+// if (tAppUserVipDetail!=null) {
+// List<TAppUserVipDetail> list = tAppUserVipDetailService.lambdaQuery().eq(TAppUserVipDetail::getAppUserId, nowUser.getId()).ge(TAppUserVipDetail::getStartTime, tAppUserVipDetail.getEndTime()).list();
+// for (TAppUserVipDetail appUserVipDetail : list) {
+// appUserVipDetail.setStartTime(appUserVipDetail.getStartTime().plusMonths(plusDay).minusDays(1));
+// appUserVipDetail.setEndTime(appUserVipDetail.getEndTime().plusMonths(plusDay).minusDays(1));
+// }
+// tAppUserVipDetailService.updateBatchById(list);
+// tAppUserVipDetail.setEndTime(tAppUserVipDetail.getEndTime().plusMonths(plusDay).minusDays(1));
+//
+// tAppUserVipDetailService.updateById(tAppUserVipDetail);
+// }else
+// {
TAppUserVipDetail tAppUserVipDetail2 = tAppUserVipDetailService.lambdaQuery().eq(TAppUserVipDetail::getAppUserId, nowUser.getId()).orderByDesc(TAppUserVipDetail::getEndTime).last("limit 1").one();
TAppUserVipDetail tAppUserVipDetail1 = new TAppUserVipDetail();
@@ -107,20 +109,18 @@
R<TVip> info = vipClient.getInfo1(vipId);
TVip vip = info.getData();
- List<SendCouponDto> javaList = new ArrayList<>();
- if (vip.getCoupon()!=null) {
- javaList = JSON.parseArray(vip.getCoupon()).toJavaList(SendCouponDto.class);
- }
+
tAppUserVipDetail1.setCouponIds(vip.getCoupon());
tAppUserVipDetail1.setSendChargeNum(vip.getDiscountTimes());
tAppUserVipDetail1.setChargeNum(vip.getDiscountTimes());
tAppUserVipDetail1.setDiscountMoney(vip.getMaximumDeduction());
tAppUserVipDetail1.setSendMonth(1);
- tAppUserVipDetail.setVipJson(JSON.toJSONString(info.getData()));
+ tAppUserVipDetail1.setVipType(type);
+ tAppUserVipDetail1.setVipJson(JSON.toJSONString(info.getData()));
tAppUserVipDetailService.save(tAppUserVipDetail1);
- }
+// }
}
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/PointDetailUtil.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/PointDetailUtil.java
index 4b935ac..54fd849 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/PointDetailUtil.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/PointDetailUtil.java
@@ -12,7 +12,7 @@
public class PointDetailUtil {
@Resource
private TAppUserIntegralChangeService appUserIntegralChangeService;
- public void addDetail(Integer old,Integer now,Integer type,Long userId,String extension,String code){
+ public void addDetail(Integer old,Integer now,Integer type,Long userId,String extension,String code,String orderCode){
TAppUserIntegralChange tAppUserIntegralChange= new TAppUserIntegralChange();
tAppUserIntegralChange.setCode(OrderCodeUtil.getOrderCode(code));
@@ -22,6 +22,7 @@
tAppUserIntegralChange.setCurrentIntegral(now);
tAppUserIntegralChange.setCreateTime(LocalDateTime.now());
tAppUserIntegralChange.setExtension(extension);
+ tAppUserIntegralChange.setOrderCode(orderCode);
appUserIntegralChangeService.save(tAppUserIntegralChange);
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/wx/tools/WxAppletTools.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/wx/tools/WxAppletTools.java
index 2dd2f67..6f19eea 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/wx/tools/WxAppletTools.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/wx/tools/WxAppletTools.java
@@ -5,6 +5,7 @@
import com.ruoyi.account.wx.body.resq.Code2SessionResqBody;
import com.ruoyi.account.wx.model.WeixinProperties;
import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import org.springframework.web.client.RestTemplate;
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/PartnerController.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/PartnerController.java
index 46ae69f..9739d0d 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/PartnerController.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/PartnerController.java
@@ -148,4 +148,14 @@
}
+ /**
+ * 根据id获取合作商信息
+ * @param id
+ * @return
+ */
+ @PostMapping("/getPartnerById/{id}")
+ public R<Partner> getPartnerById(@PathVariable("id") Integer id){
+ Partner partner = partnerService.getPartner(id);
+ return R.ok(partner);
+ }
}
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/SiteController.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/SiteController.java
index 48c8673..8d76a88 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/SiteController.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/SiteController.java
@@ -107,11 +107,14 @@
* @param number
* @return
*/
- @PostMapping("/getSiteInfoByNumber")
+ @GetMapping("/getSiteInfoByNumber")
@ApiOperation(value = "扫一扫后通过桩编号获取电站信息", tags = {"小程序-扫一扫"})
public R<SiteInfoVO> getSiteInfoByNumber(@RequestParam("number") String number){
SiteInfoVO siteInfoVO = new SiteInfoVO();
- TChargingPile one = chargingPileService.lambdaQuery().eq(TChargingPile::getNumber, number).one();
+ String chargingPileCode = number.substring(0, number.length() - 2);
+ String chargingGunCode = number.substring(number.length() - 2);
+ TChargingPile one = chargingPileService.lambdaQuery().eq(TChargingPile::getCode, chargingPileCode).one();
+ TChargingGun chargingGun = chargingGunService.getOne(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getCode, chargingGunCode).eq(TChargingGun::getChargingPileId, one.getId()));
Site byId = siteService.getById(one.getSiteId());
TAccountingStrategy byId1 = accountingStrategyService.getById(byId.getAccountingStrategyId());
List<TAccountingStrategyDetail> list = accountingStrategyDetailService.lambdaQuery().eq(TAccountingStrategyDetail::getAccountingStrategyId, byId1.getId()).list();
@@ -122,6 +125,33 @@
siteInfoVO.setVipElectrovalence(tAccountingStrategyDetail.getElectrovalence().multiply(byId1.getDiscount()).setScale(4, BigDecimal.ROUND_HALF_UP));
}
}
+ siteInfoVO.setChargingGunId(chargingGun.getId());
+ siteInfoVO.setChargingPileId(one.getId());
+ siteInfoVO.setName(byId.getName());
+ siteInfoVO.setNumber(one.getNumber().toString());
+ siteInfoVO.setSpaceChargeExplain(byId.getSpaceChargeExplain());
+ return R.ok(siteInfoVO);
+ }
+ /**
+ * 通过桩编号获取电站信息 遠程調用
+ * @param number
+ * @return
+ */
+ @PostMapping("/getSiteInfoByNumber1")
+ public R<SiteInfoVO> getSiteInfoByNumber1(@RequestParam("number") String number){
+ SiteInfoVO siteInfoVO = new SiteInfoVO();
+ TChargingPile one = chargingPileService.lambdaQuery().eq(TChargingPile::getCode, number).one();
+ Site byId = siteService.getById(one.getSiteId());
+ TAccountingStrategy byId1 = accountingStrategyService.getById(byId.getAccountingStrategyId());
+ List<TAccountingStrategyDetail> list = accountingStrategyDetailService.lambdaQuery().eq(TAccountingStrategyDetail::getAccountingStrategyId, byId1.getId()).list();
+ for (TAccountingStrategyDetail tAccountingStrategyDetail : list) {
+ // 当前时间属于那个阶段 取哪个阶段的电价
+ if(LocalTime.now().isAfter(LocalTime.parse(tAccountingStrategyDetail.getStartTime())) && LocalTime.now().isBefore(LocalTime.parse(tAccountingStrategyDetail.getEndTime()))){
+ siteInfoVO.setElectrovalence(tAccountingStrategyDetail.getElectrovalence());
+ siteInfoVO.setVipElectrovalence(tAccountingStrategyDetail.getElectrovalence().multiply(byId1.getDiscount()).setScale(4, BigDecimal.ROUND_HALF_UP));
+ }
+ }
+ siteInfoVO.setChargingPileId(one.getId());
siteInfoVO.setName(byId.getName());
siteInfoVO.setNumber(one.getNumber().toString());
siteInfoVO.setSpaceChargeExplain(byId.getSpaceChargeExplain());
@@ -134,6 +164,8 @@
PageInfo<GetSiteListDTO> list = siteService.getSiteList(siteList);
return AjaxResult.success(list);
}
+
+
@GetMapping("/getSiteList/byUserId")
@ApiOperation(value = "获取站点列表", tags = {"管理后台-站点管理"})
public R<List<GetSiteListDTO>> getSiteListByUserId(@RequestParam("userId") Long userId){
@@ -394,7 +426,7 @@
@ResponseBody
@PostMapping("/getSiteByIds")
public R<List<Site>> getSiteByIds(@RequestBody List<Integer> ids){
- List<Site> sites = siteService.listByIds(ids);
+ List<Site> sites = siteService.list(new LambdaQueryWrapper<Site>().in(Site::getId, ids).eq(Site::getDelFlag, 0));
return R.ok(sites);
}
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyController.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyController.java
index 67c3b9e..0e418d1 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyController.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyController.java
@@ -1,12 +1,10 @@
package com.ruoyi.chargingPile.controller;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.ruoyi.account.api.feignClient.AppUserClient;
import com.ruoyi.chargingPile.api.dto.TAccountingStrategyDTO;
import com.ruoyi.chargingPile.api.model.*;
+import com.ruoyi.chargingPile.api.query.BatchSetAccountingStrategy;
import com.ruoyi.chargingPile.api.query.TAccountingStrategyQuery;
import com.ruoyi.chargingPile.api.vo.TAccountingStrategyDetailVO;
import com.ruoyi.chargingPile.api.vo.TAccountingStrategyVO;
@@ -16,18 +14,16 @@
import com.ruoyi.chargingPile.service.TChargingPileService;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.dto.SteategyPassDto;
-import com.ruoyi.common.core.enums.AuditStateEnum;
import com.ruoyi.common.core.web.domain.AjaxResult;
-import com.ruoyi.common.core.web.domain.BaseDelete;
import com.ruoyi.common.core.web.page.PageInfo;
-import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.log.enums.OperatorType;
+import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.common.security.utils.SecurityUtils;
+import com.ruoyi.integration.api.feignClient.IntegrationClient;
import com.ruoyi.system.api.domain.SysUser;
import com.ruoyi.system.api.feignClient.SysUserClient;
-import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -66,8 +62,7 @@
private ISiteService siteService;
@Autowired
private SysUserClient sysUserClient;
- @Resource
- private TokenService tokenService;
+
@Autowired
public TAccountingStrategyController(TAccountingStrategyService accountingStrategyService, TAccountingStrategyDetailService accountingStrategyDetailService) {
@@ -142,7 +137,7 @@
return AjaxResult.error("同阶段费率值需一致");
}
// 判断修改的计费策略是否为已通过
- if(dto.getAuditStatus() == 3 || dto.getAuditStatus() == 4){
+ if(null != dto.getAuditStatus() && (dto.getAuditStatus() == 3 || dto.getAuditStatus() == 4)){
// 查询是否有下级审核中的策略
TAccountingStrategy children = accountingStrategyService.getOne(Wrappers.lambdaQuery(TAccountingStrategy.class)
.eq(TAccountingStrategy::getParentId, dto.getId())
@@ -311,6 +306,8 @@
return AjaxResult.ok(accountingStrategyService.pageList(query));
}
+ @Resource
+ private IntegrationClient integrationClient;
@ApiOperation(tags = {"后台-申请表单-计费模板审核"},value = "审核")
@PostMapping(value = "/auth/pass")
@@ -347,10 +344,22 @@
}
//硬件
+ List<TChargingPile> list = chargingPileService.lambdaQuery().eq(TChargingPile::getSiteId, byId.getSiteId()).list();
+ for (TChargingPile tChargingPile : list) {
+ integrationClient.setupBillingModel1(tChargingPile.getCode());
+ }
}
}else {
+ if (byId.getAuditStatus()==1){
+
+ byId.setFirstRemark(steategyPassDto.getRemark());
+
+ }else if (byId.getAuditStatus()==2){
+ byId.setTwoRemark(steategyPassDto.getRemark());
+ }
+
byId.setAuditStatus(4);
}
accountingStrategyService.updateById(byId);
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TApplyChargingPileController.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TApplyChargingPileController.java
index 74e0baf..c7e799f 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TApplyChargingPileController.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TApplyChargingPileController.java
@@ -130,7 +130,7 @@
@ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "列表")
@PostMapping(value = "/page")
- public AjaxResult<Page<TApplyChargingPile>> page(ApplyChargingQuery applyChargingQuery) {
+ public AjaxResult<Page<TApplyChargingPile>> page(@RequestBody ApplyChargingQuery applyChargingQuery) {
Page<TApplyChargingPile> page = applyChargingPileService.lambdaQuery()
.like(applyChargingQuery.getLandlordPhone() != null && !applyChargingQuery.getLandlordPhone().equals(""), TApplyChargingPile::getLandlordPhone, applyChargingQuery.getLandlordPhone())
.page(Page.of(applyChargingQuery.getPageCurr(), applyChargingQuery.getPageSize()));
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingGunController.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingGunController.java
index ecb1330..76886af 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingGunController.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingGunController.java
@@ -14,6 +14,7 @@
import com.ruoyi.chargingPile.api.vo.GunStatusStatisticsVO;
import com.ruoyi.chargingPile.api.vo.SiteNameVO;
import com.ruoyi.chargingPile.api.vo.TChargingGunVO;
+import com.ruoyi.chargingPile.config.FileUploadConfig;
import com.ruoyi.chargingPile.service.ISiteService;
import com.ruoyi.chargingPile.service.TChargingGunService;
import com.ruoyi.chargingPile.service.TChargingPileService;
@@ -63,13 +64,16 @@
@Autowired
private TChargingGunService chargingGunService;
- @Autowired
+ @Resource
private ChargingOrderClient chargingOrderClient;
@Resource
private TChargingPileService chargingPileService;
@Resource
private ISiteService siteService;
+
+ @Autowired
+ private FileUploadConfig fileUploadConfig;
/**
* 查询充电枪列表
@@ -152,11 +156,13 @@
public void downloadQRCode(@PathVariable Integer id, HttpServletResponse response){
try {
TChargingGun chargingGun = chargingGunService.getById(id);
- String fileName = URLEncoder.encode(chargingGun.getCode(), "UTF-8") + ".jpg";
+ TChargingPile chargingPile = chargingPileService.getById(chargingGun.getId());
+ String code = chargingPile.getCode() + chargingGun.getCode();
+ String fileName = URLEncoder.encode(code, "UTF-8") + ".jpg";
response.setContentType("application/force-download");
response.addHeader("Content-Disposition", "attachment;fileName=" + fileName);
- String url = "https://www.baidu.com?id=" + id;
- String filePath = "D:/Program Files/nginx-1.20.2/html";
+ String url = "https://mxcd.zhinenganguan.com?No=" + code;
+ String filePath = fileUploadConfig.getLocation();
QRCodeUtils.encode(url, filePath);
FileInputStream inputStream = new FileInputStream(filePath);
ServletOutputStream out = response.getOutputStream();
@@ -178,7 +184,7 @@
*/
@ApiOperation(tags = {"后台-工作台"},value = "设备状态统计")
@PutMapping(value = "/gunStatusStatistics")
- public AjaxResult<GunStatusStatisticsVO> gunStatusStatistics() {
+ public R<GunStatusStatisticsVO> gunStatusStatistics() {
List<Integer> siteIds = new ArrayList<>();
Long userId = SecurityUtils.getUserId();
//获取当前登录的siteIds
@@ -186,7 +192,7 @@
for (GetSiteListDTO datum : siteList1.getRecords()) {
siteIds.add(datum.getId());
}
- return AjaxResult.ok(chargingGunService.gunStatusStatistics(siteIds));
+ return R.ok(chargingGunService.gunStatusStatistics(siteIds));
}
/**
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingPileController.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingPileController.java
index 787cdbb..11b93a1 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingPileController.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingPileController.java
@@ -1,6 +1,7 @@
package com.ruoyi.chargingPile.controller;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.chargingPile.api.model.TChargingGun;
import com.ruoyi.chargingPile.api.model.TChargingPile;
@@ -10,8 +11,7 @@
import com.ruoyi.chargingPile.dto.ChargingGunCountMonitoring;
import com.ruoyi.chargingPile.dto.ChargingGunMonitoring;
import com.ruoyi.chargingPile.dto.GetChargingGunMonitoring;
-import com.ruoyi.chargingPile.service.TChargingGunService;
-import com.ruoyi.chargingPile.service.TChargingPileService;
+import com.ruoyi.chargingPile.service.*;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.PageInfo;
@@ -25,6 +25,7 @@
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.log.enums.OperatorType;
+import com.ruoyi.other.api.domain.TVip;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@@ -36,6 +37,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
+import java.math.BigDecimal;
import java.util.List;
/**
@@ -53,6 +55,12 @@
private final TChargingPileService chargingPileService;
private final TChargingGunService chargingGunService;
+
+ @Resource
+ private TAccountingStrategyService accountingStrategyService;
+
+ @Resource
+ private TAccountingStrategyDetailService accountingStrategyDetailService;
@Autowired
@@ -197,5 +205,6 @@
TChargingPile chargingPile = chargingPileService.getById(id);
return R.ok(chargingPile);
}
+
}
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/filter/AuthFilter.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/filter/AuthFilter.java
index b0304bb..e04e19d 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/filter/AuthFilter.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/filter/AuthFilter.java
@@ -81,7 +81,7 @@
return;
}
}
- filterChain.doFilter(request, response);
+ filterChain.doFilter(servletRequest, servletResponse);
}
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/mapper/TChargingGunMapper.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/mapper/TChargingGunMapper.java
index 1dfd10a..822212c 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/mapper/TChargingGunMapper.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/mapper/TChargingGunMapper.java
@@ -37,7 +37,7 @@
* @param siteIds
* @return
*/
- List<Map<Integer, Integer>> getModeStatistics(@Param("siteIds")List<Integer> siteIds);
+ List<Map<String, Object>> getModeStatistics(@Param("siteIds")List<Integer> siteIds);
/**
* 统计充电枪状态
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/PartnerServiceImpl.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/PartnerServiceImpl.java
index ae3830e..5bb8860 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/PartnerServiceImpl.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/PartnerServiceImpl.java
@@ -28,6 +28,7 @@
import io.seata.core.context.RootContext;
import io.seata.core.exception.TransactionException;
import io.seata.spring.annotation.GlobalTransactional;
+import io.seata.tm.api.GlobalTransaction;
import io.seata.tm.api.GlobalTransactionContext;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
@@ -93,10 +94,10 @@
List<SysRole> data = r.getData();
for (PartnerListDTO partnerListDTO : list) {
Integer roleId = partnerListDTO.getRoleId();
- if(null != roleId){
+ if(null == roleId){
continue;
}
- SysRole sysRole = data.stream().filter(s -> roleId.equals(s.getRoleId())).findFirst().get();
+ SysRole sysRole = data.stream().filter(s -> roleId.compareTo(s.getRoleId().intValue()) == 0).findFirst().get();
if(null != sysRole){
partnerListDTO.setRoleName(sysRole.getRoleName());
}
@@ -114,7 +115,6 @@
@Override
@GlobalTransactional(rollbackFor = Exception.class)//分布式事务
public AjaxResult addPartner(Partner partner) {
- System.err.println("事务ID:" + RootContext.getXID());
//校验参数和重复数据
AjaxResult ajaxResult = addPartnerParameterCheck(partner);
if(ajaxResult.isError()){
@@ -134,8 +134,6 @@
if(null != one){
return AjaxResult.error("登录账号不能重复");
}
- //添加新数据
- this.save(partner);
//添加登录账户
SysUser user = new SysUser();
user.setPhonenumber(partner.getPhoneOne());
@@ -149,15 +147,11 @@
user.setRoleType(2);
user.setObjectId(partner.getId());
R r = sysUserClient.addSysUser(user);
- if(r.getCode() != 200){
- // 手动进行全局事务回滚
- try {
- GlobalTransactionContext.getCurrent().rollback();
- } catch (TransactionException e) {
- throw new RuntimeException(e);
- }
- return AjaxResult.error(r.getMsg());
+ if(200 != r.getCode()){
+ throw new RuntimeException(r.getMsg());
}
+ //添加新数据
+ this.save(partner);
return AjaxResult.success();
}
@@ -245,9 +239,6 @@
}
Partner oldPartner = this.getById(partner.getId());
SysUser user = sysUserClient.queryUserByUserName(oldPartner.getAccount()).getData();
-
- //修改数据
- this.updateById(partner);
//修改登录账户
if(null == user){
user = new SysUser();
@@ -277,6 +268,9 @@
throw new RuntimeException(r.getMsg());
}
}
+
+ //修改数据
+ this.updateById(partner);
return AjaxResult.success();
}
@@ -292,12 +286,12 @@
//站点
long count = siteService.count(new LambdaQueryWrapper<Site>().in(Site::getPartnerId, Arrays.asList(ids)).eq(Site::getDelFlag, 0));
if(count > 0){
- return AjaxResult.error("当前合作商有关联站点,删除失败!");
+ return AjaxResult.error("该合作商已关联站点不可删除!");
}
//充电桩
- long count1 = chargingPileService.count(new LambdaQueryWrapper<TChargingPile>().eq(TChargingPile::getPartnerId, Arrays.asList(ids)).eq(TChargingPile::getDelFlag, 0));
+ long count1 = chargingPileService.count(new LambdaQueryWrapper<TChargingPile>().in(TChargingPile::getPartnerId, Arrays.asList(ids)).eq(TChargingPile::getDelFlag, 0));
if(count1 > 0){
- return AjaxResult.error("当前合作商有关联充电桩,删除失败!");
+ return AjaxResult.error("该合作商已关联充电桩不可删除!");
}
for (Integer id : ids) {
Partner partner = this.getById(id);
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/SiteServiceImpl.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/SiteServiceImpl.java
index 1da4d02..e83c91e 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/SiteServiceImpl.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/SiteServiceImpl.java
@@ -259,9 +259,10 @@
public AjaxResult delSite(Integer[] ids) {
//查询是否有关联数据
//充电桩
- long count1 = chargingPileService.count(new LambdaQueryWrapper<TChargingPile>().eq(TChargingPile::getSiteId, Arrays.asList(ids)).eq(TChargingPile::getDelFlag, 0));
+ long count1 = chargingPileService.count(new LambdaQueryWrapper<TChargingPile>().in(TChargingPile::getSiteId, Arrays.asList(ids))
+ .eq(TChargingPile::getDelFlag, 0));
if(count1 > 0){
- return AjaxResult.error("该站点有关联充电桩,删除失败!");
+ return AjaxResult.error("该站点已添加充电桩,不可删除。");
}
for (Integer id : ids) {
Site site = this.getById(id);
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TAccountingStrategyServiceImpl.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TAccountingStrategyServiceImpl.java
index 39a7152..472d616 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TAccountingStrategyServiceImpl.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TAccountingStrategyServiceImpl.java
@@ -40,7 +40,7 @@
List<TAccountingStrategyVO> list = this.baseMapper.pageList(query,pageInfo);
List<Integer> parentIds = list.stream().map(TAccountingStrategyVO::getId).collect(Collectors.toList());
List<TAccountingStrategy> list1 = this.list(Wrappers.lambdaQuery(TAccountingStrategy.class)
- .in(TAccountingStrategy::getParentId, parentIds)
+ .in(!parentIds.isEmpty(),TAccountingStrategy::getParentId, parentIds)
.in(TAccountingStrategy::getAuditStatus, Arrays.asList(1,2)));
for (TAccountingStrategyVO tAccountingStrategyVO : list) {
SysUser data = sysUserClient.getSysUser(tAccountingStrategyVO.getUserId()).getData();
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingGunServiceImpl.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingGunServiceImpl.java
index 496022c..0a3d4e7 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingGunServiceImpl.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingGunServiceImpl.java
@@ -111,7 +111,7 @@
return ajaxResult;
}
long count = this.count(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getCode, dto.getCode())
- .eq(TChargingGun::getDelFlag, 0));
+ .eq(TChargingGun::getDelFlag, 0).eq(TChargingGun::getChargingPileId, dto.getChargingPileId()));
if(count > 0){
return AjaxResult.error("接口编码已存在");
}
@@ -136,7 +136,7 @@
return ajaxResult;
}
TChargingGun one = this.getOne(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getCode, dto.getCode())
- .eq(TChargingGun::getDelFlag, 0));
+ .eq(TChargingGun::getDelFlag, 0).eq(TChargingGun::getChargingPileId, dto.getChargingPileId()));
if(null != one && !dto.getId().equals(one.getId())){
return AjaxResult.error("接口编码已存在");
}
@@ -186,16 +186,22 @@
GunStatusStatisticsVO gunStatusStatisticsVO = new GunStatusStatisticsVO();
if(CollectionUtils.isEmpty(siteIds)){
- List<Map<Integer, Integer>> modeStatisticsNull = new ArrayList<>();
- modeStatisticsNull.add(new HashMap<>(1,0));
- modeStatisticsNull.add(new HashMap<>(2,0));
- modeStatisticsNull.add(new HashMap<>(3,0));
- gunStatusStatisticsVO.setModeStatistics(modeStatisticsNull);
- Map<Integer, Integer> statusStatisticsNull = new HashMap<>();
- statusStatisticsNull.put(1, 0);
- statusStatisticsNull.put(2, 0);
- statusStatisticsNull.put(3, 0);
- gunStatusStatisticsVO.setStatusStatistics(statusStatisticsNull);
+// List<Map<Integer, Integer>> modeStatisticsNull = new ArrayList<>();
+// HashMap<Integer, Integer> objectObjectHashMap1 = new HashMap<>();
+// objectObjectHashMap1.put(1, 0);
+// modeStatisticsNull.add(objectObjectHashMap1);
+// HashMap<Integer, Integer> objectObjectHashMap2= new HashMap<>();
+// objectObjectHashMap2.put(2, 0);
+// modeStatisticsNull.add(objectObjectHashMap2);
+// HashMap<Integer, Integer> objectObjectHashMap3= new HashMap<>();
+// objectObjectHashMap3.put(3, 0);
+// modeStatisticsNull.add(objectObjectHashMap3);
+// gunStatusStatisticsVO.setModeStatistics(modeStatisticsNull);
+// Map<Integer, Integer> statusStatisticsNull = new HashMap<>();
+// statusStatisticsNull.put(1, 0);
+// statusStatisticsNull.put(2, 0);
+// statusStatisticsNull.put(3, 0);
+// gunStatusStatisticsVO.setStatusStatistics(statusStatisticsNull);
List<StatusModeStatisticsVO> statusModeStatistics = new ArrayList<>();
for (int i = 1; i < 4; i++) {
StatusModeStatisticsVO statusModeStatisticsVO = new StatusModeStatisticsVO();
@@ -209,35 +215,41 @@
gunStatusStatisticsVO.setStatusModeStatistics(statusModeStatistics);
}
- List<Map<Integer, Integer>> modeStatistics = this.baseMapper.getModeStatistics(siteIds);
+ List<Map<String, Object>> modeStatistics = this.baseMapper.getModeStatistics(siteIds);
if(CollectionUtils.isEmpty(modeStatistics)){
- Map<Integer, Integer> modeStatistics1 = new HashMap<>(3,0);
- modeStatistics1.put(1, 0);
- modeStatistics1.put(2, 0);
- modeStatistics1.put(3, 0);
+ Map<String, Object> modeStatistics1 = new HashMap<>();
+ modeStatistics1.put("1", "0");
+ modeStatistics1.put("2", "0");
+ modeStatistics1.put("3", "0");
modeStatistics.add(modeStatistics1);
}
gunStatusStatisticsVO.setModeStatistics(modeStatistics);
- List<Map<Integer, Integer>> statusStatistics = new ArrayList<>();
+ List<Map<String, Integer>> statusStatistics = new ArrayList<>();
// 离线
Long count = this.baseMapper.selectCount(Wrappers.lambdaQuery(TChargingGun.class)
.eq(TChargingGun::getStatus, 1));
- statusStatistics.add(new HashMap<>(1,count.intValue()));
+ HashMap<String, Integer> objectObjectHashMap1 = new HashMap<>();
+ objectObjectHashMap1.put("1", count.intValue());
+ statusStatistics.add(objectObjectHashMap1);
// statusStatistics.put(1, count.intValue());
// 故障
count = this.baseMapper.selectCount(Wrappers.lambdaQuery(TChargingGun.class)
.eq(TChargingGun::getStatus, 7));
- statusStatistics.add(new HashMap<>(2,count.intValue()));
+ HashMap<String, Integer> objectObjectHashMap2 = new HashMap<>();
+ objectObjectHashMap2.put("2", count.intValue());
+ statusStatistics.add(objectObjectHashMap2);
// statusStatistics.put(2, count.intValue());
// 充电中
count = this.baseMapper.selectCount(Wrappers.lambdaQuery(TChargingGun.class)
.in(TChargingGun::getStatus, Arrays.asList(3,4,5,6)));
- statusStatistics.add(new HashMap<>(3,count.intValue()));
+ HashMap<String, Integer> objectObjectHashMap = new HashMap<>();
+ objectObjectHashMap.put("3", count.intValue());
+ statusStatistics.add(objectObjectHashMap);
// statusStatistics.put(3, count.intValue());
- gunStatusStatisticsVO.setModeStatistics(statusStatistics);
+ gunStatusStatisticsVO.setStatusStatistics(statusStatistics);
List<StatusModeStatisticsVO> statusModeStatisticsVOS = new ArrayList<>();
StatusModeStatisticsVO statusModeStatistics1 = this.baseMapper.getStatusModeStatistics(siteIds,1);
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileNotificationServiceImpl.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileNotificationServiceImpl.java
index 6eae9d5..2fa9813 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileNotificationServiceImpl.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileNotificationServiceImpl.java
@@ -83,7 +83,8 @@
}
}
}else{
- siteIds = new HashSet<>(siteId);
+ siteIds = new HashSet<>();
+ siteIds.add(siteId);
}
PageInfo<TChargingPileNotification> pageInfo = new PageInfo<>(basePage.getPageCurr(), basePage.getPageSize());
List<TChargingPileNotification> list = this.baseMapper.chargingPileNotificationPageList(pageInfo, siteIds);
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileServiceImpl.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileServiceImpl.java
index 7219215..d95c38f 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileServiceImpl.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileServiceImpl.java
@@ -228,9 +228,10 @@
public AjaxResult delChargingPile(Integer[] ids) {
//检查是否有关联数据
//接口
- long count = chargingGunService.count(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getChargingPileId, Arrays.asList(ids)).eq(TChargingGun::getDelFlag, 0));
+ long count = chargingGunService.count(new LambdaQueryWrapper<TChargingGun>().in(TChargingGun::getChargingPileId, Arrays.asList(ids))
+ .eq(TChargingGun::getDelFlag, 0));
if(count > 0){
- return AjaxResult.error("该充电桩有关联的接口数据,删除失败!");
+ return AjaxResult.error("该充电桩已添加接口,不可删除。");
}
for (Integer id : ids) {
TChargingPile chargingPile = this.getById(id);
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/resources/mapper/chargingPile/SiteMapper.xml b/ruoyi-service/ruoyi-chargingPile/src/main/resources/mapper/chargingPile/SiteMapper.xml
index 2ff7b6e..111e8fb 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/resources/mapper/chargingPile/SiteMapper.xml
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/resources/mapper/chargingPile/SiteMapper.xml
@@ -61,7 +61,7 @@
a.phone,
a.service_phone as servicePhone,
a.parking_space as parkingSpace,
- DATE_FORMAT('%Y-%m-%d %H:%i:%s', a.establishment_time) as establishmentTime,
+ DATE_FORMAT(a.establishment_time, '%Y-%m-%d %H:%i:%s') as establishmentTime,
c.num as chargingPileNumber,
a.sort,
a.accounting_strategy_id as accountingStrategyId,
diff --git a/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/utils/listener/IotMessageListener.java b/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/utils/listener/IotMessageListener.java
index 03520f3..fc580ee 100644
--- a/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/utils/listener/IotMessageListener.java
+++ b/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/utils/listener/IotMessageListener.java
@@ -361,6 +361,8 @@
return R.ok(message);
}
+
+
@ApiOperation(value = "远程重启",tags = {"硬件接口"})
@PostMapping(value = "/platformRestart")
public R platformRestart(String deviceId) {
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/AccountingStrategyDetailOrderController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/AccountingStrategyDetailOrderController.java
index ce14d4a..db9167d 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/AccountingStrategyDetailOrderController.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/AccountingStrategyDetailOrderController.java
@@ -11,6 +11,7 @@
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
+import java.util.List;
/**
* @author zhibing.pu
@@ -36,4 +37,18 @@
.last(" and DATE_FORMAT(now(), '%H:%i') between start_time and end_time"));
return R.ok(one);
}
+
+
+ /**
+ * 获取订单对应的计费策略数据
+ * @param orderId
+ * @return
+ */
+ @PostMapping("/getAllAccountingStrategyDetailOrder")
+ public R<List<AccountingStrategyDetailOrder>> getAllAccountingStrategyDetailOrder(@RequestParam("orderId") Long orderId){
+ List<AccountingStrategyDetailOrder> one = accountingStrategyDetailOrderService.list(new LambdaQueryWrapper<AccountingStrategyDetailOrder>()
+ .eq(AccountingStrategyDetailOrder::getChargingOrderId, orderId)
+ .orderByAsc(AccountingStrategyDetailOrder::getStartTime));
+ return R.ok(one);
+ }
}
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/AccountingStrategyOrderController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/AccountingStrategyOrderController.java
new file mode 100644
index 0000000..7630c81
--- /dev/null
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/AccountingStrategyOrderController.java
@@ -0,0 +1,35 @@
+package com.ruoyi.order.controller;
+
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.order.api.model.AccountingStrategyOrder;
+import com.ruoyi.order.service.AccountingStrategyOrderService;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+/**
+ * @author zhibing.pu
+ * @Date 2024/9/25 18:33
+ */
+@RequestMapping("/accountingStrategyOrder")
+@RestController
+public class AccountingStrategyOrderController {
+
+ @Resource
+ private AccountingStrategyOrderService accountingStrategyOrderService;
+
+
+ /**
+ * 根据id获取数据
+ * @param id
+ * @return
+ */
+ @PostMapping("/getAccountingStrategyOrderById")
+ public R<AccountingStrategyOrder> getAccountingStrategyOrderById(@RequestParam("id") Integer id){
+ AccountingStrategyOrder accountingStrategyOrder = accountingStrategyOrderService.getById(id);
+ return R.ok(accountingStrategyOrder);
+ }
+}
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java
index 16e7970..28b28a6 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java
@@ -68,10 +68,12 @@
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
+import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
import java.time.YearMonth;
+import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalAdjusters;
import java.util.*;
@@ -428,21 +430,12 @@
/**
* 充电充值支付回调
- * @param request
*/
@ResponseBody
@PostMapping(value = "/chargingOrderWXCallback")
- public void chargingOrderWXCallback(HttpServletRequest request) {
- Map<String, Object> data = wxPaymentClient.payNotify(request).getData();
- if (null != data) {
- String out_trade_no = data.get("out_trade_no").toString();
- String transaction_id = data.get("transaction_id").toString();
- String attach = data.get("attach").toString();
- AjaxResult ajaxResult = chargingOrderService.chargingOrderCallback(1, out_trade_no, transaction_id, attach);
- if (ajaxResult.isSuccess()) {
- wxPaymentClient.ack();
- }
- }
+ public void chargingOrderWXCallback(@RequestParam("out_trade_no") String out_trade_no, @RequestParam("transaction_id") String transaction_id,
+ @RequestParam("attach") String attach) {
+ AjaxResult ajaxResult = chargingOrderService.chargingOrderCallback(1, out_trade_no, transaction_id, attach);
}
@@ -471,19 +464,14 @@
/**
* 远程启动失败后退款回调
- * @param request
*/
@ResponseBody
@PostMapping(value = "/chargingOrderStartupFailureWxRefund")
- public void chargingOrderStartupFailureWxRefund(HttpServletRequest request){
- WxRefundNotifyResp data = wxPaymentClient.refundNotify(request).getData();
- if(null != data){
- String out_refund_no = data.getOut_refund_no();
- String refund_id = data.getRefund_id();
- String tradeState = data.getTradeState();
- String success_time = data.getSuccess_time();
- chargingOrderService.chargingOrderStartupFailureWxRefund(out_refund_no, refund_id, tradeState, success_time);
- }
+ public void chargingOrderStartupFailureWxRefund(@RequestParam("out_trade_no") String out_refund_no,
+ @RequestParam("out_trade_no") String refund_id,
+ @RequestParam("out_trade_no") String tradeState,
+ @RequestParam("out_trade_no") String success_time){
+ chargingOrderService.chargingOrderStartupFailureWxRefund(out_refund_no, refund_id, tradeState, success_time);
}
@@ -971,23 +959,118 @@
siteIds.add(statisticsQueryDto.getSiteId());
}
if (statisticsQueryDto.getDayType()==1) {
- List<Map<String,Object>> charMap = chargingOrderService.getHourType(siteIds,statisticsQueryDto);
+ List<Map<String,Object>> charMap1 = chargingOrderService.getHourType(siteIds,statisticsQueryDto);
+ List<Map<String, Object>> charMap = new ArrayList<>();
+ // 生成从 "00:00" 到 "23:00" 的时间数据
+ for (int hour = 0; hour < 24; hour++) {
+ String time = String.format("%02d:00", hour);
+ Map<String, Object> mapWithTimeValue = findMapWithTimeValue(charMap1, time);
+ if (mapWithTimeValue!=null){
+ charMap.add(mapWithTimeValue);
+ }else {
+ Map<String, Object> timeMap = new HashMap<>();
+ timeMap.put("time", time); // 初始化值为 null
+ timeMap.put("electrovalence", 0);
+ timeMap.put("orderCount", 0);
+ timeMap.put("servicecharge", 0);
+ timeMap.put("electricity", 0);
+ charMap.add(timeMap);
+ }
+ }
return R.ok(charMap);
}else if (statisticsQueryDto.getDayType()==2){
- List<Map<String,Object>> charMap = chargingOrderService.getDateType(siteIds,statisticsQueryDto);
- return R.ok(charMap);
- }else if (statisticsQueryDto.getDayType()==3){
- List<Map<String,Object>> charMap = chargingOrderService.getMonthType(siteIds,statisticsQueryDto);
- }
+ // 假设 chargingOrderService.getDateType() 返回的是按天的数据
+ List<Map<String, Object>> charMap1 = chargingOrderService.getDateType(siteIds, statisticsQueryDto);
+ // 解析 startTime 和 endTime 为 LocalDate
+ LocalDate startDate = statisticsQueryDto.getStartTime();
+ LocalDate endDate = statisticsQueryDto.getEndTime();
+
+ List<Map<String, Object>> dateRangeStatistics = new ArrayList<>();
+
+ // 遍历日期范围
+ while (!startDate.isAfter(endDate)) {
+ String formattedDate = startDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
+ Map<String, Object> dailyStats = findMapWithDateValue(charMap1, formattedDate);
+
+ if (dailyStats != null) {
+ dateRangeStatistics.add(dailyStats);
+ } else {
+ Map<String, Object> dateMap = new HashMap<>();
+ dateMap.put("time", formattedDate);
+ dateMap.put("electrovalence", 0);
+ dateMap.put("orderCount", 0);
+ dateMap.put("servicecharge", 0);
+ dateMap.put("electricity", 0);
+ dateRangeStatistics.add(dateMap);
+ }
+
+ // 移动到下一天
+ startDate = startDate.plusDays(1);
+ }
+
+// return dateRangeStatistics;
+ return R.ok(dateRangeStatistics);
+ }else if (statisticsQueryDto.getDayType()==3){
+ List<Map<String,Object>> charMap1 = chargingOrderService.getMonthType(siteIds,statisticsQueryDto);
+ // 解析 startTime 和 endTime 为 LocalDate
+ LocalDate startDate = statisticsQueryDto.getStartTime();
+ LocalDate endDate = statisticsQueryDto.getEndTime();
+
+ List<Map<String, Object>> dateRangeStatistics = new ArrayList<>();
+
+ // 遍历日期范围
+ while (!startDate.isAfter(endDate)) {
+ String formattedDate = startDate.format(DateTimeFormatter.ofPattern("yyyy-MM"));
+ Map<String, Object> dailyStats = findMapWithDateValue(charMap1, formattedDate);
+
+ if (dailyStats != null) {
+ dateRangeStatistics.add(dailyStats);
+ } else {
+ Map<String, Object> dateMap = new HashMap<>();
+ dateMap.put("time", formattedDate);
+ dateMap.put("electrovalence", 0);
+ dateMap.put("orderCount", 0);
+ dateMap.put("servicecharge", 0);
+ dateMap.put("electricity", 0);
+ dateRangeStatistics.add(dateMap);
+ }
+
+ // 移动到下一天
+ startDate = startDate.plusMonths(1);
+ }
+ return R.ok(dateRangeStatistics);
+
+ }
return R.ok();
}
+ private static Map<String, Object> findMapWithTimeValue(List<Map<String, Object>> charMap1,String timeValue) {
+ for (Map<String, Object> map : charMap1) {
+ if (map.containsKey("time") && map.get("time").equals(timeValue)) {
+ return map;
+ }
+ }
+ return null; // 如果没有找到,返回 null
+ }
+
+ private Map<String, Object> findMapWithDateValue(List<Map<String, Object>> list, String date) {
+ for (Map<String, Object> map : list) {
+ if (date.equals(map.get("time"))) {
+ return map;
+ }
+ }
+ return null;
+ }
+
+
+
+
@ResponseBody
@PostMapping(value = "/work/use")
- @ApiOperation(value = "运营情况", tags = {"管理后台-工作台"})
+ @ApiOperation(value = "利用率", tags = {"管理后台-工作台"})
public R workUse(@RequestBody ChargingDetailQueryDto statisticsQueryDto) {
List<Integer> siteIds = new ArrayList<>();
if (statisticsQueryDto.getSiteId() == null) {
@@ -1011,7 +1094,34 @@
BigDecimal result = chargingCapacity.divide(totalRatedPower, 2, RoundingMode.HALF_UP);
map.put("chargingCapacity", result);
});
- return R.ok(capMap);
+
+
+
+ //
+ // 解析 startTime 和 endTime 为 LocalDate
+ LocalDate startDate = statisticsQueryDto.getStartTime();
+ LocalDate endDate = statisticsQueryDto.getEndTime();
+
+ List<Map<String, Object>> dateRangeStatistics = new ArrayList<>();
+
+ // 遍历日期范围
+ while (!startDate.isAfter(endDate)) {
+ String formattedDate = startDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
+ Map<String, Object> dailyStats = findMapWithDateValue(capMap, formattedDate);
+
+ if (dailyStats != null) {
+ dateRangeStatistics.add(dailyStats);
+ } else {
+ Map<String, Object> dateMap = new HashMap<>();
+ dateMap.put("time", formattedDate);
+ dateMap.put("chargingCapacity", 0);
+ dateRangeStatistics.add(dateMap);
+ }
+
+ // 移动到下一天
+ startDate = startDate.plusDays(1);
+ }
+ return R.ok(dateRangeStatistics);
}
@@ -1019,9 +1129,9 @@
@Resource
private TOrderInvoiceService invoiceService;
@ResponseBody
- @PostMapping(value = "/work/shopOrder")
+ @GetMapping(value = "/work/shopOrder")
@ApiOperation(value = "购物订单统计", tags = {"管理后台-工作台"})
- public R shopOrder(@RequestBody ChargingStatisticsQueryDto statisticsQueryDto) {
+ public R shopOrder() {
Long count = shoppingOrderService.lambdaQuery().eq(TShoppingOrder::getStatus, 1).count();
Long count1 = shoppingOrderService.lambdaQuery().eq(TShoppingOrder::getStatus, 2).count();
List<Long> counts = new ArrayList<>();
@@ -1031,9 +1141,9 @@
}
@ResponseBody
- @PostMapping(value = "/work/invoice")
+ @GetMapping(value = "/work/invoice")
@ApiOperation(value = "开票统计", tags = {"管理后台-工作台"})
- public R invoice(@RequestBody ChargingStatisticsQueryDto statisticsQueryDto) {
+ public R invoice() {
Long count = invoiceService.lambdaQuery().eq(TOrderInvoice::getStatus, 1).count();
Long count1 = invoiceService.lambdaQuery().eq(TOrderInvoice::getStatus, 3).count();
List<Long> counts = new ArrayList<>();
@@ -1043,9 +1153,9 @@
}
@ResponseBody
- @PostMapping(value = "/work/users/count")
+ @GetMapping(value = "/work/users/count")
@ApiOperation(value = "用户数量", tags = {"管理后台-工作台"})
- public R usersCount(@RequestBody ChargingStatisticsQueryDto statisticsQueryDto) {
+ public R usersCount() {
List<Map<String,Object>> userMap = chargingOrderService.countAllUserData();
return R.ok(userMap);
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TExchangeOrderController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TExchangeOrderController.java
index c07353a..42d7456 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TExchangeOrderController.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TExchangeOrderController.java
@@ -9,6 +9,7 @@
import com.ruoyi.chargingPile.api.feignClient.ChargingPileClient;
import com.ruoyi.chargingPile.api.model.TChargingPile;
import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.dto.ExchangeBackDto;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.PageInfo;
import com.ruoyi.common.security.service.TokenService;
@@ -201,14 +202,16 @@
for (int i = 0; i < split1.length; i++) {
Integer reduce = tShoppingOrderService.list(new QueryWrapper<TShoppingOrder>()
.eq("order_type",1)
- .ne("refund_status", 2))
+ .eq("goods_id", split1[i])
+ .isNull("refund_status"))
.stream().map(TShoppingOrder::getPurchaseQuantity).reduce(0, Integer::sum);
res.add(reduce);
}
break;
case 2:
for (int i = 0; i < split1.length; i++) {
- Integer reduce = exchangeOrderService.list(new QueryWrapper<TExchangeOrder>().eq("order_type",1).ne("status",4).eq("goods_id", split1[i]))
+ Integer reduce = exchangeOrderService.list(new QueryWrapper<TExchangeOrder>().eq("order_type",1)
+ .ne("status",4).eq("goods_id", split1[i]))
.stream().map(TExchangeOrder::getPurchaseQuantity).reduce(0, Integer::sum);
res.add(reduce);
}
@@ -265,7 +268,7 @@
}
@PostMapping("/create")
- public R<Long> exchangeCreate(@RequestBody ExchangeDto exchangeDto){
+ public R<ExchangeBackDto> exchangeCreate(@RequestBody ExchangeDto exchangeDto){
TExchangeOrder tExchangeOrder = new TExchangeOrder();
tExchangeOrder.setCode(OrderCodeUtil.getOrderCode("DH"));
tExchangeOrder.setAppUserId(exchangeDto.getUserId());
@@ -287,7 +290,10 @@
tExchangeOrder.setCreateTime(LocalDateTime.now());
tExchangeOrder.setDelFlag(false);
exchangeOrderService.save(tExchangeOrder);
- return R.ok(tExchangeOrder.getId());
+ ExchangeBackDto exchangeBackDto = new ExchangeBackDto();
+ exchangeBackDto.setId(tExchangeOrder.getId());
+ exchangeBackDto.setCode(tExchangeOrder.getCode());
+ return R.ok(exchangeBackDto);
}
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TOrderInvoiceController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TOrderInvoiceController.java
index 5132faf..d69169a 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TOrderInvoiceController.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TOrderInvoiceController.java
@@ -75,6 +75,7 @@
@RequestParam("invoiceUrl") String invoiceUrl){
TOrderInvoice orderInvoice = orderInvoiceService.getById(id);
orderInvoice.setInvoiceUrl(invoiceUrl);
+ orderInvoice.setStatus(3);
orderInvoiceService.updateById(orderInvoice);
// 发送邮箱
// 收件人电子邮箱,TODO 换成自己的收件箱
@@ -128,7 +129,7 @@
//组装的顺序非常重要,一定要先组装文本域,再组装文件
MimeBodyPart htmlPart = new MimeBodyPart();
// 组装内容
- htmlPart.setContent("This is message content", "text/html;charset=UTF-8");
+ htmlPart.setContent("开票", "text/html;charset=UTF-8");
msgMultipart.addBodyPart(htmlPart);
// 组装附件
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TShoppingOrderController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TShoppingOrderController.java
index 83ea8cf..85a3ca5 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TShoppingOrderController.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TShoppingOrderController.java
@@ -1,5 +1,7 @@
package com.ruoyi.order.controller;
+
import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
@@ -14,11 +16,16 @@
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.PageInfo;
import com.ruoyi.common.security.service.TokenService;
+import com.ruoyi.order.api.model.TChargingOrderRefund;
import com.ruoyi.order.api.model.TExchangeOrder;
import com.ruoyi.order.api.model.TShoppingOrder;
+import com.ruoyi.order.api.model.TShoppingOrderRefund;
import com.ruoyi.order.api.query.ShoppingOrderQuery;
import com.ruoyi.order.dto.*;
+import com.ruoyi.order.service.TShoppingOrderRefundService;
import com.ruoyi.order.service.TShoppingOrderService;
+import com.ruoyi.other.api.domain.TCoupon;
+import com.ruoyi.other.api.domain.TGoods;
import com.ruoyi.other.api.feignClient.CouponClient;
import com.ruoyi.other.api.feignClient.GoodsClient;
import com.ruoyi.payment.api.feignClient.AliPaymentClient;
@@ -37,11 +44,12 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
+import java.time.format.DateTimeFormatter;
import java.util.*;
/**
* <p>
- * 前端控制器
+ * 前端控制器
* </p>
*
* @author xiaochen
@@ -60,14 +68,48 @@
private GoodsClient goodsClient;
@Resource
private CouponClient couponClient;
-
-
+ @Resource
+ private TokenService tokenService;
+ @Resource
+ private AliPaymentClient aliPaymentClient;
+ @Resource
+ private WxPaymentClient wxPaymentClient;
+ @Resource
+ private AppCouponClient appCouponClient;
+ @Resource
+ private SysUserClient sysUserClient;
+ @Resource
+ private TShoppingOrderRefundService shoppingOrderRefundService;
+ /**
+ * 远程管理后台取消订单后退款回调
+ */
+ @ResponseBody
+ @PostMapping(value = "/shoppingOrderWxRefund")
+ public void shoppingOrderWxRefund(@RequestParam("out_trade_no") String out_refund_no,
+ @RequestParam("out_trade_no") String refund_id,
+ @RequestParam("out_trade_no") String tradeState,
+ @RequestParam("out_trade_no") String success_time){
+ if("SUCCESS".equals(tradeState)){
+ TShoppingOrderRefund one = shoppingOrderRefundService.getOne(new LambdaQueryWrapper<TShoppingOrderRefund>().eq(TShoppingOrderRefund::getRefundCode, out_refund_no));
+ one.setRefundSerialNumber(refund_id);
+ one.setRefundStatus(2);
+ one.setRefundTime(LocalDateTime.parse(success_time, DateTimeFormatter.ofPattern("yyyy-MM-DDTHH:mm:ss+TIMEZONE")));
+ shoppingOrderRefundService.updateById(one);
+ TShoppingOrder byId = shoppingOrderService.getById(one.getShoppingOrderId());
+ byId.setStatus(4);
+ shoppingOrderService.updateById(byId);
+ if (byId.getAppCouponId() != null) {
+ appCouponClient.refund(byId.getAppCouponId().toString());
+ }
+ }
+ }
+
@PostMapping("/getShoppingOrderList")
@ApiOperation(value = "列表查询", tags = {"管理后台-购物订单"})
public AjaxResult<PageInfo<TShoppingOrder>> getShoppingOrderList(@RequestBody ShoppingOrderQuery query) {
if (StringUtils.hasLength(query.getPhone())) {
List<Long> data = appUserClient.getUserIdsByPhone(query.getPhone()).getData();
- if (data.isEmpty()){
+ if (data.isEmpty()) {
return AjaxResult.success(new PageInfo<TShoppingOrder>());
}
query.setUserIds(data);
@@ -77,54 +119,61 @@
query.setGoodsIds(data);
List<Integer> data1 = couponClient.getCouponIdsByName(query.getName()).getData();
query.setCouponIds(data1);
- if (data.isEmpty() && data1.isEmpty()){
+ if (data.isEmpty() && data1.isEmpty()) {
return AjaxResult.success(new PageInfo<TShoppingOrder>());
}
}
PageInfo<TShoppingOrder> res = shoppingOrderService.pageList(query);
return AjaxResult.success(res);
}
- @Resource
- private SysUserClient sysUserClient;
+
@GetMapping("/getShoppingOrderInfoById")
@ApiOperation(value = "根据订单id查看订单详情", tags = {"管理后台-购物订单"})
public AjaxResult<TShoppingOrder> getShoppingOrderList(String id) {
TShoppingOrder byId = shoppingOrderService.getById(id);
- if (byId.getConsignerId()!=null){
+ if (byId.getConsignerId() != null) {
SysUser data = sysUserClient.getSysUser(byId.getConsignerId()).getData();
- if (data!=null){
+ if (data != null) {
byId.setConsignerName(data.getUserName());
}
}
- if (byId.getCancellationId()!=null){
+ if (byId.getCancellationId() != null) {
SysUser data = sysUserClient.getSysUser(byId.getCancellationId()).getData();
- if (data!=null){
+ if (data != null) {
byId.setCancellationName(data.getUserName());
}
}
- if (byId.getAppUserAddressId()!=null){
+ if (byId.getAppUserAddressId() != null) {
TAppUserAddress data = appUserClient.getAddressById(byId.getAppUserAddressId()).getData();
- if (data!=null){
- byId.setReceivingName(data.getName()+"-"+data.getPhone());
- byId.setReceivingAddress(data.getAddress());
+ if (data != null) {
+ byId.setReceivingName(data.getName() + "-" + data.getPhone());
+ byId.setReceivingAddress(data.getProvince()+data.getCity()
+ +(data.getDistrict()==null?"":data.getDistrict())
+ +(data.getAddress()==null?"":data.getAddress())
+ +(data.getHouseNumber()==null?"":data.getHouseNumber()));
}
+ }
+ if (byId.getOrderType()==1){
+ TGoods data = goodsClient.getGoodsById(byId.getGoodsId()).getData();
+ if (data!=null){
+ byId.setName(data.getName());
+ }
+ }else {
+ TCoupon data = couponClient.getCouponById1(byId.getCouponId()).getData();
+ if (data!=null){
+ byId.setName(data.getName());
+ }
}
return AjaxResult.success(byId);
}
+
@GetMapping("/deleteShoppingOrder")
@ApiOperation(value = "批量删除订单", tags = {"管理后台-购物订单"})
public AjaxResult<TShoppingOrder> deleteShoppingOrder(String ids) {
shoppingOrderService.removeBatchByIds(Arrays.asList(ids.split(",")));
return AjaxResult.success();
}
- @Resource
- private TokenService tokenService;
- @Resource
- private AliPaymentClient aliPaymentClient;
- @Resource
- private WxPaymentClient wxPaymentClient;
- @Resource
- private AppCouponClient appCouponClient;
+
@GetMapping("/cancelShoppingOrder")
@ApiOperation(value = "取消订单", tags = {"管理后台-购物订单"})
public AjaxResult cancelShoppingOrder(String id) {
@@ -134,54 +183,81 @@
byId.setCancellationId(userid);
byId.setCancellationTime(LocalDateTime.now());
byId.setStatus(4);
- switch (byId.getPaymentType()){
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
+ TShoppingOrderRefund tShoppingOrderRefund = new TShoppingOrderRefund();
+ tShoppingOrderRefund.setPayTime(byId.getPayTime());
+ tShoppingOrderRefund.setPayCode(byId.getSerialNumber());
+ tShoppingOrderRefund.setPayAmount(byId.getPaymentAmount());
+ tShoppingOrderRefund.setPayType(1);
+ tShoppingOrderRefund.setShoppingOrderId(byId.getId());
+ tShoppingOrderRefund.setRefundAmount(byId.getPaymentAmount());
+ tShoppingOrderRefund.setRefundStatus(1);
+ tShoppingOrderRefund.setCode("GWF" + sdf.format(new Date()) + Double.valueOf(Math.random() * 1000).intValue());
+ tShoppingOrderRefund.setRefundTitle("后台取消订单");
+ tShoppingOrderRefund.setRefundContent("后台取消订单");
+ tShoppingOrderRefund.setRefundReason("后台取消订单");
+ tShoppingOrderRefund.setRefundRemark("全额退款");
+ tShoppingOrderRefund.setRefundTotalAmount(byId.getPaymentAmount());
+ switch (byId.getPaymentType()) {
case 1:
// 微信
WxPaymentRefundModel wxPaymentRefundModel = new WxPaymentRefundModel();
wxPaymentRefundModel.setTransaction_id(byId.getSerialNumber());
wxPaymentRefundModel.setOut_trade_no(byId.getCode());
- wxPaymentRefundModel.setOut_refund_no(OrderCodeUtil.getOrderCode("GW"));
- // todo 部署到线上之后写回调地址
-// wxPaymentRefundModel.setNotify_url("");
+ wxPaymentRefundModel.setOut_refund_no(OrderCodeUtil.getOrderCode("GWTK"));
+ wxPaymentRefundModel.setReason("后台购物订单退款");
+ wxPaymentRefundModel.setNotify_url("/payment/wx/refund/notify");
String string = byId.getPaymentAmount().multiply(new BigDecimal("100")).toString();
- if (string.contains(".")){
- string = string.substring(0,string.indexOf("."));
+ if (string.contains(".")) {
+ string = string.substring(0, string.indexOf("."));
}
int i = Integer.parseInt(string);
WxPaymentRefundModel.RefundAmount refundAmount = new WxPaymentRefundModel.RefundAmount();
refundAmount.setTotal(i);
+ refundAmount.setCurrency("CNY");
refundAmount.setRefund(i);
wxPaymentRefundModel.setAmount(refundAmount);
- wxPaymentClient.refundOrderR(wxPaymentRefundModel);
+ R<String> stringR = wxPaymentClient.refundOrderR(wxPaymentRefundModel);
+ if(200 == stringR.getCode()){
+ shoppingOrderRefundService.save(tShoppingOrderRefund);
+ }
break;
case 2:
// 支付宝
RefundReq refundReq = new RefundReq();
refundReq.setOutTradeNo(byId.getSerialNumber());
- String gw = OrderCodeUtil.getOrderCode("GW");
+ String gw = OrderCodeUtil.getOrderCode("GWF");
refundReq.setOutRequestNo(gw);
refundReq.setRefundAmount(byId.getPaymentAmount().toString());
- refundReq.setRefundReason("后台退款");
+ refundReq.setRefundReason("后台购物订单退款");
RefundResp data = aliPaymentClient.refund(refundReq).getData();
- if (data!=null){
- // 退款成功 回退优惠券
-// byId.setStatus(4);
- if (byId.getAppCouponId()!=null){
+ if (data != null) {
+ byId.setStatus(4);
+ SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-DDTHH:mm:ss+TIMEZONE");
+ TShoppingOrderRefund one = shoppingOrderRefundService.getOne(new LambdaQueryWrapper<TShoppingOrderRefund>().eq(TShoppingOrderRefund::getRefundCode, data.getOutTradeNo()));
+ one.setRefundSerialNumber(data.getTradeNo());
+ one.setRefundStatus(2);
+ one.setRefundTime(LocalDateTime.parse(sdf1.format(new Date()), DateTimeFormatter.ofPattern("yyyy-MM-DDTHH:mm:ss+TIMEZONE")));
+ shoppingOrderRefundService.updateById(one);
+ if (byId.getAppCouponId() != null) {
+ // 退款成功 回退优惠券
appCouponClient.refund(byId.getAppCouponId().toString());
- byId.setRefundCode(gw);
- byId.setRefundAmount(byId.getPaymentAmount());
- byId.setRefundStatus(2);
- byId.setRefundSerialNumber(data.getTradeNo());
}
+ byId.setRefundCode(gw);
+ byId.setRefundAmount(byId.getPaymentAmount());
+ byId.setRefundStatus(2);
+ byId.setRefundSerialNumber(data.getTradeNo());
+ shoppingOrderService.updateById(byId);
}
break;
}
shoppingOrderService.updateById(byId);
return AjaxResult.success();
}
+
@GetMapping("/consignerShoppingOrder")
@ApiOperation(value = "发货", tags = {"管理后台-购物订单"})
- public AjaxResult consignerShoppingOrder(String id,String companyName,String code) {
+ public AjaxResult consignerShoppingOrder(String id, String companyName, String code) {
TShoppingOrder byId = shoppingOrderService.getById(id);
byId.setExpressCompany(companyName);
byId.setExpressNumber(code);
@@ -192,55 +268,55 @@
shoppingOrderService.updateById(byId);
return AjaxResult.success();
}
+
@GetMapping("/getMyShoppingOrderList")
@ApiOperation(value = "获取购买订单列表", tags = {"小程序-商城购买订单"})
- public AjaxResult<Map<String, Object>> getMyShoppingOrderList(GetMyShoppingOrderList query){
+ public AjaxResult<Map<String, Object>> getMyShoppingOrderList(GetMyShoppingOrderList query) {
Map<String, Object> list = shoppingOrderService.getMyShoppingOrderList(query);
return AjaxResult.success(list);
}
-
+
@GetMapping("/getMyShoppingOrderListNum")
@ApiOperation(value = "获取购买订单列表数量", tags = {"小程序-商城购买订单"})
- public AjaxResult<Map<String, Object>> getMyShoppingOrderListNum(){
+ public AjaxResult<Map<String, Object>> getMyShoppingOrderListNum() {
Long userId = tokenService.getLoginUserApplet().getUserId();
long dfh = shoppingOrderService.count(new LambdaQueryWrapper<TShoppingOrder>().eq(TShoppingOrder::getDelFlag, 0)
- .eq(TShoppingOrder::getStatus, 1).eq(TShoppingOrder::getAppUserId, userId));
+ .eq(TShoppingOrder::getStatus, 1).eq(TShoppingOrder::getAppUserId, userId).eq(TShoppingOrder::getPaymentStatus, 2));
long dsh = shoppingOrderService.count(new LambdaQueryWrapper<TShoppingOrder>().eq(TShoppingOrder::getDelFlag, 0)
- .eq(TShoppingOrder::getStatus, 2).eq(TShoppingOrder::getAppUserId, userId));
+ .eq(TShoppingOrder::getStatus, 2).eq(TShoppingOrder::getAppUserId, userId).eq(TShoppingOrder::getPaymentStatus, 2));
long ywc = shoppingOrderService.count(new LambdaQueryWrapper<TShoppingOrder>().eq(TShoppingOrder::getDelFlag, 0)
- .eq(TShoppingOrder::getStatus, 3).eq(TShoppingOrder::getAppUserId, userId));
+ .eq(TShoppingOrder::getStatus, 3).eq(TShoppingOrder::getAppUserId, userId).eq(TShoppingOrder::getPaymentStatus, 2));
Map<String, Object> map = new HashMap<>();
map.put("dfh", dfh);
map.put("dsh", dsh);
map.put("ywc", ywc);
return AjaxResult.success(map);
}
-
@GetMapping("/getMyShoppingOrderInfo/{id}")
- @ApiOperation(value = "获取购买订单详情", tags = {"小程序-商城购买订单","管理后台-支付订单-订单信息"})
- public AjaxResult<MyShoppingOrderInfo> getMyShoppingOrderInfo(@PathVariable String id){
+ @ApiOperation(value = "获取购买订单详情", tags = {"小程序-商城购买订单", "管理后台-支付订单-订单信息"})
+ public AjaxResult<MyShoppingOrderInfo> getMyShoppingOrderInfo(@PathVariable String id) {
MyShoppingOrderInfo info = shoppingOrderService.getMyShoppingOrderInfo(id);
return AjaxResult.success(info);
}
-
@PutMapping("/confirmReceipt/{id}")
@ApiOperation(value = "确认收货操作", tags = {"小程序-商城购买订单"})
- public AjaxResult confirmReceipt(@PathVariable String id){
+ public AjaxResult confirmReceipt(@PathVariable String id) {
TShoppingOrder shoppingOrder = shoppingOrderService.getById(id);
- if(shoppingOrder.getStatus() == 3){
+ if (shoppingOrder.getStatus() == 3) {
return AjaxResult.error("不能重复确认收货");
}
- if(shoppingOrder.getStatus() == 1){
+ if (shoppingOrder.getStatus() == 1) {
return AjaxResult.error("订单还未发货呢");
}
- if(shoppingOrder.getStatus() == 4){
+ if (shoppingOrder.getStatus() == 4) {
return AjaxResult.error("订单已取消,不允许操作。");
}
shoppingOrder.setStatus(3);
+ shoppingOrder.setReceivingTime(LocalDateTime.now());
shoppingOrderService.updateById(shoppingOrder);
return AjaxResult.success();
}
@@ -248,7 +324,7 @@
@PutMapping("/cancelOrder/{id}")
@ApiOperation(value = "取消订单操作", tags = {"小程序-商城购买订单"})
- public AjaxResult cancelOrder(@PathVariable String id){
+ public AjaxResult cancelOrder(@PathVariable String id) {
return shoppingOrderService.cancelOrder(id);
}
@@ -256,43 +332,38 @@
* 商城订单取消微信退款回调
*/
@PostMapping("/cancelShoppingOrderWxRefund")
- public void cancelShoppingOrderWxRefund(HttpServletRequest request){
- WxRefundNotifyResp data = wxPaymentClient.refundNotify(request).getData();
- if(null != data){
- String out_refund_no = data.getOut_refund_no();
- String refund_id = data.getRefund_id();
- String tradeState = data.getTradeState();
- String success_time = data.getSuccess_time();
- shoppingOrderService.cancelShoppingOrderWxRefund(out_refund_no, refund_id, tradeState, success_time);
- }
+ public void cancelShoppingOrderWxRefund(@RequestParam("out_refund_no") String out_refund_no,
+ @RequestParam("refund_id") String refund_id,
+ @RequestParam("tradeState") String tradeState,
+ @RequestParam("success_time") String success_time) {
+ shoppingOrderService.cancelShoppingOrderWxRefund(out_refund_no, refund_id, tradeState, success_time);
}
-
@ResponseBody
@GetMapping(value = "/getNoInvoicedOrder")
@ApiOperation(value = "获取未开票的订单数据", tags = {"小程序-充电发票"})
- public AjaxResult<List<MyShoppingOrderList>> getNoInvoicedOrder(GetNoInvoicedOrder query){
+ public AjaxResult<List<MyShoppingOrderList>> getNoInvoicedOrder(GetNoInvoicedOrder query) {
List<MyShoppingOrderList> list = shoppingOrderService.getNoInvoicedOrder(query);
return AjaxResult.success(list);
}
-
+
@PostMapping("/create")
- public R<TShoppingOrder> shopCreate(@RequestBody ExchangeDto exchangeDto){
+ public R<TShoppingOrder> shopCreate(@RequestBody ExchangeDto exchangeDto) {
TShoppingOrder shoppingOrder = new TShoppingOrder();
shoppingOrder.setTitle(exchangeDto.getTitle());
shoppingOrder.setCode(OrderCodeUtil.getOrderCode("GW"));
shoppingOrder.setAppUserId(exchangeDto.getUserId());
shoppingOrder.setOrderType(exchangeDto.getGoodType());
- if (exchangeDto.getGoodType()==1) {
+ if (exchangeDto.getGoodType() == 1) {
shoppingOrder.setGoodsId(exchangeDto.getGoodId());
- }else {
+ } else {
shoppingOrder.setCouponId(exchangeDto.getGoodId());
}
shoppingOrder.setPurchaseQuantity(exchangeDto.getNum());
shoppingOrder.setAppUserAddressId(exchangeDto.getAddressId());
shoppingOrder.setOrderAmount(exchangeDto.getOrderPrice());
- if (exchangeDto.getCouponId()!=null) {
+ if (exchangeDto.getCouponId() != null) {
shoppingOrder.setAppCouponId(exchangeDto.getCouponId());
}
shoppingOrder.setCouponDiscountAmount(exchangeDto.getDiscountPrice());
@@ -307,16 +378,16 @@
shoppingOrder.setCreateTime(LocalDateTime.now());
shoppingOrder.setDelFlag(false);
shoppingOrderService.save(shoppingOrder);
-
+
return R.ok(shoppingOrder);
-
+
}
-
+
@PostMapping("/callBack")
- public R callBack(@RequestParam("code")String code,@RequestParam("outTradeNo")String outTradeNo){
- shoppingOrderService.callBack(code,outTradeNo);
+ public R callBack(@RequestParam("code") String code, @RequestParam("outTradeNo") String outTradeNo) {
+ shoppingOrderService.callBack(code, outTradeNo);
return R.ok();
-
+
}
}
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TVipOrderController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TVipOrderController.java
index 909cf73..e174a7d 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TVipOrderController.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TVipOrderController.java
@@ -70,6 +70,14 @@
@PostMapping("/addVipOrder")
@ApiOperation(value = "添加会员订单", tags = {"管理后台-会员订单"})
public R<Long> addVipOrder(@RequestBody TVipOrder dto) {
+ if (dto.getId()!=null){
+ List<TVipOrder> list = vipOrderService.lambdaQuery().eq(TVipOrder::getCode, dto.getCode())
+ .ne(TVipOrder::getId, dto.getId()).list();
+ if (!list.isEmpty())return R.fail("订单编号已存在");
+ }else{
+ List<TVipOrder> list = vipOrderService.lambdaQuery().eq(TVipOrder::getCode, dto.getCode()).list();
+ if (!list.isEmpty())return R.fail("订单编号已存在");
+ }
vipOrderService.saveOrUpdate(dto);
return R.ok(dto.getId());
}
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/dto/TEnterpriseExport.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/dto/TEnterpriseExport.java
index bc75ad7..b9767f0 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/dto/TEnterpriseExport.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/dto/TEnterpriseExport.java
@@ -27,8 +27,7 @@
private String phone;
@Excel(name = "备注",width = 30)
private String remark;
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
- @Excel(name = "申请时间",width = 30,exportFormat="yyyy-MM-dd HH:mm:ss")
+ @Excel(name = "申请时间",width = 30)
private String createTime;
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/TExchangeOrderService.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/TExchangeOrderService.java
index ce4ae13..56c3688 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/TExchangeOrderService.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/TExchangeOrderService.java
@@ -1,12 +1,14 @@
package com.ruoyi.order.service;
import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.PageInfo;
import com.ruoyi.order.api.model.TExchangeOrder;
import com.ruoyi.order.api.query.ShoppingOrderQuery;
import com.ruoyi.order.dto.ExchangeOrderGoodsInfo;
import com.ruoyi.order.dto.GetMyExchangeOrder;
import com.ruoyi.order.dto.MyExchangeOrderList;
+import org.springframework.web.bind.annotation.PathVariable;
import java.util.List;
import java.util.Map;
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java
index e496463..352d1d3 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java
@@ -33,6 +33,7 @@
import com.ruoyi.integration.api.vo.GetPlatformStopChargingReply;
import com.ruoyi.order.api.dto.SettlementConfirmAdd;
import com.ruoyi.order.api.feignClient.AccountingStrategyDetailOrderClient;
+import com.ruoyi.order.api.feignClient.AccountingStrategyOrderClient;
import com.ruoyi.order.api.feignClient.ChargingOrderAccountingStrategyClient;
import com.ruoyi.order.api.model.*;
import com.ruoyi.order.api.query.ChargingOrderQuery;
@@ -47,11 +48,8 @@
import com.ruoyi.order.service.TChargingOrderService;
import com.ruoyi.order.service.TOrderEvaluateService;
import com.ruoyi.order.service.*;
-import com.ruoyi.other.api.domain.TCoupon;
-import com.ruoyi.other.api.domain.TGoods;
+import com.ruoyi.other.api.domain.*;
import com.ruoyi.order.vo.ChargingOrderListInfoVO;
-import com.ruoyi.other.api.domain.TIntegralRule;
-import com.ruoyi.other.api.domain.TVip;
import com.ruoyi.other.api.feignClient.*;
import com.ruoyi.payment.api.feignClient.AliPaymentClient;
import com.ruoyi.payment.api.feignClient.WxPaymentClient;
@@ -153,6 +151,9 @@
@Resource
private AccountingStrategyDetailOrderClient accountingStrategyDetailOrderClient;
+
+ @Resource
+ private AccountingStrategyOrderClient accountingStrategyOrderClient;
@Resource
private AccountingStrategyClient accountingStrategyClient;
@@ -183,6 +184,12 @@
@Resource
private VipClient vipClient;
+
+ @Resource
+ private UserTagClient userTagClient;
+
+ @Resource
+ private AppUserTagClient appUserTagClient;
//计数器
private Map<String, Integer> counter_map = new HashMap<>();
@@ -433,7 +440,28 @@
chargingOrder.setRechargePaymentStatus(1);
chargingOrder.setRechargeAmount(addChargingOrder.getPaymentAmount());
chargingOrder.setAppCouponId(addChargingOrder.getAppUserCouponId());
- if(null != appUser.getVipId()){
+ chargingOrder.setVipDiscount(new BigDecimal(10));
+ chargingOrder.setVipDiscountAmount(BigDecimal.ZERO);
+
+ Site site = siteClient.getSiteByIds(Arrays.asList(tChargingGun.getSiteId())).getData().get(0);
+ Integer accountingStrategyId = tChargingGun.getAccountingStrategyId();
+ if(null == accountingStrategyId){
+ //查询站点上面的计费策略
+ accountingStrategyId = site.getAccountingStrategyId();
+ }
+ TAccountingStrategy accountingStrategy = accountingStrategyClient.getAccountingStrategyById(accountingStrategyId).getData();
+
+ //直营站点才可以享受会员折扣
+ if(null != appUser.getVipId() && 1 == site.getBusinessCategory()){
+ TVip vip = vipClient.getInfo(appUser.getVipId()).getData();
+ BigDecimal discount = null;
+ if(1 == vip.getType()){
+ //普通会员折扣使用积分策略上的折扣,且有最高优惠金额
+ discount = accountingStrategy.getDiscount();
+ }else{
+ //内部会员使用会员信息设置的折扣,没有最高优惠金额
+ discount = vip.getDiscount();
+ }
GetAppUserVipDetail getAppUserVipDetail = new GetAppUserVipDetail();
getAppUserVipDetail.setAppUserId(appUser.getId());
getAppUserVipDetail.setVipId(appUser.getVipId());
@@ -441,24 +469,13 @@
if(null != vipDetail){
Integer chargeNum = vipDetail.getChargeNum();
if(0 > chargeNum){
- chargingOrder.setVipDiscount(vipDetail.getDiscount());
- BigDecimal discountAmount = addChargingOrder.getPaymentAmount().multiply((new BigDecimal(10)
- .subtract(vipDetail.getDiscount())).divide(new BigDecimal(10))).setScale(4, BigDecimal.ROUND_HALF_EVEN);
- chargingOrder.setVipDiscountAmount(discountAmount);
+ chargingOrder.setVipDiscount(discount);
}
}
-
}
this.save(chargingOrder);
//添加订单的计费策略
- Integer accountingStrategyId = tChargingGun.getAccountingStrategyId();
- if(null == accountingStrategyId){
- //查询站点上面的计费策略
- Site site = siteClient.getSiteByIds(Arrays.asList(tChargingGun.getSiteId())).getData().get(0);
- accountingStrategyId = site.getAccountingStrategyId();
- }
- TAccountingStrategy accountingStrategy = accountingStrategyClient.getAccountingStrategyById(accountingStrategyId).getData();
List<TAccountingStrategyDetail> strategyDetailList = accountingStrategyDetailClient.getListByAccountingStrategyId(accountingStrategyId).getData();
AccountingStrategyOrder accountingStrategyOrder = new AccountingStrategyOrder();
BeanUtils.copyProperties(accountingStrategy, accountingStrategyOrder);
@@ -481,7 +498,7 @@
paymentOrder.setAmount(addChargingOrder.getPaymentAmount());
paymentOrder.setOpenId(appUser.getWxOpenid());
paymentOrder.setDescription("充电充值");
- paymentOrder.setNotifyUrl("/order/t-charging-order/chargingOrderWXCallback");
+ paymentOrder.setNotifyUrl("/payment/wx/pay/notify");
Map<String, Object> data = wxPaymentClient.orderPay(paymentOrder).getData();
return AjaxResult.success(data);
}
@@ -494,7 +511,7 @@
req.setBody("充电充值");
AliPaymentResp data = aliPaymentClient.payment(req).getData();
if(null != data){
- data.setNotifyUrl(data.getNotifyUrl() + "/t-charging-order/chargingOrderALICallback");
+ data.setNotifyUrl(data.getNotifyUrl() + "/order/t-charging-order/chargingOrderALICallback");
return AjaxResult.success(data);
}
}
@@ -532,45 +549,101 @@
//根据当前充值的金额和计费模板算出充电的金额
BigDecimal rechargeAmount = chargingOrder.getRechargeAmount();
- //计算充电金额,会员需要将折扣金额加入到充电总金额中
- TChargingGun chargingGun = chargingGunClient.getChargingGunById(chargingOrder.getChargingGunId()).getData();
- AccountingStrategyDetailOrder strategyDetail = accountingStrategyDetailOrderClient.getNowAccountingStrategyDetailOrder(chargingOrder.getId()).getData();
- //总单价
- BigDecimal totalUnitPrice = strategyDetail.getServiceCharge().add(strategyDetail.getElectrovalence());
- //计算能充电的度数
- BigDecimal degrees = rechargeAmount.divide(totalUnitPrice);
+ BigDecimal rechargeAmount1 = new BigDecimal(rechargeAmount.toString());
+ SimpleDateFormat sdf = new SimpleDateFormat("HHmm");
+ Long now = Long.valueOf(sdf.format(new Date()));
+ Long nowTimeMillis = System.currentTimeMillis();
+ //根据支付金额,获取出使用的计费策略明细
//计算电费金额和服务费
- BigDecimal serviceCharge = strategyDetail.getServiceCharge().multiply(degrees);
- BigDecimal electrovalence = strategyDetail.getElectrovalence().multiply(degrees);
+ BigDecimal serviceCharge = BigDecimal.ZERO;
+ BigDecimal electrovalence = BigDecimal.ZERO;
+ BigDecimal discountAmount = BigDecimal.ZERO;
+ BigDecimal discount = chargingOrder.getVipDiscount();
+ //先根据额定功率计算出每秒充电度数,然后计算出支付金额能充多少度电
+ TChargingGun tChargingGun = chargingGunClient.getChargingGunById(chargingOrder.getChargingGunId()).getData();
+ BigDecimal s_degrees = tChargingGun.getRatedPower().divide(new BigDecimal(3600), 6, RoundingMode.HALF_EVEN);
- //再处理会员折扣
- BigDecimal discount = BigDecimal.ZERO;
TAppUser appUser = appUserClient.getUserById(chargingOrder.getAppUserId()).getData();
- if(null != appUser.getVipId()){
- GetAppUserVipDetail getAppUserVipDetail = new GetAppUserVipDetail();
- getAppUserVipDetail.setAppUserId(chargingOrder.getAppUserId());
- getAppUserVipDetail.setVipId(appUser.getVipId());
- TAppUserVipDetail data = appUserVipDetailClient.getAppUserVipDetail(getAppUserVipDetail).getData();
- if(data.getChargeNum() > 0){
- discount = serviceCharge.multiply(data.getDiscount().divide(new BigDecimal(10)));
- data.setChargeNum(data.getChargeNum() - 1);
- appUserVipDetailClient.updateAppUserVipDetail(data);
+ List<AccountingStrategyDetailOrder> list = accountingStrategyDetailOrderClient.getAllAccountingStrategyDetailOrder(chargingOrder.getId()).getData();
+ for (AccountingStrategyDetailOrder accountingStrategyDetailOrder : list) {
+ Integer start = Integer.valueOf(accountingStrategyDetailOrder.getStartTime().replaceAll(":", ""));
+ Integer end = Integer.valueOf(accountingStrategyDetailOrder.getEndTime().replaceAll(":", ""));
+ String[] split = accountingStrategyDetailOrder.getEndTime().split(":");
+ if(now >= start && now < end){
+ Calendar calendar = Calendar.getInstance();
+ calendar.set(Calendar.HOUR_OF_DAY, Integer.valueOf(split[0]));
+ calendar.set(Calendar.MINUTE, Integer.valueOf(split[1]));
+ //到此策略结束的秒数
+ if(null == nowTimeMillis){
+ String[] split1 = accountingStrategyDetailOrder.getStartTime().split(":");
+ Calendar calendar1 = Calendar.getInstance();
+ calendar1.set(Calendar.HOUR_OF_DAY, Integer.valueOf(split1[0]));
+ calendar1.set(Calendar.MINUTE, Integer.valueOf(split1[1]));
+ nowTimeMillis = calendar.getTimeInMillis();
+ }
+ long m = (calendar.getTimeInMillis() - nowTimeMillis) / 1000;
+ //每度电的单价
+ BigDecimal total_unit = accountingStrategyDetailOrder.getElectrovalence().add(accountingStrategyDetailOrder.getServiceCharge());
+ //每秒需要支付的金额
+ BigDecimal multiply = s_degrees.multiply(total_unit);
+ //计算充值金额能充多长时间的电
+ long times = rechargeAmount1.divide(multiply, 0, RoundingMode.DOWN).longValue();
+ if(times > m){
+ //充电时间跨度两个计费策略,需要继续对下一个策略进行计算
+ electrovalence = accountingStrategyDetailOrder.getElectrovalence().multiply(s_degrees).multiply(new BigDecimal(m));
+ serviceCharge = accountingStrategyDetailOrder.getServiceCharge().multiply(s_degrees).multiply(new BigDecimal(m));
+ discountAmount = discountAmount.add(serviceCharge.multiply((new BigDecimal(10).subtract(discount)).divide(new BigDecimal(10))));
+ rechargeAmount1 = rechargeAmount1.subtract(multiply.multiply(new BigDecimal(m)));
+ nowTimeMillis = null;
+ }else{
+ electrovalence = accountingStrategyDetailOrder.getElectrovalence().multiply(s_degrees).multiply(new BigDecimal(times));
+ serviceCharge = accountingStrategyDetailOrder.getServiceCharge().multiply(s_degrees).multiply(new BigDecimal(times));
+ discountAmount = discountAmount.add(serviceCharge.multiply((new BigDecimal(10).subtract(discount)).divide(new BigDecimal(10))));
+ break;
+ }
}
}
- electrovalence = electrovalence.add(discount);
+ if(discountAmount.compareTo(BigDecimal.ZERO) >= 0){
+ //计算会员最大优惠金额
+ if(null != appUser.getVipId()){
+ TVip vip = vipClient.getInfo(appUser.getVipId()).getData();
+ BigDecimal maximumDeduction = vip.getMaximumDeduction();
+ //普通会员有最高优惠限制
+ if(vip.getType() == 1 && discountAmount.compareTo(maximumDeduction) > 0){
+ discountAmount = maximumDeduction;
+ }
+
+ //判断会员是否还有充电优惠次数
+ GetAppUserVipDetail getAppUserVipDetail = new GetAppUserVipDetail();
+ getAppUserVipDetail.setAppUserId(chargingOrder.getAppUserId());
+ getAppUserVipDetail.setVipId(appUser.getVipId());
+ TAppUserVipDetail data = appUserVipDetailClient.getAppUserVipDetail(getAppUserVipDetail).getData();
+ if(data.getChargeNum() > 0){
+ data.setChargeNum(data.getChargeNum() - 1);
+ appUserVipDetailClient.updateAppUserVipDetail(data);
+ //会员有充电优惠次数,直接将优惠金额加入到充电费用中增加充电时长
+ electrovalence = electrovalence.add(discountAmount);
+ }
+ }
+ }
chargingOrder.setChargeAmount(electrovalence);
+ chargingOrder.setVipDiscountAmount(discountAmount);
this.updateById(chargingOrder);
- TChargingPile chargingPile = chargingPileClient.getChargingPileById(chargingGun.getChargingPileId()).getData();
+ TChargingPile chargingPile = chargingPileClient.getChargingPileById(tChargingGun.getChargingPileId()).getData();
//调用远程启动充电消息
PlatformStartCharging platformStartCharging = new PlatformStartCharging();
platformStartCharging.setTransaction_serial_number(chargingOrder.getCode());
platformStartCharging.setCharging_pile_code(chargingPile.getCode());
- platformStartCharging.setCharging_gun_code(chargingGun.getCode());
+ platformStartCharging.setCharging_gun_code(tChargingGun.getCode());
//使用订单id作为逻辑卡号
platformStartCharging.setCard_number(chargingOrder.getId().toString());
platformStartCharging.setAccount_balance(electrovalence);
+
+ System.err.println("-------------------远程调起开始充电请求-------------------");
+ System.err.println(platformStartCharging.toString());
+
sendMessageClient.platformStartCharging(platformStartCharging);
//异步线程检测远程启动的应答结果。如果失败,则需要全额退款
String code = chargingOrder.getCode();
@@ -578,16 +651,17 @@
ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
scheduler.scheduleAtFixedRate(()->{
List<PlatformStartChargingReply> data = platformStartChargingReplyClient.getPlatformStartChargingReply(code).getData();
+ System.err.println("-------------------开始检查调起充电结果-------------------");
+ System.err.println(data.toString());
if(data.size() != 0){
PlatformStartChargingReply platformStartChargingReply = data.get(1);
Integer startup_result = platformStartChargingReply.getStartup_result();
Integer failure_cause = platformStartChargingReply.getFailure_cause();
Integer counter = counter_map.get(code);
PreChargeCheck preChargeCheck1 = redisService.getCacheObject(key);
- //状态为5的时候,硬件会间隔60秒后再次检测,依然未插枪,则不启动充电
- //因这里是间隔5秒执行检测,所以累计次数在30次以上
- if(failure_cause == 5 && null == counter || counter < 35){
- counter++;
+ //5分钟内还未插枪则取消充电,退回金额。
+ if(failure_cause == 5 && (null == counter || counter < 300)){
+ counter = (null == counter ? 0 : counter) + 1;
counter_map.put(code, counter);
//启动失败
preChargeCheck1.setStartupSuccess(3);
@@ -595,9 +669,9 @@
redisService.setCacheObject(key, preChargeCheck1);
return;
}
+
//清除计时器中的无效数据
counter_map.remove(code);
- //开始处理退款
TChargingOrder order = this.getOne(new LambdaQueryWrapper<TChargingOrder>().eq(TChargingOrder::getCode, code));
if(0 == startup_result){
//启动失败
@@ -608,6 +682,7 @@
order.setStatus(-1);
order.setEndMode(0);
}else{
+ //启动成功
preChargeCheck1.setStartupSuccess(2);
order.setStatus(3);
order.setStartTime(LocalDateTime.now());
@@ -616,8 +691,10 @@
redisService.setCacheObject(key, preChargeCheck1);
//提前结束定时任务
scheduler.shutdown();
+ }else{
+ log.error("未上传开启充电结果........");
}
- }, 5, 300, TimeUnit.SECONDS);
+ }, 5, 1, TimeUnit.SECONDS);
return AjaxResult.success();
}
@@ -652,7 +729,7 @@
model.setOut_trade_no(chargingOrder.getCode());
model.setOut_refund_no(chargingOrderRefund.getRefundCode());
model.setReason("充电失败,取消充电订单");
- model.setNotify_url("/order/t-charging-order/chargingOrderStartupFailureWxRefund");
+ model.setNotify_url("/payment/wx/refund/notify");
WxPaymentRefundModel.RefundAmount amount = new WxPaymentRefundModel.RefundAmount();
amount.setRefund(rechargeAmount.multiply(new BigDecimal(100)).intValue());
amount.setTotal(rechargeAmount.multiply(new BigDecimal(100)).intValue());
@@ -767,7 +844,65 @@
chargingOrder.setStatus(4);
chargingOrder.setEndMode(1);
this.updateById(chargingOrder);
-
+
+ //处理用户标签数据
+ List<TUserTag> data = userTagClient.getAllUserTag().getData();
+ //累计充电次数
+ long count1 = this.count(new LambdaQueryWrapper<TChargingOrder>().eq(TChargingOrder::getAppUserId, chargingOrder.getAppUserId())
+ .eq(TChargingOrder::getRechargePaymentStatus, 2).isNotNull(TChargingOrder::getPaymentAmount).eq(TChargingOrder::getDelFlag, 0));
+ List<TUserTag> userTagList1 = data.stream().filter(s -> s.getStandardCondition() == 1).collect(Collectors.toList());
+ int old_times = 0;
+ Integer userTagId = null;
+ for (TUserTag tUserTag : userTagList1) {
+ Integer times = JSON.parseObject(tUserTag.getConditions()).getInteger("times");
+ //加上本次充电
+ //获取最大值标签
+ if((count1 + 1) >= times && old_times < times){
+ userTagId = tUserTag.getId();
+ old_times = times;
+ }
+ }
+ if(null != userTagId){
+ TAppUserTag appUserTag = new TAppUserTag();
+ appUserTag.setAppUserId(chargingOrder.getAppUserId());
+ appUserTag.setUserTagId(userTagId);
+ TAppUserTag data1 = appUserTagClient.getUserTag(appUserTag).getData();
+ if(null == data1){
+ data1 = new TAppUserTag();
+ data1.setAppUserId(chargingOrder.getAppUserId());
+ data1.setUserTagId(userTagId);
+ data1.setCreateTime(LocalDateTime.now());
+ appUserTagClient.addUserTag(data1);
+ }
+ }
+ //充电评率
+ List<TUserTag> userTagList2 = data.stream().filter(s -> s.getStandardCondition() == 2).collect(Collectors.toList());
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ for (TUserTag tUserTag : userTagList2) {
+ TAppUserTag appUserTag = new TAppUserTag();
+ appUserTag.setAppUserId(chargingOrder.getAppUserId());
+ appUserTag.setUserTagId(tUserTag.getId());
+ TAppUserTag data1 = appUserTagClient.getUserTag(appUserTag).getData();
+ if(null == data1){
+ Integer day = JSON.parseObject(tUserTag.getConditions()).getInteger("day");
+ Integer times = JSON.parseObject(tUserTag.getConditions()).getInteger("times");
+ Calendar start = Calendar.getInstance();
+ start.set(Calendar.DAY_OF_YEAR, start.get(Calendar.DAY_OF_YEAR) + day);
+ count1 = this.count(new LambdaQueryWrapper<TChargingOrder>().eq(TChargingOrder::getAppUserId, chargingOrder.getAppUserId())
+ .eq(TChargingOrder::getRechargePaymentStatus, 2).isNotNull(TChargingOrder::getPaymentAmount)
+ .between(TChargingOrder::getStartTime, sdf.format(start.getTime()), sdf.format(new Date())).eq(TChargingOrder::getDelFlag, 0));
+ //加上本次充电
+ if(count1 >= times){
+ data1 = new TAppUserTag();
+ data1.setAppUserId(chargingOrder.getAppUserId());
+ data1.setUserTagId(tUserTag.getId());
+ data1.setCreateTime(LocalDateTime.now());
+ appUserTagClient.addUserTag(data1);
+ }
+ }
+ }
+
+
//异步线程处理停机
ExecutorService cachedThreadPool = Executors.newFixedThreadPool(1);
cachedThreadPool.execute(()->{
@@ -1001,7 +1136,7 @@
model.setOut_trade_no(chargingOrder.getCode());
model.setOut_refund_no(chargingOrderRefund.getRefundCode());
model.setReason("充电完成退款");
- model.setNotify_url("http://221.182.45.100:9000/order/t-charging-order/chargingOrderStartupFailureWxRefund");
+ model.setNotify_url("/payment/wx/refund/notify");
WxPaymentRefundModel.RefundAmount amount = new WxPaymentRefundModel.RefundAmount();
amount.setRefund(refundAmount.multiply(new BigDecimal(100)).intValue());
amount.setTotal(rechargeAmount.multiply(new BigDecimal(100)).intValue());
@@ -1075,6 +1210,12 @@
for (ChargingOrderVO chargingOrderVO : list) {
TChargingGun data3 = chargingGunClient.getChargingGunById(chargingOrderVO.getChargingGunId()).getData();
TChargingPile data2 = chargingPileClient.getChargingPileById(chargingOrderVO.getChargingPileId()).getData();
+ if (chargingOrderVO.getSiteId()!=null){
+ List<Integer> integers = new ArrayList<>();
+ integers.add(chargingOrderVO.getSiteId());
+ List<Site> data = siteClient.getSiteByIds(integers).getData();
+ if (!data.isEmpty())chargingOrderVO.setSiteName(data.get(0).getName());
+ }
if (data2!=null && data3!=null){
chargingOrderVO.setTerminalName(data2.getName()+"-"+data3.getName());
@@ -1090,7 +1231,9 @@
// 单个订单累计服务费
BigDecimal serviceMoney1 = new BigDecimal("0");
UploadRealTimeMonitoringData data5 = uploadRealTimeMonitoringDataClient.chargingOrderInfo(chargingOrderVO.getCode()).getData();
- chargingOrderVO.setChargingSecond(data5.getTime_remaining()*60L);
+ if (data5!=null){
+ chargingOrderVO.setChargingSecond(data5.getTime_remaining()*60L);
+ }
// 总收入
if (chargingOrderVO.getRefundStatus() !=null && chargingOrderVO.getRefundStatus() == 2){
income = income.add(chargingOrderVO.getPaymentAmount().subtract(chargingOrderVO.getRefundAmount()));
@@ -1786,7 +1929,7 @@
model.setOut_refund_no(chargingOrderRefund.getRefundCode());
model.setTransaction_id(tChargingOrder.getRechargeSerialNumber());
model.setReason("取消订单");
- model.setNotify_url("http://221.182.45.100:9000/order/t-shopping-order/cancelShoppingOrderWxRefund");
+ model.setNotify_url("/order/t-shopping-order/cancelShoppingOrderWxRefund");
WxPaymentRefundModel.RefundAmount amount = new WxPaymentRefundModel.RefundAmount();
amount.setRefund(payOrderQueryDto.getRefundAmount().multiply(new BigDecimal(100)).intValue());
amount.setTotal(tChargingOrder.getPaymentAmount().multiply(new BigDecimal(100)).intValue());
@@ -1841,7 +1984,7 @@
model.setOut_refund_no(chargingOrderRefund.getRefundCode());
model.setTransaction_id(tChargingOrder.getSerialNumber());
model.setReason("取消订单");
- model.setNotify_url("http://221.182.45.100:9000/order/t-shopping-order/cancelShoppingOrderWxRefund");
+ model.setNotify_url("/order/t-shopping-order/cancelShoppingOrderWxRefund");
WxPaymentRefundModel.RefundAmount amount = new WxPaymentRefundModel.RefundAmount();
amount.setRefund(payOrderQueryDto.getRefundAmount().multiply(new BigDecimal(100)).intValue());
amount.setTotal(tChargingOrder.getPaymentAmount().multiply(new BigDecimal(100)).intValue());
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TExchangeOrderServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TExchangeOrderServiceImpl.java
index 243c47e..7b112a6 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TExchangeOrderServiceImpl.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TExchangeOrderServiceImpl.java
@@ -4,8 +4,11 @@
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.account.api.feignClient.AppUserAddressClient;
import com.ruoyi.account.api.feignClient.AppUserClient;
+import com.ruoyi.account.api.feignClient.AppUserIntegralChangeClient;
import com.ruoyi.account.api.model.TAppUser;
import com.ruoyi.account.api.model.TAppUserAddress;
+import com.ruoyi.account.api.model.TAppUserIntegralChange;
+import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.PageInfo;
import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.order.api.model.TExchangeOrder;
@@ -57,6 +60,9 @@
@Resource
private AppUserClient appUserClient;
+ @Resource
+ private AppUserIntegralChangeClient appUserIntegralChangeClient;
+
@@ -90,12 +96,16 @@
String imgUrl = "";
if(tExchangeOrder.getOrderType() == 1){
TGoods goods = goodsClient.getGoodsById(tExchangeOrder.getGoodsId()).getData();
- name = goods.getName();
- imgUrl = goods.getCoverPicture();
+ if(null != goods){
+ name = goods.getName();
+ imgUrl = goods.getCoverPicture();
+ }
}else{
TCoupon coupon = couponClient.getCouponById1(tExchangeOrder.getCouponId()).getData();
- name = coupon.getName();
- imgUrl = coupon.getCoverPicture();
+ if(null != coupon){
+ name = coupon.getName();
+ imgUrl = coupon.getCoverPicture();
+ }
}
exchangeOrderList.setName(name);
exchangeOrderList.setImgUrl(imgUrl);
@@ -131,15 +141,19 @@
String imgUrl = "";
if(exchangeOrder.getOrderType() == 1){
TGoods goods = goodsClient.getGoodsById(exchangeOrder.getGoodsId()).getData();
- name = goods.getName();
- imgUrl = goods.getCoverPicture();
+ if(null != goods){
+ name = goods.getName();
+ imgUrl = goods.getCoverPicture();
+ }
}else{
TCoupon coupon = couponClient.getCouponById1(exchangeOrder.getCouponId()).getData();
- info.setCouponType(coupon.getType());
- info.setDays(coupon.getDays());
- info.setEndTime(coupon.getEndTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
- name = coupon.getName();
- imgUrl = coupon.getCoverPicture();
+ if(null != coupon){
+ info.setCouponType(coupon.getType());
+ info.setDays(coupon.getDays());
+ info.setEndTime(coupon.getEndTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+ name = coupon.getName();
+ imgUrl = coupon.getCoverPicture();
+ }
}
info.setName(name);
info.setImgUrl(imgUrl);
@@ -197,4 +211,5 @@
pageInfo.setRecords(list);
return pageInfo;
}
+
}
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderAppealServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderAppealServiceImpl.java
index cd42e4f..5273411 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderAppealServiceImpl.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderAppealServiceImpl.java
@@ -49,31 +49,32 @@
PageInfo<TOrderAppealVO> pageInfo = new PageInfo<>(query.getPageCurr(),query.getPageSize());
List<TOrderAppealVO> list = this.baseMapper.pageList(query,pageInfo);
List<Long> orderIds = list.stream().map(TOrderAppealVO::getOrderId).collect(Collectors.toList());
- if(!CollectionUtils.isEmpty(orderIds)){
- // 查询当前页的订单
- List<TChargingOrder> chargingOrders = chargingOrderMapper.selectList(Wrappers.lambdaQuery(TChargingOrder.class)
- .in(TChargingOrder::getId, orderIds));
- List<TShoppingOrder> shoppingOrders = shoppingOrderMapper.selectList(Wrappers.lambdaQuery(TShoppingOrder.class)
- .in(TShoppingOrder::getId, orderIds));
- list.forEach(item -> {
- if (item.getOrderType() == 1) {
- TChargingOrder tChargingOrder = chargingOrders.stream().filter(chargingOrder -> chargingOrder.getId().equals(item.getOrderId())).findFirst().orElse(null);
- if(Objects.nonNull(tChargingOrder)){
- item.setChargingOrder(tChargingOrder);
- SiteNameVO siteNameVO = chargingGunClient.getAllInfoById(tChargingOrder.getChargingGunId()).getData();
- item.setGunName(siteNameVO.getGunName());
- item.setGunNumber(siteNameVO.getGunNumber());
- item.setPileName(siteNameVO.getPileName());
- item.setPileNumber(siteNameVO.getPileNumber());
- item.setSiteName(siteNameVO.getSiteName());
- item.setEndMode(tChargingOrder.getEndMode());
- }
- }else if (item.getOrderType() == 2) {
- TShoppingOrder tShoppingOrder = shoppingOrders.stream().filter(shoppingOrder -> shoppingOrder.getId().equals(item.getOrderId())).findFirst().orElse(null);
- setGoodsInfo(item,tShoppingOrder);
- }
- });
+ if(CollectionUtils.isEmpty(orderIds)){
+ return new PageInfo<>();
}
+ // 查询当前页的订单
+ List<TChargingOrder> chargingOrders = chargingOrderMapper.selectList(Wrappers.lambdaQuery(TChargingOrder.class)
+ .in(TChargingOrder::getId, orderIds));
+ List<TShoppingOrder> shoppingOrders = shoppingOrderMapper.selectList(Wrappers.lambdaQuery(TShoppingOrder.class)
+ .in(TShoppingOrder::getId, orderIds));
+ list.forEach(item -> {
+ if (item.getOrderType() == 1) {
+ TChargingOrder tChargingOrder = chargingOrders.stream().filter(chargingOrder -> chargingOrder.getId().equals(item.getOrderId())).findFirst().orElse(null);
+ if(Objects.nonNull(tChargingOrder)){
+ item.setChargingOrder(tChargingOrder);
+ SiteNameVO siteNameVO = chargingGunClient.getAllInfoById(tChargingOrder.getChargingGunId()).getData();
+ item.setGunName(siteNameVO.getGunName());
+ item.setGunNumber(siteNameVO.getGunNumber());
+ item.setPileName(siteNameVO.getPileName());
+ item.setPileNumber(siteNameVO.getPileNumber());
+ item.setSiteName(siteNameVO.getSiteName());
+ item.setEndMode(tChargingOrder.getEndMode());
+ }
+ }else if (item.getOrderType() == 2) {
+ TShoppingOrder tShoppingOrder = shoppingOrders.stream().filter(shoppingOrder -> shoppingOrder.getId().equals(item.getOrderId())).findFirst().orElse(null);
+ setGoodsInfo(item,tShoppingOrder);
+ }
+ });
list.forEach(e->e.setUid(e.getId().toString()));
pageInfo.setRecords(list);
return pageInfo;
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderInvoiceServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderInvoiceServiceImpl.java
index 9e9a60e..38cd013 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderInvoiceServiceImpl.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderInvoiceServiceImpl.java
@@ -119,13 +119,17 @@
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
String code = Double.valueOf(Math.random() * 1000).intValue() + sdf.format(new Date());
+ //获取开票类型
+ TInvoiceType invoiceType = invoiceTypeClient.getInvoiceType(addOrderInvoice.getInvoiceTypeId()).getData();
+ addOrderInvoice.setInvoicingCompany(invoiceType.getInvoicingCompany());
+ addOrderInvoice.setInvoiceType(invoiceType.getName());
+ addOrderInvoice.setInvoiceMaterial(2);
+ addOrderInvoice.setInvoicingMethod(invoiceType.getInvoicingMethod());
addOrderInvoice.setAppUserId(userId);
addOrderInvoice.setCode(code);
addOrderInvoice.setStatus(1);
addOrderInvoice.setCreateTime(LocalDateTime.now());
this.save(addOrderInvoice);
- //获取开票类型
- TInvoiceType invoiceType = invoiceTypeClient.getInvoiceType(addOrderInvoice.getInvoiceTypeId()).getData();
for (Long orderId : orderIds) {
List<TChargingOrderAccountingStrategy> list = chargingOrderAccountingStrategyService.list(new LambdaQueryWrapper<TChargingOrderAccountingStrategy>()
.eq(TChargingOrderAccountingStrategy::getChargingOrderId, orderId));
@@ -263,31 +267,37 @@
List<TOrderInvoiceVO> list = this.baseMapper.pageList(query,pageInfo);
for (TOrderInvoiceVO tOrderInvoiceVO : list) {
tOrderInvoiceVO.setUid(tOrderInvoiceVO.getId().toString());
- List<Long> collect = orderInvoiceDetailService.lambdaQuery().eq(TOrderInvoiceDetail::getOrderInvoiceId, tOrderInvoiceVO.getId())
- .eq(TOrderInvoiceDetail::getOrderType, 1).list().stream()
+ List<Long> collect = orderInvoiceDetailService.lambdaQuery().eq(TOrderInvoiceDetail::getOrderInvoiceId, tOrderInvoiceVO.getId()).list().stream()
.map(TOrderInvoiceDetail::getOrderId).collect(Collectors.toList());
// 将其全部转化为String
tOrderInvoiceVO.setIds(collect.stream().map(String::valueOf).collect(Collectors.toList()));
}
// 查询这个开票的订单ids
- List<Long> ids = list.stream().map(TOrderInvoiceVO::getId).collect(Collectors.toList());
+ if (!list.isEmpty()){
+ List<Long> ids = list.stream().map(TOrderInvoiceVO::getId).collect(Collectors.toList());
- List<TOrderInvoiceDetail> orderInvoiceDetailList = orderInvoiceDetailService.list(new LambdaQueryWrapper<TOrderInvoiceDetail>()
- .in(TOrderInvoiceDetail::getOrderInvoiceId, ids));
+ List<TOrderInvoiceDetail> orderInvoiceDetailList = orderInvoiceDetailService.list(new LambdaQueryWrapper<TOrderInvoiceDetail>()
+ .in(TOrderInvoiceDetail::getOrderInvoiceId, ids));
- List<TAppUser> finalTAppUsers = tAppUsers;
- list.forEach(e->{
- e.setServiceTariff(orderInvoiceDetailList.get(0).getServiceTariff());
- e.setElectricityTariff(orderInvoiceDetailList.get(0).getElectricityTariff());
- e.setAddedServiceTariff(orderInvoiceDetailList.get(0).getAddedServiceTariff());
- e.setAddedService(orderInvoiceDetailList.stream().filter(t->t.getAddedService()!=null).map(TOrderInvoiceDetail::getAddedService).reduce(BigDecimal::add).get());
- e.setElectrovalence(orderInvoiceDetailList.stream().filter(t->t.getElectrovalence()!=null).map(TOrderInvoiceDetail::getElectrovalence).reduce(BigDecimal::add).get());
- e.setServiceCharge(orderInvoiceDetailList.stream().filter(t->t.getServiceCharge()!=null).map(TOrderInvoiceDetail::getServiceCharge).reduce(BigDecimal::add).get());
- if (e.getBillingUserId()!=null){
- e.setUserPhone(finalTAppUsers.stream().filter(t->t.getId()!=null).filter(m->m.getId().equals(Long.parseLong(e.getBillingUserId().toString()))).findFirst().get().getPhone());
- }
- });
+ List<TAppUser> finalTAppUsers = tAppUsers;
+ list.forEach(e->{
+ if (e.getOrderType()!=null&&e.getOrderType()==1){
+ e.setServiceTariff(orderInvoiceDetailList.get(0).getServiceTariff());
+ }else{
+ e.setServiceTariff(new BigDecimal("0"));
+ }
+ e.setElectricityTariff(orderInvoiceDetailList.get(0).getElectricityTariff());
+ e.setAddedServiceTariff(orderInvoiceDetailList.get(0).getAddedServiceTariff());
+ e.setAddedService(orderInvoiceDetailList.stream().filter(t->t.getAddedService()!=null).map(TOrderInvoiceDetail::getAddedService).reduce(BigDecimal::add).get());
+ e.setElectrovalence(orderInvoiceDetailList.stream().filter(t->t.getElectrovalence()!=null).map(TOrderInvoiceDetail::getElectrovalence).reduce(BigDecimal::add).get());
+ e.setServiceCharge(orderInvoiceDetailList.stream().filter(t->t.getServiceCharge()!=null).map(TOrderInvoiceDetail::getServiceCharge).reduce(BigDecimal::add).get());
+ if (e.getBillingUserId()!=null){
+ e.setUserPhone(finalTAppUsers.stream().filter(t->t.getId()!=null).filter(m->m.getId().equals(Long.parseLong(e.getBillingUserId().toString()))).findFirst().get().getPhone());
+ }
+ });
+ }
+
pageInfo.setRecords(list);
return pageInfo;
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TShoppingOrderServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TShoppingOrderServiceImpl.java
index 75e28c4..1093912 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TShoppingOrderServiceImpl.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TShoppingOrderServiceImpl.java
@@ -25,6 +25,7 @@
import com.ruoyi.order.mapper.TShoppingOrderMapper;
import com.ruoyi.order.service.TShoppingOrderRefundService;
import com.ruoyi.order.service.TShoppingOrderService;
+import com.ruoyi.order.util.RedisLock;
import com.ruoyi.other.api.domain.TCoupon;
import com.ruoyi.other.api.domain.TGoods;
import com.ruoyi.other.api.feignClient.CouponClient;
@@ -37,6 +38,8 @@
import com.ruoyi.payment.api.vo.AliQueryOrder;
import com.ruoyi.payment.api.vo.NotifyV3PayDecodeRespBody;
import io.seata.spring.annotation.GlobalTransactional;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
@@ -85,6 +88,9 @@
@Resource
private TShoppingOrderRefundService shoppingOrderRefundService;
+
+ @Autowired
+ public RedisTemplate redisTemplate;
@@ -196,7 +202,7 @@
public Map<String, Object> getMyShoppingOrderList(GetMyShoppingOrderList query) {
Long userId = tokenService.getLoginUserApplet().getUserId();
LambdaQueryWrapper<TShoppingOrder> wrapper = new LambdaQueryWrapper<TShoppingOrder>().eq(TShoppingOrder::getDelFlag, 0)
- .eq(TShoppingOrder::getAppUserId, userId);
+ .eq(TShoppingOrder::getAppUserId, userId).eq(TShoppingOrder::getPaymentStatus, 2);
if(query.getStatus() != 0){
wrapper.eq(TShoppingOrder::getStatus, query.getStatus());
}
@@ -249,7 +255,7 @@
TAppUserAddress userAddress = appUserAddressClient.getAppUserAddressById(shoppingOrder.getAppUserAddressId()).getData();
info.setConsignee(userAddress.getName());
info.setPhone(userAddress.getPhone());
- info.setAddress(userAddress.getAddress());
+ info.setAddress(userAddress.getProvince() + userAddress.getCity() + userAddress.getDistrict() + userAddress.getAddress());
info.setExpressCompany(shoppingOrder.getExpressCompany());
info.setExpressNumber(shoppingOrder.getExpressNumber());
String name = "";
@@ -309,7 +315,7 @@
//退款金额
BigDecimal refundAmount = shoppingOrder.getPaymentAmount().subtract(bigDecimal);
-
+
//先查询第三方订单状态订单是否退款
//支付方式(1=微信,2=支付宝)
Integer paymentType = shoppingOrder.getPaymentType();
@@ -358,13 +364,16 @@
shoppingOrderRefund.setRefundRemark("全额退款");
shoppingOrderRefund.setRefundTotalAmount(refundAmount.add(bigDecimal));
shoppingOrderRefund.setPayAmount(shoppingOrder.getPaymentAmount());
+
+ shoppingOrder.setCancellationTime(LocalDateTime.now());
+ shoppingOrder.setCancellationId(shoppingOrder.getAppUserId());
if(1 == paymentType){
WxPaymentRefundModel model = new WxPaymentRefundModel();
model.setOut_trade_no(shoppingOrder.getCode());
model.setTransaction_id(shoppingOrder.getSerialNumber());
model.setOut_refund_no(shoppingOrderRefund.getRefundCode());
model.setReason("取消订单");
- model.setNotify_url("http://221.182.45.100:9000/order/t-shopping-order/cancelShoppingOrderWxRefund");
+ model.setNotify_url("/order/t-shopping-order/cancelShoppingOrderWxRefund");
WxPaymentRefundModel.RefundAmount amount = new WxPaymentRefundModel.RefundAmount();
amount.setRefund(refundAmount.multiply(new BigDecimal(100)).intValue());
amount.setTotal(shoppingOrder.getPaymentAmount().multiply(new BigDecimal(100)).intValue());
@@ -372,6 +381,7 @@
model.setAmount(amount);
R<String> orderR = wxPaymentClient.refundOrderR(model);
if(200 == orderR.getCode()){
+ this.updateById(shoppingOrder);
shoppingOrderRefundService.save(shoppingOrderRefund);
}
}
@@ -383,11 +393,9 @@
dto.setRefundReason("取消订单");
RefundResp resp = aliPaymentClient.refund(dto).getData();
if(null != resp){
+ this.updateById(shoppingOrder);
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-DDTHH:mm:ss+TIMEZONE");
AjaxResult success = cancelShoppingOrderWxRefund(resp.getOutTradeNo(), resp.getTradeNo(), "SUCCESS", sdf1.format(new Date()));
- if(success.isSuccess()){
- shoppingOrderRefundService.save(shoppingOrderRefund);
- }
}
}
return AjaxResult.success();
@@ -413,28 +421,50 @@
shoppingOrderRefundService.updateById(one);
//判断是否需要回退库存
TShoppingOrder shoppingOrder = this.getById(one.getShoppingOrderId());
+ shoppingOrder.setStatus(4);
+ shoppingOrder.setRefundCode(one.getRefundSerialNumber());
+ shoppingOrder.setRefundAmount(one.getRefundAmount());
+ shoppingOrder.setRefundStatus(2);
+ shoppingOrder.setRefundTime(one.getRefundTime());
+ this.updateById(shoppingOrder);
+
//商品
if(shoppingOrder.getOrderType() == 1){
- // todo 需完善redis锁
//redis锁 和支付使用同一个锁
- TGoods goods = goodsClient.getGoodsById(shoppingOrder.getGoodsId()).getData();
- Integer inventory = goods.getInventory();
- if(-1 != inventory){
- goods.setInventory(inventory + shoppingOrder.getPurchaseQuantity());
- goodsClient.updateGoods(goods);
+ RedisLock redisLock = new RedisLock(redisTemplate, "SHOPPING_GOODS_LOCK", 5, 30000);
+ try {
+ redisLock.lock();
+ TGoods goods = goodsClient.getGoodsById(shoppingOrder.getGoodsId()).getData();
+ Integer inventory = goods.getInventory();
+ if(-1 != inventory){
+ goods.setInventory(inventory + shoppingOrder.getPurchaseQuantity());
+ goodsClient.updateGoods(goods);
+ }
+ }catch (Exception e){
+ e.printStackTrace();
+ }finally {
+ //解锁
+ redisLock.unlock();
}
- //解锁
}
//优惠券
if(shoppingOrder.getOrderType() == 2){
- //redis锁
- TCoupon coupon = couponClient.getCouponById1(shoppingOrder.getCouponId()).getData();
- Integer inventory = coupon.getInventoryQuantity();
- if(-1 != inventory){
- coupon.setInventoryQuantity(inventory + shoppingOrder.getPurchaseQuantity());
- couponClient.updateCoupon(coupon);
+ //redis锁 和支付使用同一个锁
+ RedisLock redisLock = new RedisLock(redisTemplate, "SHOPPING_COUPON_LOCK", 5, 30000);
+ try {
+ redisLock.lock();
+ TCoupon coupon = couponClient.getCouponById1(shoppingOrder.getCouponId()).getData();
+ Integer inventory = coupon.getInventoryQuantity();
+ if(-1 != inventory){
+ coupon.setInventoryQuantity(inventory + shoppingOrder.getPurchaseQuantity());
+ couponClient.updateCoupon(coupon);
+ }
+ }catch (Exception e){
+ e.printStackTrace();
+ }finally {
+ //解锁
+ redisLock.unlock();
}
- //解锁
}
}
return AjaxResult.success();
@@ -525,6 +555,7 @@
if (data1!=null){
tShoppingOrder.setName(data1.getName());
}
+ tShoppingOrder.setStatus(3);
break;
}
if (tShoppingOrder.getAppUserId() != null){
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TVipOrderServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TVipOrderServiceImpl.java
index 2e2f137..23aeefd 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TVipOrderServiceImpl.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TVipOrderServiceImpl.java
@@ -3,6 +3,8 @@
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.account.api.dto.GiveVipDto;
+import com.ruoyi.account.api.feignClient.AppUserClient;
+import com.ruoyi.account.api.model.TAppUser;
import com.ruoyi.common.core.web.page.PageInfo;
import com.ruoyi.order.api.model.TShoppingOrder;
import com.ruoyi.order.api.model.TVipOrder;
@@ -33,6 +35,8 @@
@Resource
private VipClient vipClient;
+ @Resource
+ private AppUserClient appUserClient;
@Override
public PageInfo<TVipOrder> pageList(VipShoppingOrderQuery query) {
String startTime1 = null;
@@ -53,6 +57,13 @@
if (data!=null){
tVipOrder.setName(data.getName());
}
+ if (StringUtils.hasLength(tVipOrder.getTitle()))
+ {
+ // 去除最后两个字符
+ tVipOrder.setName(tVipOrder.getTitle().substring(0, tVipOrder.getTitle().length() - 2));
+ }
+ TAppUser data1 = appUserClient.getUserById(tVipOrder.getAppUserId()).getData();
+ if (data1!=null)tVipOrder.setUserPhone(data1.getPhone());
}
pageInfo.setRecords(list);
return pageInfo;
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/util/RedisLock.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/util/RedisLock.java
new file mode 100644
index 0000000..b9954c8
--- /dev/null
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/util/RedisLock.java
@@ -0,0 +1,51 @@
+package com.ruoyi.order.util;
+
+import org.springframework.data.redis.core.RedisTemplate;
+
+import java.util.UUID;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author zhibing.pu
+ * @Date 2024/9/26 18:43
+ */
+public class RedisLock {
+ private RedisTemplate<String, String> redisTemplate;
+ private String lockKey;
+ private int expireTime; // 锁的超时时间
+ private int timeout; // 获取锁的超时时间
+
+
+ public RedisLock(RedisTemplate<String, String> redisTemplate, String lockKey, int expireTime, int timeout) {
+ this.redisTemplate = redisTemplate;
+ this.lockKey = lockKey;
+ this.expireTime = expireTime;
+ this.timeout = timeout;
+ }
+
+ public boolean lock() {
+ String identifier = UUID.randomUUID().toString();
+ long end = System.currentTimeMillis() + timeout;
+ while (System.currentTimeMillis() < end) {
+ if (redisTemplate.opsForValue().setIfAbsent(lockKey, identifier, expireTime, TimeUnit.SECONDS)) {
+ return true;
+ }
+ // 可以使用延时来减少CPU占用
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ }
+ }
+ return false;
+ }
+
+ public boolean unlock() {
+ String identifier = redisTemplate.opsForValue().get(lockKey);
+ if (identifier != null && identifier.equals(UUID.randomUUID().toString())) {
+ redisTemplate.delete(lockKey);
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/util/task/TaskUtil.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/util/task/TaskUtil.java
new file mode 100644
index 0000000..a79ee1a
--- /dev/null
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/util/task/TaskUtil.java
@@ -0,0 +1,120 @@
+package com.ruoyi.order.util.task;
+
+import com.alibaba.fastjson2.util.UUIDUtils;
+import com.alibaba.nacos.common.utils.UuidUtils;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.ruoyi.chargingPile.api.feignClient.SiteClient;
+import com.ruoyi.chargingPile.api.model.Site;
+import com.ruoyi.order.api.model.TChargingBill;
+import com.ruoyi.order.service.TChargingBillService;
+import org.apache.logging.log4j.core.util.UuidUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Random;
+import java.util.stream.Collectors;
+
+/**
+ * @author zhibing.pu
+ * @date 2023/7/11 8:39
+ */
+@Component
+public class TaskUtil {
+
+ @Resource
+ private TChargingBillService chargingBillService;
+ @Resource
+ private SiteClient siteClient;
+
+ public static void main(String[] args) {
+ LocalDate firstDayOfLastMonth = LocalDate.now().minusMonths(1).
+ withDayOfMonth(2);
+ String string = firstDayOfLastMonth.toString();
+ // 将-替换为空字符串
+ string = string.replace("-", "");
+ System.err.println(string);
+ }
+ // 每月2号凌晨12点执行的定时任务
+ @Scheduled(cron = "0 0 0 2 * ?")
+ public void taskMonth() {
+ try {
+ // 获取上个月的开始和结束日期
+ LocalDate firstDayOfLastMonth = LocalDate.now().minusMonths(1).
+ withDayOfMonth(2);
+ String string = firstDayOfLastMonth.toString();
+ // 将-替换为空字符串
+ string = string.replace("-", "");
+ // 生成一次全站订单
+ TChargingBill tChargingBill = new TChargingBill();
+ // 订单生成规则JSD+20231201(账单所属月份)+1131304205(随机10位数)+001(当月账单序号,每月重置)
+ Random random = new Random();
+ String randomDigits = random.ints(10, 0, 10) // 生成10个随机数字,范围在0-9
+ .mapToObj(String::valueOf)
+ .collect(Collectors.joining()); // 将其连接成一个字符串
+ tChargingBill.setCode("JSD"+string+randomDigits+"001" );
+ tChargingBill.setType(1);
+ tChargingBill.setBillTime(LocalDateTime.now());
+ tChargingBill.setStatus(1);
+ tChargingBill.setOrderState(2);
+ chargingBillService.save(tChargingBill);
+ // 每月二号给每个站点生成上月账单
+ List<Integer> collect = siteClient.getSiteAll().getData().stream().map(Site::getId).collect(Collectors.toList());
+ List<TChargingBill> tChargingBills = new ArrayList<>();
+ for (int i = 1; i <= collect.size(); i++) {
+ TChargingBill tChargingBill1 = new TChargingBill();
+ Random random1 = new Random();
+ String randomDigits1 = random1.ints(10, 0, 10) // 生成10个随机数字,范围在0-9
+ .mapToObj(String::valueOf)
+ .collect(Collectors.joining()); // 将其连接成一个字符串
+ tChargingBill1.setCode("JSD"+string+randomDigits1+i );
+ tChargingBill1.setType(2);
+ tChargingBill1.setSiteId(collect.get(i));
+ tChargingBill1.setBillTime(LocalDateTime.now());
+ tChargingBill1.setStatus(1);
+ tChargingBill1.setOrderState(2);
+ tChargingBills.add(tChargingBill1);
+ }
+ if (!tChargingBills.isEmpty())chargingBillService.saveBatch(tChargingBills);
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ // 每个月最后一天23点执行的定时任务
+ @Scheduled(cron = "0 0 23 L * ?")
+ public void taskLastDay() {
+ try {
+ // 获取上个月的开始和结束日期
+ LocalDate firstDayOfLastMonth = LocalDate.now().minusMonths(1).
+ withDayOfMonth(1);
+ LocalDate lastDayOfLastMonth = LocalDate.now().minusMonths(1).
+ withDayOfMonth(firstDayOfLastMonth.lengthOfMonth());
+ // 将 LocalDate 转换为 LocalDateTime,并设定时间为一天的开始
+ LocalDateTime startDateTime = firstDayOfLastMonth.atStartOfDay();
+ LocalDateTime endDateTime = lastDayOfLastMonth.atTime(23, 59, 59); // 设定到最后一秒
+ // 构建查询条件
+ LambdaQueryWrapper<TChargingBill> queryWrapper = new LambdaQueryWrapper<>();
+ queryWrapper.ge(TChargingBill::getBillTime,
+ Date.from(startDateTime.atZone(ZoneId.systemDefault()).toInstant()))
+ .le(TChargingBill::getBillTime,
+ Date.from(endDateTime.atZone(ZoneId.systemDefault()).toInstant())); // 使用 le 包括最后一天的记录
+ List<TChargingBill> list = chargingBillService.list(queryWrapper);
+ for (TChargingBill tChargingBill : list) {
+ tChargingBill.setStatus(2);
+ }
+ chargingBillService.updateBatchById(list);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+}
diff --git a/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TChargingOrderMapper.xml b/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TChargingOrderMapper.xml
index 3d2dba7..a1b1e71 100644
--- a/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TChargingOrderMapper.xml
+++ b/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TChargingOrderMapper.xml
@@ -62,7 +62,7 @@
</if>
</select>
<select id="getNoInvoicedOrder" resultMap="BaseResultMap">
- select * from t_charging_order where del_flag = 0 and app_user_id = #{appUserId}
+ select * from t_charging_order where del_flag = 0 and status = 5 and recharge_payment_status = 2 and payment_amount is null and app_user_id = #{appUserId}
<if test="null != month and '' != month">
and DATE_FORMAT(end_time, '%Y-%m') = #{month}
</if>
@@ -109,12 +109,11 @@
</if>
</select>
<select id="payOrderQuery" resultType="com.ruoyi.order.dto.PayOrderDto">
- SELECT * FROM (SELECT
+ SELECT o.*,i.phone FROM (SELECT
id,
`code`,
1 as type,
title,
- phone,
`status`,
order_amount,
payment_amount ,
@@ -123,7 +122,8 @@
pay_time,
refund_status,
(payment_amount-refund_amount) as final_amount,
- del_flag
+ del_flag,
+ app_user_id
FROM
charging_pile_order.t_charging_order
where recharge_payment_status = 2
@@ -133,7 +133,6 @@
`code`,
2 as type,
title,
- phone,
`status`,
order_amount,
payment_amount ,
@@ -142,7 +141,8 @@
pay_time,
refund_status,
(payment_amount-refund_amount) as final_amount,
- del_flag
+ del_flag,
+ app_user_id
FROM
charging_pile_order.t_shopping_order
where payment_status = 2
@@ -152,7 +152,6 @@
`code`,
3 as type,
title,
- phone,
payment_status AS `status`,
order_amount,
payment_amount ,
@@ -161,7 +160,8 @@
pay_time,
refund_status,
(payment_amount-refund_amount) as final_amount,
- del_flag
+ del_flag,
+ app_user_id
FROM
charging_pile_order.t_vip_order
@@ -172,7 +172,6 @@
`code`,
4 as type,
title,
- phone,
`status`,
order_amount ,
order_amount as payment_amount,
@@ -181,9 +180,11 @@
out_parking_time as pay_time,
null as refund_status,
0 as final_amount,
- 0 as del_flag
+ 0 as del_flag,
+ app_user_id
FROM
charging_pile_service.t_parking_record ) o
+ LEFT JOIN `charging_pile_account`.`t_app_user` i on o.app_user_id = i.id
<where>
o.del_flag = 0
<if test="data.code != null and data.code != ''">
@@ -207,6 +208,13 @@
#{id}
</foreach>
</if>
+ <if test="data.isRefund == 1">
+ AND o.refund_status is not null
+ </if>
+ <if test="data.isRefund == 1">
+ AND o.refund_status is null
+ </if>
+
</where>
ORDER BY o.create_time desc
@@ -226,7 +234,9 @@
re.refund_remark,
co.recharge_serial_number as serail_number,
co.payment_amount,
- co.pay_time
+ co.create_time as pay_time,
+ co.id as order_id,
+ co.app_user_id as user_id
FROM t_charging_order_refund re
LEFT JOIN t_charging_order co ON re.charging_order_id = co.id
UNION ALL
@@ -243,7 +253,9 @@
re.refund_remark,
so.serial_number,
so.payment_amount,
- so.pay_time
+ so.create_time as pay_time,
+ so.id as order_id,
+ so.app_user_id as user_id
FROM t_shopping_order_refund re
LEFT JOIN t_shopping_order so on re.shopping_order_id = so.id
UNION ALL
@@ -260,7 +272,9 @@
vr.refund_remark,
vo.serial_number,
vo.payment_amount,
- vo.pay_time
+ vo.create_time as pay_time,
+ vo.id as order_id,
+ vo.app_user_id as user_id
FROM t_vip_order_refund vr
LEFT JOIN t_vip_order vo on vr.vip_order_id = vo.id
@@ -274,7 +288,7 @@
AND o.refund_code LIKE CONCAT('%',#{data.refundCode},'%')
</if>
</where>
-
+ order by o.refund_time desc
</select>
<select id="chargingOrderGroup" resultType="com.ruoyi.common.core.dto.ChargingOrderGroup">
@@ -1285,9 +1299,10 @@
<if test="statisticsQueryDto.type == 2">
end_time
</if>
- , '%Y-%m-%d %H' ) as time,
+ , '%H:00' ) as time,
SUM(service_charge) as servicecharge,
SUM(electrovalence) as electrovalence,
+ SUM(electricity) as electricity,
count(1) as orderCount
FROM
t_charging_order
@@ -1323,10 +1338,10 @@
, '%Y-%m-%d' ) as time,
SUM(service_charge) as servicecharge,
SUM(electrovalence) as electrovalence,
- count(1) as orderCount
+ count(1) as orderCount,
+ SUM(electricity) as electricity
FROM
t_charging_order
-
WHERE del_flag = 0 and recharge_payment_status = 2 and DATE(
<if test="statisticsQueryDto.type == 1">
start_time
@@ -1358,7 +1373,8 @@
, '%Y-%m' ) as time,
SUM(service_charge) as servicecharge,
SUM(electrovalence) as electrovalence,
- count(1) as orderCount
+ count(1) as orderCount,
+ SUM(electricity) as electricity
FROM
t_charging_order
@@ -1385,7 +1401,7 @@
</select>
<select id="getchargingCapacity" resultType="java.util.Map">
SELECT
- DATE_FORMAT( create_time, '%Y-%m-%d %H' ) as time,
+ DATE_FORMAT( create_time, '%Y-%m-%d' ) as time,
SUM(charging_capacity) as chargingCapacity
FROM
t_charging_order
diff --git a/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TExchangeOrderMapper.xml b/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TExchangeOrderMapper.xml
index 9ca7ee5..2cad0b5 100644
--- a/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TExchangeOrderMapper.xml
+++ b/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TExchangeOrderMapper.xml
@@ -37,28 +37,39 @@
<if test="null != req.code and req.code!=''">
and t1.code LIKE CONCAT('%',#{req.code},'%')
</if>
+ <if test="null != req.status">
+ and t1.status = #{req.status}
+ </if>
<if test="null != req.userIds and req.userIds.size()>0" >
and t1.app_user_id in
<foreach collection="req.userIds" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
- <if test="null != req.couponIds and req.couponIds.size()>0 or null != req.couponIds and req.couponIds.size()>0" >
- and (t1.goods_id in
- <foreach collection="req.goodsIds" item="item" index="index" separator="," open="(" close=")">
+ <if test="null != req.userIds and req.userIds.size()>0" >
+ and t1.app_user_id in
+ <foreach collection="req.userIds" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
- or
+ </if>
+
+ <if test="null != req.couponIds and req.couponIds.size()>0" >
and t1.coupon_id in
<foreach collection="req.couponIds" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
- )
+ </if>
+ <if test="null != req.goodsIds and req.goodsIds.size()>0" >
+ and t1.goods_id in
+ <foreach collection="req.goodsIds" item="item" index="index" separator="," open="(" close=")">
+ #{item}
+ </foreach>
</if>
<if test="startTime1 != null and startTime1!=''">
- and (t1.create_time between #{startTime1} and #{startTime2}
+ and (t1.create_time between #{startTime1} and #{startTime2})
</if>
AND t1.del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()}
+ order by t1.create_time desc
</select>
</mapper>
diff --git a/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TShoppingOrderMapper.xml b/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TShoppingOrderMapper.xml
index d19a9f2..514f70e 100644
--- a/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TShoppingOrderMapper.xml
+++ b/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TShoppingOrderMapper.xml
@@ -214,7 +214,7 @@
<select id="getNoInvoicedOrder" resultMap="BaseResultMap">
- select * from t_shopping_order where del_flag = 0 and app_user_id = #{appUserId}
+ select * from t_shopping_order where del_flag = 0 and payment_status = 2 and status = 3 and app_user_id = #{appUserId}
<if test="null != month and '' != month">
and DATE_FORMAT(create_time, '%Y-%m') = #{month}
</if>
@@ -227,9 +227,12 @@
<select id="pageList" resultType="com.ruoyi.order.api.model.TShoppingOrder">
select t1.*
from t_shopping_order t1
- where 1=1
+ where 1 = 1
<if test="null != req.code and req.code!=''">
and t1.code LIKE CONCAT('%',#{req.code},'%')
+ </if>
+ <if test="null != req.status">
+ and t1.status = #{req.status}
</if>
<if test="null != req.userIds and req.userIds.size()>0" >
and t1.app_user_id in
@@ -238,23 +241,24 @@
</foreach>
</if>
- <if test="null != req.couponIds and req.couponIds.size()>0 or null != req.couponIds and req.couponIds.size()>0" >
- and (t1.goods_id in
- <foreach collection="req.goodsIds" item="item" index="index" separator="," open="(" close=")">
- #{item}
- </foreach>
- or
+ <if test="null != req.couponIds and req.couponIds.size()>0" >
and t1.coupon_id in
<foreach collection="req.couponIds" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
- )
+ </if>
+ <if test="null != req.goodsIds and req.goodsIds.size()>0" >
+ and t1.goods_id in
+ <foreach collection="req.goodsIds" item="item" index="index" separator="," open="(" close=")">
+ #{item}
+ </foreach>
</if>
<if test="startTime1 != null and startTime1!=''">
- and (t1.create_time between #{startTime1} and #{startTime2}
+ and (t1.create_time between #{startTime1} and #{startTime2})
</if>
and t1.payment_status = 2
AND t1.del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()}
+ order by t1.create_time desc
</select>
<select id="sixBefore" resultType="com.ruoyi.order.dto.SixShopDto">
SELECT
@@ -305,17 +309,16 @@
payment_amount
FROM
t_shopping_order
- <where>
- WHERE del_flag = 0 and payment_status = 2 and ISNULL(refund_status) and status!=4
+ WHERE del_flag = 0 and payment_status = 2 and ISNULL(refund_status) and status!=4 and
DATE_FORMAT(create_time, '%Y-%m-%d') between #{statisticsQueryDto.startTime} and #{statisticsQueryDto.endTime}
- </where>
+
) AS subquery
GROUP BY
- DATE_FORMAT( subquery.create_time, '%Y-%m-%d' );
+ DATE_FORMAT( subquery.create_time, '%Y-%m-%d' )
</select>
diff --git a/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TVipOrderMapper.xml b/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TVipOrderMapper.xml
index 70127f8..739d696 100644
--- a/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TVipOrderMapper.xml
+++ b/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TVipOrderMapper.xml
@@ -42,9 +42,11 @@
and t1.vip_id = #{req.vipId}
</if>
<if test="startTime1 != null and startTime1!=''">
- and (t1.create_time between #{startTime1} and #{startTime2}
+ and t1.create_time between #{startTime1} and #{startTime2}
</if>
+ and t1.payment_status = 2
AND t1.del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()}
+ order by t1.create_time desc
</select>
<select id="sixBefore" resultType="com.ruoyi.order.dto.SixVipDto">
SELECT
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TAdvertisingController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TAdvertisingController.java
index 47f1a2f..c279c78 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TAdvertisingController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TAdvertisingController.java
@@ -1,6 +1,7 @@
package com.ruoyi.other.controller;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.core.enums.status.AdvertisingStatusEnum;
import com.ruoyi.common.core.web.domain.AjaxResult;
@@ -17,11 +18,23 @@
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.security.SecureRandom;
+import java.text.SimpleDateFormat;
+import java.util.*;
/**
* <p>
@@ -55,7 +68,16 @@
@ApiOperation(tags = {"管理后台-广告管理"},value = "广告修改")
@Log(title = "【广告管理】修改广告", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE)
public AjaxResult updateVip(@RequestBody TAdvertising dto) {
- advertisingService.updateById(dto);
+ if (dto.getJumpType() == 2){
+ // 清空跳转地址
+ advertisingService.updateById(dto);
+ LambdaUpdateWrapper<TAdvertising> tAdvertisingLambdaUpdateWrapper = new LambdaUpdateWrapper<>();
+ tAdvertisingLambdaUpdateWrapper.eq(TAdvertising::getId,dto.getId())
+ .set(TAdvertising::getJumpUrl,null);
+ advertisingService.update(tAdvertisingLambdaUpdateWrapper);
+ }else{
+ advertisingService.updateById(dto);
+ }
return AjaxResult.success();
}
@GetMapping("/getInfo")
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TCompanyController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TCompanyController.java
index d355f5c..36138e4 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TCompanyController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TCompanyController.java
@@ -31,7 +31,7 @@
public R<Page<TCompany>> unitPage(@RequestBody UnitListQueryDto unitListQueryDto) {
Page<TCompany> page = companyService.lambdaQuery()
.orderByDesc(TCompany::getCreateTime)
- .like(unitListQueryDto.getCompanyName() != null && unitListQueryDto.getCompanyName().isEmpty(), TCompany::getName, unitListQueryDto.getCompanyName())
+ .like(unitListQueryDto.getCompanyName() != null && unitListQueryDto.getCompanyName()!="", TCompany::getName, unitListQueryDto.getCompanyName())
.page(Page.of(unitListQueryDto.getPageCurr(), unitListQueryDto.getPageSize()));
return R.ok(page);
}
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TCouponController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TCouponController.java
index 07d4925..9a00b7d 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TCouponController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TCouponController.java
@@ -35,6 +35,7 @@
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.time.LocalDateTime;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
@@ -180,6 +181,24 @@
public AjaxResult<PageInfo<TCoupon>> pageList(@RequestBody CouponQuery dto) {
return AjaxResult.ok(tCouponService.pageList(dto));
}
+ @ApiOperation(tags = {"管理后台-优惠券管理"},value = "优惠券列表分页查询")
+ @PostMapping(value = "/pageList3")
+ public AjaxResult<List<TCoupon>> pageList() {
+ List<TCoupon> tCoupons = new ArrayList<>();
+
+ List<TCoupon> list = tCouponService.lambdaQuery().eq(TCoupon::getStatus, 1)
+ .orderByDesc(TCoupon::getCreateTime).list();
+ for (TCoupon tCoupon : list) {
+ if (tCoupon.getValidityPeriodMode()==1){
+ if (LocalDateTime.now().isBefore(tCoupon.getEndTime())){
+ tCoupons.add(tCoupon);
+ }
+ }else{
+ tCoupons.add(tCoupon);
+ }
+ }
+ return AjaxResult.ok(tCoupons);
+ }
/**
* 小程序远程调用 获取优惠券信息
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TGoodsController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TGoodsController.java
index 97901b7..1eb1e82 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TGoodsController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TGoodsController.java
@@ -12,6 +12,7 @@
import com.ruoyi.account.api.model.TAppUser;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.dto.AppGoodQuery;
+import com.ruoyi.common.core.dto.ExchangeBackDto;
import com.ruoyi.common.core.dto.PointChangeDto;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.BasePage;
@@ -184,8 +185,7 @@
return R.ok();
}
- @ApiOperation(tags = {"小程序-" +
- "兑换商城"},value = "积分兑换商品")
+ @ApiOperation(tags = {"小程序-兑换商城"},value = "积分兑换商品")
@PostMapping(value = "/app/shop")
public AjaxResult<PageInfo<TGoods>> shop(@RequestBody ExchangeDto exchangeDto) {
//检查当前用户积分是否够
@@ -201,6 +201,9 @@
Long count = orderClient.getExchangeById(exchangeDto.getGoodId(), userId,exchangeDto.getGoodType()).getData();
if (good.getLimitExchangeTimes() != -1 && count >= good.getLimitExchangeTimes()) {
return AjaxResult.error("当前用户已兑换"+count+"张");
+ }else {
+ //减少库存
+ good.setInventory(good.getInventory()-exchangeDto.getNum());
}
if (user.getPoints()<good.getRedeemPoints()){
return AjaxResult.error("当前用户积分不足");
@@ -210,17 +213,21 @@
point = coupon.getRedeemPoints();
Long count = orderClient.getExchangeById(exchangeDto.getGoodId(), userId,exchangeDto.getGoodType()).getData();
- if (coupon.getInventoryQuantity() != -1 && count >= coupon.getInventoryQuantity()) {
- return AjaxResult.error("当前用户已到达兑换"+coupon+"次");
- }
if (user.getPoints()<point){
return AjaxResult.error("当前用户积分不足");
}
+ if (coupon.getInventoryQuantity() != -1 && count >= coupon.getInventoryQuantity()) {
+ return AjaxResult.error("当前用户已到达兑换"+coupon+"次");
+ }else {
+ coupon.setInventoryQuantity(coupon.getInventoryQuantity()-exchangeDto.getNum());
+ }
+
+
}
exchangeDto.setPoint(point);
exchangeDto.setUserId(userId);
//生成积分兑换成功的订单
- R<Long> longR = orderClient.exchangeCreate(exchangeDto);
+ R<ExchangeBackDto> longR = orderClient.exchangeCreate(exchangeDto);
if (exchangeDto.getGoodType()==2) {
TCoupon coupon = couponService.getById(exchangeDto.getGoodId());
@@ -247,6 +254,7 @@
pointChangeDto.setPoints(point);
pointChangeDto.setRemark(longR.getData().toString());
pointChangeDto.setType(6);
+ pointChangeDto.setCode(longR.getData().getCode());
appUserClient.changeDown(pointChangeDto);
return AjaxResult.success();
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TIntegralRuleController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TIntegralRuleController.java
index 42e3bf3..1813a92 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TIntegralRuleController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TIntegralRuleController.java
@@ -2,6 +2,7 @@
import java.time.LocalDateTime;
+import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.core.domain.R;
@@ -34,9 +35,25 @@
private THtmlService htmlService;
@Autowired
private TIntegralRuleService integralRuleService;
-
-
-
+
+
+ /**
+ * 远程调用 获取首次添加车辆可获得积分
+ * @return
+ */
+ @PostMapping("/getAddCarIntegral")
+ public R<Integer> getAddCarIntegral() {
+ TIntegralRule one = integralRuleService.getOne(null);
+ String addVehiclesEarnsPoints = one.getAddVehiclesEarnsPoints();
+ JSONObject jsonObject = JSON.parseObject(addVehiclesEarnsPoints);
+ Integer point = 0;
+ //增加车牌50分,必填
+ point += jsonObject.getInteger("num1");
+ point += jsonObject.getInteger("num2");
+ point += jsonObject.getInteger("num3");
+ point += jsonObject.getInteger("num4");
+ return R.ok(point);
+ }
@GetMapping("/getSet")
@ApiOperation(tags = {"管理后台-积分管理","小程序-个人中心-签到"},value = "获取积分设置")
public R<TIntegralRule> getSet() {
@@ -57,6 +74,8 @@
}
return R.ok();
}
+
+
@GetMapping("/getInfo")
@ApiOperation(tags = {"管理后台-积分管理"},value = "type 1=积分规则说明," +
"2=会员折扣说明," +
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TUserTagController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TUserTagController.java
index 2a669b4..a4f5fa9 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TUserTagController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TUserTagController.java
@@ -1,6 +1,7 @@
package com.ruoyi.other.controller;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.account.api.dto.TagListQueryDto;
import com.ruoyi.account.api.dto.UnitListQueryDto;
@@ -36,7 +37,7 @@
public R<Page<TUserTag>> page(@RequestBody TagListQueryDto tagListQueryDto) {
Page<TUserTag> page = tUserTagService.lambdaQuery()
.orderByDesc(TUserTag::getCreateTime)
- .like(tagListQueryDto.getTagName()!=null&& tagListQueryDto.getTagName().isEmpty(), TUserTag::getName, tagListQueryDto.getTagName())
+ .like(tagListQueryDto.getTagName()!=null&& tagListQueryDto.getTagName()!="", TUserTag::getName, tagListQueryDto.getTagName())
.page(Page.of(tagListQueryDto.getPageCurr(), tagListQueryDto.getPageSize()));
return R.ok(page);
@@ -73,8 +74,17 @@
return R.ok(tUserTagService.getById(id));
}
-
-
+
+
+ /**
+ * 获取所有有效数据
+ * @return
+ */
+ @PostMapping(value = "/getAllUserTag")
+ public R<List<TUserTag>> getAllUserTag(){
+ List<TUserTag> list = tUserTagService.list(new LambdaQueryWrapper<TUserTag>().eq(TUserTag::getDelFlag, 0));
+ return R.ok(list);
+ }
}
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java
index 99d7270..a6a0e64 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java
@@ -2,6 +2,7 @@
import com.alibaba.fastjson2.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.account.api.dto.SendCouponDto;
import com.ruoyi.common.core.domain.R;
@@ -216,6 +217,8 @@
}
+
+
@ApiOperation(value = "购买会员", tags = {"小程序-个人中心"})
@GetMapping("/vipInfo/pay")
public R vipInfoPay(@RequestParam("vipId")Integer vipId,@RequestParam("buyType") Integer buyType,
@@ -261,6 +264,5 @@
return R.ok(vipService.vipInfoPay(byId,payMoney,payType,discountMoney,discount,buyType,userId));
}
-
}
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TCouponServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TCouponServiceImpl.java
index 9b29460..c08b27b 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TCouponServiceImpl.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TCouponServiceImpl.java
@@ -34,6 +34,13 @@
StringBuilder couponIds = new StringBuilder();
for (TCoupon tCoupon : list) {
couponIds.append(tCoupon.getId()).append(",");
+ // 如果优惠券库存为0 那么将优惠券状态改为下架 不启用
+ if (tCoupon.getInventoryQuantity()==0){
+ tCoupon.setStatus(2);
+ this.baseMapper.updateById(tCoupon);
+
+ }
+
}
if (!list.isEmpty()){
if (StringUtils.hasLength(couponIds)){
diff --git a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TGoodsMapper.xml b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TGoodsMapper.xml
index fb2632b..c8879ee 100644
--- a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TGoodsMapper.xml
+++ b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TGoodsMapper.xml
@@ -45,6 +45,9 @@
<if test="req.otherState != null and req.otherState == 2">
AND inventory = 0
</if>
+ <if test="req.otherState != null and req.otherState ==3">
+ AND status = 2
+ </if>
AND del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()}
</where>
ORDER BY create_time DESC
diff --git "a/ruoyi-service/ruoyi-other/src/main/resources/template/\345\205\205\347\224\265\346\241\251\347\224\263\350\257\267\350\256\260\345\275\225.xlsx" "b/ruoyi-service/ruoyi-other/src/main/resources/template/\345\205\205\347\224\265\346\241\251\347\224\263\350\257\267\350\256\260\345\275\225.xlsx"
new file mode 100644
index 0000000..fc621e2
--- /dev/null
+++ "b/ruoyi-service/ruoyi-other/src/main/resources/template/\345\205\205\347\224\265\346\241\251\347\224\263\350\257\267\350\256\260\345\275\225.xlsx"
Binary files differ
diff --git a/ruoyi-service/ruoyi-payment/src/main/java/com/ruoyi/payment/controller/WxPayController.java b/ruoyi-service/ruoyi-payment/src/main/java/com/ruoyi/payment/controller/WxPayController.java
index 6c834a0..04048b4 100644
--- a/ruoyi-service/ruoyi-payment/src/main/java/com/ruoyi/payment/controller/WxPayController.java
+++ b/ruoyi-service/ruoyi-payment/src/main/java/com/ruoyi/payment/controller/WxPayController.java
@@ -3,7 +3,9 @@
import com.fasterxml.jackson.core.type.TypeReference;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.order.api.feignClient.ChargingOrderClient;
import com.ruoyi.order.api.feignClient.OrderClient;
+import com.ruoyi.order.api.feignClient.ShoppingOrderClient;
import com.ruoyi.payment.api.vo.PaymentOrder;
import com.ruoyi.payment.api.vo.WxRefundNotifyResp;
import com.ruoyi.payment.wx.enums.RefundEnum;
@@ -37,6 +39,12 @@
@Resource
private OrderClient orderClient;
+
+ @Resource
+ private ChargingOrderClient chargingOrderClient;
+
+ @Resource
+ private ShoppingOrderClient shoppingOrderClient;
@@ -121,6 +129,7 @@
log.info("支付回调:{}", params);
String outRefundNo = (String) params.get("transaction_id");
String out_trade_no = params.get("out_trade_no").toString();
+ String attach = params.get("attach").toString();
String substring = out_trade_no.substring(0, 2);
switch (substring){
//购物订单
@@ -132,8 +141,12 @@
orderClient.vipCallBack(out_trade_no,outRefundNo);
System.err.println("----收到会员回调");
break;
+ case "CD":
+ chargingOrderClient.chargingOrderWXCallback(out_trade_no, outRefundNo, attach);
+ System.err.println("----充电支付回调");
+ break;
}
-
+ wxV3Pay.ack();
return R.ok(params);
} catch (Exception e) {
log.error("支付回调异常:{}", e, e);
@@ -180,6 +193,24 @@
// 时间不对的话,可以调用 WxTimeUtils.toRfc3339Date(success_time)转换一下
String success_time = params.get("success_time").toString();
if (tradeState.equals(RefundEnum.SUCCESS.name())) {
+ String substring = out_refund_no.substring(0, 3);
+ switch (substring){
+ //充电订单
+ case "CDF":
+ chargingOrderClient.chargingOrderStartupFailureWxRefund(out_refund_no, refund_id, tradeState, success_time);
+ System.err.println("----充电启动失败退款回调通知");
+ break;
+ case "GDF":
+ shoppingOrderClient.cancelShoppingOrderWxRefund(out_refund_no, refund_id, tradeState, success_time);
+ System.err.println("----商城订单取消退款回调通知");
+ break;
+ //充电订单
+ case "GWF":
+ chargingOrderClient.shoppingOrderWxRefund(out_refund_no, refund_id, tradeState, success_time);
+ System.err.println("----管理后台取消购物订单退款回调通知");
+ break;
+ }
+
WxRefundNotifyResp resp = new WxRefundNotifyResp();
resp.setOut_trade_no(out_trade_no);
resp.setOut_refund_no(out_refund_no);
diff --git a/ruoyi-service/ruoyi-payment/src/main/java/com/ruoyi/payment/wx/utils/WxV3Pay.java b/ruoyi-service/ruoyi-payment/src/main/java/com/ruoyi/payment/wx/utils/WxV3Pay.java
index 818f242..e322861 100644
--- a/ruoyi-service/ruoyi-payment/src/main/java/com/ruoyi/payment/wx/utils/WxV3Pay.java
+++ b/ruoyi-service/ruoyi-payment/src/main/java/com/ruoyi/payment/wx/utils/WxV3Pay.java
@@ -132,7 +132,7 @@
.amount(WxPaymentInfoModel.Amount.builder().total(amount).build())
.payer(WxPaymentInfoModel.Payer.builder().openid(openid).build())
// 分不分账
- //.settle_info(WxPaymentInfoModel.SettleInfo.builder().profit_sharing(true).build())
+// .settle_info(WxPaymentInfoModel.SettleInfo.builder().profit_sharing(true).build())
.build();
// 封装基础数据
String reqBody = buildBaseParam(requestBody
--
Gitblit v1.7.1