diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/controller/admin/RescueCarSpendController.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/controller/admin/RescueCarSpendController.java index 0526cd68..a07122a6 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/controller/admin/RescueCarSpendController.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/controller/admin/RescueCarSpendController.java @@ -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 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 page = new Page<>(pageNo, pageSize); + IPage 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 list = rescueCarSpendService.selectRescueCarSpendList(rescueCarSpend); + List list = rescueCarSpendService.list(); ExcelUtil util = new ExcelUtil(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) { diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/controller/admin/RescueDriverPositionController.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/controller/admin/RescueDriverPositionController.java new file mode 100644 index 00000000..f371a435 --- /dev/null +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/controller/admin/RescueDriverPositionController.java @@ -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 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 list = rescueDriverPositionService.selectRescueDriverPositionList(rescueDriverPosition); +// ExcelUtil util = new ExcelUtil(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 list = rescueDriverPositionService.listByInfoId(rescueDriverPosition); + return success(list); + } + + /** + * 查询救援司机位置记录列表 + */ + @GetMapping("/routeInfo") + public CommonResult routeInfo(RescueDriverPosition rescueDriverPosition) { + List res = rescueDriverPositionService.routeInfo(rescueDriverPosition); + return success(res); + } +} diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/controller/admin/RescueInfoSystem.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/controller/admin/RescueInfoSystem.java index d33c7859..419a60c5 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/controller/admin/RescueInfoSystem.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/controller/admin/RescueInfoSystem.java @@ -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 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 list = new ArrayList<>(); + while (true){ + Page page = new Page<>(pageNo, pageSize); + IPage 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 util = new ExcelUtil(RescueInfo.class); - util.exportExcel(response, list, "救援订单数据"); + // 导出 Excel + Map columnWidthMap = new HashMap<>(); + // 第一列的索引是0,宽度设置为20个字符宽 + columnWidthMap.put(9, 20); + columnWidthMap.put(10, 20); + ExcelUtils.write(response, "救援订单.xls", "数据", RescueInfo.class, list, columnWidthMap); } //指派司机 diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/controller/admin/RescueRefuelRecordController.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/controller/admin/RescueRefuelRecordController.java index bb6c3e36..92ed5427 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/controller/admin/RescueRefuelRecordController.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/controller/admin/RescueRefuelRecordController.java @@ -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 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 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 list = rescueRefuelRecordService.selectRescueRefuelRecordList(rescueRefuelRecord); - ExcelUtil util = new ExcelUtil(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 list = rescueRefuelRecordService.selectRescueRefuelRecordList(rescueRefuelRecord); +// ExcelUtil util = new ExcelUtil(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)); } } diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/mapper/RescueCarSpendMapper.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/mapper/RescueCarSpendMapper.java index 3c6d69b3..b71c15b4 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/mapper/RescueCarSpendMapper.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/mapper/RescueCarSpendMapper.java @@ -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 { /** * 查询车辆消费管理 @@ -30,7 +34,7 @@ public interface RescueCarSpendMapper * @param rescueCarSpend 车辆消费管理 * @return 车辆消费管理集合 */ - public List selectRescueCarSpendList(RescueCarSpend rescueCarSpend); + IPage selectRescueCarSpendList(@Param("map") RescueCarSpend rescueCarSpend, Page page); /** * 新增车辆消费管理 diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/mapper/RescueInfoMapper.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/mapper/RescueInfoMapper.java index 575115b8..41469ee1 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/mapper/RescueInfoMapper.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/mapper/RescueInfoMapper.java @@ -33,6 +33,7 @@ public interface RescueInfoMapper extends BaseMapper * @return 【请填写功能名称】集合 */ IPage selectRescueInfoList(@Param("map") RescueInfo rescueInfo, Page page); + IPage selectRescueListSystem2(@Param("map") RescueInfo rescueInfo, Page page); JSONObject listData(RescueInfo rescueInfo); diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/mapper/RescueRefuelRecordMapper.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/mapper/RescueRefuelRecordMapper.java index 48fce61b..86f0a019 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/mapper/RescueRefuelRecordMapper.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/mapper/RescueRefuelRecordMapper.java @@ -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 * @param rescueRefuelRecord 加油记录 * @return 加油记录集合 */ - public List selectRescueRefuelRecordList(RescueRefuelRecord rescueRefuelRecord); + IPage selectRescueRefuelRecordList(@Param("map") RescueRefuelRecord rescueRefuelRecord, Page page); /** diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/IRescueCarSpendService.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/IRescueCarSpendService.java index 37cb0fdc..8430c23d 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/IRescueCarSpendService.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/IRescueCarSpendService.java @@ -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 { /** * 查询车辆消费管理 - * + * * @param id 车辆消费管理主键 * @return 车辆消费管理 */ @@ -24,15 +25,15 @@ public interface IRescueCarSpendService /** * 查询车辆消费管理列表 - * + * * @param rescueCarSpend 车辆消费管理 * @return 车辆消费管理集合 */ - public List selectRescueCarSpendList(RescueCarSpend rescueCarSpend); + IPage selectRescueCarSpendList(RescueCarSpend rescueCarSpend, Page 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 结果 */ diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/IRescueRefuelRecordService.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/IRescueRefuelRecordService.java index cb76d59b..261a62e8 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/IRescueRefuelRecordService.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/IRescueRefuelRecordService.java @@ -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 selectRescueRefuelRecordList(RescueRefuelRecord rescueRefuelRecord); + IPage selectRescueRefuelRecordList(RescueRefuelRecord rescueRefuelRecord, Page page); /** * 新增加油记录 diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueCarSpendServiceImpl.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueCarSpendServiceImpl.java index 492a9128..fd6923ac 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueCarSpendServiceImpl.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueCarSpendServiceImpl.java @@ -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 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 selectRescueCarSpendList(RescueCarSpend rescueCarSpend) - { - return rescueCarSpendMapper.selectRescueCarSpendList(rescueCarSpend); + public IPage selectRescueCarSpendList(RescueCarSpend rescueCarSpend, Page 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); } } diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueInfoServiceImpl.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueInfoServiceImpl.java index cd3bea53..f04d15e8 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueInfoServiceImpl.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueInfoServiceImpl.java @@ -296,7 +296,6 @@ public class RescueInfoServiceImpl extends ServiceImpl selectRescueListSystem(RescueInfo rescueInfo) { - return baseMapper.selectList(new QueryWrapper<>()); } diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueRefuelRecordServiceImpl.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueRefuelRecordServiceImpl.java index 7b3d177c..5ec04fca 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueRefuelRecordServiceImpl.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueRefuelRecordServiceImpl.java @@ -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 selectRescueRefuelRecordList(RescueRefuelRecord rescueRefuelRecord) + public IPage selectRescueRefuelRecordList(RescueRefuelRecord rescueRefuelRecord, Page page) { - return baseMapper.selectRescueRefuelRecordList(rescueRefuelRecord); + return baseMapper.selectRescueRefuelRecordList(rescueRefuelRecord, page); } /** diff --git a/dl-module-rescue/src/main/resources/mapper/rescue/RescueCarSpendMapper.xml b/dl-module-rescue/src/main/resources/mapper/rescue/RescueCarSpendMapper.xml index 19a1839a..731394b2 100644 --- a/dl-module-rescue/src/main/resources/mapper/rescue/RescueCarSpendMapper.xml +++ b/dl-module-rescue/src/main/resources/mapper/rescue/RescueCarSpendMapper.xml @@ -10,17 +10,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" diff --git a/dl-module-rescue/src/main/resources/mapper/rescue/RescueInfoMapper.xml b/dl-module-rescue/src/main/resources/mapper/rescue/RescueInfoMapper.xml index 37e9d38b..11c84dfc 100644 --- a/dl-module-rescue/src/main/resources/mapper/rescue/RescueInfoMapper.xml +++ b/dl-module-rescue/src/main/resources/mapper/rescue/RescueInfoMapper.xml @@ -51,46 +51,44 @@ order by ri.create_time desc - 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 - - - and roi.order_status = #{map.orderStatus} - - - and ri.rescue_status = #{map.rescueStatus} - - - and ri.license_num like concat('%',#{map.licenseNum},'%') - - - and ri.connection_name like concat('%',#{map.connectionName},'%') - - - and ri.driver_name like concat('%',#{map.driverName},'%') - - - and ri.driver_car_num like concat('%',#{map.driverCarNum},'%') - - - and ri.rescue_type = #{map.rescueType} - - - and ri.fee_type = #{map.feeType} - - - and ri.driver_id is not null - - and rescue_time between - concat(#{map.rescueStart},' 00:00:00') and concat(#{rescueEnd},' 23:59:59') - - - + where ri.deleted = '0' + + and roi.order_status = #{map.orderStatus} + + + and ri.rescue_status = #{map.rescueStatus} + + + and ri.license_num like concat('%',#{map.licenseNum},'%') + + + and ri.connection_name like concat('%',#{map.connectionName},'%') + + + and ri.driver_name like concat('%',#{map.driverName},'%') + + + and ri.driver_car_num like concat('%',#{map.driverCarNum},'%') + + + and ri.rescue_type = #{map.rescueType} + + + and ri.fee_type = #{map.feeType} + + + and ri.driver_id is not null + + and rescue_time between + concat(#{map.rescueStart},' 00:00:00') and concat(#{map.rescueEnd},' 23:59:59') + order by ri.create_time desc diff --git a/dl-module-rescue/src/main/resources/mapper/rescue/RescueRefuelRecordMapper.xml b/dl-module-rescue/src/main/resources/mapper/rescue/RescueRefuelRecordMapper.xml index 9680df88..b284a8de 100644 --- a/dl-module-rescue/src/main/resources/mapper/rescue/RescueRefuelRecordMapper.xml +++ b/dl-module-rescue/src/main/resources/mapper/rescue/RescueRefuelRecordMapper.xml @@ -1,46 +1,50 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - + + + + + + + + + + + - 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 - - and su.real_name like concat('%',#{realName},'%') - and rci.rescue_car_num like concat('%',#{rescueCarNum},'%') - - order by rrc.record_time desc + where rrc.deleted = '0' + and su.real_name like concat('%',#{map.realName},'%') + and rci.rescue_car_num like concat('%',#{map.rescueCarNum},'%') + order by rrc.record_time desc - + select * + from rescue_refuel_record where id = #{id} - delete from rescue_refuel_record where id = #{id} + delete + from rescue_refuel_record + where id = #{id} @@ -50,29 +54,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"