wuxw
2024-01-22 a40c2eb885bcdb697c2e16dae4f43cb6cd718973
service-job/src/main/java/com/java110/job/adapt/hcIot/parkingBox/ModifyParkingBoxToIotAdapt.java
@@ -15,17 +15,16 @@
 */
package com.java110.job.adapt.hcIot.parkingBox;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.dto.parkingBox.ParkingBoxDto;
import com.java110.dto.parkingBoxArea.ParkingBoxAreaDto;
import com.java110.entity.order.Business;
import com.java110.dto.parking.ParkingBoxDto;
import com.java110.dto.parking.ParkingBoxAreaDto;
import com.java110.dto.system.Business;
import com.java110.intf.community.IParkingBoxAreaV1InnerServiceSMO;
import com.java110.intf.community.IParkingBoxV1InnerServiceSMO;
import com.java110.intf.user.IOwnerInnerServiceSMO;
import com.java110.job.adapt.DatabusAdaptImpl;
import com.java110.job.adapt.hcIot.asyn.IIotSendAsyn;
import com.java110.po.parkingBox.ParkingBoxPo;
import com.java110.po.parking.ParkingBoxPo;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
import org.springframework.beans.factory.annotation.Autowired;
@@ -73,23 +72,25 @@
    @Override
    public void execute(Business business, List<Business> businesses) {
        JSONObject data = business.getData();
        if (data.containsKey(ParkingBoxPo.class.getSimpleName())) {
            Object bObj = data.get(ParkingBoxPo.class.getSimpleName());
            JSONArray businessParkingBoxs = null;
            if (bObj instanceof JSONObject) {
                businessParkingBoxs = new JSONArray();
                businessParkingBoxs.add(bObj);
            } else if (bObj instanceof List) {
                businessParkingBoxs = JSONArray.parseArray(JSONObject.toJSONString(bObj));
            } else {
                businessParkingBoxs = (JSONArray) bObj;
            }
            //JSONObject businessParkingBox = data.getJSONObject("businessParkingBox");
            for (int bParkingBoxIndex = 0; bParkingBoxIndex < businessParkingBoxs.size(); bParkingBoxIndex++) {
                JSONObject businessParkingBox = businessParkingBoxs.getJSONObject(bParkingBoxIndex);
                doSendParkingBox(business, businessParkingBox);
            }
        }
//        if (data.containsKey(ParkingBoxPo.class.getSimpleName())) {
//            Object bObj = data.get(ParkingBoxPo.class.getSimpleName());
//            JSONArray businessParkingBoxs = null;
//            if (bObj instanceof JSONObject) {
//                businessParkingBoxs = new JSONArray();
//                businessParkingBoxs.add(bObj);
//            } else if (bObj instanceof List) {
//                businessParkingBoxs = JSONArray.parseArray(JSONObject.toJSONString(bObj));
//            } else {
//                businessParkingBoxs = (JSONArray) bObj;
//            }
//            //JSONObject businessParkingBox = data.getJSONObject("businessParkingBox");
//            for (int bParkingBoxIndex = 0; bParkingBoxIndex < businessParkingBoxs.size(); bParkingBoxIndex++) {
//                JSONObject businessParkingBox = businessParkingBoxs.getJSONObject(bParkingBoxIndex);
//                doSendParkingBox(business, businessParkingBox);
//            }
//        }
        doSendParkingBox(business, data);
    }
    private void doSendParkingBox(Business business, JSONObject businessParkingBox) {