| | |
| | | import com.dsh.account.entity.TStudent; |
| | | import com.dsh.account.feignclient.competition.model.PurchaseRecordVo; |
| | | import com.dsh.account.feignclient.course.model.RecordAppoint; |
| | | import com.dsh.account.model.vo.DetailsListVo; |
| | | import com.dsh.account.model.vo.classDetails.*; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.*; |
| | | import com.dsh.account.model.vo.commentDetail.StuCommentsVo; |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | } |
| | | @ResponseBody |
| | | @PostMapping("/api/startCource/weeksOfCourseDetailsList") |
| | | @ApiOperation(value = "上课首页-课程列表2.0", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(value = "查询时间yyyy-MM-dd", name = "time", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "学员id", name = "stuId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "门店id", name = "storeId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "用户经度", name = "longitude", required = false, dataType = "string"), |
| | | @ApiImplicitParam(value = "用户纬度", name = "latitude", required = false, dataType = "string"), |
| | | }) |
| | | public ResultUtil<Map<String,Object>> weeksOfCourseDetailsList(String time, Integer stuId, Integer storeId, String longitude, String latitude){ |
| | | try { |
| | | Integer appUserId = tokenUtil.getUserIdFormRedis(); |
| | | if(null == appUserId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(tappuService.weeksOfCourseDetailsList(appUserId,stuId,time,storeId,longitude,latitude)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/startCource/weeksOfGetHours") |
| | |
| | | import com.dsh.account.feignclient.course.model.*; |
| | | import com.dsh.account.model.BillingRequest; |
| | | import com.dsh.account.model.BillingRequestVo; |
| | | import com.dsh.account.model.vo.DetailsListVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | @FeignClient(value = "mb-cloud-course") |
| | |
| | | @PostMapping("/base/coursePack/getClassHour") |
| | | Integer getClassHour(Integer courseConfigId); |
| | | |
| | | @PostMapping("/base/coursePack/weeksOfCourseDetailsList") |
| | | HashMap<String, Object> weeksOfCourseDetailsList(@RequestBody CourseDetailReq courseDetailReq); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.feignclient.course.model; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class CourseDetailReq { |
| | | private Integer appUserId; |
| | | private Integer stuId; |
| | | private String time; |
| | | private Integer storeId; |
| | | private String lon; |
| | | private String lat; |
| | | } |
New file |
| | |
| | | package com.dsh.account.model.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class DetailsListVo { |
| | | |
| | | |
| | | @ApiModelProperty("课包id") |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("课包名称") |
| | | private String name; |
| | | @ApiModelProperty("") |
| | | private String intro; |
| | | @ApiModelProperty("1显示请假 2购课") |
| | | private Integer type; |
| | | @ApiModelProperty("时间段") |
| | | private List<String> time; |
| | | @ApiModelProperty("课时数") |
| | | private Integer num; |
| | | @ApiModelProperty("金额") |
| | | private Double money; |
| | | } |
| | |
| | | import com.dsh.account.model.LoginSMSCodeVo; |
| | | import com.dsh.account.model.LoginWeChatVo; |
| | | import com.dsh.account.model.query.appUserQuery.QueryAppUser; |
| | | import com.dsh.account.model.vo.DetailsListVo; |
| | | import com.dsh.account.model.vo.QueryAppUserVO; |
| | | import com.dsh.account.model.vo.classDetails.CourseVenue; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.ClassInfoVo; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | List<CourseVenue> queryWeekOfCourseDetails(Integer appUserId ,Integer stuId, String time, String longitude, String latitude); |
| | | |
| | | List<QueryAppUserVO> listAll(QueryAppUser query); |
| | | |
| | | Map<String,Object> weeksOfCourseDetailsList(Integer appUserId, Integer stuId, String time, Integer storeId,String lon,String lat); |
| | | |
| | | } |
| | |
| | | import com.dsh.account.model.*; |
| | | import com.dsh.account.model.dto.Coupon; |
| | | import com.dsh.account.model.query.appUserQuery.QueryAppUser; |
| | | import com.dsh.account.model.vo.DetailsListVo; |
| | | import com.dsh.account.model.vo.QueryAppUserVO; |
| | | import com.dsh.account.model.vo.classDetails.CourseVenue; |
| | | import com.dsh.account.model.vo.classDetails.ExerciseVideo; |
| | |
| | | public List<QueryAppUserVO> listAll(QueryAppUser query) { |
| | | return appUserMapper.listAll(query); |
| | | } |
| | | |
| | | @Override |
| | | public HashMap<String,Object> weeksOfCourseDetailsList(Integer appUserId, Integer stuId, String time, Integer storeId,String lon,String lat) { |
| | | // 门店id 查出所有课程 |
| | | HashMap<String, Object> map = paymentClient.weeksOfCourseDetailsList(new CourseDetailReq(appUserId, stuId, time, storeId,lon,lat)); |
| | | |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public ClassInfoVo queryUserOfStus(Integer id) { |
| | | TAppUser tAppUser = this.baseMapper.selectById(id); |
| | |
| | | import javax.annotation.PostConstruct; |
| | | import java.util.TimeZone; |
| | | |
| | | |
| | | /** |
| | | * @author jason |
| | | */ |
| | |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | ProductDetailsVo detailsVo = new ProductDetailsVo(); |
| | | PointsMerchandise merchandise = pmdsService.getById(detailRequest.getGoodId()); |
| | | detailsVo.setCardType(merchandise.getCardTye()); |
| | | detailsVo.setCardType(merchandise.getCardType()); |
| | | switch (detailRequest.getGoodsType()){ |
| | | case 2: |
| | | // 课包 |
| | |
| | | if (ToolUtil.isNotEmpty(byId)){ |
| | | PointsMerchandise pmdsServiceById = pmdsService.getById(byId.getPointsMerchandiseId()); |
| | | // 2.0 |
| | | detailsVo.setCardType(pmdsServiceById.getCardTye()); |
| | | detailsVo.setCardType(pmdsServiceById.getCardType()); |
| | | detailsVo.setExchangeType(pmdsServiceById.getRedemptionMethod()); |
| | | detailsVo.setGoodType(pmdsServiceById.getType()); |
| | | if (pmdsServiceById.getRedemptionMethod() == 1){ |
| | |
| | | */ |
| | | @TableField("shelves") |
| | | private Integer shelves; |
| | | @TableField("cardTye") |
| | | private Integer cardTye; |
| | | @TableField("cardType") |
| | | private Integer cardType; |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | |
| | | /** |
| | | * 场地责任险有效期 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date insuranceEndTime; |
| | | /** |
| | | * 场地责任险图片 |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/competition/paymentCompetitionCourseList") |
| | | @ApiOperation(value = "赛事报名--支付可用课时列表", tags = {"APP-赛事活动列表"}) |
| | |
| | | */ |
| | | @Override |
| | | public List<CompetitionListVo> queryCompetitionList(String cityCode, String content, Integer registerCondition, String heat) throws Exception { |
| | | return this.baseMapper.queryCompetitionList(cityCode, content, registerCondition, heat); |
| | | List<CompetitionListVo> competitionListVos = this.baseMapper.queryCompetitionList(cityCode, content, registerCondition, heat); |
| | | return competitionListVos; |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/course/queryCourseInfo") |
| | | @ApiOperation(value = "获取课程详情", tags = {"APP-课程列表"}) |
| | |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/course/paymentCourse") |
| | | @ApiOperation(value = "支付课程", tags = {"APP-课程列表"}) |
| | |
| | | Integer uid = tokenUtil.getUserIdFormRedis(); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | Long couponId = paymentCourseVo.getCouponId(); |
| | | if(couponId==null || couponId==0){ |
| | | paymentCourseVo.setCouponId(null); |
| | | } |
| | | return coursePackageService.paymentCourse(uid, paymentCourseVo); |
| | | }catch (Exception e){ |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 购买课程微信支付回调 |
| | |
| | | import com.dsh.course.feignclient.model.*; |
| | | import com.dsh.course.feignclient.other.StoreClient; |
| | | import com.dsh.course.feignclient.other.model.Store; |
| | | import com.dsh.course.model.BaseVo; |
| | | import com.dsh.course.model.QueryRegistrationRecord; |
| | | import com.dsh.course.model.QueryWalkInStudentList; |
| | | import com.dsh.course.model.BillingRequest; |
| | | import com.dsh.course.model.BillingRequestVo; |
| | | import com.dsh.course.model.*; |
| | | import com.dsh.course.model.dto.DiscountJsonDto; |
| | | import com.dsh.course.model.vo.CourseDetailRequest; |
| | | import com.dsh.course.model.vo.RegisterCourseVo; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Api |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | }) |
| | | public ResultUtil<?> payCourse(@RequestBody PayCourseReq req){ |
| | | public ResultUtil<?> payCourse(PayCourseReq req){ |
| | | try { |
| | | Integer appUserId = tokenUtil.getUserIdFormRedis(); |
| | | if(null == appUserId){ |
| | |
| | | if (ToolUtil.isEmpty(packagePayment)){ |
| | | return ResultUtil.error("该用户未购买该课包"); |
| | | } |
| | | CoursePackageStudent coursePackageStudent = cspsService.getOne(new LambdaQueryWrapper<CoursePackageStudent>() |
| | | List<CoursePackageStudent> coursePackageStudent = cspsService.list(new LambdaQueryWrapper<CoursePackageStudent>() |
| | | .eq(CoursePackageStudent::getCoursePackageId,packagePayment.getCoursePackageId()) |
| | | .eq(CoursePackageStudent::getCoursePackagePaymentId,courseID) |
| | | .eq(CoursePackageStudent::getStudentId,stuId) |
| | | .eq(CoursePackageStudent::getAppUserId,appUserId) |
| | | ); |
| | | |
| | | if (ToolUtil.isNotEmpty(coursePackageStudent) && coursePackageStudent.getReservationStatus() == 0){ |
| | | coursePackageStudent.setSignInOrNot(2); |
| | | coursePackageStudent.setInsertTime(simpleDateFormat.parse(time)); |
| | | cspsService.updateById(coursePackageStudent); |
| | | if (ToolUtil.isNotEmpty(coursePackageStudent)){ |
| | | for (CoursePackageStudent packageStudent : coursePackageStudent) { |
| | | if(packageStudent.getReservationStatus()==0){ |
| | | packageStudent.setSignInOrNot(2); |
| | | packageStudent.setInsertTime(simpleDateFormat.parse(time)); |
| | | cspsService.updateById(packageStudent); |
| | | } |
| | | } |
| | | |
| | | }else { |
| | | coursePackageStudent = new CoursePackageStudent(); |
| | | coursePackageStudent.setAppUserId(appUserId); |
| | | coursePackageStudent.setStudentId(stuId); |
| | | coursePackageStudent.setCoursePackageId(packagePayment.getCoursePackageId()); |
| | | coursePackageStudent.setCoursePackagePaymentId(Long.parseLong(courseID)); |
| | | coursePackageStudent.setSignInOrNot(2); |
| | | coursePackageStudent.setInsertTime(simpleDateFormat.parse(time)); |
| | | cspsService.save(coursePackageStudent); |
| | | } |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/coursePack/weeksOfCourseDetailsList") |
| | | HashMap<String, Object> weeksOfCourseDetailsList(@RequestBody CourseDetailReq courseDetailReq){ |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | ArrayList<DetailsListVo> objects = new ArrayList<>(); |
| | | try { |
| | | String time = courseDetailReq.getTime(); |
| | | Date parse = new SimpleDateFormat("yyyy-MM-dd").parse(time); |
| | | int i = cn.hutool.core.date.DateUtil.dayOfWeek(parse)-1; |
| | | String week = week(i); |
| | | Store store = sreClient.queryStoreById(courseDetailReq.getStoreId()); |
| | | String lat = store.getLat(); |
| | | String lon = store.getLon(); |
| | | |
| | | Map<String, Double> distance = GeodesyUtil.getDistance(courseDetailReq.getLon() + "," + courseDetailReq.getLat(), lon + "," + lat); |
| | | double wgs84 = distance.get("WGS84") / 1000; |
| | | map.put("distance",wgs84); |
| | | map.put("name",store.getName()); |
| | | map.put("lon",lon); |
| | | map.put("lat",lat); |
| | | |
| | | // 找出门店的所有课程 排出体验 |
| | | List<TCoursePackage> list = tcpService.list(new LambdaQueryWrapper<TCoursePackage>().eq(TCoursePackage::getStoreId, courseDetailReq.getStoreId()).ne(TCoursePackage::getType, 3).like(TCoursePackage::getClassWeeks,week)); |
| | | List<Integer> collect = list.stream().map(TCoursePackage::getId).collect(Collectors.toList()); |
| | | if(collect.size()==0){ |
| | | collect.add(-1); |
| | | } |
| | | // 找出购买的课包 |
| | | List<TCoursePackagePayment> list1 = packagePaymentService.list(new LambdaQueryWrapper<TCoursePackagePayment>().eq(TCoursePackagePayment::getAppUserId, courseDetailReq.getAppUserId()).eq(TCoursePackagePayment::getStudentId, courseDetailReq.getStuId()).in(TCoursePackagePayment::getCoursePackageId, collect)); |
| | | List<Integer> collect1 = list1.stream().map(TCoursePackagePayment::getCoursePackageId).collect(Collectors.toList()); |
| | | for (TCoursePackage tCoursePackage : list) { |
| | | DetailsListVo detailsListVo = new DetailsListVo(); |
| | | detailsListVo.setId(tCoursePackage.getId()); |
| | | detailsListVo.setName(tCoursePackage.getName()); |
| | | String classStartTime = tCoursePackage.getClassStartTime(); |
| | | String[] split = classStartTime.split(","); |
| | | String classEndTime = tCoursePackage.getClassEndTime(); |
| | | String[] split1 = classEndTime.split(","); |
| | | ArrayList<String> strings = new ArrayList<>(); |
| | | for (int i1 = 0; i1 < split.length; i1++) { |
| | | String s = split[i1] + "-" + split1[i1]; |
| | | strings.add(s); |
| | | } |
| | | detailsListVo.setTime(strings); |
| | | List<CoursePackagePaymentConfig> list2 = icppcService.list(new LambdaQueryWrapper<CoursePackagePaymentConfig>().eq(CoursePackagePaymentConfig::getCoursePackageId, tCoursePackage.getId()).orderByAsc(CoursePackagePaymentConfig::getCashPayment)); |
| | | if (list2.size() > 0) { |
| | | Double cashPayment = list2.get(0).getCashPayment(); |
| | | detailsListVo.setMoney(cashPayment); |
| | | } |
| | | detailsListVo.setNum(tCoursePackage.getNeedNum()); |
| | | if (collect1.contains(tCoursePackage.getId())) { |
| | | detailsListVo.setType(1); |
| | | } else { |
| | | detailsListVo.setType(2); |
| | | } |
| | | objects.add(detailsListVo); |
| | | } |
| | | map.put("data",objects); |
| | | |
| | | return map; |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | private String week(int i){ |
| | | String a = ""; |
| | | switch (i){ |
| | | case 1: |
| | | a="周一"; |
| | | break; |
| | | case 2: |
| | | a="周二"; |
| | | break; |
| | | case 3: |
| | | a="周三"; |
| | | break; |
| | | case 4: |
| | | a="周四"; |
| | | break; |
| | | case 5: |
| | | a="周五"; |
| | | break; |
| | | case 6: |
| | | a="周六"; |
| | | break; |
| | | case 7: |
| | | a="周日"; |
| | | break; |
| | | } |
| | | return a; |
| | | } |
| | | |
| | | } |
| | |
| | | private Integer type; |
| | | @TableField("needNum") |
| | | private Integer needNum; |
| | | |
| | | @TableField("startTime") |
| | | @JsonFormat(pattern = "yyyy.MM.dd", timezone = "GMT+8") |
| | | private Date startTime; |
| | | @TableField("endTime") |
| | | @JsonFormat(pattern = "yyyy.MM.dd", timezone = "GMT+8") |
| | | private Date endTime; |
| | | } |
| | |
| | | /** |
| | | * 退课课时 |
| | | */ |
| | | @TableField("dropoutsNumber") |
| | | @TableField(exist = false) |
| | | private Integer dropoutsNumber; |
| | | /** |
| | | * 支付用户类型(1=用户,2=管理员) |
New file |
| | |
| | | package com.dsh.course.model; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class CourseDetailReq { |
| | | private Integer appUserId; |
| | | private Integer stuId; |
| | | private String time; |
| | | private Integer storeId; |
| | | private String lon; |
| | | private String lat; |
| | | } |
| | |
| | | private StudentVo student; |
| | | @ApiModelProperty("1常规 2假期 3体验") |
| | | private Integer type; |
| | | @ApiModelProperty("假期有效期") |
| | | private String time; |
| | | } |
New file |
| | |
| | | package com.dsh.course.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class DetailsListVo { |
| | | private Integer id; |
| | | |
| | | |
| | | private String name; |
| | | |
| | | private String intro; |
| | | |
| | | private Integer type; |
| | | |
| | | private List<String> time; |
| | | |
| | | private Integer num; |
| | | |
| | | private Double money; |
| | | } |
| | |
| | | private String week; |
| | | @ApiModelProperty(value = "课包时间段") |
| | | private List<String> time; |
| | | |
| | | @ApiModelProperty(value = "上课日期") |
| | | private List<String> day; |
| | | |
| | | } |
| | |
| | | |
| | | Integer payType = tCoursePackagePayment.getPayType(); |
| | | BigDecimal cashPayment = tCoursePackagePayment.getCashPayment(); |
| | | double cashPaymentValue = cashPayment.doubleValue(); |
| | | double cashPaymentValue = 0.0; |
| | | if(cashPayment!=null){ |
| | | |
| | | cashPaymentValue = cashPayment.doubleValue(); |
| | | } |
| | | Integer playPaiCoin = tCoursePackagePayment.getPlayPaiCoin(); |
| | | TCoursePackageDiscount coursePackageDiscount = tcpdMapper.selectOne(new QueryWrapper<TCoursePackageDiscount>() |
| | | .eq("coursePackageId",coursePackage.getId() ) |
| | | .eq("type",1) |
| | | .eq("auditStatus",2)); |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | String content = coursePackageDiscount.getContent(); |
| | | double discountMember = 0.0; |
| | | DiscountJsonDto discountJsonDto = null; |
| | | try { |
| | | discountJsonDto = objectMapper.readValue(content, DiscountJsonDto.class); |
| | | discountMember = discountJsonDto.getDiscountMember(); |
| | | } catch (JsonProcessingException e) { |
| | | throw new RuntimeException(e); |
| | | if(coursePackageDiscount!=null){ |
| | | String content = coursePackageDiscount.getContent(); |
| | | DiscountJsonDto discountJsonDto = null; |
| | | try { |
| | | discountJsonDto = objectMapper.readValue(content, DiscountJsonDto.class); |
| | | discountMember = discountJsonDto.getDiscountMember(); |
| | | } catch (JsonProcessingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | switch (payType) { |
| | | case 1: |
| | | case 2: |
| | |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy.MM.dd HH:mm"); |
| | | if (tCoursePackagePayments.size() > 0 ){ |
| | | for (TCoursePackagePayment tCoursePackagePayment : tCoursePackagePayments) { |
| | | RecordAppoint recordVo = new RecordAppoint(); |
| | | recordVo.setCoursePackageId(tCoursePackagePayment.getCoursePackageId()); |
| | | |
| | | TCoursePackage coursePackage = tcpmapper.selectById(tCoursePackagePayment.getCoursePackageId()); |
| | | |
| | | recordVo.setCoursePackageName(coursePackage.getName()); |
| | | recordVo.setCourseHours(tCoursePackagePayment.getClassHours()); |
| | | Date date = DateUtil.getDate(); |
| | | |
| | | String classStartTime = coursePackage.getClassStartTime(); |
| | | String classEndTime = coursePackage.getClassEndTime(); |
| | | recordVo.setTimeFrame(simpleDateFormat.format(date)+" "+classStartTime+"-"+classEndTime); |
| | | Store store = stoClient.queryStoreById(coursePackage.getStoreId()); |
| | | recordVo.setStoreNameAddr(store.getName()+store.getAddress()); |
| | | CoursePackageStudent coursePackageStudent = cpsMapper.selectOne(new QueryWrapper<CoursePackageStudent>() |
| | | List<CoursePackageStudent> coursePackageStudent1 = cpsMapper.selectList(new QueryWrapper<CoursePackageStudent>() |
| | | .eq("coursePackageId",tCoursePackagePayment.getCoursePackageId() ) |
| | | .eq("studentId",stuId) |
| | | .eq("appUserId",appUserId) |
| | | .eq("reservationStatus",1)); |
| | | if (ToolUtil.isNotEmpty(coursePackageStudent) && coursePackageStudent.getReservationStatus() == 1){ |
| | | if (ToolUtil.isNotEmpty(coursePackageStudent1) && coursePackageStudent1.size() > 0){ |
| | | for (CoursePackageStudent coursePackageStudent : coursePackageStudent1) { |
| | | RecordAppoint recordVo = new RecordAppoint(); |
| | | recordVo.setCoursePackageId(tCoursePackagePayment.getCoursePackageId()); |
| | | |
| | | recordVo.setCourseStuRecordId(coursePackageStudent.getId()); |
| | | String classWeeks = coursePackage.getClassWeeks(); |
| | | String[] split = classWeeks.split(";"); |
| | | List<String> integerList = Arrays.asList(split); |
| | | String weekOfDate = DateTimeHelper.getWeekOfDate(new Date()); |
| | | if (integerList.contains(weekOfDate)){ |
| | | String dat = simpleDateFormat.format(date) +" "+ classStartTime; |
| | | TCoursePackage coursePackage = tcpmapper.selectById(tCoursePackagePayment.getCoursePackageId()); |
| | | |
| | | Date start = null; |
| | | try { |
| | | start = format.parse(dat); |
| | | } catch (ParseException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | if (start.after(new Date())){ |
| | | recordVo.setStatus(1); |
| | | }else if(coursePackageStudent.getSignInOrNot()==2){ |
| | | recordVo.setStatus(5); |
| | | }else { |
| | | CancelledClasses cancelledClasses = cacMapper.selectOne(new QueryWrapper<CancelledClasses>() |
| | | .eq("coursePackageId",tCoursePackagePayment.getCoursePackageId() )); |
| | | if (ToolUtil.isNotEmpty(cancelledClasses)){ |
| | | recordVo.setStatus(3); |
| | | // 消课 到课状态0 旷课 |
| | | if(coursePackageStudent.getSignInOrNot()==0){ |
| | | recordVo.setStatus(6); |
| | | } |
| | | recordVo.setCoursePackageName(coursePackage.getName()); |
| | | recordVo.setCourseHours(tCoursePackagePayment.getClassHours()); |
| | | Date date = DateUtil.getDate(); |
| | | |
| | | }else { |
| | | recordVo.setStatus(2); |
| | | String classStartTime = coursePackage.getClassStartTime(); |
| | | String classEndTime = coursePackage.getClassEndTime(); |
| | | recordVo.setTimeFrame(simpleDateFormat.format(date)+" "+classStartTime+"-"+classEndTime); |
| | | Store store = stoClient.queryStoreById(coursePackage.getStoreId()); |
| | | recordVo.setStoreNameAddr(store.getName()+store.getAddress()); |
| | | recordVo.setCourseStuRecordId(coursePackageStudent.getId()); |
| | | String classWeeks = coursePackage.getClassWeeks(); |
| | | String[] split = classWeeks.split(";"); |
| | | List<String> integerList = Arrays.asList(split); |
| | | String weekOfDate = DateTimeHelper.getWeekOfDate(new Date()); |
| | | if (integerList.contains(weekOfDate)){ |
| | | String dat = simpleDateFormat.format(date) +" "+ classStartTime; |
| | | |
| | | Date start = null; |
| | | try { |
| | | start = format.parse(dat); |
| | | } catch (ParseException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | if (start.after(new Date())){ |
| | | recordVo.setStatus(1); |
| | | }else if(coursePackageStudent.getSignInOrNot()==2){ |
| | | recordVo.setStatus(5); |
| | | }else { |
| | | CancelledClasses cancelledClasses = cacMapper.selectOne(new QueryWrapper<CancelledClasses>() |
| | | .eq("coursePackageId",tCoursePackagePayment.getCoursePackageId() )); |
| | | if (ToolUtil.isNotEmpty(cancelledClasses)){ |
| | | recordVo.setStatus(3); |
| | | // 消课 到课状态0 旷课 |
| | | if(coursePackageStudent.getSignInOrNot()==0){ |
| | | recordVo.setStatus(6); |
| | | } |
| | | |
| | | }else { |
| | | recordVo.setStatus(2); |
| | | } |
| | | } |
| | | }else { |
| | | recordVo.setStatus(1); |
| | | } |
| | | }else { |
| | | recordVo.setStatus(1); |
| | | recordVoList.add(recordVo); |
| | | } |
| | | |
| | | }else { |
| | | recordVo.setStatus(4); |
| | | // recordVo.setStatus(4); |
| | | } |
| | | recordVoList.add(recordVo); |
| | | |
| | | } |
| | | } |
| | | return recordVoList; |
| | |
| | | strings.add(s); |
| | | } |
| | | payCourseInfoReq.setTime(strings); |
| | | List<Integer> week = week(tCoursePackage.getClassWeeks()); |
| | | |
| | | // 今天周几 |
| | | int i = cn.hutool.core.date.DateUtil.dayOfWeek(new Date())-1; |
| | | |
| | | SimpleDateFormat format = new SimpleDateFormat("MM.dd"); |
| | | ArrayList<String> strings1 = new ArrayList<>(); |
| | | |
| | | for (Integer integer : week) { |
| | | if(integer<i){ |
| | | // 找下一周的时间 |
| | | Calendar instance = Calendar.getInstance(); |
| | | instance.add(Calendar.DATE,7-(i-integer)); |
| | | Date time = instance.getTime(); |
| | | strings1.add(format.format(time)); |
| | | |
| | | }else if(integer>i) { |
| | | Calendar instance = Calendar.getInstance(); |
| | | instance.add(Calendar.DATE,integer-i); |
| | | Date time = instance.getTime(); |
| | | strings1.add(format.format(time)); |
| | | }else { |
| | | Calendar instance = Calendar.getInstance(); |
| | | instance.add(Calendar.DATE,7); |
| | | Date time = instance.getTime(); |
| | | strings1.add(format.format(time)); |
| | | } |
| | | } |
| | | payCourseInfoReq.setDay(strings1); |
| | | return payCourseInfoReq; |
| | | } |
| | | private static List<Integer> week(String week){ |
| | | String[] split = week.split(";"); |
| | | ArrayList<Integer> integers = new ArrayList<>(); |
| | | for (String s : split) { |
| | | switch (s){ |
| | | case "周一": |
| | | integers.add(1); |
| | | break; |
| | | case "周二": |
| | | integers.add(2); |
| | | break; |
| | | case "周三": |
| | | integers.add(3); |
| | | break; |
| | | case "周四": |
| | | integers.add(4); |
| | | break; |
| | | case "周五": |
| | | integers.add(5); |
| | | break; |
| | | case "周六": |
| | | integers.add(6); |
| | | break; |
| | | case "周日": |
| | | integers.add(7); |
| | | break; |
| | | } |
| | | } |
| | | return integers; |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | List<Integer> week = week("周一,周二"); |
| | | // 今天周几 |
| | | int i = cn.hutool.core.date.DateUtil.dayOfWeek(new Date())-1; |
| | | |
| | | SimpleDateFormat format = new SimpleDateFormat("MM.dd"); |
| | | |
| | | ArrayList<String> strings = new ArrayList<>(); |
| | | for (Integer integer : week) { |
| | | if(integer<i){ |
| | | // 找下一周的时间 |
| | | Calendar instance = Calendar.getInstance(); |
| | | instance.add(Calendar.DATE,7-(i-integer)); |
| | | Date time = instance.getTime(); |
| | | strings.add(format.format(time)); |
| | | |
| | | }else if(integer>i) { |
| | | Calendar instance = Calendar.getInstance(); |
| | | instance.add(Calendar.DATE,integer-i); |
| | | Date time = instance.getTime(); |
| | | strings.add(format.format(time)); |
| | | }else { |
| | | Calendar instance = Calendar.getInstance(); |
| | | instance.add(Calendar.DATE,7); |
| | | Date time = instance.getTime(); |
| | | strings.add(format.format(time)); |
| | | } |
| | | } |
| | | System.out.println(strings); |
| | | } |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRES_NEW) |
| | | public ResultUtil payCourse(PayCourseReq req,Integer userId){ |
| | |
| | | for (String s : time) { |
| | | for (int i = 0; i < split.length; i++) { |
| | | CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); |
| | | coursePackageScheduling.setCourseId(tCoursePackage.getId()); |
| | | coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); |
| | | try { |
| | | Date parse = format.parse(s + " " + split[i]); |
| | | Date parse1 = format.parse(s + " " + split1[i]); |
| | |
| | | package com.dsh.course.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.nacos.common.utils.UuidUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import com.dsh.course.model.*; |
| | | import com.dsh.course.service.*; |
| | | import com.dsh.course.util.*; |
| | | import com.dsh.course.util.httpClinet.HttpResult; |
| | | import org.omg.CORBA.INTERNAL; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | TCoursePackage coursePackage = this.getById(id); |
| | | CoursePackageInfo coursePackageInfo = new CoursePackageInfo(); |
| | | coursePackageInfo.setId(id); |
| | | coursePackageInfo.setTime(coursePackage.getStartTime()+"-"+coursePackage.getEndTime()); |
| | | coursePackageInfo.setCoverDrawing(coursePackage.getCoverDrawing()); |
| | | coursePackageInfo.setName(coursePackage.getName()); |
| | | Store store = storeClient.queryStoreById(coursePackage.getStoreId()); |
| | |
| | | for (int i1 = 0; i1 < split.length; i1++) { |
| | | |
| | | CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); |
| | | coursePackageScheduling.setCourseId(tCoursePackage.getId()); |
| | | coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); |
| | | try { |
| | | Date parse = format1.parse(format.format(time) + " " + split[i1]); |
| | | Date parse1 = format1.parse(format.format(time) + " " + split1[i1]); |
| | |
| | | |
| | | for (int i1 = 0; i1 < split.length; i1++) { |
| | | CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); |
| | | coursePackageScheduling.setCourseId(tCoursePackage.getId()); |
| | | coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); |
| | | try { |
| | | Date parse = format1.parse(format.format(time) + " " + split[i1]); |
| | | Date parse1 = format1.parse(format.format(time) + " " + split1[i1]); |
| | |
| | | |
| | | for (int i1 = 0; i1 < split.length; i1++) { |
| | | CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); |
| | | coursePackageScheduling.setCourseId(tCoursePackage.getId()); |
| | | coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); |
| | | try { |
| | | Date parse = format1.parse(format.format(time) + " " + split[i1]); |
| | | Date parse1 = format1.parse(format.format(time) + " " + split1[i1]); |
| | | coursePackageScheduling.setClassDate(parse); |
| | | coursePackageScheduling.setEndDate(parse1); |
| | | coursePackageScheduling.setStatus(1); |
| | | coursePackageScheduling.setCourseId(tCoursePackage.getId()); |
| | | coursePackageScheduling.setIntegral(0); |
| | | coursePackageScheduling.setCancelClasses(""); |
| | | coursePackageScheduling.setDeductClassHour(0); |
| | | coursePackageSchedulingService.save(coursePackageScheduling); |
| | | |
| | | CoursePackageStudent student1 = new CoursePackageStudent(); |
| | |
| | | |
| | | private String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmu8n/4yTHWbn7VOrNc9OsLtDL1bEQ8gC1dHkj8Wy5z0mkaOsjJRIG/28ze12M0V8jdCKuuDr5Z1OPKiqf+XO3ypguEh+mYUVMBM/cZodDFQfTY1TKLWjvQCuaqlA+QUTCK6f7T7stsgyQ1o9Jj0rXZDz6PM4QHSTzjrLIBaeqM5WIBvH+fy/X+QG5Utd+/UT0kc0JyvuKhZ65yVUd/C9VcwJJAPliRsAQNrqYterwAJ9zvw9tF11wj9W0XgJ8Ccu4x3gR1vrlLRJJo/OA97RmxPQ+5hSacWQZCUd1dwiBq+YCrKVHGTj14izRHXrLc0yBlRXo7tBOIqcy3IsvKVthQIDAQAB";//支付宝支付公钥 |
| | | |
| | | private String appid = "";//微信appid |
| | | private String appid = "wx82f853a410b0c7c0";//微信appid |
| | | |
| | | private String appletsAppid = "";//微信小程序appid |
| | | |
| | | private String mchId = "";//微信商户号 |
| | | private String mchId = "1501481761";//微信商户号 |
| | | |
| | | private String key = "";//微信商户号 |
| | | private String key = "6f5e0c2dcabfa9c27b5da5836a362fef";//微信商户号 |
| | | |
| | | private String callbackPath = "";//支付回调网关地址 |
| | | |
| | |
| | | @Param("page") Page<Map<String, Object>> page); |
| | | |
| | | |
| | | List<Map<String, Object>> listOne(@Param("page") Page<Map<String, Object>> page, @Param("id") Integer id); |
| | | |
| | | List<Map<String, Object>> typeChange(@Param("name") String name); |
| | | |
| | | List<Map<String, Object>> typeChangeOne(@Param("id") Integer id); |
| | | |
| | | |
| | | String getConfig(@Param("page") Integer page); |
| | | |
| | | void addConfigOne(@Param("url") String url, @Param("name") String name, @Param("s") String s, @Param("s1") String s1, @Param("turnId") String turnId, @Param("sort") Integer sort,@Param("page") Integer page,@Param("type") Integer type); |
| | | |
| | | List<Map<String, Object>> listTwo(@Param("page") Page<Map<String, Object>> page); |
| | | |
| | | void delete1(@Param("id") Integer id); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.mapper; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.guns.modular.system.model.TOperator; |
| | | |
| | | /** |
| | | * <p> |
| | | * 运营商 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-20 |
| | | */ |
| | | public interface TOperatorMapper extends BaseMapper<TOperator> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.mapper; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.guns.modular.system.model.TStoreOtherConfig; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-19 |
| | | */ |
| | | public interface TStoreOtherConfigMapper extends BaseMapper<TStoreOtherConfig> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.mapper; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.guns.modular.system.model.TStoreOtherConfigTrue; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-19 |
| | | */ |
| | | public interface TStoreOtherConfigTrueMapper extends BaseMapper<TStoreOtherConfigTrue> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.mapper; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.guns.modular.system.model.TStoreOther; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-19 |
| | | */ |
| | | public interface TStoreOtherMapper extends BaseMapper<TStoreOther> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.mapper; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.guns.modular.system.model.TTurn; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-19 |
| | | */ |
| | | public interface TTurnMapper extends BaseMapper<TTurn> { |
| | | |
| | | } |
| | |
| | | public Object onChange(Integer oneId) { |
| | | if (oneId == null) return null; |
| | | try { |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getId, oneId)); |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, oneId)); |
| | | QueryWrapper<TCity> query = new QueryWrapper<TCity>().eq("parent_id", one.getId()); |
| | | return cityService.list(query); |
| | | }catch (Exception e){ |
| | |
| | | package com.dsh.guns.modular.system.controller.code; |
| | | |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.account.CityClient; |
| | |
| | | import com.dsh.guns.core.common.constant.factory.PageFactory; |
| | | import com.dsh.guns.core.util.ToolUtil; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import com.dsh.guns.modular.system.service.ICityService; |
| | | import com.dsh.guns.modular.system.service.IStoreService; |
| | | import com.dsh.guns.modular.system.service.StoreConfigService; |
| | | import com.dsh.guns.modular.system.service.*; |
| | | import com.dsh.guns.modular.system.util.GaoDeMapUtil; |
| | | import io.swagger.models.auth.In; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 车辆管理控制器 |
| | |
| | | @Resource |
| | | private StoreConfigService storeConfigService; |
| | | |
| | | @Autowired |
| | | private TStoreOtherConfigTrueService tStoreOtherConfigTrueService; |
| | | |
| | | @Autowired |
| | | private TStoreOtherConfigService storeOtherConfigService; |
| | | |
| | | @Autowired |
| | | private TTurnService tTurnService; |
| | | |
| | | @Autowired |
| | | private TStoreOtherService storeOtherService; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 跳转到车辆管理首页 |
| | |
| | | String roleid = UserExt.getUser().getRoleid(); |
| | | model.addAttribute("role",roleid); |
| | | return PREFIX + "tShop_add.html"; |
| | | } |
| | | @RequestMapping("/tShop_add_one") |
| | | public String tCompetitionAddOne(Integer id,Model model) { |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | String roleid = UserExt.getUser().getRoleid(); |
| | | model.addAttribute("id",id); |
| | | |
| | | return PREFIX + "tShop_add_one.html"; |
| | | } |
| | | @RequestMapping("/tShop_add_two") |
| | | public String tCompetitionAddTwo(Model model) { |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | String roleid = UserExt.getUser().getRoleid(); |
| | | return PREFIX + "tShop_add_two.html"; |
| | | } |
| | | |
| | | |
| | |
| | | model.addAttribute("type",1); |
| | | return PREFIX + "tShop_edit.html"; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequestMapping("/tShop_update_one/{id}") |
| | | public String tCityUpdateOne(@PathVariable Integer id, Model model) { |
| | | TStoreOtherConfig byId = storeOtherConfigService.getById(id); |
| | | TTurn one = tTurnService.getOne(new LambdaQueryWrapper<TTurn>().eq(TTurn::getName, byId.getName())); |
| | | // page list |
| | | List<TTurn> list = tTurnService.list(new LambdaQueryWrapper<TTurn>().eq(TTurn::getPid, one.getId())); |
| | | // type list |
| | | List<TTurn> list1 = tTurnService.list(new LambdaQueryWrapper<TTurn>().eq(TTurn::getPid, byId.getPageId())); |
| | | model.addAttribute("item",byId); |
| | | model.addAttribute("list",list); |
| | | model.addAttribute("list1",list1); |
| | | |
| | | return PREFIX + "tShop_edit_two.html"; |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping("/tShop_info/{id}") |
| | | public String tCityInfo(@PathVariable Integer id, Model model) { |
| | | TStore byId = storeService.getById(id); |
| | |
| | | public Object list(String provinceCode, String cityCode , String name, String phone,String shopName) { |
| | | Page<TStoreListVo> page = new PageFactory<TStoreListVo>().defaultPage(); |
| | | List<TStoreListVo> list = storeService.listAll(page,provinceCode,cityCode,name,phone,shopName); |
| | | for (TStoreListVo tStoreListVo : list) { |
| | | TCityManager byId = cityClient.getById(tStoreListVo.getCityManagerId()); |
| | | tStoreListVo.setAccount(byId.getName()+"-"+byId.getPhone()); |
| | | |
| | | } |
| | | page.setRecords(list); |
| | | return super.packForBT(page); |
| | | } |
| | | @RequestMapping(value = "/listOne") |
| | | @ResponseBody |
| | | public Object listOne(Integer id) { |
| | | Page<Map<String,Object>> page = new PageFactory<Map<String,Object>>().defaultPage(); |
| | | List<Map<String,Object>> list = storeService.listOne(page,id); |
| | | page.setRecords(list); |
| | | return super.packForBT(page); |
| | | } |
| | | @RequestMapping(value = "/listTwo") |
| | | @ResponseBody |
| | | public Object listTwo() { |
| | | Page<Map<String,Object>> page = new PageFactory<Map<String,Object>>().defaultPage(); |
| | | List<Map<String,Object>> list = storeService.listTwo(page); |
| | | page.setRecords(list); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object list(TStore tStore,String time,String userName,String userPhone) { |
| | | public Object list(TStore tStore,String time,String userName,String userPhone,String ids,Integer type,Integer yyId,String lat,String lon) { |
| | | try { |
| | | if(ToolUtil.isNotEmpty(tStore.getProvinceCode())) { |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, tStore.getProvinceCode())); |
| | |
| | | } |
| | | tStore.setStartTime(time.split(" - ")[0]); |
| | | tStore.setEndTime(time.split(" - ")[1]); |
| | | tStore.setIds(ids); |
| | | tStore.setType(type); |
| | | tStore.setOperatorId(yyId); |
| | | tStore.setState(1); |
| | | User user = new User(); |
| | | List<User> users = userMapper.selectList(new LambdaQueryWrapper<User>().eq(User::getAccount, userPhone)); |
| | |
| | | user.setPassword(SecureUtil.md5("a123456")); |
| | | userMapper.insert(user); |
| | | tStore.setStoreStaffId(user.getId()); |
| | | tStore.setLon(lon); |
| | | tStore.setLat(lat); |
| | | |
| | | storeService.save(tStore); |
| | | |
| | | ArrayList<StoreConfig> storeConfigs = new ArrayList<>(); |
| | |
| | | |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TStore tStore,String time,String userName,String userPhone) { |
| | | public Object update(TStore tStore,String time,String userName,String userPhone,String ids,Integer type,Integer yyId) { |
| | | try { |
| | | TStore byId = storeService.getById(tStore.getId()); |
| | | |
| | |
| | | } |
| | | tStore.setStartTime(time.split(" - ")[0]); |
| | | tStore.setEndTime(time.split(" - ")[1]); |
| | | tStore.setIds(ids); |
| | | tStore.setType(type); |
| | | tStore.setOperatorId(yyId); |
| | | if(ToolUtil.isEmpty(tStore.getCoverDrawing())){ |
| | | tStore.setCoverDrawing(byId.getCoverDrawing()); |
| | | } |
| | |
| | | return ERROR; |
| | | } |
| | | } |
| | | @ResponseBody |
| | | @RequestMapping(value = "/deleteOne") |
| | | public Object delete1(Integer id) { |
| | | try { |
| | | storeService.delete1(id); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/saveImg") |
| | | @ResponseBody |
| | |
| | | return ERROR; |
| | | } |
| | | } |
| | | @RequestMapping(value = "/typeChange") |
| | | @ResponseBody |
| | | public Object typeChange(String name) { |
| | | try { |
| | | List<Map<String,Object>> list = storeService.typeChange(name); |
| | | return list; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | @RequestMapping(value = "/typeChangeOne") |
| | | @ResponseBody |
| | | public Object typeChangeOne(Integer id) { |
| | | try { |
| | | List<Map<String,Object>> list = storeService.typeChangeOne(id); |
| | | return list; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ajax.set("url",url); |
| | | * ajax.set("name",name); |
| | | * ajax.set("page",page); |
| | | * ajax.set("type",type); |
| | | * ajax.set("turnId",turnId); |
| | | * ajax.set("sort",sort); |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/addConfigOne") |
| | | @ResponseBody |
| | | public Object addConfigOne(String url,String name,Integer page,Integer type,String turnId,Integer sort) { |
| | | try { |
| | | storeService.addConfigOne(url,name,page,type,turnId,sort); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | @RequestMapping(value = "/addConfig") |
| | | @ResponseBody |
| | | public Object addConfig(String name,Integer id) { |
| | | try { |
| | | List<TStoreOtherConfig> list = storeOtherConfigService.list(); |
| | | if(list.size()>0){ |
| | | TStoreOther tStoreOther = new TStoreOther(); |
| | | tStoreOther.setName(name); |
| | | tStoreOther.setStoreId(id); |
| | | storeOtherService.save(tStoreOther); |
| | | |
| | | // 找出temp表数据 |
| | | |
| | | ArrayList<TStoreOtherConfigTrue> tStoreOtherConfigTrues = new ArrayList<>(); |
| | | for (TStoreOtherConfig tStoreOtherConfig : list) { |
| | | TStoreOtherConfigTrue tStoreOtherConfigTrue = new TStoreOtherConfigTrue(); |
| | | BeanUtils.copyProperties(tStoreOtherConfig,tStoreOtherConfigTrue); |
| | | tStoreOtherConfigTrue.setPid(tStoreOther.getId()); |
| | | tStoreOtherConfigTrues.add(tStoreOtherConfigTrue); |
| | | } |
| | | tStoreOtherConfigTrueService.saveBatch(tStoreOtherConfigTrues); |
| | | storeOtherConfigService.remove(new LambdaQueryWrapper<TStoreOtherConfig>().gt(TStoreOtherConfig::getId,0)); |
| | | } |
| | | |
| | | |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | @RequestMapping(value = "/updateConfigOne") |
| | | @ResponseBody |
| | | public Object addConfigOne(String url,String name,Integer page,Integer type,String turnId,Integer sort,Integer id) { |
| | | try { |
| | | TStoreOtherConfig byId = storeOtherConfigService.getById(id); |
| | | if(ToolUtil.isNotEmpty(url)){ |
| | | byId.setUrl(url); |
| | | } |
| | | byId.setName(name); |
| | | TTurn byId1 = tTurnService.getById(page); |
| | | TTurn byId2 = tTurnService.getById(type); |
| | | byId.setPage(byId1.getName()); |
| | | byId.setType(byId2.getName()); |
| | | byId.setTurnId(turnId); |
| | | byId.setSort(sort); |
| | | byId.setPageId(page); |
| | | byId.setTypeId(type); |
| | | storeOtherConfigService.updateById(byId); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | return siteClient.listExipre(vo); |
| | | } |
| | | |
| | | @Autowired |
| | | private TOperatorService tOperatorService; |
| | | |
| | | /** |
| | | * 跳转到添加场地管理 |
| | | */ |
| | |
| | | }else if(objectType == 3){ |
| | | stores= storeClient.getStoreByStoreStaffId(objectId);; |
| | | } |
| | | List<TOperator> list = tOperatorService.list(); |
| | | model.addAttribute("yysList",list); |
| | | model.addAttribute("userType",objectType); |
| | | HashSet<String> set = new HashSet<String>(list1); |
| | | QueryWrapper<TSiteType> wrapper = new QueryWrapper<>(); |
New file |
| | |
| | | package com.dsh.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 运营商 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-20 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_operator") |
| | | public class TOperator extends Model<TOperator> { |
| | | |
| | | private static final long serialVersionUID=1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | private String name; |
| | | |
| | | @TableField("userId") |
| | | private Integer userId; |
| | | |
| | | /** |
| | | * 1 全国 2指定 |
| | | */ |
| | | private Integer type; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
| | |
| | | private String welfarePicture; |
| | | private BigDecimal score; |
| | | private Integer state; |
| | | |
| | | @TableField("operatorId") |
| | | private Integer operatorId; |
| | | @TableField("type") |
| | | private Integer type; |
| | | @TableField("ids") |
| | | private String ids; |
| | | } |
| | |
| | | |
| | | private String account; |
| | | |
| | | private Integer type; |
| | | |
| | | private String yysName; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-19 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_store_other") |
| | | public class TStoreOther extends Model<TStoreOther> { |
| | | |
| | | private static final long serialVersionUID=1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | private String name; |
| | | |
| | | @TableField("storeId") |
| | | private Integer storeId; |
| | | |
| | | private Integer sort; |
| | | |
| | | /** |
| | | * 1开启 2关闭 |
| | | */ |
| | | private Integer state; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-19 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_store_other_config") |
| | | public class TStoreOtherConfig extends Model<TStoreOtherConfig> { |
| | | |
| | | private static final long serialVersionUID=1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 图片 |
| | | */ |
| | | private String url; |
| | | |
| | | /** |
| | | * 跳转模块 |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * 跳转页面 |
| | | */ |
| | | private String page; |
| | | |
| | | /** |
| | | * 跳转类型 |
| | | */ |
| | | private String type; |
| | | |
| | | /** |
| | | * 跳转id |
| | | */ |
| | | @TableField("turnId") |
| | | private String turnId; |
| | | |
| | | /** |
| | | * 排序 |
| | | */ |
| | | private Integer sort; |
| | | |
| | | /** |
| | | * 1开启 2关闭 |
| | | */ |
| | | private Integer state; |
| | | |
| | | @TableField("pageId") |
| | | private Integer pageId; |
| | | |
| | | @TableField("typeId") |
| | | private Integer typeId; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-19 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_store_other_config_true") |
| | | public class TStoreOtherConfigTrue extends Model<TStoreOtherConfigTrue> { |
| | | |
| | | private static final long serialVersionUID=1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 图片 |
| | | */ |
| | | private String url; |
| | | |
| | | /** |
| | | * 跳转模块 |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * 跳转页面 |
| | | */ |
| | | private String page; |
| | | |
| | | /** |
| | | * 跳转类型 |
| | | */ |
| | | private String type; |
| | | |
| | | /** |
| | | * 跳转id |
| | | */ |
| | | @TableField("turnId") |
| | | private String turnId; |
| | | |
| | | /** |
| | | * 排序 |
| | | */ |
| | | private Integer sort; |
| | | |
| | | /** |
| | | * 1开启 2关闭 |
| | | */ |
| | | private Integer state; |
| | | |
| | | private Integer pid; |
| | | |
| | | @TableField("pageId") |
| | | private Integer pageId; |
| | | |
| | | @TableField("typeId") |
| | | private Integer typeId; |
| | | |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-19 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | public class TTurn extends Model<TTurn> { |
| | | |
| | | private static final long serialVersionUID=1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | private String name; |
| | | |
| | | private Integer pid; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | List<Map<String, Object>> queryListOfpage(String provinceCode, String cityCode, Integer cityManagerId, String storeName, Page<Map<String, Object>> page); |
| | | |
| | | List<Map<String, Object>> listOne(Page<Map<String, Object>> page, Integer id); |
| | | |
| | | |
| | | List<Map<String, Object>> typeChange(String name); |
| | | |
| | | List<Map<String, Object>> typeChangeOne(Integer id); |
| | | |
| | | void addConfigOne(String url, String name, Integer page,Integer type, String turnId, Integer sort); |
| | | |
| | | List<Map<String, Object>> listTwo(Page<Map<String, Object>> page); |
| | | |
| | | |
| | | void delete1(Integer id); |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.service; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.guns.modular.system.model.TOperator; |
| | | |
| | | /** |
| | | * <p> |
| | | * 运营商 服务类 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-20 |
| | | */ |
| | | public interface TOperatorService extends IService<TOperator> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.service; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.guns.modular.system.model.TStoreOtherConfig; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-19 |
| | | */ |
| | | public interface TStoreOtherConfigService extends IService<TStoreOtherConfig> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.guns.modular.system.model.TStoreOtherConfigTrue; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-19 |
| | | */ |
| | | public interface TStoreOtherConfigTrueService extends IService<TStoreOtherConfigTrue> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.service; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.guns.modular.system.model.TStoreOther; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-19 |
| | | */ |
| | | public interface TStoreOtherService extends IService<TStoreOther> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.guns.modular.system.model.TTurn; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-19 |
| | | */ |
| | | public interface TTurnService extends IService<TTurn> { |
| | | |
| | | } |
| | |
| | | public List<Map<String, Object>> queryListOfpage(String provinceCode, String cityCode, Integer cityManagerId, String storeName, Page<Map<String, Object>> page) { |
| | | return this.baseMapper.queryListOfpage(provinceCode,cityCode,cityManagerId,storeName,page); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> listOne(Page<Map<String, Object>> page, Integer id) { |
| | | return this.baseMapper.listOne(page,id); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> typeChange(String name) { |
| | | return this.baseMapper.typeChange(name); |
| | | } |
| | | @Override |
| | | public List<Map<String, Object>> typeChangeOne(Integer id) { |
| | | return this.baseMapper.typeChangeOne(id); |
| | | } |
| | | |
| | | @Override |
| | | public void addConfigOne(String url, String name, Integer page, Integer type,String turnId, Integer sort) { |
| | | String s = this.baseMapper.getConfig(page); |
| | | String s1 = this.baseMapper.getConfig(type); |
| | | this.baseMapper.addConfigOne(url,name,s,s1,turnId,sort,page,type); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> listTwo(Page<Map<String, Object>> page) { |
| | | return this.baseMapper.listTwo(page); |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void delete1(Integer id) { |
| | | this.baseMapper.delete1(id); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.mapper.TOperatorMapper; |
| | | import com.dsh.guns.modular.system.model.TOperator; |
| | | import com.dsh.guns.modular.system.service.TOperatorService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 运营商 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-20 |
| | | */ |
| | | @Service |
| | | public class TOperatorServiceImpl extends ServiceImpl<TOperatorMapper, TOperator> implements TOperatorService { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.mapper.TStoreOtherConfigMapper; |
| | | import com.dsh.guns.modular.system.model.TStoreOtherConfig; |
| | | import com.dsh.guns.modular.system.service.TStoreOtherConfigService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-19 |
| | | */ |
| | | @Service |
| | | public class TStoreOtherConfigServiceImpl extends ServiceImpl<TStoreOtherConfigMapper, TStoreOtherConfig> implements TStoreOtherConfigService { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.mapper.TStoreOtherConfigTrueMapper; |
| | | import com.dsh.guns.modular.system.model.TStoreOtherConfigTrue; |
| | | import com.dsh.guns.modular.system.service.TStoreOtherConfigTrueService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-19 |
| | | */ |
| | | @Service |
| | | public class TStoreOtherConfigTrueServiceImpl extends ServiceImpl<TStoreOtherConfigTrueMapper, TStoreOtherConfigTrue> implements TStoreOtherConfigTrueService { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.mapper.TStoreOtherMapper; |
| | | import com.dsh.guns.modular.system.model.TStoreOther; |
| | | import com.dsh.guns.modular.system.service.TStoreOtherService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-19 |
| | | */ |
| | | @Service |
| | | public class TStoreOtherServiceImpl extends ServiceImpl<TStoreOtherMapper, TStoreOther> implements TStoreOtherService { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.mapper.TTurnMapper; |
| | | import com.dsh.guns.modular.system.model.TTurn; |
| | | import com.dsh.guns.modular.system.service.TTurnService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-19 |
| | | */ |
| | | @Service |
| | | public class TTurnServiceImpl extends ServiceImpl<TTurnMapper, TTurn> implements TTurnService { |
| | | |
| | | } |
| | |
| | | CloseableHttpClient httpclient = HttpClients.createDefault(); |
| | | try { |
| | | // 拼接请求高德的url |
| | | HttpGet httpget = new HttpGet(address+"&sensor=false&key=AIzaSyCnvS7Xm3utDjc2fdd5Gvk5E1-bavcrzAA"); |
| | | HttpGet httpget = new HttpGet(address+"&sensor=false&key=77b37f0753049c4e712ea79a24e0719c"); |
| | | // 执行get请求. |
| | | CloseableHttpResponse response = httpclient.execute(httpget); |
| | | |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dsh.course.mapper.TOperatorMapper"> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dsh.course.mapper.StoreMapper"> |
| | | <insert id="addConfigOne"> |
| | | insert into t_store_other_config(id, |
| | | url, |
| | | `name`, |
| | | page, |
| | | `type`, |
| | | turnId, |
| | | sort, |
| | | state,pageId,typeId |
| | | ) value (null ,#{url},#{name},#{s},#{s1},#{turnId},#{sort},1,#{page},#{type}) |
| | | </insert> |
| | | <delete id="delete1"> |
| | | delete from t_store_other_config where id =#{id} |
| | | </delete> |
| | | |
| | | <select id="listAll" resultType="com.dsh.guns.modular.system.model.TStoreListVo"> |
| | | select t1.*,t2.name userName,t2.phone userPhone from t_store t1 left join sys_user t2 on t1.storeStaffId = t2.id |
| | | |
| | | where 1=1 |
| | | <if test="provinceCode !=null and provinceCode !=''"> |
| | | and t1.provinceCode = #{provinceCode} |
| | |
| | | and `name` like CONCAT('%',#{storeName},'%') |
| | | </if> |
| | | </select> |
| | | <select id="listOne" resultType="java.util.Map"> |
| | | select id,name,sort,state from t_store_other where storeId=#{id} |
| | | </select> |
| | | <select id="typeChange" resultType="java.util.Map"> |
| | | select t1.id,t1.name from t_turn t1 left join t_turn t2 on t1.pid = t2.id where t2.name =#{name} |
| | | </select> |
| | | <select id="typeChangeOne" resultType="java.util.Map"> |
| | | select id,name from t_turn where pid =#{id} |
| | | </select> |
| | | <select id="getConfig" resultType="java.lang.String"> |
| | | select name from t_turn where id =#{page} |
| | | </select> |
| | | <select id="listTwo" resultType="java.util.Map"> |
| | | select id,url,name , page,sort from t_store_other_config |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dsh.course.mapper.TStoreOtherConfigMapper"> |
| | | |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dsh.course.mapper.TStoreOtherConfigTrueMapper"> |
| | | |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dsh.course.mapper.TStoreOtherMapper"> |
| | | |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dsh.course.mapper.TTurnMapper"> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | |
| | | <div class="form-horizontal" id="carInfoForm"> |
| | | <input hidden id="role" value="${role}"> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">门店类型:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="radio" name="type" value="1" checked onclick="updateType(1)"> 平台门店 |
| | | <input type="radio" name="type" value="2" onclick="updateType(2)"> 运营商门店 |
| | | </div> |
| | | </div> |
| | | @if(role=='1'){ |
| | | <div class="form-group" id="yys" hidden > |
| | | <label class="col-sm-3 control-label">所属运营商:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="account" name="account" onchange="TCarInfoDlg.oneChange1(this)"> |
| | | <option value="">选择运营商</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" id="provinceCode"> |
| | | <label class="col-sm-3 control-label">所在省:</label> |
| | | <div class="col-sm-9"> |
| | |
| | | <div class="form-group" id="cityCode"> |
| | | <label class="col-sm-3 control-label">所在市:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="cCode" name="cCode" onchange="TCarInfoDlg.oneChangeNext(this)"> |
| | | <select class="form-control" id="cCode" name="cCode" > |
| | | <option value="">选择市</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" > |
| | | <label class="col-sm-3 control-label">所属账号:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="account" name="account"> |
| | | <option value="">选择账号</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | @} |
| | | <#input id="name" name="门店名称" type="text"/> |
| | | <#input id="phone" name="联系电话" type="text"/> |
| | |
| | | <!-- 创建地图容器--> |
| | | <div id="container" style="height: 500px;" ></div> |
| | | </div> |
| | | <div hidden id="longitude"></div> |
| | | <div hidden id="latitude"></div> |
| | | <div hidden id="longitude" value="104.0559716796875"></div> |
| | | <div hidden id="latitude" value="30.585671929253472"></div> |
| | | |
| | | <#input id="time" name="营业时间" type="text"/> |
| | | <div class="form-group"> |
| | |
| | | <#input id="userPhone" name="店长手机号" type="text"/> |
| | | <#avatar id="img" name="门店封面(推荐像素722*360px)" /> |
| | | <div class="row" id="app1"> |
| | | <div class="col-sm-6" style="width: 100%"> |
| | | <div class="col-sm-6" style="width: 100%;margin-left: 103px;"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label" style="width: 15%;margin-left: 5%">*实景图片(请上传不超过五张图片): </label> |
| | | <div class="col-sm-2" style="width: 100%;margin-left: 11%;margin-top: 1%"> |
| | |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <#input id="ids" name="添加入园闸机" type="text"/> |
| | | |
| | | </div> |
| | | </div> |
| | |
| | | created() { |
| | | }, |
| | | }); |
| | | |
| | | |
| | | function updateType(o) { |
| | | if(o==1){ |
| | | $("#yys").hide() |
| | | }else { |
| | | $("#yys").show() |
| | | |
| | | } |
| | | |
| | | } |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal" id="carInfoForm"> |
| | | <input id="id" value="${id}" hidden> |
| | | <div class="form-group" style="margin-left:-410px"> |
| | | <label class="col-sm-3 control-label">板块名称:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="name" name="name" type="text" style="width: 400px;"> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="form-group" style="margin-left:-410px"> |
| | | <label class="col-sm-3 control-label">内容设置:</label> |
| | | <#button name="添加" icon="fa-plus" clickFun="TCompetition.openAdd()"/> |
| | | </div> |
| | | <#table id="TCompetitionOtherTable"/> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TCompetition.addSubmit2()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCompetition.close()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tShop/tShopOtherOne.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#time', |
| | | range:true |
| | | }); |
| | | |
| | | |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal" id="carInfoForm"> |
| | | |
| | | |
| | | <#avatar id="url" name="图片(推荐像素宽度316px)"/> |
| | | |
| | | <div class="input-group" style="margin-left: 342px;"> |
| | | <div class="input-group-btn"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button"> |
| | | 跳转模块 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="name" style="width: 400px;" onclick="updateType(this)"> |
| | | <option value="" selected disabled>选择跳转模块</option> |
| | | <option value="不跳转">不跳转</option> |
| | | <option value="加入玩湃">加入玩湃</option> |
| | | <option value="开始课程">开始课程</option> |
| | | <option value="使用福利">使用福利</option> |
| | | <option value="探索玩湃">探索玩湃</option> |
| | | </select> |
| | | </div> |
| | | |
| | | <div class="input-group" style="margin-left: 342px;" id="t1" hidden > |
| | | <div class="input-group-btn"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button"> |
| | | 跳转页面 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="page" style="width: 400px;" onchange="updateOne(this)"> |
| | | |
| | | </select> |
| | | </div> |
| | | |
| | | <div class="input-group" style="margin-left: 342px;" id="t2" > |
| | | <div class="input-group-btn"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button"> |
| | | 跳转类型 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="type" style="width: 400px;" > |
| | | |
| | | </select> |
| | | </div> |
| | | |
| | | <div class="form-group" id="t3" > |
| | | <label class="col-sm-3 control-label">跳转ID:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="turnId" name="turnId" type="text" style="width: 400px;"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" id="t4" > |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="sort" name="sort" type="text" style="width: 400px;"> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCompetition.close()"/> |
| | | <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="TCompetition.addSubmit()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tShop/tShopOtherOne.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#time', |
| | | range:true |
| | | }); |
| | | |
| | | function updateType(e) { |
| | | let name = $("#name").val() |
| | | console.log(name |
| | | ) |
| | | if(name =='不跳转'){ |
| | | $("#t1").hide() |
| | | $("#t2").hide() |
| | | $("#t3").hide() |
| | | }else { |
| | | $("#t1").show() |
| | | $("#t2").show() |
| | | $("#t3").show() |
| | | |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/typeChange", function(data){ |
| | | if(data!=null){ |
| | | var content; |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#page").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("name",oneId); |
| | | ajax.start(); |
| | | } |
| | | } |
| | | |
| | | |
| | | function updateOne(e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/typeChangeOne", function(data){ |
| | | if(data!=null){ |
| | | var content1; |
| | | $.each(data, function(k,v) { |
| | | content1 += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#type").empty().append(content1); |
| | | } |
| | | }); |
| | | ajax.set("id",oneId); |
| | | ajax.start(); |
| | | } |
| | | </script> |
| | | @} |
| | |
| | | @layout("/common/_container.html"){ |
| | | <style> |
| | | .avatar-uploader .el-upload { |
| | | border: 1px dashed #d9d9d9; |
| | | border-radius: 6px; |
| | | cursor: pointer; |
| | | position: relative; |
| | | height: 100px; |
| | | width: 100px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .avatar-uploader .el-upload:hover { |
| | | border-color: #409EFF; |
| | | } |
| | | .avatar-uploader-icon { |
| | | font-size: 28px; |
| | | color: #8c939d; |
| | | width: 100px; |
| | | height: 100px; |
| | | line-height: 100px; |
| | | margin-top: 32px; |
| | | text-align: center; |
| | | } |
| | | .avatar { |
| | | width: 100px; |
| | | height: 100px; |
| | | display: block; |
| | | } |
| | | |
| | | .col-sm-12 { |
| | | margin-top: 20px; |
| | | } |
| | | |
| | | .col-sm-12 select { |
| | | height: 33px; |
| | | } |
| | | </style> |
| | | <script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.15&key=77b37f0753049c4e712ea79a24e0719c"></script> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | |
| | | <div class="form-horizontal" id="carInfoForm"> |
| | | <input hidden id="id" value="${item.id}"> |
| | | <input hidden id="role" value="${role}"> |
| | | <input hidden id="type" value="${item.type}"> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">门店类型:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="radio" name="type" value="1" onclick="updateType(1)"> 平台门店 |
| | | <input type="radio" name="type" value="2" onclick="updateType(2)"> 运营商门店 |
| | | </div> |
| | | </div> |
| | | @if(role=='1'){ |
| | | <div class="form-group" id="yys" hidden > |
| | | <label class="col-sm-3 control-label">所属运营商:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="account" name="account" onchange="TCarInfoDlg.oneChange1(this)"> |
| | | <option value="">选择运营商</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" id="provinceCode"> |
| | | <label class="col-sm-3 control-label">所在省:</label> |
| | | <div class="col-sm-9"> |
| | |
| | | <option value="">选择市</option> |
| | | @for(obj in list1){ |
| | | <option value="${obj.code}" ${obj.code == item.cityCode ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" > |
| | | <label class="col-sm-3 control-label">所属账号:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="account" name="account"> |
| | | <option value="">选择账号</option> |
| | | @for(obj in list2){ |
| | | <option value="${obj.id}" ${obj.id == item.cityManagerId ? 'selected=selected' : ''}>${obj.name}-${obj.phone}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | |
| | | <#input id="userPhone" name="管理员手机号" type="text" value="${city.account}"/> |
| | | <#avatar id="img" name="门店封面(推荐像素722*360px)" avatarImg="${item.coverDrawing}"/> |
| | | <#input id="imgOne" name="实景照片" type="text" value="${item.realPicture}"/> |
| | | <div class="row" id="app1"> |
| | | <div class="col-sm-6" style="width: 100%;margin-left: 103px;"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label" style="width: 15%;margin-left: 5%">*实景图片(请上传不超过五张图片): </label> |
| | | <div class="col-sm-2" style="width: 100%;margin-left: 11%;margin-top: 1%"> |
| | | <el-upload |
| | | |
| | | :limit="5" |
| | | class="avatar-uploader" |
| | | action="/tCouponManage/uploadPic" |
| | | list-type="picture-card" |
| | | accept="." |
| | | :file-list="imageUrl2" |
| | | :on-success="handleAvatarSuccess" |
| | | :on-remove="handleRemove"> |
| | | <i class="el-icon-plus"></i> |
| | | </el-upload> |
| | | <el-dialog :visible.sync="dialogVisible"> |
| | | <img width="100%" :src="imageUrl2" alt=""></el-dialog> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <#input id="ids" name="添加入园闸机" type="text" value="${item.ids}"/> |
| | | |
| | | </div> |
| | | <div class="row btn-group-m-t"> |
| | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tShop/tShop_info.js"></script> |
| | | <script src="${ctxPath}/js/vue/vue.js"></script> |
| | | <script src="${ctxPath}/js/elementui/index.js"></script> |
| | | <link rel="stylesheet" href="${ctxPath}/js/elementui/index.css"> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#time', |
| | | range:true |
| | | }); |
| | | |
| | | window.onload = function(){ |
| | | var OBJradio=document.getElementsByName("type") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#type").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | } |
| | | let id = "https://evmoto.obs.ap-southeast-4.myhuaweicloud.com:443/b1d6f9e362414d1b895d916657776573.png,https://evmoto.obs.ap-southeast-4.myhuaweicloud.com:443/b1d6f9e362414d1b895d916657776573.png" |
| | | let obj = [] |
| | | |
| | | |
| | | var vue2 = new Vue({ |
| | | el: '#app1', |
| | | props: { |
| | | // 数量限制 |
| | | limit: { |
| | | type: Number, |
| | | default: 2 |
| | | }, |
| | | }, |
| | | data: { |
| | | autoUpload: true,//自动上传 |
| | | imageUrl1: '',//模型数据,用于上传图片完成后图片预览 |
| | | imageUrl2: [], |
| | | dialogVisible: false |
| | | }, |
| | | methods: { |
| | | handleAvatarSuccess(res, file) { |
| | | TCarInfoDlg.goodsPicArray.push(file); |
| | | }, |
| | | changeImg(){ |
| | | var i = id.split(",") |
| | | for (let j = 0; j <i.length; j++) { |
| | | let obj={ |
| | | fileName:i[j], |
| | | uuid:i[j], |
| | | url:i[j] |
| | | } |
| | | this.imageUrl2.push(obj) |
| | | |
| | | } |
| | | console.log( this.imageUrl2,111) |
| | | }, |
| | | beforeAvatarUpload(file) { |
| | | const isLt2M = file.size / 1024 / 1024 < 10; |
| | | if (!isLt2M) { |
| | | this.$message.error('上传图片大小不能超过 10MB!'); |
| | | } |
| | | return isLt2M; |
| | | }, |
| | | handleRemove(file, fileList) { |
| | | TCarInfoDlg.goodsPicArray = TCarInfoDlg.goodsPicArray.filter(item => { |
| | | return item.uid != file.uid; |
| | | }); |
| | | }, |
| | | }, |
| | | created() { |
| | | this.changeImg() |
| | | }, |
| | | }); |
| | | |
| | | |
| | | function updateType(o) { |
| | | if(o==1){ |
| | | $("#yys").hide() |
| | | }else { |
| | | $("#yys").show() |
| | | queryStudentData |
| | | } |
| | | |
| | | } |
| | | </script> |
| | | <script type="application/javascript"> |
| | | |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal" id="carInfoForm"> |
| | | <input id="id" value="${item.id}" hidden> |
| | | <input id="name1" value="${item.name}" hidden> |
| | | |
| | | |
| | | <#avatar id="url" name="图片(推荐像素宽度316px)" avatarImg="${item.url}"/> |
| | | |
| | | <div class="input-group" style="margin-left: 342px;"> |
| | | <div class="input-group-btn"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button"> |
| | | 跳转模块 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="name" style="width: 400px;" onclick="updateType(this)"> |
| | | <option value="不跳转">不跳转</option> |
| | | <option value="加入玩湃">加入玩湃</option> |
| | | <option value="开始课程">开始课程</option> |
| | | <option value="使用福利">使用福利</option> |
| | | <option value="探索玩湃">探索玩湃</option> |
| | | </select> |
| | | </div> |
| | | |
| | | <div class="input-group" style="margin-left: 342px;" id="t1" hidden > |
| | | <div class="input-group-btn"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button"> |
| | | 跳转页面 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="page" style="width: 400px;" onchange="updateOne(this)"> |
| | | @for(obj in list){ |
| | | <option value="${obj.id}" ${obj.id == item.pageId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | |
| | | <div class="input-group" style="margin-left: 342px;" id="t2" > |
| | | <div class="input-group-btn"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button"> |
| | | 跳转类型 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="type" style="width: 400px;" > |
| | | @for(obj in list1){ |
| | | <option value="${obj.id}" ${obj.id == item.typeId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | |
| | | <div class="form-group" id="t3" > |
| | | <label class="col-sm-3 control-label">跳转ID:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="turnId" name="turnId" type="text" style="width: 400px;" value="${item.turnId}"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" id="t4" > |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="sort" name="sort" type="text" style="width: 400px;" value="${item.sort}"> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCompetition.close()"/> |
| | | <#button btnCss="info" name="确认" id="ensure" icon="fa-check" clickFun="TCompetition.addSubmit1()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tShop/tShopOtherOne.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#time', |
| | | range:true |
| | | }); |
| | | |
| | | function updateType(e) { |
| | | let name = $("#name").val() |
| | | console.log(name |
| | | ) |
| | | if(name =='不跳转'){ |
| | | $("#t1").hide() |
| | | $("#t2").hide() |
| | | $("#t3").hide() |
| | | }else { |
| | | $("#t1").show() |
| | | $("#t2").show() |
| | | $("#t3").show() |
| | | |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/typeChange", function(data){ |
| | | if(data!=null){ |
| | | var content; |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#page").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("name",oneId); |
| | | ajax.start(); |
| | | } |
| | | } |
| | | |
| | | |
| | | function updateOne(e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/typeChangeOne", function(data){ |
| | | if(data!=null){ |
| | | var content1; |
| | | $.each(data, function(k,v) { |
| | | content1 += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#type").empty().append(content1); |
| | | } |
| | | }); |
| | | ajax.set("id",oneId); |
| | | ajax.start(); |
| | | } |
| | | |
| | | window.onload = function() { |
| | | $("#name").val($("#name1").val()); |
| | | } |
| | | </script> |
| | | @} |
| | |
| | | </div> |
| | | |
| | | |
| | | <div>首页其他板块设置</div> |
| | | <#button name="添加" icon="fa-plus" clickFun="TCompetition.openAddTCompetition(id)"/> |
| | | <#button name="编辑" icon="fa-edit" clickFun="TCompetition.openTCompetitionDetail()" space="true"/> |
| | | <#button name="删除" icon="fa-remove" clickFun="TCompetition.freeze()" space="true"/> |
| | | <#button name="开启" icon="fa-remove" clickFun="TCompetition.unfreeze()" space="true"/> |
| | | <#button name="关闭" icon="fa-remove" clickFun="TCompetition.info()" space="true"/> |
| | | <#table id="TCompetitionOtherTable"/> |
| | | |
| | | |
| | | |
| | | </div> |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="TCarInfoDlg.saveAllImg()"/> |
| | | <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="TCompetition.saveAllImg()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tShop/tShop_info.js"></script> |
| | | <script src="${ctxPath}/modular/system/tShop/tShopOther.js"></script> |
| | | |
| | | <script> |
| | | </script> |
| | |
| | | <div class="form-horizontal" id="carInfoForm"> |
| | | <input hidden id="role" value="${role}"> |
| | | @if(objectType==1){ |
| | | <div class="form-group" id="provinceCode"> |
| | | <label class="col-sm-3 control-label">*所在省:</label> |
| | | <div class="col-sm-9"> |
| | | <select style="width: 300px" class="form-control" id="pCode" name="pCode" onchange="TSite.oneChange(2)"> |
| | | <option style="width: 300px" value="">选择省</option> |
| | | @for(obj in province){ |
| | | <option style="width: 300px" value="${obj}">${obj}</option> |
| | | <div class="form-group" > |
| | | <label class="col-sm-3 control-label">*所属运营商:</label> |
| | | <div class="col-sm-8"> |
| | | <select style="width: 300px" class="form-control" id="yys" name="yys" onchange="TSite.oneChangeYys(2)"> |
| | | <option style="width: 300px" value="">选择运营商</option> |
| | | @for(obj in yysList){ |
| | | <option style="width: 300px" value="${obj.id}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | @} |
| | | @if(objectType==1){ |
| | | <div class="form-group" id="cityCode"> |
| | | <label class="col-sm-3 control-label">*所在市:</label> |
| | | <div class="col-sm-9"> |
| | | <select style="width: 300px" class="form-control" id="cCode" name="cCode" onchange="TSite.oneChangeNext(this)"> |
| | | <option value="">请先选择省</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | @} |
| | | @if(objectType==1){ |
| | | <div class="form-group" > |
| | | <label class="col-sm-3 control-label">*所属账号:</label> |
| | | <div class="col-sm-9"> |
| | | <select style="width: 300px" class="form-control" id="account" name="account"> |
| | | <option value="">请先选择省/市</option> |
| | | </select> |
| | | <input type="checkbox" value="0" name="pt">平台</input> |
| | | </div> |
| | | </div> |
| | | @} |
| | |
| | | <label class="col-sm-3 control-label">*所属门店:</label> |
| | | <div class="col-sm-9"> |
| | | <select style="width: 300px" class="form-control" id="store" name="store" > |
| | | <option disabled selected value="">请选择门店</option> |
| | | @if(objectType!=1){ |
| | | @for(obj in stores){ |
| | | <option style="width: 300px" value="${obj.id}">${obj.name}</option> |
| | | @} |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" > |
| | | <label class="col-sm-3 control-label">*场地类型:</label> |
| | | <div class="col-sm-9"> |
| | | <select style="width: 300px" class="form-control" id="siteTypeOne" name = "typeId"> |
| | | <option value="普通场地">普通场地</option> |
| | | <option value="智慧场地">智慧场地</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | |
| | | <span style="margin-left: 5px;margin-top: 5px">币/半小时</span> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" id="siteMore" style=" margin-left: 255px;"> |
| | | <div class="form-group">多场地配置:<i class="fa fa-plus" onclick="addBox()"></i></div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">是否可预定半场:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="radio" name="ishalf" value="2" checked onclick="updateHalf(1)"> 否 |
| | | <input type="radio" name="ishalf" value="1" onclick="updateHalf(2)"> 是 |
| | | </div> |
| | | </div> |
| | | <div id="halfCode" hidden> |
| | | <div class="form-group" style="margin-left: 100px;" > |
| | | <label class="col-sm-3 control-label">*现金价格:</label> |
| | | <div class="col-sm-9" style="display: flex;"> |
| | | <input style="width: 300px" class="form-control" id="cashPriceOne" name="playPaiCoin" placeholder="请输入价格" type="text"> |
| | | <span style="margin-left: 5px;margin-top: 5px">元/半小时</span> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" style="margin-left: 100px;"> |
| | | <label class="col-sm-3 control-label">*玩湃币价格:</label> |
| | | <div class="col-sm-9" style="display: flex;"> |
| | | <input style="width: 300px" class="form-control" id="playPaiCoinOne" name="playPaiCoin" placeholder="请输入价格" type="text"> |
| | | <span style="margin-left: 5px;margin-top: 5px">币/半小时</span> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="form-group" id="halfName" > |
| | | <label class="col-sm-3 control-label">*半场名称:</label> |
| | | <div class="col-sm-8" style="display: flex;"> |
| | | <input style="width: 240px" class="form-control" name="name2" type="text"><i class="fa fa-plus" onclick="addBox1()" style="margin-left: 32px;margin-top: 10px;"></i> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*场地责任险有效期:</label> |
| | | <div class="col-sm-9"> |
| | |
| | | @if(objectType==1){ |
| | | <#input style="width: 300px" id="name" name="*添加闸机:" placeholder="请输入闸机ID" type="text"/> |
| | | @} |
| | | <div class="form-group" style=" margin-left: 17%;" > |
| | | <label class="col-sm-1 control-label">场地说明:</label> |
| | | <div class="col-sm-5"> |
| | | <textarea type="text/plain" id="editor" style="height: 300px;width: 800px;"></textarea> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5" > |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TSite.addSubmit()"/> |
| | |
| | | <script src="${ctxPath}/js/elementui/index.js"></script> |
| | | <link rel="stylesheet" href="${ctxPath}/js/elementui/index.css"> |
| | | <script> |
| | | |
| | | function addBox() { |
| | | var a=" <div class=\"col-sm-8 control-label\" id=\"far\">\n" + |
| | | " <label class=\"col-sm-2 control-label\">*单个场地名</label>\n" + |
| | | " <div class=\"col-sm-3\">\n" + |
| | | " <input type=\"text\" name=\"name1\" class=\"form-control newWidth\" /> \n" + |
| | | " </div> \n" + |
| | | " <div class=\"col-sm-1\">\n" + |
| | | " <i class=\"col-sm-1 fa fa-remove\" onclick=\"delBox(this)\" style=\"margin-top:10px\"></i>\n" + |
| | | " </div> \n" + |
| | | " </div> " |
| | | |
| | | |
| | | $("#siteMore").append($(a)) |
| | | } |
| | | function addBox1() { |
| | | var a=" <div class=\"col-sm-8 control-label\" id=\"far\" style=\"margin-left: 210px;\">\n" + |
| | | " <label class=\"col-sm-2 control-label\">*半场名称:</label>\n" + |
| | | " <div class=\"col-sm-3\">\n" + |
| | | " <input type=\"text\" name=\"name2\" class=\"form-control newWidth\" style=\"margin-left: 8px;width: 240px;\"/> \n" + |
| | | " </div> \n" + |
| | | " <div class=\"col-sm-1\">\n" + |
| | | " <i class=\"col-sm-1 fa fa-remove\" onclick=\"delBox(this)\" style=\"margin-top:10px\"></i>\n" + |
| | | " </div> \n" + |
| | | " </div> " |
| | | |
| | | |
| | | $("#halfName").append($(a)) |
| | | } |
| | | function delBox(o) { |
| | | $(o).parent("div").parent("div").remove() |
| | | } |
| | | |
| | | function updateHalf(e) { |
| | | if(e==1){ |
| | | $("#halfCode").hide() |
| | | }else { |
| | | $("#halfCode").show() |
| | | } |
| | | |
| | | } |
| | | |
| | | var vue2 = new Vue({ |
| | | el: '#app1', |
| | | props: { |
| | |
| | | TCompetition.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '门店类型', field: 'type', visible: role==1?true:false, align: 'center', valign: 'middle', |
| | | formatter:function (data) { |
| | | return {1:"平台门店",2:"运营商门店"}[data] |
| | | |
| | | } |
| | | }, |
| | | {title: '所属运营商', field: 'province', visible: role==1?true:false, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '省', field: 'province', visible: role==1?true:false, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '市', field: 'city', visible: role==1?true:false, align: 'center', valign: 'middle'}, |
| | | {title: '所属账号', field: 'account', visible: role==1?true:false, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '门店名称', field: 'name', visible: true, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '门店地址', field: 'address', visible: true, align: 'center', valign: 'middle' |
New file |
| | |
| | | /** |
| | | * 车辆管理管理初始化 |
| | | */ |
| | | var TCompetition = { |
| | | id: "TCompetitionOtherTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | var language =1 |
| | | var role =1 |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TCompetition.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '板块名称', field: 'name', visible: role==1?true:false, align: 'center', valign: 'middle', |
| | | }, |
| | | {title: '排序', field: 'sort', visible: role==1?true:false, align: 'center', valign: 'middle', |
| | | }, |
| | | {title: '状态', field: 'state', visible: role==1?true:false, align: 'center', valign: 'middle', |
| | | formatter:function (data) { |
| | | return {1:"开启",2:"关闭"}[data] |
| | | |
| | | } |
| | | }, |
| | | ]; |
| | | }; |
| | | function currentTime(timestamp){ |
| | | var time = timestamp + ''; |
| | | if(time.length != 13){ |
| | | timestamp = timestamp * 1000; |
| | | } |
| | | var date = new Date(timestamp);; |
| | | var Y = date.getFullYear() + '-'; |
| | | var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'; |
| | | var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '; |
| | | |
| | | var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':'; |
| | | var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + ':'; |
| | | var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds()); |
| | | var strDate = Y + M + D + h + m + s; |
| | | return strDate |
| | | } |
| | | |
| | | function currentTime1(timestamp){ |
| | | var time = timestamp + ''; |
| | | if(time.length != 13){ |
| | | timestamp = timestamp * 1000; |
| | | } |
| | | var date = new Date(timestamp);; |
| | | var Y = date.getFullYear() + '-'; |
| | | var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'; |
| | | var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '; |
| | | |
| | | var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':'; |
| | | var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + ':'; |
| | | var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds()); |
| | | var strDate = Y + M + D ; |
| | | return strDate |
| | | } |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TCompetition.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TCompetition.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 点击添加车辆管理 |
| | | */ |
| | | TCompetition.openAddTCompetition = function (e) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tShop/tShop_add_one?id='+e |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看车辆管理详情 |
| | | */ |
| | | TCompetition.openTCompetitionDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title:'编辑', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tShop/tShop_update/' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | TCompetition.info = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title:'详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tShop/tShop_info/' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | TCompetition.gift = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title:'免费福利', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tShop/tShop_gift/' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | TCompetition.indexSet = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title:'首页设置', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tShop/tShop_indexSet/' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 删除车辆管理 |
| | | */ |
| | | TCompetition.delete = function () { |
| | | if (this.check()) { |
| | | var nickname = TCompetition.seItem.carLicensePlate; |
| | | if (nickname == "" || nickname == null || nickname == undefined){ |
| | | nickname = "该车辆"; |
| | | }else{ |
| | | nickname = "【"+nickname+"】"; |
| | | } |
| | | swal({ |
| | | title: language==1?"您是否确认删除" + nickname + "?":(language==2?"Are you sure to delete the" + nickname + "?":"Apakah Anda pasti akan menghapus" + nickname + "?"), |
| | | text: language==1?"请谨慎操作!":(language==2?' Please operate with caution!':'Harap beroperasi dengan hati -hati!'), |
| | | type: "warning", |
| | | showCancelButton: true, |
| | | confirmButtonColor: "#DD6B55", |
| | | confirmButtonText: language==1?"删除":(language==2?'Delete':'Hapus'), |
| | | closeOnConfirm: true |
| | | }, function () { |
| | | var ajax = new $ax(Feng.ctxPath + "/TCompetition/delete", function (data) { |
| | | if(language==1){ |
| | | swal("删除成功", "您已经成功删除了" + nickname + "。", "success"); |
| | | }else if(language==2){ |
| | | swal("Delete succeeded!", "You have successfully deleted it" + nickname + "。", "success"); |
| | | }else { |
| | | swal("Hapus berhasil!", "Anda berhasil menghapus" + nickname + "。", "success"); |
| | | } |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | if(language==1){ |
| | | swal("删除失败", data.responseJSON.message + "!", "warning"); |
| | | }else if(language==2){ |
| | | swal("Failed to delete", data.responseJSON.message + "!", "warning"); |
| | | }else { |
| | | swal("Hapus Gagal", data.responseJSON.message + "!", "warning"); |
| | | } |
| | | |
| | | }); |
| | | ajax.set("TCompetitionId",TCompetition.seItem.id); |
| | | ajax.start(); |
| | | }); |
| | | } |
| | | }; |
| | | TCompetition.oneChange = function (e) { |
| | | console.log(111) |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/onChange", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择市</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Choose your franchisee</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih franchisee Anda</option>'; |
| | | } |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.code+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#cCode").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | TCompetition.oneChangeNext = function (e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/oneChangeNext", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择账号</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Choose your franchisee</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih franchisee Anda</option>'; |
| | | } |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#account").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | |
| | | TCompetition.freeze = function () { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/freeze", function (data) { |
| | | Feng.success("冻结成功!"); |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("冻结失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",this.seItem.id); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | TCompetition.unfreeze = function () { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/unfreeze", function (data) { |
| | | Feng.success("解冻成功!"); |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("解冻失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",this.seItem.id); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | TCompetition.reload = function () { |
| | | if (this.check()) { |
| | | let id = this.seItem.id |
| | | var operation = function(){ |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/pwd", function (data) { |
| | | Feng.success("重置成功!"); |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("重置失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",id); |
| | | ajax.start(); |
| | | } |
| | | Feng.confirm("确认重置密码?重置后密码为:a123456", operation); |
| | | } |
| | | |
| | | }; |
| | | |
| | | TCompetition.saveAllImg = function (e) { |
| | | var id = $("#id").val() |
| | | var px1 = $("#px1").val() |
| | | var px2 = $("#px2").val() |
| | | var px3 = $("#px3").val() |
| | | var px4 = $("#px4").val() |
| | | var px5 = $("#px5").val() |
| | | var px6 = $("#px6").val() |
| | | var px7 = $("#px7").val() |
| | | var px8 = $("#px8").val() |
| | | var c1 = $("#c1").val() |
| | | var c2 = $("#c2").val() |
| | | var c3 = $("#c3").val() |
| | | var c4 = $("#c4").val() |
| | | var c5 = $("#c5").val() |
| | | var c6 = $("#c6").val() |
| | | var c7 = $("#7").val() |
| | | var c8 = $("#c8").val() |
| | | var r1 = document.querySelector('input[name="r1"]').checked; |
| | | var r2 = document.querySelector('input[name="r2"]').checked; |
| | | var r3 = document.querySelector('input[name="r3"]').checked; |
| | | var r4 = document.querySelector('input[name="r4"]').checked; |
| | | var r5 = document.querySelector('input[name="r5"]').checked; |
| | | var r6 = document.querySelector('input[name="r6"]').checked; |
| | | var r7 = document.querySelector('input[name="r7"]').checked; |
| | | var r8 = document.querySelector('input[name="r8"]').checked; |
| | | if(r1){ |
| | | r1 =1 |
| | | }else{ |
| | | r1=0 |
| | | } |
| | | if(r2){ |
| | | r2 =1 |
| | | }else{ |
| | | r2=0 |
| | | } |
| | | if(r3){ |
| | | r3 =1 |
| | | }else{ |
| | | r3=0 |
| | | } |
| | | if(r4){ |
| | | r4 =1 |
| | | }else{ |
| | | r4=0 |
| | | } |
| | | if(r5){ |
| | | r5 =1 |
| | | }else{ |
| | | r5=0 |
| | | } |
| | | if(r6){ |
| | | r6 =1 |
| | | }else{ |
| | | r6=0 |
| | | } |
| | | if(r7){ |
| | | r7 =1 |
| | | }else{ |
| | | r7=0 |
| | | } |
| | | if(r8){ |
| | | r8 =1 |
| | | }else{ |
| | | r8=0 |
| | | } |
| | | |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/saveImgAll", function(data){ |
| | | if(data.code == 200){ |
| | | Feng.success("保存成功!"); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | },function(data){ |
| | | Feng.error("保存失败!" + data.responseJSON.message + "!"); |
| | | |
| | | }); |
| | | ajax.set("id",id); |
| | | ajax.set("px1",px1); |
| | | ajax.set("px2",px2); |
| | | ajax.set("px3",px3); |
| | | ajax.set("px4",px4); |
| | | ajax.set("px5",px5); |
| | | ajax.set("px6",px6); |
| | | ajax.set("px7",px7); |
| | | ajax.set("px8",px8); |
| | | ajax.set("c1",c1); |
| | | ajax.set("c2",c2); |
| | | ajax.set("c3",c3); |
| | | ajax.set("c4",c4); |
| | | ajax.set("c5",c5); |
| | | ajax.set("c6",c6); |
| | | ajax.set("c7",c7); |
| | | ajax.set("c8",c8); |
| | | ajax.set("r1",r1); |
| | | ajax.set("r2",r2); |
| | | ajax.set("r3",r3); |
| | | ajax.set("r4",r4); |
| | | ajax.set("r5",r5); |
| | | ajax.set("r6",r6); |
| | | ajax.set("r7",r7); |
| | | ajax.set("r8",r8); |
| | | ajax.start(); |
| | | } |
| | | |
| | | TCompetition.carInsurance = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: language==1?'车辆保险':(language==2?'Vehicle insurance':'Asuransi kendaraan'), |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/TCompetition/carInsurance?carId=' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询车辆管理列表 |
| | | */ |
| | | TCompetition.search = function () { |
| | | var queryData = {}; |
| | | queryData['provinceCode'] = $("#pCode").val(); |
| | | queryData['cityCode'] = $("#cCode").val(); |
| | | queryData['name'] = $("#name").val(); |
| | | queryData['phone'] = $("#phone").val(); |
| | | queryData['shopName'] = $("#shopName").val(); |
| | | TCompetition.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | TCompetition.resetSearch = function () { |
| | | $("#pCode").val(""); |
| | | $("#cCode").val(""); |
| | | $("#name").val(""); |
| | | $("#phone").val(""); |
| | | $("#shopName").val(""); |
| | | TCompetition.search(); |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColunms = TCompetition.initColumn(); |
| | | |
| | | // 初始化图片上传 |
| | | var carPhoto = new $WebUpload("c1"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c2"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c3"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c4"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c5"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c6"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c7"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c8"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("img"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var drivingLicensePhoto = new $WebUpload("drivingLicensePhoto"); |
| | | drivingLicensePhoto.setUploadBarId("progressBar"); |
| | | drivingLicensePhoto.init(); |
| | | |
| | | var table = new BSTable(TCompetition.id, "/tShop/listOne?id="+$("#id").val(), defaultColunms); |
| | | table.setPaginationType("server"); |
| | | TCompetition.table = table.init(); |
| | | }); |
| | | |
| | | /** |
| | | * 下载模板 |
| | | */ |
| | | TCompetition.uploadCarModel = function () { |
| | | window.location.href = Feng.ctxPath + "/TCompetition/uploadCarModel"; |
| | | } |
| | | |
| | | var agreement = function(){ |
| | | this.init = function(){ |
| | | //模拟上传excel |
| | | $("#uploadEventBtn").unbind("click").bind("click",function(){ |
| | | $("#uploadEventFile").click(); |
| | | }); |
| | | }; |
| | | } |
| | | /** |
| | | * 导入合同 |
| | | */ |
| | | TCompetition.exporTCompetition = function () { |
| | | var uploadEventFile = $("#uploadEventFile").val(); |
| | | if(uploadEventFile == ''){ |
| | | if(language==1){ |
| | | Feng.info("请选择Excel,再上传"); |
| | | }else if(language==2){ |
| | | Feng.info("Please select Excel and upload"); |
| | | }else { |
| | | Feng.info("Silakan pilih Excel dan upload"); |
| | | } |
| | | }else if(uploadEventFile.lastIndexOf(".xls")<0){//可判断以.xls和.xlsx结尾的excel |
| | | if(language==1){ |
| | | Feng.info("只能上传Excel文件"); |
| | | }else if(language==2){ |
| | | Feng.info("Only Excel files can be uploaded"); |
| | | }else { |
| | | Feng.info("Hanya berkas Excel yang dapat diunggah"); |
| | | } |
| | | }else{ |
| | | var url = Feng.ctxPath + '/TCompetition/exporTCompetition'; |
| | | var file = document.querySelector('input[name=file]').files[0]; |
| | | var reader = new FileReader(); |
| | | if (file) { |
| | | var formData = new FormData(); |
| | | formData.append("myfile", file); |
| | | this.sendAjaxRequest(url, 'POST', formData); |
| | | } |
| | | } |
| | | } |
| | | TCompetition.sendAjaxRequest = function(url,type,data){ |
| | | $.ajax({ |
| | | url : url, |
| | | type : type, |
| | | data : data, |
| | | success : function(result) { |
| | | if(result.code==500) { |
| | | Feng.info(result.message); |
| | | }else { |
| | | if(language==1){ |
| | | Feng.success("导入成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("SUCCESSFUL IMPORT!"); |
| | | }else { |
| | | Feng.success("Import berhasil!"); |
| | | } |
| | | } |
| | | TCompetition.table.refresh(); |
| | | }, |
| | | error : function() { |
| | | if(language==1){ |
| | | Feng.error("excel上传失败!"); |
| | | }else if(language==2){ |
| | | Feng.error("Uploading excel Fails. Procedure!"); |
| | | }else { |
| | | Feng.error("Gagal mengunggah excel!"); |
| | | } |
| | | }, |
| | | cache : false, |
| | | contentType : false, |
| | | processData : false |
| | | }); |
| | | }; |
| | | |
| | | var agreement; |
| | | $(function(){ |
| | | agreement = new agreement(); |
| | | agreement.init(); |
| | | }); |
| | | |
| | | /** |
| | | * 导出车辆操作 |
| | | */ |
| | | TCompetition.ouTCompetition = function () { |
| | | var operation = function() { |
| | | window.location.href = Feng.ctxPath + "/TCompetition/ouTCompetition"; |
| | | }; |
| | | if(language==1){ |
| | | Feng.confirm("是否确认导出车辆信息?", operation); |
| | | }else if(language==2){ |
| | | Feng.confirm("Are you sure to export vehicle information?", operation); |
| | | }else { |
| | | Feng.confirm("Apakah Anda pasti akan mengekspor informasi kendaraan?", operation); |
| | | } |
| | | } |
New file |
| | |
| | | /** |
| | | * 车辆管理管理初始化 |
| | | */ |
| | | var TCompetition = { |
| | | id: "TCompetitionOtherTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | var language =1 |
| | | var role =1 |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TCompetition.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle', |
| | | }, |
| | | {title: '图片', field: 'url', visible: role==1?true:false, align: 'center', valign: 'middle', |
| | | }, |
| | | {title: '跳转模块', field: 'name', visible: role==1?true:false, align: 'center', valign: 'middle', |
| | | }, |
| | | {title: '跳转页面', field: 'page', visible: role==1?true:false, align: 'center', valign: 'middle', |
| | | }, |
| | | {title: '排序', field: 'sort', visible: role==1?true:false, align: 'center', valign: 'middle', |
| | | }, |
| | | {title: '操作', visible: role==1?true:false, align: 'center', valign: 'middle', |
| | | formatter:function (value,row) { |
| | | return '<a href="javascript:void(0);" style="color: blue" onclick="TCompetition.delete1(' + row.id +')">删除 </a> <a href="javascript:void(0);" style="color: blue" onclick="TCompetition.openTCompetitionDetail(' + row.id +')">编辑</a>' |
| | | } |
| | | }, |
| | | ]; |
| | | }; |
| | | function currentTime(timestamp){ |
| | | var time = timestamp + ''; |
| | | if(time.length != 13){ |
| | | timestamp = timestamp * 1000; |
| | | } |
| | | var date = new Date(timestamp);; |
| | | var Y = date.getFullYear() + '-'; |
| | | var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'; |
| | | var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '; |
| | | |
| | | var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':'; |
| | | var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + ':'; |
| | | var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds()); |
| | | var strDate = Y + M + D + h + m + s; |
| | | return strDate |
| | | } |
| | | |
| | | function currentTime1(timestamp){ |
| | | var time = timestamp + ''; |
| | | if(time.length != 13){ |
| | | timestamp = timestamp * 1000; |
| | | } |
| | | var date = new Date(timestamp);; |
| | | var Y = date.getFullYear() + '-'; |
| | | var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'; |
| | | var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '; |
| | | |
| | | var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':'; |
| | | var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + ':'; |
| | | var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds()); |
| | | var strDate = Y + M + D ; |
| | | return strDate |
| | | } |
| | | |
| | | TCompetition.delete1= function (e) { |
| | | console.log(e) |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/deleteOne", function (data) { |
| | | Feng.success("删除成功!"); |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("删除失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",e); |
| | | ajax.start(); |
| | | } |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TCompetition.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TCompetition.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 点击添加车辆管理 |
| | | */ |
| | | TCompetition.openAdd = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加内容', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tShop/tShop_add_two?id='+$("#id").val() |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看车辆管理详情 |
| | | */ |
| | | TCompetition.openTCompetitionDetail = function (e) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title:'编辑', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tShop/tShop_update_one/' + e |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | TCompetition.info = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title:'详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tShop/tShop_info/' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | TCompetition.gift = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title:'免费福利', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tShop/tShop_gift/' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | TCompetition.indexSet = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title:'首页设置', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tShop/tShop_indexSet/' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 删除车辆管理 |
| | | */ |
| | | TCompetition.delete = function () { |
| | | if (this.check()) { |
| | | var nickname = TCompetition.seItem.carLicensePlate; |
| | | if (nickname == "" || nickname == null || nickname == undefined){ |
| | | nickname = "该车辆"; |
| | | }else{ |
| | | nickname = "【"+nickname+"】"; |
| | | } |
| | | swal({ |
| | | title: language==1?"您是否确认删除" + nickname + "?":(language==2?"Are you sure to delete the" + nickname + "?":"Apakah Anda pasti akan menghapus" + nickname + "?"), |
| | | text: language==1?"请谨慎操作!":(language==2?' Please operate with caution!':'Harap beroperasi dengan hati -hati!'), |
| | | type: "warning", |
| | | showCancelButton: true, |
| | | confirmButtonColor: "#DD6B55", |
| | | confirmButtonText: language==1?"删除":(language==2?'Delete':'Hapus'), |
| | | closeOnConfirm: true |
| | | }, function () { |
| | | var ajax = new $ax(Feng.ctxPath + "/TCompetition/delete", function (data) { |
| | | if(language==1){ |
| | | swal("删除成功", "您已经成功删除了" + nickname + "。", "success"); |
| | | }else if(language==2){ |
| | | swal("Delete succeeded!", "You have successfully deleted it" + nickname + "。", "success"); |
| | | }else { |
| | | swal("Hapus berhasil!", "Anda berhasil menghapus" + nickname + "。", "success"); |
| | | } |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | if(language==1){ |
| | | swal("删除失败", data.responseJSON.message + "!", "warning"); |
| | | }else if(language==2){ |
| | | swal("Failed to delete", data.responseJSON.message + "!", "warning"); |
| | | }else { |
| | | swal("Hapus Gagal", data.responseJSON.message + "!", "warning"); |
| | | } |
| | | |
| | | }); |
| | | ajax.set("TCompetitionId",TCompetition.seItem.id); |
| | | ajax.start(); |
| | | }); |
| | | } |
| | | }; |
| | | TCompetition.oneChange = function (e) { |
| | | console.log(111) |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/onChange", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择市</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Choose your franchisee</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih franchisee Anda</option>'; |
| | | } |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.code+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#cCode").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | TCompetition.oneChangeNext = function (e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/oneChangeNext", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择账号</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Choose your franchisee</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih franchisee Anda</option>'; |
| | | } |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#account").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | |
| | | TCompetition.freeze = function () { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/freeze", function (data) { |
| | | Feng.success("冻结成功!"); |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("冻结失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",this.seItem.id); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | TCompetition.unfreeze = function () { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/unfreeze", function (data) { |
| | | Feng.success("解冻成功!"); |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("解冻失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",this.seItem.id); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | TCompetition.reload = function () { |
| | | if (this.check()) { |
| | | let id = this.seItem.id |
| | | var operation = function(){ |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/pwd", function (data) { |
| | | Feng.success("重置成功!"); |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("重置失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",id); |
| | | ajax.start(); |
| | | } |
| | | Feng.confirm("确认重置密码?重置后密码为:a123456", operation); |
| | | } |
| | | |
| | | }; |
| | | |
| | | TCompetition.saveAllImg = function (e) { |
| | | var id = $("#id").val() |
| | | var px1 = $("#px1").val() |
| | | var px2 = $("#px2").val() |
| | | var px3 = $("#px3").val() |
| | | var px4 = $("#px4").val() |
| | | var px5 = $("#px5").val() |
| | | var px6 = $("#px6").val() |
| | | var px7 = $("#px7").val() |
| | | var px8 = $("#px8").val() |
| | | var c1 = $("#c1").val() |
| | | var c2 = $("#c2").val() |
| | | var c3 = $("#c3").val() |
| | | var c4 = $("#c4").val() |
| | | var c5 = $("#c5").val() |
| | | var c6 = $("#c6").val() |
| | | var c7 = $("#7").val() |
| | | var c8 = $("#c8").val() |
| | | var r1 = document.querySelector('input[name="r1"]').checked; |
| | | var r2 = document.querySelector('input[name="r2"]').checked; |
| | | var r3 = document.querySelector('input[name="r3"]').checked; |
| | | var r4 = document.querySelector('input[name="r4"]').checked; |
| | | var r5 = document.querySelector('input[name="r5"]').checked; |
| | | var r6 = document.querySelector('input[name="r6"]').checked; |
| | | var r7 = document.querySelector('input[name="r7"]').checked; |
| | | var r8 = document.querySelector('input[name="r8"]').checked; |
| | | if(r1){ |
| | | r1 =1 |
| | | }else{ |
| | | r1=0 |
| | | } |
| | | if(r2){ |
| | | r2 =1 |
| | | }else{ |
| | | r2=0 |
| | | } |
| | | if(r3){ |
| | | r3 =1 |
| | | }else{ |
| | | r3=0 |
| | | } |
| | | if(r4){ |
| | | r4 =1 |
| | | }else{ |
| | | r4=0 |
| | | } |
| | | if(r5){ |
| | | r5 =1 |
| | | }else{ |
| | | r5=0 |
| | | } |
| | | if(r6){ |
| | | r6 =1 |
| | | }else{ |
| | | r6=0 |
| | | } |
| | | if(r7){ |
| | | r7 =1 |
| | | }else{ |
| | | r7=0 |
| | | } |
| | | if(r8){ |
| | | r8 =1 |
| | | }else{ |
| | | r8=0 |
| | | } |
| | | |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/saveImgAll", function(data){ |
| | | if(data.code == 200){ |
| | | Feng.success("保存成功!"); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | },function(data){ |
| | | Feng.error("保存失败!" + data.responseJSON.message + "!"); |
| | | |
| | | }); |
| | | ajax.set("id",id); |
| | | ajax.set("px1",px1); |
| | | ajax.set("px2",px2); |
| | | ajax.set("px3",px3); |
| | | ajax.set("px4",px4); |
| | | ajax.set("px5",px5); |
| | | ajax.set("px6",px6); |
| | | ajax.set("px7",px7); |
| | | ajax.set("px8",px8); |
| | | ajax.set("c1",c1); |
| | | ajax.set("c2",c2); |
| | | ajax.set("c3",c3); |
| | | ajax.set("c4",c4); |
| | | ajax.set("c5",c5); |
| | | ajax.set("c6",c6); |
| | | ajax.set("c7",c7); |
| | | ajax.set("c8",c8); |
| | | ajax.set("r1",r1); |
| | | ajax.set("r2",r2); |
| | | ajax.set("r3",r3); |
| | | ajax.set("r4",r4); |
| | | ajax.set("r5",r5); |
| | | ajax.set("r6",r6); |
| | | ajax.set("r7",r7); |
| | | ajax.set("r8",r8); |
| | | ajax.start(); |
| | | } |
| | | |
| | | TCompetition.carInsurance = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: language==1?'车辆保险':(language==2?'Vehicle insurance':'Asuransi kendaraan'), |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/TCompetition/carInsurance?carId=' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询车辆管理列表 |
| | | */ |
| | | TCompetition.search = function () { |
| | | var queryData = {}; |
| | | queryData['provinceCode'] = $("#pCode").val(); |
| | | queryData['cityCode'] = $("#cCode").val(); |
| | | queryData['name'] = $("#name").val(); |
| | | queryData['phone'] = $("#phone").val(); |
| | | queryData['shopName'] = $("#shopName").val(); |
| | | TCompetition.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | TCompetition.resetSearch = function () { |
| | | $("#pCode").val(""); |
| | | $("#cCode").val(""); |
| | | $("#name").val(""); |
| | | $("#phone").val(""); |
| | | $("#shopName").val(""); |
| | | TCompetition.search(); |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColunms = TCompetition.initColumn(); |
| | | |
| | | // 初始化图片上传 |
| | | var carPhoto = new $WebUpload("url"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c2"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c3"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c4"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c5"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c6"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c7"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c8"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("img"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var drivingLicensePhoto = new $WebUpload("drivingLicensePhoto"); |
| | | drivingLicensePhoto.setUploadBarId("progressBar"); |
| | | drivingLicensePhoto.init(); |
| | | |
| | | var table = new BSTable(TCompetition.id, "/tShop/listTwo", defaultColunms); |
| | | table.setPaginationType("server"); |
| | | TCompetition.table = table.init(); |
| | | }); |
| | | |
| | | /** |
| | | * 下载模板 |
| | | */ |
| | | TCompetition.uploadCarModel = function () { |
| | | window.location.href = Feng.ctxPath + "/TCompetition/uploadCarModel"; |
| | | } |
| | | |
| | | var agreement = function(){ |
| | | this.init = function(){ |
| | | //模拟上传excel |
| | | $("#uploadEventBtn").unbind("click").bind("click",function(){ |
| | | $("#uploadEventFile").click(); |
| | | }); |
| | | }; |
| | | } |
| | | /** |
| | | * 导入合同 |
| | | */ |
| | | TCompetition.exporTCompetition = function () { |
| | | var uploadEventFile = $("#uploadEventFile").val(); |
| | | if(uploadEventFile == ''){ |
| | | if(language==1){ |
| | | Feng.info("请选择Excel,再上传"); |
| | | }else if(language==2){ |
| | | Feng.info("Please select Excel and upload"); |
| | | }else { |
| | | Feng.info("Silakan pilih Excel dan upload"); |
| | | } |
| | | }else if(uploadEventFile.lastIndexOf(".xls")<0){//可判断以.xls和.xlsx结尾的excel |
| | | if(language==1){ |
| | | Feng.info("只能上传Excel文件"); |
| | | }else if(language==2){ |
| | | Feng.info("Only Excel files can be uploaded"); |
| | | }else { |
| | | Feng.info("Hanya berkas Excel yang dapat diunggah"); |
| | | } |
| | | }else{ |
| | | var url = Feng.ctxPath + '/TCompetition/exporTCompetition'; |
| | | var file = document.querySelector('input[name=file]').files[0]; |
| | | var reader = new FileReader(); |
| | | if (file) { |
| | | var formData = new FormData(); |
| | | formData.append("myfile", file); |
| | | this.sendAjaxRequest(url, 'POST', formData); |
| | | } |
| | | } |
| | | } |
| | | TCompetition.sendAjaxRequest = function(url,type,data){ |
| | | $.ajax({ |
| | | url : url, |
| | | type : type, |
| | | data : data, |
| | | success : function(result) { |
| | | if(result.code==500) { |
| | | Feng.info(result.message); |
| | | }else { |
| | | if(language==1){ |
| | | Feng.success("导入成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("SUCCESSFUL IMPORT!"); |
| | | }else { |
| | | Feng.success("Import berhasil!"); |
| | | } |
| | | } |
| | | TCompetition.table.refresh(); |
| | | }, |
| | | error : function() { |
| | | if(language==1){ |
| | | Feng.error("excel上传失败!"); |
| | | }else if(language==2){ |
| | | Feng.error("Uploading excel Fails. Procedure!"); |
| | | }else { |
| | | Feng.error("Gagal mengunggah excel!"); |
| | | } |
| | | }, |
| | | cache : false, |
| | | contentType : false, |
| | | processData : false |
| | | }); |
| | | }; |
| | | |
| | | var agreement; |
| | | $(function(){ |
| | | agreement = new agreement(); |
| | | agreement.init(); |
| | | }); |
| | | |
| | | /** |
| | | * 导出车辆操作 |
| | | */ |
| | | TCompetition.ouTCompetition = function () { |
| | | var operation = function() { |
| | | window.location.href = Feng.ctxPath + "/TCompetition/ouTCompetition"; |
| | | }; |
| | | if(language==1){ |
| | | Feng.confirm("是否确认导出车辆信息?", operation); |
| | | }else if(language==2){ |
| | | Feng.confirm("Are you sure to export vehicle information?", operation); |
| | | }else { |
| | | Feng.confirm("Apakah Anda pasti akan mengekspor informasi kendaraan?", operation); |
| | | } |
| | | } |
| | | |
| | | TCompetition.addSubmit = function() { |
| | | |
| | | let url = $("#url").val() |
| | | if(url==''){ |
| | | Feng.info("请上传图片") |
| | | return; |
| | | } |
| | | |
| | | let name = $("#name").val() |
| | | console.log(name) |
| | | |
| | | if(name=='' || name ==null){ |
| | | Feng.info("请选择跳转模块") |
| | | return; |
| | | } |
| | | let page = $("#page").val() |
| | | if(page=='' && name !='不跳转'){ |
| | | Feng.info("请选择跳转页面") |
| | | return; |
| | | } |
| | | let type = $("#type").val() |
| | | |
| | | if(type=='' && name !='不跳转'){ |
| | | } |
| | | let turnId = $("#turnId").val() |
| | | |
| | | if( type =='11' || type=='13'|| type=='16'|| type=='19'|| type=='21'|| type=='40'|| type=='43'){ |
| | | Feng.info("请输入跳转ID") |
| | | return; |
| | | } |
| | | let sort = $("#sort").val() |
| | | |
| | | if(sort==''){ |
| | | Feng.info("请输入排序") |
| | | return; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/addConfigOne", function(data){ |
| | | if(data.code == 200){ |
| | | Feng.success("添加成功!"); |
| | | window.parent.TCompetition.table.refresh(); |
| | | parent.layer.close(window.parent.TCompetition.layerIndex); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("url",url); |
| | | ajax.set("name",name); |
| | | ajax.set("page",page); |
| | | ajax.set("type",type); |
| | | ajax.set("turnId",turnId); |
| | | ajax.set("sort",sort); |
| | | ajax.start(); |
| | | } |
| | | |
| | | TCompetition.addSubmit1 = function() { |
| | | |
| | | let url = $("#url").val() |
| | | if(url==''){ |
| | | } |
| | | |
| | | let name = $("#name").val() |
| | | console.log(name) |
| | | |
| | | if(name=='' || name ==null){ |
| | | Feng.info("请选择跳转模块") |
| | | return; |
| | | } |
| | | let page = $("#page").val() |
| | | if(page=='' && name !='不跳转'){ |
| | | Feng.info("请选择跳转页面") |
| | | return; |
| | | } |
| | | let type = $("#type").val() |
| | | |
| | | if(type=='' && name !='不跳转'){ |
| | | } |
| | | let turnId = $("#turnId").val() |
| | | |
| | | if( type =='11' || type=='13'|| type=='16'|| type=='19'|| type=='21'|| type=='40'|| type=='43'){ |
| | | if(turnId==""){ |
| | | Feng.info("请输入跳转ID") |
| | | return; |
| | | } |
| | | } |
| | | let sort = $("#sort").val() |
| | | |
| | | if(sort==''){ |
| | | Feng.info("请输入排序") |
| | | return; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/updateConfigOne", function(data){ |
| | | if(data.code == 200){ |
| | | Feng.success("添加成功!"); |
| | | window.parent.TCompetition.table.refresh(); |
| | | parent.layer.close(window.parent.TCompetition.layerIndex); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("url",url); |
| | | ajax.set("name",name); |
| | | ajax.set("page",page); |
| | | ajax.set("type",type); |
| | | ajax.set("turnId",turnId); |
| | | ajax.set("sort",sort); |
| | | ajax.set("id",$("#id").val()); |
| | | ajax.start(); |
| | | } |
| | | TCompetition.addSubmit2 = function() { |
| | | |
| | | |
| | | let name = $("#name").val() |
| | | |
| | | if(name=='' || name ==null){ |
| | | Feng.info("请填写板块名称") |
| | | return; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/addConfig", function(data){ |
| | | if(data.code == 200){ |
| | | Feng.success("添加成功!"); |
| | | window.parent.TCompetition.table.refresh(); |
| | | parent.layer.close(window.parent.TCompetition.layerIndex); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("name",name); |
| | | ajax.set("id",$("#id").val()); |
| | | ajax.start(); |
| | | } |
| | | TCompetition.close = function() { |
| | | parent.layer.close(window.parent.TCompetition.layerIndex); |
| | | } |
| | |
| | | return ; |
| | | } |
| | | |
| | | var OBJradio= $("input[name='type']:checked").val(); |
| | | if(OBJradio==2){ |
| | | let account = $("#account").val() |
| | | if(account==''){ |
| | | Feng.info("请选择所属运营商") |
| | | return; |
| | | } |
| | | } |
| | | let pCode = $("#pCode").val() |
| | | let cCode = $("#cCode").val() |
| | | let account = $("#account").val() |
| | | if(account==''){ |
| | | Feng.info("请选择所属账号") |
| | | return; |
| | | } |
| | | |
| | | |
| | | let name = $("#name").val() |
| | | let phone = $("#phone").val() |
| | |
| | | ajax.set("cityCode",cCode); |
| | | ajax.set("name",name); |
| | | ajax.set("phone",phone); |
| | | ajax.set("cityManagerId",account); |
| | | ajax.set("cityManagerId",null); |
| | | ajax.set("address",address); |
| | | ajax.set("time",time); |
| | | ajax.set("introduce",intro); |
| | |
| | | ajax.set("userPhone",userPhone); |
| | | ajax.set("coverDrawing",img); |
| | | ajax.set("realPicture",imgOne); |
| | | ajax.set("lat",$("#latitude").val()); |
| | | ajax.set("lon",$("#longitude").val()); |
| | | ajax.set("ids",$("#ids").val()); |
| | | ajax.set("type",OBJradio); |
| | | ajax.set("yyId",$("#account").val()); |
| | | ajax.start(); |
| | | } |
| | | var map = new AMap.Map('container', { |
| | |
| | | let pCode = $("#pCode").val() |
| | | let cCode = $("#cCode").val() |
| | | let account = $("#account").val() |
| | | if(account==''){ |
| | | Feng.info("请选择所属账号") |
| | | return; |
| | | var OBJradio= $("input[name='type']:checked").val(); |
| | | if(OBJradio==2){ |
| | | let account = $("#account").val() |
| | | if(account==''){ |
| | | Feng.info("请选择所属运营商") |
| | | return; |
| | | } |
| | | } |
| | | |
| | | let name = $("#name").val() |
New file |
| | |
| | | /** |
| | | * 初始化车辆管理详情对话框 |
| | | */ |
| | | var language=1; |
| | | var TCarInfoDlg = { |
| | | goodsPicArray: [], |
| | | tCarInfoData : {}, |
| | | validateFields: { |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 验证数据是否为空 |
| | | */ |
| | | TCarInfoDlg.validate = function () { |
| | | $('#carInfoForm').data("bootstrapValidator").resetForm(); |
| | | $('#carInfoForm').bootstrapValidator('validate'); |
| | | return $("#carInfoForm").data('bootstrapValidator').isValid(); |
| | | }; |
| | | |
| | | /** |
| | | * 清除数据 |
| | | */ |
| | | TCarInfoDlg.clearData = function() { |
| | | this.tCarInfoData = {}; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TCarInfoDlg.set = function(key, val) { |
| | | this.tCarInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val; |
| | | return this; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TCarInfoDlg.get = function(key) { |
| | | return $("#" + key).val(); |
| | | } |
| | | |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | TCarInfoDlg.close = function() { |
| | | parent.layer.close(window.parent.TCompetition.layerIndex); |
| | | } |
| | | |
| | | /** |
| | | * 收集数据 |
| | | */ |
| | | TCarInfoDlg.collectData = function() { |
| | | this |
| | | .set('id') |
| | | .set('isPlatCar') |
| | | .set('companyId') |
| | | .set('franchiseeId') |
| | | .set('carColor') |
| | | .set('carModelId') |
| | | .set('carBrandId') |
| | | .set('carLicensePlate') |
| | | .set('carPhoto') |
| | | .set('drivingLicenseNumber') |
| | | .set('drivingLicensePhoto') |
| | | .set('annualInspectionTime') |
| | | .set('commercialInsuranceTime') |
| | | .set('createTime') |
| | | .set('state') |
| | | .set('addType') |
| | | .set('addObjectId') |
| | | .set('plateColor') |
| | | .set('vehicleType') |
| | | .set('ownerName') |
| | | .set('engineId') |
| | | .set('VIN') |
| | | .set('certifyDateA') |
| | | .set('fuelType') |
| | | .set('engineDisplace') |
| | | .set('certificate') |
| | | .set('transAgency') |
| | | .set('transArea') |
| | | .set('transDateStart') |
| | | .set('transDateStop') |
| | | .set('certifyDateB') |
| | | .set('fixState') |
| | | .set('nextFixDate') |
| | | .set('checkState') |
| | | .set('feePrintId') |
| | | .set('GPSBrand') |
| | | .set('GPSModel') |
| | | .set('GPSIMEI') |
| | | .set('GPSInstallDate') |
| | | .set('registerDate') |
| | | .set('commercialType'); |
| | | } |
| | | |
| | | TCarInfoDlg.oneChange = function (e) { |
| | | console.log(111) |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/onChange", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择市</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Choose your franchisee</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih franchisee Anda</option>'; |
| | | } |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.code+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#cCode").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | TCarInfoDlg.oneChangeNext = function (e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/oneChangeNext", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择账号</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Choose your franchisee</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih franchisee Anda</option>'; |
| | | } |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#account").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | TCarInfoDlg.saveImg = function () { |
| | | var id=$("#id").val(); |
| | | var img=$("#welfarePicture").val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/saveImg", function(data){ |
| | | if(data.code == 200){ |
| | | Feng.success("保存成功") |
| | | } |
| | | }); |
| | | ajax.set("id",id); |
| | | ajax.set("img",img); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 提交添加 |
| | | */ |
| | | TCarInfoDlg.addSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | var OBJradio= $("input[name='type']:checked").val(); |
| | | if(OBJradio==2){ |
| | | let account = $("#account").val() |
| | | if(account==''){ |
| | | Feng.info("请选择所属运营商") |
| | | return; |
| | | } |
| | | } |
| | | let pCode = $("#pCode").val() |
| | | let cCode = $("#cCode").val() |
| | | |
| | | |
| | | let name = $("#name").val() |
| | | let phone = $("#phone").val() |
| | | |
| | | if(pCode=='' && $("#role")=="1"){ |
| | | Feng.info("请选择省") |
| | | return; |
| | | } |
| | | if(cCode=='' && $("#role")=="1"){ |
| | | Feng.info("请选择市") |
| | | return; |
| | | } |
| | | if(name==''){ |
| | | Feng.info("门店名称不能为空") |
| | | return; |
| | | } |
| | | if(phone==''){ |
| | | Feng.info("联系电话不能为空") |
| | | return; |
| | | } |
| | | |
| | | let address = $("#address").val() |
| | | |
| | | if(address==''){ |
| | | Feng.info("请输入地址") |
| | | return; |
| | | } |
| | | let time = $("#time").val() |
| | | |
| | | if(time==''){ |
| | | Feng.info("请填写营业时间") |
| | | return; |
| | | } |
| | | let intro = $("#intro").val() |
| | | |
| | | if(intro==''){ |
| | | Feng.info("请填写门店介绍") |
| | | return; |
| | | } |
| | | let userName = $("#userName").val() |
| | | |
| | | if(userName==''){ |
| | | Feng.info("请输入店长姓名") |
| | | return; |
| | | } |
| | | let userPhone = $("#userPhone").val() |
| | | |
| | | if(userPhone==''){ |
| | | Feng.info("请输入店长手机号") |
| | | return; |
| | | } |
| | | let img = $("#img").val() |
| | | |
| | | if(img==''){ |
| | | Feng.info("请上传门店封面") |
| | | return; |
| | | } |
| | | var goodImgs = this.goodsPicArray; |
| | | if(goodImgs.length==0){ |
| | | Feng.info("请上传实景图") |
| | | return; |
| | | } |
| | | var imgOne =""; |
| | | for (let i = 0; i <goodImgs.length; i++) { |
| | | if(i==goodImgs.length-1){ |
| | | imgOne += (goodImgs[i].response) |
| | | }else { |
| | | imgOne+=(goodImgs[i].response+",") |
| | | } |
| | | |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/add", function(data){ |
| | | if(data=="5001"){ |
| | | Feng.error("该店长手机号已经存在!") |
| | | }else |
| | | if(data.code == 200){ |
| | | if(language==1){ |
| | | Feng.success("添加成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("Successfully added!"); |
| | | }else { |
| | | Feng.success("Sangat berhasil ditambah!"); |
| | | } |
| | | window.parent.TCompetition.table.refresh(); |
| | | TCarInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(this.tCarInfoData); |
| | | ajax.set("provinceCode",pCode); |
| | | ajax.set("cityCode",cCode); |
| | | ajax.set("name",name); |
| | | ajax.set("phone",phone); |
| | | ajax.set("cityManagerId",null); |
| | | ajax.set("address",address); |
| | | ajax.set("time",time); |
| | | ajax.set("introduce",intro); |
| | | ajax.set("userName",userName); |
| | | ajax.set("userPhone",userPhone); |
| | | ajax.set("coverDrawing",img); |
| | | ajax.set("realPicture",imgOne); |
| | | ajax.set("lat",$("#latitude").val()); |
| | | ajax.set("lon",$("#longitude").val()); |
| | | ajax.set("ids",$("#ids").val()); |
| | | ajax.set("type",OBJradio); |
| | | ajax.set("yyId",$("#account").val()); |
| | | ajax.start(); |
| | | } |
| | | var map = new AMap.Map('container', { |
| | | resizeEnable: true, // 允许缩放 |
| | | zoom: 15 // 设置地图的缩放级别,0 - 20 |
| | | }); |
| | | var marker; |
| | | //搜索地图 |
| | | TCarInfoDlg.searchByStationName = function(e,type){ |
| | | var keyword="成都"; |
| | | if(type==2){ |
| | | keyword = $(e).parent().prev().find("input").val(); |
| | | }else { |
| | | if($("#address").val()!=null && $("#address").val()!=''){ |
| | | keyword = $("#address").val(); |
| | | } |
| | | } |
| | | type=1; |
| | | AMap.plugin('AMap.Geocoder', function() { |
| | | var geocoder = new AMap.Geocoder(); |
| | | console.log(geocoder) |
| | | console.log(keyword) |
| | | geocoder.getLocation(keyword, function(status, result) { |
| | | console.log(status,result) |
| | | if (status === 'complete' && result.info === 'OK') { |
| | | // 经纬度 |
| | | var lng = result.geocodes[0].location.lng; |
| | | var lat = result.geocodes[0].location.lat; |
| | | $("#longitude").val(lng) |
| | | $("#latitude").val(lat) |
| | | // 地图实例 |
| | | map = new AMap.Map('container', { |
| | | resizeEnable: true, // 允许缩放 |
| | | center: [lng, lat], // 设置地图的中心点 |
| | | zoom: 15 // 设置地图的缩放级别,0 - 20 |
| | | }); |
| | | //地图画点 |
| | | //addMarker(lng,lat); |
| | | if(type==1 || type==2){ |
| | | showInfoClick(); |
| | | if(lng == null){ |
| | | }else{ |
| | | addMarker(lng,lat); |
| | | } |
| | | }else{ |
| | | addMarker(lng,lat); |
| | | } |
| | | } else { |
| | | console.log('定位失败!'); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | } |
| | | //地图点击事件 |
| | | function showInfoClick(){ |
| | | map.on('click', function (e) { |
| | | addMarker(e.lnglat.getLng(),e.lnglat.getLat()); |
| | | }); |
| | | } |
| | | //删除点 |
| | | function removeMarkers(){ |
| | | if(marker!=null){ |
| | | map.remove(marker); |
| | | } |
| | | |
| | | } |
| | | // 实例化点标记 |
| | | function addMarker(lon,lat) { |
| | | removeMarkers(); |
| | | marker = new AMap.Marker({ |
| | | map: map, |
| | | position: new AMap.LngLat(lon, lat), // 经纬度 |
| | | }); |
| | | //加经纬度 |
| | | $("#lon").val(lon); |
| | | $("#lat").val(lat); |
| | | var lnglatXY = [lon, lat];//地图上所标点的坐标 |
| | | AMap.service('AMap.Geocoder',function() {//回调函数 |
| | | geocoder = new AMap.Geocoder({ |
| | | }); |
| | | geocoder.getAddress(lnglatXY, function (status, result) { |
| | | if (status === 'complete' && result.info === 'OK') { |
| | | //获得了有效的地址信息: |
| | | //即,result.regeocode.formattedAddress |
| | | // alert(result.regeocode.formattedAddress) |
| | | //document.getElementById("address").value=result.regeocode.formattedAddress;//将获取到的地址信息赋值给文本框,保存进数据库 |
| | | |
| | | var address = result.regeocode.formattedAddress; |
| | | var city = result.regeocode.addressComponent.city; |
| | | var province = result.regeocode.addressComponent.province; |
| | | var district = result.regeocode.addressComponent.district; |
| | | $("#address").val(address); |
| | | } else { |
| | | //获取地址失败 |
| | | } |
| | | }); |
| | | }) |
| | | } |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | TCarInfoDlg.editSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | let pCode = $("#pCode").val() |
| | | let cCode = $("#cCode").val() |
| | | let account = $("#account").val() |
| | | var OBJradio= $("input[name='type']:checked").val(); |
| | | if(OBJradio==2){ |
| | | let account = $("#account").val() |
| | | if(account==''){ |
| | | Feng.info("请选择所属运营商") |
| | | return; |
| | | } |
| | | } |
| | | |
| | | let name = $("#name").val() |
| | | let phone = $("#phone").val() |
| | | |
| | | if(pCode=='' && $("#role")=="1"){ |
| | | Feng.info("请选择省") |
| | | return; |
| | | } |
| | | if(cCode=='' && $("#role")=="1"){ |
| | | Feng.info("请选择市") |
| | | return; |
| | | } |
| | | if(name==''){ |
| | | Feng.info("门店名称不能为空") |
| | | return; |
| | | } |
| | | if(phone==''){ |
| | | Feng.info("联系电话不能为空") |
| | | return; |
| | | } |
| | | |
| | | let address = $("#address").val() |
| | | |
| | | if(address==''){ |
| | | Feng.info("请输入地址") |
| | | return; |
| | | } |
| | | let time = $("#time").val() |
| | | |
| | | if(time==''){ |
| | | Feng.info("请填写营业时间") |
| | | return; |
| | | } |
| | | let intro = $("#intro").val() |
| | | |
| | | if(intro==''){ |
| | | Feng.info("请填写门店介绍") |
| | | return; |
| | | } |
| | | let userName = $("#userName").val() |
| | | |
| | | if(userName==''){ |
| | | Feng.info("请输入店长姓名") |
| | | return; |
| | | } |
| | | let userPhone = $("#userPhone").val() |
| | | |
| | | if(userPhone==''){ |
| | | Feng.info("请输入店长手机号") |
| | | return; |
| | | } |
| | | let img = $("#img").val() |
| | | |
| | | |
| | | let imgOne = $("#imgOne").val() |
| | | |
| | | if(imgOne==''){ |
| | | Feng.info("请上传实景图") |
| | | return; |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/update", function(data){ |
| | | if(data=="5001"){ |
| | | Feng.error("该店长手机号已经存在!") |
| | | }else |
| | | if(data.code == 200){ |
| | | if(language==1){ |
| | | Feng.success("修改成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("Modify successfully!"); |
| | | }else { |
| | | Feng.success("Mengubah dengan sukses!"); |
| | | } |
| | | window.parent.TCompetition.table.refresh(); |
| | | TCarInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | },function(data){ |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("provinceCode",pCode); |
| | | ajax.set("cityCode",cCode); |
| | | ajax.set("name",name); |
| | | ajax.set("phone",phone); |
| | | ajax.set("cityManagerId",account); |
| | | ajax.set("address",address); |
| | | ajax.set("time",time); |
| | | ajax.set("introduce",intro); |
| | | ajax.set("userName",userName); |
| | | ajax.set("userPhone",userPhone); |
| | | ajax.set("coverDrawing",img); |
| | | ajax.set("realPicture",imgOne); |
| | | ajax.set("id",$("#id").val()); |
| | | ajax.start(); |
| | | } |
| | | |
| | | $(function() { |
| | | Feng.initValidator("carInfoForm", TCarInfoDlg.validateFields); |
| | | // 初始化图片上传 |
| | | var carPhoto = new $WebUpload("c1"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c2"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c3"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c4"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c5"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c6"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c7"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c8"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("img"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var drivingLicensePhoto = new $WebUpload("drivingLicensePhoto"); |
| | | drivingLicensePhoto.setUploadBarId("progressBar"); |
| | | drivingLicensePhoto.init(); |
| | | |
| | | //地图搜索 |
| | | TCarInfoDlg.searchByStationName(); |
| | | }); |
| | | |
| | | /** |
| | | * 选择分公司后执行 |
| | | */ |
| | | TCarInfoDlg.oneChange = function (e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/onChange", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择市</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Choose your franchisee</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih franchisee Anda</option>'; |
| | | } |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.code+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#cCode").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 类型改变执行 |
| | | * @param e |
| | | */ |
| | | TCarInfoDlg.companyTypeClick = function (e) { |
| | | if (1 == e){ |
| | | $(".companyDiv").hide(); |
| | | } else if (2 == e){ |
| | | $(".companyDiv").show(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 车辆品牌改变时执行 |
| | | */ |
| | | TCarInfoDlg.saveAllImg = function (e) { |
| | | var id = $("#id").val() |
| | | var px1 = $("#px1").val() |
| | | var px2 = $("#px2").val() |
| | | var px3 = $("#px3").val() |
| | | var px4 = $("#px4").val() |
| | | var px5 = $("#px5").val() |
| | | var px6 = $("#px6").val() |
| | | var px7 = $("#px7").val() |
| | | var px8 = $("#px8").val() |
| | | var c1 = $("#c1").val() |
| | | var c2 = $("#c2").val() |
| | | var c3 = $("#c3").val() |
| | | var c4 = $("#c4").val() |
| | | var c5 = $("#c5").val() |
| | | var c6 = $("#c6").val() |
| | | var c7 = $("#7").val() |
| | | var c8 = $("#c8").val() |
| | | var r1 = document.querySelector('input[name="r1"]').checked; |
| | | var r2 = document.querySelector('input[name="r2"]').checked; |
| | | var r3 = document.querySelector('input[name="r3"]').checked; |
| | | var r4 = document.querySelector('input[name="r4"]').checked; |
| | | var r5 = document.querySelector('input[name="r5"]').checked; |
| | | var r6 = document.querySelector('input[name="r6"]').checked; |
| | | var r7 = document.querySelector('input[name="r7"]').checked; |
| | | var r8 = document.querySelector('input[name="r8"]').checked; |
| | | if(r1){ |
| | | r1 =1 |
| | | }else{ |
| | | r1=0 |
| | | } |
| | | if(r2){ |
| | | r2 =1 |
| | | }else{ |
| | | r2=0 |
| | | } |
| | | if(r3){ |
| | | r3 =1 |
| | | }else{ |
| | | r3=0 |
| | | } |
| | | if(r4){ |
| | | r4 =1 |
| | | }else{ |
| | | r4=0 |
| | | } |
| | | if(r5){ |
| | | r5 =1 |
| | | }else{ |
| | | r5=0 |
| | | } |
| | | if(r6){ |
| | | r6 =1 |
| | | }else{ |
| | | r6=0 |
| | | } |
| | | if(r7){ |
| | | r7 =1 |
| | | }else{ |
| | | r7=0 |
| | | } |
| | | if(r8){ |
| | | r8 =1 |
| | | }else{ |
| | | r8=0 |
| | | } |
| | | |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/saveImgAll", function(data){ |
| | | if(data.code == 200){ |
| | | Feng.success("保存成功!"); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | },function(data){ |
| | | Feng.error("保存失败!" + data.responseJSON.message + "!"); |
| | | |
| | | }); |
| | | ajax.set("id",id); |
| | | ajax.set("px1",px1); |
| | | ajax.set("px2",px2); |
| | | ajax.set("px3",px3); |
| | | ajax.set("px4",px4); |
| | | ajax.set("px5",px5); |
| | | ajax.set("px6",px6); |
| | | ajax.set("px7",px7); |
| | | ajax.set("px8",px8); |
| | | ajax.set("c1",c1); |
| | | ajax.set("c2",c2); |
| | | ajax.set("c3",c3); |
| | | ajax.set("c4",c4); |
| | | ajax.set("c5",c5); |
| | | ajax.set("c6",c6); |
| | | ajax.set("c7",c7); |
| | | ajax.set("c8",c8); |
| | | ajax.set("r1",r1); |
| | | ajax.set("r2",r2); |
| | | ajax.set("r3",r3); |
| | | ajax.set("r4",r4); |
| | | ajax.set("r5",r5); |
| | | ajax.set("r6",r6); |
| | | ajax.set("r7",r7); |
| | | ajax.set("r8",r8); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 专车服务被点击 |
| | | */ |
| | | TCarInfoDlg.zcServerClick = function () { |
| | | var serverBox1 = $('#serverBox1').prop('checked'); |
| | | if (serverBox1){ |
| | | $("#zcModelDiv").show(); |
| | | } else { |
| | | $("#zcModelDiv").hide(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 跨城服务被点击 |
| | | */ |
| | | TCarInfoDlg.kcServerClick = function () { |
| | | var serverBox3 = $('#serverBox3').prop('checked'); |
| | | if (serverBox3){ |
| | | $("#kcModelDiv").show(); |
| | | } else { |
| | | $("#kcModelDiv").hide(); |
| | | } |
| | | } |
| | |
| | | insuranceEndTime:"", |
| | | name:"", |
| | | insuranceImg:"", |
| | | managementPlan:"" |
| | | managementPlan:"", |
| | | operatorId:"", |
| | | typeName:"", |
| | | nextName:"" |
| | | }; |
| | | data.province = $("#pCode").val() |
| | | data.city = $("#cCode").val() |
| | |
| | | data.name = $("#name").val() |
| | | data.insuranceImg = $("#img").val() |
| | | data.managementPlan = $('#courseVideo').val() |
| | | data.typeName = $('#siteTypeOne').val() |
| | | var sh =data.appointmentStartTime.split(':')[0]; |
| | | var sm =data.appointmentStartTime.split(':')[1]; |
| | | var eh =data.appointmentEndTime.split(':')[0]; |
| | | var em =data.appointmentEndTime.split(':')[1]; |
| | | if($("#pCode").val()==''){ |
| | | Feng.info("请选择省") |
| | | return; |
| | | |
| | | var SelectValue=""; |
| | | var getSelectValueMenbers = $("input[name='pt']:checked").each(function(j) { |
| | | if (j >= 0) { |
| | | SelectValue += $(this).val() |
| | | } |
| | | }); |
| | | if(SelectValue==''){ |
| | | let yys = $("#yys").val() |
| | | if(yys==""){ |
| | | Feng.info("请选择运营商") |
| | | return; |
| | | } |
| | | SelectValue= yys |
| | | } |
| | | if($("#cCode").val()==''){ |
| | | Feng.info("请选择市") |
| | | return; |
| | | data.operatorId= SelectValue; |
| | | |
| | | |
| | | |
| | | let num24 = $('input[name="name1"]'); |
| | | var nextName=""; |
| | | for (let i = 0; i < num24.length; i++) { |
| | | if(console.log($(num24[i]).val()=='')){ |
| | | Feng.info("请填写场地名称") |
| | | return; |
| | | } |
| | | if(i==num24.length-1){ |
| | | nextName += $(num24[i]).val() |
| | | }else { |
| | | nextName += $(num24[i]).val()+"," |
| | | } |
| | | } |
| | | console.log(nextName) |
| | | data.nextName= nextName; |
| | | |
| | | |
| | | |
| | | if($("#account").val()=='' ){ |
| | | Feng.info("请选择账号") |
| | | return; |
| | |
| | | return; |
| | | } |
| | | if($("#siteTypeId").val()=='' ){ |
| | | Feng.info("请选择场地类型") |
| | | Feng.info("请选择场地分类") |
| | | return; |
| | | } |
| | | if($("#name").val()==''){ |
| | |
| | | var rStime = ""; //门店的经营开始时间 |
| | | var rEtime = ""; //门店的经营结束时间 |
| | | var selectedText = $('#store option:selected').text(); |
| | | $.ajax({ |
| | | url: Feng.ctxPath + "/tSite/getTime/" + selectedText, |
| | | type: "GET", |
| | | contentType: "application/json", // 设置请求头的 Content-Type |
| | | success: function (response) { |
| | | rStime = response.startTime; |
| | | sh = rStime.split(':')[0];// 门店经营开始时间:小时 |
| | | sm = rStime.split(':')[1];// 门店经营开始时间:分钟 |
| | | |
| | | rEtime = response.endTime; |
| | | eh = rEtime.split(':')[0];// 门店经营结束时间:小时 |
| | | em = rEtime.split(':')[1];// 门店经营结束时间:分钟 |
| | | |
| | | var start = sTime.value; |
| | | var startHour = start.split(':')[0]; // 输入的可预约开始时间:小时 |
| | | var startMinute = start.split(':')[1];// 输入的可预约开始时间:分钟 |
| | | if (Number(sh)>Number(startHour)){ |
| | | Feng.error("预约的开始时间不应小于营业开始时间!") |
| | | return false; |
| | | }else if(Number(sh) === Number(startHour) ){ |
| | | if (Number(sm)>Number(startMinute)){ |
| | | Feng.error("预约的开始时间不应大于营业开始时间!") |
| | | return false; |
| | | } |
| | | }else if (Number(eh)<Number(startHour)){ |
| | | Feng.error("预约的开始时间不应大于营业结束时间!") |
| | | return false; |
| | | }else if(Number(eh)===Number(startHour)){ |
| | | Feng.error("预约的开始时间不应大于等于营业结束时间!") |
| | | return false; |
| | | } |
| | | var end = eTime.value; |
| | | var endHour = end.split(':')[0]; // 输入的可预约结束时间:小时 |
| | | var endMinute = end.split(':')[1];// 输入的可预约结束时间:分钟 |
| | | if (Number(eh)<Number(endHour)){ |
| | | Feng.error("预约的结束时间不应大于营业结束时间!") |
| | | return ; |
| | | }else if(Number(eh) === Number(endHour) ){ |
| | | if (Number(em)<Number(endMinute)){ |
| | | Feng.error("预约的开始时间不应大于开始营业时间!") |
| | | return ; |
| | | } |
| | | }else if(Number(sh)>Number(endHour)){ |
| | | Feng.error("预约的结束时间不应小于营业开始时间!") |
| | | return ; |
| | | } |
| | | if (Number(endHour)===Number(sh)){ |
| | | if(Number(endMinute) < Number(sm)){ |
| | | Feng.error("预约结束时间不应小于营业开始时间"); |
| | | return; |
| | | } |
| | | } |
| | | if (Number(startHour)===Number(endHour) && Number(startMinute)===Number(endMinute)){ |
| | | Feng.error("至少预约半个小时"); |
| | | return; |
| | | } |
| | | $.ajax({ |
| | | url: Feng.ctxPath + "/tSite/addSite" , |
| | | type: "POST", |
| | | data: JSON.stringify(data), |
| | | contentType: "application/json", |
| | | success: function (response) { |
| | | window.parent.TSite.table.refresh(); |
| | | TSite.close(); |
| | | Feng.success("添加成功"); |
| | | }, |
| | | error: function (xhr, status, error) { |
| | | Feng.error("添加失败!" + error); |
| | | } |
| | | }); |
| | | }, |
| | | error: function (xhr, status, error) { |
| | | var errorMessage = xhr.responseText ? xhr.responseText : "上架失败!"; |
| | | Feng.error("您的网络异常!"); |
| | | return false; |
| | | } |
| | | }); |
| | | // $.ajax({ |
| | | // url: Feng.ctxPath + "/tSite/getTime/" + selectedText, |
| | | // type: "GET", |
| | | // contentType: "application/json", // 设置请求头的 Content-Type |
| | | // success: function (response) { |
| | | // rStime = response.startTime; |
| | | // sh = rStime.split(':')[0];// 门店经营开始时间:小时 |
| | | // sm = rStime.split(':')[1];// 门店经营开始时间:分钟 |
| | | // |
| | | // rEtime = response.endTime; |
| | | // eh = rEtime.split(':')[0];// 门店经营结束时间:小时 |
| | | // em = rEtime.split(':')[1];// 门店经营结束时间:分钟 |
| | | // |
| | | // var start = sTime.value; |
| | | // var startHour = start.split(':')[0]; // 输入的可预约开始时间:小时 |
| | | // var startMinute = start.split(':')[1];// 输入的可预约开始时间:分钟 |
| | | // if (Number(sh)>Number(startHour)){ |
| | | // Feng.error("预约的开始时间不应小于营业开始时间!") |
| | | // return false; |
| | | // }else if(Number(sh) === Number(startHour) ){ |
| | | // if (Number(sm)>Number(startMinute)){ |
| | | // Feng.error("预约的开始时间不应大于营业开始时间!") |
| | | // return false; |
| | | // } |
| | | // }else if (Number(eh)<Number(startHour)){ |
| | | // Feng.error("预约的开始时间不应大于营业结束时间!") |
| | | // return false; |
| | | // }else if(Number(eh)===Number(startHour)){ |
| | | // Feng.error("预约的开始时间不应大于等于营业结束时间!") |
| | | // return false; |
| | | // } |
| | | // var end = eTime.value; |
| | | // var endHour = end.split(':')[0]; // 输入的可预约结束时间:小时 |
| | | // var endMinute = end.split(':')[1];// 输入的可预约结束时间:分钟 |
| | | // if (Number(eh)<Number(endHour)){ |
| | | // Feng.error("预约的结束时间不应大于营业结束时间!") |
| | | // return ; |
| | | // }else if(Number(eh) === Number(endHour) ){ |
| | | // if (Number(em)<Number(endMinute)){ |
| | | // Feng.error("预约的开始时间不应大于开始营业时间!") |
| | | // return ; |
| | | // } |
| | | // }else if(Number(sh)>Number(endHour)){ |
| | | // Feng.error("预约的结束时间不应小于营业开始时间!") |
| | | // return ; |
| | | // } |
| | | // if (Number(endHour)===Number(sh)){ |
| | | // if(Number(endMinute) < Number(sm)){ |
| | | // Feng.error("预约结束时间不应小于营业开始时间"); |
| | | // return; |
| | | // } |
| | | // } |
| | | // if (Number(startHour)===Number(endHour) && Number(startMinute)===Number(endMinute)){ |
| | | // Feng.error("至少预约半个小时"); |
| | | // return; |
| | | // } |
| | | // $.ajax({ |
| | | // url: Feng.ctxPath + "/tSite/addSite" , |
| | | // type: "POST", |
| | | // data: JSON.stringify(data), |
| | | // contentType: "application/json", |
| | | // success: function (response) { |
| | | // window.parent.TSite.table.refresh(); |
| | | // TSite.close(); |
| | | // Feng.success("添加成功"); |
| | | // }, |
| | | // error: function (xhr, status, error) { |
| | | // Feng.error("添加失败!" + error); |
| | | // } |
| | | // }); |
| | | // }, |
| | | // error: function (xhr, status, error) { |
| | | // var errorMessage = xhr.responseText ? xhr.responseText : "上架失败!"; |
| | | // Feng.error("您的网络异常!"); |
| | | // return false; |
| | | // } |
| | | // }); |
| | | }; |
| | | |
| | | TSite.search = function () { |
| | |
| | | } |
| | | |
| | | $(function () { |
| | | //初始化编辑器 |
| | | TSite.editor = UE.getEditor('editor'); |
| | | // 限制分钟选项为 0 和 30 |
| | | var timeInputs = document.querySelectorAll('input[type="time"]'); |
| | | timeInputs.forEach(function(input) { |
| | |
| | | return '<a href="javascript:void(0);" style="color: blue" onclick="TbBanner.updateState1(' + row.id +')">正常</a>' |
| | | } |
| | | if(value==2){ |
| | | return '<a href="javascript:void(0);" style="color: red" onclick="TbBanner.updateState2(' + row.id +')">隐藏</a>' |
| | | return '<a href="javascript:void(0);" style="color: red" onclick="TbBanner.updateState2(' + row.id +')">隐藏</a>' |
| | | } |
| | | }else if(language==2){ |
| | | if(value==1){ |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.PrintWriter; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | @ResponseBody |
| | | @PostMapping("/api/site/queryMySiteById") |
| | | @ApiOperation(value = "获取我的预约场地列表详情2.0", tags = {"用户—预约场地"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "id", name = "id", dataType = "int", required = true), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | }) |
| | | public ResultUtil<SiteBooking> queryMySiteById(Integer id){ |
| | | try { |
| | | SiteBooking byId = siteBookingService.getById(id); |
| | | return ResultUtil.success(byId); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
New file |
| | |
| | | package com.dsh.other.controller; |
| | | |
| | | |
| | | import cn.hutool.http.HttpRequest; |
| | | import cn.hutool.http.HttpResponse; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.other.entity.Phone; |
| | | import com.dsh.other.entity.Store; |
| | | import com.dsh.other.entity.StoreEvaluation; |
| | | import com.dsh.other.service.PhoneService; |
| | | import com.dsh.other.service.StoreService; |
| | | import com.dsh.other.service.TGameConfigService; |
| | | import com.dsh.other.service.TGameService; |
| | | import com.dsh.other.util.ResultUtil; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 客服电话 控制器 |
| | | */ |
| | | |
| | | @Controller |
| | | @RequestMapping("") |
| | | public class TGameController { |
| | | |
| | | @Resource |
| | | private TGameService gameService; |
| | | @Resource |
| | | private TGameConfigService gameConfigService; |
| | | |
| | | @Resource |
| | | private StoreService storeService; |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/game/getSpaceId") |
| | | @ApiOperation(value = "智慧球场-获取场地id", tags = {"APP-智慧球场"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "场地名称", name = "name", required = true, dataType = "String"), |
| | | }) |
| | | public ResultUtil getSpaceId(String name){ |
| | | try { |
| | | HttpRequest httpRequest = HttpRequest.get("https://try.daowepark.com/v7/user_api/general/space_list?page=1&page_num=100"); |
| | | HttpResponse execute = httpRequest.execute(); |
| | | String body = execute.body(); |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | HttpRequest httpRequest = HttpRequest.get("https://try.daowepark.com/v7/user_api/general/space_list?page=1&page_num=100"); |
| | | HttpResponse execute = httpRequest.execute(); |
| | | String body = execute.body(); |
| | | System.out.println(body); |
| | | } |
| | | } |
| | |
| | | private String imgs; |
| | | @TableField("introduce") |
| | | private String introduce; |
| | | @TableField("是否半场 1是 2否") |
| | | @TableField("ishalf") |
| | | private Integer ishalf; |
| | | @TableField("场地名称 多个逗号分割") |
| | | @TableField("nextName") |
| | | private String nextName; |
| | | @TableField("半场名称 多个逗号分割") |
| | | @TableField("halfName") |
| | | private String halfName; |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | |
| | | * 预约开始时间 |
| | | */ |
| | | @TableField("startTime") |
| | | @ApiModelProperty("预约开始时间") |
| | | private Date startTime; |
| | | /** |
| | | * 预约结束 |
| | | */ |
| | | @TableField("endTime") |
| | | @ApiModelProperty("预约结束时间") |
| | | private Date endTime; |
| | | /** |
| | | * 预约人 |
| | | */ |
| | | @TableField("booker") |
| | | @ApiModelProperty("预约人") |
| | | private String booker; |
| | | /** |
| | | * 联系方式 |
| | | */ |
| | | @TableField("phone") |
| | | @ApiModelProperty("联系方式") |
| | | private String phone; |
| | | /** |
| | | * 支付方式(1=微信,2=支付宝,3=玩湃比,4=手动支付) |
| | |
| | | * 支付时间 |
| | | */ |
| | | @TableField("payTime") |
| | | @ApiModelProperty("支付时间") |
| | | private Date payTime; |
| | | /** |
| | | * 支付金额 |
| | | */ |
| | | @TableField("payMoney") |
| | | @ApiModelProperty("支付金额") |
| | | private Double payMoney; |
| | | /** |
| | | * 优惠券id |
| | |
| | | * 状态(0=待支付,1=待核销,2=已到店,3=已完成,4=已过期,5=已取消) |
| | | */ |
| | | @TableField("status") |
| | | @ApiModelProperty("0=待支付,1=待核销,2=已到店,3=已完成,4=已过期,5=已取消") |
| | | private Integer status; |
| | | /** |
| | | * 第三方支付流水号 |
| | |
| | | @TableField("insertTime") |
| | | private Date insertTime; |
| | | @TableField("nextName") |
| | | @ApiModelProperty("场地名称") |
| | | private String nextName; |
| | | @TableField("isHalf") |
| | | @ApiModelProperty("半场 是否半场 1是 2否") |
| | | private Integer isHalf; |
| | | @TableField("halfName") |
| | | @ApiModelProperty("半场名称 ") |
| | | private String halfName; |
| | | @TableField("goType") |
| | | private Integer goType; |
New file |
| | |
| | | package com.dsh.other.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 智慧球场 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-18 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_game") |
| | | public class TGame extends Model<TGame> { |
| | | |
| | | private static final long serialVersionUID=1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 运营商id 0为平台 |
| | | */ |
| | | @TableField("operationId") |
| | | private Integer operationId; |
| | | |
| | | /** |
| | | * 省 |
| | | */ |
| | | private String province; |
| | | |
| | | /** |
| | | * 省code |
| | | */ |
| | | @TableField("provinceCode") |
| | | private String provinceCode; |
| | | |
| | | /** |
| | | * 市 |
| | | */ |
| | | private String city; |
| | | |
| | | /** |
| | | * 市code |
| | | */ |
| | | @TableField("cityCode") |
| | | private String cityCode; |
| | | |
| | | /** |
| | | * 门店id |
| | | */ |
| | | @TableField("storeId") |
| | | private Integer storeId; |
| | | |
| | | /** |
| | | * 场地id |
| | | */ |
| | | @TableField("siteId") |
| | | private Integer siteId; |
| | | |
| | | /** |
| | | * 蓝色方id |
| | | */ |
| | | private String blue; |
| | | |
| | | /** |
| | | * 红方id |
| | | */ |
| | | private String red; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.entity; |
| | | |
| | | import java.math.BigDecimal; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 游戏配置 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-18 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_game_config") |
| | | public class TGameConfig extends Model<TGameConfig> { |
| | | |
| | | private static final long serialVersionUID=1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 名称 |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * 图 |
| | | */ |
| | | private String img; |
| | | |
| | | /** |
| | | * 玩湃币 |
| | | */ |
| | | @TableField("playCoin") |
| | | private BigDecimal playCoin; |
| | | |
| | | /** |
| | | * 现金 |
| | | */ |
| | | private BigDecimal cash; |
| | | |
| | | /** |
| | | * 积分 |
| | | */ |
| | | private BigDecimal integral; |
| | | |
| | | /** |
| | | * 游戏id |
| | | */ |
| | | @TableField("gameId") |
| | | private Integer gameId; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.mapper; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.other.entity.TGameConfig; |
| | | |
| | | /** |
| | | * <p> |
| | | * 游戏配置 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-18 |
| | | */ |
| | | public interface TGameConfigMapper extends BaseMapper<TGameConfig> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.other.entity.TGame; |
| | | |
| | | /** |
| | | * <p> |
| | | * 智慧球场 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-18 |
| | | */ |
| | | public interface TGameMapper extends BaseMapper<TGame> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.service; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.other.entity.TGameConfig; |
| | | |
| | | /** |
| | | * <p> |
| | | * 游戏配置 服务类 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-18 |
| | | */ |
| | | public interface TGameConfigService extends IService<TGameConfig> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.service; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.other.entity.TGame; |
| | | |
| | | /** |
| | | * <p> |
| | | * 智慧球场 服务类 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-18 |
| | | */ |
| | | public interface TGameService extends IService<TGame> { |
| | | |
| | | } |
| | |
| | | ArrayList<String> halfName = new ArrayList<>(); |
| | | String nextName1 = site.getNextName(); |
| | | String halfName1 = site.getHalfName(); |
| | | |
| | | querySiteInfoVo.setIshalf(site.getIshalf()); |
| | | String[] split = nextName1.split(","); |
| | | for (String s : split) { |
| | | nextName.add(s); |
| | |
| | | SiteBooking siteBooking = siteBookingService.getById(queryMySiteVo.getId()); |
| | | Site site = this.getById(siteBooking.getSiteId()); |
| | | String[] split = siteBooking.getTimes().split(";"); |
| | | queryMySiteVo.setPlayPaiCoin(site.getPlayPaiCoin() * split.length); |
| | | if(site!=null){ |
| | | |
| | | queryMySiteVo.setPlayPaiCoin(site.getPlayPaiCoin() * split.length); |
| | | } |
| | | } |
| | | return queryMySiteVos; |
| | | } |
New file |
| | |
| | | package com.dsh.other.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.other.entity.TGameConfig; |
| | | import com.dsh.other.mapper.TGameConfigMapper; |
| | | import com.dsh.other.service.TGameConfigService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 游戏配置 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-18 |
| | | */ |
| | | @Service |
| | | public class TGameConfigServiceImpl extends ServiceImpl<TGameConfigMapper, TGameConfig> implements TGameConfigService { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.service.impl; |
| | | |
| | | import com.dsh.other.entity.TGame; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.other.mapper.TGameMapper; |
| | | import com.dsh.other.service.TGameService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 智慧球场 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-18 |
| | | */ |
| | | @Service |
| | | public class TGameServiceImpl extends ServiceImpl<TGameMapper, TGame> implements TGameService { |
| | | |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dsh.other.mapper.TGameConfigMapper"> |
| | | |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dsh.other.mapper.TGameMapper"> |
| | | |
| | | |
| | | </mapper> |