From 006668f1a41528c242300440e6d33e055f97f260 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Tue, 30 Jul 2024 17:52:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E5=95=86=E5=9C=BA?= =?UTF-8?q?=E7=9A=84=E4=BB=93=E5=BA=93=E4=BF=A1=E6=81=AF=EF=BC=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E4=BB=93=E5=BA=93=E8=AE=A2=E5=8D=95=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=20=E5=A2=9E=E5=8A=A0=E5=95=86=E5=AE=B6=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E7=9A=84=E5=AF=BC=E5=87=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/BasicdataWarehouseServiceImpl.java | 8 + .../DistributionStockArticleController.java | 27 +- .../controller/MallOrderController.java | 97 +++++ .../DistributionStockArticleMapper.java | 8 +- .../mapper/DistributionStockArticleMapper.xml | 384 ++++++++++++++---- .../IDistributionStockArticleService.java | 7 + .../DistributionStockArticleServiceImpl.java | 70 +++- .../DistributionStockArticleWrapper.java | 9 +- 8 files changed, 505 insertions(+), 105 deletions(-) create mode 100644 blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/MallOrderController.java diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java index 556689432..e5043d769 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java @@ -200,9 +200,17 @@ public class BasicdataWarehouseServiceImpl extends BaseServiceImpl(); for (BasicdataStorageServicesEntity basicdataStorageServicesEntity : basicdataStorageServicesEntities) { + + BasicdataWarehouseEntity basicdataWarehouseEntity = new BasicdataWarehouseEntity(); basicdataWarehouseEntity.setId(basicdataStorageServicesEntity.getServeWarehouseId()); basicdataWarehouseEntity.setName(basicdataStorageServicesEntity.getServeWarehouseName()); + + // 判断当前的集合中 这个仓库ID是否存在 + if (results.stream().anyMatch(r -> r.getId().equals(basicdataStorageServicesEntity.getServeWarehouseId()))) { + continue; + } + results.add(basicdataWarehouseEntity); } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java index 9493e7933..8d0d9cdc9 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java @@ -266,32 +266,7 @@ public class DistributionStockArticleController extends BladeController { /** * 配送在库订单--客户版本 分页 */ - @GetMapping("/clientList") - @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入distributionStockArticle") - public R> clientList(@ApiIgnore DistributionStockArticleVO distributionStockArticle, Query query) { -// BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); -// if (Func.isEmpty(myCurrentWarehouse)){ -// return R.fail("无仓库信息!!!"); -// } - //获取当前登录人仓库 -// List myWatchWarehouse = warehouseClient.getMyWatchWarehouse(); -// List collect = myWatchWarehouse.stream() -// .map(BasicdataWarehouseEntity::getId) -// .collect(Collectors.toList()); -// distributionStockArticle.setWarehouseIdList(collect); - // 得到当前登录用户的Id - List basicdataClientUserEntityListByUserIds = basicdataClientClient.getBasicdataClientUserEntityListByUserId(AuthUtil.getUserId()); - List clientIds = null; - if (Func.isNotEmpty(basicdataClientUserEntityListByUserIds)) { - clientIds = basicdataClientUserEntityListByUserIds.stream().map(BasicdataClientUserEntity::getClientId).collect(Collectors.toList()); - distributionStockArticle.setClientIds(clientIds); - } else { - return null; - } - IPage pages = distributionStockArticleService.selectClientListPage(Condition.getPage(query), distributionStockArticle); - return R.data(DistributionStockArticleWrapper.build().pageVO(pages)); - } + /** diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/MallOrderController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/MallOrderController.java new file mode 100644 index 000000000..17a5cdfd9 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/MallOrderController.java @@ -0,0 +1,97 @@ +package com.logpm.distribution.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.logpm.basicdata.entity.BasicdataClientUserEntity; +import com.logpm.basicdata.feign.IBasicdataClientClient; +import com.logpm.basicdata.feign.IBasicdataWarehouseClient; +import com.logpm.distribution.entity.DistributionStockArticleEntity; +import com.logpm.distribution.excel.DistributionStockArticleExcel; +import com.logpm.distribution.service.IDistributionStockArticleService; +import com.logpm.distribution.vo.DistributionStockArticleVO; +import com.logpm.distribution.wrapper.DistributionStockArticleWrapper; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.excel.util.ExcelUtil; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.secure.BladeUser; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.DateUtil; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import springfox.documentation.annotations.ApiIgnore; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 商家订单控制器 + * @date 2019/07/01 + * @author pref + */ +@RestController +@Slf4j +@AllArgsConstructor +@RequestMapping("/maill") +@Api(value = "商场在库订单", tags = "配送在库订单接口") +public class MallOrderController extends BladeController { + private final IDistributionStockArticleService distributionStockArticleService; + + private final IBasicdataClientClient basicdataClientClient; + + private IBasicdataWarehouseClient warehouseClient; + @GetMapping("/clientList") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入distributionStockArticle") + public R> clientList(@ApiIgnore DistributionStockArticleVO distributionStockArticle, Query query) { + + try { + // 得到当前登录用户的Id + List basicdataClientUserEntityListByUserIds = basicdataClientClient.getBasicdataClientUserEntityListByUserId(AuthUtil.getUserId()); + List clientIds = null; + if (Func.isNotEmpty(basicdataClientUserEntityListByUserIds)) { + clientIds = basicdataClientUserEntityListByUserIds.stream().map(BasicdataClientUserEntity::getClientId).collect(Collectors.toList()); + distributionStockArticle.setClientIds(clientIds); + } else { + return null; + } + IPage pages = distributionStockArticleService.selectClientListPage(Condition.getPage(query), distributionStockArticle); + return R.data(DistributionStockArticleWrapper.build().pageVO(pages)); + }catch (Exception e){ + log.error("商场订单列表查询",e); + } + return R.fail("服务器异常"); + + } + + /** + * 导出数据 + */ + @GetMapping("/export-maillOrder") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "导出已签订单数据", notes = "传入distributionStockArticle") + public void exportMaillOrder(@ApiIgnore @RequestParam Map paramMap, BladeUser bladeUser, HttpServletResponse response) { + + List basicdataClientUserEntityListByUserIds = basicdataClientClient.getBasicdataClientUserEntityListByUserId(AuthUtil.getUserId()); + List clientIds = null; + if (Func.isNotEmpty(basicdataClientUserEntityListByUserIds)) { + clientIds = basicdataClientUserEntityListByUserIds.stream().map(BasicdataClientUserEntity::getClientId).collect(Collectors.toList()); + paramMap.put("clientIds",clientIds); + } else { + return ; + } + List list = distributionStockArticleService.exportMallOrder(paramMap); + ExcelUtil.export(response, "商场在库订单明细" + DateUtil.time(), "商场在库订单明细", list, DistributionStockArticleExcel.class); + } + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java index 77503e785..5e7d6f528 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java @@ -68,7 +68,7 @@ public interface DistributionStockArticleMapper extends BaseMapper selectClientListPage(IPage page, DistributionStockArticleVO distributionStockArticleVO); + List selectClientListPage(IPage page, DistributionStockArticleVO distributionStockArticleVO,@Param("warehouseIds") List warehouseIds); List getAllReservationStockArticleInfo(@Param("ew") Map query); @@ -220,4 +220,10 @@ public interface DistributionStockArticleMapper extends BaseMapper clearAllocationStockArticleIdList); + /** + * 商家端订单导出 + * @param paramMap + * @return + */ + List exportMallOrder(@Param("param") Map paramMap); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml index 68a99c407..8ab226c77 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml @@ -50,6 +50,88 @@ + + select ldsa.id, + ldsa.tenant_id, + ldsa.create_user, + ldsa.create_time, + ldsa.update_user, + ldsa.update_time, + ldsa.status, + ldsa.is_deleted, + ldsa.create_dept, + ldsa.incoming_num, + ldsa.service_number, + ldsa.order_code, + ldsa.mall_id, + ldsa.mall_code, + ldsa.mall_name, + ldsa.store_name, + ldsa.store_code, + ldsa.store_id, + ldsa.description_goods, + ldsa.warehouse_id, + ldsa.warehouse, + ldsa.warehouse_entry_time, + ldsa.store_time, + ldsa.total_number, + ldsa.hand_quantity, + ldsa.complete_set, + ldsa.brand, + ldsa.type_service, + ldsa.customer_name, + ldsa.customer_telephone, + ldsa.customer_address, + ldsa.genre, + ldsa.stockup_status, + ldsa.reservation_status, + ldsa.order_status, + ldsa.grounding_status, + ldsa.order_receive_status, + ldsa.freeze_status, + ldsa.notification, + ldsa.fee, + ldsa.rate, + ldsa.advance_id, + ldsa.waybill_id, + ldsa.waybill_number AS waybillNumber, + ldsa.consignee_unit, + ldsa.collect_fee, + ldsa.storage_fee, + ldsa.consignee_person, + ldsa.consignee_address, + ldsa.consignee_mobile, + ldsa.warehouse_entry_time_end, + ldsa.sorting_quantity, + ldsa.delivery_quantity, + ldsa.transfer_quantity, + ldsa.signin_quantity, + ldsa.resource, + ldsa.is_opai, + ldsa.inventory_date, + ldsa.inventory_person, + ldsa.inventory_person_id, + ldsa.available_quantity, + ldsa.is_have_data, + ldsa.stock_article_code, + group_concat(DISTINCT ldpl.dealer_name) as dealerName, + ldsa.dealer_code, + ldsa.train_number, + ldsa.factory_train, + ldsa.sending, + ldsa.send_warehouse_id, + ldsa.send_warehouse_name, + ldsa.is_zero, + ldsa.accept_warehouse_id, + ldsa.accept_warehouse_name, + ldsa.order_delivery_status, + group_concat(DISTINCT ldpl.pallet ) as trays, + group_concat(DISTINCT ldpl.goods_allocation) as allocation + + from logpm_distribution_stock_article ldsa + left join logpm_distribution_parcel_list ldpl on ldsa.id = ldpl.stock_article_id + + - SELECT * from logpm_distribution_stock_article ldsa where - ldsa.is_deleted = 0 and ldsa.type_service ='2' and ldsa.genre = '1' and ldsa.reservation_status in ('10','20') - and ldsa.order_status in ('10','20','30','70') - - and ldsa.order_code like concat(#{distributionStockArticleVO.orderCode},'%') - - - and ldsa.stockup_status = #{distributionStockArticleVO.stockupStatus} - - - and ldsa.reservation_status = #{distributionStockArticleVO.reservationStatus} - - - - - - - - - and ldsa.order_status = #{distributionStockArticleVO.orderStatus} - - - and ldsa.grounding_status = #{distributionStockArticleVO.groundingStatus} - - - and ldsa.freeze_status = #{distributionStockArticleVO.freezeStatus} - - - - and ldsa.description_goods like concat('%',#{distributionStockArticleVO.descriptionGoods},'%') - + select ldsa.id, ldsa.tenant_id, + ldsa.create_user, + ldsa.create_time, + ldsa.update_user, + ldsa.update_time, + ldsa.incoming_num AS incomingNum, + ldsa.status, ldsa.is_deleted, ldsa.create_dept, + ldsa.reserve1, ldsa.reserve2, ldsa.reserve3, ldsa.reserve4, ldsa.reserve5, + ldsa.service_number, ldsa.order_code, + ldsa.mall_id, ldsa.mall_code, ldsa.mall_name, ldsa.store_name, + ldsa.store_code, ldsa.store_id, ldsa.description_goods, ldsa.warehouse_id, + ldsa.warehouse, ldsa.warehouse_entry_time, ldsa.store_time, ldsa.total_number, ldsa.hand_quantity, + ldsa.complete_set, ldsa.brand, ldsa.type_service, ldsa.customer_name, ldsa.customer_telephone, + ldsa.customer_address, ldsa.genre, + ldsa.stockup_status, ldsa.reservation_status, ldsa.order_status, ldsa.grounding_status, + ldsa.order_receive_status, + ldsa.freeze_status, ldsa.notification, ldsa.fee, ldsa.rate, ldsa.advance_id, ldsa.waybill_id, + GROUP_CONCAT( DISTINCT ldpl.waybill_number ) waybill_number, + ldsa.consignee_unit, ldsa.collect_fee, ldsa.storage_fee, ldsa.consignee_person, ldsa.consignee_address, + ldsa.consignee_mobile, ldsa.warehouse_entry_time_end, + ldsa.sorting_quantity, ldsa.delivery_quantity, ldsa.transfer_quantity, + ldsa.signin_quantity, ldsa.resource, ldsa.is_opai, + ldsa.inventory_date, ldsa.inventory_person, ldsa.inventory_person_id, + ldsa.available_quantity, ldsa.is_have_data, ldsa.stock_article_code, GROUP_CONCAT( DISTINCT ldpl.dealer_name ) + dealerName, ldsa.dealer_code, + ldsa.train_number, ldsa.factory_train, ldsa.sending, ldsa.send_warehouse_id, ldsa.send_warehouse_name, + ldsa.is_zero, ldsa.accept_warehouse_id, ldsa.accept_warehouse_name, ldsa.order_delivery_status, + ldsa.trays trays, + ldsa.allocation allocation + from logpm_distribution_stock_article ldsa + LEFT JOIN logpm_distribution_parcel_list ldpl on ldsa.id = ldpl.stock_article_id + + ldsa.is_deleted = 0 and ldsa.hand_quantity > 0 and ldsa.order_status in ('10','20','30','40','50','60','70') + and ldsa.genre = '1' and ldsa.type_service='2' + + and ldsa.order_code like concat(#{distributionStockArticleVO.orderCode},'%') + + + and ldsa.stockup_status = #{distributionStockArticleVO.stockupStatus} + + + and ldsa.reservation_status = #{distributionStockArticleVO.reservationStatus} + + + and ldsa.warehouse_id in + + #{warehouseId} + + + + and ldsa.order_status = #{distributionStockArticleVO.orderStatus} + + + and ldsa.grounding_status = #{distributionStockArticleVO.groundingStatus} + + + and ldsa.freeze_status = #{distributionStockArticleVO.freezeStatus} + + + + and ldsa.description_goods like concat('%',#{distributionStockArticleVO.descriptionGoods},'%') + - - and ldsa.warehouse like concat('%',#{distributionStockArticleVO.warehouse},'%') - + + and ldsa.warehouse like concat('%',#{distributionStockArticleVO.warehouse},'%') + - - and ldsa.brand like concat('%',#{distributionStockArticleVO.brand},'%') - + + and ldsa.brand like concat('%',#{distributionStockArticleVO.brand},'%') + - - and ldsa.store_name like concat('%',#{distributionStockArticleVO.storeName},'%') - + + and ldsa.store_name like concat('%',#{distributionStockArticleVO.storeName},'%') + - - and ldsa.customer_name like concat('%',#{distributionStockArticleVO.customerName},'%') - + + and ldsa.customer_name like concat('%',#{distributionStockArticleVO.customerName},'%') + - - and ldsa.customer_telephone like concat('%',#{distributionStockArticleVO.customerTelephone},'%') - + + and ldsa.customer_telephone like concat('%',#{distributionStockArticleVO.customerTelephone},'%') + - - and ldsa.customer_address like concat('%',#{distributionStockArticleVO.customerAddress},'%') - + + and ldsa.customer_address like concat('%',#{distributionStockArticleVO.customerAddress},'%') + - - and ldsa.waybill_number like concat('%',#{distributionStockArticleVO.waybillNumber},'%') - + + and ldsa.waybill_number like concat('%',#{distributionStockArticleVO.waybillNumber},'%') + - - and ldsa.total_number = #{distributionStockArticleVO.totalNumber} - + + and ldsa.total_number = #{distributionStockArticleVO.totalNumber} + - - and ldsa.hand_quantity = #{distributionStockArticleVO.handQuantity} - + + and ldsa.hand_quantity = #{distributionStockArticleVO.handQuantity} + - - and ldsa.mall_id in - - #{item} - - + + and ldsa.mall_id in + + #{item} + + + + + group by ldsa.id @@ -795,11 +911,6 @@ ldsa.is_deleted, ldsa.create_dept, ldsa.incoming_num, - ldsa.reserve1, - ldsa.reserve2, - ldsa.reserve3, - ldsa.reserve4, - ldsa.reserve5, ldsa.service_number, ldsa.order_code, ldsa.mall_id, @@ -864,14 +975,11 @@ ldsa.accept_warehouse_id, ldsa.accept_warehouse_name, ldsa.order_delivery_status, - group_concat(DISTINCT lwt.pallet_name) as trays, - group_concat(DISTINCT lwug.position_code) as allocation + group_concat(DISTINCT ldpl.pallet ) as trays, + group_concat(DISTINCT ldpl.goods_allocation) as allocation from logpm_distribution_stock_article ldsa left join logpm_distribution_parcel_list ldpl on ldsa.id = ldpl.stock_article_id - left join logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id - left join logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id - left JOIN logpm_warehouse_tray lwt on lwtg.tray_id= lwt.id ldsa.is_deleted = 0 and ldsa.order_status IN ( '10', '20', '30', '40', '50', '60', '70' ) and ldsa.hand_quantity > 0 @@ -1780,6 +1888,134 @@ AND ldbs.order_status != 2 GROUP BY ldbs.bill_lading_id + update logpm_distribution_stock_article diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java index 14fc6be32..616cb37f4 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java @@ -57,6 +57,13 @@ public interface IDistributionStockArticleService extends BaseService exportDistributionStockArticle(Map paramMap); + /** + * 商场导出数据 + * @param paramMap + * @return + */ + List exportMallOrder(Map paramMap); + Boolean saveStock(String ids); // /** diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java index 736ce1d78..04ce840d8 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java @@ -208,6 +208,54 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl exportMallOrder(Map paramMap) { +// 获取当前登录的仓库信息 + BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); + if (ObjectUtils.isNull(myCurrentWarehouse)) { + //查询当前用户的仓库列表 + List warehouseList = warehouseClient.getMyWarehouseList(); + if (!warehouseList.isEmpty()) { + List warehouseListIds = warehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList()); + paramMap.put("warehouseIds", warehouseListIds); + } + } else { + paramMap.put("warehouseId", myCurrentWarehouse.getId()); + } + // 用户勾选数据的ids + Object ids = paramMap.get("ids"); + List idArr = null; + if (null != ids && !"".equals(ids.toString())) { +// idArr = Arrays.asList(paramMap.get("ids").toString().split(",")); + idArr = Func.toLongList((String) paramMap.get("ids")); + + } + + String tenantId = AuthUtil.getTenantId(); + paramMap.put("tenantId", tenantId); + paramMap.put("orderIds", idArr); + + List list = baseMapper.exportMallOrder(paramMap); + List excelList = new ArrayList<>(); +// + list.forEach(li -> { + DistributionStockArticleVO distributionStockArticleVO = buildVo(li); + DistributionStockArticleExcel excel = new DistributionStockArticleExcel(); + assert distributionStockArticleVO != null; + if (distributionStockArticleVO.getTotalNumber() != null && + distributionStockArticleVO.getIncomingNum() != null) { + distributionStockArticleVO.setUnreceivedQuantity( + distributionStockArticleVO.getTotalNumber() - distributionStockArticleVO.getIncomingNum() + ); + } + BeanUtil.copyProperties(distributionStockArticleVO, excel); + excel.setIsZeroString("1".equals(distributionStockArticleVO.getIsZero()) ? "是" : "否"); + excelList.add(excel); + }); + + + return excelList; + } /** * 构建参数 @@ -251,7 +299,10 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl userR = userClient.userInfoById(distributionStockupVO.getCreateUser()); + if(userR.isSuccess()&& userR.getData()!=null){ + distributionStockupVO.setCreateUserName(userR.getData().getName()); + } } distributionStockupVO.setOrderReceiveStatusName(DictBizCache.getValue(DictBizConstant.ORDER_RECEIVE_STATUS, distributionStockupVO.getOrderReceiveStatus())); @@ -494,7 +545,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl list1 = distributionStockListService.list(Wrappers.query().lambda() .eq(DistributionStockListEntity::getStockArticleId, distributionStockArticleDTO.getId()) ); - if (list1.size() > 0) { + if (!list1.isEmpty()) { //存在 } else { @@ -641,7 +692,20 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl selectClientListPage(IPage page, DistributionStockArticleVO distributionStockArticle) { // 获取当前登陆人 - List result = baseMapper.selectClientListPage(page, distributionStockArticle); + + List warehouseIds = new ArrayList<>(); + BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); + if (ObjectUtils.isNull(myCurrentWarehouse)) { + //查询当前用户的仓库列表 + List warehouseList = warehouseClient.getMyWarehouseList(); + if (!warehouseList.isEmpty()) { + List warehouseListIds = warehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList()); + warehouseIds.addAll(warehouseListIds); + } + } else { + warehouseIds.add( myCurrentWarehouse.getId()); + } + List result = baseMapper.selectClientListPage(page, distributionStockArticle,warehouseIds); return page.setRecords(result); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionStockArticleWrapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionStockArticleWrapper.java index 9057448a0..5266e21d2 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionStockArticleWrapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionStockArticleWrapper.java @@ -8,10 +8,12 @@ import com.logpm.distribution.vo.DistributionStockArticleVO; import lombok.extern.log4j.Log4j2; import org.springblade.common.constant.DictBizConstant; import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.SpringUtil; import org.springblade.system.cache.DictBizCache; +import org.springblade.system.entity.User; import org.springblade.system.feign.IUserClient; import java.util.Date; @@ -84,7 +86,12 @@ public class DistributionStockArticleWrapper extends BaseEntityWrapper userR = userCliient.userInfoById(distributionStockupVO.getCreateUser()); + if(userR.isSuccess() && userR.getData()!=null){ + + distributionStockupVO.setCreateUserName(userR.getData().getName()); + } } distributionStockupVO.setOrderReceiveStatusName(DictBizCache.getValue(DictBizConstant.ORDER_RECEIVE_STATUS, distributionStockupVO.getOrderReceiveStatus()));