From b5922f6654676163d4b479e317b11ee610a8c067 Mon Sep 17 00:00:00 2001 From: "0.0" <1092404103.qq.com> Date: Tue, 8 Aug 2023 21:12:59 +0800 Subject: [PATCH] =?UTF-8?q?1.=E8=BF=94=E5=9B=9E=E5=AD=97=E5=85=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/constant/DictBizConstant.java | 2 + .../basicdata/vo/BasicdataGoodsAreaVO.java | 8 +++ .../BasicdataGoodsAreaController.java | 3 +- .../feign/BasicdataDriverArteryClient.java | 12 +++++ .../wrapper/WarehouseGoodsAreaWrapper.java | 54 +++++++++++++++++++ 5 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/wrapper/WarehouseGoodsAreaWrapper.java diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/DictBizConstant.java b/blade-biz-common/src/main/java/org/springblade/common/constant/DictBizConstant.java index a009871c8..6d9af25be 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/constant/DictBizConstant.java +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/DictBizConstant.java @@ -47,6 +47,8 @@ public class DictBizConstant { public static final String DISTRIBUTION_DELIVERY_KiIND = "distribution_deliverylist_kind";//配送种类 + public static final String AREA_TYPE = "area_type";//货区类型 + diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataGoodsAreaVO.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataGoodsAreaVO.java index 7818c54f3..37cf6950e 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataGoodsAreaVO.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataGoodsAreaVO.java @@ -46,6 +46,14 @@ public class BasicdataGoodsAreaVO extends BasicdataGoodsAreaEntity { private String name; private Boolean leaf; + /** + * 创建人(值) + */ + private String createUserName; + /** + * 货区类型(值) + */ + private String areaTypeName; diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAreaController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAreaController.java index 9f9b03e0f..7d652f31f 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAreaController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAreaController.java @@ -22,6 +22,7 @@ import com.logpm.basicdata.service.IBasicdataGoodsAreaService; import com.logpm.basicdata.vo.BasicdataGoodsAreaVO; import com.logpm.basicdata.vo.BasicdataNodeVO; import com.logpm.basicdata.vo.BasicdataWarehouseVO; +import com.logpm.basicdata.wrapper.WarehouseGoodsAreaWrapper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -80,7 +81,7 @@ public class BasicdataGoodsAreaController extends BladeController { IPage page = Condition.getPage(query); IPage list = basicdataGoodsAreaService.getBasicdataGoodsAreaList(basicdataGoodsArea,page); // IPage pages = basicdataGoodsAreaService.page(Condition.getPage(query), Condition.getQueryWrapper(basicdataGoodsArea, BasicdataGoodsAreaEntity.class)); - return R.data(list); + return R.data(WarehouseGoodsAreaWrapper.build().pageVO(list)); } 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 319b097dd..ed62a3234 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 @@ -16,7 +16,9 @@ */ package com.logpm.basicdata.feign; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.basicdata.mapper.BasicdataDriverArteryMapper; import lombok.AllArgsConstructor; import org.springblade.core.mp.support.BladePage; import org.springblade.core.mp.support.Condition; @@ -39,6 +41,7 @@ import springfox.documentation.annotations.ApiIgnore; public class BasicdataDriverArteryClient implements IBasicdataDriverArteryClient { private final IBasicdataDriverArteryService basicdataDriverArteryService; + private final BasicdataDriverArteryMapper basicdataDriverArteryMapper; @Override @GetMapping(TOP) @@ -50,4 +53,13 @@ public class BasicdataDriverArteryClient implements IBasicdataDriverArteryClient return BladePage.of(page); } + @Override + @GetMapping(GETENTITY) + public BasicdataDriverArteryEntity getDriverArtery(Long id) { + BasicdataDriverArteryEntity basicdataDriverArteryEntity = basicdataDriverArteryMapper.selectOne(new QueryWrapper().lambda() + .eq(BasicdataDriverArteryEntity::getUserId,id) + ); + return basicdataDriverArteryEntity; + } + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/wrapper/WarehouseGoodsAreaWrapper.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/wrapper/WarehouseGoodsAreaWrapper.java new file mode 100644 index 000000000..2a9b5529b --- /dev/null +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/wrapper/WarehouseGoodsAreaWrapper.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.basicdata.wrapper; + +import com.logpm.basicdata.entity.BasicdataGoodsAreaEntity; +import com.logpm.basicdata.vo.BasicdataGoodsAreaVO; +import lombok.extern.log4j.Log4j; +import lombok.extern.log4j.Log4j2; +import org.springblade.common.constant.DictBizConstant; +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.SpringUtil; +import org.springblade.system.cache.DictBizCache; +import org.springblade.system.feign.IUserClient; + +import java.util.Objects; + +/** + * 货区 包装类,返回视图层所需的字段 + * + * @author lmy + * @since 2023-08-08 + */ + +public class WarehouseGoodsAreaWrapper extends BaseEntityWrapper { + IUserClient userCliient = SpringUtil.getBean(IUserClient.class); + public static WarehouseGoodsAreaWrapper build() { + return new WarehouseGoodsAreaWrapper(); + } + + @Override + public BasicdataGoodsAreaVO entityVO(BasicdataGoodsAreaVO warehouseWaybill) { + BasicdataGoodsAreaVO basicdataGoodsAreaVO = Objects.requireNonNull(BeanUtil.copy(warehouseWaybill, BasicdataGoodsAreaVO.class)); + basicdataGoodsAreaVO.setCreateUserName(userCliient.userInfoById(basicdataGoodsAreaVO.getCreateUser()).getData().getName()); + basicdataGoodsAreaVO.setAreaTypeName(DictBizCache.getValue(DictBizConstant.AREA_TYPE,basicdataGoodsAreaVO.getAreaType())); + return basicdataGoodsAreaVO; + } + + +}