From d16520069e7a89b5ac0d13d0c8ba4e30af023279 Mon Sep 17 00:00:00 2001
From: nidapeng <jp@doumee.com>
Date: 星期四, 28 三月 2024 18:35:44 +0800
Subject: [PATCH] 整理
---
server/dmvisit_admin/src/main/java/com/doumee/api/business/StagingController.java | 1
server/dmvisit_service/src/main/java/com/doumee/core/erp/model/openapi/request/UserUpdateRequest.java | 4
server/dmvisit_admin/src/main/java/com/doumee/config/shiro/ShiroConfig.java | 1
server/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java | 18 +
server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/BaseListPageResponse.java | 1
server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncDeviceServiceImpl.java | 63 ++++++
server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKConstants.java | 4
server/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java | 20 ++
server/dmvisit_service/src/main/java/com/doumee/service/business/impl/erp/ErpSyncServiceImpl.java | 3
server/dmvisit_service/src/main/java/com/doumee/service/business/ext/HkSyncService.java | 1
server/admin_timer/src/main/java/com/doumee/task/ScheduleDeviceStatusTool.java | 31 +++
server/dmvisit_service/src/main/java/com/doumee/service/business/VisitsService.java | 1
server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncEmpowerServiceImpl.java | 277 +++++++++++++++++++--------
server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/ferp/HkSyncOrgUserToHKServiceImpl.java | 47 ++--
server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/AscDeviceStatusInfoResponse.java | 29 ++
server/dmvisit_service/src/main/java/com/doumee/dao/business/model/Empower.java | 6
server/dmvisit_admin/src/main/java/com/doumee/api/business/MemberController.java | 6
server/dmvisit_admin/src/main/java/com/doumee/api/business/VisitsController.java | 7
server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncBaseServiceImpl.java | 3
server/dmvisit_service/src/main/java/com/doumee/dao/business/model/Member.java | 8
server/dmvisit_service/src/main/java/com/doumee/service/business/MemberService.java | 2
server/dmvisit_admin/src/main/java/com/doumee/task/ScheduleTool.java | 5
server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKTools.java | 12 +
server/dmvisit_service/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java | 13 +
server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/AcsDeviceStatusListRequest.java | 15 +
server/dmvisit_service/src/main/java/com/doumee/core/utils/Constants.java | 1
server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncVisitServiceImpl.java | 5
27 files changed, 463 insertions(+), 121 deletions(-)
diff --git a/server/admin_timer/src/main/java/com/doumee/task/ScheduleDeviceStatusTool.java b/server/admin_timer/src/main/java/com/doumee/task/ScheduleDeviceStatusTool.java
new file mode 100644
index 0000000..82ca768
--- /dev/null
+++ b/server/admin_timer/src/main/java/com/doumee/task/ScheduleDeviceStatusTool.java
@@ -0,0 +1,31 @@
+package com.doumee.task;
+
+
+import com.doumee.service.business.impl.hksync.HkSyncDeviceServiceImpl;
+import com.doumee.service.business.impl.hksync.HkSyncEmpowerServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+/**
+ * 瀹氭椂浠诲姟
+ * @author jiangping
+ * @date 2021-10-10 14:40:35
+ * https://www.bejson.com/othertools/cron/ cron 琛ㄨ揪寮忕敓鎴愬湴鍧�
+ */
+@Component
+@EnableScheduling
+public class ScheduleDeviceStatusTool {
+
+ public static Integer endId = 0;
+ @Autowired
+ private HkSyncDeviceServiceImpl hkSyncDeviceService;
+ /**
+ * 瀹氭椂鐩戝惉璁惧鐘舵��
+ */
+ @Scheduled(fixedRate= 60*1000*5)
+ public void ascDeviceStatus() {
+ hkSyncDeviceService.getAscDeviceStatus();
+ }
+}
diff --git a/server/dmvisit_admin/src/main/java/com/doumee/api/business/MemberController.java b/server/dmvisit_admin/src/main/java/com/doumee/api/business/MemberController.java
index 2dc9432..8fe7809 100644
--- a/server/dmvisit_admin/src/main/java/com/doumee/api/business/MemberController.java
+++ b/server/dmvisit_admin/src/main/java/com/doumee/api/business/MemberController.java
@@ -95,6 +95,12 @@
memberService.updateFace(member);
return ApiResponse.success(null);
}
+ @ApiOperation("閲嶆柊涓嬪彂浜鸿劯")
+ @PostMapping("/empowerByList")
+ public ApiResponse empowerByList(@RequestBody Member member) {
+ memberService.empowerByList(member);
+ return ApiResponse.success(null);
+ }
@ApiOperation("鏍规嵁ID淇敼")
@PostMapping("/updateById")
@RequiresPermissions("business:member:update")
diff --git a/server/dmvisit_admin/src/main/java/com/doumee/api/business/StagingController.java b/server/dmvisit_admin/src/main/java/com/doumee/api/business/StagingController.java
index ad9f02c..d4d830a 100644
--- a/server/dmvisit_admin/src/main/java/com/doumee/api/business/StagingController.java
+++ b/server/dmvisit_admin/src/main/java/com/doumee/api/business/StagingController.java
@@ -58,6 +58,7 @@
@ApiOperation("瓒呮椂棰勮浜哄憳绂诲満")
@GetMapping("/level")
+// @RequiresPermissions("business:visits:level")
public ApiResponse level (@RequestParam Integer visitId) {
visitsService.visitLevel(visitId);
return ApiResponse.success("鎿嶄綔鎴愬姛");
diff --git a/server/dmvisit_admin/src/main/java/com/doumee/api/business/VisitsController.java b/server/dmvisit_admin/src/main/java/com/doumee/api/business/VisitsController.java
index 9e21987..62e35ec 100644
--- a/server/dmvisit_admin/src/main/java/com/doumee/api/business/VisitsController.java
+++ b/server/dmvisit_admin/src/main/java/com/doumee/api/business/VisitsController.java
@@ -71,6 +71,13 @@
visitsService.updateById(visits);
return ApiResponse.success(null);
}
+ @ApiOperation("鍙栨秷棰勭害")
+ @GetMapping("/visitCancel")
+ @RequiresPermissions("business:visits:cancel")
+ public ApiResponse visitCancel(@RequestParam Integer visitId) {
+ visitsService.visitCancel(visitId);
+ return ApiResponse.success(null);
+ }
@ApiOperation("鏍规嵁鏃ユ湡(starttime)鍚屾璁垮鏁版嵁")
@PostMapping("/syncByDate")
diff --git a/server/dmvisit_admin/src/main/java/com/doumee/config/shiro/ShiroConfig.java b/server/dmvisit_admin/src/main/java/com/doumee/config/shiro/ShiroConfig.java
index b785683..cd9d3e2 100644
--- a/server/dmvisit_admin/src/main/java/com/doumee/config/shiro/ShiroConfig.java
+++ b/server/dmvisit_admin/src/main/java/com/doumee/config/shiro/ShiroConfig.java
@@ -101,6 +101,7 @@
map.put("/common/captcha", "anon");
map.put("/statistics/**", "anon");
map.put("/business/hksync/push/**", "anon");
+ map.put("/business/member/empowerByList", "anon");
map.put("/dingding/push", "anon");
// map.put("/ext/workorderExt/freshStatistics", "anon");
map.put("/dingding/jsapiTicket", "anon");
diff --git a/server/dmvisit_admin/src/main/java/com/doumee/task/ScheduleTool.java b/server/dmvisit_admin/src/main/java/com/doumee/task/ScheduleTool.java
index 05436ba..793ab54 100644
--- a/server/dmvisit_admin/src/main/java/com/doumee/task/ScheduleTool.java
+++ b/server/dmvisit_admin/src/main/java/com/doumee/task/ScheduleTool.java
@@ -7,11 +7,8 @@
import com.doumee.core.utils.Constants;
import com.doumee.service.business.InterfaceLogService;
import com.doumee.service.business.MemberService;
-import com.doumee.service.business.impl.hksync.HkSyncEmpowerServiceImpl;
-import com.doumee.service.business.impl.hksync.HkSyncImgServiceImpl;
-import com.doumee.service.business.impl.hksync.HkSyncParkServiceImpl;
+import com.doumee.service.business.impl.hksync.*;
import com.doumee.service.business.impl.hksync.ferp.HkSyncOrgUserToHKServiceImpl;
-import com.doumee.service.business.impl.hksync.HkSyncVisitServiceImpl;
import com.doumee.service.business.impl.hksync.fhk.HkSyncVehicleFromHKServiceImpl;
import com.doumee.service.business.impl.hksync.fhk.HkSyncVisitFromHKServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
diff --git a/server/dmvisit_service/src/main/java/com/doumee/core/erp/model/openapi/request/UserUpdateRequest.java b/server/dmvisit_service/src/main/java/com/doumee/core/erp/model/openapi/request/UserUpdateRequest.java
index 5ee3cb8..050eb23 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/core/erp/model/openapi/request/UserUpdateRequest.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/core/erp/model/openapi/request/UserUpdateRequest.java
@@ -44,8 +44,8 @@
@ApiModelProperty(value = "鍗″彿闆嗗悎" )
private List<String> cardList;
//2024骞�1鏈�9鏃� 娌熼�氫笉浠庢涓氬姟瑙﹀彂
- @ApiModelProperty(value = "鎺堟潈闂ㄧ缁勭紪鐮侀泦鍚�,銆愯瀹㈢銆戝敮涓�鏍囪瘑" ,hidden = true )
- private Integer[] roleIds;
+// @ApiModelProperty(value = "鎺堟潈闂ㄧ缁勭紪鐮侀泦鍚�,銆愯瀹㈢銆戝敮涓�鏍囪瘑" ,hidden = true )
+// private Integer[] roleIds;
@ApiModelProperty(value = "鎺堟潈鏈夋晥鏈燂紙寮�濮嬫椂闂达級锛屼负绌烘椂榛樿闀挎湡鏈夋晥锛屽2023-11-24 11:39:23" )
private Date validStartTime;
@ApiModelProperty(value = "鎺堟潈鏈夋晥鏈燂紙鎴鏃堕棿锛夛紝涓虹┖鏃堕粯璁ら暱鏈熸湁鏁堬紝濡�2023-11-24 11:39:23" )
diff --git a/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKConstants.java b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKConstants.java
index 11e0557..3a2fd8c 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKConstants.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKConstants.java
@@ -17,6 +17,9 @@
//娴峰悍骞冲彴鏍规嵁鐜板満鐜閰嶇疆http杩樻槸https
public static final String RESPONSE_SUCCEE = "0";
public static final String RESPONSE_DOWNLOAD_ERROR= "0x15406001";
+ public static final String RESPONSE_FACE_ERROR= "0x1540350c";//鍥炶皟閿欒锛氫汉鑴稿缓妯″け璐�
+ public static final String RESPONSE_FACE_ERROR2= "0x1540350d";//鍥炶皟閿欒锛氫汉鑴哥溂闂磋窛澶皬
+
public static String https ;
/**
* 鑳藉姏寮�鏀惧钩鍙扮殑缃戠珯璺緞 璺緞涓嶇敤淇敼锛屽氨鏄�/artemis
@@ -81,6 +84,7 @@
String vehicleList= "/api/resource/v2/vehicle/advance/vehicleList";//鏌ヨ杞﹁締鍒楄〃v2
String vehicleTimeRangeList= "/api/resource/v1/vehicle/timeRange";//澧為噺鑾峰彇杞﹁締鏁版嵁
String facePictureCheck= "/api/frs/v1/face/picture/check";//浜鸿劯璇勫垎
+ String acsDeviceStatus= "/api/nms/v1/online/acs_device/get";//鑾峰彇闂ㄧ璁惧鍦ㄧ嚎鐘舵��
}
/**
diff --git a/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKTools.java b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKTools.java
index ede07f3..e1227e3 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKTools.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKTools.java
@@ -707,4 +707,16 @@
return result;
}
+ /**
+ * 鑾峰彇闂ㄧ璁惧鍦ㄧ嚎鐘舵��
+ * @param body
+ * @return
+ */
+ public static String acsDeviceStatus(String body) {
+ Map<String, String> path = getPath(HKConstants.InterfacePath.acsDeviceStatus);
+ String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", null);// post璇锋眰application/json绫诲瀷鍙傛暟
+ saveInterfaceLog(body,result,path);
+ return result;
+ }
+
}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/BaseListPageResponse.java b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/BaseListPageResponse.java
index 752edcf..fd8660b 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/BaseListPageResponse.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/BaseListPageResponse.java
@@ -10,5 +10,6 @@
private int total;// number False 鏌ヨ鏁版嵁璁板綍鎬绘暟
private int pageSize;// number False 姣忛〉璁板綍鎬绘暟
private int pageNo ;// number False 褰撳墠椤电爜
+ private int totalPage;// number False 鎬婚〉鏁�
private List<T> list ;// object[] False 鏉冮檺缁勫璞″垪琛�
}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/AcsDeviceStatusListRequest.java b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/AcsDeviceStatusListRequest.java
new file mode 100644
index 0000000..cb40e32
--- /dev/null
+++ b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/AcsDeviceStatusListRequest.java
@@ -0,0 +1,15 @@
+package com.doumee.core.haikang.model.param.request;
+
+import lombok.Data;
+
+@Data
+public class AcsDeviceStatusListRequest {
+ private String regionId ;// string False 鍖哄煙id , 鍒嗛〉鑾峰彇鍖哄煙鍒楄〃鎺ュ彛鍙互鑾峰彇
+ private String ip;// string False 璁惧ip锛岀敤鎴峰彲浠ヨ嚜宸辨墜鍔ㄨ緭鍏ワ紝涔熷彲浠ユ牴鎹煡璇㈤棬绂佽澶囧垪琛╲2鎺ュ彛鍙互鑾峰彇
+ private String[] indexCodes;//i string[] False 闂ㄧ璁惧鍒楄〃锛屾渶澶�500锛屾煡璇㈤棬绂佽澶囧垪琛╲2鎺ュ彛鍙互鑾峰彇
+ private String status ;//istring False 鐘舵��1: 鍦ㄧ嚎0: 绂荤嚎-1: 鏈娴�
+ private String includeSubNode;// i string False 鏄惁鍖呭惈涓嬬骇,锛堣嫢regionId涓虹┖锛屽垯璇ュ弬鏁颁笉璧蜂綔鐢級1: 鍖呭惈 0: 涓嶅寘鍚�
+ private Integer pageNo ;//integer True 椤电爜,pageNo鈮�1
+ private Integer pageSize;// integer True 鍒嗛〉澶у皬
+
+}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/AscDeviceStatusInfoResponse.java b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/AscDeviceStatusInfoResponse.java
new file mode 100644
index 0000000..dd0676e
--- /dev/null
+++ b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/AscDeviceStatusInfoResponse.java
@@ -0,0 +1,29 @@
+package com.doumee.core.haikang.model.param.respose;
+
+import lombok.Data;
+
+@Data
+public class AscDeviceStatusInfoResponse {
+ private String vehicleId;//string False dataId
+ private String deviceType;//string False 璁惧鍨嬪彿
+ private String deviceIndexCode;// string False 璁惧鍞竴缂栫爜
+ private String regionIndexCode;// string False 鍖哄煙缂栫爜
+ private String collectTime;//string False 閲囬泦鏃堕棿
+ private String regionName;// string False 鍖哄煙鍚嶅瓧
+ private String indexCode;//string False 璧勬簮鍞竴缂栫爜
+ private String cn;//string False 璁惧鍚嶇О
+ /**
+ * 鍗忚绫诲瀷锛� hiksdk_net: 娴峰悍绉佹湁鍗忚
+ * gb_reg: GB/T28181
+ * ehome_reg: eHome鍗忚
+ * dhsdk_net: 澶у崕绉佹湁鍗忚
+ * onvif_net: ONVIF鍗忚
+ * ezviz_net: 钀ょ煶鍗忚
+ * cascade: 绾ц仈
+ */
+ private String treatyType;//string False
+ private String manufacturer;// string False 鍘傚晢锛宧ikvision-娴峰悍锛宒ahua-澶у崕
+ private String ip;//string False ip鍦板潃
+ private String port;// number False 绔彛
+ private Integer online;// number False 鍦ㄧ嚎鐘舵�侊紝0绂荤嚎锛�1鍦ㄧ嚎
+}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java
index fb4fbb7..c1fb070 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java
@@ -963,6 +963,24 @@
}
return null;
}
+ /**
+ *鑾峰彇闂ㄧ璁惧鍦ㄧ嚎鐘舵�侊紙鍒嗛〉锛�
+ * @return
+ */
+ public static BaseResponse<BaseListPageResponse<AscDeviceStatusInfoResponse>> acsDeviceStatus(AcsDeviceStatusListRequest param){
+ log.info("銆愭捣搴疯幏鍙栭棬绂佽澶囧湪绾跨姸鎬併��================寮�濮�===="+JSONObject.toJSONString(param));
+ try {
+ String res = HKTools.acsDeviceStatus(JSONObject.toJSONString(param));
+ TypeReference typeReference =
+ new TypeReference< BaseResponse<BaseListPageResponse<AscDeviceStatusInfoResponse>> >(){};
+ BaseResponse<BaseListPageResponse<AscDeviceStatusInfoResponse>> result = JSONObject.parseObject(res, typeReference.getType());
+ logResult(result,"娴峰悍鑾峰彇闂ㄧ璁惧鍦ㄧ嚎鐘舵��");
+ return result;
+ }catch (Exception e){
+ log.error("銆愭捣搴疯幏鍙栭棬绂佽澶囧湪绾跨姸鎬併��================澶辫触====锛歕n"+ e.getMessage());
+ }
+ return null;
+ }
private static void logResult(BaseResponse res,String name) {
if(StringUtils.equals(res.getCode(),HKConstants.RESPONSE_SUCCEE)){
log.info("銆�"+name+"銆�================鎴愬姛====\n"+res);
diff --git a/server/dmvisit_service/src/main/java/com/doumee/core/utils/Constants.java b/server/dmvisit_service/src/main/java/com/doumee/core/utils/Constants.java
index c22bd19..ea1abc3 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/core/utils/Constants.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/core/utils/Constants.java
@@ -84,6 +84,7 @@
public static final String RETRY_CONNECT_NUM ="RETRY_CONNECT_NUM" ;
public static boolean DEALING_HK_SYNCPRIVILEGE= false;
public static boolean DEALING_HK_SYNCDEVICE = false;
+ public static boolean DEALING_HK_SYNCDEVICE_STATUS = false;
public static boolean DEALING_HK_SYNCPARK = false;
public static boolean DEALING_HK_IMG = false;
public static boolean DEALING_HK_ORG = false;
diff --git a/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/Empower.java b/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/Empower.java
index 7cc4b0a..17d3289 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/Empower.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/Empower.java
@@ -157,9 +157,15 @@
@ApiModelProperty(value = "娴峰悍璁惧ode")
@TableField(exist = false)
private String deviceIndexCode;
+ @ApiModelProperty(value = "娴峰悍璁惧鍦ㄧ嚎鐘舵��")
+ @TableField(exist = false)
+ private Integer deviceOnline;
@ApiModelProperty(value = "浜哄憳娴峰悍缂栫爜")
@TableField(exist = false)
private String memberHkId;
+ @ApiModelProperty(value = "浜哄憳娴峰悍浜鸿劯鐘舵�� 0鏈悓姝� 1鍚屾鎴愬姛 2鍚屾澶辫触 3璁惧寤烘ā澶辫触")
+ @TableField(exist = false)
+ private Integer memberFaceStatus;
@ApiModelProperty(value = "浜哄憳娴峰悍鍚屾鐘舵�� ")
@TableField(exist = false)
private Integer memberHkStatus;
diff --git a/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/Member.java b/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/Member.java
index 1ac0a30..7de820b 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/Member.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/Member.java
@@ -10,6 +10,7 @@
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
+import java.util.List;
/**
* 浜哄憳淇℃伅琛�
@@ -65,8 +66,8 @@
@ApiModelProperty(value = "浜鸿劯缂栫爜锛堟捣搴凤級")
@ExcelColumn(name="浜鸿劯缂栫爜锛堟捣搴凤級")
private String faceId;
- @ApiModelProperty(value = "浜鸿劯鍚屾鐘舵�侊紙娴峰悍锛� 0鏈悓姝� 1宸插悓姝� 2鍚屾澶辫触")
- @ExcelColumn(name="浜鸿劯鍚屾鐘舵�侊紙娴峰悍锛� 0鏈悓姝� 1宸插悓姝� 2鍚屾澶辫触")
+ @ApiModelProperty(value = "浜鸿劯鍚屾鐘舵�侊紙娴峰悍锛� 0鏈悓姝� 1宸插悓姝� 2鍚屾澶辫触 3涓嶅悎鏍�")
+ @ExcelColumn(name="浜鸿劯鍚屾鐘舵�侊紙娴峰悍锛� 0鏈悓姝� 1宸插悓姝� 2鍚屾澶辫触 3涓嶅悎鏍�")
private Integer faceStatus;
@ApiModelProperty(value = "浜鸿劯鍚屾淇℃伅锛堟捣搴凤級")
@ExcelColumn(name="浜鸿劯鍚屾淇℃伅锛堟捣搴凤級")
@@ -245,6 +246,9 @@
@ApiModelProperty(value = "闂ㄧ鏈夋晥鏈熷紑濮�")
@ExcelColumn(name="闂ㄧ鏈夋晥鏈熷紑濮�",index= 5,dateFormat = "yyyy-MM-dd")
private Date startTime;
+ @ApiModelProperty(value = "缂栫爜闆嗗悎")
+ @TableField(exist = false)
+ private List<Integer> idList;
@ApiModelProperty(value = "闂ㄧ鏈夋晥鏈熺粨鏉�", example = "1")
@ExcelColumn(name="闂ㄧ鏈夋晥鏈熺粨鏉�",index= 6,dateFormat = "yyyy-MM-dd")
diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/MemberService.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/MemberService.java
index 6209e5a..d3cbb5b 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/service/business/MemberService.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/MemberService.java
@@ -203,4 +203,6 @@
StagingDataVO stagingHead(StagingDataVO stagingHeadVO);
StagingDataVO stagingBody(StagingDataVO stagingHeadVO);
+
+ void empowerByList(Member member);
}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/VisitsService.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/VisitsService.java
index fc7fa7d..663c095 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/service/business/VisitsService.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/VisitsService.java
@@ -129,4 +129,5 @@
void auditApprove(AuditApproveDTO auditApproveDTO);
void visitLevel(Integer visitId);
+ void visitCancel(Integer visitId);
}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/ext/HkSyncService.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/ext/HkSyncService.java
index 6360f47..0a8b097 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/service/business/ext/HkSyncService.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/ext/HkSyncService.java
@@ -78,4 +78,5 @@
Integer syncEmpowerResultData(Integer endId);
Integer syncEmpowerDetailData(Integer endId);
void syncParkRecords(Date date);
+ void getAscDeviceStatus();
}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java
index ba50685..11f0431 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java
@@ -192,6 +192,19 @@
// List<MemberCard> cards = HkSyncOrgUserToHKServiceImpl.getNormalCardList(member,memberCardMapper);
HkSyncOrgUserToHKServiceImpl.dealMemberRoleEmpowerDo(null,member,deviceRoleMapper,empowerMapper,deviceMapper);
}
+ @Override
+ public void empowerByList(Member member) {
+ if(member.getIdList()!=null && member.getIdList().size() >0){
+ List<Member> members = memberMapper.selectList(new QueryWrapper<Member>().lambda()
+ .in(Member::getId,member.getIdList())
+ .eq(Member::getIsdeleted,Constants.ZERO));
+ if(members!=null){
+ for(Member m : members){
+ HkSyncOrgUserToHKServiceImpl.dealMemberRoleEmpowerDo(null,m,deviceRoleMapper,empowerMapper,deviceMapper);
+ }
+ }
+ }
+ }
@Override
diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java
index d7a86bf..cd7243c 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java
@@ -1269,5 +1269,25 @@
.eq(Retention::getType,Constants.memberType.visitor)
.eq(Retention::getMemberId,visits.getMemberId()));
}
+ @Override
+ public void visitCancel(Integer visitId){
+ Visits visits = visitsMapper.selectById(visitId);
+ if(Objects.isNull(visits)){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY);
+ }
+ if(!visits.getStatus().equals(Constants.VisitStatus.xfSuccess)){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"璁垮璁板綍鐘舵�侀敊璇紝璇峰埛鏂伴噸璇�");
+ }
+ VisitAppointmentOutRequest request = new VisitAppointmentOutRequest();
+ request.setOrderId(visits.getHkId());
+ //璋冪敤娴峰悍寮哄埗绛剧
+ BaseResponse response = HKService.outVisitAppiontment(request);
+ visitsMapper.update(null,new UpdateWrapper<Visits>().lambda().set(Visits::getStatus,Constants.VisitStatus.signout)
+ .eq(Visits::getId,visitId));
+ //浜у嚭鍦ㄥ満浜哄憳淇℃伅
+ retentionMapper.delete(new UpdateWrapper<Retention>().lambda()
+ .eq(Retention::getType,Constants.memberType.visitor)
+ .eq(Retention::getMemberId,visits.getMemberId()));
+ }
}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/erp/ErpSyncServiceImpl.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/erp/ErpSyncServiceImpl.java
index e238c53..af0009f 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/erp/ErpSyncServiceImpl.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/erp/ErpSyncServiceImpl.java
@@ -847,7 +847,7 @@
String encryptIdNo = DESUtil.encrypt(Constants.EDS_PWD,param.getIdNo());
member.setIdcardNo(encryptIdNo);
member.setStartTime(param.getValidStartTime());
- member.setRoleId(param.getRoleIds()!=null?JSONObject.toJSONString(param.getRoleIds()):null);
+// member.setRoleId(param.getRoleIds()!=null?JSONObject.toJSONString(param.getRoleIds()):null);
member.setEndTime(param.getValidEndTime());
member.setIdcardDecode(Constants.getTuominStr(param.getIdNo()));
member.setErpOrgId(param.getOrgId());
@@ -977,6 +977,7 @@
@Override
+ @Transactional
public void roleUserAuthor(UserAuthorRequest param){
if(Objects.isNull(param)
||StringUtils.isBlank(param.getUserId())){
diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncBaseServiceImpl.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncBaseServiceImpl.java
index b8c39aa..0c37c8e 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncBaseServiceImpl.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncBaseServiceImpl.java
@@ -192,4 +192,7 @@
}
}
+ @Override
+ public void getAscDeviceStatus() {
+ }
}
diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncDeviceServiceImpl.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncDeviceServiceImpl.java
index 911a5c5..0268516 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncDeviceServiceImpl.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncDeviceServiceImpl.java
@@ -2,11 +2,14 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
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.BaseListPageResponse;
import com.doumee.core.haikang.model.param.BaseResponse;
import com.doumee.core.haikang.model.param.request.AcsDeviceListRequest;
+import com.doumee.core.haikang.model.param.request.AcsDeviceStatusListRequest;
import com.doumee.core.haikang.model.param.request.DoorsListRequest;
import com.doumee.core.haikang.model.param.request.ParkListRequest;
import com.doumee.core.haikang.model.param.respose.*;
@@ -83,6 +86,37 @@
Constants.DEALING_HK_SYNCDEVICE =false;
}
}
+ @Override
+// @Async
+ public void getAscDeviceStatus(){
+ if(Constants.DEALING_HK_SYNCDEVICE_STATUS){
+ return;
+ }
+ Constants.DEALING_HK_SYNCDEVICE_STATUS =true;
+ try {
+ List<Device> editList = new ArrayList<>();
+ Date date = new Date();
+ //鏌ヨ鍏ㄩ儴闂ㄧ璁惧鏁版嵁
+ List<AscDeviceStatusInfoResponse> allHkList = getAllDeviceStatusList();
+
+ if(allHkList.size()>0){
+ //閫昏緫鍒犻櫎
+ for(AscDeviceStatusInfoResponse d : allHkList){
+ deviceMapper.update(null,new UpdateWrapper<Device>().lambda()
+ .set(Device::getOnline,d.getOnline())
+ .set(Device::getIp,d.getIp())
+ .set(Device::getPort,d.getPort())
+ .set(Device::getManufature,d.getManufacturer())
+ .set(Device::getEditDate,date)
+ .eq(Device::getHkId,d.getIndexCode()));
+ }
+ }
+ }catch (Exception e){
+ throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "鍚屾璁惧鐘舵�佸け璐ワ紒");
+ }finally {
+ Constants.DEALING_HK_SYNCDEVICE_STATUS =false;
+ }
+ }
private List<AcsDeviceInfoResponse> getAllDeViceList() {
AcsDeviceListRequest param = new AcsDeviceListRequest();
@@ -143,6 +177,35 @@
}
return allDoorList;
}
+ public List<AscDeviceStatusInfoResponse> getAllDeviceStatusList(){
+ List<AscDeviceStatusInfoResponse> allDoorList = new ArrayList<>();
+ Date date = new Date();
+ boolean hasNext = true;
+ int curTotal = 0;
+ int curPage = 1;
+ while (hasNext){
+ //鍒嗛〉閬嶅巻寰幆鏌ヨ鎵�鏈夐棬绂佽澶囨暟鎹�
+ AcsDeviceStatusListRequest param = new AcsDeviceStatusListRequest();
+ param.setPageNo(curPage);
+ param.setPageSize(100);
+ BaseResponse<BaseListPageResponse<AscDeviceStatusInfoResponse>> response = HKService.acsDeviceStatus(param);
+ if(response == null || !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)){
+ throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "瀵逛笉璧凤紝娴峰悍鍚屾鏁版嵁澶辫触~");
+ }
+ BaseListPageResponse r = response.getData();
+ curTotal += 100;
+ if(curTotal >= r.getTotal()){
+ hasNext = false;
+ }
+ if(r.getList() == null || r.getList().size()==0){
+ hasNext =false;
+ }else{
+ allDoorList.addAll(r.getList());
+ }
+ curPage++;
+ }
+ return allDoorList;
+ }
private void getDataChangeList(List<Device> allList, List<DoorsInfoResponse> hkDoorList , List<AcsDeviceInfoResponse> allHkList, List<Device> addList, List<Device> editList,List<Device> deleteList, Date date) {
if(hkDoorList!=null && hkDoorList.size()>0){
diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncEmpowerServiceImpl.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncEmpowerServiceImpl.java
index ae2b0f8..d0e107c 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncEmpowerServiceImpl.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncEmpowerServiceImpl.java
@@ -6,6 +6,7 @@
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.HKResponseCode;
import com.doumee.core.haikang.model.param.BaseResponse;
import com.doumee.core.haikang.model.param.request.*;
import com.doumee.core.haikang.model.param.respose.*;
@@ -80,81 +81,96 @@
//鏌ヨ涓嬪彂鐘舵��
BaseResponse<TaskPersonDetailListResponse> response = HKService.taskPersoDetail(param);
if(response!=null
- && StringUtils.equals(response.getCode(),HKConstants.RESPONSE_SUCCEE) && response.getData()!=null
- ){
- if (response.getData().getList() != null
- && response.getData().getList().size() > 0) {
+ && StringUtils.equals(response.getCode(),HKConstants.RESPONSE_SUCCEE)
+ && response.getData()!=null
+ && response.getData().getList() != null
+ && response.getData().getList().size() > 0
+ &&response.getData().getList().get(0) !=null){
TaskPersonDetailResponse model = response.getData().getList().get(0);
- if (model != null && StringUtils.equals(model.getPersondownloadResult(), "0")) {
- //鏇存柊宸插畬鎴愪笅杞戒换鍔�
- String remark = "";
- String cardInfo = "鍗$墖涓嬪彂澶辫触";
- TaskPersonDetailCardFaceResponse d = model.getPersonDownloadDetail();
- if (d.getCards() != null && d.getCards().size() > 0) {
- cardInfo = "鍗$墖锛氥��";
- for (TaskPersonDetailCardInfoResponse card : d.getCards()) {
+ if (model.getPersonDownloadDetail()!=null ) {
+ boolean isface = false;//鏄惁浜鸿劯涓嬪彂鎴愬姛
+ boolean iscard = false;//鏄惁鏈夊崱鐗囦笅鍙戞垚鍔�
+ //鏇存柊宸插畬鎴愪笅杞戒换鍔�
+ String remark = "";
+ String cardInfo = "鍗$墖涓嬪彂澶辫触";
+ TaskPersonDetailCardFaceResponse d = model.getPersonDownloadDetail();
+ if (d.getCards() != null && d.getCards().size() > 0) {
+ for (TaskPersonDetailCardInfoResponse card : d.getCards()) {
+ if(StringUtils.equals(card.getErrorCode(),HKResponseCode.ReturnCode.RESPONSE_SUCCEE.getKey())){
cardInfo += card.getId() + " ";
+ iscard=true;
}
- cardInfo += "銆戜笅鍙戞垚鍔�";
}
- if (d.getFaces() == null || d.getFaces().size() == 0) {
- remark = cardInfo + "锛� 涓嶆敮鎸佷汉鑴歌澶囷紒";
- } else {
- remark = "" + cardInfo + "锛屼汉鑴镐笅鍙戞垚鍔燂紒";
+ if(iscard){
+ cardInfo = "鍗$墖銆�"+cardInfo+"銆戜笅鍙戞垚鍔�";
}
- empowerMapper.update(null, new UpdateWrapper<Empower>()
- .lambda()
- .eq(Empower::getId, c.getId())
- .set(Empower::getRemark, remark)
- .set(Empower::getSendInfo, remark)
- .set(Empower::getSendStatus, Constants.EmpowerStatus.pass));
- if(Constants.equalsInteger(c.getMemberDeleted(), Constants.ONE)&& Constants.equalsInteger(c.getIsdeleted(), Constants.ONE) ){
- //濡傛灉鏄垹闄ゆ潈闄愭垚鍔燂紝妫�鏌ユ槸鍚﹀垹闄や汉鍛�
- checkDelMemberTask(c.getMemberId(),c.getMemberHkId());
- }
+ }
+ if (d.getFaces() == null || d.getFaces().size() == 0) {
+ remark = cardInfo + "锛� 鏃犱汉鑴镐笅鍙戯紒";
} else {
- empowerMapper.update(null, new UpdateWrapper<Empower>()
- .lambda()
- .eq(Empower::getId, c.getId())
- .set(Empower::getRemark, "涓嬪彂澶辫触")
- .set(Empower::getSendInfo, "涓嬪彂澶辫触")
- .set(Empower::getSendStatus, Constants.EmpowerStatus.fail));
+ if(d.getFaces().get(0).getErrorCode() !=null && d.getFaces().get(0).getErrorCode().equals(HKConstants.RESPONSE_SUCCEE)){
+ isface=true;
+ remark = "" + cardInfo + "锛屼汉鑴镐笅鍙戞垚鍔燂紒";
+ }else{
+ isface=false;
+ if(d.getFaces().get(0).getErrorCode()!=null &&
+ (d.getFaces().get(0).getErrorCode().equals(HKResponseCode.ReturnCode.RESPONSE_FACE_ERROR.getKey()) ||
+ d.getFaces().get(0).getErrorCode().equals(HKResponseCode.ReturnCode.RESPONSE_FACE_ERROR2.getKey()))){
+ //濡傛灉浜鸿劯涓嶅悎鏍�
+ memberMapper.update(null,new UpdateWrapper<Member>().lambda()
+ .eq(Member::getId,c.getMemberId())
+ .set(Member::getFaceStatus,Constants.THREE)
+ .set(Member::getEditDate,new Date())
+ );
+ remark = "" + cardInfo + "锛屼汉鑴稿缓妯″け璐ワ紒";
+ }else if(d.getFaces().get(0).getErrorCode()!=null && d.getFaces().get(0).getErrorCode().equals(HKResponseCode.ReturnCode.RESPONSE_DEVICE_NOFAVOR.getKey())){
+ //濡傛灉璁惧涓嶆敮鎸佷汉鑴镐笅鍙�
+ isface=true;//姝ゆ儏鍐典笉瑕佽�冭檻浜鸿劯涓嬪彂缁撴灉
+ remark = "" + cardInfo + "锛岃澶囦笉鏀寔浜鸿劯涓嬪彂锛�";
+ }else{
+ remark = "" + cardInfo + "锛屼汉鑴镐笅鍙戝け璐ワ紒";
+ }
+ }
}
- } else {
- //濡傛灉鏄凡鍒犻櫎鐨勬暟鎹紝涓嬪彂澶辫触锛堥槻姝㈣澶囩绾匡級锛屽垯灏濊瘯閲嶆柊涓嬪彂浠诲姟
- if(Constants.equalsInteger(c.getIsdeleted(), Constants.ONE) ){
- empowerMapper.update(null, new UpdateWrapper<Empower>()
- .lambda()
- .eq(Empower::getId, c.getId())
- .set(Empower::getRemark, "鍒犻櫎鏉冮檺涓嬪彂澶辫触")
- .set(Empower::getSendInfo, "鍒犻櫎鏉冮檺涓嬪彂澶辫触")
- .set(Empower::getTryNum,Constants.formatIntegerNum(c.getTryNum())+1)
- .set(Empower::getSendStatus, Constants.EmpowerStatus.fail));
- }else{
- empowerMapper.update(null, new UpdateWrapper<Empower>()
- .lambda()
- .eq(Empower::getId, c.getId())
- .set(Empower::getRemark, "涓嬪彂澶辫触")
- .set(Empower::getTryNum,Constants.formatIntegerNum(c.getTryNum())+1)
- .set(Empower::getSendInfo, "涓嬪彂澶辫触")
- .set(Empower::getSendStatus, Constants.EmpowerStatus.fail));
+ //濡傛灉杩斿洖涓嬪彂鎴愬姛 鎴栬�� 浜鸿劯涓嬪彂鎴愬姛骞朵笖鍗$墖涓嬪彂鎴愬姛
+ boolean isSuccess =StringUtils.equals(model.getPersondownloadResult(), "0") || (iscard&&isface);
+ empowerMapper.update(null, new UpdateWrapper<Empower>()
+ .lambda()
+ .eq(Empower::getId, c.getId())
+ .set(Empower::getRemark, remark)
+ .set(Empower::getEditDate,new Date())
+ .set(Empower::getSendInfo, remark)
+ .set(Empower::getSendStatus, isSuccess?Constants.EmpowerStatus.pass:Constants.EmpowerStatus.fail));
+ if(isSuccess && Constants.equalsInteger(c.getMemberDeleted(), Constants.ONE)&& Constants.equalsInteger(c.getIsdeleted(), Constants.ONE) ){
+ //濡傛灉鏄垹闄ゆ潈闄愭垚鍔燂紝妫�鏌ユ槸鍚﹀垹闄や汉鍛�
+ checkDelMemberTask(c.getMemberId(),c.getMemberHkId());
}
+ continue;
}
- }else if(response!=null && StringUtils.equals(response.getCode(),HKConstants.RESPONSE_DOWNLOAD_ERROR) ){
+ }
+ //鎵�鏈夊紓甯告儏鍐甸兘鏍囪涓轰笅鍙戝け璐�
+ //濡傛灉鏄凡鍒犻櫎鐨勬暟鎹紝涓嬪彂澶辫触锛堥槻姝㈣澶囩绾匡級锛屽垯灏濊瘯閲嶆柊涓嬪彂浠诲姟
+ if(Constants.equalsInteger(c.getIsdeleted(), Constants.ONE) ){
empowerMapper.update(null, new UpdateWrapper<Empower>()
.lambda()
.eq(Empower::getId, c.getId())
+ .set(Empower::getRemark, "鍒犻櫎鏉冮檺涓嬪彂澶辫触")
+ .set(Empower::getSendInfo, "鍒犻櫎鏉冮檺涓嬪彂澶辫触")
+ .set(Empower::getTryNum,Constants.formatIntegerNum(c.getTryNum())+1)
+ .set(Empower::getSendStatus, Constants.EmpowerStatus.fail));
+ }else{
+ empowerMapper.update(null, new UpdateWrapper<Empower>()
+ .lambda()
+ .eq(Empower::getId, c.getId())
+ .set(Empower::getEditDate,new Date())
.set(Empower::getRemark, "涓嬪彂澶辫触")
-// .set(Empower::getFailFlag, Constants.ONE)//鏃犻渶閲嶅彂锛堜笅杞戒换鍔′笉瀛樺湪锛�
.set(Empower::getTryNum,Constants.formatIntegerNum(c.getTryNum())+1)
.set(Empower::getSendInfo, "涓嬪彂澶辫触")
.set(Empower::getSendStatus, Constants.EmpowerStatus.fail));
}
}
}catch (Exception e){
-
- }finally {
-// Constants.DEALING_HK_EMPOWER_DETAIL=false;
+ e.printStackTrace();
}
}
});
@@ -301,6 +317,7 @@
.lambda()
.eq(Empower::getHkId,c.getHkId() )
.set(Empower::getSendInfo,"浠诲姟宸蹭笅杞藉畬鎴�" )
+ .set(Empower::getRemark,"浠诲姟宸蹭笅杞藉畬鎴�" )
.set(Empower::getSendStatus,Constants.EmpowerStatus.downloaded) );
}
@@ -332,9 +349,6 @@
List<Integer> noIds = new ArrayList<>();
for(Empower empower:allList){
//濡傛灉鏄垹闄ょ殑鏉冮檺涓嬪彂锛屾煡璇㈡槸鍚︿己鍊欐湁涓嬪彂鎴愬姛鐨勬暟鎹紝濡傛灉鏈夛紝鍒欎笉澶勭悊
- if(empower.getId().equals(392479)){
- System.out.println("============================");
- }
// int flag= empowerMapper.selectCount(new QueryWrapper<Empower>().lambda()
// .eq(Empower::getMemberId,empower.getMemberId())
// .eq(Empower::getDeviceId,empower.getDeviceId() )
@@ -382,25 +396,10 @@
List<Empower> allList =getAllWaitDealList( endId);
if(allList !=null && allList.size()>0){
//鏌ヨ鎵�鏈夐渶瑕佸悓姝ョ殑鏁版嵁,閲嶆柊涓嬪彂鏈�鏂颁汉鍛樻潈闄愬嵆鍙�
-// dealNewListTask(getDealList(Constants.ZERO,endId));
- List<Empower> dellist = new ArrayList<>();
- List<Empower> addlist = new ArrayList<>();
- for(Empower e : allList){
- if(Constants.equalsInteger(e.getIsdeleted(),Constants.ONE)){
- dellist.add(e);
- }else {
- addlist.add(e);
- }
- }
Thread t1=new Thread(new Runnable() {
@Override
public void run() {
- if(dellist!=null &&dellist.size()>0) {
- dealDelListTask(dellist);
- }
- if(addlist!=null &&addlist.size()>0) {
- dealNewListTask(addlist);
- }
+ dealAllListTask(allList);
}
});
t1.start();
@@ -475,8 +474,8 @@
.set(Empower::getEditDate,date)
.in(Empower::getId,successList));
}
-
- empowerMapper.update(null,new UpdateWrapper<Empower>()
+ if(errorList.size()>0){
+ empowerMapper.update(null,new UpdateWrapper<Empower>()
.lambda()
.set(Empower::getSendStatus,Constants.EmpowerStatus.fail)
.set(Empower::getSendDate,date)
@@ -486,6 +485,8 @@
.set(Empower::getRemark, "娣诲姞涓嬪彂浠诲姟鏁版嵁鍒櫎鎺堟潈澶辫触")
.set(Empower::getEditDate,date)
.in(Empower::getId,errorList));
+
+ }
}
public class TaskRuner implements Runnable{
private List<Empower> list ;
@@ -501,6 +502,99 @@
public void setList(List<Empower> list) {
this.list = list;
}
+ }
+ private void dealAllListTask(List<Empower> list) {
+ //鎸夌収鐖剁骇鐢宠鍒嗘壒澶勭悊姣忔鐢宠鏁版嵁
+ if(list ==null || list.size()==0){
+ return;
+ }
+// clearAllEmpowerFirst(list);
+ Date date = new Date();
+ //鍒涘缓浠诲姟
+ String taskId = hkTaskAddtion();
+ List<Empower> successList = new ArrayList<>();
+ List<Empower> errorList = new ArrayList<>();
+ List<Empower> waitList = new ArrayList<>();
+ List<Empower> faceErrorList = new ArrayList<>();
+ for(Empower c : list) {
+ //鍚戜换鍔℃坊鍔犱汉鍛樸�佽澶囦俊鎭暟鎹�
+ if(c.getDeviceOnline() !=null && Constants.equalsInteger(c.getDeviceOnline(),0)){
+ waitList.add(c);
+ continue;
+ }
+ if( Constants.equalsInteger(c.getMemberFaceStatus(),Constants.THREE)){
+ faceErrorList.add(c);
+ continue;
+ }
+ HKConstants.OPERA_TYPE flag = HKConstants.OPERA_TYPE.ADD;
+ if(Constants.equalsObject(c.getIsdeleted(),Constants.ONE)){
+ flag = HKConstants.OPERA_TYPE.DEL;
+ }
+ if(addTaskData(c,taskId,flag.getKey())){
+ successList.add(c);
+ }else{
+ errorList.add(c);
+ }
+ }
+ if(successList.size()>0){
+ //寮�濮嬫墽琛屼笅鍙�
+ boolean status = startTask(taskId);
+ for(Empower model : successList){
+ Empower update = new Empower();
+ update.setId(model.getId());
+ update.setSendDate(date);
+ update.setEditDate(date);
+ update.setHkId(taskId);
+ update.setRemark(status?"涓嬪彂浠诲姟鎴愬姛":"涓嬪彂浠诲姟澶辫触");
+ update.setSendInfo(status?"涓嬪彂浠诲姟鎴愬姛":"涓嬪彂浠诲姟澶辫触");
+ //涓嬪彂涓�
+ update.setSendStatus(status?Constants.EmpowerStatus.ing:Constants.EmpowerStatus.fail);
+ empowerMapper.updateById(update);
+ }
+ }
+
+ if(errorList.size()>0){
+ for(Empower model : errorList){
+ Empower update = new Empower();
+ update.setId(model.getId());
+ update.setSendDate(date);
+ update.setEditDate(date);
+ update.setHkId(taskId);
+ update.setSendStatus(Constants.EmpowerStatus.fail);
+ update.setRemark( "娣诲姞涓嬪彂浠诲姟鏁版嵁澶辫触");
+ update.setSendInfo( "娣诲姞涓嬪彂浠诲姟鏁版嵁澶辫触");
+ empowerMapper.updateById(update);
+ }
+ }
+ if(waitList.size()>0){
+ for(Empower model : waitList){
+ Empower update = new Empower();
+ update.setId(model.getId());
+ update.setSendDate(date);
+ update.setEditDate(date);
+ update.setHkId(taskId);
+ update.setSendStatus(Constants.EmpowerStatus.fail);
+ update.setRemark( "璁惧鐘舵�佸紓甯革紝绛夊緟閲嶆柊涓嬪彂");
+ update.setSendInfo( "璁惧鐘舵�佸紓甯革紝绛夊緟閲嶆柊涓嬪彂");
+ empowerMapper.updateById(update);
+ }
+ }
+ if(faceErrorList.size()>0){
+ for(Empower model : faceErrorList){
+ Empower update = new Empower();
+ update.setId(model.getId());
+ update.setSendDate(date);
+ update.setEditDate(date);
+ update.setHkId(taskId);
+ update.setSendStatus(Constants.EmpowerStatus.fail);
+ update.setRemark( "浜鸿劯寤烘ā澶辫触锛岀瓑寰呮洿鎹汉鑴稿悗閲嶆柊涓嬪彂");
+ update.setSendInfo( "浜鸿劯寤烘ā澶辫触锛岀瓑寰呮洿鎹汉鑴稿悗閲嶆柊涓嬪彂");
+ empowerMapper.updateById(update);
+ }
+ }
+
+
+
}
private void dealNewListTask(List<Empower> list) {
//鎸夌収鐖剁骇鐢宠鍒嗘壒澶勭悊姣忔鐢宠鏁版嵁
@@ -538,17 +632,20 @@
}
}
- for(Empower model : errorList){
- Empower update = new Empower();
- update.setId(model.getId());
- update.setSendDate(date);
- update.setEditDate(date);
- update.setHkId(taskId);
- update.setSendStatus(Constants.EmpowerStatus.fail);
- update.setRemark( "娣诲姞涓嬪彂浠诲姟鏁版嵁澶辫触");
- update.setSendInfo( "娣诲姞涓嬪彂浠诲姟鏁版嵁澶辫触");
- empowerMapper.updateById(update);
+ if(errorList.size()>0){
+ for(Empower model : errorList){
+ Empower update = new Empower();
+ update.setId(model.getId());
+ update.setSendDate(date);
+ update.setEditDate(date);
+ update.setHkId(taskId);
+ update.setSendStatus(Constants.EmpowerStatus.fail);
+ update.setRemark( "娣诲姞涓嬪彂浠诲姟鏁版嵁澶辫触");
+ update.setSendInfo( "娣诲姞涓嬪彂浠诲姟鏁版嵁澶辫触");
+ empowerMapper.updateById(update);
+ }
}
+
}
@@ -639,6 +736,8 @@
queryWrapper.selectAll(Empower.class);
queryWrapper.selectAs(Device::getChannelNo,Empower::getDeviceChannelNo);
queryWrapper.selectAs(Member::getHkId,Empower::getMemberHkId);
+ queryWrapper.selectAs(Member::getFaceStatus,Empower::getMemberFaceStatus);
+ queryWrapper.selectAs(Device::getOnline,Empower::getDeviceOnline);
queryWrapper.selectAs(Device::getHkId,Empower::getDeviceIndexCode);
queryWrapper.selectAs(Device::getResourceType,Empower::getDeviceType);
queryWrapper.leftJoin(Device.class,Device::getId,Empower::getDeviceId);
@@ -656,6 +755,10 @@
MPJLambdaWrapper<Empower> queryWrapper = new MPJLambdaWrapper<>();
queryWrapper.select(Empower::getId,Empower::getMemberId,Empower::getDeviceId,Empower::getIsdeleted);
queryWrapper.select(" (select count(1) from empower ee where ee.member_id=t.MEMBER_ID and ee.device_id =t.DEVICE_ID and ee.id>t.id) as tempCouunt");
+ queryWrapper.leftJoin(Member.class,Member::getId,Empower::getMemberId);
+ queryWrapper.leftJoin(Device.class,Device::getId,Empower::getDeviceId);
+ queryWrapper.ne(Member::getFaceStatus,Constants.THREE);//浜鸿劯寤烘ā娌℃湁澶辫触杩囩殑
+ queryWrapper.ne(Device::getOnline,Constants.ZERO+"");//闈炵绾�
queryWrapper.eq(Empower::getSendStatus,Constants.EmpowerStatus.fail);
queryWrapper.gt(Empower::getId,endId);
queryWrapper.orderByAsc(Empower::getId );
diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncVisitServiceImpl.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncVisitServiceImpl.java
index 827a7fc..8a287bf 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncVisitServiceImpl.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncVisitServiceImpl.java
@@ -72,14 +72,15 @@
//鍙戣捣娴峰悍棰勭害鎺ュ彛锛堥渶瑕佺櫥璁帮級锛屾牴鎹绾﹁繑鍥炴帴鍙e皝瑁呯敵璇疯褰曟洿鏂板瓧娈�
AppointmentInfoResponse model = getVisitRecord(c.getHkId());
if(model == null){
- Visits update = new Visits();
+ continue;
+ /* Visits update = new Visits();
//宸插け鏁�
update.setStatus(Constants.VisitStatus.invalid);
update.setEditDate(date);
update.setId(c.getId());
update.setRemark("棰勭害宸茶娓呴櫎");
visitsMapper.updateById(update);
- continue;
+ continue;*/
}
/**
* * 0锛氬緟瀹℃牳锛堥绾﹀緟瀹℃壒锛夈��
diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/ferp/HkSyncOrgUserToHKServiceImpl.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/ferp/HkSyncOrgUserToHKServiceImpl.java
index 0fe2776..bc8ff99 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/ferp/HkSyncOrgUserToHKServiceImpl.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/ferp/HkSyncOrgUserToHKServiceImpl.java
@@ -305,14 +305,15 @@
String doorids =deviceRole.getDoorIds();
if(StringUtils.isNotBlank(doorids)){
String[] ss = doorids.split(",");
- try {
- for(String s :ss){
+ for(String s :ss){
+ try {
Integer ts =Integer.parseInt(s);
r.add(ts);
+ }catch (Exception e){
+ //鑴忔暟鎹笉澶勭悊
}
- }catch (Exception e){
- //鑴忔暟鎹笉澶勭悊
}
+
}
}
return r;
@@ -382,10 +383,10 @@
return;
}
- List<Integer> deviceIds =new ArrayList<>();//鏂拌澶囩紪鐮侀泦鍚�
- List<Empower> list = new ArrayList<>();//鏂版巿鏉冭褰曢泦鍚�
- if(Constants.equalsInteger(member.getIsdeleted(),Constants.ZERO)
- && Constants.equalsObject(member.getHkStatus(),Constants.ONE)){
+ if(Constants.equalsInteger(member.getIsdeleted(),Constants.ZERO)){
+// && Constants.equalsObject(member.getHkStatus(),Constants.ONE)){
+ List<Integer> deviceIds =new ArrayList<>();//鏂拌澶囩紪鐮侀泦鍚�
+ List<Empower> list = new ArrayList<>();//鏂版巿鏉冭褰曢泦鍚�
//濡傛灉鐢ㄦ埛鏄悓姝ユ捣搴锋垚鍔燂紝娣诲姞甯︿笅鍙戞潈闄愶紙鍙鐞嗘柊澧炴垨鑰呯紪杈戠殑锛�
List<Device> deviceList = deviceMapper.selectList(new QueryWrapper<Device>().lambda().in(Device::getId,doorIds));
if(deviceList == null || deviceList.size() == 0){
@@ -409,22 +410,22 @@
deviceIds.add(deviceRole.getId());
list.add(model);
}
- }
- //寰呯Щ闄ゆ潈闄愮殑璁惧鏁版嵁鎺堟潈璁板綍锛堥拡瀵瑰垹闄ゅ拰鏇存柊涓㈠け鐨勬潈闄愶紝闇�瑕佸悓姝ヤ笅鍙戝垹闄ゆ潈闄愶級
- empowerMapper.update(null,new UpdateWrapper<Empower>().lambda()
- .eq(Empower::getMemberId,member.getId())
- .set(Empower::getIsdeleted,Constants.ONE)
- .eq(Empower::getIsdeleted,Constants.ZERO)
- .notIn(deviceIds.size()>0,Empower::getDeviceId,deviceIds)
- .set(Empower::getSendStatus,Constants.ZERO));
- //瀵煎叆鏂板鐨勬巿鏉冧俊鎭�
- if(list.size()>0){
- //鐩存帴瑕嗙洊閲嶅鐨勮澶囨潈闄愶紝鐩存帴鍒犻櫎鍗冲彲
- empowerMapper.delete(new UpdateWrapper<Empower>().lambda()
+ //寰呯Щ闄ゆ潈闄愮殑璁惧鏁版嵁鎺堟潈璁板綍锛堥拡瀵瑰垹闄ゅ拰鏇存柊涓㈠け鐨勬潈闄愶紝闇�瑕佸悓姝ヤ笅鍙戝垹闄ゆ潈闄愶級
+ empowerMapper.update(null,new UpdateWrapper<Empower>().lambda()
.eq(Empower::getMemberId,member.getId())
+ .set(Empower::getIsdeleted,Constants.ONE)
.eq(Empower::getIsdeleted,Constants.ZERO)
- .in(Empower::getDeviceId,deviceIds) );
- empowerMapper.insertBatchSomeColumn(list);
+ .notIn(deviceIds.size()>0,Empower::getDeviceId,deviceIds)
+ .set(Empower::getSendStatus,Constants.ZERO));
+ //瀵煎叆鏂板鐨勬巿鏉冧俊鎭�
+ if(list.size()>0){
+ //鐩存帴瑕嗙洊閲嶅鐨勮澶囨潈闄愶紝鐩存帴鍒犻櫎鍗冲彲
+ empowerMapper.delete(new UpdateWrapper<Empower>().lambda()
+ .eq(Empower::getMemberId,member.getId())
+ .eq(Empower::getIsdeleted,Constants.ZERO)
+ .in(Empower::getDeviceId,deviceIds) );
+ empowerMapper.insertBatchSomeColumn(list);
+ }
}
}
public static void dealChangeDeviceRoleEmpower( Member member ,List<Integer> addDoorIds,List<Integer> delDoorIds, DeviceRoleMapper deviceRoleMapper, EmpowerMapper empowerMapper, DeviceMapper deviceMapper) {
@@ -606,7 +607,7 @@
c.setFaceStatus(Constants.ONE);
//濡傛灉浜鸿劯璺熶綘锛岄噸鏂颁笅鍙戞潈闄愭暟鎹�
c.setRemark("浜哄憳鍜屼汉鑴镐俊鎭悓姝ユ垚鍔�"+result.getMsg());
- dealMemberRoleEmpower(c);
+ dealMemberRoleEmpower(c);
}
}
}else{
--
Gitblit v1.9.3