| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 虫害检测数据同步 |
| | |
| | | Date syncTime = new Date(); |
| | | Api1304 api1304; |
| | | Api1105 api1105; |
| | | // int index = 10001; |
| | | List<Api1304> api1304List; |
| | | for (Fz35Gas fz35Gas : list) { |
| | | //获取货位信息 |
| | | api1105 = commonService.getApi1105Cache(fz35Gas.getDepotId()); |
| | |
| | | |
| | | api1304 = updateGasInfo(api1304, fz35Gas.getPoints()); |
| | | |
| | | api1304.setCzbz(Constant.CZBZ_I); |
| | | api1304.setZhgxsj(syncTime); |
| | | |
| | | api1304.setBizId(fz35Gas.getBatchId()); |
| | | api1304.setKqdm(api1105.getKqdm()); |
| | | api1304.setSyncTime(syncTime); |
| | | api1304List = api1304Rep.getDataByQtndjcdh(api1304.getQtndjcdh()); |
| | | if(null == api1304List || api1304List.isEmpty()){ |
| | | api1304.setCzbz(Constant.CZBZ_I); |
| | | }else { |
| | | api1304.setCzbz(api1304List.get(0).getCzbz()); |
| | | } |
| | | api1304Rep.save(api1304); |
| | | // index++; |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("---同步失败----{}", e); |