租车套餐
This commit is contained in:
@ -5,11 +5,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.ui.ModelMap;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import com.ruoyi.operation.domain.ZcRentBatteyRule;
|
import com.ruoyi.operation.domain.ZcRentBatteyRule;
|
||||||
@ -124,4 +120,12 @@ public class ZcRentBatteyRuleController extends BaseController
|
|||||||
{
|
{
|
||||||
return toAjax(zcRentBatteyRuleService.deleteZcRentBatteyRuleByIds(ids));
|
return toAjax(zcRentBatteyRuleService.deleteZcRentBatteyRuleByIds(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/list/byLeaseType")
|
||||||
|
@ResponseBody
|
||||||
|
public List<ZcRentBatteyRule> listByLeaseType(@RequestParam("leaseType") Long leaseType) {
|
||||||
|
ZcRentBatteyRule zcRentBatteyRule = new ZcRentBatteyRule();
|
||||||
|
zcRentBatteyRule.setMealType(leaseType);
|
||||||
|
return zcRentBatteyRuleService.selectZcRentBatteyRuleList(zcRentBatteyRule);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -150,6 +150,16 @@ public class ZcRentCarRuleController extends BaseController
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Log(title = "运营商管理", businessType = BusinessType.UPDATE)
|
||||||
|
@RequiresPermissions("operation:company:edit")
|
||||||
|
@PostMapping("/changeStatus")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult changeStatus(ZcRentCarRule zcRentCarRule)
|
||||||
|
{
|
||||||
|
return toAjax(zcRentCarRuleService.changeStatus(zcRentCarRule));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static String generateTimestampBasedCode() {
|
public static String generateTimestampBasedCode() {
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
// 获取当前时间戳的后6位
|
// 获取当前时间戳的后6位
|
||||||
|
|||||||
@ -77,11 +77,11 @@ public class CompanyStore extends BaseEntity
|
|||||||
|
|
||||||
/** 纬度 */
|
/** 纬度 */
|
||||||
@Excel(name = "纬度")
|
@Excel(name = "纬度")
|
||||||
private String latitude;
|
private double latitude;
|
||||||
|
|
||||||
/** 经度 */
|
/** 经度 */
|
||||||
@Excel(name = "经度")
|
@Excel(name = "经度")
|
||||||
private String longitude;
|
private double longitude;
|
||||||
|
|
||||||
/** 合同签订日期 */
|
/** 合同签订日期 */
|
||||||
@Excel(name = "合同签订日期")
|
@Excel(name = "合同签订日期")
|
||||||
@ -329,21 +329,21 @@ public class CompanyStore extends BaseEntity
|
|||||||
{
|
{
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
public void setLatitude(String latitude)
|
public void setLatitude(double latitude)
|
||||||
{
|
{
|
||||||
this.latitude = latitude;
|
this.latitude = latitude;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLatitude()
|
public double getLatitude()
|
||||||
{
|
{
|
||||||
return latitude;
|
return latitude;
|
||||||
}
|
}
|
||||||
public void setLongitude(String longitude)
|
public void setLongitude(double longitude)
|
||||||
{
|
{
|
||||||
this.longitude = longitude;
|
this.longitude = longitude;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLongitude()
|
public double getLongitude()
|
||||||
{
|
{
|
||||||
return longitude;
|
return longitude;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package com.ruoyi.operation.service;
|
package com.ruoyi.operation.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.ruoyi.operation.domain.ZcRentCarRule;
|
import com.ruoyi.operation.domain.ZcRentCarRule;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -58,4 +59,6 @@ public interface IZcRentCarRuleService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteZcRentCarRuleById(Long id);
|
public int deleteZcRentCarRuleById(Long id);
|
||||||
|
|
||||||
|
public int changeStatus(ZcRentCarRule zcRentCarRule);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -95,4 +95,10 @@ public class ZcRentCarRuleServiceImpl implements IZcRentCarRuleService
|
|||||||
{
|
{
|
||||||
return zcRentCarRuleMapper.deleteZcRentCarRuleById(id);
|
return zcRentCarRuleMapper.deleteZcRentCarRuleById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int changeStatus(ZcRentCarRule zcRentCarRule) {
|
||||||
|
zcRentCarRule.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return zcRentCarRuleMapper.updateZcRentCarRule(zcRentCarRule);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1145,6 +1145,11 @@ var table = {
|
|||||||
table.set();
|
table.set();
|
||||||
$.modal.open("添加" + table.options.modalName, $.operate.addUrl(id));
|
$.modal.open("添加" + table.options.modalName, $.operate.addUrl(id));
|
||||||
},
|
},
|
||||||
|
// 添加自定义
|
||||||
|
addCustomize: function(id,width,height) {
|
||||||
|
table.set();
|
||||||
|
$.modal.open("添加" + table.options.modalName, $.operate.addUrl(id),width,height);
|
||||||
|
},
|
||||||
// 添加信息,以tab页展现
|
// 添加信息,以tab页展现
|
||||||
addTab: function (id) {
|
addTab: function (id) {
|
||||||
table.set();
|
table.set();
|
||||||
|
|||||||
@ -89,12 +89,19 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label is-required">租电套餐:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<div id="batteryRuleList"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<th:block th:include="include :: footer" />
|
<th:block th:include="include :: footer" />
|
||||||
<script th:inline="javascript">
|
<script th:inline="javascript">
|
||||||
var prefix = ctx + "operation/rentCarRule"
|
var prefix = ctx + "operation/rentCarRule"
|
||||||
|
var prefix2 = ctx + "operation/rentBatteyRule"
|
||||||
$("#form-rentCarRule-add").validate({
|
$("#form-rentCarRule-add").validate({
|
||||||
rules:{
|
rules:{
|
||||||
rentalPrice:{
|
rentalPrice:{
|
||||||
@ -110,6 +117,52 @@
|
|||||||
focusCleanup: true
|
focusCleanup: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
// 初始隐藏租赁天数
|
||||||
|
var $rentalDaysGroup = $('input[name="rentalDays"]').closest('.form-group').hide();
|
||||||
|
|
||||||
|
// 保存当前选中的值
|
||||||
|
var currentRentalType = $('input[name="rentalType"]:checked').val();
|
||||||
|
|
||||||
|
// 检查初始选中项
|
||||||
|
if(currentRentalType === '3') {
|
||||||
|
$rentalDaysGroup.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 监听单选按钮变化
|
||||||
|
$('input[name="rentalType"]').change(function() {
|
||||||
|
var newRentalType = $(this).val();
|
||||||
|
|
||||||
|
// 如果新值和当前值相同,则不处理
|
||||||
|
if(newRentalType === currentRentalType) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新当前值
|
||||||
|
currentRentalType = newRentalType;
|
||||||
|
|
||||||
|
// 处理租赁天数显示/隐藏
|
||||||
|
if(newRentalType === '3') {
|
||||||
|
$rentalDaysGroup.show();
|
||||||
|
} else {
|
||||||
|
$rentalDaysGroup.hide().find('input').val('');
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清空规则列表
|
||||||
|
$('#batteryRuleList').empty();
|
||||||
|
|
||||||
|
// 只有选择了有效值才加载数据
|
||||||
|
if(newRentalType) {
|
||||||
|
$.get(prefix2 + '/list/byLeaseType', { leaseType: newRentalType }, function(data) {
|
||||||
|
var html = '';
|
||||||
|
data.forEach(function(rule) {
|
||||||
|
html += `<div class="checkbox"><label><input type="checkbox" name="batteryRules" value="${rule.id}"> ${rule.title}</label></div>`;
|
||||||
|
});
|
||||||
|
$('#batteryRuleList').html(html);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
function submitHandler() {
|
function submitHandler() {
|
||||||
if ($.validate.form()) {
|
if ($.validate.form()) {
|
||||||
$.operate.save(prefix + "/add", $('#form-rentCarRule-add').serialize());
|
$.operate.save(prefix + "/add", $('#form-rentCarRule-add').serialize());
|
||||||
|
|||||||
@ -90,7 +90,12 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label is-required">租电套餐:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<div id="batteryRuleList"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@ -112,6 +117,26 @@
|
|||||||
focusCleanup: true
|
focusCleanup: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
// 初始隐藏租赁天数
|
||||||
|
$('input[name="rentalDays"]').closest('.form-group').hide();
|
||||||
|
|
||||||
|
// 监听单选按钮变化
|
||||||
|
$('input[name="rentalType"]').change(function() {
|
||||||
|
if($(this).val() === '3') {
|
||||||
|
$('input[name="rentalDays"]').closest('.form-group').show();
|
||||||
|
} else {
|
||||||
|
$('input[name="rentalDays"]').closest('.form-group').hide().find('input').val('');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 检查初始选中项
|
||||||
|
if($('input[name="rentalType"]:checked').val() === '3') {
|
||||||
|
$('input[name="rentalDays"]').closest('.form-group').show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
function submitHandler() {
|
function submitHandler() {
|
||||||
if ($.validate.form()) {
|
if ($.validate.form()) {
|
||||||
$.operate.save(prefix + "/edit", $('#form-rentCarRule-edit').serialize());
|
$.operate.save(prefix + "/edit", $('#form-rentCarRule-edit').serialize());
|
||||||
|
|||||||
@ -66,12 +66,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="btn-group-sm" id="toolbar" role="group">
|
<div class="btn-group-sm" id="toolbar" role="group">
|
||||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="operation:rentCarRule:add">
|
<a class="btn btn-success" onclick="$.operate.addCustomize(null,900,700)" shiro:hasPermission="operation:rentCarRule:add">
|
||||||
<i class="fa fa-plus"></i> 添加
|
<i class="fa fa-plus"></i> 添加
|
||||||
</a>
|
</a>
|
||||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="operation:rentCarRule:edit">
|
|
||||||
<i class="fa fa-edit"></i> 修改
|
|
||||||
</a>
|
|
||||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="operation:rentCarRule:remove">
|
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="operation:rentCarRule:remove">
|
||||||
<i class="fa fa-remove"></i> 删除
|
<i class="fa fa-remove"></i> 删除
|
||||||
</a>
|
</a>
|
||||||
@ -92,6 +89,7 @@
|
|||||||
var overdueTypeDatas = [[${@dict.getType('key_rent_overdue_type')}]];
|
var overdueTypeDatas = [[${@dict.getType('key_rent_overdue_type')}]];
|
||||||
var depositFreeDatas = [[${@dict.getType('key_rent_deposit_free')}]];
|
var depositFreeDatas = [[${@dict.getType('key_rent_deposit_free')}]];
|
||||||
var autoDeductDatas = [[${@dict.getType('key_rent_auto_deduct')}]];
|
var autoDeductDatas = [[${@dict.getType('key_rent_auto_deduct')}]];
|
||||||
|
var keyCompanyStatus = [[${@dict.getType('key_company_status')}]];
|
||||||
var prefix = ctx + "operation/rentCarRule";
|
var prefix = ctx + "operation/rentCarRule";
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
@ -168,7 +166,10 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'status',
|
field: 'status',
|
||||||
title: '状态'
|
title: '状态',
|
||||||
|
formatter: function(value, row, index) {
|
||||||
|
return $.table.selectDictLabel(keyCompanyStatus, value);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'operatingCompanyName',
|
field: 'operatingCompanyName',
|
||||||
@ -179,14 +180,33 @@
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
formatter: function(value, row, index) {
|
formatter: function(value, row, index) {
|
||||||
var actions = [];
|
var actions = [];
|
||||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
// actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + ' btnOption" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + ' btnOption" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||||
|
if (row.status == 1) {
|
||||||
|
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="enable(\'' + row.id + '\',\'' + row.phone + '\')"><i class="fa fa-edit"></i>启用</a> ');
|
||||||
|
} else {
|
||||||
|
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="disable(\'' + row.id + '\',\'' + row.phone + '\')"><i class="fa fa-edit"></i>停用</a> ');
|
||||||
|
}
|
||||||
return actions.join('');
|
return actions.join('');
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
$.table.init(options);
|
$.table.init(options);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* 停用 */
|
||||||
|
function disable(id,phone) {
|
||||||
|
$.modal.confirm("确认是否停用该套餐?<span style='color: red'>此套餐停用后正在租用订单继续生效,续租订单继续以原订单为准</span>", function() {
|
||||||
|
$.operate.post(prefix + "/changeStatus", { "id": id, "status": 1 });
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 启用 */
|
||||||
|
function enable(id,phone) {
|
||||||
|
$.modal.confirm("确认是否启用该套餐?", function() {
|
||||||
|
$.operate.post(prefix + "/changeStatus", { "id": id, "status": 0 });
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@ -206,6 +206,14 @@
|
|||||||
var prefix = ctx + "operation/store"
|
var prefix = ctx + "operation/store"
|
||||||
var areaPrefix = ctx + "system/areaHn";
|
var areaPrefix = ctx + "system/areaHn";
|
||||||
$("#form-store-add").validate({
|
$("#form-store-add").validate({
|
||||||
|
rules:{
|
||||||
|
latitude:{
|
||||||
|
number:true
|
||||||
|
},
|
||||||
|
longitude:{
|
||||||
|
number:true
|
||||||
|
}
|
||||||
|
},
|
||||||
focusCleanup: true
|
focusCleanup: true
|
||||||
});
|
});
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
|||||||
@ -207,6 +207,14 @@
|
|||||||
var prefix = ctx + "operation/store"
|
var prefix = ctx + "operation/store"
|
||||||
var areaPrefix = ctx + "system/areaHn";
|
var areaPrefix = ctx + "system/areaHn";
|
||||||
$("#form-store-add").validate({
|
$("#form-store-add").validate({
|
||||||
|
rules:{
|
||||||
|
latitude:{
|
||||||
|
number:true
|
||||||
|
},
|
||||||
|
longitude:{
|
||||||
|
number:true
|
||||||
|
}
|
||||||
|
},
|
||||||
focusCleanup: true
|
focusCleanup: true
|
||||||
});
|
});
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user