From f6511ea3b045bfbc025afdf91fe70e7b4b582ad6 Mon Sep 17 00:00:00 2001 From: PQZ Date: Fri, 20 Sep 2024 00:43:39 +0800 Subject: [PATCH] 1 --- .../InspectionMallPartnersController.java | 46 ++++++--------- .../mapper/InspectionInfoMapper.java | 8 +++ .../service/IInspectionInfoService.java | 7 +++ .../impl/InspectionInfoServiceImpl.java | 11 ++++ .../payment/service/OrderInfoService.java | 4 ++ .../service/impl/OrderInfoServiceImpl.java | 23 ++++++++ .../inspection/InspectionInfoMapper.xml | 58 +++++++++++++++++++ 7 files changed, 128 insertions(+), 29 deletions(-) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionMallPartnersController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionMallPartnersController.java index 0afa5cc3..d7aeea84 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionMallPartnersController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionMallPartnersController.java @@ -12,6 +12,7 @@ import cn.iocoder.yudao.framework.security.core.LoginUser; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.module.core.text.Convert; import cn.iocoder.yudao.module.core.text.ServletUtils; +import cn.iocoder.yudao.module.label.vo.LabelRespVO; import cn.iocoder.yudao.module.partner.service.IPartnerWorkerService; import cn.iocoder.yudao.module.payment.service.OrderInfoService; import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO; @@ -21,6 +22,7 @@ import cn.iocoder.yudao.module.system.service.permission.PermissionService; import cn.iocoder.yudao.module.system.service.permission.RoleService; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.github.pagehelper.PageHelper; import cn.iocoder.yudao.module.core.controller.BaseController; @@ -98,7 +100,7 @@ public class InspectionMallPartnersController extends BaseController { * 工单管理 */ @GetMapping("/workOrder") - public TableDataInfo workOrder(String carNum,String goodsTitle,String customerSource,String payType,String startTime,Long roleId,String endTime,Integer pageSize,Integer pageNum) + public CommonResult> workOrder(String carNum,String goodsTitle,String customerSource,String payType,String startTime,Long roleId,String endTime,Integer pageSize,Integer pageNum) { LoginUser user = SecurityFrameworkUtils.getLoginUser(); Set userRoleIdListByUserId = permissionService.getUserRoleIdListByUserId(user.getId()); @@ -110,33 +112,24 @@ public class InspectionMallPartnersController extends BaseController { queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0"); partner = shopMallPartnersService.getOne(queryWrapper); if (ObjectUtil.isEmpty(partner)){ - TableDataInfo dataInfo =new TableDataInfo(); - dataInfo.setCode(500); - dataInfo.setRows(new ArrayList<>()); - dataInfo.setMsg("信息有误"); - return dataInfo; + return error(); } }else if (roles.contains("jcworker")){ LambdaQueryWrapper queryWrapperWork =new LambdaQueryWrapper<>(); queryWrapperWork.eq(PartnerWorker::getUserId,user.getId()); PartnerWorker worker = partnerWorkerService.getOne(queryWrapperWork); if (ObjectUtil.isEmpty(worker)){ - TableDataInfo dataInfo =new TableDataInfo(); - dataInfo.setCode(500); - dataInfo.setRows(new ArrayList<>()); - dataInfo.setMsg("信息有误"); - return dataInfo; + return error(); } partner.setPartnerId(worker.getPartnerId()); } -// Page page = new Page<>(pageNum,pageSize); - PageHelper.startPage(pageNum,pageSize); - List list = orderInfoService.workOrder(partner.getPartnerId(),carNum,goodsTitle, customerSource, payType,startTime,roleId,endTime); - return getDataTable(list); + Page page = new Page<>(pageNum, pageSize); + IPage list = orderInfoService.pageWorkOrder(partner.getPartnerId(),carNum,goodsTitle, customerSource, payType,startTime,roleId,endTime,page); + return CommonResult.success(list); } @GetMapping("/delWorkOrder") - public TableDataInfo delWorkOrder(String carNum,String goodsTitle,String customerSource,String payType,String startTime,Long roleId,String endTime,Integer pageSize,Integer pageNum) + public CommonResult> delWorkOrder(String carNum,String goodsTitle,String customerSource,String payType,String startTime,Long roleId,String endTime,Integer pageSize,Integer pageNum) { LoginUser user = SecurityFrameworkUtils.getLoginUser(); Set userRoleIdListByUserId = permissionService.getUserRoleIdListByUserId(user.getId()); @@ -150,29 +143,24 @@ public class InspectionMallPartnersController extends BaseController { queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0"); partner = shopMallPartnersService.getOne(queryWrapper); if (ObjectUtil.isEmpty(partner)){ - TableDataInfo dataInfo =new TableDataInfo(); - dataInfo.setCode(500); - dataInfo.setRows(new ArrayList<>()); - dataInfo.setMsg("信息有误"); - return dataInfo; + return error(); } }else if (roles.contains("jcworker")){ LambdaQueryWrapper queryWrapperWork =new LambdaQueryWrapper<>(); queryWrapperWork.eq(PartnerWorker::getUserId,user.getId()); PartnerWorker worker = partnerWorkerService.getOne(queryWrapperWork); if (ObjectUtil.isEmpty(worker)){ - TableDataInfo dataInfo =new TableDataInfo(); - dataInfo.setCode(500); - dataInfo.setRows(new ArrayList<>()); - dataInfo.setMsg("信息有误"); - return dataInfo; + return error(); } partner.setPartnerId(worker.getPartnerId()); } // Page page = new Page<>(pageNum,pageSize); - PageHelper.startPage(pageNum,pageSize); - List list = orderInfoService.delworkOrder(partner.getPartnerId(),carNum,goodsTitle, customerSource, payType,startTime,roleId,endTime); - return getDataTable(list); + Page page = new Page<>(pageNum, pageSize); + +// List list = orderInfoService.delworkOrder(partner.getPartnerId(),carNum,goodsTitle, customerSource, payType,startTime,roleId,endTime); + IPage list = orderInfoService.pageWorkOrder(partner.getPartnerId(),carNum,goodsTitle, customerSource, payType,startTime,roleId,endTime,page); + + return CommonResult.success(list); } @PostMapping("/exportWorkOrder") diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/InspectionInfoMapper.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/InspectionInfoMapper.java index a80dc613..2a24ff63 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/InspectionInfoMapper.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/InspectionInfoMapper.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.inspection.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import cn.iocoder.yudao.module.inspection.entity.InspectionInfo; +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; @@ -69,11 +70,18 @@ public interface InspectionInfoMapper extends BaseMapper List workOrder(@Param("partnerId") Long partnerId, @Param("carNum")String carNum, @Param("goodsTitle")String goodsTitle , @Param("customerSource")String customerSource, @Param("payType")String payType, @Param("startTime")String startTime , @Param("roleId") Long roleId, @Param("endTime")String endTime); + IPage pageWorkOrder(@Param("partnerId") Long partnerId, @Param("carNum")String carNum, @Param("goodsTitle")String goodsTitle + , @Param("customerSource")String customerSource, @Param("payType")String payType, @Param("startTime")String startTime + , @Param("roleId") Long roleId, @Param("endTime")String endTime,Page page); List delworkOrder(@Param("partnerId") Long partnerId, @Param("carNum")String carNum, @Param("goodsTitle")String goodsTitle ,@Param("customerSource")String customerSource,@Param("payType")String payType,@Param("startTime")String startTime ,@Param("roleId") Long roleId,@Param("endTime")String endTime); + IPage pageDelWorkOrder(@Param("partnerId") Long partnerId, @Param("carNum")String carNum, @Param("goodsTitle")String goodsTitle + , @Param("customerSource")String customerSource, @Param("payType")String payType, @Param("startTime")String startTime + , @Param("roleId") Long roleId, @Param("endTime")String endTime,Page page); + Map workOrderData(@Param("partnerId") Long partnerId, @Param("carNum")String carNum, @Param("goodsTitle")String goodsTitle , @Param("customerSource")String customerSource, @Param("payType")String payType, @Param("startTime")String startTime , @Param("roleId") Long roleId, @Param("endTime")String endTime); diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionInfoService.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionInfoService.java index 296f4bd7..335dd5b4 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionInfoService.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionInfoService.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.inspection.service; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import cn.iocoder.yudao.module.inspection.entity.InspectionInfo; @@ -62,9 +63,15 @@ public interface IInspectionInfoService extends IService * @return 结果 */ public int deleteInspectionInfoById(Long id); + List workOrder(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime); + + IPage pageWorkOrder(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime,Page page); + + List delworkOrder(Long partnerId, String carNum, String goodsTitle,String customerSource,String payType,String startTime,Long roleId,String endTime); + IPage pageDelWorkOrder(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime,Page page); Map workOrderData(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime); diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java index 416412fe..d915201b 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java @@ -19,6 +19,7 @@ import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.service.user.AdminUserService; import cn.iocoder.yudao.util.SendSmsUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +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.util.StringUtils; @@ -301,11 +302,21 @@ public class InspectionInfoServiceImpl extends ServiceImpl pageWorkOrder(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime, Page page) { + return baseMapper.pageWorkOrder(partnerId,carNum,goodsTitle, customerSource, payType, startTime,roleId,endTime,page); + } + @Override public List delworkOrder(Long partnerId, String carNum, String goodsTitle,String customerSource,String payType,String startTime,Long roleId,String endTime){ return baseMapper.delworkOrder(partnerId,carNum,goodsTitle, customerSource, payType, startTime,roleId,endTime); } + @Override + public IPage pageDelWorkOrder(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime, Page page) { + return baseMapper.pageDelWorkOrder(partnerId,carNum,goodsTitle, customerSource, payType, startTime,roleId,endTime,page); + } + @Override public Map workOrderData(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime) { return baseMapper.workOrderData(partnerId,carNum,goodsTitle, customerSource, payType, startTime,roleId,endTime); diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/payment/service/OrderInfoService.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/payment/service/OrderInfoService.java index 5d04034e..d647a8d1 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/payment/service/OrderInfoService.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/payment/service/OrderInfoService.java @@ -27,10 +27,14 @@ public interface OrderInfoService extends IService { List workOrder(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime); + IPage pageWorkOrder(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime,Page page); + Map workOrderData(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime); List delworkOrder(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime); + IPage pageDelworkOrder(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime,Page page); + List orderListSystem(OrderInfo orderInfo); /** diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/payment/service/impl/OrderInfoServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/payment/service/impl/OrderInfoServiceImpl.java index 7ccec8c6..7133e0c3 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/payment/service/impl/OrderInfoServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/payment/service/impl/OrderInfoServiceImpl.java @@ -117,6 +117,18 @@ public class OrderInfoServiceImpl extends ServiceImpl pageWorkOrder(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime, Page page) { + if (StringUtils.isNotEmpty(startTime)){ + startTime = startTime+" 00:00:00"; + } + if (StringUtils.isNotEmpty(endTime)){ + endTime = endTime+" 23:59:59"; + } + + return iInspectionInfoService.pageWorkOrder(partnerId,carNum,goodsTitle, customerSource, payType, startTime, roleId,endTime,page); + } + @Override public Map workOrderData(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime) { if (StringUtils.isNotEmpty(startTime)){ @@ -139,6 +151,17 @@ public class OrderInfoServiceImpl extends ServiceImpl pageDelworkOrder(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime, Page page) { + if (StringUtils.isNotEmpty(startTime)){ + startTime = startTime+" 00:00:00"; + } + if (StringUtils.isNotEmpty(endTime)){ + endTime = endTime+" 23:59:59"; + } + return iInspectionInfoService.pageDelWorkOrder(partnerId,carNum,goodsTitle, customerSource, payType, startTime, roleId,endTime,page); + } + @Override public List orderListSystem(OrderInfo orderInfo) { return baseMapper.orderListSystem(orderInfo); diff --git a/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml b/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml index d9959145..d7b2881c 100644 --- a/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml +++ b/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml @@ -208,4 +208,62 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and ins.start_time between #{startTime} and #{endTime} + +