From c743f4413a00fc063bbbd9d851b6d0c3fff10581 Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期一, 31 七月 2023 10:04:02 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- cloud-server-management/src/main/java/com/dsh/course/feignClient/account/CityClient.java | 13 cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCityController.java | 63 ++ cloud-server-account/src/main/java/com/dsh/account/controller/CityController.java | 41 + cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCompetitionController.java | 16 cloud-server-management/src/main/webapp/WEB-INF/view/system/course/course.html | 66 ++ cloud-server-management/src/main/webapp/WEB-INF/view/system/tCity/TCity.html | 30 cloud-server-management/src/main/webapp/WEB-INF/view/system/tCity/TCity_edit.html | 359 +------------- cloud-server-management/src/main/webapp/WEB-INF/view/system/tCoupon/TCouponAdd.html | 48 + cloud-server-management/src/main/webapp/static/modular/system/tCity/tCity_info.js | 110 +-- cloud-server-management/src/main/webapp/WEB-INF/view/login.html | 18 cloud-server-other/src/main/java/com/dsh/other/service/impl/SiteServiceImpl.java | 8 cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCourseController.java | 39 + cloud-server-management/src/main/webapp/static/modular/system/tCity/tCity.js | 72 ++ cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponInfo.js | 204 +++++++- cloud-server-management/src/main/webapp/WEB-INF/view/system/tCity/TCity_add.html | 1 cloud-server-management/src/main/webapp/static/modular/system/course/course.js | 383 +++++++++++++++ 16 files changed, 995 insertions(+), 476 deletions(-) diff --git a/cloud-server-account/src/main/java/com/dsh/account/controller/CityController.java b/cloud-server-account/src/main/java/com/dsh/account/controller/CityController.java index c3d307b..adeae61 100644 --- a/cloud-server-account/src/main/java/com/dsh/account/controller/CityController.java +++ b/cloud-server-account/src/main/java/com/dsh/account/controller/CityController.java @@ -76,4 +76,45 @@ } + @PostMapping("/base/city/getById") + public TCityManager getById(@RequestBody Integer id){ + try { + return cityService.getById(id); + }catch (Exception e){ + e.printStackTrace(); + return null; + } + } + + + @PostMapping("/base/city/update") + public void update(@RequestBody TCityManager manager){ + try { + cityService.updateById(manager); + }catch (Exception e){ + e.printStackTrace(); + } + } + + + @PostMapping("/base/city/freeze") + public void freeze(@RequestBody Integer id){ + try { + TCityManager byId = cityService.getById(id); + byId.setState(2); + cityService.updateById(byId); + }catch (Exception e){ + e.printStackTrace(); + } + } + @PostMapping("/base/city/unfreeze") + public void unfreeze(@RequestBody Integer id){ + try { + TCityManager byId = cityService.getById(id); + byId.setState(1); + cityService.updateById(byId); + }catch (Exception e){ + e.printStackTrace(); + } + } } diff --git a/cloud-server-management/src/main/java/com/dsh/course/feignClient/account/CityClient.java b/cloud-server-management/src/main/java/com/dsh/course/feignClient/account/CityClient.java index c47cd34..320518d 100644 --- a/cloud-server-management/src/main/java/com/dsh/course/feignClient/account/CityClient.java +++ b/cloud-server-management/src/main/java/com/dsh/course/feignClient/account/CityClient.java @@ -14,4 +14,17 @@ @PostMapping("/base/city/add") void add(TCityManager manager); + + @PostMapping("/base/city/getById") + TCityManager getById(Integer id); + + @PostMapping("/base/city/update") + void update(TCityManager manager); + + @PostMapping("/base/city/freeze") + void freeze(Integer id); + @PostMapping("/base/city/unfreeze") + void unfreeze(Integer id); + + } diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCityController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCityController.java index 5aea2e2..40c0273 100644 --- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCityController.java +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCityController.java @@ -80,11 +80,16 @@ /** * 跳转到修改车辆管理 */ - @RequestMapping("/tCompetition_update/{id}") - public String tCarUpdate(@PathVariable Integer id, Model model) { - Competition competition = competitionClient.queryById(id); - model.addAttribute("item",competition); - return PREFIX + "tCompetition_edit.html"; + @RequestMapping("/tCity_update/{id}") + public String tCityUpdate(@PathVariable Integer id, Model model) { + TCityManager byId = cityClient.getById(id); + model.addAttribute("item",byId); + List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); + model.addAttribute("list",list); + TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, byId.getProvinceCode())); + List<TCity> list1 = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId,one.getId() )); + model.addAttribute("list1",list1); + return PREFIX + "tCity_edit.html"; } @@ -118,10 +123,15 @@ } @RequestMapping(value = "/update") - public Object update(Competition competition) { + @ResponseBody + public Object update(TCityManager manager) { try { - competitionClient.update(competition); - return SUCCESS_TIP; + TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, manager.getProvinceCode())); + manager.setProvince(one.getName()); + TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, manager.getCityCode())); + manager.setCity(one1.getName()); + cityClient.update(manager); + return new SuccessTip<>(); }catch (Exception e){ e.printStackTrace(); return ERROR; @@ -151,6 +161,43 @@ } } + @RequestMapping(value = "/freeze") + @ResponseBody + public Object freeze(Integer id) { + try { + cityClient.freeze(id); + return SUCCESS_TIP; + }catch (Exception e){ + e.printStackTrace(); + return ERROR; + } + } + @RequestMapping(value = "/unfreeze") + @ResponseBody + public Object unfreeze(Integer id) { + try { + cityClient.unfreeze(id); + return SUCCESS_TIP; + }catch (Exception e){ + e.printStackTrace(); + return ERROR; + } + } + + @RequestMapping(value = "/pwd") + @ResponseBody + public Object pwd(Integer id) { + try { + TCityManager byId = cityClient.getById(id); + byId.setPassword(SecureUtil.md5("a123456")); + cityClient.update(byId); + return SUCCESS_TIP; + }catch (Exception e){ + e.printStackTrace(); + return ERROR; + } + } + @RequestMapping(value = "/getPeopleFromId") public Object getPeopleFromId(Integer id,Integer state) { try { diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCompetitionController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCompetitionController.java index 2bc4b7c..61958cd 100644 --- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCompetitionController.java +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCompetitionController.java @@ -12,7 +12,9 @@ import com.dsh.guns.core.common.constant.factory.PageFactory; import com.dsh.guns.core.support.HttpKit; import com.dsh.guns.core.util.ToolUtil; +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.IStoreService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -40,6 +42,9 @@ @Autowired private IStoreService storeService; + + @Autowired + private ICityService cityService; /** @@ -146,6 +151,17 @@ } } + @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; + } + } } diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCourseController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCourseController.java new file mode 100644 index 0000000..f299c3b --- /dev/null +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCourseController.java @@ -0,0 +1,39 @@ +package com.dsh.guns.modular.system.controller.code; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; + +/** + * 课程管理 + * @author zhibing.pu + * @Date 2023/7/27 15:54 + */ +@Controller +@RequestMapping("/course") +public class TCourseController { + + private String PREFIX = "/system/course/"; + + + /** + * 跳转到列表页 + * @return + */ + @GetMapping("/showCourseList") + public String showCourseList(){ + return PREFIX + "course.html"; + } + + + /** + * 跳转到添加页 + * @return + */ + @GetMapping("/showAddCourse") + public String showAddCourse(){ + return PREFIX + "course_add.html"; + } + +} diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/login.html b/cloud-server-management/src/main/webapp/WEB-INF/view/login.html index 0bfc1fc..208a418 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/login.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/login.html @@ -70,15 +70,15 @@ <img src="${ctxPath}/img/password.png" /> <input class="itemInput" type="password" name="password" id="password" placeholder="请输入密码" required="" value=""> </div> - <div class="item"> - <img src="${ctxPath}/img/password.png" /> - <div class="col-sm-8" style="padding-left: 0px; width: 40%"> - <input class="form-control" type="text" name="kaptcha" placeholder="请输入验证码" required=""> - </div> - <div class="col-sm-4" style="padding-left: 0px; padding-right: 0px;margin-left: 25%"> - <img src="${ctxPath}/kaptcha" id="kaptcha" width="100%" height="100%"/> - </div> - </div> + <!--<div class="item">--> + <!--<img src="${ctxPath}/img/password.png" />--> + <!--<div class="col-sm-8" style="padding-left: 0px; width: 40%">--> + <!--<input class="form-control" type="text" name="kaptcha" placeholder="请输入验证码" required="">--> + <!--</div>--> + <!--<div class="col-sm-4" style="padding-left: 0px; padding-right: 0px;margin-left: 25%">--> + <!--<img src="${ctxPath}/kaptcha" id="kaptcha" width="100%" height="100%"/>--> + <!--</div>--> + <!--</div>--> <button onclick="login()" class="btn full-width m-b" style="background-color: #0573EA;color: white;">登 录</button> <button type="submit" id="submit" style="display: none;"></button> </p> diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/course/course.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/course/course.html new file mode 100644 index 0000000..b1b637f --- /dev/null +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/course/course.html @@ -0,0 +1,66 @@ +@layout("/common/_container.html"){ +<link rel="stylesheet" href="${ctxPath}/static/js/layui/css/layui.css" media="all"> +<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-lg-10 col-sm-9"> + <div class="row"> + <div class="col-lg-4 col-sm-12"> + <#NameCon id="name" name="搜索" placeholder="帐号/姓名/手机号"/> + </div> + </div> + </div> + <div class="col-lg-2 col-sm-3"> + <div class="row"> + <div class="col-lg-12 col-sm-12"> + <#button name="搜索" icon="fa-search" clickFun="Course.search()"/> + <#button name="重置" icon="fa-trash" clickFun="Course.resetSearch()" space="true"/> + </div> + </div> + </div> + </div> + <div class="hidden-xs" id="managerTableToolbar" role="group"> + @if(shiro.hasPermission("/course/addCourse")){ + <#button name="添加" icon="fa-plus" clickFun="Course.addCourse()"/> + @} + @if(shiro.hasPermission("/course/editCourse")){ + <#button name="编辑" icon="fa-edit" clickFun="Course.editCourse()" space="true"/> + @} + @if(shiro.hasPermission("/course/deleteCourse")){ + <#button name="删除" icon="fa-remove" clickFun="Course.deleteCourse()" space="true"/> + @} + @if(shiro.hasPermission("/course/upCourse")){ + <#button name="上架" icon="fa-refresh" clickFun="Course.upCourse()" space="true"/> + @} + @if(shiro.hasPermission("/course/downCourse")){ + <#button name="下架" icon="fa-warning" clickFun="Course.downCourse()" space="true"/> + @} + @if(shiro.hasPermission("/course/detailsCourse")){ + <#button name="详情" icon="fa-check-circle" clickFun="Course.detailsCourse()" space="true"/> + @} + </div> + <#table id="managerTable"/> + </div> + </div> + </div> + </div> + </div> +</div> +<script src="${ctxPath}/static/modular/system/course/course.js"></script> +<script src="${ctxPath}/static/js/layui/layui.js" charset="utf-8"></script> +<script> + laydate.render({ + elem: '#beginTime' + }); + laydate.render({ + elem: '#endTime' + }); +</script> +@} diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCity/TCity.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCity/TCity.html index e405654..0421340 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCity/TCity.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCity/TCity.html @@ -11,16 +11,32 @@ <div class="col-sm-12"> <div class="row"> <div class="col-sm-3"> - <#SelectCon id="pCode" name="所在省" > - <option value="">全部</option> - @for(obj in list){ - <option value="${obj.code}">${obj.name}</option> - @} - </#SelectCon> + <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="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="name" name="管理员姓名" /> </div> diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCity/TCity_add.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCity/TCity_add.html index 9827bfe..0e0a53c 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCity/TCity_add.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCity/TCity_add.html @@ -4,7 +4,6 @@ <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"> diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCity/TCity_edit.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCity/TCity_edit.html index cd9d62f..1d8f66c 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCity/TCity_edit.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCity/TCity_edit.html @@ -1,350 +1,47 @@ @layout("/common/_container.html"){ <div class="ibox float-e-margins"> <div class="ibox-content"> + <div class="form-horizontal" id="carInfoForm"> - <input type="hidden" id="id" name="id" value="${item.id}"> - - <input type="hidden" id="roleType" name="roleType" value="${roleType}"> - @if(language==1){ - <div class="row"> - <div class="col-sm-11"> - <div class="form-group"> - <label class="col-sm-3 control-label">所属机构:</label> - <div class="col-sm-9" style="display: flex;align-items: center;"> - @if(roleType == 1){ - <div class="radio radio-info radio-inline"> - <input type="radio" id="companyType1" value="1" name="companyType" ${1 == companyType ? 'checked=checked' : ''} onclick="TCarInfoDlg.companyTypeClick(1)"> - <label for="companyType1"> 平台车辆 </label> - </div> - <div class="radio radio-success radio-inline"> - <input type="radio" id="companyTyp2" value="2" name="companyType" ${2 == companyType ? 'checked=checked' : ''} onclick="TCarInfoDlg.companyTypeClick(2)"> - <label for="companyTyp2"> 加盟车辆 </label> - </div> - <select class="form-control companyDiv" id="oneId" onchange="TCarInfoDlg.oneChange(this)" style="width: 200px"> - <option value="">选择所属分公司</option> - @for(obj in companyList!){ - <option value="${obj.id}" ${obj.id == item.companyId ? 'selected=selected' : ''}>${obj.name}</option> - @} - </select> - <select class="form-control companyDiv" id="twoId" style="width: 200px;margin-left: 30px;"> - <option value="">选择所属加盟商</option> - @for(obj in franchiseeList!){ - <option value="${obj.id}" ${obj.id == item.franchiseeId ? 'selected=selected' : ''}>${obj.name}</option> - @} - </select> - @}else if(roleType == 2){ - <span class="control-label">${objectName!}</span> - <select class="form-control" id="franchiseeId" style="width: 200px;margin-left: 30px;"> - <option value="">选择所属加盟商</option> - @for(obj in franchiseeList!){ - <option value="${obj.id}" ${obj.id == item.franchiseeId ? 'selected=selected' : ''}>${obj.name}</option> - @} - </select> - @}else if(roleType == 3){ - <span class="control-label">${objectName!}</span> - @} - </div> - </div> - <div class="form-group"> - <fieldset> - <label class="col-sm-3 control-label">服务模式:</label> - <div class="col-sm-9"> - <div class="checkbox checkbox-success checkbox-inline"> - <input type="checkbox" name="serverBox" id="serverBox1" value="1" ${2 == one ? 'checked=checked' : ''} onclick="TCarInfoDlg.zcServerClick()"> - <label for="serverBox1"> 摩托车 </label> - </div> - <div class="checkbox checkbox-success checkbox-inline"> - <input type="checkbox" name="serverBox" id="serverBox4" value="4" ${2 == four ? 'checked=checked' : ''}> - <label for="serverBox4"> 同城快送 </label> - </div> - </div> - </fieldset> - </div> - <div class="form-group" id="zcModelDiv"> - <label class="col-sm-3 control-label">摩托车车型:</label> - <div class="col-sm-9"> - <select class="form-control" id="zcModel" name="zcModel"> - <option value="">选择车型</option> - @for(obj in zcModelList){ - <option value="${obj.id}" ${obj.id == zcModel ? 'selected=selected' : ''}>${obj.name}</option> - @} - </select> - </div> - </div> - <#select id="carBrandId" name="车辆品牌:" onchange="TCarInfoDlg.brandChange(this)"> - <option value="">选择车辆品牌</option> - @for(obj in brandList){ - <option value="${obj.id}" ${obj.id == item.carBrandId ? 'selected=selected' : ''}>${obj.name}</option> - @} - </#select> - <#select id="carModelId" name="车辆类型:"> - <option value="">选择车辆类型</option> - @for(obj in modelList){ - <option value="${obj.id}" ${obj.id == item.carModelId ? 'selected=selected' : ''}>${obj.name}</option> - @} - </#select> - <#select id="carColor" name="车辆颜色:"> - <option value="">选择车辆颜色</option> - <option value="1" ${'1' == item.carColor ? 'selected=selected' : ''}>黑色</option> - <option value="2" ${'2' == item.carColor ? 'selected=selected' : ''}>银色</option> - <option value="3" ${'3' == item.carColor ? 'selected=selected' : ''}>白色</option> - <option value="4" ${'4' == item.carColor ? 'selected=selected' : ''}>红色</option> - <option value="5" ${'5' == item.carColor ? 'selected=selected' : ''}>黄色</option> - <option value="6" ${'6' == item.carColor ? 'selected=selected' : ''}>橙色</option> - <option value="7" ${'7' == item.carColor ? 'selected=selected' : ''}>蓝色</option> - </#select> - <#input id="carLicensePlate" name="车牌号" value="${item.carLicensePlate}"/> - <#avatar id="carPhoto" name="车辆照片:" avatarImg="${item.carPhoto}"/> - <#input id="drivingLicenseNumber" name="行驶证编号" value="${item.drivingLicenseNumber}"/> - <#avatar id="drivingLicensePhoto" name="行驶证照片:" avatarImg="${item.drivingLicensePhoto}"/> - <#input id="annualInspectionTime" name="年检到期时间" type="text" value="${item.annualInspectionTime}"/> - <#input id="commercialInsuranceTime" name="商业保险到期时间" type="text" value="${item.commercialInsuranceTime}"/> - </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.editSubmit()"/> - <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> - </div> -</div> - @} - @if(language==2){ -<div class="row"> - <div class="col-sm-11"> - <div class="form-group"> - <label class="col-sm-3 control-label">Affiliated organization:</label> - <div class="col-sm-9" style="display: flex;align-items: center;"> - @if(roleType == 1){ - <div class="radio radio-info radio-inline"> - <input type="radio" id="companyType1" value="1" name="companyType" ${1 == companyType ? 'checked=checked' : ''} onclick="TCarInfoDlg.companyTypeClick(1)"> - <label for="companyType1"> Platform vehicle </label> - </div> - <div class="radio radio-success radio-inline"> - <input type="radio" id="companyTyp2" value="2" name="companyType" ${2 == companyType ? 'checked=checked' : ''} onclick="TCarInfoDlg.companyTypeClick(2)"> - <label for="companyTyp2"> Franchised vehicles </label> - </div> - <select class="form-control companyDiv" id="oneId" onchange="TCarInfoDlg.oneChange(this)" style="width: 200px"> - <option value="">Select Branch</option> - @for(obj in companyList!){ - <option value="${obj.id}" ${obj.id == item.companyId ? 'selected=selected' : ''}>${obj.name}</option> - @} - </select> - <select class="form-control companyDiv" id="twoId" style="width: 200px;margin-left: 30px;"> - <option value="">Select the franchisee</option> - @for(obj in franchiseeList!){ - <option value="${obj.id}" ${obj.id == item.franchiseeId ? 'selected=selected' : ''}>${obj.name}</option> - @} - </select> - @}else if(roleType == 2){ - <span class="control-label">${objectName!}</span> - <select class="form-control" id="franchiseeId" style="width: 200px;margin-left: 30px;"> - <option value="">Select the franchisee</option> - @for(obj in franchiseeList!){ - <option value="${obj.id}" ${obj.id == item.franchiseeId ? 'selected=selected' : ''}>${obj.name}</option> - @} - </select> - @}else if(roleType == 3){ - <span class="control-label">${objectName!}</span> - @} - </div> - </div> - <div class="form-group"> - <fieldset> - <label class="col-sm-3 control-label">Service mode:</label> + <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"> - <div class="checkbox checkbox-success checkbox-inline"> - <input type="checkbox" name="serverBox" id="serverBox1" value="1" ${2 == one ? 'checked=checked' : ''} onclick="TCarInfoDlg.zcServerClick()"> - <label for="serverBox1"> motorcycle </label> - </div> - <div class="checkbox checkbox-success checkbox-inline"> - <input type="checkbox" name="serverBox" id="serverBox4" value="4" ${2 == four ? 'checked=checked' : ''}> - <label for="serverBox4"> Intra-city express delivery </label> - </div> + <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> - </fieldset> - </div> - <div class="form-group" id="zcModelDiv"> - <label class="col-sm-3 control-label">Motorcycle model setting:</label> - <div class="col-sm-9"> - <select class="form-control" id="zcModel" name="zcModel"> - <option value="">Select vehicle type</option> - @for(obj in zcModelList){ - <option value="${obj.id}" ${obj.id == zcModel ? 'selected=selected' : ''}>${obj.name}</option> - @} - </select> </div> - </div> - <div class="form-group" id="kcModelDiv"> - <label class="col-sm-3 control-label">Cross city travel model:</label> - <div class="col-sm-9"> - <select class="form-control" id="kcModel" name="kcModel"> - <option value="">Select vehicle type</option> - @for(obj in kcModelList){ - <option value="${obj.id}" ${obj.id == kcModel ? 'selected=selected' : ''}>${obj.name}</option> - @} - </select> - </div> - </div> - <#select id="carBrandId" name="Vehicle brand:" onchange="TCarInfoDlg.brandChange(this)"> - <option value="">Select vehicle brand</option> - @for(obj in brandList){ - <option value="${obj.id}" ${obj.id == item.carBrandId ? 'selected=selected' : ''}>${obj.name}</option> - @} - </#select> - <#select id="carModelId" name="Vehicle type:"> - <option value="">Select vehicle type</option> - @for(obj in modelList){ - <option value="${obj.id}" ${obj.id == item.carModelId ? 'selected=selected' : ''}>${obj.name}</option> - @} -</#select> -<#select id="carColor" name="Vehicle color:"> -<option value="">Select vehicle color</option> -<option value="1" ${'1' == item.carColor ? 'selected=selected' : ''}>black</option> -<option value="2" ${'2' == item.carColor ? 'selected=selected' : ''}>silvery</option> -<option value="3" ${'3' == item.carColor ? 'selected=selected' : ''}>white</option> -<option value="4" ${'4' == item.carColor ? 'selected=selected' : ''}>red</option> -<option value="5" ${'5' == item.carColor ? 'selected=selected' : ''}>yellow</option> -<option value="6" ${'6' == item.carColor ? 'selected=selected' : ''}>orange</option> -<option value="7" ${'7' == item.carColor ? 'selected=selected' : ''}>blue</option> -</#select> -<#input id="carLicensePlate" name="License plate number" value="${item.carLicensePlate}"/> -<#avatar id="carPhoto" name="Vehicle photos:" avatarImg="${item.carPhoto}"/> -<#input id="drivingLicenseNumber" name="Driving license number" value="${item.drivingLicenseNumber}"/> -<#avatar id="drivingLicensePhoto" name="Photo of driving license:" avatarImg="${item.drivingLicensePhoto}"/> -<#input id="annualInspectionTime" name="Annual inspection expiration time" type="text" value="${item.annualInspectionTime}"/> -<#input id="commercialInsuranceTime" name="Expiration time of commercial insurance" type="text" value="${item.commercialInsuranceTime}"/> -</div> -</div> - -<div class="row btn-group-m-t"> - <div class="col-sm-10 col-sm-offset-5"> - <#button btnCss="info" name="Submit" id="ensure" icon="fa-check" clickFun="TCarInfoDlg.editSubmit()"/> - <#button btnCss="danger" name="Cancel" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> - </div> -</div> - @} - @if(language==3){ -<div class="row"> - <div class="col-sm-11"> - <div class="form-group"> - <label class="col-sm-3 control-label">Organisasi Afiliasi:</label> - <div class="col-sm-9" style="display: flex;align-items: center;"> - @if(roleType == 1){ - <div class="radio radio-info radio-inline"> - <input type="radio" id="companyType1" value="1" name="companyType" ${1 == companyType ? 'checked=checked' : ''} onclick="TCarInfoDlg.companyTypeClick(1)"> - <label for="companyType1"> Kendaraan platform </label> - </div> - <div class="radio radio-success radio-inline"> - <input type="radio" id="companyTyp2" value="2" name="companyType" ${2 == companyType ? 'checked=checked' : ''} onclick="TCarInfoDlg.companyTypeClick(2)"> - <label for="companyTyp2"> Kendaraan waralaba </label> - </div> - <select class="form-control companyDiv" id="oneId" onchange="TCarInfoDlg.oneChange(this)" style="width: 200px"> - <option value="">Pilih Branch</option> - @for(obj in companyList!){ - <option value="${obj.id}" ${obj.id == item.companyId ? 'selected=selected' : ''}>${obj.name}</option> - @} - </select> - <select class="form-control companyDiv" id="twoId" style="width: 200px;margin-left: 30px;"> - <option value="">Pilih pemilik franchise</option> - @for(obj in franchiseeList!){ - <option value="${obj.id}" ${obj.id == item.franchiseeId ? 'selected=selected' : ''}>${obj.name}</option> - @} - </select> - @}else if(roleType == 2){ - <span class="control-label">${objectName!}</span> - <select class="form-control" id="franchiseeId" style="width: 200px;margin-left: 30px;"> - <option value="">Pilih pemilik franchise</option> - @for(obj in franchiseeList!){ - <option value="${obj.id}" ${obj.id == item.franchiseeId ? 'selected=selected' : ''}>${obj.name}</option> - @} - </select> - @}else if(roleType == 3){ - <span class="control-label">${objectName!}</span> - @} - </div> - </div> - <div class="form-group"> - <fieldset> - <label class="col-sm-3 control-label">Mode Layanan:</label> + <div class="form-group" id="cityCode"> + <label class="col-sm-3 control-label">所在市:</label> <div class="col-sm-9"> - <div class="checkbox checkbox-success checkbox-inline"> - <input type="checkbox" name="serverBox" id="serverBox1" value="1" ${2 == one ? 'checked=checked' : ''} onclick="TCarInfoDlg.zcServerClick()"> - <label for="serverBox1"> sepeda motor </label> - </div> - <div class="checkbox checkbox-success checkbox-inline"> - <input type="checkbox" name="serverBox" id="serverBox4" value="4" ${2 == four ? 'checked=checked' : ''}> - <label for="serverBox4"> Pengiriman Ekspres Dalam Kota </label> - </div> + <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> - </fieldset> - </div> - <div class="form-group" id="zcModelDiv"> - <label class="col-sm-3 control-label">Pengaturan model sepeda motor:</label> - <div class="col-sm-9"> - <select class="form-control" id="zcModel" name="zcModel"> - <option value="">Pilih Jenis Kendaraan</option> - @for(obj in zcModelList){ - <option value="${obj.id}" ${obj.id == zcModel ? 'selected=selected' : ''}>${obj.name}</option> - @} - </select> </div> + <#input id="name" name="管理员姓名" type="text" value="${item.name}"/> + <#input id="phone" name="管理员手机号" type="text" value="${item.phone}"/> + + </div> - <div class="form-group" id="kcModelDiv"> - <label class="col-sm-3 control-label">Model perjalanan melintasi kota:</label> - <div class="col-sm-9"> - <select class="form-control" id="kcModel" name="kcModel"> - <option value="">Pilih Jenis Kendaraan</option> - @for(obj in kcModelList){ - <option value="${obj.id}" ${obj.id == kcModel ? 'selected=selected' : ''}>${obj.name}</option> - @} - </select> + <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> - <#select id="carBrandId" name="Merek kendaraan:" onchange="TCarInfoDlg.brandChange(this)"> - <option value="">Pilih Merek Kendaraan</option> - @for(obj in brandList){ - <option value="${obj.id}" ${obj.id == item.carBrandId ? 'selected=selected' : ''}>${obj.name}</option> - @} - </#select> - <#select id="carModelId" name="Jenis Kendaraan:"> - <option value="">Pilih Jenis Kendaraan</option> - @for(obj in modelList){ - <option value="${obj.id}" ${obj.id == item.carModelId ? 'selected=selected' : ''}>${obj.name}</option> - @} -</#select> -<#select id="carColor" name="车辆颜色:"> -<option value="">选择车辆颜色</option> -<option value="1" ${'1' == item.carColor ? 'selected=selected' : ''}>hitam</option> -<option value="2" ${'2' == item.carColor ? 'selected=selected' : ''}>perak</option> -<option value="3" ${'3' == item.carColor ? 'selected=selected' : ''}>putih</option> -<option value="4" ${'4' == item.carColor ? 'selected=selected' : ''}>merah</option> -<option value="5" ${'5' == item.carColor ? 'selected=selected' : ''}>kuning</option> -<option value="6" ${'6' == item.carColor ? 'selected=selected' : ''}>oranye</option> -<option value="7" ${'7' == item.carColor ? 'selected=selected' : ''}>biru</option> -</#select> -<#input id="carLicensePlate" name="Nomor plat nomor" value="${item.carLicensePlate}"/> -<#avatar id="carPhoto" name="Foto kendaraan:" avatarImg="${item.carPhoto}"/> -<#input id="drivingLicenseNumber" name="Nomor SIM Mengemudi" value="${item.drivingLicenseNumber}"/> -<#avatar id="drivingLicensePhoto" name="Foto SIM:" avatarImg="${item.drivingLicensePhoto}"/> -<#input id="annualInspectionTime" name="Waktu Kedaluwarsa Inspeksi Tahunan" type="text" value="${item.annualInspectionTime}"/> -<#input id="commercialInsuranceTime" name="Waktu kedaluwarsa asuransi komersial" type="text" value="${item.commercialInsuranceTime}"/> -</div> -</div> - -<div class="row btn-group-m-t"> - <div class="col-sm-10 col-sm-offset-5"> - <#button btnCss="info" name="Kirim" id="ensure" icon="fa-check" clickFun="TCarInfoDlg.editSubmit()"/> - <#button btnCss="danger" name="Batal" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> - </div> -</div> - @} - </div> </div> </div> -<script src="${ctxPath}/modular/system/tCar/tCar_info.js"></script> +<script src="${ctxPath}/modular/system/tCity/tCity_info.js"></script> <script> laydate.render({ elem: '#annualInspectionTime' diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCoupon/TCouponAdd.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCoupon/TCouponAdd.html index 9437e45..33e9063 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCoupon/TCouponAdd.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCoupon/TCouponAdd.html @@ -35,7 +35,7 @@ onclick="radio2()" style="margin-left: 24.7%;"> <label class="col-sm-1" style="margin-left: -17px;width: 20%;">代金券: 可抵</label> - <input class="col-sm-1" id="discountAmount" onkeyup="value=value.replace(/\D/g,'')"/> + <input class="col-sm-1" id="voucherAmount" onkeyup="value=value.replace(/\D/g,'')"/> <label class="col-sm-1">元</label> </div> </div> @@ -67,14 +67,14 @@ <div class="form-group"> <div class="initialLevel col-sm-12 control-label form-group"> <label class="col-sm-3 control-label"><font style="color:red">*</font>发放方式: </label> - <input class="col-sm-1 control-label" onclick="checkCompany()" name="company" type="radio" - value="0" style="margin-top: 10px"/> + <input class="col-sm-1 control-label" onclick="distributionMethod1()" name="distributionMethod" type="radio" + value="1" style="margin-top: 10px"/> <label class="col-sm-1" style="margin-left: -15px;width: 16%;margin-top: 7px">积分购买</label> - <input class="col-sm-1 control-label" name="company" onclick="checkCompany2()" type="radio" - value="1" checked style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/> + <input class="col-sm-1 control-label" name="distributionMethod" onclick="distributionMethod2()" type="radio" + value="2" checked style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/> <label class="col-sm-1" style="width: 16%;margin-top: 7px">注册赠送</label> - <input class="col-sm-1 control-label" name="company" onclick="checkCompany2()" type="radio" - value="1" checked style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px"/> + <input class="col-sm-1 control-label" name="distributionMethod" onclick="distributionMethod3()" type="radio" + value="3" checked style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px"/> <label class="col-sm-1" style="width: 16%;margin-top: 7px">自动发券</label> </div> </div> @@ -86,12 +86,15 @@ <div class="form-group"> <div class="initialLevel col-sm-12 control-label form-group"> <label class="col-sm-3 control-label"><font style="color:red">*</font>兑换方式: </label> - <input class="col-sm-1 control-label" onclick="checkCompany()" name="company" type="radio" - value="0" style="margin-top: 10px"/> + <input class="col-sm-1 control-label" onclick="exchangeMethod1()" name="exchangeMethod" type="radio" + value="1" style="margin-top: 10px"/> <label class="col-sm-1" style="margin-left: -15px;width: 16%;margin-top: 7px">积分</label> - <input class="col-sm-1 control-label" name="company" onclick="checkCompany2()" type="radio" - value="1" checked style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/> + <input class="col-sm-1 control-label" name="exchangeMethod" onclick="exchangeMethod2()" type="radio" + value="2" checked style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/> <label class="col-sm-1" style="width: 20%;margin-top: 7px">现金+积分</label> + <input class="col-sm-1 control-label" name="exchangeMethod" onclick="exchangeMethod3()" type="radio" + value="2" checked style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/> + <label class="col-sm-1" style="width: 20%;margin-top: 7px">现金</label> </div> </div> </div> @@ -120,14 +123,14 @@ <div class="form-group"> <div class="initialLevel col-sm-12 control-label form-group"> <label class="col-sm-3 control-label"><font style="color:red">*</font>用户人群: </label> - <input class="col-sm-1 control-label" onclick="userGroup1()" name="company" type="radio" - value="0" style="margin-top: 10px"/> + <input class="col-sm-1 control-label" onclick="userGroup1()" name="userGroup" type="radio" + value="1" style="margin-top: 10px"/> <label class="col-sm-1" style="margin-left: -15px;width: 16%;margin-top: 7px">全部用户</label> - <input class="col-sm-1 control-label" name="company" onclick="userGroup2()" type="radio" - value="1" checked style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/> + <input class="col-sm-1 control-label" name="userGroup" onclick="userGroup2()" type="radio" + value="2" checked style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/> <label class="col-sm-1" style="width: 16%;margin-top: 7px">年度会员</label> - <input class="col-sm-1 control-label" name="company" onclick="userGroup3()" type="radio" - value="1" checked style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px"/> + <input class="col-sm-1 control-label" name="userGroup" onclick="userGroup3()" type="radio" + value="3" checked style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px"/> <label class="col-sm-1" style="width: 25%;margin-top: -16px">已有学员用户</label> </div> </div> @@ -193,7 +196,7 @@ </div> </div> - <div class="row"> + <div class="row" id="citySelect"> <div class="col-sm-5"> <div class="form-group"> <label class="col-sm-3 control-label"><font style="color:red">*</font>指定城市: </label> @@ -202,11 +205,16 @@ <select id="city"></select> <label class="col-sm-1" style="width: 16%;margin-top: 7px">市</label> <select id="County"></select> - + <div class="col-sm-1"> + <label name="addBranch" class="form-control" onclick="couponInfoDlg.addBranch()" style="border: 0px;cursor: pointer"><i class="fa fa-plus-circle"></i></label> + <label name="addBranch" class="form-control" onclick="couponInfoDlg.delete()" style="border: 0px;cursor: pointer"><i class="fa fa-trash"></i></label> + </div> </div> </div> </div> - <div class="row"> + + + <div class="row" id="storeSelect"> <div class="col-sm-5"> <div class="form-group"> <label class="col-sm-3 control-label"><font style="color:red">*</font>指定门店: </label> diff --git a/cloud-server-management/src/main/webapp/static/modular/system/course/course.js b/cloud-server-management/src/main/webapp/static/modular/system/course/course.js new file mode 100644 index 0000000..d57ed82 --- /dev/null +++ b/cloud-server-management/src/main/webapp/static/modular/system/course/course.js @@ -0,0 +1,383 @@ +/** + * 系统管理--用户管理的单例对象 + */ +var Course = { + id: "managerTable",//表格id + seItem: null, //选中的条目 + table: null, + layerIndex: -1, + deptid:0 +}; +var language =$("#language").val() +/** + * 初始化表格的列 + */ +Course.initColumn = function () { + var columns = [ + {field: 'selectItem', radio: true, + formatter: function (value, row) { + if (row.id == 1) + return { + disabled : true,//设置是否可用 + }; + return ""; + } + }, + {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, + {title: language==1?'账号':(language==2?'Account number':'Nomor akun'), field: 'account', align: 'center', valign: 'middle', sortable: true}, + {title: language==1?'姓名':(language==2?'name':'Nama Lengkap'), field: 'name', align: 'center', valign: 'middle', sortable: true}, + {title: language==1?'性别':(language==2?'Gender':'Jenis kelamin'), field: 'sexName', align: 'center', valign: 'middle', sortable: true, + formatter:function (data) { + if(language==1){ + if(data==1){ + return '男' + }else { + return '女' + } + }else if(language==2){ + if(data==1){ + return 'man' + }else { + return 'woman' + } + }else { + if(data==1){ + return 'laki-laki' + }else { + return 'wanita' + } + } + + } + }, + {title: language==1?'角色':(language==2?'role':'peran'), field: 'roleName', visible: true, align: 'center', valign: 'middle', sortable: true, + formatter: function (value, row) { + var btn = ""; + if(row.roleName != '' && row.roleName != null) { + var labelStr = ""; + var labelStrs = ""; + var labelArray = row.roleName.split(","); + for(var i=0;i<labelArray.length;i++){ + labelStr += labelArray[i] +"<br>"; + labelStrs += labelArray[i] + " "; + } + labelStr = labelStr.substring(0,labelStr.length-4); + labelStrs = labelStrs.substring(0,labelStrs.length-5); + btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + labelStrs + '" onfocus="AppCar.tooltip()">' + labelStr + '</p>'] + } + return btn; + } + }, + {title: language==1?'部门':(language==2?'department':'departemen'), field: 'deptName', align: 'center', valign: 'middle', sortable: true}, + {title: language==1?'邮箱':(language==2?'email':'email'), field: 'email', align: 'center', valign: 'middle', sortable: true}, + {title: language==1?'电话':(language==2?'phone':'Telepon'), field: 'phone', align: 'center', valign: 'middle', sortable: true}, + {title:language==1?'创建时间':(language==2?'Creation time':'Waktu penciptaan'), field: 'createtime', visible: true, align: 'center', valign: 'middle', sortable: true, + formatter: function (value, row) { + var btn = ""; + if(row.createtime1 != '' && row.createtime1 != null) { + var time = row.createtime1.replace(" ",'<br>'); + btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.createtime1 + '" onfocus="AppCar.tooltip()">' + time + '</p>'] + } + return btn; + } + }, + {title: language==1?'状态':(language==2?'State':'Status'), field: 'statusName', visible: true, align: 'center', valign: 'middle', + formatter: function (value, row) { + var btn = ""; + if(row.statusName != '' && row.statusName != null) { + if(language==1){ + if (row.statusName == "2"){ + btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color: red;" title="' + `冻结` + '" onfocus="AppUserInfo.tooltip()">' + 冻结 + '</p>'] + }else{ + btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + `启用` + '" onfocus="AppUserInfo.tooltip()">' + 启用 + '</p>'] + } + }else if(language==2){ + if (row.statusName == "2"){ + btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color: red;" title="' + `freeze` + '" onfocus="AppUserInfo.tooltip()">' + `freeze` + '</p>'] + }else{ + btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + `enable` + '" onfocus="AppUserInfo.tooltip()">' + `enable` + '</p>'] + } + }else { + if (row.statusName == "2"){ + btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color: red;" title="' + `Membekukan` + '" onfocus="AppUserInfo.tooltip()">' + 'Membekukan' + '</p>'] + }else{ + btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + `aktifkan` + '" onfocus="AppUserInfo.tooltip()">' + 'aktifkan' + '</p>'] + } + } + + } + return btn; + } + } + ]; + return columns; +}; + +/** + * 检查是否选中 + */ +Course.check = function () { + var selected = $('#' + this.id).bootstrapTable('getSelections'); + if (selected.length == 0) { + if(language==1){ + Feng.info("请先选中表格中的某一记录!"); + }else if(language==2){ + Feng.info("Please select a record in the table first!"); + }else { + Feng.info("Pilih catatan di tabel terlebih dahulu!"); + } + return false; + } else { + Course.seItem = selected[0]; + return true; + } +}; + +/** + * 点击添加管理员 + */ +Course.addCourse = function () { + var index = layer.open({ + type: 2, + title: '添加', + area: ['800px', '560px'], //宽高 + fix: false, //不固定 + maxmin: true, + content: Feng.ctxPath + '/course/showAddCourse' + }); + this.layerIndex = index; +}; + +/** + * 点击修改按钮时 + * @param userId 管理员id + */ +Course.openChangeUser = function () { + if (this.check()) { + var index = layer.open({ + type: 2, + title: language==1?'编辑':(language==2?'Edit':'Edit'), + area: ['800px', '450px'], //宽高 + fix: false, //不固定 + maxmin: true, + content: Feng.ctxPath + '/mgr/user_edit/' + this.seItem.id + }); + this.layerIndex = index; + } +}; + +/** + * 点击角色分配 + * @param + */ +Course.roleAssign = function () { + if (this.check()) { + var index = layer.open({ + type: 2, + title: language==1?'角色分配':(language==2?'role assignment':'tugas peran'), + area: ['300px', '400px'], //宽高 + fix: false, //不固定 + maxmin: true, + content: Feng.ctxPath + '/mgr/role_assign/' + this.seItem.id + }); + this.layerIndex = index; + } +}; + +/** + * 删除用户 + */ +Course.delCourse = function () { + if (this.check()) { + + var operation = function(){ + var userId = Course.seItem.id; + var ajax = new $ax(Feng.ctxPath + "/mgr/delete", function () { + if(language==1){ + Feng.success("删除成功!"); + }else if(language==2){ + Feng.success("Delete succeeded!"); + }else { + Feng.success("Hapus berhasil!"); + } + Course.table.refresh(); + }, function (data) { + if(language==1){ + Feng.error("删除失败!" + data.responseJSON.message + "!"); + }else if(language==2){ + Feng.error("Delete failed!" + data.responseJSON.message + "!"); + }else { + Feng.error("Hapus gagal!" + data.responseJSON.message + "!"); + } + }); + ajax.set("userId", userId); + ajax.start(); + }; + + if(language==1){ + Feng.confirm("是否删除用户" + Course.seItem.account + "?",operation); + }else if(language==2){ + Feng.confirm("Whether to delete a user" + Course.seItem.account + "?",operation); + }else { + Feng.confirm("Apakah menghapus pengguna" + Course.seItem.account + "?",operation); + } + + } +}; + +/** + * 冻结用户账户 + * @param userId + */ +Course.freezeAccount = function () { + if (this.check()) { + var userId = this.seItem.id; + var ajax = new $ax(Feng.ctxPath + "/mgr/freeze", function (data) { + if(language==1){ + Feng.success("冻结成功!"); + }else if(language==2){ + Feng.success("Success!"); + }else { + Feng.success("Success!"); + } + + Course.table.refresh(); + }, function (data) { + if(language==1){ + Feng.error("冻结失败!" + data.responseJSON.message + "!"); + }else if(language==2){ + Feng.error("Fail!" + data.responseJSON.message + "!"); + }else { + Feng.error("Gagal!" + data.responseJSON.message + "!"); + } + }); + ajax.set("userId", userId); + ajax.start(); + } +}; + +/** + * 解除冻结用户账户 + * @param userId + */ +Course.unfreeze = function () { + if (this.check()) { + var userId = this.seItem.id; + var ajax = new $ax(Feng.ctxPath + "/mgr/unfreeze", function (data) { + if(language==1){ + Feng.success("解除冻结成功!"); + }else if(language==2){ + Feng.success("Success!"); + }else { + Feng.success("Success!"); + } + Course.table.refresh(); + }, function (data) { + if(language==1){ + Feng.error("解除冻结失败!"); + }else if(language==2){ + Feng.error("Fail!"); + }else { + Feng.error("Gagal!"); + } + + }); + ajax.set("userId", userId); + ajax.start(); + } +} + +/** + * 重置密码 + */ +Course.resetPwd = function () { + if (this.check()) { + var userId = this.seItem.id; + if(language==1){ + parent.layer.confirm('是否重置密码为111111?', { + btn: ['确定', '取消'], + shade: false //不显示遮罩 + }, function () { + var ajax = new $ax(Feng.ctxPath + "/mgr/reset", function (data) { + Feng.success("重置密码成功!"); + }, function (data) { + Feng.error("重置密码失败!"); + }); + ajax.set("userId", userId); + ajax.start(); + }); + }else if(language==2){ + parent.layer.confirm('Whether to reset the password to 111111?', { + btn: ['Yes', 'No'], + shade: false //不显示遮罩 + }, function () { + var ajax = new $ax(Feng.ctxPath + "/mgr/reset", function (data) { + Feng.success("Success!"); + }, function (data) { + Feng.error("Fail!"); + }); + ajax.set("userId", userId); + ajax.start(); + }); + }else { + parent.layer.confirm('Apakah untuk reset kata sandi ke 111111?', { + btn: ['Ya', 'batalkan'], + shade: false //不显示遮罩 + }, function () { + var ajax = new $ax(Feng.ctxPath + "/mgr/reset", function (data) { + Feng.success("Success!"); + }, function (data) { + Feng.error("Gagal!"); + }); + ajax.set("userId", userId); + ajax.start(); + }); + } + + } +}; + +Course.resetSearch = function () { + $("#name").val(""); + $("#createTime").val(""); + + Course.search(); +} + +Course.search = function () { + var queryData = {}; + + queryData['deptid'] = Course.deptid; + queryData['name'] = $("#name").val(); + queryData['createTime'] = $("#createTime").val(); + + Course.table.refresh({query: queryData}); +} + +Course.onClickDept = function (e, treeId, treeNode) { + Course.deptid = treeNode.id; + Course.search(); +}; + +$(function () { + var defaultColunms = Course.initColumn(); + var table = new BSTable(Course.id, "/mgr/list", defaultColunms); + // 设置物理分页server(逻辑分页client) + table.setPaginationType("server"); + // 表单提交参数 + var queryData = {}; + queryData['deptid'] = Course.deptid; + queryData['name'] = $("#name").val(); + queryData['createTime'] = $("#createTime").val(); + table.setQueryParams(queryData); + Course.table = table.init(); + + /*var defaultColunms = Course.initColumn(); + var table = new BSTable("managerTable", "/mgr/list", defaultColunms); + table.setPaginationType("client"); + Course.table = table.init();*/ + + var ztree = new $ZTree("deptTree", "/dept/tree"); + ztree.bindOnClick(Course.onClickDept); + ztree.init(); +}); diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tCity/tCity.js b/cloud-server-management/src/main/webapp/static/modular/system/tCity/tCity.js index 86c0720..d2a780e 100644 --- a/cloud-server-management/src/main/webapp/static/modular/system/tCity/tCity.js +++ b/cloud-server-management/src/main/webapp/static/modular/system/tCity/tCity.js @@ -101,7 +101,7 @@ area: ['100%', '100%'], //宽高 fix: false, //不固定 maxmin: true, - content: Feng.ctxPath + '/TCompetition/TCompetition_update/' + TCompetition.seItem.id + content: Feng.ctxPath + '/tCity/tCity_update/' + TCompetition.seItem.id }); this.layerIndex = index; } @@ -151,7 +151,69 @@ }); } }; +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()) { @@ -174,10 +236,18 @@ */ TCompetition.search = function () { var queryData = {}; + queryData['provinceCode'] = $("#pCode").val(); + queryData['cityCode'] = $("#cCode").val(); + queryData['name'] = $("#name").val(); + queryData['phone'] = $("#phone").val(); TCompetition.table.refresh({query: queryData}); }; TCompetition.resetSearch = function () { + $("#pCode").val(""); + $("#cCode").val(""); + $("#name").val(""); + $("#phone").val(""); TCompetition.search(); }; diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tCity/tCity_info.js b/cloud-server-management/src/main/webapp/static/modular/system/tCity/tCity_info.js index 28372a8..fa3be08 100644 --- a/cloud-server-management/src/main/webapp/static/modular/system/tCity/tCity_info.js +++ b/cloud-server-management/src/main/webapp/static/modular/system/tCity/tCity_info.js @@ -116,6 +116,23 @@ 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.code == 200){ @@ -153,63 +170,30 @@ if(!this.validate()){ return ; } + let pCode = $("#pCode").val() + let cCode = $("#cCode").val() + let name = $("#name").val() + let phone = $("#phone").val() - var roleType = $("#roleType").val(); //1=平台 2=分公司 3=加盟商 - var companyType = $("input[name='companyType']:checked").val(); - if (1 == roleType){ - if (2 == companyType){ - var oneId = $("#oneId").val(); - if ("" == oneId){ - if(language==1){ - Feng.info("所属分公司不能为空!"); - }else if(language==2){ - Feng.info("The subordinate branch cannot be empty!"); - }else { - Feng.info("Cabang subordinat tidak dapat kosong!"); - } - return; - } - } - } - var serverBox =[]; - $('input[name="serverBox"]:checked').each(function(){ - serverBox.push($(this).val()); - }); - if (serverBox.length == 0){ - if(language==1){ - Feng.info("请选择经营业务"); - }else if(language==2){ - Feng.info("Please select business"); - }else { - Feng.info("Pilih bisnis"); - } + if(pCode==''){ + Feng.info("请选择省") return; } - var carPhoto = $("#carPhoto").valueOf(); - if ("" == carPhoto){ - if(language==1){ - Feng.info("请上传车辆照片"); - }else if(language==2){ - Feng.info("Please upload a photo of the vehicle"); - }else { - Feng.info("Silakan mengunggah foto kendaraan"); - } + if(cCode==''){ + Feng.info("请选择市") return; } - var drivingLicensePhoto = $("#drivingLicensePhoto").valueOf(); - if ("" == drivingLicensePhoto){ - if(language==1){ - Feng.info("请上传行驶证照片"); - }else if(language==2){ - Feng.info("Please upload a photo of your vehicle. Please upload a photo of your driving license"); - }else { - Feng.info("Silakan mengunggah foto kendaraanmu. Silakan mengunggah foto dari lisensi mengemudi Anda"); - } + if(name==''){ + Feng.info("管理员姓名不能为空") + return; + } + if(phone==''){ + Feng.info("管理员手机号不能为空") return; } //提交信息 - var ajax = new $ax(Feng.ctxPath + "/tCar/update", function(data){ - if(data.status == 200){ + var ajax = new $ax(Feng.ctxPath + "/tCity/update", function(data){ + if(data.code == 200){ if(language==1){ Feng.success("修改成功!"); }else if(language==2){ @@ -217,7 +201,7 @@ }else { Feng.success("Mengubah dengan sukses!"); } - window.parent.TCar.table.refresh(); + window.parent.TCompetition.table.refresh(); TCarInfoDlg.close(); }else{ Feng.error(data.msg); @@ -225,27 +209,11 @@ },function(data){ Feng.error("修改失败!" + data.responseJSON.message + "!"); }); - ajax.set(this.tCarInfoData); - ajax.set("serverBox",serverBox.toString()); - ajax.set("zcModel",$("#zcModel").val()); - ajax.set("kcModel",$("#kcModel").val()); - ajax.set("roleType",roleType); - if (1 == roleType){ - ajax.set("companyType",companyType); - ajax.set("oneId",$("#oneId").val()); - ajax.set("twoId",$("#twoId").val()); - ajax.set("franchiseeId",0); - } else if (2 == roleType) { - ajax.set("franchiseeId",$("#franchiseeId").val()); - ajax.set("companyType",0); - ajax.set("oneId",0); - ajax.set("twoId",0); - }else if (3 == roleType){ - ajax.set("franchiseeId",0); - ajax.set("companyType",0); - ajax.set("oneId",0); - ajax.set("twoId",0); - } + ajax.set("provinceCode",pCode); + ajax.set("cityCode",cCode); + ajax.set("name",name); + ajax.set("phone",phone); + ajax.set("id",$("#id").val()); ajax.start(); } diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponInfo.js b/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponInfo.js index 7cfe71e..61f9153 100644 --- a/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponInfo.js +++ b/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponInfo.js @@ -37,13 +37,13 @@ * 关闭此对话框 */ couponInfoDlg.close = function () { - parent.layer.close(window.parent.CouponServer.layerIndex); + parent.layer.close(window.parent.TCoupon.layerIndex); } function ajax(serverCouponId, value, remark) { var ajax = new $ax(Feng.ctxPath + "/couponServer/examine", function (data) { Feng.success("审核成功!"); - window.parent.CouponServer.table.refresh(); + window.parent.TCoupon.table.refresh(); couponInfoDlg.close(); }, function (data) { Feng.error("审核失败!" + data.responseJSON.message + "!"); @@ -56,43 +56,195 @@ ajax.start(); } -function refush() { - $("#detailBox").show() -} - -function agree() { - $("#detailBox").hide() -} - -function checkCompany() { +/** + * 发放方式1 + */ +function distributionMethod1() { $("#demo2").hide() } -function checkCompany2() { +/** + * 发放方式2 + */ +function distributionMethod2() { + $("#demo2").hide() +} + +/** + * 发放方式3 + */ +function distributionMethod3() { + $("#demo2").hide() +} + + +/** + * 兑换方式1 + */ +function exchangeMethod1() { $("#demo2").show() } +/** + * 兑换方式2 + */ +function exchangeMethod2() { + $("#demo2").show() +} + +/** + * 兑换方式3 + */ +function exchangeMethod3() { + $("#demo2").show() +} + +/** + * 全部用户 + */ +function userGroup1() { + $("#demo2").show() +} + +/** + * 年度会员 + */ +function userGroup2() { + $("#demo2").show() +} + +/** + * 已有学员用户 + */ +function userGroup3() { + $("#demo2").show() +} +/** + * 全国通用 + */ +function scopeOfApplication1() { + $("#storeSelect").hide() + $("#citySelect").hide() +} +/** + * 指定城市 + */ +function scopeOfApplication2() { + $("#demo2").show() +} +/** + * 指定门店 + */ +function scopeOfApplication3() { + $("#demo2").show() +} + +/** + * 满减券 + */ function radio1() { - $("#time").val('') - // document.getElementById("time").readOnly = true; - $("#time").attr('disabled', 'disabled'); - $("#createTime").removeAttr("disabled"); + $("#conditionalAmount").removeAttr("disabled"); + $("#deductionAmount").removeAttr("disabled"); + + $("#voucherAmount").val('') + $("#voucherAmount").attr('disabled', 'disabled'); + + $("#experienceName").val('') + $("#experienceName").attr('disabled', 'disabled'); } +/** + * 代金券 + */ function radio2() { - $("#createTime").val('') - // document.getElementById("time").readOnly = false; - $("#time").removeAttr("disabled"); - $("#createTime").attr('disabled', 'disabled'); + $("#voucherAmount").removeAttr("disabled"); + + $("#conditionalAmount").val('') + $("#deductionAmount").val('') + $("#deductionAmount").attr('disabled', 'disabled'); + $("#conditionalAmount").attr('disabled', 'disabled'); + + $("#experienceName").val('') + $("#experienceName").attr('disabled', 'disabled'); + } +/** + * 体验券 + */ function radio3() { - $("#time").val('') - $("#createTime").val('') - //document.getElementById("createTime").readOnly = true; - // document.getElementById("time").readOnly = true; - $("#createTime").attr('disabled', 'disbled'); - $("#time").attr('disabled', 'disabled'); + $("#experienceName").removeAttr("disabled"); + + $("#conditionalAmount").val('') + $("#deductionAmount").val('') + $("#deductionAmount").attr('disabled', 'disabled'); + $("#conditionalAmount").attr('disabled', 'disabled'); + + $("#voucherAmount").val('') + $("#voucherAmount").attr('disabled', 'disabled'); + +} + + + + +couponInfoDlg.addBranch = function () { + + let companies = []; + let brands = []; + $.ajax({ + url : Feng.ctxPath + "/tbMemberTag/getCompanyAndBranch", + method:'POST', + success:function (res) { + companies = res.companies; + brands = res.brands; + + var str = " <div class=\"col-sm-12\">\n" + + " <label class=\"col-sm-1\">公司</label>\n" + + " <select class=\"col-sm-2\" id=\"brandCompany\" name='brandCompany' style=\"width: 88px\">\n" + + " <option value=\"\">全部公司</option>\n"; + if (companies.length > 0) { + for (let i = 0; i < companies.length; i++) { + str += '<option value="'+companies[i].id+'">'+companies[i].name+'</option>' + } + } + str+= " </select>\n" + + " <label class=\"col-sm-1\">品牌</label>\n" + + " <select class=\"col-sm-2\" id=\"brandName\" name='brandName' style=\"width: 88px\">\n" + + " <option value=\"\">全部品牌</option>\n"; + if (brands.length > 0) { + for (let i = 0; i < brands.length; i++) { + str += '<option value="' + brands[i].id + '">' + brands[i].name + '</option>'; + } + } + str += " </select>\n" + + " <div class=\"col-sm-2\">\n" + + " <input class=\"form-control\" id=\"brandDays\" name='brandDays' placeholder=\"近30天\" type=\"number\" min=\"1\"\n" + + " max=\"31\">\n" + + " </div>\n" + + " <select class=\"col-sm-2\" id=\"brandSymbol\" name='brandSymbol' style=\"width: 88px\">\n" + + " <option value=\"1\"> =</option>\n" + + " <option value=\"2\"> ></option>\n" + + " <option value=\"3\"> <</option>\n" + + " </select>\n" + + " <div class=\"col-sm-2\">\n" + + " <input class=\"form-control\" id=\"brandCount\" name='brandCount' placeholder=\"次\">\n" + + " </div>\n" + + " <div class=\"col-sm-1\">\n" + + " <label id=\"addBranch\" onclick='TbMemberTagInfoDlg.addBranch()' class=\"form-control\" style=\"border: 0px;cursor: pointer\"><i class=\"fa fa-plus\"></i></label>\n" + + " </div>\n" + + " <div class=\"col-sm-1\">\n" + + " <label id=\"addBranch\" onclick='TbMemberTagInfoDlg.subtract(this)' class=\"form-control\" style=\"border: 0px;cursor: pointer\"><i class=\"fa fa-minus\"></i></label>\n" + + " </div>\n" + + " </div>"; + $("#branch").append($(str)); + } + }) +} + + +couponInfoDlg.delete = function () { + } /** diff --git a/cloud-server-other/src/main/java/com/dsh/other/service/impl/SiteServiceImpl.java b/cloud-server-other/src/main/java/com/dsh/other/service/impl/SiteServiceImpl.java index ffb4c34..d482fbb 100644 --- a/cloud-server-other/src/main/java/com/dsh/other/service/impl/SiteServiceImpl.java +++ b/cloud-server-other/src/main/java/com/dsh/other/service/impl/SiteServiceImpl.java @@ -192,7 +192,7 @@ String s_time = split[0]; String e_time = split[split.length - 1]; - s_time = s_time.substring(s_time.lastIndexOf("-")); + s_time = s_time.substring(0,s_time.lastIndexOf("-")); String[] s1 = e_time.split(" "); e_time = s1[0] + " " + s1[1].split("-")[1]; SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm"); @@ -276,7 +276,11 @@ return ResultUtil.success(); } - + public static void main(String[] args) { + String a ="2023-07-28 10:30-15:30"; + String substring = a.substring(0,a.lastIndexOf("-")); + System.out.println(substring); + } /** * 课程微信支付 * @param paymentPrice -- Gitblit v1.7.1