| | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/coupon/queryCouponAll") |
| | | public List<Coupon> queryCouponAll() { |
| | | try { |
| | | |
| | | return couponService.lambdaQuery().eq(Coupon::getState,1) |
| | | .eq(Coupon::getAuditStatus,2).list(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return null; |
| | | } |
| | | } |
| | | @ResponseBody |
| | | @PostMapping("/coupon/queryCouponList") |
| | | public List<Coupon> queryCouponList() { |
| | | try { |
| | | |
| | | return couponService.lambdaQuery().ne(Coupon::getState,3) |
| | | .eq(Coupon::getAuditStatus,2).list(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return null; |
| | | } |
| | | } |
| | | @ResponseBody |
| | | @PostMapping("/coupon/queryUserCouponById") |
| | | public Integer queryUserCouponById(@RequestBody Long id) { |
| | |
| | | int count = ucService.count(new LambdaQueryWrapper<UserCoupon>() |
| | | .eq(UserCoupon::getCouponId, o)); |
| | | stringObjectMap.put("hasPickQty", count); |
| | | } |
| | | } |
| | | return mapList; |
| | | } |
| | | @ResponseBody |
| | | @PostMapping("/base/coupon/getCouponListAllOfSearch") |
| | | public List<Map<String, Object>> getCouponListAllOfSearch(@RequestBody CouponListOfSearch ofSearch) { |
| | | List<Map<String, Object>> mapList1 = couponService.queryCouponListOfSearch(ofSearch); |
| | | |
| | | List<Map<String, Object>> mapList = new ArrayList<>(); |
| | | if (ofSearch.getStoreIds() == null) { |
| | | ArrayList<Integer> list = new ArrayList<>(); |
| | | ofSearch.setStoreIds(list); |
| | | } |
| | | mapList = mapList1; |
| | | if (mapList.size() > 0) { |
| | | for (Map<String, Object> stringObjectMap : mapList) { |
| | | Object startTime = stringObjectMap.get("startTime"); |
| | | Object endTime = stringObjectMap.get("endTime"); |
| | | stringObjectMap.put("timeValue", startTime + "至" + endTime); |
| | | } |
| | | } |
| | | return mapList; |
| | |
| | | List<CouponCity> list = cityService.list(new LambdaQueryWrapper<CouponCity>().eq(CouponCity::getCouponId, id)); |
| | | return list; |
| | | } |
| | | @ResponseBody |
| | | @PostMapping("/base/coupon/queryAllCity") |
| | | public List<CouponCity> queryAllCity() { |
| | | List<CouponCity> list = cityService.list(new LambdaQueryWrapper<CouponCity>()); |
| | | return list; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/coupon/queryStore") |
| | | public List<Integer> queryStore(@RequestBody Integer id) { |
| | | return couStoreService.list(new LambdaQueryWrapper<CouponStore>().eq(CouponStore::getCouponId, id)).stream().map(CouponStore::getStoreId).collect(Collectors.toList()); |
| | | } |
| | | @ResponseBody |
| | | @PostMapping("/base/coupon/queryAllStore") |
| | | public List<CouponStore> queryAllStore() { |
| | | return couStoreService.list(new LambdaQueryWrapper<CouponStore>()); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/base/coupon/listRecord") |
| | | @ResponseBody |
| | | public List<Map<String, Object>> listRecord(@RequestBody CouponRecordQuery ofSearch) { |
| | | Page<Object> objectPage = new Page<>(ofSearch.getOffset(), ofSearch.getLimit()); |
| | | return couponService.listRecord(objectPage, ofSearch.getId(), ofSearch.getIds(), ofSearch.getType()); |
| | | return couponService.listRecord(ofSearch.getId(), ofSearch.getIds(), ofSearch.getType()); |
| | | } |
| | | |
| | | |