service-job/src/main/java/com/java110/job/adapt/hcIot/staff/AddStaffToIotAdapt.java
@@ -69,23 +69,27 @@ @Override public void execute(Business business, List<Business> businesses) { JSONObject data = business.getData(); JSONArray businessStoreUsers = new JSONArray(); if (data.containsKey(StoreUserPo.class.getSimpleName())) { Object bObj = data.get(StoreUserPo.class.getSimpleName()); JSONArray businessStoreUsers = null; if (bObj instanceof JSONObject) { businessStoreUsers = new JSONArray(); businessStoreUsers.add(bObj); } else if (bObj instanceof List) { businessStoreUsers = JSONArray.parseArray(JSONObject.toJSONString(bObj)); } else { businessStoreUsers = (JSONArray) bObj; } //JSONObject businessStoreUser = data.getJSONObject("businessStoreUser"); for (int bStoreUserIndex = 0; bStoreUserIndex < businessStoreUsers.size(); bStoreUserIndex++) { JSONObject businessStoreUser = businessStoreUsers.getJSONObject(bStoreUserIndex); doSendStoreUser(business, businessStoreUser); }else { if (data instanceof JSONObject) { businessStoreUsers.add(data); } } //JSONObject businessStoreUser = data.getJSONObject("businessStoreUser"); for (int bStoreUserIndex = 0; bStoreUserIndex < businessStoreUsers.size(); bStoreUserIndex++) { JSONObject businessStoreUser = businessStoreUsers.getJSONObject(bStoreUserIndex); doSendStoreUser(business, businessStoreUser); } } private void doSendStoreUser(Business business, JSONObject businessStoreUser) { service-job/src/main/java/com/java110/job/adapt/hcIot/staff/DeleteStaffToIotAdapt.java
@@ -71,23 +71,27 @@ @Override public void execute(Business business, List<Business> businesses) { JSONObject data = business.getData(); JSONArray businessOwnerAttendances = new JSONArray(); if (data.containsKey(StoreUserPo.class.getSimpleName())) { Object bObj = data.get(StoreUserPo.class.getSimpleName()); JSONArray businessOwnerAttendances = null; if (bObj instanceof JSONObject) { businessOwnerAttendances = new JSONArray(); businessOwnerAttendances.add(bObj); } else if (bObj instanceof List) { businessOwnerAttendances = JSONArray.parseArray(JSONObject.toJSONString(bObj)); } else { businessOwnerAttendances = (JSONArray) bObj; } //JSONObject businessOwnerAttendance = data.getJSONObject("businessOwnerAttendance"); for (int bOwnerAttendanceIndex = 0; bOwnerAttendanceIndex < businessOwnerAttendances.size(); bOwnerAttendanceIndex++) { JSONObject businessOwnerAttendance = businessOwnerAttendances.getJSONObject(bOwnerAttendanceIndex); doSendOwnerAttendance(business, businessOwnerAttendance); }else { if (data instanceof JSONObject) { businessOwnerAttendances.add(data); } } //JSONObject businessOwnerAttendance = data.getJSONObject("businessOwnerAttendance"); for (int bOwnerAttendanceIndex = 0; bOwnerAttendanceIndex < businessOwnerAttendances.size(); bOwnerAttendanceIndex++) { JSONObject businessOwnerAttendance = businessOwnerAttendances.getJSONObject(bOwnerAttendanceIndex); doSendOwnerAttendance(business, businessOwnerAttendance); } } private void doSendOwnerAttendance(Business business, JSONObject businessStoreUser) { service-job/src/main/java/com/java110/job/adapt/hcIot/staff/UpdateStaffToIotAdapt.java
@@ -67,23 +67,29 @@ @Override public void execute(Business business, List<Business> businesses) { JSONObject data = business.getData(); JSONArray businessOwnerAttendances = new JSONArray(); if (data.containsKey(AttendanceClassesPo.class.getSimpleName())) { Object bObj = data.get(AttendanceClassesPo.class.getSimpleName()); JSONArray businessOwnerAttendances = null; if (bObj instanceof JSONObject) { businessOwnerAttendances = new JSONArray(); businessOwnerAttendances.add(bObj); } else if (bObj instanceof List) { businessOwnerAttendances = JSONArray.parseArray(JSONObject.toJSONString(bObj)); } else { businessOwnerAttendances = (JSONArray) bObj; } //JSONObject businessOwnerAttendance = data.getJSONObject("businessOwnerAttendance"); for (int bOwnerAttendanceIndex = 0; bOwnerAttendanceIndex < businessOwnerAttendances.size(); bOwnerAttendanceIndex++) { JSONObject businessOwnerAttendance = businessOwnerAttendances.getJSONObject(bOwnerAttendanceIndex); doSendOwnerAttendance(business, businessOwnerAttendance); }else { if (data instanceof JSONObject) { businessOwnerAttendances.add(data); } } //JSONObject businessOwnerAttendance = data.getJSONObject("businessOwnerAttendance"); for (int bOwnerAttendanceIndex = 0; bOwnerAttendanceIndex < businessOwnerAttendances.size(); bOwnerAttendanceIndex++) { JSONObject businessOwnerAttendance = businessOwnerAttendances.getJSONObject(bOwnerAttendanceIndex); doSendOwnerAttendance(business, businessOwnerAttendance); } } private void doSendOwnerAttendance(Business business, JSONObject businessOwnerAttendance) {