车辆导入开始
This commit is contained in:
@ -26,7 +26,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 车型管理Controller
|
||||
* 车辆管理Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-13
|
||||
@ -50,7 +50,7 @@ public class ZcCarController extends BaseController
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询车型管理列表
|
||||
* 查询车辆管理列表
|
||||
*/
|
||||
@RequiresPermissions("operation:car:list")
|
||||
@PostMapping("/list")
|
||||
@ -63,21 +63,21 @@ public class ZcCarController extends BaseController
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出车型管理列表
|
||||
* 导出车辆管理列表
|
||||
*/
|
||||
@RequiresPermissions("operation:car:export")
|
||||
@Log(title = "车型管理", businessType = BusinessType.EXPORT)
|
||||
@Log(title = "车辆管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(ZcCar zcCar)
|
||||
{
|
||||
List<ZcCar> list = zcCarService.selectZcCarList(zcCar);
|
||||
ExcelUtil<ZcCar> util = new ExcelUtil<ZcCar>(ZcCar.class);
|
||||
return util.exportExcel(list, "车型管理数据");
|
||||
return util.exportExcel(list, "车辆管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增车型管理
|
||||
* 新增车辆管理
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add(ModelMap mmap)
|
||||
@ -89,10 +89,10 @@ public class ZcCarController extends BaseController
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存车型管理
|
||||
* 新增保存车辆管理
|
||||
*/
|
||||
@RequiresPermissions("operation:car:add")
|
||||
@Log(title = "车型管理", businessType = BusinessType.INSERT)
|
||||
@Log(title = "车辆管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(ZcCar zcCar)
|
||||
@ -106,7 +106,7 @@ public class ZcCarController extends BaseController
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改车型管理
|
||||
* 修改车辆管理
|
||||
*/
|
||||
@RequiresPermissions("operation:car:edit")
|
||||
@GetMapping("/edit/{id}")
|
||||
@ -121,7 +121,7 @@ public class ZcCarController extends BaseController
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存车型管理
|
||||
* 修改保存车辆管理
|
||||
*/
|
||||
@RequiresPermissions("operation:car:edit")
|
||||
@Log(title = "车型管理", businessType = BusinessType.UPDATE)
|
||||
@ -138,14 +138,33 @@ public class ZcCarController extends BaseController
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除车型管理
|
||||
* 删除车辆管理
|
||||
*/
|
||||
@RequiresPermissions("operation:car:remove")
|
||||
@Log(title = "车型管理", businessType = BusinessType.DELETE)
|
||||
@Log(title = "车辆管理", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(zcCarService.deleteZcCarByIds(ids));
|
||||
}
|
||||
|
||||
@Log(title = "车辆管理", businessType = BusinessType.UPDATE)
|
||||
@RequiresPermissions("operation:car:edit")
|
||||
@PostMapping("/changeStatus")
|
||||
@ResponseBody
|
||||
public AjaxResult changeStatus(ZcCar zcCar)
|
||||
{
|
||||
return toAjax(zcCarService.changeStatus(zcCar));
|
||||
}
|
||||
|
||||
@RequiresPermissions("operation:car:view")
|
||||
@GetMapping("/importTemplate")
|
||||
@ResponseBody
|
||||
public AjaxResult importTemplate()
|
||||
{
|
||||
ExcelUtil<ZcCar> util = new ExcelUtil<ZcCar>(ZcCar.class);
|
||||
return util.importTemplateExcel("车辆数据");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -180,7 +180,7 @@ public class ZcRentCarRuleController extends BaseController
|
||||
|
||||
|
||||
|
||||
@Log(title = "运营商管理", businessType = BusinessType.UPDATE)
|
||||
@Log(title = "租车计费", businessType = BusinessType.UPDATE)
|
||||
@RequiresPermissions("operation:company:edit")
|
||||
@PostMapping("/changeStatus")
|
||||
@ResponseBody
|
||||
|
||||
@ -66,4 +66,6 @@ public interface IZcCarService
|
||||
* @return 是否唯一 (0:唯一, 1:不唯一)
|
||||
*/
|
||||
String checkVinUnique(ZcCar zcCar);
|
||||
|
||||
public int changeStatus(ZcCar zcCar);
|
||||
}
|
||||
|
||||
@ -106,4 +106,12 @@ public class ZcCarServiceImpl implements IZcCarService
|
||||
}
|
||||
return OperationConstants.USER_VIN_UNIQUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int changeStatus(ZcCar zcCar) {
|
||||
zcCar.setUpdateTime(DateUtils.getNowDate());
|
||||
return zcCarMapper.updateZcCar(zcCar);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -53,9 +53,12 @@
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="operation:car:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="operation:car:export">-->
|
||||
<!-- <i class="fa fa-download"></i> 导出-->
|
||||
<!-- </a>-->
|
||||
<a class="btn btn-info" onclick="$.table.importExcel()" shiro:hasPermission="operation:car:import">
|
||||
<i class="fa fa-upload"></i> 导入
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="operation:car:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
@ -78,6 +81,8 @@
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
importUrl: prefix + "/importData",
|
||||
importTemplateUrl: prefix + "/importTemplate",
|
||||
modalName: "车型管理",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
@ -155,13 +160,47 @@
|
||||
formatter: function(value, row, index) {
|
||||
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>');
|
||||
if (row.status == 1) {
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="enable(\'' + row.id + '\')"><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 + '\')"><i class="fa fa-edit"></i>下架</a> ');
|
||||
}
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
|
||||
/* 下架 */
|
||||
function disable(id) {
|
||||
$.modal.confirm("确认是否下架此车辆?<span style='color: red'>下架后此车辆将在不会显示在用户小程序中</span>", function() {
|
||||
$.operate.post(prefix + "/changeStatus", { "id": id, "status": 1 });
|
||||
})
|
||||
}
|
||||
|
||||
/* 上架 */
|
||||
function enable(id) {
|
||||
$.modal.confirm("请确认是否需要上架此车辆 ?", function() {
|
||||
$.operate.post(prefix + "/changeStatus", { "id": id, "status": 0 });
|
||||
})
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
<!-- 导入区域 -->
|
||||
<script id="importTpl" type="text/template">
|
||||
<form enctype="multipart/form-data" class="mt20 mb10">
|
||||
<div class="col-xs-offset-1">
|
||||
<input type="file" id="file" name="file"/>
|
||||
<div class="mt10 pt5">
|
||||
<a onclick="$.table.importTemplate()" class="btn btn-default btn-xs"><i class="fa fa-file-excel-o"></i> 下载模板</a>
|
||||
</div>
|
||||
<font color="red" class="pull-left mt10">
|
||||
提示:仅允许导入“xls”或“xlsx”格式文件!
|
||||
</font>
|
||||
</div>
|
||||
</form>
|
||||
</script>
|
||||
</html>
|
||||
Reference in New Issue
Block a user