| | |
| | | } |
| | | } |
| | | |
| | | if (request.getRank() == null && goods.size() > 0) { |
| | | goods = goods.stream() |
| | | .sorted(Comparator.comparing(Goods::getGoodId, Comparator.reverseOrder())) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | |
| | | //当前第几页 |
| | | int pageNo = request.getPageNum(); |
| | | //一页五条 |
| | |
| | | List<UserIntegralChanges> userIntegralChanges = this.baseMapper.selectList(new QueryWrapper<UserIntegralChanges>() |
| | | .eq("appUserId", userIdFormRedis).le("type", 5) |
| | | .between("insertTime", monthStart, monthEnd) |
| | | .orderByDesc("insertTime")); |
| | | .orderByDesc("insertTime", "id")); |
| | | if (userIntegralChanges.size() > 0) { |
| | | for (UserIntegralChanges userIntegralChange : userIntegralChanges) { |
| | | IntegralsData detail = new IntegralsData(); |
| | |
| | | .eq("state", 1) |
| | | .eq("status", 1) |
| | | .le("startTime", currentDate) |
| | | .ge("endTime", currentDate)); |
| | | .ge("endTime", currentDate) |
| | | .orderByDesc("insertTime", "id")); |
| | | if (couponList.size() > 0) { |
| | | Iterator<Coupon> iterator = couponList.iterator(); |
| | | while (iterator.hasNext()) { |
| | |
| | | .le("startTime", new Date()) |
| | | .ge("endTime", new Date()) |
| | | .eq("status", 1) |
| | | .orderByDesc("insertTime", "id") |
| | | ); |
| | | if (request.getShopId()!=null){ |
| | | List<Integer> storeId = new ArrayList<>(); |
| | |
| | | List<PointsMerchandise> pointsMerchandiseList = pmdsService.lambdaQuery() |
| | | .eq(PointsMerchandise::getState, 1) |
| | | .eq(PointsMerchandise::getShelves,1) |
| | | .in(PointsMerchandise::getId, pointsMerchandiseIds).list(); |
| | | .in(PointsMerchandise::getId, pointsMerchandiseIds) |
| | | .orderByDesc(PointsMerchandise::getInsertTime, PointsMerchandise::getId) |
| | | .list(); |
| | | |
| | | list = pointsMerchandiseList; |
| | | } |
| | |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyy-MM-dd"); |
| | | List<UserPointsMerchandise> pointsMerchandises = upmseService.list(new QueryWrapper<UserPointsMerchandise>() |
| | | .eq("userId", appUserId).eq("payStatus", 2)); |
| | | .eq("userId", appUserId).eq("payStatus", 2) |
| | | .orderByDesc("insertTime", "id")); |
| | | List<PointsMerchandiseStore> pointsMerchandiseStoreList = pointsMerchandiseStoreService.list(); |
| | | Map<Integer, List<PointsMerchandiseStore>> pointsMerchandiseStoreMap = pointsMerchandiseStoreList.stream().collect(Collectors.groupingBy(PointsMerchandiseStore::getPointsMerchandiseId)); |
| | | |
| | |
| | | List<UserCoupon> userCoupons = new ArrayList<>(); |
| | | if (ids.size() > 0) { |
| | | userCoupons = userCouponService.list(new QueryWrapper<UserCoupon>().eq("userId", appUserId).in("couponId", ids) |
| | | .ne("status", 3)); |
| | | .ne("status", 3) |
| | | .orderByDesc("insertTime", "id")); |
| | | } |
| | | if (pointsMerchandises.size() > 0) { |
| | | for (UserPointsMerchandise pointsMerchandise : pointsMerchandises) { |
| | |
| | | |
| | | // 2.0新增会员权益赠送门票 |
| | | List<VipDetail> list = vipDetailService.lambdaQuery() |
| | | .eq(VipDetail::getAppUserId, appUserId).eq(VipDetail::getType, 2).list(); |
| | | .eq(VipDetail::getAppUserId, appUserId) |
| | | .eq(VipDetail::getType, 2) |
| | | .orderByDesc(VipDetail::getInsertTime, VipDetail::getId) |
| | | .list(); |
| | | for (VipDetail vipDetail : list) { |
| | | ExchangeDetailsResponse detailsResponse = new ExchangeDetailsResponse(); |
| | | // 添加-用于区分会员权益门票 |
| | |
| | | } |
| | | responses.add(detailsResponse); |
| | | } |
| | | Comparator<ExchangeDetailsResponse> comparator = Comparator.comparing(ExchangeDetailsResponse::getStartTime).reversed(); |
| | | Collections.sort(responses, comparator); |
| | | detailsVo.setDetailsResponses(responses); |
| | | |
| | | } |
| | | responses.sort(Comparator.comparing(ExchangeDetailsResponse::getStartTime, |
| | | Comparator.nullsLast(Comparator.reverseOrder())) |
| | | .thenComparing(ExchangeDetailsResponse::getDetailsId, Comparator.reverseOrder())); |
| | | detailsVo.setDetailsResponses(responses); |
| | | return detailsVo; |
| | | } |
| | | |
| | |
| | | @Override |
| | | public List<RegisterCourseVo> queryRegisteredCourseList(CourseOfAfterRequest courseTypeId, Integer appUserId) { |
| | | List<RegisterCourseVo> courseVos = new ArrayList<>(); |
| | | List<CoursePackageOrder> list = this.list(new QueryWrapper<CoursePackageOrder>().eq("appUserId", appUserId).eq("state", 1)); |
| | | List<CoursePackageOrder> list = this.list(new QueryWrapper<CoursePackageOrder>() |
| | | .eq("appUserId", appUserId) |
| | | .eq("state", 1) |
| | | .orderByDesc("insertTime", "id")); |
| | | for (CoursePackageOrder order : list) { |
| | | TCoursePackage coursePackage = coursePackageService.getById(order.getCoursePackageId()); |
| | | Store store = storeClient.queryStoreById(coursePackage.getStoreId()); |
| | |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | |
| | | Vip vip = vipService.getById(id); |
| | | if (vip == null) { |
| | | throw new IllegalArgumentException("会员卡不存在: " + id); |
| | | } |
| | | model.addAttribute("vip",vip); |
| | | // 编辑页的两个权益列表都会被模板遍历,即使会员卡尚未配置权益也必须提供空集合。 |
| | | model.addAttribute("couponList", new ArrayList<Coupon>()); |
| | | model.addAttribute("ticketList", new ArrayList<TicketDetailVO>()); |
| | | if (vip.getCouponJson() != null && !vip.getCouponJson().isEmpty()){ |
| | | String couponJson = vip.getCouponJson(); |
| | | // 转化为jsonArray |
| | |
| | | model.addAttribute("couponList", new ArrayList<Coupon>()); |
| | | } |
| | | } |
| | | else{ |
| | | model.addAttribute("ticketList", new ArrayList<Coupon>()); |
| | | |
| | | } |
| | | |
| | | if (vip.getTicketJson() != null && !vip.getTicketJson().isEmpty()){ |
| | | String ticketJson = vip.getTicketJson(); |
| | |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | |
| | | Vip vip = vipService.getById(id); |
| | | if (vip == null) { |
| | | throw new IllegalArgumentException("会员卡不存在: " + id); |
| | | } |
| | | model.addAttribute("vip",vip); |
| | | model.addAttribute("couponList", new ArrayList<Coupon>()); |
| | | model.addAttribute("ticketList", new ArrayList<TicketDetailVO>()); |
| | | if (vip.getCouponJson() != null && !vip.getCouponJson().isEmpty()){ |
| | | String couponJson = vip.getCouponJson(); |
| | | // 转化为jsonArray |
| | |
| | | * 列表对外的 phone 统一返回可用的店长手机号。 |
| | | */ |
| | | public String getPhone() { |
| | | return (phone == null || phone.trim().isEmpty()) ? userPhone : phone; |
| | | return hasText(phone) ? phone : defaultString(userPhone); |
| | | } |
| | | |
| | | /** |
| | | * 兼容历史门店:当店长资料中未维护 phone 时,列表仍返回可用的门店手机号。 |
| | | * 返回空字符串而非 null,避免不同环境的 JSON 忽略 null 配置导致字段消失。 |
| | | */ |
| | | public String getUserPhone() { |
| | | return hasText(userPhone) ? userPhone : defaultString(phone); |
| | | } |
| | | |
| | | private boolean hasText(String value) { |
| | | return value != null && !value.trim().isEmpty(); |
| | | } |
| | | |
| | | private String defaultString(String value) { |
| | | return value == null ? "" : value; |
| | | } |
| | | |
| | | private String account; |
| | |
| | | <select id="listAll" resultType="com.dsh.guns.modular.system.model.TStoreListVo"> |
| | | select t1.*, |
| | | t2.name as userName, |
| | | coalesce(nullif(t1.phone, ''), nullif(t2.phone, '')) as phone, |
| | | coalesce(nullif(t2.phone, ''), nullif(t1.phone, '')) as userPhone, |
| | | coalesce(nullif(t1.phone, ''), nullif(t2.phone, ''), nullif(t2.account, ''), '') as phone, |
| | | coalesce(nullif(t2.phone, ''), nullif(t2.account, ''), nullif(t1.phone, ''), '') as userPhone, |
| | | t3.name as yysName |
| | | from t_store t1 |
| | | left join sys_user t2 on t1.storeStaffId = t2.id |
| | |
| | | and t2.name like concat("%",#{name},"%") |
| | | </if> |
| | | <if test="phone !=null and phone !=''"> |
| | | and coalesce(nullif(t2.phone, ''), nullif(t1.phone, '')) like concat("%",#{phone},"%") |
| | | and coalesce(nullif(t2.phone, ''), nullif(t2.account, ''), nullif(t1.phone, '')) like concat("%",#{phone},"%") |
| | | </if> |
| | | <if test="shopName !=null and shopName !=''"> |
| | | and t1.name like concat("%",#{shopName},"%") |
| | |
| | | <select id="listAllStore" resultType="com.dsh.guns.modular.system.model.TStoreListVo"> |
| | | select t1.*, |
| | | t2.name as userName, |
| | | coalesce(nullif(t1.phone, ''), nullif(t2.phone, '')) as phone, |
| | | coalesce(nullif(t2.phone, ''), nullif(t1.phone, '')) as userPhone, |
| | | coalesce(nullif(t1.phone, ''), nullif(t2.phone, ''), nullif(t2.account, ''), '') as phone, |
| | | coalesce(nullif(t2.phone, ''), nullif(t2.account, ''), nullif(t1.phone, ''), '') as userPhone, |
| | | t3.name as yysName |
| | | from t_store t1 |
| | | left join sys_user t2 on t1.storeStaffId = t2.id |
| | |
| | | and t2.name like concat("%",#{name},"%") |
| | | </if> |
| | | <if test="phone !=null and phone !=''"> |
| | | and coalesce(nullif(t2.phone, ''), nullif(t1.phone, '')) like concat("%",#{phone},"%") |
| | | and coalesce(nullif(t2.phone, ''), nullif(t2.account, ''), nullif(t1.phone, '')) like concat("%",#{phone},"%") |
| | | </if> |
| | | <if test="shopName !=null and shopName !=''"> |
| | | and t1.name like concat("%",#{shopName},"%") |
| | |
| | | <select id="listAllStoresByIds" resultType="com.dsh.guns.modular.system.model.TStoreListVo"> |
| | | select t1.*, |
| | | t2.name as userName, |
| | | coalesce(nullif(t1.phone, ''), nullif(t2.phone, '')) as phone, |
| | | coalesce(nullif(t2.phone, ''), nullif(t1.phone, '')) as userPhone, |
| | | coalesce(nullif(t1.phone, ''), nullif(t2.phone, ''), nullif(t2.account, ''), '') as phone, |
| | | coalesce(nullif(t2.phone, ''), nullif(t2.account, ''), nullif(t1.phone, ''), '') as userPhone, |
| | | t3.name as yysName |
| | | from t_store t1 |
| | | left join sys_user t2 on t1.storeStaffId = t2.id |
| | |
| | | and t2.name like concat("%",#{name},"%") |
| | | </if> |
| | | <if test="phone !=null and phone !=''"> |
| | | and coalesce(nullif(t2.phone, ''), nullif(t1.phone, '')) like concat("%",#{phone},"%") |
| | | and coalesce(nullif(t2.phone, ''), nullif(t2.account, ''), nullif(t1.phone, '')) like concat("%",#{phone},"%") |
| | | </if> |
| | | <if test="shopName !=null and shopName !=''"> |
| | | and t1.name like concat("%",#{shopName},"%") |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.other.entity.*; |
| | | import com.dsh.other.enums.SiteBookingStatusEnum; |
| | | import com.dsh.other.feignclient.StoreClient; |
| | | import com.dsh.other.feignclient.account.AppUserClient; |
| | | import com.dsh.other.feignclient.account.model.AppUser; |
| | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String code = sdf.format(new Date()) + UUIDUtil.getNumberRandom(5);// 退款单号 |
| | | // 运营商退款 |
| | | ResultUtil refundResult = payMoneyUtil.weixinRefundV3(smidVx, code, siteBooking.getPayOrderNo(), siteBooking.getPayMoney().toString(), "/base/site/cancelMySiteCallback1"); |
| | | if (!ResultUtil.SUCCESS.equals(refundResult.getCode())) { |
| | | return refundResult; |
| | | } |
| | | payMoneyUtil.weixinRefundV3(smidVx, code, siteBooking.getPayOrderNo(), siteBooking.getPayMoney().toString(), "/base/site/cancelMySiteCallback1"); |
| | | } else { |
| | | Map<String, String> map = payMoneyUtil.wxRefund(siteBooking.getPayOrderNo(), siteBooking.getOrderNo(), siteBooking.getPayMoney().toString(), |
| | | siteBooking.getPayMoney().toString(), "/base/site/cancelMySiteCallback"); |
| | |
| | | if (!"SUCCESS".equals(return_code)) { |
| | | return ResultUtil.error(map.get("return_msg")); |
| | | } |
| | | siteBooking.setCancelUserId(uid); |
| | | siteBookingService.updateById(siteBooking); |
| | | |
| | | TBackRecord tBackRecord = new TBackRecord(); |
| | | tBackRecord.setMoney(siteBooking.getPayMoney()); |
| | | tBackRecord.setUserId(siteBooking.getAppUserId()); |
| | | tBackRecord.setTime(new Date()); |
| | | backRecordService.save(tBackRecord); |
| | | } |
| | | |
| | | // 退款请求已受理即结束该预约,不能继续在“待核销”列表中展示。 |
| | | // 微信退款回调用于补充退款流水号及恢复优惠券,重复更新状态不会影响结果。 |
| | | siteBooking.setStatus(SiteBookingStatusEnum.CANCELED.getCode()); |
| | | siteBooking.setCancelUserId(uid); |
| | | siteBooking.setCancelTime(new Date()); |
| | | siteBookingService.updateById(siteBooking); |
| | | |
| | | |
| | | } |