救援集成3/5

This commit is contained in:
xiao-fajia 2024-08-22 21:17:58 +08:00
parent 3d4f5c71ee
commit 0e7638df23
15 changed files with 304 additions and 165 deletions

View File

@ -6,6 +6,8 @@ import cn.iocoder.yudao.module.rescue.core.page.TableDataInfo;
import cn.iocoder.yudao.module.rescue.domain.RescueCarSpend;
import cn.iocoder.yudao.module.rescue.service.IRescueCarSpendService;
import cn.iocoder.yudao.module.rescue.utils.ExcelUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@ -28,22 +30,24 @@ public class RescueCarSpendController extends BaseController {
/**
* 查询车辆消费管理列表
*/
@PreAuthorize("@ss.hasPermi('rescue:rescueCarSpend:list')")
@PreAuthorize("@ss.hasPermission('rescue:rescueCarSpend:list')")
@GetMapping("/list")
public TableDataInfo list(RescueCarSpend rescueCarSpend) {
startPage();
List<RescueCarSpend> list = rescueCarSpendService.selectRescueCarSpendList(rescueCarSpend);
return getDataTable(list);
public CommonResult list(RescueCarSpend rescueCarSpend,
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
Page<RescueCarSpend> page = new Page<>(pageNo, pageSize);
IPage<RescueCarSpend> list = rescueCarSpendService.selectRescueCarSpendList(rescueCarSpend, page);
return success(list);
}
/**
* 导出车辆消费管理列表
*/
@PreAuthorize("@ss.hasPermi('rescue:rescueCarSpend:export')")
@PreAuthorize("@ss.hasPermission('rescue:rescueCarSpend:export')")
// @Log(title = "车辆消费管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, RescueCarSpend rescueCarSpend) {
List<RescueCarSpend> list = rescueCarSpendService.selectRescueCarSpendList(rescueCarSpend);
List<RescueCarSpend> list = rescueCarSpendService.list();
ExcelUtil<RescueCarSpend> util = new ExcelUtil<RescueCarSpend>(RescueCarSpend.class);
util.exportExcel(response, list, "车辆消费管理数据");
}
@ -51,7 +55,7 @@ public class RescueCarSpendController extends BaseController {
/**
* 获取车辆消费管理详细信息
*/
@PreAuthorize("@ss.hasPermi('rescue:rescueCarSpend:query')")
@PreAuthorize("@ss.hasPermission('rescue:rescueCarSpend:query')")
@GetMapping(value = "/{id}")
public CommonResult getInfo(@PathVariable("id") Long id) {
return success(rescueCarSpendService.selectRescueCarSpendById(id));
@ -60,7 +64,7 @@ public class RescueCarSpendController extends BaseController {
/**
* 新增车辆消费管理
*/
@PreAuthorize("@ss.hasPermi('rescue:rescueCarSpend:add')")
@PreAuthorize("@ss.hasPermission('rescue:rescueCarSpend:add')")
// @Log(title = "车辆消费管理", businessType = BusinessType.INSERT)
@PostMapping
public CommonResult add(@RequestBody RescueCarSpend rescueCarSpend) {
@ -70,7 +74,7 @@ public class RescueCarSpendController extends BaseController {
/**
* 修改车辆消费管理
*/
@PreAuthorize("@ss.hasPermi('rescue:rescueCarSpend:edit')")
@PreAuthorize("@ss.hasPermission('rescue:rescueCarSpend:edit')")
// @Log(title = "车辆消费管理", businessType = BusinessType.UPDATE)
@PutMapping
public CommonResult edit(@RequestBody RescueCarSpend rescueCarSpend) {
@ -80,7 +84,7 @@ public class RescueCarSpendController extends BaseController {
/**
* 删除车辆消费管理
*/
@PreAuthorize("@ss.hasPermi('rescue:rescueCarSpend:remove')")
@PreAuthorize("@ss.hasPermission('rescue:rescueCarSpend:remove')")
// @Log(title = "车辆消费管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public CommonResult remove(@PathVariable Long[] ids) {

View File

@ -0,0 +1,113 @@
package cn.iocoder.yudao.module.rescue.controller.admin;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.rescue.core.controller.BaseController;
import cn.iocoder.yudao.module.rescue.domain.RescueDriverPosition;
import cn.iocoder.yudao.module.rescue.service.IRescueDriverPositionService;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 救援司机位置记录Controller
*
* @author zcy
* @date 2023-09-19
*/
@RestController
@RequestMapping("/rescue/rescue_driver_position")
public class RescueDriverPositionController extends BaseController {
@Autowired
private IRescueDriverPositionService rescueDriverPositionService;
// /**
// * 查询救援司机位置记录列表
// */
// @PreAuthorize("@ss.hasPermi('rescue:rescue_driver_position:list')")
// @GetMapping("/list")
// public TableDataInfo list(RescueDriverPosition rescueDriverPosition)
// {
// startPage();
// List<RescueDriverPosition> list = rescueDriverPositionService.selectRescueDriverPositionList(rescueDriverPosition);
// return getDataTable(list);
// }
//
// /**
// * 导出救援司机位置记录列表
// */
// @PreAuthorize("@ss.hasPermi('rescue:rescue_driver_position:export')")
// @Log(title = "救援司机位置记录", businessType = BusinessType.EXPORT)
// @PostMapping("/export")
// public void export(HttpServletResponse response, RescueDriverPosition rescueDriverPosition)
// {
// List<RescueDriverPosition> list = rescueDriverPositionService.selectRescueDriverPositionList(rescueDriverPosition);
// ExcelUtil<RescueDriverPosition> util = new ExcelUtil<RescueDriverPosition>(RescueDriverPosition.class);
// util.exportExcel(response, list, "救援司机位置记录数据");
// }
//
// /**
// * 获取救援司机位置记录详细信息
// */
// @PreAuthorize("@ss.hasPermi('rescue:rescue_driver_position:query')")
// @GetMapping(value = "/{id}")
// public AjaxResult getInfo(@PathVariable("id") Long id)
// {
// return success(rescueDriverPositionService.selectRescueDriverPositionById(id));
// }
//
// /**
// * 新增救援司机位置记录
// */
// @PreAuthorize("@ss.hasPermi('rescue:rescue_driver_position:add')")
// @Log(title = "救援司机位置记录", businessType = BusinessType.INSERT)
// @PostMapping
// public AjaxResult add(@RequestBody RescueDriverPosition rescueDriverPosition)
// {
// return toAjax(rescueDriverPositionService.insertRescueDriverPosition(rescueDriverPosition));
// }
//
// /**
// * 修改救援司机位置记录
// */
// @PreAuthorize("@ss.hasPermi('rescue:rescue_driver_position:edit')")
// @Log(title = "救援司机位置记录", businessType = BusinessType.UPDATE)
// @PutMapping
// public AjaxResult edit(@RequestBody RescueDriverPosition rescueDriverPosition)
// {
// return toAjax(rescueDriverPositionService.updateRescueDriverPosition(rescueDriverPosition));
// }
//
// /**
// * 删除救援司机位置记录
// */
// @PreAuthorize("@ss.hasPermi('rescue:rescue_driver_position:remove')")
// @Log(title = "救援司机位置记录", businessType = BusinessType.DELETE)
// @DeleteMapping("/{ids}")
// public AjaxResult remove(@PathVariable Long[] ids)
// {
// return toAjax(rescueDriverPositionService.deleteRescueDriverPositionByIds(ids));
// }
//
/**
* 查询救援司机位置记录列表
*/
@GetMapping("/listByInfoId")
public CommonResult listByInfoId(RescueDriverPosition rescueDriverPosition) {
List<RescueDriverPosition> list = rescueDriverPositionService.listByInfoId(rescueDriverPosition);
return success(list);
}
/**
* 查询救援司机位置记录列表
*/
@GetMapping("/routeInfo")
public CommonResult routeInfo(RescueDriverPosition rescueDriverPosition) {
List<JSONObject> res = rescueDriverPositionService.routeInfo(rescueDriverPosition);
return success(res);
}
}

View File

@ -2,6 +2,8 @@ package cn.iocoder.yudao.module.rescue.controller.admin;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.rescue.core.controller.BaseController;
import cn.iocoder.yudao.module.rescue.core.page.TableDataInfo;
@ -13,6 +15,7 @@ import cn.iocoder.yudao.module.rescue.dto.DriverInfoDto;
import cn.iocoder.yudao.module.rescue.dto.SysDictData;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.module.staff.entity.CompanyStaff;
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO;
import cn.iocoder.yudao.module.rescue.service.IRescueInfoDetailService;
@ -31,9 +34,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.*;
import java.util.stream.Collectors;
@ -135,16 +136,32 @@ public class RescueInfoSystem extends BaseController {
/**
* 导出请填写功能名称列表
*/
@PreAuthorize("@ss.hasPermi('system:info:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, RescueInfo rescueInfo) {
List<RescueInfo> list = rescueInfoService.list();
for (RescueInfo info : list) {
info.setSetMoneyYuan(Double.valueOf(Optional.ofNullable(info.getSetMoney()).orElse(0L)) / 100);
info.setPayMoneyYuan(Double.valueOf(Optional.ofNullable(info.getPayMoney()).orElse(0L)) / 100);
// @PreAuthorize("@ss.hasPermission('system:info:export')")
@GetMapping("/export")
public void export(HttpServletResponse response, RescueInfo rescueInfo,
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) throws Exception {
List<RescueInfo> list = new ArrayList<>();
while (true){
Page<RescueInfo> page = new Page<>(pageNo, pageSize);
IPage<RescueInfo> rescueInfoIPage = rescueInfoService.selectRescueListSystem2(rescueInfo, page);
if (ObjectUtil.isNotEmpty(rescueInfoIPage) && !rescueInfoIPage.getRecords().isEmpty()){
rescueInfoIPage.getRecords().forEach(item -> {
item.setSetMoneyYuan(Double.valueOf(Optional.ofNullable(item.getSetMoney()).orElse(0L)) / 100);
item.setPayMoneyYuan(Double.valueOf(Optional.ofNullable(item.getPayMoney()).orElse(0L)) / 100);
});
list.addAll(rescueInfoIPage.getRecords());
pageNo++;
}else {
break;
}
}
ExcelUtil<RescueInfo> util = new ExcelUtil<RescueInfo>(RescueInfo.class);
util.exportExcel(response, list, "救援订单数据");
// 导出 Excel
Map<Integer, Integer> columnWidthMap = new HashMap<>();
// 第一列的索引是0宽度设置为20个字符宽
columnWidthMap.put(9, 20);
columnWidthMap.put(10, 20);
ExcelUtils.write(response, "救援订单.xls", "数据", RescueInfo.class, list, columnWidthMap);
}
//指派司机

View File

@ -6,6 +6,8 @@ import cn.iocoder.yudao.module.rescue.core.page.TableDataInfo;
import cn.iocoder.yudao.module.rescue.domain.RescueRefuelRecord;
import cn.iocoder.yudao.module.rescue.service.IRescueRefuelRecordService;
import cn.iocoder.yudao.module.rescue.utils.ExcelUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@ -21,8 +23,7 @@ import java.util.List;
*/
@RestController
@RequestMapping("/rescue/refuelRecord")
public class RescueRefuelRecordController extends BaseController
{
public class RescueRefuelRecordController extends BaseController {
@Autowired
private IRescueRefuelRecordService rescueRefuelRecordService;
@ -31,33 +32,31 @@ public class RescueRefuelRecordController extends BaseController
*/
@PreAuthorize("@ss.hasPermission('rescue:refuelRecord:list')")
@GetMapping("/list")
public TableDataInfo list(RescueRefuelRecord rescueRefuelRecord)
{
startPage();
List<RescueRefuelRecord> list = rescueRefuelRecordService.selectRescueRefuelRecordList(rescueRefuelRecord);
return getDataTable(list);
public CommonResult list(RescueRefuelRecord rescueRefuelRecord,
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
Page<RescueRefuelRecord> page = new Page<>(pageNo, pageSize);
return success(rescueRefuelRecordService.selectRescueRefuelRecordList(rescueRefuelRecord, page));
}
/**
* 导出加油记录列表
*/
@PreAuthorize("@ss.hasPermission('rescue:refuelRecord:export')")
// @Log(title = "加油记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, RescueRefuelRecord rescueRefuelRecord)
{
List<RescueRefuelRecord> list = rescueRefuelRecordService.selectRescueRefuelRecordList(rescueRefuelRecord);
ExcelUtil<RescueRefuelRecord> util = new ExcelUtil<RescueRefuelRecord>(RescueRefuelRecord.class);
util.exportExcel(response, list, "加油记录数据");
}
// @PreAuthorize("@ss.hasPermission('rescue:refuelRecord:export')")
//// @Log(title = "加油记录", businessType = BusinessType.EXPORT)
// @PostMapping("/export")
// public void export(HttpServletResponse response, RescueRefuelRecord rescueRefuelRecord) {
// List<RescueRefuelRecord> list = rescueRefuelRecordService.selectRescueRefuelRecordList(rescueRefuelRecord);
// ExcelUtil<RescueRefuelRecord> util = new ExcelUtil<RescueRefuelRecord>(RescueRefuelRecord.class);
// util.exportExcel(response, list, "加油记录数据");
// }
/**
* 获取加油记录详细信息
*/
@PreAuthorize("@ss.hasPermission('rescue:refuelRecord:query')")
@GetMapping(value = "/{id}")
public CommonResult getInfo(@PathVariable("id") Long id)
{
public CommonResult getInfo(@PathVariable("id") Long id) {
return success(rescueRefuelRecordService.selectRescueRefuelRecordById(id));
}
@ -67,8 +66,7 @@ public class RescueRefuelRecordController extends BaseController
@PreAuthorize("@ss.hasPermission('rescue:refuelRecord:add')")
// @Log(title = "加油记录", businessType = BusinessType.INSERT)
@PostMapping
public CommonResult add(@RequestBody RescueRefuelRecord rescueRefuelRecord)
{
public CommonResult add(@RequestBody RescueRefuelRecord rescueRefuelRecord) {
return toAjax(rescueRefuelRecordService.insertRescueRefuelRecord(rescueRefuelRecord));
}
@ -78,8 +76,7 @@ public class RescueRefuelRecordController extends BaseController
@PreAuthorize("@ss.hasPermission('rescue:refuelRecord:edit')")
// @Log(title = "加油记录", businessType = BusinessType.UPDATE)
@PutMapping
public CommonResult edit(@RequestBody RescueRefuelRecord rescueRefuelRecord)
{
public CommonResult edit(@RequestBody RescueRefuelRecord rescueRefuelRecord) {
return toAjax(rescueRefuelRecordService.updateRescueRefuelRecord(rescueRefuelRecord));
}
@ -89,8 +86,7 @@ public class RescueRefuelRecordController extends BaseController
@PreAuthorize("@ss.hasPermission('rescue:refuelRecord:remove')")
// @Log(title = "加油记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public CommonResult remove(@PathVariable Long[] ids)
{
public CommonResult remove(@PathVariable Long[] ids) {
return toAjax(rescueRefuelRecordService.deleteRescueRefuelRecordByIds(ids));
}
}

View File

@ -3,7 +3,11 @@ package cn.iocoder.yudao.module.rescue.mapper;
import cn.iocoder.yudao.module.rescue.domain.RescueCarSpend;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -14,7 +18,7 @@ import java.util.List;
* @date 2023-11-30
*/
@Mapper
public interface RescueCarSpendMapper
public interface RescueCarSpendMapper extends BaseMapper<RescueCarSpend>
{
/**
* 查询车辆消费管理
@ -30,7 +34,7 @@ public interface RescueCarSpendMapper
* @param rescueCarSpend 车辆消费管理
* @return 车辆消费管理集合
*/
public List<RescueCarSpend> selectRescueCarSpendList(RescueCarSpend rescueCarSpend);
IPage<RescueCarSpend> selectRescueCarSpendList(@Param("map") RescueCarSpend rescueCarSpend, Page<RescueCarSpend> page);
/**
* 新增车辆消费管理

View File

@ -33,6 +33,7 @@ public interface RescueInfoMapper extends BaseMapper<RescueInfo>
* @return 请填写功能名称集合
*/
IPage<RescueInfo> selectRescueInfoList(@Param("map") RescueInfo rescueInfo, Page<RescueInfo> page);
IPage<RescueInfo> selectRescueListSystem2(@Param("map") RescueInfo rescueInfo, Page<RescueInfo> page);
JSONObject listData(RescueInfo rescueInfo);

View File

@ -4,6 +4,8 @@ import cn.iocoder.yudao.module.rescue.domain.RescueInfo;
import cn.iocoder.yudao.module.rescue.domain.RescueRefuelRecord;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -32,7 +34,7 @@ public interface RescueRefuelRecordMapper extends BaseMapper<RescueRefuelRecord>
* @param rescueRefuelRecord 加油记录
* @return 加油记录集合
*/
public List<RescueRefuelRecord> selectRescueRefuelRecordList(RescueRefuelRecord rescueRefuelRecord);
IPage<RescueRefuelRecord> selectRescueRefuelRecordList(@Param("map") RescueRefuelRecord rescueRefuelRecord, Page<RescueRefuelRecord> page);
/**

View File

@ -1,22 +1,23 @@
package cn.iocoder.yudao.module.rescue.service;
import cn.iocoder.yudao.module.rescue.domain.RescueCarSpend;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* 车辆消费管理Service接口
*
*
* @author zcy
* @date 2023-11-30
*/
public interface IRescueCarSpendService
{
public interface IRescueCarSpendService extends IService<RescueCarSpend> {
/**
* 查询车辆消费管理
*
*
* @param id 车辆消费管理主键
* @return 车辆消费管理
*/
@ -24,15 +25,15 @@ public interface IRescueCarSpendService
/**
* 查询车辆消费管理列表
*
*
* @param rescueCarSpend 车辆消费管理
* @return 车辆消费管理集合
*/
public List<RescueCarSpend> selectRescueCarSpendList(RescueCarSpend rescueCarSpend);
IPage<RescueCarSpend> selectRescueCarSpendList(RescueCarSpend rescueCarSpend, Page<RescueCarSpend> page);
/**
* 新增车辆消费管理
*
*
* @param rescueCarSpend 车辆消费管理
* @return 结果
*/
@ -40,7 +41,7 @@ public interface IRescueCarSpendService
/**
* 修改车辆消费管理
*
*
* @param rescueCarSpend 车辆消费管理
* @return 结果
*/
@ -48,7 +49,7 @@ public interface IRescueCarSpendService
/**
* 批量删除车辆消费管理
*
*
* @param ids 需要删除的车辆消费管理主键集合
* @return 结果
*/
@ -56,7 +57,7 @@ public interface IRescueCarSpendService
/**
* 删除车辆消费管理信息
*
*
* @param id 车辆消费管理主键
* @return 结果
*/

View File

@ -4,6 +4,8 @@ package cn.iocoder.yudao.module.rescue.service;
import cn.iocoder.yudao.module.rescue.domain.RescueInfo;
import cn.iocoder.yudao.module.rescue.domain.RescueRefuelRecord;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
@ -30,7 +32,7 @@ public interface IRescueRefuelRecordService extends IService<RescueRefuelRecord
* @param rescueRefuelRecord 加油记录
* @return 加油记录集合
*/
public List<RescueRefuelRecord> selectRescueRefuelRecordList(RescueRefuelRecord rescueRefuelRecord);
IPage<RescueRefuelRecord> selectRescueRefuelRecordList(RescueRefuelRecord rescueRefuelRecord, Page<RescueRefuelRecord> page);
/**
* 新增加油记录

View File

@ -5,6 +5,9 @@ import cn.iocoder.yudao.module.rescue.domain.RescueCarSpend;
import cn.iocoder.yudao.module.rescue.mapper.RescueCarSpendMapper;
import cn.iocoder.yudao.module.rescue.service.IRescueCarInfoService;
import cn.iocoder.yudao.module.rescue.service.IRescueCarSpendService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -18,8 +21,7 @@ import java.util.List;
* @date 2023-11-30
*/
@Service
public class RescueCarSpendServiceImpl implements IRescueCarSpendService
{
public class RescueCarSpendServiceImpl extends ServiceImpl<RescueCarSpendMapper, RescueCarSpend> implements IRescueCarSpendService {
@Autowired
private RescueCarSpendMapper rescueCarSpendMapper;
@Autowired
@ -32,8 +34,7 @@ public class RescueCarSpendServiceImpl implements IRescueCarSpendService
* @return 车辆消费管理
*/
@Override
public RescueCarSpend selectRescueCarSpendById(Long id)
{
public RescueCarSpend selectRescueCarSpendById(Long id) {
return rescueCarSpendMapper.selectRescueCarSpendById(id);
}
@ -44,9 +45,8 @@ public class RescueCarSpendServiceImpl implements IRescueCarSpendService
* @return 车辆消费管理
*/
@Override
public List<RescueCarSpend> selectRescueCarSpendList(RescueCarSpend rescueCarSpend)
{
return rescueCarSpendMapper.selectRescueCarSpendList(rescueCarSpend);
public IPage<RescueCarSpend> selectRescueCarSpendList(RescueCarSpend rescueCarSpend, Page<RescueCarSpend> page) {
return rescueCarSpendMapper.selectRescueCarSpendList(rescueCarSpend, page);
}
/**
@ -56,8 +56,7 @@ public class RescueCarSpendServiceImpl implements IRescueCarSpendService
* @return 结果
*/
@Override
public int insertRescueCarSpend(@Valid RescueCarSpend rescueCarSpend)
{
public int insertRescueCarSpend(@Valid RescueCarSpend rescueCarSpend) {
RescueCarInfo rescueCarInfo = carInfoService.selectRescueCarInfoById(rescueCarSpend.getRescueCarId());
rescueCarSpend.setCarNum(rescueCarInfo.getRescueCarNum());
return rescueCarSpendMapper.insertRescueCarSpend(rescueCarSpend);
@ -70,8 +69,7 @@ public class RescueCarSpendServiceImpl implements IRescueCarSpendService
* @return 结果
*/
@Override
public int updateRescueCarSpend(@Valid RescueCarSpend rescueCarSpend)
{
public int updateRescueCarSpend(@Valid RescueCarSpend rescueCarSpend) {
RescueCarInfo rescueCarInfo = carInfoService.selectRescueCarInfoById(rescueCarSpend.getRescueCarId());
rescueCarSpend.setCarNum(rescueCarInfo.getRescueCarNum());
return rescueCarSpendMapper.updateRescueCarSpend(rescueCarSpend);
@ -84,8 +82,7 @@ public class RescueCarSpendServiceImpl implements IRescueCarSpendService
* @return 结果
*/
@Override
public int deleteRescueCarSpendByIds(Long[] ids)
{
public int deleteRescueCarSpendByIds(Long[] ids) {
return rescueCarSpendMapper.deleteRescueCarSpendByIds(ids);
}
@ -96,8 +93,7 @@ public class RescueCarSpendServiceImpl implements IRescueCarSpendService
* @return 结果
*/
@Override
public int deleteRescueCarSpendById(Long id)
{
public int deleteRescueCarSpendById(Long id) {
return rescueCarSpendMapper.deleteRescueCarSpendById(id);
}
}

View File

@ -296,7 +296,6 @@ public class RescueInfoServiceImpl extends ServiceImpl<RescueInfoMapper, RescueI
@Override
public List<RescueInfo> selectRescueListSystem(RescueInfo rescueInfo) {
return baseMapper.selectList(new QueryWrapper<>());
}

View File

@ -4,6 +4,8 @@ import cn.iocoder.yudao.module.rescue.domain.RescueInfo;
import cn.iocoder.yudao.module.rescue.domain.RescueRefuelRecord;
import cn.iocoder.yudao.module.rescue.service.IRescueRefuelRecordService;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.iocoder.yudao.module.rescue.mapper.RescueRefuelRecordMapper;
import org.springframework.stereotype.Service;
@ -39,9 +41,9 @@ public class RescueRefuelRecordServiceImpl extends ServiceImpl<RescueRefuelRecor
* @return 加油记录
*/
@Override
public List<RescueRefuelRecord> selectRescueRefuelRecordList(RescueRefuelRecord rescueRefuelRecord)
public IPage<RescueRefuelRecord> selectRescueRefuelRecordList(RescueRefuelRecord rescueRefuelRecord, Page<RescueRefuelRecord> page)
{
return baseMapper.selectRescueRefuelRecordList(rescueRefuelRecord);
return baseMapper.selectRescueRefuelRecordList(rescueRefuelRecord, page);
}
/**

View File

@ -10,17 +10,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectRescueCarSpendList" resultType="cn.iocoder.yudao.module.rescue.domain.RescueCarSpend">
<include refid="selectRescueCarSpendVo"/>
<where>
<if test="rescueCarId != null "> and rescue_car_id = #{rescueCarId}</if>
<if test="carNum != null and carNum != ''"> and car_num = #{carNum}</if>
<if test="maintenanceStart != null and maintenanceEnd != null"> and maintenance_time between concat(#{maintenanceStart},' 00:00:00') and concat(#{maintenanceEnd},' 23:59:59') </if>
<if test="maintenanceContent != null and maintenanceContent != ''"> and maintenance_content = #{maintenanceContent}</if>
<if test="maintenanceMoney != null "> and maintenance_money = #{maintenanceMoney}</if>
<if test="insuranceContent != null and insuranceContent != ''"> and insurance_content = #{insuranceContent}</if>
<if test="insuranceBuyStart != null and insuranceBuyEnd !=null "> and insurance_buy_time between concat(#{insuranceBuyStart},' 00:00:00') and concat(#{insuranceBuyEnd},' 23:59:59')</if>
<if test="insuranceMoney != null "> and insurance_money = #{insuranceMoney}</if>
<if test="annualAuditTime != null "> and annual_audit_time between concat(#{annualAuditStart},' 00:00:00') and concat(#{annualAuditEnd},' 23:59:59')</if>
<if test="annualAuditMoney != null "> and annual_audit_money = #{annualAuditMoney}</if>
<if test="deptId != null "> and dept_id = #{deptId}</if>
<if test="map.rescueCarId != null "> and rescue_car_id = #{map.rescueCarId}</if>
<if test="map.carNum != null and map.carNum != ''"> and car_num = #{map.carNum}</if>
<if test="map.maintenanceStart != null and map.maintenanceEnd != null"> and maintenance_time between concat(#{map.maintenanceStart},' 00:00:00') and concat(#{map.maintenanceEnd},' 23:59:59') </if>
<if test="map.maintenanceContent != null and map.maintenanceContent != ''"> and maintenance_content = #{map.maintenanceContent}</if>
<if test="map.maintenanceMoney != null "> and maintenance_money = #{map.maintenanceMoney}</if>
<if test="map.insuranceContent != null and map.insuranceContent != ''"> and insurance_content = #{map.insuranceContent}</if>
<if test="map.insuranceBuyStart != null and map.insuranceBuyEnd !=null "> and insurance_buy_time between concat(#{map.insuranceBuyStart},' 00:00:00') and concat(#{map.insuranceBuyEnd},' 23:59:59')</if>
<if test="map.insuranceMoney != null "> and insurance_money = #{map.insuranceMoney}</if>
<if test="map.annualAuditTime != null "> and annual_audit_time between concat(#{map.annualAuditStart},' 00:00:00') and concat(#{map.annualAuditEnd},' 23:59:59')</if>
<if test="map.annualAuditMoney != null "> and annual_audit_money = #{map.annualAuditMoney}</if>
</where>
order by create_time desc
</select>

View File

@ -51,46 +51,44 @@
</where>
order by ri.create_time desc
</select>
<select id="selectRescueListSystem2" parameterType="cn.iocoder.yudao.module.rescue.domain.RescueInfo"
resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
<select id="selectRescueListSystem2" resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
SELECT
ri.*,roi.order_status,roi.set_money,roi.id as rescueOrderId,roi.pay_money,roi.pay_time
FROM
rescue_info ri
left join rescue_order_info roi on roi.rescue_info_id = ri.id
<where>
<if test="map.orderStatus != null and map.orderStatus != ''">
and roi.order_status = #{map.orderStatus}
</if>
<if test="map.rescueStatus != null and map.rescueStatus != ''">
and ri.rescue_status = #{map.rescueStatus}
</if>
<if test="map.licenseNum != null ">
and ri.license_num like concat('%',#{map.licenseNum},'%')
</if>
<if test="map.connectionName != null ">
and ri.connection_name like concat('%',#{map.connectionName},'%')
</if>
<if test="map.driverName != null ">
and ri.driver_name like concat('%',#{map.driverName},'%')
</if>
<if test="map.driverCarNum != null ">
and ri.driver_car_num like concat('%',#{map.driverCarNum},'%')
</if>
<if test="map.rescueType != null ">
and ri.rescue_type = #{map.rescueType}
</if>
<if test="map.feeType != null ">
and ri.fee_type = #{map.feeType}
</if>
<if test="map.flag != null ">
and ri.driver_id is not null
</if>
<if test="map.rescueStart != null and map.rescueEnd != null">and rescue_time between
concat(#{map.rescueStart},' 00:00:00') and concat(#{rescueEnd},' 23:59:59')
</if>
</where>
where ri.deleted = '0'
<if test="map.orderStatus != null and map.orderStatus != ''">
and roi.order_status = #{map.orderStatus}
</if>
<if test="map.rescueStatus != null and map.rescueStatus != ''">
and ri.rescue_status = #{map.rescueStatus}
</if>
<if test="map.licenseNum != null ">
and ri.license_num like concat('%',#{map.licenseNum},'%')
</if>
<if test="map.connectionName != null ">
and ri.connection_name like concat('%',#{map.connectionName},'%')
</if>
<if test="map.driverName != null ">
and ri.driver_name like concat('%',#{map.driverName},'%')
</if>
<if test="map.driverCarNum != null ">
and ri.driver_car_num like concat('%',#{map.driverCarNum},'%')
</if>
<if test="map.rescueType != null ">
and ri.rescue_type = #{map.rescueType}
</if>
<if test="map.feeType != null ">
and ri.fee_type = #{map.feeType}
</if>
<if test="map.flag != null ">
and ri.driver_id is not null
</if>
<if test="map.rescueStart != null and map.rescueEnd != null">and rescue_time between
concat(#{map.rescueStart},' 00:00:00') and concat(#{map.rescueEnd},' 23:59:59')
</if>
order by ri.create_time desc
</select>

View File

@ -1,46 +1,50 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.rescue.mapper.RescueRefuelRecordMapper">
<resultMap type="cn.iocoder.yudao.module.rescue.domain.RescueRefuelRecord" id="RescueRefuelRecordResult">
<result property="id" column="id" />
<result property="driverId" column="driver_id" />
<result property="carId" column="car_id" />
<result property="refuelNum" column="refuel_num" />
<result property="refuelMoney" column="refuel_money" />
<result property="recordTime" column="record_time" />
<result property="deptId" column="dept_id" />
<result property="creator" column="creator" />
<result property="createTime" column="create_time" />
<result property="updater" column="updater" />
<result property="updateTime" column="update_time" />
<result property="id" column="id"/>
<result property="driverId" column="driver_id"/>
<result property="carId" column="car_id"/>
<result property="refuelNum" column="refuel_num"/>
<result property="refuelMoney" column="refuel_money"/>
<result property="recordTime" column="record_time"/>
<result property="deptId" column="dept_id"/>
<result property="creator" column="creator"/>
<result property="createTime" column="create_time"/>
<result property="updater" column="updater"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<select id="selectRescueRefuelRecordList" parameterType="cn.iocoder.yudao.module.rescue.domain.RescueRefuelRecord" resultType="cn.iocoder.yudao.module.rescue.domain.RescueRefuelRecord">
<select id="selectRescueRefuelRecordList" parameterType="cn.iocoder.yudao.module.rescue.domain.RescueRefuelRecord"
resultType="cn.iocoder.yudao.module.rescue.domain.RescueRefuelRecord">
SELECT
rrc.*,su.real_name,su.phonenumber,rci.rescue_car_num
rrc.*,su.nickname as real_name,su.mobile as phonenumber,rci.rescue_car_num
FROM
rescue_refuel_record rrc
inner join driver_info di ON rrc.driver_id = di.id
INNER JOIN sys_user su ON su.user_id = di.user_id
INNER JOIN system_users su ON su.id = di.user_id
left join rescue_car_info rci on di.id = rci.possessor_id
<where>
<if test="realName != null "> and su.real_name like concat('%',#{realName},'%')</if>
<if test="rescueCarNum != null "> and rci.rescue_car_num like concat('%',#{rescueCarNum},'%') </if>
</where>
order by rrc.record_time desc
where rrc.deleted = '0'
<if test="map.realName != null ">and su.real_name like concat('%',#{map.realName},'%')</if>
<if test="map.rescueCarNum != null ">and rci.rescue_car_num like concat('%',#{map.rescueCarNum},'%')</if>
order by rrc.record_time desc
</select>
<select id="selectRescueRefuelRecordById" parameterType="java.lang.Long" resultType="cn.iocoder.yudao.module.rescue.domain.RescueRefuelRecord">
select * from rescue_refuel_record
<select id="selectRescueRefuelRecordById" parameterType="java.lang.Long"
resultType="cn.iocoder.yudao.module.rescue.domain.RescueRefuelRecord">
select *
from rescue_refuel_record
where id = #{id}
</select>
<delete id="deleteRescueRefuelRecordById" parameterType="java.lang.Long">
delete from rescue_refuel_record where id = #{id}
delete
from rescue_refuel_record
where id = #{id}
</delete>
<delete id="deleteRescueRefuelRecordByIds" parameterType="java.lang.String">
@ -50,29 +54,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</delete>
<select id="getMonthRescueRefuelRecord" resultType="com.alibaba.fastjson.JSONObject">
SELECT
ifnull(sum(refuel_money),0) as refuelMoney, ifnull(sum(refuel_num),0) as refuelNum
FROM
rescue_refuel_record
where driver_id = #{driverId} and car_id = #{carId} and record_time like CONCAT(#{time},'%')
SELECT ifnull(sum(refuel_money), 0) as refuelMoney,
ifnull(sum(refuel_num), 0) as refuelNum
FROM rescue_refuel_record
where driver_id = #{driverId}
and car_id = #{carId}
and record_time like CONCAT(#{time}, '%')
</select>
<select id="listData" resultType="com.alibaba.fastjson.JSONObject">
SELECT
ifnull(sum(refuel_money),0) as refuelMoney
ifnull(sum(refuel_money),0) as refuelMoney
FROM
rescue_refuel_record rrr
rescue_refuel_record rrr
left join rescue_car_info rci on rci.id = rrr.car_id
left join driver_info di on di.id = rrr.driver_id
left join sys_user su on di.user_id = su.user_id
<where>
<if test="driverName != null ">
and su.real_name like concat('%',#{driverName},'%')
</if>
<if test="driverCarNum != null ">
and rci.rescue_car_num like concat('%',#{driverCarNum},'%')
</if>
<if test="rescueStart"> and rrr.record_time like concat(#{rescueStart},'%') </if>
${params.dataScope}
<if test="driverName != null ">
and su.real_name like concat('%',#{driverName},'%')
</if>
<if test="driverCarNum != null ">
and rci.rescue_car_num like concat('%',#{driverCarNum},'%')
</if>
<if test="rescueStart">and rrr.record_time like concat(#{rescueStart},'%')</if>
${params.dataScope}
</where>
</select>