liu 2 年 前
コミット
5a672fa433

+ 40 - 0
src/main/java/com/template/controller/SmartUserController.java

@@ -2032,6 +2032,20 @@ public class SmartUserController implements SmartUserControllerAPI {
             boolean updateBatch = smartUserService.updateUserBatchById(updateStudent);
             if (!updateBatch) {
                 return CommonResult.fail("系统批量更新出错,导入失败");
+            }else {
+//                修改需同步到海康平台
+                for (SmartUser su : updateStudent) {
+                    Integer identityId = su.getIdentityId();
+                    if (2==identityId || identityId==3) {
+                        Integer id = su.getId();
+                        SmartOperationUser smartOperationUser = new SmartOperationUser();
+                        smartOperationUser.setOperationId(id);
+                        smartOperationUser.setOperationMode("2");
+                        smartOperationUser.setStatus(1);
+                        smartOperationUser.setType(identityId);
+                        smartOperationUserService.save(smartOperationUser);
+                    }
+                }
             }
         }
 
@@ -2617,7 +2631,20 @@ public class SmartUserController implements SmartUserControllerAPI {
         }
 
         int result = smartUserService.insertSmartUser(su);
+
         if (result > 0) {
+            //        将添加的用户同步到海康平台
+            Integer identityId = su.getIdentityId();
+            if (2==identityId || identityId==3) {
+                Integer id = su.getId();
+                SmartOperationUser smartOperationUser = new SmartOperationUser();
+                smartOperationUser.setOperationId(id);
+                smartOperationUser.setOperationMode("1");
+                smartOperationUser.setStatus(1);
+                smartOperationUser.setType(identityId);
+                smartOperationUserService.save(smartOperationUser);
+            }
+
             if (isur.getIdentityId().intValue() == eIdentityStatu.Teacher.getValue() && isur.getIsr() != null && isur.getIsr().size() > 0) {
                 List<SmartTeaching> teachings = new ArrayList<>();
                 for (isrRequest sv : isur.getIsr()) {
@@ -3205,6 +3232,19 @@ public class SmartUserController implements SmartUserControllerAPI {
         }
 
         int result = smartUserService.updateSmartUser(su);
+//        修改需同步到海康平台
+        if (result>0) {
+            Integer identityId = su.getIdentityId();
+            if (2==identityId || identityId==3) {
+                Integer id = su.getId();
+                SmartOperationUser smartOperationUser = new SmartOperationUser();
+                smartOperationUser.setOperationId(id);
+                smartOperationUser.setOperationMode("2");
+                smartOperationUser.setStatus(1);
+                smartOperationUser.setType(identityId);
+                smartOperationUserService.save(smartOperationUser);
+            }
+        }
         //region 任课数据
         if (result > 0 && usur.getIdentityId().intValue() == eIdentityStatu.Teacher.getValue()) {
             smartTeachingService.deleteByUserId(su.getId());//删除任课