| | |
| | | import com.ruoyi.other.mapper.TVipMapper; |
| | | import com.ruoyi.other.service.TVipService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.poi.util.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | for (TVip tVip : list) { |
| | | String coupon = tVip.getCoupon(); |
| | | JSONArray jsonArray = JSONObject.parseArray(coupon); |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | Integer id = jsonObject.getInteger("id"); |
| | | Integer number = jsonObject.getInteger("number"); |
| | | TCoupon tCoupon = tCouponMapper.selectById(id); |
| | | if (tCoupon!=null){ |
| | | stringBuilder.append(tCoupon.getName()).append("*").append(number).append(";"); |
| | | if (StringUtils.hasLength(coupon)){ |
| | | JSONArray jsonArray = JSONObject.parseArray(coupon); |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | Integer id = jsonObject.getInteger("id"); |
| | | Integer number = jsonObject.getInteger("number"); |
| | | TCoupon tCoupon = tCouponMapper.selectById(id); |
| | | if (tCoupon!=null){ |
| | | stringBuilder.append(tCoupon.getName()).append("*").append(number).append(";"); |
| | | } |
| | | } |
| | | tVip.setCouponName(stringBuilder.toString()); |
| | | } |
| | | tVip.setCouponName(stringBuilder.toString()); |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |