| | |
| | | import com.panzhihua.service_dangjian.entity.UserTrade; |
| | | import com.panzhihua.service_dangjian.service.NeedProblemClaimService; |
| | | import com.panzhihua.service_dangjian.service.NeedProblemInventoryService; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | NeedProblemInventoryDTO dto=inventoryService.getDetails(taskId,userId); |
| | | UserTrade userTrade=new UserTrade(); |
| | | //增加积分 |
| | | UserIntegral integral = baseMapper.getUserIntegral(userId); |
| | | UserIntegral integral = baseMapper.getUserIntegral(userId,dto.getCommunityId()); |
| | | if (integral == null) { |
| | | UserIntegral addIn = new UserIntegral(); |
| | | addIn.setId(Snowflake.getId()+""); |
| | |
| | | } |
| | | else |
| | | { |
| | | int award=Integer.valueOf(dto.getAward()); |
| | | int integralAvailableSum=Integer.valueOf(integral.getIntegralAvailableSum())+award; |
| | | int integralSum=Integer.valueOf(integral.getIntegralSum())+award; |
| | | int award=0; |
| | | int integralAvailableSum=0; |
| | | int integralSum=0; |
| | | |
| | | if(!StringUtils.isEmpty(dto.getAward())) |
| | | { |
| | | award=Integer.valueOf(dto.getAward()); |
| | | } |
| | | |
| | | if(!StringUtils.isEmpty(integral.getIntegralAvailableSum())) |
| | | { |
| | | integralAvailableSum=Integer.valueOf(integral.getIntegralAvailableSum())+award; |
| | | } |
| | | |
| | | if(!StringUtils.isEmpty(integral.getIntegralSum())) |
| | | { |
| | | integralSum=Integer.valueOf(integral.getIntegralSum())+award; |
| | | } |
| | | |
| | | userTrade.setIntegralId(integral.getId()); |
| | | integral.setIntegralAvailableSum(integralAvailableSum+""); |
| | | integral.setIntegralSum(integralSum+""); |