| | |
| | | List<TPayHuimin> payHuimins = payHuiminService.list(new LambdaQueryWrapper<TPayHuimin>() |
| | | .eq(TPayHuimin::getAppUserId, uid) |
| | | .ge(TPayHuimin::getEndTime,new Date()) |
| | | .eq(TPayHuimin::getStatus, 1)); |
| | | .in(TPayHuimin::getStatus, Arrays.asList(2,3))); |
| | | List<HuiminCardVO> huiminCardVOS = new ArrayList<>(); |
| | | for (THuiminCard huiminCardVO : cardList) { |
| | | HuiminCardVO huiminCardVO1 = new HuiminCardVO(); |
| | | huiminCardVO1.setId(huiminCardVO.getId()); |
| | | List<TPayHuimin> collect = payHuimins.stream().filter(e -> e.getCardId().equals(huiminCardVO.getId())).collect(Collectors.toList()); |
| | | if (!collect.isEmpty()){ |
| | | huiminCardVO1.setCover(huiminCardVO.getBuyCover()); |
| | | huiminCardVO1.setIsBuy(1); |
| | | for (TPayHuimin tPayHuimin : collect) { |
| | | if (tPayHuimin.getStatus().equals(2)){ |
| | | huiminCardVO1.setCover(huiminCardVO.getBuyCover()); |
| | | huiminCardVO1.setIsBuy(1); |
| | | break; |
| | | }else{ |
| | | huiminCardVO1.setCover(huiminCardVO.getUnBuyCover()); |
| | | huiminCardVO1.setIsBuy(0); |
| | | } |
| | | } |
| | | }else{ |
| | | huiminCardVO1.setCover(huiminCardVO.getUnBuyCover()); |
| | | huiminCardVO1.setIsBuy(0); |
| | |
| | | private Integer appUserId; // 购买用户ID |
| | | private String userName; // 购买用户 |
| | | private String phone; // 联系电话 |
| | | private Integer carId; // 惠民卡id |
| | | |
| | | // 时间信息 |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.alipay.api.AlipayApiException; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.activity.entity.HuiminPayQuery; |
| | |
| | | public Page<SalesDetailVO> selectPage(HuiminPayQuery query) { |
| | | Page<SalesDetailVO> salesDetailVOPage = baseMapper.selectSalesDetailPage(new Page<>(query.getCurrent(), query.getSize()), query); |
| | | List<SalesDetailVO> records = salesDetailVOPage.getRecords(); |
| | | for (SalesDetailVO record : records) { |
| | | List<THuiminRecord> list = huiminRecordService.list(new LambdaQueryWrapper<THuiminRecord>() |
| | | .eq(THuiminRecord::getAppUserId, record.getAppUserId()) |
| | | .eq(THuiminRecord::getHuiminCardId, record.getCarId())); |
| | | record.setUseTimes(list.size()); |
| | | } |
| | | if (CollUtil.isNotEmpty(records)){ |
| | | List<Integer> appUserIdList = records.stream().map(SalesDetailVO::getAppUserId).collect(Collectors.toList()); |
| | | List<AppUser> appUserList = appUserClient.queryAppUserBatch(appUserIdList); |
| | |
| | | thc.huiMinType, |
| | | thc.salesMoney, |
| | | thc.operatorId, |
| | | thc.storeId, |
| | | thc.storeIds, |
| | | tph.appUserId, |
| | | tph.paymentTime, |
| | | thc.endTime, |
| | | tph.studentId, |
| | | tph.status, |
| | | CASE |
| | | WHEN tph.id IS NULL THEN NULL |
| | | ELSE COALESCE(COUNT(thr.id), 0) |
| | | END AS useTimes |
| | | thc.id as carId, |
| | | tph.status |
| | | FROM |
| | | t_pay_huimin tph |
| | | LEFT JOIN t_huimin_card thc ON tph.cardId = thc.id |
| | | LEFT JOIN t_huimin_record thr ON tph.appUserId= thr.appUserId AND tph.cardId= thr.huiminCardId |
| | | <where> |
| | | tph.id IS NOT NULL |
| | | <if test="query.huiMinName !=null and query.huiMinName != ''"> |
| | |
| | | </when> |
| | | </choose> |
| | | </if> |
| | | and tph.status!=1 |
| | | </where> |
| | | |
| | | ORDER BY tph.insertTime DESC |
| | | </select> |
| | | <select id="getStaticsData" resultType="java.util.Map" |
| | |
| | | |
| | | <!-- 不可用时间 --> |
| | | <el-form-item label="不可用时间" prop="unUseTimes"> |
| | | <el-button type="text" v-on:click="addUnUseTime()">添加</el-button> |
| | | <el-button type="text" v-on:click="addUnUseTime()">添加2</el-button> |
| | | <div v-for="(item, dayIndex) in huiminCard.unUseTimes" |
| | | :key="dayIndex" |
| | | class="date-picker-item mb-2"> |
| | |
| | | console.log(this.weeks) |
| | | }, |
| | | addUnUseTime() { |
| | | this.huiminCard.unUseTimes.push({}); |
| | | this.huiminCard.unUseTimes.push({date:null}); |
| | | }, |
| | | removeUnUseTime(index) { |
| | | this.huiminCard.unUseTimes.splice(index, 1); |
| | |
| | | {title: '有效期', field: 'endTime', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '状态', field: 'status', visible: true, align: 'center', valign: 'middle', |
| | | formatter:function(value,row,index){ |
| | | return {1: '使用中', 2: '已退款'}[value]; |
| | | return {2: '使用中', 3: '已退款'}[value]; |
| | | }} |
| | | ]; |
| | | }; |