.idea/compiler.xml
@@ -2,6 +2,7 @@ <project version="4"> <component name="CompilerConfiguration"> <annotationProcessing> <profile default="true" name="Default" enabled="true" /> <profile name="Maven default annotation processors profile" enabled="true"> <sourceOutputDir name="target/generated-sources/annotations" /> <sourceTestOutputDir name="target/generated-test-sources/test-annotations" /> .idea/libraries/Maven__commons_net_commons_net_3_8_0.xml
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,13 @@ <component name="libraryTable"> <library name="Maven: commons-net:commons-net:3.8.0"> <CLASSES> <root url="jar://$MAVEN_REPOSITORY$/commons-net/commons-net/3.8.0/commons-net-3.8.0.jar!/" /> </CLASSES> <JAVADOC> <root url="jar://$MAVEN_REPOSITORY$/commons-net/commons-net/3.8.0/commons-net-3.8.0-javadoc.jar!/" /> </JAVADOC> <SOURCES> <root url="jar://$MAVEN_REPOSITORY$/commons-net/commons-net/3.8.0/commons-net-3.8.0-sources.jar!/" /> </SOURCES> </library> </component> log/eva.log
server/dmvisit_admin/src/main/java/com/doumee/api/business/HkSyncController.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,45 @@ package com.doumee.api.business; import com.doumee.api.BaseController; import com.doumee.core.annotation.excel.ExcelExporter; import com.doumee.core.annotation.pr.PreventRepeat; import com.doumee.core.haikang.model.param.request.AcsDeviceListRequest; import com.doumee.core.haikang.service.HKService; import com.doumee.core.model.ApiResponse; import com.doumee.core.model.PageData; import com.doumee.core.model.PageWrap; import com.doumee.dao.business.model.Device; import com.doumee.service.business.DeviceService; import com.doumee.service.business.HkSyncService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.util.ArrayList; import java.util.List; /** * @author æ±è¹è¹ * @date 2023/11/30 15:33 */ @Api(tags = "æµ·åº·æ°æ®åæ¥æ¥å£") @RestController @RequestMapping("/business/hksync") public class HkSyncController extends BaseController { @Autowired private HkSyncService hkSyncService; @PreventRepeat @ApiOperation("å ¨é忥é¨ç¦è®¾å¤æ¥å£") @PostMapping("/getDevices") @RequiresPermissions("business:hksync:device") public ApiResponse getDevices(@RequestBody AcsDeviceListRequest param) { hkSyncService.syncHkDevices(param); return ApiResponse.success(null); } } server/dmvisit_admin/src/main/resources/application.yml
@@ -30,7 +30,6 @@ map-underscore-to-camel-case: true log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # ç¼åå 容设置 cache: session: @@ -46,7 +45,6 @@ smart: true # æé¤è·è¸ªçURLæ£å exclude-patterns: .+/list[a-zA-Z0-9\-\_]*$, .+/tree[a-zA-Z0-9\-\_]*$, .+/page[a-zA-Z0-9\-\_]*$, .+/all[a-zA-Z0-9\-\_]*$, /swagger-resources.* # æ¥å¿é ç½® logback: @@ -69,7 +67,6 @@ compression: enabled: true mime-types: application/json port: 10013 tomcat: max-swallow-size: -1 server/dmvisit_service/src/main/java/com/doumee/config/mybatis/EasySqlInjector.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,22 @@ package com.doumee.config.mybatis; import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.core.injector.AbstractMethod; import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector; import com.baomidou.mybatisplus.core.metadata.TableInfo; import com.baomidou.mybatisplus.extension.injector.methods.InsertBatchSomeColumn; import java.util.List; public class EasySqlInjector extends DefaultSqlInjector { @Override public List<AbstractMethod> getMethodList(Class<?> mapperClass ) { // 注æï¼æ¤SQLæ³¨å ¥å¨ç»§æ¿äºDefaultSqlInjector(é»è®¤æ³¨å ¥å¨)ï¼è°ç¨äºDefaultSqlInjectorçgetMethodListæ¹æ³ï¼ä¿çäºmybatis-plusçèªå¸¦æ¹æ³ List<AbstractMethod> methodList = super.getMethodList(mapperClass); methodList.add(new InsertBatchSomeColumn(i -> i.getFieldFill() != FieldFill.UPDATE)); return methodList; } } server/dmvisit_service/src/main/java/com/doumee/config/mybatis/MyBatisPlusConfig.java
@@ -20,4 +20,9 @@ interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); return interceptor; } @Bean public EasySqlInjector sqlInjector() { return new EasySqlInjector(); } } server/dmvisit_service/src/main/java/com/doumee/core/haikang/HKUtil.java
ÎļþÃû´Ó server/dmvisit_service/src/main/java/com/doumee/core/utils/haikang/HKUtil.java ÐÞ¸Ä @@ -1,9 +1,8 @@ package com.doumee.core.utils.haikang; package com.doumee.core.haikang; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.hikvision.artemis.sdk.ArtemisHttpUtil; import com.hikvision.artemis.sdk.config.ArtemisConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKConstants.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,100 @@ package com.doumee.core.haikang.model; import com.doumee.core.utils.Constants; import lombok.Data; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @Data public class HKConstants { private Logger logger = LoggerFactory.getLogger(HKConstants.class); //æµ·åº·å¹³å°æ ¹æ®ç°åºç¯å¢é ç½®httpè¿æ¯https public static final String RESPONSE_SUCCEE = "0"; public static String https ; /** * è½å弿¾å¹³å°çç½ç«è·¯å¾ è·¯å¾ä¸ç¨ä¿®æ¹ï¼å°±æ¯/artemis */ public static final String ARTEMIS_PATH = "/artemis"; /** * æ¥å£å°åéå */ public interface InterfacePath{ String doorEvents = "/api/acs/v2/door/events";//é¨ç¦äºä»¶æ¥è¯¢ String rootOrg = "/api/resource/v1/org/rootOrg";//è·åè·ç»ç» String addBatchOrg = "/api/resource/v1/org/batch/add";//æ¹éæ°å¢ç»ç» String delBatchOrg = "/api/resource/v1/org/batch/delete";//æ¹éå é¤ç»ç» String editOrg = "/api/resource/v1/org/single/update";//ä¿®æ¹ç»ç» String addUser = "/api/resource/v2/person/single/add";//æ·»å 人å String addBatchUser = "/api/resource/v1/person/batch/add";//æ¹éæ·»å 人å String editUser = "/api/resource/v1/person/single/update";//ä¿®æ¹äººå String delBatchUser = "/api/resource/v1/person/batch/delete";//æ¹éå é¤äººå String addFace = "/api/resource/v1/face/single/add";//æ·»å äººè¸ String editFace = "/api/resource/v1/face/single/update";//ä¿®æ¹äººè¸ String delFace = "/api/resource/v1/face/single/delete";//å é¤äººè¸ String acsDeviceList = "/api/resource/v2/acsDevice/search";//æ¥è¯¢é¨ç¦è®¾å¤å表v2 String acsDeviceTimeRangeList = "/api/resource/v1/acsDevice/timeRange";//å¢éè·åé¨ç¦è®¾å¤æ°æ® String parkAddition = "/api/pms/v2/parkingSpace/reservations/addition";//车ä½é¢çº¦v2 String parkDeletion= "/api/pms/v1/parkingSpace/reservations/deletion";//车ä½åæ¶é¢çº¦v2 String carChargeAddtion= "/api/pms/v1/car/charge";//åºå®è½¦å å¼å æ String carChargeDeletion= "/api/pms/v1/car/charge/deletion";//åºå®è½¦åæ¶å æ String getParkList= "/api/resource/v1/park/parkList";//è·åå车åºå表 String getEntranceList= "/api/resource/v1/entrance/entranceList";//è·ååºå ¥å£å表 String visitAppiontment= "/api/visitor/v2/appointment";//访客é¢çº¦v2 String visitAppiontmentMDJ= "/api/visitor/v1/appointment/registration";//访客é¢çº¦å ç»è®°v2 String visitCancel= "/api/visitor/v1/appointment/cancel";//åæ¶è®¿å®¢é¢çº¦ String facePicture= "/api/resource/v1/person/picture";//æåç¨æ·äººè¸ç §ç String privilegeGroup= "/api/visitor/v1/privilege/group";//æ¥è¯¢è®¿å®¢æéç» } /** * é¡è²æä¸¾ */ public enum Colors { SYSTEM(0, "ç³»ç»ç¨æ·" ) ; // æååé private String name; private int key; // æé æ¹æ³ Colors(int key, String name ) { this.name = name; this.key = key; } // æ®éæ¹æ³ public static String getName(int index) { for (Constants.UserType c : Constants.UserType.values()) { if (c.getKey() == index) { return c.getName(); } } return null; } // get set æ¹æ³ public String getName() { return name; } public void setName(String name) { this.name = name; } public int getKey() { return key; } public void setKey(int key) { this.key = key; } } } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKTools.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,310 @@ package com.doumee.core.haikang.model; import com.alibaba.fastjson.JSONObject; import com.hikvision.artemis.sdk.ArtemisHttpUtil; import lombok.extern.slf4j.Slf4j; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import java.io.IOException; import java.io.InputStream; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; @Slf4j public class HKTools { // private static final Logger logger = LoggerFactory.getLogger(HKUtil.class); public static void main(String[] args) throws ParseException { } private static Map<String, String> getPath(String str) { final String getCamsApi = HKConstants.ARTEMIS_PATH + str; Map<String, String> path = new HashMap<String, String>(2) { { put(HKConstants.https, getCamsApi);// æ ¹æ®ç°åºç¯å¢é¨ç½²ç¡®è®¤æ¯httpè¿æ¯https } }; return path; } /** * è·åé¨ç¦æ¶é´æ°æ®éå * @return */ public static String getRootOrg() { Map<String, String> path = getPath(HKConstants.InterfacePath.rootOrg); String result = ArtemisHttpUtil.doPostStringArtemis(path, "", null, null, "application/json", null);// post请æ±application/jsonç±»ååæ° return result; } /** * æ´æ°ç»ç»ä¿¡æ¯ * @param body * @return */ public static String editOrg(String body) { Map<String, String> path = getPath(HKConstants.InterfacePath.editOrg); String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post请æ±application/jsonç±»ååæ° return result; } /** * æ°å¢ç»ç»ä¿¡æ¯ * @param body * @return */ public static String addBatchOrg(String body) { Map<String, String> path = getPath(HKConstants.InterfacePath.addBatchOrg); String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post请æ±application/jsonç±»ååæ° return result; } /** * å é¤ç»ç»ä¿¡æ¯ * @param body * @return */ public static String delOrg(String body) { Map<String, String> path = getPath(HKConstants.InterfacePath.delBatchOrg); String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post请æ±application/jsonç±»ååæ° return result; } /** * æ°å¢äººåä¿¡æ¯ * @param body * @return */ public static String addUser(String body) { Map<String, String> path = getPath(HKConstants.InterfacePath.addUser); String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post请æ±application/jsonç±»ååæ° return result; } /** * æ¹éæ°å¢äººåä¿¡æ¯ * @param body * @return */ public static String addBatchUser(String body) { Map<String, String> path = getPath(HKConstants.InterfacePath.addBatchUser); String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post请æ±application/jsonç±»ååæ° return result; } /** * æ¹éå é¤äººåä¿¡æ¯ * @param body * @return */ public static String delBatchUser(String body) { Map<String, String> path = getPath(HKConstants.InterfacePath.delBatchUser); String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post请æ±application/jsonç±»ååæ° return result; } /** * ä¿®æ¹äººåä¿¡æ¯ * @param body * @return */ public static String editUser(String body) { Map<String, String> path = getPath(HKConstants.InterfacePath.editUser); String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post请æ±application/jsonç±»ååæ° return result; } /** * æ·»å 人è¸ä¿¡æ¯ * @param body * @return */ public static String addFace(String body) { Map<String, String> path = getPath(HKConstants.InterfacePath.addFace); String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post请æ±application/jsonç±»ååæ° return result; } /** * ç¼è¾äººè¸ä¿¡æ¯ * @param body * @return */ public static String editFace(String body) { Map<String, String> path = getPath(HKConstants.InterfacePath.editFace); String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post请æ±application/jsonç±»ååæ° return result; } /** * å é¤äººè¸ä¿¡æ¯ * @param body * @return */ public static String delFace(String body) { Map<String, String> path = getPath(HKConstants.InterfacePath.delFace); String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post请æ±application/jsonç±»ååæ° return result; } /** * å ¨éè·å车åºä¿¡æ¯ * @param body * @return */ public static String parkList(String body) { Map<String, String> path = getPath(HKConstants.InterfacePath.getParkList); String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post请æ±application/jsonç±»ååæ° return result; } /** * æ ¹æ®è½¦åºç¼ç æ¥è¯¢åºå ¥å£å表 * @param body * @return */ public static String entranceList(String body) { Map<String, String> path = getPath(HKConstants.InterfacePath.getEntranceList); String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post请æ±application/jsonç±»ååæ° return result; } /** * 车è¾é¢çº¦ * @param body * @return */ public static String parkAddition(String body) { Map<String, String> path = getPath(HKConstants.InterfacePath.parkAddition); String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post请æ±application/jsonç±»ååæ° return result; } /** * 车è¾åæ¶é¢çº¦ * @param body * @return */ public static String parkDeletion(String body) { Map<String, String> path = getPath(HKConstants.InterfacePath.parkDeletion); String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post请æ±application/jsonç±»ååæ° return result; } /** * åºå®è½¦è¾å å¼ï¼å æï¼ * @param body * @return */ public static String carChargeAddtion(String body) { Map<String, String> path = getPath(HKConstants.InterfacePath.carChargeAddtion); String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post请æ±application/jsonç±»ååæ° return result; } /** * åºå®è½¦è¾åæ¶å æ * @param body * @return */ public static String carChargeDeletion(String body) { Map<String, String> path = getPath(HKConstants.InterfacePath.carChargeDeletion); String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post请æ±application/jsonç±»ååæ° return result; } /** * è·åäººè¸æ°æ®ï¼æå人è¸è®¿é®å°åï¼ * @param body * @return */ public static InputStream getFaceInputStream(String body) throws Exception{ Map<String, String> path = getPath(HKConstants.InterfacePath.facePicture); //åæ°æ ¹æ®æ¥å£å®é æ åµè®¾ç½® HttpResponse resp = ArtemisHttpUtil.doPostStringImgArtemis( path, body, null, null,"application/json",null); if (200==resp.getStatusLine().getStatusCode()) { HttpEntity entity = resp.getEntity(); InputStream in = entity.getContent(); return in; }else{ throw new Exception("人è¸ä¸è½½åºé"); } } /** * è·åé¨ç¦è®¾å¤å表 * @param body * @return */ public static String acsDeviceList(String body) { Map<String, String> path = getPath(HKConstants.InterfacePath.acsDeviceList); String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post请æ±application/jsonç±»ååæ° return result; } /** * å¢éè·åé¨ç¦è®¾å¤å表 * @param body * @return */ public static String acsDeviceTimeRangeList(String body) { Map<String, String> path = getPath(HKConstants.InterfacePath.acsDeviceList); String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post请æ±application/jsonç±»ååæ° return result; } /** * 访客é¢çº¦ * @param body * @return */ public static String visitAppiontment(String body) { Map<String, String> path = getPath(HKConstants.InterfacePath.visitAppiontment); String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post请æ±application/jsonç±»ååæ° return result; } /** * 访客å ç»è®°é¢çº¦ * @param body * @return */ public static String visitAppiontmentMDJ(String body) { Map<String, String> path = getPath(HKConstants.InterfacePath.visitAppiontmentMDJ); String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post请æ±application/jsonç±»ååæ° return result; } /** * åæ¶è®¿å®¢é¢çº¦ * @param body * @return */ public static String visitCancel(String body) { Map<String, String> path = getPath(HKConstants.InterfacePath.visitCancel); String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post请æ±application/jsonç±»ååæ° return result; } /** * 访客æéç» * @param body * @return */ public static String privilegeGroup(String body) { Map<String, String> path = getPath(HKConstants.InterfacePath.privilegeGroup); String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post请æ±application/jsonç±»ååæ° return result; } /** * ä¼ å ¥Dataç±»åæ¥æï¼è¿ååç¬¦ä¸²ç±»åæ¶é´ï¼ISO8601æ åæ¶é´ï¼ * @param date * @return */ public static String getISO8601Timestamp(Date date){ TimeZone tz = TimeZone.getTimeZone("Asia/Shanghai"); //TimeZone tz = TimeZone.getTimeZone("GMT-01"); DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); df.setTimeZone(tz); String nowAsISO = df.format(date); return nowAsISO; } } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/BaseRequst.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,8 @@ package com.doumee.core.haikang.model.param; import lombok.Data; @Data public class BaseRequst<T> { private T data; } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/BaseResponse.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,20 @@ package com.doumee.core.haikang.model.param; import lombok.Data; @Data public class BaseResponse<T> { /** * è¿åç * 0ï¼æå * å ¶ä»ï¼å¤±è´¥ * åèéå½E.other.1 èµæºç®å½é误ç */ private String code; /** * æ¥å£æ§è¡æ åµè¯´æä¿¡æ¯ */ private String msg; private T data; } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/AcsDeviceListRequest.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,15 @@ package com.doumee.core.haikang.model.param.request; import lombok.Data; @Data public class AcsDeviceListRequest { private String name ;//string False åç§°ï¼æ¨¡ç³æç´¢ï¼æå¤§é¿åº¦32ï¼è¥å å«ä¸æï¼æå¤§é¿åº¦æä¸è¶ è¿æç §æå®ç¼ç çåèé¿åº¦ï¼å³getBytes(âutf-8â).length private String[] regionIndexCodes ;//string[] False åºåç¼å·,å¯ä»¥ä¸ºç©º; String[]ï¼æ¯ææ ¹æ®åºåæ¹éæ¥è¯¢ï¼åºåç¼å·ä¸ªæ°<=1000个ï¼å个é¿åº¦<=64Byteï¼ï¼å¯ä»æ¥è¯¢åºåå表v2æ¥å£è·åè¿ååæ°indexCode private Boolean isSubRegion;// boolean False trueæ¶ï¼æç´¢regionIndexCodesåå ¶åååºåçèµæºï¼ falseæ¶ï¼åªæç´¢ regionIndexCodesçèµæº private Integer pageNo ;//integer True å½å页ç private Integer pageSize;// integer True åé¡µå¤§å° private String[] authCodes ;//string[] False æéç éåï¼è¯¦è§éå½A.3 èµæºæéç ä¸é¨ç¦è®¾å¤å¯¹åºçèµæºæéç } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/CarChargeAddRequest.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,13 @@ package com.doumee.core.haikang.model.param.request; import lombok.Data; @Data public class CarChargeAddRequest { private String parkSyscode;// string True å车åºå¯ä¸æ è¯ï¼å¯éè¿è·åå车åºå表æ¥å£è·å private String plateNo;// string True 车çå·ç private String fee;// string False å æè´¹ç¨ï¼åä½:å ï¼2ä½å°æ° private String startTime;// string True å æå¼å§æ¶é´æ¶é´æ ¼å¼ï¼yyyy-MM-ddï¼å¦ï¼2018-07-26 private String endTime;// string True å æç»ææ¶é´æ¶é´æ ¼å¼ï¼yyyy-MM-ddï¼å¦ï¼2018-07-27 } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/CarChargeDelRequest.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,10 @@ package com.doumee.core.haikang.model.param.request; import lombok.Data; @Data public class CarChargeDelRequest { private String parkSyscode;// string False å车åºå¯ä¸æ è¯,为空æ¶ååæ¶å½åè½¦è¾ææå车åºçå æï¼å¯éè¿è·åå车åºå表æ¥å£è·å private String plateNo;// string True 车çå·ç } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/EntranceListRequest.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,10 @@ package com.doumee.core.haikang.model.param.request; import lombok.Data; @Data public class EntranceListRequest { private String parkIndexCodes ;// string True å车åºå¯ä¸æ è¯é å¤ä¸ªå¼ä½¿ç¨è±æéå·åé,ä¸è¶ è¿1000ä¸ªï¼ å¯éè¿è·åå车åºå表æ¥å£è·å } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/FaceAddRequest.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,9 @@ package com.doumee.core.haikang.model.param.request; import lombok.Data; @Data public class FaceAddRequest { private String personId ;// string True 人åId private String faceData;// string True 人è¸å¾çbase64ç¼ç åçåç¬¦æ°æ® } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/FaceEditRequest.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,10 @@ package com.doumee.core.haikang.model.param.request; import lombok.Data; @Data public class FaceEditRequest { private String faceId ;// string True 人è¸å¾çId ï¼ æ·»å äººè¸ æ¥å£è¿åæ¥æä¸çfaceIdåæ®µï¼ æè·å人åå表v2 æ¥å£è¿åæ¥æä¸çpersonPhotoIndexCodeåæ®µ private String faceData;// string True 人è¸å¾çbase64ç¼ç åçåç¬¦æ°æ® } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/FacePictureRequest.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,11 @@ package com.doumee.core.haikang.model.param.request; import lombok.Data; @Data public class FacePictureRequest { private String picUri ;// string True å¾çç¸å¯¹URI éè¿è·å人åå表v2æ¥å£è¿åâpicUriâåæ®µ private String serverIndexCode;// string True å¾çæå¡å¨å¯ä¸æ è¯ éè¿è·å人åå表v2æ¥å£è¿åâserverIndexCodeâåæ®µ } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/OrgAddRequest.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,12 @@ package com.doumee.core.haikang.model.param.request; import lombok.Data; @Data public class OrgAddRequest { private Integer clientId;// number False è°ç¨æ¹æå®æ è¯ï¼æ¥å£æ§è¡æååå°æå¡ç«¯çæçæ è¯ä¸æ¤æ è¯ç»å®åè¿å æä»¥å»ºè®®æ¯æ¬¡æ¥å£è°ç¨ï¼clientidä¿æå¯ä¸ã1~10个å符ï¼åªæ¯ææ°åã æ³¨éï¼ISCä¸å¯¹clientidåæ ¡éªååå¨ private String orgIndexCode;// string False ç»ç»å¯ä¸æ å¿ï¼ä¸å 许ä¸å ¶å®ç»ç»å¯ä¸æ å¿éå¤ï¼å æ¬å·²å é¤çç»ç»ï¼å¼ä¸ºç©ºæè ä¸ä¼ æ¤å段系ç»èªå¨çæå¯ä¸æ å¿ï¼è¯¥åæ®µç¦æ¢ä¼ 0å¼ã private String orgName;// string True ç»ç»åç§°ï¼1~32个å符ï¼ä¸è½å å« â / \ : * ? " < > private String parentIndexCode ;//string True ç¶ç»ç»å¯ä¸æ è¯ç private String orgCode;// string False ç»ç»ç¼ç ï¼å½æ·»å å°åºèç¹æ¶å¿ å¡«ï¼ç¼ç 使ç¨01101å¼å¤´ç8使°åç¼ç ï¼å½æ·»å 楼æ åå æ¶å¿ å¡«ï¼ç¼ç 使ç¨01101å¼å¤´ç20使°åç¼ç ï¼å ¶å®åºæ¯ä¸æ¹å¼æ æ } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/OrgDelRequest.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,8 @@ package com.doumee.core.haikang.model.param.request; import lombok.Data; @Data public class OrgDelRequest { private String[] indexCodes;// string[] True å¾ å é¤çç»ç»indexCodeå表ï¼å次æäº¤ä¸é为1000æ¡ ä»è·åç»ç»å表 æ¥å£è·åè¿ååæ°orgIndexCode } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/OrgEditRequest.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,9 @@ package com.doumee.core.haikang.model.param.request; import lombok.Data; @Data public class OrgEditRequest { private String orgIndexCode ;//string True ç»ç»æ è¯ï¼å¿ é¡»ä¿è¯å·²åå¨ï¼ è·åç»ç»å表 æ¥å£è·åè¿ååæ°orgIndexCodeã private String orgName ;//string False ç»ç»åç§°ï¼1~32个å符ï¼ä¸è½å å« â / \ : * ? " < > } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/ParkListRequest.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,10 @@ package com.doumee.core.haikang.model.param.request; import lombok.Data; @Data public class ParkListRequest { private String parkIndexCodes ;// string False å车åºå¯ä¸æ è¯éå å¤ä¸ªå¼ä½¿ç¨è±æéå·åéï¼ä¸è¶ è¿1000个 } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/ParkReservationAddRequest.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,17 @@ package com.doumee.core.haikang.model.param.request; import lombok.Data; @Data public class ParkReservationAddRequest { private String parkSyscode;// string True å车åºå¯ä¸æ è¯ æ¥æºäºæ¥è¯¢å车åºå表æ¥å£ï¼å¯éè¿è·åå车åºå表æ¥å£è·å private String plateNo;// string True 车çå·ç private String phoneNo;// string False ææºå· çº¯æ°åï¼ä½æ°æä¸éå¶ private String owner;// string False è系人å§å private String allowTimes;// number False å 许è¿åºæ¬¡æ°ï¼0ï¼å次1ï¼å¤æ¬¡ private String isCharge ;//string False æ¯å¦æ¶è´¹0ï¼æ¶è´¹1ï¼å è´¹ private String resvWay;// string False é¢çº¦æ¹å¼ï¼5:ç¬¬ä¸æ¹é¢çº¦ï¼é»è®¤ï¼6:访客 private String startTime ;//string False é¢çº¦å¼å§æ¶é´ ææ¶é´é¢çº¦æ¶å¿ å¡«ï¼ææ¬¡é¢çº¦ä¸å¡« ISO8601æ ¼å¼ï¼yyyy-MM-ddTHH:mm:ss+å½åæ¶åºï¼ä¾å¦å京æ¶é´ï¼2018-07-26T15:00:00+08:00 private String endTime ;//string False é¢çº¦ç»ææ¶é´ ææ¶é´é¢çº¦æ¶å¿ å¡«ï¼ææ¬¡é¢çº¦ä¸å¡« ISO8601æ ¼å¼ï¼yyyy-MM-ddTHH:mm:ss+å½åæ¶åºï¼ä¾å¦å京æ¶é´ï¼2018-07-26T15:00:00+08:00 } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/ParkReservationDelRequest.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,11 @@ package com.doumee.core.haikang.model.param.request; import lombok.Data; @Data public class ParkReservationDelRequest { private String reserveOrderNo ;//string True é¢çº¦åå· private String way ;//number False åæ¶æ¹å¼1:ç¨æ·åæ¶ï¼é»è®¤ï¼ 5:访客平å°åæ¶ } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/PrivilegeGroupRequest.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,11 @@ package com.doumee.core.haikang.model.param.request; import lombok.Data; @Data public class PrivilegeGroupRequest { private String name;// string False 访客æéç»åç§° private int pageNo ;//number True å½å页ç ï¼è¦æ±å¤§äº0 private int pageSize ;//number True æ¯é¡µè®°å½æ»æ°ï¼è¦æ±å¤§äº0ä¸ä¸è¶ è¿1000 } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/UserAddFaceRequest.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,12 @@ package com.doumee.core.haikang.model.param.request; import lombok.Data; /** * 人è¸base64请æ±åæ° */ @Data public class UserAddFaceRequest { private String faceData;// string True 人è¸å¾çbase64ç¼ç åçå符 } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/UserAddRequest.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,24 @@ package com.doumee.core.haikang.model.param.request; import lombok.Data; import java.util.List; /** * ç¨æ·æ°å¢è¯·æ±åæ° */ @Data public class UserAddRequest { private Integer clientId;//number False 人åä¸´æ¶æ å¿ï¼å½è°ç¨æ¹æªæå®personIdæ¶ï¼clientIdä½ä¸ºäººåæ å¿ï¼å¨è¿åå¼ä¸æ å¿æ¯ä¸ªäººåçæ·»å ç»æãæä»¥æ¯æ¬¡æ¥å£è°ç¨ï¼æ¯ä¸ªäººåçclientidéä¿æå¯ä¸ï¼1~10个å符ï¼åªæ¯ææ°åãæ³¨ï¼clientidåªå¯¹æ¬æ¬¡è°ç¨ææ private String personId ;//string False 人åIDï¼å¯ä»¥æå®äººåpersonIdï¼ä¸å 许ä¸å ¶ä»äººåpersonIdéå¤ï¼å æ¬å·²å é¤ç人åã 为空æ¶å¹³å°èªå¨çæäººåID private String personName;// string True 人ååç§°ï¼1~32个å符ï¼ä¸è½å å« â / \ : * ? " < > private String gender;// string True æ§å«ï¼1ï¼ç·ï¼2ï¼å¥³ï¼0ï¼æªç¥ private String orgIndexCode;// string True æå±ç»ç»æ è¯ï¼å¿ é¡»æ¯å·²åå¨ç»ç»ï¼ä»è·åç»ç»å表æ¥å£è·åè¿ååæ°orgIndexCode private String birthday ;//string False åºçæ¥æï¼ä¸¾ä¾ï¼1992-09-12 private String phoneNo ;//string False ææºå·ï¼1-20使°å,å¹³å°ä¸äººåä¿¡æ¯å®åæ è¯éæ©ä¸ºææºå·ç æ¶å¿ å¡« private String email;// string False é®ç®±ï¼ä¸¾ä¾ï¼hic@163.com private String certificateType;// string False è¯ä»¶ç±»åï¼åèéå½A æ°æ®åå ¸ï¼å¹³å°ä¸äººåä¿¡æ¯å®åæ è¯éæ©ä¸ºèº«ä»½è¯ä»¶æ¶å¿ å¡« private String certificateNo;// string False è¯ä»¶å·ç ï¼1-20使°å忝ï¼å¹³å°ä¸äººåä¿¡æ¯å®åæ è¯éæ©ä¸ºèº«ä»½è¯ä»¶æ¶å¿ å¡« private String jobNo;// string False å·¥å·ï¼1-32个å符ï¼å¹³å°ä¸äººåä¿¡æ¯å®åæ è¯éæ©ä¸ºå·¥å·æ¶å¿ å¡« private List<UserAddFaceRequest> faces;// object[] False 人è¸ä¿¡æ¯ } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/VisitAppointmentMDJRequest.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,16 @@ package com.doumee.core.haikang.model.param.request; import lombok.Data; import java.util.List; @Data public class VisitAppointmentMDJRequest { private String receptionistId;// string True 被访人å¯ä¸æ è¯ï¼æ¥è¯¢äººåå表v2æ¥å£è·åè¿åæ¥æä¸çpersonIdåæ®µ private VisitAppointmentPermissonRequest visitorPermissionSet ;//object False æééåå°è£ 对象 private String visitStartTime;// string True é¢è®¡æ¥è®¿æ¶é´ï¼æ¶é´åæ°é满足ISO8601æ ¼å¼ï¼yyyy-MM-ddTHH:mm:ss+å½åæ¶åºï¼ä¾å¦å京æ¶é´ï¼2018-07-26T15:00:00+08:00 private String visitEndTime ;// string True é¢è®¡ç¦»å¼æ¶é´ï¼æ¶é´åæ°é满足ISO8601æ ¼å¼ï¼yyyy-MM-ddTHH:mm:ss+å½åæ¶åºï¼ä¾å¦å京æ¶é´ï¼2018-07-26T15:00:00+08:00é¢è®¡ç¦»å¼æ¶é´å¿ é¡»æäºå½åæ¶é´åé¢è®¡æ¥è®¿æ¶é´ private String visitPurpose;// string False æ¥è®¿äºç±ï¼é¿åº¦ä¸º0ï½32个å符 private VisitAppointmentVistorRequest visitorInfo ;//object True è®¿å®¢ä¿¡æ¯ } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/VisitAppointmentPermissonRequest.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,11 @@ package com.doumee.core.haikang.model.param.request; import lombok.Data; @Data public class VisitAppointmentPermissonRequest { private String defaultPrivilegeGroupFlag ;// string False æ¯å¦ä½¿ç¨é»è®¤æéç»(1ï¼ä½¿ç¨ï¼é1ï¼ä¸ä½¿ç¨) private String[] privilegeGroupIds ;//string[] False æéç»idsï¼æ¥è¯¢è®¿å®¢æéç»æ¥å£è·åè¿åæ¥æä¸çprivilegeGroupIdåæ®µ } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/VisitAppointmentRequest.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,16 @@ package com.doumee.core.haikang.model.param.request; import lombok.Data; import java.util.List; @Data public class VisitAppointmentRequest { private String receptionistId;// string True 被访人å¯ä¸æ è¯ï¼æ¥è¯¢äººåå表v2æ¥å£è·åè¿åæ¥æä¸çpersonIdåæ®µ private VisitAppointmentPermissonRequest visitorPermissionSet ;//object False æééåå°è£ 对象 private String visitStartTime;// string True é¢è®¡æ¥è®¿æ¶é´ï¼æ¶é´åæ°é满足ISO8601æ ¼å¼ï¼yyyy-MM-ddTHH:mm:ss+å½åæ¶åºï¼ä¾å¦å京æ¶é´ï¼2018-07-26T15:00:00+08:00 private String visitEndTime ;// string True é¢è®¡ç¦»å¼æ¶é´ï¼æ¶é´åæ°é满足ISO8601æ ¼å¼ï¼yyyy-MM-ddTHH:mm:ss+å½åæ¶åºï¼ä¾å¦å京æ¶é´ï¼2018-07-26T15:00:00+08:00é¢è®¡ç¦»å¼æ¶é´å¿ é¡»æäºå½åæ¶é´åé¢è®¡æ¥è®¿æ¶é´ private String visitPurpose;// string False æ¥è®¿äºç±ï¼é¿åº¦ä¸º0ï½32个å符 private List<VisitAppointmentVistorRequest> visitorInfoList ;// object[] True 访客信æ¯åè¡¨ï¼æå¤§æ¯æ128ä½è®¿å®¢ï¼å ¶ä¸æå¤æ¯æ4ä½è®¿å®¢å¸¦äººè¸ä¿¡æ¯ï¼å¦æåå¨äººè¸ä¸ä¼ 失败ï¼åæ´ä¸ªé¢çº¦å¤±è´¥ã } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/VisitAppointmentVistorRequest.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,22 @@ package com.doumee.core.haikang.model.param.request; import lombok.Data; @Data public class VisitAppointmentVistorRequest { private String visitorName ;//sstring True 访客å§åï¼é¿åº¦ä¸è¶ è¿32ï¼æ¯æä¸è±æå符ï¼ä¸è½å å« â / \ : * ? " < > private String gender;// number True 访客æ§å«1-ç·,2-女 private String phoneNo;// string True èç³»çµè¯ï¼å»ºè®®å¡«åææºå·ç ï¼ä» æ¯æçº¯æ°å private String plateNo;// string False 车çå·ï¼ä¸è½å å« â / \ : * ? " < > private String certificateType;// number False è¯ä»¶ç±»åï¼è¯¦è§éå½A.11 è¯ä»¶ç±»å private String certificateNo;//string False è¯ä»¶å·ç ï¼1~20个æ°åãåæ¯ç»æï¼è¯ä»¶å·ç é空æ¶ï¼è¯ä»¶ç±»åå¿ å¡«ï¼ private String certAddr;// string False è¯ä»¶å°ï¼æ¯æ1-128ä½åæ¯ãæ±å private String certIssuer;// string False åè¯æºå ³ï¼æ¯æ1-32ä½åæ¯ãæ±å private String nation;// number False private String birthplace;// string False ç±è´¯ï¼æ¯æ1-32ä½åæ¯ãæ±å private String visitorPhoto;// string False 头åbase64ç¼ç çåèæµï¼å¾çæå¤§200Kï¼ä» æ¯æjpgæ ¼å¼ãç±äºè®¿å®¢å¤´åéè¦ä¸åå°è®¾å¤ï¼å æ¤è¯¥æ¥å£ä¼å¯¹è®¿å®¢å¤´åè¿è¡è´¨éæ£æµï¼åªæäººè¸è¯å大äºçäº75æ¶ï¼æ¥å£æä¼è¿åæåï¼å¯éè¿äººè¸è¯åæ¥å£è·å人è¸å¾ççè¯åã请æä¾äºå®æ¸ æ°ï¼äººè¸å± ä¸çæ£é¢äººè¸å å ç §ç private String visitorWorkUnit;// string False æ¥è®¿åä½ï¼æ¯æ1-32ä½å符ï¼ä¸å å«â/ð?â<> private String visitorAddress;// string False 访客ä½åï¼æ¯æ1-128ä½ä¸è±ææ°å } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/AcsDeviceInfoResponse.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,40 @@ package com.doumee.core.haikang.model.param.respose; import lombok.Data; import java.math.BigDecimal; import java.util.List; @Data public class AcsDeviceInfoResponse { private String indexCode ;//string False èµæºå¯ä¸ç¼ç private String resourceType;// string False èµæºç±»åï¼è¯¦è§éå½A.2 èµæºç±»å private String name;// string False èµæºåç§° private String parentIndexCode;// string False ç¶çº§èµæºç¼å· private String devTypeCode;// string False é¨ç¦è®¾å¤ç±»åç¼ç ï¼è¯¦è§éå½A.7 é¨ç¦è®¾å¤ç±»åä¸é¨ç¦è®¾å¤ç±»åç¼å· private String devTypeDesc;// string False é¨ç¦è®¾å¤ç±»ååå·ï¼è¯¦è§éå½A.7 é¨ç¦è®¾å¤ç±»åä¸é¨ç¦è®¾å¤ç±»å private String deviceCode ;//string False 主å¨è®¾å¤ç¼å· private String manufacturer;// string False åå private String regionIndexCode;// string False æå±åºå private String regionPath ;//string False æå±åºåè·¯å¾,以@符å·åå²ï¼å 嫿¬èç¹ private String treatyType;// string False æ¥å ¥åè®®ï¼è¯¦è§éå½A.6 ç¼ç è®¾å¤æ¥å ¥åè®® private Integer cardCapacity;// number False 设å¤å¡å®¹é private Integer fingerCapacity;// number False æçº¹å®¹é private Integer veinCapacity;// number False æéè容é private Integer faceCapacity ;//number False 人è¸å®¹é private Integer doorCapacity;// number False é¨å®¹é private String deployId ;//string False æ¨ç private String createTime ;//string False å建æ¶é´ private String updateTime ;//string False æ´æ°æ¶é´ private String description;// string False æè¿° private String netZoneId ;//string False æå±ç½å private String acsReaderVerifyModeAbility ;//string False æ¯æè®¤è¯æ¹å¼ï¼æ°æ®ä¸ºåè¿å¶ private String regionName ;//string False åºååç§° private String regionPathName;// string False æå±åºåè·¯å¾åï¼ä»¥"/"åé private String ip ;//string False é¨ç¦è®¾å¤IP private String port;// string False é¨ç¦è®¾å¤ç«¯å£ private String capability;// string False 设å¤è½åé(å«è®¾å¤ä¸çæºè½è½å)ï¼è¯¦è§éå½A.44 设å¤è½åé private String devSerialNum;// string False 设å¤åºåå· private String dataVersion;// string False çæ¬å· } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/AcsDeviceListResponse.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,15 @@ package com.doumee.core.haikang.model.param.respose; import lombok.Data; import java.util.List; @Data public class AcsDeviceListResponse { private int total;// number False æ¥è¯¢æ°æ®è®°å½æ»æ° private int pageSize;// number False æ¯é¡µè®°å½æ»æ° private int pageNo ;// number False å½å页ç private List<AcsDeviceInfoResponse> list ;// object[] False æéç»å¯¹è±¡å表 } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/EntranceListResponse.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,14 @@ package com.doumee.core.haikang.model.param.respose; import lombok.Data; @Data public class EntranceListResponse { private String entranceIndexCode ;// string False åºå ¥å£å¯ä¸æ è¯ï¼æå¤§é¿åº¦64ï¼ private String entranceName ;// string False åºå ¥å£åç§°ï¼æå¤§é¿åº¦64ï¼ private String parkIndexCode ;// string False å车åºå¯ä¸æ è¯ï¼æå¤§é¿åº¦64ï¼ private String roadNum ;// number False è½¦éæ°ï¼æå¤§é¿åº¦32ï¼ private String createTime;// string False å建æ¶é´ è¦æ±éµå®ISO8601æ åï¼å¦2018-07-26T21:30:08+08:00表示å京æ¶é´2017å¹´7æ26æ¥21æ¶30å08ç§ private String updateTime;// string False æ´æ°æ¶é´ è¦æ±éµå®ISO8601æ åï¼å¦2018-07-26T21:30:08+08:00表示å京æ¶é´2017å¹´7æ26æ¥21æ¶30å08ç§ } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/FaceAddOrEditesponse.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,11 @@ package com.doumee.core.haikang.model.param.respose; import lombok.Data; @Data public class FaceAddOrEditesponse { private String faceId;// string False 人è¸Id private String faceUrl;// string False 人è¸å¾çUrl private String personId;// string False 人åID } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/OrgListResponse.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,15 @@ package com.doumee.core.haikang.model.param.respose; import lombok.Data; @Data public class OrgListResponse { private String orgIndexCode;// ç»ç»å¯ä¸æ è¯ç ï¼æå¤§é¿åº¦64ï¼ private String orgNo ;//string False ç»ç»ç¼å·ï¼æå¤§é¿åº¦64ï¼ private String orgName;// string False ç»ç»åç§°ï¼æå¤§é¿åº¦64ï¼ å½åç»ç»çåç§°ï¼å¦é»è®¤é¨é¨ private String orgPath ;//string False ç»ç»ç®å½ï¼æå¤§é¿åº¦64ï¼ ä¾å¦ï¼é»è®¤é¨é¨/综åå®é²/å¼åå°ç» private String parentOrgIndexCode;// string False ç¶ç»ç»å¯ä¸æ è¯ç ï¼æå¤§é¿åº¦64ï¼ private String parentOrgName;// string False ç¶ç»ç»åç§°ï¼æå¤§é¿åº¦64ï¼ private String updateTime;// string False æ´æ°æ¶é´ è¦æ±éµå®ISO8601æ åï¼å¦2018-07-26T21:30:08+08:00表示å京æ¶é´2017å¹´7æ26æ¥21æ¶30å08ç§ } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/OrgOrUserAddFailureResponse.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,10 @@ package com.doumee.core.haikang.model.param.respose; import lombok.Data; @Data public class OrgOrUserAddFailureResponse { private String clientId ;//number False è°ç¨æ¹æå®Id private String code ;//string False é误ç private String msg ;//string False éè¯¯ä¿¡æ¯ } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/OrgOrUserAddResponse.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,11 @@ package com.doumee.core.haikang.model.param.respose; import lombok.Data; import java.util.List; @Data public class OrgOrUserAddResponse { private List<OrgOrUserAddSuccessResponse> successes ;//object[] False æ¹éæ·»å æåçè®°å½ private List<OrgOrUserAddFailureResponse> failures;// object[] False æ¹éæ·»å 失败çè®°å½ } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/OrgOrUserAddSuccessResponse.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,10 @@ package com.doumee.core.haikang.model.param.respose; import lombok.Data; @Data public class OrgOrUserAddSuccessResponse { private String clientId;// number False è°ç¨æ¹æå®Id private String orgIndexCode;// string False æå¡ç«¯çæçå¯ä¸æ è¯ } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/ParkListResponse.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,13 @@ package com.doumee.core.haikang.model.param.respose; import lombok.Data; @Data public class ParkListResponse { private String parkIndexCode ;// string False å车åºå¯ä¸æ è¯ï¼æå¤§é¿åº¦64ï¼ private String parentParkIndexCode;// string False ç¶å车åºå¯ä¸æ è¯ï¼æå¤§é¿åº¦64ï¼ private String parkName;// string False å车åºåç§°ï¼æå¤§é¿åº¦64ï¼ private String createTime ;// string False å建æ¶é´ éµå®ISO8601æ åï¼å¦2017-11-12T15:41:11.688+08:00表示å京æ¶é´2017å¹´11æ12æ¥15æ¶41å11.688ç§ private String updateTime;// string False æ´æ°æ¶é´ éµå®ISO8601æ åï¼å¦2017-11-12T15:41:11.688+08:00表示å京æ¶é´2017å¹´11æ12æ¥15æ¶41å11.688ç§ } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/ParkReservationAddResponse.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,9 @@ package com.doumee.core.haikang.model.param.respose; import lombok.Data; @Data public class ParkReservationAddResponse { private String reserveOrderNo ;//string False é¢çº¦åå· private String reserveTime ;//number False é¢çº¦æææ¶é´ï¼åä½ï¼åé } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/PrivilegeGroupListResponse.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,15 @@ package com.doumee.core.haikang.model.param.respose; import lombok.Data; import java.util.List; @Data public class PrivilegeGroupListResponse { private String privilegeGroupId;// string False æéç»ID, ç¨äºè®¿å®¢ç»è®°æ¶å¯¹è®¿å®¢ææ private String privilegeGroupName;// string False æéç»åç§° private String remark;// string False æè¿° private Integer isDefault ;//number False æ¯å¦æ¯é»è®¤æéç»0: æ¯1: å¦ } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/PrivilegeGroupResponse.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,15 @@ package com.doumee.core.haikang.model.param.respose; import lombok.Data; import java.util.List; @Data public class PrivilegeGroupResponse { private int total;// number False æ¥è¯¢æ°æ®è®°å½æ»æ° private int pageSize;// number False æ¯é¡µè®°å½æ»æ° private int pageNo ;// number False å½å页ç private List<PrivilegeGroupListResponse> list ;// object[] False æéç»å¯¹è±¡å表 } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/UserAddResponse.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,11 @@ package com.doumee.core.haikang.model.param.respose; import lombok.Data; import java.util.List; @Data public class UserAddResponse { private String personId ;//string False æåæ·»å ç人åId private String faceId;// string False æåæ·»å ç人è¸Id } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/UserDelResponse.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,10 @@ package com.doumee.core.haikang.model.param.respose; import lombok.Data; @Data public class UserDelResponse { private String personId ;//string False äººåæ å¿ private String code ;//string False é误ç private String msg;// string False éè¯¯ä¿¡æ¯ } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/VisitAppointmentResponse.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,14 @@ package com.doumee.core.haikang.model.param.respose; import com.doumee.core.haikang.model.param.request.VisitAppointmentPermissonRequest; import com.doumee.core.haikang.model.param.request.VisitAppointmentVistorRequest; import lombok.Data; import java.util.List; @Data public class VisitAppointmentResponse { private String appointRecordId;// string False é¢çº¦è®°å½IDï¼å¯ä½ä¸ºä¿®æ¹ãåæ¶é¢çº¦ç便® private List<VisitAppointmentVistorRequest> appointmentInfoList;// object[] False é¢çº¦è¯¦ç»ä¿¡æ¯ } server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/VisitAppointmentVistorResponse.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,18 @@ package com.doumee.core.haikang.model.param.respose; import lombok.Data; @Data public class VisitAppointmentVistorResponse { private String visitorName ;//string False 访客å§åï¼æ¯æä¸è±æå符ï¼ä¸è½å å« â / \ : * ? " < > private String appointRecordId ;// string False é¢çº¦è®°å½ID private String receptionistId ;// string False 被访人å¯ä¸æ è¯ private String receptionistName ;// string False 被访人å§åï¼æ¯æä¸è±æå符ï¼ä¸è½å å« â / \ : * ? " < > private String verificationCode ;//string False 访客éªè¯ç ï¼å¯ç¨äºè®¿å®¢å¨è®¿å®¢æºç»è®°çåè¯ï¼ æåæä½ä¸ºæ¥è¯¢æ¡ä»¶ä½¿ç¨ private String QRCode ;// string False 卿äºç»´ç å 容ï¼å¦éè¦ä½¿ç¨ï¼å°è®¿å®¢äºç»´ç å 容转æäºç»´ç å¾çå³å¯ private String orderId ;//string False 访客记å½å¯ä¸æ è¯ï¼ç¨äºå·²é¢çº¦ç»è®°ã访客ç¾ç¦»çæä½ private String picUri ;// string False 访客头å,è¿åå¾ççç¸å¯¹Uri private String svrIndexCode ;// string False å¾çå卿å¡çå¯ä¸æ è¯ } server/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,440 @@ package com.doumee.core.haikang.service; import com.alibaba.fastjson.JSONObject; import com.doumee.biz.system.SystemDictDataBiz; import com.doumee.core.haikang.model.param.request.*; import com.doumee.core.haikang.model.param.respose.*; import com.doumee.core.utils.Constants; import com.doumee.core.haikang.model.HKConstants; import com.doumee.core.haikang.model.HKTools; import com.doumee.core.haikang.model.param.BaseRequst; import com.doumee.core.haikang.model.param.BaseResponse; import com.hikvision.artemis.sdk.config.ArtemisConfig; import lombok.extern.slf4j.Slf4j; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.annotation.PostConstruct; import com.alibaba.fastjson.TypeReference; import java.io.InputStream; import java.util.List; @Service @Slf4j public class HKService { private Logger logger = LoggerFactory.getLogger(HKService.class); @Autowired private SystemDictDataBiz systemDictDataBiz; @PostConstruct public int initHkConfig(){ ArtemisConfig.host = systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_HOST).getCode(); ArtemisConfig.appKey = systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_APPKEY).getCode(); ArtemisConfig.appSecret = systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_APPSECRET).getCode(); HKConstants.https = systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_HTTPS).getCode(); return 0; } /** * è·åæ ¹ç»ç»æ°æ® * @return */ public BaseResponse<OrgListResponse> getRootOrg(BaseRequst param){ log.error("ãæµ·åº·è·åæ ¹ç»ç»ã================å¼å§===="); try { String res = HKTools.getRootOrg (); TypeReference typeReference = new TypeReference< BaseResponse<OrgListResponse>>(){}; BaseResponse<OrgListResponse> result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·è·åæ ¹ç»ç»ã================æå====\n"+res); return result; }catch (Exception e){ log.error("ãæµ·åº·è·åæ ¹ç»ç»ã================失败====ï¼\n"+ e.getMessage()); } return null; } /** * ä¿®æ¹ç»ç»æ°æ® * @return */ public BaseResponse editOrg(OrgEditRequest param){ log.error("ãæµ·åº·ä¿®æ¹ç»ç»ã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.editOrg(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse>(){}; BaseResponse result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·ä¿®æ¹ç»ç»ã================æå====\n"+res); return result; }catch (Exception e){ log.error("ãæµ·åº·ä¿®æ¹ç»ç»ã================失败====ï¼\n"+ e.getMessage()); } return null; } /** *æ¹éæ°å¢ç»ç»æ°æ® * @return */ public BaseResponse<OrgOrUserAddResponse> addBatchOrg(List<OrgAddRequest> param){ log.error("ãæµ·åº·æ°å¢ç»ç»ã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.addBatchOrg(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse<OrgOrUserAddResponse>>(){}; BaseResponse<OrgOrUserAddResponse> result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·æ°å¢ç»ç»ã================æå====\n"+res); return result; }catch (Exception e){ log.error("ãæµ·åº·æ°å¢ç»ç»ã================失败====ï¼\n"+ e.getMessage()); } return null; } /** *æ¹éå é¤ç»ç»æ°æ® * @return */ public BaseResponse delBatchOrg(OrgDelRequest param){ log.error("ãæµ·åº·å é¤ç»ç»ã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.delOrg(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse >(){}; BaseResponse result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·å é¤ç»ç»ã================æå====\n"+res); return result; }catch (Exception e){ log.error("ãæµ·åº·å é¤ç»ç»ã================失败====ï¼\n"+ e.getMessage()); } return null; } /** *æ°å¢äººåä¿¡æ¯ï¼æ¯æäººè¸æ°æ®ï¼ * @return */ public BaseResponse<UserAddResponse> addUser(UserAddRequest param){ log.error("ãæµ·åº·æ°å¢äººåã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.addUser(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse<UserAddResponse>>(){}; BaseResponse<UserAddResponse> result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·æ°å¢äººåã================æå====\n"+res); return result; }catch (Exception e){ log.error("ãæµ·åº·æ°å¢äººåã================失败====ï¼\n"+ e.getMessage()); } return null; } /** *ä¿®æ¹äººåä¿¡æ¯ï¼ä¸æ¯æäººè¸æ°æ®ï¼ * @return */ public BaseResponse editUser(UserAddRequest param){ log.error("ãæµ·åº·ä¿®æ¹äººåã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.editUser(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse<UserAddResponse>>(){}; BaseResponse<UserAddResponse> result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·ä¿®æ¹äººåã================æå====\n"+res); return result; }catch (Exception e){ log.error("ãæµ·åº·ä¿®æ¹äººåã================失败====ï¼\n"+ e.getMessage()); } return null; } /** *æ¹éæ°å¢äººåä¿¡æ¯(æ 人è¸ï¼ * @return */ public BaseResponse<OrgOrUserAddResponse> addBatchUser(List<UserAddRequest> param){ log.error("ãæµ·åº·æ¹éæ°å¢äººåã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.addBatchUser(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse<OrgOrUserAddResponse>>(){}; BaseResponse<OrgOrUserAddResponse> result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·æ¹éæ°å¢äººåã================æå====\n"+res); return result; }catch (Exception e){ log.error("ãæµ·åº·æ¹éæ°å¢äººåã================失败====ï¼\n"+ e.getMessage()); } return null; } /** *æ¹éå é¤äººåä¿¡æ¯ * @return */ public BaseResponse<OrgOrUserAddFailureResponse> delBatchUser(List<UserAddRequest> param){ log.error("ãæµ·åº·æ¹éæ°å¢äººåã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.delBatchUser(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse<OrgOrUserAddFailureResponse>>(){}; BaseResponse<OrgOrUserAddFailureResponse> result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·æ¹éæ°å¢äººåã================æå====\n"+res); return result; }catch (Exception e){ log.error("ãæµ·åº·æ¹éæ°å¢äººåã================失败====ï¼\n"+ e.getMessage()); } return null; } /** *æ·»å 人è¸ä¿¡æ¯ * @return */ public BaseResponse<FaceAddOrEditesponse> addFace(List<FaceAddRequest> param){ log.error("ãæµ·åº·æ·»å 人è¸ä¿¡æ¯ã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.addFace(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse<FaceAddOrEditesponse>>(){}; BaseResponse<FaceAddOrEditesponse> result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·æ·»å 人è¸ä¿¡æ¯ã================æå====\n"+res); return result; }catch (Exception e){ log.error("ãæµ·åº·æ·»å 人è¸ä¿¡æ¯ã================失败====ï¼\n"+ e.getMessage()); } return null; } /** *ç¼è¾äººè¸ä¿¡æ¯ * @return */ public BaseResponse<FaceAddOrEditesponse> editFace(List<FaceEditRequest> param){ log.error("ãæµ·åº·ç¼è¾äººè¸ä¿¡æ¯ã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.editFace(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse<FaceAddOrEditesponse>>(){}; BaseResponse<FaceAddOrEditesponse> result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·ç¼è¾äººè¸ä¿¡æ¯ã================æå====\n"+res); return result; }catch (Exception e){ log.error("ãæµ·åº·ç¼è¾äººè¸ä¿¡æ¯ã================失败====ï¼\n"+ e.getMessage()); } return null; } /** *å é¤äººè¸ä¿¡æ¯ * @return */ public BaseResponse delFace(List<FaceEditRequest> param){ log.error("ãæµ·åº·å é¤äººè¸ä¿¡æ¯ã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.editFace(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse>(){}; BaseResponse result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·å é¤äººè¸ä¿¡æ¯ã================æå====\n"+res); return result; }catch (Exception e){ log.error("ãæµ·åº·å é¤äººè¸ä¿¡æ¯ã================失败====ï¼\n"+ e.getMessage()); } return null; } /** * è·å海康人è¸è®¿é®å°å * @return */ public static InputStream getFaceInputStream(FacePictureRequest param) { log.error("ãæµ·åº·äººè¸è®¿é®å¾çæµã================å¼å§===="+JSONObject.toJSONString(param)); try { InputStream res = HKTools.getFaceInputStream(JSONObject.toJSONString(param)); log.error("ãæµ·åº·äººè¸è®¿é®å¾çæµã================æå====\n"); return res; }catch (Exception e){ log.error("ãæµ·åº·äººè¸è®¿é®å¾çæµã================失败====ï¼\n"+ e.getMessage()); } return null; } /** *è·å车åºåè¡¨æ°æ®ï¼å ¨éï¼ * @return */ public BaseResponse<List<ParkListResponse>> parkList(ParkListRequest param){ log.error("ãæµ·è·å车åºåè¡¨æ°æ®ã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.parkList(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse<List<ParkListResponse>>>(){}; BaseResponse result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·è·å车åºåè¡¨æ°æ®ã================æå====\n"+res); return result; }catch (Exception e){ log.error("ãæµ·åº·è·å车åºåè¡¨æ°æ®ã================失败====ï¼\n"+ e.getMessage()); } return null; } /** *è·å车åºåè¡¨æ°æ®ï¼å ¨éï¼ * @return */ public BaseResponse<List<EntranceListResponse>> entranceList(EntranceListRequest param){ log.error("ãæµ·è·å车åºåè¡¨æ°æ®ã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.entranceList(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse<List<EntranceListResponse>>>(){}; BaseResponse result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·è·å车åºåè¡¨æ°æ®ã================æå====\n"+res); return result; }catch (Exception e){ log.error("ãæµ·åº·è·å车åºåè¡¨æ°æ®ã================失败====ï¼\n"+ e.getMessage()); } return null; } /** *åºå®è½¦è¾å å¼ï¼å æï¼ * @return */ public BaseResponse carChargeAddtion(CarChargeAddRequest param){ log.error("ãæµ·åº·åºå®è½¦è¾å å¼ã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.carChargeAddtion(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse>(){}; BaseResponse result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·åºå®è½¦è¾å å¼ã================æå====\n"+res); return result; }catch (Exception e){ log.error("ãæµ·åº·åºå®è½¦è¾å å¼ã================失败====ï¼\n"+ e.getMessage()); } return null; } /** *åºå®è½¦è¾åæ¶å æ * @return */ public BaseResponse carChargeDeletion(CarChargeDelRequest param){ log.error("ãæµ·åº·åºå®è½¦è¾åæ¶å æã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.carChargeDeletion(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse>(){}; BaseResponse result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·åºå®è½¦è¾åæ¶å æã================æå====\n"+res); return result; }catch (Exception e){ log.error("ãæµ·åº·åºå®è½¦è¾åæ¶å æã================失败====ï¼\n"+ e.getMessage()); } return null; } /** *车ä½é¢çº¦ * @return */ public BaseResponse<ParkReservationAddResponse> parkReservationAddition(ParkReservationAddRequest param){ log.error("ãæµ·åº·è½¦ä½é¢çº¦ã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.parkAddition(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse<ParkReservationAddResponse>>(){}; BaseResponse<ParkReservationAddResponse> result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·è½¦ä½é¢çº¦ã================æå====\n"+res); return result; }catch (Exception e){ log.error("ãæµ·åº·è½¦ä½é¢çº¦ã================失败====ï¼\n"+ e.getMessage()); } return null; } /** *车ä½åæ¶é¢çº¦ * @return */ public BaseResponse parkReservationDeletion(ParkReservationDelRequest param){ log.error("ãæµ·åº·è½¦ä½åæ¶é¢çº¦ã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.carChargeDeletion(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse>(){}; BaseResponse result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·è½¦ä½åæ¶é¢çº¦ã================æå====\n"+res); return result; }catch (Exception e){ log.error("ãæµ·åº·è½¦ä½åæ¶é¢çº¦ã================失败====ï¼\n"+ e.getMessage()); } return null; } /** *访客é¢çº¦ * @return */ public BaseResponse<VisitAppointmentResponse> visitAppiontment(VisitAppointmentRequest param){ log.error("ãæµ·åº·è®¿å®¢é¢çº¦ã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.visitAppiontment(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse<VisitAppointmentResponse>>(){}; BaseResponse<VisitAppointmentResponse> result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·è®¿å®¢é¢çº¦ã================æå====\n"+res); return result; }catch (Exception e){ log.error("ãæµ·åº·è®¿å®¢é¢çº¦ã================失败====ï¼\n"+ e.getMessage()); } return null; } /** *访客å ç»è®°é¢çº¦ * @return */ public BaseResponse<VisitAppointmentVistorResponse> visitAppiontmentMDJ(VisitAppointmentMDJRequest param){ log.error("ãæµ·åº·è®¿å®¢å ç»è®°é¢çº¦ã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.visitAppiontmentMDJ(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse<VisitAppointmentVistorResponse> >(){}; BaseResponse<VisitAppointmentVistorResponse> result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·è®¿å®¢å ç»è®°é¢çº¦ã================æå====\n"+res); return result; }catch (Exception e){ log.error("ãæµ·åº·è®¿å®¢å ç»è®°é¢çº¦ã================失败====ï¼\n"+ e.getMessage()); } return null; } /** *访客æéç»å表æ¥è¯¢ï¼åé¡µï¼ * @return */ public BaseResponse<PrivilegeGroupResponse> privilegeGroup(PrivilegeGroupRequest param){ log.error("ãæµ·åº·è®¿å®¢æéç»å表æ¥è¯¢ã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.privilegeGroup(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse<PrivilegeGroupResponse> >(){}; BaseResponse<PrivilegeGroupResponse> result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·è®¿å®¢æéç»å表æ¥è¯¢ã================æå====\n"+res); return result; }catch (Exception e){ log.error("ãæµ·åº·è®¿å®¢æéç»å表æ¥è¯¢ã================失败====ï¼\n"+ e.getMessage()); } return null; } /** *é¨ç¦è®¾å¤æ¥è¯¢ï¼åé¡µï¼ * @return */ public BaseResponse<AcsDeviceListResponse> acsDeviceList(AcsDeviceListRequest param){ log.error("ãæµ·åº·é¨ç¦è®¾å¤æ¥è¯¢ã================å¼å§===="+JSONObject.toJSONString(param)); try { String res = HKTools.acsDeviceList(JSONObject.toJSONString(param)); TypeReference typeReference = new TypeReference< BaseResponse<AcsDeviceListResponse> >(){}; BaseResponse<AcsDeviceListResponse> result = JSONObject.parseObject(res, typeReference.getType()); log.error("ãæµ·åº·é¨ç¦è®¾å¤æ¥è¯¢ã================æå====\n"+res); return result; }catch (Exception e){ log.error("ãæµ·åº·é¨ç¦è®¾å¤æ¥è¯¢ã================失败====ï¼\n"+ e.getMessage()); } return null; } } server/dmvisit_service/src/main/java/com/doumee/core/utils/FtpUtil.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,652 @@ package com.doumee.core.utils; import java.io.*; import java.util.UUID; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.commons.net.PrintCommandListener; import org.apache.commons.net.ftp.FTP; import org.apache.commons.net.ftp.FTPClient; import org.apache.commons.net.ftp.FTPFile; import org.apache.commons.net.ftp.FTPReply; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.util.EntityUtils; import sun.misc.BASE64Encoder; /** */ /** * æ¯ææç¹ç»ä¼ çFTPå®ç¨ç±» * * @author BenZhou http://www.bt285.cn * @version 0.1 å®ç°åºæ¬æç¹ä¸ä¼ ä¸è½½ * @version 0.2 å®ç°ä¸ä¼ ä¸è½½è¿åº¦æ±æ¥ * @version 0.3 å®ç°ä¸æç®å½å建å䏿æä»¶åå»ºï¼æ·»å 对äºä¸æçæ¯æ */ @Slf4j public class FtpUtil { public FTPClient ftpClient = new FTPClient(); public FtpUtil() { // 设置å°è¿ç¨ä¸ä½¿ç¨å°çå½ä»¤è¾åºå°æ§å¶å° this.ftpClient.addProtocolCommandListener(new PrintCommandListener( new PrintWriter(System.out))); } public FtpUtil(String hostname, int port, String username, String password) throws IOException { // 设置å°è¿ç¨ä¸ä½¿ç¨å°çå½ä»¤è¾åºå°æ§å¶å° connect(hostname, port, username, password); } /** */ /** * è¿æ¥å°FTPæå¡å¨ * * @param hostname * 主æºå * @param port * ç«¯å£ * @param username * ç¨æ·å * @param password * å¯ç * @return æ¯å¦è¿æ¥æå * @throws IOException */ public boolean connect(String hostname, int port, String username, String password) throws IOException { ftpClient.connect(hostname, port); ftpClient.setControlEncoding("GBK"); if (FTPReply.isPositiveCompletion(ftpClient.getReplyCode())) { if (ftpClient.login(username, password)) { return true; } } disconnect(); return false; } /** */ /** * ä»FTPæå¡å¨ä¸ä¸è½½æä»¶,æ¯ææç¹ç»ä¼ ï¼ä¸ä¼ ç¾åæ¯æ±æ¥ * * @param remote * è¿ç¨æä»¶è·¯å¾ * @param local * æ¬å°æä»¶è·¯å¾ * @return ä¸ä¼ çç¶æ * @throws IOException */ public String download(String remote, String local) throws IOException { // è®¾ç½®è¢«å¨æ¨¡å¼ ftpClient.enterLocalPassiveMode(); // 设置以äºè¿å¶æ¹å¼ä¼ è¾ ftpClient.setFileType(FTP.BINARY_FILE_TYPE); String result; // æ£æ¥è¿ç¨æä»¶æ¯å¦åå¨ FTPFile[] files = ftpClient.listFiles(new String( remote.getBytes("GBK"), "iso-8859-1")); if (files.length != 1) { // System.out.println("è¿ç¨æä»¶ä¸åå¨"); return "è¿ç¨æä»¶ä¸åå¨"; } long lRemoteSize = files[0].getSize(); File f = new File(local); // æ¬å°å卿件ï¼è¿è¡æç¹ä¸è½½ if (f.exists()) { long localSize = f.length(); // 夿æ¬å°æä»¶å¤§å°æ¯å¦å¤§äºè¿ç¨æä»¶å¤§å° if (localSize >= lRemoteSize) { // System.out.println("æ¬å°æä»¶å¤§äºè¿ç¨æä»¶ï¼ä¸è½½ä¸æ¢"); // return "æ¬å°æä»¶å¤§äºè¿ç¨æä»¶ï¼ä¸è½½ä¸æ¢"; } // è¿è¡æç¹ç»ä¼ ï¼å¹¶è®°å½ç¶æ FileOutputStream out = new FileOutputStream(f, true); ftpClient.setRestartOffset(localSize); InputStream in = ftpClient.retrieveFileStream(new String(remote .getBytes("GBK"), "iso-8859-1")); byte[] bytes = new byte[1024]; long step = lRemoteSize / 100; long process = localSize / step; int c; while ((c = in.read(bytes)) != -1) { out.write(bytes, 0, c); localSize += c; long nowProcess = localSize / step; if (nowProcess > process) { process = nowProcess; if (process % 10 == 0) System.out.println("ä¸è½½è¿åº¦ï¼" + process); // TODO æ´æ°æä»¶ä¸è½½è¿åº¦,å¼åæ¾å¨processåéä¸ } } in.close(); out.close(); boolean isDo = ftpClient.completePendingCommand(); if (isDo) { result = "300"; // result = DownloadStatus.Download_From_Break_Success; } else { result = "400"; // result = DownloadStatus.Download_From_Break_Failed; } } else { OutputStream out = new FileOutputStream(f); InputStream in = ftpClient.retrieveFileStream(new String(remote .getBytes("GBK"), "iso-8859-1")); byte[] bytes = new byte[1024]; long step = lRemoteSize / 100; long process = 0; long localSize = 0L; int c; while ((c = in.read(bytes)) != -1) { out.write(bytes, 0, c); localSize += c; long nowProcess = localSize / step; if (nowProcess > process) { process = nowProcess; if (process % 10 == 0) System.out.println("ä¸è½½è¿åº¦ï¼" + process); // TODO æ´æ°æä»¶ä¸è½½è¿åº¦,å¼åæ¾å¨processåéä¸ } } in.close(); out.close(); boolean upNewStatus = ftpClient.completePendingCommand(); if (upNewStatus) { result = "500"; // result = DownloadStatus.Download_New_Success; } else { // result = DownloadStatus.Download_New_Failed; result = "600"; } } return result; } /** */ /** * ä¸ä¼ æä»¶å°FTPæå¡å¨ï¼æ¯ææç¹ç»ä¼ * * @param local * æ¬å°æä»¶åç§°ï¼ç»å¯¹è·¯å¾ * @param remote * è¿ç¨æä»¶è·¯å¾ï¼ä½¿ç¨/home/directory1/subdirectory/file.extææ¯ * http://www.guihua.org /subdirectory/file.ext * æç §Linuxä¸çè·¯å¾æå®æ¹å¼ï¼æ¯æå¤çº§ç®å½åµå¥ï¼æ¯æéå½å建ä¸åå¨çç®å½ç»æ * @return ä¸ä¼ ç»æ * @throws IOException */ public String upload(String local, String remote) throws IOException { // 设置PassiveModeä¼ è¾ ftpClient.enterLocalPassiveMode(); // 设置以äºè¿å¶æµçæ¹å¼ä¼ è¾ ftpClient.setFileType(FTP.BINARY_FILE_TYPE); ftpClient.setControlEncoding("GBK"); String result; // 对è¿ç¨ç®å½çå¤ç String remoteFileName = remote; if (remote.contains(File.separator)) { remoteFileName = remote.substring(remote.lastIndexOf(File.separator) + 1); // å建æå¡å¨è¿ç¨ç®å½ç»æï¼åå»ºå¤±è´¥ç´æ¥è¿å if (StringUtils.equals(CreateDirecroty(remote, ftpClient), "2")) { return "2"; } } // æ£æ¥è¿ç¨æ¯å¦å卿件 FTPFile[] files = ftpClient.listFiles(new String(remoteFileName .getBytes("GBK"), "iso-8859-1")); if (files.length == 1) { long remoteSize = files[0].getSize(); File f = new File(local); long localSize = f.length(); if (remoteSize == localSize) { return "700"; // return UploadStatus.File_Exits; } else if (remoteSize > localSize) { return "800"; // return UploadStatus.Remote_Bigger_Local; } // å°è¯ç§»å¨æä»¶å 读åæé,å®ç°æç¹ç»ä¼ result = uploadFile(remoteFileName, f, ftpClient, remoteSize); // 妿æç¹ç»ä¼ 没ææåï¼åå 餿å¡å¨ä¸æä»¶ï¼éæ°ä¸ä¼ if (StringUtils.equals(result, "1")) { if (!ftpClient.deleteFile(remoteFileName)) { return "1"; } result = uploadFile(remoteFileName, f, ftpClient, 0); } } else { result = uploadFile(remoteFileName, new File(local), ftpClient, 0); } return result; } public int getNumFromStr(String str,char searchstr) { int count = 0; char[] charArray = str.toCharArray(); for (char param : charArray) { if (param == searchstr) { count++; } } return count; } /** */ /** * ä¸ä¼ æä»¶å°FTPæå¡å¨ï¼æ¯ææç¹ç»ä¼ * * @param localFile * æ¬å°æä»¶æµ * @param remote * è¿ç¨æä»¶è·¯å¾ï¼ä½¿ç¨/home/directory1/subdirectory/file.extææ¯ * http://www.guihua.org /subdirectory/file.ext * æç §Linuxä¸çè·¯å¾æå®æ¹å¼ï¼æ¯æå¤çº§ç®å½åµå¥ï¼æ¯æéå½å建ä¸åå¨çç®å½ç»æ * @return ä¸ä¼ ç»æ * @throws IOException */ public String uploadFile(File localFile, String remote) throws IOException { // 设置PassiveModeä¼ è¾ ftpClient.enterLocalPassiveMode(); // 设置以äºè¿å¶æµçæ¹å¼ä¼ è¾ ftpClient.setFileType(FTP.BINARY_FILE_TYPE); ftpClient.setControlEncoding("GBK"); String result; // 对è¿ç¨ç®å½çå¤ç String remoteFileName = remote ; if (remote.contains(File.separator)) { remoteFileName = remote.substring(remote.lastIndexOf(File.separator) + 1); // å建æå¡å¨è¿ç¨ç®å½ç»æï¼åå»ºå¤±è´¥ç´æ¥è¿å if (StringUtils.equals(CreateDirecroty(remote, ftpClient), "2")) { return "2"; } } // æ£æ¥è¿ç¨æ¯å¦å卿件 FTPFile[] files = ftpClient.listFiles(new String(remoteFileName .getBytes("GBK"), "iso-8859-1")); if (files.length == 1) { long remoteSize = files[0].getSize(); long localSize = localFile.length(); if (remoteSize == localSize) { return "700"; // return UploadStatus.File_Exits; } else if (remoteSize > localSize) { return "800"; // return UploadStatus.Remote_Bigger_Local; } // å°è¯ç§»å¨æä»¶å 读åæé,å®ç°æç¹ç»ä¼ result = uploadFile(remoteFileName, localFile, ftpClient, remoteSize); // 妿æç¹ç»ä¼ 没ææåï¼åå 餿å¡å¨ä¸æä»¶ï¼éæ°ä¸ä¼ if (StringUtils.equals(result, "1")) { if (!ftpClient.deleteFile(remoteFileName)) { return "1"; } result = uploadFile(remoteFileName, localFile, ftpClient, 0); } // if (result == UploadStatus.Upload_From_Break_Failed) { // if (!ftpClient.deleteFile(remoteFileName)) { // return UploadStatus.Delete_Remote_Faild; // } // result = uploadFile(remoteFileName, f, ftpClient, 0); // } } else { result = uploadFile(remoteFileName, localFile, ftpClient, 0); } return result; } /** */ /** * æå¼ä¸è¿ç¨æå¡å¨çè¿æ¥ * * @throws IOException */ public void disconnect() throws IOException { if (ftpClient.isConnected()) { ftpClient.disconnect(); } } /** */ /** * éå½å建è¿ç¨æå¡å¨ç®å½ * * @param remote * è¿ç¨æå¡å¨æä»¶ç»å¯¹è·¯å¾ * @param ftpClient * FTPClient对象 * @return ç®å½å建æ¯å¦æå * @throws IOException */ public String CreateDirecroty(String remote, FTPClient ftpClient) throws IOException { String status = "1"; // UploadStatus status = UploadStatus.Create_Directory_Success; String directory = remote.substring(0, remote.lastIndexOf(File.separator) + 1); if (!directory.equalsIgnoreCase(File.separator) && !ftpClient.changeWorkingDirectory(new String(directory .getBytes("GBK"), "iso-8859-1"))) { // 妿è¿ç¨ç®å½ä¸åå¨ï¼åéå½å建è¿ç¨æå¡å¨ç®å½ int start = 0; int end = 0; if (directory.startsWith(File.separator)) { start = 1; } else { start = 0; } end = directory .indexOf(File.separator, start); while (true) { String subDirectory = new String(remote.substring(start, end) .getBytes("GBK"), "iso-8859-1"); if (!ftpClient.changeWorkingDirectory(subDirectory)) { if (ftpClient.makeDirectory(subDirectory)) { ftpClient.changeWorkingDirectory(subDirectory); } else { System.out.println("å建ç®å½å¤±è´¥"); return "2"; // return UploadStatus.Create_Directory_Fail; } } start = end + 1; end = directory.indexOf(File.separator, start); // æ£æ¥ææç®å½æ¯å¦åå»ºå®æ¯ if (end <= start) { break; } } } return status; } /** * ä¸ä¼ æä»¶å°æå¡å¨,æ°ä¸ä¼ åæç¹ç»ä¼ * * @param remoteFile * è¿ç¨æä»¶åï¼å¨ä¸ä¼ ä¹åå·²ç»å°æå¡å¨å·¥ä½ç®å½åäºæ¹å * @param localFile * æ¬å°æä»¶File奿ï¼ç»å¯¹è·¯å¾ * éè¦æ¾ç¤ºçå¤çè¿åº¦æ¥è¿å¼ * @param ftpClient * FTPClientå¼ç¨ * @return * @throws IOException */ public String uploadFile(String remoteFile, File localFile, FTPClient ftpClient, long remoteSize) throws IOException { String status; // æ¾ç¤ºè¿åº¦çä¸ä¼ long step = localFile.length() / 100; step=step ==0?1:step; long process = 0; long localreadbytes = 0L; // System.out.println(remoteFile +"-------------------------"+localFile.getPath().toString()); RandomAccessFile raf = new RandomAccessFile(localFile, "r"); OutputStream out = ftpClient.appendFileStream(new String(remoteFile .getBytes("GBK"), "iso-8859-1")); // æç¹ç»ä¼ if (remoteSize > 0) { ftpClient.setRestartOffset(remoteSize); process = remoteSize / step; raf.seek(remoteSize); localreadbytes = remoteSize; } byte[] bytes = new byte[1024]; int c; while ((c = raf.read(bytes)) != -1) { out.write(bytes, 0, c); localreadbytes += c; if (localreadbytes / step != process) { process = localreadbytes / step; System.out.println("ä¸ä¼ è¿åº¦:" + process); // TODO æ±æ¥ä¸ä¼ ç¶æ } } out.flush(); raf.close(); out.close(); boolean result = ftpClient.completePendingCommand(); if (remoteSize > 0) { status = result ? "0" : "1"; // status = result ? UploadStatus.Upload_From_Break_Success // : UploadStatus.Upload_From_Break_Failed; } else { status = result ? "0" : "1"; // status = result ? UploadStatus.Upload_New_File_Success // : UploadStatus.Upload_New_File_Failed; } return status; } public byte[] getOnlineInputsteam(String url){ try (CloseableHttpClient httpClient = HttpClientBuilder.create().build()) { HttpGet httpGet = new HttpGet(url); CloseableHttpResponse resp = httpClient.execute(httpGet);// è°ç¨æå¡å¨æ¥å£ // return resp.getEntity().getContent(); byte[] data = EntityUtils.toByteArray(resp.getEntity());// å°è¿åçå¾çæè æä»¶è½¬åæåèæ°ç»çå½¢å¼ // BASE64Encoder encoder = new BASE64Encoder(); // String imageBase64 = encoder.encode(data); // String imageBase64 = "data:image/jpg;base64," + encoder.encodeBuffer(data).trim(); // imageBase64 = imageBase64.replaceAll("\n", "").replaceAll("\r", "").replaceAll(" ", "");//å é¤ \r\n return data; } catch (Exception e) { log.error("è·åå¾çå¼å¸¸:{}",e.getMessage()); } return null; } public boolean uploadOnlineFile(String url,String ftpPath, String fileName) throws Exception { byte[] buf = getOnlineInputsteam(url); if(buf == null){ return false; } try { ftpClient.enterLocalPassiveMode();// å¼å¯è¢«å¨æ¨¡å¼ ftpClient.setFileType(FTPClient.BINARY_FILE_TYPE); CreateDirecroty( ftpPath,ftpClient); String printWorkingDirectory = ftpClient.printWorkingDirectory(); System.out.println("è·åå½åç®å½:" + printWorkingDirectory); boolean flag = ftpClient.storeFile(new String(fileName.getBytes("GBK"), "iso-8859-1"), new ByteArrayInputStream(buf)); // éè¿åé QUIT å½ä»¤æ³¨é FTP æå¡å¨ ftpClient.logout(); return flag; } catch (Exception e) { e.printStackTrace(); } finally { if (ftpClient.isConnected()){ ftpClient.disconnect(); } } return false; } /** * å é¤ä¸ä¸ªæä»¶ */ public boolean deleteFile(String filename) { boolean flag = true; try { flag = ftpClient.deleteFile(filename); if (flag) { System.out.println("å 餿件æåï¼"); } else { System.out.println("å é¤æä»¶å¤±è´¥ï¼"); } } catch (IOException ioe) { ioe.printStackTrace(); } return flag; } public static void main(String[] args) throws Exception { try { FtpUtil ftpUtil = new FtpUtil("175.27.187.84", 21, "ftpuser","doumee168" ); ftpUtil.uploadOnlineFile("https://profile-avatar.csdnimg.cn/default.jpg!1", "test"+File.separator, UUID.randomUUID().toString()+"test.jpg"); /*FtpUtil myFtp = new FtpUtil("106.15.54.228", 21, "ftptlg", "tlg168.com"); System.out.println(myFtp.upload("D:\\devices.sql", "/1111/devices.sql")); // myFtp.ftpClient.makeDirectory(new String("çµè§å§".getBytes("GBK"), // "iso-8859-1")); // myFtp.ftpClient.changeWorkingDirectory(new String("çµè§å§" // .getBytes("GBK"), "iso-8859-1")); // myFtp.ftpClient.makeDirectory(new String("走西å£".getBytes("GBK"), // "iso-8859-1")); // System.out.println(myFtp.upload("http://www.5a520.cn /yw.flv", // "/yw.flv", 5)); // System.out.println(myFtp.upload("http://www.5a520.cn /走西å£24.mp4", // "/央è§èµ°è¥¿å£/æ°æµªç½/走西å£24.mp4")); *//** * t.connect("pengtu", "61.191.61.226", 2122, "yangnet", * "yanglong@doumee.com"); File file = new File( * "D:\\lib/commons-net-3.3-bin/commons-net-3.3/NOTICE.txt"); * * *//* System.out.println(myFtp.download("/1/2/NOTICE.txt", "D:\\å.txt")); myFtp.deleteFile("/1/2/NOTICE.txt"); myFtp.disconnect(); System.out.println("javaçæ¬å·ï¼" + System.getProperty("java.version")); // javaçæ¬å· System.out .println("Javaæä¾ååç§°ï¼" + System.getProperty("java.vendor")); // Javaæä¾ååç§° System.out.println("Javaæä¾åç½ç«ï¼" + System.getProperty("java.vendor.url")); // Javaæä¾åç½ç« System.out.println("jreç®å½ï¼" + System.getProperty("java.home")); // Javaï¼å¦ï¼åºè¯¥æ¯jreç®å½ System.out.println("Javaèææºè§èçæ¬å·ï¼" + System.getProperty("java.vm.specification.version")); // Javaèææºè§èçæ¬å· System.out.println("Javaèææºè§èæä¾åï¼" + System.getProperty("java.vm.specification.vendor")); // Javaèææºè§èæä¾å System.out.println("Javaèææºè§èåç§°ï¼" + System.getProperty("java.vm.specification.name")); // Javaèææºè§èåç§° System.out.println("Javaèææºçæ¬å·ï¼" + System.getProperty("java.vm.version")); // Javaèææºçæ¬å· System.out.println("Javaèææºæä¾åï¼" + System.getProperty("java.vm.vendor")); // Javaèææºæä¾å System.out.println("Javaèææºåç§°ï¼" + System.getProperty("java.vm.name")); // Javaèææºåç§° System.out.println("Javaè§èçæ¬å·ï¼" + System.getProperty("java.specification.version")); // Javaè§èçæ¬å· System.out.println("Javaè§èæä¾åï¼" + System.getProperty("java.specification.vendor")); // Javaè§èæä¾å System.out.println("Javaè§èåç§°ï¼" + System.getProperty("java.specification.name")); // Javaè§èåç§° System.out.println("Javaç±»çæ¬å·ï¼" + System.getProperty("java.class.version")); // Javaç±»çæ¬å· System.out.println("Java类路å¾ï¼" + System.getProperty("java.class.path")); // Javaç±»è·¯å¾ System.out.println("Java libè·¯å¾ï¼" + System.getProperty("java.library.path")); // Java libè·¯å¾ System.out.println("Javaè¾å ¥è¾åºä¸´æ¶è·¯å¾ï¼" + System.getProperty("java.io.tmpdir")); // Javaè¾å ¥è¾åºä¸´æ¶è·¯å¾ System.out .println("Javaç¼è¯å¨ï¼" + System.getProperty("java.compiler")); // Javaç¼è¯å¨ System.out.println("Javaæ§è¡è·¯å¾ï¼" + System.getProperty("java.ext.dirs")); // Javaæ§è¡è·¯å¾ System.out.println("æä½ç³»ç»åç§°ï¼" + System.getProperty("os.name")); // æä½ç³»ç»åç§° System.out.println("æä½ç³»ç»çæ¶æï¼" + System.getProperty("os.arch")); // æä½ç³»ç»çæ¶æ System.out.println("æä½ç³»ç»çæ¬å·ï¼" + System.getProperty("os.version")); // æä½ç³»ç»çæ¬å· System.out.println("æä»¶åé符ï¼" + System.getProperty("file.separator")); // æä»¶åé符 System.out.println("è·¯å¾åé符ï¼" + System.getProperty("path.separator")); // è·¯å¾åé符 System.out.println("ç´çº¿åé符ï¼" + System.getProperty("line.separator")); // ç´çº¿åé符 System.out.println("æä½ç³»ç»ç¨æ·åï¼" + System.getProperty("user.name")); // ç¨æ·å System.out.println("æä½ç³»ç»ç¨æ·ç主ç®å½ï¼" + System.getProperty("user.home")); // ç¨æ·ç主ç®å½ System.out.println("å½åç¨åºæå¨ç®å½ï¼" + System.getProperty("user.dir")); // å½åç¨åºæå¨ç®å½*/ } catch (IOException e) { System.out.println("è¿æ¥FTPåºéï¼" + e.getMessage()); } } /*** * @ä¸ä¼ æä»¶å¤¹ * @param localDirectory * å½å°æä»¶å¤¹ * @param remoteDirectoryPath * Ftp æå¡å¨è·¯å¾ 以ç®å½File.separatorç»æ * */ public boolean uploadDirectory(String localDirectory, String remoteDirectoryPath) throws Exception { File src = new File(localDirectory); try { remoteDirectoryPath = remoteDirectoryPath + File.separator; // System.out.println(remoteDirectoryPath+":===============å建ç®å½================="); boolean makeDirFlag = this.ftpClient.makeDirectory(remoteDirectoryPath); }catch (IOException e) { e.printStackTrace(); log.info(remoteDirectoryPath + "ç®å½å建失败"); return false; } File[] allFile = src.listFiles(); for (int currentFile = 0;currentFile < allFile.length;currentFile++) { File f =allFile[currentFile]; String srcName= f.getPath().toString(); // System.out.println(srcName+":====================读åæä»¶======================"); String tPath = remoteDirectoryPath+f.getName(); if (!f.isDirectory()) { // System.out.println(srcName+":====================å¼å§ä¼ è¾æä»¶======================"); int dNum = getNumFromStr(tPath,File.separator.toCharArray()[0]); uploadFile(f, tPath); if(dNum -2>=0){ for (int i = 0; i < dNum-1; i++) { this.ftpClient.changeToParentDirectory(); } } }else{ // System.out.println(srcName+":====================å建åç®å½======================"); uploadDirectory(srcName, tPath+File.separator); } // System.out.println(srcName+":====================ä¸ä¼ 宿¯======================"); } return true; } /*** * @ä¸ä¼ æä»¶å¤¹ * @param pathName * æä»¶å¤¹ * */ public boolean delDirectory(String pathName ) throws Exception { try { this.ftpClient.changeWorkingDirectory( pathName.substring(0, pathName.lastIndexOf(File.separator)) ); ftpClient.removeDirectory(pathName); }catch (IOException e) { e.printStackTrace(); log.info(pathName + "ç®å½å é¤å¤±è´¥"); return false; } return true; } } server/dmvisit_service/src/main/java/com/doumee/core/utils/haikang/base/HKConstants.java
ÎļþÒÑɾ³ý server/dmvisit_service/src/main/java/com/doumee/core/utils/haikang/base/HKTools.java
ÎļþÒÑɾ³ý server/dmvisit_service/src/main/java/com/doumee/core/utils/haikang/service/HKService.java
ÎļþÒÑɾ³ý server/dmvisit_service/src/main/java/com/doumee/dao/business/DeviceMapper.java
@@ -3,10 +3,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.doumee.dao.business.model.Device; import java.util.Collection; /** * @author æ±è¹è¹ * @date 2023/11/30 15:33 */ public interface DeviceMapper extends BaseMapper<Device> { Integer insertBatchSomeColumn(Collection<Device> entityList); } server/dmvisit_service/src/main/java/com/doumee/dao/business/model/Device.java
@@ -52,13 +52,13 @@ @ExcelColumn(name="夿³¨") private String remark; @ApiModelProperty(value = "é¢ç®") @ExcelColumn(name="é¢ç®") private String title; @ApiModelProperty(value = "设å«å") @ExcelColumn(name="设å«å") private String name; @ApiModelProperty(value = "海康æ è¯", example = "1") @ExcelColumn(name="海康æ è¯") private Integer hkId; private String hkId; @ApiModelProperty(value = "æµ·åº·åæ¥ç¶æ 0æªåæ¥ 1已忥", example = "1") @ExcelColumn(name="æµ·åº·åæ¥ç¶æ 0æªåæ¥ 1已忥") @@ -79,7 +79,7 @@ @ApiModelProperty(value = "èµæºç±»å", example = "1") @ExcelColumn(name="èµæºç±»å") private BigDecimal resourceType; private String resourceType; @ApiModelProperty(value = "ç¼å·") @ExcelColumn(name="ç¼å·") server/dmvisit_service/src/main/java/com/doumee/dao/business/model/Member.java
@@ -58,7 +58,18 @@ @ApiModelProperty(value = "人è¸ç §ç") @ExcelColumn(name="人è¸ç §ç") private String faceImg; @ApiModelProperty(value = "人è¸å卿å¡å¨æ è¯ï¼æµ·åº·ï¼") @ExcelColumn(name="人è¸å卿å¡å¨æ è¯ï¼æµ·åº·ï¼") private String faceServeIndexCode; @ApiModelProperty(value = "人è¸ç¼ç ï¼æµ·åº·ï¼") @ExcelColumn(name="人è¸ç¼ç ï¼æµ·åº·ï¼") private String faceId; @ApiModelProperty(value = "人è¸åæ¥ç¶æï¼æµ·åº·ï¼ 0æªåæ¥ 1已忥 2åæ¥å¤±è´¥") @ExcelColumn(name="人è¸åæ¥ç¶æï¼æµ·åº·ï¼ 0æªåæ¥ 1已忥 2åæ¥å¤±è´¥") private Integer faceStatus; @ApiModelProperty(value = "人è¸åæ¥ä¿¡æ¯ï¼æµ·åº·ï¼") @ExcelColumn(name="人è¸åæ¥ä¿¡æ¯ï¼æµ·åº·ï¼") private String faceInfo; @ApiModelProperty(value = "å¥åº·ç ") @ExcelColumn(name="å¥åº·ç ") private String imgurl; @@ -125,7 +136,7 @@ @ExcelColumn(name="海康æ è¯") private Integer hkId; @ApiModelProperty(value = "æµ·åº·åæ¥ç¶æ 0æªåæ¥ 1已忥 2åæ¥å¤±è´¥", example = "1") @ApiModelProperty(value = "æµ·åº·åæ¥ç¶æ 0æªåæ¥ 1已忥 2åæ¥å¤±è´¥ ", example = "1") @ExcelColumn(name="æµ·åº·åæ¥ç¶æ 0æªåæ¥ 1已忥 2åæ¥å¤±è´¥") private Integer hkStatus; server/dmvisit_service/src/main/java/com/doumee/service/business/CarEventService.java
@@ -26,7 +26,6 @@ * @param id ä¸»é® */ void deleteById(Integer id); /** * å é¤ * server/dmvisit_service/src/main/java/com/doumee/service/business/DeviceService.java
@@ -1,5 +1,6 @@ package com.doumee.service.business; import com.doumee.core.haikang.model.param.request.AcsDeviceListRequest; import com.doumee.core.model.PageData; import com.doumee.core.model.PageWrap; import com.doumee.dao.business.model.Device; @@ -94,4 +95,5 @@ * @return long */ long count(Device device); } server/dmvisit_service/src/main/java/com/doumee/service/business/HkSyncService.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,12 @@ package com.doumee.service.business; import com.doumee.core.haikang.model.param.request.AcsDeviceListRequest; /** * å车åºäºä»¶æ¨éè®°å½è¡¨Serviceå®ä¹ * @author æ±è¹è¹ * @date 2023/11/30 15:33 */ public interface HkSyncService { String syncHkDevices(AcsDeviceListRequest param); } server/dmvisit_service/src/main/java/com/doumee/service/business/impl/DeviceServiceImpl.java
@@ -1,7 +1,16 @@ package com.doumee.service.business.impl; import com.doumee.core.constants.ResponseStatus; import com.doumee.core.exception.BusinessException; import com.doumee.core.haikang.model.HKConstants; import com.doumee.core.haikang.model.param.BaseResponse; import com.doumee.core.haikang.model.param.request.AcsDeviceListRequest; import com.doumee.core.haikang.model.param.respose.AcsDeviceInfoResponse; import com.doumee.core.haikang.model.param.respose.AcsDeviceListResponse; import com.doumee.core.haikang.service.HKService; import com.doumee.core.model.PageData; import com.doumee.core.model.PageWrap; import com.doumee.core.utils.Constants; import com.doumee.core.utils.Utils; import com.doumee.dao.business.DeviceMapper; import com.doumee.dao.business.model.Device; @@ -10,10 +19,14 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.Date; import java.util.List; /** @@ -26,6 +39,9 @@ @Autowired private DeviceMapper deviceMapper; @Autowired private HKService hkService; @Override public Integer create(Device device) { @@ -112,8 +128,8 @@ if (pageWrap.getModel().getRemark() != null) { queryWrapper.lambda().eq(Device::getRemark, pageWrap.getModel().getRemark()); } if (pageWrap.getModel().getTitle() != null) { queryWrapper.lambda().eq(Device::getTitle, pageWrap.getModel().getTitle()); if (pageWrap.getModel().getName() != null) { queryWrapper.lambda().eq(Device::getName, pageWrap.getModel().getName()); } if (pageWrap.getModel().getHkId() != null) { queryWrapper.lambda().eq(Device::getHkId, pageWrap.getModel().getHkId()); @@ -185,4 +201,5 @@ QueryWrapper<Device> wrapper = new QueryWrapper<>(device); return deviceMapper.selectCount(wrapper); } } server/dmvisit_service/src/main/java/com/doumee/service/business/impl/HkSyncServiceImpl.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,175 @@ package com.doumee.service.business.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.doumee.core.constants.ResponseStatus; import com.doumee.core.exception.BusinessException; import com.doumee.core.haikang.model.HKConstants; import com.doumee.core.haikang.model.param.BaseResponse; import com.doumee.core.haikang.model.param.request.AcsDeviceListRequest; import com.doumee.core.haikang.model.param.respose.AcsDeviceInfoResponse; import com.doumee.core.haikang.model.param.respose.AcsDeviceListResponse; import com.doumee.core.haikang.service.HKService; import com.doumee.core.model.PageData; import com.doumee.core.model.PageWrap; import com.doumee.core.utils.Constants; import com.doumee.core.utils.DateUtil; import com.doumee.core.utils.Utils; import com.doumee.dao.business.DeviceMapper; import com.doumee.dao.business.model.Device; import com.doumee.service.business.DeviceService; import com.doumee.service.business.HkSyncService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; import java.util.List; /** * 设å¤ä¿¡æ¯è¡¨Serviceå®ç° * @author æ±è¹è¹ * @date 2023/11/30 15:33 */ @Service public class HkSyncServiceImpl implements HkSyncService { @Autowired private DeviceMapper deviceMapper; @Autowired private HKService hkService; @Override // @Async public String syncHkDevices(AcsDeviceListRequest param){ List<Device> deleteList = new ArrayList<>(); List<Device> addList = new ArrayList<>(); List<Device> editList = new ArrayList<>(); List<AcsDeviceInfoResponse> allHkList = new ArrayList<>(); Date date = new Date(); //æ¥è¯¢å ¨é¨é¨ç¦è®¾å¤æ°æ® List<Device> allList = deviceMapper.selectList(null); boolean hasNext = true; int curTotal = 0; while (hasNext){ //å页éåå¾ªç¯æ¥è¯¢ææé¨ç¦è®¾å¤æ°æ® param = new AcsDeviceListRequest(); param.setPageNo(1); param.setPageSize(10000); BaseResponse<AcsDeviceListResponse> response = hkService.acsDeviceList(param); if(response == null || !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)){ throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对ä¸èµ·ï¼æµ·åº·åæ¥æ°æ®å¤±è´¥~"); } AcsDeviceListResponse r = response.getData(); curTotal += 10000; if(curTotal >= r.getTotal()){ hasNext = false; } List<AcsDeviceInfoResponse> tlist = r.getList(); } //夿è·åå é¤çé¨ç¦è®¾å¤ï¼é»è¾å é¤ getAddAndEditList(allList,allHkList,addList,editList,date); getDeleteList(allList,allHkList,deleteList,date); if(deleteList.size()>0){ //é»è¾å é¤ for(Device d : deleteList){ deviceMapper.updateById(d); } } if(addList.size()>0){ deviceMapper.insertBatchSomeColumn(addList); } if(editList.size()>0){ for(Device d : editList){ deviceMapper.updateById(d); } } return "忥é¨ç¦æ°æ®ï¼æ°å¢ã"+addList.size()+"ãæ¡ï¼æ´æ°ã"+editList.size()+"ãæ¡ï¼å é¤ã"+deleteList.size()+"ãæ¡"; } private void getAddAndEditList(List<Device> allList, List<AcsDeviceInfoResponse> allHkList, List<Device> addList, List<Device> editList, Date date) { if(allHkList!=null && allHkList.size()>0){ for(AcsDeviceInfoResponse device : allHkList){ Device model = getExistedDevice(device,allList); if(model !=null){ //妿已åå¨ï¼åæ´æ°æ°æ® model = initDeviceByHkData(model,device,date); editList.add(model); }else{ //妿ä¸åå¨ï¼åæ°å¢æ°æ® model = new Device(); model = initDeviceByHkData(model,device,date); addList.add(model); } } } } /** * åå§åæµ·åº·å ¥åºæ°æ® * @param model * @param device * @param date * @return */ private Device initDeviceByHkData(Device model, AcsDeviceInfoResponse device,Date date) { model.setIsdeleted(Constants.ZERO); model.setIp(device.getIp()); model.setHkDate(date); model.setCreateDate(DateUtil.StringToDate2(device.getCreateTime())); model.setEditDate(DateUtil.StringToDate2(device.getUpdateTime())); model.setNo(device.getDeviceCode()); model.setHkId(device.getIndexCode()); model.setName(device.getName()); model.setHkStatus(Constants.ONE); model.setType(Constants.ZERO); model.setResourceType(device.getResourceType()); model.setDevTypeCode(device.getDevTypeCode()); model.setManufature(device.getManufacturer()); model.setPort(device.getPort()); return model; } private Device getExistedDevice(AcsDeviceInfoResponse device, List<Device> allList) { if(allList.size()>0){ for(Device r : allList){ if(StringUtils.equals(r.getHkId(), device.getIndexCode())){ //表示æªå é¤ return r; } } } return null; } private void getDeleteList(List<Device> allList, List<AcsDeviceInfoResponse> allHkList,List<Device> deleteList ,Date date) { if(allList!=null && allList.size()>0){ for(Device device : allList){ if(isDeletedDevice(device,allHkList)){ device.setIsdeleted(Constants.ONE); device.setEditDate(date); deleteList.add(device); } } } } private boolean isDeletedDevice(Device device, List<AcsDeviceInfoResponse> allHkList) { if(allHkList.size()>0){ for(AcsDeviceInfoResponse r : allHkList){ if(StringUtils.equals(device.getHkId(), r.getIndexCode())){ //表示æªå é¤ return false; } } } return true; } } server/openapi/src/main/java/com/doumee/model/response/erp/UserListRespone.java
@@ -34,7 +34,7 @@ private Date editDate; @ApiModelProperty(value = "æå±ç»ç»ç¼ç ") private String orgId; @ApiModelProperty(value = "人è¸ç §çå°å") @ApiModelProperty(value = "人è¸ç §çå°å,å¾çå ¬ç½è®¿é®å°å") private String faceImg; @ApiModelProperty(value = "å·¥å·") private String code; server/pom.xml
@@ -271,6 +271,11 @@ <artifactId>artemis-http-client</artifactId> <version>1.1.3</version> </dependency> <dependency> <groupId>commons-net</groupId> <artifactId>commons-net</artifactId> <version>3.8.0</version> </dependency> </dependencies> <build> <plugins>