Browse Source

1.新增映射品类子类功能

dev
zhenghaoyu 1 month ago
parent
commit
762a713f97
  1. 7
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataClientEntity.java
  2. 58
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataMainCategoryEntity.java
  3. 1
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/MerchantStatisticsDTO.java
  4. 3
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/AdvanceDTO.java
  5. 3
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseWaybillClient.java
  6. 106
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataForwardingUnitController.java
  7. 111
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataMainCategoryController.java
  8. 31
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataMainController.java
  9. 27
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/ForwardingUnitDTO.java
  10. 23
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/MainDTO.java
  11. 9
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataForwardingUnitMapper.java
  12. 34
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataForwardingUnitMapper.xml
  13. 16
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataMainCategoryMapper.java
  14. 24
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataMainCategoryMapper.xml
  15. 4
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataMainMapper.java
  16. 12
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataMainMapper.xml
  17. 9
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataForwardingUnitService.java
  18. 15
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataMainCategoryService.java
  19. 7
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataMainService.java
  20. 51
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataForwardingUnitServiceImpl.java
  21. 58
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataMainCategoryServiceImpl.java
  22. 10
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataMainServiceImpl.java
  23. 13
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml
  24. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/config/ExecutorConfig.java
  25. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml
  26. 653
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
  27. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillClient.java
  28. 1
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java
  29. 11
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

7
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataClientEntity.java

@ -250,4 +250,11 @@ public class BasicdataClientEntity extends TenantEntity {
@ApiModelProperty(value = "是否是新用户 0否 1是")
private Integer isNew;
@ApiModelProperty(value = "主体id ")
private Long mainId;
@ApiModelProperty(value = "主体名称 ")
private String mainName;
}

58
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataMainCategoryEntity.java

@ -0,0 +1,58 @@
package com.logpm.basicdata.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
@Data
@TableName("logpm_basicdata_main_category")
@ApiModel(value = "BasicdataMainCategory对象", description = "物料映射子表")
@EqualsAndHashCode(callSuper = true)
public class BasicdataMainCategoryEntity extends TenantEntity {
/**
* 预留1
*/
@ApiModelProperty(value = "预留1")
private String reserve1;
/**
* 预留2
*/
@ApiModelProperty(value = "预留2")
private String reserve2;
/**
* 预留3
*/
@ApiModelProperty(value = "预留3")
private String reserve3;
/**
* 预留4
*/
@ApiModelProperty(value = "预留4")
private String reserve4;
/**
* 预留5
*/
@ApiModelProperty(value = "预留5")
private String reserve5;
@ApiModelProperty(value = "映射品类id")
private Long factoryCategoryId;
@ApiModelProperty(value = "品类id")
private Long categoryId;
@ApiModelProperty(value = "品类名称")
private String category;
@ApiModelProperty(value = "主体id")
private Long mainId;
@ApiModelProperty(value = "主体名称")
private String mainName;
}

1
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/MerchantStatisticsDTO.java

@ -49,6 +49,7 @@ public class MerchantStatisticsDTO implements Serializable {
* 运单号
*/
private String waybillNo;
private List<String> waybillNos;
/**
* 订单号
*/

3
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/AdvanceDTO.java

@ -56,6 +56,7 @@ public class AdvanceDTO implements Serializable {
private Integer isTimeOut;
private Long clientId;
private Long mainId;
}

3
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseWaybillClient.java

@ -109,4 +109,7 @@ public interface IWarehouseWaybillClient {
@GetMapping(API_PREFIX + "/findWaybillVOByOrderCode")
List<WarehouseWaybillEntity> findWaybillVOByOrderCode(@RequestParam String orderCode);
@GetMapping(API_PREFIX+"/deleteAllByWaybillId")
void deleteAllByWaybillId(@RequestParam Long waybillId);
}

106
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataForwardingUnitController.java

@ -0,0 +1,106 @@
package com.logpm.basicdata.controller;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.dto.ForwardingUnitDTO;
import com.logpm.basicdata.entity.BasicdataForwardingUnitEntity;
import com.logpm.basicdata.service.IBasicdataForwardingUnitService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Objects;
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/forwardingUnit")
@Api(value = "始发仓默认发货单位", tags = "始发仓默认发货单位")
public class BasicdataForwardingUnitController {
private final IBasicdataForwardingUnitService basicdataForwardingUnitService;
@ResponseBody
@PostMapping("/pageList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "默认发货单位列表", notes = "传入forwardingUnitDTO")
public R pageList(@RequestBody ForwardingUnitDTO forwardingUnitDTO) {
String method = "############pageList: ";
log.info(method + "请求参数{}", forwardingUnitDTO);
try {
IPage<BasicdataForwardingUnitEntity> pages = basicdataForwardingUnitService.pageList(forwardingUnitDTO);
return R.data(pages);
} catch (CustomerException e) {
log.error(e.message, e);
return R.fail(e.code, e.message);
} catch (Exception e) {
log.error(method + "系统异常", e);
return R.fail(500, method + "系统异常");
}
}
@ResponseBody
@PostMapping("/editUnit")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "新增或更新默认发货单位", notes = "传入forwardingUnitDTO")
public R editUnit(@RequestBody ForwardingUnitDTO forwardingUnitDTO) {
String method = "############editUnit: ";
log.info(method + "请求参数{}", forwardingUnitDTO);
try {
Long warehouseId = forwardingUnitDTO.getWarehouseId();
if(Objects.isNull(warehouseId)){
log.warn(method+"仓库id为空");
return R.fail(405,"仓库id为空");
}
Long clientId = forwardingUnitDTO.getClientId();
if(Objects.isNull(clientId)){
log.warn(method+"客户id为空");
return R.fail(405,"客户id为空");
}
return basicdataForwardingUnitService.editUnit(forwardingUnitDTO);
} catch (CustomerException e) {
log.error(e.message, e);
return R.fail(e.code, e.message);
} catch (Exception e) {
log.error(method + "系统异常", e);
return R.fail(500, method + "系统异常");
}
}
@ResponseBody
@PostMapping("/removeUnit")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "删除默认发货单位", notes = "传入forwardingUnitDTO")
public R removeUnit(@RequestBody ForwardingUnitDTO forwardingUnitDTO) {
String method = "############removeUnit: ";
log.info(method + "请求参数{}", forwardingUnitDTO);
try {
List<Long> ids = forwardingUnitDTO.getIds();
if(CollUtil.isEmpty(ids)){
log.warn(method+"移除id为空");
return R.fail(405,"移除id为空");
}
return basicdataForwardingUnitService.removeUnit(forwardingUnitDTO);
} catch (CustomerException e) {
log.error(e.message, e);
return R.fail(e.code, e.message);
} catch (Exception e) {
log.error(method + "系统异常", e);
return R.fail(500, method + "系统异常");
}
}
}

111
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataMainCategoryController.java

@ -0,0 +1,111 @@
package com.logpm.basicdata.controller;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.dto.MainDTO;
import com.logpm.basicdata.entity.BasicdataMainCategoryEntity;
import com.logpm.basicdata.service.IBasicdataMainCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Objects;
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/basicdataMainCategory")
@Api(value = "主体结算品类", tags = "主体结算品类")
public class BasicdataMainCategoryController {
private final IBasicdataMainCategoryService basicdataMainCategoryService;
@ResponseBody
@PostMapping("/pageList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "映射品类子类列表", notes = "传入mainDTO")
public R pageList(@RequestBody MainDTO mainDTO) {
String method = "############pageList: ";
log.info(method + "请求参数{}", mainDTO);
try {
IPage<BasicdataMainCategoryEntity> pages = basicdataMainCategoryService.pageList(mainDTO);
return R.data(pages);
} catch (CustomerException e) {
log.error(e.message, e);
return R.fail(e.code, e.message);
} catch (Exception e) {
log.error(method + "系统异常", e);
return R.fail(500, method + "系统异常");
}
}
@ResponseBody
@PostMapping("/editMainCategory")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "新增或更新映射品类子类", notes = "传入mainDTO")
public R editMainCategory(@RequestBody MainDTO mainDTO) {
String method = "############editMainCategory: ";
log.info(method + "请求参数{}", mainDTO);
try {
Long factoryCategoryId = mainDTO.getFactoryCategoryId();
if(Objects.isNull(factoryCategoryId)){
log.warn(method+"映射id为空");
return R.fail(405,"映射id为空");
}
Long mainId = mainDTO.getMainId();
if(Objects.isNull(mainId)){
log.warn(method+"主体id为空");
return R.fail(405,"主体id为空");
}
Long categoryId = mainDTO.getCategoryId();
if(Objects.isNull(categoryId)){
log.warn(method+"品类id为空");
return R.fail(405,"品类id为空");
}
return basicdataMainCategoryService.editMainCategory(mainDTO);
} catch (CustomerException e) {
log.error(e.message, e);
return R.fail(e.code, e.message);
} catch (Exception e) {
log.error(method + "系统异常", e);
return R.fail(500, method + "系统异常");
}
}
@ResponseBody
@PostMapping("/removeMainCategory")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "删除主体映射", notes = "传入mainDTO")
public R removeMainCategory(@RequestBody MainDTO mainDTO) {
String method = "############removeMainCategory: ";
log.info(method + "请求参数{}", mainDTO);
try {
List<Long> ids = mainDTO.getIds();
if(CollUtil.isEmpty(ids)){
log.warn(method+"移除id为空");
return R.fail(405,"移除id为空");
}
return basicdataMainCategoryService.removeMainCategory(mainDTO);
} catch (CustomerException e) {
log.error(e.message, e);
return R.fail(e.code, e.message);
} catch (Exception e) {
log.error(method + "系统异常", e);
return R.fail(500, method + "系统异常");
}
}
}

31
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataMainController.java

@ -2,22 +2,23 @@ package com.logpm.basicdata.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.entity.BasicdataGoodsAreaEntity;
import com.logpm.basicdata.dto.MainDTO;
import com.logpm.basicdata.entity.BasicdataMainEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.service.IBasicdataMainService;
import com.logpm.basicdata.vo.BasicdataGoodsAreaVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.exception.CustomerException;
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 javax.validation.Valid;
import java.util.Objects;
import java.util.List;
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/basicdataMain")
@ -56,4 +57,26 @@ public class BasicdataMainController {
return R.data(pages);
}
@ResponseBody
@PostMapping("/mainList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "主体列表", notes = "传入mainDTO")
public R mainList(@RequestBody MainDTO mainDTO) {
String method = "############mainList: ";
log.info(method + "请求参数{}", mainDTO);
try {
List<BasicdataMainEntity> list = basicdataMainService.mainList(mainDTO);
return R.data(list);
} catch (CustomerException e) {
log.error(e.message, e);
return R.fail(e.code, e.message);
} catch (Exception e) {
log.error(method + "系统异常", e);
return R.fail(500, method + "系统异常");
}
}
}

27
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/ForwardingUnitDTO.java

@ -0,0 +1,27 @@
package com.logpm.basicdata.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class ForwardingUnitDTO implements Serializable {
private Integer pageNum;
private Integer pageSize;
private List<Long> warehouseIds;
private List<Long> ids;
private Long warehouseId;
private String warehouseName;
private Long clientId;
private String clientName;
}

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

@ -0,0 +1,23 @@
package com.logpm.basicdata.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class MainDTO implements Serializable {
private String mainName;
private Integer pageNum;
private Integer pageSize;
private Long factoryCategoryId;
private Long mainId;
private Long categoryId;
private String category;
private List<Long> ids;
}

9
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataForwardingUnitMapper.java

@ -1,11 +1,20 @@
package com.logpm.basicdata.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.dto.ForwardingUnitDTO;
import com.logpm.basicdata.entity.BasicdataForwardingUnitEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface BasicdataForwardingUnitMapper extends BaseMapper<BasicdataForwardingUnitEntity> {
IPage<BasicdataForwardingUnitEntity> pageList(IPage<Object> page, @Param("param") ForwardingUnitDTO forwardingUnitDTO);
BasicdataForwardingUnitEntity findByWarehouseId(@Param("warehouseId") Long warehouseId);
void removeUnit(@Param("ids") List<Long> ids);
}

34
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataForwardingUnitMapper.xml

@ -0,0 +1,34 @@
<?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.basicdata.mapper.BasicdataForwardingUnitMapper">
<select id="pageList" resultType="com.logpm.basicdata.entity.BasicdataForwardingUnitEntity">
select *
from logpm_basicdata_forwarding_unit
<where>
and is_deleted = 0
<if test="param.warehouseIds != null and param.warehouseIds.size() > 0">
and warehouse_id in
<foreach collection="param.warehouseIds" item="warehouseId" open="(" separator="," close=")">
#{warehouseId}
</foreach>
</if>
</where>
</select>
<select id="findByWarehouseId" resultType="com.logpm.basicdata.entity.BasicdataForwardingUnitEntity">
select *
from logpm_basicdata_forwarding_unit
where warehouse_id = #{warehouseId}
and is_deleted = 0
</select>
<delete id="removeUnit" >
delete from logpm_basicdata_forwarding_unit
where id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

16
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataMainCategoryMapper.java

@ -0,0 +1,16 @@
package com.logpm.basicdata.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.dto.MainDTO;
import com.logpm.basicdata.entity.BasicdataMainCategoryEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface BasicdataMainCategoryMapper extends BaseMapper<BasicdataMainCategoryEntity> {
IPage<BasicdataMainCategoryEntity> pageList(IPage<Object> page, @Param("param") MainDTO mainDTO);
BasicdataMainCategoryEntity findEntityByParam(@Param("param") MainDTO mainDTO);
}

24
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataMainCategoryMapper.xml

@ -0,0 +1,24 @@
<?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.basicdata.mapper.BasicdataMainCategoryMapper">
<select id="pageList" resultType="com.logpm.basicdata.entity.BasicdataMainCategoryEntity">
select *
from logpm_basicdata_main_category
<where>
and is_deleted = 0
<if test="param.factoryCategoryId != null ">
and factory_category_id = #{param.factoryCategoryId}
</if>
</where>
</select>
<select id="findEntityByParam" resultType="com.logpm.basicdata.entity.BasicdataMainCategoryEntity">
select *
from logpm_basicdata_main_category
where factory_category_id = #{param.factoryCategoryId}
and main_id = #{param.mainId}
and is_deleted = 0
</select>
</mapper>

4
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataMainMapper.java

@ -2,12 +2,16 @@ package com.logpm.basicdata.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.dto.MainDTO;
import com.logpm.basicdata.entity.BasicdataMainEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface BasicdataMainMapper extends BaseMapper<BasicdataMainEntity> {
List<BasicdataMainEntity> selectBasicdataMainEntityPage(IPage<BasicdataMainEntity> page, BasicdataMainEntity basicdataMainEntity);
List<BasicdataMainEntity> mainList(@Param("param") MainDTO mainDTO);
}

12
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataMainMapper.xml

@ -6,4 +6,16 @@
<select id="selectBasicdataMainEntityPage" >
select * from logpm_basicdata_main where is_deleted = 0
</select>
<select id="mainList" resultType="com.logpm.basicdata.entity.BasicdataMainEntity">
select *
from logpm_basicdata_main
where is_deleted = 0
<if test="param.mainName != null and param.mainName != ''">
and name like concat('%', #{param.mainName}, '%')
</if>
limit 10
</select>
</mapper>

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

@ -1,7 +1,16 @@
package com.logpm.basicdata.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.dto.ForwardingUnitDTO;
import com.logpm.basicdata.entity.BasicdataForwardingUnitEntity;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
public interface IBasicdataForwardingUnitService extends BaseService<BasicdataForwardingUnitEntity> {
IPage<BasicdataForwardingUnitEntity> pageList(ForwardingUnitDTO forwardingUnitDTO);
R editUnit(ForwardingUnitDTO forwardingUnitDTO);
R removeUnit(ForwardingUnitDTO forwardingUnitDTO);
}

15
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataMainCategoryService.java

@ -0,0 +1,15 @@
package com.logpm.basicdata.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.dto.MainDTO;
import com.logpm.basicdata.entity.BasicdataMainCategoryEntity;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
public interface IBasicdataMainCategoryService extends BaseService<BasicdataMainCategoryEntity> {
IPage<BasicdataMainCategoryEntity> pageList(MainDTO mainDTO);
R editMainCategory(MainDTO mainDTO);
R removeMainCategory(MainDTO mainDTO);
}

7
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataMainService.java

@ -1,13 +1,18 @@
package com.logpm.basicdata.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.entity.BasicdataHistoricalContractEntity;
import com.logpm.basicdata.dto.MainDTO;
import com.logpm.basicdata.entity.BasicdataMainEntity;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
/**
* 结算主体表 服务类
*/
public interface IBasicdataMainService extends BaseService<BasicdataMainEntity> {
IPage<BasicdataMainEntity> selectBasicdataMainEntityPage(IPage<BasicdataMainEntity> page, BasicdataMainEntity basicdataMainEntity);
List<BasicdataMainEntity> mainList(MainDTO mainDTO);
}

51
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataForwardingUnitServiceImpl.java

@ -1,16 +1,67 @@
package com.logpm.basicdata.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.basicdata.dto.ForwardingUnitDTO;
import com.logpm.basicdata.entity.BasicdataForwardingUnitEntity;
import com.logpm.basicdata.mapper.BasicdataForwardingUnitMapper;
import com.logpm.basicdata.service.IBasicdataForwardingUnitService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
@Slf4j
@Service
@AllArgsConstructor
public class BasicdataForwardingUnitServiceImpl extends BaseServiceImpl<BasicdataForwardingUnitMapper, BasicdataForwardingUnitEntity> implements IBasicdataForwardingUnitService {
@Override
public IPage<BasicdataForwardingUnitEntity> pageList(ForwardingUnitDTO forwardingUnitDTO) {
IPage<Object> page = new Page<>();
page.setCurrent(forwardingUnitDTO.getPageNum());
page.setSize(forwardingUnitDTO.getPageSize());
IPage<BasicdataForwardingUnitEntity> pageList = baseMapper.pageList(page,forwardingUnitDTO);
return pageList;
}
@Override
public R editUnit(ForwardingUnitDTO forwardingUnitDTO) {
Long warehouseId = forwardingUnitDTO.getWarehouseId();
BasicdataForwardingUnitEntity forwardingUnitEntity = baseMapper.findByWarehouseId(warehouseId);
if(Objects.isNull(forwardingUnitEntity)){
forwardingUnitEntity = new BasicdataForwardingUnitEntity();
}
forwardingUnitEntity.setWarehouseId(warehouseId);
forwardingUnitEntity.setWarehouseName(forwardingUnitDTO.getWarehouseName());
forwardingUnitEntity.setClientId(forwardingUnitDTO.getClientId());
forwardingUnitEntity.setClientName(forwardingUnitDTO.getClientName());
saveOrUpdate(forwardingUnitEntity);
return R.success("操作成功");
}
@Override
public R removeUnit(ForwardingUnitDTO forwardingUnitDTO) {
List<Long> ids = forwardingUnitDTO.getIds();
// baseMapper.removeUnit(ids);
deleteLogic(ids);
return R.success("操作成功");
}
}

58
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataMainCategoryServiceImpl.java

@ -0,0 +1,58 @@
package com.logpm.basicdata.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.basicdata.dto.MainDTO;
import com.logpm.basicdata.entity.BasicdataMainCategoryEntity;
import com.logpm.basicdata.mapper.BasicdataMainCategoryMapper;
import com.logpm.basicdata.service.IBasicdataMainCategoryService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Service;
import java.util.Objects;
@Slf4j
@AllArgsConstructor
@Service
public class BasicdataMainCategoryServiceImpl extends BaseServiceImpl<BasicdataMainCategoryMapper,BasicdataMainCategoryEntity> implements IBasicdataMainCategoryService {
@Override
public IPage<BasicdataMainCategoryEntity> pageList(MainDTO mainDTO) {
IPage<Object> page = new Page<>();
page.setCurrent(mainDTO.getPageNum());
page.setSize(mainDTO.getPageSize());
IPage<BasicdataMainCategoryEntity> pageList = baseMapper.pageList(page,mainDTO);
return pageList;
}
@Override
public R editMainCategory(MainDTO mainDTO) {
BasicdataMainCategoryEntity mainCategoryEntity = baseMapper.findEntityByParam(mainDTO);
if(Objects.isNull(mainCategoryEntity)){
mainCategoryEntity = new BasicdataMainCategoryEntity();
mainCategoryEntity.setFactoryCategoryId(mainDTO.getFactoryCategoryId());
mainCategoryEntity.setMainId(mainDTO.getMainId());
mainCategoryEntity.setMainName(mainDTO.getMainName());
}
mainCategoryEntity.setCategory(mainDTO.getCategory());
mainCategoryEntity.setCategoryId(mainDTO.getCategoryId());
saveOrUpdate(mainCategoryEntity);
return R.success("操作成功");
}
@Override
public R removeMainCategory(MainDTO mainDTO) {
deleteLogic(mainDTO.getIds());
return R.success("操作成功");
}
}

10
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataMainServiceImpl.java

@ -1,12 +1,17 @@
package com.logpm.basicdata.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.dto.MainDTO;
import com.logpm.basicdata.entity.BasicdataForwardingUnitEntity;
import com.logpm.basicdata.entity.BasicdataMainEntity;
import com.logpm.basicdata.mapper.BasicdataMainMapper;
import com.logpm.basicdata.service.IBasicdataMainService;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
@Service
public class BasicdataMainServiceImpl extends BaseServiceImpl<BasicdataMainMapper, BasicdataMainEntity> implements IBasicdataMainService {
@Override
@ -15,4 +20,9 @@ public class BasicdataMainServiceImpl extends BaseServiceImpl<BasicdataMainMappe
return page.setRecords(baseMapper.selectBasicdataMainEntityPage(page, basicdataMainEntity));
}
@Override
public List<BasicdataMainEntity> mainList(MainDTO mainDTO) {
return baseMapper.mainList(mainDTO);
}
}

13
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml

@ -69,6 +69,12 @@
<if test="param.waybillNo != null and param.waybillNo != '' ">
and Locate(#{param.waybillNo},lww.waybill_no) > 0
</if>
<if test="param.waybillNos != null and param.waybillNos.size() > 0 ">
and lww.waybill_no in
<foreach collection="param.waybillNos" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.orderCode != null and param.orderCode != '' ">
and Locate(#{param.orderCode},lww.order_no) > 0
</if>
@ -718,6 +724,13 @@
<if test="param.waybillNo != null and param.waybillNo != '' ">
and Locate(#{param.waybillNo},lww.waybill_no) > 0
</if>
<if test="param.waybillNos != null and param.waybillNos.size() > 0 ">
and lww.waybill_no in
<foreach collection="param.waybillNos" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.orderCode != null and param.orderCode != '' ">
and Locate(#{param.orderCode},lww.order_no) > 0
</if>

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/config/ExecutorConfig.java

@ -57,7 +57,6 @@ public class ExecutorConfig {
RequestAttributes context = RequestContextHolder.currentRequestAttributes();
String tenantId = AuthUtil.getTenantId();
Map<String, Object> all = ThreadLocalUtil.getAll();
Map<String, String> mdcMap = MDC.getCopyOfContextMap();
return () -> {

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml

@ -516,6 +516,7 @@
IFNULL(lbfc1.category,'其他') incomeCategoryName
from logpm_trunkline_advance_detail ltad
left join logpm_basicdata_factory_category lbfc1 on lbfc1.brand = ltad.brand and IFNULL(lbfc1.firsts,1) = IFNULL(ltad.first_pack_name,1) and IFNULL(lbfc1.seconds,2) = IFNULL(ltad.second_pack_name,2) and IFNULL(lbfc1.thirds,3) = IFNULL(ltad.third_pack_name,3) and lbfc1.type = 1 AND IFNULL(lbfc1.materiel_name,4) = IFNULL(ltad.material_name,4) AND lbfc1.is_deleted = 0
left join logpm_basicdata_main_category lbmc on lbmc.factory_category_id = lbfc1.id and lbmc.main_id = #{param.mainId} and lbmc.is_deleted = 0
where ltad.is_deleted = 0
<if test="param.advanceIds != null and param.advanceIds.size() > 0">
and ltad.advance_id in

653
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

@ -815,249 +815,255 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
Long waybillId = warehouseWaybillClient.addEnntity(waybillEntity);
waybillEntity.setId(waybillId);
List<WarehouseWayBillDetail> details = new ArrayList<>();
if (!Objects.isNull(waybillId)) {
log.info("#################openWaybill: 运单保存成功");
//保存运单货物明细
List<WaybillDetailDTO> waybillDetailList = openOrderDTO.getWaybillDetailList();
for (WaybillDetailDTO waybillDetailDTO : waybillDetailList) {
WarehouseWayBillDetail warehouseWayBillDetail = new WarehouseWayBillDetail();
warehouseWayBillDetail.setWaybillId(waybillId);
warehouseWayBillDetail.setWaybillNo(waybillEntity.getWaybillNo());
Long goodsId = waybillDetailDTO.getGoodsId();
String goodsName = waybillDetailDTO.getGoodsName();
// if (Objects.isNull(goodsId)) {
// //如果品名id没有就先通过goodsName查寻,没有就新增
// BasicdataCategoryEntity basicdataCategoryEntity = basicdataCategoryClient.findByName(goodsName);
// if (Objects.isNull(basicdataCategoryEntity)) {
// basicdataCategoryEntity = new BasicdataCategoryEntity();
// basicdataCategoryEntity.setName(goodsName);
// basicdataCategoryEntity.setType(1);
// goodsId = basicdataCategoryClient.addReturnId(basicdataCategoryEntity);
// } else {
// goodsId = basicdataCategoryEntity.getId();
try{
List<WarehouseWayBillDetail> details = new ArrayList<>();
if (!Objects.isNull(waybillId)) {
log.info("#################openWaybill: 运单保存成功");
//保存运单货物明细
List<WaybillDetailDTO> waybillDetailList = openOrderDTO.getWaybillDetailList();
for (WaybillDetailDTO waybillDetailDTO : waybillDetailList) {
WarehouseWayBillDetail warehouseWayBillDetail = new WarehouseWayBillDetail();
warehouseWayBillDetail.setWaybillId(waybillId);
warehouseWayBillDetail.setWaybillNo(waybillEntity.getWaybillNo());
Long goodsId = waybillDetailDTO.getGoodsId();
String goodsName = waybillDetailDTO.getGoodsName();
// if (Objects.isNull(goodsId)) {
// //如果品名id没有就先通过goodsName查寻,没有就新增
// BasicdataCategoryEntity basicdataCategoryEntity = basicdataCategoryClient.findByName(goodsName);
// if (Objects.isNull(basicdataCategoryEntity)) {
// basicdataCategoryEntity = new BasicdataCategoryEntity();
// basicdataCategoryEntity.setName(goodsName);
// basicdataCategoryEntity.setType(1);
// goodsId = basicdataCategoryClient.addReturnId(basicdataCategoryEntity);
// } else {
// goodsId = basicdataCategoryEntity.getId();
// }
// }
// }
warehouseWayBillDetail.setCreateUser(AuthUtil.getUserId());
warehouseWayBillDetail.setUpdateUser(AuthUtil.getUserId());
Date date = new Date();
warehouseWayBillDetail.setCreateTime(date);
warehouseWayBillDetail.setUpdateTime(date);
warehouseWayBillDetail.setStatus(1);
warehouseWayBillDetail.setIsDeleted(0);
warehouseWayBillDetail.setProductId(goodsId);
warehouseWayBillDetail.setProductName(goodsName);
Integer num = waybillDetailDTO.getNum();
BigDecimal volume = waybillDetailDTO.getVolume();
BigDecimal weight = waybillDetailDTO.getWeight();
warehouseWayBillDetail.setNum(num);
warehouseWayBillDetail.setVolume(volume);
warehouseWayBillDetail.setWeight(weight);
BigDecimal price = waybillDetailDTO.getPrice();
Integer chargeType = waybillDetailDTO.getChargeType();
BigDecimal subtotalFreight = waybillDetailDTO.getSubtotalFreight();
if(price.compareTo(BigDecimal.ZERO) == 0){
warehouseWayBillDetail.setCreateUser(AuthUtil.getUserId());
warehouseWayBillDetail.setUpdateUser(AuthUtil.getUserId());
Date date = new Date();
warehouseWayBillDetail.setCreateTime(date);
warehouseWayBillDetail.setUpdateTime(date);
warehouseWayBillDetail.setStatus(1);
warehouseWayBillDetail.setIsDeleted(0);
warehouseWayBillDetail.setProductId(goodsId);
warehouseWayBillDetail.setProductName(goodsName);
Integer num = waybillDetailDTO.getNum();
BigDecimal volume = waybillDetailDTO.getVolume();
BigDecimal weight = waybillDetailDTO.getWeight();
warehouseWayBillDetail.setNum(num);
warehouseWayBillDetail.setVolume(volume);
warehouseWayBillDetail.setWeight(weight);
BigDecimal price = waybillDetailDTO.getPrice();
Integer chargeType = waybillDetailDTO.getChargeType();
BigDecimal subtotalFreight = waybillDetailDTO.getSubtotalFreight();
if(price.compareTo(BigDecimal.ZERO) == 0){
if(chargeType.equals(1)){
price = subtotalFreight.divide(new BigDecimal(num),6, RoundingMode.HALF_UP);
}else if(chargeType.equals(2)){
price = subtotalFreight.divide(volume,6, RoundingMode.HALF_UP);
}else if(chargeType.equals(3)){
price = subtotalFreight.divide(weight,6, RoundingMode.HALF_UP);
}
if(chargeType.equals(1)){
price = subtotalFreight.divide(new BigDecimal(num),6, RoundingMode.HALF_UP);
}else if(chargeType.equals(2)){
price = subtotalFreight.divide(volume,6, RoundingMode.HALF_UP);
}else if(chargeType.equals(3)){
price = subtotalFreight.divide(weight,6, RoundingMode.HALF_UP);
}
warehouseWayBillDetail.setPrice(price);
warehouseWayBillDetail.setSubtotalFreight(subtotalFreight);
warehouseWayBillDetail.setChargeType(chargeType);
warehouseWayBillDetail.setDeliveryPrice(waybillDetailDTO.getDeliveryPrice());
warehouseWayBillDetail.setSubtotalDeliveryFee(waybillDetailDTO.getSubtotalDeliveryFee());
warehouseWayBillDetail.setPickupPrice(waybillDetailDTO.getPickupPrice());
warehouseWayBillDetail.setFreightPrice(waybillDetailDTO.getFreightPrice());
warehouseWayBillDetail.setSystemChargeType(waybillDetailDTO.getSystemChargeType());
warehouseWayBillDetail.setSystemDeliveryChargeType(waybillDetailDTO.getSystemDeliveryChargeType());
warehouseWayBillDetail.setSystemPickupChargeType(waybillDetailDTO.getSystemPickupChargeType());
warehouseWayBillDetail.setSystemWarehouseChargeType(waybillDetailDTO.getSystemWarehouseChargeType());
details.add(warehouseWayBillDetail);
}
warehouseWayBillDetail.setPrice(price);
warehouseWayBillDetail.setSubtotalFreight(subtotalFreight);
warehouseWayBillDetail.setChargeType(chargeType);
warehouseWayBillDetail.setDeliveryPrice(waybillDetailDTO.getDeliveryPrice());
warehouseWayBillDetail.setSubtotalDeliveryFee(waybillDetailDTO.getSubtotalDeliveryFee());
warehouseWayBillDetail.setPickupPrice(waybillDetailDTO.getPickupPrice());
warehouseWayBillDetail.setFreightPrice(waybillDetailDTO.getFreightPrice());
warehouseWayBillDetail.setSystemChargeType(waybillDetailDTO.getSystemChargeType());
warehouseWayBillDetail.setSystemDeliveryChargeType(waybillDetailDTO.getSystemDeliveryChargeType());
warehouseWayBillDetail.setSystemPickupChargeType(waybillDetailDTO.getSystemPickupChargeType());
warehouseWayBillDetail.setSystemWarehouseChargeType(waybillDetailDTO.getSystemWarehouseChargeType());
details.add(warehouseWayBillDetail);
warehouseWaybillDetailClient.addList(details);
} else {
log.info("#################openWaybill: 运单保存失败");
throw new CustomerException(405, "运单保存失败");
}
warehouseWaybillDetailClient.addList(details);
} else {
log.info("#################openWaybill: 运单保存失败");
throw new CustomerException(405, "运单保存失败");
}
//绑定订单和运单的关系
List<TrunklineAdvanceEntity> advanceEntityList = advanceService.findListByIds(advanceIds);
List<TrunklineWaybillOrderEntity> waybillOrderEntities = new ArrayList<>();
List<TrunklineAdvanceEntity> updateAdvanceEntityList = new ArrayList<>();
Set<String> orderCodeSet = new HashSet<>();
for (TrunklineAdvanceEntity advanceEntity : advanceEntityList) {
orderCodeSet.add(advanceEntity.getOrderCode());
Long advanceId = advanceEntity.getId();
String waybillStatus = advanceEntity.getWaybillStatus();
if ("1".equals(waybillStatus)) {
log.error("###############openWaybill: 已存在已开单的暂存单");
throw new CustomerException(405, "已存在已开单的暂存单");
//绑定订单和运单的关系
List<TrunklineAdvanceEntity> advanceEntityList = advanceService.findListByIds(advanceIds);
List<TrunklineWaybillOrderEntity> waybillOrderEntities = new ArrayList<>();
List<TrunklineAdvanceEntity> updateAdvanceEntityList = new ArrayList<>();
Set<String> orderCodeSet = new HashSet<>();
for (TrunklineAdvanceEntity advanceEntity : advanceEntityList) {
orderCodeSet.add(advanceEntity.getOrderCode());
Long advanceId = advanceEntity.getId();
String waybillStatus = advanceEntity.getWaybillStatus();
if ("1".equals(waybillStatus)) {
log.error("###############openWaybill: 已存在已开单的暂存单");
throw new CustomerException(405, "已存在已开单的暂存单");
}
TrunklineWaybillOrderEntity waybillOrderEntity = new TrunklineWaybillOrderEntity();
waybillOrderEntity.setWarehouseId(warehouseId);
waybillOrderEntity.setWarehouseName(basicdataWarehouseEntity.getName());
waybillOrderEntity.setWaybillId(waybillId);
waybillOrderEntity.setWaybillNo(waybillNo);
waybillOrderEntity.setAdvanceId(advanceId);
waybillOrderEntity.setOrderCode(advanceEntity.getOrderCode());
waybillOrderEntity.setTotalNumber(advanceEntity.getTotalNum());
Integer incomingNum = advanceDetailService.getIncomingNum(advanceId);
waybillOrderEntity.setHandleNumber(incomingNum);
waybillOrderEntities.add(waybillOrderEntity);
// orderCodes.add(advanceEntity.getOrderCode());
TrunklineAdvanceEntity updateAdvanceEntity = new TrunklineAdvanceEntity();
updateAdvanceEntity.setId(advanceId);
updateAdvanceEntity.setWaybillStatus("1");
updateAdvanceEntity.setWaybillNo(waybillNo);
updateAdvanceEntityList.add(updateAdvanceEntity);
}
TrunklineWaybillOrderEntity waybillOrderEntity = new TrunklineWaybillOrderEntity();
waybillOrderEntity.setWarehouseId(warehouseId);
waybillOrderEntity.setWarehouseName(basicdataWarehouseEntity.getName());
waybillOrderEntity.setWaybillId(waybillId);
waybillOrderEntity.setWaybillNo(waybillNo);
waybillOrderEntity.setAdvanceId(advanceId);
waybillOrderEntity.setOrderCode(advanceEntity.getOrderCode());
waybillOrderEntity.setTotalNumber(advanceEntity.getTotalNum());
Integer incomingNum = advanceDetailService.getIncomingNum(advanceId);
waybillOrderEntity.setHandleNumber(incomingNum);
waybillOrderEntities.add(waybillOrderEntity);
trunklineWaybillOrderService.saveBatch(waybillOrderEntities);
//修改暂存单的状态为已开单
advanceService.updateBatchById(updateAdvanceEntityList);
// orderCodes.add(advanceEntity.getOrderCode());
//更新暂存单包件的运单信息
TrunklineAdvanceEntity updateAdvanceEntity = new TrunklineAdvanceEntity();
updateAdvanceEntity.setId(advanceId);
updateAdvanceEntity.setWaybillStatus("1");
updateAdvanceEntity.setWaybillNo(waybillNo);
updateAdvanceEntityList.add(updateAdvanceEntity);
}
trunklineWaybillOrderService.saveBatch(waybillOrderEntities);
//修改暂存单的状态为已开单
advanceService.updateBatchById(updateAdvanceEntityList);
//更新暂存单包件的运单信息
List<TrunklineAdvanceDetailVO> list = advanceDetailService.findListByAdvanceIds(advanceIds);
trunklineWaybillPackageService.saveList(list, waybillEntity);
List<TrunklineAdvanceDetailVO> list = advanceDetailService.findListByAdvanceIds(advanceIds);
trunklineWaybillPackageService.saveList(list, waybillEntity);
List<TrunklineAdvanceDetailEntity> updateAdvanceDetailList = openOrderDTO.getUpdateAdvanceDetailList();
List<TrunklineAdvanceDetailEntity> updateAdvanceDetailList = openOrderDTO.getUpdateAdvanceDetailList();
//把updateAdvanceDetailList转化成以orderPackageCode为key的Map
Map<String, TrunklineAdvanceDetailEntity> advanceDetailEntityMap = updateAdvanceDetailList.stream().collect(Collectors.toMap(TrunklineAdvanceDetailEntity::getOrderPackageCode, Function.identity()));
//把updateAdvanceDetailList转化成以orderPackageCode为key的Map
Map<String, TrunklineAdvanceDetailEntity> advanceDetailEntityMap = updateAdvanceDetailList.stream().collect(Collectors.toMap(TrunklineAdvanceDetailEntity::getOrderPackageCode, Function.identity()));
List<String> orderPackageCodes = new ArrayList<>();
String finalWaybillNo = waybillNo;
List<String> orderPackageCodes = new ArrayList<>();
String finalWaybillNo = waybillNo;
updateAdvanceDetailList.forEach(detail -> {
Long id = detail.getId();
detail.setWaybillId(waybillId);
detail.setWaybillNo(finalWaybillNo);
orderPackageCodes.add(detail.getOrderPackageCode());
});
updateAdvanceDetailList.forEach(detail -> {
Long id = detail.getId();
detail.setWaybillId(waybillId);
detail.setWaybillNo(finalWaybillNo);
orderPackageCodes.add(detail.getOrderPackageCode());
});
if (CollUtil.isNotEmpty(orderPackageCodes)) {
if (CollUtil.isNotEmpty(orderPackageCodes)) {
//把orderPackageCodes每500条分为一组
List<List<String>> orderPackageCodeList = CollUtil.split(orderPackageCodes, 500);
List<DistributionParcelListEntity> parcelListEntities = new ArrayList<>();
orderPackageCodeList.forEach(orderPackageCodeList1 -> {
log.info("###############openWaybill: 分组查询订单包裹信息, {}", orderPackageCodeList1);
parcelListEntities.addAll(distributionParcelListClient.findListByOrderPackageCodes(orderPackageCodeList1));
});
//把orderPackageCodes每500条分为一组
List<List<String>> orderPackageCodeList = CollUtil.split(orderPackageCodes, 500);
List<DistributionParcelListEntity> parcelListEntities = new ArrayList<>();
orderPackageCodeList.forEach(orderPackageCodeList1 -> {
log.info("###############openWaybill: 分组查询订单包裹信息, {}", orderPackageCodeList1);
parcelListEntities.addAll(distributionParcelListClient.findListByOrderPackageCodes(orderPackageCodeList1));
});
String departureWarehouseName = waybillEntity.getDepartureWarehouseName();
String destinationWarehouseName = waybillEntity.getDestinationWarehouseName();
Long consigneeId1 = waybillEntity.getConsigneeId();
BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findEntityById(consigneeId1);
Set<Long> stockArticleIds = new TreeSet<>();
parcelListEntities.forEach(parcelListEntity -> {
TrunklineAdvanceDetailEntity trunklineAdvanceDetailEntity = advanceDetailEntityMap.get(parcelListEntity.getOrderPackageCode());
if(!Objects.isNull(trunklineAdvanceDetailEntity)){
parcelListEntity.setWeight(trunklineAdvanceDetailEntity.getWeight());
parcelListEntity.setVolume(trunklineAdvanceDetailEntity.getVolume());
}
Long packageWarehouseId = parcelListEntity.getWarehouseId();
parcelListEntity.setWaybillId(waybillId);
parcelListEntity.setWaybillNumber(finalWaybillNo);
parcelListEntity.setSendWarehouseId(departureWarehouseId);
parcelListEntity.setSendWarehouseName(departureWarehouseName);
parcelListEntity.setAcceptWarehouseId(destinationWarehouseId);
parcelListEntity.setAcceptWarehouseName(destinationWarehouseName);
if (departureWarehouseId.equals(destinationWarehouseId)) {
parcelListEntity.setIsTransfer(0);
} else {
if (destinationWarehouseId.equals(packageWarehouseId)) {
String departureWarehouseName = waybillEntity.getDepartureWarehouseName();
String destinationWarehouseName = waybillEntity.getDestinationWarehouseName();
Long consigneeId1 = waybillEntity.getConsigneeId();
BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findEntityById(consigneeId1);
Set<Long> stockArticleIds = new TreeSet<>();
parcelListEntities.forEach(parcelListEntity -> {
TrunklineAdvanceDetailEntity trunklineAdvanceDetailEntity = advanceDetailEntityMap.get(parcelListEntity.getOrderPackageCode());
if(!Objects.isNull(trunklineAdvanceDetailEntity)){
parcelListEntity.setWeight(trunklineAdvanceDetailEntity.getWeight());
parcelListEntity.setVolume(trunklineAdvanceDetailEntity.getVolume());
}
Long packageWarehouseId = parcelListEntity.getWarehouseId();
parcelListEntity.setWaybillId(waybillId);
parcelListEntity.setWaybillNumber(finalWaybillNo);
parcelListEntity.setSendWarehouseId(departureWarehouseId);
parcelListEntity.setSendWarehouseName(departureWarehouseName);
parcelListEntity.setAcceptWarehouseId(destinationWarehouseId);
parcelListEntity.setAcceptWarehouseName(destinationWarehouseName);
if (departureWarehouseId.equals(destinationWarehouseId)) {
parcelListEntity.setIsTransfer(0);
} else {
parcelListEntity.setIsTransfer(1);
}
}
stockArticleIds.add(parcelListEntity.getStockArticleId());
});
distributionParcelListClient.updateList(parcelListEntities);
//根据订单id获取每个订单的运单拼接数据
if (!stockArticleIds.isEmpty()) {
List<Long> newList = new ArrayList<>(stockArticleIds);
List<DistributionStockArticleEntity> stockArticleEntities = distributionStockArticleClient.findStockListByIds(newList);
// List<DistributionStockArticleEntity> stockArticleEntities = distributionStockArticleClient.findWaybillNoByOrderIds(stockArticleIds);
List<DistributionStockArticleEntity> updateStockArticleList = new ArrayList<>();
stockArticleEntities.forEach(stockArticleEntity -> {
String waybillNumber = stockArticleEntity.getWaybillNumber();
DistributionStockArticleEntity updateEntity = new DistributionStockArticleEntity();
updateEntity.setId(stockArticleEntity.getId());
if(StringUtil.isBlank(waybillNumber)){
updateEntity.setWaybillNumber(finalWaybillNo);
}else{
if(!waybillNumber.contains(finalWaybillNo)){
waybillNumber = waybillNumber + "," + finalWaybillNo;
updateEntity.setWaybillNumber(waybillNumber);
if (destinationWarehouseId.equals(packageWarehouseId)) {
parcelListEntity.setIsTransfer(0);
} else {
parcelListEntity.setIsTransfer(1);
}
}
stockArticleIds.add(parcelListEntity.getStockArticleId());
});
updateEntity.setMallId(consigneeId1);
updateEntity.setMallCode(basicdataClientEntity.getClientCode());
updateEntity.setMallName(basicdataClientEntity.getClientName());
updateEntity.setTypeService(basicdataClientEntity.getTypeService() + "");
updateEntity.setConsigneePerson(waybillEntity.getConsigneeName());
updateEntity.setConsigneeMobile(waybillEntity.getConsigneeMobile());
updateEntity.setConsigneeAddress(waybillEntity.getConsigneeAddress());
updateEntity.setConsigneeUnit(basicdataClientEntity.getClientName());
updateStockArticleList.add(updateEntity);
distributionParcelListClient.updateList(parcelListEntities);
//根据订单id获取每个订单的运单拼接数据
if (!stockArticleIds.isEmpty()) {
List<Long> newList = new ArrayList<>(stockArticleIds);
List<DistributionStockArticleEntity> stockArticleEntities = distributionStockArticleClient.findStockListByIds(newList);
// List<DistributionStockArticleEntity> stockArticleEntities = distributionStockArticleClient.findWaybillNoByOrderIds(stockArticleIds);
List<DistributionStockArticleEntity> updateStockArticleList = new ArrayList<>();
stockArticleEntities.forEach(stockArticleEntity -> {
String waybillNumber = stockArticleEntity.getWaybillNumber();
DistributionStockArticleEntity updateEntity = new DistributionStockArticleEntity();
updateEntity.setId(stockArticleEntity.getId());
if(StringUtil.isBlank(waybillNumber)){
updateEntity.setWaybillNumber(finalWaybillNo);
}else{
if(!waybillNumber.contains(finalWaybillNo)){
waybillNumber = waybillNumber + "," + finalWaybillNo;
updateEntity.setWaybillNumber(waybillNumber);
}
}
});
if (CollUtil.isNotEmpty(updateStockArticleList)) {
distributionStockArticleClient.updateByBatchId(updateStockArticleList);
updateEntity.setMallId(consigneeId1);
updateEntity.setMallCode(basicdataClientEntity.getClientCode());
updateEntity.setMallName(basicdataClientEntity.getClientName());
updateEntity.setTypeService(basicdataClientEntity.getTypeService() + "");
updateEntity.setConsigneePerson(waybillEntity.getConsigneeName());
updateEntity.setConsigneeMobile(waybillEntity.getConsigneeMobile());
updateEntity.setConsigneeAddress(waybillEntity.getConsigneeAddress());
updateEntity.setConsigneeUnit(basicdataClientEntity.getClientName());
updateStockArticleList.add(updateEntity);
});
if (CollUtil.isNotEmpty(updateStockArticleList)) {
distributionStockArticleClient.updateByBatchId(updateStockArticleList);
}
}
}
}
//修改暂存单明细的结算品类
//把updateAdvanceDetailList分成每300条一组
List<List<TrunklineAdvanceDetailEntity>> updateAdvanceDetailListList = CollUtil.split(updateAdvanceDetailList, 300);
updateAdvanceDetailListList.forEach(updateAdvanceDetailList1 -> {
advanceDetailService.updateBatchById(updateAdvanceDetailList1);
});
}
//修改暂存单明细的结算品类
//把updateAdvanceDetailList分成每300条一组
List<List<TrunklineAdvanceDetailEntity>> updateAdvanceDetailListList = CollUtil.split(updateAdvanceDetailList, 300);
updateAdvanceDetailListList.forEach(updateAdvanceDetailList1 -> {
advanceDetailService.updateBatchById(updateAdvanceDetailList1);
});
trunklineWaybillPackageService.updateWaybillStatus(waybillEntity);
trunklineWaybillPackageService.updateWaybillStatus(waybillEntity);
//计算扫码入库的包件是否需要把运单和提货单挂上
openOrderAsyncService.dealwithBillladingInfo(advanceIds, warehouseId, warehouseName, waybillId, waybillNo);
//计算扫码入库的包件是否需要把运单和提货单挂上
openOrderAsyncService.dealwithBillladingInfo(advanceIds, warehouseId, warehouseName, waybillId, waybillNo);
//异步存入日志
String nickName = AuthUtil.getNickName();
Long userId = AuthUtil.getUserId();
//异步存入日志
String nickName = AuthUtil.getNickName();
Long userId = AuthUtil.getUserId();
String createOperationRemark = "创建运单" + waybillNo + ",时间:" + CommonUtil.dateToStringGeneral(new Date());
openOrderAsyncService.saveLog(waybillId, waybillNo, "10", "创建运单", createOperationRemark, nickName, userId, warehouseId, warehouseName);
String createOperationRemark = "创建运单" + waybillNo + ",时间:" + CommonUtil.dateToStringGeneral(new Date());
openOrderAsyncService.saveLog(waybillId, waybillNo, "10", "创建运单", createOperationRemark, nickName, userId, warehouseId, warehouseName);
openOrderAsyncService.syncUnloadScanWaybillInfo(advanceIds,waybillEntity);
openOrderAsyncService.syncUnloadScanWaybillInfo(advanceIds,waybillEntity);
//队列处理包件补数据
carsLoadService.sendRabbitMessageOpenOrder(advanceIds, waybillId);
//队列处理包件补数据
carsLoadService.sendRabbitMessageOpenOrder(advanceIds, waybillId);
//发布开单广播
// openOrderAsyncService.sendOpenWaybillFanout(waybillEntity, details, advanceIds);
//发布开单广播
// openOrderAsyncService.sendOpenWaybillFanout(waybillEntity, details, advanceIds);
advanceDetailService.sendReportAdvanceOpenData(AuthUtil.getNickName(), AuthUtil.getUserId(), warehouseId, warehouseName, updateAdvanceDetailList, waybillEntity);
advanceDetailService.sendReportAdvanceOpenData(AuthUtil.getNickName(), AuthUtil.getUserId(), warehouseId, warehouseName, updateAdvanceDetailList, waybillEntity);
advanceIds.forEach(advanceId ->{
bladeRedis.del(openAdvanceIds+advanceId);
});
advanceIds.forEach(advanceId ->{
bladeRedis.del(openAdvanceIds+advanceId);
});
}catch (Exception e){
log.error("#####openWaybill:开单失败",e);
warehouseWaybillClient.deleteAllByWaybillId(waybillId);
throw new CustomerException(405,"开单失败");
}
return R.data(waybillId);
}
@ -1221,125 +1227,132 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
Long waybillId = warehouseWaybillClient.addEnntity(waybillEntity);
waybillEntity.setId(waybillId);
List<WarehouseWayBillDetail> details = new ArrayList<>();
if (!Objects.isNull(waybillId)) {
log.info("#################openZeroWaybill: 运单保存成功");
//保存运单货物明细
List<WaybillDetailDTO> waybillDetailList = openOrderDTO.getAddList();
for (WaybillDetailDTO waybillDetailDTO : waybillDetailList) {
WarehouseWayBillDetail warehouseWayBillDetail = new WarehouseWayBillDetail();
warehouseWayBillDetail.setCreateUser(AuthUtil.getUserId());
warehouseWayBillDetail.setUpdateUser(AuthUtil.getUserId());
Date date = new Date();
warehouseWayBillDetail.setCreateTime(date);
warehouseWayBillDetail.setUpdateTime(date);
warehouseWayBillDetail.setStatus(1);
warehouseWayBillDetail.setIsDeleted(0);
warehouseWayBillDetail.setWaybillId(waybillId);
warehouseWayBillDetail.setWaybillNo(waybillEntity.getWaybillNo());
Long goodsId = waybillDetailDTO.getGoodsId();
String goodsName = waybillDetailDTO.getGoodsName();
if (Objects.isNull(goodsId)) {
//如果品名id没有就先通过goodsName查寻,没有就新增
if(StringUtil.isNotBlank(goodsName)){
BasicdataCategoryEntity basicdataCategoryEntity = basicdataCategoryClient.findByName(goodsName.trim());
if (Objects.isNull(basicdataCategoryEntity)) {
basicdataCategoryEntity = new BasicdataCategoryEntity();
basicdataCategoryEntity.setName(goodsName);
basicdataCategoryEntity.setType("1");
goodsId = basicdataCategoryClient.addReturnId(basicdataCategoryEntity);
} else {
goodsId = basicdataCategoryEntity.getId();
try{
List<WarehouseWayBillDetail> details = new ArrayList<>();
if (!Objects.isNull(waybillId)) {
log.info("#################openZeroWaybill: 运单保存成功");
//保存运单货物明细
List<WaybillDetailDTO> waybillDetailList = openOrderDTO.getAddList();
for (WaybillDetailDTO waybillDetailDTO : waybillDetailList) {
WarehouseWayBillDetail warehouseWayBillDetail = new WarehouseWayBillDetail();
warehouseWayBillDetail.setCreateUser(AuthUtil.getUserId());
warehouseWayBillDetail.setUpdateUser(AuthUtil.getUserId());
Date date = new Date();
warehouseWayBillDetail.setCreateTime(date);
warehouseWayBillDetail.setUpdateTime(date);
warehouseWayBillDetail.setStatus(1);
warehouseWayBillDetail.setIsDeleted(0);
warehouseWayBillDetail.setWaybillId(waybillId);
warehouseWayBillDetail.setWaybillNo(waybillEntity.getWaybillNo());
Long goodsId = waybillDetailDTO.getGoodsId();
String goodsName = waybillDetailDTO.getGoodsName();
if (Objects.isNull(goodsId)) {
//如果品名id没有就先通过goodsName查寻,没有就新增
if(StringUtil.isNotBlank(goodsName)){
BasicdataCategoryEntity basicdataCategoryEntity = basicdataCategoryClient.findByName(goodsName.trim());
if (Objects.isNull(basicdataCategoryEntity)) {
basicdataCategoryEntity = new BasicdataCategoryEntity();
basicdataCategoryEntity.setName(goodsName);
basicdataCategoryEntity.setType("1");
goodsId = basicdataCategoryClient.addReturnId(basicdataCategoryEntity);
} else {
goodsId = basicdataCategoryEntity.getId();
}
}
}
}
warehouseWayBillDetail.setProductId(goodsId);
warehouseWayBillDetail.setProductName(goodsName);
Integer num = waybillDetailDTO.getNum();
BigDecimal volume = waybillDetailDTO.getVolume();
BigDecimal weight = waybillDetailDTO.getWeight();
warehouseWayBillDetail.setNum(num);
warehouseWayBillDetail.setVolume(volume);
warehouseWayBillDetail.setWeight(weight);
BigDecimal price = waybillDetailDTO.getPrice();
Integer chargeType = waybillDetailDTO.getChargeType();
BigDecimal subtotalFreight = waybillDetailDTO.getSubtotalFreight();
if(price.compareTo(BigDecimal.ZERO) == 0){
warehouseWayBillDetail.setProductId(goodsId);
warehouseWayBillDetail.setProductName(goodsName);
Integer num = waybillDetailDTO.getNum();
BigDecimal volume = waybillDetailDTO.getVolume();
BigDecimal weight = waybillDetailDTO.getWeight();
warehouseWayBillDetail.setNum(num);
warehouseWayBillDetail.setVolume(volume);
warehouseWayBillDetail.setWeight(weight);
BigDecimal price = waybillDetailDTO.getPrice();
Integer chargeType = waybillDetailDTO.getChargeType();
BigDecimal subtotalFreight = waybillDetailDTO.getSubtotalFreight();
if(price.compareTo(BigDecimal.ZERO) == 0){
if(chargeType.equals(1)){
price = subtotalFreight.divide(new BigDecimal(num),6, RoundingMode.HALF_UP);
}else if(chargeType.equals(2)){
price = subtotalFreight.divide(volume,6, RoundingMode.HALF_UP);
}else if(chargeType.equals(3)){
price = subtotalFreight.divide(weight,6, RoundingMode.HALF_UP);
}
if(chargeType.equals(1)){
price = subtotalFreight.divide(new BigDecimal(num),6, RoundingMode.HALF_UP);
}else if(chargeType.equals(2)){
price = subtotalFreight.divide(volume,6, RoundingMode.HALF_UP);
}else if(chargeType.equals(3)){
price = subtotalFreight.divide(weight,6, RoundingMode.HALF_UP);
}
warehouseWayBillDetail.setPrice(price);
warehouseWayBillDetail.setSubtotalFreight(subtotalFreight);
warehouseWayBillDetail.setChargeType(chargeType);
warehouseWayBillDetail.setDeliveryPrice(waybillDetailDTO.getDeliveryPrice());
warehouseWayBillDetail.setSubtotalDeliveryFee(waybillDetailDTO.getSubtotalDeliveryFee());
warehouseWayBillDetail.setPickupPrice(waybillDetailDTO.getPickupPrice());
warehouseWayBillDetail.setFreightPrice(waybillDetailDTO.getFreightPrice());
warehouseWayBillDetail.setSystemChargeType(waybillDetailDTO.getChargeType());
warehouseWayBillDetail.setSystemDeliveryChargeType(waybillDetailDTO.getSystemDeliveryChargeType());
warehouseWayBillDetail.setSystemPickupChargeType(waybillDetailDTO.getSystemPickupChargeType());
warehouseWayBillDetail.setSystemWarehouseChargeType(waybillDetailDTO.getSystemWarehouseChargeType());
details.add(warehouseWayBillDetail);
}
warehouseWaybillDetailClient.addList(details);
} else {
log.info("#################openZeroWaybill: 运单保存失败");
return R.fail(405, "运单保存失败");
}
if (advanceIds != null && advanceIds.size() > 0) {
List<TrunklineAdvanceEntity> advanceEntityList = advanceService.findListByIds(advanceIds);
for (TrunklineAdvanceEntity advanceEntity : advanceEntityList) {
advanceEntity.setWaybillNo(waybillNo);
advanceEntity.setWaybillStatus("1");
}
warehouseWayBillDetail.setPrice(price);
warehouseWayBillDetail.setSubtotalFreight(subtotalFreight);
warehouseWayBillDetail.setChargeType(chargeType);
warehouseWayBillDetail.setDeliveryPrice(waybillDetailDTO.getDeliveryPrice());
warehouseWayBillDetail.setSubtotalDeliveryFee(waybillDetailDTO.getSubtotalDeliveryFee());
warehouseWayBillDetail.setPickupPrice(waybillDetailDTO.getPickupPrice());
warehouseWayBillDetail.setFreightPrice(waybillDetailDTO.getFreightPrice());
warehouseWayBillDetail.setSystemChargeType(waybillDetailDTO.getChargeType());
warehouseWayBillDetail.setSystemDeliveryChargeType(waybillDetailDTO.getSystemDeliveryChargeType());
warehouseWayBillDetail.setSystemPickupChargeType(waybillDetailDTO.getSystemPickupChargeType());
warehouseWayBillDetail.setSystemWarehouseChargeType(waybillDetailDTO.getSystemWarehouseChargeType());
details.add(warehouseWayBillDetail);
advanceService.updateBatchById(advanceEntityList);
}
warehouseWaybillDetailClient.addList(details);
} else {
log.info("#################openZeroWaybill: 运单保存失败");
return R.fail(405, "运单保存失败");
}
//异步存入日志
Date date = new Date();
String nickName = AuthUtil.getNickName();
Long userId = AuthUtil.getUserId();
String createOperationRemark = "创建运单" + waybillNo + ",时间:" + CommonUtil.dateToStringGeneral(date);
openOrderAsyncService.saveLog(waybillId, waybillNo, "10", "创建运单", createOperationRemark, nickName, userId, warehouseId, warehouseName);
if (advanceIds != null && advanceIds.size() > 0) {
List<TrunklineAdvanceEntity> advanceEntityList = advanceService.findListByIds(advanceIds);
for (TrunklineAdvanceEntity advanceEntity : advanceEntityList) {
advanceEntity.setWaybillNo(waybillNo);
advanceEntity.setWaybillStatus("1");
Integer totalCount = waybillEntity.getTotalCount();
Integer stockCount = waybillEntity.getStockCount();
if (totalCount.equals(stockCount)) {
createOperationRemark = "运单入库:" + stockCount + "/" + totalCount + ",入库类型:【零担开单及入库】,入库时间:" + CommonUtil.dateToStringGeneral(date);
openOrderAsyncService.saveLog(waybillId, waybillNo, "20", "已入库", createOperationRemark, nickName, userId, warehouseId, warehouseName);
}
advanceService.updateBatchById(advanceEntityList);
}
//异步存入日志
Date date = new Date();
String nickName = AuthUtil.getNickName();
Long userId = AuthUtil.getUserId();
String createOperationRemark = "创建运单" + waybillNo + ",时间:" + CommonUtil.dateToStringGeneral(date);
openOrderAsyncService.saveLog(waybillId, waybillNo, "10", "创建运单", createOperationRemark, nickName, userId, warehouseId, warehouseName);
Integer totalCount = waybillEntity.getTotalCount();
Integer stockCount = waybillEntity.getStockCount();
if (totalCount.equals(stockCount)) {
createOperationRemark = "运单入库:" + stockCount + "/" + totalCount + ",入库类型:【零担开单及入库】,入库时间:" + CommonUtil.dateToStringGeneral(date);
openOrderAsyncService.saveLog(waybillId, waybillNo, "20", "已入库", createOperationRemark, nickName, userId, warehouseId, warehouseName);
//创建零担订单
createStockArticle(waybillEntity);
//存入运单与订单关联信息
TrunklineWaybillOrderEntity trunklineWaybillOrderEntity = new TrunklineWaybillOrderEntity();
trunklineWaybillOrderEntity.setWarehouseId(warehouseId);
trunklineWaybillOrderEntity.setWarehouseName(basicdataWarehouseEntity.getName());
trunklineWaybillOrderEntity.setWaybillId(waybillId);
trunklineWaybillOrderEntity.setWaybillNo(waybillNo);
trunklineWaybillOrderEntity.setOrderCode(waybillNo);
trunklineWaybillOrderEntity.setTotalNumber(waybillEntity.getTotalCount());
trunklineWaybillOrderEntity.setHandleNumber(waybillEntity.getTotalCount());
trunklineWaybillOrderService.save(trunklineWaybillOrderEntity);
//发布开单广播
openOrderAsyncService.sendOpenWaybillFanout(waybillEntity, details, null);
//发送零担开单广播
sendOpenZeroWaybillFanout(AuthUtil.getUserId(), AuthUtil.getNickName(), warehouseId, warehouseName, waybillEntity, details);
}catch (Exception e){
log.error("#####openWaybill:开单失败",e);
warehouseWaybillClient.deleteAllByWaybillId(waybillId);
throw new CustomerException(405,"开单失败");
}
//创建零担订单
createStockArticle(waybillEntity);
//存入运单与订单关联信息
TrunklineWaybillOrderEntity trunklineWaybillOrderEntity = new TrunklineWaybillOrderEntity();
trunklineWaybillOrderEntity.setWarehouseId(warehouseId);
trunklineWaybillOrderEntity.setWarehouseName(basicdataWarehouseEntity.getName());
trunklineWaybillOrderEntity.setWaybillId(waybillId);
trunklineWaybillOrderEntity.setWaybillNo(waybillNo);
trunklineWaybillOrderEntity.setOrderCode(waybillNo);
trunklineWaybillOrderEntity.setTotalNumber(waybillEntity.getTotalCount());
trunklineWaybillOrderEntity.setHandleNumber(waybillEntity.getTotalCount());
trunklineWaybillOrderService.save(trunklineWaybillOrderEntity);
//发布开单广播
openOrderAsyncService.sendOpenWaybillFanout(waybillEntity, details, null);
//发送零担开单广播
sendOpenZeroWaybillFanout(AuthUtil.getUserId(), AuthUtil.getNickName(), warehouseId, warehouseName, waybillEntity, details);
Map<String, Object> map = new HashMap<>();
map.put("waybillId", waybillId);
map.put("waybillNo", waybillNo);
@ -4632,7 +4645,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
}
//TODO 还需要加上生成了预存单的无法进行作废
//生成了预存单的无法进行作废
Integer status = orderInfoClient.findCreateRencilitionOrderStatus(waybillId);
if (status == 1) {
log.warn("##########abolishWaybill: 运单已有预存单确认 waybillId={}", waybillId);
@ -4802,6 +4815,14 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
public R findAdvanceDetailListByAdvanceIds(AdvanceDTO advanceDTO) {
List<Long> advanceIds = advanceDTO.getAdvanceIds();
Long clientId = advanceDTO.getClientId();
if(!Objects.isNull(clientId)){
BasicdataClientEntity clientEntity = basicdataClientClient.findEntityById(clientId);
if(!Objects.isNull(clientEntity)){
advanceDTO.setMainId(clientEntity.getMainId());
}
}
List<AdvanceDetailVO> advanceDetailVOList = advanceDetailService.findAdvanceDetailListByAdvanceIds(advanceDTO);
return R.data(advanceDetailVOList);
@ -5596,9 +5617,9 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
Long newDestinationWarehouseId = openOrderDTO.getDestinationWarehouseId();
String newDestinationWarehouseName = openOrderDTO.getDestinationWarehouseName();
Long destinationWarehouseId = waybillEntity.getDestinationWarehouseId();
String departureWarehouseName = waybillEntity.getDepartureWarehouseName();
String destinationWarehouseName = waybillEntity.getDestinationWarehouseName();
if (!ObjectUtil.equals(destinationWarehouseId, newDestinationWarehouseId)) {
stringBuilder.append("目的仓:").append(departureWarehouseName).append("-->").append(newDestinationWarehouseName).append(";");
stringBuilder.append("目的仓:").append(destinationWarehouseName).append("-->").append(newDestinationWarehouseName).append(";");
waybillEntity.setDestinationWarehouseId(newDestinationWarehouseId);
waybillEntity.setDestinationWarehouseName(newDestinationWarehouseName);
//查询所有该运单的包件

5
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillClient.java

@ -139,4 +139,9 @@ public class WarehouseWaybillClient implements IWarehouseWaybillClient {
public List<WarehouseWaybillEntity> findWaybillVOByOrderCode(String orderCode) {
return warehouseWaybillService.findWaybillVOByOrderCode(orderCode);
}
@Override
public void deleteAllByWaybillId(Long waybillId) {
warehouseWaybillService.deleteAllByWaybillId(waybillId);
}
}

1
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java

@ -98,4 +98,5 @@ public interface IWarehouseWaybillService extends BaseService<WarehouseWaybillEn
R updateWaybillTypeService(WarehouseWaybillDTO waybillDTO);
void deleteAllByWaybillId(Long waybillId);
}

11
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

@ -1261,4 +1261,15 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
return R.success("修改成功");
}
@Override
public void deleteAllByWaybillId(Long waybillId) {
List<Long> waybillIds = Arrays.asList(waybillId);
baseMapper.deleteByWaybillIds(waybillIds);
warehouseWayBillDetailService.deleteByWaybillIds(waybillIds);
}
}

Loading…
Cancel
Save