k94314517
2024-09-30 4229bc67c2c0adf5603c7f68a1e55e480d011d75
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPlatformsServiceImpl.java
@@ -4,7 +4,6 @@
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.*;
@@ -12,7 +11,6 @@
import com.doumee.core.haikang.service.HKService;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.DateUtil;
import com.doumee.dao.business.DeviceMapper;
import com.doumee.dao.business.PlatformDeviceMapper;
import com.doumee.dao.business.PlatformMapper;
import com.doumee.dao.business.model.Device;
@@ -24,7 +22,6 @@
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;
@@ -35,7 +32,6 @@
 */
@Service
public class HkSyncPlatformsServiceImpl extends HkSyncBaseServiceImpl {
    @Autowired
    private PlatformMapper platformMapper;
    @Autowired
@@ -105,7 +101,7 @@
                //更新状态 (月台状态 0-无车 1-有车 2-超时停靠 3-错误停靠)
                for(PlatformStatusInfoResponse d : allHkList){
                    platformMapper.update(null,new UpdateWrapper<Platform>().lambda()
                            .set(Platform::getStatus,d.getStatus())
                            .set(Platform::getPlatformStatus,d.getStatus())
                            .set(Platform::getEditDate,date)
                            .eq(Platform::getHkId,d.getPlatformId()));
                }
@@ -165,7 +161,9 @@
                    editList.add(model);
                    //清空监控点数据
                    platformDeviceMapper.delete(new UpdateWrapper<PlatformDevice>().lambda()
                            .eq(PlatformDevice::getPlatformId,model.getId()));
                            .eq(PlatformDevice::getPlatformId,model.getId())
                            .eq(PlatformDevice::getType,Constants.ONE)
                    );
                    deviceList.addAll(getCameraList(device.getCameras(),model));
                }else{
                    //如果不存在,则新增数据
@@ -183,7 +181,7 @@
    private List<PlatformDevice> getCameraList(List<PlatformCameraInfoResponse> cameras, Platform model) {
        List<PlatformDevice> list = new ArrayList<>();
        if(cameras!=null || cameras.size()>0){
        if(cameras!=null && cameras.size()>0){
            for(PlatformCameraInfoResponse param :cameras){
                PlatformDevice d = new PlatformDevice();
                d.setCreateDate(model.getCreateDate());
@@ -255,7 +253,6 @@
            }
        }
        return  true;
    }
}