diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/controller/admin/RepairOrderInfoController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/controller/admin/RepairOrderInfoController.java index 3a84dad1..64e62ee8 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/controller/admin/RepairOrderInfoController.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/controller/admin/RepairOrderInfoController.java @@ -84,5 +84,16 @@ public class RepairOrderInfoController { return success(repairOrderInfoService.queryListPage(pageReqVO,page)); } - + /** + * 统计未入账和已入账(最简版) + * + * @author 小李 + * @date 18:52 2024/9/25 + **/ + @GetMapping("/census") + @Operation(summary = "统计未入账和已入账") + @PreAuthorize("@ss.hasPermission('repair:order-info:query')") + public CommonResult census() { + return success(repairOrderInfoService.census()); + } } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/mapper/RepairOrderInfoMapper.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/mapper/RepairOrderInfoMapper.java index 0f7b1dd7..ea965302 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/mapper/RepairOrderInfoMapper.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/mapper/RepairOrderInfoMapper.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.order.mapper; import cn.iocoder.yudao.module.order.entity.RepairOrderInfo; +import cn.iocoder.yudao.module.order.vo.RepairOrderCensusVO; import cn.iocoder.yudao.module.order.vo.RepairOrderInfoPageReqVO; import cn.iocoder.yudao.module.order.vo.RepairOrderInfoRespVO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -37,4 +38,13 @@ public interface RepairOrderInfoMapper extends BaseMapper { * @param respVO 查询对象 **/ IPage getOrderPageByStatus(@Param("map") RepairOrderInfoRespVO respVO, Page page); + + /** + * 统计未入账和已入账(最简版) + * + * @author 小李 + * @date 18:52 2024/9/25 + **/ + RepairOrderCensusVO census(); + } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/service/RepairOrderInfoService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/service/RepairOrderInfoService.java index 3feb5323..bf3dc0ca 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/service/RepairOrderInfoService.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/service/RepairOrderInfoService.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.order.service; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.order.entity.RepairOrderInfo; +import cn.iocoder.yudao.module.order.vo.RepairOrderCensusVO; import cn.iocoder.yudao.module.order.vo.RepairOrderInfoPageReqVO; import cn.iocoder.yudao.module.order.vo.RepairOrderInfoRespVO; import cn.iocoder.yudao.module.order.vo.RepairOrderInfoSaveReqVO; @@ -114,4 +115,13 @@ public interface RepairOrderInfoService extends IService { * @date 15:50 2024/9/24 **/ IPage getAppraisePage(Page page); + + + /** + * 统计未入账和已入账(最简版) + * + * @author 小李 + * @date 18:52 2024/9/25 + **/ + RepairOrderCensusVO census(); } diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/service/impl/RepairOrderInfoServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/service/impl/RepairOrderInfoServiceImpl.java index 9b35ccd4..a4c7b7cb 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/service/impl/RepairOrderInfoServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/service/impl/RepairOrderInfoServiceImpl.java @@ -11,6 +11,7 @@ import cn.iocoder.yudao.module.custom.service.CustomerCouponService; import cn.iocoder.yudao.module.order.entity.RepairOrderInfo; import cn.iocoder.yudao.module.order.mapper.RepairOrderInfoMapper; import cn.iocoder.yudao.module.order.service.RepairOrderInfoService; +import cn.iocoder.yudao.module.order.vo.*; import cn.iocoder.yudao.module.order.vo.RepairOrderInfoPageReqVO; import cn.iocoder.yudao.module.order.vo.RepairOrderInfoRespVO; import cn.iocoder.yudao.module.order.vo.RepairOrderInfoSaveReqVO; @@ -201,6 +202,7 @@ public class RepairOrderInfoServiceImpl extends ServiceImpl payTransactions(String orderId){ RepairOrderInfo orderInfo = this.getById(orderId); // 统一参数封装 @@ -236,4 +238,15 @@ public class RepairOrderInfoServiceImpl extends ServiceImpl order by roi.create_time desc + \ No newline at end of file diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/controller/admin/DlRepairOtherController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/controller/admin/DlRepairOtherController.java index e892afbe..bd059a11 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/controller/admin/DlRepairOtherController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/controller/admin/DlRepairOtherController.java @@ -5,12 +5,16 @@ import cn.iocoder.yudao.module.other.entity.DlRepairOther; import cn.iocoder.yudao.module.other.service.DlRepairOtherService; import cn.iocoder.yudao.module.other.vo.DlRepairOtherReqVO; import cn.iocoder.yudao.module.other.vo.DlRepairOtherRespVO; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.v3.oas.annotations.Operation; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import java.util.Comparator; +import java.util.List; + import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; /** @@ -73,5 +77,12 @@ public class DlRepairOtherController { dlRepairOtherService.deleteOther(id); return CommonResult.ok(); } + + @GetMapping("/getByName") + @Operation(summary = "根据名称获取最新的数据") + public CommonResult getOtherByName(@RequestParam("name") String name){ + List list = dlRepairOtherService.list(new LambdaQueryWrapper().eq(DlRepairOther::getName, name)); + return success(list.stream().max(Comparator.comparing(DlRepairOther::getCreateTime)).orElse(null)); + } } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairProjectController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairProjectController.java index b9e47c2e..13768d55 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairProjectController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairProjectController.java @@ -7,6 +7,7 @@ import cn.iocoder.yudao.module.project.service.RepairProjectService; import cn.iocoder.yudao.module.project.vo.RepairProjectPageReqVO; import cn.iocoder.yudao.module.project.vo.RepairProjectRespVO; import cn.iocoder.yudao.module.project.vo.RepairProjectSaveReqVO; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.v3.oas.annotations.Operation; @@ -19,6 +20,9 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.validation.Valid; +import java.util.Comparator; +import java.util.List; + import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; @Tag(name = "管理后台 - 维修项目") @@ -117,4 +121,16 @@ public class RepairProjectController { return success(repairProjectService.queryListPage(pageReqVO,page)); } + /** + * 根据名称获取最新的数据 + * + * @author 小李 + * @date 18:01 2024/9/25 + **/ + @GetMapping("/getByName") + @Operation(summary = "根据名称获取最新的数据") + public CommonResult getRepairProjectByName(@RequestParam("name") String name) { + List list = repairProjectService.list(new LambdaQueryWrapper().eq(RepairProject::getName, name)); + return success(list.stream().max(Comparator.comparing(RepairProject::getCreateTime)).orElse(null)); + } } \ No newline at end of file diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairWaresController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairWaresController.java index bf55f478..547dcb33 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairWaresController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairWaresController.java @@ -6,6 +6,7 @@ import cn.iocoder.yudao.module.project.service.RepairWaresService; import cn.iocoder.yudao.module.project.vo.RepairWaresPageReqVO; import cn.iocoder.yudao.module.project.vo.RepairWaresRespVO; import cn.iocoder.yudao.module.project.vo.RepairWaresSaveReqVO; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.v3.oas.annotations.Operation; @@ -18,6 +19,9 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.validation.Valid; +import java.util.Comparator; +import java.util.List; + import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; @Tag(name = "管理后台 - 配件库") @@ -113,5 +117,18 @@ public class RepairWaresController { return success(waresService.getWaresPage(pageReqVO, page)); } + /** + * 根据名称获取最新的数据 + * + * @author 小李 + * @date 18:03 2024/9/25 + **/ + @GetMapping("/getByName") + @Operation(summary = "根据名称获取最新的数据") + public CommonResult getWaresByName(@RequestParam("name") String name) { + List list = waresService.list(new LambdaQueryWrapper().eq(RepairWares::getName, name)); + return success(list.stream().max(Comparator.comparing(RepairWares::getCreateTime)).orElse(null)); + } + } \ No newline at end of file