huanghongfa
2021-05-20 ffea6697e4b5843bdf91e06ded75eaeb93d3ede0
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java
@@ -1,6 +1,7 @@
package com.panzhihua.service_community.api;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -13,8 +14,11 @@
import com.panzhihua.common.model.vos.community.questnaire.QuestnaireVO;
import com.panzhihua.common.model.vos.community.questnaire.UsersAnswerQuestnaireVO;
import com.panzhihua.common.model.vos.user.ComMngFamilyInfoVO;
import com.panzhihua.common.model.vos.user.SysUserNoticeVO;
import com.panzhihua.common.model.vos.user.UserPhoneVO;
import com.panzhihua.common.service.user.UserService;
import com.panzhihua.common.utlis.ClazzUtils;
import com.panzhihua.common.utlis.IdCard;
import com.panzhihua.common.utlis.IdCardUtil;
import com.panzhihua.service_community.dao.ComMngPopulationDAO;
import com.panzhihua.service_community.model.dos.*;
@@ -70,7 +74,8 @@
    private ComActMessageService comActMessageService;
    @Resource
    private ComActQuestnaireService comActQuestnaireService;
    @Resource
    private UserService userService;
    @Resource
    private EldersAuthService eldersAuthService;
    @Resource
@@ -1559,7 +1564,8 @@
        if(theFamily==null){
            return R.fail("家庭成员信息错误");
        }
        if(theFamily.getAge()>=80){
        Integer age = IdCard.IdNOToAge(theFamily.getIdCard());
        if(age>=80){
            Long loginUserId = eldersAuthAddByFamilyDTO.getUserId();
            EldersAuthDO eldersAuthDO = new EldersAuthDO();
            eldersAuthDO.setSumitUserId(eldersAuthAddByFamilyDTO.getSumitUserId());
@@ -1570,13 +1576,15 @@
            eldersAuthDO.setVideoUrl(eldersAuthAddByFamilyDTO.getVideoUrl());
            eldersAuthDO.setFamilyUserId(eldersAuthAddByFamilyDTO.getFamilyUserId());
            //根据身份证查询出籍贯 出生日期
            String domicile = "";
            Date birthDay = new Date();
            //String domicile = IdCard.domicile(eldersAuthDO.getIdCard());
            String domicile = eldersAuthService.queryDomicile(eldersAuthDO.getIdCard());
            Date birthDay = IdCard.birthDay(eldersAuthDO.getIdCard());
            eldersAuthDO.setDomicile(domicile);
            eldersAuthDO.setBirthDay(birthDay);
            int add = eldersAuthService.getBaseMapper().insert(eldersAuthDO);
            if(add==1){
                return R.ok();
                return R.ok(eldersAuthDO.getId());
            }
        }else{
            return R.fail("家庭成员年龄还未达到80");
@@ -1592,6 +1600,28 @@
    @PostMapping("/eldersauth/addFeedback")
    R add(@RequestBody EldersAuthFeedbackAddDTO eldersAuthFeedbackAddDTO){
        ClazzUtils.setIfStringIsEmpty(eldersAuthFeedbackAddDTO);
        EldersAuthDO eldersAuthDO = eldersAuthService.getBaseMapper().selectById(eldersAuthFeedbackAddDTO.getAuthId());
        if(eldersAuthDO==null){
            return R.fail("认证记录不存在");
        }
        R addR = eldersAuthService.addFeedback(eldersAuthFeedbackAddDTO);
        if(R.isOk(addR)){
            SysUserNoticeVO sysUserNoticeVO=new SysUserNoticeVO();
            sysUserNoticeVO.setUserId(eldersAuthDO.getSumitUserId());
            sysUserNoticeVO.setType(1);
            sysUserNoticeVO.setTitle("高龄认证社区社区反馈");
            sysUserNoticeVO.setBusinessType(13);
            sysUserNoticeVO.setBusinessTitle(" ");
            sysUserNoticeVO.setBusinessContent("你提交【" +eldersAuthDO.getAuthUserName() + "】的高龄认证,社区进行了反馈");
            sysUserNoticeVO.setBusinessId(eldersAuthDO.getId());
            sysUserNoticeVO.setStatus(0);
            sysUserNoticeVO.setBusinessStatus(2);
            R r1 = userService.addNotice(sysUserNoticeVO);
            if (R.isOk(r1)) {
                log.info("新增用户报名党建活动通知成功【{}】", JSONObject.toJSONString(sysUserNoticeVO));
            }
        }
        return eldersAuthService.addFeedback(eldersAuthFeedbackAddDTO);
    }
@@ -1603,6 +1633,6 @@
     */
    @PostMapping("/eldersauth/eldersAuthQuery")
    R eldersAuthQuery(@RequestBody PageEldersAuthDTO pageEldersAuthDTO){
        return eldersAuthService.query(pageEldersAuthDTO);
        return eldersAuthService.queryExportData(pageEldersAuthDTO);
    }
}