|
|
@ -3,6 +3,7 @@ package com.mh.user.service.impl; |
|
|
|
import com.mh.user.entity.NowPublicDataEntity; |
|
|
|
import com.mh.user.entity.NowPublicDataEntity; |
|
|
|
import com.mh.user.mapper.BuildingMapper; |
|
|
|
import com.mh.user.mapper.BuildingMapper; |
|
|
|
import com.mh.user.mapper.DeviceInstallMapper; |
|
|
|
import com.mh.user.mapper.DeviceInstallMapper; |
|
|
|
|
|
|
|
import com.mh.user.mapper.NowDataMapper; |
|
|
|
import com.mh.user.mapper.NowPublicDataMapper; |
|
|
|
import com.mh.user.mapper.NowPublicDataMapper; |
|
|
|
import com.mh.user.model.TempModel; |
|
|
|
import com.mh.user.model.TempModel; |
|
|
|
import com.mh.user.service.NowPublicDataService; |
|
|
|
import com.mh.user.service.NowPublicDataService; |
|
|
@ -14,6 +15,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
@Slf4j |
|
|
|
@Slf4j |
|
|
|
@Service |
|
|
|
@Service |
|
|
@ -29,6 +31,8 @@ public class NowPublicDataServiceImpl implements NowPublicDataService { |
|
|
|
BuildingMapper buildingMapper; |
|
|
|
BuildingMapper buildingMapper; |
|
|
|
|
|
|
|
|
|
|
|
private final SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
private final SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private NowDataMapper nowDataMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void saveNowPublicData(NowPublicDataEntity nowPublicDataEntity) { |
|
|
|
public void saveNowPublicData(NowPublicDataEntity nowPublicDataEntity) { |
|
|
@ -84,6 +88,13 @@ public class NowPublicDataServiceImpl implements NowPublicDataService { |
|
|
|
if (r1==0){ |
|
|
|
if (r1==0){ |
|
|
|
nowPublicDataMapper.saveNowPublicData(nowPublicDataEntity); |
|
|
|
nowPublicDataMapper.saveNowPublicData(nowPublicDataEntity); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
// 判断今天的记录是否存在多个补水,供水,回水状态值
|
|
|
|
|
|
|
|
Map<String, Object> states = nowDataMapper.selectTopOneState(buildingId); |
|
|
|
|
|
|
|
if (states != null && !states.isEmpty()) { |
|
|
|
|
|
|
|
nowPublicDataEntity.setUpWater(String.valueOf(states.get("up_water_state"))); |
|
|
|
|
|
|
|
nowPublicDataEntity.setUseWater(String.valueOf(states.get("use_water_state"))); |
|
|
|
|
|
|
|
nowPublicDataEntity.setBackWater(String.valueOf(states.get("back_water_state"))); |
|
|
|
|
|
|
|
} |
|
|
|
nowPublicDataMapper.updateNowPublicData(nowPublicDataEntity); |
|
|
|
nowPublicDataMapper.updateNowPublicData(nowPublicDataEntity); |
|
|
|
} |
|
|
|
} |
|
|
|
//判断历史表是否有记录
|
|
|
|
//判断历史表是否有记录
|
|
|
|