| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.applets.weixin.CheckService; |
| | | import com.panzhihua.applets.model.dtos.ComPbMemberCertificationDTO; |
| | | import com.panzhihua.common.constants.UserConstants; |
| | | import com.panzhihua.common.model.dtos.shop.ExcelShopOrderDTO; |
| | | import com.panzhihua.common.constants.SecurityConstants; |
| | | import com.panzhihua.common.constants.UserConstants; |
| | | import com.panzhihua.common.model.dtos.user.SysUserEditTipsDTO; |
| | | import com.panzhihua.common.model.dtos.user.SysUserFeedbackDTO; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Comparator; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.concurrent.atomic.AtomicBoolean; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | private PartyBuildingService partyBuildingService; |
| | | @Resource |
| | | private CheckService checkService; |
| | | @Resource |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | |
| | | @ApiOperation(value = "当前登录用户信息", response = LoginUserInfoVO.class) |
| | | @GetMapping("info") |
| | |
| | | if (R.isOk(r1)) { |
| | | log.info("新增实名认证未通过通知成功【{}】", JSONObject.toJSONString(sysUserNoticeVO)); |
| | | } |
| | | //清空缓存 |
| | | String userRoleKey = UserConstants.LOGIN_USER_INFO + this.getLoginUserInfo().getUserId(); |
| | | String userAppletRoleKey = SecurityConstants.ROLE_APPLETS_USER + this.getLoginUserInfo().getUserId(); |
| | | stringRedisTemplate.delete(userRoleKey); |
| | | stringRedisTemplate.delete(userAppletRoleKey); |
| | | } else { |
| | | //未通过发通知 |
| | | /** |
| | |
| | | if (null == id || 0 == id) { |
| | | return R.fail("心愿主键不能为空"); |
| | | } |
| | | String evaluate = comActMicroWishVO.getEvaluate(); |
| | | if (ObjectUtils.isEmpty(evaluate)) { |
| | | return R.fail("用户评价不能为空"); |
| | | } |
| | | Integer score = comActMicroWishVO.getScore(); |
| | | if (null == score || 0 == score) { |
| | | return R.fail("评分不能为空"); |
| | |
| | | @ApiOperation(value = "党员认证") |
| | | @PostMapping("partybuildingembercertification") |
| | | public R partybuildingembercertification(@RequestBody @Validated(AddGroup.class) ComPbMemberCertificationDTO comPbMemberCertificationDTO) { |
| | | //totest 党员认证 |
| | | //党员认证 |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long userId = loginUserInfo.getUserId(); |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | |
| | | R certUser = partyBuildingService.userCertification(userId); |
| | | |
| | | Object certUserInfo = certUser.getData(); |
| | | boolean userCertified = false; |
| | | if (certUserInfo != null) { |
| | | PartyBuildingMemberVO certUserVo = (PartyBuildingMemberVO) certUserInfo; |
| | | //已认证党员身份,直接返回 |
| | | userCertified = certUserVo.getAuditResult() == 1; |
| | | AtomicBoolean userCertified = new AtomicBoolean(false); |
| | | if (R.isOk(certUser) && certUserInfo != null) { |
| | | try { |
| | | List<PartyBuildingMemberVO> partyBuildingMemberVOList = JSONArray.parseArray(JSONArray.toJSONString(certUser.getData()), PartyBuildingMemberVO.class); |
| | | //已认证党员身份,直接返回 |
| | | if(partyBuildingMemberVOList!=null && partyBuildingMemberVOList.size()>0) { |
| | | partyBuildingMemberVOList.forEach(vo -> { |
| | | userCertified.set(vo.getAuditResult() == 1); |
| | | }); |
| | | } |
| | | }catch (Exception e){} |
| | | } |
| | | //匹配手机,验证是否进行自动确认 |
| | | if (userCertified) { |
| | | return R.fail("用户已完成党员认证"); |
| | | if (userCertified.get()) { |
| | | return R.fail("您已审核通过,无需重复提交"); |
| | | } |
| | | |
| | | PartyBuildingMemberVO partyBuildingMemberVO = new PartyBuildingMemberVO(); |
| | | BeanUtils.copyProperties(comPbMemberCertificationDTO, partyBuildingMemberVO); |
| | | partyBuildingMemberVO.setAuditResult(0); |
| | | partyBuildingMemberVO.setCommunityId(communityId); |
| | | |
| | | //用户实名认证信息判断 |
| | | String idCard = loginUserInfo.getIdCard(); |
| | |
| | | @ApiOperation(value = "党员认证查询") |
| | | @GetMapping("partybuildingembercertification") |
| | | public R partybuildingembercertification() { |
| | | //totest 党员认证查询 |
| | | //党员认证查询 |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long userId = loginUserInfo.getUserId(); |
| | | return partyBuildingService.userCertification(userId); |
| | | R r = partyBuildingService.userCertification(userId); |
| | | |
| | | if(R.isOk(r)) { |
| | | List<PartyBuildingMemberVO> partyBuildingMemberVOList = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), PartyBuildingMemberVO.class); |
| | | if(partyBuildingMemberVOList!=null && partyBuildingMemberVOList.size()>0){ |
| | | Optional<PartyBuildingMemberVO> ot = partyBuildingMemberVOList.stream().filter(partyBuildingMemberVO -> partyBuildingMemberVO.getAuditResult()==1).findFirst(); |
| | | if(ot.isPresent()){ |
| | | return R.ok(ot.get()); |
| | | }else{ |
| | | return R.ok(partyBuildingMemberVOList.get(0)); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |