Browse Source

增加报警

yjj 4 years ago
parent
commit
3d1f3d185e

+ 43 - 13
shiwan/face/face.iml

@@ -1,6 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
   <component name="FacetManager">
+    <facet type="jpa" name="JPA">
+      <configuration>
+        <setting name="validation-enabled" value="true" />
+        <setting name="provider-name" value="Hibernate" />
+        <datasource-mapping>
+          <factory-entry name="entityManagerFactory" />
+        </datasource-mapping>
+        <naming-strategy-map />
+      </configuration>
+    </facet>
     <facet type="Spring" name="Spring">
       <configuration />
     </facet>
@@ -10,19 +20,11 @@
         <sourceRoots>
           <root url="file://$MODULE_DIR$/src/main/java" />
           <root url="file://$MODULE_DIR$/src/main/resources" />
+          <root url="file://$MODULE_DIR$/../src/main/java" />
+          <root url="file://$MODULE_DIR$/../src/main/resources" />
         </sourceRoots>
       </configuration>
     </facet>
-    <facet type="jpa" name="JPA">
-      <configuration>
-        <setting name="validation-enabled" value="true" />
-        <setting name="provider-name" value="Hibernate" />
-        <datasource-mapping>
-          <factory-entry name="entityManagerFactory" value="33699a44-0673-4955-928d-c9a60d98b222" />
-        </datasource-mapping>
-        <naming-strategy-map />
-      </configuration>
-    </facet>
   </component>
   <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
     <output url="file://$MODULE_DIR$/target/classes" />
@@ -33,6 +35,15 @@
       <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
       <excludeFolder url="file://$MODULE_DIR$/target" />
     </content>
+    <content url="file://$MODULE_DIR$/../src/main/java">
+      <sourceFolder url="file://$MODULE_DIR$/../src/main/java" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../src/main/resources">
+      <sourceFolder url="file://$MODULE_DIR$/../src/main/resources" type="java-resource" />
+    </content>
+    <content url="file://$MODULE_DIR$/../src/test/java">
+      <sourceFolder url="file://$MODULE_DIR$/../src/test/java" isTestSource="true" />
+    </content>
     <orderEntry type="inheritedJdk" />
     <orderEntry type="sourceFolder" forTests="false" />
     <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.4.1" level="project" />
@@ -46,7 +57,6 @@
     <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.13.3" level="project" />
     <orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.30" level="project" />
     <orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
-    <orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.27" level="project" />
     <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.4.1" level="project" />
     <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.11.3" level="project" />
     <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.11.3" level="project" />
@@ -58,8 +68,6 @@
     <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.41" level="project" />
     <orderEntry type="library" name="Maven: org.glassfish:jakarta.el:3.0.3" level="project" />
     <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.41" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-web:5.3.2" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-beans:5.3.2" level="project" />
     <orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.3.2" level="project" />
     <orderEntry type="library" name="Maven: org.springframework:spring-aop:5.3.2" level="project" />
     <orderEntry type="library" name="Maven: org.springframework:spring-context:5.3.2" level="project" />
@@ -123,5 +131,27 @@
     <orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.16" level="project" />
     <orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.24" level="project" />
     <orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.16" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.testng:testng:7.3.0" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: com.beust:jcommander:1.78" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.apache.ant:ant:1.10.3" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.apache.ant:ant-launcher:1.10.3" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: com.google.inject:guice:no_aop:4.2.2" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: javax.inject:javax.inject:1" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: aopalliance:aopalliance:1.0" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: com.google.guava:guava:25.1-android" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.checkerframework:checker-compat-qual:2.0.0" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: com.google.errorprone:error_prone_annotations:2.1.3" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: com.google.j2objc:j2objc-annotations:1.1" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.codehaus.mojo:animal-sniffer-annotations:1.14" level="project" />
+    <orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.27" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-web:5.3.2" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-beans:5.3.2" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.13.1" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:2.2" level="project" />
+    <orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.2" level="project" />
+    <orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:1.3.2" level="project" />
+    <orderEntry type="library" name="Maven: org.mybatis:mybatis:3.4.6" level="project" />
+    <orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:1.3.2" level="project" />
   </component>
 </module>

+ 34 - 0
shiwan/face/pom.xml

@@ -29,16 +29,19 @@
             <artifactId>spring-boot-starter-test</artifactId>
             <scope>test</scope>
         </dependency>
+
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-data-jpa</artifactId>
             <version>2.3.1.RELEASE</version>
         </dependency>
+
         <dependency>
             <groupId>mysql</groupId>
             <artifactId>mysql-connector-java</artifactId>
             <version>8.0.16</version>
         </dependency>
+
         <dependency>
             <groupId>com.alibaba</groupId>
             <artifactId>fastjson</artifactId>
@@ -49,6 +52,32 @@
             <groupId>org.projectlombok</groupId>
             <artifactId>lombok</artifactId>
         </dependency>
+
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+            <version>RELEASE</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-web</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.mybatis.spring.boot</groupId>
+            <artifactId>mybatis-spring-boot-starter</artifactId>
+            <version>1.3.2</version>
+        </dependency>
+
+
     </dependencies>
 
     <build>
@@ -60,4 +89,9 @@
         </plugins>
     </build>
 
+
+
+
+
+
 </project>

+ 1 - 0
shiwan/face/src/main/java/com/huimv/face/FaceApplication.java

@@ -8,6 +8,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
 @EnableScheduling
 public class FaceApplication {
 
+
     public static void main(String[] args) {
         SpringApplication.run(FaceApplication.class, args);
     }

+ 11 - 0
shiwan/face/src/main/java/com/huimv/face/controller/FaceUserController.java

@@ -1,7 +1,9 @@
 package com.huimv.face.controller;
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.huimv.face.domain.*;
+import com.huimv.face.repo.FaceUserImgRepository;
 import com.huimv.face.result.Result;
 import com.huimv.face.service.*;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -162,6 +164,7 @@ public class FaceUserController {
 
     }
 
+
     @PostMapping("/findFaceUserByName")
     public  Result findFaceUserByName(String userName){
         return faceUserService.findFaceUserByName(userName);
@@ -172,4 +175,12 @@ public class FaceUserController {
         return faceUserImgsService.upload(ID,XM,USERID,file);
     }
 
+    @Autowired
+    FaceUserImgRepository faceUserImgRepository;
+
+    @RequestMapping(value = "/alarm", method = RequestMethod.GET)
+    public JSONObject listUser() {
+
+        return   faceUserImgsService.findAlam();
+    }
 }

+ 363 - 0
shiwan/face/src/main/java/com/huimv/face/domain/XtHkbjgzxx.java

@@ -0,0 +1,363 @@
+package com.huimv.face.domain;
+
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+@Component
+public class XtHkbjgzxx  {
+    /**
+     * This field was generated by Apache iBATIS ibator.
+     * This field corresponds to the database column xt_hkbj_gzxx.ID
+     *
+     * @ibatorgenerated Tue Aug 27 13:06:53 CST 2019
+     */
+    private Integer id;
+
+    /**
+     * This field was generated by Apache iBATIS ibator.
+     * This field corresponds to the database column xt_hkbj_gzxx.JQID
+     *
+     * @ibatorgenerated Tue Aug 27 13:06:53 CST 2019
+     */
+    private String jqid;
+
+    /**
+     * This field was generated by Apache iBATIS ibator.
+     * This field corresponds to the database column xt_hkbj_gzxx.GZLX
+     *
+     * @ibatorgenerated Tue Aug 27 13:06:53 CST 2019
+     */
+    private String gzlx;
+
+    /**
+     * This field was generated by Apache iBATIS ibator.
+     * This field corresponds to the database column xt_hkbj_gzxx.FSSJ
+     *
+     * @ibatorgenerated Tue Aug 27 13:06:53 CST 2019
+     */
+    private Date fssj;
+
+    /**
+     * This field was generated by Apache iBATIS ibator.
+     * This field corresponds to the database column xt_hkbj_gzxx.JSSJ
+     *
+     * @ibatorgenerated Tue Aug 27 13:06:53 CST 2019
+     */
+    private Date jssj;
+
+    /**
+     * This field was generated by Apache iBATIS ibator.
+     * This field corresponds to the database column xt_hkbj_gzxx.SBLX
+     *
+     * @ibatorgenerated Tue Aug 27 13:06:53 CST 2019
+     */
+    private String sblx;
+
+    /**
+     * This field was generated by Apache iBATIS ibator.
+     * This field corresponds to the database column xt_hkbj_gzxx.SBXH
+     *
+     * @ibatorgenerated Tue Aug 27 13:06:53 CST 2019
+     */
+    private String sbxh;
+
+    /**
+     * This field was generated by Apache iBATIS ibator.
+     * This field corresponds to the database column xt_hkbj_gzxx.UUID
+     *
+     * @ibatorgenerated Tue Aug 27 13:06:53 CST 2019
+     */
+    private String uuid;
+
+    /**
+     * This field was generated by Apache iBATIS ibator.
+     * This field corresponds to the database column xt_hkbj_gzxx.TXBZ
+     *
+     * @ibatorgenerated Tue Aug 27 13:06:53 CST 2019
+     */
+    private Integer txbz;
+
+    /**
+     * This method was generated by Apache iBATIS ibator.
+     * This method returns the value of the database column xt_hkbj_gzxx.ID
+     *
+     * @return the value of xt_hkbj_gzxx.ID
+     *
+     * @ibatorgenerated Tue Aug 27 13:06:53 CST 2019
+     */
+    public Integer getId() {
+        return id;
+    }
+
+    /**
+     * This method was generated by Apache iBATIS ibator.
+     * This method sets the value of the database column xt_hkbj_gzxx.ID
+     *
+     * @param id the value for xt_hkbj_gzxx.ID
+     *
+     * @ibatorgenerated Tue Aug 27 13:06:53 CST 2019
+     */
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    /**
+     * This method was generated by Apache iBATIS ibator.
+     * This method returns the value of the database column xt_hkbj_gzxx.JQID
+     *
+     * @return the value of xt_hkbj_gzxx.JQID
+     *
+     * @ibatorgenerated Tue Aug 27 13:06:53 CST 2019
+     */
+    public String getJqid() {
+        return jqid;
+    }
+
+    /**
+     * This method was generated by Apache iBATIS ibator.
+     * This method sets the value of the database column xt_hkbj_gzxx.JQID
+     *
+     * @param jqid the value for xt_hkbj_gzxx.JQID
+     *
+     * @ibatorgenerated Tue Aug 27 13:06:53 CST 2019
+     */
+    public void setJqid(String jqid) {
+        this.jqid = jqid == null ? null : jqid.trim();
+    }
+
+    /**
+     * This method was generated by Apache iBATIS ibator.
+     * This method returns the value of the database column xt_hkbj_gzxx.GZLX
+     *
+     * @return the value of xt_hkbj_gzxx.GZLX
+     *
+     * @ibatorgenerated Tue Aug 27 13:06:53 CST 2019
+     */
+    public String getGzlx() {
+        return gzlx;
+    }
+
+    /**
+     * This method was generated by Apache iBATIS ibator.
+     * This method sets the value of the database column xt_hkbj_gzxx.GZLX
+     *
+     * @param gzlx the value for xt_hkbj_gzxx.GZLX
+     *
+     * @ibatorgenerated Tue Aug 27 13:06:53 CST 2019
+     */
+    public void setGzlx(String gzlx) {
+        this.gzlx = gzlx == null ? null : gzlx.trim();
+    }
+
+    /**
+     * This method was generated by Apache iBATIS ibator.
+     * This method returns the value of the database column xt_hkbj_gzxx.FSSJ
+     *
+     * @return the value of xt_hkbj_gzxx.FSSJ
+     *
+     * @ibatorgenerated Tue Aug 27 13:06:53 CST 2019
+     */
+    public Date getFssj() {
+        return fssj;
+    }
+
+    /**
+     * This method was generated by Apache iBATIS ibator.
+     * This method sets the value of the database column xt_hkbj_gzxx.FSSJ
+     *
+     * @param fssj the value for xt_hkbj_gzxx.FSSJ
+     *
+     * @ibatorgenerated Tue Aug 27 13:06:53 CST 2019
+     */
+    public void setFssj(Date fssj) {
+        this.fssj = fssj;
+    }
+
+    /**
+     * This method was generated by Apache iBATIS ibator.
+     * This method returns the value of the database column xt_hkbj_gzxx.JSSJ
+     *
+     * @return the value of xt_hkbj_gzxx.JSSJ
+     *
+     * @ibatorgenerated Tue Aug 27 13:06:53 CST 2019
+     */
+    public Date getJssj() {
+        return jssj;
+    }
+
+    /**
+     * This method was generated by Apache iBATIS ibator.
+     * This method sets the value of the database column xt_hkbj_gzxx.JSSJ
+     *
+     * @param jssj the value for xt_hkbj_gzxx.JSSJ
+     *
+     * @ibatorgenerated Tue Aug 27 13:06:53 CST 2019
+     */
+    public void setJssj(Date jssj) {
+        this.jssj = jssj;
+    }
+
+    /**
+     * This method was generated by Apache iBATIS ibator.
+     * This method returns the value of the database column xt_hkbj_gzxx.SBLX
+     *
+     * @return the value of xt_hkbj_gzxx.SBLX
+     *
+     * @ibatorgenerated Tue Aug 27 13:06:53 CST 2019
+     */
+    public String getSblx() {
+        return sblx;
+    }
+
+    /**
+     * This method was generated by Apache iBATIS ibator.
+     * This method sets the value of the database column xt_hkbj_gzxx.SBLX
+     *
+     * @param sblx the value for xt_hkbj_gzxx.SBLX
+     *
+     * @ibatorgenerated Tue Aug 27 13:06:53 CST 2019
+     */
+    public void setSblx(String sblx) {
+        this.sblx = sblx == null ? null : sblx.trim();
+    }
+
+    /**
+     * This method was generated by Apache iBATIS ibator.
+     * This method returns the value of the database column xt_hkbj_gzxx.SBXH
+     *
+     * @return the value of xt_hkbj_gzxx.SBXH
+     *
+     * @ibatorgenerated Tue Aug 27 13:06:53 CST 2019
+     */
+    public String getSbxh() {
+        return sbxh;
+    }
+
+    /**
+     * This method was generated by Apache iBATIS ibator.
+     * This method sets the value of the database column xt_hkbj_gzxx.SBXH
+     *
+     * @param sbxh the value for xt_hkbj_gzxx.SBXH
+     *
+     * @ibatorgenerated Tue Aug 27 13:06:53 CST 2019
+     */
+    public void setSbxh(String sbxh) {
+        this.sbxh = sbxh == null ? null : sbxh.trim();
+    }
+
+    /**
+     * This method was generated by Apache iBATIS ibator.
+     * This method returns the value of the database column xt_hkbj_gzxx.UUID
+     *
+     * @return the value of xt_hkbj_gzxx.UUID
+     *
+     * @ibatorgenerated Tue Aug 27 13:06:53 CST 2019
+     */
+    public String getUuid() {
+        return uuid;
+    }
+
+    /**
+     * This method was generated by Apache iBATIS ibator.
+     * This method sets the value of the database column xt_hkbj_gzxx.UUID
+     *
+     * @param uuid the value for xt_hkbj_gzxx.UUID
+     *
+     * @ibatorgenerated Tue Aug 27 13:06:53 CST 2019
+     */
+    public void setUuid(String uuid) {
+        this.uuid = uuid == null ? null : uuid.trim();
+    }
+
+    /**
+     * This method was generated by Apache iBATIS ibator.
+     * This method returns the value of the database column xt_hkbj_gzxx.TXBZ
+     *
+     * @return the value of xt_hkbj_gzxx.TXBZ
+     *
+     * @ibatorgenerated Tue Aug 27 13:06:53 CST 2019
+     */
+    public Integer getTxbz() {
+        return txbz;
+    }
+
+    /**
+     * This method was generated by Apache iBATIS ibator.
+     * This method sets the value of the database column xt_hkbj_gzxx.TXBZ
+     *
+     * @param txbz the value for xt_hkbj_gzxx.TXBZ
+     *
+     * @ibatorgenerated Tue Aug 27 13:06:53 CST 2019
+     */
+    public void setTxbz(Integer txbz) {
+        this.txbz = txbz;
+    }
+
+    private int count;
+	    
+    private String gzxx;
+    
+    private String zsmc;
+    
+    private String mcmc;
+    
+    private String fssjStr;
+
+    private String zsqy;
+	
+	public String getZsmc() {
+		return zsmc;
+	}
+
+	
+	public void setZsmc(String zsmc) {
+		this.zsmc = zsmc;
+	}
+
+	
+	public String getMcmc() {
+		return mcmc;
+	}
+
+	
+	public void setMcmc(String mcmc) {
+		this.mcmc = mcmc;
+	}
+
+	public String getGzxx() {
+		return gzxx;
+	}
+
+	public void setGzxx(String gzxx) {
+		this.gzxx = gzxx;
+	}
+
+	public int getCount() {
+		return count;
+	}
+
+	public void setCount(int count) {
+		this.count = count;
+	}
+
+	
+	public String getFssjStr() {
+		return fssjStr;
+	}
+
+	
+	public void setFssjStr(String fssjStr) {
+		this.fssjStr = fssjStr;
+	}
+
+	
+	public String getZsqy() {
+		return zsqy;
+	}
+
+	
+	public void setZsqy(String zsqy) {
+		this.zsqy = zsqy;
+	}
+}

+ 2 - 0
shiwan/face/src/main/java/com/huimv/face/repo/FaceRecoRepository.java

@@ -10,4 +10,6 @@ import java.util.List;
 public interface FaceRecoRepository extends JpaRepository<FaceReco, Integer>, JpaSpecificationExecutor<FaceReco> {
     @Query(nativeQuery = true,value = "SELECT * FROM face_reco WHERE SBID=\"110201190808KN4872\" OR SBID=\"110201190808KN2340\" OR SBID=\"110201190808KN1206\" OR SBID=\"110201190808KN4475\" OR SBID=\"110201190808KN1937\" OR SBID=\"110201190808KN4191\" OR SBID=\"110201190808KN4746\" OR SBID=\"110201190808KN0582\" OR SBID=\"110201190808KN1791\" OR SBID=\"110201190808KN2096\" OR SBID=\"110201190808KN1555\" OR SBID=\"110201190808KN2053\" ORDER BY id  DESC   LIMIT  10 ")
     List<FaceReco> findTop10ByOrderByIdDesc();
+
+
 }

+ 3 - 0
shiwan/face/src/main/java/com/huimv/face/repo/FaceSbdaRepository.java

@@ -9,4 +9,7 @@ public interface FaceSbdaRepository extends JpaRepository<FaceSbda, Integer>, Jp
 
     @Query(nativeQuery = true,value = "SELECT * FROM  face_sbda  where SBID= ?1")
     FaceSbda findAllBySBID(String SBID);
+
+    @Query(nativeQuery = true,value = "SELECT * FROM  face_sbda  where SBID= ?1")
+    FaceSbda findAllBySBID1(String SBID);
 }

+ 27 - 0
shiwan/face/src/main/java/com/huimv/face/repo/FaceUserImgRepository.java

@@ -1,9 +1,13 @@
 package com.huimv.face.repo;
 
 import com.huimv.face.domain.FaceUserImgs;
+import com.huimv.face.domain.XtHkbjgzxx;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.Query;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * @Project : huimv.shiwan
  * @Package : com.huimv.face.repo
@@ -14,4 +18,27 @@ import org.springframework.data.jpa.repository.Query;
 public interface FaceUserImgRepository extends JpaRepository<FaceUserImgs, Integer> {
     @Query(nativeQuery = true,value = "SELECT * FROM  face_user_img  where user_id= ?1")
     FaceUserImgs findAllByUserId(String userId);
+
+
+    @Query(nativeQuery = true,value = "  SELECT gzxx.*, gydm.dmmc gzxx, zsda.zsmc zsmc, mcda.mcmc mcmc, zsda.zsqy zsqy\n" +
+            "      FROM da_jqda jqda, da_zsda zsda, da_mcda mcda, xt_hkbj_gzxx gzxx \n" +
+            "      LEFT JOIN xt_gydm gydm \n" +
+            "      ON gydm.zfbz = 0 \n" +
+            "      AND gydm.lbid = 32\n" +
+            "       AND gydm.dmid = gzxx.gzlx\n" +
+            "    WHERE jqda.zfbz = 0\n" +
+            "     AND zsda.zfbz = 0 \n" +
+            "     AND mcda.zfbz = 0 \n" +
+            "     AND zsda.id = jqda.zsid \n" +
+            "     AND jqda.jqid = gzxx.jqid\n" +
+            "      AND mcda.id = zsda.mcid      AND mcda.id = 39        \n" +
+            "     AND gzxx.jssj IS NULL \n" +
+            "  \n" +
+            "     AND gzxx.gzlx IN (1, 2, 3, 4, 5) AND fssj > DATE_ADD(NOW(),INTERVAL -10 DAY) AND zsda.ssqy != '5'  GROUP BY jqid,gzlx ")
+
+            //之后改成牧场id
+            public   List<Object[]>   findAlarm();
+
+
+
 }

+ 11 - 5
shiwan/face/src/main/java/com/huimv/face/service/FaceUserImgsService.java

@@ -1,11 +1,17 @@
 package com.huimv.face.service;
 
-import com.huimv.face.domain.FaceUserImgs;
-import com.huimv.face.result.Result;
-import org.springframework.web.multipart.MultipartFile;
+import com.alibaba.fastjson.JSONObject;
+import  com.huimv.face.domain.FaceUserImgs;
+import  com.huimv.face.result.Result;
+import  org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+
 
 public interface FaceUserImgsService {
-    Result upload(Integer ID ,String XM , String USERID, MultipartFile file);
+    Result upload(Integer ID, String XM, String USERID, MultipartFile file);
 
     FaceUserImgs findAllByUserId(String userid);
-}
+
+    JSONObject  findAlam();
+}

+ 1 - 0
shiwan/face/src/main/java/com/huimv/face/service/FaceUserService.java

@@ -19,4 +19,5 @@ public interface FaceUserService {
     FaceUser findAllByUserId(String userid);
 
     Result findFaceUserByName(String userName);
+
 }

+ 98 - 8
shiwan/face/src/main/java/com/huimv/face/service/impl/FaceUserImgsServiceImpl.java

@@ -1,5 +1,7 @@
 package com.huimv.face.service.impl;
 
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.huimv.face.domain.FaceUserImgs;
 import com.huimv.face.repo.FaceUserImgRepository;
 import com.huimv.face.result.Result;
@@ -9,6 +11,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
 
 import java.io.IOException;
+import java.util.List;
 
 /**
  * @Project : huimv.shiwan
@@ -21,15 +24,16 @@ import java.io.IOException;
 public class FaceUserImgsServiceImpl implements FaceUserImgsService {
     @Autowired
     private FaceUserImgRepository faceUserImgRepository;
+
     @Override
-    public Result upload(Integer ID ,String XM , String USERID, MultipartFile file) {
+    public Result upload(Integer ID, String XM, String USERID, MultipartFile file) {
 //        try {
-            FaceUserImgs faceUserImgs = faceUserImgRepository.findAllByUserId(USERID);
-            if (faceUserImgs == null){
-                faceUserImgs = new FaceUserImgs();
-            }
-            faceUserImgs.setUserId(USERID);
-            faceUserImgs.setUserName(XM);
+        FaceUserImgs faceUserImgs = faceUserImgRepository.findAllByUserId(USERID);
+        if (faceUserImgs == null) {
+            faceUserImgs = new FaceUserImgs();
+        }
+        faceUserImgs.setUserId(USERID);
+        faceUserImgs.setUserName(XM);
         try {
             faceUserImgs.setImg(file.getBytes());
         } catch (IOException e) {
@@ -37,7 +41,7 @@ public class FaceUserImgsServiceImpl implements FaceUserImgsService {
         }
 
         faceUserImgRepository.save(faceUserImgs);
-            return new Result(10001,"添加成功");
+        return new Result(10001, "添加成功");
 //        }catch (Exception e){
 //            return new Result(10001,"添加失败");
 //        }
@@ -48,4 +52,90 @@ public class FaceUserImgsServiceImpl implements FaceUserImgsService {
     public FaceUserImgs findAllByUserId(String userid) {
         return faceUserImgRepository.findAllByUserId(userid);
     }
+
+
+    @Override
+    public JSONObject findAlam() {
+
+        List<Object[]> Alarm = faceUserImgRepository.findAlarm();
+        JSONArray userAccountJa = new JSONArray();
+
+        for (int a = 0; a < Alarm.size(); a++) {
+            Object[] userAccountObj = (Object[]) Alarm.get(a);
+            /* 封装用户和账户关联对象 */
+            userAccountJa.add(packageUserAccountRelatedObj(userAccountObj));
+        }
+
+        JSONObject resultJo = new JSONObject();
+        resultJo.put("code", 10001);
+        resultJo.put("data", userAccountJa);
+        return resultJo;
+    }
+
+    /**
+     * 封装对象
+     */
+    private Object packageUserAccountRelatedObj(Object[] userAccountObj) {
+        JSONObject dataJo = new JSONObject();
+
+        dataJo.put("ID", userAccountObj[0].toString());
+        dataJo.put("JQID", userAccountObj[1].toString());
+        if (userAccountObj[2] == null) {
+            dataJo.put("GZLX", "");
+        } else {
+            dataJo.put("GZLX", userAccountObj[2].toString());
+        }
+        if (userAccountObj[3] == null) {
+            dataJo.put("FSSJ", "");
+        } else {
+            dataJo.put("FSSJ", userAccountObj[3].toString());
+        }
+        if (userAccountObj[4] == null) {
+            dataJo.put("JSSJ", "");
+        } else {
+            dataJo.put("JSSJ", userAccountObj[4].toString());
+        }
+        if (userAccountObj[5] == null) {
+            dataJo.put("SBLX", "");
+        } else {
+            dataJo.put("SBLX", userAccountObj[5].toString());
+        }
+        if (userAccountObj[6] == null) {
+            dataJo.put("SBXH", "");
+        } else {
+            dataJo.put("SBXH", userAccountObj[6].toString());
+        }
+        if (userAccountObj[7] == null) {
+            dataJo.put("TXBZ", "");
+        } else {
+            dataJo.put("TXBZ", userAccountObj[7].toString());
+        }
+        if (userAccountObj[8] == null) {
+            dataJo.put("UUID", "");
+        } else {
+            dataJo.put("UUID", userAccountObj[8].toString());
+        }
+        if (userAccountObj[9] == null) {
+            dataJo.put("gzxx", "");
+        } else {
+            dataJo.put("gzxx", userAccountObj[9].toString());
+        }
+        if (userAccountObj[10] == null) {
+            dataJo.put("ZSMC", "");
+        } else {
+            dataJo.put("ZSMC", userAccountObj[10].toString());
+        }
+        if (userAccountObj[11] == null) {
+            dataJo.put("mcmc", "");
+        } else {
+            dataJo.put("mcmc", userAccountObj[11].toString());
+        }
+        if (userAccountObj[12] == null) {
+            dataJo.put("zsqy", "");
+        } else {
+            dataJo.put("zsqy", userAccountObj[12].toString());
+        }
+        return dataJo;
+    }
+
 }

+ 4 - 4
shiwan/face/src/main/resources/application-prod.yml

@@ -2,13 +2,13 @@ server:
   port: 8081
 spring:
   application:
-    name: huimv-core
+    name: face
 
   #------DataSource-----
   datasource:
-    url: jdbc:mysql://127.0.0.1:3306/huimv-admin?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
-    #url: jdbc:mysql://192.168.1.7:3306/huimv-admin?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
-    username: root
+    #url: jdbc:mysql://127.0.0.1:3306/huimv-admin?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
+    url: jdbc:mysql://122.112.219.87:3306/ifm?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
+    username: huimv
     password: hm123456
     driver-class-name: com.mysql.cj.jdbc.Driver
   jpa:

+ 2 - 2
shiwan/face/src/main/resources/application-test.yml

@@ -6,8 +6,8 @@ spring:
   datasource:
       #url: jdbc:mysql://127.0.0.1:3306/huimv-admin?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
     url: jdbc:mysql://122.112.219.87:3306/ifm?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
-    username: root
-    password: ?root@huimv_farm!
+    username: huimv
+    password: hm123456
     driver-class-name: com.mysql.cj.jdbc.Driver
   jpa:
     hibernate:

+ 17 - 2
shiwan/face/src/test/java/com/huimv/face/FaceApplicationTests.java

@@ -1,12 +1,21 @@
 package com.huimv.face;
 
-import org.junit.jupiter.api.Test;
+;
+
+import com.huimv.face.repo.FaceRecoRepository;
+import com.huimv.face.repo.FaceUserImgRepository;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
 
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.List;
+import java.util.Map;
 
 class FaceApplicationTests {
-//  2020-09-08 13:17:14
+    private static FaceUserImgRepository faceRecoRepository;
+    //  2020-09-08 13:17:14
+
     @Test
     void contextLoads() {
         SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@@ -24,4 +33,10 @@ class FaceApplicationTests {
     }
 
 
+    @Test
+    void sss(){
+
+    }
+
+
 }