From ffe210bb65e747d45d1ffe97aadb773fc822bfa8 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Mon, 8 Jul 2024 14:53:15 +0800 Subject: [PATCH] =?UTF-8?q?1.bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basicdata/vo/BasicdataDriverArteryVO.java | 2 ++ .../feign/BasicdataDriverArteryClient.java | 14 ++++++++++++-- .../mapper/BasicdataDriverArteryMapper.java | 2 +- .../mapper/BasicdataDriverArteryMapper.xml | 16 +++++++++++++--- .../service/IBasicdataDriverArteryService.java | 2 +- .../impl/BasicdataDriverArteryServiceImpl.java | 2 +- .../service/impl/InComingServiceImpl.java | 2 +- .../impl/TrunklineCarsLoadServiceImpl.java | 4 +++- 8 files changed, 34 insertions(+), 10 deletions(-) diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataDriverArteryVO.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataDriverArteryVO.java index cc0b60a30..72de2c0ae 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataDriverArteryVO.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataDriverArteryVO.java @@ -42,6 +42,8 @@ public class BasicdataDriverArteryVO extends BasicdataDriverArteryEntity { @ApiModelProperty(value = "车辆信息") private String bindVehicles; + private String carNumbers; + /** * 司机关联车辆列表 */ diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataDriverArteryClient.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataDriverArteryClient.java index c88cda213..a40942a87 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataDriverArteryClient.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataDriverArteryClient.java @@ -22,15 +22,18 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.logpm.basicdata.entity.BasicdataDriverArteryEntity; import com.logpm.basicdata.mapper.BasicdataDriverArteryMapper; import com.logpm.basicdata.service.IBasicdataDriverArteryService; +import com.logpm.basicdata.vo.BasicdataDriverArteryVO; import lombok.AllArgsConstructor; import org.springblade.core.mp.support.BladePage; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.utils.StringUtil; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import springfox.documentation.annotations.ApiIgnore; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; /** @@ -69,14 +72,21 @@ public class BasicdataDriverArteryClient implements IBasicdataDriverArteryClient @Override public List findDriverListByName(String driverName) { - List ls = basicdataDriverArteryService.findDriverListByName(driverName); + List ls = basicdataDriverArteryService.findDriverListByName(driverName); List list = new ArrayList<>(); - for (BasicdataDriverArteryEntity driverArteryEntity:ls){ + for (BasicdataDriverArteryVO driverArteryEntity:ls){ JSONObject jsonObject = new JSONObject(); jsonObject.put("driverId",driverArteryEntity.getId()); jsonObject.put("driverName",driverArteryEntity.getName()); jsonObject.put("driverPhone",driverArteryEntity.getPhone()); jsonObject.put("driverType",driverArteryEntity.getType()); + String carNumbers = driverArteryEntity.getCarNumbers(); + List carNumberList = new ArrayList<>(); + if(StringUtil.isNotBlank(carNumbers)){ + String[] split = carNumbers.split(","); + carNumberList.addAll(Arrays.asList(split)); + } + jsonObject.put("carNumberList",carNumberList); list.add(jsonObject); } return list; diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.java index 30313b661..ef8b4701a 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.java @@ -57,7 +57,7 @@ public interface BasicdataDriverArteryMapper extends BaseMapper selectBasicdataDictionary(); - List findDriverListByName(@Param("driverName") String driverName); + List findDriverListByName(@Param("driverName") String driverName); void updateIsdeletedByPhone(@Param("phone") String phone); diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.xml index 3364c88b2..3045fbc95 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.xml +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.xml @@ -157,10 +157,20 @@ SELECT id,name,bind_vehicle FROM logpm_basicdata_driver_artery - + select lbda.id id, + lbda.name name, + lbda.phone phone, + lbda.type type, + group_concat(lbv.vehicle_nub) carNumbers + from logpm_basicdata_driver_artery lbda + left join logpm_basicdata_drivermiddle lbdm on lbdm.driver_id = lbda.id + left join logpm_basicdata_vehicle lbv on lbv.id = lbdm.brand_id where `name` like concat('%',#{driverName},'%') + group by lbda.id, + lbda.name, + lbda.phone, + lbda.type limit 10