车辆删除还原
This commit is contained in:
@@ -56,9 +56,11 @@ public class CarInfoController extends BaseController
|
||||
*/
|
||||
@RequiresPermissions("system:carInfo:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CarInfo carInfo)
|
||||
{
|
||||
public TableDataInfo list(CarInfo carInfo) {
|
||||
startPage();
|
||||
if (StrUtil.isBlank(carInfo.getDelFlag())) {
|
||||
carInfo.setDelFlag("0");
|
||||
}
|
||||
List<CarInfo> list = carInfoService.selectCarInfoList(carInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@@ -69,8 +71,10 @@ public class CarInfoController extends BaseController
|
||||
@RequiresPermissions("system:carInfo:export")
|
||||
@Log(title = "车辆信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CarInfo carInfo)
|
||||
{
|
||||
public void export(HttpServletResponse response, CarInfo carInfo) {
|
||||
if (StrUtil.isBlank(carInfo.getDelFlag())) {
|
||||
carInfo.setDelFlag("0");
|
||||
}
|
||||
List<CarInfo> list = carInfoService.selectCarInfoList(carInfo);
|
||||
ExcelUtil<CarInfo> util = new ExcelUtil<CarInfo>(CarInfo.class);
|
||||
util.exportExcel(response, list, "车辆信息数据");
|
||||
@@ -190,10 +194,19 @@ public class CarInfoController extends BaseController
|
||||
@DeleteMapping("/{customerIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] customerIds)
|
||||
{
|
||||
//carParkRecordService.deleteCarParkRecordByCustomerIds(customerIds);
|
||||
return toAjax(carInfoService.deleteCarInfoByCustomerIds(customerIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 还原删除车辆信息
|
||||
*/
|
||||
@RequiresPermissions("system:delCarInfo:restore")
|
||||
@Log(title = "车辆还原", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/restore")
|
||||
public AjaxResult restore(@RequestBody List<Long> customerIds) {
|
||||
return toAjax(carInfoService.restore(customerIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取企业模块|菜单权限树
|
||||
*/
|
||||
|
||||
@@ -46,7 +46,7 @@ public class CarParkController extends BaseController
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询车场信息下拉数据
|
||||
* 查询车场信息详情
|
||||
*/
|
||||
@RequiresPermissions("system:carPark:list")
|
||||
@GetMapping("/getCarParkSelect/{id}")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.dcsoft.system.vehicle.mapper;
|
||||
|
||||
import com.dcsoft.system.vehicle.domain.CarInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -63,4 +64,11 @@ public interface CarInfoMapper
|
||||
public CarInfo selectCarInfoByCarNo(String plate);
|
||||
|
||||
CarInfo selectCarInfoByPlate(String plate);
|
||||
/**
|
||||
* 还原删除车辆信息
|
||||
*
|
||||
* @param customerIds 需要还原的车辆信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int restore(@Param("list") List<Long> customerIds);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.dcsoft.system.vehicle.mapper;
|
||||
|
||||
import com.dcsoft.system.vehicle.domain.CarParkRecord;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -62,7 +63,7 @@ public interface CarParkRecordMapper
|
||||
|
||||
public int deleteCarParkRecordByParkId(Long parkId);
|
||||
|
||||
public int deleteCarParkRecordByCustomerIds(Long[] ids);
|
||||
public int deleteCarParkRecordByCustomerIds(@Param("list") List<Long> ids);
|
||||
|
||||
public int deleteCarParkRecordByCustomerId(Long[] ids);
|
||||
|
||||
|
||||
@@ -76,4 +76,11 @@ public interface ICarInfoService
|
||||
String importData(List<CarInfo> userList, boolean updateSupport, String operName);
|
||||
|
||||
CarInfo selectCarInfoByPlate(String plate);
|
||||
/**
|
||||
* 还原删除车辆信息
|
||||
*
|
||||
* @param customerIds 需要还原的车辆信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int restore(List<Long> customerIds);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public interface ICarParkRecordService
|
||||
|
||||
public int deleteCarParkRecordByParkId(Long parkId);
|
||||
|
||||
public int deleteCarParkRecordByCustomerIds(Long[] customerIds);
|
||||
public int deleteCarParkRecordByCustomerIds(List<Long> customerIds);
|
||||
|
||||
public int deleteCarParkRecordByCustomerId(Long customerId);
|
||||
|
||||
|
||||
@@ -330,6 +330,12 @@ public class CarInfoServiceImpl implements ICarInfoService
|
||||
return carInfoMapper.selectCarInfoByPlate(plate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int restore(List<Long> customerIds) {
|
||||
carParkRecordMapper.deleteCarParkRecordByCustomerIds(customerIds);
|
||||
return carInfoMapper.restore(customerIds);
|
||||
}
|
||||
|
||||
public static boolean checkPlateNumberFormat(String content) {
|
||||
String pattern = "([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼]{1}(([A-HJ-Z]{1}[A-HJ-NP-Z0-9]{5})|([A-HJ-Z]{1}(([ADF]{1}[A-HJ-NP-Z0-9]{1}[0-9]{4})|([0-9]{5}[ADF]{1})))|([A-HJ-Z]{1}[A-D0-9]{1}[0-9]{3}警)))|([0-9]{6}使)|((([沪粤川云桂鄂陕蒙藏黑辽渝]{1}A)|鲁B|闽D|蒙E|蒙H)[0-9]{4}领)|(WJ[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼·•]{1}[0-9]{4}[TDSHBXJ0-9]{1})|([VKHBSLJNGCE]{1}[A-DJ-PR-TVY]{1}[0-9]{5})";
|
||||
return Pattern.matches(pattern, content);
|
||||
|
||||
@@ -99,7 +99,7 @@ public class CarParkRecordServiceImpl implements ICarParkRecordService
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteCarParkRecordByCustomerIds(Long[] ids)
|
||||
public int deleteCarParkRecordByCustomerIds(List<Long> ids)
|
||||
{
|
||||
return carParkRecordMapper.deleteCarParkRecordByCustomerIds(ids);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import com.dcsoft.system.vehicle.service.ICarParkService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user