| | |
| | | import cn.gistack.sm.intelligentCall.entity.Scene; |
| | | import cn.gistack.sm.sjztmd.entity.TbAttResPowerStation; |
| | | import cn.gistack.sm.sjztmd.mapper.TbAttResPowerStationMapper; |
| | | import cn.gistack.sm.sjztmd.service.ITbAttResBaseService; |
| | | import cn.gistack.sm.sjztmd.service.ITbAttResPowerStationService; |
| | | import cn.gistack.system.user.feign.IUserClient; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | |
| | | @Autowired |
| | | private IUserClient userClient; |
| | | |
| | | @Autowired |
| | | private ITbAttResBaseService tbAttResBaseService; |
| | | |
| | | /** |
| | | * 查询水库填报详情信息 |
| | | * @param guid |
| | |
| | | */ |
| | | @Override |
| | | public boolean updateByGuid(List<TbAttResPowerStation> newList) { |
| | | boolean edit = false; |
| | | // 编辑标记 |
| | | if (newList.get(0).getCheckState()==4){ |
| | | edit = true; |
| | | } |
| | | // 查询是否存在 |
| | | List<TbAttResPowerStation> oldList = baseMapper.getDetailByResGuid(newList.get(0).getResGuid()); |
| | | // 更新日志 |
| | | setUpdateLog(oldList,newList); |
| | | // 创建或更新数据 |
| | | boolean flag = addOrUpdate(oldList,newList); |
| | | if (flag){ |
| | | if (!edit) { |
| | | tbAttResBaseService.updateFinalState(newList.get(0).getResGuid(), 0); |
| | | } |
| | | return true; |
| | | } |
| | | // 返回 |
| | | return flag; |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | |
| | | boolean updateFlag = true; |
| | | boolean removeFlag = true; |
| | | if (addList.size()>0){ |
| | | //如果是中途管理员编辑新增了一个,将状态设置为和原有的状态一致 |
| | | // 批量新增 |
| | | addFlag = saveBatch(addList); |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public boolean auditByGuid(List<TbAttResPowerStation> newList) { |
| | | boolean edit = false; |
| | | // 编辑标记 |
| | | if (newList.get(0).getCheckState()==4){ |
| | | edit = true; |
| | | } |
| | | // 查询是否存在 |
| | | List<TbAttResPowerStation> oldList = baseMapper.getDetailByResGuid(newList.get(0).getResGuid()); |
| | | // 更新操作日志 |
| | |
| | | setUpdateCheckLog(oldList,newList); |
| | | // 更新数据 |
| | | boolean batch = updateBatchById(newList); |
| | | if (batch){ |
| | | if (!edit) { |
| | | tbAttResBaseService.updateFinalState(newList.get(0).getResGuid(), newList.get(0).getCheckState()); |
| | | } |
| | | return true; |
| | | } |
| | | // 返回 |
| | | return batch; |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | |
| | | if (newTbAttResPowerStation.getCheckState()==4){ |
| | | fillName = "编辑"; |
| | | // 找到相关的 guid 数据 |
| | | for (TbAttResPowerStation tbAttResPowerStation : oldList) { |
| | | if (tbAttResPowerStation.getGuid().equals(newTbAttResPowerStation.getGuid())){ |
| | | newTbAttResPowerStation.setCheckState(tbAttResPowerStation.getCheckState()); |
| | | } |
| | | if (oldList.size()>0) { |
| | | newTbAttResPowerStation.setCheckState(oldList.get(0).getCheckState()); |
| | | } |
| | | } |
| | | |