+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *
+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see > record = epmetUserOpenFeignClient.getPatrolRoutineWorkListV2(midPatrolFormDTO);
- if (record == null || !record.success()) {
- log.error("获取例行工作记录V2失败,param:{}", JSON.toJSONString(midPatrolFormDTO));
- throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode());
- }
- data = record.getData();
- if (CollectionUtils.isEmpty(data)) {
- //数据已被删除了
- //暂时设置error 用于排错
- log.error("获取例行工作记录返回为空,param:{}", JSON.toJSONString(midPatrolFormDTO));
- int effectRow = baseDao.deleteById(patrolRecordForm.getId());
- log.warn("del effectRow:{}", effectRow);
- throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode());
- }
- data.forEach(d -> {
- GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(d.getGridId());
- if (null == gridInfo){
- throw new EpmetException("未查询到网格信息:"+ d.getGridId());
- }
- d.setGridCode(gridInfo.getCode());
- d.setGridName(gridInfo.getGridName());
- });
- insertNewRecordBatch(data);
- }while (data.size() == NumConstant.ONE_THOUSAND);
- return true;
- }
-
- /**
- * Desc: 历史数据处理
- * @param formDTO
- * @author zxc
- * @date 2022/7/22 13:24
- */
- @Override
- public void historyDataSync(HistoryDataSyncFormDTO formDTO) {
- Integer pageSize = NumConstant.ONE_THOUSAND;
- Integer pageNo = NumConstant.ONE;
- List
> partition = ListUtils.partition(newEntities, NumConstant.ONE_HUNDRED);
- partition.forEach(p -> {
- pingYinService.insertBatch(p);
- });
- }
- }
-
- private Boolean insertNewRecordBatch(List
> record = epmetUserOpenFeignClient.getPatrolRoutineWorkListV2(midPatrolFormDTO);
+ midPatrolFormDTO.setPageNo(midPatrolFormDTO.getPageNo() + 1);
+ if (record == null || !record.success()) {
+ log.error("获取例行工作记录V2失败,param:{}", JSON.toJSONString(midPatrolFormDTO));
+ throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode());
+ }
+ data = record.getData();
+ if (CollectionUtils.isEmpty(data)) {
+ //数据已被删除了
+ //暂时设置error 用于排错
+ log.error("获取例行工作记录返回为空,param:{}", JSON.toJSONString(midPatrolFormDTO));
+ int effectRow = baseDao.deleteById(patrolRecordForm.getId());
+ log.warn("del effectRow:{}", effectRow);
+ throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode());
+ }
+ data.forEach(d -> {
+ GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(d.getGridId());
+ if (null == gridInfo) {
+ log.warn("未查询到网格信息:" + d.getGridId());
+ return;
+ }
+ String s = StrUtil.filterEmoji(d.getWorkContent());
+ d.setWorkContent(s);
+ d.setGridCode(gridInfo.getCode());
+ d.setGridName(gridInfo.getGridName());
+ });
+ insertNewRecordBatch(data);
+
+ } while (data.size() == NumConstant.ONE_THOUSAND);
+ return true;
+ }
+
+ /**
+ * Desc: 数据存入
+ *
+ * @param newEntities
+ * @author zxc
+ * @date 2022/7/22 14:17
+ */
+ @Transactional(rollbackFor = Exception.class)
+ public void insertGridStaffWorkInfoPY(List
> partition = ListUtils.partition(newEntities, NumConstant.ONE_HUNDRED);
+ partition.forEach(p -> {
+ this.insertBatch(p);
+ });
+ }
+ }
+
+ private Boolean insertNewRecordBatch(List