Browse Source

1.商家端接口调整 --未完成

master
pref_mail@163.com 10 months ago
parent
commit
966bfc2732
  1. 2
      blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java
  2. 0
      blade-service-api/logpm-business-api/src/main/java/com/logpm/business/dto/BusinessPreListDTO.java
  3. 12
      blade-service-api/logpm-business-api/src/main/java/com/logpm/business/dto/BusinessPreOrderDTO.java
  4. 0
      blade-service-api/logpm-business-api/src/main/java/com/logpm/business/dto/BusinessSanDTO.java
  5. 2
      blade-service-api/logpm-business-api/src/main/java/com/logpm/business/entity/BusinessPreOrderEntity.java
  6. 28
      blade-service-api/logpm-business-api/src/main/java/com/logpm/business/feign/IBusinessPreOrderClient.java
  7. 14
      blade-service-api/logpm-business-api/src/main/java/com/logpm/business/vo/BusinessPreOrderVO.java
  8. 0
      blade-service-api/logpm-business-api/src/main/java/com/logpm/business/vo/DistributionBusinessPreCarDetalPackageVO.java
  9. 0
      blade-service-api/logpm-business-api/src/main/java/com/logpm/business/vo/DistributionBusinessPreCarDetalVO.java
  10. 0
      blade-service-api/logpm-business-api/src/main/java/com/logpm/business/vo/DistributionBusinessPreCarNumberVO.java
  11. 0
      blade-service-api/logpm-business-api/src/main/java/com/logpm/business/vo/DistributionBusinessPreCarNumerPageQueryVO.java
  12. 0
      blade-service-api/logpm-business-api/src/main/java/com/logpm/business/vo/DistributionBusinessPreCarNumerPageVO.java
  13. 0
      blade-service-api/logpm-business-api/src/main/java/com/logpm/business/vo/DistributionBusinessPreCarOrderDetalVO.java
  14. 2
      blade-service-api/logpm-business-api/src/main/java/com/logpm/business/vo/DistributionBusinessPreOrderListVO.java
  15. 21
      blade-service-api/logpm-business-conversion-api/pom.xml
  16. 13
      blade-service-api/logpm-business-conversion-api/src/main/java/com/logpm/business/dto/DistributionBusinessPreOrderDTO.java
  17. 14
      blade-service-api/logpm-business-conversion-api/src/main/java/com/logpm/business/vo/DistributionBusinessPreOrderVO.java
  18. 18
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionBusinessPreOrderClient.java
  19. 1
      blade-service-api/pom.xml
  20. 6
      blade-service/logpm-business/pom.xml
  21. 45
      blade-service/logpm-business/src/main/java/com/logpm/business/api/BusinessPreOrderApi.java
  22. 15
      blade-service/logpm-business/src/main/java/com/logpm/business/bean/Resp.java
  23. 16
      blade-service/logpm-business/src/main/java/com/logpm/business/controller/DistributionBusinessPreOrderController.java
  24. 28
      blade-service/logpm-business/src/main/java/com/logpm/business/feign/BusinessPreOrderClient.java
  25. 14
      blade-service/logpm-business/src/main/java/com/logpm/business/mapper/BusinessPreOrderMapper.java
  26. 13
      blade-service/logpm-business/src/main/java/com/logpm/business/mapper/BusinessPreOrderMapper.xml
  27. 62
      blade-service/logpm-business/src/main/java/com/logpm/business/mapper/DistributionBusinessPreOrderMapper.java
  28. 187
      blade-service/logpm-business/src/main/java/com/logpm/business/mapper/DistributionBusinessPreOrderMapper.xml
  29. 10
      blade-service/logpm-business/src/main/java/com/logpm/business/receiver/InWarehourseToBusinessHandler.java
  30. 11
      blade-service/logpm-business/src/main/java/com/logpm/business/service/IBusinessAsyncService.java
  31. 13
      blade-service/logpm-business/src/main/java/com/logpm/business/service/IBusinessPreOrderService.java
  32. 55
      blade-service/logpm-business/src/main/java/com/logpm/business/service/IDistributionBusinessPreOrderService.java
  33. 83
      blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessAsyncServiceImpl.java
  34. 160
      blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessPreOrderServiceImpl.java
  35. 249
      blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/IDistributionBusinessPreOrderServiceImpl.java
  36. 2
      blade-service/logpm-distribution/pom.xml
  37. 15
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionAddvalueAppController.java
  38. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionBillLadingAppController.java
  39. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionDeliveryAppController.java
  40. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionInQueryApiController.java
  41. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionReservationAppController.java
  42. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionSignforAppController.java
  43. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionStockListPDAController.java
  44. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionStockupAppController.java
  45. 36
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/config/RedissonConfig.java
  46. 83
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionBusinessPreOrderController.java
  47. 14
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/BusinessPreOrderDTO.java
  48. 14
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionBusinessPreOrderDTO.java
  49. 17
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionBusinessPreOrderClient.java
  50. 35
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/BusinessPreOrderDataQueueHandler.java
  51. 13
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java
  52. 84
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  53. 118
      blade-service/logpm-factory/src/test/java/com/logpm/factory/TestService.java
  54. 38
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java

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

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

0
blade-service-api/logpm-business-conversion-api/src/main/java/com/logpm/business/dto/BusinessPreListDTO.java → blade-service-api/logpm-business-api/src/main/java/com/logpm/business/dto/BusinessPreListDTO.java

12
blade-service-api/logpm-business-api/src/main/java/com/logpm/business/dto/BusinessPreOrderDTO.java

@ -0,0 +1,12 @@
package com.logpm.business.dto;
import com.logpm.business.entity.BusinessPreOrderEntity;
/**
*
*/
public class BusinessPreOrderDTO extends BusinessPreOrderEntity {
}

0
blade-service-api/logpm-business-conversion-api/src/main/java/com/logpm/business/dto/BusinessSanDTO.java → blade-service-api/logpm-business-api/src/main/java/com/logpm/business/dto/BusinessSanDTO.java

2
blade-service-api/logpm-business-conversion-api/src/main/java/com/logpm/business/entity/DistributionBusinessPreOrderEntity.java → blade-service-api/logpm-business-api/src/main/java/com/logpm/business/entity/BusinessPreOrderEntity.java

@ -37,7 +37,7 @@ import java.util.Date;
@TableName("logpm_business_pre_order")
@ApiModel(value = "DistributionBusinessPreOrder对象", description = "商场转换预处理实体")
@EqualsAndHashCode(callSuper = true)
public class DistributionBusinessPreOrderEntity extends TenantEntity {
public class BusinessPreOrderEntity extends TenantEntity {
/**
* 预留1

28
blade-service-api/logpm-business-api/src/main/java/com/logpm/business/feign/IBusinessPreOrderClient.java

@ -0,0 +1,28 @@
package com.logpm.business.feign;
import com.logpm.business.entity.BusinessPreOrderEntity;
import org.apache.ibatis.annotations.Param;
import org.springblade.common.constant.ModuleNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@FeignClient(
value = ModuleNameConstant.APPLICATION_DISTRIBUTION_NAME
)
public interface IBusinessPreOrderClient {
String API_PREFIX = "/client";
String INORDERBYORDERPACKAGECODE = API_PREFIX + "/inOrderByOrderPackageCode";
String SAVEOTHERDATABASENEW = API_PREFIX + "/saveOtherDataBaseNew";
@GetMapping(INORDERBYORDERPACKAGECODE)
Integer inOrderByOrderPackageCode(@RequestParam("orderPackageCode") String orderPackageCode, @RequestParam("carNum") String carNum);
@PostMapping(SAVEOTHERDATABASENEW)
void saveOtherDataBaseNew(@RequestParam("userId") String tenantId, @RequestBody List<BusinessPreOrderEntity> dataResult, @RequestParam("userId") String mallName);
}

14
blade-service-api/logpm-business-api/src/main/java/com/logpm/business/vo/BusinessPreOrderVO.java

@ -0,0 +1,14 @@
package com.logpm.business.vo;
import com.logpm.business.entity.BusinessPreOrderEntity;
import lombok.Data;
/**
*
*/
@Data
public class BusinessPreOrderVO extends BusinessPreOrderEntity {
}

0
blade-service-api/logpm-business-conversion-api/src/main/java/com/logpm/business/vo/DistributionBusinessPreCarDetalPackageVO.java → blade-service-api/logpm-business-api/src/main/java/com/logpm/business/vo/DistributionBusinessPreCarDetalPackageVO.java

0
blade-service-api/logpm-business-conversion-api/src/main/java/com/logpm/business/vo/DistributionBusinessPreCarDetalVO.java → blade-service-api/logpm-business-api/src/main/java/com/logpm/business/vo/DistributionBusinessPreCarDetalVO.java

0
blade-service-api/logpm-business-conversion-api/src/main/java/com/logpm/business/vo/DistributionBusinessPreCarNumberVO.java → blade-service-api/logpm-business-api/src/main/java/com/logpm/business/vo/DistributionBusinessPreCarNumberVO.java

0
blade-service-api/logpm-business-conversion-api/src/main/java/com/logpm/business/vo/DistributionBusinessPreCarNumerPageQueryVO.java → blade-service-api/logpm-business-api/src/main/java/com/logpm/business/vo/DistributionBusinessPreCarNumerPageQueryVO.java

0
blade-service-api/logpm-business-conversion-api/src/main/java/com/logpm/business/vo/DistributionBusinessPreCarNumerPageVO.java → blade-service-api/logpm-business-api/src/main/java/com/logpm/business/vo/DistributionBusinessPreCarNumerPageVO.java

0
blade-service-api/logpm-business-conversion-api/src/main/java/com/logpm/business/vo/DistributionBusinessPreCarOrderDetalVO.java → blade-service-api/logpm-business-api/src/main/java/com/logpm/business/vo/DistributionBusinessPreCarOrderDetalVO.java

2
blade-service-api/logpm-business-conversion-api/src/main/java/com/logpm/business/vo/DistributionBusinessPreOrderListVO.java → blade-service-api/logpm-business-api/src/main/java/com/logpm/business/vo/DistributionBusinessPreOrderListVO.java

@ -22,7 +22,7 @@ public class DistributionBusinessPreOrderListVO implements Serializable {
/**
* 列表数据
*/
private List<DistributionBusinessPreOrderVO> list;
private List<BusinessPreOrderVO> list;
}

21
blade-service-api/logpm-business-conversion-api/pom.xml

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springblade</groupId>
<artifactId>logpm-business-conversion-api</artifactId>
<version>3.2.0.RELEASE</version>
<parent>
<groupId>org.springblade</groupId>
<version>3.2.0.RELEASE</version>
<artifactId>blade-service-api</artifactId>
</parent>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

13
blade-service-api/logpm-business-conversion-api/src/main/java/com/logpm/business/dto/DistributionBusinessPreOrderDTO.java

@ -1,13 +0,0 @@
package com.logpm.business.dto;
import com.logpm.business.entity.DistributionBusinessPreOrderEntity;
import lombok.Data;
/**
*
*/
public class DistributionBusinessPreOrderDTO extends DistributionBusinessPreOrderEntity {
}

14
blade-service-api/logpm-business-conversion-api/src/main/java/com/logpm/business/vo/DistributionBusinessPreOrderVO.java

@ -1,14 +0,0 @@
package com.logpm.business.vo;
import com.logpm.business.entity.DistributionBusinessPreOrderEntity;
import lombok.Data;
/**
*
*/
@Data
public class DistributionBusinessPreOrderVO extends DistributionBusinessPreOrderEntity {
}

18
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionBusinessPreOrderClient.java

@ -1,18 +0,0 @@
package com.logpm.distribution.feign;
import org.springblade.common.constant.ModuleNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
@FeignClient(
value = ModuleNameConstant.APPLICATION_DISTRIBUTION_NAME
)
public interface IDistributionBusinessPreOrderClient {
String API_PREFIX = "/client";
String INORDERBYORDERPACKAGECODE = API_PREFIX + "/inOrderByOrderPackageCode";
@GetMapping(INORDERBYORDERPACKAGECODE)
Integer inOrderByOrderPackageCode(@RequestParam("orderPackageCode") String orderPackageCode, @RequestParam("carNum") String carNum);
}

1
blade-service-api/pom.xml

@ -43,7 +43,6 @@
<module>logpm-factory-data-api</module>
<module>logpm-factory-data-base-api</module>
<!-- 商家转化模块 -->
<module>logpm-business-conversion-api</module>
<module>logpm-factory-data-zbom-api</module>
<!--商家端 -->

6
blade-service/logpm-business/pom.xml

@ -46,11 +46,7 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-business-conversion-api</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-trunkline-api</artifactId>

45
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionBusinessPreOrderAppController.java → blade-service/logpm-business/src/main/java/com/logpm/business/api/BusinessPreOrderApi.java

@ -1,39 +1,37 @@
package com.logpm.distribution.appcontroller;
package com.logpm.business.api;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.business.bean.Resp;
import com.logpm.business.dto.BusinessPreListDTO;
import com.logpm.business.dto.BusinessSanDTO;
import com.logpm.business.vo.*;
import com.logpm.distribution.bean.Resp;
import com.logpm.distribution.service.IDistributionBusinessPreOrderService;
import com.logpm.business.service.IBusinessPreOrderService;
import com.logpm.business.vo.DistributionBusinessPreCarDetalVO;
import com.logpm.business.vo.DistributionBusinessPreCarNumerPageQueryVO;
import com.logpm.business.vo.DistributionBusinessPreCarNumerPageVO;
import com.logpm.business.vo.DistributionBusinessPreOrderListVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;
@RestController
@AllArgsConstructor
@RequestMapping("/app/businessPreOrder")
@Api(value = "配送管理", tags = "配送管理App接口")
public class DistributionBusinessPreOrderAppController {
@Api(value = "配送管理", tags = "预入库管理")
public class BusinessPreOrderApi {
private final IDistributionBusinessPreOrderService distributionBusinessPreOrderService;
private final IBusinessPreOrderService distributionIBusinessPreOrderService;
@PostMapping("/list")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "模糊查询", notes = "传入trayTypeDTO")
public R list(@RequestBody BusinessPreListDTO queryrderDTO){
public R list(@RequestBody BusinessPreListDTO queryrderDTO){
DistributionBusinessPreOrderListVO data =distributionBusinessPreOrderService.list(queryrderDTO);
DistributionBusinessPreOrderListVO data = distributionIBusinessPreOrderService.list(queryrderDTO);
return R.data(data);
}
@ -43,14 +41,14 @@ public class DistributionBusinessPreOrderAppController {
@ApiOperationSupport(order = 1)
public R scanOrderPackageCode(@RequestBody BusinessSanDTO businessSanDTO){
Resp resp = null;
try {
resp = distributionBusinessPreOrderService.inOrderWarehourse(businessSanDTO);
} catch (Exception e) {
throw new RuntimeException(e);
}
Resp resp = null;
try {
resp = distributionIBusinessPreOrderService.inOrderWarehourse(businessSanDTO);
} catch (Exception e) {
throw new RuntimeException(e);
}
return resp;
return resp;
}
@ -60,7 +58,7 @@ public class DistributionBusinessPreOrderAppController {
@ApiOperation(value = "条件查询", notes = "传入trayTypeDTO")
public R listCarNum(DistributionBusinessPreCarNumerPageQueryVO distributionBusinessPreCarNumerPageQueryVO, Query query){
IPage<DistributionBusinessPreCarNumerPageVO> data =distributionBusinessPreOrderService.listCarNum(Condition.getPage(query),distributionBusinessPreCarNumerPageQueryVO);
IPage<DistributionBusinessPreCarNumerPageVO> data = distributionIBusinessPreOrderService.listCarNum(Condition.getPage(query),distributionBusinessPreCarNumerPageQueryVO);
return R.data(data);
}
@ -70,10 +68,9 @@ public class DistributionBusinessPreOrderAppController {
@ApiOperation(value = "条件查询", notes = "传入trayTypeDTO")
public R preCarInfoDetailByCarNum(DistributionBusinessPreCarNumerPageQueryVO distributionBusinessPreCarNumerPageQueryVO){
DistributionBusinessPreCarDetalVO distributionBusinessPreCarDetalVO =distributionBusinessPreOrderService.preCarInfoDetailByCarNumber(distributionBusinessPreCarNumerPageQueryVO);
DistributionBusinessPreCarDetalVO distributionBusinessPreCarDetalVO = distributionIBusinessPreOrderService.preCarInfoDetailByCarNumber(distributionBusinessPreCarNumerPageQueryVO);
return R.data(distributionBusinessPreCarDetalVO);
}
}

15
blade-service/logpm-business/src/main/java/com/logpm/business/bean/Resp.java

@ -12,6 +12,17 @@ public class Resp extends R {
Resp resp = new Resp();
resp.setCode(200);
resp.setMsg(msg);
resp.setSuccess(true);
resp.setAudio(audio);
return resp;
}
public static Resp scanSuccessWithData(String msg,String audio,Object data){
Resp resp = new Resp();
resp.setCode(200);
resp.setMsg(msg);
resp.setSuccess(true);
resp.setData(data);
resp.setAudio(audio);
return resp;
}
@ -24,12 +35,14 @@ public class Resp extends R {
return resp;
}
public static Resp scanFail(int code,String msg,String audio){
public static Resp scanFail(int code,String msg,String audio,Object data){
Resp resp = new Resp();
resp.setCode(code);
resp.setMsg(msg);
resp.setData(data);
resp.setAudio(audio);
return resp;
}
}

16
blade-service/logpm-business/src/main/java/com/logpm/business/controller/DistributionBusinessPreOrderController.java

@ -2,9 +2,9 @@ package com.logpm.business.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.business.service.IDistributionBusinessPreOrderService;
import com.logpm.business.service.IBusinessPreOrderService;
import com.logpm.business.vo.DistributionBusinessPreCarNumberVO;
import com.logpm.business.vo.DistributionBusinessPreOrderVO;
import com.logpm.business.vo.BusinessPreOrderVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -29,7 +29,7 @@ import java.util.Map;
@Api(value = "预入库信息控制器", tags = "预入库信息控制器")
public class DistributionBusinessPreOrderController extends BladeController {
private final IDistributionBusinessPreOrderService distributionBusinessPreOrderService;
private final IBusinessPreOrderService distributionIBusinessPreOrderService;
/**
* 预入库信息 分页
@ -37,9 +37,9 @@ public class DistributionBusinessPreOrderController extends BladeController {
@GetMapping("/page")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入distributionDeliveryList")
public R<IPage<DistributionBusinessPreOrderVO>> page(@ApiIgnore @RequestParam Map<String, Object> distributionBusinessPreOrderDTO, Query query) {
IPage<DistributionBusinessPreOrderVO> page = Condition.getPage(query);
IPage<DistributionBusinessPreOrderVO> data= distributionBusinessPreOrderService.pacgeList(distributionBusinessPreOrderDTO,page);
public R<IPage<BusinessPreOrderVO>> page(@ApiIgnore @RequestParam Map<String, Object> distributionBusinessPreOrderDTO, Query query) {
IPage<BusinessPreOrderVO> page = Condition.getPage(query);
IPage<BusinessPreOrderVO> data= distributionIBusinessPreOrderService.pacgeList(distributionBusinessPreOrderDTO,page);
return R.data(data);
}
@ -51,7 +51,7 @@ public class DistributionBusinessPreOrderController extends BladeController {
@ApiOperation(value = "分页", notes = "传入distributionDeliveryList")
public R<IPage<DistributionBusinessPreCarNumberVO>> pageByCarNum(@ApiIgnore @RequestParam Map<String, Object> distributionBusinessPreOrderDTO, Query query) {
IPage<DistributionBusinessPreCarNumberVO> page = Condition.getPage(query);
IPage<DistributionBusinessPreCarNumberVO> data= distributionBusinessPreOrderService.pageByCarNum(distributionBusinessPreOrderDTO,page);
IPage<DistributionBusinessPreCarNumberVO> data= distributionIBusinessPreOrderService.pageByCarNum(distributionBusinessPreOrderDTO,page);
return R.data(data);
}
@ -63,7 +63,7 @@ public class DistributionBusinessPreOrderController extends BladeController {
@ApiOperation(value = "页面ID", notes = "传入distributionDeliveryList")
public R<Boolean> inOrder(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
// try {
Boolean isSuccess =distributionBusinessPreOrderService.inOrder(ids);
Boolean isSuccess = distributionIBusinessPreOrderService.inOrder(ids);
return R.data(isSuccess);
// }catch (Exception e){
// log.error("预入库信息入库失败",e);

28
blade-service/logpm-business/src/main/java/com/logpm/business/feign/BusinessPreOrderClient.java

@ -0,0 +1,28 @@
package com.logpm.business.feign;
import com.logpm.business.entity.BusinessPreOrderEntity;
import com.logpm.business.service.IBusinessAsyncService;
import com.logpm.business.service.IBusinessPreOrderService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@ApiIgnore()
@RestController
@AllArgsConstructor
public class BusinessPreOrderClient implements IBusinessPreOrderClient{
private final IBusinessPreOrderService distributionIBusinessPreOrderService;
private final IBusinessAsyncService businessAsyncService;
@Override
public Integer inOrderByOrderPackageCode(String orderPackageCode, String carNum) {
return distributionIBusinessPreOrderService.inOrderByOrderPackageCode(orderPackageCode,carNum);
}
@Override
public void saveOtherDataBaseNew(String tenantId, List<BusinessPreOrderEntity> dataResult, String mallName) {
businessAsyncService.saveOtherDataBaseNew(tenantId,dataResult,mallName);
}
}

14
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionBusinessPreOrderMapper.java → blade-service/logpm-business/src/main/java/com/logpm/business/mapper/BusinessPreOrderMapper.java

@ -14,17 +14,17 @@
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.distribution.mapper;
package com.logpm.business.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.business.dto.BusinessPreListDTO;
import com.logpm.business.entity.DistributionBusinessPreOrderEntity;
import com.logpm.business.dto.BusinessPreOrderDTO;
import com.logpm.business.entity.BusinessPreOrderEntity;
import com.logpm.business.vo.DistributionBusinessPreCarNumberVO;
import com.logpm.business.vo.BusinessPreOrderVO;
import com.logpm.business.vo.DistributionBusinessPreCarNumerPageQueryVO;
import com.logpm.business.vo.DistributionBusinessPreCarNumerPageVO;
import com.logpm.business.vo.DistributionBusinessPreOrderVO;
import com.logpm.distribution.dto.DistributionBusinessPreOrderDTO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -36,7 +36,7 @@ import java.util.Map;
* @author cyz
* @since 2023-06-13
*/
public interface DistributionBusinessPreOrderMapper extends BaseMapper<DistributionBusinessPreOrderEntity> {
public interface BusinessPreOrderMapper extends BaseMapper<BusinessPreOrderEntity> {
/**
@ -46,7 +46,7 @@ public interface DistributionBusinessPreOrderMapper extends BaseMapper<Distribut
* @param param
* @return
*/
IPage<DistributionBusinessPreOrderVO> pageList(IPage<DistributionBusinessPreOrderVO> page, @Param("param") DistributionBusinessPreOrderDTO param);
IPage<BusinessPreOrderVO> pageList(IPage<BusinessPreOrderVO> page, @Param("param") BusinessPreOrderDTO param);
/**
* 删除商家端数据
@ -57,7 +57,7 @@ public interface DistributionBusinessPreOrderMapper extends BaseMapper<Distribut
*/
Integer deleteBusinessPreOrder(String reservationCode, List<String> deletedPackageList);
List<DistributionBusinessPreOrderEntity> listByBusinessPreListDTO(@Param("queryrderDTO") BusinessPreListDTO queryrderDTO);
List<BusinessPreOrderEntity> listByBusinessPreListDTO(@Param("queryrderDTO") BusinessPreListDTO queryrderDTO);
Integer updateBusinessPreOrderByOrderPackageCode(@Param("orderPackageCode") String orderPackageCode);

13
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionBusinessPreOrderMapper.xml → blade-service/logpm-business/src/main/java/com/logpm/business/mapper/BusinessPreOrderMapper.xml

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.distribution.mapper.DistributionBusinessPreOrderMapper">
<mapper namespace="com.logpm.business.mapper.BusinessPreOrderMapper">
<update id="updateBusinessPreOrderByOrderPackageCode">
@ -13,13 +13,13 @@
DELETE FROM logpm_business_pre_order WHERE reservation_code = #{reservationCode}
AND order_package_code IN
<foreach
collection="orderPackageList" item="orderPackageCode" open="(" separator="," close=")">
collection="orderPackageList" item="orderPackageCode" open="(" separator="," close=")">
#{orderPackageCode}
</foreach>
</delete>
<select id="pageList" resultType="com.logpm.business.vo.DistributionBusinessPreOrderVO">
<select id="pageList" resultType="com.logpm.business.vo.BusinessPreOrderVO">
SELECT
id,
firsts,
@ -51,7 +51,7 @@
<where>
is_deleted = 0
<if test="param.id != null and param.id != ''">
AND id = #{param.id}
AND id = #{param.id}
</if>
<if test="param.firsts != null and param.firsts != ''">
AND firsts like concat(#{param.id},'%')
@ -119,7 +119,7 @@
</select>
<select id="listByBusinessPreListDTO" resultType="com.logpm.business.entity.DistributionBusinessPreOrderEntity">
<select id="listByBusinessPreListDTO" resultType="com.logpm.business.entity.BusinessPreOrderEntity">
SELECT
id,
@ -225,10 +225,11 @@
<where>
is_deleted=0
<if test="distributionBusinessPreCarNumerPageQueryVO.distrCarNumber!=null ">
and distr_car_number =#{distributionBusinessPreCarNumerPageQueryVO.distrCarNumber}
and distr_car_number =#{distributionBusinessPreCarNumerPageQueryVO.distrCarNumber}
</if>
</where>
GROUP BY distr_car_number,vehicle_name,driver_name,task_time
</select>
</mapper>

62
blade-service/logpm-business/src/main/java/com/logpm/business/mapper/DistributionBusinessPreOrderMapper.java

@ -1,62 +0,0 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.business.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.business.dto.BusinessPreListDTO;
import com.logpm.business.dto.DistributionBusinessPreOrderDTO;
import com.logpm.business.entity.DistributionBusinessPreOrderEntity;
import com.logpm.business.vo.DistributionBusinessPreCarNumberVO;
import com.logpm.business.vo.DistributionBusinessPreOrderVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 商家预备导入数据信息 Mapper 接口
*
* @author cyz
* @since 2023-06-13
*/
public interface DistributionBusinessPreOrderMapper extends BaseMapper<DistributionBusinessPreOrderEntity> {
/**
* 查询DistributionBusinessPreOrderVO列表
*
* @param page
* @param param
* @return
*/
IPage<DistributionBusinessPreOrderVO> pageList(IPage<DistributionBusinessPreOrderVO> page, @Param("param") DistributionBusinessPreOrderDTO param);
/**
* 删除商家端数据
*
* @param deletedPackageList
* @return
*/
Integer deleteBusinessPreOrder(String reservationCode, List<String> deletedPackageList);
List<DistributionBusinessPreOrderEntity> listByBusinessPreListDTO(@Param("queryrderDTO") BusinessPreListDTO queryrderDTO);
Integer updateBusinessPreOrderByOrderPackageCode(@Param("orderPackageCode") String orderPackageCode);
IPage<DistributionBusinessPreCarNumberVO> pageByCarNum(IPage<DistributionBusinessPreCarNumberVO> page, Map<String, Object> distributionBusinessPreOrderDTO);
}

187
blade-service/logpm-business/src/main/java/com/logpm/business/mapper/DistributionBusinessPreOrderMapper.xml

@ -1,187 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.business.mapper.DistributionBusinessPreOrderMapper">
<update id="updateBusinessPreOrderByOrderPackageCode">
update logpm_business_pre_order set in_warehouse=1
where order_package_code=#{orderPackageCode} and is_deleted=0 and in_warehouse=0
</update>
<delete id="deleteBusinessPreOrder">
DELETE FROM logpm_business_pre_order WHERE reservation_code = #{reservationCode}
AND order_package_code IN
<foreach
collection="orderPackageList" item="orderPackageCode" open="(" separator="," close=")">
#{orderPackageCode}
</foreach>
</delete>
<select id="pageList" resultType="com.logpm.business.vo.DistributionBusinessPreOrderVO">
SELECT
id,
firsts,
`SECOND`,
third_product,
quantity,
train_number,
order_code,
service_number,
material_name,
material_code,
brand_name,
waybill_number,
dealer_name,
dealer_code,
order_package_code,
reservation_code,
operation_status,
distr_car_number,
send_warehouse_name,
accept_warehouse_name,
weight,
volume,
driver_name,
vehicle_name,
in_warehouse
FROM
logpm_business_pre_order
<where>
is_deleted = 0
<if test="param.id != null and param.id != ''">
AND id = #{param.id}
</if>
<if test="param.firsts != null and param.firsts != ''">
AND firsts like concat(#{param.id},'%')
</if>
<if test="param.second != null and param.second != ''">
AND `SECOND` like concat(#{param.second},'%')
</if>
<if test="param.thirdProduct != null and param.thirdProduct != ''">
AND third_product like concat(#{param.thirdProduct},'%')
</if>
<if test="param.trainNumber != null and param.trainNumber != ''">
AND train_number like concat(#{param.trainNumber},'%')
</if>
<if test="param.orderCode != null and param.orderCode != ''">
AND order_code like concat(#{param.orderCode},'%')
</if>
<if test="param.serviceNumber != null and param.serviceNumber != ''">
AND service_number like concat(#{param.serviceNumber},'%')
</if>
<if test="param.materialName != null and param.materialName != ''">
AND material_name like concat(#{param.materialName},'%')
</if>
<if test="param.materialCode != null and param.materialCode != ''">
AND material_code like concat(#{param.materialCode},'%')
</if>
<if test="param.brandName != null and param.brandName != ''">
AND brand_name like concat(#{param.brandName},'%')
</if>
<if test="param.waybillNumber != null and param.waybillNumber != ''">
AND waybill_number like concat(#{param.waybillNumber},'%')
</if>
<if test="param.dealerName != null and param.dealerName != ''">
AND dealer_name like concat(#{param.dealerName},'%')
</if>
<if test="param.dealerCode != null and param.dealerCode != ''">
AND dealer_code like concat(#{param.dealerCode},'%')
</if>
<if test="param.sendWarehouseName != null and param.sendWarehouseName != ''">
AND send_warehouse_name like concat(#{param.sendWarehouseName},'%')
</if>
<if test="param.acceptWarehouseName != null and param.acceptWarehouseName != ''">
AND accept_warehouse_name like concat(#{param.acceptWarehouseName},'%')
</if>
<if test="param.driverName != null and param.driverName != ''">
AND driver_name like concat(#{param.driverName},'%')
</if>
<if test="param.vehicleName != null and param.vehicleName != ''">
AND vehicle_name like concat(#{param.vehicleName},'%')
</if>
<if test="param.distrCarNumber != null and param.distrCarNumber != ''">
AND distr_car_number like concat(#{param.distrCarNumber},'%')
</if>
<if test="param.inWarehouse != null ">
AND in_warehouse = #{param.inWarehouse}
</if>
</where>
</select>
<select id="listByBusinessPreListDTO" resultType="com.logpm.business.entity.DistributionBusinessPreOrderEntity">
SELECT
id,
firsts,
`SECOND`,
third_product,
quantity,
train_number,
order_code,
order_package_code,
service_number,
material_name,
material_code,
brand_name,
waybill_number,
dealer_name,
dealer_code,
send_warehouse_name,
accept_warehouse_name,
weight,
volume,
driver_name,
vehicle_name,
distr_car_number,
in_warehouse
FROM
logpm_business_pre_order
<where>
is_deleted = 0
<if test="queryrderDTO.reservationCode != null and queryrderDTO.reservationCode != ''">
AND reservation_code = #{queryrderDTO.reservationCode}
</if>
</where>
</select>
<select id="pageByCarNum" resultType="com.logpm.business.vo.DistributionBusinessPreCarNumberVO">
SELECT distr_car_number,
waybill_number,
order_code,
COUNT(1) as totalNum,
COUNT(CASE WHEN in_warehouse = 1 THEN 1 END) as inNum,
COUNT(1)-COUNT(CASE WHEN in_warehouse = 1 THEN 1 END) as restNum
from logpm_business_pre_order
<where>
is_deleted=0
<if test="distributionBusinessPreOrderDTO.distrCarNumber != null and distributionBusinessPreOrderDTO.distrCarNumber != ''">
AND distr_car_number = #{distributionBusinessPreOrderDTO.distrCarNumber}
</if>
<if test="distributionBusinessPreOrderDTO.waybillNumber != null and distributionBusinessPreOrderDTO.waybillNumber != ''">
and waybill_number=#{distributionBusinessPreOrderDTO.waybillNumber}
</if>
<if test="distributionBusinessPreOrderDTO.orderCode != null and distributionBusinessPreOrderDTO.orderCode != ''">
and order_code LIKE CONCAT(#{distributionBusinessPreOrderDTO.orderCode},'%')
</if>
</where>
GROUP BY
distr_car_number,
waybill_number,
order_code
</select>
</mapper>

10
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/InWarehourseToBusinessListener.java → blade-service/logpm-business/src/main/java/com/logpm/business/receiver/InWarehourseToBusinessHandler.java

@ -1,7 +1,7 @@
package com.logpm.trunkline.mq;
package com.logpm.business.receiver;
import com.alibaba.fastjson.JSONObject;
import com.logpm.distribution.feign.IDistributionBusinessPreOrderClient;
import com.logpm.business.service.IBusinessPreOrderService;
import com.rabbitmq.client.Channel;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -23,9 +23,9 @@ import java.util.Map;
@AllArgsConstructor
@Component
@RabbitListener(queues = RabbitConstant.IN_WAREHOUSE_TO_BUSINESS_DATA_QUEUE)
public class InWarehourseToBusinessListener {
public class InWarehourseToBusinessHandler {
private final IDistributionBusinessPreOrderClient distributionBusinessPreOrderClient;
private final IBusinessPreOrderService businessPreOrderService;
@RabbitHandler
public void inWarehourseToBusinessDataHandler(Map map, Message message, Channel channel) {
@ -45,7 +45,7 @@ public class InWarehourseToBusinessListener {
carNum="";
}
Integer i = distributionBusinessPreOrderClient.inOrderByOrderPackageCode(orderPackageCode, carNum);
Integer i = businessPreOrderService.inOrderByOrderPackageCode(orderPackageCode, carNum);
log.info(">>>>>>>>>>>>>>>>>> 入库操作 执行 {}",i);
}

11
blade-service/logpm-business/src/main/java/com/logpm/business/service/IBusinessAsyncService.java

@ -0,0 +1,11 @@
package com.logpm.business.service;
import com.logpm.business.entity.BusinessPreOrderEntity;
import org.springblade.common.annotations.ChangeAsync;
import java.util.List;
public interface IBusinessAsyncService {
public void saveOtherDataBaseNew(String tenantId, List<BusinessPreOrderEntity> dataResult, String mallName);
}

13
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionBusinessPreOrderService.java → blade-service/logpm-business/src/main/java/com/logpm/business/service/IBusinessPreOrderService.java

@ -1,22 +1,19 @@
package com.logpm.distribution.service;
package com.logpm.business.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.business.bean.Resp;
import com.logpm.business.dto.BusinessPreListDTO;
import com.logpm.business.dto.BusinessSanDTO;
import com.logpm.business.entity.DistributionBusinessPreOrderEntity;
import com.logpm.business.entity.BusinessPreOrderEntity;
import com.logpm.business.vo.*;
import com.logpm.distribution.bean.Resp;
import com.logpm.distribution.entity.DistributionBillLadingScanEntity;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.support.Query;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;
public interface IDistributionBusinessPreOrderService extends BaseService<DistributionBusinessPreOrderEntity> {
public interface IBusinessPreOrderService extends BaseService<BusinessPreOrderEntity> {
/**
* 预备入库ID集合
* @param ids
@ -39,7 +36,7 @@ public interface IDistributionBusinessPreOrderService extends BaseService<Distri
* @param page
* @return
*/
IPage<DistributionBusinessPreOrderVO> pacgeList(Map<String, Object> distributionBusinessPreOrderDTO, IPage<DistributionBusinessPreOrderVO> page);
IPage<BusinessPreOrderVO> pacgeList(Map<String, Object> distributionBusinessPreOrderDTO, IPage<BusinessPreOrderVO> page);
/**
* 删除商家端数据

55
blade-service/logpm-business/src/main/java/com/logpm/business/service/IDistributionBusinessPreOrderService.java

@ -1,55 +0,0 @@
package com.logpm.business.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.business.bean.Resp;
import com.logpm.business.dto.BusinessPreListDTO;
import com.logpm.business.entity.DistributionBusinessPreOrderEntity;
import com.logpm.business.vo.DistributionBusinessPreCarNumberVO;
import com.logpm.business.vo.DistributionBusinessPreOrderListVO;
import com.logpm.business.vo.DistributionBusinessPreOrderVO;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;
public interface IDistributionBusinessPreOrderService extends BaseService<DistributionBusinessPreOrderEntity> {
/**
* 预备入库ID集合
* @param ids
* @return
*/
Boolean inOrder(String ids) throws ServiceException;
/**
* 更新预入库状态
* @param orderPackageCode 包条码
* @param carNum 入库的配送车次
* @return
*/
Integer inOrderByOrderPackageCode(String orderPackageCode,String carNum);
/**
* 查询DistributionBusinessPreOrder列表
* @param distributionBusinessPreOrderDTO
* @param page
* @return
*/
IPage<DistributionBusinessPreOrderVO> pacgeList(Map<String, Object> distributionBusinessPreOrderDTO, IPage<DistributionBusinessPreOrderVO> page);
/**
* 删除商家端数据
* @param k
* @param deletedPackageList
* @return
*/
Integer deleteBusinessPreOrder(String k, List<String> deletedPackageList);
DistributionBusinessPreOrderListVO list(BusinessPreListDTO queryrderDTO);
Resp inOrderWarehourse(String orderPackageCode, String reservationCode) throws ExecutionException, InterruptedException;
IPage<DistributionBusinessPreCarNumberVO> pageByCarNum(Map<String, Object> distributionBusinessPreOrderDTO, IPage<DistributionBusinessPreCarNumberVO> page);
}

83
blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessAsyncServiceImpl.java

@ -0,0 +1,83 @@
package com.logpm.business.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.logpm.business.entity.BusinessPreOrderEntity;
import com.logpm.business.service.IBusinessAsyncService;
import com.logpm.business.service.IBusinessPreOrderService;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.annotations.ChangeAsync;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.entity.Tenant;
import org.springblade.system.feign.ISysClient;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@Log4j2
@Service
@AllArgsConstructor
public class BusinessAsyncServiceImpl implements IBusinessAsyncService {
private final IBusinessPreOrderService businessPreOrderService;
private final ISysClient sysClient;
@ChangeAsync()
@Override
public void saveOtherDataBaseNew(String tenantId, List<BusinessPreOrderEntity> dataResult, String mallName) {
List<Long> orderIdList = dataResult.stream()
.map(BusinessPreOrderEntity::getStockArticleId)
.collect(Collectors.toList());
R<Tenant> tenantByName = sysClient.getTenantByName(mallName);
if (tenantByName.isSuccess()) {
Tenant tenant = tenantByName.getData();
if (ObjectUtil.isEmpty(tenant)) {
log.info(">>>>>>>>>>>>> saveOtherDataBaseNew 租户不存在");
return;
}
if (dataResult.isEmpty()) {
log.info(" saveOtherDataBaseNew dataResult 参数错误");
}
LambdaQueryWrapper<BusinessPreOrderEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(BusinessPreOrderEntity::getInWarehouse, 0);
lambdaQueryWrapper.in(BusinessPreOrderEntity::getStockArticleId, orderIdList);
List<BusinessPreOrderEntity> list = businessPreOrderService.list(lambdaQueryWrapper);
// 找到已经推送的包件信息 并将其标记为删除状态
List<Long> temsp = new ArrayList<>();
for (BusinessPreOrderEntity distributionBusinessPreOrderEntity : list) {
for (BusinessPreOrderEntity businessPreOrderEntity : dataResult) {
businessPreOrderEntity.setTenantId(tenant.getTenantId());
if (businessPreOrderEntity.getStockArticleId().equals(distributionBusinessPreOrderEntity.getStockArticleId())) {
// 找到订单
if (businessPreOrderEntity.getOrderPackageCode().equals(distributionBusinessPreOrderEntity.getOrderPackageCode())) {
//找到包件 并标记为删除状态
temsp.add(distributionBusinessPreOrderEntity.getId());
}
}
}
}
if (!temsp.isEmpty()) {
// 更新删除状态
businessPreOrderService.deleteLogic(temsp);
}
for (BusinessPreOrderEntity distributionBusinessPreOrderEntity : dataResult) {
distributionBusinessPreOrderEntity.setTenantId(tenant.getTenantId());
}
// 执行保存操作
businessPreOrderService.saveBatch(dataResult);
}
}
}

160
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/IDistributionBusinessPreOrderServiceImpl.java → blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessPreOrderServiceImpl.java

@ -1,4 +1,4 @@
package com.logpm.distribution.service.impl;
package com.logpm.business.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -7,29 +7,23 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.business.bean.Resp;
import com.logpm.business.dto.BusinessPreListDTO;
import com.logpm.business.dto.BusinessPreOrderDTO;
import com.logpm.business.dto.BusinessSanDTO;
import com.logpm.business.entity.DistributionBusinessPreOrderEntity;
import com.logpm.business.entity.BusinessPreOrderEntity;
import com.logpm.business.mapper.BusinessPreOrderMapper;
import com.logpm.business.service.IBusinessPreOrderService;
import com.logpm.business.vo.*;
import com.logpm.distribution.bean.Resp;
import com.logpm.distribution.dto.DistributionBusinessPreOrderDTO;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.mapper.DistributionBusinessPreOrderMapper;
import com.logpm.distribution.service.IDistributionBusinessPreOrderService;
import com.logpm.distribution.service.IDistributionParcelListService;
import com.logpm.distribution.service.IDistributionStockArticleService;
import com.logpm.trunkline.dto.InComingDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.feign.IInComingClient;
import com.logpm.trunkline.feign.ITrunklineAdvanceDetailClient;
import lombok.AllArgsConstructor;
import org.jetbrains.annotations.Nullable;
import org.springblade.common.annotations.ChangeAsync;
import org.springblade.common.constant.IncomingTypeEnum;
import org.springblade.common.constant.RedisKeyConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.redis.cache.BladeRedis;
@ -43,13 +37,10 @@ import java.util.stream.Collectors;
@Service
@AllArgsConstructor
public class IDistributionBusinessPreOrderServiceImpl extends BaseServiceImpl<DistributionBusinessPreOrderMapper, DistributionBusinessPreOrderEntity> implements IDistributionBusinessPreOrderService {
public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrderMapper, BusinessPreOrderEntity> implements IBusinessPreOrderService {
private final IDistributionStockArticleService distributionStockArticleService;
private final IBasicdataWarehouseClient basicdataWarehouseClient;
private final IDistributionParcelListService distributionParcelListService;
// private final IDistributionAsyncService distributionAsyncService;
private final IInComingClient inComingClient;
@ -65,10 +56,10 @@ public class IDistributionBusinessPreOrderServiceImpl extends BaseServiceImpl<Di
wrapper.in("id", idArray);
StringBuffer sb = new StringBuffer();
List<DistributionBusinessPreOrderEntity> list = baseMapper.selectList(wrapper);
List<BusinessPreOrderEntity> list = baseMapper.selectList(wrapper);
List<DistributionBusinessPreOrderEntity> data = new ArrayList<>();
for (DistributionBusinessPreOrderEntity distributionBusinessPreOrderEntity : list) {
List<BusinessPreOrderEntity> data = new ArrayList<>();
for (BusinessPreOrderEntity distributionBusinessPreOrderEntity : list) {
if (distributionBusinessPreOrderEntity.getInWarehouse() == 1) {
throw new ServiceException("存在已入库的包件");
@ -84,7 +75,7 @@ public class IDistributionBusinessPreOrderServiceImpl extends BaseServiceImpl<Di
if (r.isSuccess()) {
// 更新成功
// 更新入库状态
for (DistributionBusinessPreOrderEntity distributionBusinessPreOrderEntity : data) {
for (BusinessPreOrderEntity distributionBusinessPreOrderEntity : data) {
distributionBusinessPreOrderEntity.setInWarehouse(1);
baseMapper.updateById(distributionBusinessPreOrderEntity);
@ -102,18 +93,13 @@ public class IDistributionBusinessPreOrderServiceImpl extends BaseServiceImpl<Di
@Override
public Integer inOrderByOrderPackageCode(String orderPackageCode, String carNum) {
// int a =baseMapper.updateBusinessPreOrderByOrderPackageCode(orderPackageCode);
//
// return a;
QueryWrapper wrapper = new QueryWrapper();
wrapper.eq("order_package_code", orderPackageCode);
// wrapper.eq("in_warehouse",0);
wrapper.eq("is_deleted", "0");
List<DistributionBusinessPreOrderEntity> list = baseMapper.selectList(wrapper);
List<BusinessPreOrderEntity> list = baseMapper.selectList(wrapper);
if (!list.isEmpty()) {
DistributionBusinessPreOrderEntity distributionBusinessPreOrderEntity = list.get(0);
BusinessPreOrderEntity distributionBusinessPreOrderEntity = list.get(0);
distributionBusinessPreOrderEntity.setInWarehouse(1);
return baseMapper.updateById(distributionBusinessPreOrderEntity);
@ -125,8 +111,8 @@ public class IDistributionBusinessPreOrderServiceImpl extends BaseServiceImpl<Di
@Override
public IPage<DistributionBusinessPreOrderVO> pacgeList(Map<String, Object> distributionBusinessPreOrderDTO, IPage<DistributionBusinessPreOrderVO> page) {
DistributionBusinessPreOrderDTO param = JSONObject.parseObject(JSONObject.toJSONString(distributionBusinessPreOrderDTO), DistributionBusinessPreOrderDTO.class);
public IPage<BusinessPreOrderVO> pacgeList(Map<String, Object> distributionBusinessPreOrderDTO, IPage<BusinessPreOrderVO> page) {
BusinessPreOrderDTO param = JSONObject.parseObject(JSONObject.toJSONString(distributionBusinessPreOrderDTO), BusinessPreOrderDTO.class);
return baseMapper.pageList(page, param);
}
@ -143,22 +129,22 @@ public class IDistributionBusinessPreOrderServiceImpl extends BaseServiceImpl<Di
DistributionBusinessPreOrderListVO distributionBusinessPreOrderListVO = new DistributionBusinessPreOrderListVO();
List<DistributionBusinessPreOrderEntity> data = baseMapper.listByBusinessPreListDTO(queryrderDTO);
List<BusinessPreOrderEntity> data = baseMapper.listByBusinessPreListDTO(queryrderDTO);
// data 分组
Map<Integer, List<DistributionBusinessPreOrderEntity>> groupedData = data.stream()
.collect(Collectors.groupingBy(DistributionBusinessPreOrderEntity::getInWarehouse));
Map<Integer, List<BusinessPreOrderEntity>> groupedData = data.stream()
.collect(Collectors.groupingBy(BusinessPreOrderEntity::getInWarehouse));
// 已入库的
List<DistributionBusinessPreOrderEntity> distributionBusinessPreOrderEntities = groupedData.get(1);
List<BusinessPreOrderEntity> distributionBusinessPreOrderEntities = groupedData.get(1);
List<DistributionBusinessPreOrderVO> result = new ArrayList<>();
for (DistributionBusinessPreOrderEntity datum : data) {
List<BusinessPreOrderVO> result = new ArrayList<>();
for (BusinessPreOrderEntity datum : data) {
if (datum.getInWarehouse().equals(queryrderDTO.getInWarehouse())) {
DistributionBusinessPreOrderVO copy = BeanUtil.copy(datum, DistributionBusinessPreOrderVO.class);
BusinessPreOrderVO copy = BeanUtil.copy(datum, BusinessPreOrderVO.class);
result.add(copy);
}
@ -197,10 +183,10 @@ public class IDistributionBusinessPreOrderServiceImpl extends BaseServiceImpl<Di
return Resp.scanFail("扫描失败", "没有包件或者车次");
}
// 查询配送车次下面所有的包件
LambdaQueryWrapper<DistributionBusinessPreOrderEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(DistributionBusinessPreOrderEntity::getDistrCarNumber, distrCarNumber);
queryWrapper.eq(DistributionBusinessPreOrderEntity::getIsDeleted, 0);
List<DistributionBusinessPreOrderEntity> list = baseMapper.selectList(queryWrapper);
LambdaQueryWrapper<BusinessPreOrderEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BusinessPreOrderEntity::getDistrCarNumber, distrCarNumber);
queryWrapper.eq(BusinessPreOrderEntity::getIsDeleted, 0);
List<BusinessPreOrderEntity> list = baseMapper.selectList(queryWrapper);
if (list.isEmpty()) {
return Resp.scanFail("扫描失败", "车次信息不存在");
}
@ -225,20 +211,20 @@ public class IDistributionBusinessPreOrderServiceImpl extends BaseServiceImpl<Di
}
@Nullable
private Resp handleNormalWarehourse(BusinessSanDTO businessSanDTO, String orderPackageCode, List<DistributionBusinessPreOrderEntity> list, String distrCarNumber) {
LambdaQueryWrapper<DistributionBusinessPreOrderEntity> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.eq(DistributionBusinessPreOrderEntity::getOrderPackageCode, orderPackageCode);
queryWrapper1.eq(DistributionBusinessPreOrderEntity::getInWarehouse, 1);
queryWrapper1.eq(DistributionBusinessPreOrderEntity::getIsDeleted, 0);
List<DistributionBusinessPreOrderEntity> list1 = baseMapper.selectList(queryWrapper1);
private Resp handleNormalWarehourse(BusinessSanDTO businessSanDTO, String orderPackageCode, List<BusinessPreOrderEntity> list, String distrCarNumber) {
LambdaQueryWrapper<BusinessPreOrderEntity> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.eq(BusinessPreOrderEntity::getOrderPackageCode, orderPackageCode);
queryWrapper1.eq(BusinessPreOrderEntity::getInWarehouse, 1);
queryWrapper1.eq(BusinessPreOrderEntity::getIsDeleted, 0);
List<BusinessPreOrderEntity> list1 = baseMapper.selectList(queryWrapper1);
if (!list1.isEmpty()) {
return Resp.scanFail("扫描失败", "包件已入库");
}
DistributionBusinessPreOrderEntity selectD = null;
BusinessPreOrderEntity selectD = null;
// 检查包件是否入库
for (DistributionBusinessPreOrderEntity distributionBusinessPreOrderEntity : list) {
for (BusinessPreOrderEntity distributionBusinessPreOrderEntity : list) {
if (distributionBusinessPreOrderEntity.getOrderPackageCode().equals(orderPackageCode)) {
//找到这个包件
@ -248,15 +234,15 @@ public class IDistributionBusinessPreOrderServiceImpl extends BaseServiceImpl<Di
}
// 全仓查询
if (selectD == null) {
LambdaQueryWrapper<DistributionBusinessPreOrderEntity> queryWrapper2 = new LambdaQueryWrapper<>();
queryWrapper2.eq(DistributionBusinessPreOrderEntity::getOrderPackageCode, orderPackageCode);
queryWrapper2.eq(DistributionBusinessPreOrderEntity::getIsDeleted, 0);
List<DistributionBusinessPreOrderEntity> list2 = baseMapper.selectList(queryWrapper2);
LambdaQueryWrapper<BusinessPreOrderEntity> queryWrapper2 = new LambdaQueryWrapper<>();
queryWrapper2.eq(BusinessPreOrderEntity::getOrderPackageCode, orderPackageCode);
queryWrapper2.eq(BusinessPreOrderEntity::getIsDeleted, 0);
List<BusinessPreOrderEntity> list2 = baseMapper.selectList(queryWrapper2);
// 全仓查询
if (!list2.isEmpty()) {
for (DistributionBusinessPreOrderEntity distributionBusinessPreOrderEntity : list2) {
for (BusinessPreOrderEntity distributionBusinessPreOrderEntity : list2) {
if (distributionBusinessPreOrderEntity.getOrderPackageCode().equals(orderPackageCode)) {
return Resp.scanSuccessWithData("是否切换车次", "当前包件不在当前车次,是否切换车次?" , distributionBusinessPreOrderEntity.getDistrCarNumber());
return Resp.scanSuccessWithData("是否切换车次", "当前包件不在当前车次,是否切换车次?", distributionBusinessPreOrderEntity.getDistrCarNumber());
}
selectD = distributionBusinessPreOrderEntity;
break;
@ -285,11 +271,11 @@ public class IDistributionBusinessPreOrderServiceImpl extends BaseServiceImpl<Di
if (Objects.isNull(o)) {
// 查询当前车次的异常入库数量
LambdaQueryWrapper<DistributionBusinessPreOrderEntity> queryWrapper3 = new LambdaQueryWrapper<>();
queryWrapper3.eq(DistributionBusinessPreOrderEntity::getDistrCarNumber, distrCarNumber);
queryWrapper3.eq(DistributionBusinessPreOrderEntity::getInWarehouse, 1);
queryWrapper3.eq(DistributionBusinessPreOrderEntity::getIsDeleted, 0);
List<DistributionBusinessPreOrderEntity> list3 = baseMapper.selectList(queryWrapper3);
LambdaQueryWrapper<BusinessPreOrderEntity> queryWrapper3 = new LambdaQueryWrapper<>();
queryWrapper3.eq(BusinessPreOrderEntity::getDistrCarNumber, distrCarNumber);
queryWrapper3.eq(BusinessPreOrderEntity::getInWarehouse, 1);
queryWrapper3.eq(BusinessPreOrderEntity::getIsDeleted, 0);
List<BusinessPreOrderEntity> list3 = baseMapper.selectList(queryWrapper3);
o = 1;
if (!list3.isEmpty()) {
o = list3.size();
@ -310,18 +296,18 @@ public class IDistributionBusinessPreOrderServiceImpl extends BaseServiceImpl<Di
}
@Nullable
private Resp handleExceptionalWarehourse(BusinessSanDTO businessSanDTO, List<DistributionBusinessPreOrderEntity> list, String orderPackageCode, String distrCarNumber) {
DistributionBusinessPreOrderEntity distributionBusinessPreOrderEntity = list.get(0);
private Resp handleExceptionalWarehourse(BusinessSanDTO businessSanDTO, List<BusinessPreOrderEntity> list, String orderPackageCode, String distrCarNumber) {
BusinessPreOrderEntity distributionBusinessPreOrderEntity = list.get(0);
TrunklineAdvanceDetailEntity entityByOrderPackageCode = trunklineAdvanceDetailClient.findEntityByOrderPackageCode(orderPackageCode);
// 增加异常预入库信息
// 如找到了 保存在当前的这个配送计划任务中
DistributionBusinessPreOrderEntity t = null;
BusinessPreOrderEntity t = null;
if (entityByOrderPackageCode != null) {
// 保存包件
t = BeanUtil.copy(entityByOrderPackageCode, DistributionBusinessPreOrderEntity.class);
assert t != null;
t.setWaybillNumber(entityByOrderPackageCode.getWaybillNo());
t = BeanUtil.copy(entityByOrderPackageCode, BusinessPreOrderEntity.class);
assert t != null;
t.setWaybillNumber(entityByOrderPackageCode.getWaybillNo());
t.setFirsts(entityByOrderPackageCode.getFirstPackName());
t.setSecond(entityByOrderPackageCode.getSecondPackName());
t.setThirdProduct(entityByOrderPackageCode.getThirdPackName());
@ -345,12 +331,12 @@ public class IDistributionBusinessPreOrderServiceImpl extends BaseServiceImpl<Di
if (Objects.isNull(o)) {
// 查询当前车次的异常入库数量
LambdaQueryWrapper<DistributionBusinessPreOrderEntity> queryWrapper3 = new LambdaQueryWrapper<>();
queryWrapper3.eq(DistributionBusinessPreOrderEntity::getDistrCarNumber, distrCarNumber);
queryWrapper3.eq(DistributionBusinessPreOrderEntity::getOperationStatus, 1);
queryWrapper3.eq(DistributionBusinessPreOrderEntity::getInWarehouse, 1);
queryWrapper3.eq(DistributionBusinessPreOrderEntity::getIsDeleted, 0);
List<DistributionBusinessPreOrderEntity> list3 = baseMapper.selectList(queryWrapper3);
LambdaQueryWrapper<BusinessPreOrderEntity> queryWrapper3 = new LambdaQueryWrapper<>();
queryWrapper3.eq(BusinessPreOrderEntity::getDistrCarNumber, distrCarNumber);
queryWrapper3.eq(BusinessPreOrderEntity::getOperationStatus, 1);
queryWrapper3.eq(BusinessPreOrderEntity::getInWarehouse, 1);
queryWrapper3.eq(BusinessPreOrderEntity::getIsDeleted, 0);
List<BusinessPreOrderEntity> list3 = baseMapper.selectList(queryWrapper3);
a = 1;
if (!list3.isEmpty()) {
a = list3.size();
@ -383,29 +369,29 @@ public class IDistributionBusinessPreOrderServiceImpl extends BaseServiceImpl<Di
List<DistributionBusinessPreCarOrderDetalVO> data = new ArrayList<>();
LambdaQueryWrapper<DistributionBusinessPreOrderEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(DistributionBusinessPreOrderEntity::getDistrCarNumber, queryVO.getDistrCarNumber());
queryWrapper.eq(DistributionBusinessPreOrderEntity::getIsDeleted, 0);
List<DistributionBusinessPreOrderEntity> list = this.list(queryWrapper);
LambdaQueryWrapper<BusinessPreOrderEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BusinessPreOrderEntity::getDistrCarNumber, queryVO.getDistrCarNumber());
queryWrapper.eq(BusinessPreOrderEntity::getIsDeleted, 0);
List<BusinessPreOrderEntity> list = this.list(queryWrapper);
if (list != null) {
Map<String, List<DistributionBusinessPreOrderEntity>> groupedData = list.stream()
.collect(Collectors.groupingBy(DistributionBusinessPreOrderEntity::getOrderCode));
Map<String, List<BusinessPreOrderEntity>> groupedData = list.stream()
.collect(Collectors.groupingBy(BusinessPreOrderEntity::getOrderCode));
groupedData.forEach((k, v) -> processGroupedData(k, v, data));
}
DistributionBusinessPreCarNumerPageVO distributionBusinessPreCarNumerPageVO = baseMapper.listCarInforByCarNum(queryVO);
DistributionBusinessPreCarDetalVO distributionBusinessPreCarDetalVO = BeanUtil.copy(distributionBusinessPreCarNumerPageVO, DistributionBusinessPreCarDetalVO.class);
if(distributionBusinessPreCarDetalVO != null){
distributionBusinessPreCarDetalVO.setDistributionBusinessPreCarOrderDetalVOList(data);
}else{
if (distributionBusinessPreCarDetalVO != null) {
distributionBusinessPreCarDetalVO.setDistributionBusinessPreCarOrderDetalVOList(data);
} else {
throw new ServiceException("系统异常");
}
return distributionBusinessPreCarDetalVO;
}
private void processGroupedData(String orderCode, List<DistributionBusinessPreOrderEntity> entities, List<DistributionBusinessPreCarOrderDetalVO> data) {
private void processGroupedData(String orderCode, List<BusinessPreOrderEntity> entities, List<DistributionBusinessPreCarOrderDetalVO> data) {
DistributionBusinessPreCarOrderDetalVO t = new DistributionBusinessPreCarOrderDetalVO();
t.setOrderCode(orderCode);
@ -414,7 +400,7 @@ public class IDistributionBusinessPreOrderServiceImpl extends BaseServiceImpl<Di
int inNum = (int) entities.stream().filter(e -> e.getInWarehouse() == 1).count();
int inExceNum = (int) entities.stream().filter(e -> e.getOperationStatus() == 1).count();
String wallbillNum = entities.stream().map(DistributionBusinessPreOrderEntity::getWaybillNumber).distinct().collect(Collectors.joining(","));
String wallbillNum = entities.stream().map(BusinessPreOrderEntity::getWaybillNumber).distinct().collect(Collectors.joining(","));
t.setWaybillNumber(wallbillNum);
t.setLoadCarCount(loadNum);
@ -436,14 +422,4 @@ public class IDistributionBusinessPreOrderServiceImpl extends BaseServiceImpl<Di
}
@ChangeAsync()
public DistributionParcelListEntity selectByOrderPackageCode(String orderPackageCode, Long warehouseId) {
return distributionParcelListService.selectByOrderPackageCode(orderPackageCode, warehouseId);
}
}

249
blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/IDistributionBusinessPreOrderServiceImpl.java

@ -1,249 +0,0 @@
package com.logpm.business.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.business.bean.Resp;
import com.logpm.business.dto.BusinessPreListDTO;
import com.logpm.business.dto.DistributionBusinessPreOrderDTO;
import com.logpm.business.entity.DistributionBusinessPreOrderEntity;
import com.logpm.business.mapper.DistributionBusinessPreOrderMapper;
import com.logpm.business.service.IDistributionBusinessPreOrderService;
import com.logpm.business.vo.DistributionBusinessPreCarNumberVO;
import com.logpm.business.vo.DistributionBusinessPreOrderListVO;
import com.logpm.business.vo.DistributionBusinessPreOrderVO;
import com.logpm.trunkline.dto.InComingDTO;
import com.logpm.trunkline.feign.IInComingClient;
import lombok.AllArgsConstructor;
import org.springblade.common.constant.IncomingTypeEnum;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service
@AllArgsConstructor
public class IDistributionBusinessPreOrderServiceImpl extends BaseServiceImpl<DistributionBusinessPreOrderMapper, DistributionBusinessPreOrderEntity> implements IDistributionBusinessPreOrderService {
private final IBasicdataWarehouseClient basicdataWarehouseClient;
private final IInComingClient inComingClient;
@Override
public Boolean inOrder(String ids) throws ServiceException {
// 查询出来需要处理的包条码
List<String> idArray = Arrays.asList(ids.split(","));
QueryWrapper wrapper = new QueryWrapper();
wrapper.in("id", idArray);
InComingDTO inComingDTO = new InComingDTO();
StringBuffer sb = new StringBuffer();
List<DistributionBusinessPreOrderEntity> list = baseMapper.selectList(wrapper);
List<DistributionBusinessPreOrderEntity> data = new ArrayList<>();
for (DistributionBusinessPreOrderEntity distributionBusinessPreOrderEntity : list) {
if (distributionBusinessPreOrderEntity.getInWarehouse() == 1) {
throw new ServiceException("存在已入库的包件");
}
if(!sb.toString().isEmpty()){
sb.append(",");
}
sb.append(distributionBusinessPreOrderEntity.getOrderPackageCode());
data.add(distributionBusinessPreOrderEntity);
}
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
inComingDTO.setOrderPackageCode(sb.toString());
inComingDTO.setIncomingType(IncomingTypeEnum.LINE_INCOMING.getCode());
inComingDTO.setWarehouseId(myCurrentWarehouse.getId());
inComingDTO.setWarehouseName(myCurrentWarehouse.getName());
R r = inComingClient.incomingPackage(inComingDTO);
if(r.isSuccess()){
// 更新成功
for (DistributionBusinessPreOrderEntity distributionBusinessPreOrderEntity : data) {
distributionBusinessPreOrderEntity.setInWarehouse(1);
baseMapper.updateById(distributionBusinessPreOrderEntity);
}
}
return true;
}
@Override
public Integer inOrderByOrderPackageCode(String orderPackageCode,String carNum) {
QueryWrapper wrapper = new QueryWrapper();
wrapper.eq("order_package_code", orderPackageCode);
// wrapper.eq("in_warehouse",0);
wrapper.eq("is_deleted","0");
List<DistributionBusinessPreOrderEntity> list = baseMapper.selectList(wrapper);
if(!list.isEmpty()){
DistributionBusinessPreOrderEntity distributionBusinessPreOrderEntity = list.get(0);
distributionBusinessPreOrderEntity.setInWarehouse(1);
return baseMapper.updateById(distributionBusinessPreOrderEntity);
}
return 0;
}
@Override
public IPage<DistributionBusinessPreOrderVO> pacgeList(Map<String, Object> distributionBusinessPreOrderDTO, IPage<DistributionBusinessPreOrderVO> page) {
DistributionBusinessPreOrderDTO param = JSONObject.parseObject(JSONObject.toJSONString(distributionBusinessPreOrderDTO), DistributionBusinessPreOrderDTO.class);
return baseMapper.pageList(page, param);
}
@Override
public Integer deleteBusinessPreOrder(String k, List<String> deletedPackageList) {
return baseMapper.deleteBusinessPreOrder(k, deletedPackageList);
}
@Override
public DistributionBusinessPreOrderListVO list(BusinessPreListDTO queryrderDTO) {
DistributionBusinessPreOrderListVO distributionBusinessPreOrderListVO = new DistributionBusinessPreOrderListVO();
List<DistributionBusinessPreOrderEntity> data = baseMapper.listByBusinessPreListDTO(queryrderDTO);
// data 分组
Map<Integer, List<DistributionBusinessPreOrderEntity>> groupedData = data.stream()
.collect(Collectors.groupingBy(DistributionBusinessPreOrderEntity::getInWarehouse));
// 已入库的
List<DistributionBusinessPreOrderEntity> distributionBusinessPreOrderEntities = groupedData.get(1);
List<DistributionBusinessPreOrderVO> result = new ArrayList<>();
for (DistributionBusinessPreOrderEntity datum : data) {
if(datum.getInWarehouse() .equals(queryrderDTO.getInWarehouse()) ){
DistributionBusinessPreOrderVO copy = BeanUtil.copy(datum, DistributionBusinessPreOrderVO.class);
result.add(copy);
}
}
distributionBusinessPreOrderListVO.setList(result);
distributionBusinessPreOrderListVO.setSumNum(data.size());
distributionBusinessPreOrderListVO.setInNum(ObjectUtils.isEmpty(distributionBusinessPreOrderEntities) ? 0 : distributionBusinessPreOrderEntities.size());
return distributionBusinessPreOrderListVO;
}
@Override
public Resp inOrderWarehourse(String orderPackageCode, String reservationCode) {
// // 查询当前预约单所有的包件
//
// LambdaQueryWrapper<DistributionBusinessPreOrderEntity> queryWrapper = new LambdaQueryWrapper<>();
// queryWrapper.eq(DistributionBusinessPreOrderEntity::getReservationCode, reservationCode);
// List<DistributionBusinessPreOrderEntity> list = baseMapper.selectList(queryWrapper);
//
// // 寻找 当前匹配的包条
// DistributionBusinessPreOrderEntity t = null;
// DistributionBusinessPreOrderEntity t1 = null;
// for (DistributionBusinessPreOrderEntity distributionBusinessPreOrderEntity : list) {
// if (distributionBusinessPreOrderEntity.getOrderPackageCode().equals(orderPackageCode)) {
// // 找到匹配的包条码
// if (distributionBusinessPreOrderEntity.getInWarehouse() == 1) {
// return Resp.scanSuccess("扫描成功", "包件已入库");
// } else {
// t = distributionBusinessPreOrderEntity;
// }
// }
// if (t1 == null) {
// t1 = distributionBusinessPreOrderEntity;
// }
// }
// if (t == null) {
// try {
// DistributionBusinessPreOrderEntity finalT = t1;
// CompletableFuture<DistributionParcelListEntity> distributionParcelListEntityCompletableFuture = CompletableFuture.supplyAsync(() -> this.selectByOrderPackageCode(orderPackageCode, finalT.getAcceptWarehouseId()));
//
// DistributionParcelListEntity distributionParcelListEntity = distributionParcelListEntityCompletableFuture.get();
//
// // 如找到了 保存在当前的这个配送计划任务中
// if (distributionParcelListEntity != null) {
// // 保存包件
// t = BeanUtil.copy(distributionParcelListEntity, DistributionBusinessPreOrderEntity.class);
// t.setDriverName(finalT.getDriverName());
// t.setVehicleName(finalT.getVehicleName());
// t.setDistrCarNumber(finalT.getTrainNumber());
// t.setOperationStatus(1);
// t.setInWarehouse(0);
// this.save(t);
// list.add(t);
//
// }
// } catch (InterruptedException | ExecutionException e) {
// log.error("inOrderWarehourse:", e);
// throw new ServiceException("包件信息不存在!");
// }
//
//
// }
//
// // 保存订单
// DistributionStockArticleEntity stockArticleEntity = buildDistributionStockArticleEntity(t);
// if (stockArticleEntity == null) {
// return Resp.scanFail("操作失败", "包件数据不存在");
// }
// // 保存包件
// t.setWarehouseId(stockArticleEntity.getWarehouseId());
// t.setWarehouse(stockArticleEntity.getWarehouse());
// t.setStockArticleId(stockArticleEntity.getId());
// buildDistributionParcelListEntity(t);
//
// // 调用入库方法
// t.setInWarehouse(1);
// baseMapper.updateById(t);
//
// queryWrapper.eq(DistributionBusinessPreOrderEntity::getInWarehouse, 1);
// Long l = baseMapper.selectCount(queryWrapper);
return Resp.scanSuccess("扫描成功", "请前往码板打托进行入库!");
}
@Override
public IPage<DistributionBusinessPreCarNumberVO> pageByCarNum(Map<String, Object> distributionBusinessPreOrderDTO, IPage<DistributionBusinessPreCarNumberVO> page) {
IPage<DistributionBusinessPreCarNumberVO> pageByCarNum =baseMapper.pageByCarNum(page, distributionBusinessPreOrderDTO);
return pageByCarNum;
}
}

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

@ -130,7 +130,7 @@
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-business-conversion-api</artifactId>
<artifactId>logpm-business-api</artifactId>
<version>${bladex.project.version}</version>
</dependency>

15
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionAddvalueAppController.java → blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionAddvalueAppController.java

@ -1,18 +1,8 @@
package com.logpm.distribution.appcontroller;
package com.logpm.distribution.api;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.distribution.bean.Resp;
import com.logpm.distribution.dto.DistributionSignforDTO;
import com.logpm.distribution.dto.DistrilbutionAppsignforDTO;
import com.logpm.distribution.dto.app.DistributionAppAddvalueDTO;
import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO;
import com.logpm.distribution.entity.DistributionAddvaluePackageEntity;
import com.logpm.distribution.entity.DistributionSignforEntity;
import com.logpm.distribution.service.IDistributionDeliveryListService;
import com.logpm.distribution.service.IDistributionReservationService;
import com.logpm.distribution.service.IDistributionSignforService;
import com.logpm.distribution.service.impl.DistributionAddvalueServiceImpl;
import com.logpm.distribution.vo.DistributionAddvaluePackageVO;
import com.logpm.distribution.vo.app.*;
@ -22,13 +12,10 @@ import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 签收 控制器

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionBillLadingAppController.java → blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionBillLadingAppController.java

@ -14,7 +14,7 @@
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.distribution.appcontroller;
package com.logpm.distribution.api;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
@ -32,7 +32,6 @@ import com.logpm.distribution.vo.app.DistrilbutionAppBillLadingOrderMainVO;
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
@ -42,7 +41,6 @@ import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionDeliveryAppController.java → blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionDeliveryAppController.java

@ -1,4 +1,4 @@
package com.logpm.distribution.appcontroller;
package com.logpm.distribution.api;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionInQueryApiController.java → blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionInQueryApiController.java

@ -1,4 +1,4 @@
package com.logpm.distribution.appcontroller;
package com.logpm.distribution.api;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.distribution.dto.app.queryOrderDTO;

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionReservationAppController.java → blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionReservationAppController.java

@ -14,7 +14,7 @@
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.distribution.appcontroller;
package com.logpm.distribution.api;
import com.logpm.distribution.service.IDistributionReservationService;
import io.swagger.annotations.Api;

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionSignforAppController.java → blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionSignforAppController.java

@ -1,4 +1,4 @@
package com.logpm.distribution.appcontroller;
package com.logpm.distribution.api;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockListPDAController.java → blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionStockListPDAController.java

@ -1,4 +1,4 @@
package com.logpm.distribution.appcontroller;
package com.logpm.distribution.api;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.distribution.service.IDistributionStockListService;
@ -8,16 +8,11 @@ import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.SpringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationContextFactory;
import org.springframework.boot.web.servlet.context.XmlServletWebServerApplicationContext;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
@RestController

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java → blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionStockupAppController.java

@ -14,7 +14,7 @@
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.distribution.appcontroller;
package com.logpm.distribution.api;
import com.alibaba.fastjson.JSONObject;
@ -57,7 +57,6 @@ import org.springblade.common.constant.reservation.ReservationOrderStatusConstan
import org.springblade.common.constant.reservation.ReservationPackageStatusConstant;
import org.springblade.common.constant.reservation.ReservationSigningStatusConstant;
import org.springblade.common.constant.stockup.StockupTypeStatusConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.exception.ServiceException;
@ -69,7 +68,6 @@ import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.cache.DictBizCache;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.TransactionDefinition;
import org.springframework.web.bind.annotation.*;

36
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/config/RedissonConfig.java

@ -1,36 +0,0 @@
package com.logpm.distribution.config;
import org.redisson.Redisson;
import org.redisson.config.Config;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.tool.utils.SpringUtil;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.stereotype.Component;
@Configuration
public class RedissonConfig {
@Bean
public Redisson redisson() {
// 单机模式
Config config = new Config();
BladeRedis bean = SpringUtil.getBean(BladeRedis.class);
RedisConnectionFactory connectionFactory = bean.getRedisTemplate().getConnectionFactory();
LettuceConnectionFactory factory = (LettuceConnectionFactory) connectionFactory;
String hostName = factory.getHostName();
int port = factory.getPort();
String password = factory.getPassword();
config.useSingleServer().setAddress("redis://"+hostName+":"+port).setDatabase(1);
config.useSingleServer().setPassword(password);
return (Redisson) Redisson.create(config);
}
}

83
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionBusinessPreOrderController.java

@ -1,83 +0,0 @@
package com.logpm.distribution.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.business.entity.DistributionBusinessPreOrderEntity;
import com.logpm.business.vo.DistributionBusinessPreCarNumberVO;
import com.logpm.business.vo.DistributionBusinessPreOrderVO;
import com.logpm.distribution.entity.DistributionDeliveryListEntity;
import com.logpm.distribution.service.IDistributionBusinessPreOrderService;
import com.logpm.distribution.vo.DistributionDeliveryListVO;
import com.logpm.distribution.wrapper.DistributionDeliveryListWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.Map;
@RestController
@AllArgsConstructor
@Slf4j
@RequestMapping("/businessPreOrder")
@Api(value = "预入库信息控制器", tags = "预入库信息控制器")
public class DistributionBusinessPreOrderController extends BladeController {
private final IDistributionBusinessPreOrderService distributionBusinessPreOrderService;
/**
* 预入库信息 分页
*/
@GetMapping("/page")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入distributionDeliveryList")
public R<IPage<DistributionBusinessPreOrderVO>> page(@ApiIgnore @RequestParam Map<String, Object> distributionBusinessPreOrderDTO, Query query) {
IPage<DistributionBusinessPreOrderVO> page = Condition.getPage(query);
IPage<DistributionBusinessPreOrderVO> data= distributionBusinessPreOrderService.pacgeList(distributionBusinessPreOrderDTO,page);
return R.data(data);
}
/**
* 预入库信息--配送车次
*/
@GetMapping("/pageByCarNum")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入distributionDeliveryList")
public R<IPage<DistributionBusinessPreCarNumberVO>> pageByCarNum(@ApiIgnore @RequestParam Map<String, Object> distributionBusinessPreOrderDTO, Query query) {
IPage<DistributionBusinessPreCarNumberVO> page = Condition.getPage(query);
IPage<DistributionBusinessPreCarNumberVO> data= distributionBusinessPreOrderService.pageByCarNum(distributionBusinessPreOrderDTO,page);
return R.data(data);
}
@GetMapping("/inOrder")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "页面ID", notes = "传入distributionDeliveryList")
public R<Boolean> inOrder(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
// try {
Boolean isSuccess =distributionBusinessPreOrderService.inOrder(ids);
return R.data(isSuccess);
// }catch (Exception e){
// log.error("预入库信息入库失败",e);
// return R.fail(500,e.getMessage());
// }
}
}

14
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/BusinessPreOrderDTO.java

@ -0,0 +1,14 @@
package com.logpm.distribution.dto;
import com.logpm.business.entity.BusinessPreOrderEntity;
import lombok.Data;
/**
*
*/
@Data
public class BusinessPreOrderDTO extends BusinessPreOrderEntity {
}

14
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionBusinessPreOrderDTO.java

@ -1,14 +0,0 @@
package com.logpm.distribution.dto;
import com.logpm.business.entity.DistributionBusinessPreOrderEntity;
import lombok.Data;
/**
*
*/
@Data
public class DistributionBusinessPreOrderDTO extends DistributionBusinessPreOrderEntity {
}

17
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionBusinessPreOrderClient.java

@ -1,17 +0,0 @@
package com.logpm.distribution.feign;
import com.logpm.distribution.service.IDistributionBusinessPreOrderService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
@ApiIgnore()
@RestController
@AllArgsConstructor
public class DistributionBusinessPreOrderClient implements IDistributionBusinessPreOrderClient {
private final IDistributionBusinessPreOrderService distributionBusinessPreOrderService;
@Override
public Integer inOrderByOrderPackageCode(String orderPackageCode, String carNum) {
return distributionBusinessPreOrderService.inOrderByOrderPackageCode(orderPackageCode,carNum);
}
}

35
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/BusinessPreOrderDataQueueHandler.java

@ -1,7 +1,8 @@
package com.logpm.distribution.receiver;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.logpm.business.entity.DistributionBusinessPreOrderEntity;
import com.logpm.business.entity.BusinessPreOrderEntity;
import com.logpm.business.feign.IBusinessPreOrderClient;
import com.logpm.distribution.entity.DistributionDeliveryListEntity;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionReservationEntity;
@ -38,23 +39,24 @@ public class BusinessPreOrderDataQueueHandler {
private final IDistributionReservationPackageService distributionReservationPackageService;
private final IDistributionParcelListService distributionParcelListService;
private final ISysClient sysClient;
private final IBusinessPreOrderClient businessPreOrderClient;
private final IDistributionAsyncService distributionAsyncService;
@RabbitHandler
public void businessPreOrderDataHandler(Map map, Message message, Channel channel) {
// plantA(map);
R<List<Tenant>> tenantList = sysClient.getTenantList();
if(tenantList.isSuccess()){
if (tenantList.isSuccess()) {
List<Tenant> data = tenantList.getData();
data.forEach(tenant -> {
if(!ObjectUtil.isEmpty(tenant.getTenantType())){
if(2==tenant.getTenantType()){
if (!ObjectUtil.isEmpty(tenant.getTenantType())) {
if (2 == tenant.getTenantType()) {
String mallName = tenant.getTenantName();
// 插入暂存单
// 插入预计表
plantA(map,mallName);
plantA(map, mallName);
}
}
});
@ -62,8 +64,7 @@ public class BusinessPreOrderDataQueueHandler {
}
private void plantA(Map map,String mallName) {
private void plantA(Map map, String mallName) {
if (StringUtil.isBlank(mallName)) {
return;
@ -88,7 +89,7 @@ public class BusinessPreOrderDataQueueHandler {
return;
}
List<DistributionBusinessPreOrderEntity> dataResult = new ArrayList<>();
List<BusinessPreOrderEntity> dataResult = new ArrayList<>();
for (DistributionReservationEntity distributionReservationEntity : list) {
// 判断需要进行推送商家名称
log.info(">>>>> mallName TAG {}", mallName);
@ -104,7 +105,7 @@ public class BusinessPreOrderDataQueueHandler {
DistributionParcelListEntity byId = distributionParcelListService.getById(distributionReservationPackageEntity.getParceListId());
DistributionBusinessPreOrderEntity data = BeanUtil.copy(byId, DistributionBusinessPreOrderEntity.class);
BusinessPreOrderEntity data = BeanUtil.copy(byId, BusinessPreOrderEntity.class);
data.setDriverName(distributionDeliveryListEntity.getDriverName());
data.setVehicleName(distributionDeliveryListEntity.getVehicleName());
@ -122,12 +123,13 @@ public class BusinessPreOrderDataQueueHandler {
}
Tenant tenant = changeDataBase(mallName);
CompletableFuture.supplyAsync(() -> {
// saveOtherData(tenant.getTenantId(),waybillBilllByWaybillNos, trunklineAdvanceDetailEntities, trunklineAdvanceEntities, trunklineWaybillPackageEntities, trunklineWaybillOrderEntities, warehouseWayBillDetails, distributionParcelListEntities, mallName);
// distributionAsyncService.saveOtherData(tenant.getTenantId(),waybillBilllByWaybillNos, trunklineAdvanceDetailEntities, trunklineAdvanceEntities, trunklineWaybillPackageEntities, trunklineWaybillOrderEntities, warehouseWayBillDetails, distributionParcelListEntities, mallName);
distributionAsyncService.saveOtherDataBaseNew(tenant.getTenantId() ,dataResult, mallName);
return null;
});
businessPreOrderClient.saveOtherDataBaseNew(tenant.getTenantId(), dataResult, mallName);
// CompletableFuture.supplyAsync(() -> {
//// saveOtherData(tenant.getTenantId(),waybillBilllByWaybillNos, trunklineAdvanceDetailEntities, trunklineAdvanceEntities, trunklineWaybillPackageEntities, trunklineWaybillOrderEntities, warehouseWayBillDetails, distributionParcelListEntities, mallName);
//// distributionAsyncService.saveOtherData(tenant.getTenantId(),waybillBilllByWaybillNos, trunklineAdvanceDetailEntities, trunklineAdvanceEntities, trunklineWaybillPackageEntities, trunklineWaybillOrderEntities, warehouseWayBillDetails, distributionParcelListEntities, mallName);
//// distributionAsyncService.saveOtherDataBaseNew(tenant.getTenantId() ,dataResult, mallName);
// return null;
// });
// 查询包间列表
@ -148,5 +150,4 @@ public class BusinessPreOrderDataQueueHandler {
}
}

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

@ -1,8 +1,7 @@
package com.logpm.distribution.service;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.business.entity.DistributionBusinessPreOrderEntity;
import com.logpm.business.entity.BusinessPreOrderEntity;
import com.logpm.distribution.dto.DistributionStockArticleDTO;
import com.logpm.distribution.dto.app.DistrilbutionloadingscanDTO;
import com.logpm.distribution.dto.app.StockupDTO;
@ -13,17 +12,8 @@ import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionParcelNumberEntity;
import com.logpm.distribution.entity.DistributionReservationEntity;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
import com.logpm.trunkline.entity.TrunklineWaybillPackageEntity;
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
import com.logpm.warehouse.entity.WarehouseWarehouseEntity;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import org.springblade.common.annotations.ChangeAsync;
import org.springblade.core.secure.BladeUser;
import java.security.NoSuchAlgorithmException;
import java.util.List;
/**
@ -338,7 +328,6 @@ public interface IDistributionAsyncService {
DistributionStockArticleEntity findDistributionStockArticleEntityByIdForAsync(String tenantId, Long id);
void saveOtherDataBaseNew(String tenantId,List<DistributionBusinessPreOrderEntity> dataResult, String mallName);
/**
* 推送预约下包件转配送日志

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

@ -12,10 +12,9 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.business.entity.DistributionBusinessPreOrderEntity;
import com.logpm.business.entity.BusinessPreOrderEntity;
import com.logpm.distribution.dto.DistributionLoadingNumDTO;
import com.logpm.distribution.dto.DistributionParcelNumberDTO;
import com.logpm.distribution.dto.DistributionStockArticleDTO;
@ -55,7 +54,6 @@ import com.logpm.factorydata.enums.BrandEnums;
import com.logpm.factorydata.util.FactoryDataMessageSender;
import com.logpm.factorydata.vo.NodePushMsg;
import com.logpm.factorydata.vo.PushData;
import com.logpm.factorydata.vo.SendMsg;
import com.logpm.trunkline.dto.AddWaybillTrackDTO;
import com.logpm.trunkline.feign.*;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
@ -107,7 +105,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;
import java.security.NoSuchAlgorithmException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
@ -128,7 +125,6 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
private final DistributionStockListMapper distributionStockListMapper;
private final IDistrilbutionBillStockService distrilbutionBillStockService;
private final IDistributionDeliveryDetailsService distributionDeliveryDetailsService;
// private final IDistributionDeliveryListService distributionDeliveryListService;
private final DistributionDeliveryListMapper distributionDeliveryListMapper;
private final DistributionSignforMapper distributionSignforMapper;
private final DistributionReservationMapper distributionReservationMapper;
@ -162,18 +158,6 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
private final FactoryDataMessageSender factoryDataMessageSender;
private final RabbitTemplate rabbitTemplate;
private final ITrunklineWaybillOrderClient trunklineWaybillOrderClient;
private final ITrunklineWaybillPackageClient trunklineWaybillPackageClient;
private final ITrunklineAdvanceClient trunklineAdvanceClient;
private final ITrunklineAdvanceDetailClient trunklineAdvanceDetailClient;
private final IWarehouseWaybillClient warehouseWaybillClient;
private final IWarehouseWaybillDetailClient warehouseWaybillDetailClient;
private final IDistributionBusinessPreOrderService distributionBusinessPreOrderService;
private final ISysClient sysClient;
@ -2886,74 +2870,8 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
return stockArticleEntity;
}
private Tenant changeDataBase(String maillName) {
R<Tenant> tenantByName = sysClient.getTenantByName(maillName);
if (tenantByName.isSuccess()) {
Tenant tenant = tenantByName.getData();
if (ObjectUtil.isEmpty(tenant)) {
log.info(">>>>>>>>>>>>> saveOtherDataBaseNew 租户不存在");
return null;
}
return tenant;
}
return null;
}
@ChangeAsync()
@Override
public void saveOtherDataBaseNew(String tenantId, List<DistributionBusinessPreOrderEntity> dataResult, String mallName) {
List<Long> orderIdList = dataResult.stream()
.map(DistributionBusinessPreOrderEntity::getStockArticleId)
.collect(Collectors.toList());
R<Tenant> tenantByName = sysClient.getTenantByName(mallName);
if (tenantByName.isSuccess()) {
Tenant tenant = tenantByName.getData();
if (ObjectUtil.isEmpty(tenant)) {
log.info(">>>>>>>>>>>>> saveOtherDataBaseNew 租户不存在");
return;
}
if (dataResult.isEmpty()) {
log.info(" saveOtherDataBaseNew dataResult 参数错误");
}
LambdaQueryWrapper<DistributionBusinessPreOrderEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(DistributionBusinessPreOrderEntity::getInWarehouse, 0);
lambdaQueryWrapper.in(DistributionBusinessPreOrderEntity::getStockArticleId, orderIdList);
List<DistributionBusinessPreOrderEntity> list = distributionBusinessPreOrderService.list(lambdaQueryWrapper);
// 找到已经推送的包件信息 并将其标记为删除状态
List<Long> temsp = new ArrayList<>();
for (DistributionBusinessPreOrderEntity distributionBusinessPreOrderEntity : list) {
for (DistributionBusinessPreOrderEntity businessPreOrderEntity : dataResult) {
businessPreOrderEntity.setTenantId(tenant.getTenantId());
if (businessPreOrderEntity.getStockArticleId().equals(distributionBusinessPreOrderEntity.getStockArticleId())) {
// 找到订单
if (businessPreOrderEntity.getOrderPackageCode().equals(distributionBusinessPreOrderEntity.getOrderPackageCode())) {
//找到包件 并标记为删除状态
temsp.add(distributionBusinessPreOrderEntity.getId());
}
}
}
}
if (!temsp.isEmpty()) {
// 更新删除状态
distributionBusinessPreOrderService.deleteLogic(temsp);
}
for (DistributionBusinessPreOrderEntity distributionBusinessPreOrderEntity : dataResult) {
distributionBusinessPreOrderEntity.setTenantId(tenant.getTenantId());
}
// 执行保存操作
distributionBusinessPreOrderService.saveBatch(dataResult);
}
}
@Override
@LogpmAsync("asyncExecutor")

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

File diff suppressed because one or more lines are too long

38
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java

@ -357,25 +357,25 @@ public class InComingServiceImpl implements IInComingService {
factoryDataMessageSender.sendNodeDataByBrand(nodePushMsg);
} else if (tenant.getTenantType() == 2) {
// 完结预入库数据状态
JSONObject jsonObject = new JSONObject();
jsonObject.put("orderPackageCode", advanceDetailEntity.getOrderPackageCode());
jsonObject.put("carNum", null);
Map mapState = new HashMap();
mapState.put("messageId", CommonUtil.getUUID());
mapState.put("messageData", jsonObject);
mapState.put("createTime", System.currentTimeMillis());
try {
rabbitTemplate.convertAndSend(RabbitConstant.IN_WAREHOUSE_TO_BUSINESS_DATA_EXCHANGE, RabbitConstant.IN_WAREHOUSE_TO_BUSINESS_DATA_ROUTING, mapState, message -> {
message.getMessageProperties()
.setHeader("x-delay", 5000);
return message;
});
} catch (Exception customerException) {
log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 消息推送失败~ 请联系管理员! ", customerException);
// throw new CustomerException(customerException.getMessage());
}
// JSONObject jsonObject = new JSONObject();
// jsonObject.put("orderPackageCode", advanceDetailEntity.getOrderPackageCode());
// jsonObject.put("carNum", null);
//
// Map mapState = new HashMap();
// mapState.put("messageId", CommonUtil.getUUID());
// mapState.put("messageData", jsonObject);
// mapState.put("createTime", System.currentTimeMillis());
// try {
// rabbitTemplate.convertAndSend(RabbitConstant.IN_WAREHOUSE_TO_BUSINESS_DATA_EXCHANGE, RabbitConstant.IN_WAREHOUSE_TO_BUSINESS_DATA_ROUTING, mapState, message -> {
// message.getMessageProperties()
// .setHeader("x-delay", 5000);
// return message;
// });
// } catch (Exception customerException) {
// log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 消息推送失败~ 请联系管理员! ", customerException);
//// throw new CustomerException(customerException.getMessage());
//
// }
} else {

Loading…
Cancel
Save