huanghongfa
2022-04-13 c7cb86db957dc7fbf6ca30270a71a43f5b31eccf
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoServiceImpl.java
@@ -7,7 +7,12 @@
import javax.annotation.Resource;
import com.panzhihua.common.model.dtos.common.PageComActEasyPhotoEvaluateDto;
import com.panzhihua.common.model.vos.community.easyPhoto.BannerVO;
import com.panzhihua.service_community.entity.ComActEasyPhotoEvaluate;
import com.panzhihua.service_community.entity.ComActEasyPhotoHandler;
import com.panzhihua.service_community.entity.SysTemplateConfig;
import com.panzhihua.service_community.service.ComActEasyPhotoHandlerService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
@@ -70,7 +75,12 @@
    private ComActReserveMapper comActReserveMapper;
    @Resource
    private ComActActivityDAO comActActivityDAO;
    @Resource
    private SysTemplateConfigDao sysTemplateConfigDao;
    @Resource
    private ComActEasyPhotoHandlerService easyPhotoHandlerService;
    @Resource
    private ComActEasyPhotoEvaluateMapper comActEasyPhotoEvaluateMapper;
    /**
     * 分页查询随手拍
     *
@@ -107,7 +117,7 @@
                }
                if (comActEasyPhotoVO1.getActivityId() != null
                    && comActEasyPhotoVO1.getStatus().equals(ComActEasyPhotoDO.status.ywc)) {
                    && comActEasyPhotoVO1.getStatus().equals(ComActEasyPhotoDO.status.dpj)) {
                    // 查询随手拍活动
                    ComActEasyPhotoActivityDO photoActivityDO =
                        comActEasyPhotoActivityMapper.selectById(comActEasyPhotoVO1.getActivityId());
@@ -186,6 +196,10 @@
                comActEasyPhotoVO.setEasyPhotoActivityVO(easyPhotoActivityVO);
            }
        }
        PageComActEasyPhotoEvaluateDto evaluateDto = new PageComActEasyPhotoEvaluateDto();
        evaluateDto.setServiceId(id);
        evaluateDto.setServiceType(ComActEasyPhotoEvaluate.ServiceType.SSP);
        comActEasyPhotoVO.setEvaluateList(comActEasyPhotoEvaluateMapper.queryAllByList(evaluateDto));
        return R.ok(comActEasyPhotoVO);
    }
@@ -310,6 +324,14 @@
                // 审核通过判断随手拍是否有活动并计算用户收益
                comActUserWalletService.examineAddMoney(comActEasyPhotoVO.getActivityType(), comActEasyPhotoVO.getId(),
                    comActEasyPhotoVO.getUserId(), BigDecimal.ZERO);
                //添加分配人员
                if(comActEasyPhotoVO.getHandleList() != null && comActEasyPhotoVO.getHandleList().size() > 0){
                    comActEasyPhotoVO.getHandleList().forEach(handle -> {
                        easyPhotoHandlerService.addHandleRecord(cmActEasyPhotoDO.getCommunityId(),comActEasyPhotoVO.getUserId()
                                ,cmActEasyPhotoDO.getId(),handle.getType(), ComActEasyPhotoHandler.ServiceType.SSP,comActEasyPhotoVO.getSponsorId());
                    });
                }
                break;
            case 2:
                // if(!cmActEasyPhotoDO.getStatus().equals(ComActEasyPhotoDO.status.dsh)){
@@ -334,7 +356,7 @@
                comActEasyPhotoFeedbackMapper.insert(photoFeedbackDO);
                break;
            case 4:
                if (cmActEasyPhotoDO.getStatus().equals(ComActEasyPhotoDO.status.ywc)) {
                if (cmActEasyPhotoDO.getStatus().equals(ComActEasyPhotoDO.status.ypj)) {
                    return R.fail("该随手拍已完成,不可重复操作");
                }
                if (StringUtils.isNotEmpty(comActEasyPhotoVO.getHandleResult())
@@ -356,7 +378,7 @@
                // comActUserWalletService.examineAddMoney(comActEasyPhotoVO.getActivityType(),comActEasyPhotoVO.getId(),comActEasyPhotoVO.getUserId(),BigDecimal.ZERO);
                // }
                cmActEasyPhotoDO.setFeedbackAt(nowDate);
                cmActEasyPhotoDO.setStatus(ComActEasyPhotoDO.status.ywc);
                cmActEasyPhotoDO.setStatus(ComActEasyPhotoDO.status.dpj);
                cmActEasyPhotoDO.setCompleteId(comActEasyPhotoVO.getUserId());
                if(comActEasyPhotoVO.getUrbanStatus()!=null&&comActEasyPhotoVO.getUrbanStatus()==2){
                    cmActEasyPhotoDO.setUrbanStatus(2);
@@ -596,10 +618,11 @@
                Map<String, String> map = comActActSignDAO.getUserOpenId(easyPhotoDO.getSponsorId());
                if (map != null) {
                    String openid = map.get("openid");
                    SysTemplateConfig sysTemplateConfig=sysTemplateConfigDao.selectOne(new QueryWrapper<SysTemplateConfig>().lambda().eq(SysTemplateConfig::getAreaCode, grantRewardDTO.getAreaCode()).eq(SysTemplateConfig::getType,7));
                    WxXCXTempSend util = new WxXCXTempSend();
                    try {
                        WxUtil.sendSubscribeJLDZ(openid, util.getAppAccessToken(), "随手拍有奖活动",
                            grantRewardDTO.getAmount(), activityType);
                            grantRewardDTO.getAmount(), activityType,sysTemplateConfig.getTemplateId());
                    } catch (Exception e) {
                        log.error("消息推送失败,失败原因:" + e.getMessage());
                    }