From 4e5a0d3f6357d01cf09992f95e678b18d6ba9b67 Mon Sep 17 00:00:00 2001 From: PQZ Date: Fri, 20 Sep 2024 00:16:25 +0800 Subject: [PATCH 1/2] 1 --- .../ShopInspectionGoodsController.java | 26 +++------ .../payment/mapper/OrderInfoMapper.java | 35 +++++++---- .../payment/service/OrderInfoService.java | 30 ++++++++-- .../service/impl/OrderInfoServiceImpl.java | 15 +++++ .../mapper/payment/OrderInfoMapper.xml | 58 +++++++++++++++++++ 5 files changed, 131 insertions(+), 33 deletions(-) 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 e5b4a5dc..c8ff1d90 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 @@ -21,8 +21,8 @@ import cn.iocoder.yudao.module.inspection.service.AppInspectionPartnerService; 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.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.github.pagehelper.IPage; import com.github.pagehelper.PageHelper; import org.apache.commons.lang3.ObjectUtils; import org.springframework.context.annotation.Lazy; @@ -172,7 +172,9 @@ public class ShopInspectionGoodsController extends BaseController * 查询检测订单列表 */ @GetMapping("/partnerOrderListSystem") - public TableDataInfo partnerOrderListSystem(OrderInfo shopInspectionOrder) throws Exception { + public CommonResult> partnerOrderListSystem(OrderInfo shopInspectionOrder, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) throws Exception { LoginUser user = SecurityFrameworkUtils.getLoginUser(); Set userRoleIdListByUserId = permissionService.getUserRoleIdListByUserId(user.getId()); List roleList = roleService.getRoleList(userRoleIdListByUserId); @@ -184,33 +186,21 @@ public class ShopInspectionGoodsController extends BaseController queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0"); partner = appInspectionPartnerService.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()); } shopInspectionOrder.setPartnerId(partner.getPartnerId()); shopInspectionOrder.setValidationTime(new Date()); - int pageNum = Convert.toInt(ServletUtils.getParameter("pageNum"), 1); - int pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10); -// Page page = new Page<>(pageNum,pageSize); - startPage(); - List list = orderInfoService.orderListSystem(shopInspectionOrder); - return getDataTable(list); + Page page = new Page<>(pageNo, pageSize); + return CommonResult.success(orderInfoService.queryListPage(shopInspectionOrder,page)); } 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 d9f3abcf..51de851c 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 @@ -1,10 +1,13 @@ package cn.iocoder.yudao.module.payment.mapper; import cn.iocoder.yudao.module.inspection.entity.InspectionInfo; +import cn.iocoder.yudao.module.label.vo.LabelPageReqVO; +import cn.iocoder.yudao.module.label.vo.LabelRespVO; import cn.iocoder.yudao.module.payment.entity.OrderInfo; import cn.iocoder.yudao.module.payment.entity.commentVo; 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; @@ -19,30 +22,42 @@ import java.util.List; */ @Mapper public interface OrderInfoMapper extends BaseMapper { - List orderListApp(@Param("userId") Long userId, @Param("status") String status,@Param("title") String title,@Param("type") String type); + List orderListApp(@Param("userId") Long userId, @Param("status") String status, @Param("title") String title, @Param("type") String type); Double avgPartnerScore(@Param("partnerId") Long partnerId); - List statisticsZXTDay(@Param("partnerId") Long partnerId, @Param("startTime")String startTime, @Param("endTime")String endTime); + List statisticsZXTDay(@Param("partnerId") Long partnerId, @Param("startTime") String startTime, @Param("endTime") String endTime); List statisticsMid(); - List inspectionList(@Param("status") String status, @Param("userId")Long userId); + List inspectionList(@Param("status") String status, @Param("userId") Long userId); - List orderListSystem( OrderInfo orderInfo); + List orderListSystem(OrderInfo orderInfo); - List statisticsZXTMonth(@Param("partnerId") Long partnerId,@Param("startTime")String startTime,@Param("endTime")String endTime); + /** + * 分页查询订单 + * + * @param entity OrderInfo实体 + * @param page 分页参数 + * @return com.baomidou.mybatisplus.core.metadata.IPage + * @author PQZ + * @date 0:04 2024/9/20 + **/ + IPage pageOrderListSystem(@Param("entity") OrderInfo entity, Page page); + + List statisticsZXTMonth(@Param("partnerId") Long partnerId, @Param("startTime") String startTime, @Param("endTime") String endTime); List statisticsOrder(); - List getPartnerList(@Param("partnerName")String partnerName); + List getPartnerList(@Param("partnerName") String partnerName); - List governmentInspectionList(@Param("carNum")String carNum, @Param("status")String status, @Param("partnerId")String partnerId); + List governmentInspectionList(@Param("carNum") String carNum, @Param("status") String status, @Param("partnerId") String partnerId); - List orderList(@Param("userId") Long userId, @Param("status") String status,@Param("title") String title); + List orderList(@Param("userId") Long userId, @Param("status") String status, @Param("title") String title); - List validationListWx(Page page,@Param("validationUserId") Long validationUserId); - List validationListPc(Page page,Long partnerId); + List validationListWx(Page page, @Param("validationUserId") Long validationUserId); + + List validationListPc(Page page, Long partnerId); Integer getNoCommentOrder(@Param("userId") Long userId); 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 05bba867..5d04034e 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 @@ -2,9 +2,12 @@ package cn.iocoder.yudao.module.payment.service; import cn.iocoder.yudao.module.inspection.entity.InspectionInfo; +import cn.iocoder.yudao.module.label.vo.LabelPageReqVO; +import cn.iocoder.yudao.module.label.vo.LabelRespVO; import cn.iocoder.yudao.module.payment.entity.OrderInfo; import cn.iocoder.yudao.module.payment.entity.commentVo; 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; @@ -18,21 +21,38 @@ import java.util.Map; * @since 2023-07-24 18:30:29 */ public interface OrderInfoService extends IService { - void reviewOrder(String orderId,Integer starLevel,String reviewStr) throws Exception; + 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); - 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); + + 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); + /** + * 分页查询订单 + * + * @param orderInfo OrderInfo实体 + * @param page 分页参数 + * @return com.baomidou.mybatisplus.core.metadata.IPage + * @author PQZ + * @date 0:02 2024/9/20 + **/ + IPage queryListPage(OrderInfo orderInfo, Page page); + Long createOrder(OrderInfo orderInfo) throws Exception; + JSONObject pickCarDetail(Long pickCarId); - JSONObject orderDetail(Long goodsId,String type,String title,Integer amount); + JSONObject orderDetail(Long goodsId, String type, String title, Integer amount); void cancelPay(Long orderId); - List orderList(String status,String title); + List orderList(String status, String title); String validation(String accessCode); 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 ba9cecf6..7ccec8c6 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 @@ -24,6 +24,7 @@ import cn.iocoder.yudao.util.StringUtils; import com.alibaba.fastjson.JSONObject; 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.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.apache.commons.lang3.ObjectUtils; @@ -143,6 +144,20 @@ public class OrderInfoServiceImpl extends ServiceImpl + * @author PQZ + * @date 0:02 2024/9/20 + **/ + @Override + public IPage queryListPage(OrderInfo orderInfo, Page page) { + return baseMapper.pageOrderListSystem(orderInfo,page); + } + @Override @Transactional(rollbackFor = Exception.class) public Long createOrder(OrderInfo orderInfo) throws Exception { diff --git a/dl-module-inspection/src/main/resources/mapper/payment/OrderInfoMapper.xml b/dl-module-inspection/src/main/resources/mapper/payment/OrderInfoMapper.xml index 88fa98cb..702f3690 100644 --- a/dl-module-inspection/src/main/resources/mapper/payment/OrderInfoMapper.xml +++ b/dl-module-inspection/src/main/resources/mapper/payment/OrderInfoMapper.xml @@ -236,4 +236,62 @@ where partner_id = #{partnerId} and comment_star is not null ORDER BY comment_time desc + From f9520fc15269ef31129637fa18f90e7179a28f8f Mon Sep 17 00:00:00 2001 From: Lihx Date: Fri, 20 Sep 2024 00:17:38 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=BF=E6=8D=A2UserId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SiteInfoController.java | 63 +++++++++++++++++++ .../inspection/mapper/SiteInfoMapper.java | 8 +++ .../inspection/service/ISiteInfoService.java | 11 ++++ .../service/impl/SiteInfoServiceImpl.java | 35 +++++++++++ .../mapper/inspection/SiteInfoMapper.xml | 18 ++++++ 5 files changed, 135 insertions(+) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/SiteInfoController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/SiteInfoController.java index 0602d3ee..38cae4b0 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/SiteInfoController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/SiteInfoController.java @@ -1,6 +1,9 @@ package cn.iocoder.yudao.module.inspection.controller; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import javax.servlet.http.HttpServletResponse; import cn.iocoder.yudao.framework.common.pojo.CommonResult; @@ -121,4 +124,64 @@ public class SiteInfoController extends BaseController return success(sum); } + /** + * 修改user_id + */ + @GetMapping("/updateUserID") + public CommonResult updateUserId(){ + //Map key存放老Id,value存放新Id + Map map = new HashMap<>(); + map.put(135,4826); + map.put(855,4828); + map.put(896,4829); + map.put(900,4830); + map.put(901,4221); + map.put(902,4832); + map.put(903,123); + map.put(904,846); + map.put(905,125); + map.put(907,850); + map.put(908,845); + map.put(909,4568); + map.put(910,4839); + map.put(911,4840); + map.put(912,4841); + map.put(913,4842); + map.put(914,4843); + map.put(915,4844); + map.put(916,4845); + map.put(917,4846); + map.put(918,4847); + map.put(919,138); + map.put(920,4849); + map.put(921,4850); + map.put(924,4851); + map.put(926,4853); + map.put(927,2793); + map.put(928,4855); + map.put(929,842); + map.put(930,4857); + map.put(931,4858); + map.put(932,908); + map.put(933,4860); + map.put(934,4861); + map.put(935,4862); + map.put(936,4863); + + int sum = 0; + //遍历Map,获得key和value + for (Map.Entry userId : map.entrySet()) { + Integer oldUserId = userId.getKey(); + Integer newUserId = userId.getValue(); + sum +=siteInfoService.updateUserId1(newUserId ,oldUserId); + sum +=siteInfoService.updateUserId2(newUserId ,oldUserId); + sum +=siteInfoService.updateUserId3(newUserId ,oldUserId); + sum +=siteInfoService.updateUserId4(newUserId ,oldUserId); + sum +=siteInfoService.updateUserId5(newUserId ,oldUserId); + } + + return success(sum); + } + + } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/SiteInfoMapper.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/SiteInfoMapper.java index 34e51f1a..9d7b0e0b 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/SiteInfoMapper.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/SiteInfoMapper.java @@ -80,4 +80,12 @@ public interface SiteInfoMapper */ public int addAll(NweUsers user); + /** + * 修改user_id + */ + public int updateUserId1(@Param("newUserId") int newUserId,@Param("oldUserId") int oldUserId); + public int updateUserId2(@Param("newUserId") int newUserId,@Param("oldUserId") int oldUserId); + public int updateUserId3(@Param("newUserId") int newUserId,@Param("oldUserId") int oldUserId); + public int updateUserId4(@Param("newUserId") int newUserId,@Param("oldUserId") int oldUserId); + public int updateUserId5(@Param("newUserId") int newUserId,@Param("oldUserId") int oldUserId); } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/ISiteInfoService.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/ISiteInfoService.java index e137eddc..ac9533a9 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/ISiteInfoService.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/ISiteInfoService.java @@ -78,4 +78,15 @@ public interface ISiteInfoService public int addNewDB(NweUsers user); + /** + * 修改user_id + */ + public int updateUserId1(int newUserId,int oldUserId); + public int updateUserId2(int newUserId,int oldUserId); + public int updateUserId3(int newUserId,int oldUserId); + public int updateUserId4(int newUserId,int oldUserId); + public int updateUserId5(int newUserId,int oldUserId); + + + } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/SiteInfoServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/SiteInfoServiceImpl.java index 4951c95a..cc9aad2b 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/SiteInfoServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/SiteInfoServiceImpl.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.inspection.service.impl; import java.util.List; +import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore; import cn.iocoder.yudao.module.inspection.entity.NweUsers; import cn.iocoder.yudao.util.DateUtils; import com.alibaba.fastjson.JSONObject; @@ -124,5 +125,39 @@ public class SiteInfoServiceImpl implements ISiteInfoService return siteInfoMapper.addAll(user); } + /** + * 修改user_id 5个SQL + */ + @Override + @TenantIgnore + public int updateUserId1(int newUserId, int oldUserId) { + return siteInfoMapper.updateUserId1(newUserId, oldUserId); + } + + @Override + @TenantIgnore + public int updateUserId2(int newUserId, int oldUserId) { + return siteInfoMapper.updateUserId2(newUserId, oldUserId); + } + + @Override + @TenantIgnore + public int updateUserId3(int newUserId, int oldUserId) { + return siteInfoMapper.updateUserId3(newUserId, oldUserId); + } + + @Override + @TenantIgnore + public int updateUserId4(int newUserId, int oldUserId) { + return siteInfoMapper.updateUserId4(newUserId, oldUserId); + } + + @Override + @TenantIgnore + public int updateUserId5(int newUserId, int oldUserId) { + return siteInfoMapper.updateUserId5(newUserId, oldUserId); + } + + } diff --git a/dl-module-inspection/src/main/resources/mapper/inspection/SiteInfoMapper.xml b/dl-module-inspection/src/main/resources/mapper/inspection/SiteInfoMapper.xml index 019a493e..5e4dbfc5 100644 --- a/dl-module-inspection/src/main/resources/mapper/inspection/SiteInfoMapper.xml +++ b/dl-module-inspection/src/main/resources/mapper/inspection/SiteInfoMapper.xml @@ -153,5 +153,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + update rescue_info set user_id = #{newUserId} where user_id = #{oldUserId} + + + + update rescue_order_info set validation_user_id = #{newUserId} where user_id = #{oldUserId} + + + + update rescue_order_info set user_id = #{newUserId} where user_id = #{oldUserId} + + + update rescue_order_return set user_id = #{newUserId} where user_id = #{oldUserId} + + + update driver_info set user_id = #{newUserId} where user_id = #{oldUserId} + +