|
@@ -94,7 +94,7 @@ public class DeviceSyncServiceImpl implements DeviceSyncService, InitializingBea
|
|
|
String customerNo="";
|
|
|
List<PayBaseConfigDto> payBaseConfigDtos = payBaseConfigService.getPrintInfo("CUSTOMER_NO",siteId,customerId);
|
|
|
for (PayBaseConfigDto item : payBaseConfigDtos){
|
|
|
- if(item.getName().trim()=="CUSTOMER_NO"){
|
|
|
+ if("CUSTOMER_NO".equals(item.getName().trim())){
|
|
|
customerNo = item.getValue();
|
|
|
}
|
|
|
}
|
|
@@ -103,12 +103,13 @@ public class DeviceSyncServiceImpl implements DeviceSyncService, InitializingBea
|
|
|
|
|
|
//查询未同步的数据
|
|
|
String url = SyncUrl+"/api/syncData/meterSync";
|
|
|
- List<Device> deviceList = deviceMapper.getNoSyncList();
|
|
|
+ List<Device> deviceList = deviceMapper.getNoSyncList(siteId,customerId);
|
|
|
if(deviceList != null && deviceList.size() >0){
|
|
|
|
|
|
List<List<Device>> lists = Lists.partition(deviceList,500);
|
|
|
for(List<Device> subDeviceList : lists){
|
|
|
MeterSyncInputDto meterSyncInputDto = new MeterSyncInputDto();
|
|
|
+
|
|
|
meterSyncInputDto.setCustomerNo(customerNo);
|
|
|
List<String> fileNos = new ArrayList<>();
|
|
|
for (Device device:subDeviceList){
|
|
@@ -125,8 +126,12 @@ public class DeviceSyncServiceImpl implements DeviceSyncService, InitializingBea
|
|
|
if(ajaxMessage != null){
|
|
|
//更新水表信息
|
|
|
if(ajaxMessage.getStatus() == 0){
|
|
|
+ List<MeterSyncDto> meterSyncDtoList = ajaxMessage.getData();
|
|
|
+
|
|
|
+ for(int i=0;i<meterSyncDtoList.size();i++){
|
|
|
|
|
|
- for(MeterSyncDto meterSyncDto:ajaxMessage.getData()){
|
|
|
+ String strList = JacksonUtil.obj2String(meterSyncDtoList.get(i));
|
|
|
+ MeterSyncDto meterSyncDto = JacksonUtil.string2Obj(strList,MeterSyncDto.class);
|
|
|
meterSyncDto.setCurrStatus(1);
|
|
|
deviceMapper.updateSync(meterSyncDto);
|
|
|
}
|