| | |
| | | * @param eldersAuthFeedbackAddDTO |
| | | * @return 新增结果 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R addFeedback(EldersAuthFeedbackAddDTO eldersAuthFeedbackAddDTO){ |
| | | EldersAuthDO eldersAuthDO = eldersAuthDAO.selectById(eldersAuthFeedbackAddDTO.getAuthId()); |
| | | if(eldersAuthDO==null){ |
| | | return R.fail("认证记录不存在"); |
| | | } |
| | | if(eldersAuthDO.getType()==null){ |
| | | return R.fail("认证方式未知"); |
| | | } |
| | | if(eldersAuthDO.getType().intValue()!=1){ |
| | | return R.fail("当前认证方式不能进行反馈"); |
| | | } |
| | | EldersAuthFeedbackDO eldersAuthFeedbackDO = new EldersAuthFeedbackDO(); |
| | | eldersAuthFeedbackDO.setCreateBy(eldersAuthFeedbackAddDTO.getUserId()); |
| | | eldersAuthFeedbackDO.setCreateAt(new Date()); |
| | | BeanUtils.copyProperties(eldersAuthFeedbackAddDTO, eldersAuthFeedbackDO); |
| | | if(eldersAuthFeedbackDAO.insert(eldersAuthFeedbackDO)>0){ |
| | | eldersAuthDO.setStatus("1"); |
| | | eldersAuthDO.setIdCard(null); |
| | | int updated = eldersAuthDAO.updateById(eldersAuthDO); |
| | | if(updated!=1){ |
| | | throw new ServiceException("更新认证记录状态失败"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |