diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockVO.java index cf43d9d0e..b9e870e7d 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockVO.java @@ -17,6 +17,7 @@ package com.logpm.distribution.vo; import com.logpm.distribution.entity.DistributionStockEntity; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -43,4 +44,10 @@ public class DistributionStockVO extends DistributionStockEntity { private Integer whole;//全部 + /** + * 出库类型 + */ + @ApiModelProperty(value = "出库类型") + private String outboundTypeName; + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java index c9f5a1d62..ee943a5ee 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java @@ -609,6 +609,7 @@ public class DistributionStockupAppController extends BladeController { } entity.setConditions("0"); entity.setType(2); + entity.setOutboundType(distributionStockupEntity.getTypeService()); distributionStockService.save(entity); //修改订单备货状态 distributionAsyncService.updateStockArticleStock(one.getStockArticleId()); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockController.java index 3cfa123b5..b802748ca 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockController.java @@ -25,6 +25,7 @@ import com.logpm.distribution.entity.DistributionStockEntity; import com.logpm.distribution.excel.DistributionStockExcel; import com.logpm.distribution.service.IDistributionStockService; import com.logpm.distribution.vo.DistributionStockVO; +import com.logpm.distribution.wrapper.DistributionStockWrapper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -76,9 +77,9 @@ public class DistributionStockController extends BladeController { @GetMapping("/list") @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "传入distributionStock") - public R> list(@ApiIgnore @RequestParam Map distributionStock, Query query) { + public R> list(@ApiIgnore @RequestParam Map distributionStock, Query query) { IPage pages = distributionStockService.page(Condition.getPage(query), Condition.getQueryWrapper(distributionStock, DistributionStockEntity.class)); - return R.data(pages); + return R.data(DistributionStockWrapper.build().pageVO(pages)); } /** diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionStockWrapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionStockWrapper.java new file mode 100644 index 000000000..dac415648 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionStockWrapper.java @@ -0,0 +1,61 @@ +package com.logpm.distribution.wrapper; + +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +import com.logpm.distribution.entity.DistributionDeliveryListEntity; +import com.logpm.distribution.entity.DistributionStockEntity; +import com.logpm.distribution.entity.DistributionStockListEntity; +import com.logpm.distribution.entity.DistrilbutionBillLadingEntity; +import com.logpm.distribution.service.IDistributionDeliveryListService; +import com.logpm.distribution.service.IDistributionStockListService; +import com.logpm.distribution.service.IDistrilbutionBillLadingService; +import com.logpm.distribution.vo.DistributionStockVO; +import lombok.RequiredArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.springblade.common.constant.DictBizConstant; +import org.springblade.common.constant.DistributionTypeConstant; +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 java.util.Objects; +@Log4j2 +public class DistributionStockWrapper extends BaseEntityWrapper { + + private IDistributionStockListService stockListService = SpringUtil.getBean(IDistributionStockListService.class); + private IDistributionDeliveryListService deliveryListService = SpringUtil.getBean(IDistributionDeliveryListService.class); + private IDistrilbutionBillLadingService billLadingService = SpringUtil.getBean(IDistrilbutionBillLadingService.class); + + public static DistributionStockWrapper build(){ + return new DistributionStockWrapper(); + } + + + @Override + public DistributionStockVO entityVO(DistributionStockEntity entity) { + + DistributionStockVO distributionStockVO = new DistributionStockVO(); + if(ObjectUtils.isNotNull(distributionStockVO)){ + //查询订单自编号 + if (ObjectUtils.isNotNull(entity.getStockListId())) { + DistributionStockListEntity byId = stockListService.getById(entity.getStockListId()); + if(byId.getSourceType().equals("1")){ + entity.setOrderSelfNumbering(byId.getIncomingBatch()); + } + } + + if(DistributionTypeConstant.ziti.getValue().equals(entity.getOutboundType())){ + DistrilbutionBillLadingEntity byId1 = billLadingService.getById(entity.getBillLadingId()); + entity.setDeliveryListCode(byId1.getPickupBatch()); + }else{ + DistributionDeliveryListEntity byId1 = deliveryListService.getById(entity.getReservationId()); + entity.setDeliveryListCode(byId1.getNoteNumber()); + } + distributionStockVO = Objects.requireNonNull(BeanUtil.copy(entity,DistributionStockVO.class)); + distributionStockVO.setOutboundTypeName(DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE, entity.getOutboundType())); + } + + + return distributionStockVO; + } +} diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWaybillController.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWaybillController.java index 77c17b856..252cb387c 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWaybillController.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWaybillController.java @@ -97,17 +97,18 @@ public class WarehouseWaybillController extends BladeController { @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "传入warehouseWaybill") public R> list(@ApiIgnore @RequestParam Map warehouseWaybill, Query query) { - QueryWrapper queryWrapper = Condition.getQueryWrapper(warehouseWaybill, WarehouseWaybillEntity.class); - //获取当前登录人仓库 - List myWatchWarehouse = basicdataWarehouseClient.getMyWatchWarehouse(); - List collect = myWatchWarehouse.stream() - .map(BasicdataWarehouseEntity::getId) - .collect(Collectors.toList()); - queryWrapper.lambda() - .in(collect.size() > 0, WarehouseWaybillEntity::getDepartureWarehouseId, collect) - .or() - .in(collect.size() > 0, WarehouseWaybillEntity::getDestinationWarehouseId, collect); - IPage pages = warehouseWaybillService.page(Condition.getPage(query), queryWrapper); +// QueryWrapper queryWrapper = Condition.getQueryWrapper(warehouseWaybill, WarehouseWaybillEntity.class); +// //获取当前登录人仓库 +// List myWatchWarehouse = basicdataWarehouseClient.getMyWatchWarehouse(); +// List collect = myWatchWarehouse.stream() +// .map(BasicdataWarehouseEntity::getId) +// .collect(Collectors.toList()); +// queryWrapper.lambda() +// .in(collect.size() > 0, WarehouseWaybillEntity::getDepartureWarehouseId, collect) +// .or() +// .in(collect.size() > 0, WarehouseWaybillEntity::getDestinationWarehouseId, collect); + + IPage pages = warehouseWaybillService.pageInfo(Condition.getPage(query), warehouseWaybill); return R.data(WarehouseWaybillWrapper.build().pageVO(pages)); } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/WarehouseWaybillDTO.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/WarehouseWaybillDTO.java index 53cb427e2..2eedc6e46 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/WarehouseWaybillDTO.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/WarehouseWaybillDTO.java @@ -20,6 +20,8 @@ import com.logpm.warehouse.entity.WarehouseWaybillEntity; import lombok.Data; import lombok.EqualsAndHashCode; +import java.util.List; + /** * 运单表 数据传输对象实体类 * @@ -31,4 +33,8 @@ import lombok.EqualsAndHashCode; public class WarehouseWaybillDTO extends WarehouseWaybillEntity { private static final long serialVersionUID = 1L; + private List departureWarehouseIds; + + private List destinationWarehouseIds; + } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.java index 43953baac..d88161936 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.java @@ -59,11 +59,11 @@ public interface TaskQuestMapper extends BaseMapper { List selectallocationList(@Param("questNum")String questNum, @Param("param") TaskSearchDTO taskSearchDTO); - List selectcontractList(IPage page, @Param("param") TaskSearchDTO taskSearchDTO,@Param("collect") List collect); + List selectcontractList(IPage page, @Param("param") TaskSearchDTO taskSearchDTO,@Param("collect") List collect,@Param("questNum") String questNum ); void setSqlMode(); - List selecttrayList(IPage page,@Param("param") TaskSearchDTO taskSearchDTO,@Param("collect") List collect); + List selecttrayList(IPage page,@Param("param") TaskSearchDTO taskSearchDTO,@Param("collect") List collect,@Param("questNum") String questNum); /** * 查询包件托盘码 @@ -81,11 +81,12 @@ public interface TaskQuestMapper extends BaseMapper { List findMaterialList(@Param("param") TaskSearchDTO taskSearchDTO); - List selectStripListByQuestId(IPage page,@Param("questId") Long id); + List selectStripListByQuestId(IPage page,@Param("questId") Long id,@Param("questNum") String questNum); - List selectInventoryListByQuestId(IPage page,@Param("questId") Long id); - List selectZeroListByQuestId(IPage page,@Param("questId") Long id); + List selectInventoryListByQuestId(IPage page,@Param("questId") Long id,@Param("questNum") String questNum); + + List selectZeroListByQuestId(IPage page,@Param("questId") Long id,@Param("questNum") String questNum); String selectExitsInfo(@Param("questNum")String questNum); @@ -121,9 +122,27 @@ public interface TaskQuestMapper extends BaseMapper { List selectTaskTrayInfo(IPage page,@Param("questNum")String questNum,@Param("param") QuestDetailEntity questDetail); - List getQuestDetailInfo(@Param("questNum")String questNum,@Param("param")QuestDetailChildEntity questDetailChildEntity); + /** + * + * @param questNum + * @param questDetailChildEntity + * @return + */ + List selectQuestDetailChildInfo(@Param("questNum")String questNum, @Param("param")QuestDetailChildEntity questDetailChildEntity); + QuestDetailChildEntity selectQuestDetailChildInfoOne(@Param("questNum")String questNum, @Param("param")QuestDetailChildEntity questDetailChildEntity); Integer updateQuestDetailQuestStatus(@Param("questNum")String questNum,@Param("param") QuestDetailEntity q); Integer updatePositionCodeList(@Param("questNum") String questNum, @Param("list") List ls); + + Integer insertQuestDetailChildList(@Param("questNum")String questNum,@Param("list") List q); + + /** + * + * @param questNum + * @param q + * @return + */ + Integer updetaQuestDetailChildList(@Param("questNum")String questNum,@Param("list") List q); + } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml index 2d2037433..385ed0e7d 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml @@ -215,12 +215,50 @@ = #{item. } = #{item. }--> - WHERE `id` = #{ param.id } + WHERE `id` = #{ item.id } + + + update ${questNum} + + cargo_name = #{item.cargoName }, + quest_num = #{item.questNum }, + + + + + + + + + WHERE `id` = #{ item.id } + + + + INSERT INTO ${questNum} (`id`, `tenant_id`, `create_user`, `create_time`, `update_user`, `update_time`, + `create_dept`, `is_deleted`, `status`, `reserve1`, `reserve2`, `reserve3`, `reserve4`, `reserve5`, `quest_detail_id`, `cargo_name`, + `quest_num`, `warehouse_id`) + VALUES + + (#{item.id}, #{item.tenantId}, #{item.createUser}, #{item.createTime}, #{item.updateUser}, #{item.updateTime}, #{item.createDept}, #{item.isDeleted} + , #{item.status}, #{item.reserve1}, #{item.reserve2}, #{item.reserve3}, #{item.reserve4}, #{item.reserve5}, + #{item.questDetailId}, #{item.cargoName}, #{item.questNum} , #{item.warehouseId} ) + + + - + select * + from ${questNum} + + is_deleted = 0 + and quest_detail_id = #{param.questDetailId } + and warehouse_id = #{param.warehouseId } + + + SELECT lqd.id id, + lqd.id id, lqd.order_code orderCode, lqd.quest_id questId, lqd.order_id orderId, @@ -352,7 +391,7 @@ ldpl.send_warehouse_name sendWarehouseName, ldsa.consignee_unit consigneeUnit FROM - logpm_quest_detail lqd + ${questNum} lqd JOIN logpm_distribution_parcel_list ldpl ON lqd.order_package_id = ldpl.id left join logpm_distribution_stock_article ldsa on ldsa.id = ldpl.stock_article_id AND lqd.quest_target =1 @@ -375,7 +414,7 @@ ldsl.service_number serviceNumber, ldsl.description_goods descriptionGoods FROM - logpm_quest_detail lqd + ${questNum} lqd JOIN logpm_distribution_stock_list ldsl ON lqd.stock_id = ldsl.id AND lqd.quest_target =3 @@ -398,7 +437,7 @@ ldsa.consignee_address consigneeAddress, ldsa.consignee_mobile consigneeMobile FROM - logpm_quest_detail lqd + ${questNum} lqd JOIN logpm_distribution_stock_article ldsa ON lqd.order_id = ldsa.id AND lqd.quest_target =2 diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java index ae900a958..2ef4e9034 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java @@ -19,6 +19,7 @@ package com.logpm.warehouse.mapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.warehouse.dto.WarehouseWaybillDTO; import com.logpm.warehouse.entity.WarehouseWaybillEntity; import com.logpm.warehouse.vo.WarehouseWaybillVO; import org.apache.ibatis.annotations.Param; @@ -45,4 +46,6 @@ public interface WarehouseWaybillMapper extends BaseMapper exportWarehouseWarehousingDetail(@Param("ew") QueryWrapper queryWrapper); + + IPage pageInfo(IPage page,@Param("param") WarehouseWaybillDTO warehouseWaybillDTO); } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml index 5a4085f64..92295b9eb 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml @@ -60,6 +60,74 @@ +