Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/PlayPai
Conflicts:
cloud-server-management/src/main/webapp/WEB-INF/view/system/dataStatistics/platformIncome.html
58个文件已修改
1个文件已删除
46个文件已添加
| | |
| | | <select /> |
| | | </component> |
| | | <component name="ChangeListManager"> |
| | | <list default="true" id="cb08d02f-fd4f-4fa2-85fe-abd508fa83ac" name="Default Changelist" comment="10.8"> |
| | | <list default="true" id="cb08d02f-fd4f-4fa2-85fe-abd508fa83ac" name="Default Changelist" comment="10.8。1"> |
| | | <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> |
| | | <change beforePath="$PROJECT_DIR$/cloud-server-course/src/main/java/com/dsh/course/service/impl/CourseCounsumServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-server-course/src/main/java/com/dsh/course/service/impl/CourseCounsumServiceImpl.java" afterDir="false" /> |
| | | <change beforePath="$PROJECT_DIR$/cloud-server-management/src/main/java/com/dsh/course/mapper/StoreMapper.java" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-server-management/src/main/java/com/dsh/course/mapper/StoreMapper.java" afterDir="false" /> |
| | | <change beforePath="$PROJECT_DIR$/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCoursePackageController.java" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCoursePackageController.java" afterDir="false" /> |
| | | <change beforePath="$PROJECT_DIR$/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/BallController.java" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/BallController.java" afterDir="false" /> |
| | | <change beforePath="$PROJECT_DIR$/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/IStoreService.java" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/IStoreService.java" afterDir="false" /> |
| | | <change beforePath="$PROJECT_DIR$/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/impl/StoreServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/impl/StoreServiceImpl.java" afterDir="false" /> |
| | | <change beforePath="$PROJECT_DIR$/cloud-server-management/src/main/resources/mapper/TStoreMapper.xml" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-server-management/src/main/resources/mapper/TStoreMapper.xml" afterDir="false" /> |
| | | <change beforePath="$PROJECT_DIR$/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_add.html" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_add.html" afterDir="false" /> |
| | | <change beforePath="$PROJECT_DIR$/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_edit.html" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_edit.html" afterDir="false" /> |
| | | <change beforePath="$PROJECT_DIR$/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/yuyue.html" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/yuyue.html" afterDir="false" /> |
| | | <change beforePath="$PROJECT_DIR$/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/yuyue_add.html" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/yuyue_add.html" afterDir="false" /> |
| | | <change beforePath="$PROJECT_DIR$/cloud-server-management/src/main/webapp/WEB-INF/view/system/coursePackage/coursePackage_add.html" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-server-management/src/main/webapp/WEB-INF/view/system/coursePackage/coursePackage_add.html" afterDir="false" /> |
| | | <change beforePath="$PROJECT_DIR$/cloud-server-management/src/main/webapp/WEB-INF/view/system/coursePackage/coursePackage_edit.html" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-server-management/src/main/webapp/WEB-INF/view/system/coursePackage/coursePackage_edit.html" afterDir="false" /> |
| | | <change beforePath="$PROJECT_DIR$/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCompetition/TCompetition_add.html" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCompetition/TCompetition_add.html" afterDir="false" /> |
| | | <change beforePath="$PROJECT_DIR$/cloud-server-management/src/main/webapp/static/modular/system/ball/yuyue.js" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-server-management/src/main/webapp/static/modular/system/ball/yuyue.js" afterDir="false" /> |
| | | <change beforePath="$PROJECT_DIR$/cloud-server-management/src/main/webapp/static/modular/system/ball/yuyue_info.js" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-server-management/src/main/webapp/static/modular/system/ball/yuyue_info.js" afterDir="false" /> |
| | | <change beforePath="$PROJECT_DIR$/cloud-server-other/src/main/java/com/dsh/other/entity/SiteBooking.java" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-server-other/src/main/java/com/dsh/other/entity/SiteBooking.java" afterDir="false" /> |
| | | <change beforePath="$PROJECT_DIR$/cloud-server-management/src/main/webapp/static/modular/system/coursePackage/coursePackage.js" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-server-management/src/main/webapp/static/modular/system/coursePackage/coursePackage.js" afterDir="false" /> |
| | | <change beforePath="$PROJECT_DIR$/cloud-server-other/src/main/java/com/dsh/other/controller/BallController.java" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-server-other/src/main/java/com/dsh/other/controller/BallController.java" afterDir="false" /> |
| | | <change beforePath="$PROJECT_DIR$/cloud-server-other/src/main/resources/mapper/GameMapper.xml" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-server-other/src/main/resources/mapper/GameMapper.xml" afterDir="false" /> |
| | | </list> |
| | | <option name="SHOW_DIALOG" value="false" /> |
| | | <option name="HIGHLIGHT_CONFLICTS" value="true" /> |
| | |
| | | <option name="hideEmptyMiddlePackages" value="true" /> |
| | | <option name="showLibraryContents" value="true" /> |
| | | </component> |
| | | <component name="PropertiesComponent">{ |
| | | "keyToString": { |
| | | "DefaultHtmlFileTemplate": "HTML File", |
| | | "RequestMappingsPanelOrder0": "0", |
| | | "RequestMappingsPanelOrder1": "1", |
| | | "RequestMappingsPanelWidth0": "75", |
| | | "RequestMappingsPanelWidth1": "75", |
| | | "RunOnceActivity.OpenProjectViewOnStart": "true", |
| | | "RunOnceActivity.ShowReadmeOnStart": "true", |
| | | "WebServerToolWindowFactoryState": "false", |
| | | "git-widget-placeholder": "master", |
| | | "ignore.virus.scanning.warn.message": "true", |
| | | "last_opened_file_path": "D:/Javaproject/PlayPay/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball", |
| | | "node.js.detected.package.eslint": "true", |
| | | "node.js.detected.package.tslint": "true", |
| | | "node.js.selected.package.eslint": "(autodetect)", |
| | | "node.js.selected.package.tslint": "(autodetect)", |
| | | "nodejs_package_manager_path": "npm", |
| | | "project.structure.last.edited": "模块", |
| | | "project.structure.proportion": "0.15", |
| | | "project.structure.side.proportion": "0.54367816", |
| | | "service.view.auto.scroll.to.source": "true", |
| | | "settings.editor.selected.configurable": "preferences.pluginManager", |
| | | "spring.configuration.checksum": "6e27eb92c8707375af194da5aa857bbc", |
| | | "vue.rearranger.settings.migration": "true" |
| | | <component name="PropertiesComponent"><![CDATA[{ |
| | | "keyToString": { |
| | | "DefaultHtmlFileTemplate": "HTML File", |
| | | "RequestMappingsPanelOrder0": "0", |
| | | "RequestMappingsPanelOrder1": "1", |
| | | "RequestMappingsPanelWidth0": "75", |
| | | "RequestMappingsPanelWidth1": "75", |
| | | "RunOnceActivity.OpenProjectViewOnStart": "true", |
| | | "RunOnceActivity.ShowReadmeOnStart": "true", |
| | | "WebServerToolWindowFactoryState": "false", |
| | | "git-widget-placeholder": "master", |
| | | "ignore.virus.scanning.warn.message": "true", |
| | | "last_opened_file_path": "D:/Javaproject/PlayPay/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball", |
| | | "node.js.detected.package.eslint": "true", |
| | | "node.js.detected.package.tslint": "true", |
| | | "node.js.selected.package.eslint": "(autodetect)", |
| | | "node.js.selected.package.tslint": "(autodetect)", |
| | | "nodejs_package_manager_path": "npm", |
| | | "project.structure.last.edited": "模块", |
| | | "project.structure.proportion": "0.15", |
| | | "project.structure.side.proportion": "0.54367816", |
| | | "service.view.auto.scroll.to.source": "true", |
| | | "settings.editor.selected.configurable": "preferences.lookFeel", |
| | | "spring.configuration.checksum": "6e27eb92c8707375af194da5aa857bbc", |
| | | "vue.rearranger.settings.migration": "true" |
| | | } |
| | | }</component> |
| | | }]]></component> |
| | | <component name="ReactorSettings"> |
| | | <option name="notificationShown" value="true" /> |
| | | </component> |
| | | <component name="RecentsManager"> |
| | | <key name="CopyFile.RECENT_KEYS"> |
| | | <recent name="D:\Javaproject\PlayPay\cloud-server-management\src\main\webapp\WEB-INF\view\system\ball" /> |
| | | <recent name="D:\Javaproject\PlayPay\cloud-server-account\src\test\java\com\dsh" /> |
| | | <recent name="D:\Javaproject\PlayPay\cloud-server-management\src\main\webapp\static\modular\system\ball" /> |
| | | <recent name="D:\Javaproject\PlayPay\cloud-server-course\src\main\resources\mapper" /> |
| | | <recent name="D:\ttt\java\PlayPai\cloud-server-management\src\main\webapp\WEB-INF\view\system\ball" /> |
| | | <recent name="D:\ttt\java\PlayPai\cloud-server-management\src\main\webapp\static\modular\system\ball" /> |
| | | </key> |
| | | <key name="MoveFile.RECENT_KEYS"> |
| | | <recent name="D:\JavaTool\PlayPai1\cloud-server-management\src\main\webapp\static\modular\system\tStudent" /> |
| | |
| | | <option name="ENABLED" value="true" /> |
| | | </pattern> |
| | | </extension> |
| | | <method v="2"> |
| | | <option name="Make" enabled="true" /> |
| | | </method> |
| | | </configuration> |
| | | <configuration name="AccountApplicationTests.contextLoads" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true"> |
| | | <module name="mb-cloud-account" /> |
| | | <shortenClasspath name="MANIFEST" /> |
| | | <extension name="coverage"> |
| | | <pattern> |
| | | <option name="PATTERN" value="com.dsh.*" /> |
| | | <option name="ENABLED" value="true" /> |
| | | </pattern> |
| | | </extension> |
| | | <option name="PACKAGE_NAME" value="com.dsh" /> |
| | | <option name="MAIN_CLASS_NAME" value="com.dsh.AccountApplicationTests" /> |
| | | <option name="METHOD_NAME" value="contextLoads" /> |
| | | <option name="TEST_OBJECT" value="method" /> |
| | | <method v="2"> |
| | | <option name="Make" enabled="true" /> |
| | | </method> |
| | | </configuration> |
| | | <configuration default="true" type="JUnit" factoryName="JUnit"> |
| | | <shortenClasspath name="MANIFEST" /> |
| | | <option name="TEST_OBJECT" value="class" /> |
| | | <method v="2"> |
| | | <option name="Make" enabled="true" /> |
| | | </method> |
| | |
| | | </method> |
| | | </configuration> |
| | | <list> |
| | | <item itemvalue="Spring Boot.GatewayApplication" /> |
| | | <item itemvalue="JUnit.AccountApplicationTests.contextLoads" /> |
| | | <item itemvalue="Spring Boot.ManagementApplication" /> |
| | | <item itemvalue="Spring Boot.GatewayApplication" /> |
| | | <item itemvalue="Spring Boot.OtherApplication" /> |
| | | <item itemvalue="Spring Boot.UserApplication" /> |
| | | <item itemvalue="Spring Boot.AccountApplication" /> |
| | |
| | | </list> |
| | | <recent_temporary> |
| | | <list> |
| | | <item itemvalue="JUnit.AccountApplicationTests.contextLoads" /> |
| | | <item itemvalue="应用程序.BigDecimalToChineseWords" /> |
| | | </list> |
| | | </recent_temporary> |
| | |
| | | <workItem from="1696433675086" duration="2211000" /> |
| | | <workItem from="1696462020097" duration="481000" /> |
| | | <workItem from="1696465598653" duration="19850000" /> |
| | | <workItem from="1696639362946" duration="45956000" /> |
| | | <workItem from="1696639362946" duration="88523000" /> |
| | | </task> |
| | | <task id="LOCAL-00001" summary="后台代码删除"> |
| | | <created>1690249807612</created> |
| | |
| | | <option name="project" value="LOCAL" /> |
| | | <updated>1696749061197</updated> |
| | | </task> |
| | | <option name="localTasksCounter" value="40" /> |
| | | <task id="LOCAL-00040" summary="10.8。1"> |
| | | <option name="closed" value="true" /> |
| | | <created>1696753188954</created> |
| | | <option name="number" value="00040" /> |
| | | <option name="presentableId" value="LOCAL-00040" /> |
| | | <option name="project" value="LOCAL" /> |
| | | <updated>1696753188954</updated> |
| | | </task> |
| | | <option name="localTasksCounter" value="41" /> |
| | | <servers /> |
| | | </component> |
| | | <component name="TypeScriptGeneratedFilesManager"> |
| | |
| | | <MESSAGE value="9.26。14" /> |
| | | <MESSAGE value="9.26。15" /> |
| | | <MESSAGE value="10.8" /> |
| | | <option name="LAST_COMMIT_MESSAGE" value="10.8" /> |
| | | <MESSAGE value="10.8。1" /> |
| | | <option name="LAST_COMMIT_MESSAGE" value="10.8。1" /> |
| | | </component> |
| | | <component name="XDebuggerManager"> |
| | | <breakpoint-manager> |
| | |
| | | <url>file://$PROJECT_DIR$/cloud-server-course/src/main/java/com/dsh/course/controller/CoursePackagePaymentController.java</url> |
| | | <line>1358</line> |
| | | <option name="timeStamp" value="14" /> |
| | | </line-breakpoint> |
| | | <line-breakpoint enabled="true" type="java-line"> |
| | | <url>file://$PROJECT_DIR$/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCompetitionAuditController.java</url> |
| | | <line>139</line> |
| | | <option name="timeStamp" value="21" /> |
| | | </line-breakpoint> |
| | | </breakpoints> |
| | | </breakpoint-manager> |
| | |
| | | package com.dsh.account.controller; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.dsh.account.dto.SelectDto; |
| | | import com.dsh.account.dto.UserInfoQueryDTO; |
| | | import com.dsh.account.entity.Coach; |
| | | import com.dsh.account.entity.TAppUser; |
| | | import com.dsh.account.entity.TCourseInfoRecord; |
| | |
| | | import com.dsh.account.service.IVipPaymentService; |
| | | import com.dsh.account.service.TAppUserService; |
| | | import com.dsh.account.service.TCourseInfoRecordService; |
| | | import com.dsh.account.util.PayMoneyUtil; |
| | | import com.dsh.account.util.ResultUtil; |
| | | import com.dsh.account.util.TokenUtil; |
| | | import com.dsh.account.util.ToolUtil; |
| | | import com.dsh.account.util.*; |
| | | import com.dsh.account.vo.GroupCityInfoVO; |
| | | import com.dsh.account.vo.UserInfoQueryVO; |
| | | import com.dsh.account.vo.entity.DayData; |
| | | import com.dsh.account.vo.entity.MonthData; |
| | | import com.dsh.account.vo.entity.WeekData; |
| | | import com.dsh.account.vo.entity.YearData; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.PrintWriter; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.util.*; |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private TCourseInfoRecordService courseInfoRecordService; |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | /** |
| | | * 获取所有用户 |
| | |
| | | public ResultUtil<String> loginWeChat(LoginWeChatVo loginWeChatVo){ |
| | | try { |
| | | return appUserService.loginWechat(loginWeChatVo); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | @ResponseBody |
| | | @PostMapping("/base/appUser/bind") |
| | | @ApiOperation(value = "微信登录--绑定手机号", tags = {"APP-登录注册"}) |
| | | @ApiImplicitParams({ |
| | | }) |
| | | public ResultUtil<String> bind(String phone,String openId,String code){ |
| | | try { |
| | | String value = redisUtil.getValue(phone); |
| | | if(!code.equals(value)){ |
| | | return ResultUtil.error("验证码无效", ""); |
| | | } |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getOpenid, openId)); |
| | | TAppUser tAppUser = list.get(0); |
| | | tAppUser.setPhone(phone); |
| | | appUserService.updateById(tAppUser); |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | System.out.println("=======selectDtos======>"+selectDtos); |
| | | return selectDtos; |
| | | } |
| | | |
| | | |
| | | @PostMapping("/appUser/userInfo") |
| | | public UserInfoQueryVO userInfo(@RequestBody UserInfoQueryDTO dto){ |
| | | |
| | | UserInfoQueryVO userInfoQueryVO = new UserInfoQueryVO(); |
| | | |
| | | LambdaQueryWrapper<TAppUser> wrapper = new LambdaQueryWrapper<>(); |
| | | |
| | | if(StringUtils.hasLength(dto.getCityCode())){ |
| | | wrapper.eq(TAppUser::getCityCode,dto.getCityCode()); |
| | | } |
| | | |
| | | if(Objects.nonNull(dto.getOperatorId())){ |
| | | wrapper.eq(TAppUser::getInsertType,2); |
| | | wrapper.eq(TAppUser::getAddUserId,dto.getOperatorId()); |
| | | } |
| | | |
| | | if(Objects.nonNull(dto.getStoreId())){ |
| | | wrapper.eq(TAppUser::getInsertType,3); |
| | | wrapper.eq(TAppUser::getAddUserId,dto.getStoreId()); |
| | | } |
| | | |
| | | // 查询会员总数,年度会员总数 |
| | | int userCount = appUserService.count(wrapper); |
| | | int userVipCount = appUserService.count(wrapper.eq(TAppUser::getIsVip,1)); |
| | | |
| | | userInfoQueryVO.setUserCount(userCount); |
| | | userInfoQueryVO.setUserVipCount(userVipCount); |
| | | |
| | | if(Objects.nonNull(dto.getIsVip())){ |
| | | wrapper.eq(TAppUser::getIsVip,dto.getIsVip()); |
| | | } |
| | | |
| | | // 年度数据 |
| | | List<YearData> yearData = appUserService.getYearUserCount(dto); |
| | | userInfoQueryVO.setYearData(yearData); |
| | | // 月度数据 |
| | | List<MonthData> monthData = appUserService.getMonthUserCount(dto); |
| | | userInfoQueryVO.setMonthData(monthData); |
| | | |
| | | // 获取最近四周 |
| | | LocalDateTime minNow = LocalDateTime.now().with(LocalTime.MIN); |
| | | LocalDateTime maxNow = LocalDateTime.now().with(LocalTime.MAX); |
| | | // 周度数据 |
| | | dto.setStartTime(minNow.minusDays(6).toString()); |
| | | dto.setEndTime(maxNow.toString()); |
| | | WeekData week4 = appUserService.getWeekUserCount4(dto); |
| | | dto.setStartTime(minNow.minusDays(13).toString()); |
| | | dto.setEndTime(maxNow.minusDays(6).toString()); |
| | | WeekData week3 = appUserService.getWeekUserCount3(dto); |
| | | dto.setStartTime(minNow.minusDays(20).toString()); |
| | | dto.setEndTime(maxNow.minusDays(13).toString()); |
| | | WeekData week2 = appUserService.getWeekUserCount2(dto); |
| | | dto.setStartTime(minNow.minusDays(27).toString()); |
| | | dto.setEndTime(maxNow.minusDays(20).toString()); |
| | | WeekData week1 = appUserService.getWeekUserCount1(dto); |
| | | |
| | | List<WeekData> weekDataList = new ArrayList<>(); |
| | | weekDataList.add(week1); |
| | | weekDataList.add(week2); |
| | | weekDataList.add(week3); |
| | | weekDataList.add(week4); |
| | | userInfoQueryVO.setWeekData(weekDataList); |
| | | |
| | | // 日度数据 |
| | | dto.setStartTime(minNow.minusDays(6).toString()); |
| | | dto.setEndTime(maxNow.toString()); |
| | | List<DayData> dayData = appUserService.getDayUserCount(dto); |
| | | userInfoQueryVO.setDayData(dayData); |
| | | return userInfoQueryVO; |
| | | } |
| | | |
| | | @PostMapping("/appUser/ageInfo") |
| | | public Map<String,Long> ageInfo(@RequestBody UserInfoQueryDTO dto){ |
| | | |
| | | Map<String,Long> map = new HashMap<>(); |
| | | |
| | | LambdaQueryWrapper<TAppUser> wrapper = new LambdaQueryWrapper<>(); |
| | | |
| | | if(StringUtils.hasLength(dto.getCityCode())){ |
| | | wrapper.eq(TAppUser::getCityCode,dto.getCityCode()); |
| | | } |
| | | |
| | | if(Objects.nonNull(dto.getOperatorId())){ |
| | | wrapper.eq(TAppUser::getInsertType,2); |
| | | wrapper.eq(TAppUser::getAddUserId,dto.getOperatorId()); |
| | | } |
| | | |
| | | if(Objects.nonNull(dto.getStoreId())){ |
| | | wrapper.eq(TAppUser::getInsertType,3); |
| | | wrapper.eq(TAppUser::getAddUserId,dto.getStoreId()); |
| | | } |
| | | |
| | | List<TAppUser> list = appUserService.list(wrapper); |
| | | // 查询会员 |
| | | list.forEach(tAppUser->tAppUser.setAge(DateUtil.ageOfNow(tAppUser.getBirthday()))); |
| | | |
| | | map.put("age1", list.stream().filter(e -> e.getAge() > 0 && e.getAge() <= 12).count()); |
| | | map.put("age2",list.stream().filter(e -> e.getAge() >= 13 && e.getAge() <= 18).count()); |
| | | map.put("age3",list.stream().filter(e -> e.getAge() >= 19 && e.getAge() <= 25).count()); |
| | | map.put("age4",list.stream().filter(e -> e.getAge() >= 26 && e.getAge() <= 35).count()); |
| | | map.put("age5",list.stream().filter(e -> e.getAge() >= 36 && e.getAge() <= 50).count()); |
| | | map.put("age6",list.stream().filter(e -> e.getAge() >= 51).count()); |
| | | return map; |
| | | } |
| | | |
| | | @PostMapping("/appUser/sexInfo") |
| | | public Map<String,Integer> sexInfo(@RequestBody UserInfoQueryDTO dto){ |
| | | |
| | | Map<String,Integer> map = new HashMap<>(2); |
| | | LambdaQueryWrapper<TAppUser> wrapper = new LambdaQueryWrapper<>(); |
| | | |
| | | if(StringUtils.hasLength(dto.getCityCode())){ |
| | | wrapper.eq(TAppUser::getCityCode,dto.getCityCode()); |
| | | } |
| | | |
| | | if(Objects.nonNull(dto.getOperatorId())){ |
| | | wrapper.eq(TAppUser::getInsertType,2); |
| | | wrapper.eq(TAppUser::getAddUserId,dto.getOperatorId()); |
| | | } |
| | | |
| | | if(Objects.nonNull(dto.getStoreId())){ |
| | | wrapper.eq(TAppUser::getInsertType,3); |
| | | wrapper.eq(TAppUser::getAddUserId,dto.getStoreId()); |
| | | } |
| | | |
| | | // 查询会员 |
| | | int boyCount = appUserService.count(wrapper.eq(TAppUser::getGender,1)); |
| | | int girlCount = appUserService.count(wrapper.eq(TAppUser::getGender,2)); |
| | | map.put("boyCount",boyCount); |
| | | map.put("girlCount",girlCount); |
| | | return map; |
| | | } |
| | | |
| | | @PostMapping("/appUser/groupCityInfo") |
| | | public List<GroupCityInfoVO> groupCityInfo(@RequestBody UserInfoQueryDTO dto){ |
| | | // 查询地区会员 |
| | | return appUserService.groupCityInfo(dto); |
| | | } |
| | | } |
| | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | if(ids.size()==0){ |
| | | ids.add(-1); |
| | | } |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().in(TAppUser::getInsertType, 1)); |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1)); |
| | | return list.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | } |
| | | @PostMapping("/student/getUserYYs") |
| | | @ResponseBody |
| | | public List<Integer> getUserYYs(@RequestBody Integer id){ |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).eq(TAppUser::getAddUserId,id)); |
| | | return list.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | } |
| | | @ResponseBody |
| | | @PostMapping("/student/getUserPtVip") |
| | | public List<Integer> getUserPtVip(){ |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1).eq(TAppUser::getIsVip,1)); |
| | | return list.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | } |
| | | |
| | | @PostMapping("/student/getUserStore") |
| | | @ResponseBody |
| | | public List<Integer> getUserStore(@RequestBody Integer id){ |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 3).eq(TAppUser::getAddUserId,id)); |
| | | return list.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/student/userAndVipPt") |
| | | public HashMap<String, Object> userAndVipPt(@RequestBody Integer type){ |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | // 所有的 |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1)); |
| | | map.put("allUser",list.size()); |
| | | List<TAppUser> list1 = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1).eq(TAppUser::getIsVip,1)); |
| | | map.put("allVip",list1.size()); |
| | | |
| | | |
| | | ArrayList<Object> integers = new ArrayList<>(); |
| | | int year = DateUtil.year(new Date()); |
| | | for (int i = 0; i < 10; i++) { |
| | | integers.add(year-i); |
| | | } |
| | | List<Object> collect = integers.stream().sorted().collect(Collectors.toList()); |
| | | // 年 |
| | | ArrayList<Long> years = new ArrayList<>(); |
| | | ArrayList<Long> yearsVip = new ArrayList<>(); |
| | | for (Object o : collect) { |
| | | String s = o.toString(); |
| | | long count = list.stream().filter(e -> e.getInsertTime().toString().contains(s)).count(); |
| | | long count1 = list1.stream().filter(e -> e.getInsertTime().toString().contains(s)).count(); |
| | | years.add(count); |
| | | yearsVip.add(count1); |
| | | } |
| | | map.put("yearData",years); |
| | | map.put("yearsVip",yearsVip); |
| | | |
| | | ArrayList<Long> months = new ArrayList<>(); |
| | | ArrayList<Long> monthsVip = new ArrayList<>(); |
| | | // 月 |
| | | for (int i = 1; i <= 12; i++) { |
| | | String m=i+""; |
| | | if(i<10){ |
| | | m="0"+i; |
| | | } |
| | | String s = year + "-" + m; |
| | | long count = list.stream().filter(e -> e.getInsertTime().toString().contains(s)).count(); |
| | | long count1 = list1.stream().filter(e -> e.getInsertTime().toString().contains(s)).count(); |
| | | months.add(count); |
| | | monthsVip.add(count1); |
| | | } |
| | | map.put("monthData",months); |
| | | map.put("monthsVip",monthsVip); |
| | | |
| | | // 周 |
| | | |
| | | // 获取最近四周 |
| | | LocalDateTime minNow = LocalDateTime.now().with(LocalTime.MIN); |
| | | LocalDateTime maxNow = LocalDateTime.now().with(LocalTime.MAX); |
| | | // 周度数据 |
| | | String s1 = minNow.minusDays(6).toString(); |
| | | String s2 = maxNow.toString(); |
| | | |
| | | String s3 = minNow.minusDays(13).toString(); |
| | | String s4 = maxNow.minusDays(6).toString(); |
| | | |
| | | |
| | | String s5 = minNow.minusDays(20).toString(); |
| | | String s6 = maxNow.minusDays(13).toString(); |
| | | |
| | | String s7 = minNow.minusDays(27).toString(); |
| | | String s8 = maxNow.minusDays(20).toString(); |
| | | |
| | | |
| | | int count = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1).between(TAppUser::getInsertTime, s7, s8)); |
| | | int countVip = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1).eq(TAppUser::getIsVip,1).between(TAppUser::getInsertTime, s7, s8)); |
| | | |
| | | int count1 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1).between(TAppUser::getInsertTime,s5,s6)); |
| | | int countVip1 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1).eq(TAppUser::getIsVip,1).between(TAppUser::getInsertTime, s5,s6)); |
| | | |
| | | int count2 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1).between(TAppUser::getInsertTime,s3,s4)); |
| | | int countVip2 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1).eq(TAppUser::getIsVip,1).between(TAppUser::getInsertTime, s3,s4)); |
| | | |
| | | int count3 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1).between(TAppUser::getInsertTime,s1,s2)); |
| | | int countVip3 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1).eq(TAppUser::getIsVip,1).between(TAppUser::getInsertTime, s1,s2)); |
| | | map.put("count",count); |
| | | map.put("count1",count1); |
| | | map.put("count2",count2); |
| | | map.put("count3",count3); |
| | | map.put("countVip",countVip); |
| | | map.put("countVip1",countVip1); |
| | | map.put("countVip2",countVip2); |
| | | map.put("countVip3",countVip3); |
| | | |
| | | |
| | | // 日 |
| | | ArrayList<Integer> days = new ArrayList<>(); |
| | | ArrayList<Integer> daysVip = new ArrayList<>(); |
| | | for (int i = 6; i >= 0; i--) { |
| | | String s = minNow.minusDays(i).toString(); |
| | | String s9 = maxNow.minusDays(i).toString(); |
| | | int count4 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1).between(TAppUser::getInsertTime,s,s9)); |
| | | int countVip5 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1).eq(TAppUser::getIsVip,1).between(TAppUser::getInsertTime, s,s9)); |
| | | days.add(count4); |
| | | daysVip.add(countVip5); |
| | | } |
| | | map.put("dayData",days); |
| | | map.put("daysVip",daysVip); |
| | | |
| | | |
| | | return map; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @PostMapping("/student/queryFee") |
| | |
| | | @PostMapping("/student/queryUserAge") |
| | | public HashMap<String, Object> queryUserAge(){ |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().in(TAppUser::getInsertType, 1)); |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1)); |
| | | List<Integer> collect = list.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | if(collect.size()==0){ |
| | | collect.add(-1); |
| | |
| | | |
| | | |
| | | } |
| | | @PostMapping("/student/queryUserAge1") |
| | | public HashMap<String, Object> queryUserAge1(){ |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1)); |
| | | List<Integer> collect = list.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | if(collect.size()==0){ |
| | | collect.add(-1); |
| | | } |
| | | |
| | | |
| | | Set<String> strings = list.stream().collect(Collectors.groupingBy(TAppUser::getCity)).keySet(); |
| | | ArrayList<String> strings1 = new ArrayList<>(); |
| | | ArrayList<Integer> integers = new ArrayList<>(); |
| | | |
| | | for (String string : strings) { |
| | | int a = 0; |
| | | strings1.add(string); |
| | | for (TAppUser tAppUser : list) { |
| | | if(tAppUser.getCity().equals(string)){ |
| | | a++; |
| | | } |
| | | } |
| | | integers.add(a); |
| | | } |
| | | |
| | | map.put("cityData",strings1); |
| | | map.put("cityNum",integers); |
| | | int age1=0; |
| | | int age2=0; |
| | | int age3=0; |
| | | int age4=0; |
| | | int age5=0; |
| | | int age6=0; |
| | | int boy=0; |
| | | int girl=0; |
| | | for (TAppUser tStudent : list) { |
| | | Date birthday = tStudent.getBirthday(); |
| | | long l =0; |
| | | if(birthday!=null){ |
| | | |
| | | l = DateUtil.betweenYear(birthday, new Date(), true); |
| | | } |
| | | if(l<=12){ |
| | | age1++; |
| | | }else if(l>12 && l<18){ |
| | | age2++; |
| | | }else if(l>=19 && l<=25){ |
| | | age3++; |
| | | }else if(l>=26 && l<=35){ |
| | | age4++; |
| | | }else if(l>=36 && l<=50){ |
| | | age5++; |
| | | }else { |
| | | age6++; |
| | | } |
| | | if(tStudent.getGender()!=null &&tStudent.getGender()==1){ |
| | | boy++; |
| | | }else { |
| | | girl++; |
| | | } |
| | | } |
| | | map.put("age1",age1); |
| | | map.put("age2",age2); |
| | | map.put("age3",age3); |
| | | map.put("age4",age4); |
| | | map.put("age5",age5); |
| | | map.put("age6",age6); |
| | | map.put("boy",boy); |
| | | map.put("girl",girl); |
| | | return map; |
| | | |
| | | |
| | | |
| | | } |
| | | @PostMapping("/student/queryUserAgeYys") |
| | | public HashMap<String, Object> queryUserAgeYys(Integer id){ |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).eq(TAppUser::getAddUserId,id)); |
| | | List<Integer> collect = list.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | if(collect.size()==0){ |
| | | collect.add(-1); |
| | | } |
| | | |
| | | |
| | | Set<String> strings = list.stream().collect(Collectors.groupingBy(TAppUser::getCity)).keySet(); |
| | | ArrayList<String> strings1 = new ArrayList<>(); |
| | | ArrayList<Integer> integers = new ArrayList<>(); |
| | | |
| | | for (String string : strings) { |
| | | int a = 0; |
| | | strings1.add(string); |
| | | for (TAppUser tAppUser : list) { |
| | | if(tAppUser.getCity().equals(string)){ |
| | | a++; |
| | | } |
| | | } |
| | | integers.add(a); |
| | | } |
| | | |
| | | map.put("cityData",strings1); |
| | | map.put("cityNum",integers); |
| | | int age1=0; |
| | | int age2=0; |
| | | int age3=0; |
| | | int age4=0; |
| | | int age5=0; |
| | | int age6=0; |
| | | int boy=0; |
| | | int girl=0; |
| | | for (TAppUser tStudent : list) { |
| | | Date birthday = tStudent.getBirthday(); |
| | | long l =0; |
| | | if(birthday!=null){ |
| | | |
| | | l = DateUtil.betweenYear(birthday, new Date(), true); |
| | | } |
| | | if(l<=12){ |
| | | age1++; |
| | | }else if(l>12 && l<18){ |
| | | age2++; |
| | | }else if(l>=19 && l<=25){ |
| | | age3++; |
| | | }else if(l>=26 && l<=35){ |
| | | age4++; |
| | | }else if(l>=36 && l<=50){ |
| | | age5++; |
| | | }else { |
| | | age6++; |
| | | } |
| | | if(tStudent.getGender()!=null &&tStudent.getGender()==1){ |
| | | boy++; |
| | | }else { |
| | | girl++; |
| | | } |
| | | } |
| | | map.put("age1",age1); |
| | | map.put("age2",age2); |
| | | map.put("age3",age3); |
| | | map.put("age4",age4); |
| | | map.put("age5",age5); |
| | | map.put("age6",age6); |
| | | map.put("boy",boy); |
| | | map.put("girl",girl); |
| | | return map; |
| | | |
| | | } |
| | | @PostMapping("/student/queryUserAgeStore") |
| | | public HashMap<String, Object> queryUserAgeStore(Integer id){ |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 3).eq(TAppUser::getAddUserId,id)); |
| | | List<Integer> collect = list.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | if(collect.size()==0){ |
| | | collect.add(-1); |
| | | } |
| | | |
| | | |
| | | Set<String> strings = list.stream().collect(Collectors.groupingBy(TAppUser::getCity)).keySet(); |
| | | ArrayList<String> strings1 = new ArrayList<>(); |
| | | ArrayList<Integer> integers = new ArrayList<>(); |
| | | |
| | | for (String string : strings) { |
| | | int a = 0; |
| | | strings1.add(string); |
| | | for (TAppUser tAppUser : list) { |
| | | if(tAppUser.getCity().equals(string)){ |
| | | a++; |
| | | } |
| | | } |
| | | integers.add(a); |
| | | } |
| | | |
| | | map.put("cityData",strings1); |
| | | map.put("cityNum",integers); |
| | | int age1=0; |
| | | int age2=0; |
| | | int age3=0; |
| | | int age4=0; |
| | | int age5=0; |
| | | int age6=0; |
| | | int boy=0; |
| | | int girl=0; |
| | | for (TAppUser tStudent : list) { |
| | | Date birthday = tStudent.getBirthday(); |
| | | long l =0; |
| | | if(birthday!=null){ |
| | | |
| | | l = DateUtil.betweenYear(birthday, new Date(), true); |
| | | } |
| | | if(l<=12){ |
| | | age1++; |
| | | }else if(l>12 && l<18){ |
| | | age2++; |
| | | }else if(l>=19 && l<=25){ |
| | | age3++; |
| | | }else if(l>=26 && l<=35){ |
| | | age4++; |
| | | }else if(l>=36 && l<=50){ |
| | | age5++; |
| | | }else { |
| | | age6++; |
| | | } |
| | | if(tStudent.getGender()!=null &&tStudent.getGender()==1){ |
| | | boy++; |
| | | }else { |
| | | girl++; |
| | | } |
| | | } |
| | | map.put("age1",age1); |
| | | map.put("age2",age2); |
| | | map.put("age3",age3); |
| | | map.put("age4",age4); |
| | | map.put("age5",age5); |
| | | map.put("age6",age6); |
| | | map.put("boy",boy); |
| | | map.put("girl",girl); |
| | | return map; |
| | | |
| | | } |
| | | @PostMapping("/student/queryUserAgeYys1") |
| | | public HashMap<String, Object> queryUserAgeYys1(@RequestBody Integer id){ |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).eq(TAppUser::getAddUserId,id)); |
| | | List<Integer> collect = list.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | if(collect.size()==0){ |
| | | collect.add(-1); |
| | | } |
| | | List<TStudent> list1 = studentService.list(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect)); |
| | | int age1=0; |
| | | int age2=0; |
| | | int age3=0; |
| | | int age4=0; |
| | | int boy=0; |
| | | int girl=0; |
| | | for (TStudent tStudent : list1) { |
| | | Date birthday = tStudent.getBirthday(); |
| | | long l = DateUtil.betweenYear(birthday, new Date(), true); |
| | | if(l<7){ |
| | | age1++; |
| | | }else if(l>=8 && l<11){ |
| | | age2++; |
| | | }else if(l>=11 && l<=12){ |
| | | age3++; |
| | | }else { |
| | | age4++; |
| | | } |
| | | if(tStudent.getSex()==1){ |
| | | boy++; |
| | | }else { |
| | | girl++; |
| | | } |
| | | } |
| | | map.put("age1",age1); |
| | | map.put("age2",age2); |
| | | map.put("age3",age3); |
| | | map.put("age4",age4); |
| | | map.put("boy",boy); |
| | | map.put("girl",girl); |
| | | return map; |
| | | |
| | | |
| | | } |
| | | @PostMapping("/student/queryUserAgeStore1") |
| | | public HashMap<String, Object> queryUserAgeStore1(@RequestBody Integer id){ |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 3).eq(TAppUser::getAddUserId,id)); |
| | | List<Integer> collect = list.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | if(collect.size()==0){ |
| | | collect.add(-1); |
| | | } |
| | | List<TStudent> list1 = studentService.list(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect)); |
| | | int age1=0; |
| | | int age2=0; |
| | | int age3=0; |
| | | int age4=0; |
| | | int boy=0; |
| | | int girl=0; |
| | | for (TStudent tStudent : list1) { |
| | | Date birthday = tStudent.getBirthday(); |
| | | long l = DateUtil.betweenYear(birthday, new Date(), true); |
| | | if(l<7){ |
| | | age1++; |
| | | }else if(l>=8 && l<11){ |
| | | age2++; |
| | | }else if(l>=11 && l<=12){ |
| | | age3++; |
| | | }else { |
| | | age4++; |
| | | } |
| | | if(tStudent.getSex()==1){ |
| | | boy++; |
| | | }else { |
| | | girl++; |
| | | } |
| | | } |
| | | map.put("age1",age1); |
| | | map.put("age2",age2); |
| | | map.put("age3",age3); |
| | | map.put("age4",age4); |
| | | map.put("boy",boy); |
| | | map.put("girl",girl); |
| | | return map; |
| | | |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.dsh.account.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @ApiModel(value = "运营统计查询DTO") |
| | | public class UserInfoQueryDTO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "选择城市") |
| | | private String cityCode; |
| | | |
| | | @ApiModelProperty(value = "分类 1平台 2运营商 3门店") |
| | | private Integer insertType; |
| | | |
| | | @ApiModelProperty(value = "运营商id") |
| | | private Integer operatorId; |
| | | |
| | | @ApiModelProperty(value = "门店id") |
| | | private Integer storeId; |
| | | |
| | | @ApiModelProperty(value = "是否年费会员 0=否,1=是") |
| | | private Integer isVip; |
| | | |
| | | @ApiModelProperty(value = "开始时间,前端忽略") |
| | | private String startTime; |
| | | |
| | | @ApiModelProperty(value = "结束时间,前端忽略") |
| | | private String endTime; |
| | | |
| | | } |
| | |
| | | */ |
| | | @TableField("addUserId") |
| | | private Integer addUserId; |
| | | @TableField(exist = false) |
| | | private Integer age; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.account.dto.SelectDto; |
| | | import com.dsh.account.dto.UserInfoQueryDTO; |
| | | import com.dsh.account.entity.TAppUser; |
| | | import com.dsh.account.model.AppUserByNameAndPhoneDTO; |
| | | import com.dsh.account.model.query.appUserQuery.QueryAppUser; |
| | | import com.dsh.account.model.vo.QueryAppUserVO; |
| | | import com.dsh.account.vo.GroupCityInfoVO; |
| | | import com.dsh.account.vo.entity.DayData; |
| | | import com.dsh.account.vo.entity.MonthData; |
| | | import com.dsh.account.vo.entity.WeekData; |
| | | import com.dsh.account.vo.entity.YearData; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | |
| | | int changeState(@Param("ids") List<Integer> ids,@Param("state") Integer state); |
| | | |
| | | List<TAppUser> queryAPPUserByNameAndPhone(@Param("query") AppUserByNameAndPhoneDTO dto); |
| | | |
| | | List<YearData> getYearUserCount(@Param("dto") UserInfoQueryDTO dto); |
| | | |
| | | List<MonthData> getMonthUserCount(@Param("dto")UserInfoQueryDTO dto); |
| | | |
| | | WeekData getWeekUserCount4(@Param("dto")UserInfoQueryDTO dto); |
| | | WeekData getWeekUserCount3(@Param("dto")UserInfoQueryDTO dto); |
| | | WeekData getWeekUserCount2(@Param("dto")UserInfoQueryDTO dto); |
| | | WeekData getWeekUserCount1(@Param("dto")UserInfoQueryDTO dto); |
| | | |
| | | List<DayData> getDayUserCount(@Param("dto")UserInfoQueryDTO dto); |
| | | |
| | | List<GroupCityInfoVO> groupCityInfo(@Param("dto")UserInfoQueryDTO dto); |
| | | } |
| | |
| | | public class LoginWeChatVo { |
| | | @ApiModelProperty(value = "微信openId", dataType = "string", required = true) |
| | | private String openId; |
| | | @ApiModelProperty(value = "手机号", dataType = "string", required = true) |
| | | @ApiModelProperty(value = "手机号", dataType = "string", required = false) |
| | | private String phone; |
| | | private String nickname; |
| | | private String headimgurl; |
| | | private Integer sex; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.account.dto.SelectDto; |
| | | import com.dsh.account.dto.UserInfoQueryDTO; |
| | | import com.dsh.account.entity.TAppUser; |
| | | import com.dsh.account.model.*; |
| | | import com.dsh.account.model.query.appUserQuery.QueryAppUser; |
| | |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.ClassInfoVo; |
| | | import com.dsh.account.model.vo.userBenefitDetail.*; |
| | | import com.dsh.account.util.ResultUtil; |
| | | import com.dsh.account.vo.GroupCityInfoVO; |
| | | import com.dsh.account.vo.entity.DayData; |
| | | import com.dsh.account.vo.entity.MonthData; |
| | | import com.dsh.account.vo.entity.WeekData; |
| | | import com.dsh.account.vo.entity.YearData; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | |
| | | Object changeState(AdvertisementChangeStateDTO dto); |
| | | |
| | | List<TAppUser> queryAPPUserByNameAndPhone(AppUserByNameAndPhoneDTO dto); |
| | | |
| | | |
| | | List<YearData> getYearUserCount(UserInfoQueryDTO dto); |
| | | |
| | | List<MonthData> getMonthUserCount(UserInfoQueryDTO dto); |
| | | |
| | | WeekData getWeekUserCount4(UserInfoQueryDTO dto); |
| | | WeekData getWeekUserCount3(UserInfoQueryDTO dto); |
| | | WeekData getWeekUserCount2(UserInfoQueryDTO dto); |
| | | WeekData getWeekUserCount1(UserInfoQueryDTO dto); |
| | | |
| | | List<DayData> getDayUserCount(UserInfoQueryDTO dto); |
| | | |
| | | List<GroupCityInfoVO> groupCityInfo(UserInfoQueryDTO dto); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.account.dto.SelectDto; |
| | | import com.dsh.account.dto.UserInfoQueryDTO; |
| | | import com.dsh.account.entity.*; |
| | | import com.dsh.account.enums.RechargeRecordEnum; |
| | | import com.dsh.account.feignclient.activity.IntroduceRewardsClient; |
| | |
| | | import com.dsh.account.service.TAppUserService; |
| | | import com.dsh.account.util.*; |
| | | import com.dsh.account.util.akeylogin.Md5Util; |
| | | import com.dsh.account.vo.GroupCityInfoVO; |
| | | import com.dsh.account.vo.entity.DayData; |
| | | import com.dsh.account.vo.entity.MonthData; |
| | | import com.dsh.account.vo.entity.WeekData; |
| | | import com.dsh.account.vo.entity.YearData; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.PageImpl; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | public List<TAppUser> queryAPPUserByNameAndPhone(AppUserByNameAndPhoneDTO dto) { |
| | | return appUserMapper.queryAPPUserByNameAndPhone(dto); |
| | | } |
| | | @Override |
| | | public List<YearData> getYearUserCount(UserInfoQueryDTO dto) { |
| | | return appUserMapper.getYearUserCount(dto); |
| | | } |
| | | |
| | | @Override |
| | | public List<MonthData> getMonthUserCount(UserInfoQueryDTO dto) { |
| | | List<MonthData> monthUserCount = appUserMapper.getMonthUserCount(dto); |
| | | for (int i = 1; i <= 12; i++) { |
| | | String time = String.valueOf(i); |
| | | if (i < 10) { |
| | | time = "0" + time; |
| | | } |
| | | monthUserCount.add(Optional.ofNullable(monthUserCount.get(i)).orElse(new MonthData(time, 0))); |
| | | } |
| | | return monthUserCount.stream().sorted(Comparator.comparing(MonthData::getMonth)).collect(Collectors.toList()); |
| | | } |
| | | |
| | | @Override |
| | | public WeekData getWeekUserCount4(UserInfoQueryDTO dto) { |
| | | return appUserMapper.getWeekUserCount4(dto); |
| | | } |
| | | @Override |
| | | public WeekData getWeekUserCount3(UserInfoQueryDTO dto) { |
| | | return appUserMapper.getWeekUserCount3(dto); |
| | | } |
| | | @Override |
| | | public WeekData getWeekUserCount2(UserInfoQueryDTO dto) { |
| | | return appUserMapper.getWeekUserCount2(dto); |
| | | } |
| | | @Override |
| | | public WeekData getWeekUserCount1(UserInfoQueryDTO dto) { |
| | | return appUserMapper.getWeekUserCount1(dto); |
| | | } |
| | | |
| | | @Override |
| | | public List<DayData> getDayUserCount(UserInfoQueryDTO dto) { |
| | | List<DayData> dayUserCount = appUserMapper.getDayUserCount(dto); |
| | | if(dayUserCount.size()<7){ |
| | | for (int i = 1; i <= 6; i++) { |
| | | String time = LocalDate.now().minusDays(i).toString(); |
| | | for (DayData dayData : dayUserCount) { |
| | | if(!time.equals(dayData.getDay())){ |
| | | dayUserCount.add(new DayData(time,0)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | dayUserCount.forEach(dayData->dayData.setDay(dayData.getDay().split("-")[2])); |
| | | return dayUserCount.stream().sorted(Comparator.comparing(DayData::getDay)).collect(Collectors.toList()); |
| | | } |
| | | |
| | | @Override |
| | | public List<GroupCityInfoVO> groupCityInfo(UserInfoQueryDTO dto) { |
| | | return appUserMapper.groupCityInfo(dto); |
| | | } |
| | | @Override |
| | | public ClassInfoVo queryUserOfStus(Integer id) { |
| | | TAppUser tAppUser = this.baseMapper.selectById(id); |
| | |
| | | return ResultUtil.error("请先注册", ""); |
| | | } |
| | | if(tAppUser.getState() == 2){ |
| | | return ResultUtil.error("您的账号已被冻结", ""); |
| | | return ResultUtil.errorCode("您的账号已被冻结", ""); |
| | | } |
| | | // password = Md5Util.MD5Encode(password, null); |
| | | if(!tAppUser.getPassword().equals(password)){ |
| | |
| | | @Override |
| | | public ResultUtil loginWechat(LoginWeChatVo loginWechatVo) throws Exception { |
| | | TAppUser tAppUser = this.baseMapper.selectOne(new QueryWrapper<TAppUser>().eq("openid", loginWechatVo.getOpenId()).ne("state", 3)); |
| | | |
| | | if(null == tAppUser){ |
| | | tAppUser = this.baseMapper.selectOne(new QueryWrapper<TAppUser>().eq("phone", loginWechatVo.getPhone()).ne("state", 3)); |
| | | if(null == tAppUser){ |
| | |
| | | tAppUser.setPhone(loginWechatVo.getPhone()); |
| | | tAppUser.setPassword(Md5Util.MD5Encode("111111", null)); |
| | | tAppUser.setIsVip(0); |
| | | tAppUser.setName(loginWechatVo.getNickname()); |
| | | tAppUser.setHeadImg(loginWechatVo.getHeadimgurl()); |
| | | tAppUser.setGender(loginWechatVo.getSex()); |
| | | tAppUser.setState(1); |
| | | tAppUser.setInsertTime(new Date()); |
| | | this.baseMapper.insert(tAppUser); |
| | |
| | | this.updateById(tAppUser); |
| | | |
| | | String token = getToken(tAppUser); |
| | | return ResultUtil.success(token); |
| | | |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put("token",token); |
| | | if(ToolUtil.isEmpty(tAppUser.getPhone())){ |
| | | map.put("isBind","0"); |
| | | }else { |
| | | map.put("isBind","1"); |
| | | } |
| | | return ResultUtil.success(map); |
| | | } |
| | | |
| | | |
| | |
| | | if(tAppUser.getState() == 2){ |
| | | return ResultUtil.error("您的账号已被冻结", ""); |
| | | } |
| | | tAppUser.setPassword(Md5Util.MD5Encode(password, null)); |
| | | tAppUser.setPassword(password); |
| | | this.updateById(tAppUser); |
| | | return ResultUtil.success(); |
| | | } |
| | |
| | | public static <T> ResultUtil <T> error(String mag, T obj){ |
| | | return ResultUtil.getResult(ResultUtil.ERROR, mag, obj); |
| | | } |
| | | public static <T> ResultUtil <T> errorCode(String mag, T obj){ |
| | | return ResultUtil.getResult(501, mag, obj); |
| | | } |
| | | |
| | | /** |
| | | * token失效 |
New file |
| | |
| | | package com.dsh.account.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | public class GroupCityInfoVO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "市code") |
| | | private String cityCode; |
| | | @ApiModelProperty(value = "市区") |
| | | private String city; |
| | | @ApiModelProperty(value = "数量") |
| | | private Integer userCount; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.vo; |
| | | |
| | | import com.dsh.account.vo.entity.DayData; |
| | | import com.dsh.account.vo.entity.MonthData; |
| | | import com.dsh.account.vo.entity.WeekData; |
| | | import com.dsh.account.vo.entity.YearData; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Data |
| | | public class UserInfoQueryVO implements Serializable { |
| | | |
| | | |
| | | @ApiModelProperty(value = "用户总数") |
| | | private Integer userCount; |
| | | @ApiModelProperty(value = "年费会员总数") |
| | | private Integer userVipCount; |
| | | |
| | | @ApiModelProperty(value = "年度数据") |
| | | private List<YearData> yearData; |
| | | @ApiModelProperty(value = "月度数据") |
| | | private List<MonthData> monthData; |
| | | @ApiModelProperty(value = "周度数据") |
| | | private List<WeekData> weekData; |
| | | @ApiModelProperty(value = "日度数据") |
| | | private List<DayData> dayData; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.vo.entity; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.ToString; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @ToString |
| | | public class DayData implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "日") |
| | | private String day; |
| | | |
| | | @ApiModelProperty(value = "数量") |
| | | private Integer dayCount; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.vo.entity; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class MonthData implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "月份") |
| | | private String month; |
| | | |
| | | @ApiModelProperty(value = "数量") |
| | | private Integer monthCount; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.vo.entity; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | public class WeekData implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "周") |
| | | private String week; |
| | | |
| | | @ApiModelProperty(value = "数量") |
| | | private Integer weekCount; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.vo.entity; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | public class YearData implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "年份") |
| | | private String year; |
| | | |
| | | @ApiModelProperty(value = "数量") |
| | | private Integer yearCount; |
| | | |
| | | } |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | <select id="getYearUserCount" resultType="com.dsh.account.vo.entity.YearData"> |
| | | select IFNULL(count(*),0) AS yearCount,DATE_FORMAT(insertTime,'%Y') AS `year` from t_app_user |
| | | <where> |
| | | <if test="dto.cityCode != null and dto.cityCode != ''"> |
| | | AND cityCode = #{dto.cityCode} |
| | | </if> |
| | | <if test="dto.isVip != null"> |
| | | AND isVip = #{dto.isVip} |
| | | </if> |
| | | <if test="dto.insertType != null and dto.insertType == 2 and dto.operatorId != null"> |
| | | AND insertType = 2 |
| | | AND addUserId = #{dto.operatorId} |
| | | </if> |
| | | <if test="dto.insertType != null and dto.insertType == 3 and dto.storeId != null"> |
| | | AND insertType = 3 |
| | | AND addUserId = #{dto.storeId} |
| | | </if> |
| | | </where> |
| | | GROUP BY DATE_FORMAT(insertTime,'%Y') |
| | | </select> |
| | | <select id="getMonthUserCount" resultType="com.dsh.account.vo.entity.MonthData"> |
| | | select IFNULL(count(*),0) AS monthCount,DATE_FORMAT(insertTime,'%Y%m') AS `month` from t_app_user |
| | | <where> |
| | | <if test="dto.cityCode != null and dto.cityCode != ''"> |
| | | AND cityCode = #{dto.cityCode} |
| | | </if> |
| | | <if test="dto.isVip != null"> |
| | | AND isVip = #{dto.isVip} |
| | | </if> |
| | | <if test="dto.insertType != null and dto.insertType == 2 and dto.operatorId != null"> |
| | | AND insertType = 2 |
| | | AND addUserId = #{dto.operatorId} |
| | | </if> |
| | | <if test="dto.insertType != null and dto.insertType == 3 and dto.storeId != null"> |
| | | AND insertType = 3 |
| | | AND addUserId = #{dto.storeId} |
| | | </if> |
| | | </where> |
| | | GROUP BY DATE_FORMAT(insertTime,'%Y%m') |
| | | </select> |
| | | <select id="getWeekUserCount4" resultType="com.dsh.account.vo.entity.WeekData"> |
| | | select IFNULL(count(*),0) AS weekCount,4 AS `week` from t_app_user |
| | | <where> |
| | | <if test="dto.startTime != null and dto.startTime != '' and dto.endTime != null and dto.endTime != ''"> |
| | | AND insertTime between #{dto.startTime} and #{dto.endTime} |
| | | </if> |
| | | <if test="dto.cityCode != null and dto.cityCode != ''"> |
| | | AND cityCode = #{dto.cityCode} |
| | | </if> |
| | | <if test="dto.isVip != null"> |
| | | AND isVip = #{dto.isVip} |
| | | </if> |
| | | <if test="dto.insertType != null and dto.insertType == 2 and dto.operatorId != null"> |
| | | AND insertType = 2 |
| | | AND addUserId = #{dto.operatorId} |
| | | </if> |
| | | <if test="dto.insertType != null and dto.insertType == 3 and dto.storeId != null"> |
| | | AND insertType = 3 |
| | | AND addUserId = #{dto.storeId} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="getWeekUserCount3" resultType="com.dsh.account.vo.entity.WeekData"> |
| | | select IFNULL(count(*),0) AS weekCount,3 AS `week` from t_app_user |
| | | <where> |
| | | <if test="dto.startTime != null and dto.startTime != '' and dto.endTime != null and dto.endTime != ''"> |
| | | AND insertTime between #{dto.startTime} and #{dto.endTime} |
| | | </if> |
| | | <if test="dto.cityCode != null and dto.cityCode != ''"> |
| | | AND cityCode = #{dto.cityCode} |
| | | </if> |
| | | <if test="dto.isVip != null"> |
| | | AND isVip = #{dto.isVip} |
| | | </if> |
| | | <if test="dto.insertType != null and dto.insertType == 2 and dto.operatorId != null"> |
| | | AND insertType = 2 |
| | | AND addUserId = #{dto.operatorId} |
| | | </if> |
| | | <if test="dto.insertType != null and dto.insertType == 3 and dto.storeId != null"> |
| | | AND insertType = 3 |
| | | AND addUserId = #{dto.storeId} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="getWeekUserCount2" resultType="com.dsh.account.vo.entity.WeekData"> |
| | | select IFNULL(count(*),0) AS weekCount,2 AS `week` from t_app_user |
| | | <where> |
| | | <if test="dto.startTime != null and dto.startTime != '' and dto.endTime != null and dto.endTime != ''"> |
| | | AND insertTime between #{dto.startTime} and #{dto.endTime} |
| | | </if> |
| | | <if test="dto.cityCode != null and dto.cityCode != ''"> |
| | | AND cityCode = #{dto.cityCode} |
| | | </if> |
| | | <if test="dto.isVip != null"> |
| | | AND isVip = #{dto.isVip} |
| | | </if> |
| | | <if test="dto.insertType != null and dto.insertType == 2 and dto.operatorId != null"> |
| | | AND insertType = 2 |
| | | AND addUserId = #{dto.operatorId} |
| | | </if> |
| | | <if test="dto.insertType != null and dto.insertType == 3 and dto.storeId != null"> |
| | | AND insertType = 3 |
| | | AND addUserId = #{dto.storeId} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="getWeekUserCount1" resultType="com.dsh.account.vo.entity.WeekData"> |
| | | select IFNULL(count(*),0) AS weekCount,1 AS `week` from t_app_user |
| | | <where> |
| | | <if test="dto.startTime != null and dto.startTime != '' and dto.endTime != null and dto.endTime != ''"> |
| | | AND insertTime between #{dto.startTime} and #{dto.endTime} |
| | | </if> |
| | | <if test="dto.cityCode != null and dto.cityCode != ''"> |
| | | AND cityCode = #{dto.cityCode} |
| | | </if> |
| | | <if test="dto.isVip != null"> |
| | | AND isVip = #{dto.isVip} |
| | | </if> |
| | | <if test="dto.insertType != null and dto.insertType == 2 and dto.operatorId != null"> |
| | | AND insertType = 2 |
| | | AND addUserId = #{dto.operatorId} |
| | | </if> |
| | | <if test="dto.insertType != null and dto.insertType == 3 and dto.storeId != null"> |
| | | AND insertType = 3 |
| | | AND addUserId = #{dto.storeId} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="getDayUserCount" resultType="com.dsh.account.vo.entity.DayData"> |
| | | select IFNULL(count(*),0) AS dayCount,DATE_FORMAT(insertTime,'%Y-%m-%d') AS `day` from t_app_user |
| | | <where> |
| | | <if test="dto.startTime != null and dto.startTime != '' and dto.endTime != null and dto.endTime != ''"> |
| | | AND insertTime between #{dto.startTime} and #{dto.endTime} |
| | | </if> |
| | | <if test="dto.cityCode != null and dto.cityCode != ''"> |
| | | AND cityCode = #{dto.cityCode} |
| | | </if> |
| | | <if test="dto.isVip != null"> |
| | | AND isVip = #{dto.isVip} |
| | | </if> |
| | | <if test="dto.insertType != null and dto.insertType == 2 and dto.operatorId != null"> |
| | | AND insertType = 2 |
| | | AND addUserId = #{dto.operatorId} |
| | | </if> |
| | | <if test="dto.insertType != null and dto.insertType == 3 and dto.storeId != null"> |
| | | AND insertType = 3 |
| | | AND addUserId = #{dto.storeId} |
| | | </if> |
| | | </where> |
| | | GROUP BY DATE_FORMAT(insertTime,'%Y-%m-%d') |
| | | </select> |
| | | <select id="groupCityInfo" resultType="com.dsh.account.vo.GroupCityInfoVO"> |
| | | select IFNULL(count(*),0) AS userCount,cityCode,city from t_app_user |
| | | <where> |
| | | <if test="dto.startTime != null and dto.startTime != '' and dto.endTime != null and dto.endTime != ''"> |
| | | AND insertTime between #{dto.startTime} and #{dto.endTime} |
| | | </if> |
| | | <if test="dto.cityCode != null and dto.cityCode != ''"> |
| | | AND cityCode = #{dto.cityCode} |
| | | </if> |
| | | <if test="dto.isVip != null"> |
| | | AND isVip = #{dto.isVip} |
| | | </if> |
| | | <if test="dto.insertType != null and dto.insertType == 2 and dto.operatorId != null"> |
| | | AND insertType = 2 |
| | | AND addUserId = #{dto.operatorId} |
| | | </if> |
| | | <if test="dto.insertType != null and dto.insertType == 3 and dto.storeId != null"> |
| | | AND insertType = 3 |
| | | AND addUserId = #{dto.storeId} |
| | | </if> |
| | | </where> |
| | | GROUP BY cityCode |
| | | </select> |
| | | </mapper> |
| | |
| | | #¿ª·¢»·¾³ |
| | | datasource.master0.type=com.alibaba.druid.pool.DruidDataSource |
| | | datasource.master0.driverClassName=com.mysql.cj.jdbc.Driver |
| | | datasource.master0.url=jdbc:mysql://8.137.22.229:3306/playpai_account?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai |
| | | datasource.master0.url=jdbc:mysql://192.168.110.80:3306/playpai_account?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai |
| | | datasource.master0.username=root |
| | | datasource.master0.password=playpai2023! |
| | | datasource.master0.password=123456 |
| | | datasource.master0.maxActive=20 |
| | | datasource.master0.maxWait=60000 |
| | | datasource.master0.minIdle=5 |
New file |
| | |
| | | package com.dsh; |
| | | |
| | | import com.dsh.account.controller.CoachTypeController; |
| | | |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | import java.util.List; |
| | | |
| | | @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = AccountApplication.class) |
| | | class AccountApplicationTests { |
| | | |
| | | @Autowired |
| | | private CoachTypeController controller; |
| | | |
| | | @Test |
| | | void contextLoads() { |
| | | System.out.println("==============="+controller.list()); |
| | | } |
| | | |
| | | } |
| | |
| | | #¿ª·¢»·¾³ |
| | | datasource.master0.type=com.alibaba.druid.pool.DruidDataSource |
| | | datasource.master0.driverClassName=com.mysql.cj.jdbc.Driver |
| | | datasource.master0.url=jdbc:mysql://8.137.22.229:3306/playpai_activity?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai |
| | | datasource.master0.url=jdbc:mysql://192.168.110.80:3306/playpai_activity?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai |
| | | datasource.master0.username=root |
| | | datasource.master0.password=playpai2023! |
| | | datasource.master0.password=123456 |
| | | datasource.master0.maxActive=20 |
| | | datasource.master0.maxWait=60000 |
| | | datasource.master0.minIdle=5 |
| | |
| | | package com.dsh.competition.controller; |
| | | |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | return sum; |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/competition/actPt") |
| | | public HashMap<String, Object> actPt(@RequestBody List<Integer> ids){ |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | if(ids.size()==0){ |
| | | ids.add(-1); |
| | | } |
| | | ArrayList<Object> integers = new ArrayList<>(); |
| | | List<Object> collect = integers.stream().sorted().collect(Collectors.toList()); |
| | | int year = DateUtil.year(new Date()); |
| | | for (int i = 0; i < 10; i++) { |
| | | integers.add(year-i); |
| | | } |
| | | // 年 |
| | | ArrayList<Integer> years = new ArrayList<>(); |
| | | ArrayList<Integer> yearsUser = new ArrayList<>(); |
| | | for (Object o : collect) { |
| | | String s = o.toString(); |
| | | int count = cttService.count(new LambdaQueryWrapper<Competition>().like(Competition::getInsertTime, s)); |
| | | int count1 = ucttService.count(new LambdaQueryWrapper<UserCompetition>().in(UserCompetition::getAppUserId, ids).like(UserCompetition::getInsertTime,s)); |
| | | years.add(count); |
| | | yearsUser.add(count1); |
| | | } |
| | | map.put("yearData",years); |
| | | map.put("yearsUser",yearsUser); |
| | | // 月 |
| | | ArrayList<Integer> months = new ArrayList<>(); |
| | | ArrayList<Integer> monthsUser = new ArrayList<>(); |
| | | for (int i = 1; i <= 12; i++) { |
| | | double sum=0.0; |
| | | String m=i+""; |
| | | if(i<10){ |
| | | m="0"+i; |
| | | } |
| | | String s = year + "-" + m; |
| | | int count = cttService.count(new LambdaQueryWrapper<Competition>().like(Competition::getInsertTime, s)); |
| | | int count1 = ucttService.count(new LambdaQueryWrapper<UserCompetition>().in(UserCompetition::getAppUserId, ids).like(UserCompetition::getInsertTime,s)); |
| | | months.add(count); |
| | | monthsUser.add(count1); |
| | | } |
| | | map.put("monthData",months); |
| | | map.put("monthsUser",monthsUser); |
| | | |
| | | return map; |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/store/queryStoreById") |
| | | Store queryStoreById(Integer id); |
| | | |
| | | @PostMapping("/store/addBackRecord") |
| | | void addBackRecord(String s); |
| | | |
| | | |
| | | } |
| | |
| | | String refund_id = map.get("refund_id"); |
| | | paymentCompetition.setRefundOrderNo(refund_id); |
| | | this.updateById(paymentCompetition); |
| | | |
| | | storeClient.addBackRecord(paymentCompetition.getAmount()+"_"+paymentCompetition.getAppUserId()); |
| | | |
| | | |
| | | } |
| | | if(paymentCompetition.getPayType() == 2){//支付宝支付 |
| | | Map<String, String> map = payMoneyUtil.aliRefund(payOrderNo, amount.toString()); |
| | |
| | | #¿ª·¢»·¾³ |
| | | datasource.master0.type=com.alibaba.druid.pool.DruidDataSource |
| | | datasource.master0.driverClassName=com.mysql.cj.jdbc.Driver |
| | | datasource.master0.url=jdbc:mysql://8.137.22.229:3306/playpai_competition?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai |
| | | datasource.master0.url=jdbc:mysql://192.168.110.80:3306/playpai_competition?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai |
| | | datasource.master0.username=root |
| | | datasource.master0.password=playpai2023! |
| | | datasource.master0.password=123456 |
| | | datasource.master0.maxActive=20 |
| | | datasource.master0.maxWait=60000 |
| | | datasource.master0.minIdle=5 |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.entity.TCourse; |
| | | import com.dsh.course.entity.TCoursePackage; |
| | | import com.dsh.course.entity.TCoursePackagePayment; |
| | | import com.dsh.course.entity.TCoursePackageType; |
| | | import com.dsh.course.entity.*; |
| | | import com.dsh.course.feignclient.model.ExerciseVideo; |
| | | import com.dsh.course.model.*; |
| | | import com.dsh.course.model.dto.CourseChangeStateDTO; |
| | | import com.dsh.course.model.dto.TQueryBenefitsVideosDTO; |
| | | import com.dsh.course.model.vo.TQueryBenefitsVideosVO; |
| | | import com.dsh.course.service.TCoursePackagePaymentService; |
| | | import com.dsh.course.service.TCoursePackageService; |
| | | import com.dsh.course.service.TCoursePackageTypeService; |
| | | import com.dsh.course.service.TCourseService; |
| | | import com.dsh.course.service.*; |
| | | import com.dsh.course.util.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | |
| | | @Autowired |
| | | private TCoursePackagePaymentService coursePackagePaymentService; |
| | | |
| | | @Autowired |
| | | private TCoursePackageDiscountService discountService; |
| | | |
| | | /** |
| | | * 上/下架 1为上架 2为下架 3为删除 |
| | |
| | | return coursePackageService.getHours(coursePackageId1); |
| | | } |
| | | |
| | | @PostMapping("/course/queryByDiscountId") |
| | | public TCoursePackage queryByDiscountId(@RequestBody Integer id){ |
| | | TCoursePackageDiscount byId = discountService.getById(id); |
| | | TCoursePackage byId1 = coursePackageService.getById(byId.getCoursePackageId()); |
| | | return byId1; |
| | | } |
| | | |
| | | |
| | | @PostMapping("/course/queryDiscountById") |
| | | public Integer queryDiscountById(@RequestBody Integer id){ |
| | | TCoursePackageDiscount byId = discountService.getById(id); |
| | | return byId.getAuditStatus(); |
| | | } |
| | | @PostMapping("/course/queryDiscountList") |
| | | public List<DiscountList> queryDiscountList(@RequestBody QueryDiscountList queryDiscountList){ |
| | | return discountService.queryDiscountList(queryDiscountList); |
| | | } |
| | | |
| | | @PostMapping("/course/queryDiscountListAudit") |
| | | public List<DiscountList> queryDiscountListAudit(@RequestBody QueryDiscountList queryDiscountList){ |
| | | return discountService.queryDiscountListAudit(queryDiscountList); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/course/updateState") |
| | | public Boolean updateState( @RequestBody DiscountUpdateState discountUpdateState){ |
| | | TCoursePackageDiscount byId = discountService.getById(discountUpdateState.getId()); |
| | | List<TCoursePackageDiscount> list = discountService.list(new LambdaQueryWrapper<TCoursePackageDiscount>().eq(TCoursePackageDiscount::getCoursePackageId, byId.getCoursePackageId())); |
| | | list.forEach(e->e.setStatus(discountUpdateState.getStatus())); |
| | | return discountService.updateBatchById(list); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/course/auditDiscount") |
| | | public Boolean auditDiscount( @RequestBody AuditDiscount auditDiscount){ |
| | | TCoursePackageDiscount byId = discountService.getById(auditDiscount.getId()); |
| | | List<TCoursePackageDiscount> list = discountService.list(new LambdaQueryWrapper<TCoursePackageDiscount>().eq(TCoursePackageDiscount::getCoursePackageId, byId.getCoursePackageId())); |
| | | for (TCoursePackageDiscount tCoursePackageDiscount : list) { |
| | | tCoursePackageDiscount.setAuditStatus(auditDiscount.getType()); |
| | | tCoursePackageDiscount.setAuditRemark(auditDiscount.getText()); |
| | | } |
| | | |
| | | return discountService.updateBatchById(list); |
| | | } |
| | | |
| | | @PostMapping("/course/queryFee") |
| | | public HashMap<String, Object> queryFee(@RequestBody QueryDataFee queryDataFee){ |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | |
| | | } |
| | | |
| | | |
| | | @PostMapping("/coursePackageDiscount/queryCoursePackageDiscountOne") |
| | | public List<TCoursePackageDiscount> queryCoursePackageDiscountOne(@RequestBody Integer id){ |
| | | return coursePackageDiscountService.list(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackagePaymentConfigId", id) |
| | | .ne("auditStatus", 2)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | @TableField("insertTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | | |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | } |
| | |
| | | package com.dsh.course.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.entity.TCoursePackageDiscount; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.course.model.DiscountList; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TCoursePackageDiscountMapper extends BaseMapper<TCoursePackageDiscount> { |
| | | |
| | | List<DiscountList> queryDiscountList(@Param("discountListPage") Page<DiscountList> discountListPage, @Param("pCode") String pCode, @Param("cCode") String cCode, @Param("name") String name, @Param("type") Integer type, @Param("ids") List<Integer> ids); |
| | | |
| | | List<DiscountList> queryDiscountListAudit(@Param("discountListPage") Page<DiscountList> discountListPage, @Param("pCode") String pCode, @Param("cCode") String cCode, @Param("name") String name, @Param("type") Integer type, @Param("ids") List<Integer> ids); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.model; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class AuditDiscount { |
| | | private Integer id; |
| | | |
| | | private Integer type; |
| | | |
| | | private String text; |
| | | } |
New file |
| | |
| | | package com.dsh.course.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class DiscountList { |
| | | private Integer id; |
| | | |
| | | private String pName; |
| | | |
| | | private String cName; |
| | | |
| | | private String shopName; |
| | | |
| | | private String name; |
| | | |
| | | private String type; |
| | | |
| | | private Integer status; |
| | | |
| | | private Integer storeId; |
| | | private Integer courseId; |
| | | } |
New file |
| | |
| | | package com.dsh.course.model; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class DiscountUpdateState { |
| | | private Integer id; |
| | | |
| | | private Integer status; |
| | | } |
New file |
| | |
| | | package com.dsh.course.model; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class QueryDiscountList { |
| | | private long offset; |
| | | private long limit; |
| | | |
| | | private String pCode; |
| | | |
| | | private String cCode; |
| | | |
| | | private String name; |
| | | |
| | | private Integer type; |
| | | |
| | | private List<Integer> ids; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.course.entity.TCoursePackageDiscount; |
| | | import com.dsh.course.model.DiscountList; |
| | | import com.dsh.course.model.QueryDiscountList; |
| | | import com.dsh.course.model.vo.response.Details; |
| | | import com.dsh.course.model.vo.response.ExchangeCoursePackageResponse; |
| | | |
| | |
| | | |
| | | ExchangeCoursePackageResponse getWeekFreeCourseDetails(Integer coursePackageDiscountId,String lat,String lon); |
| | | |
| | | List<DiscountList> queryDiscountList(QueryDiscountList queryDiscountList); |
| | | |
| | | List<DiscountList> queryDiscountListAudit(QueryDiscountList queryDiscountList); |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.entity.CoursePackagePaymentConfig; |
| | | import com.dsh.course.entity.TCoursePackage; |
| | |
| | | import com.dsh.course.mapper.TCoursePackageDiscountMapper; |
| | | import com.dsh.course.mapper.TCoursePackageMapper; |
| | | import com.dsh.course.mapper.TCoursePackagePaymentMapper; |
| | | import com.dsh.course.model.DiscountList; |
| | | import com.dsh.course.model.QueryDiscountList; |
| | | import com.dsh.course.model.vo.response.Details; |
| | | import com.dsh.course.model.vo.response.ExchangeCoursePackageResponse; |
| | | import com.dsh.course.service.TCoursePackageDiscountService; |
| | |
| | | |
| | | return packageResponse; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<DiscountList> queryDiscountListAudit(QueryDiscountList queryDiscountList) { |
| | | Page<DiscountList> discountListPage = new Page<>(queryDiscountList.getOffset(), queryDiscountList.getLimit()); |
| | | List<DiscountList> discountLists = this.baseMapper.queryDiscountListAudit(discountListPage, queryDiscountList.getPCode(), queryDiscountList.getCCode(), queryDiscountList.getName(), queryDiscountList.getType(), queryDiscountList.getIds()); |
| | | for (DiscountList discountList : discountLists) { |
| | | List<TCoursePackageDiscount> tCoursePackageDiscounts = this.baseMapper.selectList(new LambdaQueryWrapper<TCoursePackageDiscount>().eq(TCoursePackageDiscount::getCoursePackageId, discountList.getCourseId()).ne(TCoursePackageDiscount::getAuditStatus,2).orderByAsc(TCoursePackageDiscount::getType)); |
| | | long count = tCoursePackageDiscounts.stream().filter(e -> e.getAuditStatus().equals(2)).count(); |
| | | if(count>0){ |
| | | discountList.setStatus(2); |
| | | }else { |
| | | discountList.setStatus(1); |
| | | } |
| | | String type=""; |
| | | for (int i = 0; i < tCoursePackageDiscounts.size(); i++) { |
| | | if(tCoursePackageDiscounts.get(i).getType()==1){ |
| | | type += "会员折扣、"; |
| | | }else if(tCoursePackageDiscounts.get(i).getType()==3){ |
| | | type += "限时折扣、"; |
| | | }else if(tCoursePackageDiscounts.get(i).getType()==4){ |
| | | type += "赠送课时、"; |
| | | } |
| | | } |
| | | if(type.length()>0){ |
| | | type = type.substring(0,type.length()-1); |
| | | } |
| | | discountList.setType(type); |
| | | } |
| | | return discountLists; |
| | | } |
| | | @Override |
| | | public List<DiscountList> queryDiscountList(QueryDiscountList queryDiscountList) { |
| | | Page<DiscountList> discountListPage = new Page<>(queryDiscountList.getOffset(), queryDiscountList.getLimit()); |
| | | List<DiscountList> discountLists = this.baseMapper.queryDiscountList(discountListPage, queryDiscountList.getPCode(), queryDiscountList.getCCode(), queryDiscountList.getName(), queryDiscountList.getType(), queryDiscountList.getIds()); |
| | | for (DiscountList discountList : discountLists) { |
| | | List<TCoursePackageDiscount> tCoursePackageDiscounts = this.baseMapper.selectList(new LambdaQueryWrapper<TCoursePackageDiscount>().eq(TCoursePackageDiscount::getCoursePackageId, discountList.getCourseId()).eq(TCoursePackageDiscount::getAuditStatus,2).orderByAsc(TCoursePackageDiscount::getType)); |
| | | long count = tCoursePackageDiscounts.stream().filter(e -> e.getStatus().equals(2)).count(); |
| | | if(count>0){ |
| | | discountList.setStatus(2); |
| | | }else { |
| | | discountList.setStatus(1); |
| | | } |
| | | String type=""; |
| | | for (int i = 0; i < tCoursePackageDiscounts.size(); i++) { |
| | | if(tCoursePackageDiscounts.get(i).getType()==1){ |
| | | type += "会员折扣、"; |
| | | }else if(tCoursePackageDiscounts.get(i).getType()==3){ |
| | | type += "限时折扣、"; |
| | | }else if(tCoursePackageDiscounts.get(i).getType()==4){ |
| | | type += "赠送课时、"; |
| | | } |
| | | } |
| | | if(type.length()>0){ |
| | | type = type.substring(0,type.length()-1); |
| | | } |
| | | discountList.setType(type); |
| | | } |
| | | return discountLists; |
| | | } |
| | | |
| | | private static boolean isDateWithinRange(Date date, Date startTime, Date endTime) { |
| | | return date.after(startTime) && date.before(endTime); |
| | |
| | | <result column="insertTime" property="insertTime" /> |
| | | </resultMap> |
| | | |
| | | <select id="queryDiscountList" resultType="com.dsh.course.model.DiscountList"> |
| | | select t1.id,t1.type,t1.status,t2.province pName,t2.city cName,t2.name,t2.storeId,t2.id courseId from t_course_package_discount t1 left join t_course_package t2 on t1.coursePackageId = t2.id |
| | | where t2.storeId in <foreach collection="ids" close=")" item="id" open="(" separator=","> |
| | | #{id} and t1.auditStatus =2 |
| | | </foreach> |
| | | <if test="pCode !=null and pCode !=''"> |
| | | and t2.provinceCode =#{pCode} |
| | | </if> |
| | | <if test="cCode !=null and cCode !=''"> |
| | | and t2.cityCode =#{cCode} |
| | | </if> |
| | | <if test="name !=null and name !=''"> |
| | | and t2.name like concat("%",#{name},"%") |
| | | </if> |
| | | <if test="type !=null "> |
| | | and t1.type =#{type} |
| | | </if> |
| | | group by t1.coursePackageId |
| | | </select> |
| | | |
| | | |
| | | <select id="queryDiscountListAudit" resultType="com.dsh.course.model.DiscountList"> |
| | | select t1.id,t1.type,t1.auditStatus status,t2.province pName,t2.city cName,t2.name,t2.storeId,t2.id courseId from t_course_package_discount t1 left join t_course_package t2 on t1.coursePackageId = t2.id |
| | | where t2.storeId in <foreach collection="ids" close=")" item="id" open="(" separator=","> |
| | | #{id} and t1.auditStatus !=2 |
| | | </foreach> |
| | | <if test="pCode !=null and pCode !=''"> |
| | | and t2.provinceCode =#{pCode} |
| | | </if> |
| | | <if test="cCode !=null and cCode !=''"> |
| | | and t2.cityCode =#{cCode} |
| | | </if> |
| | | <if test="name !=null and name !=''"> |
| | | and t2.name like concat("%",#{name},"%") |
| | | </if> |
| | | <if test="type !=null "> |
| | | and t1.type =#{type} |
| | | </if> |
| | | group by t1.coursePackageId |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | @PostMapping("/student/queryUserAge") |
| | | HashMap<String, Object> queryUserAge(); |
| | | @PostMapping("/student/queryUserAge1") |
| | | HashMap<String, Object> queryUserAge1(); |
| | | @PostMapping("/student/getUserYYs") |
| | | List<Integer> getUserYYs(Integer id); |
| | | |
| | | @PostMapping("/student/queryUserAgeYys") |
| | | HashMap<String, Object> queryUserAgeYys(Integer id); |
| | | @PostMapping("/student/queryUserAgeStore") |
| | | HashMap<String, Object> queryUserAgeStore(Integer id); |
| | | |
| | | @PostMapping("/student/queryUserAgeYys1") |
| | | HashMap<String, Object> queryUserAgeYys1(Integer id); |
| | | @PostMapping("/student/queryUserAgeStore1") |
| | | HashMap<String, Object> queryUserAgeStore1(Integer id); |
| | | |
| | | @PostMapping("/student/getUserStore") |
| | | List<Integer> getUserStore(Integer id); |
| | | @PostMapping("/student/getUserPtVip") |
| | | List<Integer> getUserPtVip(); |
| | | |
| | | @PostMapping("/student/userAndVipPt") |
| | | HashMap<String, Object> userAndVipPt(Integer type); |
| | | |
| | | |
| | | } |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | @FeignClient("mb-cloud-competition") |
| | |
| | | @PostMapping("/base/competition/queryFee") |
| | | Double queryFee(QueryDataFee queryDataFee); |
| | | |
| | | @PostMapping("/base/competition/actPt") |
| | | HashMap<String, Object> actPt(List<Integer> ids); |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.account.model.QueryDataFee; |
| | | import com.dsh.course.feignClient.course.model.CourseChangeStateDTO; |
| | | import com.dsh.course.feignClient.course.model.QueryCourseList; |
| | | import com.dsh.guns.modular.system.model.EditCourseState; |
| | | import com.dsh.guns.modular.system.model.TCourse; |
| | | import com.dsh.guns.modular.system.model.TQueryBenefitsVideosDTO; |
| | | import com.dsh.guns.modular.system.model.TQueryBenefitsVideosVO; |
| | | import com.dsh.course.feignClient.course.model.*; |
| | | import com.dsh.course.model.AuditDiscount; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | HashMap<String, Object> queryFee(QueryDataFee queryDataFee); |
| | | |
| | | |
| | | @PostMapping("/course/queryByDiscountId") |
| | | TCoursePackage queryByDiscountId(Integer id); |
| | | |
| | | |
| | | @PostMapping("/course/queryDiscountById") |
| | | Integer queryDiscountById(Integer id); |
| | | |
| | | |
| | | @PostMapping("/course/queryDiscountList") |
| | | List<DiscountList> queryDiscountList(QueryDiscountList queryDiscountList); |
| | | |
| | | @PostMapping("/course/queryDiscountListAudit") |
| | | List<DiscountList> queryDiscountListAudit(QueryDiscountList queryDiscountList); |
| | | |
| | | @PostMapping("/course/updateState") |
| | | Boolean updateState(DiscountUpdateState discountUpdateState); |
| | | |
| | | @PostMapping("/course/auditDiscount") |
| | | Boolean auditDiscount(AuditDiscount auditDiscount); |
| | | } |
| | |
| | | @PostMapping("/coursePackageDiscount/setCoursePackageDiscount") |
| | | void setCoursePackageDiscount(List<TCoursePackageDiscount> list); |
| | | |
| | | |
| | | @PostMapping("/coursePackageDiscount/queryCoursePackageDiscountOne") |
| | | List<TCoursePackageDiscount> queryCoursePackageDiscountOne(Integer id); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.course.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class DiscountList { |
| | | private Integer id; |
| | | |
| | | private String pName; |
| | | |
| | | private String cName; |
| | | |
| | | private String shopName; |
| | | |
| | | private String name; |
| | | |
| | | private String type; |
| | | |
| | | private Integer status; |
| | | |
| | | private Integer storeId; |
| | | private Integer courseId; |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.course.model; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class QueryDiscountList { |
| | | private long offset; |
| | | private long limit; |
| | | |
| | | private String pCode; |
| | | |
| | | private String cCode; |
| | | |
| | | private String name; |
| | | |
| | | private Integer type; |
| | | |
| | | private List<Integer> ids; |
| | | } |
| | |
| | | import com.dsh.guns.modular.system.model.TStore; |
| | | import com.dsh.guns.modular.system.model.TStoreListVo; |
| | | import com.dsh.guns.modular.system.model.TTurn; |
| | | import com.dsh.guns.modular.system.model.dto.SelectDto; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | void inset(JsDto jsDto); |
| | | |
| | | JsDto get(Integer id); |
| | | |
| | | List<SelectDto> getSelect(); |
| | | } |
New file |
| | |
| | | package com.dsh.course.mapper; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.guns.modular.system.model.TBackRecord; |
| | | |
| | | /** |
| | | * <p> |
| | | * 退费记录 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-10-09 |
| | | */ |
| | | public interface TBackRecordMapper extends BaseMapper<TBackRecord> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.model; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class AuditDiscount { |
| | | private Integer id; |
| | | |
| | | private Integer type; |
| | | |
| | | private String text; |
| | | } |
| | |
| | | package com.dsh.guns.modular.system.controller.code; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.dsh.course.feignClient.account.*; |
| | | import com.dsh.course.feignClient.account.model.CityManager; |
| | |
| | | |
| | | @Autowired |
| | | private CourseClient courseClient; |
| | | |
| | | @Autowired |
| | | private IStoreService storeService; |
| | | @Autowired |
| | | private VipPaymentClient vipPaymentClient; |
| | | @Autowired |
| | |
| | | private CourseStuddentClient courseStuddentClient; |
| | | @Autowired |
| | | private CoursePackageClient coursePackageClient; |
| | | @Autowired |
| | | private TOperatorService operatorService; |
| | | /** |
| | | * 跳转到平台统计数据页面 |
| | | */ |
| | |
| | | // 最后put |
| | | monthlyData.put("yearMount",objects); |
| | | |
| | | ArrayList<Object> integers = new ArrayList<>(); |
| | | int year = DateUtil.year(new Date()); |
| | | for (int i = 0; i < 10; i++) { |
| | | integers.add(year-i); |
| | | } |
| | | List<Object> collect = integers.stream().sorted().collect(Collectors.toList()); |
| | | monthlyData.put("year",collect); |
| | | return monthlyData; |
| | | } |
| | | |
| | |
| | | |
| | | return null; |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private TBackRecordService backRecordService; |
| | | |
| | | @RequestMapping(value = "/backPt") |
| | | @ResponseBody |
| | | public Object backPt(Integer type) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | List<Integer> userPt = appUserClient.getUserPt(Arrays.asList(1)); |
| | | if(userPt.size()==0){ |
| | | userPt.add(-1); |
| | | } |
| | | ArrayList<Object> integers = new ArrayList<>(); |
| | | int year = DateUtil.year(new Date()); |
| | | List<TBackRecord> thisYear = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().like(TBackRecord::getTime, year).in(TBackRecord::getUserId,userPt)); |
| | | double sum5 = thisYear.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | map.put("thisYear",sum5); |
| | | |
| | | List<TBackRecord> thisMonth = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().like(TBackRecord::getTime, new SimpleDateFormat("yyyy-MM").format(new Date())).in(TBackRecord::getUserId,userPt)); |
| | | double sum6= thisMonth.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | map.put("thisMonth",sum6); |
| | | |
| | | |
| | | |
| | | for (int i = 0; i < 10; i++) { |
| | | integers.add(year-i); |
| | | } |
| | | List<Object> collect = integers.stream().sorted().collect(Collectors.toList()); |
| | | // 年 |
| | | ArrayList<Double> years = new ArrayList<>(); |
| | | for (Object o : collect) { |
| | | double sum=0.0; |
| | | String s = o.toString(); |
| | | List<TBackRecord> list = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().like(TBackRecord::getTime, s).in(TBackRecord::getUserId,userPt)); |
| | | sum = list.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | years.add(sum); |
| | | } |
| | | ArrayList<Double> months = new ArrayList<>(); |
| | | // 月 |
| | | for (int i = 1; i <= 12; i++) { |
| | | double sum=0.0; |
| | | String m=i+""; |
| | | if(i<10){ |
| | | m="0"+i; |
| | | } |
| | | String s = year + "-" + m; |
| | | List<TBackRecord> list = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().like(TBackRecord::getTime, s).in(TBackRecord::getUserId,userPt)); |
| | | sum = list.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | months.add(sum); |
| | | } |
| | | |
| | | // 获取最近四周 |
| | | LocalDateTime minNow = LocalDateTime.now().with(LocalTime.MIN); |
| | | LocalDateTime maxNow = LocalDateTime.now().with(LocalTime.MAX); |
| | | // 周度数据 |
| | | String s1 = minNow.minusDays(6).toString(); |
| | | String s2 = maxNow.toString(); |
| | | |
| | | String s3 = minNow.minusDays(13).toString(); |
| | | String s4 = maxNow.minusDays(6).toString(); |
| | | |
| | | |
| | | String s5 = minNow.minusDays(20).toString(); |
| | | String s6 = maxNow.minusDays(13).toString(); |
| | | |
| | | String s7 = minNow.minusDays(27).toString(); |
| | | String s8 = maxNow.minusDays(20).toString(); |
| | | |
| | | List<TBackRecord> list = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().between(TBackRecord::getTime, s7,s8).in(TBackRecord::getUserId,userPt)); |
| | | double sum = list.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | |
| | | List<TBackRecord> list1 = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().between(TBackRecord::getTime, s5,s6).in(TBackRecord::getUserId,userPt)); |
| | | double sum1 = list1.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | List<TBackRecord> list2 = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().between(TBackRecord::getTime, s3,s4).in(TBackRecord::getUserId,userPt)); |
| | | double sum2 = list2.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | List<TBackRecord> list3 = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().between(TBackRecord::getTime, s1,s2).in(TBackRecord::getUserId,userPt)); |
| | | double sum3 = list3.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | |
| | | map.put("thisWeek",sum3); |
| | | |
| | | ArrayList<Double> week = new ArrayList<>(); |
| | | week.add(sum); |
| | | week.add(sum1); |
| | | week.add(sum2); |
| | | week.add(sum3); |
| | | |
| | | // 日 |
| | | ArrayList<Double> days = new ArrayList<>(); |
| | | Double thisDay=0.0; |
| | | for (int i = 6; i >= 0; i--) { |
| | | String s = minNow.minusDays(i).toString(); |
| | | String s9 = maxNow.minusDays(i).toString(); |
| | | List<TBackRecord> day = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().between(TBackRecord::getTime, s,s9).in(TBackRecord::getUserId,userPt)); |
| | | double sum4 = day.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | days.add(sum4); |
| | | if(i==0){ |
| | | thisDay=sum4; |
| | | } |
| | | } |
| | | |
| | | map.put("thisDay",thisDay); |
| | | map.put("yearData",years); |
| | | map.put("monthData",months); |
| | | map.put("weekData",week); |
| | | map.put("dayData",days); |
| | | |
| | | return map; |
| | | } |
| | | |
| | | @RequestMapping(value = "/backYys") |
| | | @ResponseBody |
| | | public Object backYys(Integer id) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | List<Integer> userPt = appUserClient.getUserYYs(id); |
| | | if(userPt.size()==0){ |
| | | userPt.add(-1); |
| | | } |
| | | ArrayList<Object> integers = new ArrayList<>(); |
| | | int year = DateUtil.year(new Date()); |
| | | List<TBackRecord> thisYear = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().like(TBackRecord::getTime, year).in(TBackRecord::getUserId,userPt)); |
| | | double sum5 = thisYear.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | map.put("thisYear",sum5); |
| | | |
| | | List<TBackRecord> thisMonth = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().like(TBackRecord::getTime, new SimpleDateFormat("yyyy-MM").format(new Date())).in(TBackRecord::getUserId,userPt)); |
| | | double sum6= thisMonth.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | map.put("thisMonth",sum6); |
| | | |
| | | |
| | | |
| | | for (int i = 0; i < 10; i++) { |
| | | integers.add(year-i); |
| | | } |
| | | List<Object> collect = integers.stream().sorted().collect(Collectors.toList()); |
| | | // 年 |
| | | ArrayList<Double> years = new ArrayList<>(); |
| | | for (Object o : collect) { |
| | | double sum=0.0; |
| | | String s = o.toString(); |
| | | List<TBackRecord> list = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().like(TBackRecord::getTime, s).in(TBackRecord::getUserId,userPt)); |
| | | sum = list.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | years.add(sum); |
| | | } |
| | | ArrayList<Double> months = new ArrayList<>(); |
| | | // 月 |
| | | for (int i = 1; i <= 12; i++) { |
| | | double sum=0.0; |
| | | String m=i+""; |
| | | if(i<10){ |
| | | m="0"+i; |
| | | } |
| | | String s = year + "-" + m; |
| | | List<TBackRecord> list = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().like(TBackRecord::getTime, s).in(TBackRecord::getUserId,userPt)); |
| | | sum = list.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | months.add(sum); |
| | | } |
| | | |
| | | // 获取最近四周 |
| | | LocalDateTime minNow = LocalDateTime.now().with(LocalTime.MIN); |
| | | LocalDateTime maxNow = LocalDateTime.now().with(LocalTime.MAX); |
| | | // 周度数据 |
| | | String s1 = minNow.minusDays(6).toString(); |
| | | String s2 = maxNow.toString(); |
| | | |
| | | String s3 = minNow.minusDays(13).toString(); |
| | | String s4 = maxNow.minusDays(6).toString(); |
| | | |
| | | |
| | | String s5 = minNow.minusDays(20).toString(); |
| | | String s6 = maxNow.minusDays(13).toString(); |
| | | |
| | | String s7 = minNow.minusDays(27).toString(); |
| | | String s8 = maxNow.minusDays(20).toString(); |
| | | |
| | | List<TBackRecord> list = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().between(TBackRecord::getTime, s7,s8).in(TBackRecord::getUserId,userPt)); |
| | | double sum = list.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | |
| | | List<TBackRecord> list1 = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().between(TBackRecord::getTime, s5,s6).in(TBackRecord::getUserId,userPt)); |
| | | double sum1 = list1.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | List<TBackRecord> list2 = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().between(TBackRecord::getTime, s3,s4).in(TBackRecord::getUserId,userPt)); |
| | | double sum2 = list2.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | List<TBackRecord> list3 = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().between(TBackRecord::getTime, s1,s2).in(TBackRecord::getUserId,userPt)); |
| | | double sum3 = list3.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | |
| | | map.put("thisWeek",sum3); |
| | | |
| | | ArrayList<Double> week = new ArrayList<>(); |
| | | week.add(sum); |
| | | week.add(sum1); |
| | | week.add(sum2); |
| | | week.add(sum3); |
| | | |
| | | // 日 |
| | | ArrayList<Double> days = new ArrayList<>(); |
| | | Double thisDay=0.0; |
| | | for (int i = 6; i >= 0; i--) { |
| | | String s = minNow.minusDays(i).toString(); |
| | | String s9 = maxNow.minusDays(i).toString(); |
| | | List<TBackRecord> day = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().between(TBackRecord::getTime, s,s9).in(TBackRecord::getUserId,userPt)); |
| | | double sum4 = day.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | days.add(sum4); |
| | | if(i==0){ |
| | | thisDay=sum4; |
| | | } |
| | | } |
| | | |
| | | map.put("thisDay",thisDay); |
| | | map.put("yearData",years); |
| | | map.put("monthData",months); |
| | | map.put("weekData",week); |
| | | map.put("dayData",days); |
| | | |
| | | return map; |
| | | } |
| | | @RequestMapping(value = "/backStore") |
| | | @ResponseBody |
| | | public Object backStore(Integer id) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | List<Integer> userPt = appUserClient.getUserStore(id); |
| | | if(userPt.size()==0){ |
| | | userPt.add(-1); |
| | | } |
| | | ArrayList<Object> integers = new ArrayList<>(); |
| | | int year = DateUtil.year(new Date()); |
| | | List<TBackRecord> thisYear = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().like(TBackRecord::getTime, year).in(TBackRecord::getUserId,userPt)); |
| | | double sum5 = thisYear.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | map.put("thisYear",sum5); |
| | | |
| | | List<TBackRecord> thisMonth = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().like(TBackRecord::getTime, new SimpleDateFormat("yyyy-MM").format(new Date())).in(TBackRecord::getUserId,userPt)); |
| | | double sum6= thisMonth.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | map.put("thisMonth",sum6); |
| | | |
| | | |
| | | |
| | | for (int i = 0; i < 10; i++) { |
| | | integers.add(year-i); |
| | | } |
| | | List<Object> collect = integers.stream().sorted().collect(Collectors.toList()); |
| | | // 年 |
| | | ArrayList<Double> years = new ArrayList<>(); |
| | | for (Object o : collect) { |
| | | double sum=0.0; |
| | | String s = o.toString(); |
| | | List<TBackRecord> list = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().like(TBackRecord::getTime, s).in(TBackRecord::getUserId,userPt)); |
| | | sum = list.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | years.add(sum); |
| | | } |
| | | ArrayList<Double> months = new ArrayList<>(); |
| | | // 月 |
| | | for (int i = 1; i <= 12; i++) { |
| | | double sum=0.0; |
| | | String m=i+""; |
| | | if(i<10){ |
| | | m="0"+i; |
| | | } |
| | | String s = year + "-" + m; |
| | | List<TBackRecord> list = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().like(TBackRecord::getTime, s).in(TBackRecord::getUserId,userPt)); |
| | | sum = list.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | months.add(sum); |
| | | } |
| | | |
| | | // 获取最近四周 |
| | | LocalDateTime minNow = LocalDateTime.now().with(LocalTime.MIN); |
| | | LocalDateTime maxNow = LocalDateTime.now().with(LocalTime.MAX); |
| | | // 周度数据 |
| | | String s1 = minNow.minusDays(6).toString(); |
| | | String s2 = maxNow.toString(); |
| | | |
| | | String s3 = minNow.minusDays(13).toString(); |
| | | String s4 = maxNow.minusDays(6).toString(); |
| | | |
| | | |
| | | String s5 = minNow.minusDays(20).toString(); |
| | | String s6 = maxNow.minusDays(13).toString(); |
| | | |
| | | String s7 = minNow.minusDays(27).toString(); |
| | | String s8 = maxNow.minusDays(20).toString(); |
| | | |
| | | List<TBackRecord> list = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().between(TBackRecord::getTime, s7,s8).in(TBackRecord::getUserId,userPt)); |
| | | double sum = list.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | |
| | | List<TBackRecord> list1 = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().between(TBackRecord::getTime, s5,s6).in(TBackRecord::getUserId,userPt)); |
| | | double sum1 = list1.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | List<TBackRecord> list2 = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().between(TBackRecord::getTime, s3,s4).in(TBackRecord::getUserId,userPt)); |
| | | double sum2 = list2.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | List<TBackRecord> list3 = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().between(TBackRecord::getTime, s1,s2).in(TBackRecord::getUserId,userPt)); |
| | | double sum3 = list3.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | |
| | | map.put("thisWeek",sum3); |
| | | |
| | | ArrayList<Double> week = new ArrayList<>(); |
| | | week.add(sum); |
| | | week.add(sum1); |
| | | week.add(sum2); |
| | | week.add(sum3); |
| | | |
| | | // 日 |
| | | ArrayList<Double> days = new ArrayList<>(); |
| | | Double thisDay=0.0; |
| | | for (int i = 6; i >= 0; i--) { |
| | | String s = minNow.minusDays(i).toString(); |
| | | String s9 = maxNow.minusDays(i).toString(); |
| | | List<TBackRecord> day = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().between(TBackRecord::getTime, s,s9).in(TBackRecord::getUserId,userPt)); |
| | | double sum4 = day.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | days.add(sum4); |
| | | if(i==0){ |
| | | thisDay=sum4; |
| | | } |
| | | } |
| | | |
| | | map.put("thisDay",thisDay); |
| | | map.put("yearData",years); |
| | | map.put("monthData",months); |
| | | map.put("weekData",week); |
| | | map.put("dayData",days); |
| | | |
| | | return map; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/userAndVipPt") |
| | | @ResponseBody |
| | | public Object userAndVipPt(Integer type) { |
| | | HashMap<String, Object> map = appUserClient.userAndVipPt(type); |
| | | return map; |
| | | } |
| | | @RequestMapping(value = "/actPt") |
| | | @ResponseBody |
| | | public Object actPt(Integer type) { |
| | | List<Integer> userPt = appUserClient.getUserPt(Arrays.asList(1)); |
| | | HashMap<String, Object> map = competitionClient.actPt(userPt); |
| | | |
| | | List<TStore> list = storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getOperatorId, 0)); |
| | | for (TStore tStore : list) { |
| | | long l = DateUtil.betweenDay(tStore.getCreateTime(), new Date(), true); |
| | | tStore.getStartTime(); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 跳转到运营商统计数据页面 |
| | | */ |
| | | @RequestMapping("/operator") |
| | | public String operator(Model model) { |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | List<CityManager> cityManagers = cityManagerClient.listAll(); |
| | | HashSet<String> city = new HashSet<>(); |
| | | List<CityManager> list = new ArrayList<>(); |
| | | for (CityManager cityManager : cityManagers) { |
| | | if (!city.contains(cityManager.getCity())){ |
| | | city.add(cityManager.getCity()); |
| | | list.add(cityManager); |
| | | } |
| | | } |
| | | List<TOperator> list = operatorService.list(new LambdaQueryWrapper<TOperator>().ne(TOperator::getState, 3)); |
| | | model.addAttribute("list",list); |
| | | model.addAttribute("objectType",objectType); |
| | | return PREFIX + "operatorIncome.html"; |
| | | } |
| | | |
| | | /** |
| | | * 运营商 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/selectYys") |
| | | public Object selectYys(Integer id,String time) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | // 找出平台的用户 |
| | | List<User> list = sysUserService.list(new LambdaQueryWrapper<User>().eq(User::getObjectType, 2)); |
| | | List<Integer> ids = list.stream().map(User::getId).collect(Collectors.toList()); |
| | | List<Integer> userIds = appUserClient.getUserYYs(id); |
| | | QueryDataFee queryDataFee = new QueryDataFee(time, userIds); |
| | | // 会员费 |
| | | HashMap<String, Object> map1 = appUserClient.queryFee(queryDataFee); |
| | | Object fee1 = map1.get("fee1"); |
| | | |
| | | map.put("fee1",fee1); |
| | | //玩湃比 |
| | | Object fee2 = map1.get("fee2"); |
| | | map.put("fee2",fee2); |
| | | // 课程收入 |
| | | HashMap<String, Object> map3 = courseClient.queryFee(queryDataFee); |
| | | map.put("fee3",map3.get("fee")); |
| | | Object data = map3.get("data"); |
| | | map.put("courseData",data); |
| | | |
| | | |
| | | // 赛事收入 |
| | | Double aDouble1 = competitionClient.queryFee(queryDataFee); |
| | | map.put("fee4",aDouble1); |
| | | |
| | | // 订场 |
| | | if(ids.size()==0){ |
| | | ids.add(-1); |
| | | } |
| | | LambdaQueryWrapper<SiteBooking> vipPaymentLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | if(ToolUtil.isNotEmpty(time)){ |
| | | String stime = time.split(" - ")[0]+" 00:00:00"; |
| | | String etime = time.split(" - ")[1]+" 23:59:59"; |
| | | vipPaymentLambdaQueryWrapper.between(SiteBooking::getInsertTime,stime,etime); |
| | | } |
| | | if(userIds.size()==0){ |
| | | userIds.add(-1); |
| | | } |
| | | vipPaymentLambdaQueryWrapper.in(SiteBooking::getAppUserId,userIds); |
| | | vipPaymentLambdaQueryWrapper.ne(SiteBooking::getStatus,0); |
| | | ArrayList<Integer> objects = new ArrayList<>(); |
| | | objects.add(1); |
| | | objects.add(2); |
| | | vipPaymentLambdaQueryWrapper.in(SiteBooking::getPayType,objects); |
| | | List<SiteBooking> list1 = siteBookingService.list(vipPaymentLambdaQueryWrapper); |
| | | double sum = list1.stream().mapToDouble(SiteBooking::getPayMoney).sum(); |
| | | map.put("fee5",sum); |
| | | |
| | | |
| | | List<Integer> collect = list1.stream().map(SiteBooking::getSiteId).collect(Collectors.toList()); |
| | | if(collect.size()==0){ |
| | | collect.add(-1); |
| | | } |
| | | List<TSite> list3 = siteService.list(new LambdaQueryWrapper<TSite>().in(TSite::getId, collect)); |
| | | for (SiteBooking siteBooking : list1) { |
| | | for (TSite tSite : list3) { |
| | | if(siteBooking.getSiteId().equals(tSite.getId())){ |
| | | siteBooking.setType(tSite.getSiteTypeId()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | List<TSiteType> list2 = siteTypeService.list(); |
| | | |
| | | List<Map<String,Object>> mapList = new ArrayList<>(); |
| | | |
| | | for (TSiteType tSiteType : list2) { |
| | | HashMap<String, Object> map2 = new HashMap<>(); |
| | | map2.put("name",tSiteType.getName()); |
| | | double a =0; |
| | | for (SiteBooking siteBooking : list1) { |
| | | if(tSiteType.getId().equals(siteBooking.getType())){ |
| | | a += siteBooking.getPayMoney(); |
| | | } |
| | | } |
| | | map2.put("value",a); |
| | | mapList.add(map2); |
| | | } |
| | | map.put("siteData",mapList); |
| | | |
| | | |
| | | // 商品 门票 |
| | | HashMap<String, Object> map2 = pointMercharsClient.queryFee(queryDataFee); |
| | | Object all = map2.get("all"); |
| | | Object day = map2.get("day"); |
| | | Object month = map2.get("month"); |
| | | Object quarter = map2.get("quarter"); |
| | | Object year = map2.get("year"); |
| | | map.put("fee7",all); |
| | | map.put("dayone",day); |
| | | map.put("monthone",month); |
| | | map.put("quarterone",quarter); |
| | | map.put("yearone",year); |
| | | |
| | | return map; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 运营商 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/selectStore") |
| | | public Object selectStore(Integer id,String time) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | // 找出平台的用户 |
| | | List<User> list = sysUserService.list(new LambdaQueryWrapper<User>().eq(User::getObjectType, 2)); |
| | | List<Integer> ids = list.stream().map(User::getId).collect(Collectors.toList()); |
| | | List<Integer> userIds = appUserClient.getUserStore(id); |
| | | QueryDataFee queryDataFee = new QueryDataFee(time, userIds); |
| | | // 会员费 |
| | | HashMap<String, Object> map1 = appUserClient.queryFee(queryDataFee); |
| | | Object fee1 = map1.get("fee1"); |
| | | |
| | | map.put("fee1",fee1); |
| | | //玩湃比 |
| | | Object fee2 = map1.get("fee2"); |
| | | map.put("fee2",fee2); |
| | | // 课程收入 |
| | | HashMap<String, Object> map3 = courseClient.queryFee(queryDataFee); |
| | | map.put("fee3",map3.get("fee")); |
| | | Object data = map3.get("data"); |
| | | map.put("courseData",data); |
| | | |
| | | |
| | | // 赛事收入 |
| | | Double aDouble1 = competitionClient.queryFee(queryDataFee); |
| | | map.put("fee4",aDouble1); |
| | | |
| | | // 订场 |
| | | if(ids.size()==0){ |
| | | ids.add(-1); |
| | | } |
| | | LambdaQueryWrapper<SiteBooking> vipPaymentLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | if(ToolUtil.isNotEmpty(time)){ |
| | | String stime = time.split(" - ")[0]+" 00:00:00"; |
| | | String etime = time.split(" - ")[1]+" 23:59:59"; |
| | | vipPaymentLambdaQueryWrapper.between(SiteBooking::getInsertTime,stime,etime); |
| | | } |
| | | if(userIds.size()==0){ |
| | | userIds.add(-1); |
| | | } |
| | | vipPaymentLambdaQueryWrapper.in(SiteBooking::getAppUserId,userIds); |
| | | vipPaymentLambdaQueryWrapper.ne(SiteBooking::getStatus,0); |
| | | ArrayList<Integer> objects = new ArrayList<>(); |
| | | objects.add(1); |
| | | objects.add(2); |
| | | vipPaymentLambdaQueryWrapper.in(SiteBooking::getPayType,objects); |
| | | List<SiteBooking> list1 = siteBookingService.list(vipPaymentLambdaQueryWrapper); |
| | | double sum = list1.stream().mapToDouble(SiteBooking::getPayMoney).sum(); |
| | | map.put("fee5",sum); |
| | | |
| | | |
| | | List<Integer> collect = list1.stream().map(SiteBooking::getSiteId).collect(Collectors.toList()); |
| | | if(collect.size()==0){ |
| | | collect.add(-1); |
| | | } |
| | | List<TSite> list3 = siteService.list(new LambdaQueryWrapper<TSite>().in(TSite::getId, collect)); |
| | | for (SiteBooking siteBooking : list1) { |
| | | for (TSite tSite : list3) { |
| | | if(siteBooking.getSiteId().equals(tSite.getId())){ |
| | | siteBooking.setType(tSite.getSiteTypeId()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | List<TSiteType> list2 = siteTypeService.list(); |
| | | |
| | | List<Map<String,Object>> mapList = new ArrayList<>(); |
| | | |
| | | for (TSiteType tSiteType : list2) { |
| | | HashMap<String, Object> map2 = new HashMap<>(); |
| | | map2.put("name",tSiteType.getName()); |
| | | double a =0; |
| | | for (SiteBooking siteBooking : list1) { |
| | | if(tSiteType.getId().equals(siteBooking.getType())){ |
| | | a += siteBooking.getPayMoney(); |
| | | } |
| | | } |
| | | map2.put("value",a); |
| | | mapList.add(map2); |
| | | } |
| | | map.put("siteData",mapList); |
| | | |
| | | |
| | | // 商品 门票 |
| | | HashMap<String, Object> map2 = pointMercharsClient.queryFee(queryDataFee); |
| | | Object all = map2.get("all"); |
| | | Object day = map2.get("day"); |
| | | Object month = map2.get("month"); |
| | | Object quarter = map2.get("quarter"); |
| | | Object year = map2.get("year"); |
| | | map.put("fee7",all); |
| | | map.put("dayone",day); |
| | | map.put("monthone",month); |
| | | map.put("quarterone",quarter); |
| | | map.put("yearone",year); |
| | | |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跳转到门店统计数据页面 |
| | | */ |
| | | @RequestMapping("/store") |
| | | public String store(Model model) { |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | List<CityManager> cityManagers = cityManagerClient.listAll(); |
| | | HashSet<String> city = new HashSet<>(); |
| | | List<CityManager> list = new ArrayList<>(); |
| | | for (CityManager cityManager : cityManagers) { |
| | | if (!city.contains(cityManager.getCity())){ |
| | | city.add(cityManager.getCity()); |
| | | list.add(cityManager); |
| | | } |
| | | } |
| | | List<TStore> list = storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getState, 1)); |
| | | model.addAttribute("list",list); |
| | | model.addAttribute("objectType",objectType); |
| | | return PREFIX + "storeIncome.html"; |
| | |
| | | map.put("data2",objects3); |
| | | return map; |
| | | } |
| | | @RequestMapping("/stuUserData") |
| | | @ResponseBody |
| | | public Object stuUserData() { |
| | | ArrayList<Integer> objects = new ArrayList<>(); |
| | | objects.add(1); |
| | | HashMap<String, Object> map = appUserClient.queryUserAge1(); |
| | | |
| | | return map; |
| | | } |
| | | @RequestMapping("/stuUserDataYys") |
| | | @ResponseBody |
| | | public Object stuUserDataYys(Integer id) { |
| | | ArrayList<Integer> objects = new ArrayList<>(); |
| | | objects.add(1); |
| | | HashMap<String, Object> map = appUserClient.queryUserAgeYys(id); |
| | | |
| | | return map; |
| | | } |
| | | @RequestMapping("/stuUserDataStore") |
| | | @ResponseBody |
| | | public Object stuUserDataStore(Integer id) { |
| | | ArrayList<Integer> objects = new ArrayList<>(); |
| | | objects.add(1); |
| | | HashMap<String, Object> map = appUserClient.queryUserAgeStore(id); |
| | | |
| | | return map; |
| | | } |
| | | @RequestMapping("/selectYysJx") |
| | | @ResponseBody |
| | | public Object selectYysJx(Integer id) { |
| | | ArrayList<Integer> objects = new ArrayList<>(); |
| | | objects.add(1); |
| | | HashMap<String, Object> map1 = appUserClient.queryUserAgeYys1(id); |
| | | // 找出运营商的用户 |
| | | List<Integer> userYYs = appUserClient.getUserYYs(id); |
| | | |
| | | |
| | | List<Map<String, Object>> mapList = coursePackagePaymentClient.queryCourseData(userYYs); |
| | | ArrayList<Object> objects2 = new ArrayList<>(); |
| | | ArrayList<Object> objects3 = new ArrayList<>(); |
| | | for (Map<String, Object> map : mapList) { |
| | | Object name = map.get("name"); |
| | | Object value = map.get("value"); |
| | | objects2.add(name); |
| | | objects3.add(value); |
| | | } |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map1.put("data1",objects2); |
| | | map1.put("data2",objects3); |
| | | |
| | | |
| | | return map1; |
| | | } |
| | | @RequestMapping("/selectStoreJx") |
| | | @ResponseBody |
| | | public Object selectStoreJx(Integer id) { |
| | | ArrayList<Integer> objects = new ArrayList<>(); |
| | | objects.add(1); |
| | | HashMap<String, Object> map1 = appUserClient.queryUserAgeStore1(id); |
| | | // 找出运营商的用户 |
| | | List<Integer> userYYs = appUserClient.getUserYYs(id); |
| | | |
| | | |
| | | List<Map<String, Object>> mapList = coursePackagePaymentClient.queryCourseData(userYYs); |
| | | ArrayList<Object> objects2 = new ArrayList<>(); |
| | | ArrayList<Object> objects3 = new ArrayList<>(); |
| | | for (Map<String, Object> map : mapList) { |
| | | Object name = map.get("name"); |
| | | Object value = map.get("value"); |
| | | objects2.add(name); |
| | | objects3.add(value); |
| | | } |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map1.put("data1",objects2); |
| | | map1.put("data2",objects3); |
| | | |
| | | |
| | | return map1; |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | String jsonString = jsonArray.getString(i); |
| | | String[] split = jsonString.split("-"); |
| | | System.out.println("============"+split); |
| | | if (split.length>1){ |
| | | first.add(split[0]); |
| | | second.add(split[1]); |
| | | second.add(split[1]);} |
| | | |
| | | } |
| | | String firstString = String.join(",",first); |
New file |
| | |
| | | package com.dsh.guns.modular.system.controller.code; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.competition.CompetitionClient; |
| | | import com.dsh.course.feignClient.competition.model.Competition; |
| | | import com.dsh.course.feignClient.competition.model.CompetitionUser; |
| | | import com.dsh.course.feignClient.competition.model.GetPeopleQuery; |
| | | import com.dsh.course.feignClient.course.CourseClient; |
| | | import com.dsh.course.feignClient.course.CoursePackageDiscountClient; |
| | | import com.dsh.course.feignClient.course.CoursePackagePaymentConfigClient; |
| | | import com.dsh.course.feignClient.course.model.*; |
| | | import com.dsh.course.model.AuditDiscount; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.core.base.tips.ErrorTip; |
| | | import com.dsh.guns.core.base.tips.SuccessTip; |
| | | import com.dsh.guns.core.common.constant.factory.PageFactory; |
| | | import com.dsh.guns.core.util.ToolUtil; |
| | | import com.dsh.guns.modular.system.model.DiscountUpdateState; |
| | | import com.dsh.guns.modular.system.model.TCity; |
| | | import com.dsh.guns.modular.system.model.TStore; |
| | | import com.dsh.guns.modular.system.service.ICityService; |
| | | import com.dsh.guns.modular.system.service.ICoursePackageService; |
| | | import com.dsh.guns.modular.system.service.IStoreService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 车辆管理控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-05 17:25:12 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tDiscount") |
| | | public class TDiscountController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tDiscount/"; |
| | | private String PREFIX1 = "/system/tDiscountAudit/"; |
| | | |
| | | @Autowired |
| | | private CompetitionClient competitionClient; |
| | | |
| | | @Autowired |
| | | private IStoreService storeService; |
| | | |
| | | @Autowired |
| | | private ICityService cityService; |
| | | |
| | | @Autowired |
| | | private CourseClient courseClient; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 跳转到车辆管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index(Model model) { |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | return PREFIX + "TDiscount.html"; |
| | | } |
| | | @RequestMapping("/audit") |
| | | public String indexAudit(Model model) { |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | return PREFIX1 + "TDiscount.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加车辆管理 |
| | | */ |
| | | @RequestMapping("/tCompetition_add") |
| | | public String tCompetitionAdd(Model model) { |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | return PREFIX + "TCompetition_add.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跳转到修改车辆管理 |
| | | */ |
| | | @RequestMapping("/tCompetition_update/{id}") |
| | | public String tCarUpdate(@PathVariable Integer id, Model model) { |
| | | Competition competition = competitionClient.queryById(id); |
| | | model.addAttribute("item",competition); |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, competition.getProvinceCode())); |
| | | List<TCity> list1 = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId,one.getId())); |
| | | |
| | | List<TStore> list2 = storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getCityCode,competition.getCityCode())); |
| | | model.addAttribute("list",list); |
| | | model.addAttribute("list1",list1); |
| | | model.addAttribute("list2",list2); |
| | | model.addAttribute("type",1); |
| | | return PREFIX + "TCompetition_edit.html"; |
| | | } |
| | | @RequestMapping("/tCompetition_info/{id}") |
| | | public String tCarInfo(@PathVariable Integer id, Model model) { |
| | | Competition competition = competitionClient.queryById(id); |
| | | model.addAttribute("item",competition); |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, competition.getProvinceCode())); |
| | | List<TCity> list1 = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId,one.getId())); |
| | | |
| | | List<TStore> list2 = storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getCityCode,competition.getCityCode())); |
| | | model.addAttribute("list",list); |
| | | model.addAttribute("list1",list1); |
| | | model.addAttribute("list2",list2); |
| | | model.addAttribute("type",2); |
| | | |
| | | return PREFIX + "TCompetition_edit.html"; |
| | | } |
| | | @RequestMapping("/tCompetition_user/{id}") |
| | | public String tCarUser(@PathVariable Integer id, Model model) { |
| | | model.addAttribute("id",id); |
| | | return PREFIX + "TCompetitionUser.html"; |
| | | } |
| | | |
| | | @Autowired |
| | | private ICoursePackageService coursePackageService; |
| | | |
| | | @Resource |
| | | private CoursePackagePaymentConfigClient coursePackagePaymentConfigClient; |
| | | |
| | | @Resource |
| | | private CoursePackageDiscountClient coursePackageDiscountClient; |
| | | @RequestMapping("/info") |
| | | public String info( Integer id, Model model) { |
| | | TCoursePackage tCoursePackage1 = courseClient.queryByDiscountId(id); |
| | | TCoursePackage tCoursePackage = coursePackageService.queryById(tCoursePackage1.getId()); |
| | | model.addAttribute("item", tCoursePackage); |
| | | List<CoursePackagePaymentConfig> list4 = coursePackagePaymentConfigClient.queryCoursePackagePaymentConfigList(id); |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | for (CoursePackagePaymentConfig coursePackagePaymentConfig : list4) { |
| | | if(coursePackagePaymentConfig.getCashPayment() == 0){ |
| | | continue; |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId()); |
| | | map.put("classHours", coursePackagePaymentConfig.getClassHours()); |
| | | String payment = ""; |
| | | if(coursePackagePaymentConfig.getCashPayment() > 0){ |
| | | payment += "现金支付"; |
| | | } |
| | | if(coursePackagePaymentConfig.getPlayPaiCoin() > 0){ |
| | | payment += (ToolUtil.isNotEmpty(payment) ? "、" : "") + "玩湃币支付"; |
| | | } |
| | | map.put("payment", payment); |
| | | map.put("cashPayment", coursePackagePaymentConfig.getCashPayment()); |
| | | List<TCoursePackageDiscount> tCoursePackageDiscounts = coursePackageDiscountClient.queryCoursePackageDiscount(coursePackagePaymentConfig.getId()); |
| | | map.put("coursePackageDiscount", tCoursePackageDiscounts); |
| | | list.add(map); |
| | | } |
| | | model.addAttribute("coursePackagePaymentConfig", JSON.toJSONString(list)); |
| | | return PREFIX + "coursePackageDiscount.html"; |
| | | } |
| | | @RequestMapping("/infoOne") |
| | | public String infoOne( Integer id, Model model) { |
| | | Integer state = courseClient.queryDiscountById(id); |
| | | if(state==1){ |
| | | model.addAttribute("stateStr","待审核"); |
| | | model.addAttribute("state",1); |
| | | }else { |
| | | model.addAttribute("stateStr","未通过"); |
| | | model.addAttribute("state",3); |
| | | } |
| | | |
| | | TCoursePackage tCoursePackage1 = courseClient.queryByDiscountId(id); |
| | | TCoursePackage tCoursePackage = coursePackageService.queryById(tCoursePackage1.getId()); |
| | | model.addAttribute("item", tCoursePackage); |
| | | List<CoursePackagePaymentConfig> list4 = coursePackagePaymentConfigClient.queryCoursePackagePaymentConfigList(id); |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | for (CoursePackagePaymentConfig coursePackagePaymentConfig : list4) { |
| | | if(coursePackagePaymentConfig.getCashPayment() == 0){ |
| | | continue; |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId()); |
| | | map.put("classHours", coursePackagePaymentConfig.getClassHours()); |
| | | String payment = ""; |
| | | if(coursePackagePaymentConfig.getCashPayment() > 0){ |
| | | payment += "现金支付"; |
| | | } |
| | | if(coursePackagePaymentConfig.getPlayPaiCoin() > 0){ |
| | | payment += (ToolUtil.isNotEmpty(payment) ? "、" : "") + "玩湃币支付"; |
| | | } |
| | | map.put("payment", payment); |
| | | map.put("cashPayment", coursePackagePaymentConfig.getCashPayment()); |
| | | List<TCoursePackageDiscount> tCoursePackageDiscounts = coursePackageDiscountClient.queryCoursePackageDiscountOne(coursePackagePaymentConfig.getId()); |
| | | map.put("coursePackageDiscount", tCoursePackageDiscounts); |
| | | list.add(map); |
| | | } |
| | | model.addAttribute("coursePackagePaymentConfig", JSON.toJSONString(list)); |
| | | return PREFIX1 + "coursePackageDiscount.html"; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String provinceCode, String cityCode, String shopName, String name, Integer type) { |
| | | LambdaQueryWrapper<TStore> wrapper = new LambdaQueryWrapper<>(); |
| | | if(ToolUtil.isNotEmpty(shopName)){ |
| | | wrapper.like(TStore::getName, shopName); |
| | | } |
| | | List<TStore> list = storeService.list(wrapper); |
| | | Page<DiscountList> page = new PageFactory<DiscountList>().defaultPage(); |
| | | List<DiscountList> discountLists = courseClient.queryDiscountList(new QueryDiscountList(page.getCurrent(),page.getSize(),provinceCode,cityCode,name,type,list.stream().map(TStore::getId).collect(Collectors.toList()))); |
| | | for (DiscountList discountList : discountLists) { |
| | | for (TStore tStore : list) { |
| | | if(discountList.getStoreId().equals(tStore.getId())){ |
| | | discountList.setShopName(tStore.getName()); |
| | | } |
| | | } |
| | | } |
| | | page.setRecords(discountLists); |
| | | return super.packForBT(page); |
| | | } |
| | | @RequestMapping(value = "/listAudit") |
| | | @ResponseBody |
| | | public Object listAudit(String provinceCode, String cityCode, String shopName, String name, Integer type) { |
| | | LambdaQueryWrapper<TStore> wrapper = new LambdaQueryWrapper<>(); |
| | | if(ToolUtil.isNotEmpty(shopName)){ |
| | | wrapper.like(TStore::getName, shopName); |
| | | } |
| | | List<TStore> list = storeService.list(wrapper); |
| | | Page<DiscountList> page = new PageFactory<DiscountList>().defaultPage(); |
| | | List<DiscountList> discountLists = courseClient.queryDiscountListAudit(new QueryDiscountList(page.getCurrent(),page.getSize(),provinceCode,cityCode,name,type,list.stream().map(TStore::getId).collect(Collectors.toList()))); |
| | | for (DiscountList discountList : discountLists) { |
| | | for (TStore tStore : list) { |
| | | if(discountList.getStoreId().equals(tStore.getId())){ |
| | | discountList.setShopName(tStore.getName()); |
| | | } |
| | | } |
| | | } |
| | | page.setRecords(discountLists); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/updateState") |
| | | @ResponseBody |
| | | public Object updateState( Integer id,Integer status) { |
| | | try { |
| | | Boolean b = courseClient.updateState(new DiscountUpdateState(id,status)); |
| | | if(b){ |
| | | return new SuccessTip<>(); |
| | | } |
| | | return new ErrorTip(500,""); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | @RequestMapping(value = "/auditDiscount") |
| | | @ResponseBody |
| | | public Object auditDiscount(Integer id,Integer audit,String text) { |
| | | try { |
| | | Boolean b = courseClient.auditDiscount(new AuditDiscount(id,audit,text)); |
| | | if(b){ |
| | | return new SuccessTip<>(); |
| | | } |
| | | return new ErrorTip(500,""); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object list(Competition competition) { |
| | | try { |
| | | if(ToolUtil.isNotEmpty(competition.getProvinceCode())) { |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, competition.getProvinceCode())); |
| | | competition.setProvince(one.getName()); |
| | | TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, competition.getCityCode())); |
| | | competition.setCity(one1.getName()); |
| | | } |
| | | competition.setAuditStatus(1); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | competition.setStartTime(format.parse(competition.getSTime())); |
| | | competition.setEndTime(format.parse(competition.getETime())); |
| | | competition.setRegisterEndTime(format.parse(competition.getREndTime())); |
| | | competitionClient.add(competition); |
| | | return new SuccessTip<>(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(Competition competition) { |
| | | try { |
| | | Competition competition1 = competitionClient.queryById(competition.getId()); |
| | | if(ToolUtil.isNotEmpty(competition.getProvinceCode())) { |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, competition.getProvinceCode())); |
| | | competition.setProvince(one.getName()); |
| | | TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, competition.getCityCode())); |
| | | competition.setCity(one1.getName()); |
| | | } |
| | | if(ToolUtil.isEmpty(competition.getCoverDrawing())){ |
| | | competition.setCoverDrawing(competition1.getCoverDrawing()); |
| | | } |
| | | if(ToolUtil.isEmpty(competition.getRegistrationNotes())){ |
| | | competition.setRegistrationNotes(competition1.getRegistrationNotes()); |
| | | } |
| | | competitionClient.update(competition); |
| | | return new SuccessTip<>(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/cancel") |
| | | public Object cancel(Integer id) { |
| | | try { |
| | | competitionClient.cancel(id); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/getPeopleFromId") |
| | | public Object getPeopleFromId(Integer id,Integer state) { |
| | | try { |
| | | Page<Object> page = new PageFactory<>().defaultPage(); |
| | | Page<CompetitionUser> data = competitionClient.getPeopleFromId(new GetPeopleQuery(page.getSize(),page.getCurrent(),id,state)); |
| | | return super.packForBT(data); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/onChange") |
| | | @ResponseBody |
| | | public Object onChange(Integer oneId) { |
| | | try { |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, oneId)); |
| | | return cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId,one.getId())); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | @RequestMapping(value = "/oneChangeNext") |
| | | @ResponseBody |
| | | public Object oneChangeNext(Integer oneId) { |
| | | try { |
| | | return storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getCityCode, oneId)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.dsh.guns.modular.system.controller.code; |
| | | |
| | | |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | /** |
| | | * 折扣审核 控制器 |
| | | */ |
| | | |
| | | @Controller |
| | | @RequestMapping("/tDiscountExamine") |
| | | public class TDiscountExamineController { |
| | | |
| | | private String PREFIX = "/system/tDiscountExamine/"; |
| | | private String PREFIX = "/system/tDiscount/"; |
| | | |
| | | /** |
| | | * 折扣审核列表页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index(Model model) { |
| | | return PREFIX + "TDiscountExamine.html"; |
| | | return PREFIX + "TDiscount.html"; |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 车辆管理控制器 |
| | |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | |
| | | // TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, byId.getProvinceCode())); |
| | | TOperatorCity one = operatorCityService.getOne(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getOperatorId, byId.getOperatorId()).eq(TOperatorCity::getType, 1)); |
| | | List<TOperatorCity> one = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getOperatorId, byId.getOperatorId()).eq(TOperatorCity::getType, 1)); |
| | | List<TOperatorCity> ones = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getOperatorId, byId.getOperatorId()).eq(TOperatorCity::getType, 1)); |
| | | |
| | | if(ones.size()>0){ |
| | | model.addAttribute("list",ones); |
| | | List<TOperatorCity> list3 = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getPid, one.getId()).eq(TOperatorCity::getType, 2)); |
| | | TOperatorCity one1 = operatorCityService.getOne(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getOperatorId, byId.getOperatorId()).eq(TOperatorCity::getType, 1).eq(TOperatorCity::getCode,byId.getProvinceCode())); |
| | | List<TOperatorCity> list3 = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>().in(TOperatorCity::getPid, one1.getId()).eq(TOperatorCity::getType, 2)); |
| | | model.addAttribute("list1",list3); |
| | | System.out.println("===list3======="+list3); |
| | | |
| | |
| | | tStore.setType(type); |
| | | tStore.setOperatorId(yyId); |
| | | tStore.setState(1); |
| | | tStore.setCreateTime(new Date()); |
| | | User user = new User(); |
| | | List<User> users = userMapper.selectList(new LambdaQueryWrapper<User>().eq(User::getAccount, userPhone)); |
| | | if(users.size()>0){ |
| | |
| | | @ResponseBody |
| | | public Object onChange2(Integer oneId) { |
| | | try { |
| | | List<TOperatorCity> list1 = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getOperatorId, oneId).eq(TOperatorCity::getType, 1)); |
| | | List<TOperatorCity> list1 = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getId, oneId).eq(TOperatorCity::getType, 1)); |
| | | List<TOperatorCity> list = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getPid, oneId).eq(TOperatorCity::getType, 2)); |
| | | |
| | | // 若是全国 为空 去找这个省下面的市 |
| | |
| | | return ResultUtil.success("添加成功"); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map.put("name","测试场地"); |
| | | map.put("short_name","测试场地"); |
| | | map.put("location","成都"); |
| | | map.put("address","成都地址"); |
| | | map.put("telephone","17888888888"); |
| | | map.put("linkman","成都"); |
| | | map.put("business_time","[{\"start_time\":\"00:00\",\"close_time\":\"23:59\"}]"); |
| | | map.put("logo","https://we-park-life.oss-cn-beijing.aliyuncs.com/img/f325d449f2634855ad1fb0cc796465e8.png"); |
| | | map.put("remark","场地介绍"); |
| | | map.put("lat","30.670124"); |
| | | map.put("lng","103.929497"); |
| | | String s = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addSpace", map); |
| | | System.out.println(s); |
| | | } |
| | | |
| | | /** |
| | | * 编辑场地管理 |
| | |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import com.dsh.guns.modular.system.model.dto.*; |
| | | import com.dsh.guns.modular.system.service.ICityService; |
| | | import com.dsh.guns.modular.system.service.ICoursePackageService; |
| | | import com.dsh.guns.modular.system.service.IStoreService; |
| | | import com.dsh.guns.modular.system.service.ITSiteService; |
| | | import com.dsh.guns.modular.system.service.*; |
| | | import com.dsh.guns.modular.system.util.HttpRequestUtil; |
| | | import com.dsh.guns.modular.system.util.ResultUtil; |
| | | import com.google.common.base.Ascii; |
| | |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | |
| | | @Controller |
| | |
| | | return PREFIX+"ball.html"; |
| | | } |
| | | |
| | | //入园方式 |
| | | @RequestMapping("/joinmethod/{id}") |
| | | public String joinmethod(Model model,@PathVariable("id") Integer id) { |
| | | |
| | | |
| | | model.addAttribute("id",id); |
| | | |
| | | return PREFIX+"join.html"; |
| | | } |
| | | |
| | | |
| | | @RequestMapping("/selectJoin") |
| | | @ResponseBody |
| | | public ResultUtil join(@RequestBody MethodDto method) { |
| | | |
| | | System.out.println("============"+method); |
| | | SiteBooking siteBooking = new SiteBooking(); |
| | | siteBooking.setStatus(2); |
| | | siteBooking.setId(method.getId()); |
| | | siteBooking.setGoType(method.getMethod()); |
| | | iSiteBookingService.updateById(siteBooking); |
| | | |
| | | return new ResultUtil<>(0,0,"到店成功",null,null); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping(value = "/yunying") |
| | | @ResponseBody |
| | | public ResultUtil getUserSlect() { |
| | | |
| | | |
| | | |
| | | List<SelectDto> selectDtos = storeService.getSelect(); |
| | | Map<String,List<SelectDto>> map = new HashMap<>(); |
| | | map.put("options",selectDtos); |
| | | |
| | | System.out.println("=======selectDtos====="+selectDtos); |
| | | return new ResultUtil(0,0,"编辑成功",map,""); |
| | | } |
| | | |
| | | //取消凭证页面 |
| | | @RequestMapping("/tocancel/{id}") |
| | | public String tocancel(Model model,@PathVariable("id") Integer id) { |
| | | |
| | | model.addAttribute("id",id); |
| | | |
| | | return PREFIX+"cancel.html"; |
| | | } |
| | | |
| | | |
| | | @RequestMapping("/cancel") |
| | | @ResponseBody |
| | | public ResultUtil cancel(Integer id,String voucher,String textarea) { |
| | | |
| | | System.out.println("============"+id); |
| | | SiteBooking siteBooking = new SiteBooking(); |
| | | siteBooking.setId(id); |
| | | siteBooking.setStatus(5); |
| | | siteBooking.setVoucher(voucher); |
| | | siteBooking.setRemark(textarea); |
| | | siteBooking.setCancelUserId(UserExt.getUser().getId()); |
| | | iSiteBookingService.updateById(siteBooking); |
| | | |
| | | return new ResultUtil<>(0,0,"到店成功",null,null); |
| | | } |
| | | |
| | | /** |
| | | * 获取变更列表 |
| | |
| | | |
| | | @RequestMapping("/save") |
| | | @ResponseBody |
| | | public ResultUtil save(String red, String blue, String province, String city, Integer site, Integer store |
| | | public ResultUtil save(String operationId,String red, String blue, String province, String city, Integer site, Integer store |
| | | , String kuacheng, BigDecimal kuachengCoin, BigDecimal kuachengCash,String kuachengImage,BigDecimal kuachengInt,Integer kuachengId |
| | | , String shequ, BigDecimal shequCoin, BigDecimal shequCash,String shequImage,BigDecimal shequInt,Integer shequId |
| | | , String shemen, BigDecimal shemenCoin, BigDecimal shemenCash,String shemenImage,BigDecimal shemenInt,Integer shemenId |
| | |
| | | game.setCityCode(city); |
| | | game.setSiteId(site); |
| | | game.setStoreId(store); |
| | | |
| | | |
| | | if (!operationId.equals("平台")){ |
| | | game.setOperationId(Integer.valueOf(operationId));} |
| | | else { |
| | | game.setOperationId(0); |
| | | } |
| | | System.out.println("============"+game); |
| | | Integer gameId = ballClient.save(game); |
| | | |
| | |
| | | @RequestMapping("/pre_add") |
| | | public String add(Model model) { |
| | | |
| | | |
| | | model.addAttribute("is","${is}"); |
| | | |
| | | return PREFIX+"ball_pre_add.html"; |
| | | } |
| | |
| | | |
| | | return PREFIX+"ball_pre_edit.html"; |
| | | } |
| | | |
| | | @Autowired |
| | | private ISiteBookingService iSiteBookingService; |
| | | |
| | | @RequestMapping("/yueyue_edit/{id}") |
| | | public String yueyue_edit(@PathVariable("id") Integer id,Model model) { |
| | | |
| | | List<String> strings1 = new ArrayList<>(); |
| | | |
| | | SiteBooking book = iSiteBookingService.getById(id); |
| | | model.addAttribute("item", book); |
| | | if (book.getMoney()!=null){ |
| | | model.addAttribute("money",book.getMoney().split(","));} |
| | | String[] split1 = book.getTimes().split(";"); |
| | | model.addAttribute("date",split1[0].substring(0,10)); |
| | | |
| | | for (String s : split1) { |
| | | |
| | | String convertedValue = s.substring(11); |
| | | strings1.add(convertedValue); |
| | | } |
| | | |
| | | System.out.println("========strings1====="+strings1); |
| | | |
| | | //时间段 |
| | | List<String> strings = new ArrayList<>(); |
| | | // List<SiteBooking> siteBookings = siteClient.listBooks(book.getSiteId()); |
| | | List<SiteBooking> siteBookings = iSiteBookingService.list(new QueryWrapper<SiteBooking>().eq("siteId", book.getSiteId()).like("times",split1[0].substring(0,10))); |
| | | System.out.println("=======siteBookings======"+siteBookings); |
| | | for (SiteBooking siteBooking : siteBookings) { |
| | | String[] split = siteBooking.getTimes().split(";"); |
| | | for (String s : split) { |
| | | |
| | | String convertedValue = s.substring(11); |
| | | strings.add(convertedValue); |
| | | } |
| | | |
| | | } |
| | | System.out.println("======strings======="+strings); |
| | | |
| | | |
| | | List<OrderDto> timeRanges = new ArrayList<>(); |
| | | |
| | | |
| | | Site site = siteClient.listById(book.getSiteId()); |
| | | System.out.println("================"+site); |
| | | String appointmentStartTime = site.getAppointmentStartTime(); |
| | | String appointmentEndTime = site.getAppointmentEndTime(); |
| | | //生成用于比较日期是否超过的当前日期 |
| | | LocalDate currentDate = LocalDate.now(); |
| | | LocalDate parsedDate = LocalDate.parse(split1[0].substring(0,10), DateTimeFormatter.ISO_DATE); |
| | | boolean isAfterCurrentDate = parsedDate.isBefore(currentDate); |
| | | System.out.println("是否超过当前日期"+isAfterCurrentDate); |
| | | String currentTime = appointmentStartTime; |
| | | while (currentTime.compareTo(appointmentEndTime) < 0) { |
| | | String nextTime = getNextTime(currentTime); |
| | | |
| | | |
| | | String timeRange = currentTime + "-" + nextTime; |
| | | OrderDto orderDto = new OrderDto(); |
| | | orderDto.setTime(timeRange); |
| | | |
| | | LocalTime currentTime1 = LocalTime.now(); |
| | | LocalTime targetTime = LocalTime.parse(currentTime); |
| | | |
| | | boolean hasExceeded = currentTime1.isAfter(targetTime); |
| | | //是否超过当前时间 |
| | | if (hasExceeded){ |
| | | orderDto.setState(0); |
| | | } |
| | | //是否已经预定 |
| | | if (strings.contains(timeRange)){ |
| | | orderDto.setState(0); |
| | | } |
| | | //日期是否超过 |
| | | if (isAfterCurrentDate){ |
| | | orderDto.setState(0); |
| | | } |
| | | //是否是当前场地当前日期预定的 |
| | | if (strings1.contains(timeRange)){ |
| | | orderDto.setState(1); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | timeRanges.add(orderDto); |
| | | currentTime = nextTime; |
| | | } |
| | | System.out.println("-------------"+timeRanges); |
| | | model.addAttribute("timeRanges",timeRanges); |
| | | |
| | | System.out.println("======timeRanges========"+timeRanges); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | |
| | | String cityCode = null; |
| | | if(objectType == 2){//城市管理员 |
| | | CityManager cityManager = cityManagerClient.queryCityManagerById(objectId); |
| | | cityCode = cityManager.getCityCode(); |
| | | } |
| | | List<Map<String, Object>> list = storeService.queryProvince(cityCode); |
| | | model.addAttribute("province", list); |
| | | Object code = list.get(0).get("code"); |
| | | List<Map<String, Object>> list1 = storeService.queryCity(code.toString(), cityCode); |
| | | model.addAttribute("city", list1); |
| | | String code1 = list1.get(0).get("code").toString(); |
| | | List<TStore> list2 = storeService.list(new QueryWrapper<TStore>().eq("cityCode", code1).eq("state", 1)); |
| | | model.addAttribute("store", list2); |
| | | TStore store = list2.get(0); |
| | | List<TSite> list3 = siteService.list(new QueryWrapper<TSite>().eq("storeId", store.getId()).eq("state", 1)); |
| | | model.addAttribute("site", list3); |
| | | |
| | | |
| | | return PREFIX+"yuyue_edit.html"; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private IUserService userService; |
| | | @RequestMapping("/yueyue_info/{id}") |
| | | public String yueyue_info(@PathVariable("id") Integer id,Model model) { |
| | | |
| | | List<String> strings1 = new ArrayList<>(); |
| | | |
| | | SiteBooking book = iSiteBookingService.getById(id); |
| | | model.addAttribute("item", book); |
| | | if (book.getMoney()!=null){ |
| | | model.addAttribute("money",book.getMoney().split(","));} |
| | | String[] split1 = book.getTimes().split(";"); |
| | | model.addAttribute("date",split1[0].substring(0,10)); |
| | | |
| | | |
| | | User user = userService.getById(book.getCancelUserId()); |
| | | if (user!=null) { |
| | | model.addAttribute("cancelUser", user.getName()); |
| | | } |
| | | |
| | | |
| | | for (String s : split1) { |
| | | |
| | | String convertedValue = s.substring(11); |
| | | strings1.add(convertedValue); |
| | | } |
| | | |
| | | System.out.println("========strings1====="+strings1); |
| | | |
| | | //时间段 |
| | | List<String> strings = new ArrayList<>(); |
| | | // List<SiteBooking> siteBookings = siteClient.listBooks(book.getSiteId()); |
| | | List<SiteBooking> siteBookings = iSiteBookingService.list(new QueryWrapper<SiteBooking>().eq("siteId", book.getSiteId()).like("times",split1[0].substring(0,10))); |
| | | System.out.println("=======siteBookings======"+siteBookings); |
| | | for (SiteBooking siteBooking : siteBookings) { |
| | | String[] split = siteBooking.getTimes().split(";"); |
| | | for (String s : split) { |
| | | |
| | | String convertedValue = s.substring(11); |
| | | strings.add(convertedValue); |
| | | } |
| | | |
| | | } |
| | | System.out.println("======strings======="+strings); |
| | | |
| | | |
| | | List<OrderDto> timeRanges = new ArrayList<>(); |
| | | |
| | | |
| | | Site site = siteClient.listById(book.getSiteId()); |
| | | System.out.println("================"+site); |
| | | String appointmentStartTime = site.getAppointmentStartTime(); |
| | | String appointmentEndTime = site.getAppointmentEndTime(); |
| | | //生成用于比较日期是否超过的当前日期 |
| | | LocalDate currentDate = LocalDate.now(); |
| | | LocalDate parsedDate = LocalDate.parse(split1[0].substring(0,10), DateTimeFormatter.ISO_DATE); |
| | | boolean isAfterCurrentDate = parsedDate.isBefore(currentDate); |
| | | System.out.println("是否超过当前日期"+isAfterCurrentDate); |
| | | String currentTime = appointmentStartTime; |
| | | while (currentTime.compareTo(appointmentEndTime) < 0) { |
| | | String nextTime = getNextTime(currentTime); |
| | | |
| | | |
| | | String timeRange = currentTime + "-" + nextTime; |
| | | OrderDto orderDto = new OrderDto(); |
| | | orderDto.setTime(timeRange); |
| | | |
| | | LocalTime currentTime1 = LocalTime.now(); |
| | | LocalTime targetTime = LocalTime.parse(currentTime); |
| | | |
| | | boolean hasExceeded = currentTime1.isAfter(targetTime); |
| | | //是否超过当前时间 |
| | | if (hasExceeded){ |
| | | orderDto.setState(0); |
| | | } |
| | | //是否已经预定 |
| | | if (strings.contains(timeRange)){ |
| | | orderDto.setState(0); |
| | | } |
| | | //日期是否超过 |
| | | if (isAfterCurrentDate){ |
| | | orderDto.setState(0); |
| | | } |
| | | //是否是当前场地当前日期预定的 |
| | | if (strings1.contains(timeRange)){ |
| | | orderDto.setState(1); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | timeRanges.add(orderDto); |
| | | currentTime = nextTime; |
| | | } |
| | | System.out.println("-------------"+timeRanges); |
| | | model.addAttribute("timeRanges",timeRanges); |
| | | |
| | | System.out.println("======timeRanges========"+timeRanges); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | |
| | | String cityCode = null; |
| | | if(objectType == 2){//城市管理员 |
| | | CityManager cityManager = cityManagerClient.queryCityManagerById(objectId); |
| | | cityCode = cityManager.getCityCode(); |
| | | } |
| | | List<Map<String, Object>> list = storeService.queryProvince(cityCode); |
| | | model.addAttribute("province", list); |
| | | Object code = list.get(0).get("code"); |
| | | List<Map<String, Object>> list1 = storeService.queryCity(code.toString(), cityCode); |
| | | model.addAttribute("city", list1); |
| | | String code1 = list1.get(0).get("code").toString(); |
| | | List<TStore> list2 = storeService.list(new QueryWrapper<TStore>().eq("cityCode", code1).eq("state", 1)); |
| | | model.addAttribute("store", list2); |
| | | TStore store = list2.get(0); |
| | | List<TSite> list3 = siteService.list(new QueryWrapper<TSite>().eq("storeId", store.getId()).eq("state", 1)); |
| | | model.addAttribute("site", list3); |
| | | |
| | | |
| | | return PREFIX+"yuyue_info.html"; |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping("/paike") |
| | |
| | | |
| | | @RequestMapping("/yuyuetimes/{id}") |
| | | @ResponseBody |
| | | public List<OrderDto> yuyuetimes(@PathVariable("id") Integer id) { |
| | | |
| | | public List<OrderDto> yuyuetimes(@PathVariable("id") Integer id,String date) { |
| | | System.out.println("=======date======"+date); |
| | | |
| | | List<String> strings = new ArrayList<>(); |
| | | List<SiteBooking> siteBookings = siteClient.listBooks(id); |
| | | |
| | | // List<SiteBooking> siteBookings = siteClient.listBooks(id); |
| | | List<SiteBooking> siteBookings = iSiteBookingService.list(new QueryWrapper<SiteBooking>().eq("siteId", id).like("times",date)); |
| | | System.out.println("=======siteBookings======"+siteBookings); |
| | | for (SiteBooking siteBooking : siteBookings) { |
| | | String[] split = siteBooking.getTimes().split(";"); |
| | |
| | | } |
| | | |
| | | return String.format("%02d:%02d", hour, minute); |
| | | |
| | | // String[] parts = currentTime.split(":"); |
| | | // int hour = Integer.parseInt(parts[0]); |
| | | // int minute = Integer.parseInt(parts[1]); |
| | | // |
| | | // if (minute == 45) { |
| | | // hour++; |
| | | // minute = 0; |
| | | // } else if (minute == 0){ |
| | | // minute = 15; |
| | | // }else if (minute == 15){ |
| | | // minute = 30; |
| | | // }else if (minute == 30){ |
| | | // minute = 45; |
| | | // } |
| | | // |
| | | // return String.format("%02d:%02d", hour, minute); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | return new ResultUtil<>(null,200,null,null,null); |
| | | } |
| | | |
| | | @RequestMapping("/orderedit") |
| | | @ResponseBody |
| | | public ResultUtil orderedit(SiteBooking siteBooking){ |
| | | iSiteBookingService.updateById(siteBooking); |
| | | |
| | | System.out.println("================="+siteBooking); |
| | | |
| | | return new ResultUtil<>(null,200,null,null,null); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.model; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class DiscountUpdateState { |
| | | private Integer id; |
| | | |
| | | private Integer status; |
| | | } |
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 java.time.LocalDateTime; |
| | | 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-10-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_back_record") |
| | | public class TBackRecord extends Model<TBackRecord> { |
| | | |
| | | private static final long serialVersionUID=1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @TableField("userId") |
| | | private Integer userId; |
| | | |
| | | private Double money=0.0; |
| | | |
| | | private LocalDateTime time; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
| | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @TableName("t_store") |
| | | @Data |
| | |
| | | private Integer type; |
| | | @TableField("ids") |
| | | private String ids; |
| | | @TableField("createTime") |
| | | private Date createTime; |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.model.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class MethodDto { |
| | | Integer id; |
| | | Integer method; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import com.dsh.guns.modular.system.model.dto.SelectDto; |
| | | import io.swagger.models.auth.In; |
| | | import com.dsh.course.dto.JsDto; |
| | | import com.dsh.guns.modular.system.model.Dict; |
| | |
| | | void insert(JsDto jsDto); |
| | | |
| | | JsDto get(Integer id); |
| | | |
| | | List<SelectDto> getSelect(); |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.service; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.guns.modular.system.model.TBackRecord; |
| | | |
| | | /** |
| | | * <p> |
| | | * 退费记录 服务类 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-10-09 |
| | | */ |
| | | public interface TBackRecordService extends IService<TBackRecord> { |
| | | |
| | | } |
| | |
| | | import com.dsh.guns.modular.system.model.TStore; |
| | | import com.dsh.guns.modular.system.model.TStoreListVo; |
| | | import com.dsh.guns.modular.system.model.TTurn; |
| | | import com.dsh.guns.modular.system.model.dto.SelectDto; |
| | | import com.dsh.guns.modular.system.service.IStoreService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<SelectDto> getSelect() { |
| | | return this.baseMapper.getSelect(); |
| | | } |
| | | |
| | | @Override |
| | | public List<TImgConfig> getConfig() { |
| | | |
| | | return this.baseMapper.getConfig1(); |
New file |
| | |
| | | package com.dsh.guns.modular.system.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.mapper.TBackRecordMapper; |
| | | import com.dsh.guns.modular.system.model.TBackRecord; |
| | | import com.dsh.guns.modular.system.service.TBackRecordService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 退费记录 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-10-09 |
| | | */ |
| | | @Service |
| | | public class TBackRecordServiceImpl extends ServiceImpl<TBackRecordMapper, TBackRecord> implements TBackRecordService { |
| | | |
| | | } |
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.TBackRecordMapper"> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | <select id="getConfig1" resultType="com.dsh.guns.modular.system.model.TImgConfig"> |
| | | select * from t_img_config |
| | | </select> |
| | | <select id="getSelect" resultType="com.dsh.guns.modular.system.model.dto.SelectDto"> |
| | | |
| | | |
| | | SELECT op.id , CONCAT(us.name,'-',us.`phone`) as value |
| | | FROM t_operator op |
| | | LEFT JOIN sys_user us on op.userId = us.id |
| | | |
| | | |
| | | |
| | | |
| | | </select> |
| | | </mapper> |
| | |
| | | { |
| | | "type": "form", |
| | | "id": "u:24af29be25d2", |
| | | "title": "111", |
| | | "title": "", |
| | | "body": [ |
| | | { |
| | | "label": "所属运营商:", |
| | | "type": "tpl", |
| | | "id": "u:587781d5d181", |
| | | "tpl": "                                    *所属运营商:", |
| | | "inline": true, |
| | | "wrapperComponent": "", |
| | | "style": { |
| | | "marginLeft": "0" |
| | | } |
| | | },{ |
| | | "type": "select", |
| | | "name": "operator", |
| | | "id": "u:970f68a2c4ee", |
| | | "mode": "horizontal", |
| | | "size": "lg", |
| | | "label": "", |
| | | "name": "operationId", |
| | | "id": "u:c037c33c2c81", |
| | | "mode": "inline", |
| | | "size": "md", |
| | | "multiple": false, |
| | | "showInvalidMatch": false, |
| | | "searchable": true, |
| | |
| | | "horizontal": { |
| | | "leftFixed": "lg" |
| | | }, |
| | | "options": [ |
| | | { |
| | | "label": "等待沟通中", |
| | | "value": "等待沟通中" |
| | | "disabledOn": "is!=0", |
| | | "required": true, |
| | | "source": { |
| | | "url": "/ball/yunying", |
| | | "method": "post", |
| | | "messages": { |
| | | } |
| | | ] |
| | | }, |
| | | "labelField": "value", |
| | | "valueField": "id" |
| | | },{ |
| | | "type": "checkbox", |
| | | "option": "平台", |
| | | "name": "is", |
| | | "id": "u:88f23ebcf4f7", |
| | | "onEvent": { |
| | | "change": { |
| | | "weight": 0, |
| | | "actions": [ |
| | | { |
| | | "componentId": "u:c037c33c2c81", |
| | | "args": { |
| | | "value": "$event.data.value" |
| | | }, |
| | | "actionType": "setValue" |
| | | } |
| | | ] |
| | | } |
| | | }, |
| | | "trueValue": "平台", |
| | | "falseValue": 0, |
| | | "mode": "inline" |
| | | }, |
| | | { |
| | | "type": "select", |
| | |
| | | }, |
| | | "value": "", |
| | | "required": true |
| | | |
| | | }, |
| | | { |
| | | "type": "input-text", |
| | |
| | | "clearValueOnHidden": false, |
| | | "hidden": false, |
| | | "required": true |
| | | |
| | | }, |
| | | { |
| | | "type": "button", |
| | |
| | | "mode": "inline", |
| | | "labelClassName": "text-dark m-b", |
| | | "value": "14" |
| | | }, |
| | | { |
| | | "type": "tpl", |
| | | "id": "u:587781d5d181", |
| | | "tpl": "                                ", |
| | | "inline": true, |
| | | "wrapperComponent": "", |
| | | "style": { |
| | | "marginLeft": "0" |
| | | } |
| | | }, |
| | | { |
| | | "type": "input-text", |
| | |
| | | "value": "16" |
| | | }, |
| | | { |
| | | "type": "tpl", |
| | | "id": "u:587781d5d181", |
| | | "tpl": "                                ", |
| | | "inline": true, |
| | | "wrapperComponent": "", |
| | | "style": { |
| | | "marginLeft": "0" |
| | | } |
| | | }, |
| | | { |
| | | "type": "input-text", |
| | | "label": "玩派币", |
| | | "name": "shequCoin", |
| | |
| | | "value": "13" |
| | | }, |
| | | { |
| | | "type": "tpl", |
| | | "id": "u:587781d5d181", |
| | | "tpl": "                                ", |
| | | "inline": true, |
| | | "wrapperComponent": "", |
| | | "style": { |
| | | "marginLeft": "0" |
| | | } |
| | | }, |
| | | { |
| | | "type": "input-text", |
| | | "label": "玩派币", |
| | | "name": "shemenCoin", |
| | |
| | | "value": "玩湃熊之力-速度" |
| | | }, |
| | | { |
| | | "type": "tpl", |
| | | "id": "u:587781d5d181", |
| | | "tpl": "                                ", |
| | | "inline": true, |
| | | "wrapperComponent": "", |
| | | "style": { |
| | | "marginLeft": "0" |
| | | } |
| | | }, |
| | | { |
| | | "type": "hidden", |
| | | "label": "", |
| | | "name": "suduId", |
| | | "id": "u:f0f7e6028e17", |
| | | "id": "u:ca5a1fd9c191", |
| | | "mode": "inline", |
| | | "labelClassName": "text-dark m-b", |
| | | "value": "15" |
| | |
| | | "value": "1" |
| | | }, |
| | | { |
| | | "type": "tpl", |
| | | "id": "u:587781d5d181", |
| | | "tpl": "                                ", |
| | | "inline": true, |
| | | "wrapperComponent": "", |
| | | "style": { |
| | | "marginLeft": "0" |
| | | } |
| | | }, |
| | | { |
| | | "type": "input-text", |
| | | "label": "玩派币", |
| | | "name": "fangkuaiCoin", |
| | |
| | | "mode": "inline", |
| | | "labelClassName": "text-dark m-b", |
| | | "value": "7" |
| | | }, |
| | | { |
| | | "type": "tpl", |
| | | "id": "u:587781d5d181", |
| | | "tpl": "                                ", |
| | | "inline": true, |
| | | "wrapperComponent": "", |
| | | "style": { |
| | | "marginLeft": "0" |
| | | } |
| | | }, |
| | | { |
| | | "type": "input-text", |
| | |
| | | "value": "8" |
| | | }, |
| | | { |
| | | "type": "tpl", |
| | | "id": "u:587781d5d181", |
| | | "tpl": "                                ", |
| | | "inline": true, |
| | | "wrapperComponent": "", |
| | | "style": { |
| | | "marginLeft": "0" |
| | | } |
| | | }, |
| | | { |
| | | "type": "input-text", |
| | | "label": "玩派币", |
| | | "name": "sqCoin", |
| | |
| | | "mode": "inline", |
| | | "labelClassName": "text-dark m-b", |
| | | "value": "10" |
| | | }, |
| | | { |
| | | "type": "tpl", |
| | | "id": "u:587781d5d181", |
| | | "tpl": "                                ", |
| | | "inline": true, |
| | | "wrapperComponent": "", |
| | | "style": { |
| | | "marginLeft": "0" |
| | | } |
| | | }, |
| | | { |
| | | "type": "input-text", |
| | |
| | | "value": "11" |
| | | }, |
| | | { |
| | | "type": "tpl", |
| | | "id": "u:587781d5d181", |
| | | "tpl": "                                ", |
| | | "inline": true, |
| | | "wrapperComponent": "", |
| | | "style": { |
| | | "marginLeft": "0" |
| | | } |
| | | }, |
| | | { |
| | | "type": "input-text", |
| | | "label": "玩派币", |
| | | "name": "zs2Coin", |
| | |
| | | }, |
| | | { |
| | | "type": "hidden", |
| | | "label": "游戏名称", |
| | | "label": "", |
| | | "name": "ly", |
| | | "id": "u:c4a543b6cda0", |
| | | "mode": "inline", |
| | |
| | | }, |
| | | { |
| | | "type": "hidden", |
| | | "label": "游戏id", |
| | | "label": "", |
| | | "name": "lyId", |
| | | "id": "u:90d5f2fa406a", |
| | | "mode": "inline", |
| | | "labelClassName": "text-dark m-b", |
| | | "value": "5" |
| | | }, |
| | | { |
| | | "type": "tpl", |
| | | "id": "u:587781d5d181", |
| | | "tpl": "                                ", |
| | | "inline": true, |
| | | "wrapperComponent": "", |
| | | "style": { |
| | | "marginLeft": "0" |
| | | } |
| | | }, |
| | | { |
| | | "type": "input-text", |
| | |
| | | "actions": [ |
| | | { |
| | | "componentId": "u:24af29be25d2", |
| | | "actionType": "submit" |
| | | }, |
| | | { |
| | | "args": { |
| | | }, |
| | | "outputVar": "responseResult", |
| | | "actionType": "submit" |
| | | "script": "window.parent.TStudent.table.refresh();", |
| | | "actionType": "custom" |
| | | }, |
| | | { |
| | | "args": {}, |
| | | "script": "parent.layer.close(window.parent.TStudent.layerIndex);", |
| | | "actionType": "custom" |
| | | } |
| | | ] |
| | | } |
| | |
| | | "dataType": "form-data" |
| | | }, |
| | | "actions": [ |
| | | ] |
| | | ], |
| | | "onEvent": { |
| | | "submitSucc": { |
| | | "weight": 0, |
| | | "actions": [ |
| | | { |
| | | "args": { |
| | | }, |
| | | "script": "parent.layer.close(window.parent.TStudent.layerIndex);", |
| | | "actionType": "custom" |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | |
| | | "title": "", |
| | | "body": [ |
| | | { |
| | | "label": "所属运营商:", |
| | | "type": "tpl", |
| | | "id": "u:587781d5d181", |
| | | "tpl": "                                    *所属运营商:", |
| | | "inline": true, |
| | | "wrapperComponent": "", |
| | | "style": { |
| | | "marginLeft": "0" |
| | | } |
| | | },{ |
| | | "type": "select", |
| | | "name": "operator", |
| | | "id": "u:970f68a2c4ee", |
| | | "mode": "horizontal", |
| | | "size": "lg", |
| | | "label": "", |
| | | "name": "operationId", |
| | | "id": "u:c037c33c2c81", |
| | | "mode": "inline", |
| | | "size": "md", |
| | | "multiple": false, |
| | | "showInvalidMatch": false, |
| | | "searchable": true, |
| | |
| | | "horizontal": { |
| | | "leftFixed": "lg" |
| | | }, |
| | | "options": [ |
| | | { |
| | | "label": "等待沟通中", |
| | | "value": "等待沟通中" |
| | | "disabledOn": "is!=0", |
| | | "required": true, |
| | | "source": { |
| | | "url": "/ball/yunying", |
| | | "method": "post", |
| | | "messages": { |
| | | } |
| | | ] |
| | | }, |
| | | "labelField": "value", |
| | | "valueField": "id" |
| | | },{ |
| | | "type": "checkbox", |
| | | "option": "平台", |
| | | "name": "is", |
| | | "id": "u:88f23ebcf4f7", |
| | | "onEvent": { |
| | | "change": { |
| | | "weight": 0, |
| | | "actions": [ |
| | | { |
| | | "componentId": "u:c037c33c2c81", |
| | | "args": { |
| | | "value": "$event.data.value" |
| | | }, |
| | | "actionType": "setValue" |
| | | } |
| | | ] |
| | | } |
| | | }, |
| | | "trueValue": "平台", |
| | | "falseValue": 0, |
| | | "mode": "inline" |
| | | }, |
| | | { |
| | | "type": "select", |
| | |
| | | "actions": [ |
| | | { |
| | | "componentId": "u:24af29be25d2", |
| | | "actionType": "submit" |
| | | }, |
| | | { |
| | | "args": { |
| | | }, |
| | | "outputVar": "responseResult", |
| | | "actionType": "submit" |
| | | "script": "window.parent.TStudent.table.refresh();", |
| | | "actionType": "custom" |
| | | }, |
| | | { |
| | | "args": {}, |
| | | "script": "parent.layer.close(window.parent.TStudent.layerIndex);", |
| | | "actionType": "custom" |
| | | } |
| | | ] |
| | | } |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="zh"> |
| | | <head> |
| | | <meta charset="UTF-8" /> |
| | | <title>amis demo</title> |
| | | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| | | <meta |
| | | name="viewport" |
| | | content="width=device-width, initial-scale=1, maximum-scale=1" |
| | | /> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> |
| | | <link rel="stylesheet" href="${ctxPath}/sdk/sdk.css" /> |
| | | <link rel="stylesheet" href="${ctxPath}/sdk/helper.css" /> |
| | | <link rel="stylesheet" href="${ctxPath}/sdk/iconfont.css" /> |
| | | <!-- 这是默认主题所需的,如果是其他主题则不需要 --> |
| | | <!-- 从 1.1.0 开始 sdk.css 将不支持 IE 11,如果要支持 IE11 请引用这个 css,并把前面那个删了 --> |
| | | <!-- <link rel="stylesheet" href="sdk-ie11.css" /> --> |
| | | <!-- 不过 amis 开发团队几乎没测试过 IE 11 下的效果,所以可能有细节功能用不了,如果发现请报 issue --> |
| | | <style> |
| | | html, |
| | | body, |
| | | .app-wrapper { |
| | | position: relative; |
| | | width: 100%; |
| | | height: 100%; |
| | | margin: 0; |
| | | padding: 0; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <div id="root" class="app-wrapper"></div> |
| | | <script src="${ctxPath}/sdk/sdk.js"></script> |
| | | <script type="text/javascript"> |
| | | (function () { |
| | | let amis = amisRequire('amis/embed'); |
| | | // 通过替换下面这个配置来生成不同页面 |
| | | let amisJSON ={ |
| | | "type": "page", |
| | | "title": "", |
| | | "body": [ |
| | | { |
| | | "type": "form", |
| | | "id": "u:6d72ddddf222", |
| | | "title": "", |
| | | "body": [ |
| | | { |
| | | "type": "grid", |
| | | "columns": [ |
| | | ], |
| | | "id": "u:313016b48f71" |
| | | }, |
| | | { |
| | | "type": "flex", |
| | | "id": "u:e21645a48093", |
| | | "className": "p-1", |
| | | "items": [ |
| | | { |
| | | "type": "tpl", |
| | | "id": "u:5130236fd5a1", |
| | | "tpl": "入园方式", |
| | | "inline": true, |
| | | "wrapperComponent": "h2" |
| | | } |
| | | ], |
| | | "style": { |
| | | "position": "static", |
| | | "flexWrap": "nowrap" |
| | | }, |
| | | "direction": "row", |
| | | "justify": "center", |
| | | "alignItems": "stretch", |
| | | "isFixedHeight": false, |
| | | "isFixedWidth": false |
| | | }, |
| | | { |
| | | "type": "input-image", |
| | | "label": "上传凭证", |
| | | "name": "voucher", |
| | | "autoUpload": true, |
| | | "proxy": true, |
| | | "uploadType": "fileReceptor", |
| | | "imageClassName": "r w-full", |
| | | "receiver": { |
| | | "url": "/mgr/uploadImgAmis", |
| | | "method": "post" |
| | | }, |
| | | "id": "u:15f57e1e7de6", |
| | | "accept": ".jpeg, .jpg, .png, .gif", |
| | | "multiple": false, |
| | | "hideUploadButton": false, |
| | | "fixedSize": false, |
| | | "required": true, |
| | | "mode": "horizontal" |
| | | }, |
| | | { |
| | | "type": "textarea", |
| | | "label": "备注:", |
| | | "name": "textarea", |
| | | "id": "u:d98613414ea8", |
| | | "minRows": 3, |
| | | "maxRows": 20, |
| | | "mode": "horizontal", |
| | | "size": "md" |
| | | }, |
| | | { |
| | | "type": "hidden", |
| | | "name": "id", |
| | | "id": "u:91f4afc2930e", |
| | | "value": `${id}` |
| | | }, |
| | | { |
| | | "type": "flex", |
| | | "id": "u:8254704349a2", |
| | | "className": "p-1", |
| | | "items": [ |
| | | { |
| | | "type": "button", |
| | | "id": "u:6c0b8f917bf7", |
| | | "label": "关闭", |
| | | "onEvent": { |
| | | "click": { |
| | | "actions": [ |
| | | { |
| | | "args": { |
| | | }, |
| | | "script": "parent.layer.close(window.parent.TStudent.layerIndex);", |
| | | "actionType": "custom" |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | "type": "button", |
| | | "id": "u:6c0b8f917bf7", |
| | | "label": "保存", |
| | | "level": "info", |
| | | "onEvent": { |
| | | "click": { |
| | | "actions": [ |
| | | { |
| | | "componentId": "u:6d72ddddf222", |
| | | "actionType": "submit" |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | ], |
| | | "style": { |
| | | "position": "relative" |
| | | } |
| | | }, |
| | | { |
| | | "type": "grid", |
| | | "columns": [ |
| | | ], |
| | | "id": "u:ec43218540fa" |
| | | } |
| | | ], |
| | | "api": { |
| | | "url": "/ball/cancel", |
| | | "method": "post", |
| | | "messages": { |
| | | }, |
| | | "dataType": "form-data" |
| | | }, |
| | | "actions": [ |
| | | ], |
| | | "onEvent": { |
| | | "submitSucc": { |
| | | "weight": 0, |
| | | "actions": [ |
| | | { |
| | | "args": { |
| | | }, |
| | | "script": "window.parent.TStudent.table.refresh();", |
| | | "actionType": "custom" |
| | | }, |
| | | { |
| | | "args": { |
| | | }, |
| | | "script": "parent.layer.close(window.parent.TStudent.layerIndex);", |
| | | "actionType": "custom" |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | ], |
| | | "id": "u:b97e4e9b9f48", |
| | | "actions": [ |
| | | ] |
| | | }; |
| | | |
| | | let amisScoped = amis.embed('#root', amisJSON); |
| | | |
| | | |
| | | })(); |
| | | |
| | | |
| | | </script> |
| | | |
| | | </body> |
| | | </html> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="zh"> |
| | | <head> |
| | | <meta charset="UTF-8" /> |
| | | <title>amis demo</title> |
| | | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| | | <meta |
| | | name="viewport" |
| | | content="width=device-width, initial-scale=1, maximum-scale=1" |
| | | /> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> |
| | | <link rel="stylesheet" href="${ctxPath}/sdk/sdk.css" /> |
| | | <link rel="stylesheet" href="${ctxPath}/sdk/helper.css" /> |
| | | <link rel="stylesheet" href="${ctxPath}/sdk/iconfont.css" /> |
| | | <!-- 这是默认主题所需的,如果是其他主题则不需要 --> |
| | | <!-- 从 1.1.0 开始 sdk.css 将不支持 IE 11,如果要支持 IE11 请引用这个 css,并把前面那个删了 --> |
| | | <!-- <link rel="stylesheet" href="sdk-ie11.css" /> --> |
| | | <!-- 不过 amis 开发团队几乎没测试过 IE 11 下的效果,所以可能有细节功能用不了,如果发现请报 issue --> |
| | | <style> |
| | | html, |
| | | body, |
| | | .app-wrapper { |
| | | position: relative; |
| | | width: 100%; |
| | | height: 100%; |
| | | margin: 0; |
| | | padding: 0; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <div id="root" class="app-wrapper"></div> |
| | | <script src="${ctxPath}/sdk/sdk.js"></script> |
| | | <script type="text/javascript"> |
| | | (function () { |
| | | let amis = amisRequire('amis/embed'); |
| | | // 通过替换下面这个配置来生成不同页面 |
| | | let amisJSON ={ |
| | | "type": "page", |
| | | "title": "", |
| | | "body": [ |
| | | { |
| | | "type": "form", |
| | | "id": "u:6d72ddddf25c", |
| | | "title": "", |
| | | "body": [ |
| | | { |
| | | "type": "grid", |
| | | "columns": [ |
| | | ], |
| | | "id": "u:313016b48f71" |
| | | }, |
| | | { |
| | | "type": "flex", |
| | | "id": "u:e21645a48093", |
| | | "className": "p-1", |
| | | "items": [ |
| | | { |
| | | "type": "tpl", |
| | | "id": "u:5130236fd5a1", |
| | | "tpl": "入园方式", |
| | | "inline": true, |
| | | "wrapperComponent": "h2" |
| | | } |
| | | ], |
| | | "style": { |
| | | "position": "static", |
| | | "flexWrap": "nowrap" |
| | | }, |
| | | "direction": "row", |
| | | "justify": "center", |
| | | "alignItems": "stretch", |
| | | "isFixedHeight": false, |
| | | "isFixedWidth": false |
| | | }, |
| | | { |
| | | "type": "hidden", |
| | | "name": "id", |
| | | "id": "u:91f4afc2930e", |
| | | "value": `${id}` |
| | | }, |
| | | { |
| | | "type": "radios", |
| | | "id": "u:d98068b4f7d2", |
| | | "label": "请选择:", |
| | | "name": "method", |
| | | "options": [ |
| | | { |
| | | "label": "手环", |
| | | "value": "1" |
| | | } |
| | | ], |
| | | "mode": "inline", |
| | | "required": true |
| | | }, |
| | | { |
| | | "type": "flex", |
| | | "id": "u:8254704349a2", |
| | | "className": "p-1", |
| | | "items": [ |
| | | { |
| | | "type": "button", |
| | | "id": "u:6c0b8f917bf7", |
| | | "label": "关闭", |
| | | "onEvent": { |
| | | "click": { |
| | | "actions": [ |
| | | { |
| | | "args": { |
| | | }, |
| | | "script": "parent.layer.close(window.parent.TStudent.layerIndex);", |
| | | "actionType": "custom" |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | "type": "button", |
| | | "id": "u:6c0b8f917bf7", |
| | | "label": "保存", |
| | | "level": "info", |
| | | "onEvent": { |
| | | "click": { |
| | | "actions": [ |
| | | { |
| | | "componentId": "u:6d72ddddf25c", |
| | | "actionType": "submit" |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | ], |
| | | "style": { |
| | | "position": "relative" |
| | | } |
| | | }, |
| | | { |
| | | "type": "grid", |
| | | "columns": [ |
| | | ], |
| | | "id": "u:ec43218540fa" |
| | | } |
| | | ], |
| | | "api": { |
| | | "url": "/ball/selectJoin", |
| | | "method": "post", |
| | | "messages": { |
| | | } |
| | | }, |
| | | "actions": [ |
| | | ], |
| | | "onEvent": { |
| | | "submitSucc": { |
| | | "weight": 0, |
| | | "actions": [ |
| | | { |
| | | "args": { |
| | | }, |
| | | "script": "window.parent.TStudent.table.refresh();", |
| | | "actionType": "custom" |
| | | }, |
| | | { |
| | | "args": { |
| | | }, |
| | | "script": "parent.layer.close(window.parent.TStudent.layerIndex);", |
| | | "actionType": "custom" |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | ], |
| | | "id": "u:b97e4e9b9f48", |
| | | "actions": [ |
| | | ] |
| | | }; |
| | | |
| | | let amisScoped = amis.embed('#root', amisJSON); |
| | | |
| | | |
| | | })(); |
| | | |
| | | |
| | | </script> |
| | | |
| | | </body> |
| | | </html> |
| | |
| | | </div> |
| | | |
| | | <div class="col-sm-3"> |
| | | <div class="input-group"> |
| | | <div class="input-group-btn open"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="true"> |
| | | 支付方式 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="payMethod"> |
| | | <option value="">全部</option> |
| | | <option value=1>微信</option> |
| | | <option value=2>支付宝</option> |
| | | <option value=3>玩湃币</option> |
| | | <option value=4>手动支付</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="col-sm-3"> |
| | | <div class="input-group"> |
| | | <div class="input-group-btn open"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="true"> |
| | | 支付方式 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="state"> |
| | | <option value="">全部</option> |
| | | |
| | | <option value="0">待支付</option> |
| | | <option value="1">待核销</option> |
| | | <option value="2">已到店</option> |
| | | <option value="3">已完成</option> |
| | | <option value="4">已过期</option> |
| | | <option value="5">已取消</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TStudent.search()"/> |
| | | </div> |
| | | </div> |
| | |
| | | <#button name="添加" icon="fa-plus" clickFun="TStudent.openAddTStudent()"/> |
| | | |
| | | <#button name="修改" icon="fa-edit" clickFun="TStudent.openTStudentDetail()" space="true"/> |
| | | <#button name="查看详情" icon="fa-edit" clickFun="TStudent.openTStudentDetail1()" space="true"/> |
| | | <#button name="确认到店" icon="fa-edit" clickFun="TStudent.openTStudentDetail1()" space="true"/> |
| | | <#button name="取消凭证" icon="fa-edit" clickFun="TStudent.openTStudentDetail4()" space="true"/> |
| | | |
| | | <#button name="查看详情" icon="fa-edit" clickFun="TStudent.openTStudentDetail5()" space="true"/> |
| | | |
| | | @if(shiro.hasPermission("/tStudent/delete")){ |
| | | <#button name="删除" icon="fa-remove" clickFun="TStudent.delete()" space="true"/> |
| | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*上课场地:</label> |
| | | <div class="col-sm-4"> |
| | | <select class="form-control" id="siteId" name="siteId" onchange="CoursePackageInfo.addTime(this.value)"> |
| | | <select class="form-control" id="siteId" name="siteId" > |
| | | <option >请选择场地</option> |
| | | |
| | | |
| | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">预约时间:</label> |
| | | <div class="col-sm-4"> |
| | | <input class="form-control" id="time" name="time" type="text" > |
| | | <input class="form-control" id="time" name="time" type="text" onchange="CoursePackageInfo.addTime()"> |
| | | |
| | | </div> |
| | | </div> |
| | |
| | | elem: '#time' |
| | | ,lang:"CN", |
| | | min:0, |
| | | max:10 |
| | | max:10, |
| | | format:'yyyy-MM-dd', |
| | | done:function (a) { |
| | | console.log("==========="+a) |
| | | var ajax = new $ax(Feng.ctxPath + "/ball/yuyuetimes/"+ $('#siteId').val(), function(data){ |
| | | console.log("================"+data) |
| | | if(data!=null){ |
| | | var content=''; |
| | | $.each(data, function(k, v) { |
| | | var buttonClass = "layui-btn layui-btn-primary"; |
| | | var style = ""; |
| | | if (v.state === 0) { |
| | | style = "background-color: red;"; |
| | | } |
| | | var disabledAttribute = v.state === 0 ? "disabled" : ""; |
| | | content += '<button type="button" class="' + buttonClass + '" ' + disabledAttribute + ' style="' + style + '" onclick="toggleColor(this)">' + v.time + '</button>'; |
| | | }); |
| | | $("#ttt2").empty().append(content); |
| | | } |
| | | }) |
| | | ajax.set("date",$('#time').val()); |
| | | ajax.start() |
| | | |
| | | var ajax1 = new $ax(Feng.ctxPath + "/ball/halfName/"+ $('#siteId').val(), function(data){ |
| | | console.log("================"+data) |
| | | if(data!=null){ |
| | | let htmlStr = ''; |
| | | for (let i = 0; i < data.length; i++) { |
| | | htmlStr += '<option value="' + data[i] + '">' + data[i] + '</option>' |
| | | } |
| | | $("#half").empty().append(htmlStr); |
| | | } |
| | | }) |
| | | ajax1.start() |
| | | |
| | | } |
| | | }); |
| | | |
| | | laydate.render({ |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <style> |
| | | .green-button { |
| | | background-color: green; |
| | | } |
| | | </style> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <input type="hidden" id="id" value="${item.id}"> |
| | | <div class="form-horizontal"> |
| | | <div class="row"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*所在省:</label> |
| | | <div class="col-sm-4"> |
| | | <select class="form-control" id="provinceCode" name="provinceCode"> |
| | | @for(obj in province){ |
| | | <option value="${obj.code}" ${obj.code == item.provinceCode ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*所在市:</label> |
| | | <div class="col-sm-4"> |
| | | <select class="form-control" id="cityCode" name="cityCode"> |
| | | @for(obj in city){ |
| | | <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-4"> |
| | | <select class="form-control" id="storeId" name="storeId"> |
| | | @for(obj in store){ |
| | | <option value="${obj.id}" ${obj.id == item.storeId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*预约类型:</label> |
| | | <div class="col-sm-4"> |
| | | <input type="radio" name="type" value="1" checked="" onclick="updateType(1)" > 全场 |
| | | <input type="radio" name="type" value="2" onclick="updateType(2)" > 半场 |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*上课场地:</label> |
| | | <input type="hidden" id="selSiteId" value="${item.siteId}"> |
| | | |
| | | <div class="col-sm-4"> |
| | | <select class="form-control" id="siteId" name="siteId" onchange="CoursePackageInfo.addTime1()" > |
| | | <option >请选择场地</option> |
| | | |
| | | @for(obj in site){ |
| | | <option value="${obj.id}" data-custom-data="1" ${obj.id == item.siteId ? 'selected=selected' : ''} >${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="form-group" id="half1" hidden="hidden"> |
| | | <label class="col-sm-3 control-label">*选择半场:</label> |
| | | <div class="col-sm-4"> |
| | | <select class="form-control" name="half" id="half"> |
| | | |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <input type="hidden" id="selDate" value="${date}"> |
| | | <label class="col-sm-3 control-label">预约时间:</label> |
| | | <div class="col-sm-4"> |
| | | <input class="form-control" id="time" name="time" type="text" value="${date}"> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*预约时间段:</label> |
| | | <div class="col-sm-5" id="ttt1"> |
| | | <div class="layui-btn-group" id="ttt2"> |
| | | |
| | | |
| | | </div> |
| | | |
| | | <div class="layui-btn-group" id="ttt3"> |
| | | |
| | | @for(obj in timeRanges){ |
| | | <button name="has" type="button" ${obj.state == 0 ? "class = 'layui-btn layui-btn-primary' disabled style='background-color: red'" : obj.state == 1 ? "class = 'layui-btn layui-btn-primary green-button'" : "class = 'layui-btn layui-btn-primary'"} onclick="toggleColor(this)">${obj.time}</button> |
| | | <!-- <button type="button" ${obj.state == 0 ? "class = 'layui-btn layui-btn-primary' disabled style='background-color: red'" : "class = 'layui-btn layui-btn-primary' "} onclick="toggleColor(this)">${obj.time}</button>--> |
| | | <!-- <button type="button" ${obj.state == 0 ? "class = 'layui-btn layui-btn-primary green-button'" : "class = 'layui-btn layui-btn-primary'"} onclick="toggleColor(this)">${obj.time}</button>--> |
| | | @} |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">现金价格:</label> |
| | | <div class="col-sm-4"> |
| | | <input class="form-control" id="cash" name="cash" type="text" value="${money[0]!}" > |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">玩派币价格:</label> |
| | | <div class="col-sm-4"> |
| | | <input class="form-control" id="play" name="play" type="text" value="${money[1]!}" > |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">预约人:</label> |
| | | <div class="col-sm-4"> |
| | | <input class="form-control" id="booker" name="booker" type="text" value="${item.booker}" > |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">联系电话:</label> |
| | | <div class="col-sm-4"> |
| | | <input class="form-control" id="phone" name="phone" type="text" value="${item.phone}" > |
| | | |
| | | </div> |
| | | </div> |
| | | <!-- <input type="text" id = "counpons">--> |
| | | </div> |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="CoursePackageInfo.addSubmit1()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="CoursePackageInfo.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/ball/yuyue_info.js"></script> |
| | | <script type="text/javascript"> |
| | | function updateType(o) { |
| | | if(o==1){ |
| | | |
| | | var elements = document.getElementsByClassName("layui-btn layui-btn-primary green-button"); |
| | | var count = elements.length; |
| | | |
| | | console.log("Number of elements: " + count); |
| | | |
| | | $("#half1").hide() |
| | | var radios = document.getElementsByName("type"); |
| | | var selectedValue; |
| | | |
| | | for (var i = 0; i < radios.length; i++) { |
| | | if (radios[i].checked) { |
| | | selectedValue = radios[i].value; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | var ajax3 = new $ax(Feng.ctxPath + "/ball/getMoney/"+$('#siteId').val()+'/'+selectedValue, function(data){ |
| | | console.log("===========3333====="+data) |
| | | if(data!=null){ |
| | | |
| | | $("#cash").val(data[0] * count); |
| | | $("#play").val(data[1] * count); |
| | | |
| | | } |
| | | }) |
| | | ajax3.start() |
| | | }else { |
| | | var elements = document.getElementsByClassName("layui-btn layui-btn-primary green-button"); |
| | | var count = elements.length; |
| | | |
| | | console.log("Number of elements: " + count); |
| | | |
| | | $("#half1").show() |
| | | var radios = document.getElementsByName("type"); |
| | | var selectedValue; |
| | | |
| | | for (var i = 0; i < radios.length; i++) { |
| | | if (radios[i].checked) { |
| | | selectedValue = radios[i].value; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | var ajax3 = new $ax(Feng.ctxPath + "/ball/getMoney/"+$('#siteId').val()+'/'+selectedValue, function(data){ |
| | | console.log("===========3333====="+data) |
| | | if(data!=null){ |
| | | |
| | | $("#cash").val(data[0] * count); |
| | | $("#play").val(data[1] * count); |
| | | |
| | | } |
| | | }) |
| | | ajax3.start() |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | function toggleColor(button) { |
| | | button.classList.toggle("green-button"); |
| | | |
| | | var elements = document.getElementsByClassName("layui-btn layui-btn-primary green-button"); |
| | | var count = elements.length; |
| | | |
| | | console.log("Number of elements: " + count); |
| | | |
| | | |
| | | var radios = document.getElementsByName("type"); |
| | | var selectedValue; |
| | | |
| | | for (var i = 0; i < radios.length; i++) { |
| | | if (radios[i].checked) { |
| | | selectedValue = radios[i].value; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | var ajax3 = new $ax(Feng.ctxPath + "/ball/getMoney/"+$('#siteId').val()+'/'+selectedValue, function(data){ |
| | | console.log("===========3333====="+data) |
| | | if(data!=null){ |
| | | |
| | | $("#cash").val(data[0] * count); |
| | | $("#play").val(data[1] * count); |
| | | |
| | | } |
| | | }) |
| | | ajax3.start() |
| | | |
| | | |
| | | } |
| | | |
| | | laydate.render({ |
| | | elem: '#time' |
| | | ,lang:"CN", |
| | | min:0, |
| | | max:10, |
| | | format:'yyyy-MM-dd', |
| | | done:function (a) { |
| | | console.log("==============="+$('#time').val()) |
| | | console.log("==============="+$('#selDate').val()) |
| | | console.log("==============="+$('#siteId').val()) |
| | | console.log("==============="+$('#selSiteId').val()) |
| | | |
| | | if ($('#siteId').val() != $('#selSiteId').val()||$('#time').val()!=$('#selDate').val()){ |
| | | $("#ttt3").hide() |
| | | $("#ttt2").show() |
| | | |
| | | }else { |
| | | $("#ttt3").show() |
| | | $("#ttt2").hide() |
| | | |
| | | } |
| | | |
| | | console.log("==========="+a) |
| | | var ajax = new $ax(Feng.ctxPath + "/ball/yuyuetimes/"+ $('#siteId').val(), function(data){ |
| | | console.log("================"+data) |
| | | if(data!=null){ |
| | | var content=''; |
| | | $.each(data, function(k, v) { |
| | | var buttonClass = "layui-btn layui-btn-primary"; |
| | | var style = ""; |
| | | if (v.state === 0) { |
| | | style = "background-color: red;"; |
| | | } |
| | | var disabledAttribute = v.state === 0 ? "disabled" : ""; |
| | | content += '<button type="button" class="' + buttonClass + '" ' + disabledAttribute + ' style="' + style + '" onclick="toggleColor(this)">' + v.time + '</button>'; |
| | | }); |
| | | $("#ttt2").empty().append(content); |
| | | } |
| | | }) |
| | | ajax.start() |
| | | |
| | | var ajax1 = new $ax(Feng.ctxPath + "/ball/halfName/"+ $('#siteId').val(), function(data){ |
| | | console.log("================"+data) |
| | | if(data!=null){ |
| | | let htmlStr = ''; |
| | | for (let i = 0; i < data.length; i++) { |
| | | htmlStr += '<option value="' + data[i] + '">' + data[i] + '</option>' |
| | | } |
| | | $("#half").empty().append(htmlStr); |
| | | } |
| | | }) |
| | | ajax1.start() |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | }); |
| | | |
| | | laydate.render({ |
| | | elem: '#holitime' |
| | | ,range: true //或 range: '~' 来自定义分割字符 |
| | | }); |
| | | |
| | | var avatarUp = new $WebUpload("coverDrawing"); |
| | | avatarUp.setUploadBarId("progressBar"); |
| | | avatarUp.init(); |
| | | |
| | | var avatarUp1 = new $WebUpload("detailDrawing"); |
| | | avatarUp1.setUploadBarId("progressBar"); |
| | | avatarUp1.init(); |
| | | |
| | | var avatarUp1 = new $WebUpload("introduceDrawing"); |
| | | avatarUp1.setUploadBarId("progressBar"); |
| | | avatarUp1.init(); |
| | | function addTime(){ |
| | | var i = $('#dayTime > div').length |
| | | |
| | | let htmlStr =' <div style="display:flex">\n' + |
| | | ' <input class="form-control" id="classStartTime'+i+'" name="classStartTime" placeholder="请选择" style="width: 200px;">\n' + |
| | | ' <i class="fa fa-trash-o" style="font-size:24px" onclick="removePrice1(this)"></i>\n' + |
| | | ' </div>' |
| | | $('#dayTime').append(htmlStr); |
| | | console.log("========="+i) |
| | | laydate.render({ |
| | | elem: '#classStartTime'+i, |
| | | type: 'time', |
| | | range: true |
| | | }); |
| | | } |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <style> |
| | | .green-button { |
| | | background-color: green; |
| | | } |
| | | </style> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <input type="hidden" id="id" value="${item.id}"> |
| | | <div class="form-horizontal"> |
| | | <div class="row"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*所在省:</label> |
| | | <div class="col-sm-4"> |
| | | <select class="form-control" id="provinceCode" name="provinceCode" disabled> |
| | | @for(obj in province){ |
| | | <option value="${obj.code}" ${obj.code == item.provinceCode ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*所在市:</label> |
| | | <div class="col-sm-4"> |
| | | <select class="form-control" id="cityCode" name="cityCode" disabled> |
| | | @for(obj in city){ |
| | | <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-4"> |
| | | <select class="form-control" id="storeId" name="storeId" disabled> |
| | | @for(obj in store){ |
| | | <option value="${obj.id}" ${obj.id == item.storeId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*预约类型:</label> |
| | | <div class="col-sm-4"> |
| | | <input type="radio" name="type" value="1" checked="" onclick="updateType(1)" disabled> 全场 |
| | | <input type="radio" name="type" value="2" onclick="updateType(2)" disabled> 半场 |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*上课场地:</label> |
| | | <input type="hidden" id="selSiteId" value="${item.siteId}"> |
| | | |
| | | <div class="col-sm-4"> |
| | | <select class="form-control" id="siteId" name="siteId" onchange="CoursePackageInfo.addTime1()" disabled > |
| | | <option >请选择场地</option> |
| | | |
| | | @for(obj in site){ |
| | | <option value="${obj.id}" data-custom-data="1" ${obj.id == item.siteId ? 'selected=selected' : ''} >${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="form-group" id="half1" hidden="hidden"> |
| | | <label class="col-sm-3 control-label">*选择半场:</label> |
| | | <div class="col-sm-4"> |
| | | <select class="form-control" name="half" id="half" disabled> |
| | | |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <input type="hidden" id="selDate" value="${date}"> |
| | | <label class="col-sm-3 control-label">预约时间:</label> |
| | | <div class="col-sm-4"> |
| | | <input class="form-control" id="time" name="time" type="text" value="${date}" disabled> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*预约时间段:</label> |
| | | <div class="col-sm-5" id="ttt1" disabled=""> |
| | | <div class="layui-btn-group" id="ttt2"> |
| | | |
| | | |
| | | </div> |
| | | |
| | | <div class="layui-btn-group" id="ttt3"> |
| | | |
| | | @for(obj in timeRanges){ |
| | | <button disabled name="has" type="button" ${obj.state == 0 ? "class = 'layui-btn layui-btn-primary' disabled style='background-color: red'" : obj.state == 1 ? "class = 'layui-btn layui-btn-primary green-button'" : "class = 'layui-btn layui-btn-primary'"} onclick="toggleColor(this)">${obj.time}</button> |
| | | <!-- <button type="button" ${obj.state == 0 ? "class = 'layui-btn layui-btn-primary' disabled style='background-color: red'" : "class = 'layui-btn layui-btn-primary' "} onclick="toggleColor(this)">${obj.time}</button>--> |
| | | <!-- <button type="button" ${obj.state == 0 ? "class = 'layui-btn layui-btn-primary green-button'" : "class = 'layui-btn layui-btn-primary'"} onclick="toggleColor(this)">${obj.time}</button>--> |
| | | @} |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">现金价格:</label> |
| | | <div class="col-sm-4"> |
| | | <input class="form-control" id="cash" name="cash" type="text" value="${money[0]!}" disabled > |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">玩派币价格:</label> |
| | | <div class="col-sm-4"> |
| | | <input class="form-control" id="play" name="play" type="text" value="${money[1]!}" disabled > |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">预约人:</label> |
| | | <div class="col-sm-4"> |
| | | <input class="form-control" id="booker" name="booker" type="text" value="${item.booker}" disabled > |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">联系电话:</label> |
| | | <div class="col-sm-4"> |
| | | <input class="form-control" id="phone" name="phone" type="text" value="${item.phone}" disabled > |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">操作人:</label> |
| | | <div class="col-sm-4"> |
| | | <input class="form-control" id="cancelUserId" name="cancelUserId" type="text" value="${cancelUser!}" disabled > |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" disabled> |
| | | <label class="col-sm-3 control-label head-scu-label">*上传凭证:</label> |
| | | <div class="col-sm-2"> |
| | | <div id="introduceDrawingPreId"> |
| | | <div><img width="100px" height="100px" src="${item.voucher}"></div> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">备注:</label> |
| | | <div class="col-sm-4"> |
| | | <textarea class="form-control" id="remark" name="remark" disabled>${item.remark}</textarea > |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | <!-- <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="CoursePackageInfo.addSubmit1()"/>--> |
| | | <#button btnCss="danger" name="关闭" id="cancel" icon="fa-eraser" clickFun="CoursePackageInfo.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/ball/yuyue_info.js"></script> |
| | | <script type="text/javascript"> |
| | | function updateType(o) { |
| | | if(o==1){ |
| | | |
| | | var elements = document.getElementsByClassName("layui-btn layui-btn-primary green-button"); |
| | | var count = elements.length; |
| | | |
| | | console.log("Number of elements: " + count); |
| | | |
| | | $("#half1").hide() |
| | | var radios = document.getElementsByName("type"); |
| | | var selectedValue; |
| | | |
| | | for (var i = 0; i < radios.length; i++) { |
| | | if (radios[i].checked) { |
| | | selectedValue = radios[i].value; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | var ajax3 = new $ax(Feng.ctxPath + "/ball/getMoney/"+$('#siteId').val()+'/'+selectedValue, function(data){ |
| | | console.log("===========3333====="+data) |
| | | if(data!=null){ |
| | | |
| | | $("#cash").val(data[0] * count); |
| | | $("#play").val(data[1] * count); |
| | | |
| | | } |
| | | }) |
| | | ajax3.start() |
| | | }else { |
| | | var elements = document.getElementsByClassName("layui-btn layui-btn-primary green-button"); |
| | | var count = elements.length; |
| | | |
| | | console.log("Number of elements: " + count); |
| | | |
| | | $("#half1").show() |
| | | var radios = document.getElementsByName("type"); |
| | | var selectedValue; |
| | | |
| | | for (var i = 0; i < radios.length; i++) { |
| | | if (radios[i].checked) { |
| | | selectedValue = radios[i].value; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | var ajax3 = new $ax(Feng.ctxPath + "/ball/getMoney/"+$('#siteId').val()+'/'+selectedValue, function(data){ |
| | | console.log("===========3333====="+data) |
| | | if(data!=null){ |
| | | |
| | | $("#cash").val(data[0] * count); |
| | | $("#play").val(data[1] * count); |
| | | |
| | | } |
| | | }) |
| | | ajax3.start() |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | function toggleColor(button) { |
| | | button.classList.toggle("green-button"); |
| | | |
| | | var elements = document.getElementsByClassName("layui-btn layui-btn-primary green-button"); |
| | | var count = elements.length; |
| | | |
| | | console.log("Number of elements: " + count); |
| | | |
| | | |
| | | var radios = document.getElementsByName("type"); |
| | | var selectedValue; |
| | | |
| | | for (var i = 0; i < radios.length; i++) { |
| | | if (radios[i].checked) { |
| | | selectedValue = radios[i].value; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | var ajax3 = new $ax(Feng.ctxPath + "/ball/getMoney/"+$('#siteId').val()+'/'+selectedValue, function(data){ |
| | | console.log("===========3333====="+data) |
| | | if(data!=null){ |
| | | |
| | | $("#cash").val(data[0] * count); |
| | | $("#play").val(data[1] * count); |
| | | |
| | | } |
| | | }) |
| | | ajax3.start() |
| | | |
| | | |
| | | } |
| | | |
| | | laydate.render({ |
| | | elem: '#time' |
| | | ,lang:"CN", |
| | | min:0, |
| | | max:10, |
| | | format:'yyyy-MM-dd', |
| | | done:function (a) { |
| | | console.log("==============="+$('#time').val()) |
| | | console.log("==============="+$('#selDate').val()) |
| | | console.log("==============="+$('#siteId').val()) |
| | | console.log("==============="+$('#selSiteId').val()) |
| | | |
| | | if ($('#siteId').val() != $('#selSiteId').val()||$('#time').val()!=$('#selDate').val()){ |
| | | $("#ttt3").hide() |
| | | $("#ttt2").show() |
| | | |
| | | }else { |
| | | $("#ttt3").show() |
| | | $("#ttt2").hide() |
| | | |
| | | } |
| | | |
| | | console.log("==========="+a) |
| | | var ajax = new $ax(Feng.ctxPath + "/ball/yuyuetimes/"+ $('#siteId').val(), function(data){ |
| | | console.log("================"+data) |
| | | if(data!=null){ |
| | | var content=''; |
| | | $.each(data, function(k, v) { |
| | | var buttonClass = "layui-btn layui-btn-primary"; |
| | | var style = ""; |
| | | if (v.state === 0) { |
| | | style = "background-color: red;"; |
| | | } |
| | | var disabledAttribute = v.state === 0 ? "disabled" : ""; |
| | | content += '<button type="button" class="' + buttonClass + '" ' + disabledAttribute + ' style="' + style + '" onclick="toggleColor(this)">' + v.time + '</button>'; |
| | | }); |
| | | $("#ttt2").empty().append(content); |
| | | } |
| | | }) |
| | | ajax.start() |
| | | |
| | | var ajax1 = new $ax(Feng.ctxPath + "/ball/halfName/"+ $('#siteId').val(), function(data){ |
| | | console.log("================"+data) |
| | | if(data!=null){ |
| | | let htmlStr = ''; |
| | | for (let i = 0; i < data.length; i++) { |
| | | htmlStr += '<option value="' + data[i] + '">' + data[i] + '</option>' |
| | | } |
| | | $("#half").empty().append(htmlStr); |
| | | } |
| | | }) |
| | | ajax1.start() |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | }); |
| | | |
| | | laydate.render({ |
| | | elem: '#holitime' |
| | | ,range: true //或 range: '~' 来自定义分割字符 |
| | | }); |
| | | |
| | | var avatarUp = new $WebUpload("coverDrawing"); |
| | | avatarUp.setUploadBarId("progressBar"); |
| | | avatarUp.init(); |
| | | |
| | | var avatarUp1 = new $WebUpload("detailDrawing"); |
| | | avatarUp1.setUploadBarId("progressBar"); |
| | | avatarUp1.init(); |
| | | |
| | | var avatarUp1 = new $WebUpload("introduceDrawing"); |
| | | avatarUp1.setUploadBarId("progressBar"); |
| | | avatarUp1.init(); |
| | | function addTime(){ |
| | | var i = $('#dayTime > div').length |
| | | |
| | | let htmlStr =' <div style="display:flex">\n' + |
| | | ' <input class="form-control" id="classStartTime'+i+'" name="classStartTime" placeholder="请选择" style="width: 200px;">\n' + |
| | | ' <i class="fa fa-trash-o" style="font-size:24px" onclick="removePrice1(this)"></i>\n' + |
| | | ' </div>' |
| | | $('#dayTime').append(htmlStr); |
| | | console.log("========="+i) |
| | | laydate.render({ |
| | | elem: '#classStartTime'+i, |
| | | type: 'time', |
| | | range: true |
| | | }); |
| | | } |
| | | </script> |
| | | @} |
| | |
| | | <span class="classNumber_span" ${type == 2||type == 3 ? 'hidden=hidden' : ''}><input class="classNumber" type="number" min="0" placeholder="请输入" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"> </span> |
| | | <span class="cash_span" ></span> |
| | | <span class="paiCoin_span"></span> |
| | | <#button btnCss="info" name="优惠卷" id="ensure" icon="fa-check" clickFun="CoursePackageInfo.openDia(1)"/> |
| | | <#button btnCss="info" name="优惠券" id="ensure" icon="fa-check" clickFun="CoursePackageInfo.openDia(1)"/> |
| | | <i class="fa fa-plus-circle" style="font-size:24px" onclick="addPrice(${type})"></i> |
| | | <input type="text" id = "counpons1" class="counpons" hidden="hidden" > |
| | | </div> |
| | |
| | | @} |
| | | </span> |
| | | <input type="hidden" id="counpons1" value="${couponIds}" class="counpons"> |
| | | <#button btnCss="info" name="优惠卷" id="ensure" icon="fa-check" clickFun="CoursePackageInfo.openDia(1)"/> |
| | | <#button btnCss="info" name="优惠券" id="ensure" icon="fa-check" clickFun="CoursePackageInfo.openDia(1)"/> |
| | | <i class="fa fa-plus-circle" style="font-size:24px" onclick="addPrice(${type})"></i> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal"> |
| | | |
| | | <div class="row"> |
| | | <br class="col-sm-10"> |
| | | @if(objectType==1){ |
| | |
| | | <div class="input-group"> |
| | | <div class="input-group-btn open"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="true"> |
| | | 选择城市 |
| | | 选择运营商 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="cCode" onchange="TSite.oneChangeNext(1)"> |
| | | <select class="form-control" id="cCode" > |
| | | <option value="">请选择</option> |
| | | @for(obj in list){ |
| | | <option value="${obj.cityCode}">${obj.city}</option> |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | @} |
| | | @if(objectType==1){ |
| | | <div class="col-sm-3"> |
| | | <div class="input-group"> |
| | | <div class="input-group-btn open"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="true"> |
| | | 选择账号 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="account" > |
| | | <option value="">请选择账号</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <#button name="搜索" icon="fa-search" clickFun="TCompetition.search()"/> |
| | | <#button name="搜索" icon="fa-search" clickFun="search()"/> |
| | | @} |
| | | </br> |
| | | </br> |
| | |
| | | </br> |
| | | <div class="col-sm-3" style="width: 400px;display: flex"> |
| | | <#TimeCon id="beginTime" name="时间段:" isTime="false"/> |
| | | <#button name="搜索" icon="fa-search" clickFun="TCompetition.search()"/> |
| | | <#button name="搜索" icon="fa-search" clickFun="search()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="col-sm-10" style="width: 1500px" > |
| | | </br> |
| | | </br> |
| | | <span>会员费收入:</span> |
| | | <span>玩湃币充值收入:</span> |
| | | <span>课程收入:</span> |
| | | <span>活动收入:</span> |
| | | <span>订场收入:</span> |
| | | <span>赛事收入:</span> |
| | | <span>商品收入:</span> |
| | | <span>其他收入:</span> |
| | | <span>会员费收入:<label id="fee1">0.0</label></span> |
| | | <span>玩湃币充值收入:<label id="fee2">0.0</label></span> |
| | | <span>课程收入:<label id="fee3">0.0</label></span> |
| | | <span>活动/赛事收入:<label id="fee4">0.0</label></span> |
| | | <span>订场收入:<label id="fee5">0.0</label></span> |
| | | <span>商品收入:<label id="fee7">0.0</label></span> |
| | | </br> |
| | | </br> |
| | | </br> |
| | |
| | | <div class="col-sm-10" style="width: 1500px" > |
| | | </br> |
| | | </br> |
| | | <span>本年退费额度:</span> |
| | | <span>本月退费额度:</span> |
| | | <span>本周退费额度:</span> |
| | | <span>本日退费额度:</span> |
| | | <span id="yearRefund">本年退费额度:<span id="back1"></span></span> |
| | | <span id="monthRefund">本月退费额度:<span id="back2"></span></span> |
| | | <span id="weekRefund">本周退费额度:<span id="back3"></span></span> |
| | | <span id="todayRefund">本日退费额度:<span id="back4"></span></span> |
| | | </br> |
| | | </br> |
| | | <div id="refund" style="width: 1280px;height:500px;"></div> |
| | |
| | | <script src="${ctxPath}/modular/system/dataStatistics/tSite.js"></script> |
| | | <script src="${ctxPath}/static/js/plugins/switchery/switchery.js"></script> |
| | | <script> |
| | | |
| | | |
| | | function oneChangeNext(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(); |
| | | } |
| | | |
| | | |
| | | |
| | | function search(){ |
| | | |
| | | if(cutType==1){ |
| | | srtj() |
| | | tuifei() |
| | | } |
| | | |
| | | if(cutType==2){ |
| | | yytj() |
| | | } |
| | | if(cutType==3){ |
| | | jxtj() |
| | | } |
| | | } |
| | | |
| | | |
| | | let cutType=1; |
| | | |
| | | |
| | | laydate.render({ |
| | | elem: '#beginTime' |
| | | , trigger: 'click' |
| | |
| | | getContent(1); |
| | | getContent1(1); |
| | | getContent2(1); |
| | | |
| | | // 基于准备好的dom,初始化echarts实例 |
| | | var myChart = echarts.init(document.getElementById('income')); |
| | | var myChart1 = echarts.init(document.getElementById('refund')); |
| | | |
| | | var myChart2 = echarts.init(document.getElementById('user')); |
| | | var myChart3 = echarts.init(document.getElementById('vip')); |
| | | var myChart4 = echarts.init(document.getElementById('activity')); |
| | | var myChart5 = echarts.init(document.getElementById('prepare')); |
| | | var myChart6 = echarts.init(document.getElementById('teach')); |
| | | var myChart7 = echarts.init(document.getElementById('courseData')); |
| | | tuifei() |
| | | option = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | |
| | | }, |
| | | { |
| | | name: '日度营收', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [320, 332, 301, 334, 390, 330, 320, 10, 195, 145, 188, 160] |
| | | } |
| | | ] |
| | | }; |
| | | option1 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | legend: { |
| | | data: ['年度退费', '月度退费', '周度退费', '日度退费'] |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | toolbox: { |
| | | feature: { |
| | | saveAsImage: {} |
| | | } |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'] |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '年度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [120, 132, 101, 134, 90, 230, 160, 190, 410, 330, 210, 330] |
| | | }, |
| | | { |
| | | name: '月度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [220, 182, 191, 234, 290, 330, 310, 190, 210, 330, 410, 160] |
| | | }, |
| | | { |
| | | name: '周度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [150, 232, 201, 154, 190, 330, 410, 160, 210, 195, 210, 188] |
| | | }, |
| | | { |
| | | name: '日度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [320, 332, 301, 334, 390, 330, 320, 10, 195, 145, 188, 160] |
| | |
| | | }; |
| | | // 使用刚指定的配置项和数据显示图表。 |
| | | myChart.setOption(option); |
| | | myChart1.setOption(option1); |
| | | myChart2.setOption(option2); |
| | | myChart3.setOption(option3); |
| | | myChart4.setOption(option4); |
| | |
| | | myChart7.setOption(option7); |
| | | }); |
| | | function getContent(type){ |
| | | cutType=type |
| | | //设置点击字体颜色效果 |
| | | for(var i=1;i<4;i++){ |
| | | document.getElementById("div"+i).style.color="#888888";// |
| | |
| | | $("#ensure").show(); |
| | | $("#nextB").hide(); |
| | | } |
| | | |
| | | |
| | | if(type==1){ |
| | | srtj() |
| | | tuifei() |
| | | } |
| | | |
| | | |
| | | |
| | | if(type==2){ |
| | | yytj() |
| | | } |
| | | |
| | | if(type==3){ |
| | | jxtj() |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | function srtj() { |
| | | var id = $("#cCode").val() |
| | | var beginTime = $("#beginTime").val() |
| | | console.log(id) |
| | | if(id==""){ |
| | | Feng.info("请先选择运营商"); |
| | | return; |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/data/selectYys", function (data) { |
| | | |
| | | $("#fee1").text(data.fee1) |
| | | $("#fee2").text(data.fee2) |
| | | $("#fee3").text(data.fee3) |
| | | $("#fee4").text(data.fee4) |
| | | $("#fee5").text(data.fee5) |
| | | $("#fee7").text(data.fee7) |
| | | $("#day").val(data.dayone) |
| | | $("#month").val(data.monthone) |
| | | $("#quarter").val(data.quarterone) |
| | | $("#year").val(data.yearone) |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | var chartDom = document.getElementById('cookieTicket'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | option = { |
| | | title: { |
| | | text: '门票收入', |
| | | subtext: '', |
| | | left: 'center' |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | |
| | | series: [ |
| | | { |
| | | name: 'Access From', |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| | | { value: data.dayone, name: '日卡' }, |
| | | { value: data.monthone, name: '月卡' }, |
| | | { value: data.quarterone, name: '季卡' }, |
| | | { value: data.yearone, name: '年卡' }, |
| | | |
| | | ], |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | |
| | | var chartDom = document.getElementById('cookieCourse'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | option = { |
| | | title: { |
| | | text: '课程收入', |
| | | subtext: '', |
| | | left: 'center' |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | |
| | | series: [ |
| | | { |
| | | name: 'Access From', |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: data.courseData, |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | |
| | | |
| | | var chartDom = document.getElementById('cookieBooking'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | option = { |
| | | title: { |
| | | text: '订场收入', |
| | | subtext: '', |
| | | left: 'center' |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | |
| | | series: [ |
| | | { |
| | | name: 'Access From', |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: data.siteData, |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | }, function (data) { |
| | | |
| | | }); |
| | | ajax.set("id",id); |
| | | ajax.set("time",beginTime); |
| | | ajax.start(); |
| | | |
| | | } |
| | | |
| | | function jxtj() { |
| | | var id = $("#cCode").val() |
| | | console.log(id,333) |
| | | if(id==""){ |
| | | Feng.info("请先选择运营商"); |
| | | return; |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/data/selectYysJx", function (data) { |
| | | console.log(data) |
| | | |
| | | var chartDom = document.getElementById('cookieTeachAge'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | option = { |
| | | title: { |
| | | text: '年龄分布', |
| | | subtext: '', |
| | | left: 'center' |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | |
| | | series: [ |
| | | { |
| | | name: 'Access From', |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| | | { value: data.age1, name: '0-7岁' }, |
| | | { value: data.age2, name: '8-10岁' }, |
| | | { value:data.age3, name: '11-12岁' }, |
| | | { value: data.age4, name: '13岁以上' }, |
| | | ], |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | |
| | | |
| | | |
| | | var chartDom = document.getElementById('cookieTeachGender'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | option = { |
| | | title: { |
| | | text: '性别分布', |
| | | subtext: '', |
| | | left: 'center' |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | |
| | | series: [ |
| | | { |
| | | name: 'Access From', |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| | | { value: data.boy, name: '男' }, |
| | | { value: data.girl, name: '女' }, |
| | | |
| | | ], |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | |
| | | |
| | | |
| | | var chartDom = document.getElementById('cookieTeachCourse'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | |
| | | option = { |
| | | xAxis: { |
| | | type: 'category', |
| | | data: data.data1 |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | data: data.data2, |
| | | type: 'bar' |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | }, function (data) { |
| | | |
| | | }); |
| | | ajax.set("id",id); |
| | | ajax.start(); |
| | | |
| | | } |
| | | |
| | | function yytj() { |
| | | let id = $("#cCode").val() |
| | | console.log(id) |
| | | if(id==''){ |
| | | Feng.info("请先选择运营商"); |
| | | return; |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/data/stuUserDataYys", function (data) { |
| | | console.log(data,323232) |
| | | var chartDom = document.getElementById('cookieAge'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | option = { |
| | | title: { |
| | | text: '年龄分布', |
| | | subtext: '', |
| | | left: 'center' |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | |
| | | series: [ |
| | | { |
| | | name: 'Access From', |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| | | { value: data.age1, name: '0-12岁' }, |
| | | { value: data.age2, name: '13-18岁' }, |
| | | { value: data.age3, name: '19-25岁' }, |
| | | { value: data.age4, name: '12-35岁' }, |
| | | { value: data.age5, name: '36-50岁' }, |
| | | { value: data.age6, name: '51岁以上' }, |
| | | |
| | | ], |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | |
| | | |
| | | |
| | | var chartDom = document.getElementById('cookieGender'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | option = { |
| | | title: { |
| | | text: '性别分布', |
| | | subtext: '', |
| | | left: 'center' |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | |
| | | series: [ |
| | | { |
| | | name: 'Access From', |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| | | { value: data.boy, name: '男' }, |
| | | { value: data.girl, name: '女' }, |
| | | |
| | | ], |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | |
| | | |
| | | |
| | | |
| | | var chartDom = document.getElementById('city'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | |
| | | option = { |
| | | xAxis: { |
| | | type: 'category', |
| | | data: data.cityData |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | data: data.cityNum, |
| | | type: 'bar' |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | |
| | | |
| | | |
| | | }, function (data) { |
| | | |
| | | }); |
| | | ajax.set("id",id); |
| | | ajax.start(); |
| | | } |
| | | |
| | | |
| | | |
| | | function tuifei() { |
| | | var myChart1 = echarts.init(document.getElementById('refund')); |
| | | let id = $("#cCode").val() |
| | | console.log(id) |
| | | if(id==''){ |
| | | Feng.info("请先选择运营商"); |
| | | return; |
| | | } |
| | | var ajax3 = new $ax(Feng.ctxPath + "/data/backYys", function(data){ |
| | | $("#back1").text(data.thisYear); |
| | | $("#back2").text(data.thisMonth); |
| | | $("#back3").text(data.thisWeek); |
| | | $("#back4").text(data.thisDay); |
| | | option1 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | legend: { |
| | | |
| | | data: ['年度退费', '月度退费','周度退费','日度退费'], |
| | | icon: 'stack', |
| | | selectedMode: 'single', // 单选 |
| | | selected: { |
| | | 年度会员数: true, |
| | | 月度会员数: false, |
| | | 周度会员数: false, |
| | | 日度会员数: false |
| | | } |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | toolbox: { |
| | | feature: { |
| | | saveAsImage: {} |
| | | } |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: yearX |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '年度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.yearData |
| | | }, |
| | | { |
| | | name: '月度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.monthData |
| | | }, |
| | | { |
| | | name: '周度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.weekData |
| | | }, |
| | | { |
| | | name: '日度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.dayData |
| | | } |
| | | ] |
| | | |
| | | }; |
| | | }); |
| | | ajax3.set("id",id) |
| | | ajax3.start(); |
| | | |
| | | myChart1.on('legendselectchanged', obj => { |
| | | var options = myChart1.getOption() |
| | | //这里是选择切换什么样的x轴,那么他会进行对Y值的切换 |
| | | if (obj.name == '年度退费') { |
| | | options.xAxis[0].data = yearX |
| | | } else if (obj.name == '月度退费') { |
| | | options.xAxis[0].data = monthX |
| | | } else if (obj.name == '周度退费') { |
| | | options.xAxis[0].data = ["1周","2周","3周","4周"] |
| | | } else if (obj.name == '日度退费') { |
| | | options.xAxis[0].data = dataX |
| | | } |
| | | myChart1.setOption(options, true) |
| | | }) |
| | | myChart1.setOption(option1); |
| | | } |
| | | |
| | | function getContent1(type){ |
| | | //设置点击字体颜色效果 |
| | | for(var i=1;i<3;i++){ |
| | |
| | | } |
| | | </script> |
| | | <script> |
| | | var ans = []; |
| | | var weekX = ["1周","2周","3周","4周"]; |
| | | var monthX = ["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]; |
| | | var yearX = []; |
| | | var timeX = []; |
| | | var dataX = []; |
| | | // 创建一个日期对象 |
| | | var currentDate = new Date(); |
| | | // 获取当前日期的号数 |
| | | let currentDay = currentDate.getDate(); |
| | | // 循环添加号数到数组 |
| | | for (let i = 0; i < 7; i++) { |
| | | dataX.push(currentDay - 6+i); |
| | | } |
| | | // 获取当前月份 |
| | | var currentMonth = currentDate.getMonth(); |
| | | // 获取当前年份 |
| | | var currentYear = currentDate.getFullYear(); |
| | | // 计算指定年份和月份的天数 |
| | | function getDaysInMonth(year, month) { |
| | | // month 参数范围是 0-11,所以需要加 1 |
| | | return new Date(year, month + 1, 0).getDate(); |
| | | } |
| | | // 获取当前月份的天数 |
| | | var daysInMonth = getDaysInMonth(currentYear, currentMonth); |
| | | // 将天数按字符串格式添加到 timeX 数组中 |
| | | for (var i = 1; i <= daysInMonth; i++) { |
| | | timeX.push(String(i)); |
| | | } |
| | | $(function(){ |
| | | var chartDom = document.getElementById('cookieTicket'); |
| | | var myChart = echarts.init(chartDom); |
| | |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| | | { value: 1048, name: '年票' }, |
| | | { value: 735, name: '亲子票' }, |
| | | { value: 1048, name: '日卡' }, |
| | | { value: 735, name: '月卡' }, |
| | | { value: 735, name: '季卡' }, |
| | | { value: 735, name: '年卡' }, |
| | | |
| | | ], |
| | | emphasis: { |
| | |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| | | { value: 1048, name: '30-35' }, |
| | | { value: 735, name: '12-18' }, |
| | | |
| | | ], |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | }); |
| | | $(function(){ |
| | | var chartDom = document.getElementById('cookieTeachAge'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | option = { |
| | | title: { |
| | | text: '年龄分布', |
| | | subtext: '', |
| | | left: 'center' |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | |
| | | series: [ |
| | | { |
| | | name: 'Access From', |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| | | { value: 1048, name: '30-35' }, |
| | | { value: 1048, name: '30-351' }, |
| | | { value: 735, name: '12-18' }, |
| | | |
| | | ], |
| | |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | }); |
| | | $(function(){ |
| | | var chartDom = document.getElementById('cookieTeachGender'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | option = { |
| | | title: { |
| | | text: '性别分布', |
| | | subtext: '', |
| | | left: 'center' |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | |
| | | series: [ |
| | | { |
| | | name: 'Access From', |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| | | { value: 1048, name: '男' }, |
| | | { value: 735, name: '女' }, |
| | | |
| | | ], |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | }); |
| | | $(function(){ |
| | | var chartDom = document.getElementById('city'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | |
| | | option = { |
| | | xAxis: { |
| | | type: 'category', |
| | | data: ['北京', '上海', '广东', '深圳', '成都', '曹县', '奥里给'] |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | data: [120, 200, 150, 80, 70, 110, 130], |
| | | type: 'bar' |
| | | } |
| | | ] |
| | | }; |
| | |
| | | <div class="col-sm-10" style="width: 1500px" > |
| | | </br> |
| | | </br> |
| | | <span id="yearRefund">本年退费额度:</span> |
| | | <span id="monthRefund">本月退费额度:</span> |
| | | <span id="weekRefund">本周退费额度:</span> |
| | | <span id="todayRefund">本日退费额度:</span> |
| | | <span id="yearRefund">本年退费额度:<span id="back1"></span></span> |
| | | <span id="monthRefund">本月退费额度:<span id="back2"></span></span> |
| | | <span id="weekRefund">本周退费额度:<span id="back3"></span></span> |
| | | <span id="todayRefund">本日退费额度:<span id="back4"></span></span> |
| | | </br> |
| | | </br> |
| | | <div id="refund" style="width: 1280px;height:500px;"></div> |
| | |
| | | </br> |
| | | </br> |
| | | <div style="height: 25px;box-sizing: border-box;background:#f3f3f4;line-height: 25px;border:1px solid;margin-bottom: 20px;width: 500px"> |
| | | <div id="d1" class='table2' onclick="getContent1(1)" style="border-right: 1px solid #333;background-color: rgb(26, 179, 148);color: white;">用户总数:0人</div> |
| | | <div id="d2" class='table2' onclick="getContent1(2)" style="border-right: 1px solid #333;">年费会员数量:0人</div> |
| | | <div id="d1" class='table2' onclick="getContent1(1)" style="border-right: 1px solid #333;background-color: rgb(26, 179, 148);color: white;">用户总数:<span id="userAll"></span>人</div> |
| | | <div id="d2" class='table2' onclick="getContent1(2)" style="border-right: 1px solid #333;">年费会员数量:<span id="userVipAll"></span>人</div> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-10"> |
| | |
| | | <script src="${ctxPath}/static/js/plugins/switchery/switchery.js"></script> |
| | | <script> |
| | | var ans = []; |
| | | var weekX = []; |
| | | var weekX = ["1","2","上周","本周"]; |
| | | var monthX = ["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]; |
| | | var yearX = ["2023年","2024年","2025年","2026年","2027年","2028年"]; |
| | | var yearX = []; |
| | | var timeX = []; |
| | | var dataX = []; |
| | | // 创建一个日期对象 |
| | |
| | | getContent2(1); |
| | | |
| | | var ajax = new $ax(Feng.ctxPath + "/data/getIncomeData", function(resp){ |
| | | yearX=resp.year |
| | | |
| | | |
| | | var list = resp.yearMount; |
| | | console.log(list); |
| | | var t1 = document.getElementById("totalIncome"); |
| | |
| | | }); |
| | | ajax.set("type",1); |
| | | ajax.start(); |
| | | option2 = { |
| | | |
| | | // 基于准备好的dom,初始化echarts实例 |
| | | var myChart = echarts.init(document.getElementById('main')); |
| | | var myChart1 = echarts.init(document.getElementById('refund')); |
| | | |
| | | |
| | | |
| | | var myChart6 = echarts.init(document.getElementById('teach')); |
| | | var myChart7 = echarts.init(document.getElementById('courseData')); |
| | | |
| | | |
| | | var ajax3 = new $ax(Feng.ctxPath + "/data/backPt", function(data){ |
| | | $("#back1").text(data.thisYear); |
| | | $("#back2").text(data.thisMonth); |
| | | $("#back3").text(data.thisWeek); |
| | | $("#back4").text(data.thisDay); |
| | | option1 = { |
| | | |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | legend: { |
| | | |
| | | data: ['年度用户数', '月度用户数','周度用户数','日度用户数'], |
| | | icon: 'stack', |
| | | selectedMode: 'single', // 单选 |
| | | selected: { |
| | | 年度用户数: true, |
| | | 月度用户数: false, |
| | | 周度用户数: false, |
| | | 日度用户数: false |
| | | } |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | toolbox: { |
| | | feature: { |
| | | saveAsImage: {} |
| | | } |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: yearX |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '年度用户数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [100,50,60,10,12,13,54,156] |
| | | }, |
| | | { |
| | | name: '月度用户数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [26,44,55,12,6,7,98,541,223] |
| | | }, |
| | | { |
| | | name: '周度用户数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [ |
| | | 33,22,11,12,61,17,23,33,41 |
| | | ] |
| | | }, |
| | | { |
| | | name: '日度用户数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [ |
| | | 12,11,17,26,23,111,23,45,41 |
| | | ] |
| | | } |
| | | ] |
| | | }; |
| | | var ajax2 = new $ax(Feng.ctxPath + "/data/getIncomeData", function(resp){ |
| | | option3 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | legend: { |
| | | |
| | | data: ['年度会员数', '月度会员数','周度会员数','日度会员数'], |
| | | data: ['年度退费', '月度退费','周度退费','日度退费'], |
| | | icon: 'stack', |
| | | selectedMode: 'single', // 单选 |
| | | selected: { |
| | |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '年度会员数', |
| | | name: '年度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [100,50,60,10,12,13,54,156] |
| | | data: data.yearData |
| | | }, |
| | | { |
| | | name: '月度会员数', |
| | | name: '月度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [26,44,55,12,6,7,98,541,223] |
| | | data: data.monthData |
| | | }, |
| | | { |
| | | name: '周度会员数', |
| | | name: '周度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [ |
| | | 33,22,11,12,61,17,23,33,41 |
| | | ] |
| | | data: data.weekData |
| | | }, |
| | | { |
| | | name: '日度会员数', |
| | | name: '日度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [ |
| | | 12,11,17,26,23,111,23,45,41 |
| | | ] |
| | | data: data.dayData |
| | | } |
| | | ] |
| | | |
| | | }; |
| | | }); |
| | | ajax2.set("type",1); |
| | | ajax2.start(); |
| | | // 基于准备好的dom,初始化echarts实例 |
| | | var myChart = echarts.init(document.getElementById('main')); |
| | | var myChart1 = echarts.init(document.getElementById('refund')); |
| | | var myChart2 = echarts.init(document.getElementById('user')); |
| | | var myChart3 = echarts.init(document.getElementById('vip')); |
| | | var myChart4 = echarts.init(document.getElementById('activity')); |
| | | var myChart5 = echarts.init(document.getElementById('prepare')); |
| | | var myChart6 = echarts.init(document.getElementById('teach')); |
| | | var myChart7 = echarts.init(document.getElementById('courseData')); |
| | | ajax3.start(); |
| | | |
| | | option1 = { |
| | | |
| | | |
| | | var ajax4 = new $ax(Feng.ctxPath + "/data/userAndVipPt", function(data){ |
| | | option1 = { |
| | | |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | legend: { |
| | | |
| | | data: ['年度退费', '月度退费','周度退费','日度退费'], |
| | | icon: 'stack', |
| | | selectedMode: 'single', // 单选 |
| | | selected: { |
| | | 年度会员数: true, |
| | | 月度会员数: false, |
| | | 周度会员数: false, |
| | | 日度会员数: false |
| | | } |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | toolbox: { |
| | | feature: { |
| | | saveAsImage: {} |
| | | } |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: yearX |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '年度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.yearData |
| | | }, |
| | | { |
| | | name: '月度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.monthData |
| | | }, |
| | | { |
| | | name: '周度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.weekData |
| | | }, |
| | | { |
| | | name: '日度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.dayData |
| | | } |
| | | ] |
| | | |
| | | }; |
| | | }); |
| | | ajax4.start(); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | option6 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | legend: { |
| | | data: ['年度退费', '月度退费', '周度退费', '日度退费'] |
| | | data: ['年度学员数', '月度学员数', '周度学员数', '日度学员数'] |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '年度退费', |
| | | name: '年度学员数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [120, 132, 101, 134, 90, 230, 160, 190, 410, 330, 210, 330] |
| | | }, |
| | | { |
| | | name: '月度退费', |
| | | name: '月度学员数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [220, 182, 191, 234, 290, 330, 310, 190, 210, 330, 410, 160] |
| | | }, |
| | | { |
| | | name: '周度退费', |
| | | name: '周度学员数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [150, 232, 201, 154, 190, 330, 410, 160, 210, 195, 210, 188] |
| | | }, |
| | | { |
| | | name: '日度退费', |
| | | name: '日度学员数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [320, 332, 301, 334, 390, 330, 320, 10, 195, 145, 188, 160] |
| | |
| | | }; |
| | | |
| | | |
| | | option4 = { |
| | | |
| | | option7 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | legend: { |
| | | data: ['年度次数', '月度次数'] |
| | | data: ['年度耗课数量', '月度耗课数量', '周度耗课数量', '日度耗课数量'] |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '年度次数', |
| | | name: '年度耗课数量', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [1220, 1532, 101, 1394, 980, 2380, 1680, 1190, 1410, 1330, 2110, 1330] |
| | | data: [120, 132, 101, 134, 90, 230, 160, 190, 410, 330, 210, 330] |
| | | }, |
| | | { |
| | | name: '月度次数', |
| | | name: '月度耗课数量', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [1220, 1182, 2191, 3234, 1290, 1330, 2310, 2190, 2210, 1330, 2410, 1650] |
| | | data: [220, 182, 191, 234, 290, 330, 310, 190, 210, 330, 410, 160] |
| | | }, |
| | | { |
| | | name: '周度耗课数量', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [150, 232, 201, 154, 190, 330, 410, 160, 210, 195, 210, 188] |
| | | }, |
| | | { |
| | | name: '日度耗课数量', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [320, 332, 301, 334, 390, 330, 320, 10, 195, 145, 188, 160] |
| | | } |
| | | |
| | | ] |
| | | }; |
| | | option5 = { |
| | |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [220, 182, 191, 234, 290, 330, 310, 190, 210, 330, 410, 160] |
| | | }, |
| | | { |
| | | name: '周度耗课数量', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [150, 232, 201, 154, 190, 330, 410, 160, 210, 195, 210, 188] |
| | | }, |
| | | { |
| | | name: '日度耗课数量', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [320, 332, 301, 334, 390, 330, 320, 10, 195, 145, 188, 160] |
| | | } |
| | | ] |
| | | }; |
| | | myChart.on('legendselectchanged', obj => { |
| | | var options = myChart.getOption() |
| | | //这里是选择切换什么样的x轴,那么他会进行对Y值的切换 |
| | |
| | | } |
| | | myChart.setOption(options, true) |
| | | }) |
| | | myChart1.on('legendselectchanged', obj => { |
| | | var options = myChart1.getOption() |
| | | //这里是选择切换什么样的x轴,那么他会进行对Y值的切换 |
| | | if (obj.name == '年度退费') { |
| | | options.xAxis[0].data = yearX |
| | | } else if (obj.name == '月度退费') { |
| | | options.xAxis[0].data = monthX |
| | | } else if (obj.name == '周度退费') { |
| | | options.xAxis[0].data = ["1周","2周","3周","4周"] |
| | | } else if (obj.name == '日度退费') { |
| | | options.xAxis[0].data = dataX |
| | | } |
| | | myChart1.setOption(options, true) |
| | | }) |
| | | |
| | | |
| | | // 使用刚指定的配置项和数据显示图表。 |
| | | myChart.setOption(option); |
| | | myChart1.setOption(option1); |
| | | |
| | | myChart6.setOption(option6); |
| | | myChart7.setOption(option7); |
| | | }); |
| | | |
| | | function ptUser() { |
| | | var myChart2 = echarts.init(document.getElementById('user')); |
| | | var myChart3 = echarts.init(document.getElementById('vip')); |
| | | myChart2.on('legendselectchanged', obj => { |
| | | var options = myChart2.getOption() |
| | | //这里是选择切换什么样的x轴,那么他会进行对Y值的切换 |
| | |
| | | } else if (obj.name == '月度用户数') { |
| | | options.xAxis[0].data = monthX |
| | | } else if (obj.name == '周度用户数') { |
| | | options.xAxis[0].data = weekX |
| | | options.xAxis[0].data = ["1周","2周","3周","4周"] |
| | | } else if (obj.name == '日度用户数') { |
| | | options.xAxis[0].data = dataX |
| | | } |
| | |
| | | } else if (obj.name == '月度会员数') { |
| | | options.xAxis[0].data = monthX |
| | | } else if (obj.name == '周度会员数') { |
| | | options.xAxis[0].data = weekX |
| | | options.xAxis[0].data = ["1周","2周","3周","4周"] |
| | | } else if (obj.name == '日度会员数') { |
| | | options.xAxis[0].data = dataX |
| | | } |
| | | myChart3.setOption(options, true) |
| | | }); |
| | | // 使用刚指定的配置项和数据显示图表。 |
| | | myChart.setOption(option); |
| | | myChart1.setOption(option1); |
| | | var ajax2 = new $ax(Feng.ctxPath + "/data/userAndVipPt", function(data){ |
| | | $("#userAll").text(data.allUser) |
| | | $("#userVipAll").text(data.allVip) |
| | | console.log(data) |
| | | option2 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | legend: { |
| | | |
| | | data: ['年度用户数', '月度用户数','周度用户数','日度用户数'], |
| | | icon: 'stack', |
| | | selectedMode: 'single', // 单选 |
| | | selected: { |
| | | 年度用户数: true, |
| | | 月度用户数: false, |
| | | 周度用户数: false, |
| | | 日度用户数: false |
| | | } |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | toolbox: { |
| | | feature: { |
| | | saveAsImage: {} |
| | | } |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: yearX |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '年度用户数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.yearData |
| | | }, |
| | | { |
| | | name: '月度用户数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.monthData |
| | | }, |
| | | { |
| | | name: '周度用户数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [data.count,data.count1,data.count2,data.count3] |
| | | }, |
| | | { |
| | | name: '日度用户数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.dayData |
| | | } |
| | | ] |
| | | }; |
| | | option3 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | legend: { |
| | | |
| | | data: ['年度会员数', '月度会员数','周度会员数','日度会员数'], |
| | | icon: 'stack', |
| | | selectedMode: 'single', // 单选 |
| | | selected: { |
| | | 年度会员数: true, |
| | | 月度会员数: false, |
| | | 周度会员数: false, |
| | | 日度会员数: false |
| | | } |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | toolbox: { |
| | | feature: { |
| | | saveAsImage: {} |
| | | } |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: yearX |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '年度会员数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.yearsVip |
| | | }, |
| | | { |
| | | name: '月度会员数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.monthsVip |
| | | }, |
| | | { |
| | | name: '周度会员数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data:[data.countVip,data.countVip1,data.countVip2,data.countVip3] |
| | | }, |
| | | { |
| | | name: '日度会员数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.daysVip |
| | | } |
| | | ] |
| | | }; |
| | | }); |
| | | ajax2.set("type",1) |
| | | ajax2.start() |
| | | myChart2.setOption(option2); |
| | | myChart3.setOption(option3); |
| | | } |
| | | |
| | | function ptActivity() { |
| | | var myChart4 = echarts.init(document.getElementById('activity')); |
| | | var myChart5 = echarts.init(document.getElementById('prepare')); |
| | | |
| | | var ajax2 = new $ax(Feng.ctxPath + "/data/actPt", function(data){ |
| | | console.log(data) |
| | | |
| | | option4 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | legend: { |
| | | data: ['年度次数', '月度次数'] |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | toolbox: { |
| | | feature: { |
| | | saveAsImage: {} |
| | | } |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'] |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '年度次数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [1220, 1532, 101, 1394, 980, 2380, 1680, 1190, 1410, 1330, 2110, 1330] |
| | | }, |
| | | { |
| | | name: '月度次数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [1220, 1182, 2191, 3234, 1290, 1330, 2310, 2190, 2210, 1330, 2410, 1650] |
| | | } |
| | | |
| | | ] |
| | | }; |
| | | option5 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | legend: { |
| | | data: ['年度次数', '月度次数'] |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | toolbox: { |
| | | feature: { |
| | | saveAsImage: {} |
| | | } |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'] |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '年度次数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [120, 132, 101, 394, 980, 2380, 1680, 1190, 1410, 1330, 2110, 1330] |
| | | }, |
| | | { |
| | | name: '月度次数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [120, 182, 211, 324, 120, 130, 310, 290, 220, 130, 240, 150] |
| | | } |
| | | ] |
| | | }; |
| | | }); |
| | | ajax2.set("type",1) |
| | | ajax2.start() |
| | | myChart4.setOption(option4); |
| | | myChart5.setOption(option5); |
| | | myChart6.setOption(option6); |
| | | myChart7.setOption(option7); |
| | | }); |
| | | } |
| | | |
| | | function getContent(type){ |
| | | //设置点击字体颜色效果 |
| | | for(var i=1;i<4;i++){ |
| | |
| | | $("#ensure").show(); |
| | | $("#nextB").hide(); |
| | | } |
| | | |
| | | if(type==2){ |
| | | var ajax = new $ax(Feng.ctxPath + "/data/stuUserData", function (data) { |
| | | console.log(data,323232) |
| | | var chartDom = document.getElementById('cookieAge'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | option = { |
| | | title: { |
| | | text: '年龄分布', |
| | | subtext: '', |
| | | left: 'center' |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | |
| | | series: [ |
| | | { |
| | | name: 'Access From', |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| | | { value: data.age1, name: '0-12岁' }, |
| | | { value: data.age2, name: '13-18岁' }, |
| | | { value: data.age3, name: '19-25岁' }, |
| | | { value: data.age4, name: '12-35岁' }, |
| | | { value: data.age5, name: '36-50岁' }, |
| | | { value: data.age6, name: '51岁以上' }, |
| | | |
| | | ], |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | |
| | | |
| | | |
| | | var chartDom = document.getElementById('cookieGender'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | option = { |
| | | title: { |
| | | text: '性别分布', |
| | | subtext: '', |
| | | left: 'center' |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | |
| | | series: [ |
| | | { |
| | | name: 'Access From', |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| | | { value: data.boy, name: '男' }, |
| | | { value: data.girl, name: '女' }, |
| | | |
| | | ], |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | |
| | | |
| | | |
| | | |
| | | var chartDom = document.getElementById('city'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | |
| | | option = { |
| | | xAxis: { |
| | | type: 'category', |
| | | data: data.cityData |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | data: data.cityNum, |
| | | type: 'bar' |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | |
| | | |
| | | |
| | | }, function (data) { |
| | | |
| | | }); |
| | | ajax.start(); |
| | | |
| | | |
| | | ptUser() |
| | | |
| | | } |
| | | |
| | | |
| | | if(type==3){ |
| | | var ajax = new $ax(Feng.ctxPath + "/data/stuCourseData", function (data) { |
| | | |
| | | console.log(data.data1) |
| | | var chartDom = document.getElementById('cookieTeachCourse'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | |
| | | option = { |
| | | xAxis: { |
| | | type: 'category', |
| | | data: data.data1, |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | data: data.data2, |
| | | type: 'bar' |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | }, function (data) { |
| | | |
| | | }); |
| | | ajax.start(); |
| | | |
| | | ptActivity() |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | function getContent1(type){ |
| | | //设置点击字体颜色效果 |
| | |
| | | myChart.setOption(option); |
| | | }); |
| | | $(function(){ |
| | | var chartDom = document.getElementById('cookieGender'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | option = { |
| | | title: { |
| | | text: '性别分布', |
| | | subtext: '', |
| | | left: 'center' |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | |
| | | series: [ |
| | | { |
| | | name: 'Access From', |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| | | { value: 1048, name: '男' }, |
| | | { value: 735, name: '女' }, |
| | | |
| | | ], |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | }); |
| | | $(function(){ |
| | | var chartDom = document.getElementById('cookieTeachGender'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | |
| | | }; |
| | | myChart.setOption(option); |
| | | }); |
| | | |
| | | </script> |
| | | @} |
| | |
| | | <div class="input-group"> |
| | | <div class="input-group-btn open"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="true"> |
| | | 选择城市 |
| | | 选择门店 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="cCode" onchange="TSite.oneChangeNext(1)"> |
| | | <select class="form-control" id="cCode" > |
| | | <option value="">请选择</option> |
| | | @for(obj in list){ |
| | | <option value="${obj.cityCode}">${obj.city}</option> |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | @} |
| | | @if(objectType==1){ |
| | | <div class="col-sm-3"> |
| | | <div class="input-group"> |
| | | <div class="input-group-btn open"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="true"> |
| | | 选择账号 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="account" onchange="TSite.getStore()"> |
| | | <option value="">请先选择城市</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | @} |
| | | |
| | | @if(objectType!=3){ |
| | | <div class="col-sm-3"> |
| | | <div class="input-group"> |
| | | <div class="input-group-btn open"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="true"> |
| | | 选择门店 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="store"> |
| | | <option value="">请先选择城市</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <#button name="搜索" icon="fa-search" clickFun="TCompetition.search()"/> |
| | | <#button name="搜索" icon="fa-search" clickFun="search()"/> |
| | | @} |
| | | </br> |
| | | </br> |
| | |
| | | </br> |
| | | <div class="col-sm-3" style="width: 400px;display: flex"> |
| | | <#TimeCon id="beginTime" name="时间段:" isTime="false"/> |
| | | <#button name="搜索" icon="fa-search" clickFun="TCompetition.search()"/> |
| | | <#button name="搜索" icon="fa-search" clickFun="search()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="col-sm-10" style="width: 1500px" > |
| | | </br> |
| | | </br> |
| | | <span>会员费收入:</span> |
| | | <span>玩湃币充值收入:</span> |
| | | <span>课程收入:</span> |
| | | <span>活动收入:</span> |
| | | <span>订场收入:</span> |
| | | <span>赛事收入:</span> |
| | | <span>商品收入:</span> |
| | | <span>其他收入:</span> |
| | | <span>会员费收入:<label id="fee1">0.0</label></span> |
| | | <span>玩湃币充值收入:<label id="fee2">0.0</label></span> |
| | | <span>课程收入:<label id="fee3">0.0</label></span> |
| | | <span>活动/赛事收入:<label id="fee4">0.0</label></span> |
| | | <span>订场收入:<label id="fee5">0.0</label></span> |
| | | <span>商品收入:<label id="fee7">0.0</label></span> |
| | | </br> |
| | | </br> |
| | | </br> |
| | |
| | | <div class="col-sm-10" style="width: 1500px" > |
| | | </br> |
| | | </br> |
| | | <span>本年退费额度:</span> |
| | | <span>本月退费额度:</span> |
| | | <span>本周退费额度:</span> |
| | | <span>本日退费额度:</span> |
| | | <span id="yearRefund">本年退费额度:<span id="back1"></span></span> |
| | | <span id="monthRefund">本月退费额度:<span id="back2"></span></span> |
| | | <span id="weekRefund">本周退费额度:<span id="back3"></span></span> |
| | | <span id="todayRefund">本日退费额度:<span id="back4"></span></span> |
| | | </br> |
| | | </br> |
| | | <div id="refund" style="width: 1280px;height:500px;"></div> |
| | |
| | | <script src="${ctxPath}/modular/system/dataStatistics/tSite.js"></script> |
| | | <script src="${ctxPath}/static/js/plugins/switchery/switchery.js"></script> |
| | | <script> |
| | | |
| | | |
| | | function search(){ |
| | | |
| | | if(cutType==1){ |
| | | srtj() |
| | | tuifei() |
| | | } |
| | | |
| | | if(cutType==2){ |
| | | yytj() |
| | | } |
| | | if(cutType==3){ |
| | | jxtj() |
| | | } |
| | | } |
| | | |
| | | |
| | | let cutType=1; |
| | | |
| | | |
| | | function srtj() { |
| | | var id = $("#cCode").val() |
| | | var beginTime = $("#beginTime").val() |
| | | console.log(id) |
| | | if(id==""){ |
| | | Feng.info("请先选择门店"); |
| | | return; |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/data/selectStore", function (data) { |
| | | |
| | | $("#fee1").text(data.fee1) |
| | | $("#fee2").text(data.fee2) |
| | | $("#fee3").text(data.fee3) |
| | | $("#fee4").text(data.fee4) |
| | | $("#fee5").text(data.fee5) |
| | | $("#fee7").text(data.fee7) |
| | | $("#day").val(data.dayone) |
| | | $("#month").val(data.monthone) |
| | | $("#quarter").val(data.quarterone) |
| | | $("#year").val(data.yearone) |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | var chartDom = document.getElementById('cookieTicket'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | option = { |
| | | title: { |
| | | text: '门票收入', |
| | | subtext: '', |
| | | left: 'center' |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | |
| | | series: [ |
| | | { |
| | | name: 'Access From', |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| | | { value: data.dayone, name: '日卡' }, |
| | | { value: data.monthone, name: '月卡' }, |
| | | { value: data.quarterone, name: '季卡' }, |
| | | { value: data.yearone, name: '年卡' }, |
| | | |
| | | ], |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | |
| | | var chartDom = document.getElementById('cookieCourse'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | option = { |
| | | title: { |
| | | text: '课程收入', |
| | | subtext: '', |
| | | left: 'center' |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | |
| | | series: [ |
| | | { |
| | | name: 'Access From', |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: data.courseData, |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | |
| | | |
| | | var chartDom = document.getElementById('cookieBooking'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | option = { |
| | | title: { |
| | | text: '订场收入', |
| | | subtext: '', |
| | | left: 'center' |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | |
| | | series: [ |
| | | { |
| | | name: 'Access From', |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: data.siteData, |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | }, function (data) { |
| | | |
| | | }); |
| | | ajax.set("id",id); |
| | | ajax.set("time",beginTime); |
| | | ajax.start(); |
| | | |
| | | } |
| | | |
| | | |
| | | function yytj() { |
| | | let id = $("#cCode").val() |
| | | console.log(id) |
| | | if(id==''){ |
| | | Feng.info("请先选择门店"); |
| | | return; |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/data/stuUserDataStore", function (data) { |
| | | console.log(data,323232) |
| | | var chartDom = document.getElementById('cookieAge'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | option = { |
| | | title: { |
| | | text: '年龄分布', |
| | | subtext: '', |
| | | left: 'center' |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | |
| | | series: [ |
| | | { |
| | | name: 'Access From', |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| | | { value: data.age1, name: '0-12岁' }, |
| | | { value: data.age2, name: '13-18岁' }, |
| | | { value: data.age3, name: '19-25岁' }, |
| | | { value: data.age4, name: '12-35岁' }, |
| | | { value: data.age5, name: '36-50岁' }, |
| | | { value: data.age6, name: '51岁以上' }, |
| | | |
| | | ], |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | |
| | | |
| | | |
| | | var chartDom = document.getElementById('cookieGender'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | option = { |
| | | title: { |
| | | text: '性别分布', |
| | | subtext: '', |
| | | left: 'center' |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | |
| | | series: [ |
| | | { |
| | | name: 'Access From', |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| | | { value: data.boy, name: '男' }, |
| | | { value: data.girl, name: '女' }, |
| | | |
| | | ], |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | |
| | | |
| | | |
| | | |
| | | var chartDom = document.getElementById('city'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | |
| | | option = { |
| | | xAxis: { |
| | | type: 'category', |
| | | data: data.cityData |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | data: data.cityNum, |
| | | type: 'bar' |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | |
| | | |
| | | |
| | | }, function (data) { |
| | | |
| | | }); |
| | | ajax.set("id",id); |
| | | ajax.start(); |
| | | } |
| | | |
| | | function jxtj() { |
| | | var id = $("#cCode").val() |
| | | console.log(id,333) |
| | | if(id==""){ |
| | | Feng.info("请先选择门店"); |
| | | return; |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/data/selectStoreJx", function (data) { |
| | | console.log(data) |
| | | |
| | | var chartDom = document.getElementById('cookieTeachAge'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | option = { |
| | | title: { |
| | | text: '年龄分布', |
| | | subtext: '', |
| | | left: 'center' |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | |
| | | series: [ |
| | | { |
| | | name: 'Access From', |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| | | { value: data.age1, name: '0-7岁' }, |
| | | { value: data.age2, name: '8-10岁' }, |
| | | { value:data.age3, name: '11-12岁' }, |
| | | { value: data.age4, name: '13岁以上' }, |
| | | ], |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | |
| | | |
| | | |
| | | var chartDom = document.getElementById('cookieTeachGender'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | option = { |
| | | title: { |
| | | text: '性别分布', |
| | | subtext: '', |
| | | left: 'center' |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | |
| | | series: [ |
| | | { |
| | | name: 'Access From', |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| | | { value: data.boy, name: '男' }, |
| | | { value: data.girl, name: '女' }, |
| | | |
| | | ], |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | |
| | | |
| | | |
| | | var chartDom = document.getElementById('cookieTeachCourse'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | |
| | | option = { |
| | | xAxis: { |
| | | type: 'category', |
| | | data: data.data1 |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | data: data.data2, |
| | | type: 'bar' |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | }, function (data) { |
| | | |
| | | }); |
| | | ajax.set("id",id); |
| | | ajax.start(); |
| | | |
| | | } |
| | | function tuifei() { |
| | | var myChart1 = echarts.init(document.getElementById('refund')); |
| | | let id = $("#cCode").val() |
| | | console.log(id) |
| | | if(id==''){ |
| | | Feng.info("请先选择门店"); |
| | | return; |
| | | } |
| | | var ajax3 = new $ax(Feng.ctxPath + "/data/backStore", function(data){ |
| | | $("#back1").text(data.thisYear); |
| | | $("#back2").text(data.thisMonth); |
| | | $("#back3").text(data.thisWeek); |
| | | $("#back4").text(data.thisDay); |
| | | option1 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | legend: { |
| | | |
| | | data: ['年度退费', '月度退费','周度退费','日度退费'], |
| | | icon: 'stack', |
| | | selectedMode: 'single', // 单选 |
| | | selected: { |
| | | 年度会员数: true, |
| | | 月度会员数: false, |
| | | 周度会员数: false, |
| | | 日度会员数: false |
| | | } |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | toolbox: { |
| | | feature: { |
| | | saveAsImage: {} |
| | | } |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: yearX |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '年度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.yearData |
| | | }, |
| | | { |
| | | name: '月度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.monthData |
| | | }, |
| | | { |
| | | name: '周度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.weekData |
| | | }, |
| | | { |
| | | name: '日度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.dayData |
| | | } |
| | | ] |
| | | |
| | | }; |
| | | }); |
| | | ajax3.set("id",id) |
| | | ajax3.start(); |
| | | |
| | | myChart1.on('legendselectchanged', obj => { |
| | | var options = myChart1.getOption() |
| | | //这里是选择切换什么样的x轴,那么他会进行对Y值的切换 |
| | | if (obj.name == '年度退费') { |
| | | options.xAxis[0].data = yearX |
| | | } else if (obj.name == '月度退费') { |
| | | options.xAxis[0].data = monthX |
| | | } else if (obj.name == '周度退费') { |
| | | options.xAxis[0].data = ["1周","2周","3周","4周"] |
| | | } else if (obj.name == '日度退费') { |
| | | options.xAxis[0].data = dataX |
| | | } |
| | | myChart1.setOption(options, true) |
| | | }) |
| | | myChart1.setOption(option1); |
| | | } |
| | | |
| | | |
| | | laydate.render({ |
| | | elem: '#beginTime' |
| | | , trigger: 'click' |
| | |
| | | getContent2(1); |
| | | // 基于准备好的dom,初始化echarts实例 |
| | | var myChart = echarts.init(document.getElementById('income')); |
| | | var myChart1 = echarts.init(document.getElementById('refund')); |
| | | var myChart2 = echarts.init(document.getElementById('user')); |
| | | var myChart3 = echarts.init(document.getElementById('vip')); |
| | | var myChart4 = echarts.init(document.getElementById('activity')); |
| | | var myChart5 = echarts.init(document.getElementById('prepare')); |
| | | var myChart6 = echarts.init(document.getElementById('teach')); |
| | | var myChart7 = echarts.init(document.getElementById('courseData')); |
| | | tuifei() |
| | | option = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | |
| | | }, |
| | | { |
| | | name: '日度营收', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [320, 332, 301, 334, 390, 330, 320, 10, 195, 145, 188, 160] |
| | | } |
| | | ] |
| | | }; |
| | | option1 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | legend: { |
| | | data: ['年度退费', '月度退费', '周度退费', '日度退费'] |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | toolbox: { |
| | | feature: { |
| | | saveAsImage: {} |
| | | } |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'] |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '年度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [120, 132, 101, 134, 90, 230, 160, 190, 410, 330, 210, 330] |
| | | }, |
| | | { |
| | | name: '月度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [220, 182, 191, 234, 290, 330, 310, 190, 210, 330, 410, 160] |
| | | }, |
| | | { |
| | | name: '周度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [150, 232, 201, 154, 190, 330, 410, 160, 210, 195, 210, 188] |
| | | }, |
| | | { |
| | | name: '日度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [320, 332, 301, 334, 390, 330, 320, 10, 195, 145, 188, 160] |
| | |
| | | }; |
| | | // 使用刚指定的配置项和数据显示图表。 |
| | | myChart.setOption(option); |
| | | myChart1.setOption(option1); |
| | | myChart2.setOption(option2); |
| | | myChart3.setOption(option3); |
| | | myChart4.setOption(option4); |
| | |
| | | myChart7.setOption(option7); |
| | | }); |
| | | function getContent(type){ |
| | | |
| | | cutType=type; |
| | | //设置点击字体颜色效果 |
| | | for(var i=1;i<4;i++){ |
| | | document.getElementById("div"+i).style.color="#888888";// |
| | |
| | | $("#ensure").show(); |
| | | $("#nextB").hide(); |
| | | } |
| | | |
| | | if(type==1){ |
| | | srtj() |
| | | tuifei() |
| | | } |
| | | |
| | | if(type==2){ |
| | | yytj() |
| | | } |
| | | |
| | | if(type==3){ |
| | | jxtj() |
| | | } |
| | | |
| | | } |
| | | function getContent1(type){ |
| | | //设置点击字体颜色效果 |
| | |
| | | $("#nextB").hide(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | </script> |
| | | <script> |
| | | var ans = []; |
| | | var weekX = ["1周","2周","3周","4周"]; |
| | | var monthX = ["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]; |
| | | var yearX = []; |
| | | var timeX = []; |
| | | var dataX = []; |
| | | // 创建一个日期对象 |
| | | var currentDate = new Date(); |
| | | // 获取当前日期的号数 |
| | | let currentDay = currentDate.getDate(); |
| | | // 循环添加号数到数组 |
| | | for (let i = 0; i < 7; i++) { |
| | | dataX.push(currentDay - 6+i); |
| | | } |
| | | // 获取当前月份 |
| | | var currentMonth = currentDate.getMonth(); |
| | | // 获取当前年份 |
| | | var currentYear = currentDate.getFullYear(); |
| | | // 计算指定年份和月份的天数 |
| | | function getDaysInMonth(year, month) { |
| | | // month 参数范围是 0-11,所以需要加 1 |
| | | return new Date(year, month + 1, 0).getDate(); |
| | | } |
| | | // 获取当前月份的天数 |
| | | var daysInMonth = getDaysInMonth(currentYear, currentMonth); |
| | | // 将天数按字符串格式添加到 timeX 数组中 |
| | | for (var i = 1; i <= daysInMonth; i++) { |
| | | timeX.push(String(i)); |
| | | } |
| | | $(function(){ |
| | | var chartDom = document.getElementById('cookieTicket'); |
| | | var myChart = echarts.init(chartDom); |
| | |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| | | { value: 1048, name: '年票' }, |
| | | { value: 735, name: '亲子票' }, |
| | | { value: 0, name: '日卡' }, |
| | | { value: 0, name: '月卡' }, |
| | | { value: 0, name: '季卡' }, |
| | | { value: 0, name: '年卡' }, |
| | | |
| | | ], |
| | | emphasis: { |
| | |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| | | { value: 1048, name: '篮球课' }, |
| | | { value: 735, name: '羽毛课' }, |
| | | { value: 735, name: '足球课' }, |
| | | { value: 0, name: '篮球课' }, |
| | | { value: 0, name: '羽毛课' }, |
| | | { value: 0, name: '足球课' }, |
| | | |
| | | ], |
| | | emphasis: { |
| | |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| | | { value: 1048, name: '激战' }, |
| | | { value: 735, name: '篮球场' }, |
| | | { value: 735, name: '足球场' }, |
| | | { value: 0, name: '激战' }, |
| | | { value: 0, name: '篮球场' }, |
| | | { value: 0, name: '足球场' }, |
| | | |
| | | ], |
| | | emphasis: { |
| | |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| | | { value: 1048, name: '30-35' }, |
| | | { value: 735, name: '12-18' }, |
| | | { value: 0, name: '0-7岁' }, |
| | | { value: 0, name: '8-10岁' }, |
| | | { value:0, name: '11-12岁' }, |
| | | { value: 0, name: '13岁以上' }, |
| | | |
| | | ], |
| | | emphasis: { |
| | |
| | | <div class="form-group" id="shop"> |
| | | <label class="col-sm-3 control-label">举办门店:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="shopId" name="shopId"> |
| | | <select class="form-control" id="shopId" name="shopId" multiple> |
| | | <option value="">选择门店</option> |
| | | </select> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tCompetition/tCompetition_info.js"></script> |
| | | <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/css/select2.min.css"> |
| | | <!--<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>--> |
| | | <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.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> |
| | | $(document).ready(function() { |
| | | $('#shopId').select2({ |
| | | multiple: true, |
| | | closeOnSelect: false |
| | | }); |
| | | }); |
| | | |
| | | laydate.render({ |
| | | elem: '#startTime' |
| | | ,type:"datetime" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#endTime' |
| | | ,type:"datetime" |
| | | }); |
| | | |
| | | |
| | | |
| | | var vue2 = new Vue({ |
| | | el: '#app1', |
| | | props: { |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | |
| | | |
| | | <div class="form-horizontal" id="carInfoForm"> |
| | | <div class="form-group" id="provinceCode"> |
| | | <label class="col-sm-3 control-label">所在省:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="pCode" name="pCode" onchange="TCarInfoDlg.oneChange(this)"> |
| | | <option value="">选择省</option> |
| | | @for(obj in list){ |
| | | <option value="${obj.code}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <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"> |
| | | <option value="">选择市</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <#input id="name" name="管理员姓名" type="text"/> |
| | | <#input id="phone" name="管理员手机号" type="text"/> |
| | | |
| | | |
| | | </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="TCarInfoDlg.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tCity/tCity_info.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#annualInspectionTime' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#commercialInsuranceTime' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#certifyDateA' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStart' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStop' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#certifyDateB' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#nextFixDate' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#GPSInstallDate' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#registerDate' |
| | | ,lang:"en" |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | |
| | | <div class="form-horizontal" id="carInfoForm"> |
| | | <input hidden id="id" value="${item.id}"> |
| | | <div class="form-group" id="provinceCode"> |
| | | <label class="col-sm-3 control-label">所在省:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="pCode" name="pCode" onchange="TCarInfoDlg.oneChange(this)"> |
| | | <option value="">选择省</option> |
| | | @for(obj in list){ |
| | | <option value="${obj.code}" ${obj.code == item.provinceCode ? 'selected=selected' : ''}>${obj.name}</option> |
| | | <option value="${obj.code}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <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"> |
| | | <option value="">选择市</option> |
| | | @for(obj in list1){ |
| | | <option value="${obj.code}" ${obj.code == item.cityCode ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <#input id="name" name="发放数量" type="text" value="${item.name}"/> |
| | | <#input id="phone" name="管理员手机号" type="text" value="${item.phone}"/> |
| | | |
| | | |
| | | </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.editSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tCity/tCity_info.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#annualInspectionTime' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#commercialInsuranceTime' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#certifyDateA' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStart' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStop' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | |
| | | elem: '#certifyDateB' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#nextFixDate' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#GPSInstallDate' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#registerDate' |
| | | ,lang:"en" |
| | | }); |
| | | </script> |
| | | <script type="application/javascript"> |
| | | $(function() { |
| | | var companyType = $("input[name='companyType']:checked").val(); |
| | | if (1 == companyType){ |
| | | $(".companyDiv").hide(); |
| | | } else if (2 == companyType){ |
| | | $(".companyDiv").show(); |
| | | } |
| | | |
| | | TCarInfoDlg.zcServerClick(); |
| | | TCarInfoDlg.kcServerClick(); |
| | | |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | |
| | | <div class="ibox-title"> |
| | | <h5>折扣管理</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <div class="input-group"> |
| | | <div class="input-group-btn open"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="true"> |
| | | 所在省 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="pCode" onchange="TCompetition.oneChange(this)"> |
| | | <option value="">全部</option> |
| | | @for(obj in list){ |
| | | <option value="${obj.code}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="col-sm-3"> |
| | | <div class="input-group"> |
| | | <div class="input-group-btn open"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="true"> |
| | | 所在市 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="cCode"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="shopName" name="所属门店" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="name" name="课包名称" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="type" name="折扣类型" > |
| | | <option value="">全部</option> |
| | | <option value="1">会员折扣</option> |
| | | <option value="3">限时折扣</option> |
| | | <option value="4">赠送课时</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TCompetition.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TCompetition.resetSearch()" space="true"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TCompetitionTableToolbar" role="group"> |
| | | <#button name="上架" icon="fa-plus" clickFun="TCompetition.updateState(1)"/> |
| | | <#button name="下架" icon="fa-edit" clickFun="TCompetition.updateState(2)" space="true"/> |
| | | <#button name="查看详情" icon="fa-remove" clickFun="TCompetition.info()" space="true"/> |
| | | |
| | | </div> |
| | | <#table id="TCompetitionTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tDiscount/tDiscount.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#createTime' |
| | | ,range: true |
| | | ,lang:"en" |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal"> |
| | | <div class="row"> |
| | | <input type="hidden" id="id" value="${item.id}"> |
| | | <input type="hidden" id="coursePackagePaymentConfig" value='${coursePackagePaymentConfig}'> |
| | | <div class="form-group"> |
| | | <div class="col-sm-2"></div> |
| | | <div class="col-sm-10"> |
| | | <label class="col-sm-2 control-label">课包名称:</label> |
| | | <div class="col-sm-4" style="margin-top: 6px;"> |
| | | <span>${item.name}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <div class="col-sm-2"></div> |
| | | <div class="col-sm-10"> |
| | | <div class="col-sm-2"> |
| | | </div> |
| | | <div class="col-sm-6" id="classHours" style="margin-top: 6px;"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <div class="col-sm-2"></div> |
| | | <div class="col-sm-10"> |
| | | <label class="col-sm-2 control-label">支付方式:</label> |
| | | <div class="col-sm-4" style="margin-top: 6px;"> |
| | | <span id="payment"></span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <div class="col-sm-2"></div> |
| | | <div class="col-sm-10"> |
| | | <label class="col-sm-2 control-label">现金支付:</label> |
| | | <div class="col-sm-4" style="margin-top: 6px;"> |
| | | <span id="cashPayment"></span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <div class="col-sm-2"></div> |
| | | <div class="col-sm-10"> |
| | | <label class="col-sm-2 control-label">*折扣类型:</label> |
| | | <div class="col-sm-6" id="types" style="margin-top: 6px;"> |
| | | <input type="checkbox" name="type" value="1"> 会员折扣 |
| | | <input type="checkbox" name="type" value="2"> 续课优惠 |
| | | <input type="checkbox" name="type" value="3"> 限时折扣 |
| | | <input type="checkbox" name="type" value="4"> 赠送课时 |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div id="memberDiscount"> |
| | | |
| | | </div> |
| | | <div id="renewalOffer"> |
| | | |
| | | </div> |
| | | <div id="limitedTimeDiscount"> |
| | | |
| | | </div> |
| | | <div id="complimentaryClass"> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="danger" name="关闭" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/coursePackage/coursePackageDiscount.js"></script> |
| | | <script src="${ctxPath}/modular/system/tDiscount/tDiscount_info.js"></script> |
| | | |
| | | |
| | | <script type="text/javascript"> |
| | | laydate.render({ |
| | | elem: '#classStartTime' |
| | | ,type: '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"> |
| | | <div class="form-group" id="provinceCode"> |
| | | <label class="col-sm-3 control-label">所在省:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="pCode" name="pCode" onchange="TCarInfoDlg.oneChange(this)"> |
| | | <option value="">选择省</option> |
| | | @for(obj in list){ |
| | | <option value="${obj.code}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <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"> |
| | | <option value="">选择市</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <#input id="name" name="管理员姓名" type="text"/> |
| | | <#input id="phone" name="管理员手机号" type="text"/> |
| | | |
| | | |
| | | </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="TCarInfoDlg.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tCity/tCity_info.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#annualInspectionTime' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#commercialInsuranceTime' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#certifyDateA' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStart' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStop' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#certifyDateB' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#nextFixDate' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#GPSInstallDate' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#registerDate' |
| | | ,lang:"en" |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | |
| | | <div class="form-horizontal" id="carInfoForm"> |
| | | <input hidden id="id" value="${item.id}"> |
| | | <div class="form-group" id="provinceCode"> |
| | | <label class="col-sm-3 control-label">所在省:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="pCode" name="pCode" onchange="TCarInfoDlg.oneChange(this)"> |
| | | <option value="">选择省</option> |
| | | @for(obj in list){ |
| | | <option value="${obj.code}" ${obj.code == item.provinceCode ? 'selected=selected' : ''}>${obj.name}</option> |
| | | <option value="${obj.code}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <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"> |
| | | <option value="">选择市</option> |
| | | @for(obj in list1){ |
| | | <option value="${obj.code}" ${obj.code == item.cityCode ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <#input id="name" name="发放数量" type="text" value="${item.name}"/> |
| | | <#input id="phone" name="管理员手机号" type="text" value="${item.phone}"/> |
| | | |
| | | |
| | | </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.editSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tCity/tCity_info.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#annualInspectionTime' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#commercialInsuranceTime' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#certifyDateA' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStart' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStop' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | |
| | | elem: '#certifyDateB' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#nextFixDate' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#GPSInstallDate' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#registerDate' |
| | | ,lang:"en" |
| | | }); |
| | | </script> |
| | | <script type="application/javascript"> |
| | | $(function() { |
| | | var companyType = $("input[name='companyType']:checked").val(); |
| | | if (1 == companyType){ |
| | | $(".companyDiv").hide(); |
| | | } else if (2 == companyType){ |
| | | $(".companyDiv").show(); |
| | | } |
| | | |
| | | TCarInfoDlg.zcServerClick(); |
| | | TCarInfoDlg.kcServerClick(); |
| | | |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | |
| | | <div class="ibox-title"> |
| | | <h5>折扣管理</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <div class="input-group"> |
| | | <div class="input-group-btn open"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="true"> |
| | | 所在省 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="pCode" onchange="TCompetition.oneChange(this)"> |
| | | <option value="">全部</option> |
| | | @for(obj in list){ |
| | | <option value="${obj.code}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="col-sm-3"> |
| | | <div class="input-group"> |
| | | <div class="input-group-btn open"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="true"> |
| | | 所在市 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="cCode"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="shopName" name="所属门店" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="name" name="课包名称" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="type" name="折扣类型" > |
| | | <option value="">全部</option> |
| | | <option value="1">会员折扣</option> |
| | | <option value="3">限时折扣</option> |
| | | <option value="4">赠送课时</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TCompetition.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TCompetition.resetSearch()" space="true"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TCompetitionTableToolbar" role="group"> |
| | | <#button name="审核" icon="fa-plus" clickFun="TCompetition.audit()"/> |
| | | <#button name="查看详情" icon="fa-remove" clickFun="TCompetition.info()" space="true"/> |
| | | |
| | | </div> |
| | | <#table id="TCompetitionTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tDiscountAudit/tDiscount.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#createTime' |
| | | ,range: true |
| | | ,lang:"en" |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal"> |
| | | <div class="row"> |
| | | <input type="hidden" id="id" value="${item.id}"> |
| | | <input type="hidden" id="coursePackagePaymentConfig" value='${coursePackagePaymentConfig}'> |
| | | <div class="form-group"> |
| | | <div class="col-sm-2"></div> |
| | | <div class="col-sm-10"> |
| | | <label class="col-sm-2 control-label">当前状态:</label> |
| | | @if(state==1){ |
| | | <div class="col-sm-4" style="margin-top: 6px;color: goldenrod"> |
| | | <span>${stateStr}</span> |
| | | </div> |
| | | @} |
| | | @if(state==3){ |
| | | <div class="col-sm-4" style="margin-top: 6px;color: red"> |
| | | <span>${stateStr}</span> |
| | | </div> |
| | | @} |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <div class="col-sm-2"></div> |
| | | <div class="col-sm-10"> |
| | | <label class="col-sm-2 control-label">课包名称:</label> |
| | | <div class="col-sm-4" style="margin-top: 6px;"> |
| | | <span>${item.name}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <div class="col-sm-2"></div> |
| | | <div class="col-sm-10"> |
| | | <div class="col-sm-2"> |
| | | </div> |
| | | <div class="col-sm-6" id="classHours" style="margin-top: 6px;"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <div class="col-sm-2"></div> |
| | | <div class="col-sm-10"> |
| | | <label class="col-sm-2 control-label">支付方式:</label> |
| | | <div class="col-sm-4" style="margin-top: 6px;"> |
| | | <span id="payment"></span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <div class="col-sm-2"></div> |
| | | <div class="col-sm-10"> |
| | | <label class="col-sm-2 control-label">现金支付:</label> |
| | | <div class="col-sm-4" style="margin-top: 6px;"> |
| | | <span id="cashPayment"></span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <div class="col-sm-2"></div> |
| | | <div class="col-sm-10"> |
| | | <label class="col-sm-2 control-label">*折扣类型:</label> |
| | | <div class="col-sm-6" id="types" style="margin-top: 6px;"> |
| | | <input type="checkbox" name="type" value="1"> 会员折扣 |
| | | <input type="checkbox" name="type" value="2"> 续课优惠 |
| | | <input type="checkbox" name="type" value="3"> 限时折扣 |
| | | <input type="checkbox" name="type" value="4"> 赠送课时 |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div id="memberDiscount"> |
| | | |
| | | </div> |
| | | <div id="renewalOffer"> |
| | | |
| | | </div> |
| | | <div id="limitedTimeDiscount"> |
| | | |
| | | </div> |
| | | <div id="complimentaryClass"> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="danger" name="关闭" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tDiscountAudit/coursePackageDiscount.js"></script> |
| | | <script src="${ctxPath}/modular/system/tDiscount/tDiscount_info.js"></script> |
| | | |
| | | |
| | | <script type="text/javascript"> |
| | | laydate.render({ |
| | | elem: '#classStartTime' |
| | | ,type: 'time' |
| | | ,range: true |
| | | }); |
| | | </script> |
| | | @} |
| | |
| | | <link rel="stylesheet" href="${ctxPath}/js/elementui/index.css"> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#time', |
| | | range:true |
| | | elem: '#time' |
| | | ,type: 'time',format: "HH:mm" |
| | | ,range: true |
| | | }); |
| | | |
| | | var vue2 = new Vue({ |
| | | el: '#app1', |
| | | props: { |
| | |
| | | <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" > |
| | | <select class="form-control" id="cCode" name="cCode"> |
| | | <option value="">选择市</option> |
| | | @for(obj in list1){ |
| | | <option value="${obj.id}" ${obj.code == item.cityCode ? 'selected=selected' : ''}>${obj.name}</option> |
| | | <option value="${obj.id}" ${item.cityCode == obj.code ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | |
| | | <!-- 创建地图容器--> |
| | | <div id="container" style="height: 500px;" ></div> |
| | | </div> |
| | | <#input id="time" name="营业时间" type="text" value="${time}"/>v |
| | | <#input id="time" name="营业时间" type="text" value="${time}"/> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">门店介绍:</label> |
| | | <div class="col-sm-9"> |
| | |
| | | <link rel="stylesheet" href="${ctxPath}/js/elementui/index.css"> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#time', |
| | | range:true |
| | | elem: '#time' |
| | | ,type: 'time',format: "HH:mm" |
| | | ,range: true |
| | | }); |
| | | |
| | | let id = "${item.realPicture}" |
| | | let obj = [] |
| | | |
| | |
| | | |
| | | |
| | | window.onload = function(){ |
| | | |
| | | console.log("${item.operatorId}") |
| | | var OBJradio=document.getElementsByName("type") |
| | | if("${item.operatorId}"==0){ |
| | |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | </script> |
| | |
| | | */ |
| | | TStudent.openTStudentDetail = function () { |
| | | if (this.check()) { |
| | | |
| | | if (TStudent.seItem.status!=1){ |
| | | Feng.error("请选择待核销的数据") |
| | | return |
| | | } |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/ball/pre_edit/' + TStudent.seItem.id |
| | | content: Feng.ctxPath + '/ball/yueyue_edit/' + TStudent.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | TStudent.openTStudentDetail5 = function () { |
| | | if (this.check()) { |
| | | |
| | | |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/ball/yueyue_info/' + TStudent.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | /** |
| | | * 打开详情 |
| | | * 确认到店 |
| | | */ |
| | | TStudent.openTStudentDetail1 = function () { |
| | | if (this.check()) { |
| | | |
| | | if (TStudent.seItem.status!=1){ |
| | | Feng.error("请选择待核销的数据") |
| | | return |
| | | } |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '', |
| | | area: ['20%', '25%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/ball/joinmethod/' + TStudent.seItem.id |
| | | }); |
| | | |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * 确认到店 |
| | | */ |
| | | TStudent.openTStudentDetail4 = function () { |
| | | if (this.check()) { |
| | | |
| | | if (TStudent.seItem.status!=1){ |
| | | Feng.error("请选择待核销的数据") |
| | | return |
| | | } |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '', |
| | | area: ['30%', '40%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/ball/tocancel/' + TStudent.seItem.id |
| | | }); |
| | | |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | TStudent.openTStudentDetail2 = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | |
| | | queryData['store'] = $("#store").val(); |
| | | queryData['peopleName'] = $("#peopleName").val(); |
| | | queryData['phone'] = $("#phone").val(); |
| | | queryData['date'] = $("#peopleName").val(); |
| | | queryData['date'] = $("#date").val(); |
| | | queryData['payMethod'] = $("#payMethod").val(); |
| | | queryData['state'] = $("#state").val(); |
| | | |
| | | |
| | | |
| | |
| | | $("#ttt2").empty().append(content); |
| | | } |
| | | }) |
| | | ajax.set("date",$('#time').val()); |
| | | ajax.start() |
| | | |
| | | var ajax1 = new $ax(Feng.ctxPath + "/ball/halfName/"+ $('#siteId').val(), function(data){ |
| | | console.log("================"+data) |
| | | if(data!=null){ |
| | | let htmlStr = ''; |
| | | for (let i = 0; i < data.length; i++) { |
| | | htmlStr += '<option value="' + data[i] + '">' + data[i] + '</option>' |
| | | } |
| | | $("#half").empty().append(htmlStr); |
| | | } |
| | | }) |
| | | ajax1.start() |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | }; |
| | | |
| | | |
| | | |
| | | CoursePackageInfo.addTime1 = function (a) { |
| | | |
| | | |
| | | if ($('#siteId').val() != $('#selSiteId').val()||$('#time').val()!=$('#selDate').val()){ |
| | | $("#ttt3").hide() |
| | | $("#ttt2").show() |
| | | |
| | | }else { |
| | | $("#ttt3").show() |
| | | $("#ttt2").hide() |
| | | |
| | | } |
| | | |
| | | console.log("==========="+a) |
| | | var ajax = new $ax(Feng.ctxPath + "/ball/yuyuetimes/"+ $('#siteId').val(), function(data){ |
| | | console.log("================"+data) |
| | | if(data!=null){ |
| | | var content=''; |
| | | $.each(data, function(k, v) { |
| | | var buttonClass = "layui-btn layui-btn-primary"; |
| | | var style = ""; |
| | | if (v.state === 0) { |
| | | style = "background-color: red;"; |
| | | } |
| | | var disabledAttribute = v.state === 0 ? "disabled" : ""; |
| | | content += '<button type="button" class="' + buttonClass + '" ' + disabledAttribute + ' style="' + style + '" onclick="toggleColor(this)">' + v.time + '</button>'; |
| | | }); |
| | | $("#ttt2").empty().append(content); |
| | | } |
| | | }) |
| | | ajax.start() |
| | | |
| | | var ajax1 = new $ax(Feng.ctxPath + "/ball/halfName/"+ $('#siteId').val(), function(data){ |
| | |
| | | var values = ""; |
| | | |
| | | for (var i = 0; i < elements.length; i++) { |
| | | values += date +" "+ elements[i].innerText + ","; |
| | | values += date +" "+ elements[i].innerText + ";"; |
| | | } |
| | | |
| | | // 去除最后一个逗号 |
| | |
| | | ajax.start(); |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * 新修改 |
| | | */ |
| | | CoursePackageInfo.addSubmit1 = function () { |
| | | let province = $('#provinceCode option:checked').text(); |
| | | let provinceCode = $('#provinceCode').val(); |
| | | let city = $('#cityCode option:checked').text(); |
| | | let cityCode = $('#cityCode').val(); |
| | | let storeId = $('#storeId').val(); |
| | | let siteId = $('#siteId').val(); |
| | | let site = $('#siteId option:checked').text(); |
| | | |
| | | |
| | | var radios = document.getElementsByName("type"); |
| | | var selectedValue; |
| | | |
| | | |
| | | |
| | | for (var i = 0; i < radios.length; i++) { |
| | | if (radios[i].checked) { |
| | | selectedValue = radios[i].value; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | let type = selectedValue; |
| | | let half = $('#half').val(); |
| | | let date = $('#time').val(); |
| | | |
| | | |
| | | var elements = document.getElementsByClassName("layui-btn layui-btn-primary green-button"); |
| | | var values = ""; |
| | | console.log("==============="+elements[0]) |
| | | if ($('#siteId').val() != $('#selSiteId').val()||$('#time').val()!=$('#selDate').val()) { |
| | | for (var i = 0; i < elements.length; i++) { |
| | | if (elements[i].name != 'has') { |
| | | values += date + " " + elements[i].innerText + ";"; |
| | | } |
| | | |
| | | } |
| | | }else { |
| | | for (var i = 0; i < elements.length; i++) { |
| | | if (elements[i].name = 'has') { |
| | | values += date + " " + elements[i].innerText + ";"; |
| | | } |
| | | } |
| | | } |
| | | // 去除最后一个逗号 |
| | | values = values.slice(0, -1); |
| | | |
| | | console.log(values); |
| | | |
| | | var times = values; |
| | | |
| | | let cash = $('#cash').val(); |
| | | let play = $('#play').val(); |
| | | let booker = $('#booker').val(); |
| | | let phone = $('#phone').val(); |
| | | let id = $('#id').val(); |
| | | |
| | | |
| | | // if(null == provinceCode || '' == provinceCode){ |
| | | // Feng.error("所在省不能为空"); |
| | | // return |
| | | // } |
| | | // if(null == cityCode || '' == cityCode){ |
| | | // Feng.error("所在市不能为空"); |
| | | // return |
| | | // } |
| | | // if(null == storeId || '' == storeId){ |
| | | // Feng.error("所属门店不能为空"); |
| | | // return |
| | | // } |
| | | // if(null == coursePackageTypeId || '' == coursePackageTypeId){ |
| | | // Feng.error("课程类型不能为空"); |
| | | // return |
| | | // } |
| | | // if(null == name || '' == name){ |
| | | // Feng.error("课包名称不能为空"); |
| | | // return |
| | | // } |
| | | // if(null == siteId || '' == siteId){ |
| | | // Feng.error("上课场地不能为空"); |
| | | // return |
| | | // } |
| | | // if(null == coachId || '' == coachId){ |
| | | // Feng.error("授课教师不能为空"); |
| | | // return |
| | | // } |
| | | // |
| | | // classWeeks = classWeeks.substring(0, classWeeks.length - 1); |
| | | // |
| | | // if(null == coverDrawing || '' == coverDrawing){ |
| | | // Feng.error("课包封面不能为空"); |
| | | // return |
| | | // } |
| | | // if(null == detailDrawing || '' == detailDrawing){ |
| | | // Feng.error("详情页不能为空"); |
| | | // return |
| | | // } |
| | | // if(null == introduceDrawing || '' == introduceDrawing){ |
| | | // Feng.error("课包介绍不能为空"); |
| | | // return |
| | | // } |
| | | |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/ball/orderedit", function (data) { |
| | | if(data.code == 200){ |
| | | Feng.success("添加成功!"); |
| | | CoursePackageInfo.close(); |
| | | window.parent.TStudent.table.refresh(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("province",province) |
| | | ajax.set("provinceCode",provinceCode); |
| | | ajax.set("city",city); |
| | | ajax.set("cityCode",cityCode); |
| | | ajax.set("storeId",storeId); |
| | | ajax.set("isHalf",type); |
| | | ajax.set("siteId",siteId); |
| | | ajax.set("nextName",site); |
| | | ajax.set("halfName",half); |
| | | ajax.set("date",date); |
| | | ajax.set("times",times); |
| | | ajax.set("money",cash+","+play); |
| | | ajax.set("booker",booker); |
| | | ajax.set("phone",phone); |
| | | ajax.set("id",id); |
| | | |
| | | |
| | | ajax.start(); |
| | | }; |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | |
| | | */ |
| | | CoursePackage.editCoursePackageState = function (state) { |
| | | if (this.check()) { |
| | | |
| | | if(CoursePackage.seItem.state == state){ |
| | | Feng.error("不能重复操作"); |
| | | return |
| | | } |
| | | parent.layer.confirm(state == 1 ? '是否上架' : "是否下架" , { |
| | | btn: ['确定', '取消'] |
| | | }, function (index) { |
| | | let ajax = new $ax(Feng.ctxPath + "/coursePackage/editCoursePackageState", function (data) { |
| | | Feng.success(state == 1 ? '上架' : "下架" + "成功!"); |
| | | CoursePackage.table.refresh(); |
| | |
| | | ajax.set("id", CoursePackage.seItem.id); |
| | | ajax.set("state", state); |
| | | ajax.start(); |
| | | parent.layer.close(index); |
| | | |
| | | }, function (index) { |
| | | parent.layer.close(index); |
| | | } |
| | | |
| | | |
| | | ) |
| | | |
| | | } |
| | | }; |
| | | |
New file |
| | |
| | | /** |
| | | * 车辆管理管理初始化 |
| | | */ |
| | | var TCompetition = { |
| | | id: "TCompetitionTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | var language =1 |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TCompetition.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '所在省', field: 'pname', visible: true, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '所在市', field: 'cname', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '所属门店', field: 'shopName', visible: true, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '课包名称', field: 'name', visible: true, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '折扣类型', field: 'type', visible: true, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '状态', field: 'status', visible: true, 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 () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCity/tCity_add' |
| | | }); |
| | | 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 + '/tCity/tCity_update/' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 删除车辆管理 |
| | | */ |
| | | TCompetition.updateState = function (e) { |
| | | if (this.check()) { |
| | | var id = TCompetition.seItem.id; |
| | | var ajax = new $ax(Feng.ctxPath + "/tDiscount/updateState", function (data) { |
| | | if(data.code==200){ |
| | | Feng.success("操作成功") |
| | | }else { |
| | | Feng.error("操作失败") |
| | | } |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("操作失败") |
| | | TCompetition.table.refresh(); |
| | | }); |
| | | ajax.set("id",id); |
| | | ajax.set("status",e); |
| | | 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.freeze = function () { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/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 + "/tCity/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.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.info = function () { |
| | | if (this.check()) { |
| | | let index = layer.open({ |
| | | type: 2, |
| | | title: '折扣详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tDiscount/info?id=' + this.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询车辆管理列表 |
| | | */ |
| | | TCompetition.search = function () { |
| | | var queryData = {}; |
| | | queryData['provinceCode'] = $("#pCode").val(); |
| | | queryData['cityCode'] = $("#cCode").val(); |
| | | queryData['name'] = $("#name").val(); |
| | | queryData['shopName'] = $("#shopName").val(); |
| | | queryData['type'] = $("type").val(); |
| | | TCompetition.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | TCompetition.resetSearch = function () { |
| | | $("#pCode").val(""); |
| | | $("#cCode").val(""); |
| | | $("#name").val(""); |
| | | $("#type").val(""); |
| | | $("#shopName").val(""); |
| | | TCompetition.search(); |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColunms = TCompetition.initColumn(); |
| | | var table = new BSTable(TCompetition.id, "/tDiscount/list", 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 language=1; |
| | | var TCarInfoDlg = { |
| | | 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.addSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | let pCode = $("#pCode").val() |
| | | let cCode = $("#cCode").val() |
| | | let name = $("#name").val() |
| | | let phone = $("#phone").val() |
| | | |
| | | if(pCode==''){ |
| | | Feng.info("请选择省") |
| | | return; |
| | | } |
| | | if(cCode==''){ |
| | | Feng.info("请选择市") |
| | | return; |
| | | } |
| | | if(name==''){ |
| | | Feng.info("管理员姓名不能为空") |
| | | return; |
| | | } |
| | | if(phone==''){ |
| | | Feng.info("管理员手机号不能为空") |
| | | return; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/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.start(); |
| | | } |
| | | |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | TCarInfoDlg.editSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | let pCode = $("#pCode").val() |
| | | let cCode = $("#cCode").val() |
| | | let name = $("#name").val() |
| | | let phone = $("#phone").val() |
| | | |
| | | if(pCode==''){ |
| | | Feng.info("请选择省") |
| | | return; |
| | | } |
| | | if(cCode==''){ |
| | | Feng.info("请选择市") |
| | | return; |
| | | } |
| | | if(name==''){ |
| | | Feng.info("管理员姓名不能为空") |
| | | return; |
| | | } |
| | | if(phone==''){ |
| | | Feng.info("管理员手机号不能为空") |
| | | return; |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/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("id",$("#id").val()); |
| | | ajax.start(); |
| | | } |
| | | |
| | | $(function() { |
| | | Feng.initValidator("carInfoForm", TCarInfoDlg.validateFields); |
| | | // 初始化图片上传 |
| | | var carPhoto = new $WebUpload("carPhoto"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var drivingLicensePhoto = new $WebUpload("drivingLicensePhoto"); |
| | | drivingLicensePhoto.setUploadBarId("progressBar"); |
| | | drivingLicensePhoto.init(); |
| | | }); |
| | | |
| | | /** |
| | | * 选择分公司后执行 |
| | | */ |
| | | 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.brandChange = function (e) { |
| | | var carBrandId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCar/brandChange", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择车辆类型</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Please select the vehicle type</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih Jenis Kendaraan</option>'; |
| | | } |
| | | |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#carModelId").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("carBrandId",carBrandId); |
| | | 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(); |
| | | } |
| | | } |
New file |
| | |
| | | /** |
| | | * 用户详情对话框(可用于添加和修改对话框) |
| | | */ |
| | | var CoursePackageDiscount = { |
| | | userInfoData: {}, |
| | | coursePackagePaymentConfig: {} |
| | | }; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | CoursePackageDiscount.close = function () { |
| | | parent.layer.close(window.parent.CoursePackage.layerIndex); |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | CoursePackageDiscount.editSubmit = function () { |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/coursePackage/setCoursePackageDiscount", function (data) { |
| | | if(data.code == 200){ |
| | | Feng.success("编辑成功!"); |
| | | CoursePackageDiscount.close(); |
| | | window.parent.CoursePackage.table.refresh(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("编辑失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set('json', JSON.stringify(CoursePackageDiscount.coursePackagePaymentConfig)); |
| | | ajax.set('id', $('#id').val()); |
| | | ajax.start(); |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | function addPrice(type){ |
| | | let index = $('#classHours').find('button[checked]').attr('index'); |
| | | if(type == 3){ |
| | | let ll = $('#limitedTimeDiscount .limitedTimeDiscount').length; |
| | | let htmlStr = |
| | | ' <div class="form-group limitedTimeDiscount" index="' + ll + '">' + |
| | | ' <div class="col-sm-2"></div>\n' + |
| | | ' <div class="col-sm-8" style="border: 1px solid; padding: 20px;">\n' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">折扣有效期:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <input class="startAndEndDay" style="width: 300px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/>' + |
| | | ' </div>\n' + |
| | | ' <div class="col-sm-1"><i class="fa fa-trash-o" style="font-size:24px;color: red;" onclick="removePrice(3, this)"></i></div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*折扣时间:</label>\n' + |
| | | ' <div class="col-sm-5">\n' + |
| | | ' <input class="time" style="width: 200px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/>\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label"></label>\n' + |
| | | ' <div class="col-sm-8" style="margin-top: 6px;">\n' + |
| | | ' <input type="checkbox" name="week" value="1" onclick="addPriceValue(3, this, \'weeks\')"/> 周一 ' + |
| | | ' <input type="checkbox" name="week" value="2" onclick="addPriceValue(3, this, \'weeks\')"/> 周二 ' + |
| | | ' <input type="checkbox" name="week" value="3" onclick="addPriceValue(3, this, \'weeks\')"/> 周三 ' + |
| | | ' <input type="checkbox" name="week" value="4" onclick="addPriceValue(3, this, \'weeks\')"/> 周四 ' + |
| | | ' <input type="checkbox" name="week" value="5" onclick="addPriceValue(3, this, \'weeks\')"/> 周五 ' + |
| | | ' <input type="checkbox" name="week" value="6" onclick="addPriceValue(3, this, \'weeks\')"/> 周六 ' + |
| | | ' <input type="checkbox" name="week" value="7" onclick="addPriceValue(3, this, \'weeks\')"/> 周日 ' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*现金支付:</label>\n' + |
| | | ' <div class="col-sm-4">\n' + |
| | | ' <input type="number" class="price" onblur="addPriceValue(3, this, \'cashPayment\')" min="0" placeholder="请输入折扣后支付价格" style="width: 180px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/> ¥\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | ' </div>'; |
| | | |
| | | $('#limitedTimeDiscount').append(htmlStr); |
| | | let arr = CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount; |
| | | for(let k in arr){ |
| | | if(arr[k].type == 3){ |
| | | arr[k].content.push({}) |
| | | } |
| | | } |
| | | lay('.startAndEndDay').each(function(i, e){ |
| | | laydate.render({ |
| | | elem: this |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | ,done: function(value, date, endDate){ |
| | | let index = $('#classHours').find('button[checked]').attr('index'); |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | let ii = $(e).parent('div').parent('div').parent('div').parent('div').attr('index'); |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(type == obj.coursePackageDiscount[i].type){ |
| | | let jsonArray = obj.coursePackageDiscount[i].content; |
| | | for (let j = 0; j < jsonArray.length; j++) { |
| | | if(j == ii){ |
| | | let arr = value.split(" - "); |
| | | obj.coursePackageDiscount[i].content[j]['startDate'] = arr[0]; |
| | | obj.coursePackageDiscount[i].content[j]['endDate'] = arr[1]; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | lay('.time').each(function(i, e){ |
| | | laydate.render({ |
| | | elem: this |
| | | ,type: 'time' |
| | | ,range: true |
| | | ,done: function(value, date, endDate){ |
| | | let index = $('#classHours').find('button[checked]').attr('index'); |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | let ii = $(e).parent('div').parent('div').parent('div').parent('div').attr('index'); |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(type == obj.coursePackageDiscount[i].type){ |
| | | let jsonArray = obj.coursePackageDiscount[i].content; |
| | | for (let j = 0; j < jsonArray.length; j++) { |
| | | if(j == ii){ |
| | | let arr = value.split(" - "); |
| | | obj.coursePackageDiscount[i].content[j]['startTime'] = arr[0]; |
| | | obj.coursePackageDiscount[i].content[j]['endTime'] = arr[1]; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | if(type == 4){ |
| | | let ll = $('#complimentaryClass .complimentaryClass').length; |
| | | let htmlStr = |
| | | ' <div class="form-group complimentaryClass" index="' + ll + '">' + |
| | | ' <div class="col-sm-2"></div>\n' + |
| | | ' <div class="col-sm-8" style="border: 1px solid; padding: 20px;">\n' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*赠送有效期:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <input class="startAndEndDay" style="width: 300px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/>' + |
| | | ' </div>\n' + |
| | | ' <div class="col-sm-1"><i class="fa fa-trash-o" style="font-size:24px;color: red;" onclick="removePrice(4, this)"></i></div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*赠送时间:</label>\n' + |
| | | ' <div class="col-sm-5">\n' + |
| | | ' <input class="time" style="width: 200px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/>\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label"></label>\n' + |
| | | ' <div class="col-sm-8" style="margin-top: 6px;">\n' + |
| | | ' <input type="checkbox" name="week" value="1" onclick="addPriceValue(4, this, \'weeks\')"/> 周一 ' + |
| | | ' <input type="checkbox" name="week" value="2" onclick="addPriceValue(4, this, \'weeks\')"/> 周二 ' + |
| | | ' <input type="checkbox" name="week" value="3" onclick="addPriceValue(4, this, \'weeks\')"/> 周三 ' + |
| | | ' <input type="checkbox" name="week" value="4" onclick="addPriceValue(4, this, \'weeks\')"/> 周四 ' + |
| | | ' <input type="checkbox" name="week" value="5" onclick="addPriceValue(4, this, \'weeks\')"/> 周五 ' + |
| | | ' <input type="checkbox" name="week" value="6" onclick="addPriceValue(4, this, \'weeks\')"/> 周六 ' + |
| | | ' <input type="checkbox" name="week" value="7" onclick="addPriceValue(4, this, \'weeks\')"/> 周日 ' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*赠送课时数:</label>\n' + |
| | | ' <div class="col-sm-4">\n' + |
| | | ' <input type="number" class="price" onblur="addPriceValue(4, this, \'hour\')" min="0" placeholder="请输入赠送课时数" style="width: 180px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/> ¥\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | ' </div>'; |
| | | $('#complimentaryClass').append(htmlStr); |
| | | let arr = CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount; |
| | | for(let k in arr){ |
| | | if(arr[k].type == 4){ |
| | | arr[k].content.push({}) |
| | | } |
| | | } |
| | | lay('.startAndEndDay').each(function(i, e){ |
| | | laydate.render({ |
| | | elem: this |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | ,done: function(value, date, endDate){ |
| | | let index = $('#classHours').find('button[checked]').attr('index'); |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | let ii = $(e).parent('div').parent('div').parent('div').parent('div').attr('index'); |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(type == obj.coursePackageDiscount[i].type){ |
| | | let jsonArray = obj.coursePackageDiscount[i].content; |
| | | for (let j = 0; j < jsonArray.length; j++) { |
| | | if(j == ii){ |
| | | let arr = value.split(" - "); |
| | | obj.coursePackageDiscount[i].content[j]['startDate'] = arr[0]; |
| | | obj.coursePackageDiscount[i].content[j]['endDate'] = arr[1]; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | lay('.time').each(function(i, e){ |
| | | laydate.render({ |
| | | elem: this |
| | | ,type: 'time' |
| | | ,range: true |
| | | ,done: function(value, date, endDate){ |
| | | let index = $('#classHours').find('button[checked]').attr('index'); |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | let ii = $(e).parent('div').parent('div').parent('div').parent('div').attr('index'); |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(type == obj.coursePackageDiscount[i].type){ |
| | | let jsonArray = obj.coursePackageDiscount[i].content; |
| | | for (let j = 0; j < jsonArray.length; j++) { |
| | | if(j == ii){ |
| | | let arr = value.split(" - "); |
| | | obj.coursePackageDiscount[i].content[j]['startTime'] = arr[0]; |
| | | obj.coursePackageDiscount[i].content[j]['endTime'] = arr[1]; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | function removePrice(type, e){ |
| | | let index = $('#classHours').find('button[checked]').attr('index'); |
| | | let object = $(e).parent('div').parent('div').parent('div').parent('div'); |
| | | let ii = object.attr('index'); |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(type == obj.coursePackageDiscount[i].type){ |
| | | let jsonArray = null; |
| | | if(typeof obj.coursePackageDiscount[i].content == "string"){ |
| | | jsonArray = JSON.parse(obj.coursePackageDiscount[i].content); |
| | | }else{ |
| | | jsonArray = obj.coursePackageDiscount[i].content; |
| | | } |
| | | |
| | | let arr = []; |
| | | for (let j = 0; j < jsonArray.length; j++) { |
| | | if(j == ii){ |
| | | continue |
| | | } |
| | | arr.push(jsonArray[j]); |
| | | } |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount[i].content = arr; |
| | | } |
| | | } |
| | | object.remove(); |
| | | } |
| | | |
| | | |
| | | function addPriceValue(type, e, name){ |
| | | let index = $('#classHours').find('button[checked]').attr('index'); |
| | | if(type == 1){ |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(type == obj.coursePackageDiscount[i].type){ |
| | | let content = null; |
| | | if(typeof obj.coursePackageDiscount[i].content == "string"){ |
| | | content = JSON.parse(obj.coursePackageDiscount[i].content); |
| | | }else{ |
| | | content = obj.coursePackageDiscount[i].content; |
| | | } |
| | | content[name] = parseFloat($(e).val()); |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount[i].content = content; |
| | | } |
| | | } |
| | | } |
| | | if(type == 2){ |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(type == obj.coursePackageDiscount[i].type){ |
| | | let content = null; |
| | | if(typeof obj.coursePackageDiscount[i].content == "string"){ |
| | | content = JSON.parse(obj.coursePackageDiscount[i].content); |
| | | }else{ |
| | | content = obj.coursePackageDiscount[i].content; |
| | | } |
| | | content[name] = parseFloat($(e).val()); |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount[i].content = content; |
| | | } |
| | | } |
| | | } |
| | | if(type == 3){ |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | let ii = $(e).parent('div').parent('div').parent('div').parent('div').attr('index'); |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(type == obj.coursePackageDiscount[i].type){ |
| | | let jsonArray = null; |
| | | if(typeof obj.coursePackageDiscount[i].content == "string"){ |
| | | jsonArray = JSON.parse(obj.coursePackageDiscount[i].content); |
| | | }else{ |
| | | jsonArray = obj.coursePackageDiscount[i].content; |
| | | } |
| | | |
| | | for (let j = 0; j < jsonArray.length; j++) { |
| | | if(j == ii){ |
| | | if('weeks' == name){ |
| | | let weeks = jsonArray[j].weeks; |
| | | let v = parseInt($(e).val()); |
| | | if(null != weeks && typeof weeks != "undefined"){ |
| | | if(e.checked){ |
| | | weeks.push(v); |
| | | }else{ |
| | | let arr = []; |
| | | for (let k = 0; k < weeks.length; k++) { |
| | | if(weeks[k] == v){ |
| | | continue |
| | | } |
| | | arr.push(weeks[k]); |
| | | } |
| | | weeks = arr; |
| | | } |
| | | }else{ |
| | | weeks = [v]; |
| | | } |
| | | jsonArray[j].weeks = weeks; |
| | | }else{ |
| | | jsonArray[j][name] = parseFloat($(e).val()); |
| | | } |
| | | } |
| | | } |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount[i].content = jsonArray; |
| | | } |
| | | } |
| | | } |
| | | if(type == 4){ |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | let ii = $(e).parent('div').parent('div').parent('div').parent('div').attr('index'); |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(type == obj.coursePackageDiscount[i].type){ |
| | | let jsonArray = null; |
| | | if(typeof obj.coursePackageDiscount[i].content == "string"){ |
| | | jsonArray = JSON.parse(obj.coursePackageDiscount[i].content); |
| | | }else{ |
| | | jsonArray = obj.coursePackageDiscount[i].content; |
| | | } |
| | | for (let j = 0; j < jsonArray.length; j++) { |
| | | if(j == ii){ |
| | | if('weeks' == name){ |
| | | let weeks = jsonArray[j].weeks; |
| | | let v = parseInt($(e).val()); |
| | | if(null != weeks && typeof weeks != "undefined"){ |
| | | if(e.checked){ |
| | | weeks.push(v); |
| | | }else{ |
| | | let arr = []; |
| | | for (let k = 0; k < weeks.length; k++) { |
| | | if(weeks[k] == v){ |
| | | continue |
| | | } |
| | | arr.push(weeks[k]); |
| | | } |
| | | weeks = arr; |
| | | } |
| | | }else{ |
| | | weeks = [v]; |
| | | } |
| | | jsonArray[j].weeks = weeks; |
| | | }else{ |
| | | jsonArray[j][name] = parseFloat($(e).val()); |
| | | } |
| | | } |
| | | } |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount[i].content = jsonArray; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | function selectedPperiod(e){ |
| | | $('#classHours').find('button[checked]').attr('style', 'width: 60px;height: 30px;border: none;border-radius: 5px;'); |
| | | $('#classHours').find('button[checked]').removeAttr('checked'); |
| | | if(typeof e != "undefined"){ |
| | | $(e).attr('style', 'width: 60px;height: 30px;background-color: #0086F6;border: none;border-radius: 5px;color: white;'); |
| | | $(e).attr('checked', true); |
| | | }else{ |
| | | $($('#classHours').find('button')[0]).attr('style', 'width: 60px;height: 30px;background-color: #0086F6;border: none;border-radius: 5px;color: white;'); |
| | | $($('#classHours').find('button')[0]).attr('checked', true); |
| | | } |
| | | |
| | | let index = $('#classHours').find('button[checked]').attr('index'); |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | $('#payment').text(obj.payment); |
| | | $('#cashPayment').text(obj.cashPayment); |
| | | |
| | | $('#memberDiscount').html(''); |
| | | $('#renewalOffer').html(''); |
| | | $('#limitedTimeDiscount').html(''); |
| | | $('#complimentaryClass').html(''); |
| | | let objv = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | $('input[name="type"]').each(function (i, e) { |
| | | e.checked = false; |
| | | let v = $(e).val(); |
| | | for (let i = 0; i < objv.coursePackageDiscount.length; i++) { |
| | | if(v == objv.coursePackageDiscount[i].type){ |
| | | $(e).click(); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | $(function () { |
| | | CoursePackageDiscount.coursePackagePaymentConfig = JSON.parse($('#coursePackagePaymentConfig').val()); |
| | | let htmlStr = ''; |
| | | for (let i = 0; i < CoursePackageDiscount.coursePackagePaymentConfig.length; i++) { |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[i]; |
| | | if(i == 0){ |
| | | htmlStr += '<button checked onclick="selectedPperiod(this)" index="' + i + '" style="width: 60px;height: 30px;background-color: #0086F6;border: none;border-radius: 5px;color: white;">' + obj.classHours + '课时</button> '; |
| | | }else{ |
| | | htmlStr += '<button onclick="selectedPperiod(this)" index="' + i + '" style="width: 60px;height: 30px;border: none;border-radius: 5px;">' + obj.classHours + '课时</button> '; |
| | | } |
| | | } |
| | | $('#classHours').html(htmlStr); |
| | | |
| | | $('input[name="type"]').click(function () { |
| | | let v = $(this).val(); |
| | | let index = $('#classHours').find('button[checked]').attr('index'); |
| | | if(this.checked && v == '1'){ |
| | | let discountMember = true; |
| | | let hh = '<div class="hr-line-dashed"></div>' + |
| | | '<h3>会员折扣</h3>\n' + |
| | | ' <div class="form-group">\n' + |
| | | ' <div class="col-sm-2"></div>'+ |
| | | ' <div class="col-sm-10">' + |
| | | ' <label class="col-sm-2 control-label">*现金支付:</label>\n' + |
| | | ' <div class="col-sm-3">\n' + |
| | | ' <input type="number" min="0" value="'; |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(v == obj.coursePackageDiscount[i].type){ |
| | | let jsonObject = null; |
| | | if(typeof obj.coursePackageDiscount[i].content == "string"){ |
| | | jsonObject = JSON.parse(obj.coursePackageDiscount[i].content); |
| | | }else{ |
| | | jsonObject = obj.coursePackageDiscount[i].content; |
| | | } |
| | | hh += (null == jsonObject.discountMember ? '' : jsonObject.discountMember); |
| | | discountMember = false; |
| | | } |
| | | } |
| | | hh += '" placeholder="请输入会员支付价格" onblur="addPriceValue(1, this, \'discountMember\')" style="width: 180px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/> ¥\n' + |
| | | ' </div>\n' + |
| | | ' </div>'+ |
| | | ' </div>'; |
| | | |
| | | $('#memberDiscount').html(hh); |
| | | if(discountMember){ |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount.push({ |
| | | type: 1, |
| | | content:{ |
| | | discountMember: null |
| | | } |
| | | }); |
| | | } |
| | | }else if(!this.checked && v == '1'){ |
| | | $('#memberDiscount').html(''); |
| | | let datas = CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount; |
| | | let arra = []; |
| | | for (let i = 0; i < datas.length; i++){ |
| | | if(datas[i].type == v){ |
| | | continue; |
| | | } |
| | | arra.push(datas[i]); |
| | | } |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount = arra; |
| | | } |
| | | if(this.checked && v == '2'){ |
| | | let continuingMember = true; |
| | | let hh = '<div class="hr-line-dashed"></div>' + |
| | | '<h3>续课优惠</h3>\n' + |
| | | ' <div class="form-group">\n' + |
| | | ' <div class="col-sm-2"></div>'+ |
| | | ' <div class="col-sm-10">' + |
| | | ' <label class="col-sm-2 control-label">会员续课:</label>\n' + |
| | | ' <div class="col-sm-3">\n' + |
| | | ' </div>\n' + |
| | | ' <label class="col-sm-2 control-label">用户续课:</label>\n' + |
| | | ' <div class="col-sm-3">\n' + |
| | | ' </div>\n' + |
| | | ' </div>'+ |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <div class="col-sm-2"></div>'+ |
| | | ' <div class="col-sm-10">' + |
| | | ' <label class="col-sm-2 control-label">*现金支付:</label>\n' + |
| | | ' <div class="col-sm-3">\n' + |
| | | ' <input type="number" min="0" value="'; |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(v == obj.coursePackageDiscount[i].type){ |
| | | let jsonObject = null; |
| | | if(typeof obj.coursePackageDiscount[i].content == "string"){ |
| | | jsonObject = JSON.parse(obj.coursePackageDiscount[i].content); |
| | | }else{ |
| | | jsonObject = obj.coursePackageDiscount[i].content; |
| | | } |
| | | hh += (null == jsonObject.continuingMember ? '' : jsonObject.continuingMember); |
| | | continuingMember = false; |
| | | } |
| | | } |
| | | hh += '" placeholder="请输入会员支付价格" onblur="addPriceValue(2, this, \'continuingMember\')" style="width: 180px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/> ¥\n' + |
| | | ' </div>\n' + |
| | | ' <label class="col-sm-2 control-label">*现金支付:</label>\n' + |
| | | ' <div class="col-sm-3">\n' + |
| | | ' <input type="number" min="0" value="'; |
| | | let obje = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | for (let i = 0; i < obje.coursePackageDiscount.length; i++) { |
| | | if(v == obje.coursePackageDiscount[i].type){ |
| | | let jsonObject = null; |
| | | if(typeof obje.coursePackageDiscount[i].content == "string"){ |
| | | jsonObject = JSON.parse(obje.coursePackageDiscount[i].content); |
| | | }else{ |
| | | jsonObject = obje.coursePackageDiscount[i].content; |
| | | } |
| | | hh += (null == jsonObject.continuingUser ? '' : jsonObject.continuingUser); |
| | | } |
| | | } |
| | | hh += '" placeholder="请输入用户支付价格" onblur="addPriceValue(2, this, \'continuingUser\')" style="width: 180px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/> ¥\n' + |
| | | ' </div>\n' + |
| | | ' </div>'+ |
| | | ' </div>'; |
| | | $('#renewalOffer').html(hh); |
| | | if(continuingMember){ |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount.push({ |
| | | type: 2, |
| | | content: { |
| | | continuingMember: null, |
| | | continuingUser: null |
| | | } |
| | | }) |
| | | } |
| | | }else if(!this.checked && v == '2'){ |
| | | $('#renewalOffer').html(''); |
| | | let datas = CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount; |
| | | let arra = []; |
| | | for (let i = 0; i < datas.length; i++){ |
| | | if(datas[i].type == v){ |
| | | continue; |
| | | } |
| | | arra.push(datas[i]); |
| | | } |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount = arra; |
| | | } |
| | | if(this.checked && v == '3'){ |
| | | let data_value = true; |
| | | let hh = '<div class="hr-line-dashed"></div>' + |
| | | '<span style="font-size: 16px;font-weight: 500;">限时折扣</span> <i class="fa fa-plus-circle" style="font-size:24px" onclick="addPrice(3)"></i>\n'; |
| | | let obje = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | for (let i = 0; i < obje.coursePackageDiscount.length; i++) { |
| | | if(v == obje.coursePackageDiscount[i].type){ |
| | | data_value = false |
| | | let jsonArray = null; |
| | | if(typeof obje.coursePackageDiscount[i].content == "string"){ |
| | | jsonArray = JSON.parse(obje.coursePackageDiscount[i].content); |
| | | }else{ |
| | | jsonArray = obje.coursePackageDiscount[i].content; |
| | | } |
| | | |
| | | for (let j = 0; j < jsonArray.length; j++) { |
| | | hh += '' + |
| | | ' <div class="form-group limitedTimeDiscount" index="' + j + '">' + |
| | | ' <div class="col-sm-2"></div>\n' + |
| | | ' <div class="col-sm-8" style="border: 1px solid; padding: 20px;">\n' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">折扣有效期:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <input class="startAndEndDay" value="' + (jsonArray[j].startDate + " - " + jsonArray[j].endDate) + '" style="width: 300px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/>' + |
| | | ' </div>\n' + |
| | | ' <div class="col-sm-1"><i class="fa fa-trash-o" style="font-size:24px;color: red;" onclick="removePrice(3, this)"></i></div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*折扣时间:</label>\n' + |
| | | ' <div class="col-sm-5">\n' + |
| | | ' <input class="time" value="' + jsonArray[j].startTime + " - " + jsonArray[j].endTime + '" style="width: 200px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/>\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label"></label>\n' + |
| | | ' <div class="col-sm-8" style="margin-top: 6px;">\n' + |
| | | ' <input type="checkbox" name="week" value="1"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 1){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周一 ' + |
| | | ' <input type="checkbox" name="week" value="2"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 2){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周二 ' + |
| | | ' <input type="checkbox" name="week" value="3"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 3){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周三 ' + |
| | | ' <input type="checkbox" name="week" value="4"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 4){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周四 ' + |
| | | ' <input type="checkbox" name="week" value="5"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 5){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周五 ' + |
| | | ' <input type="checkbox" name="week" value="6"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 6){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周六 ' + |
| | | ' <input type="checkbox" name="week" value="7"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 7){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周日 ' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*现金支付:</label>\n' + |
| | | ' <div class="col-sm-4">\n' + |
| | | ' <input type="number" min="0" value="' + jsonArray[j].cashPayment + '" onblur="addPriceValue(3, this, \'cashPayment\')" placeholder="请输入折扣后支付价格" style="width: 180px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/> ¥\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | ' </div>'; |
| | | } |
| | | |
| | | } |
| | | } |
| | | $('#limitedTimeDiscount').html(hh); |
| | | if(data_value){ |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount.push({ |
| | | type: 3, |
| | | content: [] |
| | | }) |
| | | } |
| | | }else if(!this.checked && v == '3'){ |
| | | $('#limitedTimeDiscount').html(''); |
| | | let datas = CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount; |
| | | let arra = []; |
| | | for (let i = 0; i < datas.length; i++){ |
| | | if(datas[i].type == v){ |
| | | continue; |
| | | } |
| | | arra.push(datas[i]); |
| | | } |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount = arra; |
| | | } |
| | | if(this.checked && v == '4'){ |
| | | let data_value = true; |
| | | let hh = |
| | | '<div class="hr-line-dashed"></div>' + |
| | | '<span style="font-size: 16px;font-weight: 500;">赠送课时</span> <i class="fa fa-plus-circle" style="font-size:24px" onclick="addPrice(4)"></i>\n'; |
| | | let obje = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | for (let i = 0; i < obje.coursePackageDiscount.length; i++) { |
| | | if (v == obje.coursePackageDiscount[i].type) { |
| | | data_value = false; |
| | | let jsonArray = null; |
| | | if(typeof obje.coursePackageDiscount[i].content == "string"){ |
| | | jsonArray = JSON.parse(obje.coursePackageDiscount[i].content); |
| | | }else{ |
| | | jsonArray = obje.coursePackageDiscount[i].content; |
| | | } |
| | | for (let j = 0; j < jsonArray.length; j++) { |
| | | hh += |
| | | ' <div class="form-group complimentaryClass" index="' + j + '">' + |
| | | ' <div class="col-sm-2"></div>\n' + |
| | | ' <div class="col-sm-8" style="border: 1px solid; padding: 20px;">\n' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*赠送有效期:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <input class="startAndEndDay" value="' + (jsonArray[j].startDate + " - " + jsonArray[j].endDate) + '" style="width: 300px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/>' + |
| | | ' </div>\n' + |
| | | ' <div class="col-sm-1"><i class="fa fa-trash-o" style="font-size:24px;color: red;" onclick="removePrice(4, this)"></i></div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*赠送时间:</label>\n' + |
| | | ' <div class="col-sm-5">\n' + |
| | | ' <input class="time" value="' + jsonArray[j].startTime + " - " + jsonArray[j].endTime + '" style="width: 200px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/>\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label"></label>\n' + |
| | | ' <div class="col-sm-8" style="margin-top: 6px;">\n' + |
| | | ' <input type="checkbox" name="week" value="1"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 1){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周一 ' + |
| | | ' <input type="checkbox" name="week" value="2"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 2){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周二 ' + |
| | | ' <input type="checkbox" name="week" value="3"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 3){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周三 ' + |
| | | ' <input type="checkbox" name="week" value="4"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 4){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周四 ' + |
| | | ' <input type="checkbox" name="week" value="5"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 5){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周五 ' + |
| | | ' <input type="checkbox" name="week" value="6"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 6){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周六 ' + |
| | | ' <input type="checkbox" name="week" value="7"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 7){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周日 ' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*赠送课时数:</label>\n' + |
| | | ' <div class="col-sm-4">\n' + |
| | | ' <input type="number" value="' + jsonArray[j].hour + '" onblur="addPriceValue(4, this, \'hour\')" min="0" placeholder="请输入赠送课时数" style="width: 180px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/> ¥\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | ' </div>'; |
| | | } |
| | | } |
| | | } |
| | | $('#complimentaryClass').html(hh); |
| | | if(data_value){ |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount.push({ |
| | | type: 4, |
| | | content: [] |
| | | }) |
| | | } |
| | | }else if(!this.checked && v == '4'){ |
| | | $('#complimentaryClass').html(''); |
| | | let datas = CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount; |
| | | let arra = []; |
| | | for (let i = 0; i < datas.length; i++){ |
| | | if(datas[i].type == v){ |
| | | continue; |
| | | } |
| | | arra.push(datas[i]); |
| | | } |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount = arra; |
| | | } |
| | | }) |
| | | |
| | | |
| | | selectedPperiod(); |
| | | }); |
New file |
| | |
| | | /** |
| | | * 初始化车辆管理详情对话框 |
| | | */ |
| | | var language=1; |
| | | var TCarInfoDlg = { |
| | | 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.addSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | let pCode = $("#pCode").val() |
| | | let cCode = $("#cCode").val() |
| | | let name = $("#name").val() |
| | | let phone = $("#phone").val() |
| | | |
| | | if(pCode==''){ |
| | | Feng.info("请选择省") |
| | | return; |
| | | } |
| | | if(cCode==''){ |
| | | Feng.info("请选择市") |
| | | return; |
| | | } |
| | | if(name==''){ |
| | | Feng.info("管理员姓名不能为空") |
| | | return; |
| | | } |
| | | if(phone==''){ |
| | | Feng.info("管理员手机号不能为空") |
| | | return; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/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.start(); |
| | | } |
| | | |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | TCarInfoDlg.editSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | let pCode = $("#pCode").val() |
| | | let cCode = $("#cCode").val() |
| | | let name = $("#name").val() |
| | | let phone = $("#phone").val() |
| | | |
| | | if(pCode==''){ |
| | | Feng.info("请选择省") |
| | | return; |
| | | } |
| | | if(cCode==''){ |
| | | Feng.info("请选择市") |
| | | return; |
| | | } |
| | | if(name==''){ |
| | | Feng.info("管理员姓名不能为空") |
| | | return; |
| | | } |
| | | if(phone==''){ |
| | | Feng.info("管理员手机号不能为空") |
| | | return; |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/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("id",$("#id").val()); |
| | | ajax.start(); |
| | | } |
| | | |
| | | $(function() { |
| | | Feng.initValidator("carInfoForm", TCarInfoDlg.validateFields); |
| | | // 初始化图片上传 |
| | | var carPhoto = new $WebUpload("carPhoto"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var drivingLicensePhoto = new $WebUpload("drivingLicensePhoto"); |
| | | drivingLicensePhoto.setUploadBarId("progressBar"); |
| | | drivingLicensePhoto.init(); |
| | | }); |
| | | |
| | | /** |
| | | * 选择分公司后执行 |
| | | */ |
| | | 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.brandChange = function (e) { |
| | | var carBrandId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCar/brandChange", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择车辆类型</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Please select the vehicle type</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih Jenis Kendaraan</option>'; |
| | | } |
| | | |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#carModelId").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("carBrandId",carBrandId); |
| | | 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(); |
| | | } |
| | | } |
New file |
| | |
| | | /** |
| | | * 车辆管理管理初始化 |
| | | */ |
| | | var TCompetition = { |
| | | id: "TCompetitionTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | var language =1 |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TCompetition.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '所在省', field: 'pname', visible: true, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '所在市', field: 'cname', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '所属门店', field: 'shopName', visible: true, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '课包名称', field: 'name', visible: true, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '折扣类型', field: 'type', visible: true, align: 'center', valign: 'middle' |
| | | ,formatter:function (data) { |
| | | return{1:"会员折扣",3:"限时折扣",4:"赠送课时"}[data] |
| | | } |
| | | }, |
| | | {title: '状态', field: 'status', visible: true, align: 'center', valign: 'middle' |
| | | ,formatter:function (data) { |
| | | return{1:"待审核",3:"未通过"}[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 () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCity/tCity_add' |
| | | }); |
| | | 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 + '/tCity/tCity_update/' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 删除车辆管理 |
| | | */ |
| | | TCompetition.updateState = function (e) { |
| | | if (this.check()) { |
| | | var id = TCompetition.seItem.id; |
| | | var ajax = new $ax(Feng.ctxPath + "/TDiscount/updateState", function (data) { |
| | | if(data.code==200){ |
| | | Feng.success("操作成功") |
| | | }else { |
| | | Feng.error("操作失败") |
| | | } |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("操作失败") |
| | | TCompetition.table.refresh(); |
| | | }); |
| | | ajax.set("id",id); |
| | | ajax.set("status",e); |
| | | 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.freeze = function () { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/freeze", function (data) { |
| | | Feng.success("冻结成功!"); |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("冻结失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",this.seItem.id); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | TCompetition.audit = function () { |
| | | if (this.check()) { |
| | | var index = layer.load(1,{ |
| | | type: 1 |
| | | , title: '折扣审核' |
| | | , area: ['50%', '50%'] |
| | | , offset: 'auto' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset |
| | | , id: 'layerDemo' //防止重复弹出cge |
| | | , content: '<div class="form-horizontal">' + |
| | | ' <div class="col-sm-11" >' + |
| | | ' <div class="col-sm-11">' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">审核状态:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <input type="radio" name="r1" value="2" checked> 通过 <input type="radio" name="r1" value="3" > 拒绝 '+ |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">拒绝理由:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <textarea id="text" style="width: 460px; height: 138px;"></textarea> '+ |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | '</div>' |
| | | , btn: ['关闭', '保存'] |
| | | , btnAlign: 'c' //按钮居中 |
| | | , shade: 0.5 //不显示遮罩 |
| | | ,load:1 |
| | | , yes: function () { |
| | | layer.closeAll(); |
| | | }, |
| | | btn2:function () { |
| | | let audit = document.querySelector('input[name="r1"]:checked').value; |
| | | let text = $("#text").val() |
| | | if(audit==3){ |
| | | if(text==''){ |
| | | Feng.info("请输入拒绝理由") |
| | | return false; |
| | | } |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/tDiscount/auditDiscount", function (data) { |
| | | if (data.code == 200) { |
| | | Feng.success("操作成功!"); |
| | | window.location.reload(); |
| | | window.parent.layer.closeAll(); |
| | | } else if(data=="repeat"){ |
| | | window.location.reload(); |
| | | window.parent.layer.closeAll(); |
| | | Feng.error("请勿重复操作"); |
| | | }else { |
| | | return Feng.error(data.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("操作失败!") |
| | | window.location.reload(); |
| | | window.parent.layer.closeAll(); |
| | | return Feng.error("操作失败!"); |
| | | }); |
| | | ajax.set("id", TCompetition.seItem.id); |
| | | ajax.set("audit", audit); |
| | | ajax.set("text", text); |
| | | ajax.start(); |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | TCompetition.unfreeze = function () { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/unfreeze", function (data) { |
| | | Feng.success("解冻成功!"); |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("解冻失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",this.seItem.id); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | TCompetition.info = function () { |
| | | console.log(111) |
| | | if (this.check()) { |
| | | let index = layer.open({ |
| | | type: 2, |
| | | title: '折扣详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tDiscount/infoOne?id=' + this.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | 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.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['shopName'] = $("#shopName").val(); |
| | | queryData['type'] = $("type").val(); |
| | | TCompetition.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | TCompetition.resetSearch = function () { |
| | | $("#pCode").val(""); |
| | | $("#cCode").val(""); |
| | | $("#name").val(""); |
| | | $("#type").val(""); |
| | | $("#shopName").val(""); |
| | | TCompetition.search(); |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColunms = TCompetition.initColumn(); |
| | | var table = new BSTable(TCompetition.id, "/tDiscount/listAudit", 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 language=1; |
| | | var TCarInfoDlg = { |
| | | 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.addSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | let pCode = $("#pCode").val() |
| | | let cCode = $("#cCode").val() |
| | | let name = $("#name").val() |
| | | let phone = $("#phone").val() |
| | | |
| | | if(pCode==''){ |
| | | Feng.info("请选择省") |
| | | return; |
| | | } |
| | | if(cCode==''){ |
| | | Feng.info("请选择市") |
| | | return; |
| | | } |
| | | if(name==''){ |
| | | Feng.info("管理员姓名不能为空") |
| | | return; |
| | | } |
| | | if(phone==''){ |
| | | Feng.info("管理员手机号不能为空") |
| | | return; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/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.start(); |
| | | } |
| | | |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | TCarInfoDlg.editSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | let pCode = $("#pCode").val() |
| | | let cCode = $("#cCode").val() |
| | | let name = $("#name").val() |
| | | let phone = $("#phone").val() |
| | | |
| | | if(pCode==''){ |
| | | Feng.info("请选择省") |
| | | return; |
| | | } |
| | | if(cCode==''){ |
| | | Feng.info("请选择市") |
| | | return; |
| | | } |
| | | if(name==''){ |
| | | Feng.info("管理员姓名不能为空") |
| | | return; |
| | | } |
| | | if(phone==''){ |
| | | Feng.info("管理员手机号不能为空") |
| | | return; |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/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("id",$("#id").val()); |
| | | ajax.start(); |
| | | } |
| | | |
| | | $(function() { |
| | | Feng.initValidator("carInfoForm", TCarInfoDlg.validateFields); |
| | | // 初始化图片上传 |
| | | var carPhoto = new $WebUpload("carPhoto"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var drivingLicensePhoto = new $WebUpload("drivingLicensePhoto"); |
| | | drivingLicensePhoto.setUploadBarId("progressBar"); |
| | | drivingLicensePhoto.init(); |
| | | }); |
| | | |
| | | /** |
| | | * 选择分公司后执行 |
| | | */ |
| | | 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.brandChange = function (e) { |
| | | var carBrandId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCar/brandChange", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择车辆类型</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Please select the vehicle type</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih Jenis Kendaraan</option>'; |
| | | } |
| | | |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#carModelId").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("carBrandId",carBrandId); |
| | | 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(); |
| | | } |
| | | } |
| | |
| | | var carPhoto = new $WebUpload("img"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("welfarePicture"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var drivingLicensePhoto = new $WebUpload("drivingLicensePhoto"); |
| | | drivingLicensePhoto.setUploadBarId("progressBar"); |
| | | drivingLicensePhoto.init(); |
| | |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | TCarInfoDlg.oneChange1Next = function (e) { |
| | | console.log(111) |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/onChange1", 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>"; |
| | | }); |
| | | $("#pCode").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",e); |
| | | ajax.start(); |
| | | } |
| | | TCarInfoDlg.oneChange2 = function (e) { |
| | | console.log(111) |
| | | var oneId=$(e).val(); |
| | |
| | | @ResponseBody |
| | | @PostMapping("/listorder") |
| | | public List<Map<String, Object>> listorder(@RequestBody BookingQuery bookingQuery){ |
| | | System.out.println("===bookingQuery===="+bookingQuery); |
| | | return gameService.orderlist(bookingQuery); |
| | | // return game.getId(); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.other.entity.Store; |
| | | import com.dsh.other.entity.TBackRecord; |
| | | import com.dsh.other.entity.TStoreOther; |
| | | import com.dsh.other.entity.TStoreOtherConfigTrue; |
| | | import com.dsh.other.feignclient.model.*; |
| | | import com.dsh.other.model.*; |
| | | import com.dsh.other.service.StoreService; |
| | | import com.dsh.other.service.TStoreOtherConfigTrueService; |
| | | import com.dsh.other.service.TStoreOtherService; |
| | | import com.dsh.other.service.*; |
| | | import com.dsh.other.util.GDMapGeocodingUtil; |
| | | import com.dsh.other.util.ResultUtil; |
| | | import com.dsh.other.util.ToolUtil; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @RestController |
| | | @RequestMapping("") |
| | |
| | | |
| | | @Autowired |
| | | private TStoreOtherService tStoreOtherService; |
| | | |
| | | @Autowired |
| | | private TBackRecordService backRecordService; |
| | | |
| | | /** |
| | | * 根据城市管理员id获取门店 |
| | |
| | | } |
| | | |
| | | |
| | | @PostMapping("/store/addBackRecord") |
| | | public void addBackRecord(@RequestBody String s){ |
| | | TBackRecord tBackRecord = new TBackRecord(); |
| | | String[] split = s.split("_"); |
| | | tBackRecord.setMoney(Double.valueOf(split[0])); |
| | | tBackRecord.setUserId(Integer.valueOf(split[1])); |
| | | tBackRecord.setTime(new Date()); |
| | | backRecordService.save(tBackRecord); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | try { |
| | | List<TStoreOtherConfigTrue> tStoreOtherConfigTrues = new ArrayList<>(); |
| | | |
| | | List<TStoreOther> list = tStoreOtherService.list(new LambdaQueryWrapper<TStoreOther>().eq(TStoreOther::getStoreId, id)); |
| | | List<TStoreOther> list = tStoreOtherService.list(new LambdaQueryWrapper<TStoreOther>().eq(TStoreOther::getStoreId, id).eq(TStoreOther::getState,1)); |
| | | if(list.size()>0){ |
| | | tStoreOtherConfigTrues= tStoreOtherConfigTrueService.list(new LambdaQueryWrapper<TStoreOtherConfigTrue>().eq(TStoreOtherConfigTrue::getPid, list.get(0).getId())); |
| | | tStoreOtherConfigTrues= tStoreOtherConfigTrueService.list(new LambdaQueryWrapper<TStoreOtherConfigTrue>().in(TStoreOtherConfigTrue::getPid, list.stream().map(TStoreOther::getId).collect(Collectors.toList())).eq(TStoreOtherConfigTrue::getState,1)); |
| | | } |
| | | return ResultUtil.success(tStoreOtherConfigTrues); |
| | | }catch (Exception e){ |
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 java.time.LocalDateTime; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 退费记录 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-10-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_back_record") |
| | | public class TBackRecord extends Model<TBackRecord> { |
| | | |
| | | private static final long serialVersionUID=1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @TableField("userId") |
| | | private Integer userId; |
| | | |
| | | private Double money; |
| | | |
| | | private Date time; |
| | | |
| | | |
| | | @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.TBackRecord; |
| | | |
| | | /** |
| | | * <p> |
| | | * 退费记录 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-10-09 |
| | | */ |
| | | public interface TBackRecordMapper extends BaseMapper<TBackRecord> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.other.entity.TBackRecord; |
| | | |
| | | /** |
| | | * <p> |
| | | * 退费记录 服务类 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-10-09 |
| | | */ |
| | | public interface TBackRecordService extends IService<TBackRecord> { |
| | | |
| | | } |
| | |
| | | @Autowired |
| | | private SiteMapper siteMapper; |
| | | |
| | | @Autowired |
| | | private TBackRecordService backRecordService; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | siteBooking.setCancelUserId(uid); |
| | | siteBookingService.updateById(siteBooking); |
| | | |
| | | TBackRecord tBackRecord = new TBackRecord(); |
| | | tBackRecord.setMoney(siteBooking.getPayMoney()); |
| | | tBackRecord.setUserId(siteBooking.getAppUserId()); |
| | | tBackRecord.setTime(new Date()); |
| | | backRecordService.save(tBackRecord); |
| | | |
| | | } |
| | | if(siteBooking.getPayType() == 2){//支付宝 |
| | | Map<String, String> map = payMoneyUtil.aliRefund(siteBooking.getPayOrderNo(), siteBooking.getPayMoney().toString()); |
| | |
| | | userCoupon.setStatus(1); |
| | | userCouponClient.updateUserCoupon(userCoupon); |
| | | } |
| | | |
| | | |
| | | TBackRecord tBackRecord = new TBackRecord(); |
| | | tBackRecord.setMoney(siteBooking.getPayMoney()); |
| | | tBackRecord.setUserId(siteBooking.getAppUserId()); |
| | | tBackRecord.setTime(new Date()); |
| | | backRecordService.save(tBackRecord); |
| | | } |
| | | |
| | | if(siteBooking.getPayType() == 3){//玩湃币 |
New file |
| | |
| | | package com.dsh.other.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.other.entity.TBackRecord; |
| | | import com.dsh.other.mapper.TBackRecordMapper; |
| | | import com.dsh.other.service.TBackRecordService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 退费记录 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-10-09 |
| | | */ |
| | | @Service |
| | | public class TBackRecordServiceImpl extends ServiceImpl<TBackRecordMapper, TBackRecord> implements TBackRecordService { |
| | | |
| | | } |
| | |
| | | FROM t_site_booking bk |
| | | LEFT JOIN t_store st on bk.storeId = st.id |
| | | LEFT JOIN t_site si on bk.siteId = si.id |
| | | <where> |
| | | <if test="provinceCode!=null and provinceCode!= ''"> |
| | | and bk.provinceCode=#{provinceCode} |
| | | </if> |
| | | <if test="cityCode!=null and cityCode!= ''"> |
| | | and bk.cityCode=#{cityCode} |
| | | </if> |
| | | |
| | | <if test="store!=null and store!= ''"> |
| | | and st.name=#{store} |
| | | </if> |
| | | |
| | | <if test="peopleName!=null and peopleName!= ''"> |
| | | and bk.booker=#{peopleName} |
| | | </if> |
| | | |
| | | <if test="phone!=null and phone!= ''"> |
| | | and bk.phone=#{phone} |
| | | </if> |
| | | |
| | | |
| | | <if test="date!=null and date!= ''"> |
| | | and bk.times like concat('%',#{date},'%') </if> |
| | | <if test="payMethod!=null "> |
| | | and bk.payType=#{payMethod} |
| | | </if> |
| | | |
| | | <if test="state!=null "> |
| | | and bk.status=#{state} |
| | | </if> |
| | | |
| | | |
| | | </where> |
| | | |
| | | |
| | | |
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.TBackRecordMapper"> |
| | | |
| | | |
| | | </mapper> |