Browse Source

Merge remote-tracking branch 'origin/dev' into dev

training
0.0 2 years ago
parent
commit
8159ea7bf3
  1. 8
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataWarehouseVO.java
  2. 4
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAreaController.java
  3. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsAreaService.java
  4. 37
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAreaServiceImpl.java
  5. 16
      blade-service/logpm-distribution/pom.xml
  6. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java
  7. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java
  8. 14
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml
  9. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml
  10. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java
  11. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java
  12. 24
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  13. 55
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  14. 16
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionParcelListWrapper.java
  15. 20
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java
  16. 1
      blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java
  17. 56
      blade-service/logpm-factory/src/test/java/com/logpm/factory/TestService.java
  18. 13
      blade-service/logpm-factory/src/test/java/com/logpm/factory/excel/ExcelMode.java
  19. 15
      blade-service/logpm-warehouse/pom.xml
  20. 24
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java
  21. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownTypeService.java
  22. 38
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java

8
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataWarehouseVO.java

@ -17,6 +17,7 @@
package com.logpm.basicdata.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.logpm.basicdata.entity.BasicdataGoodsAreaEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -36,5 +37,12 @@ public class BasicdataWarehouseVO extends BasicdataWarehouseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "仓库货区")
private List<BasicdataGoodsAreaEntity> children;
}

4
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAreaController.java

@ -90,8 +90,8 @@ public class BasicdataGoodsAreaController extends BladeController {
* 货区 获取货区
*/
@GetMapping("/getNode")
public R<List<BasicdataNodeVO>> getNode() {
List<BasicdataNodeVO> pages = basicdataGoodsAreaService.getNode();
public R<List<BasicdataWarehouseVO>> getNode() {
List<BasicdataWarehouseVO> pages = basicdataGoodsAreaService.getNode();
log.info("pages>>>>>>>>>>>>>>{}",pages);
return R.data(pages);
}

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsAreaService.java

@ -90,5 +90,5 @@ public interface IBasicdataGoodsAreaService extends BaseService<BasicdataGoodsAr
/**
* 货区 获取货区
*/
List<BasicdataNodeVO> getNode();
List<BasicdataWarehouseVO> getNode();
}

37
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAreaServiceImpl.java

@ -17,7 +17,9 @@
package com.logpm.basicdata.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import com.logpm.basicdata.entity.BasicdataGoodsAllocationEntity;
import com.logpm.basicdata.entity.BasicdataGoodsAreaEntity;
@ -27,13 +29,18 @@ import com.logpm.basicdata.mapper.BasicdataGoodsAllocationMapper;
import com.logpm.basicdata.mapper.BasicdataGoodsAreaMapper;
import com.logpm.basicdata.mapper.BasicdataGoodsShelfMapper;
import com.logpm.basicdata.service.IBasicdataGoodsAreaService;
import com.logpm.basicdata.service.IBasicdataWarehouseService;
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 com.logpm.warehouse.feign.IWarehouseUpdownGoodsClient;
import lombok.AllArgsConstructor;
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.Func;
import org.springblade.system.feign.IUserClient;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -63,9 +70,11 @@ public class BasicdataGoodsAreaServiceImpl extends BaseServiceImpl<BasicdataGood
private final IWarehouseUpdownGoodsClient warehouseUpdownGoodsClient;
private final BasicdataGoodsAllocationMapper goodsAllocationMapper;
private final IBasicdataWarehouseService basicdataWarehouseService;
@Override
public IPage<BasicdataGoodsAreaVO> selectWarehouseGoodsAreaPage(IPage<BasicdataGoodsAreaVO> page, BasicdataGoodsAreaVO basicdataGoodsAreaVO) {
return page.setRecords(baseMapper.selectWarehouseGoodsAreaPage(page, basicdataGoodsAreaVO));
@ -154,15 +163,23 @@ public class BasicdataGoodsAreaServiceImpl extends BaseServiceImpl<BasicdataGood
}
@Override
public List<BasicdataNodeVO> getNode() {
//查询一级仓库节点信息
List<BasicdataNodeVO> basicdataWarehouseVOList = baseMapper.selectFirstNode();
//获取二节点的货区
for (BasicdataNodeVO basicdataNodeVO : basicdataWarehouseVOList) {
List<BasicdataNodeVO> goodeAreaNodes = goodsAllocationMapper.selectSecondNode(basicdataNodeVO.getValue());
basicdataNodeVO.setChildren(goodeAreaNodes);
}
return basicdataWarehouseVOList;
public List<BasicdataWarehouseVO> getNode() {
//查询当前登陆用户能够操作的仓库列表
// BladeUser user = AuthUtil.getUser();
List<BasicdataWarehouseVO> myWarehouseList = basicdataWarehouseService.getMyWarehouseList();
myWarehouseList.forEach(w->{
LambdaQueryWrapper<BasicdataGoodsAreaEntity> qw = Wrappers.<BasicdataGoodsAreaEntity>query().lambda().eq(BasicdataGoodsAreaEntity::getWarehouseId, w.getId());
List<BasicdataGoodsAreaEntity> basicdataGoodsAreaEntities = basicdataGoodsAreaMapper.selectList(qw);
w.setChildren(basicdataGoodsAreaEntities);
});
// //查询一级仓库节点信息
// List<BasicdataNodeVO> basicdataWarehouseVOList = baseMapper.selectFirstNode();
// //获取二节点的货区
// for (BasicdataNodeVO basicdataNodeVO : basicdataWarehouseVOList) {
// List<BasicdataNodeVO> goodeAreaNodes = goodsAllocationMapper.selectSecondNode(basicdataNodeVO.getValue());
// basicdataNodeVO.setChildren(goodeAreaNodes);
// }
return myWarehouseList;
}
}

16
blade-service/logpm-distribution/pom.xml

@ -12,7 +12,7 @@
<groupId>org.springblade</groupId>
<artifactId>logpm-distribution</artifactId>
<version>3.1.0.RELEASE</version>
<version>${bladex.project.version}</version>
<dependencies>
<dependency>
@ -35,7 +35,7 @@
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-distribution-api</artifactId>
<version>3.1.0.RELEASE</version>
<version>${bladex.project.version}</version>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
@ -45,12 +45,12 @@
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-basic-api</artifactId>
<version>3.1.0.RELEASE</version>
<version>${bladex.project.version}</version>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-warehouse-api</artifactId>
<version>3.1.0.RELEASE</version>
<version>${bladex.project.version}</version>
</dependency>
<!--Sms-->
<dependency>
@ -75,7 +75,7 @@
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-basicdata-api</artifactId>
<version>3.1.0.RELEASE</version>
<version>${bladex.project.version}</version>
<scope>compile</scope>
</dependency>
@ -85,6 +85,12 @@
<version>${bladex.project.version}</version>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-user-api</artifactId>
<version>${bladex.project.version}</version>
</dependency>
</dependencies>

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java

@ -326,9 +326,8 @@ public class DistributionDeliveryListController extends BladeController {
@GetMapping("/selectDiscussStockArticleInfoList")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "customArgs")
public R<?> selectDiscussStockArticleInfoList(@ApiIgnore @RequestParam Map<String, Object> params, Query query) {
List<DistributionStockArticleVO> distributionStockArticle = distributionDeliveryListService.selectDiscussStockArticleInfoList(params,query);
public R<IPage<DistributionStockArticleVO>> selectDiscussStockArticleInfoList(@ApiIgnore @RequestParam Map<String, Object> params, Query query) {
IPage<DistributionStockArticleVO> distributionStockArticle = distributionDeliveryListService.selectDiscussStockArticleInfoList(params,query);
return R.data(distributionStockArticle);
}
/**

9
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java

@ -310,8 +310,11 @@ public class DistributionReservationController extends BladeController {
@GetMapping("/selectUpdateAvailableStockArticle")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入distrbutionReservation")
public R<?> selectUpdateAvailableStockArticle(@RequestParam Long id) {
List<DistributionStockArticleVO> stockArticleVOS = reservationService.selectUpdateAvailableStockArticle(id);
return R.data(stockArticleVOS);
public R<IPage<DistributionStockArticleVO>> selectUpdateAvailableStockArticle(@ApiIgnore @RequestParam Long id, Query query,@ApiIgnore @RequestParam Map<String, Object> distributionStockArticle) {
IPage<DistributionStockArticleVO> page = Condition.getPage(query);
List<DistributionStockArticleVO> stockArticleVOS = reservationService.selectUpdateAvailableStockArticle(id,distributionStockArticle);
page.setRecords(stockArticleVOS);
page.setTotal(stockArticleVOS.size());
return R.data(page);
}
}

14
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml

@ -315,11 +315,11 @@
ldr.consignee consignee,
ldr.reservation_num reservationNum,
COALESCE(lds.loaded_number + lds.loadedin_number, 0) loadingNub,
(SELECT COALESCE(COUNT(*), 0) from logpm_distribution_reservation_stockarticle ldrs WHERE ldrs.reservation_id =ldr.id ) ordNub,
(SELECT COALESCE(COUNT(*), 0) from logpm_distribution_reservation_stockarticle ldrs WHERE ldrs.reservation_id =ldr.id and ldrs.stock_article_status in (1,3) ) ordNub,
COALESCE(lds.received_quantity + lds.receivedin_quantity, 0) signNub
FROM
logpm_distribution_signfor lds
JOIN logpm_distribution_reservation ldr ON ldr.id = lds.reservation_id
JOIN logpm_distribution_reservation ldr ON ldr.id = lds.reservation_id and ldr.reservation_status != '40'
WHERE
lds.is_deleted = 0
AND lds.delivery_id = #{id}
@ -337,12 +337,12 @@
lbm.logpm_unit logpmUnit
FROM
logpm_distribution_reservation ldr
join logpm_distribution_reservation_stocklist ldrs on ldr.id = ldrs.reservation_id
join logpm_distribution_reservation_stocklist ldrs on ldr.id = ldrs.reservation_id and ldrs.stock_article_status in (1,3)
join logpm_distribution_stock_list ldsl on ldsl.id = ldrs.stocklist_id
LEFT JOIN logpm_distribution_loadscaninvn ldl on ldsl.id = ldl.inventory_id
left join logpm_basicdata_material lbm on ldsl.material_id = lbm.id
<where>
ldr.is_deleted = 0
ldr.is_deleted = 0 and ldr.reservation_status != '40'
AND ldr.id = #{param.reservationId}
</where>
</select>
@ -367,7 +367,7 @@
GROUP BY
ldsa.id
) AS loading
JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id
JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id and ldrs.stock_article_status in (1,3)
JOIN logpm_distribution_reservation ldr ON ldr.id = ldrs.reservation_id
JOIN logpm_distribution_stock_article ldsa ON ldsa.id = ldrs.stock_article_id
@ -406,7 +406,7 @@
GROUP BY
ldsa.id
) AS loading
JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id
JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id and ldrs.stock_article_status in (1,3)
JOIN logpm_distribution_reservation ldr ON ldr.id = ldrs.reservation_id
JOIN logpm_distribution_stock_article ldsa ON ldsa.id = ldrs.stock_article_id
<where>
@ -442,7 +442,7 @@
GROUP BY
ldsa.id
) AS loading
JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id
JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id and ldrs.stock_article_status in (1,3)
JOIN logpm_distribution_reservation ldr ON ldr.id = ldrs.reservation_id
JOIN logpm_distribution_stock_article ldsa ON ldsa.id = ldrs.stock_article_id
<where>

11
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml

@ -655,16 +655,15 @@
WHERE lds.delivery_id = lddl.id
) forkliftName, -->
lddl.create_time createTime,
(SELECT COALESCE(COUNT(*), 0) FROM logpm_distribution_signfor lds WHERE lds.delivery_id =lddl.id)
customersNumber,
lddl.customers_number customersNumber,
lddl.price price,
lddl.added_services_id addedServicesId,
(SELECT COALESCE (COUNT(*) ,0)
FROM
logpm_distribution_signfor lds
join logpm_distribution_reservation ldr on lds.reservation_id =ldr.id
join logpm_distribution_reservation ldr on lds.reservation_id =ldr.id and ldr.reservation_status != '40'
join logpm_distribution_reservation_stockarticle ldrs on ldrs.reservation_id =ldr.id
WHERE lds.delivery_id = lddl.id
WHERE lds.delivery_id = lddl.id and ldrs.stock_article_status in (1,3)
) orderNumber,
(SELECT COALESCE (sum(ldr.reservation_num + ldr.reservation_stock_list_num) ,0)
FROM
@ -689,7 +688,7 @@
(SELECT COALESCE (sum(ldr.reservation_stock_list_num) ,0)
FROM
logpm_distribution_signfor lds
join logpm_distribution_reservation ldr on lds.reservation_id =ldr.id
join logpm_distribution_reservation ldr on lds.reservation_id =ldr.id and ldr.reservation_status != '40'
WHERE lds.delivery_id = lddl.id) inventoryNub,
(SELECT COALESCE(sum(lds.loaded_number+lds.loadedin_number), 0) FROM logpm_distribution_signfor lds WHERE
lddl.id = lds.delivery_id) scannedNumber,
@ -699,7 +698,7 @@
where ldr.id in
(select lds.reservation_id
from logpm_distribution_signfor lds
where lds.delivery_id = lddl.id )
where lds.delivery_id = lddl.id ) and ldr.reservation_status != '40'
) consignee
FROM
logpm_distribution_delivery_list lddl

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java

@ -197,5 +197,5 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
* @param query
* @return
*/
List<DistributionStockArticleVO> selectDiscussStockArticleInfoList(Map<String, Object> params, Query query);
IPage<DistributionStockArticleVO> selectDiscussStockArticleInfoList(Map<String, Object> params, Query query);
}

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java

@ -173,7 +173,7 @@ public interface IDistributionReservationService extends BaseService<Distributio
* @param reservationId
* @return
*/
List<DistributionStockArticleVO> selectUpdateAvailableStockArticle(Long reservationId);
List<DistributionStockArticleVO> selectUpdateAvailableStockArticle(Long reservationId,Map<String, Object> distributionStockArticle);
/**
* 文员自主添加预约

24
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -1384,7 +1384,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
// DistributionStockupVO stockupInfo = distributionStockupMapper.getDeliveryStockupInfo(deliveryListEntity.getId());
Date date = new Date();
BladeUser user = AuthUtil.getUser();
AtomicInteger clientNum = new AtomicInteger();
AtomicInteger orderNum = new AtomicInteger();
mallClient.forEach((k, v) -> {
clientNum.getAndIncrement();
//判断原始客户中是否存在
if (Func.isEmpty(originalClient.get(k))) {
//不存在,意味这里应该进行客户的新增
@ -1417,6 +1420,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
AtomicInteger packageTotal = new AtomicInteger();
v.forEach(s -> {
orderNum.getAndIncrement();
mallName.add(s.getMallName());
DistributionStockArticleDTO stockArticleDTO = Func.copy(s, DistributionStockArticleDTO.class);
List<DistributionParcelListEntity> packageListInfo = stockArticleDTO.getPackageListInfo();
@ -1479,6 +1483,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = distributionDeliveryListMapper.selectStockArticleById(deliveryListEntityId,k);
Map<Long, List<DistributionReservationStockarticleEntity>> oldStockArticle = reservationStockarticleEntityList.stream().collect(Collectors.groupingBy(DistributionReservationStockarticleEntity::getStockArticleId));
v.forEach(s -> {
orderNum.getAndIncrement();
//根据配送和客户名称查询预约
AtomicInteger packageNum = new AtomicInteger();
AtomicInteger reduceNum = new AtomicInteger();
@ -1628,6 +1633,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionStockArticleService.updateById(stockArticleEntity);
//修改预约状态和包件状态
});
List<DistributionReservationEntity> reservationEntities = originalClient.get(f);
reservationEntities.forEach(r->{
distributionSignforMapper.deleteByReservationAndDeliveryId(r.getId(),deliveryListEntityId);
});
});
String kind = deliveryListEntity.getKind();
switch (kind) {
@ -1675,6 +1684,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
deliveryListEntity.setDriverName(driverNames.deleteCharAt(driverNames.length() - 1).toString());
deliveryListEntity.setVehicleName(vehicleNubs.deleteCharAt(vehicleNubs.length() - 1).toString());
}
deliveryListEntity.setOrderNumber(orderNum.get());
deliveryListEntity.setCustomersNumber(clientNum.get());
deliveryListEntity.setTaskTime(deliveryListDTO.getTaskTime());
//对配送进行更改
this.updateById(deliveryListEntity);
@ -1942,8 +1953,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
@Override
public List<DistributionStockArticleVO> selectDiscussStockArticleInfoList(Map<String, Object> params, Query query) {
public IPage<DistributionStockArticleVO> selectDiscussStockArticleInfoList(Map<String, Object> params, Query query) {
IPage<Object> page = Condition.getPage(query);
//这里还需要查询出该配送任务下的订单信息,在进行编辑的时候进行回显
String deliveryId = (String) params.get("deliveryId");
List<DistributionStockArticleEntity> stockArticleEntityList = baseMapper.selectDiscussStockArticleList(deliveryId);
@ -1970,13 +1981,14 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
.notIn(DistributionStockArticleEntity::getId, list);
IPage<DistributionStockArticleEntity> pages = distributionStockArticleService.page(Condition.getPage(query), lambdaQueryWrapper);
IPage<DistributionStockArticleVO> distributionStockArticleVOIPage = DistributionStockArticleWrapper.build().pageVO(pages);
List<DistributionStockArticleVO> records = distributionStockArticleVOIPage.getRecords();
records.forEach(r->{
// List<DistributionStockArticleVO> records = distributionStockArticleVOIPage.getRecords();
distributionStockArticleVOIPage.getRecords().forEach(r->{
//查询包件情况
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListService.getBaseMapper().selectList(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getStockArticleId, r.getId()));
r.setParcelListVOS(DistributionParcelListWrapper.build().listVO(parcelListEntityList));
});
records.addAll(stockArticleVOList);
return records;
// records.addAll(stockArticleVOList);
return distributionStockArticleVOIPage;
}
}

55
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

@ -679,8 +679,10 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionSignforService.save(distributionSignforEntity);
//修改预约信息为待配送
reservationEntity.setReservationStatus(ReservationStatusConstant.daipeisong.getValue());
//这里需要查询出订单数量
Long count = distributionReservationStocklistService.getBaseMapper().selectCount(Wrappers.<DistributionReservationStocklistEntity>query().lambda().eq(DistributionReservationStocklistEntity::getReservationId, reservationEntity.getId()));
//预约订单数量
orderNum.getAndAdd(reservationEntity.getStockArticleId().split(",").length);
orderNum.getAndAdd(Integer.parseInt(count.toString()));
//统计包件数量
packageNum.getAndAdd(reservationEntity.getReservationNum());
//TODO 设置是否齐套
@ -692,7 +694,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
w.lambda().eq(DistributionReservationStocklistEntity::getReservationId, reservationEntity.getId());
List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = distributionReservationStockarticleService.getBaseMapper().selectList(q);
List<DistributionReservationStocklistEntity> reservationStocklistEntityList = distributionReservationStocklistService.getBaseMapper().selectList(w);
//查询预约单下的包件信息
if (!Func.isEmpty(reservationStockarticleEntityList)) {
@ -1396,16 +1397,41 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
}
@Override
public List<DistributionStockArticleVO> selectUpdateAvailableStockArticle(Long reservationId) {
public List<DistributionStockArticleVO> selectUpdateAvailableStockArticle(Long reservationId,Map<String, Object> distributionStockArticle) {
//这里还需要查询出该预约单下的订单信息
//这里将该预约下的订单进行过滤
String orderCode = (String) distributionStockArticle.get("orderCode");
String mallName = (String) distributionStockArticle.get("mallName");
String descriptionGoods = (String) distributionStockArticle.get("descriptionGoods");
String brand = (String) distributionStockArticle.get("brand");
String customerName = (String) distributionStockArticle.get("customerName");
String customerTelephone = (String) distributionStockArticle.get("customerTelephone");
List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = distributionReservationStockarticleService.getBaseMapper().selectList(Wrappers.<DistributionReservationStockarticleEntity>query().lambda().eq(DistributionReservationStockarticleEntity::getReservationId, reservationId));
List<DistributionStockArticleVO> stockArticleVOArrayList = new ArrayList<>();
List<String> list = new ArrayList<>();
reservationStockarticleEntityList.forEach(r -> {
list.add(r.getStockArticleId().toString());
List<DistributionStockArticleEntity> stockArticleEntities = distributionStockArticleService.getBaseMapper().selectList(Wrappers.<DistributionStockArticleEntity>query().lambda().eq(DistributionStockArticleEntity::getId, r.getStockArticleId()));
LambdaQueryWrapper<DistributionStockArticleEntity> lambda = Wrappers.<DistributionStockArticleEntity>query().lambda();
if (Func.isNotEmpty(orderCode)){
lambda.like(DistributionStockArticleEntity::getOrderCode,orderCode);
}
if (Func.isNotEmpty(mallName)){
lambda.like(DistributionStockArticleEntity::getOrderCode,mallName);
}
if (Func.isNotEmpty(descriptionGoods)){
lambda.like(DistributionStockArticleEntity::getOrderCode,descriptionGoods);
}
if (Func.isNotEmpty(brand)){
lambda.like(DistributionStockArticleEntity::getOrderCode,brand);
}
if (Func.isNotEmpty(customerName)){
lambda.like(DistributionStockArticleEntity::getOrderCode,customerName);
}
if (Func.isNotEmpty(customerTelephone)){
lambda.like(DistributionStockArticleEntity::getOrderCode,customerTelephone);
}
lambda.eq(DistributionStockArticleEntity::getId,r.getStockArticleId());
List<DistributionStockArticleEntity> stockArticleEntities = distributionStockArticleService.getBaseMapper().selectList(lambda);
List<DistributionStockArticleVO> stockArticleVOList = DistributionStockArticleWrapper.build().listVO(stockArticleEntities);
stockArticleVOList.forEach(s -> {
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListService.getBaseMapper().selectList(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getStockArticleId, s.getId()));
@ -1429,6 +1455,24 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
if (!Func.isEmpty(list)) {
qw.notIn(DistributionStockArticleEntity::getId, list);
}
if (Func.isNotEmpty(orderCode)){
qw.like(DistributionStockArticleEntity::getOrderCode,orderCode);
}
if (Func.isNotEmpty(mallName)){
qw.like(DistributionStockArticleEntity::getOrderCode,mallName);
}
if (Func.isNotEmpty(descriptionGoods)){
qw.like(DistributionStockArticleEntity::getOrderCode,descriptionGoods);
}
if (Func.isNotEmpty(brand)){
qw.like(DistributionStockArticleEntity::getOrderCode,brand);
}
if (Func.isNotEmpty(customerName)){
qw.like(DistributionStockArticleEntity::getOrderCode,customerName);
}
if (Func.isNotEmpty(customerTelephone)){
qw.like(DistributionStockArticleEntity::getOrderCode,customerTelephone);
}
List<DistributionStockArticleEntity> stockArticleEntityList = distributionStockArticleService.getBaseMapper().selectList(qw);
List<DistributionStockArticleVO> stockArticleVOS = DistributionStockArticleWrapper.build().listVO(stockArticleEntityList);
stockArticleVOS.forEach(s -> {
@ -1441,6 +1485,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
}
@Override
@Transactional
public boolean insertAutonomouslyReservation(DistributionReservationDTO distributionReservationDTO) {
if (Func.isEmpty(distributionReservationDTO)) {
log.error("参数错误+{" + distributionReservationDTO + "}");

16
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionParcelListWrapper.java

@ -3,11 +3,15 @@ package com.logpm.distribution.wrapper;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.vo.DistributionParcelListVO;
import com.logpm.warehouse.feign.IWarehouseUpdownGoodsClient;
import lombok.AllArgsConstructor;
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.Func;
import org.springblade.system.cache.DictBizCache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
@ -18,8 +22,12 @@ import java.util.Objects;
* @author: cyz
* @create: 2023-08-02 14:35
**/
public class DistributionParcelListWrapper extends BaseEntityWrapper<DistributionParcelListEntity, DistributionParcelListVO> {
@Autowired
private IWarehouseUpdownGoodsClient warehouseUpdownGoodsClient;
public static DistributionParcelListWrapper build(){
return new DistributionParcelListWrapper();
}
@ -36,9 +44,11 @@ public class DistributionParcelListWrapper extends BaseEntityWrapper<Distributio
//如果有上架选择填充货位信息
if (Func.isNotBlank(parcelListVO.getOrderPackageGroundingStatus())){
if (parcelListVO.getOrderPackageGroundingStatus().equals("20")){
String s = warehouseUpdownGoodsClient.selectMsgBywrap(parcelListVO.getId());
if (Func.isNotEmpty(s)){
parcelListVO.setAllocationMsg(s);
if (Func.isNotEmpty(warehouseUpdownGoodsClient)){
String s = warehouseUpdownGoodsClient.selectMsgBywrap(parcelListVO.getId());
if (Func.isNotEmpty(s)){
parcelListVO.setAllocationMsg(s);
}
}
}
}

20
blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java

@ -12,12 +12,10 @@ import com.logpm.factory.mt.service.IMtFactoryOrderMainService;
import com.logpm.factory.mt.service.IMtFactoryOrderService;
import com.logpm.factory.mt.service.IMtPackageInfoService;
import com.logpm.factory.oupai.entity.FactoryOrderEntity;
import com.logpm.factory.oupai.entity.FactoryPackageDetailEntity;
import com.logpm.factory.oupai.entity.FactoryPackageEntity;
import com.logpm.factory.oupai.entity.ReceivingOrderEntity;
import com.logpm.factory.oupai.service.IFactoryOrderService;
import com.logpm.factory.oupai.service.IFactoryPackageService;
import com.logpm.factory.oupai.service.IOuPaiFactoryService;
import com.logpm.factory.oupai.service.IReceivingOrderService;
import com.logpm.factory.oupai.service.*;
import com.logpm.factory.pan.service.IPanFactoryOrderService;
import com.logpm.factory.pan.service.IPanPackageInfoService;
import com.logpm.factory.pan.service.IPanPackageListService;
@ -93,6 +91,8 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
private final IReceivingOrderService receivingOrderService;
private final IFactoryPackageDetailService factoryPackageDetailService;
//工厂查询
private final IOuPaiFactoryService ouPaiFactoryService;
@ -509,6 +509,11 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
//更新包件
advanceDetailClient.updateAdvanceDetail(advanceDetailEntity);
} else {
advanceDetailEntity = new AdvanceDetailEntity();
advanceDetailEntity.setAdvanceId(advanceEntity.getId());//预仓id
@ -556,6 +561,13 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
advanceDetailEntity.setRemark("");//备注
advanceDetailEntity.setOldId(0);//
Integer detailId = advanceDetailClient.addAdvanceDetail(advanceDetailEntity);
advanceDetailEntity.setId(detailId);
// 物料明细
List<FactoryPackageDetailEntity> factoryPackageDetailEntities = factoryPackageDetailService.lambdaQuery().eq(FactoryPackageDetailEntity::getPackageId, factoryPackageEntity.getId()).list();
// todo 保存物料明细
if (detailId > 0) {
//修改数据状态
factoryPackageEntity.setTurnStatus(2);

1
blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java

@ -440,6 +440,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
logger.info("订单同步出现的客户编号{} 匹配的客户", basicdataClientEntity);
if (!Objects.isNull(basicdataClientEntity)) {
//商城
distributionStockArticleEntity.setMallId(basicdataClientEntity.getId());
distributionStockArticleEntity.setMallName(basicdataClientEntity.getClientName());
distributionStockArticleEntity.setMallCode(basicdataClientEntity.getClientCode());

56
blade-service/logpm-factory/src/test/java/com/logpm/factory/TestService.java

@ -1,11 +1,21 @@
package com.logpm.factory;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.metadata.BaseRowModel;
import com.alibaba.excel.metadata.Sheet;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.extension.conditions.update.UpdateChainWrapper;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.logpm.factory.comfac.controller.FactoryCommonController;
import com.logpm.factory.comfac.dto.UnloadCarDTO;
import com.logpm.factory.excel.ExcelMode;
import com.logpm.factory.mt.entity.MtFactoryOrderMain;
import com.logpm.factory.mt.entity.MtPushData;
import com.logpm.factory.mt.service.IMtFactoryDataService;
@ -17,6 +27,7 @@ import com.logpm.factory.snm.vo.MTOrderPackageRelationVO;
import com.logpm.oldproject.entity.AdvanceDetailEntity;
import com.logpm.oldproject.feign.IAdvanceDetailClient;
import com.rabbitmq.client.Channel;
import lombok.Data;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springblade.core.test.BladeBootTest;
@ -28,13 +39,12 @@ import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.beans.factory.annotation.Autowired;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.security.NoSuchAlgorithmException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.*;
import java.util.stream.Collectors;
@ExtendWith(BladeSpringExtension.class)
@ -47,10 +57,40 @@ public class TestService {
//
//
//
// @Test
// public void test2() {
public void test2() {
// ouPaiFactoryService.findOuPaiFactoryOrderDTOByCarCarNumber("LCD230505047");
//
// }
// 获取Excle
Sheet sheet = new Sheet(1, 1, ExcelMode.class);
try {
List<Object> readList = EasyExcelFactory.read(new FileInputStream("f://order_status_log.xlsx"), sheet);
List<ExcelMode> list = new ArrayList<ExcelMode>();
for (Object obj : readList) {
ExcelMode t = (ExcelMode) obj;
JSONObject json = JSONObject.parseObject(t.getArgs());
System.out.println(json.getString("unitNo"));
//HttpResponse execute = HttpUtil.createPost("http://h5u.huitongys.com/api/logpm-factory/factory/common/sendOrderStatus").body(t.getArgs()).execute();
//System.out.println(execute.body());
}
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
}

13
blade-service/logpm-factory/src/test/java/com/logpm/factory/excel/ExcelMode.java

@ -0,0 +1,13 @@
package com.logpm.factory.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.metadata.BaseRowModel;
import lombok.Data;
@Data
public class ExcelMode extends BaseRowModel {
@ExcelProperty(index = 1)
private String args;
}

15
blade-service/logpm-warehouse/pom.xml

@ -37,7 +37,7 @@
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-warehouse-api</artifactId>
<version>3.1.0.RELEASE</version>
<version>${bladex.project.version}</version>
<scope>compile</scope>
</dependency>
<!--mq-->
@ -48,13 +48,13 @@
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-basicdata-api</artifactId>
<version>3.1.0.RELEASE</version>
<version>${bladex.project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-distribution-api</artifactId>
<version>3.1.0.RELEASE</version>
<version>${bladex.project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
@ -70,9 +70,16 @@
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-old-project-api</artifactId>
<version>3.1.0.RELEASE</version>
<version>${bladex.project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-user-api</artifactId>
<version>${bladex.project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>

24
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java

@ -505,6 +505,30 @@ public class WarehouseUpdownTypeApiController {
}
}
@ResponseBody
@PostMapping("/downScanTrayCode")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "下架扫描托盘", notes = "传入trayTypeDTO")
public R downScanTrayCode(@RequestBody UpdownTypeDTO updownTypeDTO ) {
String method = "###########downScanTrayCode: ";
log.info(method + "下架扫描托盘 downScanTrayCode={}", updownTypeDTO);
String trayCode = updownTypeDTO.getTrayCode();
try{
if(StringUtil.isBlank(trayCode)){
log.warn(method+"托盘码不能为空 trayCode={}",trayCode);
return R.fail(403,"托盘码不能为空");
}
//查询该库位的货物信息
return warehouseUpdownTypeService.downScanTrayCode(trayCode);
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常,联系管理员",e);
return R.fail(500,"系统异常,联系管理员");
}
}
@ResponseBody
@PostMapping("/downTrayCode")
@ApiOperationSupport(order = 1)

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownTypeService.java

@ -59,4 +59,6 @@ public interface IWarehouseUpdownTypeService extends BaseService<WarehouseUpdown
R moveAllocationScanTrayCode(String trayCode);
R moveAllocationByTrayCode(String trayCode, Long allocationId);
R downScanTrayCode(String trayCode);
}

38
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java

@ -1191,6 +1191,44 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
return R.success("移库成功");
}
@Override
public R downScanTrayCode(String trayCode) {
BasicdataTrayEntity trayEntity = basicdataTrayClient.getTrayByTrayCode(trayCode);//托盘信息
if(Objects.isNull(trayEntity)){
log.warn("#################findUpShelfScanGoods: 托盘信息不存在 trayCode={}",trayCode);
throw new CustomerException(403,"托盘信息不存在");
}
Long allocationId = warehouseTaryAllocationService.getAllocationIdByTrayId(trayEntity.getId());
if (Objects.isNull(allocationId)){
log.warn("#################findUpShelfScanGoods: 托盘未上架 trayCode={}",trayCode);
throw new CustomerException(403,"托盘未上架");
}
Long trayId = trayEntity.getId();
QueryWrapper<WarehouseTrayTypeEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("tray_id",trayId)
.eq("is_deleted",0);
WarehouseTrayTypeEntity trayTypeEntity = warehouseTrayTypeService.getOne(queryWrapper);
if(Objects.isNull(trayTypeEntity)){
log.warn("#################findUpShelfScanGoods: 托盘没有货物信息 trayCode={}",trayCode);
throw new CustomerException(403,"托盘没有货物信息");
}
Long trayTypeId = trayTypeEntity.getId();//打托方式id
String type = trayTypeEntity.getType();//打托分类
List<UpShelfDataVO> listByTrayTypeId = null;
if(PalletProductTypeConstant.CUSTOMIZED.equals(type)){
listByTrayTypeId = warehouseTrayGoodsService.getUpListByTrayTypeId(trayTypeId);
}else if(PalletProductTypeConstant.ARTIFICIAL.equals(type)){
listByTrayTypeId = warehouseTrayGoodsService.getZeroUpListByTrayTypeId(trayTypeId);
}else if(PalletProductTypeConstant.STOCKDATA.equals(type)){
listByTrayTypeId = warehouseTrayGoodsService.getStockUpListByTrayTypeId(trayTypeId);
}else if(PalletProductTypeConstant.STOCKNODATA.equals(type)){
listByTrayTypeId = warehouseTrayGoodsService.getStockUpListByTrayTypeId(trayTypeId);
}
return R.data(listByTrayTypeId);
}
private void saveUpdownGoodsLogPart(List<WarehouseUpdownGoodsEntity> updownGoodsList, int residue, String bindingType, Integer isAlltrays, String remark) {
List<WarehouseUpdownGoodsLogEntity> updownGoodsLogList = new ArrayList<>();
for (WarehouseUpdownGoodsEntity updownGoodsEntity:updownGoodsList){

Loading…
Cancel
Save