| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.account.CityManagerClient; |
| | | import com.dsh.course.feignClient.account.CoachClient; |
| | | import com.dsh.course.feignClient.account.model.CityManager; |
| | | import com.dsh.course.feignClient.account.model.Coach; |
| | | import com.dsh.course.feignClient.account.model.CoachSerchVO; |
| | | import com.dsh.course.feignClient.course.*; |
| | | import com.dsh.course.feignClient.course.model.*; |
| | | import com.dsh.course.feignClient.other.BallClient; |
| | | import com.dsh.course.feignClient.other.model.Site; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.core.util.ToolUtil; |
| | | import com.dsh.guns.modular.system.model.TSite; |
| | | import com.dsh.guns.modular.system.model.TStore; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import com.dsh.guns.modular.system.model.dto.SelectDto; |
| | | import com.dsh.guns.modular.system.service.ICoursePackageService; |
| | | import com.dsh.guns.modular.system.service.IStoreService; |
| | | import com.dsh.guns.modular.system.service.ITSiteService; |
| | | import com.dsh.guns.modular.system.service.*; |
| | | import com.dsh.guns.modular.system.util.ResultUtil; |
| | | import io.swagger.models.auth.In; |
| | | import org.aspectj.weaver.ast.Var; |
| | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | @Resource |
| | | private CoursePackageClient coursePackageClient; |
| | | |
| | | |
| | | @Autowired |
| | | private TOperatorService tOperatorService; |
| | | @Autowired |
| | | private TOperatorCityService tOperatorCityService; |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/getCoursePackageByType") |
| | | public List<TCoursePackage> getCoursePackageByType(Integer storeId){ |
| | | return coursePackageClient.getCoursePackageByType(storeId); |
| | | public List<TCoursePackage> getCoursePackageByType(Integer storeId,Integer typeId){ |
| | | return coursePackageClient.getCoursePackageByType(typeId,storeId); |
| | | } |
| | | /** |
| | | * 跳转到列表页 |
| | |
| | | String cityCode = null; |
| | | if(objectType == 2){//城市管理员 |
| | | CityManager cityManager = cityManagerClient.queryCityManagerById(objectId); |
| | | cityCode = cityManager.getCityCode(); |
| | | if (cityManager!=null){ |
| | | cityCode = cityManager.getCityCode(); |
| | | } |
| | | } |
| | | List<Map<String, Object>> list = storeService.queryProvince(cityCode); |
| | | model.addAttribute("province", list); |
| | |
| | | * @param model |
| | | * @return |
| | | */ |
| | | @Autowired |
| | | private ICityService cityService; |
| | | @GetMapping("/openAddCoursePackage") |
| | | public String openAddCoursePackage(Model model,Integer type){ |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | List<TCoursePackageType> tCoursePackageTypes = coursePackageTypeClient.queryAllCoursePackageType(); |
| | | model.addAttribute("coursePackageType", tCoursePackageTypes); |
| | | String cityCode = null; |
| | | String cityCode = ""; |
| | | if(objectType == 2){//城市管理员 |
| | | CityManager cityManager = cityManagerClient.queryCityManagerById(objectId); |
| | | cityCode = cityManager.getCityCode(); |
| | | // 获取到这个运营商下面的所有门店 |
| | | List<TStore> operatorId = storeService.list(new QueryWrapper<TStore>().eq("operatorId",objectId)); |
| | | model.addAttribute("store", operatorId); |
| | | List<Coach> coach = coachClient.queryCoachByOperatorId(objectId); |
| | | model.addAttribute("coach", coach); |
| | | // 如果该运营商下面没有门店 |
| | | if (operatorId.size()==0){ |
| | | List<TStore> o = new ArrayList<>(); |
| | | List<TSite> tSites = new ArrayList<>(); |
| | | model.addAttribute("store", o); |
| | | model.addAttribute("site", tSites); |
| | | }else{ |
| | | List<TSite> storeId = siteService.list(new QueryWrapper<TSite>() |
| | | .eq("storeId", operatorId.get(0).getId())); |
| | | model.addAttribute("site", storeId); |
| | | } |
| | | }else{ |
| | | List<Map<String, Object>> list = storeService.queryProvince(cityCode); |
| | | model.addAttribute("province", list); |
| | | Object code = list.get(0).get("code"); |
| | | List<Map<String, Object>> list1 = storeService.queryCity(code.toString(), cityCode); |
| | | model.addAttribute("city", list1); |
| | | String code1 = list1.get(0).get("code").toString(); |
| | | List<TStore> list2 = storeService.list(new QueryWrapper<TStore>().eq("cityCode", code1).eq("state", 1)); |
| | | model.addAttribute("store", list2); |
| | | TStore store = list2.get(0); |
| | | List<TSite> list3 = siteService.list(new QueryWrapper<TSite>().eq("storeId", store.getId()).eq("state", 1)); |
| | | model.addAttribute("site", list3); |
| | | |
| | | |
| | | List<Coach> coaches = coachClient.queryCoachByOperatorId(objectId); |
| | | model.addAttribute("coach", coaches); |
| | | System.out.println("========type========"+type); |
| | | } |
| | | List<Map<String, Object>> list = storeService.queryProvince(cityCode); |
| | | model.addAttribute("province", list); |
| | | Object code = list.get(0).get("code"); |
| | | List<Map<String, Object>> list1 = storeService.queryCity(code.toString(), cityCode); |
| | | model.addAttribute("city", list1); |
| | | String code1 = list1.get(0).get("code").toString(); |
| | | List<TStore> list2 = storeService.list(new QueryWrapper<TStore>().eq("cityCode", code1).eq("state", 1)); |
| | | model.addAttribute("store", list2); |
| | | TStore store = list2.get(0); |
| | | List<TSite> list3 = siteService.list(new QueryWrapper<TSite>().eq("storeId", store.getId()).eq("state", 1)); |
| | | model.addAttribute("site", list3); |
| | | List<Coach> coaches = coachClient.queryCoachByCity(code1); |
| | | model.addAttribute("coach", coaches); |
| | | |
| | | |
| | | model.addAttribute("objectType",objectType); |
| | | model.addAttribute("type",type); |
| | | System.out.println("========type========"+type); |
| | | // if (type ==1){ |
| | | // return PREFIX + "coursePackage_edit.html"; |
| | | // } |
| | |
| | | TCoursePackage tCoursePackage = coursePackageService.queryById(id); |
| | | model.addAttribute("item", tCoursePackage); |
| | | model.addAttribute("type", tCoursePackage.getType()); |
| | | |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | model.addAttribute("objectType",objectType); |
| | | |
| | | String classStartTime = tCoursePackage.getClassStartTime(); |
| | | String classEndTime = tCoursePackage.getClassEndTime(); |
| | |
| | | model.addAttribute("store", list2); |
| | | List<TSite> list3 = siteService.list(new QueryWrapper<TSite>().eq("storeId", tCoursePackage.getStoreId()).eq("state", 1)); |
| | | model.addAttribute("site", list3); |
| | | List<Coach> coaches = coachClient.queryCoachByCity(cityCode); |
| | | model.addAttribute("coach", coaches); |
| | | if (UserExt.getUser().getObjectType() == 2){ |
| | | List<Coach> coaches = coachClient.queryCoachByOperatorId(UserExt.getUser().getObjectId()); |
| | | model.addAttribute("coach", coaches); |
| | | }else{ |
| | | CoachQuery coachQuery = new CoachQuery(); |
| | | coachQuery.setProvince(tCoursePackage.getProvince()); |
| | | coachQuery.setCity(tCoursePackage.getCity()); |
| | | List<CoachSerchVO> coachSerchVOS = coachClient.listAll(coachQuery); |
| | | model.addAttribute("coach",coachSerchVOS); |
| | | } |
| | | |
| | | |
| | | List<CoursePackagePaymentConfig> list4 = coursePackagePaymentConfigClient.queryCoursePackagePaymentConfigList(id); |
| | | |
| | | |
| | |
| | | System.out.println("=========coursePackagePaymentConfig=============>" + coursePackagePaymentConfig); |
| | | // model.addAttribute("couponIds", "3,2"); |
| | | } |
| | | |
| | | |
| | | Integer able = coursePackageClient.queryAble(id); |
| | | |
| | | model.addAttribute("able",able); |
| | | |
| | | return PREFIX + "coursePackage_edit.html"; |
| | | } |
| | | |
| | |
| | | System.out.println("=========coursePackagePaymentConfig=============>" + coursePackagePaymentConfig); |
| | | // model.addAttribute("couponIds", "3,2"); |
| | | } |
| | | |
| | | return PREFIX + "coursePackage_info.html"; |
| | | } |
| | | |
| | |
| | | map.put("coursePackageDiscount", tCoursePackageDiscounts); |
| | | list.add(map); |
| | | } |
| | | model.addAttribute("role",UserExt.getUser().getObjectType()); |
| | | model.addAttribute("type",tCoursePackage.getType()); |
| | | List<TCoursePackageDiscount> tCoursePackageDiscounts = coursePackageDiscountClient.queryByCoursePackageId1(tCoursePackage.getId()); |
| | | if (tCoursePackageDiscounts.size()>0){ |
| | | TCoursePackageDiscount tCoursePackageDiscount = tCoursePackageDiscounts.get(0); |
| | | model.addAttribute("audit",tCoursePackageDiscount.getAuditStatus()); |
| | | StringBuilder stringBuilder = new StringBuilder(" "); |
| | | // 如果折扣未通过 |
| | | if (tCoursePackageDiscount.getAuditStatus() == 3){ |
| | | model.addAttribute("state","未通过"); |
| | | for (TCoursePackageDiscount coursePackageDiscount : tCoursePackageDiscounts) { |
| | | stringBuilder.append(coursePackageDiscount.getAuditRemark()+","); |
| | | } |
| | | if (!stringBuilder.equals("")){ |
| | | String string = stringBuilder.toString(); |
| | | String substring = string.substring(0, string.length() - 1); |
| | | model.addAttribute("reasons",substring); |
| | | }else{ |
| | | model.addAttribute("reasons",stringBuilder); |
| | | } |
| | | }else{ |
| | | model.addAttribute("reasons",stringBuilder); |
| | | } |
| | | if(tCoursePackageDiscount.getAuditStatus() == 2){ |
| | | model.addAttribute("state","已通过"); |
| | | } |
| | | if (tCoursePackageDiscount.getAuditStatus() == 1){ |
| | | model.addAttribute("state","待审核"); |
| | | } |
| | | }else{ |
| | | model.addAttribute("audit",2); |
| | | model.addAttribute("state",0); |
| | | model.addAttribute("reasons",""); |
| | | } |
| | | |
| | | model.addAttribute("coursePackagePaymentConfig", JSON.toJSONString(list)); |
| | | return PREFIX + "coursePackageDiscount.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跳转到报名列表页 |
| | |
| | | model.addAttribute("auditStatus", tCoursePackage.getAuditStatus()); |
| | | |
| | | model.addAttribute("authRemark", tCoursePackage.getAuthRemark()); |
| | | String classStartTime = tCoursePackage.getClassStartTime(); |
| | | String classEndTime = tCoursePackage.getClassEndTime(); |
| | | if (tCoursePackage.getStartTime()!=null) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String dateString = sdf.format(tCoursePackage.getStartTime()); |
| | | String dateString1 = sdf.format(tCoursePackage.getEndTime()); |
| | | model.addAttribute("holi", dateString + " - " + dateString1); |
| | | } |
| | | String[] split1 = classStartTime.split(","); |
| | | String[] split2 = classEndTime.split(","); |
| | | |
| | | model.addAttribute("classTime", tCoursePackage.getClassStartTime() + ":00 - " + tCoursePackage.getClassEndTime() + ":00"); |
| | | List<String> listtime = new ArrayList<>(); |
| | | |
| | | for (int i = 0; i < split1.length; i++) { |
| | | String o = split1[i]+"-"+split2[i]; |
| | | listtime.add(o); |
| | | } |
| | | |
| | | |
| | | model.addAttribute("time1",listtime.remove(0)); |
| | | if (listtime.size()!=0) { |
| | | model.addAttribute("times", listtime); |
| | | } |
| | | model.addAttribute("classTime", |
| | | tCoursePackage.getClassStartTime() + ":00 - " |
| | | + tCoursePackage.getClassEndTime() + ":00"); |
| | | String[] split = tCoursePackage.getClassWeeks().split(";"); |
| | | List<String> list5 = Arrays.asList("周一", "周二", "周三", "周四", "周五", "周六", "周日"); |
| | | List<Map<String, Object>> classWeeks = new ArrayList<>(); |
| | |
| | | model.addAttribute("playPaiCoin", coursePackagePaymentConfig.getPlayPaiCoin() == 0 ? false : true);} |
| | | model.addAttribute("coursePackagePaymentConfig", list4.remove(0)); |
| | | model.addAttribute("coursePackagePaymentConfigs", list4); |
| | | |
| | | Integer type = tCoursePackage.getType(); |
| | | model.addAttribute("type",type); |
| | | return PREFIX + "examineCoursePackage_info.html"; |
| | | } |
| | | |
| | |
| | | @ResponseBody |
| | | @PostMapping("/queryCity") |
| | | public List<Map<String, Object>> queryCity(String code){ |
| | | |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | String cityCode = null; |
| | |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | String cityCode = null; |
| | | if(objectType == 2){//城市管理员 |
| | | CityManager cityManager = cityManagerClient.queryCityManagerById(objectId); |
| | | cityCode = cityManager.getCityCode(); |
| | | } |
| | | System.out.println("======="+storeService.queryCity(code, cityCode)); |
| | | // if(objectType == 2){//城市管理员 |
| | | // CityManager cityManager = cityManagerClient.queryCityManagerById(objectId); |
| | | // cityCode = cityManager.getCityCode(); |
| | | // } |
| | | |
| | | // return storeService.queryCity(code, cityCode); |
| | | return new ResultUtil(0,null,null,storeService.queryCity(code, cityCode),null); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/queryCity3") |
| | | public ResultUtil queryCity3(){ |
| | | |
| | | System.out.println("======="+storeService.queryCity1()); |
| | | // return storeService.queryCity(code, cityCode); |
| | | return new ResultUtil(0,null,null,storeService.queryCity1(),null); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/queryCity1/") |
| | | public ResultUtil queryCity2(){ |
| | | |
| | | return new ResultUtil(0,null,null,null,null); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/queryStore1//{id}") |
| | | public ResultUtil queryCity6(){ |
| | | |
| | | return new ResultUtil(0,null,null,null,null); |
| | | } |
| | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/queryStore1/{cityCode}") |
| | | public ResultUtil queryStore1(@PathVariable("cityCode") String cityCode){ |
| | | List<TStore> list = storeService.list(new QueryWrapper<TStore>().select("id","name").eq("cityCode", cityCode).eq("state", 1)); |
| | | @PostMapping("/queryStore1/{cityCode}/{$operationId}") |
| | | public ResultUtil queryStore1(@PathVariable("cityCode") String cityCode, |
| | | @PathVariable("$operationId") String operationId){ |
| | | Integer operatorId= 0; |
| | | Integer type= 0; |
| | | if (operationId.equals("平台")){ |
| | | type = 1; |
| | | operatorId = null; |
| | | }else{ |
| | | operatorId = Integer.valueOf(operationId); |
| | | type = 2; |
| | | } |
| | | QueryWrapper<TStore> wrapper = new QueryWrapper<>(); |
| | | wrapper.select("id","name"); |
| | | wrapper.eq("cityCode", cityCode); |
| | | wrapper.eq("state", 1); |
| | | wrapper.eq("type", type); |
| | | if (type!=1){ |
| | | // 如果不是勾选的平台 是选择的运营商 那么筛选运营商id |
| | | wrapper.eq("operatorId",operatorId); |
| | | } |
| | | List<TStore> list = storeService.list( |
| | | wrapper |
| | | ); |
| | | // Map<String,Integer> map = new LinkedHashMap<>(); |
| | | List<SelectDto> selectDtos = new ArrayList<>(); |
| | | Map<String,Integer> map = new HashMap<>(); |
| | |
| | | |
| | | return new ResultUtil(0,0,null,list,null); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/queryStore3") |
| | | public ResultUtil queryStore3(){ |
| | | List<TStore> list = storeService.list(new QueryWrapper<TStore>().select("id","name").eq("state", 1)); |
| | | // Map<String,Integer> map = new LinkedHashMap<>(); |
| | | List<SelectDto> selectDtos = new ArrayList<>(); |
| | | Map<String,Integer> map = new HashMap<>(); |
| | | // for (TStore store : list) { |
| | | // SelectDto selectDto = new SelectDto(); |
| | | // selectDto.setId(Long.valueOf(store.getId())); |
| | | // selectDto.setValue(store.getName()); |
| | | // selectDtos.add(selectDto); |
| | | // |
| | | // } |
| | | // map.put("options",selectDtos); |
| | | |
| | | return new ResultUtil(0,0,null,list,null); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/queryStore1/") |
| | |
| | | List<TSite> list = siteService.list(new QueryWrapper<TSite>().select("id","name").eq("storeId", storeId).eq("state", 1)); |
| | | return list; |
| | | } |
| | | /** |
| | | * 根据门店id获取场地(智慧球场添加使用 过滤掉已经添加过的场地) |
| | | * @param storeId |
| | | * @return |
| | | */ |
| | | @Autowired |
| | | private BallClient ballClient; |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/querySite3/{id}") |
| | | public List<Site> querySite3(@PathVariable("id") Integer storeId){ |
| | | |
| | | return ballClient.getSiteList(storeId); |
| | | } |
| | | @ResponseBody |
| | | @PostMapping("/querySite3/") |
| | | public Object querySite3(){ |
| | | |
| | | return new ResultUtil(0,0,null,null,null); |
| | | } |
| | | /** |
| | | * 根据门店id获取场地(智慧球场编辑使用 过滤掉已经添加过的场地 包含当前的场地) |
| | | * @param storeId |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/querySite5/{id}") |
| | | public List<Site> querySite5(@PathVariable("id") Integer storeId){ |
| | | |
| | | return ballClient.getSiteList1(storeId); |
| | | } |
| | | /** |
| | | * 根据门店id获取场地 |
| | | * @param storeId |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/querySite1") |
| | | public List<TSite> querySite1(Integer storeId,Integer type){ |
| | | List<TSite> list = new ArrayList<>(); |
| | | if (type==1){ |
| | | list = siteService.list(new QueryWrapper<TSite>() |
| | | .select("id","name") |
| | | .eq("storeId", storeId) |
| | | .eq("state", 1) |
| | | .eq("ishalf",type)); |
| | | }else{ |
| | | list = siteService.list(new QueryWrapper<TSite>() |
| | | .select("id","name") |
| | | .eq("storeId", storeId) |
| | | .eq("state", 1) |
| | | ); |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据门店id获取场地 |
| | | * @param storeId |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/querySite") |
| | | public List<TSite> querySite4(Integer storeId){ |
| | | System.out.println("==storeId==="+storeId); |
| | | List<TSite> list = siteService.list(new QueryWrapper<TSite>().select("id","name").eq("storeId", storeId).eq("state", 1)); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | |
| | | // @ResponseBody |
| | | // @PostMapping("/querySite") |
| | | // public List<TSite> querySite2(){ |
| | | // return null; |
| | | // } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/querySite/") |
| | |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | Integer storeId = null; |
| | | if(objectType == 2){//城市管理员 |
| | | CityManager cityManager = cityManagerClient.queryCityManagerById(objectId); |
| | | provinceCode = cityManager.getProvinceCode(); |
| | | cityCode = cityManager.getCityCode(); |
| | | List<Integer> storeIds = new ArrayList<>(); |
| | | |
| | | if(objectType == 2){// 城市管理员 |
| | | // CityManager cityManager = cityManagerClient.queryCityManagerById(objectId); |
| | | // provinceCode = cityManager.getProvinceCode(); |
| | | // cityCode = cityManager.getCityCode(); |
| | | // 获取运营商下的门店ids |
| | | List<Integer> operatorId = storeService.list(new QueryWrapper<TStore>().eq("operatorId", objectId)) |
| | | .stream().map(TStore::getId).collect(Collectors.toList()); |
| | | storeIds = operatorId; |
| | | } |
| | | if(objectType == 3) {//城市管理员 |
| | | storeId = objectId; |
| | | if(objectType == 3) {// 门店 |
| | | storeIds.add(objectId); |
| | | } |
| | | Page<Map<String, Object>> mapPage = coursePackageService.queryCoursePackageLists(provinceCode, cityCode, coursePackageTypeId, storeId, name, status, state); |
| | | Page<Map<String, Object>> mapPage = coursePackageService.queryCoursePackageLists(provinceCode, |
| | | cityCode, coursePackageTypeId, storeIds, name, status, state); |
| | | return super.packForBT(mapPage); |
| | | } |
| | | |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/addCoursePackage") |
| | | public ResultUtil addCoursePackage(TCoursePackage coursePackage, String coursePackagePaymentConfig) throws ParseException { |
| | | public ResultUtil addCoursePackage(TCoursePackage coursePackage, |
| | | String coursePackagePaymentConfig) throws ParseException { |
| | | String classStartTime = coursePackage.getClassStartTime(); |
| | | // String classEndTime = coursePackage.getClassEndTime(); |
| | | Date startDate = null; |
| | | Date endDate =null ; |
| | | |
| | | |
| | | String holitime = coursePackage.getHolitime(); |
| | | if (holitime!=null&&holitime!="") { |
| | |
| | | DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | startDate = dateFormat.parse(startDateString); |
| | | endDate = dateFormat.parse(endDateString); |
| | | |
| | | if (coursePackage.getType() == 2){ |
| | | startDate.setHours(0); |
| | | startDate.setMinutes(0); |
| | | startDate.setSeconds(0); |
| | | endDate.setHours(23); |
| | | endDate.setMinutes(59); |
| | | endDate.setSeconds(59); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | coursePackage.setClassStartTime(firstString); |
| | | coursePackage.setClassEndTime(secondString); |
| | | coursePackage.setAuditStatus(1); |
| | | coursePackage.setStatus(1); |
| | | coursePackage.setState(1); |
| | | if (UserExt.getUser().getObjectType() == 1){ |
| | | coursePackage.setAuditStatus(2); |
| | | }else{ |
| | | coursePackage.setAuditStatus(1); |
| | | } |
| | | coursePackage.setInsertTime(new Date()); |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | |
| | | if (objectType==2){ |
| | | Integer storeId = coursePackage.getStoreId(); |
| | | TStore store = storeService.getOne(new QueryWrapper<TStore>().eq("id", storeId)); |
| | | coursePackage.setProvince(store.getProvince()); |
| | | coursePackage.setProvinceCode(store.getProvinceCode()); |
| | | coursePackage.setCity(store.getCity()); |
| | | coursePackage.setCityCode(store.getCityCode()); |
| | | coursePackage.setAuditStatus(1); |
| | | } |
| | | |
| | | |
| | | // 详情多图片 |
| | | // String substring = coursePackage.getDetailDrawing().substring(0, coursePackage.getDetailDrawing().length() - 1); |
| | | // coursePackage.setDetailDrawing(substring); |
| | |
| | | @ResponseBody |
| | | @PostMapping("/updateCoursePackage") |
| | | public ResultUtil updateCoursePackage(TCoursePackage coursePackage, String coursePackagePaymentConfig){ |
| | | |
| | | // System.out.println("=======getClassStartTime============"+classStartTime); |
| | | String startTime = coursePackage.getClassStartTime(); |
| | | JSONArray jsonArray = JSON.parseArray(startTime); |
| | | String s = startTime.replaceAll(" ", ""); |
| | | |
| | | JSONArray jsonArray = JSON.parseArray(s); |
| | | System.out.println("=======jsonArray==========="+jsonArray); |
| | | |
| | | List<String> first = new ArrayList<>(); |
| | | List<String> second = new ArrayList<>(); |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | // JSONObject jsonObject = JSON.parseObject(jsonArray.getString(i)); |
| | | // JSONObject jsonObject = JSON.parseObject(jsonArray.getString(i)); |
| | | |
| | | String jsonString = jsonArray.getString(i); |
| | | String[] split = jsonString.split("-"); |
| | |
| | | // classEndTime = classEndTime.substring(0, classEndTime.lastIndexOf(":")); |
| | | coursePackage.setClassStartTime(firstString); |
| | | coursePackage.setClassEndTime(secondString); |
| | | coursePackage.setAuditStatus(2); |
| | | if (UserExt.getUser().getObjectType() != 1){ |
| | | coursePackage.setAuditStatus(1); |
| | | } |
| | | coursePackageService.updateCoursePackage(coursePackage, coursePackagePaymentConfig); |
| | | return ResultUtil.success(); |
| | | } |
| | |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/editCoursePackageState1") |
| | | public ResultUtil editCoursePackageState1(Integer id, Integer state){ |
| | | TCoursePackage coursePackage = new TCoursePackage(); |
| | | coursePackage.setId(id); |
| | | coursePackage.setState(state); |
| | | coursePackageService.editCoursePackageState(coursePackage); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | /** |
| | | * 编辑课包折扣 |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/afterClassExercises") |
| | | public ResultUtil afterClassExercises(Long id, Integer courseId, Integer integral){ |
| | | public ResultUtil afterClassExercises(Long id, Integer courseId, Integer integral,Integer packId){ |
| | | return coursePackageService.afterClassExercises(id, courseId, integral); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/queryWalkInStudentList") |
| | | @PostMapping("/queryWalkInStudentListqueryCoursePackageLists") |
| | | public Object queryWalkInStudentList(Long coursePackageSchedulingId, String userName, String studentName){ |
| | | Page<Map<String, Object>> page = coursePackageService.queryWalkInStudentList(coursePackageSchedulingId, userName, studentName); |
| | | return super.packForBT(page); |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/makeUpMissedLessons") |
| | | public ResultUtil makeUpMissedLessons(Long id){ |
| | | public ResultUtil makeUpMissedLessons(Integer id){ |
| | | System.out.println("==========coursePackage补课PaymentId======"+id); |
| | | return coursePackageService.makeUpMissedLessons(id); |
| | | } |