| | |
| | | import com.dsh.course.feignClient.account.model.QueryByNamePhone; |
| | | import com.dsh.course.feignClient.account.model.TAppUser; |
| | | import com.dsh.course.feignClient.activity.CouponClient; |
| | | import com.dsh.course.feignClient.activity.model.Coupon; |
| | | import com.dsh.course.feignClient.activity.model.CouponCity; |
| | | import com.dsh.course.feignClient.activity.model.CouponListOfSearch; |
| | | import com.dsh.course.feignClient.activity.model.CouponRecordQuery; |
| | | import com.dsh.course.feignClient.activity.model.*; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.base.tips.SuccessTip; |
| | | import com.dsh.guns.core.common.constant.factory.PageFactory; |
| | |
| | | public String memberCouponAdd(Model model) { |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | System.out.println(objectType); |
| | | List<PointsMerchandise> pointsMerchandises = client.goodsList(); |
| | | model.addAttribute("userType",objectType); |
| | | model.addAttribute("goods",pointsMerchandises); |
| | | return PREFIX + "TCouponAdd.html"; |
| | | } |
| | | |
| | |
| | | return PREFIX + "TCouponInfo.html"; |
| | | } |
| | | |
| | | |
| | | // 积分商品活动状态 未开始和已开始状态 上架 |
| | | @RequestMapping("/goodsList") |
| | | @ResponseBody |
| | | public Object goodsList() { |
| | | return client.goodsList(); |
| | | } |
| | | |
| | | /** |
| | | * 跳转到门店管理列表页 |
| | |
| | | @RequestMapping("/siteDetailsOfSearch") |
| | | @ResponseBody |
| | | public Object siteDetailsOfSearch(String provinceId,String cityId,Integer operatorId,String storeName){ |
| | | List<Map<String, Object>> res = new ArrayList<>(); |
| | | Integer storeId = null; |
| | | if (UserExt.getUser().getObjectType()== 2){ |
| | | // 筛选这个运营商下的门店 |
| | | operatorId = UserExt.getUser().getObjectId(); |
| | | } |
| | | if (UserExt.getUser().getObjectType()== 3){ |
| | | List<Integer> storeIds = storeService.lambdaQuery().eq(TStore::getOperatorId, operatorId).list() |
| | | .stream().map(TStore::getId).collect(Collectors.toList()); |
| | | if (storeIds.isEmpty()){ |
| | | storeIds.add(0); |
| | | } |
| | | res = storeService.querySiteListOfpageOperator(provinceId,cityId,operatorId,storeName,storeIds); |
| | | }else if (UserExt.getUser().getObjectType()== 3){ |
| | | // 筛选这个运营商下的门店 |
| | | storeId = UserExt.getUser().getObjectId(); |
| | | res = storeService.querySiteListOfpage(provinceId,cityId,operatorId,storeName,storeId); |
| | | }else{ |
| | | List<Integer> storeIds = new ArrayList<>(); |
| | | res = storeService.querySiteListOfpageOperator(provinceId,cityId,operatorId,storeName,storeIds); |
| | | } |
| | | List<Map<String,Object>> storeList = storeService.querySiteListOfpage(provinceId,cityId,operatorId,storeName,storeId); |
| | | if (storeList.size() > 0 ){ |
| | | for (Map<String, Object> stringObjectMap : storeList) { |
| | | if (res.size() > 0 ){ |
| | | for (Map<String, Object> stringObjectMap : res) { |
| | | String provinceName = (String) stringObjectMap.get("province"); |
| | | String cityName = (String) stringObjectMap.get("city"); |
| | | stringObjectMap.put("provinceCity",provinceName+cityName); |
| | |
| | | |
| | | } |
| | | } |
| | | return storeList; |
| | | return res; |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | return couponListOfSearch; |
| | | } |
| | | /** |
| | | * 根据运营商ID 获取运营商管理的省市 |
| | | */ |
| | | @RequestMapping(value = "/listSelect") |
| | | @ResponseBody |
| | | public Object listOfDatas(String name, Integer type, Integer status, Integer state) { |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | CouponListOfSearch ofSearch = new CouponListOfSearch(); |
| | | ofSearch.setPage(page); |
| | | ofSearch.setName(name); |
| | | ofSearch.setType(type); |
| | | ofSearch.setStatus(status); |
| | | ofSearch.setState(state); |
| | | List<Map<String, Object>> couponListOfSearch = client.getCouponListAllOfSearch(ofSearch); |
| | | return couponListOfSearch; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取 优惠券管理 |
| | |
| | | if (imgFile != null){ |
| | | String originalFilename = imgFile.getOriginalFilename(); |
| | | String newName = originalFilename.substring(imgFile.getOriginalFilename().lastIndexOf(".")); |
| | | |
| | | |
| | | String url = OssUploadUtil.ossUpload("img/",imgFile); |
| | | Map<String, String> map = new HashMap<String, String>(); |
| | | //是否上传成功 |