| | |
| | | import cn.gistack.sm.sjztmd.entity.TbAttResRsbVerspi; |
| | | import cn.gistack.sm.sjztmd.entity.TbAttResRsbVerspi; |
| | | import cn.gistack.sm.sjztmd.mapper.TbAttResRsbVerspiMapper; |
| | | import cn.gistack.sm.sjztmd.service.ITbAttResBaseService; |
| | | import cn.gistack.sm.sjztmd.service.ITbAttResRsbVerspiService; |
| | | 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<TbAttResRsbVerspi> newList) { |
| | | boolean edit = false; |
| | | // 编辑标记 |
| | | if (newList.get(0).getCheckState()==4){ |
| | | edit = true; |
| | | } |
| | | // 查询是否存在 |
| | | List<TbAttResRsbVerspi> 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; |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public boolean auditByGuid(List<TbAttResRsbVerspi> newList) { |
| | | boolean edit = false; |
| | | // 编辑标记 |
| | | if (newList.get(0).getCheckState()==4){ |
| | | edit = true; |
| | | } |
| | | // 查询是否存在 |
| | | List<TbAttResRsbVerspi> 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 (newTbAttResRsbVerspi.getCheckState()==4){ |
| | | fillName = "编辑"; |
| | | // 找到相关的 guid 数据 |
| | | for (TbAttResRsbVerspi tbAttResRsbVerspi : oldList) { |
| | | if (tbAttResRsbVerspi.getGuid().equals(newTbAttResRsbVerspi.getGuid())){ |
| | | newTbAttResRsbVerspi.setCheckState(tbAttResRsbVerspi.getCheckState()); |
| | | } |
| | | if (oldList.size()>0){ |
| | | newTbAttResRsbVerspi.setCheckState(oldList.get(0).getCheckState()); |
| | | } |
| | | } |
| | | |