lidongdong
2024-05-29 811edcf5e457abb4d6646b61001664f6df750070
花城  修改随手拍管理模块6
1个文件已修改
173 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommunityActivityApi.java 173 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommunityActivityApi.java
@@ -1092,92 +1092,93 @@
            comActEasyPhotoVO.setHandlerId(userId);
        }
        R<SysTemplateConfigVO> sysTemplateConfigVO=userService.selectTemplate(this.getAreaCode(),4);
        R r = communityService.putEasypHotoStatus(comActEasyPhotoVO);
//        if (R.isOk(r)) {
//            R r1 = communityService.detailEasyPhoto(id, userId);
//            if (R.isOk(r1)) {
//                ComActEasyPhotoVO comActEasyPhotoVO1 =
//                    JSONObject.parseObject(JSONObject.toJSONString(r1.getData()), ComActEasyPhotoVO.class);
//                SysUserNoticeVO sysUserNoticeVO = new SysUserNoticeVO();
//                sysUserNoticeVO.setUserId(comActEasyPhotoVO1.getSponsorId());
//                sysUserNoticeVO.setType(2);
//                sysUserNoticeVO.setBusinessType(4);
//                sysUserNoticeVO.setBusinessTime(comActEasyPhotoVO1.getExamineAt());
//                sysUserNoticeVO.setBusinessId(id);
//                sysUserNoticeVO.setStatus(0);
//                // 查询用户openid
//                R userResult = userService.getUserOpenId(comActEasyPhotoVO1.getSponsorId());
//                if (type.intValue() == 2) {
//                    sysUserNoticeVO.setBusinessTitle(comActEasyPhotoVO1.getDetail());
//                    sysUserNoticeVO.setTitle("随手拍未通过审核");
//                    sysUserNoticeVO.setBusinessContent(String.format("驳回原因:%s", comActEasyPhotoVO.getRejectReason()));
//                    sysUserNoticeVO.setBusinessStatus(1);
//                    R r2 = userService.addNotice(sysUserNoticeVO);
//                    if (R.isOk(r2)) {
//                        log.info("新增随手拍未通过审核通知成功【{}】", JSONObject.toJSONString(sysUserNoticeVO));
//                    }
//
//                    if (R.isOk(userResult)) {
//                        String openid = userResult.getData().toString();
//                        WxXCXTempSend util = new WxXCXTempSend();
//                        try {
//                            String result = comActEasyPhotoVO1.getRejectReason();
//                            if (StringUtils.isNotEmpty(result)) {
//                                result = result.substring(0, 4);
//                                result += "…";
//                            }
//                            WxUtil.sendSubscribeSHZT(openid, util.getAccessToken(), "随手拍",
//                                DateUtils.format(comActEasyPhotoVO1.getExamineAt(), DateUtils.ymdhms_format), result,sysTemplateConfigVO.getData().getTemplateId());
//                        } catch (Exception e) {
//                            log.error("消息推送失败,失败原因:" + e.getMessage());
//                        }
//                    }
//                } else if (type.intValue() == 3) {
//                    sysUserNoticeVO.setTitle("随手拍有反馈");
//                    sysUserNoticeVO.setBusinessTitle(comActEasyPhotoVO.getHandleResult());
//                    sysUserNoticeVO.setBusinessContent("社区已经处理好了具体的事宜,将变成现在更好看的样子找到更好的自己……");
//                    sysUserNoticeVO.setBusinessStatus(2);
//                    R r2 = userService.addNotice(sysUserNoticeVO);
//                    if (R.isOk(r2)) {
//                        log.info("新增随手拍有反馈通知成功【{}】", JSONObject.toJSONString(sysUserNoticeVO));
//                    }
//                }
//
//                if (type.equals(1)) {// 审核通过给用户增加积分
////                    communityService.addIntegralTradeAdmin(
////                        new AddComActIntegralUserDTO(id, AddComActIntegralUserDTO.integralType.fbssp,
////                            this.getCommunityId(), comActEasyPhotoVO1.getSponsorId()));
//
//                    // 2023/11/20 新逻辑
//                    NewFightIntegral integral=new NewFightIntegral();
//                    integral.setRemark("微心愿上传通过审核");
//                    if(comActEasyPhotoVO.getCommunityId()<=0)
//                    {
//                        integral.setCommunityId(getCommunityId()+"");
//                    }
//                    else
//                    {
//                        integral.setCommunityId(comActEasyPhotoVO.getCommunityId()+"");
//                    }
//                    integral.setType("18");
//                    integral.setUserId(comActEasyPhotoVO.getSponsorId()+"");
//                    newStriveForFeign.upIntegral(integral);
//
//
//                    // 审核通过发送订阅消息给用户
//                    if (R.isOk(userResult)) {
//                        String openid = userResult.getData().toString();
//                        WxXCXTempSend util = new WxXCXTempSend();
//                        try {
//                            WxUtil.sendSubscribeSHZT(openid, util.getAccessToken(), "随手拍",
//                                DateUtils.format(comActEasyPhotoVO1.getExamineAt(), DateUtils.ymdhms_format), "审核通过",sysTemplateConfigVO.getData().getTemplateId());
//                        } catch (Exception e) {
//                            log.error("消息推送失败,失败原因:" + e.getMessage());
//                        }
//                    }
//                }
//            }
//        }
//        R r = communityService.putEasypHotoStatus(comActEasyPhotoVO);
        R r = R.ok();
        if (R.isOk(r)) {
            R r1 = communityService.detailEasyPhoto(id, userId);
            if (R.isOk(r1)) {
                ComActEasyPhotoVO comActEasyPhotoVO1 =
                    JSONObject.parseObject(JSONObject.toJSONString(r1.getData()), ComActEasyPhotoVO.class);
                SysUserNoticeVO sysUserNoticeVO = new SysUserNoticeVO();
                sysUserNoticeVO.setUserId(comActEasyPhotoVO1.getSponsorId());
                sysUserNoticeVO.setType(2);
                sysUserNoticeVO.setBusinessType(4);
                sysUserNoticeVO.setBusinessTime(comActEasyPhotoVO1.getExamineAt());
                sysUserNoticeVO.setBusinessId(id);
                sysUserNoticeVO.setStatus(0);
                // 查询用户openid
                R userResult = userService.getUserOpenId(comActEasyPhotoVO1.getSponsorId());
                if (type.intValue() == 2) {
                    sysUserNoticeVO.setBusinessTitle(comActEasyPhotoVO1.getDetail());
                    sysUserNoticeVO.setTitle("随手拍未通过审核");
                    sysUserNoticeVO.setBusinessContent(String.format("驳回原因:%s", comActEasyPhotoVO.getRejectReason()));
                    sysUserNoticeVO.setBusinessStatus(1);
                    R r2 = userService.addNotice(sysUserNoticeVO);
                    if (R.isOk(r2)) {
                        log.info("新增随手拍未通过审核通知成功【{}】", JSONObject.toJSONString(sysUserNoticeVO));
                    }
                    if (R.isOk(userResult)) {
                        String openid = userResult.getData().toString();
                        WxXCXTempSend util = new WxXCXTempSend();
                        try {
                            String result = comActEasyPhotoVO1.getRejectReason();
                            if (StringUtils.isNotEmpty(result)) {
                                result = result.substring(0, 4);
                                result += "…";
                            }
                            WxUtil.sendSubscribeSHZT(openid, util.getAccessToken(), "随手拍",
                                DateUtils.format(comActEasyPhotoVO1.getExamineAt(), DateUtils.ymdhms_format), result,sysTemplateConfigVO.getData().getTemplateId());
                        } catch (Exception e) {
                            log.error("消息推送失败,失败原因:" + e.getMessage());
                        }
                    }
                } else if (type.intValue() == 3) {
                    sysUserNoticeVO.setTitle("随手拍有反馈");
                    sysUserNoticeVO.setBusinessTitle(comActEasyPhotoVO.getHandleResult());
                    sysUserNoticeVO.setBusinessContent("社区已经处理好了具体的事宜,将变成现在更好看的样子找到更好的自己……");
                    sysUserNoticeVO.setBusinessStatus(2);
                    R r2 = userService.addNotice(sysUserNoticeVO);
                    if (R.isOk(r2)) {
                        log.info("新增随手拍有反馈通知成功【{}】", JSONObject.toJSONString(sysUserNoticeVO));
                    }
                }
                if (type.equals(1)) {// 审核通过给用户增加积分
//                    communityService.addIntegralTradeAdmin(
//                        new AddComActIntegralUserDTO(id, AddComActIntegralUserDTO.integralType.fbssp,
//                            this.getCommunityId(), comActEasyPhotoVO1.getSponsorId()));
                    // 2023/11/20 新逻辑
                    NewFightIntegral integral=new NewFightIntegral();
                    integral.setRemark("微心愿上传通过审核");
                    if(comActEasyPhotoVO.getCommunityId()<=0)
                    {
                        integral.setCommunityId(getCommunityId()+"");
                    }
                    else
                    {
                        integral.setCommunityId(comActEasyPhotoVO.getCommunityId()+"");
                    }
                    integral.setType("18");
                    integral.setUserId(comActEasyPhotoVO.getSponsorId()+"");
                    newStriveForFeign.upIntegral(integral);
                    // 审核通过发送订阅消息给用户
                    if (R.isOk(userResult)) {
                        String openid = userResult.getData().toString();
                        WxXCXTempSend util = new WxXCXTempSend();
                        try {
                            WxUtil.sendSubscribeSHZT(openid, util.getAccessToken(), "随手拍",
                                DateUtils.format(comActEasyPhotoVO1.getExamineAt(), DateUtils.ymdhms_format), "审核通过",sysTemplateConfigVO.getData().getTemplateId());
                        } catch (Exception e) {
                            log.error("消息推送失败,失败原因:" + e.getMessage());
                        }
                    }
                }
            }
        }
        return r;
    }