| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.apache.commons.beanutils.PropertyUtils;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.user.UserSystemCouponCountMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord;
|
| | | import com.yeshi.fanli.entity.system.SystemCoupon;
|
| | | import com.yeshi.fanli.service.inter.config.SystemCouponService;
|
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.count.UserSystemCouponCountService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderCountService;
|
| | |
| | |
|
| | | @Resource
|
| | | private HongBaoV2CountService hongBaoV2CountService;
|
| | | |
| | | @Resource
|
| | | private SystemCouponService systemCouponService;
|
| | |
|
| | | /**
|
| | | * 奖励券统计
|
| | |
| | | orderMoney = new BigDecimal(0);
|
| | | }
|
| | | userSystemCouponVO.setOrderMoney(orderMoney);
|
| | | |
| | | }
|
| | | }
|
| | |
|
| | |
| | | public List<UserSystemCouponCountVO> listFreeCouponRecord(long start,int count, String key, Integer keyType,
|
| | | Integer state){
|
| | |
|
| | | List<UserSystemCouponCountVO> list = userSystemCouponCountMapper.listFreeCouponRecord(start, count, key,
|
| | | List<UserSystemCouponRecord> list = userSystemCouponCountMapper.listFreeCouponRecord(start, count, key,
|
| | | keyType, state);
|
| | |
|
| | | if (list == null ) {
|
| | | list = new ArrayList<UserSystemCouponCountVO>();
|
| | | if (list == null || list.size() == 0) {
|
| | | return null;
|
| | | }
|
| | |
|
| | | for (UserSystemCouponCountVO userSystemCouponVO: list) {
|
| | | List<UserSystemCouponCountVO> listvo = new ArrayList<UserSystemCouponCountVO>();
|
| | | |
| | | for (UserSystemCouponRecord couponRecord: list) {
|
| | | |
| | | UserSystemCouponCountVO vo = new UserSystemCouponCountVO();
|
| | | UserSystemCoupon userSystemCoupon = couponRecord.getUserSystemCoupon();
|
| | | try {
|
| | | PropertyUtils.copyProperties(vo, userSystemCoupon);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | | vo.setUserSystemCouponRecord(couponRecord);
|
| | | |
| | | // SystemCoupon systemCoupon = userSystemCoupon.getSystemCoupon();
|
| | | // SystemCoupon baseCoupon = systemCouponService.selectByPrimaryKey(systemCoupon.getId());
|
| | | // if (baseCoupon == null || baseCoupon.getId() == null) {
|
| | | // continue;
|
| | | // }
|
| | | // vo.setSystemCoupon(baseCoupon);
|
| | | |
| | | // 用户信息
|
| | | Long uid = userSystemCouponVO.getUid();
|
| | | Long uid = userSystemCoupon.getUid();
|
| | | UserInfo userInfo = userInfoService.selectByPKey(uid);
|
| | | if (userInfo == null) {
|
| | | userInfo = new UserInfo();
|
| | | userInfo.setId(uid);
|
| | | }
|
| | | userSystemCouponVO.setUserInfo(userInfo);
|
| | | vo.setUserInfo(userInfo);
|
| | |
|
| | | UserSystemCouponRecord couponRecord = userSystemCouponVO.getUserSystemCouponRecord();
|
| | | if (couponRecord != null) {
|
| | | String orderNo = couponRecord.getOrderNo();
|
| | | BigDecimal orderMoney = commonOrderCountService.getMoneyByOrderNo(orderNo);
|
| | | if (orderMoney == null) {
|
| | | orderMoney = new BigDecimal(0);
|
| | | }
|
| | | userSystemCouponVO.setOrderMoney(orderMoney);
|
| | | |
| | | String orderNo = couponRecord.getOrderNo();
|
| | | BigDecimal orderMoney = commonOrderCountService.getMoneyByOrderNo(orderNo);
|
| | | if (orderMoney == null) {
|
| | | orderMoney = new BigDecimal(0);
|
| | | }
|
| | | vo.setOrderMoney(orderMoney);
|
| | | |
| | | listvo.add(vo);
|
| | | }
|
| | | |
| | | return list;
|
| | | return listvo;
|
| | | }
|
| | |
|
| | |
|