Browse Source

fix:修改商场的仓库信息,优化仓库订单导出 增加商家订单的导出功能

dist.1.3.0
pref_mail@163.com 6 months ago
parent
commit
006668f1a4
  1. 8
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java
  2. 27
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java
  3. 97
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/MallOrderController.java
  4. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java
  5. 384
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  6. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java
  7. 70
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  8. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionStockArticleWrapper.java

8
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java

@ -200,9 +200,17 @@ public class BasicdataWarehouseServiceImpl extends BaseServiceImpl<BasicdataWare
if (basicdataStorageServicesEntities != null && !basicdataStorageServicesEntities.isEmpty()) {
results = new ArrayList<>();
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);
}
}

27
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<IPage<DistributionStockArticleVO>> clientList(@ApiIgnore DistributionStockArticleVO distributionStockArticle, Query query) {
// BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
// if (Func.isEmpty(myCurrentWarehouse)){
// return R.fail("无仓库信息!!!");
// }
//获取当前登录人仓库
// List<BasicdataWarehouseEntity> myWatchWarehouse = warehouseClient.getMyWatchWarehouse();
// List<Long> collect = myWatchWarehouse.stream()
// .map(BasicdataWarehouseEntity::getId)
// .collect(Collectors.toList());
// distributionStockArticle.setWarehouseIdList(collect);
// 得到当前登录用户的Id
List<BasicdataClientUserEntity> 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<DistributionStockArticleEntity> pages = distributionStockArticleService.selectClientListPage(Condition.getPage(query), distributionStockArticle);
return R.data(DistributionStockArticleWrapper.build().pageVO(pages));
}
/**

97
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<IPage<DistributionStockArticleVO>> clientList(@ApiIgnore DistributionStockArticleVO distributionStockArticle, Query query) {
try {
// 得到当前登录用户的Id
List<BasicdataClientUserEntity> 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<DistributionStockArticleEntity> 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<String, Object> paramMap, BladeUser bladeUser, HttpServletResponse response) {
List<BasicdataClientUserEntity> 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<DistributionStockArticleExcel> list = distributionStockArticleService.exportMallOrder(paramMap);
ExcelUtil.export(response, "商场在库订单明细" + DateUtil.time(), "商场在库订单明细", list, DistributionStockArticleExcel.class);
}
}

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java

@ -68,7 +68,7 @@ public interface DistributionStockArticleMapper extends BaseMapper<DistributionS
* @param distributionStockArticleVO
* @return
*/
List<DistributionStockArticleEntity> selectClientListPage(IPage page, DistributionStockArticleVO distributionStockArticleVO);
List<DistributionStockArticleEntity> selectClientListPage(IPage page, DistributionStockArticleVO distributionStockArticleVO,@Param("warehouseIds") List<Long> warehouseIds);
List<DistributionStockArticleEntity> getAllReservationStockArticleInfo(@Param("ew") Map<String,Object> query);
@ -220,4 +220,10 @@ public interface DistributionStockArticleMapper extends BaseMapper<DistributionS
void clearAllocationByIds(@Param("ids") List<Long> clearAllocationStockArticleIdList);
/**
* 商家端订单导出
* @param paramMap
* @return
*/
List<DistributionStockArticleEntity> exportMallOrder(@Param("param") Map<String, Object> paramMap);
}

384
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml

@ -50,6 +50,88 @@
<!-- <result column="reservation_num" property="reservationNum"/>-->
</resultMap>
<sql id="selectOrderList">
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
</sql>
<select id="selectDistributionStockArticlePage" resultMap="distributionStockArticleResultMap">
select *
@ -85,80 +167,114 @@
<select id="selectClientListPage" resultMap="distributionStockArticleResultMap">
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')
<if test="distributionStockArticleVO.orderCode!=null and distributionStockArticleVO.orderCode !=''">
and ldsa.order_code like concat(#{distributionStockArticleVO.orderCode},'%')
</if>
<if test="distributionStockArticleVO.stockupStatus != null and distributionStockArticleVO.stockupStatus != ''">
and ldsa.stockup_status = #{distributionStockArticleVO.stockupStatus}
</if>
<if test="distributionStockArticleVO.reservationStatus != null and distributionStockArticleVO.reservationStatus != ''">
and ldsa.reservation_status = #{distributionStockArticleVO.reservationStatus}
</if>
<!-- <if test="distributionStockArticleVO.warehouseIdList != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(distributionStockArticleVO.warehouseIdList)">-->
<!-- and ldsa.warehouse_id in-->
<!-- <foreach collection="distributionStockArticleVO.warehouseIdList" item="item" open="(" close=")" separator=",">-->
<!-- #{item}-->
<!-- </foreach>-->
<!-- </if>-->
<if test="distributionStockArticleVO.orderStatus != null and distributionStockArticleVO.orderStatus != ''">
and ldsa.order_status = #{distributionStockArticleVO.orderStatus}
</if>
<if test="distributionStockArticleVO.groundingStatus != null and distributionStockArticleVO.groundingStatus != ''">
and ldsa.grounding_status = #{distributionStockArticleVO.groundingStatus}
</if>
<if test="distributionStockArticleVO.freezeStatus != null and distributionStockArticleVO.freezeStatus != ''">
and ldsa.freeze_status = #{distributionStockArticleVO.freezeStatus}
</if>
<!-- 条件没有写完 -->
<if test="distributionStockArticleVO.descriptionGoods != null and distributionStockArticleVO.descriptionGoods != ''">
and ldsa.description_goods like concat('%',#{distributionStockArticleVO.descriptionGoods},'%')
</if>
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
<where>
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'
<if test="distributionStockArticleVO.orderCode!=null and distributionStockArticleVO.orderCode !=''">
and ldsa.order_code like concat(#{distributionStockArticleVO.orderCode},'%')
</if>
<if test="distributionStockArticleVO.stockupStatus != null and distributionStockArticleVO.stockupStatus != ''">
and ldsa.stockup_status = #{distributionStockArticleVO.stockupStatus}
</if>
<if test="distributionStockArticleVO.reservationStatus != null and distributionStockArticleVO.reservationStatus != ''">
and ldsa.reservation_status = #{distributionStockArticleVO.reservationStatus}
</if>
<if test="warehouseIds != null">
and ldsa.warehouse_id in
<foreach collection="warehouseIds" item="warehouseId" open="(" separator="," close=")">
#{warehouseId}
</foreach>
</if>
<if test="distributionStockArticleVO.orderStatus != null and distributionStockArticleVO.orderStatus != ''">
and ldsa.order_status = #{distributionStockArticleVO.orderStatus}
</if>
<if test="distributionStockArticleVO.groundingStatus != null and distributionStockArticleVO.groundingStatus != ''">
and ldsa.grounding_status = #{distributionStockArticleVO.groundingStatus}
</if>
<if test="distributionStockArticleVO.freezeStatus != null and distributionStockArticleVO.freezeStatus != ''">
and ldsa.freeze_status = #{distributionStockArticleVO.freezeStatus}
</if>
<!-- 条件没有写完 -->
<if test="distributionStockArticleVO.descriptionGoods != null and distributionStockArticleVO.descriptionGoods != ''">
and ldsa.description_goods like concat('%',#{distributionStockArticleVO.descriptionGoods},'%')
</if>
<if test="distributionStockArticleVO.warehouse != null and distributionStockArticleVO.warehouse != ''">
and ldsa.warehouse like concat('%',#{distributionStockArticleVO.warehouse},'%')
</if>
<if test="distributionStockArticleVO.warehouse != null and distributionStockArticleVO.warehouse != ''">
and ldsa.warehouse like concat('%',#{distributionStockArticleVO.warehouse},'%')
</if>
<if test="distributionStockArticleVO.brand != null and distributionStockArticleVO.brand != ''">
and ldsa.brand like concat('%',#{distributionStockArticleVO.brand},'%')
</if>
<if test="distributionStockArticleVO.brand != null and distributionStockArticleVO.brand != ''">
and ldsa.brand like concat('%',#{distributionStockArticleVO.brand},'%')
</if>
<if test="distributionStockArticleVO.storeName != null and distributionStockArticleVO.storeName != ''">
and ldsa.store_name like concat('%',#{distributionStockArticleVO.storeName},'%')
</if>
<if test="distributionStockArticleVO.storeName != null and distributionStockArticleVO.storeName != ''">
and ldsa.store_name like concat('%',#{distributionStockArticleVO.storeName},'%')
</if>
<if test="distributionStockArticleVO.customerName != null and distributionStockArticleVO.customerName != ''">
and ldsa.customer_name like concat('%',#{distributionStockArticleVO.customerName},'%')
</if>
<if test="distributionStockArticleVO.customerName != null and distributionStockArticleVO.customerName != ''">
and ldsa.customer_name like concat('%',#{distributionStockArticleVO.customerName},'%')
</if>
<if test="distributionStockArticleVO.customerTelephone != null and distributionStockArticleVO.customerTelephone != ''">
and ldsa.customer_telephone like concat('%',#{distributionStockArticleVO.customerTelephone},'%')
</if>
<if test="distributionStockArticleVO.customerTelephone != null and distributionStockArticleVO.customerTelephone != ''">
and ldsa.customer_telephone like concat('%',#{distributionStockArticleVO.customerTelephone},'%')
</if>
<if test="distributionStockArticleVO.customerAddress != null and distributionStockArticleVO.customerAddress != ''">
and ldsa.customer_address like concat('%',#{distributionStockArticleVO.customerAddress},'%')
</if>
<if test="distributionStockArticleVO.customerAddress != null and distributionStockArticleVO.customerAddress != ''">
and ldsa.customer_address like concat('%',#{distributionStockArticleVO.customerAddress},'%')
</if>
<if test="distributionStockArticleVO.waybillNumber != null and distributionStockArticleVO.waybillNumber != ''">
and ldsa.waybill_number like concat('%',#{distributionStockArticleVO.waybillNumber},'%')
</if>
<if test="distributionStockArticleVO.waybillNumber != null and distributionStockArticleVO.waybillNumber != ''">
and ldsa.waybill_number like concat('%',#{distributionStockArticleVO.waybillNumber},'%')
</if>
<if test="distributionStockArticleVO.totalNumber != null and distributionStockArticleVO.totalNumber != ''">
and ldsa.total_number = #{distributionStockArticleVO.totalNumber}
</if>
<if test="distributionStockArticleVO.totalNumber != null ">
and ldsa.total_number = #{distributionStockArticleVO.totalNumber}
</if>
<if test="distributionStockArticleVO.handQuantity != null and distributionStockArticleVO.handQuantity != ''">
and ldsa.hand_quantity = #{distributionStockArticleVO.handQuantity}
</if>
<if test="distributionStockArticleVO.handQuantity != null and distributionStockArticleVO.handQuantity != ''">
and ldsa.hand_quantity = #{distributionStockArticleVO.handQuantity}
</if>
<if test="distributionStockArticleVO.clientIds != null and distributionStockArticleVO.handQuantity != ''">
and ldsa.mall_id in
<foreach collection="distributionStockArticleVO.clientIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="distributionStockArticleVO.clientIds != null ">
and ldsa.mall_id in
<foreach collection="distributionStockArticleVO.clientIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
group by ldsa.id
</select>
@ -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
<where>
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
</select>
<select id="exportMallOrder" resultType="com.logpm.distribution.entity.DistributionStockArticleEntity">
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
<where>
ldsa.is_deleted = 0 and ldsa.order_status IN ( '10', '20', '30', '40', '50', '60', '70' )
and ldsa.hand_quantity > 0
and ldsa.genre = '1'
<if test="param.warehouseId != null and param.warehouseId != ''">
and ldsa.warehouse_id = #{param.warehouseId}
</if>
<if test="param.warehouseIds != null ">
and ldsa.warehouse_id in
<foreach collection="param.warehouseIds" item="wIitem" index="index" open="(" close=")" separator=",">
#{wIitem}
</foreach>
</if>
<if test="param.waybillNumber != null and param.waybillNumber != ''">and ldpl.waybill_number =
#{param.waybillNumber}
</if>
<if test="param.orderCode != null and param.orderCode != ''">and ldsa.order_code = #{param.orderCode}</if>
<if test="param.mallName != null and param.mallName != ''">and ldsa.mall_name = #{param.mallName}</if>
<if test="param.typeService != null and param.typeService != ''">and ldsa.type_service =
#{param.typeService}
</if>
<if test="param.consigneeUnit != null and param.consigneeUnit != ''">and ldsa.consignee_unit =
#{param.consigneeUnit}
</if>
<if test="param.trainNumber != null and param.trainNumber != ''">and ldsa.train_number =
#{param.trainNumber}
</if>
<if test="param.acceptWarehouseName != null and param.acceptWarehouseName != ''">and
ldsa.accept_warehouse_name = #{param.acceptWarehouseName}
</if>
<if test="param.serviceNumber != null and param.serviceNumber != ''">
and ldsa.service_number = #{param.serviceNumber}
</if>
<if test="param.clientIds != null and param.handQuantity != ''">
and ldsa.mall_id in
<foreach collection="param.clientIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.orderIds != null ">
and ldsa.id in
<foreach collection="param.orderIds" item="wIitem" index="index" open="(" close=")" separator=",">
#{wIitem}
</foreach>
</if>
</where>
group by ldsa.id
</select>
<update id="clearTraysByIds" >
update logpm_distribution_stock_article

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java

@ -57,6 +57,13 @@ public interface IDistributionStockArticleService extends BaseService<Distributi
*/
List<DistributionStockArticleExcel> exportDistributionStockArticle(Map<String, Object> paramMap);
/**
* 商场导出数据
* @param paramMap
* @return
*/
List<DistributionStockArticleExcel> exportMallOrder(Map<String, Object> paramMap);
Boolean saveStock(String ids);
// /**

70
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java

@ -208,6 +208,54 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
return excelList;
}
@Override
public List<DistributionStockArticleExcel> exportMallOrder(Map<String, Object> paramMap) {
// 获取当前登录的仓库信息
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (ObjectUtils.isNull(myCurrentWarehouse)) {
//查询当前用户的仓库列表
List<BasicdataWarehouseEntity> warehouseList = warehouseClient.getMyWarehouseList();
if (!warehouseList.isEmpty()) {
List<Long> 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<Long> 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<DistributionStockArticleEntity> list = baseMapper.exportMallOrder(paramMap);
List<DistributionStockArticleExcel> 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<Distrib
distributionStockupVO.setReservationStatusName(DictBizCache.getValue(DictBizConstant.ORDER_RESERVATION_STATUS, distributionStockupVO.getReservationStatus()));
distributionStockupVO.setStockupStatusName(DictBizCache.getValue(DictBizConstant.ORDER_STOCKUP_STATUS, distributionStockupVO.getStockupStatus()));
if (ObjectUtils.isNotNull(distributionStockupVO.getCreateUser())) {
distributionStockupVO.setCreateUserName(userClient.userInfoById(distributionStockupVO.getCreateUser()).getData().getName());
R<User> 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<Distrib
List<DistributionStockListEntity> list1 = distributionStockListService.list(Wrappers.<DistributionStockListEntity>query().lambda()
.eq(DistributionStockListEntity::getStockArticleId, distributionStockArticleDTO.getId())
);
if (list1.size() > 0) {
if (!list1.isEmpty()) {
//存在
} else {
@ -641,7 +692,20 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
@Override
public IPage<DistributionStockArticleEntity> selectClientListPage(IPage<DistributionStockArticleEntity> page, DistributionStockArticleVO distributionStockArticle) {
// 获取当前登陆人
List<DistributionStockArticleEntity> result = baseMapper.selectClientListPage(page, distributionStockArticle);
List<Long> warehouseIds = new ArrayList<>();
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (ObjectUtils.isNull(myCurrentWarehouse)) {
//查询当前用户的仓库列表
List<BasicdataWarehouseEntity> warehouseList = warehouseClient.getMyWarehouseList();
if (!warehouseList.isEmpty()) {
List<Long> warehouseListIds = warehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());
warehouseIds.addAll(warehouseListIds);
}
} else {
warehouseIds.add( myCurrentWarehouse.getId());
}
List<DistributionStockArticleEntity> result = baseMapper.selectClientListPage(page, distributionStockArticle,warehouseIds);
return page.setRecords(result);
}

9
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<Distribut
distributionStockupVO.setReservationStatusName(DictBizCache.getValue(DictBizConstant.ORDER_RESERVATION_STATUS, distributionStockupVO.getReservationStatus()));
distributionStockupVO.setStockupStatusName(DictBizCache.getValue(DictBizConstant.ORDER_STOCKUP_STATUS, distributionStockupVO.getStockupStatus()));
if (ObjectUtils.isNotNull(distributionStockupVO.getCreateUser())) {
distributionStockupVO.setCreateUserName(userCliient.userInfoById(distributionStockupVO.getCreateUser()).getData().getName());
R<User> 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()));

Loading…
Cancel
Save