| | |
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | |
| | | import com.yeshi.fanli.service.inter.order.HongBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderHongBaoMapService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserMoneyDetailService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponRecordService;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserMoneyMsgNotificationService userMoneyMsgNotificationService;
|
| | | |
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | |
|
| | | // 券失效图片
|
| | | public final static String PIC_INVALID = "http://192.168.1.200/icon/mian_invalid.png";
|
| | |
| | | }
|
| | |
|
| | | // 数据组织
|
| | | listDataFactory(listVO);
|
| | | listDataFactory(listVO, uid);
|
| | |
|
| | | return listVO;
|
| | | }
|
| | |
| | | *
|
| | | * @param listVO
|
| | | */
|
| | | public void listDataFactory(List<UserSystemCouponVO> listVO) throws Exception{
|
| | | public void listDataFactory(List<UserSystemCouponVO> listVO, Long uid) throws Exception{
|
| | |
|
| | | for (UserSystemCouponVO userCouponVO : listVO) {
|
| | |
|
| | |
| | | userCouponVO.setCouponEffect(systemCoupon.getEffect());
|
| | | userCouponVO.setCouponRule(systemCoupon.getRule());
|
| | |
|
| | | // 使用中状态 改变为已使用
|
| | | // 使用状态
|
| | | Integer state = userCouponVO.getState();
|
| | | if (UserSystemCoupon.STATE_IN_USE == state) {
|
| | | state = UserSystemCoupon.STATE_END_USE;
|
| | | userCouponVO.setState(state);
|
| | | }
|
| | |
|
| | | // 按钮跳转
|
| | |
|
| | | Map<String, Object> jumpBtn = null;
|
| | | |
| | | Integer stateActivated = userCouponVO.getStateActivated();
|
| | | |
| | | if (stateActivated == null || stateActivated == 0) {
|
| | | // 显示规则
|
| | | userCouponVO.setCouponRule(systemCoupon.getRemark());
|
| | | systemCoupon.setEffect("待激活");
|
| | | userCouponVO.setCouponEffect("待激活");
|
| | |
|
| | | // 状态未激活 -且未被使用
|
| | | if (UserSystemCoupon.STATE_CAN_USE == state) {
|
| | |
| | |
|
| | | jumpBtn = new HashMap<String, Object>();
|
| | | Map<String, Object> jumpLink = new HashMap<String, Object>();
|
| | | jumpLink.put("url", configService.get("invite_activation_url"));
|
| | | |
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra != null && userInfoExtra.getInviteCode() != null
|
| | | && userInfoExtra.getInviteCode().trim().length() > 0) {
|
| | | |
| | | jumpLink.put("url", configService.get("invite_activation_success_url" +"?alert=ture"));
|
| | | } else {
|
| | |
|
| | | jumpLink.put("url", configService.get("invite_activation_url"));
|
| | | }
|
| | | |
| | | jumpBtn.put("params", jumpLink);
|
| | | jumpBtn.put("jumpDetail", jumpDetailV2Service.getByTypeCache("invite"));
|
| | |
|
| | |
| | | jumpBtn.put("jumpDetail", jumpDetailV2Service.getByTypeCache("web"));
|
| | |
|
| | | } else if (CouponTypeEnum.rebatePercentCoupon == type) {
|
| | | // 返利奖励券
|
| | | // 返利奖励券- 跳转至订单到账界面
|
| | | jumpLink.put("state", 2);
|
| | |
|
| | | jumpBtn = new HashMap<String, Object>();
|
| | | jumpBtn.put("params", jumpLink);
|
| | | |
| | | // 跳转订单列表
|
| | | jumpBtn.put("jumpDetail", jumpDetailV2Service.getByTypeCache("orderList"));
|
| | | |
| | | }
|
| | | } else if (UserSystemCoupon.STATE_END_USE == state || UserSystemCoupon.STATE_OVERDUE == state) {
|
| | | userCouponVO.setCouponPicture(PIC_INVALID);
|
| | | |
| | | } else if (UserSystemCoupon.STATE_IN_USE == state) {
|
| | | // 使用中
|
| | | userCouponVO.setInUseExplain(configService.get("free_coupon_using-help"));
|
| | | }
|
| | |
|
| | | }
|
| | | |
| | | // 券失效图片替换
|
| | | if (UserSystemCoupon.STATE_END_USE == state || UserSystemCoupon.STATE_OVERDUE == state) {
|
| | | userCouponVO.setCouponPicture(PIC_INVALID);
|
| | | }
|
| | | |
| | | userCouponVO.setJumpBtn(jumpBtn);
|
| | |
|
| | | String couponTerm = "有效期:";
|
| | |
| | | return userRecordVO;
|
| | | }
|
| | |
|
| | | |
| | | |
| | | }
|