Переглянути джерело

Merge branch 'test' of jishutao/kede-server into prod

anderx 4 роки тому
батько
коміт
3382708205
82 змінених файлів з 1258 додано та 512 видалено
  1. 1 1
      GeneratorConfig.xml
  2. 122 116
      pom.xml
  3. 10 0
      src/main/java/com/goafanti/admin/bo/AdminListBo.java
  4. 8 0
      src/main/java/com/goafanti/admin/bo/InputPublicReleaseList.java
  5. 8 8
      src/main/java/com/goafanti/admin/bo/OutPublicRelease.java
  6. 21 0
      src/main/java/com/goafanti/admin/bo/OutPublicReleaseList.java
  7. 13 1
      src/main/java/com/goafanti/admin/controller/AdminNoticeApiController.java
  8. 30 16
      src/main/java/com/goafanti/admin/controller/AdminReleaseApiController.java
  9. 2 0
      src/main/java/com/goafanti/admin/service/NoticeService.java
  10. 6 2
      src/main/java/com/goafanti/admin/service/PublicReleaseService.java
  11. 14 0
      src/main/java/com/goafanti/admin/service/impl/NoticeServiceImpl.java
  12. 127 18
      src/main/java/com/goafanti/admin/service/impl/PublicReleaseServiceImpl.java
  13. 21 9
      src/main/java/com/goafanti/common/bo/EmailBo.java
  14. 1 4
      src/main/java/com/goafanti/common/constant/ShiroConstants.java
  15. 14 1
      src/main/java/com/goafanti/common/controller/PublicController.java
  16. 7 0
      src/main/java/com/goafanti/common/controller/WebpageController.java
  17. 3 1
      src/main/java/com/goafanti/common/dao/AdminMapper.java
  18. 2 0
      src/main/java/com/goafanti/common/dao/NoticeMapper.java
  19. 0 1
      src/main/java/com/goafanti/common/dao/OrganizationIdentityMapper.java
  20. 0 1
      src/main/java/com/goafanti/common/dao/PatentNewMapper.java
  21. 0 1
      src/main/java/com/goafanti/common/dao/PersonnelMidMapper.java
  22. 13 7
      src/main/java/com/goafanti/common/dao/PublicReleaseLogMapper.java
  23. 11 9
      src/main/java/com/goafanti/common/dao/PublicReleaseMapper.java
  24. 0 1
      src/main/java/com/goafanti/common/dao/TOrderTaskMapper.java
  25. 3 1
      src/main/java/com/goafanti/common/dao/UserChannelMapper.java
  26. 0 1
      src/main/java/com/goafanti/common/dao/UserTransferLogMapper.java
  27. 2 2
      src/main/java/com/goafanti/common/enums/ChannelStatus.java
  28. 3 0
      src/main/java/com/goafanti/common/enums/NoticeStatus.java
  29. 14 5
      src/main/java/com/goafanti/common/mapper/AdminMapper.xml
  30. 13 0
      src/main/java/com/goafanti/common/mapper/NoticeMapper.xml
  31. 1 1
      src/main/java/com/goafanti/common/mapper/PaymentNodeMapper.xml
  32. 13 9
      src/main/java/com/goafanti/common/mapper/PublicReleaseLogMapper.xml
  33. 74 27
      src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml
  34. 8 0
      src/main/java/com/goafanti/common/mapper/UserChannelMapper.xml
  35. 1 1
      src/main/java/com/goafanti/common/mapper/UserMapper.xml
  36. 2 1
      src/main/java/com/goafanti/common/mapper/UserMapperExt.xml
  37. 83 59
      src/main/java/com/goafanti/common/model/PublicRelease.java
  38. 20 20
      src/main/java/com/goafanti/common/model/PublicReleaseLog.java
  39. 0 1
      src/main/java/com/goafanti/common/task/ExpiredUserMemberTask.java
  40. 0 1
      src/main/java/com/goafanti/common/task/OrderReportTask.java
  41. 1 89
      src/main/java/com/goafanti/common/utils/AsyncUtils.java
  42. 3 4
      src/main/java/com/goafanti/common/utils/DateUtils.java
  43. 0 1
      src/main/java/com/goafanti/common/utils/ExcelUtils.java
  44. 190 0
      src/main/java/com/goafanti/common/utils/RedisUtil.java
  45. 148 0
      src/main/java/com/goafanti/common/utils/WeChatUtils.java
  46. 2 1
      src/main/java/com/goafanti/common/utils/excel/Excel.java
  47. 0 2
      src/main/java/com/goafanti/common/utils/excel/ExcelConstant.java
  48. 1 2
      src/main/java/com/goafanti/common/utils/excel/NewExcelUtil.java
  49. 0 1
      src/main/java/com/goafanti/contract/service/impl/ContractServiceImpl.java
  50. 5 1
      src/main/java/com/goafanti/core/shiro/token/TokenManager.java
  51. 13 7
      src/main/java/com/goafanti/core/websocket/SystemWebSocketHandler.java
  52. 6 5
      src/main/java/com/goafanti/core/websocket/WebSocketConfig.java
  53. 5 2
      src/main/java/com/goafanti/core/websocket/WebSocketHandshakeInterceptor.java
  54. 0 1
      src/main/java/com/goafanti/customer/bo/FollowBusinessBo.java
  55. 0 1
      src/main/java/com/goafanti/customer/service/CustomerService.java
  56. 0 1
      src/main/java/com/goafanti/order/bo/OrderListBo.java
  57. 16 0
      src/main/java/com/goafanti/order/bo/Outproject.java
  58. 0 9
      src/main/java/com/goafanti/order/controller/FundManagerOrderApiController.java
  59. 0 2
      src/main/java/com/goafanti/order/service/OrderNewService.java
  60. 0 1
      src/main/java/com/goafanti/order/service/impl/FundManagerOrderServiceImpl.java
  61. 0 3
      src/main/java/com/goafanti/order/service/impl/OrderBillServiceImpl.java
  62. 1 0
      src/main/java/com/goafanti/order/service/impl/OrderInvoiceServiceImpl.java
  63. 1 0
      src/main/java/com/goafanti/order/service/impl/OrderReceivablesServiceImpl.java
  64. 1 0
      src/main/java/com/goafanti/organization/bo/ThirdPartyError.java
  65. 0 2
      src/main/java/com/goafanti/organization/service/ThirdPartyCompanyService.java
  66. 0 1
      src/main/java/com/goafanti/permission/controller/NewPermissionApiController.java
  67. 0 1
      src/main/java/com/goafanti/permission/service/impl/NewRoleServiceImpl.java
  68. 0 1
      src/main/java/com/goafanti/permission/service/impl/PermissionServiceImpl.java
  69. 0 1
      src/main/java/com/goafanti/personnel/bo/PersonnelContractBo.java
  70. 5 0
      src/main/java/com/goafanti/user/bo/OrgIdentityDetailAdmin.java
  71. 4 0
      src/main/java/com/goafanti/user/bo/OrganizationIndentityUserBo.java
  72. 0 1
      src/main/java/com/goafanti/user/controller/UserChannelApiController.java
  73. 7 4
      src/main/java/com/goafanti/user/service/impl/UserChannelServiceImpl.java
  74. 0 1
      src/main/java/com/goafanti/user/service/impl/UserServiceImpl.java
  75. 1 1
      src/main/resources/applicationContext.xml
  76. 6 6
      src/main/resources/props/config_local.properties
  77. 1 1
      src/main/resources/props/config_test.properties
  78. 1 0
      src/main/resources/shiro_base_auth.ini
  79. 8 2
      src/main/resources/spring/spring-mvc.xml
  80. 71 31
      src/main/resources/spring/spring-shiro.xml
  81. 25 0
      src/main/resources/spring/spring-websocket.xml
  82. 65 0
      src/main/webapp/WEB-INF/views/portal/websocket.html

+ 1 - 1
GeneratorConfig.xml

@@ -43,7 +43,7 @@
     <property name="enableSubPackages" value="false"/>
      <property name="nullCatalogMeansCurrent" value="true"/>
     </javaClientGenerator>
-    <table schema="aft" tableName="public_release"
+    <table schema="aft" tableName="public_release_log"
 	enableCountByExample="false" enableUpdateByExample="false"
 	enableDeleteByExample="false" enableSelectByExample="false"
 	selectByExampleQueryId="false" enableSelectByPrimaryKey="true"

+ 122 - 116
pom.xml

@@ -1,5 +1,6 @@
 <?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"
+<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/maven-v4_0_0.xsd">
 
 	<modelVersion>4.0.0</modelVersion>
@@ -20,35 +21,35 @@
 		<org.aspectj-version>1.6.10</org.aspectj-version>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 	</properties>
-	<profiles>  
-        <profile>  
-            <id>aft_local</id>  
-            <activation>  
-                <activeByDefault>true</activeByDefault>  
-            </activation>  
-            <properties>  
-                <profiles.activation>local</profiles.activation>  
-            </properties>  
-        </profile>  
-        <profile>  
-            <id>aft_dev</id>  
-            <properties>  
-                <profiles.activation>dev</profiles.activation>  
-            </properties>  
-        </profile>  
-        <profile>  
-            <id>aft_prod</id>  
-            <properties>  
-                <profiles.activation>prod</profiles.activation>  
-            </properties>  
-        </profile>  
-        <profile>  
-            <id>aft_test</id>  
-            <properties>  
-                <profiles.activation>test</profiles.activation>  
-            </properties>  
-        </profile>  
-	</profiles> 
+	<profiles>
+		<profile>
+			<id>aft_local</id>
+			<activation>
+				<activeByDefault>true</activeByDefault>
+			</activation>
+			<properties>
+				<profiles.activation>local</profiles.activation>
+			</properties>
+		</profile>
+		<profile>
+			<id>aft_dev</id>
+			<properties>
+				<profiles.activation>dev</profiles.activation>
+			</properties>
+		</profile>
+		<profile>
+			<id>aft_prod</id>
+			<properties>
+				<profiles.activation>prod</profiles.activation>
+			</properties>
+		</profile>
+		<profile>
+			<id>aft_test</id>
+			<properties>
+				<profiles.activation>test</profiles.activation>
+			</properties>
+		</profile>
+	</profiles>
 
 	<dependencies>
 		<!-- spring -->
@@ -70,23 +71,29 @@
 			<version>${org.springframework-version}</version>
 		</dependency>
 		
-        <dependency>  
-            <groupId>javax.annotation</groupId>  
-            <artifactId>jsr250-api</artifactId>  
-            <version>1.0</version>  
-        </dependency> 
-        <!-- hibernate-validator -->
-        <dependency>
-            <groupId>org.hibernate</groupId>
-            <artifactId>hibernate-validator</artifactId>
-            <version>5.4.0.Final</version>
-        </dependency>
-        <dependency>
-     <groupId>javax.xml.bind</groupId>
-     <artifactId>jaxb-api</artifactId>
-     <version>2.3.0</version>
- </dependency>
- 
+
+		<dependency>
+			<groupId>javax.annotation</groupId>
+			<artifactId>jsr250-api</artifactId>
+			<version>1.0</version>
+		</dependency>
+		<!-- hibernate-validator -->
+		<dependency>
+			<groupId>org.hibernate</groupId>
+			<artifactId>hibernate-validator</artifactId>
+			<version>5.4.0.Final</version>
+		</dependency>
+		<dependency>
+			<groupId>javax.xml.bind</groupId>
+			<artifactId>jaxb-api</artifactId>
+			<version>2.3.0</version>
+		</dependency>
+		<!-- <dependency>
+			<groupId>de.dfki.cos.basys.platform.wrapper-bundle-settings</groupId>
+			<artifactId>javax.websocket-api</artifactId>
+			<version>0.2.6</version>
+			<scope>provided</scope>
+		</dependency> -->
 		<dependency>
 			<groupId>org.springframework</groupId>
 			<artifactId>spring-webmvc</artifactId>
@@ -113,28 +120,28 @@
 			<artifactId>spring-messaging</artifactId>
 			<version>${org.springframework-version}</version>
 		</dependency>
-		
+
 		<dependency>
-		    <groupId>org.springframework.data</groupId>
-		    <artifactId>spring-data-redis</artifactId>
-		    <version>1.8.3.RELEASE</version>
+			<groupId>org.springframework.data</groupId>
+			<artifactId>spring-data-redis</artifactId>
+			<version>1.8.3.RELEASE</version>
 		</dependency>
-		
+
 		<dependency>
-		    <groupId>org.thymeleaf</groupId>
-		    <artifactId>thymeleaf-spring4</artifactId>
-		    <version>3.0.5.RELEASE</version>
+			<groupId>org.thymeleaf</groupId>
+			<artifactId>thymeleaf-spring4</artifactId>
+			<version>3.0.5.RELEASE</version>
 		</dependency>
 		<dependency>
-		    <groupId>nz.net.ultraq.thymeleaf</groupId>
-		    <artifactId>thymeleaf-layout-dialect</artifactId>
-		    <version>2.2.1</version>
+			<groupId>nz.net.ultraq.thymeleaf</groupId>
+			<artifactId>thymeleaf-layout-dialect</artifactId>
+			<version>2.2.1</version>
 		</dependency>
 		<dependency>
-            <groupId>com.github.theborakompanioni</groupId>
-            <artifactId>thymeleaf-extras-shiro</artifactId>
-            <version>2.0.0</version>
-        </dependency>
+			<groupId>com.github.theborakompanioni</groupId>
+			<artifactId>thymeleaf-extras-shiro</artifactId>
+			<version>2.0.0</version>
+		</dependency>
 		<!-- spring end -->
 
 		<!-- redis begin -->
@@ -337,33 +344,32 @@
 			<artifactId>classmate</artifactId>
 			<version>1.1.0</version>
 		</dependency>
-	    <dependency>
-		    <groupId>com.googlecode.json-simple</groupId>
-		    <artifactId>json-simple</artifactId>
-		    <version>1.1.1</version>
+		<dependency>
+			<groupId>com.googlecode.json-simple</groupId>
+			<artifactId>json-simple</artifactId>
+			<version>1.1.1</version>
 		</dependency>
 		<dependency>
-		    <groupId>org.apache.poi</groupId>
-		    <artifactId>poi-ooxml</artifactId>
-		    <version>3.17</version>
+			<groupId>org.apache.poi</groupId>
+			<artifactId>poi-ooxml</artifactId>
+			<version>3.17</version>
 		</dependency>
-       <dependency>
- 		 	<groupId>com.aliyun</groupId>
-  			<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
-  			<version>1.0.0</version>
+		<dependency>
+			<groupId>com.aliyun</groupId>
+			<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
+			<version>1.0.0</version>
 		</dependency>
 		<dependency>
 			<groupId>com.aliyun</groupId>
 			<artifactId>aliyun-java-sdk-core</artifactId>
 			<version>3.5.0</version>
 		</dependency>
-        <dependency>
+		<dependency>
 			<groupId>org.apache.httpcomponents</groupId>
 			<artifactId>httpasyncclient</artifactId>
 			<version>4.1.3</version>
 		</dependency>
-        
-        <!-- jpush -->
+		
 		<dependency>
 			<groupId>cn.jpush.api</groupId>
 			<artifactId>jiguang-common</artifactId>
@@ -382,9 +388,9 @@
 		</dependency>
 		<!-- javaMail -->
 		<dependency>
-		    <groupId>javax.mail</groupId>
-		    <artifactId>mail</artifactId>
-		    <version>1.4.7</version>
+			<groupId>javax.mail</groupId>
+			<artifactId>mail</artifactId>
+			<version>1.4.7</version>
 		</dependency>
 	</dependencies>
 	<build>
@@ -421,45 +427,45 @@
 					<skip>true</skip>
 				</configuration>
 			</plugin>
-			<plugin>    
-			    <groupId>org.apache.maven.plugins</groupId>    
-			    <artifactId>maven-surefire-plugin</artifactId>    
-			    <version>2.5</version>    
-			    <configuration>    
-			        <skip>true</skip>    
-			    </configuration>    
-			</plugin> 
-			<plugin>  
-                <groupId>org.apache.maven.plugins</groupId>  
-                <artifactId>maven-war-plugin</artifactId>  
-                <version>3.1.0</version>  
-                <configuration>  
-                    <warName>${profiles.activation}</warName>  
-                    <!-- 激活spring profile -->  
-                    <webResources>  
-                        <resource>  
-                            <filtering>true</filtering>  
-                            <directory>src/main/webapp</directory>  
-                            <includes>  
-                                <include>**/**</include>  
-                            </includes>  
-                        </resource>  
-                        <resource>  
-                            <filtering>true</filtering>  
-                            <directory>src/main/resources</directory>
-                            <targetPath>WEB-INF/classes</targetPath>
-                            <includes>  
-                                <include>**/**</include>  
-                            </includes>  
-                        </resource>  
-                    </webResources>  
-                    <warSourceDirectory>src/main/webapp</warSourceDirectory>  
-                    <webXml>src/main/webapp/WEB-INF/web.xml</webXml>  
-                </configuration>  
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-surefire-plugin</artifactId>
+				<version>2.5</version>
+				<configuration>
+					<skip>true</skip>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-war-plugin</artifactId>
+				<version>3.1.0</version>
+				<configuration>
+					<warName>${profiles.activation}</warName>
+					<!-- 激活spring profile -->
+					<webResources>
+						<resource>
+							<filtering>true</filtering>
+							<directory>src/main/webapp</directory>
+							<includes>
+								<include>**/**</include>
+							</includes>
+						</resource>
+						<resource>
+							<filtering>true</filtering>
+							<directory>src/main/resources</directory>
+							<targetPath>WEB-INF/classes</targetPath>
+							<includes>
+								<include>**/**</include>
+							</includes>
+						</resource>
+					</webResources>
+					<warSourceDirectory>src/main/webapp</warSourceDirectory>
+					<webXml>src/main/webapp/WEB-INF/web.xml</webXml>
+				</configuration>
 			</plugin>
 		</plugins>
 	</build>
-	
+
 	<repositories>
 		<repository>
 			<id>aliyun-repos</id>
@@ -471,7 +477,7 @@
 	</repositories>
 
 
-    
+
 	<pluginRepositories>
 		<pluginRepository>
 			<id>aliyun-plugin</id>

+ 10 - 0
src/main/java/com/goafanti/admin/bo/AdminListBo.java

@@ -97,6 +97,8 @@ public class AdminListBo {
 	
 	private String contactId;
 	
+	private String openId;
+	
 	public List<String> getRolesId() {
 		return rolesId;
 	}
@@ -286,4 +288,12 @@ public class AdminListBo {
 		this.contactId = contactId;
 	}
 
+	public String getOpenId() {
+		return openId;
+	}
+
+	public void setOpenId(String openId) {
+		this.openId = openId;
+	}
+
 }

+ 8 - 0
src/main/java/com/goafanti/admin/bo/InputPublicReleaseList.java

@@ -5,6 +5,7 @@ public class InputPublicReleaseList {
 	private Integer pageSize;
 	private Integer pageNo;
 	private Integer type;
+	private String clockTime;
 	public Integer getPageSize() {
 		return pageSize;
 	}
@@ -24,5 +25,12 @@ public class InputPublicReleaseList {
 		this.type = type;
 	}
 	
+	public String getClockTime() {
+		return clockTime;
+	}
+	public void setClockTime(String clockTime) {
+		this.clockTime = clockTime;
+	}
+	
 
 }

+ 8 - 8
src/main/java/com/goafanti/admin/bo/OutPublicRelease.java

@@ -1,7 +1,12 @@
 package com.goafanti.admin.bo;
 
-public class OutPublicRelease {
-	private Integer id;
+import com.goafanti.common.model.PublicRelease;
+
+public class OutPublicRelease extends PublicRelease {
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
 	private String nickname;
 	private String aname;
 	private String releaseStarts;
@@ -9,12 +14,7 @@ public class OutPublicRelease {
 	private String releaseEnds;
 	private String createTimes;
 	private Integer status;
-	public Integer getId() {
-		return id;
-	}
-	public void setId(Integer id) {
-		this.id = id;
-	}
+	
 	public String getNickname() {
 		return nickname;
 	}

+ 21 - 0
src/main/java/com/goafanti/admin/bo/OutPublicReleaseList.java

@@ -9,7 +9,10 @@ public class OutPublicReleaseList {
 	private String releaseStarts;
 	private String releaseEnds;
 	private String createTimes;
+	private String latitude;
+	private String longitude; 
 	private Integer status;
+	private Integer clockIn;
 	public String getId() {
 		return id;
 	}
@@ -58,5 +61,23 @@ public class OutPublicReleaseList {
 	public void setUserName(String userName) {
 		this.userName = userName;
 	}
+	public String getLatitude() {
+		return latitude;
+	}
+	public void setLatitude(String latitude) {
+		this.latitude = latitude;
+	}
+	public String getLongitude() {
+		return longitude;
+	}
+	public void setLongitude(String longitude) {
+		this.longitude = longitude;
+	}
+	public Integer getClockIn() {
+		return clockIn;
+	}
+	public void setClockIn(Integer clockIn) {
+		this.clockIn = clockIn;
+	}
 	
 }

+ 13 - 1
src/main/java/com/goafanti/admin/controller/AdminNoticeApiController.java

@@ -35,13 +35,25 @@ public class AdminNoticeApiController extends CertifyApiController{
 	 * @return
 	 */
 	@RequestMapping(value = "/unread", method = RequestMethod.GET)
-	public Result unread(){
+	public Result unread(Integer type){
 		Result res = new Result();
 		res.setData(noticeService.updateListUnreadNoticeByAid());
 		return res;
 	}
 	
 	/**
+	 * 
+	 * 未读通知列表
+	 * @return
+	 */
+	@RequestMapping(value = "/publicReleaseUnread", method = RequestMethod.GET)
+	public Result publicReleaseUnread(){
+		Result res = new Result();
+		res.setData(noticeService.pushPublicReleaseUnread());
+		return res;
+	}
+	
+	/**
 	 * 已读通知列表
 	 * @return
 	 */

+ 30 - 16
src/main/java/com/goafanti/admin/controller/AdminReleaseApiController.java

@@ -56,18 +56,6 @@ public class AdminReleaseApiController extends CertifyApiController{
 	@RequestMapping(value = "/updatePublicRelease", method = RequestMethod.POST)
 	public Result updatePublicRelease(InputPublicRelease in){
 		Result res = new Result();
-		if (StringUtils.isBlank(in.getUid())) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"用户编号"));
-			return res;
-		}
-		if (StringUtils.isBlank(in.getReleaseStarts())) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"公出时间"));
-			return res;
-		}
-		if (StringUtils.isBlank(in.getUserName())) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"公出地点"));
-			return res;
-		}
 		
 		res.setData(publicReleaseService.updatePublicRelease(in));
 		return res;
@@ -78,9 +66,9 @@ public class AdminReleaseApiController extends CertifyApiController{
 	 * @return
 	 */
 	@RequestMapping(value = "/publicReleaseClockIn", method = RequestMethod.POST)
-	public Result publicReleaseClockIn(Integer id){
+	public Result publicReleaseClockIn(Integer id,String photoUrl){
 		Result res =new Result();
-		res.setData(publicReleaseService.pushPublicReleaseClockIn(id));
+		res.setData(publicReleaseService.pushPublicReleaseClockIn(id,photoUrl));
 		return res;
 	}
 	/**
@@ -88,9 +76,21 @@ public class AdminReleaseApiController extends CertifyApiController{
 	 * @return
 	 */
 	@RequestMapping(value = "/dtails", method = RequestMethod.GET)
-	public Result publicReleaseDtails(String id){
+	public Result dtails(Integer id){
+		Result res =new Result();
+		res.setData(publicReleaseService.dtails(id));
+		return res;
+	}
+	
+	
+	/**
+	 * 外出申请详情
+	 * @return
+	 */
+	@RequestMapping(value = "/followDtails", method = RequestMethod.GET)
+	public Result followDtails(String id){
 		Result res =new Result();
-		res.setData(publicReleaseService.publicReleaseDtails(id));
+		res.setData(publicReleaseService.followDtails(id));
 		return res;
 	}
 	
@@ -120,6 +120,10 @@ public class AdminReleaseApiController extends CertifyApiController{
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"审核状态"));
 			return res;
 		}
+		if (remarks.length()>20) {
+			res.getError().add(buildError("备注长度不能超过20个字符。"));
+			return res;
+		}
 		res.setData(publicReleaseService.pushExaminePublicRelease( id , status, remarks,duration));
 		return res;
 	}
@@ -135,6 +139,16 @@ public class AdminReleaseApiController extends CertifyApiController{
 		return res;
 	}
 	
+	/**
+	 * 外出审核日志列表
+	 * @return
+	 */
+	@RequestMapping(value = "/unreadPublicReleaseLog", method = RequestMethod.GET)
+	public Result unreadPublicReleaseLog(){
+		Result res =new Result();
+		res.data(publicReleaseService.unreadPublicReleaseLog());
+		return res;
+	}
 	
 	/**
 	 * 公出统计

+ 2 - 0
src/main/java/com/goafanti/admin/service/NoticeService.java

@@ -14,5 +14,7 @@ public interface NoticeService {
 
 	int findUnreadNoticeCount();
 
+	List<NoticeBo> pushPublicReleaseUnread();
+
 
 }

+ 6 - 2
src/main/java/com/goafanti/admin/service/PublicReleaseService.java

@@ -23,14 +23,18 @@ public interface PublicReleaseService {
 
 	int updatePublicRelease(InputPublicRelease in);
 
-	int pushPublicReleaseClockIn(Integer id);
+	int pushPublicReleaseClockIn(Integer id,String photoUrl);
 
-	OutPublicRelease publicReleaseDtails(String id);
+	OutPublicRelease dtails(Integer id);
 
 	Object publicReleaseStatistics(InputPublicStatistics in);
 
 	Object publicReleaseListDtails(InputPublicDtails in);
 
+	OutPublicRelease followDtails(String id);
+
+	List<outPublicReleaseLog> unreadPublicReleaseLog();
+
 
 
 }

+ 14 - 0
src/main/java/com/goafanti/admin/service/impl/NoticeServiceImpl.java

@@ -78,5 +78,19 @@ public class NoticeServiceImpl extends BaseMybatisDao<NoticeMapper> implements N
 		return noticeMapper.selectUnreadedCount(TokenManager.getAdminId());
 	}
 
+	@Override
+	public List<NoticeBo> pushPublicReleaseUnread() {
+		List<NoticeBo> nl=noticeMapper.publicReleaseUnread(TokenManager.getAdminId());
+		List<String> dl=new  ArrayList<String>();
+		if (!nl.isEmpty()) {
+			for (NoticeBo n : nl) {
+				// 添加已读
+				dl.add(n.getId());
+			}
+			noticeMapper.batchUpdateUnreaded(dl);
+		}
+		return nl;
+	}
+
 
 }

+ 127 - 18
src/main/java/com/goafanti/admin/service/impl/PublicReleaseServiceImpl.java

@@ -1,16 +1,20 @@
 package com.goafanti.admin.service.impl;
 
+import java.io.UnsupportedEncodingException;
 import java.text.ParseException;
-import java.util.Calendar;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 
+import javax.mail.MessagingException;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.web.socket.TextMessage;
 
+import com.goafanti.admin.bo.AdminListBo;
 import com.goafanti.admin.bo.InputPublicDtails;
 import com.goafanti.admin.bo.InputPublicRelease;
 import com.goafanti.admin.bo.InputPublicReleaseList;
@@ -21,21 +25,31 @@ import com.goafanti.admin.bo.OutPublicReleaseList;
 import com.goafanti.admin.bo.OutPublicStatistics;
 import com.goafanti.admin.bo.outPublicReleaseLog;
 import com.goafanti.admin.service.PublicReleaseService;
+import com.goafanti.common.bo.EmailBo;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.dao.PublicReleaseLogMapper;
 import com.goafanti.common.dao.PublicReleaseMapper;
+import com.goafanti.common.dao.UserMapper;
+import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.Admin;
+import com.goafanti.common.model.Notice;
 import com.goafanti.common.model.PublicRelease;
 import com.goafanti.common.model.PublicReleaseLog;
+import com.goafanti.common.model.User;
 import com.goafanti.common.utils.AsyncUtils;
 import com.goafanti.common.utils.DateUtils;
+import com.goafanti.common.utils.SendEmailUtil;
+import com.goafanti.common.utils.WeChatUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.customer.bo.FollowBusinessBo;
 import com.goafanti.customer.service.CustomerService;
+import com.goafanti.core.websocket.SystemWebSocketHandler;
+
+import cn.jiguang.common.utils.StringUtils;
 
 @Service
 public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper> implements PublicReleaseService {
@@ -46,14 +60,21 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 	@Autowired
 	private CustomerService customerService;
 	@Autowired
-	private AsyncUtils asyncUtils;
+	private WeChatUtils weChatUtils;
 	@Autowired
 	private AdminMapper adminMapper;
+	@Autowired
+	private	AsyncUtils asyncUtils;
+	@Autowired
+	private	UserMapper	userMapper;
+	@Autowired
+	private SystemWebSocketHandler	systemWebSocketHandler;
 	
 	@Override
 	public int addPublicRelease(InputPublicRelease in) {
 		Date date =new Date();
 		in.setCreateTime(date);
+		in.setStatus(1);
 		in.setAid(TokenManager.getAdminId());
 		try {
 			in.setReleaseStart(DateUtils.parseDate(in.getReleaseStarts(), AFTConstants.YYYYMMDDHHMMSS));
@@ -63,17 +84,67 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 			throw new BusinessException("转换异常");
 		}
 		publicReleaseMapper.insertSelectiveGetId(in);
-		Admin a=adminMapper.selectByPrimaryKey(TokenManager.getAdminId());
+		AdminListBo my = adminMapper.getDeptNameByAid(TokenManager.getAdminId());
+		Admin a=adminMapper.selectByPrimaryKey(my.getSuperiorId());
+		PublicReleaseLog log=new PublicReleaseLog(in.getId(),TokenManager.getAdminId(),1,"发起外出申请",new Date());
+		publicReleaseLogMapper.insertSelective(log);
 		String openid=a.getOpenId();
-		openid="ogXpy5RoYqThnr-a8_2e0W7dZuF0";
+		User u=userMapper.selectByPrimaryKey(in.getUid());
+		String str="["+my.getName()+"]发起["+u.getNickname()+"]的外出申请,请及时审核。";
+		sendNoticeAndSoucket(a.getId(),NoticeStatus.PUBLIC_RELEASE_START.getCode(),str);
 		if (openid!=null) {
-			asyncUtils.addWechatNotice(openid, 0,date,a.getName());
-			return 1;
+			Integer res= weChatUtils.addNotice(openid, in.getStatus(),date,my.getName(),str);
+			if (res!=0) {
+				sendEmail(my, a,1);
+			}
+			return  res;
 		}else {
-			//成功但是对方收不到消息
+			sendEmail(my, a,1);
 			return 2;
 		}
 	}
+
+
+
+
+
+
+
+
+	private void sendNoticeAndSoucket(String id,Integer type,String content) {
+		systemWebSocketHandler.sendMessageToUser(id, new TextMessage("unread"));
+		Notice n =new Notice();
+		n.setId(UUID.randomUUID().toString());
+		n.setAid(id);
+		n.setNoticeType(type);
+		n.setContent(content);
+		n.setReaded(0);//未读
+		asyncUtils.addNotice(n);
+	}
+
+
+
+
+
+
+
+
+	private void sendEmail(AdminListBo my, Admin a,Integer type) {
+		String title="外出申请提醒";
+		if (type==0) title="外出申请驳回提醒";
+		else if (type==2) title="外出申请同意提醒";
+		if (SendEmailUtil.isEmail(a.getEmail())) {
+			EmailBo email=new EmailBo(title,a.getEmail() , my.getDepartmentName(), my.getName(),"详情请登录微信打卡小程序查看,谢谢!") ;
+			try {
+				asyncUtils.send(email);
+			} catch (UnsupportedEncodingException | MessagingException e) {
+				e.printStackTrace();
+			}
+		}
+	}
+	
+	
+	
 	
 
 
@@ -82,12 +153,13 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 	@Override
 	public int updatePublicRelease(InputPublicRelease in) {
 		try {
-			in.setReleaseStart(DateUtils.parseDate(in.getReleaseStarts(), AFTConstants.YYYYMMDDHHMMSS));
-			in.setReleaseEnd(DateUtils.parseDate(in.getReleaseEnds(), AFTConstants.YYYYMMDDHHMMSS));
+			if(in.getReleaseStarts()!=null)in.setReleaseStart(DateUtils.parseDate(in.getReleaseStarts(), AFTConstants.YYYYMMDDHHMMSS));
+			if(in.getReleaseEnds()!=null)in.setReleaseEnd(DateUtils.parseDate(in.getReleaseEnds(), AFTConstants.YYYYMMDDHHMMSS));
 		} catch (ParseException e) {
 			e.printStackTrace();
 			throw new BusinessException("转换异常");
 		}
+		in.setStatus(1);
 		publicReleaseMapper.updateByPrimaryKeySelective(in);
 		return 1;
 	}
@@ -98,42 +170,74 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		Map<String,Object> map =new HashMap<String, Object>();
 		map.put("type", in.getType()==null?0:in.getType());
 		map.put("aid", TokenManager.getAdminId());
+		if (StringUtils.isNotEmpty(in.getClockTime())) {
+			map.put("clockTime", in.getClockTime());	
+		}
 		return (Pagination<OutPublicReleaseList>) findPage("listPublicRelease", "countPublicRelease", map, in.getPageNo(), in.getPageSize());
 	}
 
 	@Override
 	public int pushExaminePublicRelease(Integer id, Integer status, String remarks,Double duration) {
 		PublicRelease p=new PublicRelease();
+		Date date =new Date();
 		p.setId(id);
 		p.setStatus(status);
-		if (status==2) {
-			PublicRelease use=publicReleaseMapper.selectByPrimaryKey(id);
-			p.setDuration(duration);
+		PublicRelease use=publicReleaseMapper.selectByPrimaryKey(id);
+		if (use.getStatus()!=1) {
+			throw new BusinessException("只能修改已发起的状态");
 		}
 		publicReleaseMapper.updateByPrimaryKeySelective(p);
 		PublicReleaseLog log=new PublicReleaseLog(id,TokenManager.getAdminId(),status,remarks,new Date());
 		publicReleaseLogMapper.insertSelective(log);
-		return 1;
+		AdminListBo my = adminMapper.getDeptNameByAid(TokenManager.getAdminId());
+		Admin a=adminMapper.selectByPrimaryKey(use.getAid());
+		Integer type=0;
+		String content="";
+		User u=userMapper.selectByPrimaryKey(use.getUid());
+		if (status==0) {
+			type=NoticeStatus.PUBLIC_RELEASE_NO.getCode();
+			content="["+u.getNickname()+"]的外出申请,已通过审核!";
+		}else if(status==2) {
+			type=NoticeStatus.PUBLIC_RELEASE_YES.getCode();
+			content="["+u.getNickname()+"]的外出申请,未通过审核!";
+		}
+		sendNoticeAndSoucket(a.getId(),type,content);
+		if (my.getOpenId()!=null) {
+			Integer res=weChatUtils.addNotice(a.getOpenId(),p.getStatus(),date,my.getName(),remarks);
+			if (res!=0) {
+				sendEmail( my,  a, status);
+				
+			}
+			return res;
+		}
+			return 1;
 	}
 	
 	@Override
 	public List<outPublicReleaseLog> listPublicReleaseLog(Integer id) {
-		return publicReleaseLogMapper.listPublicReleaseLog(id);
+		List<outPublicReleaseLog> list=publicReleaseLogMapper.listPublicReleaseLog(id);
+		return list;
 	}
 
 	@Override
-	public int pushPublicReleaseClockIn(Integer id) {
+	public List<outPublicReleaseLog> unreadPublicReleaseLog() {
+		List<outPublicReleaseLog> list=publicReleaseLogMapper.unreadPublicReleaseLog(TokenManager.getAdminId());
+		return list;
+	}
+	@Override
+	public int pushPublicReleaseClockIn(Integer id,String photoUrl) {
 		PublicRelease p=new PublicRelease();
 		PublicRelease use=publicReleaseMapper.selectByPrimaryKey(id);
 		p.setId(id);
 		p.setClockIn(1);
+		p.setPhotoUrl(photoUrl);
 		p.setClockInTime(new Date());
 		if (use.getClockIn()==0) {
 			FollowBusinessBo fbb=new FollowBusinessBo();
 			fbb.setUid(use.getUid());
 			fbb.setContactType("0");
 			fbb.setResult(use.getRemarks());
-			fbb.setFollowTime(DateUtils.formatDate(use.getClockInTime(), AFTConstants.YYYYMMDDHHMMSS));
+			fbb.setFollowTime(DateUtils.formatDate(p.getClockInTime(), AFTConstants.YYYYMMDDHHMMSS));
 			String ufid=UUID.randomUUID().toString();
 			p.setUfid(ufid);
 			customerService.addFollow(fbb,ufid);
@@ -143,8 +247,13 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 	}
 
 	@Override
-	public OutPublicRelease publicReleaseDtails(String id) {
-		return	publicReleaseMapper.selectByUfid(id); 
+	public OutPublicRelease dtails(Integer id) {
+		return	publicReleaseMapper.selectDtails(id,null); 
+	}
+	
+	@Override
+	public OutPublicRelease followDtails(String id) {
+		return	publicReleaseMapper.selectDtails(null,id); 
 	}
 
 	@SuppressWarnings("unchecked")

+ 21 - 9
src/main/java/com/goafanti/common/bo/EmailBo.java

@@ -68,7 +68,7 @@ public class EmailBo {
 	 * @param date			时间
 	 * @param adminName		接收人名字
 	 * @param userName		用户名称
-	 * @param type		类型 0通用 1催款 2付款催款
+	 * @param type		类型 0订单提醒 1催款 2付款催款
 	 * @param approval   null 非特批
 	 * @return 
 	 */
@@ -84,6 +84,23 @@ public class EmailBo {
 		if(type==1)this.content=setDunFormat( addressee, sender, deptname,orderNo, date , dunStatusName,adminName,userName,0);
 		if(type==2)this.content=setDunFormat( addressee, sender, deptname,orderNo, date , dunStatusName,adminName,userName,1);
 	}
+	/**
+	 * 通用模版
+	 * @param subject
+	 * @param address
+	 * @param deptname
+	 * @param sender
+	 * @param end
+	 */
+	public  EmailBo(String subject, String address, String deptname, String sender,String end) {
+		this.subject = subject;
+		this.address = address;
+		this.addressee = "";
+		this.deptname = deptname;
+		this.sender = sender;
+		if (end!=null) this.end=end;
+		this.content = setGeneralFormat();
+	}
 	
 	public  EmailBo(String subject, String address, String deptname, String sender,
 			 String orderNo,String adminName) {
@@ -222,12 +239,9 @@ public class EmailBo {
 				"                      <tr>\r\n" + 
 				"                <td width=\"40\" height=\"32\" border=\"0\" align=\"left\" valign=\"middle\" style=\" width:40px; text-align:left;vertical-align:middle; line-height:32px; float:left;\">&nbsp;</td>\r\n" + 
 				"                <td width=\"720\" height=\"32\" border=\"0\" align=\"left\" style=\" width:720px; text-align:left;vertical-align:middle;line-height:32px;\"><span style=\"font-weight: 900\">您收到一条由["+this.deptname+"] 的 ["+this.sender+"] 发起的 ["+this.subject+"] 通知</span></td>\r\n" + 
-				"              </tr>\r\n" + 
-				"              <tr>\r\n" + 
-				"                <td width=\"720\" height=\"24\" colspan=\"2\" style=\"padding-left:40px;\"><span style=\"font-weight: 900\">请登录查看</span></td>\r\n" + 
-				"              </tr>\r\n" + 
+				"              </tr>\r\n" +
 				"              <tr>\r\n" + 
-				"                <td width=\"720\" height=\"24\" colspan=\"2\" style=\"padding-left:40px;\"><span>详情请登录科德业务管理系统查看,谢谢!</span></td>\r\n" + 
+				"                <td width=\"720\" height=\"24\" colspan=\"2\" style=\"padding-left:40px;\"><span>"+end+"</span></td>\r\n" + 
 				"              </tr>\r\n" + 
 				"              <tr>\r\n" + 
 				"                <td width=\"720\" height=\"24\" colspan=\"2\" style=\"padding-left:40px;\"></td>\r\n" + 
@@ -290,9 +304,7 @@ public class EmailBo {
 	}
 	
 	public String format(String name){
-        return "<div>亲爱的" + name + ", 您收到一条由[" + this.deptname +"] 的 [" + this.sender + "] 发起的 [" + this.subject + "] 通知:</div>"
-        		+ "<div>" + this.content + "</div>"
-        		+ "<div>" + this.end + "</div>";
+        return  "<div>" + this.content + "</div>";
     }
 	
 	

+ 1 - 4
src/main/java/com/goafanti/common/constant/ShiroConstants.java

@@ -6,8 +6,5 @@ public class ShiroConstants {
 	public static final String REDIS_SHIRO_SESSION = "goafanti-session:";
 	public static final String REDIS_SHIRO_ALL = "*goafanti-session:*";
 
-	// 0:禁止登录
-	public static final Integer USER_DISABLE = new Integer(0);
-	// 1:有效
-	public static final Integer USER_ENABLE = new Integer(1);
+	
 }

+ 14 - 1
src/main/java/com/goafanti/common/controller/PublicController.java

@@ -31,6 +31,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.socket.TextMessage;
 
 import com.goafanti.admin.service.AdminService;
 import com.goafanti.admin.service.AttachmentService;
@@ -43,7 +44,6 @@ import com.goafanti.common.model.User;
 import com.goafanti.common.service.DistrictGlossoryService;
 import com.goafanti.common.service.FieldGlossoryService;
 import com.goafanti.common.service.IndustryCategoryService;
-import com.goafanti.common.utils.AsyncUtils;
 import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.common.utils.MobileMessageUtils;
@@ -53,6 +53,7 @@ import com.goafanti.common.utils.TimeUtils;
 import com.goafanti.common.utils.VerifyCodeUtils;
 import com.goafanti.common.utils.excel.FileUtils;
 import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.core.websocket.SystemWebSocketHandler;
 import com.goafanti.user.service.UserService;
 
 @Controller
@@ -556,6 +557,18 @@ public class PublicController extends CertifyApiController {
 	}
 	
 	
+	/** 省市区查询 **/
+	@RequestMapping(value = "/sendWeb" , method = RequestMethod.POST)
+	@ResponseBody
+	public Result sendWeb(String str){
+		Result res = new Result();
+		SystemWebSocketHandler sys=new SystemWebSocketHandler();
+		TextMessage text=new TextMessage(str.getBytes());
+		sys.sendMessageToUsers(text);
+		res.setData(1);
+		return res;
+	}
+	
 	
     /**
      * 导入流水

+ 7 - 0
src/main/java/com/goafanti/common/controller/WebpageController.java

@@ -410,6 +410,13 @@ public class WebpageController extends BaseController {
 		return modelview;
 	}
 	
+	@RequestMapping(value="/portal/websocket")
+	public ModelAndView websocket(HttpServletRequest request, ModelAndView modelview){
+		request.getSession().setAttribute("uid", "con");
+		modelview.setViewName("/portal/websocket");
+		return modelview;
+	}
+	
 	/**
 	 *  关于我们
 	 * @param request

+ 3 - 1
src/main/java/com/goafanti/common/dao/AdminMapper.java

@@ -202,6 +202,8 @@ public interface AdminMapper {
 
 	List<String> getAdminRoleListByAid(String id);
 
-	String selectByOpeid(String aid);
+	Admin selectByOpeid(String openid);
+
+	Admin selectGetSuper(String aid);
 	
 }

+ 2 - 0
src/main/java/com/goafanti/common/dao/NoticeMapper.java

@@ -54,4 +54,6 @@ public interface NoticeMapper {
 	void insertBatch(List<Notice> notice);
 
 	List<NoticeBo> findUnreadNoticeListByPage(@Param("aid") String aid);
+
+	List<NoticeBo> publicReleaseUnread(@Param("aid") String aid);
 }

+ 0 - 1
src/main/java/com/goafanti/common/dao/OrganizationIdentityMapper.java

@@ -1,7 +1,6 @@
 package com.goafanti.common.dao;
 
 import com.goafanti.common.model.OrganizationIdentity;
-import com.goafanti.common.model.OrganizationIdentityExample;
 import com.goafanti.user.bo.AuditorOrgIdentityDetailBo;
 import com.goafanti.user.bo.InputUserChannel;
 import com.goafanti.user.bo.OrgBasicInfoBo;

+ 0 - 1
src/main/java/com/goafanti/common/dao/PatentNewMapper.java

@@ -1,7 +1,6 @@
 package com.goafanti.common.dao;
 
 import com.goafanti.common.model.PatentNew;
-import com.goafanti.common.model.PatentNewExample;
 import com.goafanti.common.model.PatentNewLog;
 
 import java.util.List;

+ 0 - 1
src/main/java/com/goafanti/common/dao/PersonnelMidMapper.java

@@ -2,7 +2,6 @@ package com.goafanti.common.dao;
 
 import com.goafanti.common.model.PersonnelMid;
 import com.goafanti.common.model.PersonnelMidExample;
-import com.goafanti.personnel.bo.IntpersonnelWelfareBo;
 
 import java.util.List;
 import org.apache.ibatis.annotations.Param;

+ 13 - 7
src/main/java/com/goafanti/common/dao/PublicReleaseLogMapper.java

@@ -2,6 +2,8 @@ package com.goafanti.common.dao;
 
 import java.util.List;
 
+import org.apache.ibatis.annotations.Param;
+
 import com.goafanti.admin.bo.outPublicReleaseLog;
 import com.goafanti.common.model.PublicReleaseLog;
 
@@ -9,39 +11,43 @@ public interface PublicReleaseLogMapper {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table public_release_log
-	 * @mbg.generated  Tue Jun 01 15:52:56 CST 2021
+	 * @mbg.generated  Fri Jun 11 16:07:04 CST 2021
 	 */
 	int deleteByPrimaryKey(Integer id);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table public_release_log
-	 * @mbg.generated  Tue Jun 01 15:52:56 CST 2021
+	 * @mbg.generated  Fri Jun 11 16:07:04 CST 2021
 	 */
 	int insert(PublicReleaseLog record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table public_release_log
-	 * @mbg.generated  Tue Jun 01 15:52:56 CST 2021
+	 * @mbg.generated  Fri Jun 11 16:07:04 CST 2021
 	 */
 	int insertSelective(PublicReleaseLog record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table public_release_log
-	 * @mbg.generated  Tue Jun 01 15:52:56 CST 2021
+	 * @mbg.generated  Fri Jun 11 16:07:04 CST 2021
 	 */
 	PublicReleaseLog selectByPrimaryKey(Integer id);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table public_release_log
-	 * @mbg.generated  Tue Jun 01 15:52:56 CST 2021
+	 * @mbg.generated  Fri Jun 11 16:07:04 CST 2021
 	 */
 	int updateByPrimaryKeySelective(PublicReleaseLog record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table public_release_log
-	 * @mbg.generated  Tue Jun 01 15:52:56 CST 2021
+	 * @mbg.generated  Fri Jun 11 16:07:04 CST 2021
 	 */
 	int updateByPrimaryKey(PublicReleaseLog record);
 
-	List<outPublicReleaseLog> listPublicReleaseLog(Integer id);
+	List<outPublicReleaseLog> listPublicReleaseLog(@Param ("id")Integer id);
+
+	void updateNoRead();
+
+	List<outPublicReleaseLog> unreadPublicReleaseLog(String aid);
 }

+ 11 - 9
src/main/java/com/goafanti/common/dao/PublicReleaseMapper.java

@@ -1,53 +1,55 @@
 package com.goafanti.common.dao;
 
+import org.apache.ibatis.annotations.Param;
+
 import com.goafanti.admin.bo.OutPublicRelease;
-import com.goafanti.admin.bo.OutPublicReleaseList;
 import com.goafanti.common.model.PublicRelease;
 
 public interface PublicReleaseMapper {
     /**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table public_release
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	int deleteByPrimaryKey(Integer id);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table public_release
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	int insert(PublicRelease record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table public_release
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	int insertSelective(PublicRelease record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table public_release
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	PublicRelease selectByPrimaryKey(Integer id);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table public_release
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	int updateByPrimaryKeySelective(PublicRelease record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table public_release
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	int updateByPrimaryKeyWithBLOBs(PublicRelease record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table public_release
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	int updateByPrimaryKey(PublicRelease record);
 
 	void insertSelectiveGetId(PublicRelease in);
 
-	OutPublicRelease selectByUfid(String ufid);
+	OutPublicRelease selectDtails(@Param("id") Integer id,@Param("ufid")String ufid);
+
 }

+ 0 - 1
src/main/java/com/goafanti/common/dao/TOrderTaskMapper.java

@@ -2,7 +2,6 @@ package com.goafanti.common.dao;
 
 import com.goafanti.common.bo.UserOrderTask;
 import com.goafanti.common.model.TOrderTask;
-import com.goafanti.common.model.TOrderTaskExample;
 import com.goafanti.order.bo.TOrderTaskBo;
 import com.goafanti.order.bo.TOrderTaskDetailBo;
 import com.goafanti.order.bo.TOrderTaskListBo;

+ 3 - 1
src/main/java/com/goafanti/common/dao/UserChannelMapper.java

@@ -7,7 +7,6 @@ import org.apache.ibatis.annotations.Param;
 
 import com.goafanti.common.model.UserChannel;
 import com.goafanti.user.bo.InputUserChannel;
-import com.goafanti.user.bo.OutUserChannel;
 
 public interface UserChannelMapper {
     /**
@@ -81,6 +80,9 @@ public interface UserChannelMapper {
 	int selectSignByUid(String uid);
 
 
+	UserChannel selectByUid(String id);
+
+
 	
 
 

+ 0 - 1
src/main/java/com/goafanti/common/dao/UserTransferLogMapper.java

@@ -1,7 +1,6 @@
 package com.goafanti.common.dao;
 
 import com.goafanti.common.model.UserTransferLog;
-import com.goafanti.common.model.UserTransferLogExample;
 import com.goafanti.customer.bo.transferListBo;
 import com.goafanti.user.bo.InputUserChannel;
 

+ 2 - 2
src/main/java/com/goafanti/common/enums/ChannelStatus.java

@@ -27,9 +27,9 @@ public enum ChannelStatus {
 	/** 非法名称*/ 
 	FFMC(9,"非法名称"),
 	WXLXR(14,"无效联系人"),
-	/** 已存在渠道*/ 
+	/** 已存在我的渠道*/ 
 	YCZWDQD(10,"已存在我的渠道"),
-	/** 已存在渠道*/ 
+	/** 已存在别人渠道*/ 
 	YCZBRQD(11,"已存在别人渠道"),
 	/** 0已存在私有*/ 
 	YCZBRSY(12,"已存在别人私有"),

+ 3 - 0
src/main/java/com/goafanti/common/enums/NoticeStatus.java

@@ -60,6 +60,9 @@ public enum NoticeStatus {
 	CUSTOMER_LOSE270(51,"客户释放(270天)"),
 	CUSTOMER_CHENNEL_RECOVERY(52,"渠道客户回收"),
 	CUSTOMER_CHENNEL_LOSE(53,"渠道客户丢失"),
+	PUBLIC_RELEASE_START(54,"外出打卡申请"),
+	PUBLIC_RELEASE_YES(55,"外出打卡通过"),
+	PUBLIC_RELEASE_NO(56,"外出打卡驳回"),
 	OTHER(0, "其他");
 
 	private NoticeStatus(Integer code, String desc) {

+ 14 - 5
src/main/java/com/goafanti/common/mapper/AdminMapper.xml

@@ -990,8 +990,8 @@
   </select>
   <!-- 获得当前登录人的名字和部门名 -->
   <select id="getDeptNameByAid" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminListBo">
-  	select a.id,a.name, d.name as departmentName,a.department_id departmentId,a.email from admin a
-  		left join department d on a.department_id = d.id
+  	select a.id,a.name, d.name as departmentName,a.department_id departmentId,a.email,a.superior_id superiorId 
+   from admin a left join department d on a.department_id = d.id
   		where a.id = #{_parameter,jdbcType=VARCHAR}
   </select>
   
@@ -1216,6 +1216,13 @@ select a.id,a.nickname as name,a.source,c.name contacts,c.mobile as contactMobil
   <select id="selectBySuperId" resultType="java.lang.String">
   	select id from admin where superior_id= #{aid}
   </select>
+  
+   <select id="selectGetSuper" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from admin
+    where  superior_id= #{aid}
+  </select>
   <select id="selectFinanceAdminByOrderDep" resultType="com.goafanti.common.model.Admin">
  	 select a.finance_id id,b.name from department a left join admin b on a.finance_id=b.id
 	where a.id= #{orderDep}
@@ -1234,8 +1241,10 @@ select a.id,a.nickname as name,a.source,c.name contacts,c.mobile as contactMobil
 	where a.id= #{id}
   </select>
   
-  <select id="selectByOpeid" resultType="java.lang.String">
-  select b.open_id from admin a left join admin b on a.superior_id =b.id
-	where a.id= #{aid}
+  <select id="selectByOpeid" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from admin
+    where  open_id= #{openid}
   </select>
 </mapper>

+ 13 - 0
src/main/java/com/goafanti/common/mapper/NoticeMapper.xml

@@ -216,6 +216,19 @@
     order by n.create_time desc
   </select>
     
+    
+    <select id="publicReleaseUnread"  resultType="com.goafanti.admin.bo.NoticeBo">
+    select n.id, n.aid, n.uid, n.notice_type as noticeType, n.content, n.create_time as createTime, n.type,
+		oi.unit_name as unitName, n.rid, a.name as principle, n.readed, n.year
+		from notice n 
+		LEFT JOIN organization_identity oi on n.uid = oi.uid
+		LEFT JOIN admin a on a.id = n.pid 
+    where n.readed = 0 and n.notice_type in(54,55,56)
+    <if test="aid != null">
+    	and n.aid = #{aid}
+    </if>
+    order by n.create_time desc
+  </select>
   
   <select id="findReadedNoticeListByPage" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.NoticeBo">
      select n.id, n.uid, n.aid, n.notice_type as noticeType, n.content, n.create_time as createTime, 

+ 1 - 1
src/main/java/com/goafanti/common/mapper/PaymentNodeMapper.xml

@@ -467,7 +467,7 @@
    </if>
   </select>
   <select id="selectByStatus" resultType="com.goafanti.organization.bo.OutPaymentNode">
-  select id,tid,cid,company_name companyName,unit_price unitPrice,quantity,total_amount totalAmount,
+  select id,tid,cid,company_name companyName,unit_price unitPrice,quantity,total_amount totalAmount,create_time createTime ,
    party_amount partyAmount, date_format(party_time,'%Y-%m-%d')partyTimes,project_type projectType,dun_type dunType
    from payment_node where dun_status = #{status}
   </select>

+ 13 - 9
src/main/java/com/goafanti/common/mapper/PublicReleaseLogMapper.xml

@@ -5,7 +5,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jun 01 15:52:56 CST 2021.
+      This element was generated on Fri Jun 11 16:07:04 CST 2021.
     -->
     <id column="id" jdbcType="INTEGER" property="id" />
     <result column="prid" jdbcType="INTEGER" property="prid" />
@@ -18,7 +18,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jun 01 15:52:56 CST 2021.
+      This element was generated on Fri Jun 11 16:07:04 CST 2021.
     -->
     id, prid, aid, remarks, `status`, create_time
   </sql>
@@ -26,7 +26,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jun 01 15:52:56 CST 2021.
+      This element was generated on Fri Jun 11 16:07:04 CST 2021.
     -->
     select 
     <include refid="Base_Column_List" />
@@ -37,7 +37,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jun 01 15:52:56 CST 2021.
+      This element was generated on Fri Jun 11 16:07:04 CST 2021.
     -->
     delete from public_release_log
     where id = #{id,jdbcType=INTEGER}
@@ -46,7 +46,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jun 01 15:52:56 CST 2021.
+      This element was generated on Fri Jun 11 16:07:04 CST 2021.
     -->
     insert into public_release_log (id, prid, aid, 
       remarks, `status`, create_time
@@ -59,7 +59,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jun 01 15:52:56 CST 2021.
+      This element was generated on Fri Jun 11 16:07:04 CST 2021.
     -->
     insert into public_release_log
     <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -107,7 +107,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jun 01 15:52:56 CST 2021.
+      This element was generated on Fri Jun 11 16:07:04 CST 2021.
     -->
     update public_release_log
     <set>
@@ -133,7 +133,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jun 01 15:52:56 CST 2021.
+      This element was generated on Fri Jun 11 16:07:04 CST 2021.
     -->
     update public_release_log
     set prid = #{prid,jdbcType=INTEGER},
@@ -147,6 +147,10 @@
   select a.id,a.aid ,a.prid ,a.remarks ,a.status ,b.name aname,
 	date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes
 	from public_release_log a left join admin b on a.aid =b.id 
-	where a.prid = #{id}
+	where 1=1
+	<if test="id !=null">
+	and a.prid = #{id}
+	</if>
   </select>
+
 </mapper>

+ 74 - 27
src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml

@@ -5,7 +5,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 02 14:39:12 CST 2021.
+      This element was generated on Thu Jun 10 15:22:12 CST 2021.
     -->
     <id column="id" jdbcType="INTEGER" property="id" />
     <result column="uid" jdbcType="VARCHAR" property="uid" />
@@ -24,12 +24,13 @@
     <result column="pname" jdbcType="VARCHAR" property="pname" />
     <result column="ufid" jdbcType="VARCHAR" property="ufid" />
     <result column="duration" jdbcType="DOUBLE" property="duration" />
+    <result column="valid_date" jdbcType="VARCHAR" property="validDate" />
   </resultMap>
   <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.goafanti.common.model.PublicRelease">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 02 14:39:12 CST 2021.
+      This element was generated on Thu Jun 10 15:22:12 CST 2021.
     -->
     <result column="annex_url" jdbcType="LONGVARCHAR" property="annexUrl" />
     <result column="photo_url" jdbcType="LONGVARCHAR" property="photoUrl" />
@@ -38,16 +39,16 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 02 14:39:12 CST 2021.
+      This element was generated on Thu Jun 10 15:22:12 CST 2021.
     -->
     id, `uid`, aid, release_start, release_end, remarks, user_name, longitude, latitude, 
-    `status`, create_time, clock_in, clock_in_time, pid, pname, ufid, duration
+    `status`, create_time, clock_in, clock_in_time, pid, pname, ufid, duration, valid_date
   </sql>
   <sql id="Blob_Column_List">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 02 14:39:12 CST 2021.
+      This element was generated on Thu Jun 10 15:22:12 CST 2021.
     -->
     annex_url, photo_url
   </sql>
@@ -55,7 +56,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 02 14:39:12 CST 2021.
+      This element was generated on Thu Jun 10 15:22:12 CST 2021.
     -->
     select 
     <include refid="Base_Column_List" />
@@ -68,7 +69,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 02 14:39:12 CST 2021.
+      This element was generated on Thu Jun 10 15:22:12 CST 2021.
     -->
     delete from public_release
     where id = #{id,jdbcType=INTEGER}
@@ -77,28 +78,28 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 02 14:39:12 CST 2021.
+      This element was generated on Thu Jun 10 15:22:12 CST 2021.
     -->
     insert into public_release (id, `uid`, aid, 
       release_start, release_end, remarks, 
       user_name, longitude, latitude, 
       `status`, create_time, clock_in, 
       clock_in_time, pid, pname, 
-      ufid, duration, annex_url, 
-      photo_url)
+      ufid, duration, valid_date, 
+      annex_url, photo_url)
     values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, 
       #{releaseStart,jdbcType=TIMESTAMP}, #{releaseEnd,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}, 
       #{userName,jdbcType=VARCHAR}, #{longitude,jdbcType=VARCHAR}, #{latitude,jdbcType=VARCHAR}, 
       #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{clockIn,jdbcType=INTEGER}, 
       #{clockInTime,jdbcType=TIMESTAMP}, #{pid,jdbcType=VARCHAR}, #{pname,jdbcType=VARCHAR}, 
-      #{ufid,jdbcType=VARCHAR}, #{duration,jdbcType=DOUBLE}, #{annexUrl,jdbcType=LONGVARCHAR}, 
-      #{photoUrl,jdbcType=LONGVARCHAR})
+      #{ufid,jdbcType=VARCHAR}, #{duration,jdbcType=DOUBLE}, #{validDate,jdbcType=VARCHAR}, 
+      #{annexUrl,jdbcType=LONGVARCHAR}, #{photoUrl,jdbcType=LONGVARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.PublicRelease">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 02 14:39:12 CST 2021.
+      This element was generated on Thu Jun 10 15:22:12 CST 2021.
     -->
     insert into public_release
     <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -153,6 +154,9 @@
       <if test="duration != null">
         duration,
       </if>
+      <if test="validDate != null">
+        valid_date,
+      </if>
       <if test="annexUrl != null">
         annex_url,
       </if>
@@ -212,6 +216,9 @@
       <if test="duration != null">
         #{duration,jdbcType=DOUBLE},
       </if>
+      <if test="validDate != null">
+        #{validDate,jdbcType=VARCHAR},
+      </if>
       <if test="annexUrl != null">
         #{annexUrl,jdbcType=LONGVARCHAR},
       </if>
@@ -224,7 +231,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 02 14:39:12 CST 2021.
+      This element was generated on Thu Jun 10 15:22:12 CST 2021.
     -->
     update public_release
     <set>
@@ -276,6 +283,9 @@
       <if test="duration != null">
         duration = #{duration,jdbcType=DOUBLE},
       </if>
+      <if test="validDate != null">
+        valid_date = #{validDate,jdbcType=VARCHAR},
+      </if>
       <if test="annexUrl != null">
         annex_url = #{annexUrl,jdbcType=LONGVARCHAR},
       </if>
@@ -289,7 +299,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 02 14:39:12 CST 2021.
+      This element was generated on Thu Jun 10 15:22:12 CST 2021.
     -->
     update public_release
     set `uid` = #{uid,jdbcType=VARCHAR},
@@ -308,6 +318,7 @@
       pname = #{pname,jdbcType=VARCHAR},
       ufid = #{ufid,jdbcType=VARCHAR},
       duration = #{duration,jdbcType=DOUBLE},
+      valid_date = #{validDate,jdbcType=VARCHAR},
       annex_url = #{annexUrl,jdbcType=LONGVARCHAR},
       photo_url = #{photoUrl,jdbcType=LONGVARCHAR}
     where id = #{id,jdbcType=INTEGER}
@@ -316,7 +327,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 02 14:39:12 CST 2021.
+      This element was generated on Thu Jun 10 15:22:12 CST 2021.
     -->
     update public_release
     set `uid` = #{uid,jdbcType=VARCHAR},
@@ -334,12 +345,13 @@
       pid = #{pid,jdbcType=VARCHAR},
       pname = #{pname,jdbcType=VARCHAR},
       ufid = #{ufid,jdbcType=VARCHAR},
-      duration = #{duration,jdbcType=DOUBLE}
+      duration = #{duration,jdbcType=DOUBLE},
+      valid_date = #{validDate,jdbcType=VARCHAR}
     where id = #{id,jdbcType=INTEGER}
   </update>
   
    <insert id="insertSelectiveGetId" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicRelease" useGeneratedKeys="true">
-   insert into public_release
+    insert into public_release
     <trim prefix="(" suffix=")" suffixOverrides=",">
       <if test="id != null">
         id,
@@ -386,6 +398,15 @@
       <if test="pname != null">
         pname,
       </if>
+      <if test="ufid != null">
+        ufid,
+      </if>
+      <if test="duration != null">
+        duration,
+      </if>
+      <if test="validDate != null">
+        valid_date,
+      </if>
       <if test="annexUrl != null">
         annex_url,
       </if>
@@ -439,6 +460,15 @@
       <if test="pname != null">
         #{pname,jdbcType=VARCHAR},
       </if>
+      <if test="ufid != null">
+        #{ufid,jdbcType=VARCHAR},
+      </if>
+      <if test="duration != null">
+        #{duration,jdbcType=DOUBLE},
+      </if>
+      <if test="validDate != null">
+        #{validDate,jdbcType=VARCHAR},
+      </if>
       <if test="annexUrl != null">
         #{annexUrl,jdbcType=LONGVARCHAR},
       </if>
@@ -452,15 +482,20 @@
   </insert>
   
   <select id="listPublicRelease" resultType="com.goafanti.admin.bo.OutPublicReleaseList">
-  select  a.id,b.nickname ,c.name  aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.user_name userName,
-date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.status
-	from public_release a left join `user` b on a.uid =b.id left join admin c on a.aid =c.id
+select  a.id,b.nickname ,c.name  aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.user_name userName,
+date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.status,
+a.latitude ,a.longitude ,a.clock_in clockIn 
+from public_release a left join `user` b on a.uid =b.id left join admin c on a.aid =c.id
 	where 1=1
 	<if test="type==0">
 	and a.aid= #{aid} 
 	</if>
 	<if test="type==1">
 	and c.superior_id = #{aid}
+	and a.status=1
+	</if>
+	<if test="clockTime !=null">
+	and a.release_start &lt; #{clockTime} and a.release_end &gt; #{clockTime}
 	</if>
 	order by a.status,a.create_time 
   	<if test="page_sql!=null">
@@ -476,21 +511,33 @@ date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,date_format(a.create
 	</if>
 	<if test="type==1">
 	and c.superior_id = #{aid}
+	and a.status=1
+	</if>
+	<if test="clockTime !=null">
+	and a.release_start &lt; #{clockTime} and a.release_end &gt; #{clockTime}
 	</if>
   </select>
   
-  <select id="selectByUfid" resultType="com.goafanti.admin.bo.OutPublicRelease">
-  select  a.id,b.nickname ,c.name  aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.user_name userName,
-date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.status
+  <select id="selectDtails" resultType="com.goafanti.admin.bo.OutPublicRelease">
+  		select  a.id,b.nickname ,c.name  aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.user_name userName,
+date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.status,
+a.annex_url annexUrl ,a.remarks,a.duration ,a.valid_date validDate ,a.latitude ,a.longitude 
 	from public_release a left join `user` b on a.uid =b.id left join admin c on a.aid =c.id
-	where a.ufid= #{id}
+	where 1=1
+	<if test="id !=null">
+	and a.id= #{id}
+	</if>
+	<if test="ufid !=null">
+	and a.ufid= #{ufid}
+	</if>
+	
   </select>
   
   <select id="listPublicStatistics" resultType="com.goafanti.admin.bo.OutPublicStatistics">
   	select if(a.status=0,1,0)bh ,if(a.status=1,1,0)wsh,if(a.status=2,1,0)tg,b.name 
-  	,sum(a.duration)duration
+  	,sum(if(a.status=2,a.duration,0))duration
     from  public_release a left join admin b on a.aid =b.id
-	where 1=1
+	where 1=1 
 	<if test="aid != null">
 	and a.aid= #{aid}
 	</if>

+ 8 - 0
src/main/java/com/goafanti/common/mapper/UserChannelMapper.xml

@@ -43,6 +43,8 @@
     from user_channel
     where id = #{id,jdbcType=INTEGER}
   </select>
+  
+  
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
     <!--
       WARNING - @mbg.generated
@@ -367,4 +369,10 @@
     </foreach>
     )
     </select>
+    <select id="selectByUid"  resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from user_channel
+    where uid = #{id}
+  </select>
 </mapper>

+ 1 - 1
src/main/java/com/goafanti/common/mapper/UserMapper.xml

@@ -1651,7 +1651,7 @@
     select 
     <include refid="Base_Column_List" />
     from user
-    where nickname  = #{name}
+    where nickname  = #{name} limit 1
   </select>
   
 </mapper>

+ 2 - 1
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -335,8 +335,9 @@
 			a.aid,
 			a.sign_bills signBills,
 			a.share_type as shareType,
+			a.channel ,
 			a.information_maintainer as mid 		
-		from user a 
+		from `user` a 
 		left join organization_identity b on a.id = b.uid
 		left join district_glossory dg1 on b.location_province = dg1.id
 		left join district_glossory dg2 on b.location_city = dg2.id

+ 83 - 59
src/main/java/com/goafanti/common/model/PublicRelease.java

@@ -7,109 +7,114 @@ public class PublicRelease implements Serializable {
 
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column public_release.id
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	private Integer id;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column public_release.uid
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	private String uid;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column public_release.aid
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	private String aid;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column public_release.release_start
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	private Date releaseStart;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column public_release.release_end
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	private Date releaseEnd;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column public_release.remarks
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	private String remarks;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column public_release.user_name
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	private String userName;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column public_release.longitude
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	private String longitude;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column public_release.latitude
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	private String latitude;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column public_release.status
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	private Integer status;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column public_release.create_time
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	private Date createTime;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column public_release.clock_in
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	private Integer clockIn;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column public_release.clock_in_time
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	private Date clockInTime;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column public_release.pid
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	private String pid;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column public_release.pname
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	private String pname;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column public_release.ufid
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	private String ufid;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column public_release.duration
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	private Double duration;
 	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column public_release.valid_date
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	private String validDate;
+	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column public_release.annex_url
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	private String annexUrl;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column public_release.photo_url
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	private String photoUrl;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table public_release
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	private static final long serialVersionUID = 1L;
 
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.id
 	 * @return  the value of public_release.id
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public Integer getId() {
 		return id;
@@ -118,7 +123,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.id
 	 * @param id  the value for public_release.id
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public void setId(Integer id) {
 		this.id = id;
@@ -127,7 +132,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.uid
 	 * @return  the value of public_release.uid
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public String getUid() {
 		return uid;
@@ -136,7 +141,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.uid
 	 * @param uid  the value for public_release.uid
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public void setUid(String uid) {
 		this.uid = uid == null ? null : uid.trim();
@@ -145,7 +150,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.aid
 	 * @return  the value of public_release.aid
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public String getAid() {
 		return aid;
@@ -154,7 +159,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.aid
 	 * @param aid  the value for public_release.aid
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public void setAid(String aid) {
 		this.aid = aid == null ? null : aid.trim();
@@ -163,7 +168,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.release_start
 	 * @return  the value of public_release.release_start
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public Date getReleaseStart() {
 		return releaseStart;
@@ -172,7 +177,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.release_start
 	 * @param releaseStart  the value for public_release.release_start
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public void setReleaseStart(Date releaseStart) {
 		this.releaseStart = releaseStart;
@@ -181,7 +186,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.release_end
 	 * @return  the value of public_release.release_end
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public Date getReleaseEnd() {
 		return releaseEnd;
@@ -190,7 +195,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.release_end
 	 * @param releaseEnd  the value for public_release.release_end
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public void setReleaseEnd(Date releaseEnd) {
 		this.releaseEnd = releaseEnd;
@@ -199,7 +204,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.remarks
 	 * @return  the value of public_release.remarks
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public String getRemarks() {
 		return remarks;
@@ -208,7 +213,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.remarks
 	 * @param remarks  the value for public_release.remarks
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public void setRemarks(String remarks) {
 		this.remarks = remarks == null ? null : remarks.trim();
@@ -217,7 +222,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.user_name
 	 * @return  the value of public_release.user_name
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public String getUserName() {
 		return userName;
@@ -226,7 +231,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.user_name
 	 * @param userName  the value for public_release.user_name
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public void setUserName(String userName) {
 		this.userName = userName == null ? null : userName.trim();
@@ -235,7 +240,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.longitude
 	 * @return  the value of public_release.longitude
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public String getLongitude() {
 		return longitude;
@@ -244,7 +249,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.longitude
 	 * @param longitude  the value for public_release.longitude
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public void setLongitude(String longitude) {
 		this.longitude = longitude == null ? null : longitude.trim();
@@ -253,7 +258,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.latitude
 	 * @return  the value of public_release.latitude
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public String getLatitude() {
 		return latitude;
@@ -262,7 +267,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.latitude
 	 * @param latitude  the value for public_release.latitude
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public void setLatitude(String latitude) {
 		this.latitude = latitude == null ? null : latitude.trim();
@@ -271,7 +276,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.status
 	 * @return  the value of public_release.status
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public Integer getStatus() {
 		return status;
@@ -280,7 +285,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.status
 	 * @param status  the value for public_release.status
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public void setStatus(Integer status) {
 		this.status = status;
@@ -289,7 +294,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.create_time
 	 * @return  the value of public_release.create_time
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public Date getCreateTime() {
 		return createTime;
@@ -298,7 +303,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.create_time
 	 * @param createTime  the value for public_release.create_time
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public void setCreateTime(Date createTime) {
 		this.createTime = createTime;
@@ -307,7 +312,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.clock_in
 	 * @return  the value of public_release.clock_in
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public Integer getClockIn() {
 		return clockIn;
@@ -316,7 +321,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.clock_in
 	 * @param clockIn  the value for public_release.clock_in
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public void setClockIn(Integer clockIn) {
 		this.clockIn = clockIn;
@@ -325,7 +330,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.clock_in_time
 	 * @return  the value of public_release.clock_in_time
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public Date getClockInTime() {
 		return clockInTime;
@@ -334,7 +339,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.clock_in_time
 	 * @param clockInTime  the value for public_release.clock_in_time
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public void setClockInTime(Date clockInTime) {
 		this.clockInTime = clockInTime;
@@ -343,7 +348,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.pid
 	 * @return  the value of public_release.pid
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public String getPid() {
 		return pid;
@@ -352,7 +357,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.pid
 	 * @param pid  the value for public_release.pid
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public void setPid(String pid) {
 		this.pid = pid == null ? null : pid.trim();
@@ -361,7 +366,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.pname
 	 * @return  the value of public_release.pname
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public String getPname() {
 		return pname;
@@ -370,7 +375,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.pname
 	 * @param pname  the value for public_release.pname
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public void setPname(String pname) {
 		this.pname = pname == null ? null : pname.trim();
@@ -379,7 +384,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.ufid
 	 * @return  the value of public_release.ufid
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public String getUfid() {
 		return ufid;
@@ -388,7 +393,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.ufid
 	 * @param ufid  the value for public_release.ufid
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public void setUfid(String ufid) {
 		this.ufid = ufid == null ? null : ufid.trim();
@@ -397,7 +402,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.duration
 	 * @return  the value of public_release.duration
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public Double getDuration() {
 		return duration;
@@ -406,16 +411,34 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.duration
 	 * @param duration  the value for public_release.duration
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public void setDuration(Double duration) {
 		this.duration = duration;
 	}
 
 	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.valid_date
+	 * @return  the value of public_release.valid_date
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public String getValidDate() {
+		return validDate;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.valid_date
+	 * @param validDate  the value for public_release.valid_date
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public void setValidDate(String validDate) {
+		this.validDate = validDate == null ? null : validDate.trim();
+	}
+
+	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.annex_url
 	 * @return  the value of public_release.annex_url
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public String getAnnexUrl() {
 		return annexUrl;
@@ -424,7 +447,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.annex_url
 	 * @param annexUrl  the value for public_release.annex_url
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public void setAnnexUrl(String annexUrl) {
 		this.annexUrl = annexUrl == null ? null : annexUrl.trim();
@@ -433,7 +456,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.photo_url
 	 * @return  the value of public_release.photo_url
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public String getPhotoUrl() {
 		return photoUrl;
@@ -442,7 +465,7 @@ public class PublicRelease implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.photo_url
 	 * @param photoUrl  the value for public_release.photo_url
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	public void setPhotoUrl(String photoUrl) {
 		this.photoUrl = photoUrl == null ? null : photoUrl.trim();
@@ -450,7 +473,7 @@ public class PublicRelease implements Serializable {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table public_release
-	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
 	 */
 	@Override
 	public String toString() {
@@ -475,6 +498,7 @@ public class PublicRelease implements Serializable {
 		sb.append(", pname=").append(pname);
 		sb.append(", ufid=").append(ufid);
 		sb.append(", duration=").append(duration);
+		sb.append(", validDate=").append(validDate);
 		sb.append(", annexUrl=").append(annexUrl);
 		sb.append(", photoUrl=").append(photoUrl);
 		sb.append(", serialVersionUID=").append(serialVersionUID);

+ 20 - 20
src/main/java/com/goafanti/common/model/PublicReleaseLog.java

@@ -6,43 +6,43 @@ import java.util.Date;
 public class PublicReleaseLog implements Serializable {
     /**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column public_release_log.id
-	 * @mbg.generated  Tue Jun 01 15:52:56 CST 2021
+	 * @mbg.generated  Fri Jun 11 16:07:04 CST 2021
 	 */
 	private Integer id;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column public_release_log.prid
-	 * @mbg.generated  Tue Jun 01 15:52:56 CST 2021
+	 * @mbg.generated  Fri Jun 11 16:07:04 CST 2021
 	 */
 	private Integer prid;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column public_release_log.aid
-	 * @mbg.generated  Tue Jun 01 15:52:56 CST 2021
+	 * @mbg.generated  Fri Jun 11 16:07:04 CST 2021
 	 */
 	private String aid;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column public_release_log.remarks
-	 * @mbg.generated  Tue Jun 01 15:52:56 CST 2021
+	 * @mbg.generated  Fri Jun 11 16:07:04 CST 2021
 	 */
 	private String remarks;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column public_release_log.status
-	 * @mbg.generated  Tue Jun 01 15:52:56 CST 2021
+	 * @mbg.generated  Fri Jun 11 16:07:04 CST 2021
 	 */
 	private Integer status;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column public_release_log.create_time
-	 * @mbg.generated  Tue Jun 01 15:52:56 CST 2021
+	 * @mbg.generated  Fri Jun 11 16:07:04 CST 2021
 	 */
 	private Date createTime;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table public_release_log
-	 * @mbg.generated  Tue Jun 01 15:52:56 CST 2021
+	 * @mbg.generated  Fri Jun 11 16:07:04 CST 2021
 	 */
 	private static final long serialVersionUID = 1L;
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release_log.id
 	 * @return  the value of public_release_log.id
-	 * @mbg.generated  Tue Jun 01 15:52:56 CST 2021
+	 * @mbg.generated  Fri Jun 11 16:07:04 CST 2021
 	 */
 	public Integer getId() {
 		return id;
@@ -50,7 +50,7 @@ public class PublicReleaseLog implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release_log.id
 	 * @param id  the value for public_release_log.id
-	 * @mbg.generated  Tue Jun 01 15:52:56 CST 2021
+	 * @mbg.generated  Fri Jun 11 16:07:04 CST 2021
 	 */
 	public void setId(Integer id) {
 		this.id = id;
@@ -58,7 +58,7 @@ public class PublicReleaseLog implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release_log.prid
 	 * @return  the value of public_release_log.prid
-	 * @mbg.generated  Tue Jun 01 15:52:56 CST 2021
+	 * @mbg.generated  Fri Jun 11 16:07:04 CST 2021
 	 */
 	public Integer getPrid() {
 		return prid;
@@ -66,7 +66,7 @@ public class PublicReleaseLog implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release_log.prid
 	 * @param prid  the value for public_release_log.prid
-	 * @mbg.generated  Tue Jun 01 15:52:56 CST 2021
+	 * @mbg.generated  Fri Jun 11 16:07:04 CST 2021
 	 */
 	public void setPrid(Integer prid) {
 		this.prid = prid;
@@ -74,7 +74,7 @@ public class PublicReleaseLog implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release_log.aid
 	 * @return  the value of public_release_log.aid
-	 * @mbg.generated  Tue Jun 01 15:52:56 CST 2021
+	 * @mbg.generated  Fri Jun 11 16:07:04 CST 2021
 	 */
 	public String getAid() {
 		return aid;
@@ -82,7 +82,7 @@ public class PublicReleaseLog implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release_log.aid
 	 * @param aid  the value for public_release_log.aid
-	 * @mbg.generated  Tue Jun 01 15:52:56 CST 2021
+	 * @mbg.generated  Fri Jun 11 16:07:04 CST 2021
 	 */
 	public void setAid(String aid) {
 		this.aid = aid == null ? null : aid.trim();
@@ -90,7 +90,7 @@ public class PublicReleaseLog implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release_log.remarks
 	 * @return  the value of public_release_log.remarks
-	 * @mbg.generated  Tue Jun 01 15:52:56 CST 2021
+	 * @mbg.generated  Fri Jun 11 16:07:04 CST 2021
 	 */
 	public String getRemarks() {
 		return remarks;
@@ -98,7 +98,7 @@ public class PublicReleaseLog implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release_log.remarks
 	 * @param remarks  the value for public_release_log.remarks
-	 * @mbg.generated  Tue Jun 01 15:52:56 CST 2021
+	 * @mbg.generated  Fri Jun 11 16:07:04 CST 2021
 	 */
 	public void setRemarks(String remarks) {
 		this.remarks = remarks == null ? null : remarks.trim();
@@ -106,7 +106,7 @@ public class PublicReleaseLog implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release_log.status
 	 * @return  the value of public_release_log.status
-	 * @mbg.generated  Tue Jun 01 15:52:56 CST 2021
+	 * @mbg.generated  Fri Jun 11 16:07:04 CST 2021
 	 */
 	public Integer getStatus() {
 		return status;
@@ -114,7 +114,7 @@ public class PublicReleaseLog implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release_log.status
 	 * @param status  the value for public_release_log.status
-	 * @mbg.generated  Tue Jun 01 15:52:56 CST 2021
+	 * @mbg.generated  Fri Jun 11 16:07:04 CST 2021
 	 */
 	public void setStatus(Integer status) {
 		this.status = status;
@@ -122,7 +122,7 @@ public class PublicReleaseLog implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release_log.create_time
 	 * @return  the value of public_release_log.create_time
-	 * @mbg.generated  Tue Jun 01 15:52:56 CST 2021
+	 * @mbg.generated  Fri Jun 11 16:07:04 CST 2021
 	 */
 	public Date getCreateTime() {
 		return createTime;
@@ -130,14 +130,14 @@ public class PublicReleaseLog implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release_log.create_time
 	 * @param createTime  the value for public_release_log.create_time
-	 * @mbg.generated  Tue Jun 01 15:52:56 CST 2021
+	 * @mbg.generated  Fri Jun 11 16:07:04 CST 2021
 	 */
 	public void setCreateTime(Date createTime) {
 		this.createTime = createTime;
 	}
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table public_release_log
-	 * @mbg.generated  Tue Jun 01 15:52:56 CST 2021
+	 * @mbg.generated  Fri Jun 11 16:07:04 CST 2021
 	 */
 	@Override
 	public String toString() {

+ 0 - 1
src/main/java/com/goafanti/common/task/ExpiredUserMemberTask.java

@@ -2,7 +2,6 @@ package com.goafanti.common.task;
 
 import javax.annotation.Resource;
 
-import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
 import com.goafanti.common.utils.LoggerUtils;

+ 0 - 1
src/main/java/com/goafanti/common/task/OrderReportTask.java

@@ -7,7 +7,6 @@ import javax.annotation.Resource;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
 import com.goafanti.common.utils.LoggerUtils;

+ 1 - 89
src/main/java/com/goafanti/common/utils/AsyncUtils.java

@@ -1,42 +1,25 @@
 package com.goafanti.common.utils;
 
 import java.io.UnsupportedEncodingException;
-import java.net.URL;
-import java.util.Date;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 import javax.mail.MessagingException;
 
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Component;
 
-import com.alibaba.fastjson.JSONObject;
 import com.goafanti.common.bo.EmailBo;
-import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.NoticeMapper;
 import com.goafanti.common.enums.NoticeTypes;
-import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.Notice;
-import com.goafanti.core.shiro.token.TokenManager;
 
 @Component
 @Async
 public class AsyncUtils {
 	@Autowired
 	private NoticeMapper noticeMapper;
-	@Value(value = "${wx.appId}")
-	private String appId;
-	@Value(value = "${wx.appSecret}")
-	private String appSecret;
-	//待审核通知
-	private static final String sptz="j7WH3EwQnxGxwuV2HwmJhryxySPE8vOiV5cVOpp-42I";
-	//审核结通知
-	private static final String jgtz="pWia-KJPFwDM8ReDu_BOa2_42G7W2hXB16sUDbSxpcM";
-	private static  String send_url="https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=ACCESS_TOKEN";
+	
 
 	
 	public void patentSend(EmailBo bo) throws UnsupportedEncodingException, MessagingException {
@@ -62,75 +45,4 @@ public class AsyncUtils {
 		
 	}
 
-
-	/**
-	 * 
-	 * @param openid
-	 * @param type 0申请 1通过 2驳回
-	 * @param string 
-	 * @param date 
-	 */
-	public void addWechatNotice(String openid ,Integer type, Date date, String aname) {
-		Map<String, Object> map=new HashMap<String, Object>();
-		String accessToken=getAccessToken();
-		String url=send_url.replace("ACCESS_TOKEN", accessToken);
-		System.out.println(url);
-		map.put("access_token", accessToken);
-		map.put("touser", openid);
-		Map<String, Object> we=new HashMap<String, Object>();
-		if (type==0) {
-			map.put("template_id", sptz);
-			Map<String, Object> v1=new HashMap<String, Object>();
-			String str=DateUtils.formatDate(date, AFTConstants.YMDHMS_CHINESE);
-			v1.put("value",str);
-			we.put("date2", v1);
-			Map<String, Object> v2=new HashMap<String, Object>();
-			v2.put("value", aname);
-			we.put("name5", v2);
-			Map<String, Object> v3=new HashMap<String, Object>();
-			v3.put("value", "我是一个备注");
-			we.put("thing8", v3);
-		}else if (type==1){
-			map.put("template_id", jgtz);
-			we.put("thing17", new HashMap<>().put("value", "通过"));
-			we.put("thing25", new HashMap<>().put("value", "您申请的外出已通过!"));
-		}else if (type==2){
-			map.put("template_id", jgtz);
-			we.put("thing17", new HashMap<>().put("value", "通过"));
-			we.put("thing25", new HashMap<>().put("value", "您申请的外出已驳回!"));
-		}
-		map.put("data", we);
-		System.out.println(JSONObject.toJSON(map));
-		JSONObject json=HttpUtils.httpPost(url, map);
-		System.out.println(JSONObject.toJSONString(json));
-		
-	}
-	
-
-	
-	  public  String getAccessToken() {
-	    	String access_token=(String) TokenManager.getVal2Session("access_token");
-	    	String expires_in= (String) TokenManager.getVal2Session("expires_in");
-	    	if (access_token!=null&&expires_in!=null) {
-	    		expires_in=expires_in+7200;
-	    		if (new Date().getTime()<Long.valueOf(expires_in)) {
-	    			return access_token;
-				}
-			}
-				String url = String.format(
-						"https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s", appId,
-						appSecret);
-				JSONObject js = HttpUtils.httpGet(url);
-				String errcode =js.getString("errcode");
-				if (errcode!=null) {
-					throw new  BusinessException("获取AccessToken失败!");
-				}else {
-					LoggerUtils.debug(AsyncUtils.class,"获取AccessToken成功,accesstoken="+js.getString("access_token"));
-				}
-				access_token = js.getString("access_token");
-				expires_in = js.getString("expires_in");
-				TokenManager.setVal2Session("access_token", access_token);
-				TokenManager.setVal2Session("expires_in", expires_in);
-			return access_token;
-	    }
 }

+ 3 - 4
src/main/java/com/goafanti/common/utils/DateUtils.java

@@ -7,7 +7,6 @@ import java.util.Date;
 
 
 import com.goafanti.common.error.BusinessException;
-import com.goafanti.common.model.PublicRelease;
 
 public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
 
@@ -278,7 +277,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
 	 */
 	public static Date getFirstDayOfQuarter(Integer year, Integer quarter) {
 		Calendar calendar = Calendar.getInstance();
-		Integer month = new Integer(0);
+		Integer month = 0;
 		if (quarter == 1) {
 			month = 1 - 1;
 		} else if (quarter == 2) {
@@ -315,7 +314,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
 	 */
 	public static Date getLastDayOfQuarter(Integer year, Integer quarter) {
 		Calendar calendar = Calendar.getInstance();
-		Integer month = new Integer(0);
+		Integer month = 0;
 		if (quarter == 1) {
 			month = 3 - 1;
 		} else if (quarter == 2) {
@@ -352,7 +351,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
 	 */
 	public static Date getLastDayOfLastQuarter(Integer year, Integer quarter) {
 		Calendar calendar = Calendar.getInstance();
-		Integer month = new Integer(0);
+		Integer month = 0;
 		if (quarter == 1) {
 			month = 12 - 1;
 		} else if (quarter == 2) {

+ 0 - 1
src/main/java/com/goafanti/common/utils/ExcelUtils.java

@@ -17,7 +17,6 @@ import java.util.regex.Pattern;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.xssf.usermodel.XSSFSheet;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.springframework.stereotype.Component;
 import org.springframework.web.multipart.MultipartFile;
 
 import com.goafanti.customer.bo.CustomerExcelBo;

+ 190 - 0
src/main/java/com/goafanti/common/utils/RedisUtil.java

@@ -0,0 +1,190 @@
+package com.goafanti.common.utils;
+
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import com.alibaba.fastjson.JSON;
+
+import redis.clients.jedis.Jedis;
+import redis.clients.jedis.JedisPool;
+/**
+ * redis辅助类
+ * @author 
+ *
+ */
+@Component
+public class RedisUtil {
+	@Value(value = "${jedis.host}")
+	private  String host;
+	@Value(value = "${jedis.password}")
+	private  String pwd;
+	@Autowired
+	private  JedisPool pool;//创建代理对象
+	
+	
+	
+//	 /**
+//     * 初始化Redis连接池
+//     */
+//    public RedisUtil() {
+//    	if (pool==null) {
+//    		try {
+//    			JedisPoolConfig config = new JedisPoolConfig();
+//    			config.setBlockWhenExhausted(false);
+//    			config.setEvictionPolicyClassName("org.apache.commons.pool2.impl.DefaultEvictionPolicy"); 
+//    			config.setJmxEnabled(true);
+//    			config.setJmxNamePrefix("pool");
+//    			config.setLifo(true);
+//    			config.setMaxIdle(8);
+//    			config.setMaxTotal(8);
+//    			config.setMaxWaitMillis(-1);
+//    			config.setMinEvictableIdleTimeMillis(1800000L);
+//    			config.setMinIdle(0);
+//    			config.setNumTestsPerEvictionRun(3);
+//    			config.setSoftMinEvictableIdleTimeMillis(1800000L);
+//    			config.setTestOnBorrow(false);
+//    			config.setTestWhileIdle(false);
+//    			config.setTimeBetweenEvictionRunsMillis(-1);
+//    			pool = new JedisPool(config, host, 6379, 10000, pwd);
+//    		} catch (Exception e) {
+//    			e.printStackTrace();
+//    		}
+//		}
+//    }
+
+	
+	
+	public boolean presence(String key){
+		Jedis jedis = pool.getResource();
+		boolean bool=true;
+		try {
+			bool =jedis.exists(key);//进行判断
+		}catch(Exception e){
+			e.printStackTrace();//输出错误信息
+		}finally {
+			jedis.close();//释放资源
+		}
+		return bool;
+	}
+	/**
+	 * 将缓存中数据进行反序列化
+	 * @param key
+	 * @param clazz
+	 * @return
+	 */
+	@SuppressWarnings("unchecked")
+	public <T>List<T> getObject(String key,Class<T> clazz){
+		Jedis jedis = pool.getResource();
+		ByteArrayInputStream is=null;
+		ObjectInputStream ois=null;
+		try {
+			//将缓存中数据存入byte数组中
+			byte[] b = jedis.get(key.getBytes());
+			is= new ByteArrayInputStream(b);
+			ois = new ObjectInputStream(is);
+			return(List<T>)ois.readObject();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally{
+			try {
+				is.close();
+				ois.close();
+			} catch (IOException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+			jedis.close();
+		}
+		return null;
+	}
+	/**
+	 * 将对象进行序列化存入redis中
+	 * @param object
+	 * @param key
+	 */
+	public void saveObject(Object object,String key){
+		Jedis jedis=pool.getResource();
+		ByteArrayOutputStream os=null;
+		ObjectOutputStream oos=null;
+		try {
+			os=new ByteArrayOutputStream();
+			oos =new ObjectOutputStream(os);
+			byte[] b=os.toByteArray();
+			JSON.toJSONString(b);
+			jedis.set(key.getBytes(), b);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally{
+			try {
+				os.close();
+				oos.close();
+			} catch (Exception e2) {
+				e2.printStackTrace();
+			}
+			jedis.close();
+		}
+	}
+	// 把List集合对象转换成json格式保存到指定的键中
+	public void saveJsonArray(Object object, String key) {
+		Jedis jedis = pool.getResource();
+		try {
+			// 格式化成Json字符串
+			String array = JSON.toJSONString(object);
+			jedis.set(key, array.toString()); // 存入缓存
+		} finally {
+			jedis.close();
+		}
+	}
+	
+		public void setString(String key, String value) {
+			Jedis jedis = pool.getResource();
+			try {
+				jedis.set(key,value); // 存入缓存
+			} finally {
+				jedis.close();
+			}
+		}
+		
+		public void deleteString(String key) {
+			Jedis jedis = pool.getResource();
+			try {
+				jedis.del(key);
+			} finally {
+				jedis.close();
+			}
+		}
+		
+		public String getString(String key) {
+			Jedis jedis = pool.getResource();
+			String str=new String();
+			try {
+				str=jedis.get(key);
+			} finally {
+				jedis.close();
+			}
+			return str;
+		}
+
+	// 通过键取出Json字符串并转换成 <T>这个T所指定的类型
+	public  <T> T getJsonArray(String key, Class<T> clazz) {
+		Jedis jedis = pool.getResource();
+		try {
+			String str = jedis.get(key);
+			// 把字符串转换回集合对象 clazz是指定的类型
+			return JSON.parseObject(str, clazz);
+		} finally {
+			jedis.close();
+		}
+	}
+}
+
+

+ 148 - 0
src/main/java/com/goafanti/common/utils/WeChatUtils.java

@@ -0,0 +1,148 @@
+package com.goafanti.common.utils;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import com.alibaba.fastjson.JSONObject;
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.error.BusinessException;
+
+
+@Component
+public class WeChatUtils {
+	
+	
+	@Value(value = "${wx.appId}")
+	private String appId;
+	@Value(value = "${wx.appSecret}")
+	private String appSecret;
+	@Autowired
+	private RedisUtil redisUtil;
+	
+	//待审核通知
+	private static final String sptz="j7WH3EwQnxGxwuV2HwmJhryxySPE8vOiV5cVOpp-42I";
+	//审核结通知
+	private static final String jgtz="pWia-KJPFwDM8ReDu_BOa9FJn31VFc81bp3yxfBmIRI";
+	private static  String send_url="https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=ACCESS_TOKEN";
+
+
+	
+
+	/**
+	 * 
+	 * @param openid
+	 * @param type 状态 0驳回 1发起 2同意
+	 * @param string 
+	 * @param date 
+	 */
+	public Integer addNotice(String openid ,Integer type, Date date, String aname,String remarks) {
+		Map<String, Object> map=new HashMap<String, Object>();
+		String accessToken=getAccessToken();
+		String url=send_url.replace("ACCESS_TOKEN", accessToken);
+		map.put("access_token", accessToken);
+		map.put("touser", openid);
+		if (type==1) {
+			map.put("template_id", sptz);
+			map.put("data",getData(type,date, aname,remarks));
+		}else {
+			map.put("template_id", jgtz);
+			map.put("data",getData(type,date, aname,remarks));
+		}
+		System.out.println("inupt="+JSONObject.toJSONString(map));
+		JSONObject res=HttpUtils.httpPost(url, map);
+		System.out.println("res="+JSONObject.toJSONString(res));
+		if (res.get("errcode")!=null) {
+			return res.getInteger("errcode");
+		}else {
+			return 1;
+		}
+		
+	}
+	private Map<String, Object> getData(Integer type,Date date, String aname, String remarks) {
+		Map<String, Object> we=new HashMap<String, Object>();
+		String strDate=DateUtils.formatDate(date, AFTConstants.YMDHMS_CHINESE);
+		if (type==1) {
+			Map<String, Object> v1=new HashMap<String, Object>();
+			v1.put("value",strDate);
+			we.put("time5", v1);
+			Map<String, Object> v2=new HashMap<String, Object>();
+			v2.put("value", aname);
+			we.put("name3", v2);
+			Map<String, Object> v3=new HashMap<String, Object>();
+			v3.put("value", remarks);
+			we.put("thing10", v3);
+		}else {
+			String thing2="";
+			if (type==0){
+				thing2="驳回";
+			}else if (type==2){
+				thing2="通过";
+			}
+			Map<String, Object> v1=new HashMap<String, Object>();
+			v1.put("value",strDate);
+			we.put("date3", v1);
+			Map<String, Object> v2=new HashMap<String, Object>();
+			v2.put("value", thing2);
+			we.put("thing2", v2);
+			Map<String, Object> v3=new HashMap<String, Object>();
+			v3.put("value", remarks);
+			we.put("thing6", v3);
+		} 
+		return we;
+	}
+	
+	
+
+	
+	public String getAccessToken() {
+		Date date = new Date();
+		if (redisUtil.presence("access_token")||redisUtil.presence("expires_in")) {
+			String access_token=redisUtil.getString("access_token");
+			String expires_in=redisUtil.getString("expires_in");
+			if (date.getTime() < Long.valueOf(expires_in)) {
+				LoggerUtils.debug(getClass(), "redis中获取accestoken");
+				return access_token;
+			} else {
+				LoggerUtils.debug(getClass(), "accestoken超时重新获取");
+				redisUtil.deleteString("access_token");
+				redisUtil.deleteString("expires_in");
+				return setSessionAccessToken(date);
+			}
+		
+		} else {
+			return setSessionAccessToken(date);
+		}
+		
+
+	}
+	
+
+
+	private String setSessionAccessToken(Date date) {
+		String url = String.format(
+				"https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s", appId,
+				appSecret);
+		JSONObject js = HttpUtils.httpGet(url);
+		String errcode =js.getString("errcode");
+		if (errcode!=null) {
+			throw new  BusinessException("获取AccessToken失败!");
+		}else {
+			LoggerUtils.debug(AsyncUtils.class,"获取并存入AccessToken成功,accesstoken="+js.getString("access_token"));
+		}
+		String access_token = js.getString("access_token");
+		Long expires_in = js.getLong("expires_in");
+		//返回时间为秒需要计算换成毫秒
+		expires_in=expires_in*1000;
+		expires_in+=date.getTime();
+		redisUtil.setString("access_token", access_token);
+		redisUtil.setString("expires_in", expires_in.toString());
+		return access_token;
+	}
+
+}

+ 2 - 1
src/main/java/com/goafanti/common/utils/excel/Excel.java

@@ -60,7 +60,8 @@ public @interface Excel
     /**
      * BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN
      */
-    public int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
+    @SuppressWarnings("deprecation")
+	public int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
 
     /**
      * 导出类型(0数字 1字符串)

+ 0 - 2
src/main/java/com/goafanti/common/utils/excel/ExcelConstant.java

@@ -1,8 +1,6 @@
 package com.goafanti.common.utils.excel;
 
 import com.goafanti.order.enums.LiquidationNewState;
-import com.goafanti.order.enums.NewProjectStatus;
-import com.goafanti.order.enums.OrderNewState;
 
 public class ExcelConstant {
 	

+ 1 - 2
src/main/java/com/goafanti/common/utils/excel/NewExcelUtil.java

@@ -48,10 +48,8 @@ import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.ss.util.CellRangeAddressList;
 import org.apache.poi.util.IOUtils;
 import org.apache.poi.xssf.streaming.SXSSFWorkbook;
-import org.apache.poi.xssf.usermodel.XSSFCellStyle;
 import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
 import org.apache.poi.xssf.usermodel.XSSFDataValidation;
-import org.apache.poi.xssf.usermodel.XSSFFont;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -465,6 +463,7 @@ public class NewExcelUtil<T> {
 	/**
 	 * 添加单元格
 	 */
+	@SuppressWarnings("deprecation")
 	public Cell addCell(Excel attr, Row row, T vo, Field field, int column) {
 		Cell cell = null;
 		try {

+ 0 - 1
src/main/java/com/goafanti/contract/service/impl/ContractServiceImpl.java

@@ -16,7 +16,6 @@ import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.ContractLogMapper;
 import com.goafanti.common.dao.ContractMapper;
 import com.goafanti.common.dao.CopyrightInfoMapper;
-import com.goafanti.common.dao.NoticeMapper;
 import com.goafanti.common.dao.OrgCognizanceMapper;
 import com.goafanti.common.dao.PatentInfoMapper;
 import com.goafanti.common.dao.TechProjectMapper;

+ 5 - 1
src/main/java/com/goafanti/core/shiro/token/TokenManager.java

@@ -19,7 +19,7 @@ public class TokenManager {
 	/**
 	 * 获取当前登录的用户User对象
 	 * 
-	 * @return
+	 * @return
 	 */
 	public static AftUser getToken() {
 		return (AftUser) SecurityUtils.getSubject().getPrincipal();
@@ -51,6 +51,10 @@ public class TokenManager {
 	public static Session getSession() {
 		return SecurityUtils.getSubject().getSession();
 	}
+	
+	public static  void deleteSession(String str) {
+		getSession().removeAttribute(str);
+	}
 
 	/**
 	 * 获取当前用户ID

+ 13 - 7
src/main/java/com/goafanti/core/websocket/SystemWebSocketHandler.java

@@ -4,6 +4,7 @@ import java.io.IOException;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
+import org.springframework.stereotype.Service;
 import org.springframework.web.socket.CloseStatus;
 import org.springframework.web.socket.TextMessage;
 import org.springframework.web.socket.WebSocketHandler;
@@ -12,17 +13,20 @@ import org.springframework.web.socket.WebSocketSession;
 
 import com.goafanti.common.utils.LoggerUtils;
 
+@Service
 public class SystemWebSocketHandler implements WebSocketHandler {
+	
 
-	private static final Map<Long, WebSocketSession> users = new ConcurrentHashMap<>();
+	private static final Map<String, WebSocketSession> users = new ConcurrentHashMap<>();
+	
 
 	@Override
 	public void afterConnectionEstablished(WebSocketSession session) throws Exception {
-		Long userId = (Long) session.getAttributes().get(Constants.WEBSOCKET_USERNAME);
+		String userId = (String) session.getAttributes().get(Constants.WEBSOCKET_USERNAME);
 		if (userId != null) {
 			users.put(userId, session);
-			LoggerUtils.debug(getClass(), "添加用户websocket:" + userId);
 		}
+		LoggerUtils.debug(getClass(), "添加用户websocket:" + userId);
 	}
 
 	@Override
@@ -36,13 +40,15 @@ public class SystemWebSocketHandler implements WebSocketHandler {
 		if (session.isOpen()) {
 			session.close();
 		}
-		LoggerUtils.debug(getClass(), "websocket: " + users.remove(session) + "关闭");
+		users.remove(session);
+		LoggerUtils.debug(getClass(), "websocket: error");
 	}
 
 	@SuppressWarnings("unlikely-arg-type")
 	@Override
 	public void afterConnectionClosed(WebSocketSession session, CloseStatus closeStatus) throws Exception {
-		LoggerUtils.debug(getClass(), "websocket: " + users.remove(session) + "关闭");
+		users.remove(session);
+		LoggerUtils.debug(getClass(), "websocket: close");
 	}
 
 	@Override
@@ -56,7 +62,7 @@ public class SystemWebSocketHandler implements WebSocketHandler {
 	 * @param message
 	 */
 	public void sendMessageToUsers(TextMessage message) {
-		for (Long userId : users.keySet()) {
+		for (String userId : users.keySet()) {
 			WebSocketSession user = users.get(userId);
 			try {
 				if (user.isOpen()) {
@@ -74,7 +80,7 @@ public class SystemWebSocketHandler implements WebSocketHandler {
 	 * @param userId
 	 * @param message
 	 */
-	public void sendMessageToUser(Long userId, TextMessage message) {
+	public void sendMessageToUser(String userId, TextMessage message) {
 		WebSocketSession user = users.get(userId);
 		if (user != null) {
 			try {

+ 6 - 5
src/main/java/com/goafanti/core/websocket/WebSocketConfig.java

@@ -1,5 +1,6 @@
 package com.goafanti.core.websocket;
 
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.web.servlet.config.annotation.EnableWebMvc;
@@ -14,14 +15,14 @@ import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry
 public class WebSocketConfig extends WebMvcConfigurerAdapter implements WebSocketConfigurer {
 	@Autowired
 	SystemWebSocketHandler systemWebSocketHandler;
+	
+	
 
 	@Override
 	public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
-		registry.addHandler(systemWebSocketHandler, "/webSocketServer")
-				.addInterceptors(new WebSocketHandshakeInterceptor());
-
-		registry.addHandler(systemWebSocketHandler, "/sockjs/webSocketServer").setAllowedOrigins("*")
-				.addInterceptors(new WebSocketHandshakeInterceptor()).withSockJS();
+		registry.addHandler(systemWebSocketHandler, "/webSocketServer").addInterceptors(new WebSocketHandshakeInterceptor()).setAllowedOrigins("*");
+//		registry.addHandler(systemWebSocketHandler, "/sockjs/webSocketServer").setAllowedOrigins("*")
+//				.addInterceptors(new WebSocketHandshakeInterceptor()).withSockJS();
 	}
 
 }

+ 5 - 2
src/main/java/com/goafanti/core/websocket/WebSocketHandshakeInterceptor.java

@@ -17,12 +17,15 @@ public class WebSocketHandshakeInterceptor implements HandshakeInterceptor {
 	@Override
 	public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler,
 			Map<String, Object> attributes) throws Exception {
+		System.out.println("beforeHandshake");
 		if (request instanceof ServletServerHttpRequest) {
 			ServletServerHttpRequest servletRequest = (ServletServerHttpRequest) request;
 			HttpSession session = servletRequest.getServletRequest().getSession(false);
+			String id = TokenManager.getAdminId();
+			System.out.println("Websocket:用户[ID:" + id + "]握手成功");
 			if (session != null && TokenManager.isLogin()) {
 				// 使用TokenManager.getUserId区分WebSocketHandler,以便定向发送消息
-				attributes.put(Constants.WEBSOCKET_USERNAME, TokenManager.getUserId());
+				attributes.put(Constants.WEBSOCKET_USERNAME, id);
 				return true;
 			}
 		}
@@ -32,6 +35,6 @@ public class WebSocketHandshakeInterceptor implements HandshakeInterceptor {
 	@Override
 	public void afterHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler,
 			Exception exception) {
-
+		System.out.println("After handshake");
 	}
 }

+ 0 - 1
src/main/java/com/goafanti/customer/bo/FollowBusinessBo.java

@@ -1,6 +1,5 @@
 package com.goafanti.customer.bo;
 
-import java.util.Date;
 import java.util.List;
 
 /**

+ 0 - 1
src/main/java/com/goafanti/customer/service/CustomerService.java

@@ -29,7 +29,6 @@ import com.goafanti.customer.bo.InputListChannel;
 import com.goafanti.customer.bo.LockingReleaseBo;
 import com.goafanti.customer.bo.StatisticBo;
 import com.goafanti.customer.bo.transferListBo;
-import com.goafanti.user.bo.OutUserChannel;
 
 public interface CustomerService {
 	/**

+ 0 - 1
src/main/java/com/goafanti/order/bo/OrderListBo.java

@@ -3,7 +3,6 @@ package com.goafanti.order.bo;
 import java.math.BigDecimal;
 
 import com.goafanti.common.utils.excel.Excel;
-import com.goafanti.common.utils.excel.Excel.ColumnType;
 
 
 /**

+ 16 - 0
src/main/java/com/goafanti/order/bo/Outproject.java

@@ -6,4 +6,20 @@ public class Outproject {
 	
 	private String name;
 
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
 }

+ 0 - 9
src/main/java/com/goafanti/order/controller/FundManagerOrderApiController.java

@@ -1,18 +1,9 @@
 package com.goafanti.order.controller;
 
-import java.io.IOException;
-import java.io.OutputStream;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.util.Date;
 
 import javax.annotation.Resource;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.poi.xssf.usermodel.XSSFCell;
-import org.apache.poi.xssf.usermodel.XSSFRow;
-import org.apache.poi.xssf.usermodel.XSSFSheet;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;

+ 0 - 2
src/main/java/com/goafanti/order/service/OrderNewService.java

@@ -1,6 +1,5 @@
 package com.goafanti.order.service;
 
-import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.util.List;
 
@@ -8,7 +7,6 @@ import javax.mail.MessagingException;
 import javax.servlet.http.HttpServletResponse;
 
 
-import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.TOrderDun;
 import com.goafanti.common.model.TOrderNew;
 import com.goafanti.common.model.TOrderNewWithBLOBs;

+ 0 - 1
src/main/java/com/goafanti/order/service/impl/FundManagerOrderServiceImpl.java

@@ -44,7 +44,6 @@ import com.goafanti.common.model.TOrderRefund;
 import com.goafanti.common.model.TOrderTask;
 import com.goafanti.common.utils.AsyncUtils;
 import com.goafanti.common.utils.LoggerUtils;
-import com.goafanti.common.utils.SendEmailUtil;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;

+ 0 - 3
src/main/java/com/goafanti/order/service/impl/OrderBillServiceImpl.java

@@ -6,7 +6,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -17,8 +16,6 @@ import com.goafanti.common.dao.TOrderBillNewMapper;
 import com.goafanti.common.dao.TOrderNewMapper;
 import com.goafanti.common.model.TOrderBillNew;
 import com.goafanti.common.model.TOrderNew;
-import com.goafanti.common.utils.ExportExcelUtil;
-import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;

+ 1 - 0
src/main/java/com/goafanti/order/service/impl/OrderInvoiceServiceImpl.java

@@ -87,6 +87,7 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
 		orderNewService.pushGeneralSendNoticeAndEmail(aids, NoticeStatus.ORDER_INVPICE_START.getCode(),o.getOrderNo(), TokenManager.getAdminId(),0);
 	}
 
+	@SuppressWarnings("deprecation")
 	@Override
 	public boolean checkAmount(TOrderInvoice t) {
 		TOrderNew tn=tOrderNewMapper.selectByPrimaryKey(t.getOrderNo());

+ 1 - 0
src/main/java/com/goafanti/order/service/impl/OrderReceivablesServiceImpl.java

@@ -122,6 +122,7 @@ public class OrderReceivablesServiceImpl extends BaseMybatisDao<TemporaryReceiva
 	public int deleteAllReceivables() {
 		return temporaryReceivablesMapper.deleteByaid(TokenManager.getAdminId());
 	}
+	@SuppressWarnings("deprecation")
 	@Override
 	public int batchImport() {
 		List<TemporaryReceivables> list=temporaryReceivablesMapper.selectByaid(TokenManager.getAdminId());

+ 1 - 0
src/main/java/com/goafanti/organization/bo/ThirdPartyError.java

@@ -32,6 +32,7 @@ public enum ThirdPartyError {
 
 	
 
+	@SuppressWarnings("unlikely-arg-type")
 	public static boolean containsType(Integer code) {
 		return status.containsKey(code);
 	}

+ 0 - 2
src/main/java/com/goafanti/organization/service/ThirdPartyCompanyService.java

@@ -1,10 +1,8 @@
 package com.goafanti.organization.service;
 
-import java.io.IOException;
 import java.util.List;
 import java.util.Map;
 
-import javax.servlet.http.HttpServletResponse;
 
 import com.goafanti.common.model.CompanyLibrary;
 import com.goafanti.common.model.OfficialFeePrice;

+ 0 - 1
src/main/java/com/goafanti/permission/controller/NewPermissionApiController.java

@@ -8,7 +8,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
 import com.goafanti.common.bo.Result;
-import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.BaseApiController;
 import com.goafanti.common.dao.PermissionMapper;

+ 0 - 1
src/main/java/com/goafanti/permission/service/impl/NewRoleServiceImpl.java

@@ -39,7 +39,6 @@ import com.goafanti.common.model.Role;
 import com.goafanti.common.model.RolePermission;
 import com.goafanti.common.model.RoleResources;
 import com.goafanti.common.model.UserRole;
-import com.goafanti.common.model.UserTransferLog;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;

+ 0 - 1
src/main/java/com/goafanti/permission/service/impl/PermissionServiceImpl.java

@@ -10,7 +10,6 @@ import java.util.Set;
 import java.util.UUID;
 
 import org.apache.commons.beanutils.BeanUtils;
-import org.apache.shiro.util.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 

+ 0 - 1
src/main/java/com/goafanti/personnel/bo/PersonnelContractBo.java

@@ -1,6 +1,5 @@
 package com.goafanti.personnel.bo;
 
-import java.util.Date;
 
 import com.goafanti.common.model.PersonnelContract;
 

+ 5 - 0
src/main/java/com/goafanti/user/bo/OrgIdentityDetailAdmin.java

@@ -3,6 +3,11 @@ package com.goafanti.user.bo;
 import com.goafanti.common.model.OrganizationIdentity;
 
 public class OrgIdentityDetailAdmin extends OrganizationIdentity {
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
 	private String level;
 	
 	private String ratepayId;

+ 4 - 0
src/main/java/com/goafanti/user/bo/OrganizationIndentityUserBo.java

@@ -3,6 +3,10 @@ package com.goafanti.user.bo;
 import com.goafanti.common.model.OrganizationIdentity;
 
 public class OrganizationIndentityUserBo extends OrganizationIdentity{
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
 	private String ratepayId;
 
 	public String getRatepayId() {

+ 0 - 1
src/main/java/com/goafanti/user/controller/UserChannelApiController.java

@@ -20,7 +20,6 @@ import com.goafanti.common.enums.AttachmentType;
 import com.goafanti.common.model.Attachment;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.common.utils.excel.NewExcelUtil;
-import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.user.bo.InputUserChannel;
 import com.goafanti.user.bo.OutUserChannel;
 import com.goafanti.user.service.UserChannelService;

+ 7 - 4
src/main/java/com/goafanti/user/service/impl/UserChannelServiceImpl.java

@@ -37,6 +37,7 @@ import com.goafanti.common.enums.ChannelStatus;
 import com.goafanti.common.enums.SocietyTag;
 import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.User;
+import com.goafanti.common.model.UserChannel;
 import com.goafanti.common.utils.ExcelUtils;
 import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.common.utils.PasswordUtil;
@@ -214,8 +215,9 @@ public class UserChannelServiceImpl extends BaseMybatisDao<UserChannelMapper> im
     			in.setStatus(ChannelStatus.WFP.getCode());
     			list.add(in);
     		}else {
+    			//判断是自己的客户还是别人的,渠道不用此做判断
     			Integer i=0;
-    			if (u.getAid()!=null&&u.getAid().equals(TokenManager.getAdminId())) {
+    			if (u.getAid()!=null&&u.getAid().equals(aid)) {
     				i=1;
     			}
 //    			共享类型 0-私有 1-公共 2 签单 
@@ -223,9 +225,10 @@ public class UserChannelServiceImpl extends BaseMybatisDao<UserChannelMapper> im
     				if(u.getChannel()==0) {
     					if(i==1)in.setStatus(ChannelStatus.YCZWDSY.getCode());
     					else in.setStatus(ChannelStatus.YCZBRSY.getCode());
-    				}
-    				else {
-    					if(i==1)in.setStatus(ChannelStatus.YCZWDQD.getCode());
+    				}else {
+    					UserChannel uc=userChannelMapper.selectByUid(u.getId());
+    					if(uc.getAid().equals(aid))
+    					in.setStatus(ChannelStatus.YCZWDQD.getCode());
     					else in.setStatus(ChannelStatus.YCZBRQD.getCode());
     				}
     			}

+ 0 - 1
src/main/java/com/goafanti/user/service/impl/UserServiceImpl.java

@@ -1,7 +1,6 @@
 package com.goafanti.user.service.impl;
 
 import java.text.ParseException;
-import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;

+ 1 - 1
src/main/resources/applicationContext.xml

@@ -20,5 +20,5 @@
 	<import resource="classpath:spring/spring-shiro.xml" />
 	<import resource="classpath:spring/spring-mvc.xml" />
 	<import resource="classpath:spring/spring-task.xml" />
-
+	<import resource="classpath:spring/spring-websocket.xml" />
 </beans>

+ 6 - 6
src/main/resources/props/config_local.properties

@@ -1,13 +1,13 @@
 #Driver
 jdbc.driverClassName=com.mysql.jdbc.Driver
 #本地
-jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-jdbc.username=root
-jdbc.password=123456
-#测试
-#jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+#jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 #jdbc.username=root
-#jdbc.password=aftdev
+#jdbc.password=123456
+#测试
+jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+jdbc.username=root
+jdbc.password=aftdev
 #\u68c0\u6d4b\u6570\u636e\u5e93\u94fe\u63a5\u662f\u5426\u6709\u6548\uff0c\u5fc5\u987b\u914d\u7f6e
 jdbc.validationQuery=SELECT 'x'
 #\u521d\u59cb\u8fde\u63a5\u6570

+ 1 - 1
src/main/resources/props/config_test.properties

@@ -65,7 +65,7 @@ avatar.host=//static.jishutao.com
 avatar.upload.host=//static.jishutao.com/upload
 
 wx.appId=wxff2f5720ed7d7f63
-wx.appSecret=9c9912bdd381f2a412a23dd560c2f77e
+wx.appSecret=081744369d42405be58fe37f892631f7
 
 upload.path=/data/static/public/upload
 upload.private.path=/data/static/private/upload

+ 1 - 0
src/main/resources/shiro_base_auth.ini

@@ -12,6 +12,7 @@
 /signin=anon
 /managesignin=anon
 /register=anon
+/webSocketServer=anon
 /mregister=anon
 /open/**=anon
 /favicon.ico=anon

+ 8 - 2
src/main/resources/spring/spring-mvc.xml

@@ -10,7 +10,9 @@
 	http://www.springframework.org/schema/task
 	http://www.springframework.org/schema/task/spring-task-4.0.xsd
 	http://www.springframework.org/schema/mvc 
-	http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd">
+	http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
+	http://www.springframework.org/schema/websocket
+    http://www.springframework.org/schema/websocket/spring-websocket.xsd">
 
 	<!-- Scan controller -->
 		
@@ -18,6 +20,8 @@
 		base-package="com.goafanti.*.controller;com.goafanti.*.*.controller;com.goafanti.common.task;com.goafanti.common.utils;
 		com.goafanti.core.websocket" />
 		
+		
+	
 
 
 	<bean name="springContextUtils" class="com.goafanti.common.utils.SpringContextUtils" scope="singleton"></bean>
@@ -147,6 +151,8 @@
 	<bean id="shiroFilterUtils" class="com.goafanti.core.shiro.filter.ShiroFilterUtils" scope="singleton">
 		<property name="appName" value="${app.name}" />
 	</bean>
-	<bean id="systemWebSocketHandler" class="com.goafanti.core.websocket.SystemWebSocketHandler" scope="singleton"></bean>
+	
+	
+	
 	
 </beans>

+ 71 - 31
src/main/resources/spring/spring-shiro.xml

@@ -1,7 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <beans xmlns="http://www.springframework.org/schema/beans"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
-	xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:aop="http://www.springframework.org/schema/aop"
+	xmlns:tx="http://www.springframework.org/schema/tx"
+	xmlns:util="http://www.springframework.org/schema/util"
 	xmlns:context="http://www.springframework.org/schema/context"
 	xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
@@ -10,11 +12,26 @@
        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd">
 
-	<bean id="jedisPoolConfig" class="redis.clients.jedis.JedisPoolConfig">
+	<bean id="jedisPoolConfig"
+		class="redis.clients.jedis.JedisPoolConfig">
 		<property name="maxIdle" value="100" />
 		<property name="minIdle" value="10" />
 		<property name="testOnBorrow" value="true" />
 	</bean>
+	  <bean id="poolConfig" class="org.apache.commons.pool2.impl.GenericObjectPoolConfig">
+        <property name="minIdle" value="5"/>
+        <property name="maxIdle" value="20"/>
+        <property name="maxWaitMillis" value="100000"/>
+        <property name="maxTotal" value="10000"/>
+    </bean>
+	
+	 <bean id="jedisPool" class="redis.clients.jedis.JedisPool">
+        <constructor-arg name="poolConfig" ref="poolConfig"/>
+        <constructor-arg name="host" value="${jedis.host}"/>
+        <constructor-arg name="port" value="${jedis.port}"/>
+        <constructor-arg name="password" value="${jedis.password}"/>
+        <constructor-arg name="timeout" value="1000000"/>
+    </bean>
 
 	<bean id="redisConnectionFactory"
 		class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory">
@@ -26,37 +43,45 @@
 		<!-- <property name="database" value="${jedis.dbIndex}" /> -->
 	</bean>
 
-	<bean id="redisTemplate" class="com.goafanti.core.cache.template.FastJsonRedisTemplate">
-		<constructor-arg index="0" ref="redisConnectionFactory" />
+	<bean id="redisTemplate"
+		class="com.goafanti.core.cache.template.FastJsonRedisTemplate">
+		<constructor-arg index="0"
+			ref="redisConnectionFactory" />
 	</bean>
-	<bean id="sessionRedisTemplate" class="com.goafanti.core.shiro.cache.template.SessionRedisTemplate">
-		<constructor-arg index="0" ref="redisConnectionFactory" />
+	<bean id="sessionRedisTemplate"
+		class="com.goafanti.core.shiro.cache.template.SessionRedisTemplate">
+		<constructor-arg index="0"
+			ref="redisConnectionFactory" />
 	</bean>
-	
-	<bean id="cacheManager" class="org.springframework.data.redis.cache.RedisCacheManager">
+
+	<bean id="cacheManager"
+		class="org.springframework.data.redis.cache.RedisCacheManager">
 		<constructor-arg index="0" ref="redisTemplate" />
-		<property name="defaultExpiration" value="86400" />		
+		<property name="defaultExpiration" value="86400" />
 	</bean>
-	
-	<bean id="shrioRedisCacheManager" class="com.goafanti.core.shiro.cache.ShiroRedisCacheManager">
+
+	<bean id="shrioRedisCacheManager"
+		class="com.goafanti.core.shiro.cache.ShiroRedisCacheManager">
 		<property name="redisTemplate" ref="sessionRedisTemplate" />
 		<property name="expire" value="2592000" />
 	</bean>
-	
 
-      
+
+
 
 	<bean id="sessionIdGenerator"
 		class="org.apache.shiro.session.mgt.eis.JavaUuidSessionIdGenerator" />
 
-	<bean id="sessionIdCookie" class="org.apache.shiro.web.servlet.SimpleCookie">
+	<bean id="sessionIdCookie"
+		class="org.apache.shiro.web.servlet.SimpleCookie">
 		<constructor-arg value="AFT_SID" />
 		<property name="httpOnly" value="true" />
 		<property name="maxAge" value="2592000" />
 		<!-- <property name="domain" value=""/> -->
 	</bean>
 
-	<bean id="customSessionListener" class="com.goafanti.core.shiro.listener.CustomSessionListener">
+	<bean id="customSessionListener"
+		class="com.goafanti.core.shiro.listener.CustomSessionListener">
 		<property name="redisTemplate" ref="sessionRedisTemplate" />
 	</bean>
 
@@ -69,11 +94,13 @@
 	<bean id="sessionValidationScheduler"
 		class="org.apache.shiro.session.mgt.ExecutorServiceSessionValidationScheduler">
 		<!-- -->
-		<property name="interval" value="${session.validate.timespan}" />
+		<property name="interval"
+			value="${session.validate.timespan}" />
 		<property name="sessionManager" ref="sessionManager" />
 	</bean>
 	<!-- -->
-	<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
+	<bean id="securityManager"
+		class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
 		<property name="realm" ref="userRealm" />
 		<property name="sessionManager" ref="sessionManager" />
 		<property name="cacheManager" ref="shrioRedisCacheManager" />
@@ -87,17 +114,21 @@
 	<!-- credential matcher -->
 	<bean id="credentialsMatcher"
 		class="org.apache.shiro.authc.credential.HashedCredentialsMatcher">
-		<property name="hashAlgorithmName" value="${pwd.hash_algorithm_name}" />
-		<property name="hashIterations" value="${pwd.hash_iterations}" />
+		<property name="hashAlgorithmName"
+			value="${pwd.hash_algorithm_name}" />
+		<property name="hashIterations"
+			value="${pwd.hash_iterations}" />
 		<property name="storedCredentialsHexEncoded" value="true" />
 	</bean>
 	<!-- -->
-	<bean id="userRealm" class="com.goafanti.core.shiro.token.UserRealm">
+	<bean id="userRealm"
+		class="com.goafanti.core.shiro.token.UserRealm">
 		<property name="credentialsMatcher" ref="credentialsMatcher" />
 	</bean>
 
 	<!-- Session Manager -->
-	<bean id="sessionManager" class="com.goafanti.core.shiro.session.CustomSessionManager">
+	<bean id="sessionManager"
+		class="com.goafanti.core.shiro.session.CustomSessionManager">
 		<!-- class="org.apache.shiro.web.session.mgt.DefaultWebSessionManager"> -->
 		<property name="sessionIdUrlRewritingEnabled" value="false" />
 		<!-- -->
@@ -113,35 +144,43 @@
 			</list>
 		</property>
 		<!-- -->
-		<property name="sessionValidationScheduler" ref="sessionValidationScheduler" />
+		<property name="sessionValidationScheduler"
+			ref="sessionValidationScheduler" />
 		<!-- -->
-		<property name="sessionValidationSchedulerEnabled" value="true" />
+		<property name="sessionValidationSchedulerEnabled"
+			value="true" />
 		<!-- -->
 		<property name="deleteInvalidSessions" value="true" />
 		<!-- -->
 		<property name="sessionIdCookie" ref="sessionIdCookie" />
 	</bean>
 
-	<bean id="shiroManager" class="com.goafanti.core.shiro.service.impl.ShiroManagerImpl" />
+	<bean id="shiroManager"
+		class="com.goafanti.core.shiro.service.impl.ShiroManagerImpl" />
 
-	<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
+	<bean id="shiroFilter"
+		class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
 		<property name="securityManager" ref="securityManager" />
 		<property name="loginUrl" value="/user/login" />
 		<property name="successUrl" value="/" />
 		<property name="unauthorizedUrl" value="/user/login" />
-		<property name="filterChainDefinitions" value="#{shiroManager.loadFilterChainDefinitions()}" />
+		<property name="filterChainDefinitions"
+			value="#{shiroManager.loadFilterChainDefinitions()}" />
 		<property name="filters">
 			<util:map>
 				<entry key="login">
-					<bean id="login" class="com.goafanti.core.shiro.filter.LoginFilter" />
+					<bean id="login"
+						class="com.goafanti.core.shiro.filter.LoginFilter" />
 				</entry>
 				<entry key="permission">
-					<bean id="permission" class="com.goafanti.core.shiro.filter.PermissionFilter">
+					<bean id="permission"
+						class="com.goafanti.core.shiro.filter.PermissionFilter">
 						<property name="loginUrl" value="/admin/login" />
 					</bean>
 				</entry>
 				<entry key="admin">
-					<bean id="admin" class="com.goafanti.core.shiro.filter.AdminFilter">
+					<bean id="admin"
+						class="com.goafanti.core.shiro.filter.AdminFilter">
 						<property name="loginUrl" value="/admin/login" />
 					</bean>
 				</entry>
@@ -149,5 +188,6 @@
 		</property>
 	</bean>
 	<!-- -->
-	<bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor" />
+	<bean id="lifecycleBeanPostProcessor"
+		class="org.apache.shiro.spring.LifecycleBeanPostProcessor" />
 </beans>

+ 25 - 0
src/main/resources/spring/spring-websocket.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:mvc="http://www.springframework.org/schema/mvc"
+       xmlns:websocket="http://www.springframework.org/schema/websocket"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://www.springframework.org/schema/mvc
+        http://www.springframework.org/schema/mvc/spring-mvc.xsd
+        http://www.springframework.org/schema/websocket
+        http://www.springframework.org/schema/websocket/spring-websocket.xsd">
+        
+    <!--配置 webSocket-->
+    <bean id="systemWebSocketHandler" class="com.goafanti.core.websocket.SystemWebSocketHandler" scope="singleton"></bean>
+    
+    <websocket:handlers allowed-origins="*">
+        <!--指定 webSocket 地址-->
+        <websocket:mapping path="/webSocketServer" handler="systemWebSocketHandler"/>
+        <!-- 过滤器 -->
+         <websocket:handshake-interceptors>
+        	<bean class="com.goafanti.core.websocket.WebSocketHandshakeInterceptor"/>
+        </websocket:handshake-interceptors>  
+    </websocket:handlers>
+ 
+</beans>

+ 65 - 0
src/main/webapp/WEB-INF/views/portal/websocket.html

@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
+
+
+<head>
+	<style type="text/css">
+		div
+			{
+				border:2px dashed #000000
+			}
+	</style>
+
+	<script type="text/javascript">
+
+	</script>
+</head>
+
+<body>
+	<h1>Rumia chat room</h1>
+	
+	<div>
+		<p id="talked"></p>
+	</div>
+	<br>
+	<div>
+		<input type="text" id="say">
+		<button onclick="sendData()">SAY</button>
+	</div>
+	
+	
+
+	<script type="text/javascript">
+
+		var ws = new WebSocket("ws://" + window.location.host + "/webSocketServer");
+
+		function sendData()
+		{
+			var msg = document.getElementById("say").value;
+			ws.send(msg);
+		}
+
+		ws.onopen = function(evt)
+		{ 
+			console.log("Connection open ..."); 
+		};
+
+		ws.onmessage = function(evt)
+		{
+			console.log("Received Message: " + evt.data);
+			document.getElementById("talked").innerHTML = document.getElementById("talked").innerHTML + "<br>" + evt.data;
+		};
+
+		ws.onclose = function(evt)
+		{
+			console.log("Connection closed.");
+		};
+
+		ws.onerror = function(evt)
+		{
+			console.log("error!!!"); 
+		};
+
+	</script>
+
+</body>