| | |
| | | import com.dsh.activity.model.response.GoodsInfoOneVo; |
| | | import com.dsh.activity.model.response.StoreVos; |
| | | import com.dsh.activity.service.*; |
| | | import com.dsh.activity.util.GDMapGeocodingUtil; |
| | | import com.dsh.activity.util.StrUtils; |
| | | import com.dsh.activity.util.TokenUtil; |
| | | import com.dsh.activity.util.ToolUtil; |
| | | import com.dsh.activity.util.*; |
| | | import io.swagger.models.auth.In; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | pmdsService.changeState(dto); |
| | | } |
| | | |
| | | /** |
| | | * 根据id查询 |
| | | */ |
| | |
| | | public PointsMerchandise getById(@RequestBody Integer id){ |
| | | return pmdsService.getById(id); |
| | | } |
| | | |
| | | /** |
| | | * 门票核销 |
| | | */ |
| | |
| | | public Object changeState(@RequestBody CourseChangeStateDTO dto){ |
| | | return userPointsMerchandiseService.changeState(dto); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping("/base/pointMerchars/writeOff") |
| | |
| | | byId.setVerificationUserId(dto.getVerificationUserId()); |
| | | return userPointsMerchandiseService.updateById(byId); |
| | | } |
| | | |
| | | @Autowired |
| | | private OperatorClient operatorClient; |
| | | @Resource |
| | | private CouponCityService cityService; |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/ticketList") |
| | | public List<Map<String,Object>> ticketList(@RequestBody IntegralGoodsOfSearch ofSearch){ |
| | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/queryGoodsListSearch") |
| | | public List<Map<String,Object>> getIntegralGoodsListOfSearch(@RequestBody IntegralGoodsOfSearch ofSearch){ |
| | |
| | | System.out.println("mapList->"+mapList); |
| | | return mapList; |
| | | } |
| | | |
| | | /** |
| | | * 获取积分商票消费金额 |
| | | */ |
| | |
| | | return userPointsMerchandiseService.getAmount(); |
| | | } |
| | | |
| | | |
| | | @Resource |
| | | private StoreClient storeClient; |
| | | |
| | | @Autowired |
| | | private PointsMerchandiseStoreService pointsMerchandiseStoreService; |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/convertGoods") |
| | |
| | | String cityCode = geocode.get("cityCode"); |
| | | |
| | | |
| | | List<PointsMerchandiseCity> cityCode1 = pmdsCityService.list(new QueryWrapper<PointsMerchandiseCity>().eq("cityCode", cityCode)); |
| | | List<Integer> cIds = new ArrayList<>(); |
| | | for (PointsMerchandiseCity pointsMerchandiseCity : cityCode1) { |
| | | cIds.add(pointsMerchandiseCity.getPointsMerchandiseId()); |
| | | // if(null != geocode) { |
| | | |
| | | List<Store> stores = storeClient.queryStoreList(new QueryStoreList(provinceCode, cityCode)); |
| | | Store s = null; |
| | | Double d = 0D; |
| | | for (Store store : stores) { |
| | | Map<String, Double> distance = GeodesyUtil.getDistance(location.getLon() + "," + location.getLat(), store.getLon() + "," + store.getLat()); |
| | | Double wgs84 = distance.get("WGS84"); |
| | | if (s == null || d > wgs84) { |
| | | s = store; |
| | | d = wgs84; |
| | | } |
| | | } |
| | | // } |
| | | |
| | | // List<PointsMerchandiseCity> cityCode1 = pmdsCityService.list(new QueryWrapper<PointsMerchandiseCity>().eq("cityCode", cityCode)); |
| | | List<Integer> cIds = new ArrayList<>(); |
| | | // for (PointsMerchandiseCity pointsMerchandiseCity : cityCode1) { |
| | | // cIds.add(pointsMerchandiseCity.getPointsMerchandiseId()); |
| | | // } |
| | | |
| | | List<PointsMerchandiseStore> storesids = pointsMerchandiseStoreService.list(new QueryWrapper<PointsMerchandiseStore>().eq("storeId", s.getId())); |
| | | for (PointsMerchandiseStore storesid : storesids) { |
| | | cIds.add(storesid.getPointsMerchandiseId()); |
| | | } |
| | | |
| | | |
| | | // if (cIds.size()>0) { |
| | | |
| | | List<PointsMerchandise> merchandises = pmdsService.list(new QueryWrapper<PointsMerchandise>() |
| | | List<PointsMerchandise> merchandises = pmdsService.list(new QueryWrapper<PointsMerchandise>().in("id", cIds) |
| | | .eq("state", 1) |
| | | .eq("shelves", 1) |
| | | .gt("endTime", new Date()).last("ORDER BY sort desc,insertTime desc")); |
| | |
| | | System.out.println(commodity); |
| | | return commodity; |
| | | } |
| | | |
| | | @Resource |
| | | private CoursePackageClient coursePackageClient; |
| | | @Autowired |
| | |
| | | // return pointMerchandiseVo; |
| | | // |
| | | // } |
| | | |
| | | |
| | | |
| | | PointMerchandiseVo pointMerchandiseVo = new PointMerchandiseVo(); |
| | |
| | | |
| | | @Autowired |
| | | private UserCouponService userCouponService; |
| | | |
| | | @PostMapping("/base/pointMerchars/getGoodDetails") |
| | | public ProductDetailsVo getGoodDetailsWithId(@RequestBody ProductDetailRequest detailRequest){ |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | ProductDetailsVo detailsVo = new ProductDetailsVo(); |
| | | PointsMerchandise merchandise = pmdsService.getById(detailRequest.getGoodId()); |
| | | |
| | | |
| | | |
| | | if (merchandise!=null) { |
| | |
| | | // .eq("pointsMerchandiseId",merchandise.getId() )); |
| | | |
| | | |
| | | |
| | | int couponCounts = userCouponService.count(new QueryWrapper<UserCoupon>().eq("couponId", coupon.getId())); |
| | | // detailsVo.setRedeemedNum(coupon.getPickUpQuantity()); |
| | | detailsVo.setRedeemedNum(couponCounts); |
| | |
| | | List<Integer> rid= stoClient.querySiteIdById(storeIds); |
| | | detailsResponse.setRid(rid); |
| | | } |
| | | |
| | | |
| | | }else if(merchandise.getUseScope()==3){ |
| | | // 指定门店 |
| | | List<PointsMerchandiseStore> list = pmdstoService.list(new LambdaQueryWrapper<PointsMerchandiseStore>() |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | if (merchandise.getCardType()==1){ |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | Calendar calendar = Calendar.getInstance(); |
| | |
| | | detailsVo.setOrderTime(format); |
| | | |
| | | |
| | | |
| | | |
| | | list2.add(pmdsServiceById.getCover()); |
| | | detailsVo.setPics(list2); |
| | | Collections.sort(detailsVo.getPics(), (s1, s2) -> { |
| | |
| | | return 0; // 保持原顺序 |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | if (pmdsServiceById.getCardType()==1){ |
| | |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | |
| | | |
| | | |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(byId.getInsertTime()); |
| | | calendar.add(Calendar.DAY_OF_MONTH, 31); |
| | |
| | | |
| | | } else if (pmdsServiceById.getCardType()==3) { |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | |
| | | |
| | | |
| | | Calendar calendar = Calendar.getInstance(); |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | break; |
| | |
| | | // .eq("pointsMerchandiseId",merchandise.getId() )); |
| | | |
| | | |
| | | |
| | | int couponCounts = userCouponService.count(new QueryWrapper<UserCoupon>().eq("couponId", coupon.getId())); |
| | | // detailsVo.setRedeemedNum(coupon.getPickUpQuantity()); |
| | | // detailsVo.setRedeemedNum(couponCounts); |
| | |
| | | |
| | | /** |
| | | * 获取用户已兑换商品的数量 |
| | | * |
| | | * @param goodResp |
| | | * @return 数量 |
| | | */ |
| | |
| | | System.out.println(count); |
| | | return count; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/queryUserHasGoodsNums1") |
| | | public int queryUserHasGoodsNums1(@RequestBody AppUserGoodResp goodResp){ |
| | |
| | | |
| | | /** |
| | | * 变更兑换商品的的状态 |
| | | * |
| | | * @param code |
| | | * @return 数量 |
| | | */ |
| | |
| | | return upmseService.getConsumeDetails(requestVo); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param mapLists |
| | | * @param timeType 1=未开始 2=已开始 3=已结束 |
| | | * @return |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/updateGoodsDetail") |
| | | public boolean updateGoodsDetail(@RequestBody Map<String, Object> map){ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @PostMapping("/base/pointMerchars/addOther") |
| | | public Boolean addOther(@RequestBody String pam){ |
| | | Boolean save =false; |
| | |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |