Quellcode durchsuchen

Merge branch 'master' of https://e.coding.net/chuanghaikeji/smartCampus/backend_code

夏文涛 vor 2 Jahren
Ursprung
Commit
d6829f3750
1 geänderte Dateien mit 40 neuen und 0 gelöschten Zeilen
  1. 40 0
      src/main/java/com/template/controller/SmartUserController.java

+ 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()) {
             //查找原有的任课数据