| | |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 分公司管理控制器 |
| | |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TCompany tCompany,@RequestParam String subArr,String account,String password) { |
| | | public Object add(TCompany tCompany,@RequestParam String subArr,String account,String password,String content) { |
| | | //判断账号是否已存在 |
| | | int count = userService.selectCount(new EntityWrapper<User>().eq("account", account) |
| | | .eq("status",1)); |
| | |
| | | user.setName(tCompany.getName()); |
| | | user.setSex(1); |
| | | userService.insert(user); |
| | | |
| | | // 添加计费规则 |
| | | TSystemPrice tSystemPrice = new TSystemPrice(); |
| | | tSystemPrice.setCompanyId(tCompany.getId()); |
| | | tSystemPrice.setType(2); |
| | | tSystemPrice.setState(1); |
| | | tSystemPrice.setContent(content); |
| | | systemPriceService.insert(tSystemPrice); |
| | | |
| | | //添加经营区域 |
| | | addSocpe(subArr,tCompany.getId()); |
| | |
| | | */ |
| | | @RequestMapping(value = "/addFranchisee") |
| | | @ResponseBody |
| | | public Object addFranchisee(TCompany tCompany,String account,String password) { |
| | | public Object addFranchisee(TCompany tCompany,String account,String password,String content) { |
| | | //判断账号是否已存在 |
| | | int count = userService.selectCount( |
| | | new EntityWrapper<User>().eq("account", account) |
| | |
| | | user.setName(tCompany.getName()); |
| | | user.setSex(1); |
| | | userService.insert(user); |
| | | |
| | | // 添加计费规则 |
| | | TSystemPrice tSystemPrice = new TSystemPrice(); |
| | | tSystemPrice.setCompanyId(tCompany.getId()); |
| | | tSystemPrice.setType(2); |
| | | tSystemPrice.setState(1); |
| | | tSystemPrice.setContent(content); |
| | | systemPriceService.insert(tSystemPrice); |
| | | |
| | | return SUCCESS_TIP; |
| | | } |
| | |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TCompany tCompany,@RequestParam String subArr,String account,String password,Integer userId) { |
| | | public Object update(TCompany tCompany,@RequestParam String subArr,String account,String password,Integer userId,String content) { |
| | | //判断账号 |
| | | User user = userService.selectById(userId); |
| | | if (SinataUtil.isNotEmpty(account) && SinataUtil.isNotEmpty(password)){ |
| | |
| | | tCompanyService.updateById(tCompany); |
| | | user.setName(tCompany.getName()); |
| | | userService.updateById(user); |
| | | |
| | | // 修改计费规则 |
| | | TSystemPrice tSystemPrice = systemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("companyId", tCompany.getId()) |
| | | .eq("type", 2) |
| | | .last("LIMIT 1")); |
| | | if (Objects.nonNull(tSystemPrice)){ |
| | | tSystemPrice.setContent(content); |
| | | systemPriceService.updateById(tSystemPrice); |
| | | } |
| | | |
| | | //添加经营区域 |
| | | addSocpe(subArr,tCompany.getId()); |
| | |
| | | */ |
| | | @RequestMapping(value = "/updateFranchisee") |
| | | @ResponseBody |
| | | public Object updateFranchisee(TCompany tCompany,String account,String password,Integer userId) { |
| | | public Object updateFranchisee(TCompany tCompany,String account,String password,Integer userId,String content) { |
| | | //判断账号 |
| | | User user = userService.selectById(userId); |
| | | if (!user.getAccount().equals(account)){ |
| | |
| | | user.setName(tCompany.getName()); |
| | | userService.updateById(user); |
| | | |
| | | // 修改计费规则 |
| | | TSystemPrice tSystemPrice = systemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("companyId", tCompany.getId()) |
| | | .eq("type", 2) |
| | | .last("LIMIT 1")); |
| | | if (Objects.nonNull(tSystemPrice)){ |
| | | tSystemPrice.setContent(content); |
| | | systemPriceService.updateById(tSystemPrice); |
| | | } |
| | | |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | <div style="float: left;width: 1200px;margin-left: 50px;"> |
| | | <div class="form-group exclusivePriceSettings"> |
| | | <div class="form-group content"> |
| | | <h3 style="color: #377CCD;margin-bottom: 20px;">在线计费规则</h3> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">起步价设置:</label> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group waitFee"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">等待费设置:</label> |
| | | <div class="col-sm-10"> |
| | | 司机到达预约地点 <input type="text" onblur="checkIsMinute(this)" name="num29" id="num29" class="form-control newWidth" placeholder="最多3位数"/> 分钟过后开始收取等待费, |
| | |
| | | </div> |
| | | |
| | | |
| | | <div class="form-group exclusivePriceSettings"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">软件使用费:</label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label"></label> |
| | | <div class="col-sm-5"> |
| | | <div class="col-sm-3"> |
| | | <span class="control-label">订单扣除固定费用</span> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <input type="text" class="form-control" id="fixedDeduction" name="fixedDeduction"> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <span class="control-label">元</span> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-4"> |
| | | <div class="col-sm-3"> |
| | | <span class="control-label">线上下单扣除</span> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <input type="text" class="form-control" id="percentageDeduction" name="percentageDeduction"> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <span class="control-label">%</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label"></label> |
| | | <div class="col-sm-5"> |
| | | <span class="control-label" style="color: #c1c1c1">人工、一键下单、电召订单使用</span> |
| | | </div> |
| | | <div class="col-sm-4"> |
| | | <span class="control-label" style="color: #c1c1c1">线上下单使用</span> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">司机接单限制:</label> |
| | | <div class="col-sm-9"> |
| | | <div class="col-sm-1"> |
| | | <span class="control-label">余额低于</span> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <input type="text" class="form-control" id="driverRestriction" name="driverRestriction"> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <span class="control-label">元不可接单</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">登录账号:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="text" class="form-control" id="account" name="account" > |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">登录密码:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="password" class="form-control" id="password" name="password" > |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="float: left;width: 1200px;margin-left: 50px;"> |
| | | <div class="form-group content"> |
| | | <h3 style="color: #377CCD;margin-bottom: 20px;">在线计费规则</h3> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">起步价设置:</label> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group waitFee"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">等待费设置:</label> |
| | | <div class="col-sm-10"> |
| | | 司机到达预约地点 <input type="text" onblur="checkIsMinute(this)" name="num29" id="num29" class="form-control newWidth" placeholder="最多3位数"/> 分钟过后开始收取等待费, |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">软件使用费:</label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label"></label> |
| | | <div class="col-sm-5"> |
| | | <div class="col-sm-3"> |
| | | <span class="control-label">订单扣除固定费用</span> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <input type="text" class="form-control" id="fixedDeduction" name="fixedDeduction" value="${item.fixedDeduction}"> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <span class="control-label">元</span> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-4"> |
| | | <div class="col-sm-3"> |
| | | <span class="control-label">线上下单扣除</span> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <input type="text" class="form-control" id="percentageDeduction" name="percentageDeduction" value="${item.percentageDeduction}"> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <span class="control-label">%</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label"></label> |
| | | <div class="col-sm-5"> |
| | | <span class="control-label" style="color: #c1c1c1">人工、一键下单、电召订单使用</span> |
| | | </div> |
| | | <div class="col-sm-4"> |
| | | <span class="control-label" style="color: #c1c1c1">线上下单使用</span> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">司机接单限制:</label> |
| | | <div class="col-sm-9"> |
| | | <div class="col-sm-1"> |
| | | <span class="control-label">余额低于</span> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <input type="text" class="form-control" id="driverRestriction" name="driverRestriction" value="${item.driverRestriction}"> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <span class="control-label">元不可接单</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">登录账号:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="text" class="form-control" id="account" name="account" > |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">登录密码:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="password" class="form-control" id="password" name="password" > |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tCompany/franchisee_info.js"></script> |
| | | <script type="text/javascript"> |
| | | laydate.render({ |
| | | elem: '#setupTime' |
| | | }); |
| | | laydate.render({ |
| | | elem: '#licenseTime' |
| | | }); |
| | | laydate.render({ |
| | | elem: '#licenseStartTime' |
| | | }); |
| | | laydate.render({ |
| | | elem: '#licenseEndTime' |
| | | }); |
| | | laydate.render({ |
| | | elem: '.p1 #num14' |
| | | ,type: 'time' |
| | | ,range: '-' |
| | | ,format: 'HH:mm' |
| | | }); |
| | | laydate.render({ |
| | | elem: '.p1 #num21' |
| | | ,type: 'time' |
| | | ,range: '-' |
| | | ,format: 'HH:mm' |
| | | }); |
| | | laydate.render({ |
| | | elem: '.p1 #num22' |
| | | ,type: 'time' |
| | | ,range: '-' |
| | | ,format: 'HH:mm' |
| | | }); |
| | | |
| | | laydate.render({ |
| | | elem: '.p2 #num14' |
| | | ,type: 'time' |
| | | ,range: '-' |
| | | ,format: 'HH:mm' |
| | | }); |
| | | laydate.render({ |
| | | elem: '.p2 #num21' |
| | | ,type: 'time' |
| | | ,range: '-' |
| | | ,format: 'HH:mm' |
| | | }); |
| | | laydate.render({ |
| | | elem: '.p2 #num22' |
| | | ,type: 'time' |
| | | ,range: '-' |
| | | ,format: 'HH:mm' |
| | | }); |
| | | |
| | | laydate.render({ |
| | | elem: '.p3 #num14' |
| | | ,type: 'time' |
| | | ,range: '-' |
| | | ,format: 'HH:mm' |
| | | }); |
| | | laydate.render({ |
| | | elem: '.p3 #num21' |
| | | ,type: 'time' |
| | | ,range: '-' |
| | | ,format: 'HH:mm' |
| | | }); |
| | | laydate.render({ |
| | | elem: '.p3 #num22' |
| | | ,type: 'time' |
| | | ,range: '-' |
| | | ,format: 'HH:mm' |
| | | }); |
| | | |
| | | laydate.render({ |
| | | elem: '.wp1 #num14' |
| | | ,type: 'time' |
| | | ,range: '-' |
| | | ,format: 'HH:mm' |
| | | }); |
| | | laydate.render({ |
| | | elem: '.wp1 #num21' |
| | | ,type: 'time' |
| | | ,range: '-' |
| | | ,format: 'HH:mm' |
| | | }); |
| | | laydate.render({ |
| | | elem: '.wp1 #num22' |
| | | ,type: 'time' |
| | | ,range: '-' |
| | | ,format: 'HH:mm' |
| | | }); |
| | | |
| | | laydate.render({ |
| | | elem: '.wp2 #num14' |
| | | ,type: 'time' |
| | | ,range: '-' |
| | | ,format: 'HH:mm' |
| | | }); |
| | | laydate.render({ |
| | | elem: '.wp2 #num21' |
| | | ,type: 'time' |
| | | ,range: '-' |
| | | ,format: 'HH:mm' |
| | | }); |
| | | laydate.render({ |
| | | elem: '.wp2 #num22' |
| | | ,type: 'time' |
| | | ,range: '-' |
| | | ,format: 'HH:mm' |
| | | }); |
| | | |
| | | laydate.render({ |
| | | elem: '.wp3 #num14' |
| | | ,type: 'time' |
| | | ,range: '-' |
| | | ,format: 'HH:mm' |
| | | }); |
| | | laydate.render({ |
| | | elem: '.wp3 #num21' |
| | | ,type: 'time' |
| | | ,range: '-' |
| | | ,format: 'HH:mm' |
| | | }); |
| | | laydate.render({ |
| | | elem: '.wp3 #num22' |
| | | ,type: 'time' |
| | | ,range: '-' |
| | | ,format: 'HH:mm' |
| | | }); |
| | | |
| | | laydate.render({ |
| | | elem: '.exclusivePriceSettings #num14' |
| | | ,type: 'time' |
| | | ,range: '-' |
| | | ,format: 'HH:mm' |
| | | }); |
| | | laydate.render({ |
| | | elem: '.exclusivePriceSettings #num21' |
| | | ,type: 'time' |
| | | ,range: '-' |
| | | ,format: 'HH:mm' |
| | | }); |
| | | laydate.render({ |
| | | elem: '.exclusivePriceSettings #num22' |
| | | ,type: 'time' |
| | | ,range: '-' |
| | | ,format: 'HH:mm' |
| | | }); |
| | | |
| | | laydate.render({ |
| | | elem: '.onePriceSetting #num14' |
| | | ,type: 'time' |
| | | ,range: '-' |
| | | ,format: 'HH:mm' |
| | | }); |
| | | laydate.render({ |
| | | elem: '.onePriceSetting #num21' |
| | | ,type: 'time' |
| | | ,range: '-' |
| | | ,format: 'HH:mm' |
| | | }); |
| | | laydate.render({ |
| | | elem: '.onePriceSetting #num22' |
| | | ,type: 'time' |
| | | ,range: '-' |
| | | ,format: 'HH:mm' |
| | | }); |
| | | |
| | | var regDouble = /^(0|[1-9]\d{0,2})(\.\d{1,2})?$/; |
| | | var regInt = /^[0-9]{0,3}$/; |
| | | function checkIsYuan(obj){ |
| | | var num = $(obj).val(); |
| | | if(!regDouble.test(num)){ |
| | | layer.msg("【元】输入框不能超过3位数,保留两位小数"); |
| | | $(obj).val(''); |
| | | } |
| | | } |
| | | function checkIsGongLi(obj, clazz){ |
| | | var num = $(obj).val(); |
| | | if(!regDouble.test(num)){ |
| | | layer.msg("【公里】输入框不能超过3位数,保留两位小数"); |
| | | $(obj).val(''); |
| | | } |
| | | if (obj.id == "num7"){ |
| | | $("." + clazz + " #num9").val(num); |
| | | }else if (obj.id == "num10"){ |
| | | $("." + clazz + " #num12").val(num); |
| | | } |
| | | } |
| | | function checkIsMinute(obj){ |
| | | var num = $(obj).val(); |
| | | if(!regInt.test(num)){ |
| | | layer.msg("【分钟】输入框不能超过3位数"); |
| | | $(obj).val(''); |
| | | } |
| | | } |
| | | |
| | | </script> |
| | | @} |
| | |
| | | return |
| | | } |
| | | |
| | | |
| | | var content = '{'; |
| | | //拼接数据 |
| | | $(".content input[type='text']").each(function(){ |
| | | var value = $(this).val(); |
| | | if('' == value){ |
| | | b = true; |
| | | Feng.info("请填写完整配置"); |
| | | return |
| | | } |
| | | content = content + '"'+$(this)[0].name+'":"'+value+'",'; |
| | | }); |
| | | content = content.substring(0,content.length-1); |
| | | content += '}'; |
| | | console.log(content); |
| | | if(b){ |
| | | return |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompany/addFranchisee", function(data){ |
| | | if ("error" == data){ |
| | |
| | | ajax.set("isTaxi",1); |
| | | ajax.set("account",$("#account").val()); |
| | | ajax.set("password",$("#password").val()); |
| | | ajax.set("content",content); |
| | | ajax.start(); |
| | | } |
| | | |
| | |
| | | if(b){ |
| | | return |
| | | } |
| | | |
| | | var content = '{'; |
| | | //拼接数据 |
| | | $(".content input[type='text']").each(function(){ |
| | | var value = $(this).val(); |
| | | if('' == value){ |
| | | b = true; |
| | | Feng.info("请填写完整配置"); |
| | | return |
| | | } |
| | | content = content + '"'+$(this)[0].name+'":"'+value+'",'; |
| | | }); |
| | | content = content.substring(0,content.length-1); |
| | | content += '}'; |
| | | console.log(content); |
| | | if(b){ |
| | | return |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompany/updateFranchisee", function(data){ |
| | |
| | | ajax.set("account",$("#account").val()); |
| | | ajax.set("password",$("#password").val()); |
| | | ajax.set("userId",$("#userId").val()); |
| | | ajax.set("content",content); |
| | | ajax.start(); |
| | | } |
| | | |
| | |
| | | let driverRestriction = $('#driverRestriction').val(); |
| | | regexp(driverRestriction, "司机接单限制") |
| | | |
| | | |
| | | var content = '{'; |
| | | //拼接数据 |
| | | $(".content input[type='text']").each(function(){ |
| | | var value = $(this).val(); |
| | | if('' == value){ |
| | | b = true; |
| | | Feng.info("请填写完整配置"); |
| | | return |
| | | } |
| | | content = content + '"'+$(this)[0].name+'":"'+value+'",'; |
| | | }); |
| | | content = content.substring(0,content.length-1); |
| | | content += '}'; |
| | | console.log(content); |
| | | if(b){ |
| | | return |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompany/add", function(data){ |
| | | if ("error" == data){ |
| | |
| | | ajax.set("subArr",JSON.stringify(subArr)); |
| | | ajax.set("account",$("#account").val()); |
| | | ajax.set("password",$("#password").val()); |
| | | ajax.set("content",content); |
| | | ajax.start(); |
| | | } |
| | | |
| | |
| | | let driverRestriction = $('#driverRestriction').val(); |
| | | regexp(driverRestriction, "司机接单限制") |
| | | |
| | | |
| | | var content = '{'; |
| | | //拼接数据 |
| | | $(".content input[type='text']").each(function(){ |
| | | var value = $(this).val(); |
| | | if('' == value){ |
| | | b = true; |
| | | Feng.info("请填写完整配置"); |
| | | return |
| | | } |
| | | content = content + '"'+$(this)[0].name+'":"'+value+'",'; |
| | | }); |
| | | content = content.substring(0,content.length-1); |
| | | content += '}'; |
| | | console.log(content); |
| | | if(b){ |
| | | return |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompany/update", function(data){ |
| | | if ("error" == data){ |
| | |
| | | ajax.set("account",$("#account").val()); |
| | | ajax.set("password",$("#password").val()); |
| | | ajax.set("userId",$("#userId").val()); |
| | | ajax.set("content",content); |
| | | ajax.start(); |
| | | } |
| | | |