CeDo
2021-06-15 1a987c8fd64413f04bdd0ea2bc8cb1b4262d4242
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/EldersAuthServiceImpl.java
@@ -152,12 +152,29 @@
     * @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();