| | |
| | | @ResponseBody |
| | | @PostMapping("/base/coupon/queryCouponListSearch") |
| | | public List<Map<String,Object>> getCouponListOfSearch(@RequestBody CouponListOfSearch ofSearch){ |
| | | List<Map<String, Object>> mapList = couponService.queryCouponListOfSearch(ofSearch); |
| | | List<Map<String, Object>> mapList1 = couponService.queryCouponListOfSearch(ofSearch); |
| | | List<Map<String, Object>> mapList = new ArrayList<>(); |
| | | |
| | | if(ofSearch.getStoreId()!=null){ |
| | | for (Map<String, Object> map : mapList1) { |
| | | List<CouponStore> id = couStoreService.list(new LambdaQueryWrapper<CouponStore>().eq(CouponStore::getCouponId, map.get("id").toString())); |
| | | List<Integer> collect = id.stream().map(CouponStore::getStoreId).collect(Collectors.toList()); |
| | | if(collect.size()==0){ |
| | | collect.add(-1); |
| | | } |
| | | if(collect.contains(ofSearch.getStoreId())){ |
| | | mapList.add(map); |
| | | } |
| | | } |
| | | } |
| | | if (mapList.size() > 0){ |
| | | for (Map<String, Object> stringObjectMap : mapList) { |
| | | Integer o = (Integer) stringObjectMap.get("id"); |
| | |
| | | package com.dsh.course.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.dsh.course.entity.CancelledClasses; |
| | | import com.dsh.course.entity.CoursePackageScheduling; |
| | | import com.dsh.course.entity.TCoursePackage; |
| | | import com.dsh.course.entity.TCoursePackagePayment; |
| | | import com.dsh.course.feignclient.account.AppUserClient; |
| | | import com.dsh.course.feignclient.account.CoachClient; |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | query.setCoachIds(c); |
| | | } |
| | | } |
| | | List<Integer> collect =new ArrayList<>(); |
| | | if(query.getStoreId()!=null){ |
| | | List<TCoursePackage> list = coursePackageService.list(new LambdaQueryWrapper<TCoursePackage>().eq(TCoursePackage::getStoreId, query.getStoreId())); |
| | | collect = list.stream().map(TCoursePackage::getId).collect(Collectors.toList()); |
| | | if(collect.size()==0){ |
| | | collect.add(-1); |
| | | } |
| | | } |
| | | |
| | | List<CancelClassesVO> result = cancelledClassesService.listAll(query); |
| | | List<CancelClassesVO> result = cancelledClassesService.listAll(query,collect); |
| | | for (CancelClassesVO cancelClassesVO : result) { |
| | | CoursePackageScheduling byId1 = coursePackageSchedulingService.getById(cancelClassesVO.getCoursePackageSchedulingId()); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | |
| | | |
| | | public interface CancelledClassesMapper extends BaseMapper<CancelledClasses> { |
| | | |
| | | List<CancelClassesVO> listAll(@Param("query") CancelClassesQuery query,@Param("sTime")String sTime,@Param("eTime")String eTime); |
| | | List<CancelClassesVO> listAll(@Param("query") CancelClassesQuery query, @Param("sTime")String sTime, @Param("eTime")String eTime, @Param("collect") List<Integer> collect); |
| | | |
| | | List<MoneyBack> getRefund(); |
| | | |
| | |
| | | private List<Integer> coachIds; |
| | | // 学员ids |
| | | private List<Integer> studentIds; |
| | | |
| | | private Integer storeId; |
| | | } |
| | |
| | | */ |
| | | public interface CancelledClassesService extends IService<CancelledClasses> { |
| | | |
| | | List<CancelClassesVO> listAll(CancelClassesQuery query); |
| | | List<CancelClassesVO> listAll(CancelClassesQuery query, List<Integer> collect); |
| | | |
| | | } |
| | |
| | | private CancelledClassesMapper cancelledClassesMapper; |
| | | |
| | | @Override |
| | | public List<CancelClassesVO> listAll(CancelClassesQuery query) { |
| | | public List<CancelClassesVO> listAll(CancelClassesQuery query, List<Integer> collect) { |
| | | String STime = null; |
| | | String ETime = null; |
| | | if (StringUtils.hasLength(query.getTime())) { |
| | | STime = query.getTime().split(" - ")[0] + " 00:00:00"; |
| | | ETime = query.getTime().split(" - ")[1] + " 23:59:59"; |
| | | } |
| | | return cancelledClassesMapper.listAll(query,STime,ETime); |
| | | return cancelledClassesMapper.listAll(query,STime,ETime,collect); |
| | | } |
| | | } |
| | |
| | | @Override |
| | | public List<DiscountList> queryDiscountList(QueryDiscountList queryDiscountList) { |
| | | Page<DiscountList> discountListPage = new Page<>(queryDiscountList.getOffset(), queryDiscountList.getLimit()); |
| | | List<Integer> ids = queryDiscountList.getIds(); |
| | | if(ids.size()==0){ |
| | | ids.add(-1); |
| | | queryDiscountList.setIds(ids); |
| | | } |
| | | List<DiscountList> discountLists = this.baseMapper.queryDiscountList(discountListPage, queryDiscountList.getPCode(), queryDiscountList.getCCode(), queryDiscountList.getName(), queryDiscountList.getType(), queryDiscountList.getIds()); |
| | | for (DiscountList discountList : discountLists) { |
| | | List<TCoursePackageDiscount> tCoursePackageDiscounts = this.baseMapper.selectList(new LambdaQueryWrapper<TCoursePackageDiscount>().eq(TCoursePackageDiscount::getCoursePackageId, discountList.getCourseId()).eq(TCoursePackageDiscount::getAuditStatus,2).orderByAsc(TCoursePackageDiscount::getType)); |
| | |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | <if test="collect != null and collect.size>0"> |
| | | AND t2.id IN |
| | | <foreach collection="collect" separator="," item="id" open="(" close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="getRefund" resultType="com.dsh.course.entity.MoneyBack"> |
| | |
| | | vo.setIds(collect); |
| | | }else if(roleType == 3){ |
| | | List<Integer> list = new ArrayList<>(); |
| | | TStoreStaff storeByStoreStaffId = storeStaffClient.getStoreByStoreStaffId(objectId); |
| | | list.add(storeByStoreStaffId.getStoreId()); |
| | | list.add(objectId); |
| | | vo.setIds(list); |
| | | } |
| | | List<QueryBodySideAppointmentVO> queryBodySideAppointmentVOS = bodySideAppointmentClient.listAll(vo); |
| | |
| | | ofSearch.setUserPopulation(userPopulation); |
| | | ofSearch.setStatus(status); |
| | | ofSearch.setState(state); |
| | | if (UserExt.getUser().getObjectType()==3) { |
| | | ofSearch.setStoreId(UserExt.getUser().getObjectId()); |
| | | } |
| | | return client.getCouponListOfSearch(ofSearch); |
| | | } |
| | | |
| | |
| | | import com.dsh.course.feignClient.course.CoursePackagePaymentConfigClient; |
| | | import com.dsh.course.feignClient.course.model.*; |
| | | import com.dsh.course.model.AuditDiscount; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.core.base.tips.ErrorTip; |
| | | import com.dsh.guns.core.base.tips.SuccessTip; |
| | |
| | | if(ToolUtil.isNotEmpty(shopName)){ |
| | | wrapper.like(TStore::getName, shopName); |
| | | } |
| | | if(UserExt.getUser().getObjectType()==3){ |
| | | wrapper.eq(TStore::getId, UserExt.getUser().getObjectId()); |
| | | } |
| | | List<TStore> list = storeService.list(wrapper); |
| | | Page<DiscountList> page = new PageFactory<DiscountList>().defaultPage(); |
| | | List<DiscountList> discountLists = courseClient.queryDiscountList(new QueryDiscountList(page.getCurrent(),page.getSize(),provinceCode,cityCode,name,type,list.stream().map(TStore::getId).collect(Collectors.toList()))); |
| | |
| | | coachQuery.setCoachName(coachName); |
| | | coachQuery.setCourseName(courseName); |
| | | coachQuery.setTime(beginTime); |
| | | if(UserExt.getUser().getObjectType()==3){ |
| | | coachQuery.setStoreId(UserExt.getUser().getObjectId()); |
| | | } |
| | | return cancelledClassesClient.listAll(coachQuery); |
| | | } |
| | | /** |
| | |
| | | private List<Integer> coachIds; |
| | | // 学员ids |
| | | private List<Integer> studentIds; |
| | | |
| | | private Integer storeId; |
| | | } |