Compare commits

...

4 Commits

  1. 2
      blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java
  2. 24
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataGoodsAllocationClient.java
  3. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockEntity.java
  4. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupListVO.java
  5. 9
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAllocationController.java
  6. 30
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataGoodsAllocationClient.java
  7. 19
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAllocationMapper.java
  8. 66
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAllocationMapper.xml
  9. 23
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsAllocationService.java
  10. 79
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAllocationServiceImpl.java
  11. 8
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAreaServiceImpl.java
  12. 14
      blade-service/logpm-distribution/pom.xml
  13. 63
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java
  14. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockController.java
  15. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/StockupDTO.java
  16. 16
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml
  17. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java
  18. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockService.java
  19. 39
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  20. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  21. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  22. 43
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockServiceImpl.java

2
blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java

@ -8,7 +8,7 @@ public interface ModuleNameConstant {
/**
* 如果不需要 ""
*/
public static final String DEVAUTH ="";
public static final String DEVAUTH ="-tjj";
/**
* 工厂对接服务名称

24
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataGoodsAllocationClient.java

@ -66,4 +66,28 @@ public interface IBasicdataGoodsAllocationClient {
@GetMapping(API_PREFIX+"/findListByShelfId")
List<BasicdataGoodsAllocationEntity> findListByShelfId(@RequestParam Long shelfId);
/**
* 根据名称搜索库位
* @param fragment
* @return
*/
@GetMapping(API_PREFIX+"/findListStockUpAllocationByName")
List<BasicdataGoodsAllocationEntity> findListStockUpAllocationByName(@RequestParam String fragment);
/**
* 扫描备货库位
* @param stockUpAreaCode
* @return
*/
@GetMapping(API_PREFIX+"/scanStockUpAllocationByCode")
BasicdataGoodsAllocationEntity scanStockUpAllocationByCode(@RequestParam Long stockUpAreaCode);
/**
* 查询库位的完整名称按照货区-货架-货位的方式呈现
* @param goodsStockupAllocationId
* @return
*/
@GetMapping(API_PREFIX+"/getAllocationIntegrityName")
String getAllocationIntegrityName(@RequestParam Long goodsStockupAllocationId);
}

3
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockEntity.java

@ -179,4 +179,7 @@ public class DistributionStockEntity extends TenantEntity {
@ApiModelProperty(value = "扫码类型 1包件 2库存品")
private Integer type;
@ApiModelProperty(value = "备货区库位ID")
private Long goodsStockupAllocationId; //备货区库位ID
}

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupListVO.java

@ -26,6 +26,8 @@ public class DistributionStockupListVO implements Serializable {
private String trays;//托盘
private String mallName;//商场名称
private Integer orderNum;//订单总数
private Integer stockupNum;//备货数
private Integer inventoryNub;//库存品数

9
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAllocationController.java

@ -199,6 +199,14 @@ public class BasicdataGoodsAllocationController extends BladeController {
return R.data(pages);
}
@GetMapping("/getStockUpAllocation")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "查询备货库位信息", notes = "传入BasicdataGoodsAllocation")
public R<List<BasicdataNodeVO>> getStockUpAllocation() {
List<BasicdataNodeVO> pages = basicdataGoodsAllocationService.getStockUpAllocation();
return R.data(pages);
}
/**
* 货位获取模板信息
@ -209,7 +217,6 @@ public class BasicdataGoodsAllocationController extends BladeController {
public R<?> getPrintTemplate(@ApiIgnore @RequestParam("ids") String ids) {
FreightSpaceVO result = basicdataGoodsAllocationService.getPrintTemplate(ids);
return R.data(result);
}

30
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataGoodsAllocationClient.java

@ -19,6 +19,7 @@ package com.logpm.basicdata.feign;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basicdata.entity.BasicdataGoodsAllocationEntity;
import com.logpm.basicdata.service.IBasicdataGoodsAllocationService;
import lombok.AllArgsConstructor;
@ -42,7 +43,7 @@ import java.util.List;
@AllArgsConstructor
public class BasicdataGoodsAllocationClient implements IBasicdataGoodsAllocationClient {
private final IBasicdataGoodsAllocationService BasicdataGoodsAllocationService;
private final IBasicdataGoodsAllocationService basicdataGoodsAllocationService;
@Override
@GetMapping(TOP)
@ -50,13 +51,13 @@ public class BasicdataGoodsAllocationClient implements IBasicdataGoodsAllocation
Query query = new Query();
query.setCurrent(current);
query.setSize(size);
IPage<BasicdataGoodsAllocationEntity> page = BasicdataGoodsAllocationService.page(Condition.getPage(query));
IPage<BasicdataGoodsAllocationEntity> page = basicdataGoodsAllocationService.page(Condition.getPage(query));
return BladePage.of(page);
}
@Override
public Long addLocation(BasicdataGoodsAllocationEntity entity) {
boolean saveFlag = BasicdataGoodsAllocationService.save(entity);
boolean saveFlag = basicdataGoodsAllocationService.save(entity);
if(saveFlag){
return entity.getId();
}else{
@ -74,12 +75,12 @@ public class BasicdataGoodsAllocationClient implements IBasicdataGoodsAllocation
UpdateWrapper<BasicdataGoodsAllocationEntity> updateWrapper = new UpdateWrapper<>();
updateWrapper.set("allocation_status",allocationStatus)
.eq("id",allocationId);
BasicdataGoodsAllocationService.update(updateWrapper);
basicdataGoodsAllocationService.update(updateWrapper);
}
@Override
public BasicdataGoodsAllocationEntity getEntityByAllocationId(Long allocationId) {
return BasicdataGoodsAllocationService.getById(allocationId);
return basicdataGoodsAllocationService.getById(allocationId);
}
@Override
@ -89,14 +90,29 @@ public class BasicdataGoodsAllocationClient implements IBasicdataGoodsAllocation
.eq("enable_status","1")
.eq("allocation_status","1")
.eq("is_deleted",0);
return BasicdataGoodsAllocationService.list(queryWrapper);
return basicdataGoodsAllocationService.list(queryWrapper);
}
@Override
public List<BasicdataGoodsAllocationEntity> findListByShelfId(Long shelfId) {
QueryWrapper<BasicdataGoodsAllocationEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("goods_shelf_id",shelfId);
return BasicdataGoodsAllocationService.list(queryWrapper);
return basicdataGoodsAllocationService.list(queryWrapper);
}
@Override
public List<BasicdataGoodsAllocationEntity> findListStockUpAllocationByName(String fragment) {
return basicdataGoodsAllocationService.findListStockUpAllocationByName(fragment);
}
@Override
public BasicdataGoodsAllocationEntity scanStockUpAllocationByCode(Long stockUpAreaCode) {
return basicdataGoodsAllocationService.scanStockUpAllocationByCode(stockUpAreaCode);
}
@Override
public String getAllocationIntegrityName(Long goodsStockupAllocationId) {
return basicdataGoodsAllocationService.getAllocationIntegrityName(goodsStockupAllocationId);
}
}

19
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAllocationMapper.java

@ -55,7 +55,7 @@ public interface BasicdataGoodsAllocationMapper extends BaseMapper<BasicdataGood
*/
List<BasicdataGoodsAllocationExcel> exportBasicdataGoodsAllocation(@Param("ew") Wrapper<BasicdataGoodsAllocationEntity> queryWrapper);
List<BasicdataNodeVO> selectSecondNode(@Param("warehouseId")String warehouseId);
List<BasicdataNodeVO> selectSecondNode(@Param("warehouseId")String warehouseId,@Param("areaType") String areaType);
List<BasicdataNodeVO> selectThirdNode(@Param("warehouseId")String warehouseId,@Param("areaId") String areaId);
@ -68,4 +68,21 @@ public interface BasicdataGoodsAllocationMapper extends BaseMapper<BasicdataGood
* @return
*/
WarehouseAllocationInfoVO selectAllocationInfo(@Param("id") String id);
/*
* @param warehouseId
* @param areaId
* @param goodsShelfId
* @return
*/
List<BasicdataNodeVO> selectFourthNode(@Param("warehouseId") String warehouseId,@Param("areaId") String areaId,@Param("goodsShelfId") String goodsShelfId);
String getAllocationIntegrityName(@Param("goodsAllocationId") Long goodsStockupAllocationId);
/**
* 查询托盘完整信息
* @param stockUpAreaCode
* @return
*/
BasicdataGoodsAllocationEntity getAllocationIntegrityEntity(@Param("id") Long stockUpAreaCode);
}

66
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAllocationMapper.xml

@ -50,6 +50,9 @@
is_deleted = 0
AND
warehouse_id = #{warehouseId}
<if test="areaType !=null and areaType != ''">
and area_type = #{areaType}
</if>
</select>
<select id="selectThirdNode" resultType="com.logpm.basicdata.vo.BasicdataNodeVO">
SELECT
@ -158,5 +161,66 @@
where lwga.is_deleted = 0
and CONCAT(lwga2.headline,'-',lwgs.goods_shelf_name,'-',lwga.goods_allocation_name) = #{allocationCode}
</select>
<select id="selectFourthNode" resultType="com.logpm.basicdata.vo.BasicdataNodeVO">
SELECT
lwga.id AS
VALUE
,
lwga.goods_allocation_name AS label,
( TRUE ) AS leaf
FROM
logpm_warehouse_goods_allocation AS lwga
WHERE
lwga.is_deleted = 0 AND lwga.warehouse_id = #{warehouseId} AND lwga.goods_area_id = #{areaId} and lwga.goods_shelf_id = #{goodsShelfId}
</select>
<select id="getAllocationIntegrityName" resultType="java.lang.String">
SELECT
CONCAT_WS('-',lwgaa.headline,lwgs.goods_shelf_name,lwga.goods_allocation_name)
FROM
logpm_warehouse_goods_allocation AS lwga
LEFT JOIN logpm_warehouse_goods_shelf AS lwgs ON lwga.goods_shelf_id = lwgs.id
LEFT JOIN logpm_warehouse_goods_area AS lwgaa ON lwga.goods_area_id = lwgaa.id
WHERE
lwga.id = #{goodsAllocationId}
</select>
<select id="getAllocationIntegrityEntity"
resultType="com.logpm.basicdata.entity.BasicdataGoodsAllocationEntity">
SELECT
CONCAT_WS( '-', lwgaa.headline, lwgs.goods_shelf_name, lwga.goods_allocation_name ) AS goodsAllocationName,
lwga.id,
lwga.tenant_id,
lwga.create_user,
lwga.create_time,
lwga.update_user,
lwga.update_time,
lwga.status,
lwga.is_deleted,
lwga.create_dept,
lwga.reserve1,
lwga.reserve2,
lwga.reserve3,
lwga.reserve4,
lwga.reserve5,
lwga.goods_area_id,
lwga.warehouse_name,
lwga.warehouse_id,
lwga.goods_shelf_id,
lwga.row_num,
lwga.enable_status,
lwga.allocation_status,
lwga.storey_num,
lwga.qr_code,
lwga.qr_code_url,
lwga.column_num,
lwga.layer_num,
lwga.template_id,
lwga.old_id,
lwga.old_qr_code
FROM
logpm_warehouse_goods_allocation AS lwga
LEFT JOIN logpm_warehouse_goods_shelf AS lwgs ON lwga.goods_shelf_id = lwgs.id
LEFT JOIN logpm_warehouse_goods_area AS lwgaa ON lwga.goods_area_id = lwgaa.id
WHERE
lwga.id = #{id}
</select>
</mapper>

23
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsAllocationService.java

@ -103,4 +103,27 @@ public interface IBasicdataGoodsAllocationService extends BaseService<BasicdataG
* 货位禁用
*/
R disableGoodsAllocation(String ids);
/**
* 查询备货区
* @param fragment
* @return
*/
List<BasicdataGoodsAllocationEntity> findListStockUpAllocationByName(String fragment);
/**
*
* @param stockUpAreaCode
* @return
*/
BasicdataGoodsAllocationEntity scanStockUpAllocationByCode(Long stockUpAreaCode);
List<BasicdataNodeVO> getStockUpAllocation();
/**
* 查询库位的完整名称 货区-货架-货位的方式呈现
* @param goodsStockupAllocationId
* @return
*/
String getAllocationIntegrityName(Long goodsStockupAllocationId);
}

79
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAllocationServiceImpl.java

@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import com.logpm.basic.entity.BasicPrintTemplateEntity;
import com.logpm.basic.feign.IBasicPrintTemplateClient;
@ -137,7 +138,7 @@ public class BasicdataGoodsAllocationServiceImpl extends BaseServiceImpl<Basicda
List<BasicdataNodeVO> basicdataWarehouseVOList = goodsAreaMapper.selectFirstNode(collect);
//遍历仓库节点查询货区节点信息
for (BasicdataNodeVO basicdataNodeVO : basicdataWarehouseVOList) {
List<BasicdataNodeVO> goodeAreaNodes = goodsAllocationMapper.selectSecondNode(basicdataNodeVO.getValue());
List<BasicdataNodeVO> goodeAreaNodes = goodsAllocationMapper.selectSecondNode(basicdataNodeVO.getValue(), null);
//判断仓库下是否存在货区节点,存在则添加,不存在则设置没有下级节点
if (!Func.isEmpty(goodeAreaNodes)) {
basicdataNodeVO.setChildren(goodeAreaNodes);
@ -163,7 +164,7 @@ public class BasicdataGoodsAllocationServiceImpl extends BaseServiceImpl<Basicda
public boolean insertGoodsAllocation(BasicdataGoodsAllocationDTO basicdataGoodsAllocationDto) {
BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity = new BasicdataGoodsAllocationEntity();
if (Func.isEmpty(basicdataGoodsAllocationDto)) {
log.error("参数不合法:{}" , basicdataGoodsAllocationDto);
log.error("参数不合法:{}", basicdataGoodsAllocationDto);
return false;
}
BeanUtils.copyProperties(basicdataGoodsAllocationDto, basicdataGoodsAllocationEntity);
@ -184,7 +185,7 @@ public class BasicdataGoodsAllocationServiceImpl extends BaseServiceImpl<Basicda
String code = tenantCodeClient.shelfCode(user.getTenantId(), "5");
String allocationCode = code + "-" + basicdataGoodsAllocationEntity.getColumnNum() + "-" + basicdataGoodsAllocationEntity.getLayerNum() + "-" + basicdataGoodsAllocationEntity.getGoodsAllocationName();
basicdataGoodsAllocationEntity.setQrCode(allocationCode);
return SqlHelper.retBool(goodsAllocationMapper.insert(basicdataGoodsAllocationEntity));
return SqlHelper.retBool(goodsAllocationMapper.insert(basicdataGoodsAllocationEntity));
}
@Override
@ -196,8 +197,8 @@ public class BasicdataGoodsAllocationServiceImpl extends BaseServiceImpl<Basicda
List<Long> collect = myWatchWarehouse.stream()
.map(BasicdataWarehouseEntity::getId)
.collect(Collectors.toList());
basicdataGoodsAllocation.put("warehouseList",collect);
return goodsAllocationMapper.selectGoodsAllocationList(page, basicdataGoodsAllocation);
basicdataGoodsAllocation.put("warehouseList", collect);
return goodsAllocationMapper.selectGoodsAllocationList(page, basicdataGoodsAllocation);
}
@ -205,7 +206,7 @@ public class BasicdataGoodsAllocationServiceImpl extends BaseServiceImpl<Basicda
public boolean updateGoodsAllocation(BasicdataGoodsAllocationDTO basicdataGoodsAllocationDto) {
boolean result = false;
if (Func.isEmpty(basicdataGoodsAllocationDto)) {
log.error("参数不合法:{}" , basicdataGoodsAllocationDto);
log.error("参数不合法:{}", basicdataGoodsAllocationDto);
return result;
}
BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity = new BasicdataGoodsAllocationEntity();
@ -265,22 +266,80 @@ public class BasicdataGoodsAllocationServiceImpl extends BaseServiceImpl<Basicda
boolean update = this.update(new UpdateWrapper<BasicdataGoodsAllocationEntity>().lambda()
.set(BasicdataGoodsAllocationEntity::getEnableStatus, 1)
.in(BasicdataGoodsAllocationEntity::getId, Func.toLongList(ids)));
return update?R.success("成功"):R.fail("失败");
return update ? R.success("成功") : R.fail("失败");
}
@Override
public R disableGoodsAllocation(String ids) {
log.info("传入参数>>>>>>>>>>{}",ids);
log.info("传入参数>>>>>>>>>>{}", ids);
//查询该货位有无货物
// List<Long> longs = Func.toLongList(ids);
Integer integer = warehouseUpdownGoodsClient.selectCountByAllo(ids);
if (integer>0){
if (integer > 0) {
return R.fail("有货物,无法禁用");
}
boolean update = this.update(new UpdateWrapper<BasicdataGoodsAllocationEntity>().lambda()
.set(BasicdataGoodsAllocationEntity::getEnableStatus, 2)
.in(BasicdataGoodsAllocationEntity::getId, Func.toLongList(ids)));
return update?R.success("成功"):R.fail("失败");
return update ? R.success("成功") : R.fail("失败");
}
@Override
public List<BasicdataGoodsAllocationEntity> findListStockUpAllocationByName(String fragment) {
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)) {
return null;
}
return this.list(Wrappers.<BasicdataGoodsAllocationEntity>query().lambda()
.like(BasicdataGoodsAllocationEntity::getGoodsAllocationName, fragment)
.eq(BasicdataGoodsAllocationEntity::getWarehouseId, myCurrentWarehouse.getId())
.eq(BasicdataGoodsAllocationEntity::getEnableStatus, "1")
);
}
@Override
public BasicdataGoodsAllocationEntity scanStockUpAllocationByCode(Long stockUpAreaCode) {
return baseMapper.getAllocationIntegrityEntity(stockUpAreaCode);
}
@Override
public List<BasicdataNodeVO> getStockUpAllocation() {
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseService.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)) {
return null;
}
List<BasicdataNodeVO> nodeS = new ArrayList<>();
List<BasicdataNodeVO> goodeAreaNodes = goodsAllocationMapper.selectSecondNode(myCurrentWarehouse.getId().toString(), "1");
if (Func.isNotEmpty(goodeAreaNodes)) {
for (BasicdataNodeVO goodeAreaNode : goodeAreaNodes) {
List<BasicdataNodeVO> goodsShelfNode = goodsAllocationMapper.selectThirdNode(myCurrentWarehouse.getId().toString(), goodeAreaNode.getValue());
if (Func.isNotEmpty(goodsShelfNode)) {
goodeAreaNode.setChildren(goodsShelfNode);
goodeAreaNode.setLeaf(false);
for (BasicdataNodeVO basicdataNodeVO : goodsShelfNode) {
List<BasicdataNodeVO> goodsAllocationNode = goodsAllocationMapper.selectFourthNode(myCurrentWarehouse.getId().toString(), goodeAreaNode.getValue(), basicdataNodeVO.getValue());
if (Func.isNotEmpty(goodsAllocationNode)) {
basicdataNodeVO.setChildren(goodsAllocationNode);
basicdataNodeVO.setLeaf(false);
}else {
basicdataNodeVO.setLeaf(true);
}
}
}else {
goodeAreaNode.setLeaf(true);
}
nodeS.add(goodeAreaNode);
}
}
return nodeS;
}
@Override
public String getAllocationIntegrityName(Long goodsStockupAllocationId) {
return baseMapper.getAllocationIntegrityName(goodsStockupAllocationId);
}
}

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

@ -320,11 +320,17 @@ public class BasicdataGoodsAreaServiceImpl extends BaseServiceImpl<BasicdataGood
.map(BasicdataWarehouseEntity::getId)
.collect(Collectors.toList());
//查询货区(除开备货区)
// List<BasicdataGoodsAreaEntity> basicdataGoodsAreaEntities = basicdataGoodsAreaMapper.selectList(new QueryWrapper<BasicdataGoodsAreaEntity>().lambda()
// .eq(BasicdataGoodsAreaEntity::getIsDeleted,0)
// .eq(BasicdataGoodsAreaEntity::getAreaType,2)
// .in(collect.size()>0,BasicdataGoodsAreaEntity::getWarehouseId,collect)
// );
// 2023-12-12 备货区可创建货架
List<BasicdataGoodsAreaEntity> basicdataGoodsAreaEntities = basicdataGoodsAreaMapper.selectList(new QueryWrapper<BasicdataGoodsAreaEntity>().lambda()
.eq(BasicdataGoodsAreaEntity::getIsDeleted,0)
.eq(BasicdataGoodsAreaEntity::getAreaType,2)
.in(collect.size()>0,BasicdataGoodsAreaEntity::getWarehouseId,collect)
);
return basicdataGoodsAreaEntities;
}

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

@ -107,9 +107,21 @@
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-system-api</artifactId>
<version>3.2.0.RELEASE</version>
<version>${bladex.project.version}</version>
<scope>compile</scope>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springblade</groupId>-->
<!-- <artifactId>logpm-factory</artifactId>-->
<!-- <version>${bladex.project.version}</version>-->
<!-- <scope>compile</scope>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.springblade</groupId>-->
<!-- <artifactId>logpm-factory-api</artifactId>-->
<!-- <version>${bladex.project.version}</version>-->
<!-- <scope>compile</scope>-->
<!-- </dependency>-->
</dependencies>

63
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java

@ -23,8 +23,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.entity.BasicdataGoodsAllocationEntity;
import com.logpm.basicdata.entity.BasicdataGoodsAreaEntity;
import com.logpm.basicdata.entity.BasicdataTrayEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataGoodsAllocationClient;
import com.logpm.basicdata.feign.IBasicdataGoodsAreaClient;
import com.logpm.basicdata.feign.IBasicdataTrayClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
@ -130,6 +133,8 @@ public class DistributionStockupAppController extends BladeController {
private final IDisStockOrdercodeRecoService disStockOrdercodeRecoService;
private final IBasicdataGoodsAllocationClient basicdataGoodsAllocationClient;
/**
* 备货信息表 任务客户 分页列表
@ -183,9 +188,42 @@ public class DistributionStockupAppController extends BladeController {
return R.fail(401, "查询备货ID不能为空");
}
Map<String, Object> map = distributionStockupService.selectHomeStockupPage(stockupDTO);
if (Func.isEmpty(map.get("stockupArea"))){
map.put("stockupArea","");
}
return R.data(map);
}
@ResponseBody
@GetMapping("/inspectStockUpArea")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "检查备货区", notes = "传入stockupDTO")
public R inspectArea(@RequestParam String fragment) {
return R.data(basicdataGoodsAllocationClient.findListStockUpAllocationByName(fragment)) ;
}
@ResponseBody
@GetMapping("/scanStockUpArea")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "检查备货区", notes = "传入stockupDTO")
public R scanStockUpArea(@RequestParam Long stockUpAreaCode) {
BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity = basicdataGoodsAllocationClient.scanStockUpAllocationByCode(stockUpAreaCode);
if (Func.isEmpty(basicdataGoodsAllocationEntity)){
return Resp.scanFail("无此库位信息","无此库位信息");
}
Long goodsAreaId = basicdataGoodsAllocationEntity.getGoodsAreaId();
BasicdataGoodsAreaEntity entityByGoodsAreaId = basicdataGoodsAreaClient.getEntityByGoodsAreaId(goodsAreaId);
if (entityByGoodsAreaId.getAreaType().equals("2")){
return Resp.scanFail("不是备货区库位","不是备货区库位");
}
return R.data(basicdataGoodsAllocationEntity);
}
/**
* 对象转map
*
@ -654,8 +692,8 @@ public class DistributionStockupAppController extends BladeController {
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)){
return R.data(403, "未授权!");
}
if (scanType == 2) {
//库存品扫描
Long stockListId = stockupDTO.getStockListId();
@ -1145,6 +1183,13 @@ public class DistributionStockupAppController extends BladeController {
log.warn("##################allocationId: 货位ID为空!");
return R.fail("货位ID不能为空");
}
if (Objects.isNull(stockupDTO.getGoodsStockupAllocationId())) {
log.warn("##################allocationId: 货位ID为空!");
return R.fail("备货货位ID不能为空");
}
//查询备货库位信息
String allocationIntegrityName = basicdataGoodsAllocationClient.getAllocationIntegrityName(stockupDTO.getGoodsStockupAllocationId());
//判断是否可以继续备货
DistributionStockListEntity byId = null;
// if (ObjectUtils.isNull(stockListId)) {
@ -1412,7 +1457,12 @@ public class DistributionStockupAppController extends BladeController {
entity.setType(2);
entity.setAllocationId(stockupDTO.getAllocationId());
entity.setOutboundType(stockupEntity.getTypeService());
entity.setGoodsStockupAllocationId(stockupDTO.getGoodsStockupAllocationId());
entity.setStockupArea(allocationIntegrityName);
distributionStockService.save(entity);
distributionStockService.maintenanceStockUpArea(entity.getStockupId(),allocationIntegrityName);
// dataSourceTransactionManager.commit(transactionStatus);//提交
Map<String, Object> map = new HashMap<>();
@ -1513,6 +1563,14 @@ public class DistributionStockupAppController extends BladeController {
return R.fail("包件扫码:预约单id不能为空");
}
// ------------------2023-12-14 增加扫描
// if (Func.isEmpty(stockupDTO.getGoodsStockupAllocationId())){
// return Resp.scanFail("无备货库位信息", "无备货库位信息!");
// }
// -------------------------------------------------------
String allocationIntegrityName = basicdataGoodsAllocationClient.getAllocationIntegrityName(stockupDTO.getGoodsStockupAllocationId());
Integer integer = distributionStockupService.selectPackage(stockupDTO);
switch (integer) {
case 1:
@ -1556,7 +1614,10 @@ public class DistributionStockupAppController extends BladeController {
entity.setConditions("0");
entity.setType(2);
entity.setOutboundType(distributionStockupEntity.getTypeService());
entity.setGoodsStockupAllocationId(stockupDTO.getGoodsStockupAllocationId());
entity.setStockupArea(allocationIntegrityName);
distributionStockService.save(entity);
distributionStockService.maintenanceStockUpArea(entity.getStockupId(), allocationIntegrityName);
//修改订单备货状态
distributionAsyncService.updateStockArticleStock(one.getStockArticleId());
// dataSourceTransactionManager.commit(transactionStatus);//提交

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockController.java

@ -110,11 +110,9 @@ public class DistributionStockController extends BladeController {
@ApiOperationSupport(order = 4)
@ApiOperation(value = "系统备货新增", notes = "传入distributionStock")
public R addStockDetail(@Valid @RequestBody DistributionStockDTO distributionStock) {
if(ObjectUtils.isNull(distributionStock.getGoodsAreaId())){
return R.fail("注意,注意:备货区未选择!");
}
// if(ObjectUtils.isNull(distributionStock.getGoodsAreaId())){
// return R.fail("注意,注意:备货区未选择!");
// }
return R.status(distributionStockService.addStockDetail(distributionStock));
}

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/StockupDTO.java

@ -49,6 +49,8 @@ public class StockupDTO implements Serializable {
private Long userId;//当前操作人
private String deliveryDetailsId;//订单库存ID
private Long goodsStockupAllocationId;//备货库位ID
//扫码参数
private Integer scanType;//备货扫码类型 1 包件 2库存品
private String packetBarCode;//包件码

16
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml

@ -414,6 +414,14 @@
LEFT JOIN logpm_distribution_reservation ldr on ldr.id = ldsi.reservation_id
where ds.id = lds.id
) customer,
<!-- (-->
<!-- SELECT-->
<!-- group_concat( IFNULL( ldr.mall_name, '' ) SEPARATOR ',' )-->
<!-- FROM-->
<!-- logpm_distribution_reservation ldr-->
<!-- WHERE-->
<!-- ldr.id = ldsi.reservation_id-->
<!-- ) AS mallName,-->
(
select GROUP_CONCAT(DISTINCT lwug.position_code )
from logpm_distribution_stockup ds
@ -481,6 +489,14 @@
LEFT JOIN logpm_distribution_stock_article ldsa on ldbs.stock_article_id = ldsa.id
where ldbs.bill_lading_id = ldsi.reservation_id
) customer,
<!-- (-->
<!-- SELECT-->
<!-- group_concat( IFNULL( ldr.mall_name, '' ) SEPARATOR ',' )-->
<!-- FROM-->
<!-- logpm_distribution_reservation AS ldr-->
<!-- WHERE-->
<!-- ldr.id = ldsi.reservation_id-->
<!-- ) AS mallName,-->
(
select GROUP_CONCAT(DISTINCT ldpl.goods_allocation SEPARATOR ',')
from logpm_distrilbution_bill_stock ldbs

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java

@ -1,5 +1,6 @@
package com.logpm.distribution.service;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.distribution.dto.DistributionStockArticleDTO;
import com.logpm.distribution.dto.app.DistrilbutionloadingscanDTO;
import com.logpm.distribution.dto.app.StockupDTO;
@ -258,4 +259,13 @@ public interface IDistributionAsyncService {
* @param orderPackageId
*/
void checkRetentionZeroPackageReservationAndDeliveryInfo(Long reservationId, Long deliveryId, Long orderPackageId, Long orderId);
/**
* 推送装车数据至工厂
* @param parcelListEntity
* @param deliveryId
* @param reservationId
* @param number
*/
void pushLoadingByPackage(DistributionParcelListEntity parcelListEntity, Long deliveryId, Long reservationId, String type, Long warehouseId);
}

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockService.java

@ -74,6 +74,7 @@ public interface IDistributionStockService extends BaseService<DistributionStock
* @return
*/
void getUpdateOrderState(Long pageId,int type,Integer num);
void maintenanceStockUpArea(Long pageId,String allocationIntegrityName);
Integer selectCount(Long id,Long parseLong);

39
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java

@ -46,6 +46,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -1342,6 +1343,44 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
maintenanceDeliveryPackageNum(deliveryId);
}
@Override
@Async
public void pushLoadingByPackage(DistributionParcelListEntity parcelListEntity, Long deliveryId, Long reservationId, String type,Long warehouseId) {
// switch (type){
// case "4":
// DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(deliveryId);
// OrderStatusDTO orderStatusDTO = new OrderStatusDTO();
// orderStatusDTO.setDispatchNumber(distributionDeliveryListEntity.getTrainNumber());
// orderStatusDTO.setOrderNo(parcelListEntity.getOrderCode());
// orderStatusDTO.setLogiBillNo(parcelListEntity.getWaybillNumber());
// orderStatusDTO.setUnitNo(parcelListEntity.getOrderPackageCode());
// DistributionLoadscanEntity distributionLoadscanEntity = distributionLoadscanMapper.selectOne(Wrappers.<DistributionLoadscanEntity>query().lambda()
// .eq(DistributionLoadscanEntity::getDeliveryId, deliveryId)
// .eq(DistributionLoadscanEntity::getReservationId, reservationId)
// .eq(DistributionLoadscanEntity::getOrderPackageCode, parcelListEntity.getOrderPackageCode())
// .eq(DistributionLoadscanEntity::getPackageId, parcelListEntity.getId())
// .ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
// );
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
// orderStatusDTO.setOperationTime(sdf.format(distributionLoadscanEntity.getScanTime()));
// orderStatusDTO.setCurrentWarehouse(warehouseId.toString());
// orderStatusDTO.setDistributionContactId(distributionDeliveryListEntity.getId().toString());
// orderStatusDTO.setStatus("5");
// orderStatusDTO.setUsername(distributionLoadscanEntity.getScanUser());
//
//
// break;
// case "5":
// ReceiveInfoDTO receiveInfoDTO = new ReceiveInfoDTO();
// receiveInfoDTO.setReceiver();
//
//
// break;
//
// }
}
/**
* 维护配送数量和状态
*

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

@ -598,6 +598,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
// str.append("包件装车");
// loadingNum.getAndAdd(loadscanEntity.getPackageNub());
distributionAsyncService.checkLoadingByPackage(parcelListEntity, loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId());
//推送装车数据
distributionAsyncService.pushLoadingByPackage(parcelListEntity, loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(),"4",myCurrentWarehouse.getId());
} else if (parcelListEntityList.size() == 0) {
//查找出该包件信息
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getOne(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode()));
@ -1505,6 +1507,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
Integer k = distributionStockArticleMapper.deductionHandQuantity(loadscanEntity.getOrderId(), loadscanEntity.getLoadedNub());
warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId());
distributionAsyncService.checkOrderLoadingStatus(parcelListEntity.getId());
//推送装车数据
distributionAsyncService.pushLoadingByPackage(parcelListEntity, loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(),"4",myCurrentWarehouse.getId());
}
//异步修改包件状态
// distributionAsyncService.changeMarketDeliveryListStatus(loadscanEntity.getOrderPackageCode(), loadscanEntity.getDeliveryId());
@ -5145,6 +5149,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionStockArticleMapper.deductionHandQuantity(loadscanEntity.getOrderId(), loadscanEntity.getLoadedNub());
//异步维护此异常装车包件的订单状态
distributionAsyncService.checkOrderLoadingStatus(parcelListEntity.getId());
//推送装车数据
distributionAsyncService.pushLoadingByPackage(parcelListEntity, loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(),"4",myCurrentWarehouse.getId());
DistributionSignforEntity signforEntity = distributionSignforService.getOne(Wrappers.<DistributionSignforEntity>query().lambda().eq(DistributionSignforEntity::getReservationId, reservationEntity.getId()).eq(DistributionSignforEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()));
if (Func.isNotEmpty(signforEntity)) {
//标识该客户存在异常装车包件,为了后续的异常装车审核

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

@ -777,7 +777,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
distributionStockListInfo.setServiceNumber(distributionStockListEntity.getServiceNumber()); //服务号
distributionStockListInfo.setDescriptionGoods(distributionStockListEntity.getMallName()); //物料名称
distributionStockListInfo.setCargoNumber(distributionStockListEntity.getMarketCode()); //物料编号
distributionStockListInfo.setCargoNumber(distributionStockListEntity.getCargoNumber()); //物料编号
distributionStockListInfo.setWarehouseName(distributionStockListEntity.getWarehouseName()); //仓库
distributionStockListInfo.setWarehouseId(distributionStockListEntity.getWarehouseId()); //仓库ID
distributionStockListInfo.setMarketId(distributionStockListEntity.getMarketId()); //商场

43
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockServiceImpl.java

@ -21,6 +21,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basicdata.entity.BasicdataGoodsAllocationEntity;
import com.logpm.basicdata.feign.IBasicdataGoodsAllocationClient;
import com.logpm.distribution.dto.DistributionStockDTO;
import com.logpm.distribution.entity.*;
import com.logpm.distribution.excel.DistributionStockExcel;
@ -37,6 +39,7 @@ import org.springblade.common.constant.order.OrderStockupStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStockupStatusConstant;
import org.springblade.common.constant.stockup.StockupStatusConstant;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.Func;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
@ -80,6 +83,8 @@ public class DistributionStockServiceImpl extends BaseServiceImpl<DistributionSt
private IDistributionDeliveryDetailsService distributionDeliveryDetailsService;
private IBasicdataGoodsAllocationClient basicdataGoodsAllocationClient;
@Override
public IPage<DistributionStockVO> selectDistributionStockPage(IPage<DistributionStockVO> page, DistributionStockVO distributionStock) {
@ -204,8 +209,13 @@ public class DistributionStockServiceImpl extends BaseServiceImpl<DistributionSt
@Transactional(rollbackFor = Exception.class)
public Boolean addStockDetail(DistributionStockDTO distributionStocks) {
// DistributionStockDTO distributionStock1 = JSONObject.parseObject(JSONObject.toJSONString(distributionStocks), DistributionStockDTO.class);
if (Func.isEmpty(distributionStocks.getGoodsStockupAllocationId())){
log.warn("备货缺少备货库位ID");
return false;
}
List<String> ids = distributionStocks.getIds();
List<DistributionStockEntity> list = new ArrayList<>();
String allocationIntegrityName = basicdataGoodsAllocationClient.getAllocationIntegrityName(distributionStocks.getGoodsStockupAllocationId());
for (int ii = 0; ii < ids.size(); ii++) {
String i = ids.get(ii);
DistributionStockEntity stockEntity = new DistributionStockEntity();
@ -246,10 +256,18 @@ public class DistributionStockServiceImpl extends BaseServiceImpl<DistributionSt
stockEntity.setGoodsName(byId.getMaterialName()); //货物名称
stockEntity.setUnit(byId.getMaterialUnit()); //单位
stockEntity.setOrderSelfNumbering(byId.getOrderCode()); //自编码
//----------------------2023-12-14 备货区域字段调整
//查询库位的完整名称
if (Func.isNotEmpty(allocationIntegrityName)){
stockEntity.setStockupArea(distributionStocks.getStockupArea()); //自编码
}
stockEntity.setStockupArea(distributionStocks.getStockupArea()); //自编码
stockEntity.setStockupId(distributionStocks.getStockupId()); //自编码
stockEntity.setType(1);
stockEntity.setStockQuantity(1);
stockEntity.setGoodsStockupAllocationId(distributionStocks.getGoodsStockupAllocationId());
stockEntity.setStockQuantity(1);
stockEntity.setStockQuantity(1);
stockEntity.setOutboundType(byId1.getTypeService());//类型
list.add(stockEntity);
//修改备货状态
@ -262,10 +280,15 @@ public class DistributionStockServiceImpl extends BaseServiceImpl<DistributionSt
if(ObjectUtils.isNotNull(distributionStocks.getStockupType()) && distributionStocks.getStockupType().equals("ZT")){
//修改备货状态 自提
getUpdateOrderState(distributionStocks.getStockupId(),3,list.size() );
}else{
//修改备货状态 市 商
getUpdateOrderState(distributionStocks.getStockupId(),2,list.size() );
getUpdateOrderState(distributionStocks.getStockupId(),2,list.size());
}
//维护备货区
maintenanceStockUpArea(distributionStocks.getStockupId(),allocationIntegrityName);
//修改已备货的数量
@ -279,7 +302,7 @@ public class DistributionStockServiceImpl extends BaseServiceImpl<DistributionSt
* @param type
*/
@Override
public void getUpdateOrderState(Long pageId,int type,Integer num ) {
public void getUpdateOrderState(Long pageId,int type,Integer num) {
switch (type){
case 1: //修改订单备货状态
DistributionStockVO distributionStockVO = baseMapper.selectParcelList(pageId); //查询有多少待备货的包件
@ -319,6 +342,7 @@ public class DistributionStockServiceImpl extends BaseServiceImpl<DistributionSt
//查询备货状态
getUpdateStockup(pageId,2);
}
}
}
@ -353,6 +377,21 @@ public class DistributionStockServiceImpl extends BaseServiceImpl<DistributionSt
}
@Override
public void maintenanceStockUpArea(Long pageId, String allocationIntegrityName) {
DistributionStockupEntity distributionStockupEntity = distributionStockupMapper.selectById(pageId);
if (Func.isBlank(distributionStockupEntity.getStockupArea())){
distributionStockupEntity.setStockupArea(allocationIntegrityName);
}else {
if (!distributionStockupEntity.getStockupArea().contains(allocationIntegrityName)){
distributionStockupEntity.setStockupArea(distributionStockupEntity.getStockupArea()+","+allocationIntegrityName);
}
}
distributionStockupMapper.updateById(distributionStockupEntity);
}
/**
* 修改备货状态
* @param pageId

Loading…
Cancel
Save