| | |
| | | import com.panzhihua.common.constants.HttpStatus; |
| | | import com.panzhihua.common.model.dtos.PageBaseDTO; |
| | | import com.panzhihua.common.model.dtos.community.ActivityInviteDTO; |
| | | import com.panzhihua.common.model.vos.jinhui.JinhuiCoinGeneralTableVO; |
| | | import com.panzhihua.common.model.vos.jinhui.JinhuiGoldCoinRecordVO; |
| | | import com.panzhihua.common.service.jinhui.JinhuiCommunityService; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.ComActNeighborCircleDAO; |
| | | import com.panzhihua.service_community.dao.ComActNeighborCircleTopicWestMapper; |
| | | import com.panzhihua.service_community.dao.ComPbMemberDAO; |
| | | import com.panzhihua.service_community.entity.ComActActivityInvite; |
| | | import com.panzhihua.service_community.entity.JinhuiCoinGeneralTable; |
| | | import com.panzhihua.service_community.model.dos.ComActNeighborCircleTopicWestDO; |
| | | import com.panzhihua.service_community.service.ComActActivityInviteService; |
| | | import com.panzhihua.service_community.util.WxMaConfiguration; |
| | |
| | | private ComActNeighborCircleDAO comActNeighborCircleDAO; |
| | | @Resource |
| | | private WxMaConfiguration wxMaConfiguration; |
| | | @Resource |
| | | private JinhuiCommunityService jinhuiCommunityService; |
| | | |
| | | /** |
| | | * 新增社区活动 |
| | |
| | | if(!StringUtils.isEmpty(actActivityDO.getJinhuiCoinPunishment()) && !StringUtils.equals(actActivityDO.getJinhuiCoinPunishment(),"0")) |
| | | { |
| | | //查询个人金汇币总额 |
| | | // R<JinhuiCoinGeneralTable> jinhuiCoinGeneralTable=jinhuiCommunityService.coinTableGetDetails(userId+""); |
| | | // if(jinhuiCoinGeneralTable!=null) |
| | | // { |
| | | // if (!StringUtils.isEmpty(jinhuiCoinGeneralTable.getData().getGoldCoin())) |
| | | // { |
| | | // JinhuiCoinGeneralTableVO jinhuiVO=new JinhuiCoinGeneralTableVO(); |
| | | // jinhuiVO.setId(jinhuiCoinGeneralTable.getData().getId()); |
| | | // |
| | | // int punishmentGold=Integer.valueOf(actActivityDO.getJinhuiCoinPunishment()); |
| | | // int allGold=Integer.valueOf(jinhuiCoinGeneralTable.getData().getGoldCoin()); |
| | | // if(punishmentGold>=allGold) |
| | | // { |
| | | // jinhuiVO.setGoldCoin("0"); |
| | | // } |
| | | // else |
| | | // { |
| | | // allGold=allGold-punishmentGold; |
| | | // jinhuiVO.setGoldCoin(allGold+""); |
| | | // } |
| | | // jinhuiCommunityService.coinTableEditData(jinhuiVO); |
| | | // } |
| | | // } |
| | | R<JinhuiCoinGeneralTable> jinhuiCoinGeneralTable=jinhuiCommunityService.coinTableGetDetails(userId+""); |
| | | if(jinhuiCoinGeneralTable!=null) |
| | | { |
| | | if (!StringUtils.isEmpty(jinhuiCoinGeneralTable.getData().getGoldCoin())) |
| | | { |
| | | JinhuiCoinGeneralTableVO jinhuiVO=new JinhuiCoinGeneralTableVO(); |
| | | jinhuiVO.setId(jinhuiCoinGeneralTable.getData().getId()); |
| | | |
| | | // JinhuiGoldCoinRecordVO jVo=new JinhuiGoldCoinRecordVO(); |
| | | // jVo.setCommunityId(actActivityDO.getCommunityId()+""); |
| | | // jVo.setTitle("取消志愿者活动"); |
| | | // jVo.setUserId(userId+""); |
| | | // jVo.setRemark("取消志愿者活动"); |
| | | // jVo.setType("2"); |
| | | // jVo.setGoldCoin(actActivityDO.getJinhuiCoinPunishment()); |
| | | // jinhuiCommunityService.recordAddData(jVo); |
| | | int punishmentGold=Integer.valueOf(actActivityDO.getJinhuiCoinPunishment()); |
| | | int allGold=Integer.valueOf(jinhuiCoinGeneralTable.getData().getGoldCoin()); |
| | | if(punishmentGold>=allGold) |
| | | { |
| | | jinhuiVO.setGoldCoin("0"); |
| | | } |
| | | else |
| | | { |
| | | allGold=allGold-punishmentGold; |
| | | jinhuiVO.setGoldCoin(allGold+""); |
| | | } |
| | | jinhuiCommunityService.coinTableEditData(jinhuiVO); |
| | | } |
| | | } |
| | | |
| | | JinhuiGoldCoinRecordVO jVo=new JinhuiGoldCoinRecordVO(); |
| | | jVo.setCommunityId(actActivityDO.getCommunityId()+""); |
| | | jVo.setTitle("取消志愿者活动"); |
| | | jVo.setUserId(userId+""); |
| | | jVo.setRemark("取消志愿者活动"); |
| | | jVo.setType("2"); |
| | | jVo.setGoldCoin(actActivityDO.getJinhuiCoinPunishment()); |
| | | jinhuiCommunityService.recordAddData(jVo); |
| | | |
| | | |
| | | } |
| | |
| | | // comActIntegralUserTradeService.addIntegralTradeAdmin(addComActIntegralUserDTO); |
| | | |
| | | //查询个人金汇币总额 |
| | | // R<JinhuiCoinGeneralTable> jinhuiCoinGeneralTable=jinhuiCommunityService.coinTableGetDetails(userId+""); |
| | | // if(jinhuiCoinGeneralTable!=null) |
| | | // { |
| | | // if (!StringUtils.isEmpty(jinhuiCoinGeneralTable.getData().getGoldCoin())) |
| | | // { |
| | | // JinhuiCoinGeneralTableVO jinhuiVO=new JinhuiCoinGeneralTableVO(); |
| | | // jinhuiVO.setId(jinhuiCoinGeneralTable.getData().getId()); |
| | | // |
| | | // int allGold=Integer.valueOf(jinhuiCoinGeneralTable.getData().getGoldCoin()); |
| | | // allGold=allGold+rewardIntegral; |
| | | // jinhuiVO.setGoldCoin(allGold+""); |
| | | // jinhuiCommunityService.coinTableEditData(jinhuiVO); |
| | | // } |
| | | // } |
| | | // |
| | | // JinhuiGoldCoinRecordVO jVo=new JinhuiGoldCoinRecordVO(); |
| | | // jVo.setCommunityId(comActActivityDO.getCommunityId()+""); |
| | | // jVo.setTitle("志愿者活动奖励"); |
| | | // jVo.setUserId(userId+""); |
| | | // jVo.setRemark("志愿者活动奖励"); |
| | | // jVo.setType("1"); |
| | | // jVo.setGoldCoin(rewardIntegral+""); |
| | | // jinhuiCommunityService.recordAddData(jVo); |
| | | R<JinhuiCoinGeneralTable> jinhuiCoinGeneralTable=jinhuiCommunityService.coinTableGetDetails(userId+""); |
| | | if(jinhuiCoinGeneralTable!=null) |
| | | { |
| | | if (!StringUtils.isEmpty(jinhuiCoinGeneralTable.getData().getGoldCoin())) |
| | | { |
| | | JinhuiCoinGeneralTableVO jinhuiVO=new JinhuiCoinGeneralTableVO(); |
| | | jinhuiVO.setId(jinhuiCoinGeneralTable.getData().getId()); |
| | | |
| | | int allGold=Integer.valueOf(jinhuiCoinGeneralTable.getData().getGoldCoin()); |
| | | allGold=allGold+rewardIntegral; |
| | | jinhuiVO.setGoldCoin(allGold+""); |
| | | jinhuiCommunityService.coinTableEditData(jinhuiVO); |
| | | } |
| | | } |
| | | |
| | | JinhuiGoldCoinRecordVO jVo=new JinhuiGoldCoinRecordVO(); |
| | | jVo.setCommunityId(comActActivityDO.getCommunityId()+""); |
| | | jVo.setTitle("志愿者活动奖励"); |
| | | jVo.setUserId(userId+""); |
| | | jVo.setRemark("志愿者活动奖励"); |
| | | jVo.setType("1"); |
| | | jVo.setGoldCoin(rewardIntegral+""); |
| | | jinhuiCommunityService.recordAddData(jVo); |
| | | return R.ok(); |
| | | } else { |
| | | return R.ok(); |