Browse Source

Merge branch 'pre-production'

single_db
zhenghaoyu 1 year ago
parent
commit
aa85b93b2f
  1. 3
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java
  2. 4
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsOrderEntity.java
  3. 1
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadAllOrderVO.java
  4. 14
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/ProductUnloadInfoVO.java
  5. 8
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineCarsLoadLineVO.java
  6. 1
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineCarsLoadVO.java
  7. 18
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/UnloadZeroVO.java
  8. 5
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseTrayTypeClient.java
  9. 3
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataWarehouseClient.java
  10. 112
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/CarsLoadApiController.java
  11. 86
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/TripartiteTransferApiController.java
  12. 121
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java
  13. 14
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/TripartiteTransferController.java
  14. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadLineMapper.java
  15. 8
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadLineMapper.xml
  16. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.java
  17. 20
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml
  18. 12
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java
  19. 38
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml
  20. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.java
  21. 11
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml
  22. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsUnloadScanMapper.java
  23. 13
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsUnloadScanMapper.xml
  24. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadLineService.java
  25. 13
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java
  26. 15
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java
  27. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsOrderService.java
  28. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsUnloadScanService.java
  29. 6
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadLineServiceImpl.java
  30. 24
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java
  31. 207
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  32. 6
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsOrderEntityServiceImpl.java
  33. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsUnloadScanServiceImpl.java
  34. 10
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseTrayTypeClient.java
  35. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseTrayGoodsMapper.java
  36. 7
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseTrayGoodsMapper.xml
  37. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayGoodsService.java
  38. 1
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayTypeService.java
  39. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsServiceImpl.java
  40. 16
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

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

@ -54,4 +54,7 @@ public class LoadCarsDTO implements Serializable {
private Long carsLoadScanId;
private List<String> orderCodes;
}

4
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsOrderEntity.java

@ -73,5 +73,9 @@ public class TrunklineCarsOrderEntity extends TenantEntity {
/** 是否异常 0否 1是 */
@ApiModelProperty(name = "是否异常 0否 1是",notes = "")
private Integer isAbnormal;
/** 卸车数量 */
@ApiModelProperty(name = "卸车数量",notes = "")
private Integer unloadNum;
}

1
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadAllOrderVO.java

@ -18,6 +18,7 @@ public class CarsLoadAllOrderVO implements Serializable {
private String shipper;//发货单位
private String consignee;//收货单位
private String consigneeName;//收货人
private String goodsName;//货物名称
private String customerTrain;//客户车次号
private String remark;//备注好
private Integer totalNum;//总件数

14
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/ProductUnloadInfoVO.java

@ -0,0 +1,14 @@
package com.logpm.trunkline.vo;
import lombok.Data;
import java.io.Serializable;
@Data
public class ProductUnloadInfoVO implements Serializable {
private String productName;
private Integer loadingNum;
private Integer unloadNum;
}

8
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineCarsLoadLineVO.java

@ -0,0 +1,8 @@
package com.logpm.trunkline.vo;
import com.logpm.trunkline.entity.TrunklineCarsLoadLineEntity;
import lombok.Data;
@Data
public class TrunklineCarsLoadLineVO extends TrunklineCarsLoadLineEntity {
}

1
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineCarsLoadVO.java

@ -20,6 +20,7 @@ public class TrunklineCarsLoadVO extends TrunklineCarsLoadEntity {
private List<TrunklineCarsLoadScanEntity> carsLoadScanPackageList = new ArrayList<>();
private List<TrunklineCarsUnloadScanEntity> carsUnloadScanPackageList = new ArrayList<>();
private List<LoadZeroListVO> zeroList = new ArrayList<>();
private List<UnloadZeroVO> unloadZeroList = new ArrayList<>();
private BigDecimal nowTransportCost;
private BigDecimal oilCost;

18
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/UnloadZeroVO.java

@ -0,0 +1,18 @@
package com.logpm.trunkline.vo;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@Data
public class UnloadZeroVO implements Serializable {
private String waybillNo;//运单号
private Integer loadingNum;//装车数量
private Integer unloadNum;//卸车件数
private List<ProductUnloadInfoVO> productUnloadInfoList = new ArrayList<>();
}

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

@ -62,4 +62,9 @@ public interface IWarehouseTrayTypeClient {
@GetMapping(API_PREFIX+"/findAllGoodsByTrayCodeAndWarehouseId")
List<JSONObject> findAllGoodsByTrayCodeAndWarehouseId(@RequestParam String trayCode, @RequestParam Long warehouseId);
@GetMapping(API_PREFIX+"/deleteZeroOrderByTrayCode")
void deleteZeroOrderByTrayCode(@RequestParam String orderCode, @RequestParam String palletCode, @RequestParam Long wid);
@GetMapping(API_PREFIX+"/changeTrayWarehouseInfo")
void changeTrayWarehouseInfo(@RequestParam String trayCode, @RequestParam Long warehouseId);
}

3
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataWarehouseClient.java

@ -179,6 +179,9 @@ public class BasicdataWarehouseClient implements IBasicdataWarehouseClient {
JSONObject jsonObject = new JSONObject();
jsonObject.put("warehouseId",warehouseEntity.getId());
jsonObject.put("warehouseName",warehouseEntity.getName());
jsonObject.put("linkMan",warehouseEntity.getLinkman());
jsonObject.put("linkPhone",warehouseEntity.getContactNumber());
jsonObject.put("linkAddress",warehouseEntity.getWarehouseAddress());
list.add(jsonObject);
}
return list;

112
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/CarsLoadApiController.java

@ -45,7 +45,7 @@ public class CarsLoadApiController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"仓库信息为空");
}
@ -93,7 +93,7 @@ public class CarsLoadApiController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"仓库信息为空");
}
@ -142,7 +142,7 @@ public class CarsLoadApiController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"仓库信息为空");
}
@ -178,7 +178,7 @@ public class CarsLoadApiController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"仓库信息为空");
}
@ -217,7 +217,7 @@ public class CarsLoadApiController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"仓库信息为空");
}
@ -252,7 +252,7 @@ public class CarsLoadApiController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"仓库信息为空");
}
@ -288,7 +288,7 @@ public class CarsLoadApiController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (!Objects.isNull(myCurrentWarehouse)) {
if (Objects.isNull(myCurrentWarehouse)) {
log.warn(method + "仓库信息为空 myCurrentWarehouse={}", myCurrentWarehouse);
return R.fail(405, "仓库信息为空");
}
@ -337,7 +337,7 @@ public class CarsLoadApiController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"仓库信息为空");
}
@ -379,7 +379,7 @@ public class CarsLoadApiController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"仓库信息为空");
}
@ -412,32 +412,6 @@ public class CarsLoadApiController {
@ResponseBody
@PostMapping("/arriveUnloadPageList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "到车列表", notes = "传入loadCarsDTO")
public R arriveUnloadPageList(@RequestBody LoadCarsDTO loadCarsDTO) {
String method = "############arriveUnloadPageList: ";
log.info(method + "请求参数{}", loadCarsDTO);
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"仓库信息为空");
}
loadCarsDTO.setWarehouseId(myCurrentWarehouse.getId());
return carsLoadService.arriveUnloadPageList(loadCarsDTO);
}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,"系统异常");
}
}
@ResponseBody
@ -452,7 +426,7 @@ public class CarsLoadApiController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"仓库信息为空");
}
@ -486,7 +460,7 @@ public class CarsLoadApiController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"仓库信息为空");
}
@ -501,7 +475,7 @@ public class CarsLoadApiController {
}
return carsLoadService.unloadPackage(loadId,orderPackageCode,myCurrentWarehouse.getId());
return carsLoadService.unloadPackage(loadId,orderPackageCode,myCurrentWarehouse.getId(),1);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
@ -526,7 +500,7 @@ public class CarsLoadApiController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"仓库信息为空");
}
@ -545,7 +519,44 @@ public class CarsLoadApiController {
return R.fail(405,"零担品类为空");
}
return carsLoadService.unloadZero(loadId,waybillNo,productInfoList,myCurrentWarehouse.getId(),null);
return carsLoadService.unloadZero(loadId,waybillNo,productInfoList,myCurrentWarehouse.getId(),1);
}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,"系统异常");
}
}
@ResponseBody
@PostMapping("/findUnloadTrayGoodsList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询托盘装车了哪些货物", notes = "传入loadCarsDTO")
public R findUnloadTrayGoodsList(@RequestBody LoadCarsDTO loadCarsDTO) {
String method = "############findUnloadTrayGoodsList: ";
log.info(method + "请求参数{}", loadCarsDTO);
Long loadId = loadCarsDTO.getLoadId();
String trayCode = loadCarsDTO.getTrayCode();
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"仓库信息为空");
}
loadCarsDTO.setWarehouseId(myCurrentWarehouse.getId());
if(Objects.isNull(loadId)){
log.warn(method+"配载计划id为空 loadId={}",loadId);
return R.fail(405,"配载计划id为空");
}
if(StringUtil.isBlank(trayCode)){
log.warn(method+"托盘码为空 trayCode={}",trayCode);
return R.fail(405,"托盘码为空");
}
return carsLoadService.findUnloadTrayGoodsList(loadId,trayCode,myCurrentWarehouse.getId());
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
@ -559,18 +570,17 @@ public class CarsLoadApiController {
@ResponseBody
@PostMapping("/unloadTray")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "卸车托盘", notes = "传入loadCarsDTO")
@ApiOperation(value = "托盘卸车", notes = "传入loadCarsDTO")
public R unloadTray(@RequestBody LoadCarsDTO loadCarsDTO) {
String method = "############unloadTray: ";
log.info(method + "请求参数{}", loadCarsDTO);
Long loadId = loadCarsDTO.getLoadId();
String waybillNo = loadCarsDTO.getWaybillNo();
List<ProductInfoDTO> productInfoList = loadCarsDTO.getProductInfoList();
String trayCode = loadCarsDTO.getTrayCode();
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"仓库信息为空");
}
@ -579,17 +589,11 @@ public class CarsLoadApiController {
log.warn(method+"配载计划id为空 loadId={}",loadId);
return R.fail(405,"配载计划id为空");
}
if(StringUtil.isBlank(waybillNo)){
log.warn(method+"运单号为空 waybillNo={}",waybillNo);
return R.fail(405,"运单号为空");
}
if(productInfoList.isEmpty()){
log.warn(method+"零担品类为空 waybillNo={}",waybillNo);
return R.fail(405,"零担品类为空");
if(StringUtil.isBlank(trayCode)){
log.warn(method+"托盘码为空 trayCode={}",trayCode);
return R.fail(405,"托盘码为空");
}
return carsLoadService.unloadZero(loadId,waybillNo,productInfoList,myCurrentWarehouse.getId(),null);
return carsLoadService.unloadTray(loadId,trayCode,myCurrentWarehouse.getId());
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);

86
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/TripartiteTransferApiController.java

@ -0,0 +1,86 @@
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.LoadCarsDTO;
import com.logpm.trunkline.service.ITrunklineCarsLoadService;
import com.logpm.trunkline.vo.TripartiteTransferVO;
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/tripartiteTransfer")
@Api(value = "三方中转控制类", tags = "三方中转接口")
public class TripartiteTransferApiController {
private final IBasicdataWarehouseClient warehouseClient;
private final ITrunklineCarsLoadService carsLoadService;
@ResponseBody
@PostMapping("/transferLoadPageList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "三方中转装车列表", notes = "传入loadCarsDTO")
public R tripartiteTransferPageList(@RequestBody LoadCarsDTO loadCarsDTO) {
String method = "############tripartiteTransferPageList: ";
log.info(method + "请求参数{}", loadCarsDTO);
Integer type = loadCarsDTO.getType();
Integer pageNum = loadCarsDTO.getPageNum();
Integer pageSize = loadCarsDTO.getPageSize();
String startDate = loadCarsDTO.getStartDate();
String endDate = loadCarsDTO.getEndDate();
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"仓库信息为空");
}
loadCarsDTO.setWarehouseId(myCurrentWarehouse.getId());
if(Objects.isNull(pageNum)){
loadCarsDTO.setPageNum(1);
}
if(Objects.isNull(pageSize)){
loadCarsDTO.setPageSize(10);
}
if(StringUtil.isBlank(startDate)){
log.warn(method+"开始时间为空 startDate={}",startDate);
return R.fail(405,"开始时间为空");
}
if(StringUtil.isBlank(endDate)){
log.warn(method+"结束时间为空 endDate={}",endDate);
return R.fail(405,"结束时间为空");
}
if(Objects.isNull(type)){
log.warn(method+"查询类型为空 type={}",type);
return R.fail(405,"查询类型为空");
}
IPage<TripartiteTransferVO> tripartiteTransferVOIPage = carsLoadService.tripartiteTransferPageList(loadCarsDTO);
return R.data(tripartiteTransferVOIPage);
}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,"系统异常");
}
}
}

121
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java

@ -4,8 +4,12 @@ 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.*;
import com.logpm.trunkline.dto.LoadCarsDTO;
import com.logpm.trunkline.dto.TrunklineCarsLoadDTO;
import com.logpm.trunkline.dto.TrunklineCarsLoadLineDTO;
import com.logpm.trunkline.dto.TrunklineCarsOrderDTO;
import com.logpm.trunkline.service.ITrunklineCarsLoadService;
import com.logpm.trunkline.vo.TrunklineCarsLoadLineVO;
import com.logpm.trunkline.vo.TrunklineCarsLoadVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -93,7 +97,7 @@ public class CarsLoadController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(400,"仓库信息为空");
}
@ -123,7 +127,7 @@ public class CarsLoadController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(400,"仓库信息为空");
}
@ -158,7 +162,7 @@ public class CarsLoadController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(400,"仓库信息为空");
}
@ -207,7 +211,7 @@ public class CarsLoadController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(400,"仓库信息为空");
}
@ -241,7 +245,7 @@ public class CarsLoadController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(400,"仓库信息为空");
}
@ -279,7 +283,7 @@ public class CarsLoadController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(400,"仓库信息为空");
}
@ -346,7 +350,7 @@ public class CarsLoadController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(400,"仓库信息为空");
}
@ -387,7 +391,7 @@ public class CarsLoadController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(400,"仓库信息为空");
}
@ -421,7 +425,7 @@ public class CarsLoadController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(400,"仓库信息为空");
}
@ -455,7 +459,7 @@ public class CarsLoadController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(400,"仓库信息为空");
}
@ -491,7 +495,7 @@ public class CarsLoadController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(400,"仓库信息为空");
}
@ -566,20 +570,20 @@ public class CarsLoadController {
log.warn(method+"分摊方式为空 chargeType={}",chargeType);
throw new CustomerException(400,"分摊方式为空");
}
if(!"2".equals(chargeType) && !"3".equals(chargeType) && !"4".equals(chargeType)){
if(!"1".equals(chargeType) && !"2".equals(chargeType) && !"3".equals(chargeType)){
log.warn(method+"分摊方式值不正确 chargeType={}",chargeType);
throw new CustomerException(400,"分摊方式值不正确");
}
Long carrierId = carsLoadDTO.getCarrierId();
if(Objects.isNull(carrierId)){
log.warn(method+"承运商id为空 carrierId={}",carrierId);
throw new CustomerException(400,"承运商id为空");
}
String carrierName = carsLoadDTO.getCarrierName();
if(StringUtil.isBlank(carrierName)){
log.warn(method+"承运商名称为空 carrierName={}",carrierName);
throw new CustomerException(400,"承运商名称为空");
}
// Long carrierId = carsLoadDTO.getCarrierId();
// if(Objects.isNull(carrierId)){
// log.warn(method+"承运商id为空 carrierId={}",carrierId);
// throw new CustomerException(400,"承运商id为空");
// }
// String carrierName = carsLoadDTO.getCarrierName();
// if(StringUtil.isBlank(carrierName)){
// log.warn(method+"承运商名称为空 carrierName={}",carrierName);
// throw new CustomerException(400,"承运商名称为空");
// }
String carNumber = carsLoadDTO.getCarNumber();
if(StringUtil.isBlank(carNumber)){
log.warn(method+"车牌号为空 carNumber={}",carNumber);
@ -654,10 +658,10 @@ public class CarsLoadController {
throw new CustomerException(400,"排序为空");
}
List<TrunklineCarsOrderDTO> lineCarsOrderList = carsLoadLineDTO.getLineCarsOrderList();
if (lineCarsOrderList.size() <= 0){
log.warn(method+"节点关联订单不正确 lineCarsOrderList.size()={}",lineCarsOrderList.size());
throw new CustomerException(400,"节点关联订单不正确");
}
// if (lineCarsOrderList.size() <= 0){
// log.warn(method+"节点关联订单不正确 lineCarsOrderList.size()={}",lineCarsOrderList.size());
// throw new CustomerException(400,"节点关联订单不正确");
// }
for (TrunklineCarsOrderDTO carsOrderDTO:lineCarsOrderList){
String orderCode = carsOrderDTO.getOrderCode();
if(StringUtil.isBlank(orderCode)){
@ -697,7 +701,7 @@ public class CarsLoadController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"仓库信息为空");
}
@ -746,7 +750,7 @@ public class CarsLoadController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"仓库信息为空");
}
@ -782,7 +786,7 @@ public class CarsLoadController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"仓库信息为空");
}
@ -827,7 +831,7 @@ public class CarsLoadController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"仓库信息为空");
}
@ -873,7 +877,7 @@ public class CarsLoadController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"仓库信息为空");
}
@ -920,7 +924,7 @@ public class CarsLoadController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (!Objects.isNull(myCurrentWarehouse)) {
if (Objects.isNull(myCurrentWarehouse)) {
log.warn(method + "仓库信息为空 myCurrentWarehouse={}", myCurrentWarehouse);
return R.fail(405, "仓库信息为空");
}
@ -998,4 +1002,55 @@ public class CarsLoadController {
}
@ResponseBody
@PostMapping("/findLoadFeeByNodeId")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询配载计划节点费用信息", notes = "传入loadCarsDTO")
public R findLoadFeeByNodeId(@RequestBody LoadCarsDTO loadCarsDTO) {
String method = "############findLoadFeeByNodeId: ";
log.info(method + "请求参数{}", loadCarsDTO);
Long loadId = loadCarsDTO.getLoadId();
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(myCurrentWarehouse)) {
log.warn(method + "仓库信息为空 myCurrentWarehouse={}", myCurrentWarehouse);
return R.fail(405, "仓库信息为空");
}
return carsLoadService.findLoadFeeByNodeId(loadId,myCurrentWarehouse.getId());
}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: 系统异常");
}
}
@ResponseBody
@PostMapping("/updateLoadFeeByNodeId")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "更新配载计划节点费用信息", notes = "传入loadCarsDTO")
public R updateLoadFeeByNodeId(@RequestBody TrunklineCarsLoadLineVO carsLoadLineVO) {
String method = "############updateLoadFeeByNodeId: ";
log.info(method + "请求参数{}", carsLoadLineVO);
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(myCurrentWarehouse)) {
log.warn(method + "仓库信息为空 myCurrentWarehouse={}", myCurrentWarehouse);
return R.fail(405, "仓库信息为空");
}
return carsLoadService.updateLoadFeeByNodeId(carsLoadLineVO);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error("############updateLoadFeeByNodeId: 系统异常",e);
return R.fail(500,"系统异常");
}
}
}

14
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/TripartiteTransferController.java

@ -74,7 +74,7 @@ public class TripartiteTransferController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(400,"仓库信息为空");
}
@ -188,7 +188,7 @@ public class TripartiteTransferController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(400,"仓库信息为空");
}
@ -220,7 +220,7 @@ public class TripartiteTransferController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(400,"仓库信息为空");
}
@ -252,7 +252,7 @@ public class TripartiteTransferController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(400,"仓库信息为空");
}
@ -284,7 +284,7 @@ public class TripartiteTransferController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(400,"仓库信息为空");
}
@ -317,7 +317,7 @@ public class TripartiteTransferController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(400,"仓库信息为空");
}
@ -354,7 +354,7 @@ public class TripartiteTransferController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(400,"仓库信息为空");
}

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

@ -5,6 +5,7 @@ import com.logpm.trunkline.entity.TrunklineCarsLoadLineEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
@Mapper
@ -19,4 +20,6 @@ public interface TrunklineCarsLoadLineMapper extends BaseMapper<TrunklineCarsLoa
void updatePlanLoadingNumberByLoadLineId(@Param("planNum") Integer planNum, @Param("loadLineId") Long loadLineId);
List<TrunklineCarsLoadLineEntity> findListMoreSortByLoadId(@Param("loadId") Long loadId, @Param("sort") Integer sort);
BigDecimal getAllNodeFee(@Param("loadId") Long loadId);
}

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

@ -40,4 +40,12 @@
and sort > #{sort}
</select>
<select id="getAllNodeFee" resultType="java.math.BigDecimal">
select sum(IFNULL(now_transport_cost,0))+sum(IFNULL(oil_cost,0))+sum(IFNULL(back_transport_cost,0))+sum(IFNULL(reach_transport_cost,0))+sum(IFNULL(whole_car_info_cost,0))+sum(IFNULL(whole_car_insurance_cost,0))+sum(IFNULL(whole_car_ground_cost,0))+sum(IFNULL(hair_whole_cost,0))+sum(IFNULL(hair_whole_other_cost,0))+sum(IFNULL(unload_cost,0))+sum(IFNULL(unload_other_cost,0))+sum(IFNULL(fuel,0))+sum(IFNULL(toll_fee,0))
from logpm_trunkline_cars_load_line
where load_id = #{loadId}
and is_deleted = 0
</select>
</mapper>

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

@ -26,4 +26,5 @@ public interface TrunklineCarsLoadMapper extends BaseMapper<TrunklineCarsLoadEnt
IPage<TrunklineCarsLoadVO> carsLoadPageList(IPage<Object> page, @Param("param") LoadCarsDTO loadCarsDTO);
IPage<TrunklineCarsLoadVO> arriveUnloadPageList(IPage<Object> page, @Param("param") LoadCarsDTO loadCarsDTO);
}

20
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml

@ -115,7 +115,6 @@
<select id="findAllOrderList" resultType="com.logpm.trunkline.vo.CarsLoadAllOrderVO">
select ldsa.order_code orderCode,
ldsa.total_number totalNum,
ldpl.waybill_number waybillNo,
lww.create_time createTime,
lww.destination destination,
@ -123,7 +122,7 @@
lww.shipper shipper,
lww.consignee consignee,
lww.consignee_name consigneeName,
lww.goods_name consigneeName,
lww.goods_name goodsName,
ltwo.total_number totalNum,
lww.total_weight totalWeight,
lww.total_volume totalVolume,
@ -131,7 +130,7 @@
lww.remark remark,
lww.waybill_type type,
IFNULL(TRUNCATE(lww.total_freight/lww.total_count,4),0) price,
IFNULL(TRUNCATE(lww.total_freight/lww.total_count,4)*count(ldpl.id) freight,
IFNULL(TRUNCATE(lww.total_freight/lww.total_count,4),0)*count(ldpl.id) freight,
count(ldpl.id) stockNum
from logpm_distribution_stock_article ldsa
left join logpm_distribution_parcel_list ldpl on ldsa.order_code = ldpl.order_code
@ -140,8 +139,14 @@
where ldsa.is_deleted = 0
and ldpl.order_package_status in ('20','30')
and ldpl.is_deleted = 0
<if test="param.ordercodes != null">
and concat(ldsa.order_code,',',ldpl.waybill_number) not in
<foreach collection="param.ordercodes" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.warehouseId != null" >
and ldsa.warehoud_id = #{param.warehouseId}
and ldsa.warehouse_id = #{param.warehouseId}
and ldpl.warehouse_id = #{param.warehouseId}
</if>
group by ldsa.order_code,
@ -161,7 +166,7 @@
lww.customer_train,
lww.remark,
lww.waybill_type
HAVING count(count(ldpl.id)) &gt; 0
HAVING count(ldpl.id) &gt; 0
</select>
<select id="findUseOrderList" resultType="com.logpm.trunkline.vo.CarsLoadAllOrderVO">
@ -182,7 +187,7 @@
ltco.plan_num planNum,
ltco.real_num realNum,
IFNULL(TRUNCATE(lww.total_freight/lww.total_count,4),0) price,
IFNULL(TRUNCATE(lww.total_freight/lww.total_count,4)*count(ldpl.id) freight
IFNULL(TRUNCATE(lww.total_freight/lww.total_count,4),0)*count(ldpl.id) freight
from logpm_trunkline_cars_order ltco
left join logpm_warehouse_waybill lww on lww.waybill_no = ltco.waybill_no
left join logpm_distribution_parcel_list ldpl on ltco.order_code = ldpl.order_code and ldpl.waybill_number = ltco.waybill_no
@ -246,6 +251,7 @@
select *
from logpm_trunkline_cars_load ltcl
where ltcl.is_deleted = 0
and ltcl.load_type != '4'
and ltcl.start_warehouse_id = #{param.warehouseId}
<if test="param.startDate != null and param.startDate != ''">
and ltcl.create_time &gt;= #{param.startDate}
@ -268,6 +274,8 @@
left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcl.id
where ltcl.is_deleted = 0
and ltcll.node_id = #{param.warehouseId}
and ltcll.sort != 1
and ltcl.load_type != '4'
<if test="param.startDate != null and param.startDate != ''">
and ltcl.start_time &gt;= #{param.startDate}
</if>

12
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java

@ -1,10 +1,14 @@
package com.logpm.trunkline.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.trunkline.dto.ProductInfoDTO;
import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity;
import com.logpm.trunkline.vo.ProductUnloadInfoVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface TrunklineCarsLoadScanMapper extends BaseMapper<TrunklineCarsLoadScanEntity> {
@ -18,4 +22,12 @@ public interface TrunklineCarsLoadScanMapper extends BaseMapper<TrunklineCarsLoa
Integer findAbnormalNumByLoadIdAndNodeId(@Param("loadId") Long loadId, @Param("nodeId") Long nodeId);
Integer findNumByLoadIdAndNodeIdAndOrderCodeAndWaybillNo(@Param("loadId") Long loadId, @Param("nodeId") Long nodeId, @Param("orderCode") String orderCode, @Param("waybillNo") String waybillNo);
List<ProductUnloadInfoVO> findListByLoadIdAndWaybillNo(@Param("loadId") Long loadId, @Param("waybillNo") String waybillNo);
TrunklineCarsLoadScanEntity findEntityByLoadIdAndOrderPackageCode(@Param("loadId") Long loadId, @Param("orderPackageCode") String orderPackageCode);
List<TrunklineCarsLoadScanEntity> findUnloadTrayGoodsList(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId, @Param("trayCode") String trayCode);
List<ProductInfoDTO> findProductInfoList(@Param("loadId") Long loadId, @Param("trayCode") String trayCode, @Param("waybillNo") String waybillNo);
}

38
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml

@ -39,4 +39,42 @@
and waybill_no = #{waybillNo}
</select>
<select id="findListByLoadIdAndWaybillNo" resultType="com.logpm.trunkline.vo.ProductUnloadInfoVO">
select ltcls.scan_code productName,
IFNULL(ltcls.num,0) loadingNum,
IFNULL(ltcus.num,0) unloadNum
from logpm_trunkline_cars_load_scan ltcls
left join logpm_trunkline_cars_unload_scan ltcus on ltcus.load_id = ltcls.load_id and ltcus.waybill_no = ltcls.waybill_no
where ltcls.type = 2
and ltcus.type = 2
and ltcls.load_id = #{loadId}
and ltcls.waybill_no = #{waybillNo}
</select>
<select id="findEntityByLoadIdAndOrderPackageCode" resultType="com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity">
select *
from logpm_trunkline_cars_load_scan
where scan_code = #{orderPackageCode}
and load_id = #{loadId}
</select>
<select id="findUnloadTrayGoodsList" resultType="com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity">
select ltcls.*
from logpm_trunkline_cars_order ltco
left join logpm_trunkline_cars_load_scan ltcls on ltcls.order_code = ltco.order_code and ltcls.load_id = ltco.load_id
where ltco.load_id = #{loadId}
and ltco.final_node_id = #{warehouseId}
and ltcls.tray_code = #{trayCode}
</select>
<select id="findProductInfoList" resultType="com.logpm.trunkline.dto.ProductInfoDTO">
select scan_code productName,
num enterNum
from logpm_trunkline_cars_load_scan
where load_id = #{loadId}
and tray_code = #{trayCode}
and waybill_no = #{waybillNo}
</select>
</mapper>

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

@ -7,6 +7,7 @@ import com.logpm.trunkline.entity.TrunklineCarsOrderEntity;
import com.logpm.trunkline.vo.CarsLoadAllOrderVO;
import com.logpm.trunkline.vo.LoadZeroListVO;
import com.logpm.trunkline.vo.NodeNumDataVO;
import com.logpm.trunkline.vo.UnloadZeroVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -22,4 +23,6 @@ public interface TrunklineCarsOrderMapper extends BaseMapper<TrunklineCarsOrderE
List<LoadZeroListVO> findZeroList(@Param("loadId") Long loadId, @Param("nodeId") Long warehouseId);
List<UnloadZeroVO> findUnloadZeroList(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId);
}

11
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml

@ -63,4 +63,15 @@
ltco.plan_num
</select>
<select id="findUnloadZeroList" resultType="com.logpm.trunkline.vo.UnloadZeroVO">
select waybill_no waybillNo,
real_num loadingNum,
unload_num unloadNum
from logpm_trunkline_cars_order
where is_deleted = 0,
and load_id = #{loadId}
and final_node_id = #{warehouseId}
and `type` = 2
</select>
</mapper>

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

@ -13,5 +13,7 @@ public interface TrunklineCarsUnloadScanMapper extends BaseMapper<TrunklineCarsU
Integer findNumByLoadIdAndNodeId(@Param("loadId") Long loadId, @Param("nodeId") Long nodeId);
Integer findAbnormalNumByLoadIdAndNodeId(@Param("loadId") Long loadId, @Param("nodeId") Long nodeIdv);
Integer findAbnormalNumByLoadIdAndNodeId(@Param("loadId") Long loadId, @Param("nodeId") Long nodeId);
Integer findNumByLoadIdAndNodeIdAndOrderCodeAndWaybillNo(@Param("loadId") Long loadId, @Param("nodeId") Long nodeId, @Param("orderCode") String orderCode, @Param("waybillNo") String waybillNo);
}

13
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsUnloadScanMapper.xml

@ -19,15 +19,24 @@
select IFNULL(sum(num),0)
from logpm_trunkline_cars_unload_scan
where load_id = #{loadId}
and node_id = #{nodeId}
and warehouse_id = #{nodeId}
</select>
<select id="findAbnormalNumByLoadIdAndNodeId" resultType="int">
select IFNULL(sum(num),0)
from logpm_trunkline_cars_unload_scan
where load_id = #{loadId}
and node_id = #{nodeId}
and warehouse_id = #{nodeId}
and is_abnormal = 1
</select>
<select id="findNumByLoadIdAndNodeIdAndOrderCodeAndWaybillNo" resultType="int">
select IFNULL(sum(num),0)
from logpm_trunkline_cars_unload_scan
where load_id = #{loadId}
and warehouse_id = #{nodeId}
and order_code = #{orderCode}
and waybill_no = #{waybillNo}
</select>
</mapper>

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

@ -3,6 +3,7 @@ package com.logpm.trunkline.service;
import com.logpm.trunkline.entity.TrunklineCarsLoadLineEntity;
import org.springblade.core.mp.base.BaseService;
import java.math.BigDecimal;
import java.util.List;
public interface ITrunklineCarsLoadLineService extends BaseService<TrunklineCarsLoadLineEntity> {
@ -22,4 +23,6 @@ public interface ITrunklineCarsLoadLineService extends BaseService<TrunklineCars
List<TrunklineCarsLoadLineEntity> findListMoreSortByLoadId(Long loadId, Integer sort);
List<TrunklineCarsLoadLineEntity> findListByLoadId(Long loadId);
BigDecimal getAllNodeFee(Long loadId);
}

13
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java

@ -1,8 +1,12 @@
package com.logpm.trunkline.service;
import com.logpm.trunkline.dto.ProductInfoDTO;
import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity;
import com.logpm.trunkline.vo.ProductUnloadInfoVO;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
public interface ITrunklineCarsLoadScanService extends BaseService<TrunklineCarsLoadScanEntity> {
Integer findNumByLoadId(Long loadId);
@ -14,4 +18,13 @@ public interface ITrunklineCarsLoadScanService extends BaseService<TrunklineCars
Integer findAbnormalNumByLoadIdAndNodeId(Long loadId, Long nodeId);
Integer findNumByLoadIdAndNodeIdAndOrderCodeAndWaybillNo(Long loadId, Long nodeId, String orderCode, String waybillNo);
List<ProductUnloadInfoVO> findListByLoadIdAndWaybillNo(Long loadId, String waybillNo);
TrunklineCarsLoadScanEntity findEntityByLoadIdAndOrderPackageCode(Long loadId, String orderPackageCode);
List<TrunklineCarsLoadScanEntity> findUnloadTrayGoodsList(Long loadId, Long warehouseId, String trayCode);
List<ProductInfoDTO> findProductInfoList(Long loadId, String trayCode, String waybillNo);
}

15
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java

@ -6,6 +6,7 @@ import com.logpm.trunkline.dto.ProductInfoDTO;
import com.logpm.trunkline.dto.TrunklineCarsLoadDTO;
import com.logpm.trunkline.entity.TrunklineCarsLoadEntity;
import com.logpm.trunkline.vo.TripartiteTransferVO;
import com.logpm.trunkline.vo.TrunklineCarsLoadLineVO;
import com.logpm.trunkline.vo.TrunklineCarsLoadVO;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
@ -91,9 +92,9 @@ public interface ITrunklineCarsLoadService extends BaseService<TrunklineCarsLoad
R arriveUnloadPageList(LoadCarsDTO loadCarsDTO);
R unloadPackage(Long loadId, String orderPackageCode, Long warehouseId);
R unloadPackage(Long loadId, String orderPackageCode, Long warehouseId,Integer unbindTray);
R unloadZero(Long loadId, String waybillNo,List<ProductInfoDTO> productInfoList, Long warehouseId,String trayCode);
R unloadZero(Long loadId, String waybillNo,List<ProductInfoDTO> productInfoList, Long warehouseId,Integer unbindTray);
R findLoadScanWaybillDetailList(Long loadId, String waybillNo, Long warehouseId);
@ -102,4 +103,14 @@ public interface ITrunklineCarsLoadService extends BaseService<TrunklineCarsLoad
R findWarehouseList(String warehouseName);
R findLoadInitData(Long warehouseId);
R findUnloadTrayGoodsList(Long loadId, String trayCode,Long warehouseId);
R unloadTray(Long loadId, String trayCode, Long warehouseId);
R transferLoadPageList(LoadCarsDTO loadCarsDTO);
R findLoadFeeByNodeId(Long loadId,Long warehouseId);
R updateLoadFeeByNodeId(TrunklineCarsLoadLineVO carsLoadLineVO);
}

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

@ -6,6 +6,7 @@ import com.logpm.trunkline.entity.TrunklineCarsOrderEntity;
import com.logpm.trunkline.vo.CarsLoadAllOrderVO;
import com.logpm.trunkline.vo.LoadZeroListVO;
import com.logpm.trunkline.vo.NodeNumDataVO;
import com.logpm.trunkline.vo.UnloadZeroVO;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
@ -20,4 +21,6 @@ public interface ITrunklineCarsOrderService extends BaseService<TrunklineCarsOrd
List<TrunklineCarsOrderEntity> findListByLoadIdAndNodeId(Long loadId, Long nodeId);
List<LoadZeroListVO> findZeroList(Long loadId, Long warehouseId);
List<UnloadZeroVO> findUnloadZeroList(Long loadId, Long warehouseId);
}

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsUnloadScanService.java

@ -11,4 +11,6 @@ public interface ITrunklineCarsUnloadScanService extends BaseService<TrunklineCa
Integer findNumByLoadIdAndNodeId(Long loadId, Long nodeId);
Integer findAbnormalNumByLoadIdAndNodeId(Long loadId, Long nodeId);
Integer findNumByLoadIdAndNodeIdAndOrderCodeAndWaybillNo(Long loadId, Long nodeId, String orderCode, String waybillNo);
}

6
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadLineServiceImpl.java

@ -9,6 +9,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.List;
@Slf4j
@ -64,4 +65,9 @@ public class TrunklineCarsLoadLineServiceImpl extends BaseServiceImpl<TrunklineC
.eq("load_id",loadId);
return baseMapper.selectList(queryWrapper);
}
@Override
public BigDecimal getAllNodeFee(Long loadId) {
return baseMapper.getAllNodeFee(loadId);
}
}

24
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java

@ -1,13 +1,17 @@
package com.logpm.trunkline.service.impl;
import com.logpm.trunkline.dto.ProductInfoDTO;
import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity;
import com.logpm.trunkline.mapper.TrunklineCarsLoadScanMapper;
import com.logpm.trunkline.service.ITrunklineCarsLoadScanService;
import com.logpm.trunkline.vo.ProductUnloadInfoVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import java.util.List;
@Slf4j
@Service
@AllArgsConstructor
@ -36,4 +40,24 @@ public class TrunklineCarsLoadScanServiceImpl extends BaseServiceImpl<TrunklineC
public Integer findNumByLoadIdAndNodeIdAndOrderCodeAndWaybillNo(Long loadId, Long nodeId, String orderCode, String waybillNo) {
return baseMapper.findNumByLoadIdAndNodeIdAndOrderCodeAndWaybillNo(loadId,nodeId,orderCode,waybillNo);
}
@Override
public List<ProductUnloadInfoVO> findListByLoadIdAndWaybillNo(Long loadId, String waybillNo) {
return baseMapper.findListByLoadIdAndWaybillNo(loadId,waybillNo);
}
@Override
public TrunklineCarsLoadScanEntity findEntityByLoadIdAndOrderPackageCode(Long loadId, String orderPackageCode) {
return baseMapper.findEntityByLoadIdAndOrderPackageCode(loadId,orderPackageCode);
}
@Override
public List<TrunklineCarsLoadScanEntity> findUnloadTrayGoodsList(Long loadId, Long warehouseId, String trayCode) {
return baseMapper.findUnloadTrayGoodsList(loadId,warehouseId,trayCode);
}
@Override
public List<ProductInfoDTO> findProductInfoList(Long loadId, String trayCode, String waybillNo) {
return baseMapper.findProductInfoList(loadId,trayCode,waybillNo);
}
}

207
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -71,7 +71,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
for (TrunklineCarsLoadVO trunklineCarsLoadVO:records){
Long loadId = trunklineCarsLoadVO.getId();
QueryWrapper<TrunklineCarsLoadLineEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id_deleted",0)
queryWrapper.eq("is_deleted",0)
.eq("load_id",loadId);
List<TrunklineCarsLoadLineEntity> list = trunklineCarsLoadLineService.list(queryWrapper);
trunklineCarsLoadVO.setCarsLoadLineList(list);
@ -759,7 +759,6 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Long loadLineId = nodeNumDataVO.getLoadLineId();
Integer planNum = nodeNumDataVO.getPlanNum();
loadPlanNum = loadPlanNum + planNum;
trunklineCarsLoadLineService.updatePlanLoadingNumberByLoadLineId(planNum,loadLineId);
}
@ -794,10 +793,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
String orderCode = carsOrderEntity.getOrderCode();
String waybillNo = carsOrderEntity.getWaybillNo();
Integer orderLoadingNum = trunklineCarsLoadScanService.findNumByLoadIdAndNodeIdAndOrderCodeAndWaybillNo(loadId,nodeId,orderCode,waybillNo);//节点实际装车数量
// Integer orderUnloadingNum = trunklineCarsUnloadScanService.findNumByLoadIdAndNodeId(loadId,nodeId,orderCode,waybillNo);//节点实际卸车数量
Integer orderUnloadingNum = trunklineCarsUnloadScanService.findNumByLoadIdAndNodeIdAndOrderCodeAndWaybillNo(loadId,nodeId,orderCode,waybillNo);//节点实际卸车数量
// Integer orderLoadingAbnormalNum = trunklineCarsLoadScanService.findAbnormalNumByLoadIdAndNodeId(loadId,nodeId,orderCode,waybillNo);//节点实际装车异常数量
// Integer orderUnloadingAbnormalNum = trunklineCarsUnloadScanService.findAbnormalNumByLoadIdAndNodeId(loadId,nodeId,orderCode,waybillNo);//节点实际卸车异常数量
carsOrderEntity.setRealNum(orderLoadingNum);
carsOrderEntity.setUnloadNum(orderUnloadingNum);
trunklineCarsOrderService.updateById(carsOrderEntity);
}
}
@ -1362,6 +1362,13 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.fail(405,"仓库信息不存在");
}
//判断包条是不是已经装车
TrunklineCarsLoadScanEntity isExit = trunklineCarsLoadScanService.findEntityByLoadIdAndOrderPackageCode(loadId,orderPackageCode);
if(!Objects.isNull(isExit)){
log.warn("##################loadingScan: 包件已经装车 orderPackageCode={}",orderPackageCode);
return R.fail(405,"包件已经装车");
}
//判断包条码是不是在库
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, warehouseId);
TrunklineCarsLoadScanEntity carsLoadScanEntity = new TrunklineCarsLoadScanEntity();
@ -1382,8 +1389,36 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setNum(1);
carsLoadScanEntity.setType(1);
if(Objects.isNull(parcelListEntity)){
carsLoadScanEntity.setIsData(0);
carsLoadScanEntity.setIsAbnormal(1);
DistributionParcelListEntity otherParcelListEntity = distributionParcelListClient.findByOrderPackageCodeAndStatus(orderPackageCode);
if(Objects.isNull(otherParcelListEntity)){
carsLoadScanEntity.setIsData(0);
carsLoadScanEntity.setIsAbnormal(1);
}else{
carsLoadScanEntity.setIsData(1);
carsLoadScanEntity.setIsAbnormal(1);
String waybillNumber = otherParcelListEntity.getWaybillNumber();
Long wid = otherParcelListEntity.getWarehouseId();
String orderCode = otherParcelListEntity.getOrderCode();
WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNumber);
if(Objects.isNull(waybillEntity)){
log.warn("##################loadingScan: 运单信息不存在 waybillNumber={}",waybillNumber);
return R.fail(405,"运单信息不存在");
}
carsLoadScanEntity.setWaybillId(waybillEntity.getId());
carsLoadScanEntity.setWaybillNo(waybillEntity.getWaybillNo());
carsLoadScanEntity.setOrderCode(orderCode);
otherParcelListEntity.setOrderPackageStatus("60");
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, wid);
if(Objects.isNull(stockArticleEntity)){
log.warn("##################loadingScan: 订单信息不存在 orderCode={} warehouseId={}",orderCode,warehouseId);
return R.fail(405,"订单信息不存在");
}
stockArticleEntity.setHandQuantity(stockArticleEntity.getHandQuantity()-1);
distributionParcelListClient.update(otherParcelListEntity);
distributionStockArticleClient.saveOrUpdate(stockArticleEntity);
updownTypeClient.downPackageOrDelTray(orderPackageCode,wid);
}
}else{
//有包件所以是有数据的包件扫描
carsLoadScanEntity.setIsData(1);
@ -1428,6 +1463,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
distributionParcelListClient.update(parcelListEntity);
distributionStockArticleClient.saveOrUpdate(stockArticleEntity);
updownTypeClient.downPackageOrDelTray(orderPackageCode,warehouseId);
}
trunklineCarsLoadScanService.save(carsLoadScanEntity);
@ -1612,6 +1648,62 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.data(pageList);
}
@Override
public R transferLoadPageList(LoadCarsDTO loadCarsDTO) {
IPage<Object> page = new Page<>();
page.setCurrent(loadCarsDTO.getPageNum());
page.setSize(loadCarsDTO.getPageSize());
Integer type = loadCarsDTO.getType();
Date start = CommonUtil.getStartByDateStr(loadCarsDTO.getStartDate());
Date end = CommonUtil.getStartByDateStr(loadCarsDTO.getEndDate());
loadCarsDTO.setStartDate(CommonUtil.dateToStringGeneral(start));
loadCarsDTO.setEndDate(CommonUtil.dateToStringGeneral(end));
IPage<TrunklineCarsLoadVO> pageList = baseMapper.carsLoadPageList(page,loadCarsDTO);
return R.data(pageList);
}
@Override
public R findLoadFeeByNodeId(Long loadId,Long warehouseId) {
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if(Objects.isNull(carsLoadEntity)){
log.warn("##################findLoadFeeByNodeId: 配载or三方计划不存在 loadId={}",loadId);
return R.fail(405,"计划不存在");
}
TrunklineCarsLoadLineEntity carsLoadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndNodeId(loadId, warehouseId);
if(Objects.isNull(carsLoadLineEntity)){
log.warn("##################findLoadFeeByNodeId: 节点信息不存在 loadId={} warehouseId={}",loadId,warehouseId);
return R.fail(405,"节点信息不存在");
}
return R.data(carsLoadLineEntity);
}
@Override
public R updateLoadFeeByNodeId(TrunklineCarsLoadLineVO carsLoadLineVO) {
trunklineCarsLoadLineService.updateById(carsLoadLineVO);
Long loadId = carsLoadLineVO.getLoadId();
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if(Objects.isNull(carsLoadEntity)){
log.warn("##########updateLoadFeeByNodeId: 配载计划信息不存在 loadId={}",loadId);
return R.fail(405,"配载计划信息不存在");
}
//重新计算配载计划的费用
BigDecimal countTransportCost = trunklineCarsLoadLineService.getAllNodeFee(loadId);
carsLoadEntity.setCountTransportCost(countTransportCost);
updateById(carsLoadEntity);
return R.success("修改成功");
}
@Override
public R loadingTrayInfo(LoadCarsDTO loadCarsDTO) {
log.info("##############loadingTrayInfo: 查询托盘的货物信息");
@ -1692,7 +1784,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
loadingZero(loadId,warehouseId,waybillNo,trayCode,productInfoList);
}
//TODO 托盘下架
//下架托盘
updownTypeClient.downTray(trayCode,warehouseId);
return R.success("整托装车成功");
}
@ -1858,7 +1951,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
@Override
public R unloadPackage(Long loadId, String orderPackageCode, Long warehouseId) {
public R unloadPackage(Long loadId, String orderPackageCode, Long warehouseId,Integer unbindTray) {
log.info("#############unloadPackage: 卸车包件");
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
@ -2041,13 +2134,16 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
trunklineCarsUnloadScanEntity.setIsAbnormal(0);
trunklineCarsUnloadScanService.save(trunklineCarsUnloadScanEntity);
String trayCode = trunklineCarsUnloadScanEntity.getTrayCode();
Long wid = carsLoadScanEntity.getWarehouseId();//包件装车的节点仓库
if(!StringUtil.isBlank(trayCode)){
//有托盘码
//所有按件卸车需要解绑托盘
//TODO 需要解绑托盘
if(unbindTray == 1){
//需要解绑托盘
updownTypeClient.downPackageOrDelTray(orderPackageCode,wid);
}
}
Long wid = carsLoadScanEntity.getWarehouseId();//包件装车的节点仓库
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, wid);
if(Objects.isNull(parcelListEntity)){
log.warn("##############unloadPackage: 包件信息不存在 orderPackageCode={} wid={}",orderPackageCode,wid);
@ -2132,7 +2228,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
@Override
public R unloadZero(Long loadId, String waybillNo,List<ProductInfoDTO> productInfoList, Long warehouseId,String trayCode) {
public R unloadZero(Long loadId, String waybillNo,List<ProductInfoDTO> productInfoList, Long warehouseId,Integer unbindTray) {
log.info("#############unloadZero: 卸车零担");
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
@ -2153,11 +2249,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.fail(405,"运单信息不存在");
}
BasicdataTrayEntity basicdataTrayEntity = null;
if(!StringUtil.isBlank(trayCode)){
basicdataTrayEntity = basicdataTrayClient.getTrayByTrayCode(trayCode);
}
String trayCode = null;
Integer totalNum = 0;
Long wid = null;
for (ProductInfoDTO productInfoDTO : productInfoList) {
//判断装车数据
String productName = productInfoDTO.getProductName();
@ -2171,6 +2265,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
TrunklineCarsLoadScanEntity one = trunklineCarsLoadScanService.getOne(queryWrapper);
Integer loadNum = 0;
if(!Objects.isNull(one)){
trayCode = one.getTrayCode();
wid = one.getWarehouseId();
loadNum = one.getNum();
}
@ -2190,13 +2286,14 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsUnloadScanEntity.setScanCode(productName);
carsUnloadScanEntity.setScanStatus("2");
carsUnloadScanEntity.setNum(enterNum);
if(!Objects.isNull(basicdataTrayEntity)){
carsUnloadScanEntity.setTrayId(basicdataTrayEntity.getId());
carsUnloadScanEntity.setTrayCode(trayCode);
carsUnloadScanEntity.setTrayName(basicdataTrayEntity.getPalletName());
}
carsUnloadScanEntity.setTrayId(one.getTrayId());
carsUnloadScanEntity.setTrayCode(trayCode);
carsUnloadScanEntity.setTrayName(one.getTrayName());
trunklineCarsUnloadScanService.save(carsUnloadScanEntity);
totalNum = totalNum + enterNum;
//创建对应的订单信息
String orderCode = waybillNo;
DistributionStockArticleEntity newStockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
@ -2242,6 +2339,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
}
if(!StringUtil.isBlank(trayCode)){
if(unbindTray == 1){
String orderCode=waybillNo;
trayTypeClient.deleteZeroOrderByTrayCode(orderCode,trayCode,wid);
}
}
return R.success("卸车成功");
}
@ -2296,7 +2399,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.fail(405,"配载计划信息不存在");
}
//查询已扫描车的包件
//查询已扫描车的包件
QueryWrapper<TrunklineCarsUnloadScanEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("load_id",loadId)
.eq("warehouse_id",warehouseId)
@ -2304,14 +2407,19 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
List<TrunklineCarsUnloadScanEntity> packageList = trunklineCarsUnloadScanService.list(queryWrapper);
//查询已装车的零担
List<LoadZeroListVO> zeroList = trunklineCarsOrderService.findZeroList(loadId,warehouseId);
List<UnloadZeroVO> zeroList = trunklineCarsOrderService.findUnloadZeroList(loadId,warehouseId);
for (UnloadZeroVO unloadZeroVO : zeroList) {
String waybillNo = unloadZeroVO.getWaybillNo();
List<ProductUnloadInfoVO> list = trunklineCarsLoadScanService.findListByLoadIdAndWaybillNo(loadId,waybillNo);
unloadZeroVO.setProductUnloadInfoList(list);
}
TrunklineCarsLoadVO trunklineCarsLoadVO = new TrunklineCarsLoadVO();
BeanUtil.copy(carsLoadEntity,trunklineCarsLoadVO);
trunklineCarsLoadVO.setCarsUnloadScanPackageList(packageList);
trunklineCarsLoadVO.setZeroList(zeroList);
trunklineCarsLoadVO.setUnloadZeroList(zeroList);
return R.data(trunklineCarsLoadVO);
}
@ -2357,5 +2465,58 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.data(map);
}
@Override
public R findUnloadTrayGoodsList(Long loadId, String trayCode,Long warehouseId) {
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if(Objects.isNull(carsLoadEntity)){
log.warn("###############findUnloadTrayGoodsList: 配载计划不存在 loadId={}",loadId);
return R.fail(405,"配载计划不存在");
}
//查询该节点有没有该托盘的信息
List<TrunklineCarsLoadScanEntity> list = trunklineCarsLoadScanService.findUnloadTrayGoodsList(loadId,warehouseId,trayCode);
if(list.isEmpty()){
log.warn("###############findUnloadTrayGoodsList: 托盘上没有该节点的卸货数据 loadId={} trayCode={} warehouseId={]",loadId,trayCode,warehouseId);
return R.fail(405,"托盘上没有该节点的卸货数据");
}
return R.data(list);
}
@Override
public R unloadTray(Long loadId, String trayCode, Long warehouseId) {
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if(Objects.isNull(carsLoadEntity)){
log.warn("###############unloadTray: 配载计划不存在 loadId={}",loadId);
return R.fail(405,"配载计划不存在");
}
//查询该节点有没有该托盘的信息
List<TrunklineCarsLoadScanEntity> list = trunklineCarsLoadScanService.findUnloadTrayGoodsList(loadId,warehouseId,trayCode);
Set<String> set = new TreeSet<>();
for (TrunklineCarsLoadScanEntity carsLoadScanEntity : list) {
Integer type = carsLoadScanEntity.getType();
String scanCode = carsLoadScanEntity.getScanCode();
if(type == 1){
//包件
unloadPackage(loadId,scanCode,warehouseId,0);
}else if(type == 2){
String waybillNo = carsLoadScanEntity.getWaybillNo();
set.add(waybillNo);
}
}
//零担处理
for (String waybillNo:set){
List<ProductInfoDTO> productInfoList = trunklineCarsLoadScanService.findProductInfoList(loadId,trayCode,waybillNo);
unloadZero(loadId,waybillNo,productInfoList,warehouseId,0);
}
//处理托盘的入库和货物的入库
trayTypeClient.changeTrayWarehouseInfo(trayCode,warehouseId);
return R.success("卸车成功");
}
}

6
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsOrderEntityServiceImpl.java

@ -8,6 +8,7 @@ import com.logpm.trunkline.service.ITrunklineCarsOrderService;
import com.logpm.trunkline.vo.CarsLoadAllOrderVO;
import com.logpm.trunkline.vo.LoadZeroListVO;
import com.logpm.trunkline.vo.NodeNumDataVO;
import com.logpm.trunkline.vo.UnloadZeroVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
@ -43,4 +44,9 @@ public class TrunklineCarsOrderEntityServiceImpl extends BaseServiceImpl<Trunkli
public List<LoadZeroListVO> findZeroList(Long loadId, Long warehouseId) {
return baseMapper.findZeroList(loadId,warehouseId);
}
@Override
public List<UnloadZeroVO> findUnloadZeroList(Long loadId, Long warehouseId) {
return baseMapper.findUnloadZeroList(loadId, warehouseId);
}
}

5
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsUnloadScanServiceImpl.java

@ -31,4 +31,9 @@ public class TrunklineCarsUnloadScanServiceImpl extends BaseServiceImpl<Trunklin
public Integer findAbnormalNumByLoadIdAndNodeId(Long loadId, Long nodeId) {
return baseMapper.findAbnormalNumByLoadIdAndNodeId(loadId,nodeId);
}
@Override
public Integer findNumByLoadIdAndNodeIdAndOrderCodeAndWaybillNo(Long loadId, Long nodeId, String orderCode, String waybillNo) {
return baseMapper.findNumByLoadIdAndNodeIdAndOrderCodeAndWaybillNo(loadId,nodeId,orderCode,waybillNo);
}
}

10
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseTrayTypeClient.java

@ -79,5 +79,15 @@ public class WarehouseTrayTypeClient implements IWarehouseTrayTypeClient {
return warehouseTrayTypeService.findAllGoodsByTrayCodeAndWarehouseId(trayCode,warehouseId);
}
@Override
public void deleteZeroOrderByTrayCode(String orderCode, String palletCode, Long wid) {
warehouseTrayTypeService.deleteZeroOrderByTrayCode(orderCode,palletCode,wid);
}
@Override
public void changeTrayWarehouseInfo(String trayCode, Long warehouseId) {
warehouseTrayTypeService.changeTrayWarehouseInfo(trayCode,warehouseId);
}
}

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

@ -57,4 +57,6 @@ public interface WarehouseTrayGoodsMapper extends BaseMapper<WarehouseTrayGoodsE
Integer getNumByZation(@Param("id")Long id);
Integer SumByTrayId(@Param("id") Long trayId);
void updeteWarehouseIdByTrayTypeId(@Param("trayTypeId") Long trayTypeId, @Param("warehouseId") Long warehouseId);
}

7
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseTrayGoodsMapper.xml

@ -319,4 +319,11 @@
SELECT sum(lwtg.num) FROM logpm_warehouse_tray_goods lwtg where lwtg.is_deleted =0 and lwtg.tray_id = #{id} GROUP BY lwtg.tray_id
</select>
<update id="updeteWarehouseIdByTrayTypeId">
update logpm_warehouse_tray_goods
set warehouse_id = #{warehouseId}
where tray_type_id = #{trayTypeId}
</update>
</mapper>

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

@ -83,4 +83,6 @@ public interface IWarehouseTrayGoodsService extends BaseService<WarehouseTrayGoo
List<PositionVO> getTrayGoodsByStockNoAllocationId(Long marketId, String materialCode, String incomingBatch,Long warehouseId);
Integer getNumByZation(Long id);
void updeteWarehouseIdByTrayTypeId(Long trayTypeId, Long warehouseId);
}

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

@ -95,4 +95,5 @@ public interface IWarehouseTrayTypeService extends BaseService<WarehouseTrayType
List<JSONObject> findAllGoodsByTrayCodeAndWarehouseId(String trayCode, Long warehouseId);
void changeTrayWarehouseInfo(String trayCode, Long warehouseId);
}

5
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsServiceImpl.java

@ -275,6 +275,11 @@ public class WarehouseTrayGoodsServiceImpl extends BaseServiceImpl<WarehouseTray
return baseMapper.getNumByZation(id);
}
@Override
public void updeteWarehouseIdByTrayTypeId(Long trayTypeId, Long warehouseId) {
baseMapper.updeteWarehouseIdByTrayTypeId(trayTypeId,warehouseId);
}
@Override
public Boolean deleteByMasterId(Long masterId) {
int delete = baseMapper.delete(new QueryWrapper<WarehouseTrayGoodsEntity>().lambda()

16
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

@ -2724,6 +2724,22 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
return ls;
}
@Override
public void changeTrayWarehouseInfo(String trayCode, Long warehouseId) {
QueryWrapper<WarehouseTrayTypeEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("tray_code",trayCode)
.eq("is_deleted",0);
WarehouseTrayTypeEntity trayTypeEntity = baseMapper.selectOne(queryWrapper);
trayTypeEntity.setWarehouseId(warehouseId);
updateById(trayTypeEntity);
Long trayTypeId = trayTypeEntity.getId();
warehouseTrayGoodsService.updeteWarehouseIdByTrayTypeId(trayTypeId,warehouseId);
}
private R moveTrayOrderPackageCode(WarehouseTrayTypeEntity trayTypeEntity, String orderPackageCode) {
Long wid = trayTypeEntity.getWarehouseId();

Loading…
Cancel
Save