From a75b0521674545fd864e734a55811acd6ef92ee6 Mon Sep 17 00:00:00 2001 From: nyoung <12190070+nyoungo@user.noreply.gitee.com> Date: Mon, 2 Sep 2024 21:25:04 +0800 Subject: [PATCH] 1 --- .../InspectionMallPartnersController.java | 16 ++++--- .../controller/PartnerOwnController.java | 13 +++--- .../ShopInspectionGoodsController.java | 9 +++- .../mapper/AppInspectionPartnerMapper.java | 5 ++- .../mapper/InspectionInfoMapper.java | 9 ++-- .../service/AppInspectionPartnerService.java | 5 ++- .../service/IInspectionInfoService.java | 5 ++- .../impl/AppInspectionPartnerServiceImpl.java | 9 ++-- .../impl/InspectionInfoServiceImpl.java | 11 ++--- .../PartnerCustomerInfoController.java | 12 ++++-- .../mapper/PartnerCustomerInfoMapper.java | 4 +- .../service/IPartnerCustomerInfoService.java | 3 +- .../impl/PartnerCustomerInfoServiceImpl.java | 21 +++++----- .../payment/controller/OrderController.java | 8 +++- .../payment/mapper/OrderInfoMapper.java | 2 +- .../payment/service/OrderInfoService.java | 6 +-- .../service/impl/OrderInfoServiceImpl.java | 12 +++--- .../module/shop/mapper/ShopUserCarMapper.java | 2 + .../shop/service/IShopUserCarService.java | 2 + .../service/impl/ShopUserCarServiceImpl.java | 6 +++ .../partner/PartnerCustomerInfoMapper.xml | 12 +++--- .../mapper/payment/OrderInfoMapper.xml | 42 +++++++++---------- .../mapper/shop/ShopUserCarMapper.xml | 5 ++- 23 files changed, 130 insertions(+), 89 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 e76c76ee..20fef636 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 @@ -10,6 +10,8 @@ import cn.hutool.poi.excel.ExcelWriter; import cn.iocoder.yudao.framework.common.pojo.CommonResult; 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.partner.service.IPartnerWorkerService; import cn.iocoder.yudao.module.payment.service.OrderInfoService; import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO; @@ -127,8 +129,8 @@ public class InspectionMallPartnersController extends BaseController { } partner.setPartnerId(worker.getPartnerId()); } - PageHelper.startPage(pageNum,pageSize); - List list = orderInfoService.workOrder(partner.getPartnerId(),carNum,goodsTitle, customerSource, payType,startTime,roleId,endTime); + Page page = new Page<>(pageNum,pageSize); + List list = orderInfoService.workOrder(page,partner.getPartnerId(),carNum,goodsTitle, customerSource, payType,startTime,roleId,endTime); return getDataTable(list); } @@ -166,8 +168,8 @@ public class InspectionMallPartnersController extends BaseController { } partner.setPartnerId(worker.getPartnerId()); } - PageHelper.startPage(pageNum,pageSize); - List list = orderInfoService.delworkOrder(partner.getPartnerId(),carNum,goodsTitle, customerSource, payType,startTime,roleId,endTime); + Page page = new Page<>(pageNum,pageSize); + List list = orderInfoService.delworkOrder(page,partner.getPartnerId(),carNum,goodsTitle, customerSource, payType,startTime,roleId,endTime); return getDataTable(list); } @@ -195,8 +197,10 @@ public class InspectionMallPartnersController extends BaseController { } partner.setPartnerId(worker.getPartnerId()); } - PageHelper.startPage(1,500); - List list = orderInfoService.workOrder(partner.getPartnerId(),carNum,goodsTitle, customerSource, payType,startTime,roleId,endTime); + int pageNum = Convert.toInt(ServletUtils.getParameter("pageNum"), 1); + int pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10); + Page page = new Page<>(pageNum,pageSize); + List list = orderInfoService.workOrder(page,partner.getPartnerId(),carNum,goodsTitle, customerSource, payType,startTime,roleId,endTime); List> rows =new ArrayList<>(); Map stringObjectMap = orderInfoService.workOrderData(partner.getPartnerId(), carNum, goodsTitle, customerSource, payType, startTime, roleId, endTime); diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/PartnerOwnController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/PartnerOwnController.java index 67aa70e6..554f2f16 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/PartnerOwnController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/PartnerOwnController.java @@ -18,6 +18,7 @@ import cn.iocoder.yudao.module.system.service.dict.DictDataService; import cn.iocoder.yudao.module.system.service.dict.DictTypeService; import cn.iocoder.yudao.util.StringUtils; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.github.pagehelper.PageHelper; import cn.iocoder.yudao.module.core.controller.BaseController; import cn.iocoder.yudao.module.core.page.TableDataInfo; @@ -323,8 +324,8 @@ public class PartnerOwnController extends BaseController { if (!partnersTmp.getUserId().equals(user.getId())){ return null; } - PageHelper.startPage(pageNum,pageSize); - List workList = partnerList.getWorkList(partnerId,postId, workName, phoneNum); + Page page = new Page<>(pageNum, pageSize); + List workList = partnerList.getWorkList(page,partnerId,postId, workName, phoneNum); return getDataTable(workList); } @@ -344,8 +345,8 @@ public class PartnerOwnController extends BaseController { if (!partnerId.equals(partners.getPartnerId())){ return null; } - PageHelper.startPage(pageNum,pageSize); - List inspectionInfos = partnerList.inspectionList(partnerId, status, carNum); + Page page = new Page<>(pageNum,pageSize); + List inspectionInfos = partnerList.inspectionList(page,partnerId, status, carNum); return getDataTable(inspectionInfos); } @@ -365,8 +366,8 @@ public class PartnerOwnController extends BaseController { if (ObjectUtil.isEmpty(worker)){ return null; } - PageHelper.startPage(pageNum,pageSize); - List inspectionInfos = partnerList.inspectionList(partnerId, status, searchValue); + Page page = new Page<>(pageNum,pageSize); + List inspectionInfos = partnerList.inspectionList(page,partnerId, status, searchValue); return getDataTable(inspectionInfos); } //增加检测步骤信息 diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/ShopInspectionGoodsController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/ShopInspectionGoodsController.java index 53cb401a..cf132612 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/ShopInspectionGoodsController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/ShopInspectionGoodsController.java @@ -9,6 +9,8 @@ import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; 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.partner.service.IPartnerWorkerService; import cn.iocoder.yudao.module.payment.service.OrderInfoService; import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO; @@ -20,6 +22,7 @@ import cn.iocoder.yudao.module.partner.entity.PartnerWorker; import cn.iocoder.yudao.module.payment.entity.OrderInfo; import cn.iocoder.yudao.module.shop.entity.ShopMallPartners; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.pagehelper.PageHelper; import org.apache.commons.lang3.ObjectUtils; import org.springframework.context.annotation.Lazy; import org.springframework.security.access.prepost.PreAuthorize; @@ -201,8 +204,10 @@ public class ShopInspectionGoodsController extends BaseController } shopInspectionOrder.setPartnerId(partner.getPartnerId()); shopInspectionOrder.setValidationTime(new Date()); - startPage(); - List list = orderInfoService.orderListSystem(shopInspectionOrder); + int pageNum = Convert.toInt(ServletUtils.getParameter("pageNum"), 1); + int pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10); + Page page = new Page<>(pageNum,pageSize); + List list = orderInfoService.orderListSystem(page,shopInspectionOrder); return getDataTable(list); } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/AppInspectionPartnerMapper.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/AppInspectionPartnerMapper.java index fd0fec15..c83c83bd 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/AppInspectionPartnerMapper.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/AppInspectionPartnerMapper.java @@ -9,6 +9,7 @@ import cn.iocoder.yudao.module.inspection.entity.ShopInspectionCategory; import cn.iocoder.yudao.module.inspection.query.PartnerListQuery; import cn.iocoder.yudao.module.inspection.vo.*; import cn.iocoder.yudao.module.shop.entity.ShopMallPartners; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -31,8 +32,8 @@ public interface AppInspectionPartnerMapper extends BaseMapper List hotGoodsList(@Param("partnerId") Long partnerId,@Param("dateStr")String dateStr); List manageGoodsList(@Param("partnerId") Long partnerId, @Param("isListing")String isListing,@Param("goodsTitle") String goodsTitle); List orderList(@Param("partnerId") Long partnerId, @Param("phoneNum") String phoneNum,@Param("title") String title); - List getWorkList(@Param("partnerId")Long partnerId, @Param("postId") Long postId, @Param("workName") String workName, @Param("phoneNum")String phoneNum); - List inspectionList(@Param("partnerId")Long partnerId,@Param("status") String status, @Param("carNum")String carNum); + List getWorkList(Page page,@Param("partnerId")Long partnerId, @Param("postId") Long postId, @Param("workName") String workName, @Param("phoneNum")String phoneNum); + List inspectionList(Page page,@Param("partnerId")Long partnerId, @Param("status") String status, @Param("carNum")String carNum); List workerInspectionList(@Param("workerId")Long workerId,@Param("status") String status, @Param("searchValue")String searchValue); List validationList(@Param("partnerId") Long partnerId, @Param("searchValue") String searchValue); List getPickCarList(@Param("partnerId") Long partnerId, @Param("phoneNum") String phoneNum, @Param("pickStatus") String pickStatus); 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 d2980a45..650ce14e 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.extension.plugins.pagination.Page; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -65,11 +66,11 @@ public interface InspectionInfoMapper extends BaseMapper * @return 结果 */ public int deleteInspectionInfoByIds(Long[] ids); - 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); + List workOrder(Page page,@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); - List delworkOrder(@Param("partnerId") Long partnerId, @Param("carNum")String carNum, @Param("goodsTitle")String goodsTitle + List delworkOrder(Page page,@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/AppInspectionPartnerService.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/AppInspectionPartnerService.java index 2c07059b..074e1952 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/AppInspectionPartnerService.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/AppInspectionPartnerService.java @@ -6,6 +6,7 @@ import cn.iocoder.yudao.module.partner.entity.PartnerWorker; import cn.iocoder.yudao.module.payment.entity.OrderInfo; import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import cn.iocoder.yudao.module.inspection.entity.*; import cn.iocoder.yudao.module.inspection.query.PartnerListQuery; @@ -52,11 +53,11 @@ public interface AppInspectionPartnerService extends IService Long orderDetailByCode(Long partnerId,String code) throws Exception; void takeOut(Long partnerId,Long orderId,Long workId,String carNum) throws Exception; void addWorker(Long partnerId,String realName,String phoneNum,Long postId) throws Exception; - List getWorkList(Long partnerId, Long postId, String workName, String phoneNum); + List getWorkList(Page page,Long partnerId, Long postId, String workName, String phoneNum); void delWorker(Long partnerId,Long workId); - List inspectionList(Long partnerId,String status,String carNum); + List inspectionList(Page page,Long partnerId, String status, String carNum); InspectionInfoVo inspectionDetail(Long inspectionInfoId); List workerInspectionList(Long partnerId,String status,String searchValue); 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 6340bec9..6a78ea50 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.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import cn.iocoder.yudao.module.inspection.entity.InspectionInfo; @@ -61,8 +62,8 @@ 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); - List delworkOrder(Long partnerId, String carNum, String goodsTitle,String customerSource,String payType,String startTime,Long roleId,String endTime); + List workOrder(Page page,Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime); + List delworkOrder(Page page,Long partnerId, String carNum, String goodsTitle,String customerSource,String payType,String startTime,Long roleId,String endTime); 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/AppInspectionPartnerServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java index 0055f116..e54f5b93 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java @@ -37,6 +37,7 @@ import cn.iocoder.yudao.util.SendSmsUtil; import cn.iocoder.yudao.util.VehicleLicenseOCR; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.github.pagehelper.PageHelper; import cn.iocoder.yudao.util.StringUtils; @@ -1055,8 +1056,8 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl getWorkList(Long partnerId,Long postId,String workName,String phoneNum) { - return baseMapper.getWorkList(partnerId,postId,workName,phoneNum); + public List getWorkList(Page page,Long partnerId,Long postId,String workName,String phoneNum) { + return baseMapper.getWorkList(page,partnerId,postId,workName,phoneNum); } @Override @@ -1070,8 +1071,8 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl inspectionList(Long partnerId,String status,String carNum) { - return baseMapper.inspectionList(partnerId,status,carNum); + public List inspectionList(Page page,Long partnerId, String status, String carNum) { + return baseMapper.inspectionList(page,partnerId,status,carNum); } @Override 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 dc074881..c4d54686 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.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import cn.iocoder.yudao.util.StringUtils; import cn.iocoder.yudao.module.inspection.entity.*; @@ -105,12 +106,12 @@ public class InspectionInfoServiceImpl extends ServiceImpl workerQueryWrapper =new LambdaQueryWrapper<>(); workerQueryWrapper.eq(PartnerWorker::getUserId,loginUser.getId()).eq(PartnerWorker::getPartnerId,partners.getPartnerId()); PartnerWorker worker = workerService.getOne(workerQueryWrapper); - AdminUserDO workerUser =userService.getUser(worker.getUserId()); if (ObjectUtils.isNotEmpty(worker)){ inspectionInfo.setWorkId(worker.getId()); }else { throw new Exception("请先将接待员加入员工"); } + AdminUserDO workerUser =userService.getUser(worker.getUserId()); String buyName = StringUtils.isNotEmpty(inspectionInfo.getBuyName())?inspectionInfo.getBuyName():"未知客户"; String buyPhone = StringUtils.isNotEmpty(inspectionInfo.getBuyPhone())?inspectionInfo.getBuyPhone():StringUtils.isNotEmpty(inspectionInfo.getBuyName())?inspectionInfo.getBuyName():"无"; AdminUserDO user = userService.getUserByMobile(buyPhone); @@ -296,13 +297,13 @@ public class InspectionInfoServiceImpl extends ServiceImpl workOrder(Long partnerId, String carNum, String goodsTitle,String customerSource,String payType,String startTime,Long roleId,String endTime){ - return baseMapper.workOrder(partnerId,carNum,goodsTitle, customerSource, payType, startTime,roleId,endTime); + public List workOrder(Page page,Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime){ + return baseMapper.workOrder(page,partnerId,carNum,goodsTitle, customerSource, payType, startTime,roleId,endTime); } @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); + public List delworkOrder(Page page,Long partnerId, String carNum, String goodsTitle,String customerSource,String payType,String startTime,Long roleId,String endTime){ + return baseMapper.delworkOrder(page,partnerId,carNum,goodsTitle, customerSource, payType, startTime,roleId,endTime); } @Override diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/controller/PartnerCustomerInfoController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/controller/PartnerCustomerInfoController.java index a0e0b6da..12f3f803 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/controller/PartnerCustomerInfoController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/controller/PartnerCustomerInfoController.java @@ -3,11 +3,14 @@ package cn.iocoder.yudao.module.partner.controller; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.module.core.controller.BaseController; import cn.iocoder.yudao.module.core.page.TableDataInfo; +import cn.iocoder.yudao.module.core.text.Convert; +import cn.iocoder.yudao.module.core.text.ServletUtils; import cn.iocoder.yudao.module.inspection.service.AppInspectionPartnerService; import cn.iocoder.yudao.module.partner.entity.PartnerCustomerInfo; import cn.iocoder.yudao.module.partner.service.IPartnerCustomerInfoService; import cn.iocoder.yudao.module.shop.entity.ShopMallPartners; import cn.iocoder.yudao.util.ExcelUtil; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; @@ -35,8 +38,10 @@ public class PartnerCustomerInfoController extends BaseController public TableDataInfo list(PartnerCustomerInfo partnerCustomerInfo) throws Exception { ShopMallPartners partners = partnerService.shopInfo(); partnerCustomerInfo.setPartnerId(partners.getPartnerId()); - startPage(); - List list = partnerCustomerInfoService.selectPartnerCustomerInfoList(partnerCustomerInfo); + int pageNum = Convert.toInt(ServletUtils.getParameter("pageNum"), 1); + int pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10); + Page page = new Page<>(pageNum,pageSize); + List list = partnerCustomerInfoService.selectPartnerCustomerInfoList(page,partnerCustomerInfo); return getDataTable(list); } @@ -47,7 +52,8 @@ public class PartnerCustomerInfoController extends BaseController @PostMapping("/export") public void export(HttpServletResponse response, PartnerCustomerInfo partnerCustomerInfo) { - List list = partnerCustomerInfoService.selectPartnerCustomerInfoList(partnerCustomerInfo); + Page page = new Page<>(); + List list = partnerCustomerInfoService.selectPartnerCustomerInfoList(page,partnerCustomerInfo); ExcelUtil util = new ExcelUtil(PartnerCustomerInfo.class); util.exportExcel(response, list, "客户信息数据"); } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/mapper/PartnerCustomerInfoMapper.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/mapper/PartnerCustomerInfoMapper.java index 16287e3b..675870a2 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/mapper/PartnerCustomerInfoMapper.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/mapper/PartnerCustomerInfoMapper.java @@ -3,7 +3,9 @@ package cn.iocoder.yudao.module.partner.mapper; import cn.iocoder.yudao.module.partner.entity.PartnerCustomerInfo; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -22,7 +24,7 @@ public interface PartnerCustomerInfoMapper extends BaseMapper selectPartnerCustomerInfoList(PartnerCustomerInfo partnerCustomerInfo); + public List selectPartnerCustomerInfoList(Page page ,@Param("vo") PartnerCustomerInfo partnerCustomerInfo); /** * 查询客户信息 diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/service/IPartnerCustomerInfoService.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/service/IPartnerCustomerInfoService.java index ac993eee..bbd74f99 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/service/IPartnerCustomerInfoService.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/service/IPartnerCustomerInfoService.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.partner.service; import cn.iocoder.yudao.module.partner.entity.PartnerCustomerInfo; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import java.util.List; @@ -19,7 +20,7 @@ public interface IPartnerCustomerInfoService extends IService selectPartnerCustomerInfoList(PartnerCustomerInfo partnerCustomerInfo); + public List selectPartnerCustomerInfoList(Page page ,PartnerCustomerInfo partnerCustomerInfo); /** * 查询客户信息 diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/service/impl/PartnerCustomerInfoServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/service/impl/PartnerCustomerInfoServiceImpl.java index 96692d41..a79f8124 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/service/impl/PartnerCustomerInfoServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/service/impl/PartnerCustomerInfoServiceImpl.java @@ -17,6 +17,7 @@ import cn.iocoder.yudao.module.system.service.user.AdminUserService; import cn.iocoder.yudao.util.DateUtils; import cn.iocoder.yudao.util.StringUtils; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.apache.commons.lang3.ObjectUtils; import org.springframework.beans.BeanUtils; @@ -56,13 +57,11 @@ public class PartnerCustomerInfoServiceImpl extends ServiceImpl selectPartnerCustomerInfoList(PartnerCustomerInfo partnerCustomerInfo) + public List selectPartnerCustomerInfoList(Page page ,PartnerCustomerInfo partnerCustomerInfo) { - List partnerCustomerInfos = baseMapper.selectPartnerCustomerInfoList(partnerCustomerInfo); + List partnerCustomerInfos = baseMapper.selectPartnerCustomerInfoList(page,partnerCustomerInfo); for (PartnerCustomerInfo customerInfo : partnerCustomerInfos) { - LambdaQueryWrapper queryWrapper1 =new LambdaQueryWrapper<>(); - queryWrapper1.eq(ShopUserCar::getUserId,customerInfo.getUserId()); - List list = userCarService.list(queryWrapper1); + List list = userCarService.selectUserCarsByUserId(customerInfo.getUserId()); if (CollectionUtil.isNotEmpty(list)){ customerInfo.setUserCarList(list); }else { @@ -105,11 +104,13 @@ public class PartnerCustomerInfoServiceImpl extends ServiceImpl ids = new HashSet<>(); ids.add(role.getId()); permissionService.assignUserRole(uid,ids); @@ -182,14 +183,12 @@ public class PartnerCustomerInfoServiceImpl extends ServiceImpl queryWrapper1 =new LambdaQueryWrapper<>(); - queryWrapper1.eq(ShopUserCar::getUserId,partnerCustomerInfo.getUserId()); - userCarService.remove(queryWrapper1); + userCarService.deleteShopUserCarByUserId(partnerCustomerInfo.getUserId()); userCarService.saveBatch(userCarList); } if (!StringUtils.isEmpty(partnerCustomerInfo.getCustomerPhone())&&!StringUtils.isEmpty(partnerCustomerInfo.getRoleCode())){ AdminUserDO sysUser = userService.selectUserByPhone(partnerCustomerInfo.getCustomerPhone()); - RoleDO sysRole = roleService.queryRole(partnerCustomerInfo.getRoleCode()); +// RoleDO sysRole = roleService.queryRole(partnerCustomerInfo.getRoleCode()); if (ObjectUtils.isNotEmpty(sysUser)){ Set ids = new HashSet(); diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/payment/controller/OrderController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/payment/controller/OrderController.java index 0d80f77d..2273e484 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/payment/controller/OrderController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/payment/controller/OrderController.java @@ -6,6 +6,8 @@ import cn.iocoder.yudao.module.core.controller.BaseController; import cn.iocoder.yudao.module.core.page.PageDomain; import cn.iocoder.yudao.module.core.page.TableDataInfo; import cn.iocoder.yudao.module.core.page.TableSupport; +import cn.iocoder.yudao.module.core.text.Convert; +import cn.iocoder.yudao.module.core.text.ServletUtils; import cn.iocoder.yudao.module.inspection.service.AppInspectionPartnerService; import cn.iocoder.yudao.module.payment.entity.OrderInfo; import cn.iocoder.yudao.module.payment.entity.commentVo; @@ -119,8 +121,10 @@ public class OrderController extends BaseController { */ @GetMapping("/orderListSystem") public TableDataInfo orderListSystem(OrderInfo shopInspectionOrder) { - startPage(); - List list = orderInfoService.orderListSystem(shopInspectionOrder); + int pageNum = Convert.toInt(ServletUtils.getParameter("pageNum"), 1); + int pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10); + Page page = new Page<>(pageNum,pageSize); + List list = orderInfoService.orderListSystem(page,shopInspectionOrder); return getDataTable(list); } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/payment/mapper/OrderInfoMapper.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/payment/mapper/OrderInfoMapper.java index 45067268..4d74e66d 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/payment/mapper/OrderInfoMapper.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/payment/mapper/OrderInfoMapper.java @@ -29,7 +29,7 @@ public interface OrderInfoMapper extends BaseMapper { List inspectionList(@Param("status") String status, @Param("userId")Long userId); - List orderListSystem(OrderInfo orderInfo); + List orderListSystem(Page page,@Param("vo") OrderInfo orderInfo); List statisticsZXTMonth(@Param("partnerId") Long partnerId,@Param("startTime")String startTime,@Param("endTime")String 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 f51c33f6..a2ff0c92 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 @@ -20,10 +20,10 @@ import java.util.Map; public interface OrderInfoService extends IService { void reviewOrder(String orderId,Integer starLevel,String reviewStr) throws Exception; List orderListApp(String status, String title, String type); - List workOrder(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime); + List workOrder(Page page,Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime); 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); - List orderListSystem(OrderInfo orderInfo); + List delworkOrder(Page page,Long partnerId,String carNum,String goodsTitle,String customerSource,String payType,String startTime,Long roleId,String endTime); + List orderListSystem(Page page,OrderInfo orderInfo); Long createOrder(OrderInfo orderInfo) throws Exception; JSONObject pickCarDetail(Long pickCarId); 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 09d41d6e..d1b75c4c 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 @@ -106,14 +106,14 @@ public class OrderInfoServiceImpl extends ServiceImpl workOrder(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime) { + public List workOrder(Page page,Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime) { if (StringUtils.isNotEmpty(startTime)){ startTime = startTime+" 00:00:00"; } if (StringUtils.isNotEmpty(endTime)){ endTime = endTime+" 23:59:59"; } - return iInspectionInfoService.workOrder(partnerId,carNum,goodsTitle, customerSource, payType, startTime, roleId,endTime); + return iInspectionInfoService.workOrder(page,partnerId,carNum,goodsTitle, customerSource, payType, startTime, roleId,endTime); } @Override @@ -128,19 +128,19 @@ public class OrderInfoServiceImpl extends ServiceImpl delworkOrder(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime) { + public List delworkOrder(Page page,Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime) { if (StringUtils.isNotEmpty(startTime)){ startTime = startTime+" 00:00:00"; } if (StringUtils.isNotEmpty(endTime)){ endTime = endTime+" 23:59:59"; } - return iInspectionInfoService.delworkOrder(partnerId,carNum,goodsTitle, customerSource, payType, startTime, roleId,endTime); + return iInspectionInfoService.delworkOrder(page,partnerId,carNum,goodsTitle, customerSource, payType, startTime, roleId,endTime); } @Override - public List orderListSystem(OrderInfo orderInfo) { - return baseMapper.orderListSystem(orderInfo); + public List orderListSystem(Page page,OrderInfo orderInfo) { + return baseMapper.orderListSystem(page,orderInfo); } @Override diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/shop/mapper/ShopUserCarMapper.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/shop/mapper/ShopUserCarMapper.java index afc38a46..e095f32e 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/shop/mapper/ShopUserCarMapper.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/shop/mapper/ShopUserCarMapper.java @@ -73,4 +73,6 @@ public interface ShopUserCarMapper extends BaseMapper List getDbCars(Long userId); ShopUserCar selectUserCarsByUserIdCarNum(@Param("userId") Long userId,@Param("carNum") String carNum); + + void deleteShopUserCarByUserId(Long userId); } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/shop/service/IShopUserCarService.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/shop/service/IShopUserCarService.java index 0a46a65b..5486d7f7 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/shop/service/IShopUserCarService.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/shop/service/IShopUserCarService.java @@ -74,4 +74,6 @@ public interface IShopUserCarService extends IService JSONObject appVehicleLicenseOCR2(String imagePath) throws Exception; void infoCardOCR( String imagePath) throws TencentCloudSDKException; JSONObject getInfoCard(); + + void deleteShopUserCarByUserId(Long userId); } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/shop/service/impl/ShopUserCarServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/shop/service/impl/ShopUserCarServiceImpl.java index d925bbd6..d1b20ee9 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/shop/service/impl/ShopUserCarServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/shop/service/impl/ShopUserCarServiceImpl.java @@ -399,6 +399,12 @@ public class ShopUserCarServiceImpl extends ServiceImpl diff --git a/dl-module-inspection/src/main/resources/mapper/shop/ShopUserCarMapper.xml b/dl-module-inspection/src/main/resources/mapper/shop/ShopUserCarMapper.xml index ff601c5c..a78d20a2 100644 --- a/dl-module-inspection/src/main/resources/mapper/shop/ShopUserCarMapper.xml +++ b/dl-module-inspection/src/main/resources/mapper/shop/ShopUserCarMapper.xml @@ -152,7 +152,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{carId} - + + delete from shop_user_car + where user_id = #{userId} +