From cb2b53c615599ae0ca50fbdaa2de83be047c94fe Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期四, 14 四月 2022 15:13:50 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/lyq_battery_shop' into lyq_battery_shop

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComChangeCarModelRelationServiceImpl.java |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComChangeCarModelRelationServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComChangeCarModelRelationServiceImpl.java
index 81ad177..e45ac7f 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComChangeCarModelRelationServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComChangeCarModelRelationServiceImpl.java
@@ -1,6 +1,9 @@
 package com.panzhihua.service_community.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.panzhihua.common.model.vos.common.ComChangeCarModelRelationVo;
+import com.panzhihua.common.model.vos.common.ComChangeCarModelVo;
 import com.panzhihua.service_community.entity.ComChangeCarModelRelation;
 import com.panzhihua.service_community.dao.ComChangeCarModelRelationMapper;
 import com.panzhihua.service_community.service.ComChangeCarModelRelationService;
@@ -10,6 +13,8 @@
 import com.panzhihua.common.model.vos.R;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+
+import java.util.List;
 
 /**
  * title: 换新车-车型与规格关联表表服务实现类
@@ -48,7 +53,7 @@
     @Override
     public R insert(AddComChangeCarModelRelationDto comChangeCarModelRelation) {
         ComChangeCarModelRelation entity = this.baseMapper.selectOne(new QueryWrapper<ComChangeCarModelRelation>().lambda()
-                .eq(ComChangeCarModelRelation::getModelId,comChangeCarModelRelation.getModelSpecsId())
+                .eq(ComChangeCarModelRelation::getModelId,comChangeCarModelRelation.getModelId())
                 .eq(ComChangeCarModelRelation::getModelSpecsId,comChangeCarModelRelation.getModelSpecsId()));
         if(entity == null){
             entity = new ComChangeCarModelRelation();
@@ -142,6 +147,12 @@
      */
     @Override
     public R queryByAppletsPage(PageComChangeCarModelRelationDto comChangeCarModelRelation) {
-        return R.ok(this.baseMapper.queryAllByAppletsLimit(comChangeCarModelRelation, new Page(comChangeCarModelRelation.getPageNum(), comChangeCarModelRelation.getPageSize())));
+        IPage<ComChangeCarModelVo> carModelVoIPage = this.baseMapper.queryAllByAppletsLimit(comChangeCarModelRelation, new Page(comChangeCarModelRelation.getPageNum(), comChangeCarModelRelation.getPageSize()));
+        carModelVoIPage.getRecords().forEach(carModel -> {
+            //查询车型规格列表
+            List<ComChangeCarModelRelationVo> carModelRelationVoList = this.baseMapper.queryAllByModelId(carModel.getId());
+            carModel.setCarModelRelationList(carModelRelationVoList);
+        });
+        return R.ok(carModelVoIPage);
     }
 }

--
Gitblit v1.7.1