achao 2 лет назад
Сommit
a5c99d02da
100 измененных файлов с 9504 добавлено и 0 удалено
  1. 2 0
      .gitattributes
  2. 78 0
      .gitignore
  3. 145 0
      pom.xml
  4. 22 0
      sendGoodNotPlat.xml
  5. 641 0
      sql/unimall_tmp.sql
  6. BIN
      unimall-admin-api/.DS_Store
  7. 107 0
      unimall-admin-api/pom.xml
  8. BIN
      unimall-admin-api/src/.DS_Store
  9. BIN
      unimall-admin-api/src/main/.DS_Store
  10. BIN
      unimall-admin-api/src/main/java/.DS_Store
  11. BIN
      unimall-admin-api/src/main/java/com/.DS_Store
  12. BIN
      unimall-admin-api/src/main/java/com/iotechn/.DS_Store
  13. BIN
      unimall-admin-api/src/main/java/com/iotechn/unimall/.DS_Store
  14. BIN
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/.DS_Store
  15. 51 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/AdminCheckQuartz.java
  16. 91 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/AuthService.java
  17. 31 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/MyApplicationLisenter.java
  18. 13 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/UnimallAdminApiApplication.java
  19. BIN
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/.DS_Store
  20. 79 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/admin/AdminService.java
  21. 248 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/admin/AdminServiceImpl.java
  22. 72 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/advertisement/AdminAdvertisementService.java
  23. 111 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/advertisement/AdminAdvertisementServiceImpl.java
  24. 40 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/appraise/AdminAppraise.java
  25. 46 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/appraise/AdminAppraiseImpl.java
  26. 64 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/ICardClassifyInfoService.java
  27. 64 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/ICardExchangeInfoService.java
  28. 57 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/ICardHolderInfoService.java
  29. 75 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/ICardManagementInfoService.java
  30. 64 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/ICertificateManagementInfoService.java
  31. 57 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/ICircleCardInfoService.java
  32. 70 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/ICircleManagementInfoService.java
  33. 67 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/ICommonUserInfoService.java
  34. 69 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/IPersonalHomepageInfoService.java
  35. 57 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/ISearchRecordsInfoService.java
  36. 164 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CardClassifyInfoServiceImpl.java
  37. 194 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CardExchangeInfoServiceImpl.java
  38. 153 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CardHolderInfoServiceImpl.java
  39. 237 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CardManagementInfoServiceImpl.java
  40. 267 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CertificateManagementInfoServiceImpl.java
  41. 121 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CircleCardInfoServiceImpl.java
  42. 180 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CircleManagementInfoServiceImpl.java
  43. 151 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CommonUserInfoServiceImpl.java
  44. 157 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/PersonalHomepageInfoServiceImpl.java
  45. 138 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/SearchRecordsInfoServiceImpl.java
  46. 62 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/category/AdminCategoryService.java
  47. 304 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/category/AdminCategoryServiceImpl.java
  48. 54 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/config/AdminMerchantConfigService.java
  49. 75 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/config/AdminMerchantConfigServiceImpl.java
  50. 82 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/coupon/AdminCouponService.java
  51. 123 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/coupon/AdminCouponServiceImpl.java
  52. 20 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/dashboard/DashboardService.java
  53. 86 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/dashboard/DashboardServiceImpl.java
  54. 50 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/dict/DictDataService.java
  55. 77 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/dict/DictDataserviceImpl.java
  56. 48 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/dict/DictTypeService.java
  57. 86 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/dict/DictTypeServiceImpl.java
  58. 62 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/freight/AdminFreightTemplateService.java
  59. 147 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/freight/AdminFreightTemplateServiceImpl.java
  60. 64 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/goods/AdminGoodsService.java
  61. 414 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/goods/AdminGoodsServiceImpl.java
  62. 55 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/goods/AdminGroupShopGoodsService.java
  63. 290 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/goods/AdminGroupShopGoodsServiceImpl.java
  64. 40 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/log/loginLog/SysLogininforService.java
  65. 87 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/log/loginLog/SysLogininforServiceImpl.java
  66. 40 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/log/operLog/OperLogService.java
  67. 87 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/log/operLog/OperLogServiceImpl.java
  68. 66 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/IMarketAdvertisementInfoService.java
  69. 50 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/IMarketCaseService.java
  70. 67 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/IMarketCircleInfoService.java
  71. 70 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/IMarketOrderDetailService.java
  72. 68 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/IMarketOrderInfoService.java
  73. 74 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/IMarketProdectInfoService.java
  74. 71 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/IMarketReceivingAddressService.java
  75. 74 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/IMarketShopInfoService.java
  76. 140 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/impl/MarketAdvertisementInfoServiceImpl.java
  77. 96 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/impl/MarketCaseServiceImpl.java
  78. 150 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/impl/MarketCircleInfoServiceImpl.java
  79. 149 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/impl/MarketOrderDetailServiceImpl.java
  80. 146 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/impl/MarketOrderInfoServiceImpl.java
  81. 164 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/impl/MarketProdectInfoServiceImpl.java
  82. 158 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/impl/MarketReceivingAddressServiceImpl.java
  83. 167 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/impl/MarketShopInfoServiceImpl.java
  84. 21 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/monitor/online/UserOnlineService.java
  85. 45 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/monitor/online/UserOnlineServiceImpl.java
  86. 11 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/monitor/server/ServerService.java
  87. 22 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/monitor/server/ServerServiceImpl.java
  88. 57 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/order/AdminOrderService.java
  89. 198 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/order/AdminOrderServiceImpl.java
  90. 54 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/recommend/AdminRecommendService.java
  91. 99 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/recommend/AdminRecommendServiceImpl.java
  92. 65 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/role/RoleService.java
  93. 141 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/role/RoleServiceImpl.java
  94. 74 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/tools/gen/GenTableService.java
  95. 179 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/tools/gen/GenTableServiceImpl.java
  96. 62 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/user/AdminUserService.java
  97. 229 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/user/AdminUserServiceImpl.java
  98. BIN
      unimall-admin-api/src/main/lib/cf-auth-api-token-5.1.5-SNAPSHOT-jar-with-dependencies.jar
  99. BIN
      unimall-admin-api/src/main/lib/dangdang-open-sdk.jar
  100. 1 0
      unimall-admin-api/src/main/resources/application.properties

+ 2 - 0
.gitattributes

@@ -0,0 +1,2 @@
+*.sql linguist-language=java
+*.html linguist-language=java

+ 78 - 0
.gitignore

@@ -0,0 +1,78 @@
+HELP.md
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**
+!**/src/test/**
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+#/build/
+
+### VS Code ###
+.vscode/
+
+### maven ###
+.mvn
+mvnw
+mvnw.cmd
+
+###properties###
+/unimall-launcher/src/main/resources/application-dev.properties
+/unimall-launcher/src/main/resources/application-prd.properties
+
+### target ###
+/target/
+/unimall-admin-api/target/
+/unimall-app-api/target/
+/unimall-biz/target/
+/unimall-data/target/
+/unimall-core/target/
+/unimall-launcher/target/
+/unimall-plugin-core/target/
+/unimall-app/unpackage/dist/
+/unimall-app/unpackage/resources/
+/unimall-app/unpackage/debug/
+/unimall-admin/dist.zip
+
+###node_modules###
+/unimall-admin/node_modules/
+/unimall-app/node_modules/
+
+
+###logs###
+unimall.log
+unimall.log.*.gz
+unimall.log.*.tmp
+
+
+### plugins ###
+/plugins/
+/unimall-app/pages/plugins/
+/unimall-admin/src/views/plugins/
+
+### xcx ###
+.map/
+/unpackage/
+*.wxss
+*.json
+*.wxml
+xiaochengxu/unpackage/

+ 145 - 0
pom.xml

@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<packaging>pom</packaging>
+	<parent>
+		<groupId>org.springframework.boot</groupId>
+		<artifactId>spring-boot-starter-parent</artifactId>
+		<version>2.1.2.RELEASE</version>
+		<relativePath/> <!-- lookup parent from repository -->
+	</parent>
+	<groupId>com.iotechn</groupId>
+	<artifactId>unimall</artifactId>
+	<version>0.0.1-RELEASE</version>
+	<name>unimall</name>
+	<description>App,MiniProgram</description>
+
+	<properties>
+		<java.version>1.8</java.version>
+	</properties>
+
+	<repositories>
+		<repository>
+			<id>maven-ali</id>
+			<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
+			<releases>
+				<enabled>true</enabled>
+			</releases>
+			<snapshots>
+				<enabled>true</enabled>
+				<updatePolicy>always</updatePolicy>
+				<checksumPolicy>fail</checksumPolicy>
+			</snapshots>
+		</repository>
+	</repositories>
+
+	<modules>
+		<module>unimall-core</module>
+		<module>unimall-data</module>
+		<module>unimall-biz</module>
+		<module>unimall-app-api</module>
+		<module>unimall-admin-api</module>
+		<module>unimall-launcher</module>
+		<module>unimall-plugin-core</module>
+	</modules>
+
+	<dependencyManagement>
+		<dependencies>
+
+			<!-- http客户端 -->
+			<dependency>
+				<groupId>com.squareup.okhttp3</groupId>
+				<artifactId>okhttp</artifactId>
+				<version>3.10.0</version>
+			</dependency>
+
+			<!-- 良心云 sms -->
+			<dependency>
+				<groupId>com.github.qcloudsms</groupId>
+				<artifactId>qcloudsms</artifactId>
+				<version>1.0.5</version>
+			</dependency>
+
+			<!-- 阿里云 SMS -->
+			<dependency>
+				<groupId>com.aliyun</groupId>
+				<artifactId>aliyun-java-sdk-core</artifactId>
+				<version>4.1.1</version>
+			</dependency>
+
+			<!-- 阿里云对象存储 -->
+			<dependency>
+				<groupId>com.aliyun.oss</groupId>
+				<artifactId>aliyun-sdk-oss</artifactId>
+				<version>2.8.3</version>
+			</dependency>
+
+			<!-- mybatis plus 依赖 -->
+			<dependency>
+				<groupId>com.baomidou</groupId>
+				<artifactId>mybatis-plus-boot-starter</artifactId>
+				<version>2.2.0</version>
+			</dependency>
+
+			<dependency>
+				<groupId>com.baomidou</groupId>
+				<artifactId>mybatis-plus-support</artifactId>
+				<version>2.2.0</version>
+			</dependency>
+
+			<!-- mysql -->
+			<dependency>
+				<groupId>mysql</groupId>
+				<artifactId>mysql-connector-java</artifactId>
+				<version>8.0.15</version>
+			</dependency>
+
+			<!-- 阿里巴巴 数据源 Druid -->
+			<dependency>
+				<groupId>com.alibaba</groupId>
+				<artifactId>druid</artifactId>
+				<version>1.1.8</version>
+			</dependency>
+
+			<!-- lombok 工具 -->
+			<dependency>
+				<groupId>org.projectlombok</groupId>
+				<artifactId>lombok</artifactId>
+				<version>1.18.4</version>
+				<scope>provided</scope>
+			</dependency>
+
+			<!-- 阿里巴巴 json 解析 -->
+			<dependency>
+				<groupId>com.alibaba</groupId>
+				<artifactId>fastjson</artifactId>
+				<version>1.2.31</version>
+			</dependency>
+
+			<!-- 微信第三方封装Api -->
+			<dependency>
+				<groupId>com.github.binarywang</groupId>
+				<artifactId>weixin-java-pay</artifactId>
+				<version>3.3.0</version>
+				<exclusions>
+					<exclusion>
+						<artifactId>qrcode-utils</artifactId>
+						<groupId>com.github.binarywang</groupId>
+					</exclusion>
+				</exclusions>
+			</dependency>
+
+		</dependencies>
+	</dependencyManagement>
+
+	<!-- 发布maven私服 -->
+	<!--<distributionManagement>-->
+		<!--<repository>-->
+			<!--<id>iotechn-release</id>-->
+			<!--<name>unimall maven</name>-->
+			<!--<url>http://maven.iotechn.com/repository/maven-releases/</url>-->
+		<!--</repository>-->
+	<!--</distributionManagement>-->
+
+</project>

+ 22 - 0
sendGoodNotPlat.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="GBK"?>
+<request>
+    <functionID>dangdang.order.goods.send</functionID>
+    <time>2022-07-11 09:32:13</time>
+    <OrdersList>
+        <OrderInfo>
+            <orderID>45018706599</orderID>
+            <logisticsName>¼«ÍÃËÙµÝ</logisticsName>
+            <logisticsNameAb>JT</logisticsNameAb>
+            <logisticsTel>400-820-1666</logisticsTel>
+            <logisticsOrderID>JT3007364146966</logisticsOrderID>
+            <SendGoodsList>
+                <ItemInfo>
+                    <itemID>11162110282</itemID>
+                    <sendGoodsCount>1</sendGoodsCount>
+                    <belongProductsPromoID></belongProductsPromoID>
+                    <productItemId>45018706599001</productItemId>
+                </ItemInfo>
+            </SendGoodsList>
+        </OrderInfo>
+    </OrdersList>
+</request>

Разница между файлами не показана из-за своего большого размера
+ 641 - 0
sql/unimall_tmp.sql


BIN
unimall-admin-api/.DS_Store


+ 107 - 0
unimall-admin-api/pom.xml

@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>com.iotechn</groupId>
+		<artifactId>unimall</artifactId>
+		<version>0.0.1-RELEASE</version>
+	</parent>
+	<groupId>com.iotechn</groupId>
+	<artifactId>unimall-admin-api</artifactId>
+	<version>0.0.1-RELEASE</version>
+	<name>unimall-admin-api</name>
+	<description>后台管理Api</description>
+
+	<properties>
+		<java.version>1.8</java.version>
+	</properties>
+
+	<repositories>
+		<repository>
+			<id>maven-ali</id>
+			<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
+			<releases>
+				<enabled>true</enabled>
+			</releases>
+			<snapshots>
+				<enabled>true</enabled>
+				<updatePolicy>always</updatePolicy>
+				<checksumPolicy>fail</checksumPolicy>
+			</snapshots>
+		</repository>
+		<repository>
+			<id>iotechn-release</id>
+			<name>unimall maven</name>
+			<url>http://maven.iotechn.com/repository/maven-releases/</url>
+		</repository>
+	</repositories>
+
+	<dependencies>
+		<dependency>
+			<groupId>commons-httpclient</groupId>
+			<artifactId>commons-httpclient</artifactId>
+			<version>3.1</version>
+		</dependency>
+		<!-- 引入本地jar -->
+		<dependency>
+			<groupId>com.dangdang.openplatform.openapi</groupId>
+			<artifactId>sdk</artifactId>
+			<version>1.0-SNAPSHOT</version>
+			<scope>system</scope>
+			<systemPath>${project.basedir}/src/main/lib/dangdang-open-sdk.jar</systemPath>
+		</dependency>
+		<dependency>
+			<groupId>com.iotechn</groupId>
+			<artifactId>unimall-core</artifactId>
+			<version>0.0.1-RELEASE</version>
+		</dependency>
+		<!-- 插件核心依赖 勿删 -->
+		<dependency>
+			<groupId>com.iotechn</groupId>
+			<artifactId>unimall-plugin-core</artifactId>
+			<version>0.0.1-RELEASE</version>
+		</dependency>
+
+		<dependency>
+			<groupId>com.iotechn</groupId>
+			<artifactId>unimall-data</artifactId>
+			<version>0.0.1-RELEASE</version>
+		</dependency>
+
+		<dependency>
+			<groupId>com.iotechn</groupId>
+			<artifactId>unimall-biz</artifactId>
+			<version>0.0.1-RELEASE</version>
+		</dependency>
+
+		<!-- 微信第三方封装Api -->
+		<dependency>
+			<groupId>com.github.binarywang</groupId>
+			<artifactId>weixin-java-pay</artifactId>
+		</dependency>
+
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>com.baidu.contact-center</groupId>
+			<artifactId>cf-auth-api-token</artifactId>
+			<version>5.1.5-SNAPSHOT</version>
+			<scope>system</scope>
+			<systemPath>${project.basedir}/src/main/lib/cf-auth-api-token-5.1.5-SNAPSHOT-jar-with-dependencies.jar</systemPath>
+		</dependency>
+		<dependency>
+			<groupId>org.projectlombok</groupId>
+			<artifactId>lombok</artifactId>
+			<optional>true</optional>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-test</artifactId>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+
+</project>

BIN
unimall-admin-api/src/.DS_Store


BIN
unimall-admin-api/src/main/.DS_Store


BIN
unimall-admin-api/src/main/java/.DS_Store


BIN
unimall-admin-api/src/main/java/com/.DS_Store


BIN
unimall-admin-api/src/main/java/com/iotechn/.DS_Store


BIN
unimall-admin-api/src/main/java/com/iotechn/unimall/.DS_Store


BIN
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/.DS_Store


+ 51 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/AdminCheckQuartz.java

@@ -0,0 +1,51 @@
+package com.iotechn.unimall.admin;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.stereotype.Component;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+/**
+ * Created by rize on 2019/7/21.
+ */
+@Component
+@EnableScheduling
+public class AdminCheckQuartz {
+
+    private static final Logger logger = LoggerFactory.getLogger(AdminCheckQuartz.class);
+    private static final String ORDER_STATUS_LOCK = "ORDER_STATUS_QUARTZ_LOCK";
+    private static final String GROUP_SHOP_START_LOCK = "GROUP_SHOP_START_LOCK";
+    private static final String GROUP_SHOP_END_LOCK = "GROUP_SHOP_END_LOCK";
+    private static final String GROUP_SHOP_LOCK_LOCK = "GROUP_SHOP_LOCK_LOCK";
+    ExecutorService pool = Executors.newFixedThreadPool(2);
+
+    /**
+     * 订单数据定时轮训处理 每小时执行一次
+     */
+//    @Scheduled(cron = "0 0 7-22 * * ? ")
+    public void task1(){
+        new Thread(new Runnable() {
+            @Override
+            public void run() {
+            }
+        }).start();
+    }
+    /**
+     * 订单数据定时轮训处理 每30分钟执行一次
+     */
+//    @Scheduled(cron = "0 0/30 * * * ? ")
+    public void task2(){
+        new Thread(new Runnable() {
+            @Override
+            public void run() {
+            }
+        }).start();
+    }
+    public void dealOrder() throws Exception {
+
+    }
+
+
+}

+ 91 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/AuthService.java

@@ -0,0 +1,91 @@
+package com.iotechn.unimall.admin;
+
+/**
+ * @Author:chengchangjiang
+ * @Description:
+ * @Date:Created in 15:59 2022-06-17
+ */
+
+
+import org.json.JSONObject;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 获取token类
+ */
+public class AuthService {
+
+    /**
+     * 获取权限token
+     * @return 返回示例:
+     * {
+     * "access_token": "24.460da4889caad24cccdb1fea17221975.2592000.1491995545.282335-1234567",
+     * "expires_in": 2592000
+     * }
+     */
+    public static String getAuth() {
+        // 官网获取的 API Key 更新为你注册的
+        String clientId = "346da55bb3c248ea84e39b5913939f05";
+        // 官网获取的 Secret Key 更新为你注册的
+        String clientSecret = "0628356ece284d87935f73017af1c0ce";
+        return getAuth(clientId, clientSecret);
+    }
+
+    /**
+     * 获取API访问token
+     * 该token有一定的有效期,需要自行管理,当失效时需重新获取.
+     * @param ak - 百度云官网获取的 API Key
+     * @param sk - 百度云官网获取的 Securet Key
+     * @return assess_token 示例:
+     * "24.460da4889caad24cccdb1fea17221975.2592000.1491995545.282335-1234567"
+     */
+    public static String getAuth(String ak, String sk) {
+        // 获取token地址
+        String authHost = "https://aip.baidubce.com/oauth/2.0/token?";
+        String getAccessTokenUrl = authHost
+                // 1. grant_type为固定参数
+                + "grant_type=client_credentials"
+                // 2. 官网获取的 API Key
+                + "&client_id=" + ak
+                // 3. 官网获取的 Secret Key
+                + "&client_secret=" + sk;
+        try {
+            URL realUrl = new URL(getAccessTokenUrl);
+            // 打开和URL之间的连接
+            HttpURLConnection connection = (HttpURLConnection) realUrl.openConnection();
+            connection.setRequestMethod("GET");
+            connection.connect();
+            // 获取所有响应头字段
+            Map<String, List<String>> map = connection.getHeaderFields();
+            // 遍历所有的响应头字段
+            for (String key : map.keySet()) {
+                System.out.println(key + "--->" + map.get(key));
+            }
+            // 定义 BufferedReader输入流来读取URL的响应
+            BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
+            String result = "";
+            String line;
+            while ((line = in.readLine()) != null) {
+                result += line;
+            }
+            /**
+             * 返回结果示例
+             */
+            System.out.println("result:" + result);
+            JSONObject jsonObject = new JSONObject(result);
+            String access_token = jsonObject.getString("access_token");
+            return access_token;
+        } catch (Exception e) {
+            System.err.printf("获取token失败!");
+            e.printStackTrace(System.err);
+        }
+        return null;
+    }
+
+}

+ 31 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/MyApplicationLisenter.java

@@ -0,0 +1,31 @@
+package com.iotechn.unimall.admin;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationListener;
+import org.springframework.context.event.ContextRefreshedEvent;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Author:chengchangjiang
+ * @Description:
+ * @Date:Created in 12:34 2022-06-16
+ */
+@Component
+public class MyApplicationLisenter implements ApplicationListener<ContextRefreshedEvent> {
+
+    private static Logger logger = LoggerFactory.getLogger(MyApplicationLisenter.class);
+
+    @Override
+    public void onApplicationEvent(ContextRefreshedEvent e) {
+        logger.info("实现了ApplicationListener的onApplicationEvent方法");
+//        new Thread(new Runnable() {
+//            @Override
+//            public void run() {
+//            }
+//        }).start();
+    }
+
+
+}

+ 13 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/UnimallAdminApiApplication.java

@@ -0,0 +1,13 @@
+package com.iotechn.unimall.admin;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class UnimallAdminApiApplication {
+
+	public static void main(String[] args) {
+		SpringApplication.run(UnimallAdminApiApplication.class, args);
+	}
+
+}

BIN
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/.DS_Store


+ 79 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/admin/AdminService.java

@@ -0,0 +1,79 @@
+package com.iotechn.unimall.admin.api.admin;
+
+import com.iotechn.unimall.core.Const;
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.dto.AdminDTO;
+import com.iotechn.unimall.data.model.Page;
+
+/**
+ * Created by rize on 2019/4/8.
+ */
+@HttpOpenApi(group = "admin", description = "管理员服务")
+public interface AdminService {
+
+	@HttpMethod(description = "管理员登录 返回AccessToken")
+	public String login(
+			@NotNull @HttpParam(name = "loginIp", type = HttpParamType.IP, description = "用户登陆IP") String loginIp,
+			@NotNull @HttpParam(name = "browserName", type = HttpParamType.BrowserName, description = "浏览器名称") String browserName,
+			@NotNull @HttpParam(name = "browserVersion", type = HttpParamType.BrowserVersion, description = "浏览器版本") String browserVersion,
+			@NotNull @HttpParam(name = "osName", type = HttpParamType.OsName, description = "系统名称") String osName,
+			@NotNull @HttpParam(name = "username", type = HttpParamType.COMMON, description = "用户名") String username,
+			@NotNull @HttpParam(name = "password", type = HttpParamType.COMMON, description = "密码") String password,
+			@NotNull @HttpParam(name = "verifyCode", type = HttpParamType.COMMON, description = "验证码") String verifyCode)
+			throws ServiceException;
+
+	@HttpMethod(description = "管理员登出")
+	public String logout(
+			@NotNull @HttpParam(name = Const.ADMIN_ACCESS_TOKEN, type = HttpParamType.HEADER, description = "访问Token") String accessToken,
+			@NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId)
+			throws ServiceException;
+
+	@HttpMethod(description = "管理员信息")
+	public AdminDTO info(
+			@NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId)
+			throws ServiceException;
+
+	@HttpMethod(description = "列表", permission = "admin:admin:list", permissionParentName = "系统管理", permissionName = "管理员")
+	public Page<AdminDTO> list(
+			@HttpParam(name = "username", type = HttpParamType.COMMON, description = "管理员名称搜索") String name,
+			@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+			@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页长度", valueDef = "20") Integer limit,
+			@NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId)
+			throws ServiceException;
+
+	@HttpMethod(description = "创建", permission = "admin:admin:create", permissionParentName = "系统管理", permissionName = "管理员")
+	public AdminDTO create(
+			@NotNull @HttpParam(name = "adminDTO", type = HttpParamType.COMMON, description = "欲创建的admin对象JSON") AdminDTO adminDTO,
+			@NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId)
+			throws ServiceException;
+
+	@HttpMethod(description = "修改", permission = "admin:admin:update", permissionParentName = "系统管理", permissionName = "管理员")
+	public String update(
+			@NotNull @HttpParam(name = "adminDTO", type = HttpParamType.COMMON, description = "欲修改的admin对象JSON") AdminDTO adminDTO,
+			@NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId)
+			throws ServiceException;
+
+	@HttpMethod(description = "删除", permission = "admin:admin:delete", permissionParentName = "系统管理", permissionName = "管理员")
+	public String delete(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "目标删除Id") Long id,
+			@NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId)
+			throws ServiceException;
+
+	@HttpMethod(description = "更改密码")
+	public String newPassword(
+			@HttpParam(name = Const.ADMIN_ACCESS_TOKEN, type = HttpParamType.HEADER, description = "访问Token") String accessToken,
+			@NotNull @HttpParam(name = "oldPassword", type = HttpParamType.COMMON, description = "老密码") String oldPassword,
+			@NotNull @HttpParam(name = "newPassword", type = HttpParamType.COMMON, description = "新密码") String newPassword,
+			@NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId)
+			throws ServiceException;
+
+	@HttpMethod(description = "发送登陆短信")
+	public Boolean sendLoginMsg(
+			@NotNull @HttpParam(name = "username", type = HttpParamType.COMMON, description = "用户名") String username,
+			@NotNull @HttpParam(name = "password", type = HttpParamType.COMMON, description = "密码") String password)
+			throws ServiceException;
+}

+ 248 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/admin/AdminServiceImpl.java

@@ -0,0 +1,248 @@
+package com.iotechn.unimall.admin.api.admin;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.core.Const;
+import com.iotechn.unimall.core.exception.AdminServiceException;
+import com.iotechn.unimall.core.exception.ExceptionDefinition;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.core.exception.ThirdPartServiceException;
+import com.iotechn.unimall.core.notify.SMSClient;
+import com.iotechn.unimall.core.notify.SMSResult;
+import com.iotechn.unimall.core.util.GeneratorUtil;
+import com.iotechn.unimall.core.util.MD5Util;
+import com.iotechn.unimall.data.component.CacheComponent;
+import com.iotechn.unimall.data.domain.AdminDO;
+import com.iotechn.unimall.data.domain.RoleDO;
+import com.iotechn.unimall.data.domain.RolePermissionDO;
+import com.iotechn.unimall.data.dto.AdminDTO;
+import com.iotechn.unimall.data.enums.AdminStatusType;
+import com.iotechn.unimall.data.enums.RoleStatusType;
+import com.iotechn.unimall.data.mapper.AdminMapper;
+import com.iotechn.unimall.data.mapper.RoleMapper;
+import com.iotechn.unimall.data.mapper.RolePermissionMapper;
+import com.iotechn.unimall.data.model.Page;
+import com.iotechn.unimall.data.util.IpUtils;
+import com.iotechn.unimall.data.util.SessionUtil;
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.StringRedisTemplate;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
+
+import java.util.*;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Created by rize on 2019/4/8.
+ */
+@Service
+public class AdminServiceImpl implements AdminService {
+
+	@Autowired
+	private StringRedisTemplate userRedisTemplate;
+
+	@Autowired
+	private AdminMapper adminMapper;
+
+	@Autowired
+	private RoleMapper roleMapper;
+
+	@Autowired
+	private RolePermissionMapper rolePermissionMapper;
+
+	@Autowired
+	private CacheComponent cacheComponent;
+
+	@Autowired
+	private SMSClient smsClient;
+
+	private final static String ADMIN_MSG_CODE = "admin_msg_code_";
+
+	@Override
+	public String login(String loginIp, String browserName, String browserVersion, String osName, String username,
+			String password, String verifyCode) throws ServiceException {
+		String accessToken = generateAccessToken();
+		// 数据库查管理员
+		List<AdminDO> adminDOS = adminMapper.selectList(new EntityWrapper<AdminDO>().eq("username", username));
+		if (CollectionUtils.isEmpty(adminDOS)) {
+			throw new AdminServiceException(ExceptionDefinition.ADMIN_NOT_EXIST);
+		}
+		AdminDO adminDO = adminDOS.get(0);
+		// 短信验证码
+//        String code = cacheComponent.getRaw(ADMIN_MSG_CODE+adminDO.getPhone() );
+//        if(!"guest".equals(username) && (code == null || verifyCode==null || !code.equals(verifyCode))){
+//            throw new AdminServiceException(ExceptionDefinition.ADMIN_VERIFYCODE_ERROR);
+//        }
+
+		if (!MD5Util.verify(password, username, adminDO.getPassword())) {
+			throw new AdminServiceException(ExceptionDefinition.ADMIN_PASSWORD_ERROR);
+		}
+		List<Long> ids = JSONObject.parseArray(adminDO.getRoleIds(), Long.class);
+		if (CollectionUtils.isEmpty(ids)) {
+			throw new AdminServiceException(ExceptionDefinition.ADMIN_ROLE_IS_EMPTY);
+		}
+		List<RoleDO> roleDOList = roleMapper
+				.selectList(new EntityWrapper<RoleDO>().in("id", ids).eq("status", RoleStatusType.ACTIVE.getCode()));
+		List<String> roleNames = new LinkedList<>();
+		roleDOList.forEach(item -> {
+			roleNames.add(item.getName());
+		});
+		AdminDTO adminDTO = new AdminDTO();
+		adminDTO.setRoles(roleNames);
+		BeanUtils.copyProperties(adminDO, adminDTO);
+		adminDTO.setRoleIds(JSONObject.parseArray(adminDO.getRoleIds(), Long.class));
+		adminDTO.setPassword(null);
+		List<RolePermissionDO> rolePermissionDOList = rolePermissionMapper
+				.selectList(new EntityWrapper<RolePermissionDO>().in("role_id", ids).eq("deleted", 0));
+		List<String> permissionNames = new LinkedList<>();
+		rolePermissionDOList.forEach(item -> {
+			permissionNames.add(item.getPermission());
+		});
+		adminDTO.setPerms(permissionNames);
+		JSONObject loginUserInfo = (JSONObject) JSONObject.toJSON(adminDTO);
+		loginUserInfo.put("loginIp", loginIp);
+		loginUserInfo.put("loginTime", new Date());
+		loginUserInfo.put("browser", browserName + "(" + browserVersion + ")");
+		loginUserInfo.put("osName", osName);
+		userRedisTemplate.opsForValue().set(Const.ADMIN_REDIS_PREFIX + accessToken,
+				JSONObject.toJSONString(loginUserInfo), 30, TimeUnit.DAYS);
+		return accessToken;
+	}
+
+	@Override
+	public String logout(String accessToken, Long adminId) throws ServiceException {
+		userRedisTemplate.delete(Const.ADMIN_REDIS_PREFIX + accessToken);
+		return "ok";
+	}
+
+	@Override
+	public AdminDTO info(Long adminId) throws ServiceException {
+		return SessionUtil.getAdmin();
+	}
+
+	@Override
+	public Page<AdminDTO> list(String name, Integer page, Integer limit, Long adminId) throws ServiceException {
+		Wrapper<AdminDO> wrapper = new EntityWrapper<AdminDO>();
+		if (!StringUtils.isEmpty(name)) {
+			wrapper.like("username", name);
+		}
+		wrapper.orderBy("id", false);
+		Integer count = adminMapper.selectCount(wrapper);
+		List<AdminDO> adminDOS = adminMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+		List<AdminDTO> adminDTOS = new ArrayList<AdminDTO>(adminDOS.size());
+		for (AdminDO adminDO : adminDOS) {
+			AdminDTO adminDTO = new AdminDTO();
+			BeanUtils.copyProperties(adminDO, adminDTO);
+			adminDTO.setRoleIds(JSONObject.parseArray(adminDO.getRoleIds(), Long.class));
+			adminDTO.setPassword(null);
+			adminDTOS.add(adminDTO);
+		}
+		return new Page<>(adminDTOS, page, limit, count);
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public AdminDTO create(AdminDTO adminDTO, Long adminId) throws ServiceException {
+		AdminDO adminDO = new AdminDO();
+		Integer count = adminMapper.selectCount(new EntityWrapper<AdminDO>().eq("username", adminDTO.getUsername()));
+		if (count > 0) {
+			throw new AdminServiceException(ExceptionDefinition.ADMIN_USER_NAME_REPEAT);
+		}
+		BeanUtils.copyProperties(adminDTO, adminDO);
+		adminDO.setPassword(MD5Util.md5(adminDO.getPassword(), adminDO.getUsername()));
+		adminDO.setRoleIds(JSONObject.toJSONString(adminDTO.getRoleIds()));
+		adminDO.setGmtUpdate(new Date());
+		adminDO.setGmtCreate(adminDO.getGmtUpdate());
+		adminDO.setStatus(AdminStatusType.ACTIVE.getCode());
+		adminDO.setLastLoginIp("0.0.0.0");
+		adminDO.setGmtLastLogin("1997-01-20 00:00:00");
+		if (adminMapper.insert(adminDO) > 0) {
+			adminDTO.setId(adminDO.getId());
+			return adminDTO;
+		}
+		throw new AdminServiceException(ExceptionDefinition.ADMIN_UNKNOWN_EXCEPTION);
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public String update(AdminDTO adminDTO, Long adminId) throws ServiceException {
+		Long id = adminDTO.getId();
+		if (id == null) {
+			throw new AdminServiceException(ExceptionDefinition.ADMIN_UNKNOWN_EXCEPTION);
+		}
+		AdminDO adminDO = new AdminDO();
+		BeanUtils.copyProperties(adminDTO, adminDO);
+		adminDO.setGmtUpdate(new Date());
+		AdminDO adminDOExist = adminMapper.selectById(id);
+		if (!StringUtils.isEmpty(adminDO.getPassword()) && !StringUtils.isEmpty(adminDOExist.getUsername())) {
+			adminDO.setPassword(MD5Util.md5(adminDO.getPassword(), adminDOExist.getUsername()));
+		}
+		adminDO.setUsername(null);
+		if (!CollectionUtils.isEmpty(adminDTO.getRoleIds())) {
+			adminDO.setRoleIds(JSONObject.toJSONString(adminDTO.getRoleIds()));
+		}
+		if (adminMapper.updateById(adminDO) > 0) {
+			return "ok";
+		}
+		throw new AdminServiceException(ExceptionDefinition.ADMIN_UNKNOWN_EXCEPTION);
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public String delete(Long id, Long adminId) throws ServiceException {
+		if (adminMapper.deleteById(id) > 0) {
+			return "ok";
+		}
+		throw new AdminServiceException(ExceptionDefinition.ADMIN_UNKNOWN_EXCEPTION);
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public String newPassword(String accessToken, String oldPassword, String newPassword, Long adminId)
+			throws ServiceException {
+		AdminDO adminDOExist = adminMapper.selectById(adminId);
+		if (!MD5Util.md5(oldPassword, adminDOExist.getUsername()).equals(adminDOExist.getPassword())) {
+			throw new AdminServiceException(ExceptionDefinition.ADMIN_PASSWORD_ERROR);
+		}
+		AdminDO adminDO = new AdminDO();
+		adminDO.setId(adminId);
+		adminDO.setPassword(MD5Util.md5(newPassword, adminDOExist.getUsername()));
+		if (adminMapper.updateById(adminDO) > 0) {
+			// logout(accessToken, adminId);
+			return "ok";
+		}
+		throw new AdminServiceException(ExceptionDefinition.ADMIN_UNKNOWN_EXCEPTION);
+	}
+
+	@Override
+	public Boolean sendLoginMsg(String username, String password) throws ServiceException {
+		if ("guest".equals(username)) {
+			throw new AdminServiceException(ExceptionDefinition.ADMIN_GUEST_NOT_NEED_VERIFY_CODE);
+		}
+		AdminDO adminDO = new AdminDO();
+		adminDO.setUsername(username);
+		adminDO.setPassword(MD5Util.md5(password, username));
+		AdminDO admin = adminMapper.selectOne(adminDO);
+		if (admin == null) {
+			throw new AdminServiceException(ExceptionDefinition.ADMIN_USER_NOT_EXITS);
+		}
+		String code = GeneratorUtil.genSixVerifyCode();
+		cacheComponent.putRaw(ADMIN_MSG_CODE + admin.getPhone(), code, 300);
+		SMSResult smsResult = smsClient.sendAdminLoginVerify(admin.getPhone(), code);
+		if (!smsResult.isSucc()) {
+			throw new ThirdPartServiceException(smsResult.getMsg(),
+					ExceptionDefinition.ADMIN_VERIFY_CODE_SEND_FAIL.getCode());
+		}
+		return true;
+	}
+
+	private String generateAccessToken() {
+		return (UUID.randomUUID().toString().replace("-", ""));
+	}
+
+}

+ 72 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/advertisement/AdminAdvertisementService.java

@@ -0,0 +1,72 @@
+package com.iotechn.unimall.admin.api.advertisement;
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.annotation.param.Range;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.AdvertisementDO;
+import com.iotechn.unimall.data.dto.RecommendDTO;
+import com.iotechn.unimall.data.enums.StatusType;
+import com.iotechn.unimall.data.model.Page;
+
+import java.util.List;
+
+/**
+ * Created with IntelliJ IDEA.
+ * Description:
+ * User: kbq
+ * Date: 2019-07-08
+ * Time: 下午8:23
+ */
+
+@HttpOpenApi(group = "admin.advertisement", description = "广告推销")
+public interface AdminAdvertisementService {
+
+    @HttpMethod(description = "创建", permission = "promote:advertisement:create", permissionParentName = "推广管理", permissionName = "广告管理")
+    public Boolean addAdvertisement(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
+            @NotNull @HttpParam(name = "adType", type = HttpParamType.COMMON, description = "广告类型") Integer adType,
+            @HttpParam(name = "title", type = HttpParamType.COMMON, description = "广告标题") String title,
+            @NotNull @HttpParam(name = "url", type = HttpParamType.COMMON, description = "广告地址") String url,
+            @NotNull @HttpParam(name = "imgUrl", type = HttpParamType.COMMON, description = "广告图片地址") String imgUrl,
+            @NotNull @HttpParam(name = "status", type = HttpParamType.COMMON, description = "广告状态") Integer status,
+            @NotNull @HttpParam(name = "color", type = HttpParamType.COMMON, description = "广告图片颜色") String color) throws ServiceException;
+
+    @HttpMethod(description = "删除", permission = "promote:advertisement:delete", permissionParentName = "推广管理", permissionName = "广告管理")
+    public Boolean deleteAdvertisement(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
+            @NotNull @HttpParam(name = "adType", type = HttpParamType.COMMON, description = "广告类型") Integer adType,
+            @NotNull @HttpParam(name = "adId", type = HttpParamType.COMMON, description = "广告ID") Long adId) throws ServiceException;
+
+    @HttpMethod(description = "修改", permission = "promote:advertisement:update", permissionParentName = "推广管理", permissionName = "广告管理")
+    public Boolean updateAdvertisement(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
+            @NotNull @HttpParam(name = "adId", type = HttpParamType.COMMON, description = "广告ID") Long adId,
+            @NotNull @HttpParam(name = "adType", type = HttpParamType.COMMON, description = "广告类型") Integer adType,
+            @HttpParam(name = "title", type = HttpParamType.COMMON, description = "广告标题") String title,
+            @HttpParam(name = "url", type = HttpParamType.COMMON, description = "广告地址") String url,
+            @HttpParam(name = "imgUrl", type = HttpParamType.COMMON, description = "广告图片地址") String imgUrl,
+            @HttpParam(name = "status", type = HttpParamType.COMMON, description = "广告状态") Integer status,
+            @HttpParam(name = "color", type = HttpParamType.COMMON, description = "广告图片颜色") String color) throws ServiceException;
+
+
+    @HttpMethod(description = "查询", permission = "promote:advertisement:query", permissionParentName = "推广管理", permissionName = "广告管理")
+    public Page<AdvertisementDO> queryAdvertisement(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
+            @HttpParam(name = "adType", type = HttpParamType.COMMON, description = "广告类型") Integer adType,
+            @Range(min = 1) @HttpParam(name = "pageNo", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer pageNo,
+            @Range(min = 1) @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页面长度", valueDef = "10") Integer limit,
+            @HttpParam(name = "status", type = HttpParamType.COMMON, description = "广告状态") Integer status) throws ServiceException;
+
+    @HttpMethod(description = "查询", permission = "promote:advertisement:query", permissionParentName = "推广管理", permissionName = "广告管理")
+    public Page<AdvertisementDO> queryAllAdvertisement(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
+            @Range(min = 1) @HttpParam(name = "pageNo", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer pageNo,
+            @Range(min = 1) @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页面长度", valueDef = "10") Integer pageSize
+    ) throws ServiceException;
+
+
+}

+ 111 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/advertisement/AdminAdvertisementServiceImpl.java

@@ -0,0 +1,111 @@
+package com.iotechn.unimall.admin.api.advertisement;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.core.exception.AdminServiceException;
+import com.iotechn.unimall.core.exception.ExceptionDefinition;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.component.CacheComponent;
+import com.iotechn.unimall.data.domain.AdvertisementDO;
+import com.iotechn.unimall.data.domain.OrderDO;
+import com.iotechn.unimall.data.enums.AdvertisementType;
+import com.iotechn.unimall.data.mapper.AdvertisementMapper;
+import com.iotechn.unimall.data.model.Page;
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.StringUtils;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Created with IntelliJ IDEA.
+ * Description:
+ * User: kbq
+ * Date: 2019-07-08
+ * Time: 下午9:24
+ */
+@Service
+public class AdminAdvertisementServiceImpl implements AdminAdvertisementService {
+
+    @Autowired
+    private AdvertisementMapper advertisementMapper;
+    @Autowired
+    private CacheComponent cacheComponent;
+
+    private  final  static String  ADVERTISEMENT_NAME = "ADVERTISEMENT_TYPE_";
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean addAdvertisement(Long adminId, Integer adType, String title, String url, String imgUrl, Integer status,String color) throws ServiceException {
+
+        Date now = new Date();
+        AdvertisementDO advertisementDO = new AdvertisementDO(adType,title,url,imgUrl,status,color);
+        advertisementDO.setGmtCreate(now);
+        advertisementDO.setGmtUpdate(now);
+
+        if(advertisementMapper.insert(advertisementDO) > 0){
+            cacheComponent.delPrefixKey(ADVERTISEMENT_NAME);
+            return true;
+        }
+        throw new AdminServiceException(ExceptionDefinition.ADVERTISEMENT_SQL_ADD_FAILED);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean deleteAdvertisement(Long adminId,Integer adType, Long adId) throws ServiceException {
+
+        if(advertisementMapper.delete(new EntityWrapper<AdvertisementDO>()
+                .eq("id",adId)
+                .eq("ad_type",adType)) > 0){
+            cacheComponent.delPrefixKey(ADVERTISEMENT_NAME);
+            return true;
+        }
+        throw new AdminServiceException(ExceptionDefinition.ADVERTISEMENT_SQL_DELETE_FAILED);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean updateAdvertisement(Long adminId,Long adId, Integer adType, String title, String url, String imgUrl, Integer status,String color) throws ServiceException {
+        AdvertisementDO advertisementDO = new AdvertisementDO(adType,title,url,imgUrl,status,color);
+        advertisementDO.setId(adId);
+        advertisementDO.setGmtUpdate(new Date());
+        if(advertisementMapper.updateById(advertisementDO)>0){
+            cacheComponent.delPrefixKey(ADVERTISEMENT_NAME);
+            return  true;
+        }
+        throw new AdminServiceException(ExceptionDefinition.ADVERTISEMENT_SQL_UPDATE_FAILED);
+    }
+
+    @Override
+    public Page<AdvertisementDO> queryAdvertisement(Long adminId, Integer adType, Integer pageNo, Integer limit, Integer status) throws ServiceException {
+        Wrapper<AdvertisementDO> wrapper = new EntityWrapper<AdvertisementDO>();
+        if (adType != null) {
+            wrapper.eq("ad_type", adType);
+        }
+        if (status != null) {
+            wrapper.eq("status", status);
+        }
+
+        List<AdvertisementDO> advertisementDOList = advertisementMapper.selectPage(new RowBounds(limit *(pageNo - 1), limit),wrapper);
+        Integer count = advertisementMapper.selectCount(wrapper);
+
+        Page<AdvertisementDO> page = new Page<>(advertisementDOList,pageNo, limit,count);
+
+        return page;
+
+    }
+
+    //冗余,未使用
+    @Override
+    public Page<AdvertisementDO> queryAllAdvertisement(Long adminId,Integer pageNo,Integer pageSize) throws ServiceException {
+
+        List<AdvertisementDO> advertisementDOList = advertisementMapper.getAllAdvertisement(pageSize*(pageNo-1),pageSize);
+        Integer count = advertisementMapper.selectCount(null);
+        Page<AdvertisementDO> page = new Page<>(advertisementDOList,pageNo,pageSize,count);
+        return page;
+
+    }
+}

+ 40 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/appraise/AdminAppraise.java

@@ -0,0 +1,40 @@
+package com.iotechn.unimall.admin.api.appraise;
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.dto.appraise.AppraiseResponseDTO;
+import com.iotechn.unimall.data.model.Page;
+
+/**
+ * Created with IntelliJ IDEA.
+ * Description:
+ * User: kbq
+ * Date: 2019-07-15
+ * Time: 下午3:41
+ */
+@HttpOpenApi(group = "admin.appraise", description = "评论")
+public interface AdminAppraise {
+
+    @HttpMethod(description = "删除", permission = "operation:appraise:delete", permissionParentName = "运营管理", permissionName = "评论管理")
+    public boolean deleteAppraise(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
+            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "评论id") Long id) throws ServiceException;
+
+
+    @HttpMethod(description = "查询", permission = "operation:appraise:query", permissionParentName = "运营管理", permissionName = "评论管理")
+    public Page<AppraiseResponseDTO> getAppraiseList(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
+            @HttpParam(name = "id", type = HttpParamType.COMMON, description = "评论id") Long id,
+            @HttpParam(name = "userName", type = HttpParamType.COMMON, description = "用户姓名") String userName,
+            @HttpParam(name = "spuName", type = HttpParamType.COMMON, description = "商品名字") String spuName,
+            @HttpParam(name = "orderId", type = HttpParamType.COMMON, description = "订单ID") Long orderId,
+            @HttpParam(name = "score", type = HttpParamType.COMMON, description = "评论id") Integer score,
+            @HttpParam(name = "content", type = HttpParamType.COMMON, description = "评论id") String content,
+            @HttpParam(name = "pageNo", type = HttpParamType.COMMON, description = "页码") Integer pageNo,
+            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度") Integer limit) throws ServiceException;
+
+}

+ 46 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/appraise/AdminAppraiseImpl.java

@@ -0,0 +1,46 @@
+package com.iotechn.unimall.admin.api.appraise;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.dto.appraise.AppraiseResponseDTO;
+import com.iotechn.unimall.data.mapper.AppraiseMapper;
+import com.iotechn.unimall.data.model.Page;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.StringUtils;
+
+import java.util.List;
+
+/**
+ * Created with IntelliJ IDEA.
+ * Description:
+ * User: kbq
+ * Date: 2019-07-15
+ * Time: 下午3:56
+ */
+@Service
+public class AdminAppraiseImpl implements  AdminAppraise {
+
+    @Autowired
+    private AppraiseMapper appraiseMapper;
+
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public boolean deleteAppraise(Long adminId, Long id) throws ServiceException {
+        return appraiseMapper.deleteById(id) > 0;
+    }
+
+    @Override
+    public Page<AppraiseResponseDTO> getAppraiseList(Long adminId, Long id, String userName, String spuName, Long orderId, Integer score, String content,Integer pageNo,Integer limit) throws ServiceException {
+
+        Integer count = appraiseMapper.countAppraiseCondition(id,userName ,spuName , orderId, score, content);
+
+        List<AppraiseResponseDTO> appraiseResponseDTOList = appraiseMapper.selectAppraiseCondition(id,userName ,spuName , orderId, score, content,(pageNo-1)*limit,limit);
+
+        Page<AppraiseResponseDTO> page = new Page<AppraiseResponseDTO>(appraiseResponseDTOList,pageNo,limit,count);
+
+        return page;
+    }
+}

+ 64 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/ICardClassifyInfoService.java

@@ -0,0 +1,64 @@
+package com.iotechn.unimall.admin.api.card;
+
+
+import com.iotechn.unimall.data.domain.CardClassifyInfo;
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.CardManagementInfo;
+import com.iotechn.unimall.data.model.Page;
+import java.util.Date;
+
+/**
+ * 名片分类Service接口
+ * 
+ * @author jlb
+ * @date 2023-04-10
+ */
+@HttpOpenApi(group = "admin.unimall.cardClassifyInfo", description = "名片分类")
+public interface ICardClassifyInfoService{
+	@HttpMethod(description = "新增",  permissionName = "名片分类管理")
+	public Boolean add(@NotNull @HttpParam(name = "cardClassifyInfo", type = HttpParamType.COMMON, description = "名片分类") CardClassifyInfo cardClassifyInfo)throws ServiceException;
+
+	@HttpMethod(description = "列表", permissionName = "名片分类管理")
+	public Page<CardClassifyInfo> list(
+								@HttpParam(name = "commonId", type = HttpParamType.COMMON, description = "个人id") Long commonId,
+							@HttpParam(name = "circleName", type = HttpParamType.COMMON, description = "分类名称") String circleName,
+							@HttpParam(name = "topMarking", type = HttpParamType.COMMON, description = "置顶标识") Long topMarking,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "删除标识") Long deleteFlag,
+					@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+		@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+		throws ServiceException;
+
+	@HttpMethod(description = "删除",  permissionName = "名片分类管理")
+	public Boolean delete(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")String id)throws ServiceException;
+
+	@HttpMethod(description = "置顶",  permissionName = "名片分类管理")
+	public Boolean top(@NotNull @HttpParam(name = "cardClassifyInfo", type = HttpParamType.COMMON, description = "名片分类") CardClassifyInfo cardClassifyInfo)throws ServiceException;
+
+	@HttpMethod(description = "置顶默认分类",  permissionName = "名片分类管理")
+	public Boolean topDefault(@NotNull @HttpParam(name = "cardClassifyInfo", type = HttpParamType.COMMON, description = "名片分类") CardClassifyInfo cardClassifyInfo)throws ServiceException;
+
+	@HttpMethod(description = "修改",  permissionName = "名片分类管理")
+	public Boolean update(@NotNull @HttpParam(name = "cardClassifyInfo", type = HttpParamType.COMMON, description = "名片分类") CardClassifyInfo cardClassifyInfo)throws ServiceException;
+
+	@HttpMethod(description = "查询",  permissionName = "名片分类管理")
+	public CardClassifyInfo get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")Long id)throws ServiceException;
+	
+	@HttpMethod(description = "导出excl表", permissionName = "名片分类管理")
+	public String export(
+								@HttpParam(name = "commonId", type = HttpParamType.COMMON, description = "个人id") Long commonId,
+							@HttpParam(name = "circleName", type = HttpParamType.COMMON, description = "分类名称") String circleName,
+							@HttpParam(name = "topMarking", type = HttpParamType.COMMON, description = "置顶标识") Long topMarking,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "删除标识") Long deleteFlag,
+				@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+	@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)throws ServiceException;
+	
+}

+ 64 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/ICardExchangeInfoService.java

@@ -0,0 +1,64 @@
+package com.iotechn.unimall.admin.api.card;
+
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.CardExchangeInfo;
+import com.iotechn.unimall.data.model.Page;
+import java.util.Date;
+
+/**
+ * 名片交换Service接口
+ * 
+ * @author jlb
+ * @date 2023-04-12
+ */
+@HttpOpenApi(group = "admin.unimall.cardExchangeInfo", description = "名片交换")
+public interface ICardExchangeInfoService{
+	@HttpMethod(description = "新增", permissionName = "名片交换管理")
+	public Boolean add(@NotNull @HttpParam(name = "cardExchangeInfo", type = HttpParamType.COMMON, description = "名片交换") CardExchangeInfo cardExchangeInfo)throws ServiceException;
+
+	@HttpMethod(description = "列表", permissionName = "名片交换管理")
+	public Page<CardExchangeInfo> list(
+								@HttpParam(name = "sendId", type = HttpParamType.COMMON, description = "发起人id") Long sendId,
+							@HttpParam(name = "receiveId", type = HttpParamType.COMMON, description = "接收人id") Long receiveId,
+							@HttpParam(name = "sendCardId", type = HttpParamType.COMMON, description = "发起人名片id") Long sendCardId,
+							@HttpParam(name = "receiveCardId", type = HttpParamType.COMMON, description = "接收人名片id") Long receiveCardId,
+							@HttpParam(name = "circleName", type = HttpParamType.COMMON, description = "圈子名称") String circleName,
+							@HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态(1已接受3已拒绝5已过期)") String status,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "删除标识") Long deleteFlag,
+					@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+		@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+		throws ServiceException;
+
+	@HttpMethod(description = "删除", permissionName = "名片交换管理")
+	public Boolean delete(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")String id)throws ServiceException;
+
+	@HttpMethod(description = "修改", permissionName = "名片交换管理")
+	public Boolean update(@NotNull @HttpParam(name = "cardExchangeInfo", type = HttpParamType.COMMON, description = "名片交换") CardExchangeInfo cardExchangeInfo,
+						  @HttpParam(name = "updateFlag", type = HttpParamType.COMMON, description = "updateFlag") String updateFlag)throws ServiceException;
+
+	@HttpMethod(description = "查询", permissionName = "名片交换管理")
+	public CardExchangeInfo get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")Long id)throws ServiceException;
+	
+	@HttpMethod(description = "导出excl表", permissionName = "名片交换管理")
+	public String export(
+								@HttpParam(name = "sendId", type = HttpParamType.COMMON, description = "发起人id") Long sendId,
+							@HttpParam(name = "receiveId", type = HttpParamType.COMMON, description = "接收人id") Long receiveId,
+							@HttpParam(name = "sendCardId", type = HttpParamType.COMMON, description = "发起人名片id") Long sendCardId,
+							@HttpParam(name = "receiveCardId", type = HttpParamType.COMMON, description = "接收人名片id") Long receiveCardId,
+							@HttpParam(name = "circleName", type = HttpParamType.COMMON, description = "圈子名称") String circleName,
+							@HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态(1已接受3已拒绝5已过期)") String status,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "删除标识") Long deleteFlag,
+				@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+	@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)throws ServiceException;
+	
+}

+ 57 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/ICardHolderInfoService.java

@@ -0,0 +1,57 @@
+package com.iotechn.unimall.admin.api.card;
+
+
+import com.iotechn.unimall.data.domain.CardHolderInfo;
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.model.Page;
+import java.util.Date;
+
+/**
+ * 名片夹Service接口
+ * 
+ * @author jlb
+ * @date 2023-04-10
+ */
+@HttpOpenApi(group = "admin.unimall.cardHolderInfo", description = "名片夹")
+public interface ICardHolderInfoService{
+	@HttpMethod(description = "新增",  permissionName = "名片夹管理")
+	public Boolean add(@NotNull @HttpParam(name = "cardHolderInfo", type = HttpParamType.COMMON, description = "名片夹") CardHolderInfo cardHolderInfo)throws ServiceException;
+
+	@HttpMethod(description = "列表",  permissionName = "名片夹管理")
+	public Page<CardHolderInfo> list(
+								@HttpParam(name = "commonId", type = HttpParamType.COMMON, description = "个人id") Long commonId,
+							@HttpParam(name = "cardId", type = HttpParamType.COMMON, description = "名片id") String cardId,
+										@HttpParam(name = "classify", type = HttpParamType.COMMON, description = "客户分类") String classify,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "删除标识") Long deleteFlag,
+					@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+		@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+		throws ServiceException;
+
+	@HttpMethod(description = "删除", permissionName = "名片夹管理")
+	public Boolean delete(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")String id)throws ServiceException;
+
+	@HttpMethod(description = "修改",  permissionName = "名片夹管理")
+	public Boolean update(@NotNull @HttpParam(name = "cardHolderInfo", type = HttpParamType.COMMON, description = "名片夹") CardHolderInfo cardHolderInfo)throws ServiceException;
+
+	@HttpMethod(description = "查询", permissionName = "名片夹管理")
+	public CardHolderInfo get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")Long id)throws ServiceException;
+	
+	@HttpMethod(description = "导出excl表", permissionName = "名片夹管理")
+	public String export(
+								@HttpParam(name = "commonId", type = HttpParamType.COMMON, description = "个人id") Long commonId,
+							@HttpParam(name = "cardId", type = HttpParamType.COMMON, description = "名片id") String cardId,
+										@HttpParam(name = "classify", type = HttpParamType.COMMON, description = "客户分类") String classify,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "删除标识") Long deleteFlag,
+				@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+	@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)throws ServiceException;
+	
+}

+ 75 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/ICardManagementInfoService.java

@@ -0,0 +1,75 @@
+package com.iotechn.unimall.admin.api.card;
+
+
+import com.iotechn.unimall.data.domain.CardManagementInfo;
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.model.Page;
+import java.util.Date;
+
+/**
+ * 名片管理Service接口
+ * 
+ * @author jlb
+ * @date 2023-04-10
+ */
+@HttpOpenApi(group = "admin.unimall.cardManagementInfo", description = "名片管理")
+public interface ICardManagementInfoService{
+	@HttpMethod(description = "新增",  permissionName = "名片管理管理")
+	public Boolean add(@NotNull @HttpParam(name = "cardManagementInfo", type = HttpParamType.COMMON, description = "名片管理") CardManagementInfo cardManagementInfo)throws ServiceException;
+
+	@HttpMethod(description = "列表",  permissionName = "名片管理管理")
+	public Page<CardManagementInfo> list(
+								@HttpParam(name = "commonId", type = HttpParamType.COMMON, description = "个人id") Long commonId,
+							@HttpParam(name = "cardBusiness", type = HttpParamType.COMMON, description = "名片标识") String cardBusiness,
+							@HttpParam(name = "name", type = HttpParamType.COMMON, description = "姓名") String name,
+							@HttpParam(name = "post", type = HttpParamType.COMMON, description = "职务") String post,
+							@HttpParam(name = "companyName", type = HttpParamType.COMMON, description = "公司名") String companyName,
+							@HttpParam(name = "location", type = HttpParamType.COMMON, description = "定位") String location,
+							@HttpParam(name = "detailedAddress", type = HttpParamType.COMMON, description = "详细地址") String detailedAddress,
+							@HttpParam(name = "phone", type = HttpParamType.COMMON, description = "联系电话") String phone,
+							@HttpParam(name = "headSculpture", type = HttpParamType.COMMON, description = "头像") String headSculpture,
+							@HttpParam(name = "qrCode", type = HttpParamType.COMMON, description = "二维码") String qrCode,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "删除标识") Long deleteFlag,
+					@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+		@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+		throws ServiceException;
+
+	@HttpMethod(description = "删除",  permissionName = "名片管理管理")
+	public Boolean delete(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")String id,
+						@HttpParam(name = "deleteCondition", type = HttpParamType.COMMON, description = "删除条件") String deleteCondition)throws ServiceException;
+
+	@HttpMethod(description = "修改",  permissionName = "名片管理管理")
+	public Boolean update(@NotNull @HttpParam(name = "cardManagementInfo", type = HttpParamType.COMMON, description = "名片管理") CardManagementInfo cardManagementInfo)throws ServiceException;
+
+	@HttpMethod(description = "置顶",  permissionName = "名片管理管理")
+	public Boolean top(@NotNull @HttpParam(name = "cardManagementInfo", type = HttpParamType.COMMON, description = "名片管理") CardManagementInfo cardManagementInfo)throws ServiceException;
+
+	@HttpMethod(description = "查询", permissionName = "名片管理管理")
+	public CardManagementInfo get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")Long id)throws ServiceException;
+	
+	@HttpMethod(description = "导出excl表", permissionName = "名片管理管理")
+	public String export(
+								@HttpParam(name = "commonId", type = HttpParamType.COMMON, description = "个人id") Long commonId,
+							@HttpParam(name = "cardBusiness", type = HttpParamType.COMMON, description = "名片标识") String cardBusiness,
+							@HttpParam(name = "name", type = HttpParamType.COMMON, description = "姓名") String name,
+							@HttpParam(name = "post", type = HttpParamType.COMMON, description = "职务") String post,
+							@HttpParam(name = "companyName", type = HttpParamType.COMMON, description = "公司名") String companyName,
+							@HttpParam(name = "location", type = HttpParamType.COMMON, description = "定位") String location,
+							@HttpParam(name = "detailedAddress", type = HttpParamType.COMMON, description = "详细地址") String detailedAddress,
+							@HttpParam(name = "phone", type = HttpParamType.COMMON, description = "联系电话") String phone,
+							@HttpParam(name = "headSculpture", type = HttpParamType.COMMON, description = "头像") String headSculpture,
+							@HttpParam(name = "qrCode", type = HttpParamType.COMMON, description = "二维码") String qrCode,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "删除标识") Long deleteFlag,
+				@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+	@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)throws ServiceException;
+	
+}

+ 64 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/ICertificateManagementInfoService.java

@@ -0,0 +1,64 @@
+package com.iotechn.unimall.admin.api.card;
+
+
+import com.iotechn.unimall.data.domain.CertificateManagementInfo;
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.dto.DistinguishView;
+import com.iotechn.unimall.data.model.Page;
+import java.util.Date;
+
+/**
+ * 证件管理Service接口
+ * 
+ * @author jlb
+ * @date 2023-04-10
+ */
+@HttpOpenApi(group = "admin.unimall.certificateManagementInfo", description = "证件管理")
+public interface ICertificateManagementInfoService{
+	@HttpMethod(description = "新增", permissionName = "证件管理管理")
+	public Boolean add(@NotNull @HttpParam(name = "certificateManagementInfo", type = HttpParamType.COMMON, description = "证件管理") CertificateManagementInfo certificateManagementInfo)throws ServiceException;
+
+	@HttpMethod(description = "列表",  permissionName = "证件管理管理")
+	public Page<CertificateManagementInfo> list(
+								@HttpParam(name = "commonId", type = HttpParamType.COMMON, description = "个人id") Long commonId,
+							@HttpParam(name = "certificateName", type = HttpParamType.COMMON, description = "证件名称") String certificateName,
+							@HttpParam(name = "certificateImage", type = HttpParamType.COMMON, description = "证件图") String certificateImage,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "删除标识") Long deleteFlag,
+					@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+		@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+		throws ServiceException;
+
+	@HttpMethod(description = "删除", permissionName = "证件管理管理")
+	public Boolean delete(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")String id)throws ServiceException;
+
+	@HttpMethod(description = "修改",  permissionName = "证件管理管理")
+	public Boolean update(@NotNull @HttpParam(name = "certificateManagementInfo", type = HttpParamType.COMMON, description = "证件管理") CertificateManagementInfo certificateManagementInfo)throws ServiceException;
+
+	@HttpMethod(description = "查询",  permissionName = "证件管理管理")
+	public CertificateManagementInfo get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")Long id)throws ServiceException;
+
+	@HttpMethod(description = "识别身份证",  permissionName = "证件管理管理")
+	public DistinguishView personShibie(@HttpParam(name = "certificateImage", type = HttpParamType.COMMON, description = "证件图") String certificateImage)throws ServiceException;
+
+	@HttpMethod(description = "识别银行卡",  permissionName = "证件管理管理")
+	public DistinguishView bankShibie(@HttpParam(name = "certificateImage", type = HttpParamType.COMMON, description = "证件图") String certificateImage)throws ServiceException;
+
+	@HttpMethod(description = "导出excl表", permissionName = "证件管理管理")
+	public String export(
+								@HttpParam(name = "commonId", type = HttpParamType.COMMON, description = "个人id") Long commonId,
+							@HttpParam(name = "certificateName", type = HttpParamType.COMMON, description = "证件名称") String certificateName,
+							@HttpParam(name = "certificateImage", type = HttpParamType.COMMON, description = "证件图") String certificateImage,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "删除标识") Long deleteFlag,
+				@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+	@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)throws ServiceException;
+	
+}

+ 57 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/ICircleCardInfoService.java

@@ -0,0 +1,57 @@
+package com.iotechn.unimall.admin.api.card;
+
+
+import com.iotechn.unimall.data.domain.CircleCardInfo;
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.model.Page;
+import java.util.Date;
+
+/**
+ * 圈子个人关系Service接口
+ * 
+ * @author jlb
+ * @date 2023-04-10
+ */
+@HttpOpenApi(group = "admin.unimall.circleCardInfo", description = "圈子个人关系")
+public interface ICircleCardInfoService{
+	@HttpMethod(description = "新增",  permissionName = "圈子个人关系管理")
+	public Boolean add(@NotNull @HttpParam(name = "circleCardInfo", type = HttpParamType.COMMON, description = "圈子个人关系") CircleCardInfo circleCardInfo)throws ServiceException;
+
+	@HttpMethod(description = "列表", permissionName = "圈子个人关系管理")
+	public Page<CircleCardInfo> list(
+					@HttpParam(name = "circleId", type = HttpParamType.COMMON, description = "圈子id") Long circleId,
+							@HttpParam(name = "cardId", type = HttpParamType.COMMON, description = "名片id") Long cardId,
+							@HttpParam(name = "commonId", type = HttpParamType.COMMON, description = "个人id") Long commonId,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "删除标识") Long deleteFlag,
+					@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+		@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+		throws ServiceException;
+
+	@HttpMethod(description = "删除", permissionName = "圈子个人关系管理")
+	public Boolean delete(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = " ")String id)throws ServiceException;
+
+	@HttpMethod(description = "修改",  permissionName = "圈子个人关系管理")
+	public Boolean update(@NotNull @HttpParam(name = "circleCardInfo", type = HttpParamType.COMMON, description = "圈子个人关系") CircleCardInfo circleCardInfo)throws ServiceException;
+
+	@HttpMethod(description = "查询",  permissionName = "圈子个人关系管理")
+	public CircleCardInfo get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")Long id)throws ServiceException;
+	
+	@HttpMethod(description = "导出excl表", permissionName = "圈子个人关系管理")
+	public String export(
+					@HttpParam(name = "circleId", type = HttpParamType.COMMON, description = "圈子id") Long circleId,
+							@HttpParam(name = "cardId", type = HttpParamType.COMMON, description = "名片id") Long cardId,
+							@HttpParam(name = "commonId", type = HttpParamType.COMMON, description = "个人id") Long commonId,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "删除标识") Long deleteFlag,
+				@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+	@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)throws ServiceException;
+	
+}

+ 70 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/ICircleManagementInfoService.java

@@ -0,0 +1,70 @@
+package com.iotechn.unimall.admin.api.card;
+
+
+import com.iotechn.unimall.data.domain.CardManagementInfo;
+import com.iotechn.unimall.data.domain.CircleManagementInfo;
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.model.Page;
+import java.util.Date;
+
+/**
+ * 圈子管理Service接口
+ * 
+ * @author jlb
+ * @date 2023-04-10
+ */
+@HttpOpenApi(group = "admin.unimall.circleManagementInfo", description = "圈子管理")
+public interface ICircleManagementInfoService{
+	@HttpMethod(description = "新增",  permissionName = "圈子管理管理")
+	public Boolean add(@NotNull @HttpParam(name = "circleManagementInfo", type = HttpParamType.COMMON, description = "圈子管理") CircleManagementInfo circleManagementInfo)throws ServiceException;
+
+	@HttpMethod(description = "列表",  permissionName = "圈子管理管理")
+	public Page<CircleManagementInfo> list(
+								@HttpParam(name = "commonId", type = HttpParamType.COMMON, description = "个人id") Long commonId,
+							@HttpParam(name = "circleName", type = HttpParamType.COMMON, description = "圈子名称") String circleName,
+							@HttpParam(name = "circleLabel", type = HttpParamType.COMMON, description = "圈子标签") String circleLabel,
+							@HttpParam(name = "status", type = HttpParamType.COMMON, description = "0未审核 1已通过") Long status,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "删除标识") Long deleteFlag,
+					@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+		@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+		throws ServiceException;
+
+	@HttpMethod(description = "删除",  permissionName = "圈子管理管理")
+	public Boolean delete(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")String id)throws ServiceException;
+
+	@HttpMethod(description = "修改",  permissionName = "圈子管理管理")
+	public Boolean update(@NotNull @HttpParam(name = "circleManagementInfo", type = HttpParamType.COMMON, description = "圈子管理") CircleManagementInfo circleManagementInfo)throws ServiceException;
+
+	@HttpMethod(description = "查询",  permissionName = "圈子管理管理")
+	public CircleManagementInfo get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")Long id,
+									@HttpParam(name = "commonId", type = HttpParamType.COMMON, description = "个人id") Long commonId)throws ServiceException;
+
+	@HttpMethod(description = "圈子详情名片列表",  permissionName = "圈子管理管理")
+	public Page<CardManagementInfo> circleCardlist(
+			@HttpParam(name = "commonId", type = HttpParamType.COMMON, description = "个人id") Long commonId,
+			@HttpParam(name = "id", type = HttpParamType.COMMON, description = "")Long id,
+			@HttpParam(name = "status", type = HttpParamType.COMMON, description = " 1已交换 2未交换") String status,
+			@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+			@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+			throws ServiceException;
+
+	@HttpMethod(description = "导出excl表",  permissionName = "圈子管理管理")
+	public String export(
+								@HttpParam(name = "commonId", type = HttpParamType.COMMON, description = "个人id") Long commonId,
+							@HttpParam(name = "circleName", type = HttpParamType.COMMON, description = "圈子名称") String circleName,
+							@HttpParam(name = "circleLabel", type = HttpParamType.COMMON, description = "圈子标签") String circleLabel,
+							@HttpParam(name = "status", type = HttpParamType.COMMON, description = "0未审核 1已通过") Long status,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "删除标识") Long deleteFlag,
+				@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+	@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)throws ServiceException;
+	
+}

+ 67 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/ICommonUserInfoService.java

@@ -0,0 +1,67 @@
+package com.iotechn.unimall.admin.api.card;
+
+
+import com.iotechn.unimall.data.domain.CommonUserInfo;
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.model.Page;
+import java.util.Date;
+
+/**
+ * 用户管理Service接口
+ * 
+ * @author jlb
+ * @date 2023-04-10
+ */
+@HttpOpenApi(group = "admin.unimall.commonUserInfo", description = "用户管理")
+public interface ICommonUserInfoService{
+	@HttpMethod(description = "新增",  permissionName = "用户管理管理")
+	public Boolean add(@NotNull @HttpParam(name = "commonUserInfo", type = HttpParamType.COMMON, description = "用户管理") CommonUserInfo commonUserInfo)throws ServiceException;
+
+	@HttpMethod(description = "列表",  permissionName = "用户管理管理")
+	public Page<CommonUserInfo> list(
+								@HttpParam(name = "nickname", type = HttpParamType.COMMON, description = "昵称") String nickname,
+							@HttpParam(name = "password", type = HttpParamType.COMMON, description = "密码") String password,
+							@HttpParam(name = "phone", type = HttpParamType.COMMON, description = "手机号") String phone,
+							@HttpParam(name = "realname", type = HttpParamType.COMMON, description = "真实姓名") String realname,
+							@HttpParam(name = "shareCard", type = HttpParamType.COMMON, description = "允许他人分享名片(1允许)") Long shareCard,
+							@HttpParam(name = "lookPage", type = HttpParamType.COMMON, description = "允许圈子成员查看主页(1允许)") Long lookPage,
+							@HttpParam(name = "autoAccept", type = HttpParamType.COMMON, description = "自动接受邀请(1是)") Long autoAccept,
+							@HttpParam(name = "status", type = HttpParamType.COMMON, description = "0.冻结 1.激活") Long status,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "删除标识") Long deleteFlag,
+					@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+		@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+		throws ServiceException;
+
+	@HttpMethod(description = "删除", permissionName = "用户管理管理")
+	public Boolean delete(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")String id)throws ServiceException;
+
+	@HttpMethod(description = "修改",  permissionName = "用户管理管理")
+	public Boolean update(@NotNull @HttpParam(name = "commonUserInfo", type = HttpParamType.COMMON, description = "用户管理") CommonUserInfo commonUserInfo)throws ServiceException;
+
+	@HttpMethod(description = "查询", permissionName = "用户管理管理")
+	public CommonUserInfo get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")Long id)throws ServiceException;
+	
+	@HttpMethod(description = "导出excl表",  permissionName = "用户管理管理")
+	public String export(
+								@HttpParam(name = "nickname", type = HttpParamType.COMMON, description = "昵称") String nickname,
+							@HttpParam(name = "password", type = HttpParamType.COMMON, description = "密码") String password,
+							@HttpParam(name = "phone", type = HttpParamType.COMMON, description = "手机号") String phone,
+							@HttpParam(name = "realname", type = HttpParamType.COMMON, description = "真实姓名") String realname,
+							@HttpParam(name = "shareCard", type = HttpParamType.COMMON, description = "允许他人分享名片(1允许)") Long shareCard,
+							@HttpParam(name = "lookPage", type = HttpParamType.COMMON, description = "允许圈子成员查看主页(1允许)") Long lookPage,
+							@HttpParam(name = "autoAccept", type = HttpParamType.COMMON, description = "自动接受邀请(1是)") Long autoAccept,
+							@HttpParam(name = "status", type = HttpParamType.COMMON, description = "0.冻结 1.激活") Long status,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "删除标识") Long deleteFlag,
+				@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+	@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)throws ServiceException;
+	
+}

+ 69 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/IPersonalHomepageInfoService.java

@@ -0,0 +1,69 @@
+package com.iotechn.unimall.admin.api.card;
+
+
+import com.iotechn.unimall.data.domain.PersonalHomepageInfo;
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.model.Page;
+import java.util.Date;
+
+/**
+ * 个人主页Service接口
+ * 
+ * @author jlb
+ * @date 2023-04-10
+ */
+@HttpOpenApi(group = "admin.unimall.personalHomepageInfo", description = "个人主页")
+public interface IPersonalHomepageInfoService{
+	@HttpMethod(description = "新增",  permissionName = "个人主页管理")
+	public Boolean add(@NotNull @HttpParam(name = "personalHomepageInfo", type = HttpParamType.COMMON, description = "个人主页") PersonalHomepageInfo personalHomepageInfo)throws ServiceException;
+
+	@HttpMethod(description = "列表",  permissionName = "个人主页管理")
+	public Page<PersonalHomepageInfo> list(
+								@HttpParam(name = "commonId", type = HttpParamType.COMMON, description = "个人id") Long commonId,
+							@HttpParam(name = "companyName", type = HttpParamType.COMMON, description = "公司名") String companyName,
+							@HttpParam(name = "companyIntroduction", type = HttpParamType.COMMON, description = "公司简介") String companyIntroduction,
+							@HttpParam(name = "scopeOfBusiness", type = HttpParamType.COMMON, description = "业务范围") String scopeOfBusiness,
+							@HttpParam(name = "companyAddress", type = HttpParamType.COMMON, description = "公司地址") String companyAddress,
+							@HttpParam(name = "phone", type = HttpParamType.COMMON, description = "联系电话") String phone,
+							@HttpParam(name = "portraiture", type = HttpParamType.COMMON, description = "传真") String portraiture,
+							@HttpParam(name = "postbox", type = HttpParamType.COMMON, description = "邮箱") String postbox,
+							@HttpParam(name = "addressUrl", type = HttpParamType.COMMON, description = "企业风采") String addressUrl,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "删除标识") Long deleteFlag,
+					@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+		@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+		throws ServiceException;
+
+	@HttpMethod(description = "删除",  permissionName = "个人主页管理")
+	public Boolean delete(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")String id)throws ServiceException;
+
+	@HttpMethod(description = "修改", permissionName = "个人主页管理")
+	public Boolean update(@NotNull @HttpParam(name = "personalHomepageInfo", type = HttpParamType.COMMON, description = "个人主页") PersonalHomepageInfo personalHomepageInfo)throws ServiceException;
+
+	@HttpMethod(description = "查询",  permissionName = "个人主页管理")
+	public PersonalHomepageInfo get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")Long id)throws ServiceException;
+	
+	@HttpMethod(description = "导出excl表",  permissionName = "个人主页管理")
+	public String export(
+								@HttpParam(name = "commonId", type = HttpParamType.COMMON, description = "个人id") Long commonId,
+							@HttpParam(name = "companyName", type = HttpParamType.COMMON, description = "公司名") String companyName,
+							@HttpParam(name = "companyIntroduction", type = HttpParamType.COMMON, description = "公司简介") String companyIntroduction,
+							@HttpParam(name = "scopeOfBusiness", type = HttpParamType.COMMON, description = "业务范围") String scopeOfBusiness,
+							@HttpParam(name = "companyAddress", type = HttpParamType.COMMON, description = "公司地址") String companyAddress,
+							@HttpParam(name = "phone", type = HttpParamType.COMMON, description = "联系电话") String phone,
+							@HttpParam(name = "portraiture", type = HttpParamType.COMMON, description = "传真") String portraiture,
+							@HttpParam(name = "postbox", type = HttpParamType.COMMON, description = "邮箱") String postbox,
+							@HttpParam(name = "addressUrl", type = HttpParamType.COMMON, description = "企业风采") String addressUrl,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "删除标识") Long deleteFlag,
+				@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+	@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)throws ServiceException;
+	
+}

+ 57 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/ISearchRecordsInfoService.java

@@ -0,0 +1,57 @@
+package com.iotechn.unimall.admin.api.card;
+
+
+import com.iotechn.unimall.data.domain.SearchRecordsInfo;
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.model.Page;
+import java.util.Date;
+
+/**
+ * 搜索记录Service接口
+ * 
+ * @author searchRecordsInfo
+ * @date 2023-04-10
+ */
+@HttpOpenApi(group = "admin.unimall.searchRecordsInfo", description = "搜索记录")
+public interface ISearchRecordsInfoService{
+	@HttpMethod(description = "新增", permissionName = "搜索记录管理")
+	public Boolean add(@NotNull @HttpParam(name = "searchRecordsInfo", type = HttpParamType.COMMON, description = "搜索记录") SearchRecordsInfo searchRecordsInfo)throws ServiceException;
+
+	@HttpMethod(description = "列表", permissionName = "搜索记录管理")
+	public Page<SearchRecordsInfo> list(
+								@HttpParam(name = "commonId", type = HttpParamType.COMMON, description = "个人id") Long commonId,
+							@HttpParam(name = "searchContent", type = HttpParamType.COMMON, description = "搜索内容") String searchContent,
+							@HttpParam(name = "functionType", type = HttpParamType.COMMON, description = "功能类型") String functionType,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "删除标识") Long deleteFlag,
+					@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+		@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+		throws ServiceException;
+
+	@HttpMethod(description = "清空搜索记录",  permissionName = "搜索记录管理")
+	public Boolean delete(@NotNull @HttpParam(name = "searchRecordsInfo", type = HttpParamType.COMMON, description = "搜索记录") SearchRecordsInfo searchRecordsInfo)throws ServiceException;
+
+	@HttpMethod(description = "修改",  permissionName = "搜索记录管理")
+	public Boolean update(@NotNull @HttpParam(name = "searchRecordsInfo", type = HttpParamType.COMMON, description = "搜索记录") SearchRecordsInfo searchRecordsInfo)throws ServiceException;
+
+	@HttpMethod(description = "查询", permissionName = "搜索记录管理")
+	public SearchRecordsInfo get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")Long id)throws ServiceException;
+	
+	@HttpMethod(description = "导出excl表",  permissionName = "搜索记录管理")
+	public String export(
+								@HttpParam(name = "commonId", type = HttpParamType.COMMON, description = "个人id") Long commonId,
+							@HttpParam(name = "searchContent", type = HttpParamType.COMMON, description = "搜索内容") String searchContent,
+							@HttpParam(name = "functionType", type = HttpParamType.COMMON, description = "功能类型") String functionType,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "删除标识") Long deleteFlag,
+				@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+	@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)throws ServiceException;
+	
+}

+ 164 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CardClassifyInfoServiceImpl.java

@@ -0,0 +1,164 @@
+package com.iotechn.unimall.admin.api.card.impl;
+
+import java.util.List;
+
+import com.iotechn.unimall.core.exception.AdminServiceException;
+import com.iotechn.unimall.core.exception.AppServiceException;
+import com.iotechn.unimall.core.exception.ExceptionDefinition;
+import com.iotechn.unimall.data.domain.CardManagementInfo;
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.util.ExcelUtil;
+import com.iotechn.unimall.data.mapper.CardClassifyInfoMapper;
+import com.iotechn.unimall.data.domain.CardClassifyInfo;
+import com.iotechn.unimall.admin.api.card.ICardClassifyInfoService;
+import com.iotechn.unimall.data.model.Page;
+
+import java.util.Date;
+
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 名片分类Service业务层处理
+ *
+ * @author jlb
+ * @date 2023-04-10
+ */
+@Service
+public class CardClassifyInfoServiceImpl implements ICardClassifyInfoService {
+    @Autowired
+    private CardClassifyInfoMapper cardClassifyInfoMapper;
+
+    @Override
+    public Boolean add(CardClassifyInfo cardClassifyInfo) throws ServiceException {
+        Date now = new Date();
+        cardClassifyInfo.setGmtCreate(now);
+        cardClassifyInfo.setGmtUpdate(now);
+        List<CardClassifyInfo> cardClassifyInfoList = cardClassifyInfoMapper.selectList(new EntityWrapper<CardClassifyInfo>()
+                .eq("common_id", cardClassifyInfo.getCommonId())
+                .eq("delete_flag", 0)
+                .eq("circle_name", cardClassifyInfo.getCircleName()));
+        if (cardClassifyInfoList.size() > 0) {
+            throw new AppServiceException(ExceptionDefinition.CLASSIFY_REPEAT_ERROR);
+        }
+        return cardClassifyInfoMapper.insert(cardClassifyInfo) > 0;
+    }
+
+    @Override
+    public Page<CardClassifyInfo> list(Long commonId, String circleName, Long topMarking, Date gmtCreate, Date gmtUpdate, Long deleteFlag, Integer page, Integer limit) throws ServiceException {
+        Wrapper<CardClassifyInfo> wrapper = new EntityWrapper<CardClassifyInfo>();
+        if (!StringUtils.isEmpty(commonId)) {
+            wrapper.eq("common_id", commonId);
+        }
+        if (!StringUtils.isEmpty(circleName)) {
+            wrapper.eq("circle_name", circleName);
+        }
+        if (!StringUtils.isEmpty(topMarking)) {
+            wrapper.eq("top_marking", topMarking);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        wrapper.eq("delete_flag", 0).orderBy("top_marking", false).orderBy("gmt_create", true);
+        List<CardClassifyInfo> list = cardClassifyInfoMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+        Integer count = cardClassifyInfoMapper.selectCount(wrapper);
+        return new Page<CardClassifyInfo>(list, page, limit, count);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean delete(String id) {
+        String[] ids = String.valueOf(id).split(",");
+        for (String tt : ids) {
+            CardClassifyInfo tmp = cardClassifyInfoMapper.selectById(Long.parseLong(tt));
+            if (tmp != null) {
+                tmp.setDeleteFlag(1l);
+                tmp.setGmtUpdate(new Date());
+                cardClassifyInfoMapper.updateById(tmp);
+            }
+        }
+        return true;
+    }
+
+    @Override
+    public Boolean top(CardClassifyInfo cardClassifyInfo) throws ServiceException {
+        CardClassifyInfo cardClassifyInfo1 = cardClassifyInfoMapper.selectById(cardClassifyInfo.getId());
+        List<CardClassifyInfo> cardClassifyInfoList = cardClassifyInfoMapper.selectList(new EntityWrapper<CardClassifyInfo>()
+                .eq("common_id", cardClassifyInfo1.getCommonId())
+                .eq("delete_flag", 0));
+        if (!CollectionUtils.isEmpty(cardClassifyInfoList)) {
+            for (CardClassifyInfo aa : cardClassifyInfoList) {
+                aa.setTopMarking(0l);
+                cardClassifyInfoMapper.updateById(aa);
+            }
+        }
+        cardClassifyInfo1.setTopMarking(1l);
+        cardClassifyInfo1.setGmtUpdate(new Date());
+        return cardClassifyInfoMapper.updateById(cardClassifyInfo1) > 0;
+    }
+
+    @Override
+    public Boolean topDefault(CardClassifyInfo cardClassifyInfo) throws ServiceException {
+        List<CardClassifyInfo> cardClassifyInfoList = cardClassifyInfoMapper.selectList(new EntityWrapper<CardClassifyInfo>()
+                .eq("common_id", cardClassifyInfo.getCommonId())
+                .eq("delete_flag", 0));
+        if (!CollectionUtils.isEmpty(cardClassifyInfoList)) {
+            for (CardClassifyInfo aa : cardClassifyInfoList) {
+                aa.setTopMarking(0l);
+                cardClassifyInfoMapper.updateById(aa);
+            }
+        }
+        return true;
+    }
+
+    @Override
+    public Boolean update(CardClassifyInfo cardClassifyInfo) throws ServiceException {
+        Date now = new Date();
+        cardClassifyInfo.setGmtUpdate(now);
+        return cardClassifyInfoMapper.updateById(cardClassifyInfo) > 0;
+    }
+
+    @Override
+    public CardClassifyInfo get(Long id) throws ServiceException {
+        return cardClassifyInfoMapper.selectById(id);
+    }
+
+    @Override
+    public String export(Long commonId, String circleName, Long topMarking, Date gmtCreate, Date gmtUpdate, Long deleteFlag, Integer page, Integer limit) throws ServiceException {
+        Wrapper<CardClassifyInfo> wrapper = new EntityWrapper<CardClassifyInfo>();
+        if (!StringUtils.isEmpty(commonId)) {
+            wrapper.eq("common_id", commonId);
+        }
+        if (!StringUtils.isEmpty(circleName)) {
+            wrapper.eq("circle_name", circleName);
+        }
+        if (!StringUtils.isEmpty(topMarking)) {
+            wrapper.eq("top_marking", topMarking);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        List<CardClassifyInfo> list = cardClassifyInfoMapper.selectList(wrapper);
+        ExcelUtil<CardClassifyInfo> util = new ExcelUtil<CardClassifyInfo>(CardClassifyInfo.class);
+        return util.exportExcel(list, "操作日志");
+    }
+}

+ 194 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CardExchangeInfoServiceImpl.java

@@ -0,0 +1,194 @@
+package com.iotechn.unimall.admin.api.card.impl;
+
+import java.util.List;
+
+import com.iotechn.unimall.admin.api.card.ICardExchangeInfoService;
+import com.iotechn.unimall.core.exception.AppServiceException;
+import com.iotechn.unimall.core.exception.ExceptionDefinition;
+import com.iotechn.unimall.data.domain.CardExchangeInfo;
+import com.iotechn.unimall.data.domain.CardHolderInfo;
+import com.iotechn.unimall.data.domain.CardManagementInfo;
+import com.iotechn.unimall.data.dto.goods.GroupShopDTO;
+import com.iotechn.unimall.data.dto.order.OrderDTO;
+import com.iotechn.unimall.data.mapper.CardExchangeInfoMapper;
+import com.iotechn.unimall.data.mapper.CardHolderInfoMapper;
+import com.iotechn.unimall.data.mapper.CardManagementInfoMapper;
+import com.iotechn.unimall.data.model.Page;
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.data.util.ExcelUtil;
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
+
+import com.iotechn.unimall.core.exception.ServiceException;
+
+import java.util.Date;
+
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 名片交换Service业务层处理
+ *
+ * @author jlb
+ * @date 2023-04-12
+ */
+@Service
+public class CardExchangeInfoServiceImpl implements ICardExchangeInfoService {
+    @Autowired
+    private CardExchangeInfoMapper cardExchangeInfoMapper;
+    @Autowired
+    private CardHolderInfoMapper cardHolderInfoMapper;
+    @Autowired
+    private CardManagementInfoMapper cardManagementInfoMapper;
+
+    @Override
+    public Boolean add(CardExchangeInfo cardExchangeInfo) throws ServiceException {
+        Date now = new Date();
+        cardExchangeInfo.setGmtCreate(now);
+        cardExchangeInfo.setGmtUpdate(now);
+        return cardExchangeInfoMapper.insert(cardExchangeInfo) > 0;
+    }
+
+    @Override
+    public Page<CardExchangeInfo> list(Long sendId, Long receiveId, Long sendCardId, Long receiveCardId, String circleName, String status, Date gmtCreate, Date gmtUpdate, Long deleteFlag, Integer page, Integer limit) throws ServiceException {
+        Wrapper<CardExchangeInfo> wrapper = new EntityWrapper<CardExchangeInfo>();
+        if (!StringUtils.isEmpty(sendId)) {
+            wrapper.eq("send_id", sendId);
+        }
+        if (!StringUtils.isEmpty(receiveId)) {
+            wrapper.eq("receive_id", receiveId);
+        }
+        if (!StringUtils.isEmpty(sendCardId)) {
+            wrapper.eq("send_card_id", sendCardId);
+        }
+        if (!StringUtils.isEmpty(receiveCardId)) {
+            wrapper.eq("receive_card_id", receiveCardId);
+        }
+        if (!StringUtils.isEmpty(circleName)) {
+            wrapper.eq("circle_name", circleName);
+        }
+        if (!StringUtils.isEmpty(status)) {
+            wrapper.eq("status", status);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        wrapper.eq("delete_flag", 0);
+        Integer count = cardExchangeInfoMapper.getCardExchangeCount(status,(page - 1) * limit, limit, receiveId);
+        List<CardExchangeInfo> list = cardExchangeInfoMapper.getCardExchangeInfoPage(status,(page - 1) * limit, limit, receiveId);
+        if (!CollectionUtils.isEmpty(list)){
+            for (CardExchangeInfo cardExchangeInfo:list){
+                CardManagementInfo cardManagementInfo = cardManagementInfoMapper.selectById(cardExchangeInfo.getSendCardId());
+                if (cardManagementInfo != null) {
+                    cardExchangeInfo.setCardManagementInfo(cardManagementInfo);
+                }
+            }
+        }
+        return new Page<CardExchangeInfo>(list, page, limit, count);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean delete(String id) {
+        String[] ids = String.valueOf(id).split(",");
+        for (String tt : ids) {
+            CardExchangeInfo tmp = cardExchangeInfoMapper.selectById(Long.parseLong(tt));
+            if (tmp != null) {
+                tmp.setDeleteFlag(1L);
+                cardExchangeInfoMapper.updateById(tmp);
+            }
+        }
+        return true;
+    }
+
+    @Override
+    public Boolean update(CardExchangeInfo cardExchangeInfo, String updateFlag) throws ServiceException {
+        Date now = new Date();
+        cardExchangeInfo.setGmtUpdate(now);
+        //拉黑
+        if ("1".equals(updateFlag)) {
+            cardExchangeInfo.setStatus("7");
+        }
+        //拒绝
+        else if ("2".equals(updateFlag)) {
+            cardExchangeInfo.setStatus("3");
+        }
+        //接受
+        else if ("3".equals(updateFlag)) {
+            cardExchangeInfo.setStatus("1");
+            //接收人名片夹添加数据
+            CardHolderInfo cardHolderInfo = new CardHolderInfo();
+            cardHolderInfo.setCardId(String.valueOf(cardExchangeInfo.getSendCardId()));
+            CardManagementInfo cardManagementInfo = cardManagementInfoMapper.selectById(cardExchangeInfo.getSendCardId());
+            //查看发起人名片是否删除
+            if (cardManagementInfo.getCommonId() == -1) {
+                throw new AppServiceException(ExceptionDefinition.ACCEPT_CARD_ERROR);
+            }
+            cardHolderInfo.setCommonId(cardExchangeInfo.getReceiveId());
+            cardHolderInfo.setGmtCreate(now);
+            cardHolderInfo.setGmtUpdate(now);
+            cardHolderInfoMapper.insert(cardHolderInfo);
+            //发起人名片夹添加数据
+            cardHolderInfo = new CardHolderInfo();
+            cardHolderInfo.setCardId(String.valueOf(cardExchangeInfo.getReceiveCardId()));
+            cardHolderInfo.setCommonId(cardExchangeInfo.getSendId());
+            cardHolderInfo.setGmtCreate(now);
+            cardHolderInfo.setGmtUpdate(now);
+            cardHolderInfoMapper.insert(cardHolderInfo);
+        }
+        //移除
+        else {
+            cardExchangeInfo.setStatus("0");
+        }
+        return cardExchangeInfoMapper.updateById(cardExchangeInfo) > 0;
+    }
+
+    @Override
+    public CardExchangeInfo get(Long id) throws ServiceException {
+        return cardExchangeInfoMapper.selectById(id);
+    }
+
+    @Override
+    public String export(Long sendId, Long receiveId, Long sendCardId, Long receiveCardId, String circleName, String status, Date gmtCreate, Date gmtUpdate, Long deleteFlag, Integer page, Integer limit) throws ServiceException {
+        Wrapper<CardExchangeInfo> wrapper = new EntityWrapper<CardExchangeInfo>();
+        if (!StringUtils.isEmpty(sendId)) {
+            wrapper.eq("send_id", sendId);
+        }
+        if (!StringUtils.isEmpty(receiveId)) {
+            wrapper.eq("receive_id", receiveId);
+        }
+        if (!StringUtils.isEmpty(sendCardId)) {
+            wrapper.eq("send_card_id", sendCardId);
+        }
+        if (!StringUtils.isEmpty(receiveCardId)) {
+            wrapper.eq("receive_card_id", receiveCardId);
+        }
+        if (!StringUtils.isEmpty(circleName)) {
+            wrapper.eq("circle_name", circleName);
+        }
+        if (!StringUtils.isEmpty(status)) {
+            wrapper.eq("status", status);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        List<CardExchangeInfo> list = cardExchangeInfoMapper.selectList(wrapper);
+        ExcelUtil<CardExchangeInfo> util = new ExcelUtil<CardExchangeInfo>(CardExchangeInfo.class);
+        return util.exportExcel(list, "操作日志");
+    }
+}

+ 153 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CardHolderInfoServiceImpl.java

@@ -0,0 +1,153 @@
+package com.iotechn.unimall.admin.api.card.impl;
+
+import java.util.List;
+
+import com.iotechn.unimall.data.domain.CardManagementInfo;
+import com.iotechn.unimall.data.domain.CommonUserInfo;
+import com.iotechn.unimall.data.domain.PersonalHomepageInfo;
+import com.iotechn.unimall.data.mapper.CardManagementInfoMapper;
+import com.iotechn.unimall.data.mapper.CommonUserInfoMapper;
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.util.ExcelUtil;
+import com.iotechn.unimall.data.mapper.CardHolderInfoMapper;
+import com.iotechn.unimall.data.domain.CardHolderInfo;
+import com.iotechn.unimall.admin.api.card.ICardHolderInfoService;
+import com.iotechn.unimall.data.model.Page;
+
+import java.util.Date;
+
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 名片夹Service业务层处理
+ *
+ * @author jlb
+ * @date 2023-04-10
+ */
+@Service
+public class CardHolderInfoServiceImpl implements ICardHolderInfoService {
+    @Autowired
+    private CardHolderInfoMapper cardHolderInfoMapper;
+    @Autowired
+    private CardManagementInfoMapper cardManagementInfoMapper;
+    @Autowired
+    private CommonUserInfoMapper commonUserInfoMapper;
+
+    @Override
+    public Boolean add(CardHolderInfo cardHolderInfo) throws ServiceException {
+        Date now = new Date();
+        cardHolderInfo.setGmtCreate(now);
+        cardHolderInfo.setGmtUpdate(now);
+        //个人展示的二维码 相互交换
+        if (cardHolderInfo.getCardCommonId() != null) {
+            CardHolderInfo cardHolderInfo1 = new CardHolderInfo();
+            cardHolderInfo1.setCardId(cardHolderInfo.getMyCardId());
+            cardHolderInfo1.setCommonId(cardHolderInfo.getCardCommonId());
+            cardHolderInfo1.setGmtCreate(now);
+            cardHolderInfo1.setGmtUpdate(now);
+            cardHolderInfoMapper.insert(cardHolderInfo1);
+        }
+        return cardHolderInfoMapper.insert(cardHolderInfo) > 0;
+    }
+
+    @Override
+    public Page<CardHolderInfo> list(Long commonId, String cardId, String classify, Date gmtCreate, Date gmtUpdate, Long deleteFlag, Integer page, Integer limit) throws ServiceException {
+        Wrapper<CardHolderInfo> wrapper = new EntityWrapper<CardHolderInfo>();
+        if (!StringUtils.isEmpty(commonId)) {
+            wrapper.eq("common_id", commonId);
+        }
+        if (!StringUtils.isEmpty(cardId)) {
+            wrapper.eq("card_id", cardId);
+        }
+        if (!StringUtils.isEmpty(classify)) {
+            wrapper.eq("classify", classify);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        wrapper.eq("delete_flag", 0);
+        List<CardHolderInfo> list = cardHolderInfoMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+        if (!CollectionUtils.isEmpty(list)) {
+            for (CardHolderInfo cardHolderInfo : list) {
+                CardManagementInfo cardManagementInfo = cardManagementInfoMapper.selectById(cardHolderInfo.getCardId());
+                if (cardManagementInfo != null) {
+                    cardHolderInfo.setCardManagementInfo(cardManagementInfo);
+                }
+                //查看是否允许分享
+                CommonUserInfo commonUserInfo = commonUserInfoMapper.selectById(cardHolderInfo.getCommonId());
+                if (commonUserInfo != null) {
+                    cardHolderInfo.setShareCard(commonUserInfo.getShareCard());
+                }
+            }
+        }
+        Integer count = cardHolderInfoMapper.selectCount(wrapper);
+        return new Page<CardHolderInfo>(list, page, limit, count);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean delete(String id) {
+        String[] ids = String.valueOf(id).split(",");
+        for (String tt : ids) {
+            CardHolderInfo tmp = cardHolderInfoMapper.selectById(Long.parseLong(tt));
+            if (tmp != null) {
+                tmp.setDeleteFlag(1l);
+                tmp.setGmtUpdate(new Date());
+                cardHolderInfoMapper.updateById(tmp);
+            }
+        }
+        return true;
+    }
+
+    @Override
+    public Boolean update(CardHolderInfo cardHolderInfo) throws ServiceException {
+        Date now = new Date();
+        cardHolderInfo.setGmtUpdate(now);
+        return cardHolderInfoMapper.updateById(cardHolderInfo) > 0;
+    }
+
+    @Override
+    public CardHolderInfo get(Long id) throws ServiceException {
+        return cardHolderInfoMapper.selectById(id);
+    }
+
+    @Override
+    public String export(Long commonId, String cardId, String classify, Date gmtCreate, Date gmtUpdate, Long deleteFlag, Integer page, Integer limit) throws ServiceException {
+        Wrapper<CardHolderInfo> wrapper = new EntityWrapper<CardHolderInfo>();
+        if (!StringUtils.isEmpty(commonId)) {
+            wrapper.eq("common_id", commonId);
+        }
+        if (!StringUtils.isEmpty(cardId)) {
+            wrapper.eq("card_id", cardId);
+        }
+        if (!StringUtils.isEmpty(classify)) {
+            wrapper.eq("classify", classify);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        List<CardHolderInfo> list = cardHolderInfoMapper.selectList(wrapper);
+        ExcelUtil<CardHolderInfo> util = new ExcelUtil<CardHolderInfo>(CardHolderInfo.class);
+        return util.exportExcel(list, "操作日志");
+    }
+}

+ 237 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CardManagementInfoServiceImpl.java

@@ -0,0 +1,237 @@
+package com.iotechn.unimall.admin.api.card.impl;
+
+import java.util.List;
+
+import com.iotechn.unimall.core.util.GeneratorUtil;
+import com.iotechn.unimall.data.util.QRCodeUtil;
+import com.iotechn.unimall.data.domain.*;
+import com.iotechn.unimall.data.mapper.CardHolderInfoMapper;
+import com.iotechn.unimall.data.mapper.CircleCardInfoMapper;
+import com.iotechn.unimall.data.mapper.PersonalHomepageInfoMapper;
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.util.ExcelUtil;
+import com.iotechn.unimall.data.mapper.CardManagementInfoMapper;
+import com.iotechn.unimall.admin.api.card.ICardManagementInfoService;
+import com.iotechn.unimall.data.model.Page;
+
+import java.util.Date;
+
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 名片管理Service业务层处理
+ *
+ * @author jlb
+ * @date 2023-04-10
+ */
+@Service
+public class CardManagementInfoServiceImpl implements ICardManagementInfoService {
+    @Autowired
+    private CardManagementInfoMapper cardManagementInfoMapper;
+    @Autowired
+    private QRCodeUtil qrCodeUtil;
+    @Autowired
+    private CircleCardInfoMapper circleCardInfoMapper;
+    @Autowired
+    private CardHolderInfoMapper cardHolderInfoMapper;
+    @Autowired
+    private PersonalHomepageInfoMapper personalHomepageInfoMapper;
+
+    @Override
+    public Boolean add(CardManagementInfo cardManagementInfo) throws ServiceException {
+        Date now = new Date();
+        cardManagementInfo.setGmtCreate(now);
+        cardManagementInfo.setGmtUpdate(now);
+        cardManagementInfoMapper.insert(cardManagementInfo);
+        //更新数据库默认值
+        cardManagementInfo = cardManagementInfoMapper.selectById(cardManagementInfo.getId());
+        //二维码
+        String str = qrCodeUtil.getQRCodeImage(String.valueOf(cardManagementInfo.getId()), false, cardManagementInfo.getName(), GeneratorUtil.genUUId());
+        String str1 = qrCodeUtil.getQRCodeImage(cardManagementInfo.getId() + "," + cardManagementInfo.getCommonId(), false, cardManagementInfo.getName(), GeneratorUtil.genUUId());
+        cardManagementInfo.setQrCode(str);
+        cardManagementInfo.setQrCodeMyself(str1);
+        return cardManagementInfoMapper.updateById(cardManagementInfo) > 0;
+    }
+
+    @Override
+    public Page<CardManagementInfo> list(Long commonId, String cardBusiness, String name, String post, String companyName, String location, String detailedAddress, String phone, String headSculpture, String qrCode, Date gmtCreate, Date gmtUpdate, Long deleteFlag, Integer page, Integer limit) throws ServiceException {
+        Wrapper<CardManagementInfo> wrapper = new EntityWrapper<CardManagementInfo>();
+        if (!StringUtils.isEmpty(commonId)) {
+            wrapper.eq("common_id", commonId);
+        }
+        if (!StringUtils.isEmpty(cardBusiness)) {
+            wrapper.eq("card_business", cardBusiness);
+        }
+        if (!StringUtils.isEmpty(name)) {
+            wrapper.eq("name", name);
+        }
+        if (!StringUtils.isEmpty(post)) {
+            wrapper.eq("post", post);
+        }
+        if (!StringUtils.isEmpty(companyName)) {
+            wrapper.eq("company_name", companyName);
+        }
+        if (!StringUtils.isEmpty(location)) {
+            wrapper.eq("location", location);
+        }
+        if (!StringUtils.isEmpty(detailedAddress)) {
+            wrapper.eq("detailed_address", detailedAddress);
+        }
+        if (!StringUtils.isEmpty(phone)) {
+            wrapper.eq("phone", phone);
+        }
+        if (!StringUtils.isEmpty(headSculpture)) {
+            wrapper.eq("head_sculpture", headSculpture);
+        }
+        if (!StringUtils.isEmpty(qrCode)) {
+            wrapper.eq("qr_code", qrCode);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        wrapper.eq("delete_flag", 0).orderBy("top_marking", false);
+        List<CardManagementInfo> list = cardManagementInfoMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+        if (!CollectionUtils.isEmpty(list)) {
+            for (CardManagementInfo cardManagementInfo : list) {
+                PersonalHomepageInfo personalHomepageInfo = new PersonalHomepageInfo();
+                personalHomepageInfo.setCommonId(cardManagementInfo.getCommonId());
+                personalHomepageInfo.setDeleteFlag(0l);
+                PersonalHomepageInfo personalHomepageInfo1 = personalHomepageInfoMapper.selectOne(personalHomepageInfo);
+                if (personalHomepageInfo1 != null) {
+                    cardManagementInfo.setPersonalHomeId(personalHomepageInfo1.getId());
+                }
+            }
+        }
+        Integer count = cardManagementInfoMapper.selectCount(wrapper);
+        return new Page<CardManagementInfo>(list, page, limit, count);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean delete(String id, String deleteCondition) {
+        String[] ids = String.valueOf(id).split(",");
+        for (String tt : ids) {
+            CardManagementInfo tmp = cardManagementInfoMapper.selectById(Long.parseLong(tt));
+            if (tmp != null) {
+                //退出关联的圈子
+                List<CircleCardInfo> list = circleCardInfoMapper.selectList(new EntityWrapper<CircleCardInfo>()
+                        .eq("card_id", tmp.getId())
+                        .eq("delete_flag", 0));
+                if (!CollectionUtils.isEmpty(list)) {
+                    for (CircleCardInfo aa : list) {
+                        aa.setDeleteFlag(1l);
+                        aa.setGmtUpdate(new Date());
+                        circleCardInfoMapper.updateById(aa);
+                    }
+                }
+                //从所有拥有此名片用户列表删除
+                if ("1".equals(deleteCondition)) {
+                    List<CardHolderInfo> cardHolderInfoList = cardHolderInfoMapper.selectList(new EntityWrapper<CardHolderInfo>()
+                            .eq("card_id", tmp.getId())
+                            .eq("delete_flag", 0));
+                    if (!CollectionUtils.isEmpty(cardHolderInfoList)) {
+                        for (CardHolderInfo aa : cardHolderInfoList) {
+                            aa.setDeleteFlag(1l);
+                            aa.setGmtUpdate(new Date());
+                            cardHolderInfoMapper.updateById(aa);
+                        }
+                    }
+                }
+                tmp.setCommonId(-1l);
+                tmp.setGmtUpdate(new Date());
+                cardManagementInfoMapper.updateById(tmp);
+            }
+        }
+        return true;
+    }
+
+    @Override
+    public Boolean update(CardManagementInfo cardManagementInfo) throws ServiceException {
+        Date now = new Date();
+        cardManagementInfo.setGmtUpdate(now);
+        return cardManagementInfoMapper.updateById(cardManagementInfo) > 0;
+    }
+
+    @Override
+    public Boolean top(CardManagementInfo cardManagementInfo) throws ServiceException {
+        CardManagementInfo cardManagementInfo1 = cardManagementInfoMapper.selectById(cardManagementInfo.getId());
+        List<CardManagementInfo> cardManagementInfoList = cardManagementInfoMapper.selectList(new EntityWrapper<CardManagementInfo>()
+                .eq("common_id", cardManagementInfo1.getCommonId())
+                .eq("delete_flag", 0));
+        if (!CollectionUtils.isEmpty(cardManagementInfoList)) {
+            for (CardManagementInfo aa : cardManagementInfoList) {
+                aa.setTopMarking(0l);
+                cardManagementInfoMapper.updateById(aa);
+            }
+        }
+        cardManagementInfo1.setTopMarking(1l);
+        cardManagementInfo1.setGmtUpdate(new Date());
+        return cardManagementInfoMapper.updateById(cardManagementInfo1) > 0;
+    }
+
+    @Override
+    public CardManagementInfo get(Long id) throws ServiceException {
+        return cardManagementInfoMapper.selectById(id);
+    }
+
+    @Override
+    public String export(Long commonId, String cardBusiness, String name, String post, String companyName, String location, String detailedAddress, String phone, String headSculpture, String qrCode, Date gmtCreate, Date gmtUpdate, Long deleteFlag, Integer page, Integer limit) throws ServiceException {
+        Wrapper<CardManagementInfo> wrapper = new EntityWrapper<CardManagementInfo>();
+        if (!StringUtils.isEmpty(commonId)) {
+            wrapper.eq("common_id", commonId);
+        }
+        if (!StringUtils.isEmpty(cardBusiness)) {
+            wrapper.eq("card_business", cardBusiness);
+        }
+        if (!StringUtils.isEmpty(name)) {
+            wrapper.eq("name", name);
+        }
+        if (!StringUtils.isEmpty(post)) {
+            wrapper.eq("post", post);
+        }
+        if (!StringUtils.isEmpty(companyName)) {
+            wrapper.eq("company_name", companyName);
+        }
+        if (!StringUtils.isEmpty(location)) {
+            wrapper.eq("location", location);
+        }
+        if (!StringUtils.isEmpty(detailedAddress)) {
+            wrapper.eq("detailed_address", detailedAddress);
+        }
+        if (!StringUtils.isEmpty(phone)) {
+            wrapper.eq("phone", phone);
+        }
+        if (!StringUtils.isEmpty(headSculpture)) {
+            wrapper.eq("head_sculpture", headSculpture);
+        }
+        if (!StringUtils.isEmpty(qrCode)) {
+            wrapper.eq("qr_code", qrCode);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        List<CardManagementInfo> list = cardManagementInfoMapper.selectList(wrapper);
+        ExcelUtil<CardManagementInfo> util = new ExcelUtil<CardManagementInfo>(CardManagementInfo.class);
+        return util.exportExcel(list, "操作日志");
+    }
+}

+ 267 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CertificateManagementInfoServiceImpl.java

@@ -0,0 +1,267 @@
+package com.iotechn.unimall.admin.api.card.impl;
+
+import java.util.*;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.iotechn.unimall.data.dto.DistinguishView;
+import com.iotechn.unimall.data.util.HttpUtils;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.util.EntityUtils;
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.util.ExcelUtil;
+import com.iotechn.unimall.data.mapper.CertificateManagementInfoMapper;
+import com.iotechn.unimall.data.domain.CertificateManagementInfo;
+import com.iotechn.unimall.admin.api.card.ICertificateManagementInfoService;
+import com.iotechn.unimall.data.model.Page;
+import java.util.Date;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 证件管理Service业务层处理
+ *
+ * @author jlb
+ * @date 2023-04-10
+ */
+@Service
+public class CertificateManagementInfoServiceImpl implements ICertificateManagementInfoService {
+	@Autowired
+	private CertificateManagementInfoMapper certificateManagementInfoMapper;
+
+	@Override
+	public Boolean add(CertificateManagementInfo certificateManagementInfo) throws ServiceException {
+		Date now = new Date();
+		certificateManagementInfo.setGmtCreate(now);
+		certificateManagementInfo.setGmtUpdate(now);
+		return certificateManagementInfoMapper.insert(certificateManagementInfo) > 0;
+	}
+
+	@Override
+	public Page<CertificateManagementInfo> list(Long commonId, String certificateName, String certificateImage, Date gmtCreate, Date gmtUpdate, Long deleteFlag, Integer page, Integer limit) throws ServiceException {
+		Wrapper<CertificateManagementInfo> wrapper = new EntityWrapper<CertificateManagementInfo>();
+		if (!StringUtils.isEmpty(commonId)) {
+			wrapper.eq("common_id", commonId);
+		}
+		if (!StringUtils.isEmpty(certificateName)) {
+			wrapper.eq("certificate_name", certificateName);
+		}
+		if (!StringUtils.isEmpty(certificateImage)) {
+			wrapper.eq("certificate_image", certificateImage);
+		}
+		if (!StringUtils.isEmpty(gmtCreate)) {
+			wrapper.eq("gmt_create", gmtCreate);
+		}
+		if (!StringUtils.isEmpty(gmtUpdate)) {
+			wrapper.eq("gmt_update", gmtUpdate);
+		}
+		if (!StringUtils.isEmpty(deleteFlag)) {
+			wrapper.eq("delete_flag", deleteFlag);
+		}
+		wrapper.eq("delete_flag", 0);
+		List<CertificateManagementInfo> list = certificateManagementInfoMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+		Integer count = certificateManagementInfoMapper.selectCount(wrapper);
+		return new Page<CertificateManagementInfo>(list, page, limit, count);
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public Boolean delete(String id) {
+		String[] ids = String.valueOf(id).split(",");
+		for (String tt : ids) {
+			CertificateManagementInfo tmp = certificateManagementInfoMapper.selectById(Long.parseLong(tt));
+			if (tmp != null) {
+				tmp.setDeleteFlag(1l);
+				tmp.setGmtUpdate(new Date());
+				certificateManagementInfoMapper.updateById(tmp);
+			}
+		}
+		return true;
+	}
+
+	@Override
+	public Boolean update(CertificateManagementInfo certificateManagementInfo) throws ServiceException {
+		Date now = new Date();
+		certificateManagementInfo.setGmtUpdate(now);
+		return certificateManagementInfoMapper.updateById(certificateManagementInfo) > 0;
+	}
+
+	@Override
+	public CertificateManagementInfo get(Long id) throws ServiceException {
+		return certificateManagementInfoMapper.selectById(id);
+	}
+
+	@Override
+	public String export(Long commonId, String certificateName, String certificateImage, Date gmtCreate, Date gmtUpdate, Long deleteFlag, Integer page, Integer limit) throws ServiceException {
+		Wrapper<CertificateManagementInfo> wrapper = new EntityWrapper<CertificateManagementInfo>();
+		if (!StringUtils.isEmpty(commonId)) {
+			wrapper.eq("common_id", commonId);
+		}
+		if (!StringUtils.isEmpty(certificateName)) {
+			wrapper.eq("certificate_name", certificateName);
+		}
+		if (!StringUtils.isEmpty(certificateImage)) {
+			wrapper.eq("certificate_image", certificateImage);
+		}
+		if (!StringUtils.isEmpty(gmtCreate)) {
+			wrapper.eq("gmt_create", gmtCreate);
+		}
+		if (!StringUtils.isEmpty(gmtUpdate)) {
+			wrapper.eq("gmt_update", gmtUpdate);
+		}
+		if (!StringUtils.isEmpty(deleteFlag)) {
+			wrapper.eq("delete_flag", deleteFlag);
+		}
+		List<CertificateManagementInfo> list = certificateManagementInfoMapper.selectList(wrapper);
+		ExcelUtil<CertificateManagementInfo> util = new ExcelUtil<CertificateManagementInfo>(CertificateManagementInfo.class);
+		return util.exportExcel(list, "操作日志");
+	}
+
+	@Override
+	public DistinguishView personShibie(String certificateImage) throws ServiceException {
+		String appcode = "2d59bfa794994f5f94d1d98b7b5bd102";
+		//API产品路径
+		String requestUrl = "https://personcard.market.alicloudapi.com/ai_market/ai_ocr_universal/shen_fen_zheng/ch/v1";
+		//阿里云APPCODE
+		DistinguishView distinguishView = new DistinguishView();
+		CloseableHttpClient httpClient = null;
+		try {
+			httpClient = HttpClients.createDefault();
+			List<NameValuePair> params = new ArrayList<NameValuePair>();
+			//启用URL方式进行识别
+			//内容数据类型是图像文件URL链接
+			params.add(new BasicNameValuePair("IMAGE", certificateImage));
+			params.add(new BasicNameValuePair("IMAGE_TYPE", "1"));
+
+			// 创建一个HttpPost实例
+			HttpPost httpPost = new HttpPost(requestUrl);
+			httpPost.addHeader("Authorization", "APPCODE " + appcode);
+			httpPost.addHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
+
+			// 设置请求参数
+			httpPost.setEntity(new UrlEncodedFormEntity(params, "utf-8"));
+
+			// 发送POST请求
+			HttpResponse execute = httpClient.execute(httpPost);
+
+			// 获取状态码
+			int statusCode = execute.getStatusLine().getStatusCode();
+			System.out.println(statusCode);
+
+			// 获取结果
+			HttpEntity entity = execute.getEntity();
+			String body = EntityUtils.toString(entity);
+			System.out.println(body);
+			JSONObject jsonObject = JSONObject.parseObject(body);
+			distinguishView.setRecPersonNo(jsonObject.getJSONObject("身份证识别实体信息").getJSONObject("身份证人像面实体信息").getString("身份证号"));
+			return distinguishView;
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+
+	@Override
+	public DistinguishView bankShibie(String certificateImage) throws ServiceException {
+		String appcode = "2d59bfa794994f5f94d1d98b7b5bd102";
+		String host = "https://api06.aliyun.venuscn.com";
+		String path = "/ocr/bank-card";
+		String method = "POST";
+		Map<String, String> headers = new HashMap<String, String>();
+		//最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105
+		headers.put("Authorization", "APPCODE " + appcode);
+		//根据API的要求,定义相对应的Content-Type
+		headers.put("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
+		Map<String, String> querys = new HashMap<String, String>();
+		Map<String, String> bodys = new HashMap<String, String>();
+		bodys.put("pic", certificateImage);
+		try {
+			HttpResponse response = HttpUtils.doPost(host, path, method, headers, querys, bodys);
+			String body = EntityUtils.toString(response.getEntity());
+			System.out.println(body);
+			JSONObject jsonObject = JSONObject.parseObject(body);
+			if ("200".equals(jsonObject.getString("ret"))) {
+				JSONObject data = JSONObject.parseObject(jsonObject.getString("data"));
+				DistinguishView distinguishView = new DistinguishView();
+				distinguishView.setBankNo(data.getString("number"));
+
+				host = "https://yhkgsd.market.alicloudapi.com";
+				path = "/bankcard/region";
+				method = "GET";
+				headers = new HashMap<String, String>();
+				//最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105
+				headers.put("Authorization", "APPCODE " + appcode);
+				querys = new HashMap<String, String>();
+				querys.put("bankcard", distinguishView.getBankNo());
+				try {
+					response = HttpUtils.doGet(host, path, method, headers, querys);
+					body = EntityUtils.toString(response.getEntity());
+					System.out.println(body);
+					jsonObject = JSONObject.parseObject(body);
+					if ("0".equals(jsonObject.getString("code"))) {
+						data = JSONObject.parseObject(jsonObject.getString("data"));
+						JSONObject detail = JSONObject.parseObject(data.getString("detail"));
+						String[] area = detail.getString("area").split(" - ");
+						String province = "";
+						String city = "";
+						if (area.length > 1) {
+							province = area[0];
+							city = area[1];
+						}
+
+						host = "https://cnaps.market.alicloudapi.com";
+						path = "/lianzhuo/querybankaps";
+						method = "GET";
+						headers = new HashMap<String, String>();
+						//最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105
+						headers.put("Authorization", "APPCODE " + appcode);
+						querys = new HashMap<String, String>();
+						querys.put("card", distinguishView.getBankNo());
+						querys.put("province", province);
+						querys.put("city", city);
+						try {
+							response = HttpUtils.doGet(host, path, method, headers, querys);
+							System.out.println(response.toString());
+							body = EntityUtils.toString(response.getEntity());
+							System.out.println(body);
+							jsonObject = JSONObject.parseObject(body);
+							JSONObject jsonData = jsonObject.getJSONObject("data");
+							JSONObject res = jsonObject.getJSONObject("resp");
+							if ("200".equals(res.get("RespCode"))) {
+								JSONArray jsonArray = jsonData.getJSONArray("record");
+								List<String> bankList = new ArrayList<>();
+								for (int i = 0; i < jsonArray.size(); i++) {
+									bankList.add(jsonArray.getJSONObject(i).get("lName").toString());
+								}
+							}
+						} catch (Exception e) {
+							e.printStackTrace();
+						}
+					}
+				} catch (Exception e) {
+					e.printStackTrace();
+				}
+				return distinguishView;
+			} else {
+				System.out.println(jsonObject.getString("msg"));
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+}
+

+ 121 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CircleCardInfoServiceImpl.java

@@ -0,0 +1,121 @@
+package com.iotechn.unimall.admin.api.card.impl;
+
+import java.util.List;
+
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.util.ExcelUtil;
+import com.iotechn.unimall.data.mapper.CircleCardInfoMapper;
+import com.iotechn.unimall.data.domain.CircleCardInfo;
+import com.iotechn.unimall.admin.api.card.ICircleCardInfoService;
+import com.iotechn.unimall.data.model.Page;
+
+import java.util.Date;
+
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 圈子个人关系Service业务层处理
+ *
+ * @author jlb
+ * @date 2023-04-10
+ */
+@Service
+public class CircleCardInfoServiceImpl implements ICircleCardInfoService {
+    @Autowired
+    private CircleCardInfoMapper circleCardInfoMapper;
+
+    @Override
+    public Boolean add(CircleCardInfo circleCardInfo) throws ServiceException {
+        Date now = new Date();
+        circleCardInfo.setGmtCreate(now);
+        circleCardInfo.setGmtUpdate(now);
+        return circleCardInfoMapper.insert(circleCardInfo) > 0;
+    }
+
+    @Override
+    public Page<CircleCardInfo> list(Long circleId, Long cardId, Long commonId, Date gmtCreate, Date gmtUpdate, Long deleteFlag, Integer page, Integer limit) throws ServiceException {
+        Wrapper<CircleCardInfo> wrapper = new EntityWrapper<CircleCardInfo>();
+        if (!StringUtils.isEmpty(circleId)) {
+            wrapper.eq("circle_id", circleId);
+        }
+        if (!StringUtils.isEmpty(cardId)) {
+            wrapper.eq("card_id", cardId);
+        }
+        if (!StringUtils.isEmpty(commonId)) {
+            wrapper.eq("common_id", commonId);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        wrapper.eq("delete_flag", 0);
+        List<CircleCardInfo> list = circleCardInfoMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+        Integer count = circleCardInfoMapper.selectCount(wrapper);
+        return new Page<CircleCardInfo>(list, page, limit, count);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean delete(String id) {
+        String[] ids = String.valueOf(id).split(",");
+        for (String tt : ids) {
+            CircleCardInfo tmp = circleCardInfoMapper.selectById(Long.parseLong(tt));
+            if (tmp != null) {
+                tmp.setDeleteFlag(1l);
+                tmp.setGmtUpdate(new Date());
+                circleCardInfoMapper.updateById(tmp);
+            }
+        }
+        return true;
+    }
+
+    @Override
+    public Boolean update(CircleCardInfo circleCardInfo) throws ServiceException {
+        Date now = new Date();
+        circleCardInfo.setGmtUpdate(now);
+        return circleCardInfoMapper.updateById(circleCardInfo) > 0;
+    }
+
+    @Override
+    public CircleCardInfo get(Long id) throws ServiceException {
+        return circleCardInfoMapper.selectById(id);
+    }
+
+    @Override
+    public String export(Long circleId, Long cardId, Long commonId, Date gmtCreate, Date gmtUpdate, Long deleteFlag, Integer page, Integer limit) throws ServiceException {
+        Wrapper<CircleCardInfo> wrapper = new EntityWrapper<CircleCardInfo>();
+        if (!StringUtils.isEmpty(circleId)) {
+            wrapper.eq("circle_id", circleId);
+        }
+        if (!StringUtils.isEmpty(cardId)) {
+            wrapper.eq("card_id", cardId);
+        }
+        if (!StringUtils.isEmpty(commonId)) {
+            wrapper.eq("common_id", commonId);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        List<CircleCardInfo> list = circleCardInfoMapper.selectList(wrapper);
+        ExcelUtil<CircleCardInfo> util = new ExcelUtil<CircleCardInfo>(CircleCardInfo.class);
+        return util.exportExcel(list, "操作日志");
+    }
+}

+ 180 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CircleManagementInfoServiceImpl.java

@@ -0,0 +1,180 @@
+package com.iotechn.unimall.admin.api.card.impl;
+
+import java.util.*;
+
+import com.iotechn.unimall.data.domain.*;
+import com.iotechn.unimall.data.mapper.*;
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.util.ExcelUtil;
+import com.iotechn.unimall.admin.api.card.ICircleManagementInfoService;
+import com.iotechn.unimall.data.model.Page;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 圈子管理Service业务层处理
+ *
+ * @author jlb
+ * @date 2023-04-10
+ */
+@Service
+public class CircleManagementInfoServiceImpl implements ICircleManagementInfoService {
+    @Autowired
+    private CircleManagementInfoMapper circleManagementInfoMapper;
+    @Autowired
+    private CircleCardInfoMapper circleCardInfoMapper;
+    @Autowired
+    private CardManagementInfoMapper cardManagementInfoMapper;
+    @Autowired
+    private CommonUserInfoMapper commonUserInfoMapper;
+    @Autowired
+    private CardHolderInfoMapper cardHolderInfoMapper;
+    @Autowired
+    private CardExchangeInfoMapper cardExchangeInfoMapper;
+
+    @Override
+    public Boolean add(CircleManagementInfo circleManagementInfo) throws ServiceException {
+        Date now = new Date();
+        circleManagementInfo.setGmtCreate(now);
+        circleManagementInfo.setGmtUpdate(now);
+        //添加圈子状态默认未审核
+        circleManagementInfo.setStatus(0l);
+        return circleManagementInfoMapper.insert(circleManagementInfo) > 0;
+    }
+
+    @Override
+    public Page<CircleManagementInfo> list(Long commonId, String circleName, String circleLabel, Long status, Date gmtCreate, Date gmtUpdate, Long deleteFlag, Integer page, Integer limit) throws ServiceException {
+        Wrapper<CircleManagementInfo> wrapper = new EntityWrapper<CircleManagementInfo>();
+        if (!StringUtils.isEmpty(circleName)) {
+            wrapper.like("circle_name", circleName);
+        }
+        if (!StringUtils.isEmpty(circleLabel)) {
+            wrapper.eq("circle_label", circleLabel);
+        }
+        if (!StringUtils.isEmpty(status)) {
+            wrapper.eq("status", status);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        wrapper.eq("delete_flag", 0);
+        List<CircleManagementInfo> list = circleManagementInfoMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+        if (!CollectionUtils.isEmpty(list)) {
+            for (CircleManagementInfo circleManagementInfo : list) {
+                List<CircleCardInfo> circleCardInfoList = circleCardInfoMapper.selectList(new EntityWrapper<CircleCardInfo>()
+                        .eq("circle_id", circleManagementInfo.getId())
+                        .eq("delete_flag", 0));
+                circleManagementInfo.setCardNum(circleCardInfoList.size());
+                List<CircleCardInfo> circleCardInfoList1 = circleCardInfoMapper.selectList(new EntityWrapper<CircleCardInfo>()
+                        .eq("circle_id", circleManagementInfo.getId())
+                        .eq("common_id",commonId)
+                        .eq("delete_flag", 0));
+                if (circleCardInfoList1.size()>0){
+                    circleManagementInfo.setAddedFlag(1l);
+                } else {
+                    circleManagementInfo.setAddedFlag(0l);
+                }
+            }
+        }
+        Collections.sort(list, new Comparator<CircleManagementInfo>() {
+            @Override
+            public int compare(CircleManagementInfo o1, CircleManagementInfo o2) {
+                return o1.getAddedFlag() > o2.getAddedFlag() ? -1 : (o1.getAddedFlag() == o2.getAddedFlag()) ? 0 : 1;
+            }
+        });
+        Integer count = circleManagementInfoMapper.selectCount(wrapper);
+        return new Page<CircleManagementInfo>(list, page, limit, count);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean delete(String id) {
+        String[] ids = String.valueOf(id).split(",");
+        for (String tt : ids) {
+            CircleManagementInfo tmp = circleManagementInfoMapper.selectById(Long.parseLong(tt));
+            if (tmp != null) {
+                tmp.setDeleteFlag(1l);
+                tmp.setGmtUpdate(new Date());
+                circleManagementInfoMapper.updateById(tmp);
+            }
+        }
+        return true;
+    }
+
+    @Override
+    public Boolean update(CircleManagementInfo circleManagementInfo) throws ServiceException {
+        Date now = new Date();
+        circleManagementInfo.setGmtUpdate(now);
+        return circleManagementInfoMapper.updateById(circleManagementInfo) > 0;
+    }
+
+    @Override
+    public CircleManagementInfo get(Long id, Long commonId) throws ServiceException {
+        CircleManagementInfo circleManagementInfo = circleManagementInfoMapper.selectById(id);
+        CircleCardInfo circleCardInfo = new CircleCardInfo();
+        circleCardInfo.setCommonId(commonId);
+        circleCardInfo.setCircleId(circleManagementInfo.getId());
+        circleCardInfo.setDeleteFlag(0l);
+        CircleCardInfo circleCardInfo1 = circleCardInfoMapper.selectOne(circleCardInfo);
+        //我加入该圈子的名片
+        if (circleCardInfo1 != null) {
+            circleManagementInfo.setCircleCardInfo(circleCardInfo1);
+        }
+        List<CircleCardInfo> circleCardInfoList = circleCardInfoMapper.selectList(new EntityWrapper<CircleCardInfo>()
+                .eq("circle_id", circleManagementInfo.getId())
+                .eq("delete_flag", 0));
+        circleManagementInfo.setCardNum(circleCardInfoList.size());
+        return circleManagementInfo;
+    }
+
+    @Override
+    public Page<CardManagementInfo> circleCardlist(Long commonId, Long id, String status, Integer page, Integer limit) throws ServiceException {
+        Wrapper<CardManagementInfo> wrapper = new EntityWrapper<CardManagementInfo>();
+        wrapper.eq("delete_flag", 0);
+        Integer count = cardManagementInfoMapper.getCardManagementCount(status,(page - 1) * limit, limit, commonId,id);
+        List<CardManagementInfo> list = cardManagementInfoMapper.getCardManagementPage(status,(page - 1) * limit, limit, commonId,id);
+        return new Page<CardManagementInfo>(list, page, limit, count);
+    }
+
+    @Override
+    public String export(Long commonId, String circleName, String circleLabel, Long status, Date gmtCreate, Date gmtUpdate, Long deleteFlag, Integer page, Integer limit) throws ServiceException {
+        Wrapper<CircleManagementInfo> wrapper = new EntityWrapper<CircleManagementInfo>();
+        if (!StringUtils.isEmpty(commonId)) {
+            wrapper.eq("common_id", commonId);
+        }
+        if (!StringUtils.isEmpty(circleName)) {
+            wrapper.eq("circle_name", circleName);
+        }
+        if (!StringUtils.isEmpty(circleLabel)) {
+            wrapper.eq("circle_label", circleLabel);
+        }
+        if (!StringUtils.isEmpty(status)) {
+            wrapper.eq("status", status);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        List<CircleManagementInfo> list = circleManagementInfoMapper.selectList(wrapper);
+        ExcelUtil<CircleManagementInfo> util = new ExcelUtil<CircleManagementInfo>(CircleManagementInfo.class);
+        return util.exportExcel(list, "操作日志");
+    }
+}

+ 151 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CommonUserInfoServiceImpl.java

@@ -0,0 +1,151 @@
+package com.iotechn.unimall.admin.api.card.impl;
+
+import java.util.List;
+
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.util.ExcelUtil;
+import com.iotechn.unimall.data.mapper.CommonUserInfoMapper;
+import com.iotechn.unimall.data.domain.CommonUserInfo;
+import com.iotechn.unimall.admin.api.card.ICommonUserInfoService;
+import com.iotechn.unimall.data.model.Page;
+
+import java.util.Date;
+
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 用户管理Service业务层处理
+ *
+ * @author jlb
+ * @date 2023-04-10
+ */
+@Service
+public class CommonUserInfoServiceImpl implements ICommonUserInfoService {
+    @Autowired
+    private CommonUserInfoMapper commonUserInfoMapper;
+
+    @Override
+    public Boolean add(CommonUserInfo commonUserInfo) throws ServiceException {
+        Date now = new Date();
+        commonUserInfo.setGmtCreate(now);
+        commonUserInfo.setGmtUpdate(now);
+        return commonUserInfoMapper.insert(commonUserInfo) > 0;
+    }
+
+    @Override
+    public Page<CommonUserInfo> list(String nickname, String password, String phone, String realname, Long shareCard, Long lookPage, Long autoAccept, Long status, Date gmtCreate, Date gmtUpdate, Long deleteFlag, Integer page, Integer limit) throws ServiceException {
+        Wrapper<CommonUserInfo> wrapper = new EntityWrapper<CommonUserInfo>();
+        if (!StringUtils.isEmpty(nickname)) {
+            wrapper.eq("nickname", nickname);
+        }
+        if (!StringUtils.isEmpty(password)) {
+            wrapper.eq("password", password);
+        }
+        if (!StringUtils.isEmpty(phone)) {
+            wrapper.eq("phone", phone);
+        }
+        if (!StringUtils.isEmpty(realname)) {
+            wrapper.eq("realname", realname);
+        }
+        if (!StringUtils.isEmpty(shareCard)) {
+            wrapper.eq("share_card", shareCard);
+        }
+        if (!StringUtils.isEmpty(lookPage)) {
+            wrapper.eq("look_page", lookPage);
+        }
+        if (!StringUtils.isEmpty(autoAccept)) {
+            wrapper.eq("auto_accept", autoAccept);
+        }
+        if (!StringUtils.isEmpty(status)) {
+            wrapper.eq("status", status);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        wrapper.eq("delete_flag", 0);
+        List<CommonUserInfo> list = commonUserInfoMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+        Integer count = commonUserInfoMapper.selectCount(wrapper);
+        return new Page<CommonUserInfo>(list, page, limit, count);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean delete(String id) {
+        String[] ids = String.valueOf(id).split(",");
+        for (String tt : ids) {
+            CommonUserInfo tmp = commonUserInfoMapper.selectById(Long.parseLong(tt));
+            if (tmp != null) {
+                tmp.setDeleteFlag(1L);
+                tmp.setGmtUpdate(new Date());
+                commonUserInfoMapper.updateById(tmp);
+            }
+        }
+        return true;
+    }
+
+    @Override
+    public Boolean update(CommonUserInfo commonUserInfo) throws ServiceException {
+        Date now = new Date();
+        commonUserInfo.setGmtUpdate(now);
+        return commonUserInfoMapper.updateById(commonUserInfo) > 0;
+    }
+
+    @Override
+    public CommonUserInfo get(Long id) throws ServiceException {
+        return commonUserInfoMapper.selectById(id);
+    }
+
+    @Override
+    public String export(String nickname, String password, String phone, String realname, Long shareCard, Long lookPage, Long autoAccept, Long status, Date gmtCreate, Date gmtUpdate, Long deleteFlag, Integer page, Integer limit) throws ServiceException {
+        Wrapper<CommonUserInfo> wrapper = new EntityWrapper<CommonUserInfo>();
+        if (!StringUtils.isEmpty(nickname)) {
+            wrapper.eq("nickname", nickname);
+        }
+        if (!StringUtils.isEmpty(password)) {
+            wrapper.eq("password", password);
+        }
+        if (!StringUtils.isEmpty(phone)) {
+            wrapper.eq("phone", phone);
+        }
+        if (!StringUtils.isEmpty(realname)) {
+            wrapper.eq("realname", realname);
+        }
+        if (!StringUtils.isEmpty(shareCard)) {
+            wrapper.eq("share_card", shareCard);
+        }
+        if (!StringUtils.isEmpty(lookPage)) {
+            wrapper.eq("look_page", lookPage);
+        }
+        if (!StringUtils.isEmpty(autoAccept)) {
+            wrapper.eq("auto_accept", autoAccept);
+        }
+        if (!StringUtils.isEmpty(status)) {
+            wrapper.eq("status", status);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        List<CommonUserInfo> list = commonUserInfoMapper.selectList(wrapper);
+        ExcelUtil<CommonUserInfo> util = new ExcelUtil<CommonUserInfo>(CommonUserInfo.class);
+        return util.exportExcel(list, "操作日志");
+    }
+}

+ 157 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/PersonalHomepageInfoServiceImpl.java

@@ -0,0 +1,157 @@
+package com.iotechn.unimall.admin.api.card.impl;
+
+import java.util.List;
+
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.util.ExcelUtil;
+import com.iotechn.unimall.data.mapper.PersonalHomepageInfoMapper;
+import com.iotechn.unimall.data.domain.PersonalHomepageInfo;
+import com.iotechn.unimall.admin.api.card.IPersonalHomepageInfoService;
+import com.iotechn.unimall.data.model.Page;
+
+import java.util.Date;
+
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 个人主页Service业务层处理
+ *
+ * @author jlb
+ * @date 2023-04-10
+ */
+@Service
+public class PersonalHomepageInfoServiceImpl implements IPersonalHomepageInfoService {
+    @Autowired
+    private PersonalHomepageInfoMapper personalHomepageInfoMapper;
+
+    @Override
+    public Boolean add(PersonalHomepageInfo personalHomepageInfo) throws ServiceException {
+        Date now = new Date();
+        personalHomepageInfo.setGmtCreate(now);
+        personalHomepageInfo.setGmtUpdate(now);
+        return personalHomepageInfoMapper.insert(personalHomepageInfo) > 0;
+    }
+
+    @Override
+    public Page<PersonalHomepageInfo> list(Long commonId, String companyName, String companyIntroduction, String scopeOfBusiness, String companyAddress, String phone, String portraiture, String postbox, String addressUrl, Date gmtCreate, Date gmtUpdate, Long deleteFlag, Integer page, Integer limit) throws ServiceException {
+        Wrapper<PersonalHomepageInfo> wrapper = new EntityWrapper<PersonalHomepageInfo>();
+        if (!StringUtils.isEmpty(commonId)) {
+            wrapper.eq("common_id", commonId);
+        }
+        if (!StringUtils.isEmpty(companyName)) {
+            wrapper.eq("company_name", companyName);
+        }
+        if (!StringUtils.isEmpty(companyIntroduction)) {
+            wrapper.eq("company_introduction", companyIntroduction);
+        }
+        if (!StringUtils.isEmpty(scopeOfBusiness)) {
+            wrapper.eq("scope_of_business", scopeOfBusiness);
+        }
+        if (!StringUtils.isEmpty(companyAddress)) {
+            wrapper.eq("company_address", companyAddress);
+        }
+        if (!StringUtils.isEmpty(phone)) {
+            wrapper.eq("phone", phone);
+        }
+        if (!StringUtils.isEmpty(portraiture)) {
+            wrapper.eq("portraiture", portraiture);
+        }
+        if (!StringUtils.isEmpty(postbox)) {
+            wrapper.eq("postbox", postbox);
+        }
+        if (!StringUtils.isEmpty(addressUrl)) {
+            wrapper.eq("address_url", addressUrl);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        wrapper.eq("delete_flag", 0);
+        List<PersonalHomepageInfo> list = personalHomepageInfoMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+        Integer count = personalHomepageInfoMapper.selectCount(wrapper);
+        return new Page<PersonalHomepageInfo>(list, page, limit, count);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean delete(String id) {
+        String[] ids = String.valueOf(id).split(",");
+        for (String tt : ids) {
+            PersonalHomepageInfo tmp = personalHomepageInfoMapper.selectById(Long.parseLong(tt));
+            if (tmp != null) {
+                tmp.setDeleteFlag(1l);
+                tmp.setGmtUpdate(new Date());
+                personalHomepageInfoMapper.updateById(tmp);
+            }
+        }
+        return true;
+    }
+
+    @Override
+    public Boolean update(PersonalHomepageInfo personalHomepageInfo) throws ServiceException {
+        Date now = new Date();
+        personalHomepageInfo.setGmtUpdate(now);
+        return personalHomepageInfoMapper.updateById(personalHomepageInfo) > 0;
+    }
+
+    @Override
+    public PersonalHomepageInfo get(Long id) throws ServiceException {
+        return personalHomepageInfoMapper.selectById(id);
+    }
+
+    @Override
+    public String export(Long commonId, String companyName, String companyIntroduction, String scopeOfBusiness, String companyAddress, String phone, String portraiture, String postbox, String addressUrl, Date gmtCreate, Date gmtUpdate, Long deleteFlag, Integer page, Integer limit) throws ServiceException {
+        Wrapper<PersonalHomepageInfo> wrapper = new EntityWrapper<PersonalHomepageInfo>();
+        if (!StringUtils.isEmpty(commonId)) {
+            wrapper.eq("common_id", commonId);
+        }
+        if (!StringUtils.isEmpty(companyName)) {
+            wrapper.eq("company_name", companyName);
+        }
+        if (!StringUtils.isEmpty(companyIntroduction)) {
+            wrapper.eq("company_introduction", companyIntroduction);
+        }
+        if (!StringUtils.isEmpty(scopeOfBusiness)) {
+            wrapper.eq("scope_of_business", scopeOfBusiness);
+        }
+        if (!StringUtils.isEmpty(companyAddress)) {
+            wrapper.eq("company_address", companyAddress);
+        }
+        if (!StringUtils.isEmpty(phone)) {
+            wrapper.eq("phone", phone);
+        }
+        if (!StringUtils.isEmpty(portraiture)) {
+            wrapper.eq("portraiture", portraiture);
+        }
+        if (!StringUtils.isEmpty(postbox)) {
+            wrapper.eq("postbox", postbox);
+        }
+        if (!StringUtils.isEmpty(addressUrl)) {
+            wrapper.eq("address_url", addressUrl);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        List<PersonalHomepageInfo> list = personalHomepageInfoMapper.selectList(wrapper);
+        ExcelUtil<PersonalHomepageInfo> util = new ExcelUtil<PersonalHomepageInfo>(PersonalHomepageInfo.class);
+        return util.exportExcel(list, "操作日志");
+    }
+}

+ 138 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/SearchRecordsInfoServiceImpl.java

@@ -0,0 +1,138 @@
+package com.iotechn.unimall.admin.api.card.impl;
+
+import java.util.List;
+
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.util.ExcelUtil;
+import com.iotechn.unimall.data.mapper.SearchRecordsInfoMapper;
+import com.iotechn.unimall.data.domain.SearchRecordsInfo;
+import com.iotechn.unimall.admin.api.card.ISearchRecordsInfoService;
+import com.iotechn.unimall.data.model.Page;
+
+import java.util.Date;
+
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 搜索记录Service业务层处理
+ *
+ * @author searchRecordsInfo
+ * @date 2023-04-10
+ */
+@Service
+public class SearchRecordsInfoServiceImpl implements ISearchRecordsInfoService {
+    @Autowired
+    private SearchRecordsInfoMapper searchRecordsInfoMapper;
+
+    @Override
+    public Boolean add(SearchRecordsInfo searchRecordsInfo) throws ServiceException {
+        Date now = new Date();
+        searchRecordsInfo.setGmtCreate(now);
+        searchRecordsInfo.setGmtUpdate(now);
+        List<SearchRecordsInfo> searchRecordsInfos=searchRecordsInfoMapper.selectList(new EntityWrapper<SearchRecordsInfo>()
+                .eq("common_id",searchRecordsInfo.getCommonId())
+                .eq("function_type",searchRecordsInfo.getFunctionType())
+                .eq("search_content",searchRecordsInfo.getSearchContent())
+                .eq("delete_flag",0));
+        //已有搜索记录不新增
+        if (searchRecordsInfos.size()>0){
+            searchRecordsInfos.get(0).setGmtUpdate(now);
+            return searchRecordsInfoMapper.updateById(searchRecordsInfo) > 0;
+        }
+        else {
+            return searchRecordsInfoMapper.insert(searchRecordsInfo) > 0;
+        }
+    }
+
+    @Override
+    public Page<SearchRecordsInfo> list(Long commonId, String searchContent, String functionType, Date gmtCreate, Date gmtUpdate, Long deleteFlag, Integer page, Integer limit) throws ServiceException {
+        Wrapper<SearchRecordsInfo> wrapper = new EntityWrapper<SearchRecordsInfo>();
+        if (!StringUtils.isEmpty(commonId)) {
+            wrapper.eq("common_id", commonId);
+        }
+        if (!StringUtils.isEmpty(searchContent)) {
+            wrapper.eq("search_content", searchContent);
+        }
+        if (!StringUtils.isEmpty(functionType)) {
+            wrapper.eq("function_type", functionType);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        wrapper.eq("delete_flag", 0);
+        wrapper.orderBy("gmt_update", false);
+        List<SearchRecordsInfo> list = searchRecordsInfoMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+        Integer count = searchRecordsInfoMapper.selectCount(wrapper);
+        return new Page<SearchRecordsInfo>(list, page, limit, count);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean delete(SearchRecordsInfo searchRecordsInfo) {
+        List<SearchRecordsInfo> searchRecordsInfos=searchRecordsInfoMapper.selectList(new EntityWrapper<SearchRecordsInfo>()
+                .eq("common_id",searchRecordsInfo.getCommonId())
+                .eq("function_type",searchRecordsInfo.getFunctionType())
+                .eq("delete_flag",0));
+        //清空搜索记录
+        if (!CollectionUtils.isEmpty(searchRecordsInfos)){
+            for (SearchRecordsInfo searchRecordsInfo1:searchRecordsInfos){
+                searchRecordsInfo1.setDeleteFlag(1l);
+                searchRecordsInfo1.setGmtUpdate(new Date());
+                searchRecordsInfoMapper.updateById(searchRecordsInfo1);
+            }
+        }
+        return true;
+    }
+
+    @Override
+    public Boolean update(SearchRecordsInfo searchRecordsInfo) throws ServiceException {
+        Date now = new Date();
+        searchRecordsInfo.setGmtUpdate(now);
+        return searchRecordsInfoMapper.updateById(searchRecordsInfo) > 0;
+    }
+
+    @Override
+    public SearchRecordsInfo get(Long id) throws ServiceException {
+        return searchRecordsInfoMapper.selectById(id);
+    }
+
+    @Override
+    public String export(Long commonId, String searchContent, String functionType, Date gmtCreate, Date gmtUpdate, Long deleteFlag, Integer page, Integer limit) throws ServiceException {
+        Wrapper<SearchRecordsInfo> wrapper = new EntityWrapper<SearchRecordsInfo>();
+        if (!StringUtils.isEmpty(commonId)) {
+            wrapper.eq("common_id", commonId);
+        }
+        if (!StringUtils.isEmpty(searchContent)) {
+            wrapper.eq("search_content", searchContent);
+        }
+        if (!StringUtils.isEmpty(functionType)) {
+            wrapper.eq("function_type", functionType);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        List<SearchRecordsInfo> list = searchRecordsInfoMapper.selectList(wrapper);
+        ExcelUtil<SearchRecordsInfo> util = new ExcelUtil<SearchRecordsInfo>(SearchRecordsInfo.class);
+        return util.exportExcel(list, "操作日志");
+    }
+}

+ 62 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/category/AdminCategoryService.java

@@ -0,0 +1,62 @@
+package com.iotechn.unimall.admin.api.category;
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.annotation.param.Range;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.CategoryDO;
+import com.iotechn.unimall.data.dto.CategoryDTO;
+import com.iotechn.unimall.data.dto.CategoryTreeNodeDTO;
+import com.iotechn.unimall.data.model.Page;
+
+import java.util.List;
+
+/**
+ * Created by rize on 2019/7/12.
+ */
+@HttpOpenApi(group = "admin.category", description = "类目管理服务")
+public interface AdminCategoryService {
+
+    @HttpMethod(description = "获取二级类目树")
+    public List<CategoryTreeNodeDTO> categorySecondLevelTree() throws ServiceException;
+
+    @HttpMethod(description = "获取类目树")
+    public List<CategoryTreeNodeDTO> categoryTree() throws ServiceException;
+
+    @HttpMethod(description = "创建", permission = "operation:category:create", permissionParentName = "商品管理", permissionName = "类目管理")
+    public CategoryDO addCategory(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
+            @NotNull @HttpParam(name = "title", type = HttpParamType.COMMON, description = "类目标题") String title,
+            @HttpParam(name = "parentId", type = HttpParamType.COMMON, description = "类目父节点", valueDef = "0") Long parentId,
+            @HttpParam(name = "iconUrl", type = HttpParamType.COMMON, description = "类目图标") String iconUrl,
+            @HttpParam(name = "picUrl", type = HttpParamType.COMMON, description = "类目图片") String picUrl,
+            @HttpParam(name = "level", type = HttpParamType.COMMON, description = "类目等级") Integer level) throws ServiceException;
+
+    @HttpMethod(description = "删除", permission = "operation:category:delete", permissionParentName = "商品管理", permissionName = "类目管理")
+    public boolean deleteCategory(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
+            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "类目ID") Long id) throws ServiceException;
+
+    @HttpMethod(description = "修改", permission = "operation:category:update", permissionParentName = "商品管理", permissionName = "类目管理")
+    public CategoryTreeNodeDTO updateCategory(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
+            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "类目ID") Long id,
+            @NotNull @HttpParam(name = "title", type = HttpParamType.COMMON, description = "类目标题") String title,
+            @NotNull @HttpParam(name = "parentId", type = HttpParamType.COMMON, description = "类目父节点") Long parentId,
+            @HttpParam(name = "iconUrl", type = HttpParamType.COMMON, description = "类目图标") String iconUrl,
+            @HttpParam(name = "picUrl", type = HttpParamType.COMMON, description = "类目图片") String picUrl,
+            @HttpParam(name = "level", type = HttpParamType.COMMON, description = "类目等级") Integer level) throws ServiceException;
+
+    @HttpMethod(description = "查询", permission = "operation:category:query", permissionParentName = "商品管理", permissionName = "类目管理")
+    public Page<CategoryTreeNodeDTO> queryCategory(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
+            @HttpParam(name = "id", type = HttpParamType.COMMON, description = "类目ID") Long id,
+            @HttpParam(name = "title", type = HttpParamType.COMMON, description = "类目标题") String title,
+            @HttpParam(name = "level", type = HttpParamType.COMMON, description = "类目等级") Integer level,
+            @HttpParam(name = "parentId", type = HttpParamType.COMMON, description = "父类目id") Long parentId,
+            @Range(min = 1) @HttpParam(name = "pageNo", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer pageNo,
+            @Range(min = 1) @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "10") Integer limit) throws ServiceException;
+}

+ 304 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/category/AdminCategoryServiceImpl.java

@@ -0,0 +1,304 @@
+package com.iotechn.unimall.admin.api.category;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.iotechn.unimall.biz.service.category.CategoryBizService;
+import com.iotechn.unimall.core.exception.*;
+import com.iotechn.unimall.data.component.CacheComponent;
+import com.iotechn.unimall.data.domain.CategoryDO;
+import com.iotechn.unimall.data.domain.SpuDO;
+import com.iotechn.unimall.data.dto.CategoryTreeNodeDTO;
+import com.iotechn.unimall.data.mapper.CategoryMapper;
+import com.iotechn.unimall.data.mapper.SpuMapper;
+import com.iotechn.unimall.data.model.Page;
+import com.iotechn.unimall.plugin.core.inter.IPluginUpdateCategory;
+import com.iotechn.unimall.plugin.core.manager.PluginsManager;
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * Created by rize on 2019/7/12.
+ */
+@Service
+public class AdminCategoryServiceImpl implements AdminCategoryService {
+
+    @Autowired
+    private CategoryMapper categoryMapper;
+
+    @Autowired
+    private SpuMapper spuMapper;
+
+    @Autowired
+    private CategoryBizService categoryBizService;
+
+    @Autowired
+    private CacheComponent cacheComponent;
+
+    @Autowired
+    private PluginsManager pluginsManager;
+
+    private static final String CA_CATEGORY_TREE = "CA_CATEGORY_TREE";
+
+    private static final String ADMIN_QUERY_CATEGORY_LIST = "ADMIN_QUERY_CATEGORY_LIST";
+
+    private static final String CA_CATEGORY_SECOND_LEVEL_TREE = "CA_CATEGORY_SECOND_LEVEL_TREE";
+
+    /**
+     * @return
+     * @throws ServiceException
+     */
+
+
+    /*获取两级目录树*/
+    public List<CategoryTreeNodeDTO> categorySecondLevelTree() throws ServiceException {
+        List<CategoryTreeNodeDTO> objList = cacheComponent.getObjList(CA_CATEGORY_SECOND_LEVEL_TREE, CategoryTreeNodeDTO.class);
+        if (objList != null) {
+            return objList;
+        }
+        List<CategoryTreeNodeDTO> list = categoryBizService.categorySecondLevelTree();
+        cacheComponent.putObj(CA_CATEGORY_SECOND_LEVEL_TREE, list, 60 * 60);
+        return list;
+    }
+
+
+    /*获取三级目录树。*/
+    //TODO 做下优化
+    @Override
+    public List<CategoryTreeNodeDTO> categoryTree() throws ServiceException {
+        List<CategoryTreeNodeDTO> objList = cacheComponent.getObjList(CA_CATEGORY_TREE, CategoryTreeNodeDTO.class);
+        if (objList != null) {
+            return objList;
+        }
+        List<CategoryDO> categoryDOS = categoryMapper.selectList(new EntityWrapper<>());
+        List<CategoryTreeNodeDTO> list = categoryDOS.stream().filter((item) -> (item.getParentId().equals(0l))).map(item -> {
+            CategoryTreeNodeDTO dto = new CategoryTreeNodeDTO();
+            dto.setLabel(item.getTitle());
+            dto.setLevel(0);
+            dto.setFullName(dto.getLabel());
+            dto.setValue(item.getId());
+            dto.setChildren(new LinkedList<>());
+            return dto;
+        }).collect(Collectors.toList());
+        list.forEach(item -> {
+            categoryDOS.forEach(categoryDO -> {
+                if (categoryDO.getParentId().equals(item.getValue())) {
+                    CategoryTreeNodeDTO categoryTreeNodeDTO = new CategoryTreeNodeDTO();
+                    categoryTreeNodeDTO.setChildren(new LinkedList<>());
+                    categoryTreeNodeDTO.setValue(categoryDO.getId());
+                    categoryTreeNodeDTO.setLabel(categoryDO.getTitle());
+                    categoryTreeNodeDTO.setLevel(1);
+                    categoryTreeNodeDTO.setParent(item.getValue());
+                    categoryTreeNodeDTO.setFullName(item.getFullName() + "/" + categoryDO.getTitle());
+                    item.getChildren().add(categoryTreeNodeDTO);
+                    categoryDOS.forEach(subCategoryDO -> {
+                        if (subCategoryDO.getParentId().equals(categoryTreeNodeDTO.getValue())) {
+                            CategoryTreeNodeDTO childCategoryNodeDTO = new CategoryTreeNodeDTO();
+                            childCategoryNodeDTO.setLabel(subCategoryDO.getTitle());
+                            childCategoryNodeDTO.setValue(subCategoryDO.getId());
+                            childCategoryNodeDTO.setLevel(2);
+                            childCategoryNodeDTO.setParent(categoryTreeNodeDTO.getValue());
+                            childCategoryNodeDTO.setFullName(categoryTreeNodeDTO.getFullName() + "/" + subCategoryDO.getTitle());
+                            categoryTreeNodeDTO.getChildren().add(childCategoryNodeDTO);
+                        }
+                    });
+                }
+            });
+        });
+        cacheComponent.putObj(CA_CATEGORY_TREE, list, 60 * 60);
+        return list;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public CategoryDO addCategory(Long adminId, String title, Long parentId, String iconUrl, String picUrl, Integer level) throws ServiceException {
+        CategoryDO parent = null;
+        CategoryDO categoryDO = new CategoryDO();
+        if (!parentId.equals(0l)) {
+            parent = categoryMapper.selectById(parentId);
+            if (parent == null) {
+                throw new AdminServiceException(ExceptionDefinition.PARENT_NODE_INFORMATION_ERROR);
+            }
+            categoryDO.setLevel(parent.getLevel() + 1);
+        } else {
+            categoryDO.setLevel(0);
+        }
+        categoryDO.setParentId(parentId);
+        categoryDO.setIconUrl(iconUrl);
+        categoryDO.setPicUrl(picUrl);
+        categoryDO.setTitle(title);
+        Date now = new Date();
+        categoryDO.setGmtCreate(now);
+        categoryDO.setGmtUpdate(now);
+
+        if (categoryMapper.insert(categoryDO) <= 0) {
+            throw new AdminServiceException(ExceptionDefinition.DATABASE_INSERT_FAILURE);
+        }
+        cacheComponent.del(CA_CATEGORY_TREE);
+        cacheComponent.del(ADMIN_QUERY_CATEGORY_LIST);
+        cacheComponent.del(CA_CATEGORY_SECOND_LEVEL_TREE);
+        cacheComponent.del(CategoryBizService.CA_CATEGORY_ID_HASH);
+        cacheComponent.del(CategoryBizService.CA_CATEGORY_LIST);
+        pluginInvokeUpdateCategory(categoryDO.getId());
+        return categoryDO;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public boolean deleteCategory(Long adminId, Long id) throws ServiceException {
+        Integer count_category = categoryMapper.selectCount(new EntityWrapper<CategoryDO>().eq("parent_id", id));
+        Integer count_spu = spuMapper.selectCount(new EntityWrapper<SpuDO>().eq("category_id", id));
+
+        if (count_category != 0 || count_spu != 0) {
+            throw new AppServiceException(ExceptionDefinition.CATEGORY_OUGHT_TO_EMPTY);
+        }
+        cacheComponent.del(CA_CATEGORY_TREE);
+        cacheComponent.del(ADMIN_QUERY_CATEGORY_LIST);
+        cacheComponent.del(CA_CATEGORY_SECOND_LEVEL_TREE);
+        cacheComponent.del(CategoryBizService.CA_CATEGORY_ID_HASH);
+        cacheComponent.del(CategoryBizService.CA_CATEGORY_LIST);
+        pluginInvokeUpdateCategory(id);
+        return categoryMapper.deleteById(id) > 0;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public CategoryTreeNodeDTO updateCategory(Long adminId, Long id, String title, Long parentId, String iconUrl, String picUrl, Integer level) throws ServiceException {
+        CategoryDO categoryDO = new CategoryDO();
+        if (id == null || parentId == null) {
+            throw new AdminServiceException(ExceptionDefinition.CATEGORY_OR_PARENT_NODE_IS_EMPTY);
+        }
+        categoryDO.setId(parentId);
+        CategoryDO categoryParent = categoryMapper.selectOne(categoryDO);
+
+        //传入父节点等于自身抛出异常
+        if (id.equals(parentId)) {
+            throw new AdminServiceException(ExceptionDefinition.PARENT_CAN_NOT_EQUALS_ONESELF);
+        }
+
+        if (categoryParent == null && !parentId.equals(0L)) {
+            throw new AdminServiceException(ExceptionDefinition.NOT_FIND_PARENT_NODE);
+        }
+        if (parentId.equals(0L)) {
+            categoryDO.setLevel(0);
+        } else {
+            categoryDO.setLevel(categoryParent.getLevel() + 1);
+        }
+        categoryDO.setId(id);
+        categoryDO.setGmtUpdate(new Date());
+        categoryDO.setParentId(parentId);
+        categoryDO.setTitle(title);
+        categoryDO.setPicUrl(picUrl);
+        categoryDO.setIconUrl(iconUrl);
+        if (categoryMapper.updateById(categoryDO) <= 0) {
+            throw new AdminServiceException(ExceptionDefinition.CATEGORY_UPDATE_FAILURE);
+        }
+        CategoryTreeNodeDTO categoryTreeNodeDTO = new CategoryTreeNodeDTO();
+        List<CategoryTreeNodeDTO> list = getCategoryList();
+        for (CategoryTreeNodeDTO temp : list) {
+            if (categoryDO.getId().equals(temp.getValue())) {
+                BeanUtils.copyProperties(temp, categoryTreeNodeDTO);
+                break;
+            }
+        }
+        cacheComponent.del(CA_CATEGORY_TREE);
+        cacheComponent.del(ADMIN_QUERY_CATEGORY_LIST);
+        cacheComponent.del(CA_CATEGORY_SECOND_LEVEL_TREE);
+        cacheComponent.del(CategoryBizService.CA_CATEGORY_ID_HASH);
+        cacheComponent.del(CategoryBizService.CA_CATEGORY_LIST);
+        pluginInvokeUpdateCategory(categoryDO.getId());
+        return categoryTreeNodeDTO;
+    }
+
+    //首先的到所有的类目的List<CategoryTreeNodeDTO>,在根据SQL查询得到的数据转化成传往前端的数据
+    @Override
+    public Page<CategoryTreeNodeDTO> queryCategory(Long adminId, Long id, String title, Integer level, Long parentId, Integer pageNo, Integer limit) throws ServiceException {
+        EntityWrapper wrapper = new EntityWrapper();
+        if (id != null) {
+            wrapper.eq("id", id);
+        }
+        if (title != null) {
+            wrapper.like("title", title);
+        }
+        if (level != null) {
+            wrapper.eq("level", level);
+        }
+        if (parentId != null) {
+            wrapper.eq("parent_id", parentId);
+        }
+        wrapper.orderBy("level");
+        Integer count = categoryMapper.selectCount(wrapper);
+
+        List<CategoryDO> categoryDOS = categoryMapper.selectPage(new RowBounds((pageNo - 1) * limit, limit), wrapper);
+        List<CategoryTreeNodeDTO> totalCategory = getCategoryList();
+        List<CategoryTreeNodeDTO> list = categoryDOS.stream().map(item -> {
+            CategoryTreeNodeDTO dto = new CategoryTreeNodeDTO();
+            for (CategoryTreeNodeDTO temp : totalCategory) {
+                if (temp.getValue().equals(item.getId())) {
+                    BeanUtils.copyProperties(temp, dto);
+                    return dto;
+                }
+            }
+            BeanUtils.copyProperties(item, dto);
+            ;
+            return dto;
+        }).collect(Collectors.toList());
+        Page<CategoryTreeNodeDTO> page = new Page<>(list, pageNo, limit, count);
+        return page;
+    }
+
+
+    //TODO 可以做出父节点查询所有子节点
+    //获得所有类目按类目等级排序的类目list,
+    private List<CategoryTreeNodeDTO> getCategoryList() {
+        List<CategoryTreeNodeDTO> objList = cacheComponent.getObjList(ADMIN_QUERY_CATEGORY_LIST, CategoryTreeNodeDTO.class);
+        if (objList != null) {
+            return objList;
+        }
+        EntityWrapper wrapper = new EntityWrapper();
+        wrapper.orderBy("level");
+        List<CategoryDO> categoryDOS = categoryMapper.selectList(wrapper);
+        List<CategoryTreeNodeDTO> list = categoryDOS.stream().map(item -> {
+            CategoryTreeNodeDTO dto = new CategoryTreeNodeDTO();
+            dto.setLabel(item.getTitle());
+            dto.setLevel(item.getLevel());
+            dto.setValue(item.getId());
+            dto.setParent(item.getParentId());
+            dto.setIconUrl(item.getIconUrl());
+            dto.setPicUrl(item.getPicUrl());
+            if (item.getLevel() == 0) {
+                dto.setFullName(dto.getLabel());
+            }
+            return dto;
+        }).collect(Collectors.toList());
+
+        for (CategoryTreeNodeDTO cOne : list) {
+
+            for (CategoryTreeNodeDTO cTwo : list) {
+                if (cOne.getParent().equals(cTwo.getValue())) {
+                    cOne.setFullName(cTwo.getFullName() + "/" + cOne.getLabel());
+                    break;
+                }
+            }
+
+        }
+        cacheComponent.putObj(ADMIN_QUERY_CATEGORY_LIST, list, 60 * 60);
+        return list;
+    }
+
+    private void pluginInvokeUpdateCategory(Long categoryId) {
+        List<IPluginUpdateCategory> plugins = pluginsManager.getPlugins(IPluginUpdateCategory.class);
+        if (!CollectionUtils.isEmpty(plugins)) {
+            for (IPluginUpdateCategory updateGoods : plugins) {
+                updateGoods.invokeCategoryUpdate(categoryId);
+            }
+        }
+    }
+
+
+}

+ 54 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/config/AdminMerchantConfigService.java

@@ -0,0 +1,54 @@
+package com.iotechn.unimall.admin.api.config;
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.annotation.param.Range;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.CategoryDO;
+import com.iotechn.unimall.data.domain.ConfigDO;
+import com.iotechn.unimall.data.dto.CategoryTreeNodeDTO;
+import com.iotechn.unimall.data.dto.ConfigDTO;
+import com.iotechn.unimall.data.model.Page;
+
+import java.util.List;
+
+/**
+ * Created with IntelliJ IDEA.
+ * Description:
+ * User: kbq
+ * Date: 2019-07-20
+ * Time: 上午10:18
+ */
+
+@HttpOpenApi(group = "admin.merchant", description = "商铺信息配置")
+public interface AdminMerchantConfigService {
+
+    @HttpMethod(description = "创建", permission = "promote:merchant:create", permissionParentName = "推广管理", permissionName = "商铺信息管理")
+    public boolean addMerchant(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
+            @NotNull @HttpParam(name = "title", type = HttpParamType.COMMON, description = "商铺标题") String title,
+            @HttpParam(name = "logoUrl", type = HttpParamType.COMMON, description = "商铺logo") String logoUrl,
+            @HttpParam(name = "description", type = HttpParamType.COMMON, description = "商铺描述") String description,
+            @HttpParam(name = "address", type = HttpParamType.COMMON, description = "商铺地址") String address,
+            @NotNull @HttpParam(name = "showType", type = HttpParamType.COMMON, description = "展示方式") Integer showType
+    ) throws ServiceException;
+
+    @HttpMethod(description = "修改", permission = "promote:merchant:update", permissionParentName = "推广管理", permissionName = "商铺信息管理")
+    public boolean updateMerchant(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
+            @NotNull @HttpParam(name = "title", type = HttpParamType.COMMON, description = "商铺标题") String title,
+            @HttpParam(name = "logoUrl", type = HttpParamType.COMMON, description = "商铺logo") String logoUrl,
+            @HttpParam(name = "description", type = HttpParamType.COMMON, description = "商铺描述") String description,
+            @HttpParam(name = "address", type = HttpParamType.COMMON, description = "商铺地址") String address,
+            @NotNull @HttpParam(name = "showType", type = HttpParamType.COMMON, description = "展示方式") Integer showType
+    ) throws ServiceException;
+
+    @HttpMethod(description = "查询", permission = "promote:merchant:query", permissionParentName = "推广管理", permissionName = "商铺信息管理")
+    public ConfigDTO getMerchant(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;
+
+
+}

+ 75 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/config/AdminMerchantConfigServiceImpl.java

@@ -0,0 +1,75 @@
+package com.iotechn.unimall.admin.api.config;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.iotechn.unimall.biz.service.config.ConfigBizService;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.ConfigDO;
+import com.iotechn.unimall.data.dto.ConfigDTO;
+import com.iotechn.unimall.data.mapper.ConfigMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
+
+/**
+ * Created with IntelliJ IDEA.
+ * Description:
+ * User: kbq
+ * Date: 2019-07-20
+ * Time: 上午10:47
+ */
+@Service
+public class AdminMerchantConfigServiceImpl implements AdminMerchantConfigService {
+
+    @Autowired
+    private ConfigMapper configMapper;
+
+    @Autowired
+    private ConfigBizService configBizService;
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public boolean addMerchant(Long adminId, String title, String logoUrl, String description, String address, Integer showType) throws ServiceException {
+        Date now = new Date();
+        ConfigDO titleDO = new ConfigDO("title",title);
+            titleDO.setGmtCreate(now);titleDO.setGmtUpdate(now);
+        ConfigDO logoDO = new ConfigDO("logoUrl",logoUrl);
+            logoDO.setGmtCreate(now);logoDO.setGmtUpdate(now);
+        ConfigDO descDO = new ConfigDO("description",description);
+            descDO.setGmtCreate(now);descDO.setGmtUpdate(now);
+        ConfigDO addressDO = new ConfigDO("address",address);
+            addressDO.setGmtCreate(now);addressDO.setGmtUpdate(now);
+        ConfigDO showTypeDO = new ConfigDO("showType",String.valueOf(showType));
+            showTypeDO.setGmtCreate(now);showTypeDO.setGmtUpdate(now);
+        configMapper.insert(titleDO);
+        configMapper.insert(logoDO);
+        configMapper.insert(descDO);
+        configMapper.insert(addressDO);
+        configMapper.insert(showTypeDO);
+        configBizService.clearMerchantConfigCache();
+        return true;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public boolean updateMerchant(Long adminId, String title, String logoUrl, String description, String address, Integer showType) throws ServiceException {
+        configMapper.update(new ConfigDO("title",title), new EntityWrapper<ConfigDO>().eq("key_word","title"));
+
+        configMapper.update(new ConfigDO("logoUrl",logoUrl), new EntityWrapper<ConfigDO>().eq("key_word","logoUrl"));
+
+        configMapper.update(new ConfigDO("description",description), new EntityWrapper<ConfigDO>().eq("key_word","description"));
+
+        configMapper.update(new ConfigDO("address",address), new EntityWrapper<ConfigDO>().eq("key_word","address"));
+
+        configMapper.update(new ConfigDO("showType",String.valueOf(showType)), new EntityWrapper<ConfigDO>().eq("key_word","showType"));
+
+        configBizService.clearMerchantConfigCache();
+        return true;
+    }
+
+    @Override
+    public ConfigDTO getMerchant(Long adminId) throws ServiceException {
+        return configBizService.getMerchantConfig();
+    }
+}

+ 82 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/coupon/AdminCouponService.java

@@ -0,0 +1,82 @@
+package com.iotechn.unimall.admin.api.coupon;
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.CouponDO;
+import com.iotechn.unimall.data.dto.CouponAdminDTO;
+import com.iotechn.unimall.data.dto.CouponDTO;
+import com.iotechn.unimall.data.model.Page;
+
+import java.util.Date;
+
+/**
+ * Created with IntelliJ IDEA.
+ * Description:
+ * User: kbq
+ * Date: 2019-07-12
+ * Time: 下午10:47
+ */
+
+@HttpOpenApi(group = "admin.coupon", description = "优惠卷")
+public interface AdminCouponService {
+
+    @HttpMethod(description = "创建", permission = "promote:coupon:create", permissionParentName = "推广管理", permissionName = "优惠管理")
+    public CouponDO addCoupon(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
+            @NotNull @HttpParam(name = "title", type = HttpParamType.COMMON, description = "优惠卷标题") String title,
+            @NotNull @HttpParam(name = "type", type = HttpParamType.COMMON, description = "优惠卷类别,如满减") Integer type,
+            @HttpParam(name = "description", type = HttpParamType.COMMON, description = "优惠卷描述") String description,
+            @NotNull @HttpParam(name = "total", type = HttpParamType.COMMON, description = "优惠卷总数") Integer total,
+            @NotNull @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "用户限制领取") Integer limit,
+            @NotNull @HttpParam(name = "discount", type = HttpParamType.COMMON, description = "优惠价格") Integer discount,
+            @NotNull @HttpParam(name = "min", type = HttpParamType.COMMON, description = "满足优惠的最低价格") Integer min,
+            @NotNull @HttpParam(name = "status", type = HttpParamType.COMMON, description = "优惠卷状态") Integer status,
+            @HttpParam(name = "categoryId", type = HttpParamType.COMMON, description = "优惠类别") Long categoryId,
+            @HttpParam(name = "days", type = HttpParamType.COMMON, description = "优惠时长") Integer days,
+            @HttpParam(name = "gmtStart", type = HttpParamType.COMMON, description = "优惠开始时间") Long gmtStart,
+            @HttpParam(name = "gmtEnd", type = HttpParamType.COMMON, description = "优惠结束时间") Long gmtEnd) throws ServiceException;
+
+    @HttpMethod(description = "删除", permission = "promote:coupon:delete", permissionParentName = "推广管理", permissionName = "优惠管理")
+    public Boolean deleteCoupon(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
+            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "优惠卷ID") Long id) throws ServiceException;
+
+    @HttpMethod(description = "修改", permission = "promote:coupon:update", permissionParentName = "推广管理", permissionName = "优惠管理")
+    public Boolean updateCoupon(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
+            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "优惠卷ID") Long id,
+            @NotNull @HttpParam(name = "title", type = HttpParamType.COMMON, description = "优惠卷标题") String title,
+            @NotNull @HttpParam(name = "type", type = HttpParamType.COMMON, description = "优惠卷类别,如满减") Integer type,
+            @HttpParam(name = "description", type = HttpParamType.COMMON, description = "优惠卷描述") String description,
+            @NotNull @HttpParam(name = "total", type = HttpParamType.COMMON, description = "优惠卷总数") Integer total,
+            @NotNull @HttpParam(name = "surplus", type = HttpParamType.COMMON, description = "优惠卷剩余") Integer surplus,
+            @NotNull @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "用户限制领取") Integer limit,
+            @NotNull @HttpParam(name = "discount", type = HttpParamType.COMMON, description = "优惠价格") Integer discount,
+            @NotNull @HttpParam(name = "min", type = HttpParamType.COMMON, description = "满足优惠的最低价格") Integer min,
+            @NotNull @HttpParam(name = "status", type = HttpParamType.COMMON, description = "优惠卷状态") Integer status,
+            @HttpParam(name = "categoryId", type = HttpParamType.COMMON, description = "优惠类别") Long categoryId,
+            @HttpParam(name = "days", type = HttpParamType.COMMON, description = "优惠时长") Integer days,
+            @HttpParam(name = "gmtStart", type = HttpParamType.COMMON, description = "优惠开始时间") Date gmtStart,
+            @HttpParam(name = "gmtEnd", type = HttpParamType.COMMON, description = "优惠结束时间") Date gmtEnd) throws ServiceException;
+
+    @HttpMethod(description = "修改", permission = "promote:coupon:update", permissionParentName = "推广管理", permissionName = "优惠管理")
+    public Boolean updateCouponStatus(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
+            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "优惠卷ID") Long id,
+            @NotNull @HttpParam(name = "status", type = HttpParamType.COMMON, description = "优惠卷状态") Integer status) throws ServiceException;
+
+
+    @HttpMethod(description = "查询", permission = "promote:coupon:query", permissionParentName = "推广管理", permissionName = "优惠管理")
+    public Page<CouponAdminDTO> queryCouponByTitle(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
+            @HttpParam(name = "title", type = HttpParamType.COMMON, description = "优惠卷标题") String title,
+            @HttpParam(name = "type", type = HttpParamType.COMMON, description = "优惠卷类型") Integer type,
+            @HttpParam(name = "status", type = HttpParamType.COMMON, description = "优惠卷状态") Integer status,
+            @HttpParam(name = "pageNo", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer pageNo,
+            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "10") Integer limit) throws ServiceException;
+
+}

+ 123 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/coupon/AdminCouponServiceImpl.java

@@ -0,0 +1,123 @@
+package com.iotechn.unimall.admin.api.coupon;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.iotechn.unimall.core.exception.AdminServiceException;
+import com.iotechn.unimall.core.exception.ExceptionDefinition;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.CouponDO;
+import com.iotechn.unimall.data.dto.CouponAdminDTO;
+import com.iotechn.unimall.data.mapper.CouponMapper;
+import com.iotechn.unimall.data.mapper.UserCouponMapper;
+import com.iotechn.unimall.data.model.Page;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Created with IntelliJ IDEA.
+ * Description:
+ * User: kbq
+ * Date: 2019-07-12
+ * Time: 下午11:26
+ */
+@Service
+public class AdminCouponServiceImpl implements AdminCouponService {
+
+    @Autowired
+    private CouponMapper couponMapper;
+
+    @Autowired
+    private UserCouponMapper userCouponMapper;
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public CouponDO addCoupon(Long adminId, String title, Integer type, String description, Integer total, Integer limit, Integer discount, Integer min, Integer status, Long categoryId, Integer days, Long gmtStart, Long gmtEnd) throws ServiceException {
+
+        Date start = null;
+        Date end = null;
+        if (gmtEnd != null && gmtStart != null) {
+            start = new Date(gmtStart);
+            end = new Date(gmtEnd);
+        }
+
+        CouponDO couponDO = new CouponDO(title, type, description, total, total, limit, discount, min, status, categoryId, days, start, end);
+
+        Date now = new Date();
+        couponDO.setGmtCreate(now);
+        couponDO.setGmtUpdate(now);
+        if (couponMapper.insert(couponDO) > 0) {
+            return couponDO;
+        }
+        throw new AdminServiceException(ExceptionDefinition.ADMIN_UNKNOWN_EXCEPTION);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean deleteCoupon(Long adminId, Long id) throws ServiceException {
+        EntityWrapper wrapperC = new EntityWrapper();
+        wrapperC.eq("id", id);
+        if (couponMapper.delete(wrapperC) <= 0) {
+            throw new AdminServiceException(ExceptionDefinition.ADMIN_UNKNOWN_EXCEPTION);
+        }
+        EntityWrapper wrapperUC = new EntityWrapper();
+        wrapperUC.eq("coupon_id", id);
+        userCouponMapper.delete(wrapperUC);
+        return true;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean updateCoupon(Long adminId, Long id, String title, Integer type, String description, Integer total, Integer surplus, Integer limit, Integer discount, Integer min, Integer status, Long categoryId, Integer days, Date gmtStart, Date gmtEnd) throws ServiceException {
+        CouponDO couponDO = new CouponDO(title, type, description, total, surplus, limit, discount, min, status, categoryId, days, gmtStart, gmtEnd);
+        couponDO.setId(id);
+        List<CouponDO> couponDOList = couponMapper.selectList(new EntityWrapper<CouponDO>().eq("id", id));
+        if (CollectionUtils.isEmpty(couponDOList)) {
+            throw new AdminServiceException(ExceptionDefinition.COUPON_NOT_EXIST);
+        }
+        Date now = new Date();
+        couponDO.setGmtCreate(couponDOList.get(0).getGmtCreate());
+        couponDO.setGmtUpdate(now);
+        return couponMapper.updateAllColumnById(couponDO) > 0;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean updateCouponStatus(Long adminId, Long id, Integer status) throws ServiceException {
+        CouponDO couponDO = new CouponDO();
+        couponDO.setId(id);
+        couponDO.setStatus(status);
+        couponDO.setGmtUpdate(new Date());
+        return couponMapper.updateById(couponDO) > 0;
+    }
+
+    @Override
+    public Page<CouponAdminDTO> queryCouponByTitle(Long adminId, String title, Integer type, Integer status, Integer pageNo, Integer limit) throws ServiceException {
+        EntityWrapper wrapper = new EntityWrapper();
+        Date now = new Date();
+        if (!StringUtils.isEmpty(title)) {
+            wrapper.like("title", title);
+        }
+        if (type != null) {
+            wrapper.eq("type", type);
+        }
+        if (status != null) {
+            if (status >= 0 && status < 2) {
+                wrapper.eq("status", status);
+                wrapper.andNew().gt("gmt_end", now).or().isNotNull("days"); //coupon -> conpon.gt("gmt_end", now).or().isNotNull("days")
+            } else if (status < 0) {
+                wrapper.lt("gmt_end", now);
+            } else {
+                throw new AdminServiceException(ExceptionDefinition.COUPON_CHECK_DATA_FAILED);
+            }
+        }
+        Integer count = couponMapper.selectCount(wrapper);
+        List<CouponAdminDTO> couponDTOList = couponMapper.getAdminCouponList(title, type, status, now, (pageNo - 1) * limit, limit);
+        Page<CouponAdminDTO> page = new Page<CouponAdminDTO>(couponDTOList, pageNo, limit, count);
+        return page;
+    }
+}

+ 20 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/dashboard/DashboardService.java

@@ -0,0 +1,20 @@
+package com.iotechn.unimall.admin.api.dashboard;
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+
+/**
+ * Created by rize on 2019/7/15.
+ */
+@HttpOpenApi(group = "admin.dashboard" , description = "首页数据服务")
+public interface DashboardService {
+
+    @HttpMethod(description = "聚合数据")
+    public Object integral(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员Id") Long adminId) throws ServiceException;
+
+}

+ 86 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/dashboard/DashboardServiceImpl.java

@@ -0,0 +1,86 @@
+package com.iotechn.unimall.admin.api.dashboard;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.OrderDO;
+import com.iotechn.unimall.data.domain.SpuDO;
+import com.iotechn.unimall.data.dto.DashboardIntegralDTO;
+import com.iotechn.unimall.data.enums.OrderStatusType;
+import com.iotechn.unimall.data.mapper.OrderMapper;
+import com.iotechn.unimall.data.mapper.SpuMapper;
+import com.iotechn.unimall.data.model.KVModel;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * Created by rize on 2019/7/15.
+ */
+@Service
+public class DashboardServiceImpl implements DashboardService {
+
+    @Autowired
+    private OrderMapper orderMapper;
+
+    @Autowired
+    private SpuMapper spuMapper;
+
+    @Override
+    public Object integral(Long adminId) throws ServiceException {
+        DashboardIntegralDTO dto = new DashboardIntegralDTO();
+        Integer orderWaitStock = orderMapper.selectCount(new EntityWrapper<OrderDO>().eq("status", OrderStatusType.WAIT_STOCK.getCode()));
+        Integer spuCount = spuMapper.selectCount(new EntityWrapper<SpuDO>());
+        List<KVModel<String, Long>> area = orderMapper.selectAreaStatistics();
+        List<KVModel<String, Long>> channel = orderMapper.selectChannelStatistics();
+        dto.setArea(area);
+        dto.setChannel(channel);
+        dto.setWaitStockCount(orderWaitStock);
+        dto.setGoodsCount(spuCount);
+        Integer days = 7;
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
+        String startDay = sdf.format(new Date(System.currentTimeMillis() - 1000l * 60 * 60 * 24 * days));
+        List<KVModel<String, Long>> orderCountKVList = orderMapper.selectOrderCountStatistics(startDay);
+        List<KVModel<String, Long>> orderSumKVList = orderMapper.selectOrderSumStatistics(startDay);
+        SimpleDateFormat sdfDay = new SimpleDateFormat("yyyy-MM-dd");
+        List<Object[]> orderCount = new LinkedList<>();
+        Object[] orderCountNameArray = new Object[days];
+        Object[] orderCountValueArray = new Object[days];
+        orderCount.add(orderCountNameArray);
+        orderCount.add(orderCountValueArray);
+        dto.setDaysOrder(orderCount);
+        List<Object[]> orderSum = new LinkedList<>();
+        Object[] orderSumNameArray = new Object[days];
+        Object[] orderSumValueArray = new Object[days];
+        orderSum.add(orderSumNameArray);
+        orderSum.add(orderSumValueArray);
+        dto.setDaysSum(orderSum);
+        //这里是在补全 group by 为 0 的情况
+        for (int i = 0; i < days; i++) {
+            Date date = new Date(System.currentTimeMillis() - 1000l * 60 * 60 * 24 * i);
+            String key = sdfDay.format(date);
+            int i1 = orderCountKVList.indexOf(new KVModel<>(key, null));
+            if (i1 >= 0) {
+                orderCountNameArray[days - i - 1] = key;
+                orderCountValueArray[days - i - 1] = orderCountKVList.get(i1).getValue();
+            } else {
+                orderCountNameArray[days - i - 1] = key;
+                orderCountValueArray[days - i - 1] = 0;
+            }
+
+            int i2 = orderSumKVList.indexOf(new KVModel<>(key, null));
+            if (i2 >= 0) {
+                orderSumNameArray[days - i - 1] = key;
+                orderSumValueArray[days - i - 1] = orderSumKVList.get(i2).getValue();
+            } else {
+                orderSumNameArray[days - i - 1] = key;
+                orderSumValueArray[days - i - 1] = 0;
+            }
+        }
+        return dto;
+    }
+}

+ 50 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/dict/DictDataService.java

@@ -0,0 +1,50 @@
+package com.iotechn.unimall.admin.api.dict;
+
+import java.util.List;
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.sys.dict.SysDictData;
+import com.iotechn.unimall.data.model.Page;
+
+@HttpOpenApi(group = "admin.dictData", description = "字典数据服务")
+public interface DictDataService {
+	@HttpMethod(description = "创建", permission = "admin:dictData:add", permissionParentName = "系统管理", permissionName = "字典管理")
+	public Boolean add(
+			@NotNull @HttpParam(name = "dictData", type = HttpParamType.COMMON, description = "字典信息") SysDictData dictData)
+			throws ServiceException;
+
+	@HttpMethod(description = "列表", permission = "admin:dictData:list", permissionParentName = "系统管理", permissionName = "字典管理")
+	public Page<SysDictData> list(
+			@HttpParam(name = "dictType", type = HttpParamType.COMMON, description = "字典类型") String dictType,
+			@HttpParam(name = "dictLabel", type = HttpParamType.COMMON, description = "字典标签") String dictLabel,
+			@HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态") String status,
+			@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+			@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+			throws ServiceException;
+
+	@HttpMethod(description = "删除", permission = "admin:dictData:delete", permissionParentName = "系统管理", permissionName = "字典管理")
+	public Boolean delete(
+			@NotNull @HttpParam(name = "dictCodes", type = HttpParamType.COMMON, description = "字典Id") String dictCodes)
+			throws ServiceException;
+
+	@HttpMethod(description = "修改", permission = "admin:dictData:update", permissionParentName = "系统管理", permissionName = "字典管理")
+	public Boolean update(
+			@NotNull @HttpParam(name = "dictData", type = HttpParamType.COMMON, description = "字典信息") SysDictData dictData)
+			throws ServiceException;
+
+	@HttpMethod(description = "查询", permission = "admin:dictData:get", permissionParentName = "系统管理", permissionName = "字典管理")
+	public SysDictData get(
+			@HttpParam(name = "dictCode", type = HttpParamType.COMMON, description = "字典ID") String dictCode)
+			throws ServiceException;
+
+	@HttpMethod(description = "根据字典类型查询所属数据", permission = "admin:dictData:selectDictDataByType", permissionParentName = "系统管理", permissionName = "字典管理")
+	public List<SysDictData> selectDictDataByType(
+			@HttpParam(name = "dictType", type = HttpParamType.COMMON, description = "字典类型") String dictType)
+			throws ServiceException;
+
+}

+ 77 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/dict/DictDataserviceImpl.java

@@ -0,0 +1,77 @@
+package com.iotechn.unimall.admin.api.dict;
+
+import java.util.List;
+
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.sys.dict.SysDictData;
+import com.iotechn.unimall.data.mapper.sys.dict.SysDictDataMapper;
+import com.iotechn.unimall.data.model.Page;
+/**
+ * 
+ * @author dyl
+ *
+ */
+@Service
+public class DictDataserviceImpl implements DictDataService{
+
+	@Autowired
+	private SysDictDataMapper dictDataMapper;
+	
+	@Override
+	public Boolean add(SysDictData dictData) throws ServiceException {
+		return dictDataMapper.insert(dictData)>0;
+	}
+
+	@Override
+	public Page<SysDictData> list(String dictType, String dictLabel, String status,Integer page, Integer limit)
+			throws ServiceException {
+		Wrapper<SysDictData> wrapper = new EntityWrapper<SysDictData>();
+		if (!StringUtils.isEmpty(dictType)) {
+			wrapper.eq("dict_type", dictType);
+		}
+		if (!StringUtils.isEmpty(dictType)) {
+			wrapper.like("dict_label", dictLabel);
+		}
+		if (!StringUtils.isEmpty(status)) {
+			wrapper.like("status", status);
+		}
+		List<SysDictData> SysDictDataS = dictDataMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+		Integer count = dictDataMapper.selectCount(wrapper);
+		return new Page<SysDictData>(SysDictDataS, page, limit, count);
+	}
+
+	@Override
+	public Boolean delete(String dictCodes) throws ServiceException {
+		String[] ids=dictCodes.split(",");
+		Wrapper<SysDictData> wrapper = new EntityWrapper<SysDictData>();
+		wrapper.in("dict_code", ids);
+		return dictDataMapper.delete(wrapper)>0;
+	}
+
+	@Override
+	public Boolean update(SysDictData dictData) throws ServiceException {
+		return dictDataMapper.updateById(dictData)>0;
+	}
+
+	@Override
+	public SysDictData get(String dictCode) throws ServiceException {
+		return dictDataMapper.selectById(dictCode);
+	}
+
+	@Override
+	public List<SysDictData> selectDictDataByType(String dictType) throws ServiceException {
+		Wrapper<SysDictData> wrapper = new EntityWrapper<SysDictData>();
+        if (!StringUtils.isEmpty(dictType)) {
+            wrapper.eq("dict_type", dictType);
+        }
+		return dictDataMapper.selectList(wrapper);
+	}
+
+}

+ 48 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/dict/DictTypeService.java

@@ -0,0 +1,48 @@
+package com.iotechn.unimall.admin.api.dict;
+
+import java.util.List;
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.sys.dict.SysDictType;
+import com.iotechn.unimall.data.model.Page;
+
+@HttpOpenApi(group = "admin.dictType", description = "字典类型服务")
+public interface DictTypeService {
+	@HttpMethod(description = "创建", permission = "admin:dictType:add", permissionParentName = "系统管理", permissionName = "字典管理")
+	public Boolean add(
+			@NotNull @HttpParam(name = "dictType", type = HttpParamType.COMMON, description = "字典信息") SysDictType dictType)
+			throws ServiceException;
+
+	@HttpMethod(description = "列表", permission = "admin:dictType:list", permissionParentName = "系统管理", permissionName = "字典管理")
+	public Page<SysDictType> list(
+			@HttpParam(name = "dictName", type = HttpParamType.COMMON, description = "字典名称") String dictName,
+			@HttpParam(name = "dictType", type = HttpParamType.COMMON, description = "字典类型") String dictType,
+			@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+			@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+			throws ServiceException;
+
+	@HttpMethod(description = "删除", permission = "admin:dictType:delete", permissionParentName = "系统管理", permissionName = "字典管理")
+	public Boolean delete(
+			@NotNull @HttpParam(name = "dictIds", type = HttpParamType.COMMON, description = "字典Id") String dictIds)
+			throws ServiceException;
+
+	@HttpMethod(description = "修改", permission = "admin:dictType:update", permissionParentName = "系统管理", permissionName = "字典管理")
+	public Boolean update(
+			@NotNull @HttpParam(name = "dictType", type = HttpParamType.COMMON, description = "字典信息") SysDictType dictType)
+			throws ServiceException;
+
+	@HttpMethod(description = "查询", permission = "admin:dictType:get", permissionParentName = "系统管理", permissionName = "字典管理")
+	public SysDictType get(
+			@HttpParam(name = "dictId", type = HttpParamType.COMMON, description = "字典ID") Long dictId)
+			throws ServiceException;
+
+	@HttpMethod(description = "字典选择框列表", permission = "admin:dictType:optionselect", permissionParentName = "系统管理", permissionName = "字典管理")
+	public List<SysDictType> optionselect()throws ServiceException;
+
+
+}

+ 86 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/dict/DictTypeServiceImpl.java

@@ -0,0 +1,86 @@
+package com.iotechn.unimall.admin.api.dict;
+
+import java.util.List;
+
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.StringUtils;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.core.exception.AdminServiceException;
+import com.iotechn.unimall.core.exception.ExceptionDefinition;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.sys.dict.SysDictType;
+import com.iotechn.unimall.data.mapper.sys.dict.SysDictTypeMapper;
+import com.iotechn.unimall.data.model.Page;
+
+/**
+ * 
+ * @author dyl
+ *
+ */
+@Service
+public class DictTypeServiceImpl implements DictTypeService {
+
+	@Autowired
+	private SysDictTypeMapper typeMapper;
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public Boolean add(SysDictType sysDictType) throws ServiceException {
+		Long dictId;
+		if (sysDictType.getDictId() == null)
+			dictId = -1L;
+		else
+			dictId = sysDictType.getDictId();
+		SysDictType dictType = typeMapper.checkDictTypeUnique(sysDictType);
+		if (dictType != null && dictType.getDictId().longValue() != dictId.longValue()) {
+			throw new AdminServiceException(ExceptionDefinition.DICT_TYPE_HAS_EXISTED);
+		}
+		return typeMapper.insert(sysDictType) > 0;
+	}
+
+	@Override
+	public Page<SysDictType> list(String dictName, String dictType, Integer page, Integer limit)
+			throws ServiceException {
+		Wrapper<SysDictType> wrapper = new EntityWrapper<SysDictType>();
+		if (!StringUtils.isEmpty(dictName)) {
+			wrapper.like("dict_name", dictName);
+		}
+		if (!StringUtils.isEmpty(dictType)) {
+			wrapper.eq("dict_type", dictType);
+		}
+		List<SysDictType> SysDictTypeS = typeMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+		Integer count = typeMapper.selectCount(wrapper);
+		return new Page<SysDictType>(SysDictTypeS, page, limit, count);
+	}
+
+	@Override
+	public Boolean delete(String dictIds) throws ServiceException {
+		String[] ids=dictIds.split(",");
+		Wrapper<SysDictType> wrapper = new EntityWrapper<SysDictType>();
+		wrapper.in("dict_id", ids);
+		return typeMapper.delete(wrapper) > 0;
+	}
+
+	@Override
+	public Boolean update(SysDictType dictType) throws ServiceException {
+
+		return typeMapper.updateById(dictType) > 0;
+	}
+
+	@Override
+	public SysDictType get(Long dictId) throws ServiceException {
+		return typeMapper.selectById(dictId);
+	}
+
+	@Override
+	public List<SysDictType> optionselect() throws ServiceException {
+		return typeMapper.selectDictTypeAll();
+	}
+
+
+}

+ 62 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/freight/AdminFreightTemplateService.java

@@ -0,0 +1,62 @@
+package com.iotechn.unimall.admin.api.freight;
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.annotation.param.Range;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.FreightTemplateCarriageDO;
+import com.iotechn.unimall.data.dto.freight.FreightTemplateDTO;
+
+import java.util.List;
+
+/**
+ * Created with IntelliJ IDEA.
+ * Description:
+ * User: kbq
+ * Date: 2019-07-07
+ * Time: 下午3:37
+ */
+@HttpOpenApi(group = "admin.freight", description = "运费模板")
+public interface AdminFreightTemplateService {
+
+    @HttpMethod(description = "创建", permission = "operation:freight:create", permissionParentName = "运营管理", permissionName = "运费模板管理")
+    public boolean addFreightTemplate(
+            @NotNull @HttpParam(name = "templateName", type = HttpParamType.COMMON, description = "模板名称") String templateName,
+            @HttpParam(name = "spuLocation", type = HttpParamType.COMMON, description = "宝贝地址") String spuLocation,
+            @NotNull @HttpParam(name = "deliveryDeadline", type = HttpParamType.COMMON, description = "发货期限") Integer deliveryDeadline,
+            @NotNull @HttpParam(name = "defaultFreePrice", type = HttpParamType.COMMON, description = "默认满价包邮系列") Integer defaultFreePrice,
+            @NotNull @HttpParam(name = "defaultFirstNum", type = HttpParamType.COMMON, description = "默认首费") Integer defaultFirstNum,
+            @NotNull @Range(min = 1) @HttpParam(name = "defaultFirstPrice", type = HttpParamType.COMMON, description = "默认首件数量") Integer defaultFirstPrice,
+            @NotNull @HttpParam(name = "defaultContinueNum", type = HttpParamType.COMMON, description = "默认续费") Integer defaultContinueNum,
+            @NotNull @Range(min = 1) @HttpParam(name = "defaultContinuePrice", type = HttpParamType.COMMON, description = "默认续件数量") Integer defaultContinuePrice,
+            @HttpParam(name = "freightTemplateCarriageDOList", type = HttpParamType.COMMON, description = "特殊运费区") List freightTemplateCarriageDOList,
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId
+    ) throws ServiceException;
+
+    @HttpMethod(description = "删除", permission = "operation:freight:delete", permissionParentName = "运营管理", permissionName = "运费模板管理")
+    public boolean deleteFreightTemplate(
+            @NotNull @HttpParam(name = "templateId", type = HttpParamType.COMMON, description = "模板ID") Long templateId,
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;
+
+    @HttpMethod(description = "更新", permission = "operation:freight:update", permissionParentName = "运营管理", permissionName = "运费模板管理")
+    public boolean updateFreightTemplate(
+            @NotNull @HttpParam(name = "templateId", type = HttpParamType.COMMON, description = "模板名称") Long templateId,
+            @NotNull @HttpParam(name = "templateName", type = HttpParamType.COMMON, description = "模板名称") String templateName,
+            @HttpParam(name = "spuLocation", type = HttpParamType.COMMON, description = "宝贝地址") String spuLocation,
+            @NotNull @HttpParam(name = "deliveryDeadline", type = HttpParamType.COMMON, description = "发货期限") Integer deliveryDeadline,
+            @NotNull @HttpParam(name = "defaultFreePrice", type = HttpParamType.COMMON, description = "默认满价包邮系列") Integer defaultFreePrice,
+            @NotNull @Range(min = 1) @HttpParam(name = "defaultFirstNum", type = HttpParamType.COMMON, description = "默认首费") Integer defaultFirstNum,
+            @NotNull @Range(min = 0) @HttpParam(name = "defaultFirstPrice", type = HttpParamType.COMMON, description = "默认首件数量") Integer defaultFirstPrice,
+            @NotNull @Range(min = 1) @HttpParam(name = "defaultContinueNum", type = HttpParamType.COMMON, description = "默认续费") Integer defaultContinueNum,
+            @NotNull @Range(min = 0) @HttpParam(name = "defaultContinuePrice", type = HttpParamType.COMMON, description = "默认续件数量") Integer defaultContinuePrice,
+            @HttpParam(name = "freightTemplateCarriageDOList", type = HttpParamType.COMMON, description = "特殊运费区") List templateCarriageDOList,
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;
+
+    @HttpMethod(description = "查询", permission = "operation:freight:query", permissionParentName = "运营管理", permissionName = "运费模板管理")
+    public List<FreightTemplateDTO> getAllFreightTemplate(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;
+
+}

+ 147 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/freight/AdminFreightTemplateServiceImpl.java

@@ -0,0 +1,147 @@
+package com.iotechn.unimall.admin.api.freight;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.TypeReference;
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.iotechn.unimall.biz.service.goods.GoodsBizService;
+import com.iotechn.unimall.core.exception.AdminServiceException;
+import com.iotechn.unimall.core.exception.ExceptionDefinition;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.component.CacheComponent;
+import com.iotechn.unimall.data.domain.FreightTemplateCarriageDO;
+import com.iotechn.unimall.data.domain.FreightTemplateDO;
+import com.iotechn.unimall.data.domain.SpuDO;
+import com.iotechn.unimall.data.dto.freight.FreightTemplateDTO;
+import com.iotechn.unimall.data.mapper.FreightTemplateCarriageMapper;
+import com.iotechn.unimall.data.mapper.FreightTemplateMapper;
+import com.iotechn.unimall.data.mapper.SpuMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * Created with IntelliJ IDEA.
+ * Description:
+ * User: kbq
+ * Date: 2019-07-07
+ * Time: 下午4:25
+ */
+@Service
+public class AdminFreightTemplateServiceImpl implements AdminFreightTemplateService {
+
+    @Autowired
+    private FreightTemplateMapper freightTemplateMapper;
+
+    @Autowired
+    private FreightTemplateCarriageMapper freightTemplateCarriageMapper;
+
+    @Autowired
+    private SpuMapper spuMapper;
+
+    @Autowired
+    private CacheComponent cacheComponent;
+
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public boolean addFreightTemplate(String templateName, String spuLocation, Integer deliveryDeadline, Integer defaultFreePrice, Integer defaultFirstNum, Integer defaultFirstPrice, Integer defaultContinueNum, Integer defaultContinuePrice, List freightTemplateCarriageDOList, Long adminId) throws ServiceException {
+        Date now = new Date();
+        FreightTemplateDO freightTemplateDO = new FreightTemplateDO(templateName, spuLocation, deliveryDeadline, defaultFreePrice, defaultFirstNum, defaultFirstPrice, defaultContinueNum, defaultContinuePrice);
+        freightTemplateDO.setGmtCreate(now);
+        freightTemplateDO.setGmtUpdate(now);
+        int judgeSQL = freightTemplateMapper.insert(freightTemplateDO); //插入模板主表
+        if (judgeSQL <= 0) {
+            throw new AdminServiceException(ExceptionDefinition.FREIGHT_TEMPLATE_INSERT_FAILED);
+        }
+        if (CollectionUtils.isEmpty(freightTemplateCarriageDOList)) {
+            return true;
+        }
+        List<FreightTemplateCarriageDO> collect = (List<FreightTemplateCarriageDO>) freightTemplateCarriageDOList.stream().map(item -> {
+            FreightTemplateCarriageDO t = JSONObject.toJavaObject((JSON) item, FreightTemplateCarriageDO.class);
+            return t;
+        }).collect(Collectors.toList());
+        insertFreightTemplateCarriage(freightTemplateDO, collect, now);
+        return true;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public boolean deleteFreightTemplate(Long templateId, Long adminId) throws ServiceException {
+        if (spuMapper.selectCount(new EntityWrapper<SpuDO>().eq("freight_template_id", templateId)) > 0) {
+            throw new AdminServiceException(ExceptionDefinition.FREIGHT_SPU_QUERY_HAS);
+        }
+        if (freightTemplateMapper.delete(new EntityWrapper<FreightTemplateDO>().eq("id", templateId)) <= 0) {
+            throw new AdminServiceException(ExceptionDefinition.FREIGHT_TEMPLATE_DELETE_FAILED);
+        }
+        if (freightTemplateCarriageMapper.delete(
+                new EntityWrapper<FreightTemplateCarriageDO>()
+                        .eq("template_id", templateId)) > 0) {
+            cacheComponent.delPrefixKey(GoodsBizService.CA_SPU_PREFIX);
+            return true;
+        }
+        throw new AdminServiceException(ExceptionDefinition.FREIGHT_TEMPLATE_UPDATE_FAILED);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public boolean updateFreightTemplate(Long templateId, String templateName, String spuLocation, Integer deliveryDeadline, Integer defaultFreePrice, Integer defaultFirstNum, Integer defaultFirstPrice, Integer defaultContinueNum, Integer defaultContinuePrice, List freightTemplateCarriageDOList, Long adminId) throws ServiceException {
+        Date now = new Date();
+        FreightTemplateDO freightTemplateDO = new FreightTemplateDO(templateName, spuLocation, deliveryDeadline, defaultFreePrice, defaultFirstNum, defaultFirstPrice, defaultContinueNum, defaultContinuePrice);
+        freightTemplateDO.setId(templateId);
+        freightTemplateDO.setGmtUpdate(now);
+        if (freightTemplateMapper.updateById(freightTemplateDO) <= 0) {    //如果主表修改失败
+            throw new AdminServiceException(ExceptionDefinition.FREIGHT_TEMPLATE_UPDATE_FAILED);
+        }
+        freightTemplateCarriageMapper.delete(new EntityWrapper<FreightTemplateCarriageDO>().eq("template_id", templateId));
+        if (CollectionUtils.isEmpty(freightTemplateCarriageDOList)) {
+            return true;
+        }
+        List<FreightTemplateCarriageDO> collect = (List<FreightTemplateCarriageDO>) freightTemplateCarriageDOList.stream().map(item -> {
+            FreightTemplateCarriageDO t = JSONObject.toJavaObject((JSON) item, FreightTemplateCarriageDO.class);
+            return t;
+        }).collect(Collectors.toList());
+        insertFreightTemplateCarriage(freightTemplateDO, collect, now);
+        cacheComponent.delPrefixKey(GoodsBizService.CA_SPU_PREFIX);
+        return true;
+    }
+
+    private void insertFreightTemplateCarriage(FreightTemplateDO freightTemplateDO, List<FreightTemplateCarriageDO> freightTemplateCarriageDOList, Date now) throws ServiceException {
+        //表中设定可默认值,所以就不检查是否为空
+        for (FreightTemplateCarriageDO freightTemplateCarriageDO : freightTemplateCarriageDOList) {
+            freightTemplateCarriageDO.setTemplateId(freightTemplateDO.getId());
+            freightTemplateCarriageDO.setGmtCreate(now);
+            freightTemplateCarriageDO.setGmtUpdate(now);
+            Integer judgeSQL = freightTemplateCarriageMapper.insert(freightTemplateCarriageDO);
+            if (judgeSQL <= 0) {
+                throw new AdminServiceException(ExceptionDefinition.FREIGHT_CARRIAGE_INSERT_FAILED);
+            }
+        }
+    }
+
+    @Override
+    public List<FreightTemplateDTO> getAllFreightTemplate(Long adminId) throws ServiceException {
+        List<FreightTemplateDO> freightTemplateDOList = freightTemplateMapper.selectList(null); //查出主表所有数据
+        List<FreightTemplateDTO> freightTemplateDTOList = new ArrayList<>();
+        if (freightTemplateDOList == null || freightTemplateDOList.size() == 0) { //如果主表没有记录
+            return freightTemplateDTOList;
+        }
+        for (FreightTemplateDO freightTemplateDO : freightTemplateDOList) {  //查出副表中,主表每条数据对应的数据
+            FreightTemplateDTO freightTemplateDTO = new FreightTemplateDTO();
+            List<FreightTemplateCarriageDO> freightTemplateCarriageDOList = freightTemplateCarriageMapper.selectList(new EntityWrapper<FreightTemplateCarriageDO>()
+                    .eq("template_id", freightTemplateDO.getId()));
+            freightTemplateDTO.setFreightTemplateDO(freightTemplateDO);
+            freightTemplateDTO.setFreightTemplateCarriageDOList(freightTemplateCarriageDOList);
+            freightTemplateDTOList.add(freightTemplateDTO);
+        }
+        return freightTemplateDTOList;
+    }
+
+
+}

+ 64 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/goods/AdminGoodsService.java

@@ -0,0 +1,64 @@
+package com.iotechn.unimall.admin.api.goods;
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.dto.goods.SpuDTO;
+import com.iotechn.unimall.data.dto.goods.SpuTreeNodeDTO;
+import com.iotechn.unimall.data.model.Page;
+
+import java.util.List;
+
+/**
+ * Created by rize on 2019/7/11.
+ */
+@HttpOpenApi(group = "admin.goods", description = "管理员商品服务")
+public interface AdminGoodsService {
+
+    @HttpMethod(description = "获取SPU树")
+    public List<SpuTreeNodeDTO> getSpuBigTree(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员Id") Long adminId) throws ServiceException;
+
+
+    @HttpMethod(description = "创建", permission = "operation:goods:create", permissionParentName = "商品管理", permissionName = "商品管理")
+    public String create(
+            @NotNull @HttpParam(name = "spuDTO", type = HttpParamType.COMMON, description = "商品JSON数据") SpuDTO spuDTO,
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;
+
+
+    @HttpMethod(description = "编辑", permission = "operation:goods:edit", permissionParentName = "商品管理", permissionName = "商品管理")
+    public String edit(
+            @NotNull @HttpParam(name = "spuDTO", type = HttpParamType.COMMON, description = "商品JSON数据") SpuDTO spuDTO,
+            @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;
+
+    @HttpMethod(description = "列表", permission = "operation:goods:list", permissionParentName = "商品管理", permissionName = "商品管理")
+    public Page<SpuDTO> list(
+            @HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit,
+            @HttpParam(name = "categoryId", type = HttpParamType.COMMON, description = "搜索分类") Long categoryId,
+            @HttpParam(name = "title", type = HttpParamType.COMMON, description = "搜索标题") String title,
+            @HttpParam(name = "barcode", type = HttpParamType.COMMON, description = "商品条形码") String barcode,
+            @HttpParam(name = "status", type = HttpParamType.COMMON, description = "商品状态") Integer status,
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员Id") Long adminId) throws ServiceException;
+
+    @HttpMethod(description = "详情", permission = "operation:goods:detail", permissionParentName = "商品管理", permissionName = "商品管理")
+    public SpuDTO detail(
+            @NotNull @HttpParam(name = "spuId", type = HttpParamType.COMMON, description = "商品Id") Long spuId,
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员Id") Long adminId) throws ServiceException;
+
+    @HttpMethod(description = "上下架", permission = "operation:goods:edit", permissionParentName = "商品管理", permissionName = "商品管理")
+    public SpuDTO freezeOrActivation(
+            @NotNull @HttpParam(name = "spuId", type = HttpParamType.COMMON, description = "商品Id") Long spuId,
+            @NotNull @HttpParam(name = "status", type = HttpParamType.COMMON, description = "商品想要变为的状态") Integer status,
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员Id") Long adminId) throws ServiceException;
+
+
+    @HttpMethod(description = "删除", permission = "operation:goods:delete", permissionParentName = "商品管理", permissionName = "商品管理")
+    public String delete(
+            @NotNull @HttpParam(name = "spuId", type = HttpParamType.COMMON, description = "商品Id") Long spuId,
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员Id") Long adminId) throws ServiceException;
+
+}

+ 414 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/goods/AdminGoodsServiceImpl.java

@@ -0,0 +1,414 @@
+package com.iotechn.unimall.admin.api.goods;
+
+import com.baomidou.mybatisplus.entity.Column;
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.biz.service.goods.GoodsBizService;
+import com.iotechn.unimall.core.Const;
+import com.iotechn.unimall.core.exception.AdminServiceException;
+import com.iotechn.unimall.core.exception.ExceptionDefinition;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.component.CacheComponent;
+import com.iotechn.unimall.data.domain.*;
+import com.iotechn.unimall.data.dto.goods.SpuDTO;
+import com.iotechn.unimall.data.dto.goods.SpuTreeNodeDTO;
+import com.iotechn.unimall.data.enums.BizType;
+import com.iotechn.unimall.data.enums.SpuStatusType;
+import com.iotechn.unimall.data.mapper.*;
+import com.iotechn.unimall.data.model.Page;
+import com.iotechn.unimall.plugin.core.inter.IPluginUpdateGoods;
+import com.iotechn.unimall.plugin.core.manager.PluginsManager;
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * Created by rize on 2019/7/11.
+ */
+@Service
+public class AdminGoodsServiceImpl implements AdminGoodsService {
+
+    @Autowired
+    private CategoryMapper categoryMapper;
+
+    @Autowired
+    private SpuMapper spuMapper;
+
+    @Autowired
+    private SkuMapper skuMapper;
+
+    @Autowired
+    private SpuAttributeMapper spuAttributeMapper;
+
+    @Autowired
+    private ImgMapper imgMapper;
+
+    @Autowired
+    private CartMapper cartMapper;
+
+    @Autowired
+    private GoodsBizService goodsBizService;
+
+    @Autowired
+    private PluginsManager pluginsManager;
+
+    @Autowired
+    private CacheComponent cacheComponent;
+
+    private static final Column[] spuBaseColumns = {
+            Column.create().column("id"),
+            Column.create().column("original_price").as("originalPrice"),
+            Column.create().column("price"),
+            Column.create().column("vip_price").as("vipPrice"),
+            Column.create().column("title"),
+            Column.create().column("sales"),
+            Column.create().column("img"),
+            Column.create().column("description"),
+            Column.create().column("category_id").as("categoryId"),
+            Column.create().column("freight_template_id").as("freightTemplateId"),
+            Column.create().column("unit"),
+            Column.create().column("status")};
+
+    /**
+     * 后台低频接口, 无需缓存
+     * @return
+     * @throws ServiceException
+     */
+    public List<SpuTreeNodeDTO> getSpuBigTree(Long adminId) throws  ServiceException{
+        List<CategoryDO> categoryDOS = categoryMapper.selectList(new EntityWrapper<CategoryDO>().orderBy("level"));
+        List<SpuDO> spuDOS = spuMapper.getSpuTitleAll();
+        List<SpuTreeNodeDTO> list = new ArrayList<>();
+        Integer recordLevelOne = 0;
+        Integer recordLevelTwo = 0;
+        for (int i = 0; i < categoryDOS.size(); i++) {
+            if(i != 0 && categoryDOS.get(i-1).getLevel().equals(0) && categoryDOS.get(i).getLevel().equals(1)){
+                recordLevelOne = i;
+            }
+            if(i != 0 && categoryDOS.get(i-1).getLevel().equals(1) && categoryDOS.get(i).getLevel().equals(2)){
+                recordLevelTwo = i;
+                break;
+            }
+        }
+
+        for (int i = 0; i < recordLevelOne; i++) {
+            CategoryDO categoryOnI = categoryDOS.get(i);    //一级类目
+            SpuTreeNodeDTO dtoOnI = new SpuTreeNodeDTO();
+            dtoOnI.setLabel(categoryOnI.getTitle());
+            dtoOnI.setValue("C_" + categoryOnI.getId());
+            dtoOnI.setId(categoryOnI.getId());
+            dtoOnI.setChildren(new LinkedList<>());
+            for (int j = recordLevelOne; j < recordLevelTwo; j++) {
+                CategoryDO categoryOnJ = categoryDOS.get(j);    //二级类目
+                if(!categoryOnJ.getParentId().equals(dtoOnI.getId())){
+                    continue;
+                }
+
+                SpuTreeNodeDTO dtoOnJ = new SpuTreeNodeDTO();
+                dtoOnJ.setLabel(categoryOnJ.getTitle());
+                dtoOnJ.setValue("C_" + categoryOnJ.getId());
+                dtoOnJ.setId(categoryOnJ.getId());
+                dtoOnJ.setChildren(new LinkedList<>());
+                
+                for (int p = recordLevelTwo; p <categoryDOS.size() ; p++) {
+                    CategoryDO categoryOnP = categoryDOS.get(p);    //三级类目
+                    if(!categoryOnP.getParentId().equals(dtoOnJ.getId())){
+                        continue;
+                    }
+
+                    SpuTreeNodeDTO dtoOnP = new SpuTreeNodeDTO();
+                    dtoOnP.setLabel(categoryOnP.getTitle());
+                    dtoOnP.setValue("C_" + categoryOnP.getId());
+                    dtoOnP.setId(categoryOnP.getId());
+                    dtoOnP.setChildren(new LinkedList<>());
+
+                    for (int k = 0; k < spuDOS.size(); k++) {
+                        if(k != 0 && spuDOS.get(k-1).getCategoryId().equals(dtoOnP.getId()) && !spuDOS.get(k).getCategoryId().equals(dtoOnP.getId())){
+                            break;
+                        }
+                        SpuDO spuDO = spuDOS.get(k);        //商品
+                        if(spuDO.getCategoryId().equals(dtoOnP.getId())){
+                            SpuTreeNodeDTO dtoOnK = new SpuTreeNodeDTO();
+                            dtoOnK.setLabel(spuDO.getTitle());
+                            dtoOnK.setValue("G_" + spuDO.getId());
+                            dtoOnK.setId(spuDO.getId());
+                            dtoOnK.setChildren(new LinkedList<>());
+                            dtoOnP.getChildren().add(dtoOnK);
+                        }
+                    }
+                    dtoOnJ.getChildren().add(dtoOnP);
+                }
+                dtoOnI.getChildren().add(dtoOnJ);
+            }
+            list.add(dtoOnI);
+        }
+        return list;
+    }
+
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String create(SpuDTO spuDTO, Long adminId) throws ServiceException {
+        //参数校验
+        if (CollectionUtils.isEmpty(spuDTO.getSkuList())) {
+            throw new AdminServiceException(ExceptionDefinition.GOODS_SKU_LIST_EMPTY);
+        }
+        if (spuDTO.getId() != null) {
+            throw new AdminServiceException(ExceptionDefinition.GOODS_CREATE_HAS_ID);
+        }
+        if (spuDTO.getOriginalPrice() < spuDTO.getPrice() || spuDTO.getPrice() < spuDTO.getVipPrice() || spuDTO.getOriginalPrice() < spuDTO.getVipPrice()) {
+            throw new AdminServiceException(ExceptionDefinition.GOODS_PRICE_CHECKED_FAILED);
+        }
+        //校验Sku是否重复
+        List<String> barCodes = spuDTO.getSkuList().stream().map(item -> item.getBarCode()).collect(Collectors.toList());
+        List<SkuDO> existSkuDO = skuMapper.selectList(new EntityWrapper<SkuDO>().in("bar_code", barCodes));
+        if (!CollectionUtils.isEmpty(existSkuDO)) {
+            String spuIds = existSkuDO.stream().map(item -> item.getSpuId().toString()).collect(Collectors.joining(","));
+            String skuIds = existSkuDO.stream().map(item -> item.getBarCode()).collect(Collectors.joining(","));
+            throw new AdminServiceException(ExceptionDefinition
+                    .buildVariableException(ExceptionDefinition.GOODS_CREATE_BARCODE_REPEAT, spuIds, skuIds));
+        }
+        Date now = new Date();
+        SpuDO spuDO = new SpuDO();
+        BeanUtils.copyProperties(spuDTO, spuDO);
+        spuDO.setGmtUpdate(now);
+        spuDO.setGmtCreate(now);
+        spuDO.setSales(0);
+        spuMapper.insert(spuDO);
+        spuDTO.setId(spuDO.getId());
+        //插入SKU表
+        for (SkuDO skuDO : spuDTO.getSkuList()) {
+            if (skuDO.getOriginalPrice() < skuDO.getPrice() || skuDO.getPrice() < skuDO.getVipPrice() || skuDO.getOriginalPrice() < skuDO.getVipPrice()) {
+                throw new AdminServiceException(ExceptionDefinition.GOODS_PRICE_CHECKED_FAILED);
+            }
+            skuDO.setSpuId(spuDO.getId());
+            skuDO.setGmtUpdate(now);
+            skuDO.setGmtCreate(now);
+            skuDO.setFreezeStock(0);
+            skuMapper.insert(skuDO);
+        }
+        //插入spuAttr
+        insertSpuAttribute(spuDTO, now);
+        //插入IMG
+        insertSpuImg(spuDTO, spuDO.getId(), now);
+        goodsBizService.clearGoodsCache(spuDO.getId());
+        pluginUpdateInvoke(spuDO.getId());
+
+        cacheComponent.delPrefixKey(GoodsBizService.CA_SPU_PAGE_PREFIX);
+        return "ok";
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String edit(SpuDTO spuDTO, Long adminId) throws ServiceException {
+        if (spuDTO.getId() == null) {
+            throw new AdminServiceException(ExceptionDefinition.PARAM_CHECK_FAILED);
+        }
+        if (CollectionUtils.isEmpty(spuDTO.getSkuList())) {
+            throw new AdminServiceException(ExceptionDefinition.GOODS_SKU_LIST_EMPTY);
+        }
+        if (spuDTO.getOriginalPrice() < spuDTO.getPrice() || spuDTO.getPrice() < spuDTO.getVipPrice() || spuDTO.getOriginalPrice() < spuDTO.getVipPrice()) {
+            throw new AdminServiceException(ExceptionDefinition.GOODS_PRICE_CHECKED_FAILED);
+        }
+        Date now = new Date();
+        SpuDO spuDO = new SpuDO();
+        BeanUtils.copyProperties(spuDTO, spuDO);
+        spuDO.setGmtUpdate(now);
+        spuMapper.updateById(spuDO);
+        List<String> barCodes = new LinkedList<>();
+        for (SkuDO skuDO : spuDTO.getSkuList()) {
+            if (skuDO.getOriginalPrice() < skuDO.getPrice() || skuDO.getPrice() < skuDO.getVipPrice() || skuDO.getOriginalPrice() < skuDO.getVipPrice()) {
+                throw new AdminServiceException(ExceptionDefinition.GOODS_PRICE_CHECKED_FAILED);
+            }
+            skuDO.setId(null);
+            skuDO.setSpuId(spuDO.getId());
+            skuDO.setGmtUpdate(now);
+            skuDO.setFreezeStock(0);
+            if (skuMapper.update(skuDO,
+                    new EntityWrapper<SkuDO>()
+                            .eq("bar_code", skuDO.getBarCode())) <= 0) {
+                skuDO.setGmtCreate(now);
+                skuMapper.insert(skuDO);
+            }
+            barCodes.add(skuDO.getBarCode());
+        }
+        //删除多余barCode
+        skuMapper.delete(new EntityWrapper<SkuDO>().eq("spu_id", spuDO.getId()).notIn("bar_code",barCodes));
+        //插入spuAttr
+        spuAttributeMapper.delete(new EntityWrapper<SpuAttributeDO>().eq("spu_id", spuDTO.getId()));
+        insertSpuAttribute(spuDTO, now);
+        imgMapper.delete(new EntityWrapper<ImgDO>().eq("biz_id", spuDO.getId()).eq("biz_type", BizType.GOODS.getCode()));
+        //插入IMG
+        insertSpuImg(spuDTO, spuDO.getId(), now);
+        goodsBizService.clearGoodsCache(spuDTO.getId());
+        pluginUpdateInvoke(spuDTO.getId());
+
+        cacheComponent.delPrefixKey(GoodsBizService.CA_SPU_PAGE_PREFIX);
+        return "ok";
+    }
+
+    private void insertSpuAttribute(SpuDTO spuDTO, Date now) {
+        if (!CollectionUtils.isEmpty(spuDTO.getAttributeList())) {
+            for (SpuAttributeDO spuAttributeDO : spuDTO.getAttributeList()) {
+                spuAttributeDO.setSpuId(spuDTO.getId());
+                spuAttributeDO.setGmtUpdate(now);
+                spuAttributeDO.setGmtCreate(now);
+                spuAttributeMapper.insert(spuAttributeDO);
+            }
+        }
+    }
+
+    private void insertSpuImg(SpuDTO spuDTO, Long bizId, Date now) {
+        List<String> imgList = spuDTO.getImgList();
+        List<ImgDO> imgDOList = imgList.stream().map(item -> {
+            ImgDO imgDO = new ImgDO();
+            imgDO.setBizType(BizType.GOODS.getCode());
+            imgDO.setBizId(bizId);
+            imgDO.setUrl(item);
+            imgDO.setGmtCreate(now);
+            imgDO.setGmtUpdate(now);
+            return imgDO;
+        }).collect(Collectors.toList());
+        imgMapper.insertImgs(imgDOList);
+    }
+
+    @Override
+    public Page<SpuDTO> list(Integer page, Integer limit, Long categoryId, String title,String barcode, Integer status, Long adminId) throws ServiceException {
+        Wrapper<SpuDO> wrapper = new EntityWrapper<SpuDO>();
+
+        if (!StringUtils.isEmpty(title)) {
+            wrapper.like("title", title);
+        }
+
+        if (categoryId != null && categoryId != 0L) {
+            List<CategoryDO> childrenList = categoryMapper.selectList(new EntityWrapper<CategoryDO>().eq("parent_id", categoryId));
+            // 传入类目拥有的三级类目集合
+            LinkedList<Long> childrenIds = new LinkedList<>();
+
+            // 传入类目没有子类目
+            if (CollectionUtils.isEmpty(childrenList)) {
+                // 则传入类目为三级类目
+                childrenIds.add(categoryId);
+            } else {
+
+                CategoryDO categoryDO = categoryMapper.selectById(categoryId);
+
+                // 检验传入类目是一级还是二级类目
+                if (categoryDO.getParentId() != 0L) {
+                    //二级分类
+                    childrenList.forEach(item -> {
+                        childrenIds.add(item.getId());
+                    });
+                } else {
+                    //一级分类
+                    childrenList.forEach(item -> {
+                        List<CategoryDO> leafList = categoryMapper.selectList(new EntityWrapper<CategoryDO>().eq("parent_id", item.getId()));
+                        if (!CollectionUtils.isEmpty(leafList)) {
+                            leafList.forEach(leafItem -> {
+                                childrenIds.add(leafItem.getId());
+                            });
+                        }
+                    });
+                }
+            }
+            wrapper.in("category_id", childrenIds);
+        }
+
+        if(status != null){
+            wrapper.eq("status", status.intValue() <= SpuStatusType.STOCK.getCode()?SpuStatusType.STOCK.getCode():SpuStatusType.SELLING.getCode());
+        }
+
+        if(barcode != null){
+            List<SkuDO> skuDOList = skuMapper.selectList(new EntityWrapper<SkuDO>().eq("bar_code", barcode));
+            if(!CollectionUtils.isEmpty(skuDOList)){
+                SkuDO skuDO = skuDOList.get(0);
+                wrapper.eq("id",skuDO.getSpuId());
+            }
+        }
+
+        wrapper.setSqlSelect(spuBaseColumns);
+        List<SpuDO> spuDOS = spuMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+
+        //组装SPU
+        List<SpuDTO> spuDTOList = new ArrayList<>();
+        spuDOS.forEach(item -> {
+            SpuDTO spuDTO = new SpuDTO();
+            BeanUtils.copyProperties(item, spuDTO);
+            List<SkuDO> skuDOList = skuMapper.selectList(new EntityWrapper<SkuDO>().eq("spu_id", item.getId()));
+            spuDTO.setSkuList(skuDOList);
+            spuDTOList.add(spuDTO);
+        });
+
+        Integer count = spuMapper.selectCount(wrapper);
+        Page<SpuDTO> dtoPage = new Page<>(spuDTOList, page, limit, count);
+
+        return dtoPage;
+    }
+
+    @Override
+    public SpuDTO detail(Long spuId, Long adminId) throws ServiceException {
+        return goodsBizService.getGoods(spuId, null);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String delete(Long spuId, Long adminId) throws ServiceException {
+        if (spuMapper.deleteById(spuId) <= 0) {
+            throw new AdminServiceException(ExceptionDefinition.GOODS_NOT_EXIST);
+        }
+        cartMapper.delete(new EntityWrapper<CartDO>().in("sku_id", skuMapper.getSkuIds(spuId)));
+        skuMapper.delete(new EntityWrapper<SkuDO>().eq("spu_id", spuId));
+        imgMapper.delete(new EntityWrapper<ImgDO>().eq("biz_id", spuId).eq("biz_type", BizType.GOODS.getCode()));
+        spuAttributeMapper.delete(new EntityWrapper<SpuAttributeDO>().eq("spu_id", spuId));
+        goodsBizService.clearGoodsCache(spuId);
+        pluginUpdateInvoke(spuId);
+
+        cacheComponent.delPrefixKey(GoodsBizService.CA_SPU_PAGE_PREFIX);
+        return "ok";
+    }
+
+    private void pluginUpdateInvoke(Long spuId) {
+        List<IPluginUpdateGoods> plugins = pluginsManager.getPlugins(IPluginUpdateGoods.class);
+        if (!CollectionUtils.isEmpty(plugins)) {
+            for (IPluginUpdateGoods updateGoods : plugins) {
+                updateGoods.invokeGoodsUpdate(spuId);
+            }
+        }
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public SpuDTO freezeOrActivation(Long spuId, Integer status, Long adminId) throws ServiceException {
+        SpuDO spuDO = spuMapper.selectById(spuId);
+
+        if(spuDO == null){
+            throw new AdminServiceException(ExceptionDefinition.GOODS_NOT_EXIST);
+        }
+
+        status = status <= SpuStatusType.STOCK.getCode() ? SpuStatusType.STOCK.getCode() : SpuStatusType.SELLING.getCode();
+
+        if(spuDO.getStatus().intValue() == status.intValue()){
+            throw new AdminServiceException(ExceptionDefinition.GOODS_NEED_STATUS_ERROR);
+        }
+
+        spuDO.setStatus(status);
+        spuDO.setGmtUpdate(new Date());
+        if(spuMapper.updateById(spuDO) <= 0){
+            throw new AdminServiceException(ExceptionDefinition.GOODS_UPDATE_SQL_FAILED);
+        }
+
+        SpuDTO spuDTO = new SpuDTO();
+        BeanUtils.copyProperties(spuDO,spuDTO);
+        List<SkuDO> skuDOList = skuMapper.selectList(new EntityWrapper<SkuDO>().eq("spu_id", spuDO.getId()));
+        spuDTO.setSkuList(skuDOList);
+
+        cacheComponent.delPrefixKey(GoodsBizService.CA_SPU_PAGE_PREFIX);
+        return spuDTO;
+    }
+}

+ 55 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/goods/AdminGroupShopGoodsService.java

@@ -0,0 +1,55 @@
+package com.iotechn.unimall.admin.api.goods;
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.annotation.param.Range;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.GroupShopSkuDO;
+import com.iotechn.unimall.data.dto.goods.GroupShopDTO;
+import com.iotechn.unimall.data.dto.goods.SpuDTO;
+import com.iotechn.unimall.data.model.Page;
+
+import java.util.List;
+
+@HttpOpenApi(group = "admin.groupShop", description = "管理团购商品服务")
+public interface AdminGroupShopGoodsService {
+
+    @HttpMethod(description = "增加", permission = "operation:groupShop:create", permissionParentName = "商品管理", permissionName = "团购商品管理")
+    public String addGroupShopSpu(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员Id") Long adminId,
+            @NotNull @HttpParam(name = "spuId", type = HttpParamType.COMMON, description = "spuId") Long spuId,
+            @NotNull @HttpParam(name = "gmtStart", type = HttpParamType.COMMON, description = "团购开始时间戳") Long gmtStart,
+            @NotNull @HttpParam(name = "gmtEnd", type = HttpParamType.COMMON, description = "团购结束时间戳") Long gmtEnd,
+            @NotNull @Range(min = 1) @HttpParam(name = "minimumNumber", type = HttpParamType.COMMON, description = "团购最低人数") Integer minimumNumber,
+            @NotNull @HttpParam(name = "automaticRefund", type = HttpParamType.COMMON, description = "团购人数未满是否自动退款")  Integer automaticRefund,
+            @NotNull @HttpParam(name = "groupShopSkuList", type = HttpParamType.COMMON, description = "团购sku链表") List groupShopSkuList) throws ServiceException;
+
+    @HttpMethod(description = "删除", permission = "operation:groupShop:delete", permissionParentName = "商品管理", permissionName = "团购商品管理")
+    public String deleteGroupShopSpu(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员Id") Long adminId,
+            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "团购商品的Id") Long id) throws  ServiceException;
+
+    @HttpMethod(description = "修改", permission = "operation:groupShop:update", permissionParentName = "商品管理", permissionName = "团购商品管理")
+    public GroupShopDTO editGroupShopSpu(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员Id") Long adminId,
+            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "团购商品spuID") Long id,
+            @NotNull @HttpParam(name = "spuId", type = HttpParamType.COMMON, description = "spuId") Long spuId,
+            @NotNull @HttpParam(name = "gmtStart", type = HttpParamType.COMMON, description = "团购开始时间戳") Long gmtStart,
+            @NotNull @HttpParam(name = "gmtEnd", type = HttpParamType.COMMON, description = "团购结束时间戳") Long gmtEnd,
+            @NotNull @Range(min = 1) @HttpParam(name = "minimumNumber", type = HttpParamType.COMMON, description = "团购最低人数") Integer minimumNumber,
+            @NotNull @HttpParam(name = "automaticRefund", type = HttpParamType.COMMON, description = "团购人数未满是否自动退款")  Integer automaticRefund,
+            @NotNull @HttpParam(name = "groupShopSkuList", type = HttpParamType.COMMON, description = "团购sku链表") List groupShopSkuDOList ) throws ServiceException;
+
+    @HttpMethod(description = "查询", permission = "operation:groupShop:query", permissionParentName = "商品管理", permissionName = "团购商品管理")
+    public Page<GroupShopDTO> queryGroupShop(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员Id") Long adminId,
+            @HttpParam(name = "id", type = HttpParamType.COMMON, description = "团购商品的ID") Long id,
+            @HttpParam(name = "spuName", type = HttpParamType.COMMON, description = "团购商品的名称") String spuName,
+            @HttpParam(name = "status", type = HttpParamType.COMMON, description = "团购商品的状态") Integer status,
+            @Range(min = 1) @HttpParam(name = "page", type = HttpParamType.COMMON, description = "团购商品页码", valueDef = "1") Integer page,
+            @Range(min = 1) @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "团购商品长度", valueDef = "20") Integer limit ) throws ServiceException;
+
+}

+ 290 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/goods/AdminGroupShopGoodsServiceImpl.java

@@ -0,0 +1,290 @@
+package com.iotechn.unimall.admin.api.goods;/*
+@PackageName:com.iotechn.unimall.admin.api.goods
+@ClassName: AdminGroupShopGoodsServiceImpl
+@Description:
+@author kbq
+@date 19-11-13下午4:21
+*/
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.iotechn.unimall.admin.api.order.AdminOrderService;
+import com.iotechn.unimall.core.exception.AdminServiceException;
+import com.iotechn.unimall.core.exception.ExceptionDefinition;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.component.CacheComponent;
+import com.iotechn.unimall.data.domain.*;
+import com.iotechn.unimall.data.dto.goods.GroupShopSkuDTO;
+import com.iotechn.unimall.data.dto.goods.GroupShopDTO;
+import com.iotechn.unimall.data.enums.GroupShopAutomaticRefundType;
+import com.iotechn.unimall.data.enums.StatusType;
+import com.iotechn.unimall.data.mapper.*;
+import com.iotechn.unimall.data.model.Page;
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+
+import java.util.Comparator;
+import java.util.Date;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+@EnableScheduling
+public class AdminGroupShopGoodsServiceImpl implements AdminGroupShopGoodsService {
+
+    @Autowired
+    private SkuMapper skuMapper;
+
+    @Autowired
+    private SpuMapper spuMapper;
+
+    @Autowired
+    private GroupShopMapper groupShopMapper;
+
+    @Autowired
+    private GroupShopSkuMapper groupShopSkuMapper;
+
+    @Autowired
+    private CacheComponent cacheComponent;
+
+    private static final String GROUP_SHOP_CACHE = "CA_GROUP_SHOP";
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String addGroupShopSpu(Long adminId, Long spuId, Long gmtStart, Long gmtEnd, Integer minimumNumber, Integer automaticRefund, List groupShopSkuList) throws ServiceException {
+        // 1.转化为对应的GroupShopSkuDo类的链表
+        List<GroupShopSkuDO> groupShopSkuDOList = (List<GroupShopSkuDO>) groupShopSkuList.stream().map(t -> {
+            GroupShopSkuDO groupShopSkuDO = JSONObject.toJavaObject((JSON) t, GroupShopSkuDO.class);
+            return groupShopSkuDO;
+        }).sorted(Comparator.comparingInt(o -> ((GroupShopSkuDO) o).getSkuGroupShopPrice())).collect(Collectors.toList());
+
+        if (gmtStart.compareTo(gmtEnd) >= 0) {
+            throw new AdminServiceException(ExceptionDefinition.GROUP_SHOP_START_MUST_LESS_THAN_END);
+        }
+
+        // 2.检验数据库中是否存在spuId对应的sku
+        SpuDO spuDO = spuMapper.selectById(spuId);
+        List<SkuDO> skuDOList = skuMapper.selectList((new EntityWrapper<SkuDO>().eq("spu_id", spuId)));
+        if (spuDO == null || CollectionUtils.isEmpty(skuDOList)) {
+            throw new AdminServiceException(ExceptionDefinition.SPU_NO_EXITS_OR_ONLY_SPU);
+        }
+        // 2.1 检验groupShop表中是否存在此商品
+        Integer count = groupShopMapper.selectCount((new EntityWrapper<GroupShopDO>().eq("spu_id", spuId)));
+        if (count > 0) {
+            throw new AdminServiceException(ExceptionDefinition.GROUP_SHOP_ALREADY_EXIT);
+        }
+
+        Date timeStart = new Date(gmtStart);
+        Date timeEnd = new Date(gmtEnd);
+        Date now = new Date();
+        GroupShopDO groupShopDO = new GroupShopDO();
+
+        groupShopDO.setAlreadyBuyNumber(0);
+        groupShopDO.setMinimumNumber(minimumNumber);
+        groupShopDO.setGmtStart(timeStart);
+        groupShopDO.setGmtEnd(timeEnd);
+        groupShopDO.setAutomaticRefund(automaticRefund.compareTo(0) > 0 ? GroupShopAutomaticRefundType.YES.getCode() : GroupShopAutomaticRefundType.NO.getCode());
+        groupShopDO.setSpuId(spuId);
+        groupShopDO.setMinPrice(groupShopSkuDOList.get(0).getSkuGroupShopPrice());
+        groupShopDO.setMaxPrice(groupShopSkuDOList.get(groupShopSkuDOList.size() - 1).getSkuGroupShopPrice());
+        groupShopDO.setGmtCreate(now);
+        groupShopDO.setGmtUpdate(now);
+        // 3.设置是否在活动时间的状态
+        setGroupShopStatus(now, gmtStart, gmtEnd, spuDO, groupShopDO);
+        if (groupShopMapper.insert(groupShopDO) <= 0) {
+            throw new AdminServiceException(ExceptionDefinition.GROUP_SHOP_SPU_ADD_SQL_QUERY_ERROR);
+        }
+
+        if (skuDOList.size() != groupShopSkuDOList.size()) {
+            throw new AdminServiceException(ExceptionDefinition.GROUP_SHOP_SKU_NUMBER_ERROR);
+        }
+        // 4.插入groupShopSkuList
+        this.insertGroupShopSkuList(groupShopSkuDOList, skuDOList, groupShopDO.getId(), now);
+        cacheComponent.delPrefixKey(GROUP_SHOP_CACHE);
+        return "ok";
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String deleteGroupShopSpu(Long adminId, Long id) throws ServiceException {
+
+        GroupShopDO groupShopDO = groupShopMapper.selectById(id);
+        if (groupShopDO == null) {
+            throw new AdminServiceException(ExceptionDefinition.SPU_NO_EXITS_OR_ONLY_SPU);
+        }
+
+        if (groupShopDO.getStatus() > 0) {
+            throw new AdminServiceException(ExceptionDefinition.GROUP_SHOP_ALREAD_ATCIVE);
+        }
+
+        if (groupShopMapper.deleteById(id) <= 0) {
+            throw new AdminServiceException(ExceptionDefinition.GROUP_SHOP_SPU_DELETE_SQL_QUERY_ERROR);
+        }
+        if (groupShopSkuMapper.delete((new EntityWrapper<GroupShopSkuDO>().eq("group_shop_id", id))) <= 0) {
+            throw new AdminServiceException(ExceptionDefinition.GROUP_SHOP_SKU_DELETE_SQL_QUERY_ERROR);
+        }
+
+        cacheComponent.delPrefixKey(GROUP_SHOP_CACHE);
+        return "ok";
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public GroupShopDTO editGroupShopSpu(Long adminId, Long id, Long spuId, Long gmtStart, Long gmtEnd, Integer minimumNumber, Integer automaticRefund, List groupShopSkuList) throws ServiceException {
+        // 1.转化为对应的GroupShopSkuDo类的链表
+        List<GroupShopSkuDO> groupShopSkuDOList = (List<GroupShopSkuDO>) groupShopSkuList.stream().map(t -> {
+            GroupShopSkuDO groupShopSkuDO = JSONObject.toJavaObject((JSON) t, GroupShopSkuDO.class);
+            return groupShopSkuDO;
+        }).sorted(Comparator.comparingInt(o -> ((GroupShopSkuDO) o).getSkuGroupShopPrice())).collect(Collectors.toList());
+
+        if (gmtStart.compareTo(gmtEnd) >= 0) {
+            throw new AdminServiceException(ExceptionDefinition.GROUP_SHOP_START_MUST_LESS_THAN_END);
+        }
+
+        SpuDO spuDO = spuMapper.selectById(spuId);
+        List<SkuDO> skuDOList = skuMapper.selectList((new EntityWrapper<SkuDO>().eq("spu_id", spuId)));
+        if (spuDO == null || CollectionUtils.isEmpty(skuDOList)) {
+            throw new AdminServiceException(ExceptionDefinition.SPU_NO_EXITS_OR_ONLY_SPU);
+        }
+
+        GroupShopDO groupShopDO = groupShopMapper.selectById(id);
+        if (groupShopDO == null) {
+            throw new AdminServiceException(ExceptionDefinition.GROUP_SHOP_SPU_NO_EXITS);
+        }
+
+        if (groupShopDO.getStatus() > 0) {
+            throw new AdminServiceException(ExceptionDefinition.GROUP_SHOP_ALREAD_ATCIVE);
+        }
+
+        Date timeStart = new Date(gmtStart);
+        Date timeEnd = new Date(gmtEnd);
+        Date now = new Date();
+
+        groupShopDO.setMinimumNumber(minimumNumber);
+        groupShopDO.setGmtStart(timeStart);
+        groupShopDO.setGmtEnd(timeEnd);
+        groupShopDO.setAutomaticRefund(automaticRefund.compareTo(0) > 0 ? StatusType.ACTIVE.getCode() : StatusType.LOCK.getCode());
+        groupShopDO.setSpuId(spuId);
+        groupShopDO.setMinPrice(groupShopSkuDOList.get(0).getSkuGroupShopPrice());
+        groupShopDO.setMinPrice(groupShopSkuDOList.get(groupShopSkuDOList.size() - 1).getSkuGroupShopPrice());
+        groupShopDO.setGmtUpdate(now);
+        this.setGroupShopStatus(now, gmtStart, gmtEnd, spuDO, groupShopDO);
+        if (groupShopMapper.updateById(groupShopDO) <= 0) {
+            throw new AdminServiceException(ExceptionDefinition.GROUP_SHOP_SPU_UPDATE_SQL_QUERY_ERROR);
+        }
+
+        if (groupShopSkuMapper.delete((new EntityWrapper<GroupShopSkuDO>().eq("group_shop_id", id))) <= 0) {
+            throw new AdminServiceException(ExceptionDefinition.GROUP_SHOP_SKU_DELETE_SQL_QUERY_ERROR);
+        }
+
+        if (skuDOList.size() != groupShopSkuDOList.size()) {
+            throw new AdminServiceException(ExceptionDefinition.GROUP_SHOP_SKU_NUMBER_ERROR);
+        }
+        // 4.插入groupShopSkuList
+        this.insertGroupShopSkuList(groupShopSkuDOList, skuDOList, groupShopDO.getId(), now);
+        cacheComponent.delPrefixKey(GROUP_SHOP_CACHE);
+        return new GroupShopDTO();
+    }
+
+    @Override
+    public Page<GroupShopDTO> queryGroupShop(Long adminId, Long id, String spuName, Integer status, Integer page, Integer limit) throws ServiceException {
+        EntityWrapper<GroupShopDO> groupShopSpuDOEntityWrapper = new EntityWrapper<GroupShopDO>();
+        if (id != null) {
+            groupShopSpuDOEntityWrapper.eq("id", id);
+        }
+
+        if (status != null) {
+            groupShopSpuDOEntityWrapper.eq("status", status);
+        }
+
+        if (spuName != null) {
+            EntityWrapper<SpuDO> spuDOEntityWrapper = new EntityWrapper<>();
+            spuDOEntityWrapper.setSqlSelect("id");
+            spuDOEntityWrapper.like("title", spuName);
+            List<Object> objectList = spuMapper.selectObjs(spuDOEntityWrapper);
+            List<String> collect = objectList.stream().map(s -> String.valueOf(s)).collect(Collectors.toList());
+            groupShopSpuDOEntityWrapper.in("spu_id", collect);
+        }
+
+        List<GroupShopDO> groupShopDOList = groupShopMapper.selectPage(new RowBounds((page - 1) * limit, limit), groupShopSpuDOEntityWrapper);
+        Integer count = groupShopMapper.selectCount(groupShopSpuDOEntityWrapper);
+        List<GroupShopDTO> groupShopDTOList = new LinkedList<>();
+
+        for (GroupShopDO groupShopDO : groupShopDOList) {
+            GroupShopDTO groupShopDTO = new GroupShopDTO();
+            SpuDO spuDO = spuMapper.selectById(groupShopDO.getSpuId());
+            BeanUtils.copyProperties(spuDO, groupShopDTO);
+            BeanUtils.copyProperties(groupShopDO, groupShopDTO);
+            /**
+             * 添加groupShopSkuDTOList
+             */
+            List<SkuDO> skuDOList = skuMapper.selectList((new EntityWrapper<SkuDO>().eq("spu_id", spuDO.getId())));
+            List<GroupShopSkuDO> groupShopSkuDOList = groupShopSkuMapper.selectList((new EntityWrapper<GroupShopSkuDO>()).eq("group_shop_id", groupShopDO.getId()));
+            List<GroupShopSkuDTO> groupShopSkuDTOList = groupShopSkuDOList.stream().map(s -> {
+                GroupShopSkuDTO groupShopSkuDTO = new GroupShopSkuDTO();
+                BeanUtils.copyProperties(s, groupShopSkuDTO);
+                return groupShopSkuDTO;
+            }).collect(Collectors.toList());
+
+            for (SkuDO skuDO : skuDOList) {
+                for (GroupShopSkuDTO groupShopSkuDTO : groupShopSkuDTOList) {
+                    if (groupShopSkuDTO.getSkuId().equals(skuDO.getId())) {
+                        BeanUtils.copyProperties(skuDO, groupShopSkuDTO);
+                        break;
+                    }
+                }
+            }
+            groupShopDTO.setGroupShopSkuDTOList(groupShopSkuDTOList);
+            groupShopDTOList.add(groupShopDTO);
+        }
+        return new Page<GroupShopDTO>(groupShopDTOList, page, limit, count);
+    }
+
+    private void setGroupShopStatus(Date now, Long gmtStart, Long gmtEnd, SpuDO spuDO, GroupShopDO groupShopDO) {
+        if (now.getTime() >= gmtStart.longValue() && now.getTime() < gmtEnd.longValue()) {
+            //3.1 商品本身是否处于下架状态
+            if (spuDO.getStatus().equals(StatusType.ACTIVE.getCode())) {
+                groupShopDO.setStatus(StatusType.ACTIVE.getCode());
+            } else {
+                groupShopDO.setStatus(StatusType.LOCK.getCode());
+            }
+        } else {
+            groupShopDO.setStatus(StatusType.LOCK.getCode());
+        }
+    }
+
+    private void insertGroupShopSkuList(List<GroupShopSkuDO> groupShopSkuDOList, List<SkuDO> skuDOList, Long groupShopId, Date now) throws ServiceException {
+        for (GroupShopSkuDO groupShopSkuDO : groupShopSkuDOList) {
+            boolean judge = false;
+            for (SkuDO sku : skuDOList) {
+                if (sku.getId().equals(groupShopSkuDO.getSkuId())) {
+                    judge = true;
+                    break;
+                }
+            }
+
+            if (!judge) {
+                throw new AdminServiceException(ExceptionDefinition.GROUP_SHOP_SKU_ID_ERROR);
+            }
+
+            if (groupShopSkuDO.getSkuGroupShopPrice() == null || groupShopSkuDO.getSkuGroupShopPrice().equals(0)) {
+                throw new AdminServiceException(ExceptionDefinition.GROUP_SHOP_SKU_PRICE_ERROR);
+            }
+
+            groupShopSkuDO.setGroupShopId(groupShopId);
+            groupShopSkuDO.setGmtCreate(now);
+            groupShopSkuDO.setGmtUpdate(now);
+            if (groupShopSkuMapper.insert(groupShopSkuDO) <= 0) {
+                throw new AdminServiceException(ExceptionDefinition.GROUP_SHOP_SKU_ADD_SQL_QUERY_ERROR);
+            }
+        }
+    }
+
+}

+ 40 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/log/loginLog/SysLogininforService.java

@@ -0,0 +1,40 @@
+package com.iotechn.unimall.admin.api.log.loginLog;
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.log.SysLogininfor;
+import com.iotechn.unimall.data.model.Page;
+
+@HttpOpenApi(group = "admin.log.logininfor", description = "登陆日志管理")
+public interface SysLogininforService {
+	@HttpMethod(description = "登陆日志列表", permission = "admin:log:logininfor:list", permissionParentName = "日志管理", permissionName = "登陆日志管理")
+	public Page<SysLogininfor> list(
+			@HttpParam(name = "ipaddr", type = HttpParamType.COMMON, description = "登录地址") String ipaddr,
+			@HttpParam(name = "userName", type = HttpParamType.COMMON, description = "用户名称") String userName,
+			@HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态") String status,
+			@HttpParam(name = "beginTime", type = HttpParamType.COMMON, description = "登陆开始时间") String beginTime,
+			@HttpParam(name = "endTime", type = HttpParamType.COMMON, description = "登陆结束时间") String endTime,
+			@HttpParam(name = "pageNum", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+			@HttpParam(name = "pageSize", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+			throws ServiceException;
+	@HttpMethod(description = "删除登陆日志", permission = "admin:log:logininfor:delete", permissionParentName = "日志管理", permissionName = "登陆日志管理")
+	public Boolean delete(
+			@NotNull @HttpParam(name = "infoIds", type = HttpParamType.COMMON, description = "日志Id") String infoIds)
+			throws ServiceException;
+	
+	@HttpMethod(description = "清空登陆日志", permission = "admin:log:logininfor:clean", permissionParentName = "日志管理", permissionName = "登陆日志管理")
+	public Boolean clean()throws ServiceException;
+	
+	@HttpMethod(description = "导出日志列表", permission = "admin:log:logininfor:export", permissionParentName = "日志管理", permissionName = "登陆日志管理")
+	public String export(
+			@HttpParam(name = "ipaddr", type = HttpParamType.COMMON, description = "登录地址") String ipaddr,
+			@HttpParam(name = "userName", type = HttpParamType.COMMON, description = "用户名称") String userName,
+			@HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态") String status,
+			@HttpParam(name = "beginTime", type = HttpParamType.COMMON, description = "登陆开始时间") String beginTime,
+			@HttpParam(name = "endTime", type = HttpParamType.COMMON, description = "登陆结束时间") String endTime)
+			throws ServiceException;
+}

+ 87 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/log/loginLog/SysLogininforServiceImpl.java

@@ -0,0 +1,87 @@
+package com.iotechn.unimall.admin.api.log.loginLog;
+
+import java.util.List;
+
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.log.SysLogininfor;
+import com.iotechn.unimall.data.mapper.log.SysLogininforMapper;
+import com.iotechn.unimall.data.model.Page;
+import com.iotechn.unimall.data.util.ExcelUtil;
+
+/**
+ * 
+ * @author dyl
+ *
+ */
+@Service
+public class SysLogininforServiceImpl implements SysLogininforService {
+
+	@Autowired
+	private SysLogininforMapper logininforMapper;
+
+	@Override
+	public Page<SysLogininfor> list(String ipaddr, String userName, String status, String beginTime, String endTime,
+			Integer page, Integer limit) throws ServiceException {
+		Wrapper<SysLogininfor> wrapper = new EntityWrapper<SysLogininfor>();
+		if (!StringUtils.isEmpty(ipaddr)) {
+			wrapper.like("ipaddr", ipaddr);
+		}
+		if (!StringUtils.isEmpty(userName)) {
+			wrapper.like("user_name", userName);
+		}
+		if (!StringUtils.isEmpty(status)) {
+			wrapper.eq("status", status);
+		}
+		if (!StringUtils.isEmpty(beginTime) && !StringUtils.isEmpty(endTime)) {
+			wrapper.between("login_time", beginTime, endTime);
+		}
+		wrapper.orderBy("info_id", false);
+		List<SysLogininfor> SysOperLogS = logininforMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+		Integer count = logininforMapper.selectCount(wrapper);
+		return new Page<SysLogininfor>(SysOperLogS, page, limit, count);
+	}
+
+	@Override
+	public Boolean delete(String infoIds) throws ServiceException {
+		String[] ids = infoIds.split(",");
+		Wrapper<SysLogininfor> wrapper = new EntityWrapper<SysLogininfor>();
+		wrapper.in("info_id", ids);
+		return logininforMapper.delete(wrapper) > 0;
+	}
+
+	@Override
+	public Boolean clean() throws ServiceException {
+		Wrapper<SysLogininfor> wrapper = new EntityWrapper<SysLogininfor>();
+		wrapper.eq("1", 1);
+		return logininforMapper.delete(wrapper) > 0;
+	}
+
+	@Override
+	public String export(String ipaddr, String userName, String status, String beginTime, String endTime)
+			throws ServiceException {
+		Wrapper<SysLogininfor> wrapper = new EntityWrapper<SysLogininfor>();
+		if (!StringUtils.isEmpty(ipaddr)) {
+			wrapper.like("ipaddr", ipaddr);
+		}
+		if (!StringUtils.isEmpty(userName)) {
+			wrapper.like("user_name", userName);
+		}
+		if (!StringUtils.isEmpty(status)) {
+			wrapper.eq("status", status);
+		}
+		if (!StringUtils.isEmpty(beginTime) && !StringUtils.isEmpty(endTime)) {
+			wrapper.between("login_time", beginTime, endTime);
+		}
+		List<SysLogininfor> list = logininforMapper.selectList(wrapper);
+		ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);
+		return util.exportExcel(list, "操作日志");
+	}
+
+}

+ 40 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/log/operLog/OperLogService.java

@@ -0,0 +1,40 @@
+package com.iotechn.unimall.admin.api.log.operLog;
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.log.SysOperLog;
+import com.iotechn.unimall.data.model.Page;
+
+@HttpOpenApi(group = "admin.log.operlog", description = "操作日志管理")
+public interface OperLogService {
+	@HttpMethod(description = "操作日志列表", permission = "admin:log:operlog:list", permissionParentName = "日志管理", permissionName = "操作日志管理")
+	public Page<SysOperLog> list(
+			@HttpParam(name = "title", type = HttpParamType.COMMON, description = "系统模块") String title,
+			@HttpParam(name = "operName", type = HttpParamType.COMMON, description = "操作人员") String operName,
+			@HttpParam(name = "businessType", type = HttpParamType.COMMON, description = "操作类型") String businessType,
+			@HttpParam(name = "beginTime", type = HttpParamType.COMMON, description = "操作开始时间") String beginTime,
+			@HttpParam(name = "endTime", type = HttpParamType.COMMON, description = "操作结束时间") String endTime,
+			@HttpParam(name = "pageNum", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+			@HttpParam(name = "pageSize", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+			throws ServiceException;
+	@HttpMethod(description = "删除操作日志", permission = "admin:log:operlog:delete", permissionParentName = "日志管理", permissionName = "操作日志管理")
+	public Boolean delete(
+			@NotNull @HttpParam(name = "operIds", type = HttpParamType.COMMON, description = "日志Id") String operIds)
+			throws ServiceException;
+	
+	@HttpMethod(description = "清空操作日志", permission = "admin:log:operlog:clean", permissionParentName = "日志管理", permissionName = "操作日志管理")
+	public Boolean clean()throws ServiceException;
+	
+	@HttpMethod(description = "导出日志列表", permission = "admin:log:operlog:export", permissionParentName = "日志管理", permissionName = "操作日志管理")
+	public String export(
+			@HttpParam(name = "title", type = HttpParamType.COMMON, description = "系统模块") String title,
+			@HttpParam(name = "operName", type = HttpParamType.COMMON, description = "操作人员") String operName,
+			@HttpParam(name = "businessType", type = HttpParamType.COMMON, description = "操作类型") String businessType,
+			@HttpParam(name = "beginTime", type = HttpParamType.COMMON, description = "操作开始时间") String beginTime,
+			@HttpParam(name = "endTime", type = HttpParamType.COMMON, description = "操作结束时间") String endTime)
+			throws ServiceException;
+}

+ 87 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/log/operLog/OperLogServiceImpl.java

@@ -0,0 +1,87 @@
+package com.iotechn.unimall.admin.api.log.operLog;
+
+import java.util.List;
+
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.log.SysOperLog;
+import com.iotechn.unimall.data.mapper.log.SysOperLogMapper;
+import com.iotechn.unimall.data.model.Page;
+import com.iotechn.unimall.data.util.ExcelUtil;
+
+/**
+ * 
+ * @author dyl
+ *
+ */
+@Service
+public class OperLogServiceImpl implements OperLogService {
+
+	@Autowired
+	private SysOperLogMapper operLogMapper;
+
+	@Override
+	public Page<SysOperLog> list(String title, String operName, String businessType, String beginTime, String endTime,
+			Integer page, Integer limit) throws ServiceException {
+		Wrapper<SysOperLog> wrapper = new EntityWrapper<SysOperLog>();
+		if (!StringUtils.isEmpty(title)) {
+			wrapper.like("title", title);
+		}
+		if (!StringUtils.isEmpty(operName)) {
+			wrapper.like("oper_name", operName);
+		}
+		if (!StringUtils.isEmpty(businessType)) {
+			wrapper.eq("business_type", businessType);
+		}
+		if (!StringUtils.isEmpty(beginTime) && !StringUtils.isEmpty(endTime)) {
+			wrapper.between("oper_time", beginTime, endTime);
+		}
+		wrapper.orderBy("oper_id", false);
+		List<SysOperLog> SysOperLogS = operLogMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+		Integer count = operLogMapper.selectCount(wrapper);
+		return new Page<SysOperLog>(SysOperLogS, page, limit, count);
+	}
+
+	@Override
+	public Boolean delete(String operIds) throws ServiceException {
+		String[] ids = operIds.split(",");
+		Wrapper<SysOperLog> wrapper = new EntityWrapper<SysOperLog>();
+		wrapper.in("oper_id", ids);
+		return operLogMapper.delete(wrapper) > 0;
+	}
+
+	@Override
+	public Boolean clean() throws ServiceException {
+		Wrapper<SysOperLog> wrapper = new EntityWrapper<SysOperLog>();
+		wrapper.eq("1", 1);
+		return operLogMapper.delete(wrapper) > 0;
+	}
+
+	@Override
+	public String export(String title, String operName, String businessType, String beginTime, String endTime)
+			throws ServiceException {
+		Wrapper<SysOperLog> wrapper = new EntityWrapper<SysOperLog>();
+		if (!StringUtils.isEmpty(title)) {
+			wrapper.like("title", title);
+		}
+		if (!StringUtils.isEmpty(operName)) {
+			wrapper.like("oper_name", operName);
+		}
+		if (!StringUtils.isEmpty(businessType)) {
+			wrapper.eq("business_type", businessType);
+		}
+		if (!StringUtils.isEmpty(beginTime) && !StringUtils.isEmpty(endTime)) {
+			wrapper.between("oper_time", beginTime, endTime);
+		}
+		List<SysOperLog> list = operLogMapper.selectList(wrapper);
+		ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
+		return util.exportExcel(list, "操作日志");
+	}
+
+}

+ 66 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/IMarketAdvertisementInfoService.java

@@ -0,0 +1,66 @@
+package com.iotechn.unimall.admin.api.market;
+
+
+import com.iotechn.unimall.data.domain.market.MarketAdvertisementInfo;
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.model.Page;
+
+import java.util.Date;
+
+/**
+ * 广告信息Service接口
+ *
+ * @author jlb
+ * @date 2022-08-01
+ */
+@HttpOpenApi(group = "admin.market.marketAdvertisementInfo", description = "广告信息")
+public interface IMarketAdvertisementInfoService {
+    @HttpMethod(description = "新增", permission = "admin:market:marketAdvertisementInfo:add", permissionParentName = "宠物管理", permissionName = "广告信息管理")
+    public Boolean add(@NotNull @HttpParam(name = "marketAdvertisementInfo", type = HttpParamType.COMMON, description = "广告信息") MarketAdvertisementInfo marketAdvertisementInfo,
+                       @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "adminId") Long adminId) throws ServiceException;
+
+    @HttpMethod(description = "列表", permission = "admin:market:marketAdvertisementInfo:list", permissionParentName = "宠物管理", permissionName = "广告信息管理")
+    public Page<MarketAdvertisementInfo> list(
+            @HttpParam(name = "companyId", type = HttpParamType.COMMON, description = "") Long companyId,
+            @HttpParam(name = "advertisementName", type = HttpParamType.COMMON, description = "广告名称") String advertisementName,
+            @HttpParam(name = "url", type = HttpParamType.COMMON, description = "图片") String url,
+            @HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态") String status,
+            @HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "0:否(默认) 1:是") Integer deleteFlag,
+            @HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+            @HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+            @HttpParam(name = "userId", type = HttpParamType.COMMON, description = "") Long userId,
+            @HttpParam(name = "adminId", type = HttpParamType.COMMON, description = "") Long adminId,
+            @HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+            throws ServiceException;
+
+    @HttpMethod(description = "删除", permission = "admin:market:marketAdvertisementInfo:delete", permissionParentName = "宠物管理", permissionName = "广告信息管理")
+    public Boolean delete(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "") String id) throws ServiceException;
+
+    @HttpMethod(description = "修改", permission = "admin:market:marketAdvertisementInfo:update", permissionParentName = "宠物管理", permissionName = "广告信息管理")
+    public Boolean update(@NotNull @HttpParam(name = "marketAdvertisementInfo", type = HttpParamType.COMMON, description = "广告信息") MarketAdvertisementInfo marketAdvertisementInfo,
+                          @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "adminId") Long adminId) throws ServiceException;
+
+    @HttpMethod(description = "查询", permission = "admin:market:marketAdvertisementInfo:get", permissionParentName = "宠物管理", permissionName = "广告信息管理")
+    public MarketAdvertisementInfo get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "") Long id) throws ServiceException;
+
+    @HttpMethod(description = "导出excl表", permission = "admin:market:marketAdvertisementInfo:export", permissionParentName = "宠物管理", permissionName = "广告信息管理")
+    public String export(
+            @HttpParam(name = "companyId", type = HttpParamType.COMMON, description = "") Long companyId,
+            @HttpParam(name = "advertisementName", type = HttpParamType.COMMON, description = "广告名称") String advertisementName,
+            @HttpParam(name = "url", type = HttpParamType.COMMON, description = "图片") String url,
+            @HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态") String status,
+            @HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "0:否(默认) 1:是") Integer deleteFlag,
+            @HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+            @HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+            @HttpParam(name = "userId", type = HttpParamType.COMMON, description = "") Long userId,
+            @HttpParam(name = "adminId", type = HttpParamType.COMMON, description = "") Long adminId,
+            @HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit) throws ServiceException;
+
+}

+ 50 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/IMarketCaseService.java

@@ -0,0 +1,50 @@
+package com.iotechn.unimall.admin.api.market;
+
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.market.MarketCase;
+import com.iotechn.unimall.data.model.Page;
+import java.util.Date;
+
+/**
+ * 关注Service接口
+ * 
+ * @author jlb
+ * @date 2023-02-03
+ */
+@HttpOpenApi(group = "admin.unimall.marketCase", description = "关注")
+public interface IMarketCaseService{
+	@HttpMethod(description = "新增")
+	public Boolean add(@NotNull @HttpParam(name = "marketCase", type = HttpParamType.COMMON, description = "关注") MarketCase marketCase,
+						   @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "adminId") Long adminId)throws ServiceException;
+
+	@HttpMethod(description = "列表")
+	public Page<MarketCase> list(
+								@HttpParam(name = "concernedId", type = HttpParamType.COMMON, description = "被关注人id") String concernedId,
+							@HttpParam(name = "followersId", type = HttpParamType.COMMON, description = "关注人id") String followersId,
+					@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+		@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+		throws ServiceException;
+
+	@HttpMethod(description = "删除")
+	public Boolean delete(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = " ")String id)throws ServiceException;
+
+	@HttpMethod(description = "修改")
+	public Boolean update(@NotNull @HttpParam(name = "marketCase", type = HttpParamType.COMMON, description = "关注") MarketCase marketCase,
+						  @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "adminId") Long adminId)throws ServiceException;
+
+	@HttpMethod(description = "查询")
+	public MarketCase get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = " ")Long id)throws ServiceException;
+	
+	@HttpMethod(description = "导出excl表", permission = "admin:unimall:marketCase:export",permissionParentName = "宠物管理", permissionName = "关注管理")
+	public String export(@HttpParam(name = "concernedId", type = HttpParamType.COMMON, description = "被关注人id") String concernedId,
+							@HttpParam(name = "followersId", type = HttpParamType.COMMON, description = "关注人id") String followersId,
+				@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+	@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)throws ServiceException;
+	
+}

+ 67 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/IMarketCircleInfoService.java

@@ -0,0 +1,67 @@
+package com.iotechn.unimall.admin.api.market;
+
+
+import com.iotechn.unimall.data.domain.market.MarketCircleInfo;
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.model.Page;
+import java.util.Date;
+
+/**
+ * 生鲜圈Service接口
+ * 
+ * @author jlb
+ * @date 2023-01-03
+ */
+@HttpOpenApi(group = "admin.market.marketCircleInfo", description = "生鲜圈")
+public interface IMarketCircleInfoService{
+	@HttpMethod(description = "新增", permission = "admin:market:marketCircleInfo:add", permissionParentName = "宠物管理", permissionName = "生鲜圈管理")
+	public Boolean add(@NotNull @HttpParam(name = "marketCircleInfo", type = HttpParamType.COMMON, description = "生鲜圈") MarketCircleInfo marketCircleInfo,
+						   @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "adminId") Long adminId)throws ServiceException;
+
+	@HttpMethod(description = "列表", permission = "admin:market:marketCircleInfo:list",permissionParentName = "宠物管理", permissionName = "生鲜圈管理")
+	public Page<MarketCircleInfo> list(
+								@HttpParam(name = "companyId", type = HttpParamType.COMMON, description = "") Long companyId,
+							@HttpParam(name = "shopId", type = HttpParamType.COMMON, description = "店铺id") Long shopId,
+							@HttpParam(name = "content", type = HttpParamType.COMMON, description = "内容") String content,
+							@HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态") String status,
+							@HttpParam(name = "url", type = HttpParamType.COMMON, description = "附件") String url,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "0:否(默认) 1:是") Integer deleteFlag,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "userId", type = HttpParamType.COMMON, description = "") Long userId,
+							@HttpParam(name = "adminId", type = HttpParamType.COMMON, description = "") Long adminId,
+					@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+		@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+		throws ServiceException;
+
+	@HttpMethod(description = "删除", permission = "admin:market:marketCircleInfo:delete",permissionParentName = "宠物管理", permissionName = "生鲜圈管理")
+	public Boolean delete(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")String id)throws ServiceException;
+
+	@HttpMethod(description = "修改", permission = "admin:market:marketCircleInfo:update",permissionParentName = "宠物管理", permissionName = "生鲜圈管理")
+	public Boolean update(@NotNull @HttpParam(name = "marketCircleInfo", type = HttpParamType.COMMON, description = "生鲜圈") MarketCircleInfo marketCircleInfo,
+						  @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "adminId") Long adminId)throws ServiceException;
+
+	@HttpMethod(description = "查询", permission = "admin:market:marketCircleInfo:get",permissionParentName = "宠物管理", permissionName = "生鲜圈管理")
+	public MarketCircleInfo get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")Long id)throws ServiceException;
+	
+	@HttpMethod(description = "导出excl表", permission = "admin:market:marketCircleInfo:export",permissionParentName = "宠物管理", permissionName = "生鲜圈管理")
+	public String export(
+								@HttpParam(name = "companyId", type = HttpParamType.COMMON, description = "") Long companyId,
+							@HttpParam(name = "shopId", type = HttpParamType.COMMON, description = "店铺id") Long shopId,
+							@HttpParam(name = "content", type = HttpParamType.COMMON, description = "内容") String content,
+							@HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态") String status,
+							@HttpParam(name = "url", type = HttpParamType.COMMON, description = "附件") String url,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "0:否(默认) 1:是") Integer deleteFlag,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "userId", type = HttpParamType.COMMON, description = "") Long userId,
+							@HttpParam(name = "adminId", type = HttpParamType.COMMON, description = "") Long adminId,
+				@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+	@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)throws ServiceException;
+	
+}

+ 70 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/IMarketOrderDetailService.java

@@ -0,0 +1,70 @@
+package com.iotechn.unimall.admin.api.market;
+
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.market.MarketOrderDetail;
+import com.iotechn.unimall.data.model.Page;
+
+import java.util.Date;
+
+/**
+ * 订单详情Service接口
+ *
+ * @author jlb
+ * @date 2022-08-01
+ */
+@HttpOpenApi(group = "admin.unimall.marketOrderDetail", description = "订单详情")
+public interface IMarketOrderDetailService {
+    @HttpMethod(description = "新增", permission = "admin:unimall:marketOrderDetail:add", permissionParentName = "宠物管理", permissionName = "订单详情管理")
+    public Boolean add(@NotNull @HttpParam(name = "marketOrderDetail", type = HttpParamType.COMMON, description = "订单详情") MarketOrderDetail marketOrderDetail,
+                       @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "adminId") Long adminId) throws ServiceException;
+
+    @HttpMethod(description = "列表", permission = "admin:unimall:marketOrderDetail:list", permissionParentName = "宠物管理", permissionName = "订单详情管理")
+    public Page<MarketOrderDetail> list(
+            @HttpParam(name = "companyId", type = HttpParamType.COMMON, description = "") Long companyId,
+            @HttpParam(name = "orderId", type = HttpParamType.COMMON, description = "订单id") String orderId,
+            @HttpParam(name = "name", type = HttpParamType.COMMON, description = "商品名称") String name,
+            @HttpParam(name = "price", type = HttpParamType.COMMON, description = "单价") Double price,
+            @HttpParam(name = "num", type = HttpParamType.COMMON, description = "数量") Long num,
+            @HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态") String status,
+            @HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "0:否(默认) 1:是") Integer deleteFlag,
+            @HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+            @HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+            @HttpParam(name = "userId", type = HttpParamType.COMMON, description = "") Long userId,
+            @HttpParam(name = "adminId", type = HttpParamType.COMMON, description = "") Long adminId,
+            @HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+            throws ServiceException;
+
+    @HttpMethod(description = "删除", permission = "admin:unimall:marketOrderDetail:delete", permissionParentName = "宠物管理", permissionName = "订单详情管理")
+    public Boolean delete(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "") String id) throws ServiceException;
+
+    @HttpMethod(description = "修改", permission = "admin:unimall:marketOrderDetail:update", permissionParentName = "宠物管理", permissionName = "订单详情管理")
+    public Boolean update(@NotNull @HttpParam(name = "marketOrderDetail", type = HttpParamType.COMMON, description = "订单详情") MarketOrderDetail marketOrderDetail,
+                          @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "adminId") Long adminId) throws ServiceException;
+
+    @HttpMethod(description = "查询", permission = "admin:unimall:marketOrderDetail:get", permissionParentName = "宠物管理", permissionName = "订单详情管理")
+    public MarketOrderDetail get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "") Long id) throws ServiceException;
+
+    @HttpMethod(description = "导出excl表", permission = "admin:unimall:marketOrderDetail:export", permissionParentName = "宠物管理", permissionName = "订单详情管理")
+    public String export(
+            @HttpParam(name = "companyId", type = HttpParamType.COMMON, description = "") Long companyId,
+            @HttpParam(name = "orderId", type = HttpParamType.COMMON, description = "订单id") String orderId,
+            @HttpParam(name = "name", type = HttpParamType.COMMON, description = "商品名称") String name,
+            @HttpParam(name = "price", type = HttpParamType.COMMON, description = "单价") Double price,
+            @HttpParam(name = "num", type = HttpParamType.COMMON, description = "数量") Long num,
+            @HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态") String status,
+            @HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "0:否(默认) 1:是") Integer deleteFlag,
+            @HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+            @HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+            @HttpParam(name = "userId", type = HttpParamType.COMMON, description = "") Long userId,
+            @HttpParam(name = "adminId", type = HttpParamType.COMMON, description = "") Long adminId,
+            @HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit) throws ServiceException;
+
+}

+ 68 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/IMarketOrderInfoService.java

@@ -0,0 +1,68 @@
+package com.iotechn.unimall.admin.api.market;
+
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.market.MarketOrderInfo;
+import com.iotechn.unimall.data.model.Page;
+
+import java.util.Date;
+
+/**
+ * 订单信息Service接口
+ *
+ * @author jlb
+ * @date 2022-08-01
+ */
+@HttpOpenApi(group = "admin.unimall.marketOrderInfo", description = "订单信息")
+public interface IMarketOrderInfoService {
+    @HttpMethod(description = "新增", permission = "admin:unimall:marketOrderInfo:add", permissionParentName = "宠物管理", permissionName = "订单信息管理")
+    public Boolean add(@NotNull @HttpParam(name = "marketOrderInfo", type = HttpParamType.COMMON, description = "订单信息") MarketOrderInfo marketOrderInfo,
+                       @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "adminId") Long adminId) throws ServiceException;
+
+    @HttpMethod(description = "列表", permission = "admin:unimall:marketOrderInfo:list", permissionParentName = "宠物管理", permissionName = "订单信息管理")
+    public Page<MarketOrderInfo> list(
+            @HttpParam(name = "companyId", type = HttpParamType.COMMON, description = "") Long companyId,
+            @HttpParam(name = "orderNo", type = HttpParamType.COMMON, description = "订单编号") String orderNo,
+            @HttpParam(name = "customer", type = HttpParamType.COMMON, description = "客户") String customer,
+            @HttpParam(name = "pets", type = HttpParamType.COMMON, description = "收货地址") String pets,
+            @HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态") String status,
+            @HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "0:否(默认) 1:是") Integer deleteFlag,
+            @HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+            @HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+            @HttpParam(name = "userId", type = HttpParamType.COMMON, description = "") Long userId,
+            @HttpParam(name = "adminId", type = HttpParamType.COMMON, description = "") Long adminId,
+            @HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+            throws ServiceException;
+
+    @HttpMethod(description = "删除", permission = "admin:unimall:marketOrderInfo:delete", permissionParentName = "宠物管理", permissionName = "订单信息管理")
+    public Boolean delete(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "") String id) throws ServiceException;
+
+    @HttpMethod(description = "修改", permission = "admin:unimall:marketOrderInfo:update", permissionParentName = "宠物管理", permissionName = "订单信息管理")
+    public Boolean update(@NotNull @HttpParam(name = "marketOrderInfo", type = HttpParamType.COMMON, description = "订单信息") MarketOrderInfo marketOrderInfo,
+                          @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "adminId") Long adminId) throws ServiceException;
+
+    @HttpMethod(description = "查询", permission = "admin:unimall:marketOrderInfo:get", permissionParentName = "宠物管理", permissionName = "订单信息管理")
+    public MarketOrderInfo get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "") Long id) throws ServiceException;
+
+    @HttpMethod(description = "导出excl表", permission = "admin:unimall:marketOrderInfo:export", permissionParentName = "宠物管理", permissionName = "订单信息管理")
+    public String export(
+            @HttpParam(name = "companyId", type = HttpParamType.COMMON, description = "") Long companyId,
+            @HttpParam(name = "orderNo", type = HttpParamType.COMMON, description = "订单编号") String orderNo,
+            @HttpParam(name = "customer", type = HttpParamType.COMMON, description = "客户") String customer,
+            @HttpParam(name = "pets", type = HttpParamType.COMMON, description = "收货地址") String pets,
+            @HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态") String status,
+            @HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "0:否(默认) 1:是") Integer deleteFlag,
+            @HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+            @HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+            @HttpParam(name = "userId", type = HttpParamType.COMMON, description = "") Long userId,
+            @HttpParam(name = "adminId", type = HttpParamType.COMMON, description = "") Long adminId,
+            @HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit) throws ServiceException;
+
+}

+ 74 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/IMarketProdectInfoService.java

@@ -0,0 +1,74 @@
+package com.iotechn.unimall.admin.api.market;
+
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.market.MarketProdectInfo;
+import com.iotechn.unimall.data.model.Page;
+
+import java.util.Date;
+
+/**
+ * 商品信息Service接口
+ *
+ * @author jlb
+ * @date 2022-08-01
+ */
+@HttpOpenApi(group = "admin.unimall.marketProdectInfo", description = "商品信息")
+public interface IMarketProdectInfoService {
+    @HttpMethod(description = "新增", permission = "admin:unimall:marketProdectInfo:add", permissionParentName = "宠物管理", permissionName = "商品信息管理")
+    public Boolean add(@NotNull @HttpParam(name = "marketProdectInfo", type = HttpParamType.COMMON, description = "商品信息") MarketProdectInfo marketProdectInfo,
+                       @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "adminId") Long adminId) throws ServiceException;
+
+    @HttpMethod(description = "列表", permission = "admin:unimall:marketProdectInfo:list", permissionParentName = "宠物管理", permissionName = "商品信息管理")
+    public Page<MarketProdectInfo> list(
+            @HttpParam(name = "companyId", type = HttpParamType.COMMON, description = "") Long companyId,
+            @HttpParam(name = "prodectName", type = HttpParamType.COMMON, description = "商品名称") String prodectName,
+            @HttpParam(name = "classificationKey", type = HttpParamType.COMMON, description = "商品分类key") String classificationKey,
+            @HttpParam(name = "classification", type = HttpParamType.COMMON, description = "商品分类") String classification,
+            @HttpParam(name = "url", type = HttpParamType.COMMON, description = "封面") String url,
+            @HttpParam(name = "productDetails", type = HttpParamType.COMMON, description = "商品详情") String productDetails,
+            @HttpParam(name = "commodity price", type = HttpParamType.COMMON, description = "商品售价") Double commodityPrice,
+            @HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态") String status,
+            @HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "0:否(默认) 1:是") Integer deleteFlag,
+            @HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+            @HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+            @HttpParam(name = "userId", type = HttpParamType.COMMON, description = "") Long userId,
+            @HttpParam(name = "adminId", type = HttpParamType.COMMON, description = "") Long adminId,
+            @HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+            throws ServiceException;
+
+    @HttpMethod(description = "删除", permission = "admin:unimall:marketProdectInfo:delete", permissionParentName = "宠物管理", permissionName = "商品信息管理")
+    public Boolean delete(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "") String id) throws ServiceException;
+
+    @HttpMethod(description = "修改", permission = "admin:unimall:marketProdectInfo:update", permissionParentName = "宠物管理", permissionName = "商品信息管理")
+    public Boolean update(@NotNull @HttpParam(name = "marketProdectInfo", type = HttpParamType.COMMON, description = "商品信息") MarketProdectInfo marketProdectInfo,
+                          @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "adminId") Long adminId) throws ServiceException;
+
+    @HttpMethod(description = "查询", permission = "admin:unimall:marketProdectInfo:get", permissionParentName = "宠物管理", permissionName = "商品信息管理")
+    public MarketProdectInfo get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "") Long id) throws ServiceException;
+
+    @HttpMethod(description = "导出excl表", permission = "admin:unimall:marketProdectInfo:export", permissionParentName = "宠物管理", permissionName = "商品信息管理")
+    public String export(
+            @HttpParam(name = "companyId", type = HttpParamType.COMMON, description = "") Long companyId,
+            @HttpParam(name = "prodectName", type = HttpParamType.COMMON, description = "商品名称") String prodectName,
+            @HttpParam(name = "classificationKey", type = HttpParamType.COMMON, description = "商品分类key") String classificationKey,
+            @HttpParam(name = "classification", type = HttpParamType.COMMON, description = "商品分类") String classification,
+            @HttpParam(name = "url", type = HttpParamType.COMMON, description = "封面") String url,
+            @HttpParam(name = "productDetails", type = HttpParamType.COMMON, description = "商品详情") String productDetails,
+            @HttpParam(name = "commodity price", type = HttpParamType.COMMON, description = "商品售价") Double commodityPrice,
+            @HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态") String status,
+            @HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "0:否(默认) 1:是") Integer deleteFlag,
+            @HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+            @HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+            @HttpParam(name = "userId", type = HttpParamType.COMMON, description = "") Long userId,
+            @HttpParam(name = "adminId", type = HttpParamType.COMMON, description = "") Long adminId,
+            @HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit) throws ServiceException;
+
+}

+ 71 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/IMarketReceivingAddressService.java

@@ -0,0 +1,71 @@
+package com.iotechn.unimall.admin.api.market;
+
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.market.MarketReceivingAddress;
+import com.iotechn.unimall.data.model.Page;
+import java.util.Date;
+
+/**
+ * 收货地址Service接口
+ * 
+ * @author jlb
+ * @date 2022-08-01
+ */
+@HttpOpenApi(group = "admin.unimall.marketReceivingAddress", description = "收货地址")
+public interface IMarketReceivingAddressService{
+	@HttpMethod(description = "新增", permission = "admin:unimall:marketReceivingAddress:add", permissionParentName = "宠物管理", permissionName = "收货地址管理")
+	public Boolean add(@NotNull @HttpParam(name = "marketReceivingAddress", type = HttpParamType.COMMON, description = "收货地址") MarketReceivingAddress marketReceivingAddress,
+						   @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "adminId") Long adminId)throws ServiceException;
+
+	@HttpMethod(description = "列表", permission = "admin:unimall:marketReceivingAddress:list",permissionParentName = "宠物管理", permissionName = "收货地址管理")
+	public Page<MarketReceivingAddress> list(
+								@HttpParam(name = "companyId", type = HttpParamType.COMMON, description = "") Long companyId,
+							@HttpParam(name = "cusId", type = HttpParamType.COMMON, description = "客户id") String cusId,
+							@HttpParam(name = "consigneeName", type = HttpParamType.COMMON, description = "收货人姓名") String consigneeName,
+							@HttpParam(name = "phone", type = HttpParamType.COMMON, description = "手机号") String phone,
+							@HttpParam(name = "location", type = HttpParamType.COMMON, description = "所在地区") String location,
+							@HttpParam(name = "address", type = HttpParamType.COMMON, description = "详细地址") String address,
+							@HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态") String status,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "0:否(默认) 1:是") Integer deleteFlag,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "userId", type = HttpParamType.COMMON, description = "") Long userId,
+							@HttpParam(name = "adminId", type = HttpParamType.COMMON, description = "") Long adminId,
+					@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+		@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+		throws ServiceException;
+
+	@HttpMethod(description = "删除", permission = "admin:unimall:marketReceivingAddress:delete",permissionParentName = "宠物管理", permissionName = "收货地址管理")
+	public Boolean delete(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")String id)throws ServiceException;
+
+	@HttpMethod(description = "修改", permission = "admin:unimall:marketReceivingAddress:update",permissionParentName = "宠物管理", permissionName = "收货地址管理")
+	public Boolean update(@NotNull @HttpParam(name = "marketReceivingAddress", type = HttpParamType.COMMON, description = "收货地址") MarketReceivingAddress marketReceivingAddress,
+						  @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "adminId") Long adminId)throws ServiceException;
+
+	@HttpMethod(description = "查询", permission = "admin:unimall:marketReceivingAddress:get",permissionParentName = "宠物管理", permissionName = "收货地址管理")
+	public MarketReceivingAddress get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")Long id)throws ServiceException;
+	
+	@HttpMethod(description = "导出excl表", permission = "admin:unimall:marketReceivingAddress:export",permissionParentName = "宠物管理", permissionName = "收货地址管理")
+	public String export(
+								@HttpParam(name = "companyId", type = HttpParamType.COMMON, description = "") Long companyId,
+							@HttpParam(name = "cusId", type = HttpParamType.COMMON, description = "客户id") String cusId,
+							@HttpParam(name = "consigneeName", type = HttpParamType.COMMON, description = "收货人姓名") String consigneeName,
+							@HttpParam(name = "phone", type = HttpParamType.COMMON, description = "手机号") String phone,
+							@HttpParam(name = "location", type = HttpParamType.COMMON, description = "所在地区") String location,
+							@HttpParam(name = "address", type = HttpParamType.COMMON, description = "详细地址") String address,
+							@HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态") String status,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "0:否(默认) 1:是") Integer deleteFlag,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "userId", type = HttpParamType.COMMON, description = "") Long userId,
+							@HttpParam(name = "adminId", type = HttpParamType.COMMON, description = "") Long adminId,
+				@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+	@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)throws ServiceException;
+	
+}

+ 74 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/IMarketShopInfoService.java

@@ -0,0 +1,74 @@
+package com.iotechn.unimall.admin.api.market;
+
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.market.MarketShopInfo;
+import com.iotechn.unimall.data.model.Page;
+
+import java.util.Date;
+
+/**
+ * 商店信息Service接口
+ *
+ * @author jlb
+ * @date 2022-08-01
+ */
+@HttpOpenApi(group = "admin.unimall.marketShopInfo", description = "商店信息")
+public interface IMarketShopInfoService {
+    @HttpMethod(description = "新增", permission = "admin:unimall:marketShopInfo:add", permissionParentName = "宠物管理", permissionName = "商店信息管理")
+    public Boolean add(@NotNull @HttpParam(name = "marketShopInfo", type = HttpParamType.COMMON, description = "商店信息") MarketShopInfo marketShopInfo,
+                       @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "adminId") Long adminId) throws ServiceException;
+
+    @HttpMethod(description = "列表", permission = "admin:unimall:marketShopInfo:list", permissionParentName = "宠物管理", permissionName = "商店信息管理")
+    public Page<MarketShopInfo> list(
+            @HttpParam(name = "companyId", type = HttpParamType.COMMON, description = "") Long companyId,
+            @HttpParam(name = "name", type = HttpParamType.COMMON, description = "名称") String name,
+            @HttpParam(name = "postion", type = HttpParamType.COMMON, description = "位置") String postion,
+            @HttpParam(name = "url", type = HttpParamType.COMMON, description = "封面") String url,
+            @HttpParam(name = "phone", type = HttpParamType.COMMON, description = "手机") String phone,
+            @HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态") String status,
+            @HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "0:否(默认) 1:是") Integer deleteFlag,
+            @HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+            @HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+            @HttpParam(name = "userId", type = HttpParamType.COMMON, description = "") Long userId,
+            @HttpParam(name = "adminId", type = HttpParamType.COMMON, description = "") Long adminId,
+            @HttpParam(name = "level", type = HttpParamType.COMMON, description = "信誉等级") String level,
+            @HttpParam(name = "caseWorld", type = HttpParamType.COMMON, description = "关键词") String caseWorld,
+            @HttpParam(name = "lon", type = HttpParamType.COMMON, description = "经度") String lon,
+            @HttpParam(name = "lat", type = HttpParamType.COMMON, description = "纬度") String lat,
+            @HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+            throws ServiceException;
+
+    @HttpMethod(description = "删除", permission = "admin:unimall:marketShopInfo:delete", permissionParentName = "宠物管理", permissionName = "商店信息管理")
+    public Boolean delete(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "") String id) throws ServiceException;
+
+    @HttpMethod(description = "修改", permission = "admin:unimall:marketShopInfo:update", permissionParentName = "宠物管理", permissionName = "商店信息管理")
+    public Boolean update(@NotNull @HttpParam(name = "marketShopInfo", type = HttpParamType.COMMON, description = "商店信息") MarketShopInfo marketShopInfo,
+                          @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "adminId") Long adminId) throws ServiceException;
+
+    @HttpMethod(description = "查询", permission = "admin:unimall:marketShopInfo:get", permissionParentName = "宠物管理", permissionName = "商店信息管理")
+    public MarketShopInfo get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "") Long id) throws ServiceException;
+
+    @HttpMethod(description = "导出excl表", permission = "admin:unimall:marketShopInfo:export", permissionParentName = "宠物管理", permissionName = "商店信息管理")
+    public String export(
+            @HttpParam(name = "companyId", type = HttpParamType.COMMON, description = "") Long companyId,
+            @HttpParam(name = "name", type = HttpParamType.COMMON, description = "名称") String name,
+            @HttpParam(name = "postion", type = HttpParamType.COMMON, description = "位置") String postion,
+            @HttpParam(name = "url", type = HttpParamType.COMMON, description = "封面") String url,
+            @HttpParam(name = "phone", type = HttpParamType.COMMON, description = "手机") String phone,
+            @HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态") String status,
+            @HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "0:否(默认) 1:是") Integer deleteFlag,
+            @HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+            @HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+            @HttpParam(name = "userId", type = HttpParamType.COMMON, description = "") Long userId,
+            @HttpParam(name = "adminId", type = HttpParamType.COMMON, description = "") Long adminId,
+            @HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit) throws ServiceException;
+
+}

+ 140 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/impl/MarketAdvertisementInfoServiceImpl.java

@@ -0,0 +1,140 @@
+package com.iotechn.unimall.admin.api.market.impl;
+
+import java.util.List;
+
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.util.ExcelUtil;
+import com.iotechn.unimall.data.mapper.market.MarketAdvertisementInfoMapper;
+import com.iotechn.unimall.data.domain.market.MarketAdvertisementInfo;
+import com.iotechn.unimall.admin.api.market.IMarketAdvertisementInfoService;
+import com.iotechn.unimall.data.model.Page;
+
+import java.util.Date;
+
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 广告信息Service业务层处理
+ *
+ * @author jlb
+ * @date 2022-08-01
+ */
+@Service
+public class MarketAdvertisementInfoServiceImpl implements IMarketAdvertisementInfoService {
+    @Autowired
+    private MarketAdvertisementInfoMapper marketAdvertisementInfoMapper;
+
+    @Override
+    public Boolean add(MarketAdvertisementInfo marketAdvertisementInfo, Long adminId) throws ServiceException {
+        Date now = new Date();
+        marketAdvertisementInfo.setGmtCreate(now);
+        marketAdvertisementInfo.setGmtUpdate(now);
+        marketAdvertisementInfo.setAdminId(adminId);
+        return marketAdvertisementInfoMapper.insert(marketAdvertisementInfo) > 0;
+    }
+
+    @Override
+    public Page<MarketAdvertisementInfo> list(Long companyId, String advertisementName, String url, String status, Integer deleteFlag, Date gmtCreate, Date gmtUpdate, Long userId, Long adminId, Integer page, Integer limit) throws ServiceException {
+        Wrapper<MarketAdvertisementInfo> wrapper = new EntityWrapper<MarketAdvertisementInfo>();
+        if (!StringUtils.isEmpty(companyId)) {
+            wrapper.eq("company_id", companyId);
+        }
+        if (!StringUtils.isEmpty(advertisementName)) {
+            wrapper.eq("advertisement_name", advertisementName);
+        }
+        if (!StringUtils.isEmpty(url)) {
+            wrapper.eq("url", url);
+        }
+        if (!StringUtils.isEmpty(status)) {
+            wrapper.eq("status", status);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(userId)) {
+            wrapper.eq("user_id", userId);
+        }
+        if (!StringUtils.isEmpty(adminId)) {
+            wrapper.eq("admin_id", adminId);
+        }
+        wrapper.eq("delete_flag", 0);
+        List<MarketAdvertisementInfo> list = marketAdvertisementInfoMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+        Integer count = marketAdvertisementInfoMapper.selectCount(wrapper);
+        return new Page<MarketAdvertisementInfo>(list, page, limit, count);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean delete(String id) {
+        String[] ids = String.valueOf(id).split(",");
+        for (String tt : ids) {
+            MarketAdvertisementInfo tmp = marketAdvertisementInfoMapper.selectById(Long.parseLong(tt));
+            if (tmp != null) {
+                tmp.setDeleteFlag(1);
+                marketAdvertisementInfoMapper.updateById(tmp);
+            }
+        }
+        return true;
+    }
+
+    @Override
+    public Boolean update(MarketAdvertisementInfo marketAdvertisementInfo, Long adminId) throws ServiceException {
+        Date now = new Date();
+        marketAdvertisementInfo.setGmtUpdate(now);
+        marketAdvertisementInfo.setAdminId(adminId);
+        return marketAdvertisementInfoMapper.updateById(marketAdvertisementInfo) > 0;
+    }
+
+    @Override
+    public MarketAdvertisementInfo get(Long id) throws ServiceException {
+        return marketAdvertisementInfoMapper.selectById(id);
+    }
+
+    @Override
+    public String export(Long companyId, String advertisementName, String url, String status, Integer deleteFlag, Date gmtCreate, Date gmtUpdate, Long userId, Long adminId, Integer page, Integer limit) throws ServiceException {
+        Wrapper<MarketAdvertisementInfo> wrapper = new EntityWrapper<MarketAdvertisementInfo>();
+        if (!StringUtils.isEmpty(companyId)) {
+            wrapper.eq("company_id", companyId);
+        }
+        if (!StringUtils.isEmpty(advertisementName)) {
+            wrapper.eq("advertisement_name", advertisementName);
+        }
+        if (!StringUtils.isEmpty(url)) {
+            wrapper.eq("url", url);
+        }
+        if (!StringUtils.isEmpty(status)) {
+            wrapper.eq("status", status);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(userId)) {
+            wrapper.eq("user_id", userId);
+        }
+        if (!StringUtils.isEmpty(adminId)) {
+            wrapper.eq("admin_id", adminId);
+        }
+        List<MarketAdvertisementInfo> list = marketAdvertisementInfoMapper.selectList(wrapper);
+        ExcelUtil<MarketAdvertisementInfo> util = new ExcelUtil<MarketAdvertisementInfo>(MarketAdvertisementInfo.class);
+        return util.exportExcel(list, "操作日志");
+    }
+}

+ 96 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/impl/MarketCaseServiceImpl.java

@@ -0,0 +1,96 @@
+package com.iotechn.unimall.admin.api.market.impl;
+
+import java.util.List;
+
+import com.iotechn.unimall.admin.api.market.IMarketCaseService;
+import com.iotechn.unimall.data.domain.market.MarketCase;
+import com.iotechn.unimall.data.mapper.market.MarketCaseMapper;
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.util.ExcelUtil;
+import com.iotechn.unimall.data.model.Page;
+import java.util.Date;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 关注Service业务层处理
+ * 
+ * @author jlb
+ * @date 2023-02-03
+ */
+@Service
+public class MarketCaseServiceImpl implements IMarketCaseService {
+	@Autowired
+	private MarketCaseMapper marketCaseMapper;
+	
+	@Override
+	public Boolean add(MarketCase marketCase, Long adminId) throws ServiceException {
+		Date now = new Date();
+		marketCase.setGmtCreate(now);
+		marketCase.setGmtUpdate(now);
+		marketCase.setAdminId(adminId);
+		return marketCaseMapper.insert(marketCase)>0;
+	}
+
+	@Override
+	public Page<MarketCase> list(String concernedId,String followersId, Integer page, Integer limit)throws ServiceException {
+		Wrapper<MarketCase> wrapper = new EntityWrapper<MarketCase>();
+														if (!StringUtils.isEmpty(concernedId)) {
+					wrapper.eq("concerned_id", concernedId);
+				}
+												if (!StringUtils.isEmpty(followersId)) {
+					wrapper.eq("followers_id", followersId);
+				}
+							wrapper.eq("delete_flag", 0);
+		List<MarketCase> list = marketCaseMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+		Integer count = marketCaseMapper.selectCount(wrapper);
+		return new Page<MarketCase>(list, page, limit, count);
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public Boolean delete(String id) {
+		String[] ids = String.valueOf(id).split(",");
+		for (String tt:ids) {
+			MarketCase tmp =  marketCaseMapper.selectById(Long.parseLong(tt));
+			if(tmp != null){
+				tmp.setDeleteFlag(1);
+				marketCaseMapper.updateById(tmp);
+			}
+		}
+		return true;
+	}
+
+	@Override
+	public Boolean update(MarketCase marketCase,Long adminId) throws ServiceException {
+		Date now = new Date();
+		marketCase.setGmtUpdate(now);
+		marketCase.setAdminId(adminId);
+		return marketCaseMapper.updateById(marketCase)>0;
+	}
+
+	@Override
+	public MarketCase get(Long id) throws ServiceException {
+		return marketCaseMapper.selectById(id);
+	}
+	
+	@Override
+	public String export(String concernedId,String followersId, Integer page, Integer limit)throws ServiceException {
+		Wrapper<MarketCase> wrapper = new EntityWrapper<MarketCase>();
+														if (!StringUtils.isEmpty(concernedId)) {
+					wrapper.eq("concerned_id", concernedId);
+				}
+												if (!StringUtils.isEmpty(followersId)) {
+					wrapper.eq("followers_id", followersId);
+				}
+							List<MarketCase> list = marketCaseMapper.selectList(wrapper);
+		ExcelUtil<MarketCase> util = new ExcelUtil<MarketCase>(MarketCase.class);
+		return util.exportExcel(list, "操作日志");
+	}
+}

+ 150 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/impl/MarketCircleInfoServiceImpl.java

@@ -0,0 +1,150 @@
+package com.iotechn.unimall.admin.api.market.impl;
+
+import java.util.List;
+
+import com.iotechn.unimall.data.mapper.market.MarketShopInfoMapper;
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.util.ExcelUtil;
+import com.iotechn.unimall.data.mapper.market.MarketCircleInfoMapper;
+import com.iotechn.unimall.data.domain.market.MarketCircleInfo;
+import com.iotechn.unimall.admin.api.market.IMarketCircleInfoService;
+import com.iotechn.unimall.data.model.Page;
+import java.util.Date;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 生鲜圈Service业务层处理
+ * 
+ * @author jlb
+ * @date 2023-01-03
+ */
+@Service
+public class MarketCircleInfoServiceImpl implements IMarketCircleInfoService{
+	@Autowired
+	private MarketCircleInfoMapper marketCircleInfoMapper;
+	@Autowired
+	private MarketShopInfoMapper marketShopInfoMapper;
+	
+	@Override
+	public Boolean add(MarketCircleInfo marketCircleInfo,Long adminId) throws ServiceException {
+		Date now = new Date();
+		marketCircleInfo.setGmtCreate(now);
+		marketCircleInfo.setGmtUpdate(now);
+		marketCircleInfo.setAdminId(adminId);
+		return marketCircleInfoMapper.insert(marketCircleInfo)>0;
+	}
+
+	@Override
+	public Page<MarketCircleInfo> list(Long companyId,Long shopId,String content,String status,String url,Integer deleteFlag,Date gmtCreate,Date gmtUpdate,Long userId,Long adminId, Integer page, Integer limit)throws ServiceException {
+		Wrapper<MarketCircleInfo> wrapper = new EntityWrapper<MarketCircleInfo>();
+														if (!StringUtils.isEmpty(companyId)) {
+					wrapper.eq("company_id", companyId);
+				}
+												if (!StringUtils.isEmpty(shopId)) {
+					wrapper.eq("shop_id", shopId);
+				}
+												if (!StringUtils.isEmpty(content)) {
+					wrapper.eq("content", content);
+				}
+												if (!StringUtils.isEmpty(status)) {
+					wrapper.eq("status", status);
+				}
+												if (!StringUtils.isEmpty(url)) {
+					wrapper.eq("url", url);
+				}
+												if (!StringUtils.isEmpty(deleteFlag)) {
+					wrapper.eq("delete_flag", deleteFlag);
+				}
+												if (!StringUtils.isEmpty(gmtCreate)) {
+					wrapper.eq("gmt_create", gmtCreate);
+				}
+												if (!StringUtils.isEmpty(gmtUpdate)) {
+					wrapper.eq("gmt_update", gmtUpdate);
+				}
+												if (!StringUtils.isEmpty(userId)) {
+					wrapper.eq("user_id", userId);
+				}
+												if (!StringUtils.isEmpty(adminId)) {
+					wrapper.eq("admin_id", adminId);
+				}
+							wrapper.eq("delete_flag", 0);
+		List<MarketCircleInfo> list = marketCircleInfoMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+		for(MarketCircleInfo tmp : list){
+			tmp.setShopName(marketShopInfoMapper.selectById(tmp.getShopId()).getName());
+		}
+		Integer count = marketCircleInfoMapper.selectCount(wrapper);
+		return new Page<MarketCircleInfo>(list, page, limit, count);
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public Boolean delete(String id) {
+		String[] ids = String.valueOf(id).split(",");
+		for (String tt:ids) {
+			MarketCircleInfo tmp =  marketCircleInfoMapper.selectById(Long.parseLong(tt));
+			if(tmp != null){
+				tmp.setDeleteFlag(1);
+				marketCircleInfoMapper.updateById(tmp);
+			}
+		}
+		return true;
+	}
+
+	@Override
+	public Boolean update(MarketCircleInfo marketCircleInfo,Long adminId) throws ServiceException {
+		Date now = new Date();
+		marketCircleInfo.setGmtUpdate(now);
+		marketCircleInfo.setAdminId(adminId);
+		return marketCircleInfoMapper.updateById(marketCircleInfo)>0;
+	}
+
+	@Override
+	public MarketCircleInfo get(Long id) throws ServiceException {
+		return marketCircleInfoMapper.selectById(id);
+	}
+	
+	@Override
+	public String export(Long companyId,Long shopId,String content,String status,String url,Integer deleteFlag,Date gmtCreate,Date gmtUpdate,Long userId,Long adminId, Integer page, Integer limit)throws ServiceException {
+		Wrapper<MarketCircleInfo> wrapper = new EntityWrapper<MarketCircleInfo>();
+														if (!StringUtils.isEmpty(companyId)) {
+					wrapper.eq("company_id", companyId);
+				}
+												if (!StringUtils.isEmpty(shopId)) {
+					wrapper.eq("shop_id", shopId);
+				}
+												if (!StringUtils.isEmpty(content)) {
+					wrapper.eq("content", content);
+				}
+												if (!StringUtils.isEmpty(status)) {
+					wrapper.eq("status", status);
+				}
+												if (!StringUtils.isEmpty(url)) {
+					wrapper.eq("url", url);
+				}
+												if (!StringUtils.isEmpty(deleteFlag)) {
+					wrapper.eq("delete_flag", deleteFlag);
+				}
+												if (!StringUtils.isEmpty(gmtCreate)) {
+					wrapper.eq("gmt_create", gmtCreate);
+				}
+												if (!StringUtils.isEmpty(gmtUpdate)) {
+					wrapper.eq("gmt_update", gmtUpdate);
+				}
+												if (!StringUtils.isEmpty(userId)) {
+					wrapper.eq("user_id", userId);
+				}
+												if (!StringUtils.isEmpty(adminId)) {
+					wrapper.eq("admin_id", adminId);
+				}
+							List<MarketCircleInfo> list = marketCircleInfoMapper.selectList(wrapper);
+		ExcelUtil<MarketCircleInfo> util = new ExcelUtil<MarketCircleInfo>(MarketCircleInfo.class);
+		return util.exportExcel(list, "操作日志");
+	}
+}

+ 149 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/impl/MarketOrderDetailServiceImpl.java

@@ -0,0 +1,149 @@
+package com.iotechn.unimall.admin.api.market.impl;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.admin.api.market.IMarketOrderDetailService;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.market.MarketOrderDetail;
+import com.iotechn.unimall.data.mapper.market.MarketOrderDetailMapper;
+import com.iotechn.unimall.data.model.Page;
+import com.iotechn.unimall.data.util.ExcelUtil;
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.StringUtils;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 订单详情Service业务层处理
+ *
+ * @author jlb
+ * @date 2022-08-01
+ */
+@Service
+public class MarketOrderDetailServiceImpl implements IMarketOrderDetailService {
+    @Autowired
+    private MarketOrderDetailMapper marketOrderDetailMapper;
+
+    @Override
+    public Boolean add(MarketOrderDetail marketOrderDetail, Long adminId) throws ServiceException {
+        Date now = new Date();
+        marketOrderDetail.setGmtCreate(now);
+        marketOrderDetail.setGmtUpdate(now);
+        marketOrderDetail.setAdminId(adminId);
+        return marketOrderDetailMapper.insert(marketOrderDetail) > 0;
+    }
+
+    @Override
+    public Page<MarketOrderDetail> list(Long companyId, String orderId, String name, Double price, Long num, String status, Integer deleteFlag, Date gmtCreate, Date gmtUpdate, Long userId, Long adminId, Integer page, Integer limit) throws ServiceException {
+        Wrapper<MarketOrderDetail> wrapper = new EntityWrapper<MarketOrderDetail>();
+        if (!StringUtils.isEmpty(companyId)) {
+            wrapper.eq("company_id", companyId);
+        }
+        if (!StringUtils.isEmpty(orderId)) {
+            wrapper.eq("order_id", orderId);
+        }
+        if (!StringUtils.isEmpty(name)) {
+            wrapper.eq("name", name);
+        }
+        if (!StringUtils.isEmpty(price)) {
+            wrapper.eq("price", price);
+        }
+        if (!StringUtils.isEmpty(num)) {
+            wrapper.eq("num", num);
+        }
+        if (!StringUtils.isEmpty(status)) {
+            wrapper.eq("status", status);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(userId)) {
+            wrapper.eq("user_id", userId);
+        }
+        if (!StringUtils.isEmpty(adminId)) {
+            wrapper.eq("admin_id", adminId);
+        }
+        wrapper.eq("delete_flag", 0);
+        List<MarketOrderDetail> list = marketOrderDetailMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+        Integer count = marketOrderDetailMapper.selectCount(wrapper);
+        return new Page<MarketOrderDetail>(list, page, limit, count);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean delete(String id) {
+        String[] ids = String.valueOf(id).split(",");
+        for (String tt : ids) {
+            MarketOrderDetail tmp = marketOrderDetailMapper.selectById(Long.parseLong(tt));
+            if (tmp != null) {
+                tmp.setDeleteFlag(1);
+                marketOrderDetailMapper.updateById(tmp);
+            }
+        }
+        return true;
+    }
+
+    @Override
+    public Boolean update(MarketOrderDetail marketOrderDetail, Long adminId) throws ServiceException {
+        Date now = new Date();
+        marketOrderDetail.setGmtUpdate(now);
+        marketOrderDetail.setAdminId(adminId);
+        return marketOrderDetailMapper.updateById(marketOrderDetail) > 0;
+    }
+
+    @Override
+    public MarketOrderDetail get(Long id) throws ServiceException {
+        return marketOrderDetailMapper.selectById(id);
+    }
+
+    @Override
+    public String export(Long companyId, String orderId, String name, Double price, Long num, String status, Integer deleteFlag, Date gmtCreate, Date gmtUpdate, Long userId, Long adminId, Integer page, Integer limit) throws ServiceException {
+        Wrapper<MarketOrderDetail> wrapper = new EntityWrapper<MarketOrderDetail>();
+        if (!StringUtils.isEmpty(companyId)) {
+            wrapper.eq("company_id", companyId);
+        }
+        if (!StringUtils.isEmpty(orderId)) {
+            wrapper.eq("order_id", orderId);
+        }
+        if (!StringUtils.isEmpty(name)) {
+            wrapper.eq("name", name);
+        }
+        if (!StringUtils.isEmpty(price)) {
+            wrapper.eq("price", price);
+        }
+        if (!StringUtils.isEmpty(num)) {
+            wrapper.eq("num", num);
+        }
+        if (!StringUtils.isEmpty(status)) {
+            wrapper.eq("status", status);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(userId)) {
+            wrapper.eq("user_id", userId);
+        }
+        if (!StringUtils.isEmpty(adminId)) {
+            wrapper.eq("admin_id", adminId);
+        }
+        List<MarketOrderDetail> list = marketOrderDetailMapper.selectList(wrapper);
+        ExcelUtil<MarketOrderDetail> util = new ExcelUtil<MarketOrderDetail>(MarketOrderDetail.class);
+        return util.exportExcel(list, "操作日志");
+    }
+}

+ 146 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/impl/MarketOrderInfoServiceImpl.java

@@ -0,0 +1,146 @@
+package com.iotechn.unimall.admin.api.market.impl;
+
+import java.util.List;
+
+import com.iotechn.unimall.admin.api.market.IMarketOrderInfoService;
+import com.iotechn.unimall.data.domain.market.MarketOrderInfo;
+import com.iotechn.unimall.data.mapper.market.MarketOrderInfoMapper;
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.util.ExcelUtil;
+import com.iotechn.unimall.data.model.Page;
+
+import java.util.Date;
+
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 订单信息Service业务层处理
+ *
+ * @author jlb
+ * @date 2022-08-01
+ */
+@Service
+public class MarketOrderInfoServiceImpl implements IMarketOrderInfoService {
+    @Autowired
+    private MarketOrderInfoMapper marketOrderInfoMapper;
+
+    @Override
+    public Boolean add(MarketOrderInfo marketOrderInfo, Long adminId) throws ServiceException {
+        Date now = new Date();
+        marketOrderInfo.setGmtCreate(now);
+        marketOrderInfo.setGmtUpdate(now);
+        marketOrderInfo.setAdminId(adminId);
+        return marketOrderInfoMapper.insert(marketOrderInfo) > 0;
+    }
+
+    @Override
+    public Page<MarketOrderInfo> list(Long companyId, String orderNo, String customer, String pets, String status, Integer deleteFlag, Date gmtCreate, Date gmtUpdate, Long userId, Long adminId, Integer page, Integer limit) throws ServiceException {
+        Wrapper<MarketOrderInfo> wrapper = new EntityWrapper<MarketOrderInfo>();
+        if (!StringUtils.isEmpty(companyId)) {
+            wrapper.eq("company_id", companyId);
+        }
+        if (!StringUtils.isEmpty(orderNo)) {
+            wrapper.eq("order_no", orderNo);
+        }
+        if (!StringUtils.isEmpty(customer)) {
+            wrapper.eq("customer", customer);
+        }
+        if (!StringUtils.isEmpty(pets)) {
+            wrapper.eq("pets", pets);
+        }
+        if (!StringUtils.isEmpty(status)) {
+            wrapper.eq("status", status);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(userId)) {
+            wrapper.eq("user_id", userId);
+        }
+        if (!StringUtils.isEmpty(adminId)) {
+            wrapper.eq("admin_id", adminId);
+        }
+        wrapper.eq("delete_flag", 0);
+        List<MarketOrderInfo> list = marketOrderInfoMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+        Integer count = marketOrderInfoMapper.selectCount(wrapper);
+        return new Page<MarketOrderInfo>(list, page, limit, count);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean delete(String id) {
+        String[] ids = String.valueOf(id).split(",");
+        for (String tt : ids) {
+            MarketOrderInfo tmp = marketOrderInfoMapper.selectById(Long.parseLong(tt));
+            if (tmp != null) {
+                tmp.setDeleteFlag(1);
+                marketOrderInfoMapper.updateById(tmp);
+            }
+        }
+        return true;
+    }
+
+    @Override
+    public Boolean update(MarketOrderInfo marketOrderInfo, Long adminId) throws ServiceException {
+        Date now = new Date();
+        marketOrderInfo.setGmtUpdate(now);
+        marketOrderInfo.setAdminId(adminId);
+        return marketOrderInfoMapper.updateById(marketOrderInfo) > 0;
+    }
+
+    @Override
+    public MarketOrderInfo get(Long id) throws ServiceException {
+        return marketOrderInfoMapper.selectById(id);
+    }
+
+    @Override
+    public String export(Long companyId, String orderNo, String customer, String pets, String status, Integer deleteFlag, Date gmtCreate, Date gmtUpdate, Long userId, Long adminId, Integer page, Integer limit) throws ServiceException {
+        Wrapper<MarketOrderInfo> wrapper = new EntityWrapper<MarketOrderInfo>();
+        if (!StringUtils.isEmpty(companyId)) {
+            wrapper.eq("company_id", companyId);
+        }
+        if (!StringUtils.isEmpty(orderNo)) {
+            wrapper.eq("order_no", orderNo);
+        }
+        if (!StringUtils.isEmpty(customer)) {
+            wrapper.eq("customer", customer);
+        }
+        if (!StringUtils.isEmpty(pets)) {
+            wrapper.eq("pets", pets);
+        }
+        if (!StringUtils.isEmpty(status)) {
+            wrapper.eq("status", status);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(userId)) {
+            wrapper.eq("user_id", userId);
+        }
+        if (!StringUtils.isEmpty(adminId)) {
+            wrapper.eq("admin_id", adminId);
+        }
+        List<MarketOrderInfo> list = marketOrderInfoMapper.selectList(wrapper);
+        ExcelUtil<MarketOrderInfo> util = new ExcelUtil<MarketOrderInfo>(MarketOrderInfo.class);
+        return util.exportExcel(list, "操作日志");
+    }
+}

+ 164 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/impl/MarketProdectInfoServiceImpl.java

@@ -0,0 +1,164 @@
+package com.iotechn.unimall.admin.api.market.impl;
+
+import java.util.List;
+
+import com.iotechn.unimall.admin.api.market.IMarketProdectInfoService;
+import com.iotechn.unimall.data.domain.market.MarketProdectInfo;
+import com.iotechn.unimall.data.mapper.market.MarketProdectInfoMapper;
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.util.ExcelUtil;
+import com.iotechn.unimall.data.model.Page;
+
+import java.util.Date;
+
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 商品信息Service业务层处理
+ *
+ * @author jlb
+ * @date 2022-08-01
+ */
+@Service
+public class MarketProdectInfoServiceImpl implements IMarketProdectInfoService {
+    @Autowired
+    private MarketProdectInfoMapper marketProdectInfoMapper;
+
+    @Override
+    public Boolean add(MarketProdectInfo marketProdectInfo, Long adminId) throws ServiceException {
+        Date now = new Date();
+        marketProdectInfo.setGmtCreate(now);
+        marketProdectInfo.setGmtUpdate(now);
+        marketProdectInfo.setAdminId(adminId);
+        return marketProdectInfoMapper.insert(marketProdectInfo) > 0;
+    }
+
+    @Override
+    public Page<MarketProdectInfo> list(Long companyId, String prodectName, String classificationKey, String classification, String url, String productDetails, Double commodityPrice, String status, Integer deleteFlag, Date gmtCreate, Date gmtUpdate, Long userId, Long adminId, Integer page, Integer limit) throws ServiceException {
+        Wrapper<MarketProdectInfo> wrapper = new EntityWrapper<MarketProdectInfo>();
+        if (!StringUtils.isEmpty(companyId)) {
+            wrapper.eq("company_id", companyId);
+        }
+        if (!StringUtils.isEmpty(prodectName)) {
+            wrapper.eq("prodect_name", prodectName);
+        }
+        if (!StringUtils.isEmpty(classificationKey)) {
+            wrapper.eq("classification_key", classificationKey);
+        }
+        if (!StringUtils.isEmpty(classification)) {
+            wrapper.eq("classification", classification);
+        }
+        if (!StringUtils.isEmpty(url)) {
+            wrapper.eq("url", url);
+        }
+        if (!StringUtils.isEmpty(productDetails)) {
+            wrapper.eq("product_details", productDetails);
+        }
+        if (!StringUtils.isEmpty(commodityPrice)) {
+            wrapper.eq("commodity price", commodityPrice);
+        }
+        if (!StringUtils.isEmpty(status)) {
+            wrapper.eq("status", status);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(userId)) {
+            wrapper.eq("user_id", userId);
+        }
+        if (!StringUtils.isEmpty(adminId)) {
+            wrapper.eq("admin_id", adminId);
+        }
+        wrapper.eq("delete_flag", 0);
+        List<MarketProdectInfo> list = marketProdectInfoMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+        Integer count = marketProdectInfoMapper.selectCount(wrapper);
+        return new Page<MarketProdectInfo>(list, page, limit, count);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean delete(String id) {
+        String[] ids = String.valueOf(id).split(",");
+        for (String tt : ids) {
+            MarketProdectInfo tmp = marketProdectInfoMapper.selectById(Long.parseLong(tt));
+            if (tmp != null) {
+                tmp.setDeleteFlag(1);
+                marketProdectInfoMapper.updateById(tmp);
+            }
+        }
+        return true;
+    }
+
+    @Override
+    public Boolean update(MarketProdectInfo marketProdectInfo, Long adminId) throws ServiceException {
+        Date now = new Date();
+        marketProdectInfo.setGmtUpdate(now);
+        marketProdectInfo.setAdminId(adminId);
+        return marketProdectInfoMapper.updateById(marketProdectInfo) > 0;
+    }
+
+    @Override
+    public MarketProdectInfo get(Long id) throws ServiceException {
+        return marketProdectInfoMapper.selectById(id);
+    }
+
+    @Override
+    public String export(Long companyId, String prodectName, String classificationKey, String classification, String url, String productDetails, Double commodityPrice, String status, Integer deleteFlag, Date gmtCreate, Date gmtUpdate, Long userId, Long adminId, Integer page, Integer limit) throws ServiceException {
+        Wrapper<MarketProdectInfo> wrapper = new EntityWrapper<MarketProdectInfo>();
+        if (!StringUtils.isEmpty(companyId)) {
+            wrapper.eq("company_id", companyId);
+        }
+        if (!StringUtils.isEmpty(prodectName)) {
+            wrapper.eq("prodect_name", prodectName);
+        }
+        if (!StringUtils.isEmpty(classificationKey)) {
+            wrapper.eq("classification_key", classificationKey);
+        }
+        if (!StringUtils.isEmpty(classification)) {
+            wrapper.eq("classification", classification);
+        }
+        if (!StringUtils.isEmpty(url)) {
+            wrapper.eq("url", url);
+        }
+        if (!StringUtils.isEmpty(productDetails)) {
+            wrapper.eq("product_details", productDetails);
+        }
+        if (!StringUtils.isEmpty(commodityPrice)) {
+            wrapper.eq("commodity price", commodityPrice);
+        }
+        if (!StringUtils.isEmpty(status)) {
+            wrapper.eq("status", status);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(userId)) {
+            wrapper.eq("user_id", userId);
+        }
+        if (!StringUtils.isEmpty(adminId)) {
+            wrapper.eq("admin_id", adminId);
+        }
+        List<MarketProdectInfo> list = marketProdectInfoMapper.selectList(wrapper);
+        ExcelUtil<MarketProdectInfo> util = new ExcelUtil<MarketProdectInfo>(MarketProdectInfo.class);
+        return util.exportExcel(list, "操作日志");
+    }
+}

+ 158 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/impl/MarketReceivingAddressServiceImpl.java

@@ -0,0 +1,158 @@
+package com.iotechn.unimall.admin.api.market.impl;
+
+import java.util.List;
+
+import com.iotechn.unimall.admin.api.market.IMarketReceivingAddressService;
+import com.iotechn.unimall.data.domain.market.MarketReceivingAddress;
+import com.iotechn.unimall.data.mapper.market.MarketReceivingAddressMapper;
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.util.ExcelUtil;
+import com.iotechn.unimall.data.model.Page;
+
+import java.util.Date;
+
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 收货地址Service业务层处理
+ *
+ * @author jlb
+ * @date 2022-08-01
+ */
+@Service
+public class MarketReceivingAddressServiceImpl implements IMarketReceivingAddressService {
+    @Autowired
+    private MarketReceivingAddressMapper marketReceivingAddressMapper;
+
+    @Override
+    public Boolean add(MarketReceivingAddress marketReceivingAddress, Long adminId) throws ServiceException {
+        Date now = new Date();
+        marketReceivingAddress.setGmtCreate(now);
+        marketReceivingAddress.setGmtUpdate(now);
+        marketReceivingAddress.setAdminId(adminId);
+        return marketReceivingAddressMapper.insert(marketReceivingAddress) > 0;
+    }
+
+    @Override
+    public Page<MarketReceivingAddress> list(Long companyId, String cusId, String consigneeName, String phone, String location, String address, String status, Integer deleteFlag, Date gmtCreate, Date gmtUpdate, Long userId, Long adminId, Integer page, Integer limit) throws ServiceException {
+        Wrapper<MarketReceivingAddress> wrapper = new EntityWrapper<MarketReceivingAddress>();
+        if (!StringUtils.isEmpty(companyId)) {
+            wrapper.eq("company_id", companyId);
+        }
+        if (!StringUtils.isEmpty(cusId)) {
+            wrapper.eq("cus_id", cusId);
+        }
+        if (!StringUtils.isEmpty(consigneeName)) {
+            wrapper.eq("consignee_name", consigneeName);
+        }
+        if (!StringUtils.isEmpty(phone)) {
+            wrapper.eq("phone", phone);
+        }
+        if (!StringUtils.isEmpty(location)) {
+            wrapper.eq("location", location);
+        }
+        if (!StringUtils.isEmpty(address)) {
+            wrapper.eq("address", address);
+        }
+        if (!StringUtils.isEmpty(status)) {
+            wrapper.eq("status", status);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(userId)) {
+            wrapper.eq("user_id", userId);
+        }
+        if (!StringUtils.isEmpty(adminId)) {
+            wrapper.eq("admin_id", adminId);
+        }
+        wrapper.eq("delete_flag", 0);
+        List<MarketReceivingAddress> list = marketReceivingAddressMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+        Integer count = marketReceivingAddressMapper.selectCount(wrapper);
+        return new Page<MarketReceivingAddress>(list, page, limit, count);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean delete(String id) {
+        String[] ids = String.valueOf(id).split(",");
+        for (String tt : ids) {
+            MarketReceivingAddress tmp = marketReceivingAddressMapper.selectById(Long.parseLong(tt));
+            if (tmp != null) {
+                tmp.setDeleteFlag(1);
+                marketReceivingAddressMapper.updateById(tmp);
+            }
+        }
+        return true;
+    }
+
+    @Override
+    public Boolean update(MarketReceivingAddress marketReceivingAddress, Long adminId) throws ServiceException {
+        Date now = new Date();
+        marketReceivingAddress.setGmtUpdate(now);
+        marketReceivingAddress.setAdminId(adminId);
+        return marketReceivingAddressMapper.updateById(marketReceivingAddress) > 0;
+    }
+
+    @Override
+    public MarketReceivingAddress get(Long id) throws ServiceException {
+        return marketReceivingAddressMapper.selectById(id);
+    }
+
+    @Override
+    public String export(Long companyId, String cusId, String consigneeName, String phone, String location, String address, String status, Integer deleteFlag, Date gmtCreate, Date gmtUpdate, Long userId, Long adminId, Integer page, Integer limit) throws ServiceException {
+        Wrapper<MarketReceivingAddress> wrapper = new EntityWrapper<MarketReceivingAddress>();
+        if (!StringUtils.isEmpty(companyId)) {
+            wrapper.eq("company_id", companyId);
+        }
+        if (!StringUtils.isEmpty(cusId)) {
+            wrapper.eq("cus_id", cusId);
+        }
+        if (!StringUtils.isEmpty(consigneeName)) {
+            wrapper.eq("consignee_name", consigneeName);
+        }
+        if (!StringUtils.isEmpty(phone)) {
+            wrapper.eq("phone", phone);
+        }
+        if (!StringUtils.isEmpty(location)) {
+            wrapper.eq("location", location);
+        }
+        if (!StringUtils.isEmpty(address)) {
+            wrapper.eq("address", address);
+        }
+        if (!StringUtils.isEmpty(status)) {
+            wrapper.eq("status", status);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(userId)) {
+            wrapper.eq("user_id", userId);
+        }
+        if (!StringUtils.isEmpty(adminId)) {
+            wrapper.eq("admin_id", adminId);
+        }
+        List<MarketReceivingAddress> list = marketReceivingAddressMapper.selectList(wrapper);
+        ExcelUtil<MarketReceivingAddress> util = new ExcelUtil<MarketReceivingAddress>(MarketReceivingAddress.class);
+        return util.exportExcel(list, "操作日志");
+    }
+}

+ 167 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/market/impl/MarketShopInfoServiceImpl.java

@@ -0,0 +1,167 @@
+package com.iotechn.unimall.admin.api.market.impl;
+
+import java.util.List;
+
+import com.iotechn.unimall.admin.api.market.IMarketShopInfoService;
+import com.iotechn.unimall.data.domain.market.MarketShopInfo;
+import com.iotechn.unimall.data.mapper.market.MarketShopInfoMapper;
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.util.ExcelUtil;
+import com.iotechn.unimall.data.model.Page;
+
+import java.util.Date;
+
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 商店信息Service业务层处理
+ *
+ * @author jlb
+ * @date 2022-08-01
+ */
+@Service
+public class MarketShopInfoServiceImpl implements IMarketShopInfoService {
+    @Autowired
+    private MarketShopInfoMapper marketShopInfoMapper;
+
+
+    @Override
+    public Boolean add(MarketShopInfo marketShopInfo, Long adminId) throws ServiceException {
+        Date now = new Date();
+        marketShopInfo.setGmtCreate(now);
+        marketShopInfo.setGmtUpdate(now);
+        marketShopInfo.setAdminId(adminId);
+        return marketShopInfoMapper.insert(marketShopInfo) > 0;
+    }
+
+
+    @Override
+    public Page<MarketShopInfo> list(Long companyId, String name, String postion, String url, String phone, String status, Integer deleteFlag, Date gmtCreate, Date gmtUpdate, Long userId, Long adminId, String level, String caseWorld, String lon, String lat, Integer page, Integer limit) throws ServiceException {
+        Wrapper<MarketShopInfo> wrapper = new EntityWrapper<MarketShopInfo>();
+        if (!StringUtils.isEmpty(companyId)) {
+            wrapper.eq("company_id", companyId);
+        }
+        if (!StringUtils.isEmpty(name)) {
+            wrapper.eq("name", name);
+        }
+        if (!StringUtils.isEmpty(postion)) {
+            wrapper.eq("postion", postion);
+        }
+        if (!StringUtils.isEmpty(url)) {
+            wrapper.eq("url", url);
+        }
+        if (!StringUtils.isEmpty(phone)) {
+            wrapper.eq("phone", phone);
+        }
+        if (!StringUtils.isEmpty(level)) {
+            wrapper.eq("level", level);
+        }
+        if (!StringUtils.isEmpty(caseWorld)) {
+            wrapper.eq("caseWorld", caseWorld);
+        }
+        if (!StringUtils.isEmpty(lon)) {
+            wrapper.eq("lon", lon);
+        }
+        if (!StringUtils.isEmpty(lat)) {
+            wrapper.eq("lat", lat);
+        }
+
+        if (!StringUtils.isEmpty(status)) {
+            wrapper.eq("status", status);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(userId)) {
+            wrapper.eq("user_id", userId);
+        }
+        if (!StringUtils.isEmpty(adminId)) {
+            wrapper.eq("admin_id", adminId);
+        }
+        wrapper.eq("delete_flag", 0);
+        List<MarketShopInfo> list = marketShopInfoMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+        Integer count = marketShopInfoMapper.selectCount(wrapper);
+        return new Page<MarketShopInfo>(list, page, limit, count);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean delete(String id) {
+        String[] ids = String.valueOf(id).split(",");
+        for (String tt : ids) {
+            MarketShopInfo tmp = marketShopInfoMapper.selectById(Long.parseLong(tt));
+            if (tmp != null) {
+                tmp.setDeleteFlag(1);
+                marketShopInfoMapper.updateById(tmp);
+            }
+        }
+        return true;
+    }
+
+    @Override
+    public Boolean update(MarketShopInfo marketShopInfo, Long adminId) throws ServiceException {
+        Date now = new Date();
+        marketShopInfo.setGmtUpdate(now);
+        marketShopInfo.setAdminId(adminId);
+        return marketShopInfoMapper.updateById(marketShopInfo) > 0;
+    }
+
+    @Override
+    public MarketShopInfo get(Long id) throws ServiceException {
+        return marketShopInfoMapper.selectById(id);
+    }
+
+    @Override
+    public String export(Long companyId, String name, String postion, String url, String phone, String status, Integer deleteFlag, Date gmtCreate, Date gmtUpdate, Long userId, Long adminId, Integer page, Integer limit) throws ServiceException {
+        Wrapper<MarketShopInfo> wrapper = new EntityWrapper<MarketShopInfo>();
+        if (!StringUtils.isEmpty(companyId)) {
+            wrapper.eq("company_id", companyId);
+        }
+        if (!StringUtils.isEmpty(name)) {
+            wrapper.eq("name", name);
+        }
+        if (!StringUtils.isEmpty(postion)) {
+            wrapper.eq("postion", postion);
+        }
+        if (!StringUtils.isEmpty(url)) {
+            wrapper.eq("url", url);
+        }
+        if (!StringUtils.isEmpty(phone)) {
+            wrapper.eq("phone", phone);
+        }
+        if (!StringUtils.isEmpty(status)) {
+            wrapper.eq("status", status);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(userId)) {
+            wrapper.eq("user_id", userId);
+        }
+        if (!StringUtils.isEmpty(adminId)) {
+            wrapper.eq("admin_id", adminId);
+        }
+        List<MarketShopInfo> list = marketShopInfoMapper.selectList(wrapper);
+        ExcelUtil<MarketShopInfo> util = new ExcelUtil<MarketShopInfo>(MarketShopInfo.class);
+        return util.exportExcel(list, "操作日志");
+    }
+}

+ 21 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/monitor/online/UserOnlineService.java

@@ -0,0 +1,21 @@
+package com.iotechn.unimall.admin.api.monitor.online;
+
+import java.util.List;
+
+import com.alibaba.fastjson.JSONObject;
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.exception.ServiceException;
+
+@HttpOpenApi(group = "admin.monitor.online", description = "在线用户管理")
+public interface UserOnlineService {
+	@HttpMethod(description = "在线用户列表", permission = "admin:monitor:online:list", permissionParentName = "系统管理", permissionName = "在线用户管理")
+	public List<JSONObject> list() throws ServiceException;
+	
+	@HttpMethod(description = "强退用户", permission = "admin:monitor:online:forceLogout", permissionParentName = "系统管理", permissionName = "在线用户管理")
+	public Boolean forceLogout(
+			@HttpParam(name = "tokenId", type = HttpParamType.COMMON, description = "用户token") String tokenId)
+			throws ServiceException;
+}

+ 45 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/monitor/online/UserOnlineServiceImpl.java

@@ -0,0 +1,45 @@
+package com.iotechn.unimall.admin.api.monitor.online;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.StringRedisTemplate;
+import org.springframework.stereotype.Service;
+
+import com.alibaba.fastjson.JSONObject;
+import com.iotechn.unimall.core.Const;
+import com.iotechn.unimall.core.exception.ServiceException;
+/**
+ * 
+ * @author dyl
+ *
+ */
+@Service
+public class UserOnlineServiceImpl implements UserOnlineService {
+	@Autowired
+	private StringRedisTemplate userRedisTemplate;
+	
+	@Override
+	public List<JSONObject> list() throws ServiceException {
+		List<JSONObject> loginList=new ArrayList<JSONObject>();
+		Set<String> keys = userRedisTemplate.keys(Const.ADMIN_REDIS_PREFIX+"*");
+		Iterator<String> it1 = keys.iterator();
+		while (it1.hasNext()) {
+			String tokenId=it1.next();
+			JSONObject json = JSONObject.parseObject(userRedisTemplate.opsForValue().get(tokenId));
+			json.put("tokenId", tokenId.split("_")[2]);
+			json.put("expireTime", userRedisTemplate.getExpire(tokenId));
+			loginList.add(json);
+		}
+		return loginList;
+	}
+
+	@Override
+	public Boolean forceLogout(String tokenId) throws ServiceException {
+		return userRedisTemplate.delete(Const.ADMIN_REDIS_PREFIX  + tokenId);
+	}
+
+}

+ 11 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/monitor/server/ServerService.java

@@ -0,0 +1,11 @@
+package com.iotechn.unimall.admin.api.monitor.server;
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.data.domain.monitor.Server;
+
+@HttpOpenApi(group = "admin.monitor.server", description = "服务监控数据")
+public interface ServerService {
+	@HttpMethod(description = "获取服务监控数据", permission = "admin:monitor:server:getInfo", permissionParentName = "系统管理", permissionName = "服务监控数据")
+	public Server getInfo()throws Exception;
+}

+ 22 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/monitor/server/ServerServiceImpl.java

@@ -0,0 +1,22 @@
+package com.iotechn.unimall.admin.api.monitor.server;
+
+import org.springframework.stereotype.Service;
+
+import com.iotechn.unimall.data.domain.monitor.Server;
+
+/**
+ * 
+ * @author dyl
+ *
+ */
+@Service
+public class ServerServiceImpl implements ServerService {
+
+	@Override
+	public Server getInfo() throws Exception {
+		Server server = new Server();
+		server.copyTo();
+		return server;
+	}
+
+}

+ 57 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/order/AdminOrderService.java

@@ -0,0 +1,57 @@
+package com.iotechn.unimall.admin.api.order;
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.annotation.param.Range;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.OrderDO;
+import com.iotechn.unimall.data.dto.order.OrderDTO;
+import com.iotechn.unimall.data.model.Page;
+
+import java.util.List;
+
+/**
+ * Created by rize on 2019/7/10.
+ */
+@HttpOpenApi(group = "admin.order", description = "管理员订单服务")
+public interface AdminOrderService {
+
+    @HttpMethod(description = "列表", permission = "operation:order:list", permissionParentName = "运营管理", permissionName = "订单管理")
+    public Page<OrderDO> list(
+            @HttpParam(name = "page", type = HttpParamType.COMMON, description = "订单页码", valueDef = "1") Integer page,
+            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit,
+            @HttpParam(name = "status", type = HttpParamType.COMMON, description = "订单状态") Integer status,
+            @HttpParam(name = "orderNo", type = HttpParamType.COMMON, description = "订单号") String orderNo,
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员Id") Long adminId) throws ServiceException;
+
+
+    @HttpMethod(description = "退款", permission = "operation:order:refund", permissionParentName = "运营管理", permissionName = "订单管理")
+    public String refund(
+            @NotNull @HttpParam(name = "orderNo", type = HttpParamType.COMMON, description = "订单号") String orderNo,
+            @NotNull @HttpParam(name = "type", type = HttpParamType.COMMON, description = "0.拒绝退款 1.同意退款") Integer type,
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员Id") Long adminId) throws ServiceException;
+
+
+    @HttpMethod(description = "发货", permission = "operation:order:ship", permissionParentName = "运营管理", permissionName = "订单管理")
+    public String ship(
+            @NotNull @HttpParam(name = "orderNo", type = HttpParamType.COMMON, description = "订单号") String orderNo,
+            @NotNull @HttpParam(name = "shipCode", type = HttpParamType.COMMON, description = "承运商Code") String shipCode,
+            @HttpParam(name = "shipNo", type = HttpParamType.COMMON, description = "运单号") String shipNo,
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员Id") Long adminId) throws ServiceException;
+
+    @HttpMethod(description = "详情", permission = "operation:order:detail", permissionParentName = "运营管理", permissionName = "订单管理")
+    public OrderDTO detail(
+            @NotNull @HttpParam(name = "orderId", type = HttpParamType.COMMON, description = "订单Id") Long orderNo,
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员Id") Long adminId) throws ServiceException;
+
+
+    @HttpMethod(description = "根据传入时间和订单状态查询订单信息")
+    public List<OrderDTO> queryToExcel(
+            @HttpParam(name = "gmtStart", type = HttpParamType.COMMON, description = "查询开始时间") Long gmtStart,
+            @HttpParam(name = "gmtEnd", type = HttpParamType.COMMON, description = "查询结束时间") Long gmtEnd,
+            @HttpParam(name = "status", type = HttpParamType.COMMON, description = "订单状态", valueDef = "20") Integer status,
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员Id") Long adminId) throws ServiceException;
+}

+ 198 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/order/AdminOrderServiceImpl.java

@@ -0,0 +1,198 @@
+package com.iotechn.unimall.admin.api.order;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.github.binarywang.wxpay.bean.request.WxPayRefundRequest;
+import com.github.binarywang.wxpay.bean.result.WxPayRefundResult;
+import com.github.binarywang.wxpay.service.WxPayService;
+import com.iotechn.unimall.biz.service.order.OrderBizService;
+import com.iotechn.unimall.core.exception.AdminServiceException;
+import com.iotechn.unimall.core.exception.ExceptionDefinition;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.component.LockComponent;
+import com.iotechn.unimall.data.domain.OrderDO;
+import com.iotechn.unimall.data.domain.OrderSkuDO;
+import com.iotechn.unimall.data.domain.UserDO;
+import com.iotechn.unimall.data.dto.order.OrderDTO;
+import com.iotechn.unimall.data.enums.OrderStatusType;
+import com.iotechn.unimall.data.enums.UserLoginType;
+import com.iotechn.unimall.data.mapper.OrderMapper;
+import com.iotechn.unimall.data.mapper.OrderSkuMapper;
+import com.iotechn.unimall.data.mapper.UserMapper;
+import com.iotechn.unimall.data.model.Page;
+import org.apache.ibatis.session.RowBounds;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.StringUtils;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Created by rize on 2019/7/10.
+ */
+@Service
+public class AdminOrderServiceImpl implements AdminOrderService {
+
+    private static final Logger logger = LoggerFactory.getLogger(AdminOrderServiceImpl.class);
+
+    @Autowired
+    private OrderBizService orderBizService;
+
+    @Autowired
+    private WxPayService wxPayService;
+
+    @Autowired
+    private OrderMapper orderMapper;
+
+    @Autowired
+    private OrderSkuMapper orderSkuMapper;
+
+    @Autowired
+    private LockComponent lockComponent;
+
+    @Autowired
+    private UserMapper userMapper;
+
+    @Value("${com.iotechn.unimall.wx.mini.app-id}")
+    private String wxMiNiAppid;
+
+    @Value("${com.iotechn.unimall.wx.app.app-id}")
+    private String wxAppAppid;
+
+    @Override
+    public Page<OrderDO> list(Integer pageNo, Integer pageSize, Integer status, String orderNo, Long adminId) throws ServiceException {
+        Wrapper<OrderDO> wrapper = new EntityWrapper<OrderDO>();
+        wrapper.orderBy("id", false);
+        if (!StringUtils.isEmpty(orderNo)) {
+            wrapper.eq("order_no", orderNo);
+        }
+        if (status != null) {
+            wrapper.eq("status", status);
+        }
+        List<OrderDO> orderDOS = orderMapper.selectPage(new RowBounds((pageNo - 1) * pageSize, pageSize), wrapper);
+        Integer count = orderMapper.selectCount(wrapper);
+        return new Page<OrderDO>(orderDOS, pageNo, pageSize, count);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String refund(String orderNo, Integer type, Long adminId) throws ServiceException {
+        if (lockComponent.tryLock(OrderBizService.ORDER_REFUND_LOCK + orderNo, 30)) {
+            try {
+                //1.校验订单状态是否处于退款中
+                OrderDO orderDO = orderBizService.checkOrderExist(orderNo, null);
+                if (orderDO.getStatus() != OrderStatusType.REFUNDING.getCode()) {
+                    throw new AdminServiceException(ExceptionDefinition.ORDER_STATUS_NOT_SUPPORT_REFUND);
+                }
+                //2.退款处理
+                if (type == 0) {
+                    //2.1 店主拒绝退款
+                    OrderDO updateOrderDO = new OrderDO();
+                    updateOrderDO.setStatus(OrderStatusType.WAIT_CONFIRM.getCode());
+                    updateOrderDO.setGmtUpdate(new Date());
+                    orderBizService.changeOrderStatus(orderNo, OrderStatusType.REFUNDING.getCode(), updateOrderDO);
+                    return "ok";
+                } else if (type == 1) {
+                    //2.2 店主同意退款
+                    //2.2.1 先流转状态
+                    OrderDO updateOrderDO = new OrderDO();
+                    updateOrderDO.setStatus(OrderStatusType.REFUNDED.getCode());
+                    updateOrderDO.setGmtUpdate(new Date());
+                    orderBizService.changeOrderStatus(orderNo, OrderStatusType.REFUNDING.getCode(), updateOrderDO);
+                    Long userId = orderDO.getUserId();
+                    UserDO userDO = userMapper.selectById(userId);
+                    Integer loginType = userDO.getLoginType();
+                    //2.2.2 向微信支付平台发送退款请求
+                    WxPayRefundRequest wxPayRefundRequest = new WxPayRefundRequest();
+                    wxPayRefundRequest.setAppid(loginType == UserLoginType.MP_WEIXIN.getCode() ? wxMiNiAppid : wxAppAppid);
+                    wxPayRefundRequest.setOutTradeNo(orderNo);
+                    wxPayRefundRequest.setOutRefundNo("refund_" + orderNo);
+                    wxPayRefundRequest.setTotalFee(orderDO.getPayPrice() - orderDO.getFreightPrice());
+                    wxPayRefundRequest.setRefundFee(orderDO.getPayPrice() - orderDO.getFreightPrice());
+                    WxPayRefundResult wxPayRefundResult = wxPayService.refund(wxPayRefundRequest);
+                    if (!wxPayRefundResult.getReturnCode().equals("SUCCESS")) {
+                        logger.warn("[微信退款] 失败 : " + wxPayRefundResult.getReturnMsg());
+                        throw new AdminServiceException(wxPayRefundResult.getReturnMsg(),
+                                ExceptionDefinition.THIRD_PART_SERVICE_EXCEPTION.getCode());
+                    }
+                    if (!wxPayRefundResult.getResultCode().equals("SUCCESS")) {
+                        logger.warn("[微信退款] 失败 : " + wxPayRefundResult.getReturnMsg());
+                        throw new AdminServiceException(wxPayRefundResult.getReturnMsg(),
+                                ExceptionDefinition.THIRD_PART_SERVICE_EXCEPTION.getCode());
+                    }
+                    return "ok";
+                } else {
+                    throw new AdminServiceException(ExceptionDefinition.PARAM_CHECK_FAILED);
+                }
+            } catch (ServiceException e) {
+                throw e;
+            } catch (Exception e) {
+                logger.error("[微信退款] 异常", e);
+                throw new AdminServiceException(ExceptionDefinition.ADMIN_UNKNOWN_EXCEPTION);
+            } finally {
+                lockComponent.release(OrderBizService.ORDER_REFUND_LOCK + orderNo);
+            }
+        } else {
+            throw new AdminServiceException(ExceptionDefinition.SYSTEM_BUSY);
+        }
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String ship(String orderNo, String shipCode, String shipNo, Long adminId) throws ServiceException {
+        orderBizService.checkOrderExist(orderNo, null);
+        OrderDO updateOrderDO = new OrderDO();
+        Date now = new Date();
+        updateOrderDO.setGmtUpdate(now);
+        updateOrderDO.setGmtShip(now);
+        updateOrderDO.setStatus(OrderStatusType.WAIT_CONFIRM.getCode());
+        if (!"NONE".equals(shipCode)) {
+            updateOrderDO.setShipCode(shipCode);
+            updateOrderDO.setShipNo(shipNo);
+        }
+        //流转订单状态
+        orderBizService.changeOrderStatus(orderNo, OrderStatusType.WAIT_STOCK.getCode(), updateOrderDO);
+        return "ok";
+    }
+
+    @Override
+    public OrderDTO detail(Long orderId, Long adminId) throws ServiceException {
+        return orderBizService.getOrderDetail(orderId, null);
+    }
+
+    @Override
+    public List<OrderDTO> queryToExcel(Long gmtStart, Long gmtEnd, Integer status, Long adminId) throws ServiceException {
+        EntityWrapper wrapper = new EntityWrapper();
+        if(gmtStart != null && gmtEnd != null){
+            if(gmtStart > gmtStart){
+                throw new AdminServiceException(ExceptionDefinition.ORDER_EXCEL_PARAM_ERROR);
+            }
+            wrapper.between("gmt_create",new Date(gmtStart) ,new Date(gmtEnd));
+        }
+        if(status != null){
+            wrapper.eq("status", status);
+        }
+        List<OrderDO> orderDOS = orderMapper.selectList(wrapper);
+        if(orderDOS == null || orderDOS.size() == 0){
+            return null;
+        }
+        List<OrderDTO> orderDTOList = new ArrayList<>();
+        for (OrderDO temp: orderDOS ) {
+            OrderDTO orderDTO = new OrderDTO();
+            BeanUtils.copyProperties(temp, orderDTO);
+            orderDTOList.add(orderDTO);
+        }
+        for (OrderDTO orderDTO:orderDTOList) {
+                List<OrderSkuDO> orderSkuDOList =  orderSkuMapper.selectList(new EntityWrapper<OrderSkuDO>().eq("order_no",orderDTO.getOrderNo() ));
+                orderDTO.setSkuList(orderSkuDOList);
+        }
+        return orderDTOList;
+    }
+}

+ 54 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/recommend/AdminRecommendService.java

@@ -0,0 +1,54 @@
+package com.iotechn.unimall.admin.api.recommend;
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.annotation.param.Range;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.RecommendDO;
+import com.iotechn.unimall.data.dto.RecommendDTO;
+import com.iotechn.unimall.data.model.Page;
+import org.apache.ibatis.annotations.Param;
+
+import java.rmi.ServerException;
+import java.util.List;
+
+/**
+ * Created with IntelliJ IDEA.
+ * Description:
+ * User: kbq
+ * Date: 2019-07-08
+ * Time: 下午3:42
+ */
+
+@HttpOpenApi(group = "admin.recommend", description = "推荐商品")
+public interface AdminRecommendService {
+
+    @HttpMethod(description = "创建", permission = "promote:recommend:create", permissionParentName = "推广管理", permissionName = "推荐管理")
+    public Boolean addRecommend(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
+            @NotNull @HttpParam(name = "spuId", type = HttpParamType.COMMON, description = "商品Id") Long spuId,
+            @NotNull @HttpParam(name = "recommendType", type = HttpParamType.COMMON, description = "推荐类型") Integer recommendType) throws ServiceException;
+
+    @HttpMethod(description = "删除", permission = "promote:recommend:delete", permissionParentName = "推广管理", permissionName = "推荐管理")
+    public Boolean deleteRecommend(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
+            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "推荐id") Long id,
+            @NotNull @HttpParam(name = "recommendType", type = HttpParamType.COMMON, description = "推荐类型") Integer recommendType) throws ServiceException;
+
+    @HttpMethod(description = "查询", permission = "promote:recommend:query", permissionParentName = "推广管理", permissionName = "推荐管理")
+    public Page<RecommendDTO> queryRecommendByType(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
+            @HttpParam(name = "recommendType", type = HttpParamType.COMMON, description = "推荐类型") Integer recommendType,
+            @Range(min = 1) @HttpParam(name = "pageNo", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer pageNo,
+            @Range(min = 1) @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页面长度", valueDef = "10") Integer pageSize) throws ServiceException;
+
+    @HttpMethod(description = "查询", permission = "promote:recommend:query", permissionParentName = "推广管理", permissionName = "推荐管理")
+    public Page<RecommendDTO> queryAllRecommend(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
+            @Range(min = 1) @HttpParam(name = "pageNo", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer pageNo,
+            @Range(min = 1) @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页面长度", valueDef = "10") Integer pageSize) throws ServiceException;
+
+}

+ 99 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/recommend/AdminRecommendServiceImpl.java

@@ -0,0 +1,99 @@
+package com.iotechn.unimall.admin.api.recommend;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.iotechn.unimall.biz.service.recommend.RecommendBizService;
+import com.iotechn.unimall.core.exception.AdminServiceException;
+import com.iotechn.unimall.core.exception.ExceptionDefinition;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.component.CacheComponent;
+import com.iotechn.unimall.data.domain.RecommendDO;
+import com.iotechn.unimall.data.domain.SpuDO;
+import com.iotechn.unimall.data.dto.RecommendDTO;
+import com.iotechn.unimall.data.mapper.RecommendMapper;
+import com.iotechn.unimall.data.mapper.SpuMapper;
+import com.iotechn.unimall.data.model.Page;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Created with IntelliJ IDEA.
+ * Description:
+ * User: kbq
+ * Date: 2019-07-08
+ * Time: 下午5:47
+ */
+@Service
+public class AdminRecommendServiceImpl implements AdminRecommendService {
+
+    @Autowired
+    private CacheComponent cacheComponent;
+    @Autowired
+    private RecommendMapper recommendMapper;
+    @Autowired
+    private SpuMapper spuMapper;
+    @Autowired
+    private RecommendBizService recommendBizService;
+
+    private final static String RECOMMEND_NAME = "RECOMMEND_TYPE_";
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean addRecommend(Long adminId, Long spuId, Integer recommendType) throws ServiceException {
+
+        if (!(spuMapper.selectCount(new EntityWrapper<SpuDO>().eq("id", spuId)) > 0)) {
+            throw new AdminServiceException(ExceptionDefinition.RECOMMEND_SPU_NO_HAS);
+        }
+
+        if (recommendMapper.selectCount(new EntityWrapper<RecommendDO>()
+                .eq("spu_id", spuId)
+                .eq("recommend_type", recommendType)) > 0) {
+            throw new AdminServiceException(ExceptionDefinition.RECOMMEND_ALREADY_HAS);
+        }
+        RecommendDO recommendDO = new RecommendDO(spuId, recommendType);
+        Date now = new Date();
+        recommendDO.setGmtCreate(now);
+        recommendDO.setGmtUpdate(now);
+        if (!(recommendMapper.insert(recommendDO) > 0)) {
+            throw new AdminServiceException(ExceptionDefinition.RECOMMEND_SQL_ADD_FAILED);
+        }
+        cacheComponent.delPrefixKey(RECOMMEND_NAME+recommendType);
+        return true;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean deleteRecommend(Long adminId, Long id, Integer recommendType) throws ServiceException {
+
+        Integer judgeSQL = recommendMapper.delete(new EntityWrapper<RecommendDO>()
+                .eq("id", id)
+                .eq("recommend_type",recommendType));
+
+        if(judgeSQL > 0){
+            cacheComponent.delPrefixKey(RECOMMEND_NAME + recommendType);
+            return true;
+        }
+
+        throw new AdminServiceException(ExceptionDefinition.RECOMMEND_SQL_DELETE_FAILED);
+    }
+
+    @Override
+    public Page<RecommendDTO> queryRecommendByType(Long adminId, Integer recommendType, Integer pageNo, Integer pageSize) throws ServiceException {
+        if(recommendType == null){
+            return recommendBizService.queryAllRecommend(pageNo, pageSize);
+        }
+
+        Integer count = recommendMapper.selectCount(new EntityWrapper<RecommendDO>().eq("recommend_type",recommendType));
+        List<RecommendDTO> recommendDTOList = recommendMapper.getRecommendByType(recommendType,(pageNo-1)*pageSize,pageSize);
+        Page<RecommendDTO> page = new Page<>(recommendDTOList,pageNo,pageSize,count);
+        return page;
+    }
+
+    @Override
+    public Page<RecommendDTO> queryAllRecommend(Long adminId, Integer pageNo, Integer pageSize) throws ServiceException {
+        return recommendBizService.queryAllRecommend(pageNo, pageSize);
+    }
+}

+ 65 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/role/RoleService.java

@@ -0,0 +1,65 @@
+package com.iotechn.unimall.admin.api.role;
+
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.RoleDO;
+import com.iotechn.unimall.data.dto.RoleSetPermissionDTO;
+import com.iotechn.unimall.data.model.Page;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by rize on 2019/4/11.
+ */
+@HttpOpenApi(group = "admin.role", description = "角色服务")
+public interface RoleService {
+
+    @HttpMethod(description = "列表", permission = "admin:role:list", permissionParentName = "系统管理", permissionName = "角色管理")
+    public Page<RoleDO> list(
+            @HttpParam(name = "name", type = HttpParamType.COMMON, description = "搜索名称") String name,
+            @HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit,
+            @HttpParam(name = "adminId", type = HttpParamType.USER_ID, description = "管理员ID") Long adminId) throws ServiceException;
+
+
+    @HttpMethod(description = "添加", permission = "admin:role:create", permissionParentName = "系统管理", permissionName = "角色管理")
+    public RoleDO create(
+            @NotNull @HttpParam(name = "role", type = HttpParamType.COMMON, description = "角色对象") RoleDO roleDO,
+            @HttpParam(name = "adminId", type = HttpParamType.USER_ID, description = "管理员ID") Long adminId) throws ServiceException;
+
+
+    @HttpMethod(description = "删除", permission = "admin:role:delete", permissionParentName = "系统管理", permissionName = "角色管理")
+    public String delete(
+            @NotNull @HttpParam(name = "roleId", type = HttpParamType.COMMON, description = "角色Id") Long roleId,
+            @HttpParam(name = "adminId", type = HttpParamType.USER_ID, description = "管理员ID") Long adminId) throws ServiceException;
+
+
+    @HttpMethod(description = "更新", permission = "admin:role:update", permissionParentName = "系统管理", permissionName = "角色管理")
+    public RoleDO update(
+            @NotNull @HttpParam(name = "role", type = HttpParamType.COMMON, description = "角色对象") RoleDO roleDO,
+            @HttpParam(name = "adminId", type = HttpParamType.USER_ID, description = "管理员ID") Long adminId) throws ServiceException;
+
+
+    @HttpMethod(description = "角色授权", permission = "admin:role:permissionList",  permissionParentName = "系统管理", permissionName = "角色管理")
+    public String permissionSet(
+            @NotNull @HttpParam(name = "roleSetPermissionDTO", type = HttpParamType.COMMON, description = "设置DTO") RoleSetPermissionDTO roleSetPermissionDTO,
+            @HttpParam(name = "adminId", type = HttpParamType.USER_ID, description = "管理员ID") Long adminId) throws ServiceException;
+
+
+    @HttpMethod(description = "权限列表", permission = "admin:permission:list", permissionParentName = "系统管理", permissionName = "角色管理")
+    public Map<String,Object> permissionList(
+            @NotNull @HttpParam(name = "roleId", type = HttpParamType.COMMON, description = "角色ID") Long roleId,
+            @HttpParam(name = "adminId", type = HttpParamType.USER_ID, description = "管理员ID") Long adminId) throws ServiceException;
+
+
+    @HttpMethod(description = "角色枚举")
+    public List<Map<String,Object>> options(
+            @HttpParam(name = "adminId", type = HttpParamType.USER_ID, description = "管理员ID") Long adminId) throws ServiceException;
+
+}

+ 141 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/role/RoleServiceImpl.java

@@ -0,0 +1,141 @@
+package com.iotechn.unimall.admin.api.role;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.core.exception.AdminServiceException;
+import com.iotechn.unimall.core.exception.ExceptionDefinition;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.RoleDO;
+import com.iotechn.unimall.data.domain.RolePermissionDO;
+import com.iotechn.unimall.data.dto.PermissionPointDTO;
+import com.iotechn.unimall.data.dto.RoleSetPermissionDTO;
+import com.iotechn.unimall.data.enums.RoleStatusType;
+import com.iotechn.unimall.data.mapper.RoleMapper;
+import com.iotechn.unimall.data.mapper.RolePermissionMapper;
+import com.iotechn.unimall.data.model.Page;
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
+
+import java.util.*;
+
+/**
+ * Created by rize on 2019/4/11.
+ */
+@Service
+public class RoleServiceImpl implements RoleService {
+
+    @Autowired
+    private RoleMapper roleMapper;
+
+    @Autowired
+    private RolePermissionMapper rolePermissionMapper;
+
+    public static List<PermissionPointDTO> permDTOs = new LinkedList<>();
+
+    public static Set<String> allPermPoint = new HashSet<>();
+
+    @Override
+    public Page<RoleDO> list(String name, Integer page, Integer limit, Long adminId) throws ServiceException {
+        Wrapper<RoleDO> wrapper = new EntityWrapper<RoleDO>();
+        if (!StringUtils.isEmpty(name)) {
+            wrapper.like("name", name);
+        }
+        List<RoleDO> roleDOS = roleMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+        Integer count = roleMapper.selectCount(wrapper);
+        return new Page<RoleDO>(roleDOS, page, limit, count);
+    }
+
+    @Override
+    public RoleDO create(RoleDO roleDO, Long adminId) throws ServiceException {
+        Date now = new Date();
+        roleDO.setStatus(RoleStatusType.ACTIVE.getCode());
+        roleDO.setGmtUpdate(now);
+        roleDO.setGmtCreate(now);
+        if (roleMapper.insert(roleDO) > 0) {
+            return roleDO;
+        }
+        throw new AdminServiceException(ExceptionDefinition.ADMIN_UNKNOWN_EXCEPTION);
+    }
+
+    @Override
+    public String delete(Long roleId, Long adminId) throws ServiceException {
+        if (roleMapper.deleteById(roleId) > 0) {
+            return "ok";
+        }
+        throw new AdminServiceException(ExceptionDefinition.ADMIN_UNKNOWN_EXCEPTION);
+    }
+
+    @Override
+    public RoleDO update(RoleDO roleDO, Long adminId) throws ServiceException {
+        if (roleMapper.updateById(roleDO) > 0) {
+            return roleDO;
+        }
+        throw new AdminServiceException(ExceptionDefinition.ADMIN_UNKNOWN_EXCEPTION);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String permissionSet(RoleSetPermissionDTO roleSetPermissionDTO, Long adminId) throws ServiceException {
+        Long roleId = roleSetPermissionDTO.getRoleId();
+        if (roleId == null) {
+            throw new AdminServiceException(ExceptionDefinition.PARAM_CHECK_FAILED);
+        }
+        rolePermissionMapper.delete(new EntityWrapper<RolePermissionDO>().eq("role_id", roleId));
+        //构建插入
+        List<String> permissions = roleSetPermissionDTO.getPermissions();
+        if (!CollectionUtils.isEmpty(permissions)) {
+            Date now = new Date();
+            for (String permission : permissions) {
+                RolePermissionDO rolePermissionDO = new RolePermissionDO();
+                rolePermissionDO.setRoleId(roleId);
+                rolePermissionDO.setDeleted(0);
+                rolePermissionDO.setPermission(permission);
+                rolePermissionDO.setGmtCreate(now);
+                rolePermissionDO.setGmtUpdate(now);
+                rolePermissionMapper.insert(rolePermissionDO);
+            }
+        }
+        return "ok";
+    }
+
+    @Override
+    public Map<String,Object> permissionList(Long roleId, Long adminId) throws ServiceException {
+        List<RolePermissionDO> rolePermissionDOList =
+                rolePermissionMapper.selectList(
+                        new EntityWrapper<RolePermissionDO>()
+                                .eq("role_id", roleId));
+
+        Map<String,Object> map = new HashMap<>();
+        Set<String> permissionPoint = new HashSet<>();
+        for (RolePermissionDO permissionDO : rolePermissionDOList) {
+            if ("*".equals(permissionDO.getPermission())) {
+                //若为超级管理员,则直接push所有权限进去
+                permissionPoint.addAll(allPermPoint);
+                break;
+            } else {
+                permissionPoint.add(permissionDO.getPermission());
+            }
+        }
+        map.put("systemPermissions", permDTOs);
+        map.put("assignedPermissions", permissionPoint);
+        return map;
+    }
+
+    @Override
+    public List<Map<String, Object>> options(Long adminId) throws ServiceException {
+        List<RoleDO> roleDOS = roleMapper.selectList(new EntityWrapper<>());
+        List<Map<String,Object>> list = new LinkedList<>();
+        roleDOS.forEach(item -> {
+            Map<String,Object> map = new HashMap<>();
+            map.put("value", item.getId());
+            map.put("label", item.getName());
+            list.add(map);
+        });
+        return list;
+    }
+
+}

+ 74 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/tools/gen/GenTableService.java

@@ -0,0 +1,74 @@
+package com.iotechn.unimall.admin.api.tools.gen;
+
+import java.util.List;
+
+import com.alibaba.fastjson.JSONObject;
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.tools.gen.GenTable;
+import com.iotechn.unimall.data.domain.tools.gen.GenTableColumn;
+import com.iotechn.unimall.data.model.Page;
+
+/**
+ * 
+ * @author dyl
+ *
+ */
+@HttpOpenApi(group = "admin.tools.gen", description = "代码生成")
+public interface GenTableService {
+	@HttpMethod(description = "代码生成列表", permission = "admin:tools:gen:list", permissionParentName = "系统工具", permissionName = "代码生成")
+	public Page<GenTable> list(
+			@HttpParam(name = "tableName", type = HttpParamType.COMMON, description = "表名称") String tableName,
+			@HttpParam(name = "tableComment", type = HttpParamType.COMMON, description = "表描述") String tableComment,
+			@HttpParam(name = "beginTime", type = HttpParamType.COMMON, description = "开始时间") String beginTime,
+			@HttpParam(name = "endTime", type = HttpParamType.COMMON, description = "结束时间") String endTime,
+			@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+			@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+			throws ServiceException;
+
+	@HttpMethod(description = "数据表列表", permission = "admin:tools:gen:dbList", permissionParentName = "系统工具", permissionName = "代码生成")
+	public Page<GenTable> getDbList(
+			@HttpParam(name = "tableName", type = HttpParamType.COMMON, description = "表名称") String tableName,
+			@HttpParam(name = "tableComment", type = HttpParamType.COMMON, description = "表描述") String tableComment,
+			@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+			@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+			throws ServiceException;
+
+	@HttpMethod(description = "查询数据表详情", permission = "admin:tools:gen:get", permissionParentName = "系统工具", permissionName = "代码生成")
+	public JSONObject get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "表ID") String id)
+			throws ServiceException;
+
+	@HttpMethod(description = "查询数据表字段详情", permission = "admin:tools:genTable:getColumn", permissionParentName = "系统工具", permissionName = "代码生成")
+	public List<GenTableColumn> getColumn(
+			@HttpParam(name = "talbleId", type = HttpParamType.COMMON, description = "表ID") String talbleId)
+			throws ServiceException;
+
+	@HttpMethod(description = "导入表结构", permission = "admin:tools:gen:import", permissionParentName = "系统工具", permissionName = "代码生成")
+	public Boolean importTableSave(
+			@HttpParam(name = "tables", type = HttpParamType.COMMON, description = "表名") String tables)
+			throws ServiceException;
+
+	@HttpMethod(description = "修改表生成信息", permission = "admin:tools:gen:update", permissionParentName = "系统工具", permissionName = "代码生成")
+	public Boolean update(
+			@NotNull @HttpParam(name = "genTable", type = HttpParamType.COMMON, description = "表信息") GenTable genTable)
+			throws ServiceException;
+
+	@HttpMethod(description = "修改表字段生成信息", permission = "admin:tools:gen:updateColumn", permissionParentName = "系统工具", permissionName = "代码生成")
+	public Boolean updateColumn(
+			@NotNull @HttpParam(name = "genTableColumn", type = HttpParamType.COMMON, description = "表字段信息") GenTableColumn genTableColumn)
+			throws ServiceException;
+
+	@HttpMethod(description = "删除", permission = "admin:tools:gen:delete", permissionParentName = "系统工具", permissionName = "代码生成")
+	public Boolean delete(
+			@NotNull @HttpParam(name = "tableIds", type = HttpParamType.COMMON, description = "表Id") String tableIds)
+			throws ServiceException;
+
+	@HttpMethod(description = "代码预览", permission = "admin:tools:gen:preview", permissionParentName = "系统工具", permissionName = "代码生成")
+	public JSONObject preview(
+			@NotNull @HttpParam(name = "tableId", type = HttpParamType.COMMON, description = "表Id") String tableId)
+			throws ServiceException;
+}

+ 179 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/tools/gen/GenTableServiceImpl.java

@@ -0,0 +1,179 @@
+package com.iotechn.unimall.admin.api.tools.gen;
+
+import java.io.StringWriter;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.ibatis.session.RowBounds;
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.Velocity;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.core.exception.AdminServiceException;
+import com.iotechn.unimall.core.exception.ExceptionDefinition;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.core.util.StringUtils;
+import com.iotechn.unimall.data.domain.tools.gen.GenTable;
+import com.iotechn.unimall.data.domain.tools.gen.GenTableColumn;
+import com.iotechn.unimall.data.mapper.tools.gen.GenTableColumnMapper;
+import com.iotechn.unimall.data.mapper.tools.gen.GenTableMapper;
+import com.iotechn.unimall.data.model.Page;
+import com.iotechn.unimall.data.util.GenUtils;
+import com.iotechn.unimall.data.util.SessionUtil;
+import com.iotechn.unimall.data.util.VelocityInitializer;
+import com.iotechn.unimall.data.util.VelocityUtils;
+
+/**
+ * 
+ * @author dyl
+ *
+ */
+@Service
+public class GenTableServiceImpl implements GenTableService {
+
+	@Autowired
+	private GenTableMapper tableMapper;
+
+	@Autowired
+	private GenTableColumnMapper tableColumnMapper;
+
+	@Override
+	public Page<GenTable> list(String tableName, String tableComment, String beginTime, String endTime, Integer page,
+			Integer limit) throws ServiceException {
+		Wrapper<GenTable> wrapper = new EntityWrapper<GenTable>();
+		if (!StringUtils.isEmpty(tableName)) {
+			wrapper.eq("table_name", tableName);
+		}
+		if (!StringUtils.isEmpty(tableComment)) {
+			wrapper.like("table_comment", tableComment);
+		}
+		if (!StringUtils.isEmpty(beginTime) && !StringUtils.isEmpty(endTime)) {
+			wrapper.between("create_time", beginTime, endTime);
+		}
+		List<GenTable> GenTableS = tableMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+		Integer count = tableMapper.selectCount(wrapper);
+		return new Page<GenTable>(GenTableS, page, limit, count);
+	}
+
+	@Override
+	public Page<GenTable> getDbList(String tableName, String tableComment, Integer page, Integer limit)
+			throws ServiceException {
+		GenTable genTable = new GenTable();
+		genTable.setTableName(tableName);
+		genTable.setTableComment(tableComment);
+		List<GenTable> GenTableS = tableMapper.selectDbTableList(new RowBounds((page - 1) * limit, limit), genTable);
+		Integer count = tableMapper.selectDbTableCount(genTable);
+		return new Page<GenTable>(GenTableS, page, limit, count);
+	}
+
+	@Override
+	public JSONObject get(String id) throws ServiceException {
+		JSONObject result = new JSONObject();
+		Wrapper<GenTableColumn> wrapper = new EntityWrapper<GenTableColumn>();
+		wrapper.eq("table_id", id);
+
+		GenTable table = tableMapper.selectById(id);
+		List<GenTableColumn> list = tableColumnMapper.selectList(wrapper);
+
+		result.put("info", table);
+		result.put("rows", list);
+		return result;
+	}
+
+	@Override
+	public List<GenTableColumn> getColumn(String talbleId) throws ServiceException {
+		Wrapper<GenTableColumn> wrapper = new EntityWrapper<GenTableColumn>();
+		wrapper.eq("table_id", talbleId);
+		List<GenTableColumn> list = tableColumnMapper.selectList(wrapper);
+		return list;
+	}
+
+	@Override
+	public Boolean importTableSave(String tables) throws ServiceException {
+		String[] ids = tables.split(",");
+		List<GenTable> tableList = tableMapper.selectDbTableListByNames(ids);
+		String operName = SessionUtil.getAdmin().getUsername();
+		for (GenTable table : tableList) {
+			try {
+				String tableName = table.getTableName();
+				GenUtils.initTable(table, operName);
+				int row = tableMapper.insert(table);
+				if (row > 0) {
+					// 保存列信息
+					List<GenTableColumn> genTableColumns = tableColumnMapper.selectDbTableColumnsByName(tableName);
+					for (GenTableColumn column : genTableColumns) {
+						GenUtils.initColumnField(column, table);
+						tableColumnMapper.insert(column);
+					}
+				}
+			} catch (Exception e) {
+				e.printStackTrace();
+				throw new AdminServiceException(ExceptionDefinition.TABLE_IMPORT_ERROR);
+			}
+		}
+		return true;
+	}
+
+	@Override
+	public Boolean update(GenTable genTable) throws ServiceException {
+		return tableMapper.updateById(genTable) > 0;
+	}
+
+	@Override
+	public Boolean updateColumn(GenTableColumn genTableColumn) throws ServiceException {
+		return tableColumnMapper.updateById(genTableColumn) > 0;
+	}
+
+	@Override
+	public Boolean delete(String tableIds) throws ServiceException {
+		String[] ids = tableIds.split(",");
+		Wrapper<GenTable> wrapper = new EntityWrapper<GenTable>();
+		wrapper.in("table_id", ids);
+		return tableMapper.delete(wrapper) > 0;
+	}
+
+	@Override
+	public JSONObject preview(String tableId) throws ServiceException {
+		Map<String, String> dataMap = new LinkedHashMap<>();
+		// 查询表信息
+		GenTable table = tableMapper.selectById(tableId);
+		Wrapper<GenTableColumn> wrapper = new EntityWrapper<GenTableColumn>();
+		wrapper.eq("table_id", table.getTableId());
+		// 查询列信息
+		List<GenTableColumn> columns =tableColumnMapper.selectList(wrapper);
+		table.setColumns(columns);
+		setPkColumn(table, columns);
+		VelocityInitializer.initVelocity();
+
+		VelocityContext context = VelocityUtils.prepareContext(table);
+
+		// 获取模板列表
+		List<String> templates = VelocityUtils.getTemplateList(table.getTplCategory());
+		for (String template : templates) {
+			// 渲染模板
+			StringWriter sw = new StringWriter();
+			Template tpl = Velocity.getTemplate(template, "UTF-8");
+			tpl.merge(context, sw);
+			dataMap.put(template, sw.toString());
+		}
+		return JSONObject.parseObject(JSONObject.toJSONString(dataMap));
+	}
+
+	public void setPkColumn(GenTable table, List<GenTableColumn> columns) {
+		for (GenTableColumn column : columns) {
+			if (column.isPk()) {
+				table.setPkColumn(column);
+				break;
+			}
+		}
+		if (StringUtils.isNull(table.getPkColumn())) {
+			table.setPkColumn(columns.get(0));
+		}
+	}
+}

+ 62 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/user/AdminUserService.java

@@ -0,0 +1,62 @@
+package com.iotechn.unimall.admin.api.user;
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.annotation.param.Range;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.UserDO;
+import com.iotechn.unimall.data.model.Page;
+
+/**
+ * Created with IntelliJ IDEA.
+ * Description:
+ * User: kbq
+ * Date: 2019-07-11
+ * Time: 下午7:30
+ */
+
+@HttpOpenApi(group = "admin.user", description = "用户管理")
+public interface AdminUserService {
+
+    @HttpMethod(description = "创建", permission = "system:user:create", permissionParentName = "系统管理", permissionName = "用户管理")
+    public Boolean addUser(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
+            @NotNull @HttpParam(name = "user", type = HttpParamType.COMMON, description = "用户信息") UserDO user) throws ServiceException;
+
+    @HttpMethod(description = "删除", permission = "system:user:delete", permissionParentName = "系统管理", permissionName = "用户管理")
+    public Boolean deleteUser(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
+            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "用户Id") Long id,
+            @NotNull @HttpParam(name = "nickname", type = HttpParamType.COMMON, description = "用户Id") String nickname) throws ServiceException;
+
+    @HttpMethod(description = "修改", permission = "system:user:update", permissionParentName = "系统管理", permissionName = "用户管理")
+    public Boolean updateUser(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
+            @NotNull @HttpParam(name = "user", type = HttpParamType.COMMON, description = "用户信息") UserDO user) throws ServiceException;
+
+    @HttpMethod(description = "激活冻结", permission = "system:user:update", permissionParentName = "系统管理", permissionName = "用户管理")
+    public Boolean updateStatus(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
+            @NotNull @HttpParam(name = "userId", type = HttpParamType.COMMON, description = "用户信息") Long userId,
+            @NotNull @HttpParam(name = "status", type = HttpParamType.COMMON, description = "用户信息") Integer status) throws ServiceException;
+
+
+    @HttpMethod(description = "查询", permission = "system:user:query", permissionParentName = "系统管理", permissionName = "用户管理")
+    public Page<UserDO> getUser(
+            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
+            @HttpParam(name = "id", type = HttpParamType.COMMON, description = "用户ID") Long id,
+            @HttpParam(name = "nickname", type = HttpParamType.COMMON, description = "用户昵称") String nickname,
+            @HttpParam(name = "level", type = HttpParamType.COMMON, description = "用户等级") Integer level,
+            @HttpParam(name = "gender", type = HttpParamType.COMMON, description = "用户性别") Integer gender,
+            @HttpParam(name = "status", type = HttpParamType.COMMON, description = "用户状态") Integer status,
+            @Range(min = 1) @HttpParam(name = "pageNo", type = HttpParamType.COMMON, description = "当前页码") Integer pageNo,
+            @Range(min = 1) @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度") Integer limit) throws ServiceException;
+    @HttpMethod(description = "测试")
+    public String test(
+            @HttpParam(name = "param", type = HttpParamType.COMMON, description = "参数") String nickname,
+            @HttpParam(name = "param1", type = HttpParamType.COMMON, description = "参数") String nickname1) throws Exception;
+
+}

+ 229 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/user/AdminUserServiceImpl.java

@@ -0,0 +1,229 @@
+package com.iotechn.unimall.admin.api.user;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.dangdang.openplatform.openapi.sdk.ApiException;
+import com.dangdang.openplatform.openapi.sdk.SdkClient;
+import com.dangdang.openplatform.openapi.sdk.internal.util.FileItem;
+import com.dangdang.openplatform.openapi.sdk.request.order.OrderDetailsGetRequest;
+import com.dangdang.openplatform.openapi.sdk.request.order.OrderGoodsSendRequest;
+import com.dangdang.openplatform.openapi.sdk.request.order.OrdersContentDecryptRequest;
+import com.dangdang.openplatform.openapi.sdk.requestmodel.order.EncryptDTO;
+import com.dangdang.openplatform.openapi.sdk.requestmodel.order.OrderDetailsGet;
+import com.dangdang.openplatform.openapi.sdk.response.order.OrderDetailsGetResponse;
+import com.dangdang.openplatform.openapi.sdk.response.order.OrderGoodsSendResponse;
+import com.dangdang.openplatform.openapi.sdk.response.order.OrdersContentDecryptResponse;
+import com.dangdang.openplatform.openapi.sdk.responsemodel.order.CryptUserInfo;
+import com.dangdang.openplatform.openapi.sdk.responsemodel.order.OrdersContentDecryptDTO;
+import com.google.gson.JsonObject;
+import com.iotechn.unimall.core.util.MD5Util;
+import com.iotechn.unimall.data.util.XMLUtil;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.iotechn.unimall.core.exception.AdminServiceException;
+import com.iotechn.unimall.core.exception.ExceptionDefinition;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.UserDO;
+import com.iotechn.unimall.data.mapper.UserMapper;
+import com.iotechn.unimall.data.model.Page;
+import okhttp3.*;
+import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.codec.digest.Md5Crypt;
+import org.apache.http.HttpStatus;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.BasicCookieStore;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.util.EntityUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.io.*;
+import java.math.BigInteger;
+import java.nio.charset.StandardCharsets;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Created with IntelliJ IDEA.
+ * Description:
+ * User: kbq
+ * Date: 2019-07-11
+ * Time: 下午7:57
+ */
+@Service
+public class AdminUserServiceImpl implements AdminUserService {
+
+    @Autowired
+    private UserMapper userMapper;
+
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean addUser(Long adminId, UserDO user) throws ServiceException {
+        if (user == null) {
+            throw new AdminServiceException(ExceptionDefinition.USER_INFORMATION_MISSING);
+        }
+        if (user.getPhone() == null) {
+            throw new AdminServiceException(ExceptionDefinition.USER_INFORMATION_MISSING);
+        }
+        if (userMapper.selectCount(new EntityWrapper<UserDO>().eq("phone", user.getPhone())) > 0) {
+            throw new AdminServiceException(ExceptionDefinition.USER_PHONE_ALREADY_EXIST);
+        }
+        Date now = new Date();
+        user.setId(null);
+        user.setPassword(Md5Crypt.md5Crypt(user.getPassword().getBytes(), "$1$" + user.getPhone().substring(0, 7)));
+        user.setGmtCreate(now);
+        user.setGmtUpdate(now);
+        return userMapper.insert(user) > 0;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean deleteUser(Long adminId, Long id, String nickname) throws ServiceException {
+        return userMapper.delete(new EntityWrapper<UserDO>()
+                .eq("id", id)
+                .eq("nickname", nickname)) > 0;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean updateUser(Long adminId, UserDO user) throws ServiceException {
+        if (user == null || user.getId() == null) {
+            throw new AdminServiceException(ExceptionDefinition.USER_INFORMATION_MISSING);
+        }
+        if (user.getPhone() == null) {
+            throw new AdminServiceException(ExceptionDefinition.USER_INFORMATION_MISSING);
+        }
+        if (userMapper.selectCount(new EntityWrapper<UserDO>().eq("phone", user.getPhone()).notIn("id", user.getId())) > 0) {
+            throw new AdminServiceException(ExceptionDefinition.USER_PHONE_ALREADY_EXIST);
+        }
+        Date now = new Date();
+        user.setGmtUpdate(now);
+        UserDO userDO = userMapper.selectById(user.getId());
+        if (userDO.getPassword().equals(user.getPassword())) {
+            return userMapper.updateById(user) > 0;
+        }
+        if (user.getPassword() != null) {
+            user.setPassword(Md5Crypt.md5Crypt(user.getPassword().getBytes(), "$1$" + user.getPhone().substring(0, 7)));
+        }
+        return userMapper.updateById(user) > 0;
+    }
+
+    @Override
+    public Boolean updateStatus(Long adminId, Long userId, Integer status) throws ServiceException {
+        if (userId == null || status == null || (status != 0 && status != 1)) {
+            throw new AdminServiceException(ExceptionDefinition.USER_INFORMATION_MISSING);
+        }
+        UserDO userDO = new UserDO();
+        userDO.setId(userId);
+        userDO.setStatus(status);
+        userDO.setGmtUpdate(new Date());
+        if (userMapper.updateById(userDO) > 0) {
+            return true;
+        }
+        return false;
+    }
+
+    @Override
+    public Page<UserDO> getUser(Long adminId, Long id, String nickname, Integer level, Integer gender, Integer status, Integer pageNo, Integer limit) throws ServiceException {
+        Integer count = userMapper.countUser(id, nickname, level, gender, status);
+        List<UserDO> userDOList = userMapper.getUserList(id, nickname, level, gender, status, limit * (pageNo - 1), limit);
+        Page<UserDO> page = new Page<UserDO>(userDOList, pageNo, limit, count);
+        return page;
+    }
+
+    @Override
+    public String test(String param, String param1) throws Exception {
+        String url = "https://open-api.ushengyun.com/printer/print";
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        // 模拟登陆,按实际服务器端要求选用 Post 或 Get 请求方式
+        HttpPost httpPost = new HttpPost(url);
+        SortedMap<Object, Object> params = new TreeMap<Object, Object>();
+        Long now = new Date().getTime();
+        params.put("appid", "10317");
+        params.put("timestamp", now);
+        params.put("deviceid", "70006716");
+        params.put("devicesecret", "y77iba4i");
+        params.put("printdata", "<S2><C>#1 饿了么</C></S2><S1><C>优声科技(成都店)</C></S1><S1><C>--在线支付--</C></S1><S2><C>[预订单]</C></S2>");
+        String sign = createSign(params,"eaf56473cc6cba0d5a8e10d3a35ab51b");
+        params.put("sign", sign);
+        JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(params));
+
+        httpPost.setEntity(new StringEntity(jsonObject.toString(), StandardCharsets.UTF_8));
+        ;
+        // 设置header信息
+        httpPost.setHeader("Content-type", "application/json");
+        CloseableHttpResponse response = httpClient.execute(httpPost);
+        try {
+            // 执行请求操作,并拿到结果(同步阻塞)
+            String body = EntityUtils.toString(response.getEntity());
+            jsonObject = JSONObject.parseObject(body);
+            if (jsonObject.getString("status").equals("1001")) {
+                String token = jsonObject.getJSONObject("result").getString("token");
+                System.out.println("token = " + token);
+                return token;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            // 释放链接
+            response.close();
+            httpClient.close();
+        }
+
+        return "";
+
+    }
+    /**
+     * 生成签名
+     */
+    public static String createSign(SortedMap<Object,Object> parameters,String key){
+        StringBuffer sbkey = new StringBuffer();
+        //1.将所有参与传参的参数按照accsii排序(升序)
+        Set es = parameters.entrySet();
+        Iterator it = es.iterator();
+        while(it.hasNext()) {
+            Map.Entry entry = (Map.Entry)it.next();
+            String k = (String)entry.getKey();
+            Object v = entry.getValue();
+            //2.空值不传递,不参与签名组串
+            if(null != v && !"".equals(v)) {
+                sbkey.append(k + v );
+            }
+        }
+        sbkey=sbkey.append(key);
+        System.out.println("排序好的顺序为:"+sbkey.toString());
+        //3.MD5加密,结果转换为大写字符
+        String sign = getMD5(sbkey.toString()).toLowerCase();
+        return sign;
+    }
+
+    /**
+     * 对字符串进行MD5加密
+     */
+    public static String getMD5(String str) {
+        MessageDigest digest;
+
+        try {
+            digest = MessageDigest.getInstance("MD5");
+            digest.update(str.getBytes());
+            return new BigInteger(1, digest.digest()).toString(16);
+        } catch (NoSuchAlgorithmException e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+}

BIN
unimall-admin-api/src/main/lib/cf-auth-api-token-5.1.5-SNAPSHOT-jar-with-dependencies.jar


BIN
unimall-admin-api/src/main/lib/dangdang-open-sdk.jar


+ 1 - 0
unimall-admin-api/src/main/resources/application.properties

@@ -0,0 +1 @@
+

Некоторые файлы не были показаны из-за большого количества измененных файлов