| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.VolunteerCreditsExchangeVO; |
| | | import com.panzhihua.common.model.vos.community.VolunteerTypeVO; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.VolunteerCreditsExchangeDao; |
| | |
| | | @Resource |
| | | private VolunteerIntegralMerchantService goodsService; |
| | | |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | @Override |
| | | public R getList(int pageNum, int pageSize, String goodsId, String orderNumber, |
| | |
| | | return R.fail("商品不存在"); |
| | | } |
| | | |
| | | LoginUserInfoVO loginUserInfoVOR=userService.getUserInfoByUserId(item.getUserId()).getData(); |
| | | |
| | | int integral=0; |
| | | if(!StringUtils.isEmpty(item.getNeedScore())) |
| | | if(!StringUtils.isEmpty(loginUserInfoVOR.getLoveIntegral())) |
| | | { |
| | | integral=Integer.valueOf(item.getNeedScore()); |
| | | integral=Integer.valueOf(loginUserInfoVOR.getLoveIntegral()); |
| | | } |
| | | |
| | | if(integral<Integer.valueOf(goods.getIntegral())) |
| | |
| | | { |
| | | return R.fail("兑换用户id不能为空"); |
| | | } |
| | | |
| | | int num1=integral-Integer.valueOf(goods.getIntegral()); |
| | | loginUserInfoVOR.setLoveIntegral(num1+""); |
| | | userService.putUser(loginUserInfoVOR); |
| | | |
| | | //设置订单号 |
| | | item.setOrderNumber(Snowflake.getId()+""); |
| | |
| | | return R.fail("删除订单id不能为空"); |
| | | } |
| | | |
| | | |
| | | int num= baseMapper.delete(id); |
| | | if(num>0) |
| | | { |