| | |
| | | String cityName = (String) stringObjectMap.get("city"); |
| | | stringObjectMap.put("provinceCity",provinceName+cityName); |
| | | Integer managerId = (Integer) stringObjectMap.get("operatorId"); |
| | | if (managerId==0){ |
| | | if (managerId == null){ |
| | | stringObjectMap.put("accountName","平台"); |
| | | }else{ |
| | | if (managerId==0){ |
| | | stringObjectMap.put("accountName","平台"); |
| | | }else{ |
| | | TOperator operator = operatorService.getOne(new QueryWrapper<TOperator>().eq("id", managerId)); |
| | | if (ToolUtil.isNotEmpty(operator)){ |
| | | stringObjectMap.put("accountName",operator.getName()); |
| | | }else{ |
| | | stringObjectMap.put("accountName","平台"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return storeList; |
| | | } |
| | | // 查询场地列表 |
| | | @RequestMapping("/siteDetailsOfSearch") |
| | | @ResponseBody |
| | | public Object siteDetailsOfSearch(String provinceId,String cityId,Integer operatorId,String storeName){ |
| | | Integer storeId = null; |
| | | if (UserExt.getUser().getObjectType()== 2){ |
| | | // 筛选这个运营商下的门店 |
| | | operatorId = UserExt.getUser().getObjectId(); |
| | | } |
| | | if (UserExt.getUser().getObjectType()== 3){ |
| | | // 筛选这个运营商下的门店 |
| | | storeId = UserExt.getUser().getObjectId(); |
| | | } |
| | | List<Map<String,Object>> storeList = storeService.querySiteListOfpage(provinceId,cityId,operatorId,storeName,storeId); |
| | | if (storeList.size() > 0 ){ |
| | | for (Map<String, Object> stringObjectMap : storeList) { |
| | | String provinceName = (String) stringObjectMap.get("province"); |
| | | String cityName = (String) stringObjectMap.get("city"); |
| | | stringObjectMap.put("provinceCity",provinceName+cityName); |
| | | |
| | | Integer managerId = (Integer) stringObjectMap.get("operatorId"); |
| | | |
| | | Integer type = (Integer) stringObjectMap.get("type"); |
| | | if (type == 1){ |
| | | // 平台 |
| | | stringObjectMap.put("account","平台"); |
| | | }else{ |
| | | // 根据门店获取运营商id 查询运营商名称 |
| | | |
| | | // 查询运营商名称 |
| | | TOperator operator = operatorService.getOne(new QueryWrapper<TOperator>().eq("id", managerId)); |
| | | if (ToolUtil.isNotEmpty(operator)){ |
| | | stringObjectMap.put("accountName",operator.getName()); |
| | | }else{ |
| | | stringObjectMap.put("accountName","平台"); |
| | | |
| | | stringObjectMap.put("account",operator.getName()); |
| | | } |
| | | } |
| | | |
| | |
| | | ofSearch.setStoreIds(storeIds); |
| | | ofSearch.setObjType(UserExt.getUser().getObjectType()); |
| | | ofSearch.setOperatorId(UserExt.getUser().getObjectId()); |
| | | // 查询当前门店属于哪个运营商 |
| | | List<TOperatorCity> operatorId = operatorCityService.list(new QueryWrapper<TOperatorCity>().eq("operatorId", UserExt.getUser().getObjectId())); |
| | | ofSearch.setOperatorCities(operatorId); |
| | | } |
| | | if (UserExt.getUser().getObjectType()==3) { |
| | | ofSearch.setStoreId(UserExt.getUser().getObjectId()); |
| | |
| | | } |
| | | // 运营商可以查看平台添加的优惠券应只展示使用范围为全国通用、 |
| | | // 指定城市有运营商管辖的、指定门店有运营商旗下门店 |
| | | List<Map<String, Object>> couponListOfSearch = client.getCouponListOfSearch(ofSearch); |
| | | |
| | | return client.getCouponListOfSearch(ofSearch); |
| | | return couponListOfSearch; |
| | | } |
| | | /** |
| | | * 根据运营商ID 获取运营商管理的省市 |
| | | */ |
| | | |
| | | /** |
| | | * 获取 优惠券管理 |
| | |
| | | ofSearch.setState(state); |
| | | ofSearch.setCityCode(cityCode); |
| | | ofSearch.setStoreId(storeId); |
| | | ofSearch.setObjType(UserExt.getUser().getObjectType()); |
| | | ofSearch.setOperatorId(UserExt.getUser().getObjectId()); |
| | | return client.getCouponListOfSearch1(ofSearch); |
| | | } |
| | | |
| | |
| | | @RequestMapping(value = "/listRecord") |
| | | @ResponseBody |
| | | public Object listRecord(Integer id,String name, Integer type, String phone) { |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | List<TAppUser> tAppUsers = appUserClient.queryByNamePhone(new QueryByNamePhone(name, phone)); |
| | | if(tAppUsers.size()==0){ |
| | | return new ArrayList<>(); |
| | | } |
| | | CouponRecordQuery ofSearch = new CouponRecordQuery(); |
| | | ofSearch.setId(id); |
| | | ofSearch.setLimit(page.getSize()); |
| | | ofSearch.setOffset(page.getCurrent()); |
| | | ofSearch.setIds(tAppUsers.stream().map(TAppUser::getId).collect(Collectors.toList())); |
| | | ofSearch.setType(type); |
| | | List<Map<String, Object>> maps = client.listRecord(ofSearch); |
| | |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | dataVo.setUserType(objectType); |
| | | dataVo.setCityManagerId(UserExt.getUser().getObjectId()); |
| | | if(UserExt.getUser().getObjectType()==3){ |
| | | if(UserExt.getUser().getObjectType()==2){ |
| | | dataVo.setCompany(3); |
| | | dataVo.setUserType(2); |
| | | dataVo.setCityManagerId(UserExt.getUser().getObjectId()); |
| | | }else if(UserExt.getUser().getObjectType()==3){ |
| | | dataVo.setStoreIds(UserExt.getUser().getObjectId().toString()); |
| | | dataVo.setCompany(3); |
| | | } |
| | | dataVo.setObjType(UserExt.getUser().getObjectType()); |
| | | if(UserExt.getUser().getObjectType()==3){ |
| | | dataVo.setStoreIds(UserExt.getUser().getObjectId().toString()); |
| | | dataVo.setCompany(3); |
| | | dataVo.setUserType(3); |
| | | }else{ |
| | | dataVo.setUserType(1); |
| | | } |
| | | dataVo.setObjType(UserExt.getUser().getObjectType()); |
| | | client.insertIntoData(dataVo); |