Browse Source

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

training
caoyizhong 1 year ago
parent
commit
a8e95cc913
  1. 16
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/InComingDTO.java
  2. 1
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseWaybillClient.java
  3. 6
      blade-service/logpm-trunkline/pom.xml
  4. 61
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/BillladingApiController.java
  5. 70
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/InComingApiController.java
  6. 35
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/bean/Resp.java
  7. 32
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/BillladingController.java
  8. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java
  9. 7
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml
  10. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.java
  11. 8
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml
  12. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.java
  13. 43
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml
  14. 10
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IInComingService.java
  15. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java
  16. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceService.java
  17. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineBillladingService.java
  18. 61
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java
  19. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java
  20. 62
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java
  21. 14
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java
  22. 39
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWaybillController.java
  23. 7
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/WarehouseWaybillDTO.java
  24. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java
  25. 12
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml
  26. 4
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java
  27. 12
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

16
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/InComingDTO.java

@ -0,0 +1,16 @@
package com.logpm.trunkline.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class InComingDTO implements Serializable {
private Long billladingId;//提货id
private String orderPackageCode;//包件码
private Long warehouseId;//仓库id
}

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

@ -60,4 +60,5 @@ public interface IWarehouseWaybillClient {
@PostMapping(API_PREFIX + "/updateEntity")
void updateEntity(@RequestBody WarehouseWaybillEntity warehouseWaybill);
}

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

@ -45,6 +45,12 @@
<version>3.2.0.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-warehouse-api</artifactId>
<version>3.2.0.RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies>

61
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/BillladingApiController.java

@ -0,0 +1,61 @@
package com.logpm.trunkline.api;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.trunkline.dto.BillladingDTO;
import com.logpm.trunkline.service.ITrunklineBillladingService;
import com.logpm.trunkline.vo.TrunklineBillladingVO;
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.Objects;
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/api/billlading")
@Api(value = "提货单控制类", tags = "提货单接口")
public class BillladingApiController {
private final IBasicdataWarehouseClient warehouseClient;
private final ITrunklineBillladingService billladingService;
@ResponseBody
@PostMapping("/list")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "提货单列表", notes = "传入billladingDTO")
public R pageList(@RequestBody BillladingDTO billladingDTO) {
String method = "############list: ";
log.info(method+"请求参数{}",billladingDTO);
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(403,"仓库信息为空");
}
billladingDTO.setWarehouseId(myCurrentWarehouse.getId());
IPage<TrunklineBillladingVO> pages = billladingService.pageInfoList(billladingDTO);
return R.data(pages);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error("############sendOrders: 系统异常",e);
return R.fail(500,"############sendOrders: 系统异常");
}
}
}

70
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/InComingApiController.java

@ -0,0 +1,70 @@
package com.logpm.trunkline.api;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.trunkline.dto.InComingDTO;
import com.logpm.trunkline.service.IInComingService;
import com.logpm.trunkline.vo.TrunklineBillladingVO;
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.springblade.core.tool.utils.StringUtil;
import org.springframework.web.bind.annotation.*;
import java.util.Objects;
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/api/incoming")
@Api(value = "入库控制类", tags = "入库接口")
public class InComingApiController {
private final IBasicdataWarehouseClient warehouseClient;
private final IInComingService inComingService;
@ResponseBody
@PostMapping("/incomingPackage")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "包件入库扫描", notes = "传入inComingDTO")
public R incomingPackage(@RequestBody InComingDTO inComingDTO) {
String method = "############incomingPackage: ";
log.info(method+"请求参数{}",inComingDTO);
String orderPackageCode = inComingDTO.getOrderPackageCode();
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(403,"仓库信息为空");
}
inComingDTO.setWarehouseId(myCurrentWarehouse.getId());
if(StringUtil.isBlank(orderPackageCode)){
log.warn(method+"包件码不能为空");
return R.fail(405,"包件码不能为空");
}
return inComingService.incomingPackage(inComingDTO);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error("############sendOrders: 系统异常",e);
return R.fail(500,"############sendOrders: 系统异常");
}
}
}

35
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/bean/Resp.java

@ -0,0 +1,35 @@
package com.logpm.trunkline.bean;
import lombok.Data;
import org.springblade.core.tool.api.R;
@Data
public class Resp extends R {
private String audio;
public static Resp scanSuccess(String msg,String audio){
Resp resp = new Resp();
resp.setCode(200);
resp.setMsg(msg);
resp.setAudio(audio);
return resp;
}
public static Resp scanFail(String msg,String audio){
Resp resp = new Resp();
resp.setCode(3001);
resp.setMsg(msg);
resp.setAudio(audio);
return resp;
}
public static Resp scanFail(int code,String msg,String audio){
Resp resp = new Resp();
resp.setCode(code);
resp.setMsg(msg);
resp.setAudio(audio);
return resp;
}
}

32
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/BillladingController.java

@ -7,6 +7,7 @@ import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.trunkline.dto.BillladingDTO;
import com.logpm.trunkline.service.ITrunklineBillladingService;
import com.logpm.trunkline.vo.TrunklineBillladingVO;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
@ -34,6 +35,8 @@ public class BillladingController {
private final ITrunklineBillladingService trunklineBillladingService;
private final IWarehouseWaybillClient warehouseWaybillClient;
@ResponseBody
@PostMapping("/pageList")
@ApiOperationSupport(order = 1)
@ -159,34 +162,5 @@ public class BillladingController {
}
}
@ResponseBody
@PostMapping("/pageWaybillList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "分页查询运单", notes = "传入waybillDTO")
public R pageWaybillList(@RequestBody BillladingDTO billladingDTO) {
String method = "############findChargeTypeList: ";
log.info(method + "请求参数{}", billladingDTO);
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(403,"仓库信息为空");
}
billladingDTO.setWarehouseId(myCurrentWarehouse.getId());
IPage<TrunklineBillladingVO> pages = trunklineBillladingService.pageList(billladingDTO);
return R.data(pages);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error("############sendOrders: 系统异常",e);
return R.fail(500,"############sendOrders: 系统异常");
}
}
}

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

@ -3,7 +3,11 @@ package com.logpm.trunkline.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface TrunklineAdvanceDetailMapper extends BaseMapper<TrunklineAdvanceDetailEntity> {
void updatePackageStatusById(@Param("packageStatus") String packageStatus, @Param("advanceDetailId") Long advanceDetailId);
}

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

@ -3,4 +3,11 @@
<mapper namespace="com.logpm.trunkline.mapper.TrunklineAdvanceDetailMapper">
<update id="updatePackageStatusById">
update logpm_trunkline_advance_detail
set package_status = #{packageStatus}
where id = #{advanceDetailId}
</update>
</mapper>

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.java

@ -3,7 +3,10 @@ package com.logpm.trunkline.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface TrunklineAdvanceMapper extends BaseMapper<TrunklineAdvanceEntity> {
int getAllTotalNum(@Param("orderCode") String orderCode);
}

8
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml

@ -2,5 +2,13 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.trunkline.mapper.TrunklineAdvanceMapper">
<select id="getAllTotalNum" resultType="int">
select sum(total_num)
from logpm_trunkline_advance
where is_deleted = 0
and order_code = #{orderCode}
</select>
</mapper>

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

@ -13,4 +13,5 @@ public interface TrunklineBillladingMapper extends BaseMapper<TrunklineBillladin
IPage<TrunklineBillladingVO> pageList(IPage<Object> page, @Param("param") BillladingDTO billladingDTO);
IPage<TrunklineBillladingVO> pageInfoList(IPage<Object> page, @Param("param") BillladingDTO billladingDTO);
}

43
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml

@ -8,27 +8,13 @@
ltb.car_number carNumber,
ltb.driver_name driverName,
ltb.driver_phone driverPhone,
ltb.line_name_title lineTameTitle,
ltb.warehouse_id warehouseId,
ltb.warehouse_name warehouseName,
ltb.line_id lineId,
ltb.line_name_title lineNameTitle,
lbd.node_nub nodeNub,
ltb.start_time startTime,
ltb.end_time endTime,
ltb.plan_num planNum,
ltb.billlading_status billladingStatus,
ltb.charge_type chargeType,
ltb.total_fee totalFee,
ltb.remark remark,
ltb.carrier_name carrierName,
ltb.create_user_name createUserName,
count(ltbw.id) waybillCount,
sum(ltbw.real_num) totalNum,
sum(ltbw.real_weight) totalWeight,
sum(ltbw.real_volume) totalVolume
ltb.carrier_name carrierName
from logpm_trunkline_billlading ltb
left join logpm_basic_deline lbd on lbd.id = ltb.line_id
left join logpm_trunkline_billlading_waybill ltbw on ltbw.billlading_id = ltb.id and ltbw.
where ltb.is_deleted = 0
<if test="param.billladingCode != null and param.billladingCode != '' ">
and ltb.billlading_code = #{param.billladingCode}
@ -54,25 +40,14 @@
<if test="param.createUserName != null and param.createUserName != '' ">
and ltb.create_user_name = #{param.createUserName}
</if>
group by ltb.id,ltb.billlading_code,
ltb.car_number,
ltb.driver_name,
ltb.driver_phone,
ltb.warehouse_id,
ltb.warehouse_name,
ltb.line_id,
ltb.line_name_title,
lbd.node_nub,
ltb.start_time,
ltb.end_time,
ltb.plan_num,
ltb.billlading_status,
ltb.charge_type,
ltb.total_fee,
ltb.remark,
ltb.carrier_name,
ltb.create_user_name
order by ltb.create_time desc
</select>
<select id="pageInfoList" resultType="com.logpm.trunkline.vo.TrunklineBillladingVO">
select
</select>
</mapper>

10
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IInComingService.java

@ -0,0 +1,10 @@
package com.logpm.trunkline.service;
import com.logpm.trunkline.dto.InComingDTO;
import org.springblade.core.tool.api.R;
public interface IInComingService {
R incomingPackage(InComingDTO inComingDTO);
}

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java

@ -4,4 +4,7 @@ import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import org.springblade.core.mp.base.BaseService;
public interface ITrunklineAdvanceDetailService extends BaseService<TrunklineAdvanceDetailEntity> {
void updatePackageStatusById(String packageStatus, Long advanceDetailId);
}

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceService.java

@ -1,7 +1,10 @@
package com.logpm.trunkline.service;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import org.springblade.core.mp.base.BaseService;
public interface ITrunklineAdvanceService extends BaseService<TrunklineAdvanceEntity> {
void saveOrderAndPackage(TrunklineAdvanceDetailEntity advanceDetailEntity, Long warehouseId);
}

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineBillladingService.java

@ -11,4 +11,7 @@ public interface ITrunklineBillladingService extends BaseService<TrunklineBillla
IPage<TrunklineBillladingVO> pageList(BillladingDTO billladingDTO);
void saveNew(BillladingDTO billladingDTO,String warehouseCode);
IPage<TrunklineBillladingVO> pageInfoList(BillladingDTO billladingDTO);
}

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

@ -0,0 +1,61 @@
package com.logpm.trunkline.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.trunkline.bean.Resp;
import com.logpm.trunkline.dto.InComingDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.service.IInComingService;
import com.logpm.trunkline.service.ITrunklineAdvanceDetailService;
import com.logpm.trunkline.service.ITrunklineAdvanceService;
import com.logpm.trunkline.service.ITrunklineBillladingPackageServicie;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Service;
import java.util.Objects;
@Slf4j
@Service
@AllArgsConstructor
public class InComingServiceImpl implements IInComingService {
private final ITrunklineBillladingPackageServicie billladingPackageServicie;
private final ITrunklineAdvanceDetailService advanceDetailService;
private final ITrunklineAdvanceService advanceService;
@Override
public R incomingPackage(InComingDTO inComingDTO) {
String orderPackageCode = inComingDTO.getOrderPackageCode();//包件码
Long warehouseId = inComingDTO.getWarehouseId();//仓库id
Long billladingId = inComingDTO.getBillladingId();//提货单id
log.info("############incomingPackage: 包件入库开始 orderPackageCode={} billladingId={} warehouseId={}",orderPackageCode,billladingId,warehouseId);
//包件入库开始
//查询包件是否有数据
QueryWrapper<TrunklineAdvanceDetailEntity> advanceDetailQueryWrapper = new QueryWrapper<>();
advanceDetailQueryWrapper.eq("order_package_code",orderPackageCode)
.eq("warehouse_id",warehouseId);
TrunklineAdvanceDetailEntity advanceDetailEntity = advanceDetailService.getOne(advanceDetailQueryWrapper);
if(Objects.isNull(advanceDetailEntity)){
log.warn("############incomingPackage: 包件不存在 orderPackageCode={} warehouseId={}",orderPackageCode,warehouseId);
return Resp.scanFail(405,"包件无数据","包件无数据");
}
Long advanceDetailId = advanceDetailEntity.getId();
String packageStatus = advanceDetailEntity.getPackageStatus();
if("1".equals(packageStatus)){
log.warn("############incomingPackage: 包件已入库 orderPackageCode={} warehouseId={}",orderPackageCode,warehouseId);
return Resp.scanFail(405,"包件已入库","包件已入库");
}
//1.修改暂存单包件入库状态
advanceDetailService.updatePackageStatusById("1",advanceDetailId);
//2.判断包件和订单是否已经存入在库订单
advanceService.saveOrderAndPackage(advanceDetailEntity,warehouseId);
return null;
}
}

4
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java

@ -12,4 +12,8 @@ import org.springframework.stereotype.Service;
@Service
@AllArgsConstructor
public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl<TrunklineAdvanceDetailMapper, TrunklineAdvanceDetailEntity> implements ITrunklineAdvanceDetailService {
@Override
public void updatePackageStatusById(String packageStatus, Long advanceDetailId) {
baseMapper.updatePackageStatusById(packageStatus,advanceDetailId);
}
}

62
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java

@ -1,15 +1,77 @@
package com.logpm.trunkline.service.impl;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.feign.IDistributionParcelListClient;
import com.logpm.distribution.feign.IDistributionStockArticleClient;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.mapper.TrunklineAdvanceMapper;
import com.logpm.trunkline.service.ITrunklineAdvanceService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.TenantNum;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import java.util.Objects;
@Slf4j
@Service
@AllArgsConstructor
public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanceMapper, TrunklineAdvanceEntity> implements ITrunklineAdvanceService {
private final IDistributionStockArticleClient stockArticleClient;
private final IDistributionParcelListClient parcelListClient;
private final ITrunklineAdvanceService advanceService;
private final IBasicdataWarehouseClient basicdataWarehouseClient;
@Override
public void saveOrderAndPackage(TrunklineAdvanceDetailEntity advanceDetailEntity, Long warehouseId) {
String orderPackageCode = advanceDetailEntity.getOrderPackageCode();
String orderCode = advanceDetailEntity.getOrderCode();
Long advanceId = advanceDetailEntity.getAdvanceId();
log.info("############saveOrderAndPackage: 保存订单和包件信息 orderPackageCode={}",orderPackageCode);
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
if(Objects.isNull(warehouseEntity)){
log.warn("############saveOrderAndPackage: 仓库信息不存在warehouseId={}",warehouseId);
throw new CustomerException(405,"仓库信息不存在");
}
//1.判断包件是否已经存在
DistributionParcelListEntity parcelListEntity = parcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, warehouseId);
if(!Objects.isNull(parcelListEntity)){
log.warn("############saveOrderAndPackage: 包件信息已存在 orderPackageCode={} warehouseId={}",orderPackageCode,warehouseId);
throw new CustomerException(405,"包件信息已存在");
}
//2.查询订单信息
int total = baseMapper.getAllTotalNum(orderCode);
DistributionStockArticleEntity stockArticleEntity = stockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
if(Objects.isNull(stockArticleEntity)){
log.info("#############saveOrderAndPackage: 订单信息为空,同步订单信息");
//订单信息为空
TrunklineAdvanceEntity advanceEntity = advanceService.getById(advanceId);
stockArticleEntity = new DistributionStockArticleEntity();
stockArticleEntity.setOrderCode(orderCode);
stockArticleEntity.setServiceNumber(advanceEntity.getServiceNum());
stockArticleEntity.setWaybillNumber(advanceEntity.getWaybillNo());
stockArticleEntity.setTotalNumber(total);
stockArticleEntity.setHandQuantity(0);
stockArticleEntity.setTenantId(TenantNum.HUITONGCODE);// 对应租户ID
stockArticleEntity.setWarehouse(warehouseEntity.getName());
stockArticleEntity.setWarehouseId(warehouseId);
stockArticleEntity.setBrand(advanceEntity.getBrand());
}
}
}

14
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java

@ -103,4 +103,18 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
billladingWaybillService.save(billladingWaybillEntity);
}
}
@Override
public IPage<TrunklineBillladingVO> pageInfoList(BillladingDTO billladingDTO) {
IPage<Object> page = new Page<>();
page.setCurrent(billladingDTO.getPageNum());
page.setSize(billladingDTO.getPageSize());
billladingDTO.setBillladingStatus("2");
IPage<TrunklineBillladingVO> pageList = baseMapper.pageInfoList(page,billladingDTO);
return pageList;
}
}

39
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWaybillController.java

@ -16,7 +16,6 @@
*/
package com.logpm.warehouse.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
@ -25,9 +24,8 @@ import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.feign.IDistributionStockArticleClient;
import com.logpm.warehouse.dto.ProductDTO;
import com.logpm.warehouse.dto.SplitOrderDTO;
import com.logpm.warehouse.entity.WarehouseWarehousingDetailEntity;
import com.logpm.warehouse.dto.WarehouseWaybillDTO;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.excel.WarehouseWarehousingDetailExcel;
import com.logpm.warehouse.excel.WarehouseWaybillExcel;
import com.logpm.warehouse.service.IWarehouseWaybillService;
import com.logpm.warehouse.vo.WarehouseWaybillVO;
@ -44,7 +42,6 @@ import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.feign.IDictBizClient;
@ -56,7 +53,6 @@ import javax.validation.Valid;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* 运单表 控制器
@ -75,7 +71,7 @@ public class WarehouseWaybillController extends BladeController {
private final IDistributionStockArticleClient distributionStockArticleClient;
private final IBasicdataWarehouseClient basicdataWarehouseClient;
private final IBasicdataWarehouseClient warehouseClient;
private final IDictBizClient dictBizClient;
@ -251,4 +247,35 @@ public class WarehouseWaybillController extends BladeController {
ExcelUtil.export(response, "在库运单" + DateUtil.time(), "在库运单数据表", list, WarehouseWaybillExcel.class);
}
@ResponseBody
@PostMapping("/pageWaybillList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "分页查询运单", notes = "传入waybillDTO")
public R pageWaybillList(@RequestBody WarehouseWaybillDTO waybillDTO) {
String method = "############pageWaybillList: ";
log.info(method + "请求参数{}", waybillDTO);
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(403,"仓库信息为空");
}
waybillDTO.setWarehouseId(myCurrentWarehouse.getId());
IPage<WarehouseWaybillVO> pages = warehouseWaybillService.pageList(waybillDTO);
return R.data(pages);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error("############sendOrders: 系统异常",e);
return R.fail(500,"############sendOrders: 系统异常");
}
}
}

7
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/WarehouseWaybillDTO.java

@ -37,4 +37,11 @@ public class WarehouseWaybillDTO extends WarehouseWaybillEntity {
private List<Long> destinationWarehouseIds;
private Integer pageNum;
private Integer pageSize;
private Long warehouseId;
private List<String> waybillNoList;
}

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

@ -48,4 +48,6 @@ public interface WarehouseWaybillMapper extends BaseMapper<WarehouseWaybillEntit
List<WarehouseWaybillVO> exportWarehouseWarehousingDetail(@Param("ew") QueryWrapper<WarehouseWaybillEntity> queryWrapper);
IPage<WarehouseWaybillEntity> pageInfo(IPage<Object> page,@Param("param") WarehouseWaybillDTO warehouseWaybillDTO);
IPage<WarehouseWaybillVO> pageList(IPage<Object> page, @Param("param") WarehouseWaybillDTO waybillDTO);
}

12
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml

@ -141,4 +141,16 @@
</update>
<select id="pageList" resultType="com.logpm.warehouse.vo.WarehouseWaybillVO">
select *
from logpm_warehouse_waybill
where is_deleted = 0
<if test="param.waybillNoList != null">
and waybill_no not in
<foreach collection="param.waybillNoList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
</mapper>

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

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.warehouse.dto.SplitOrderDTO;
import com.logpm.warehouse.dto.WarehouseWaybillDTO;
import com.logpm.warehouse.dto.WaybillDTO;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.excel.WarehouseWaybillExcel;
@ -46,4 +47,7 @@ public interface IWarehouseWaybillService extends BaseService<WarehouseWaybillEn
List<WarehouseWaybillExcel> exportWarehouseWarehousingDetail(Map<String, Object> warehouseWaybillEntity);
IPage<WarehouseWaybillEntity> pageInfo(IPage<Object> page, Map<String, Object> warehouseWaybill);
IPage<WarehouseWaybillVO> pageList(WarehouseWaybillDTO waybillDTO);
}

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

@ -6,6 +6,7 @@ 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.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataStoreBusinessEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
@ -39,7 +40,6 @@ import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.TenantNum;
import org.springblade.common.constant.order.*;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.tool.constant.BladeConstant;
@ -682,4 +682,14 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
}
return baseMapper.pageInfo(page,warehouseWaybillDTO);
}
@Override
public IPage<WarehouseWaybillVO> pageList(WarehouseWaybillDTO waybillDTO) {
IPage<Object> page = new Page<>();
page.setCurrent(waybillDTO.getPageNum());
page.setSize(waybillDTO.getPageSize());
IPage<WarehouseWaybillVO> pageList = baseMapper.pageList(page,waybillDTO);
return pageList;
}
}

Loading…
Cancel
Save