Browse Source

1.干线-bug修复,逻辑修改更新

2.补丁-新增修复老系统盘点的包件的状态
chenglong
zhenghaoyu 1 year ago
parent
commit
eb678167ba
  1. 4
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IInventoryDetailClient.java
  2. 2
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/WaybillDetailDTO.java
  3. 3
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceEntity.java
  4. 2
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/UnloadPackageVO.java
  5. 2
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/UnloadScanOrderVO.java
  6. 8
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWaybillEntity.java
  7. 5
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/InventoryDetailClient.java
  8. 2
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IInventoryDetailService.java
  9. 21
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/InventoryDetailServiceImpl.java
  10. 34
      blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncOrderInfoToPlatform.java
  11. 4
      blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.java
  12. 15
      blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml
  13. 4
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/IWarehouseMappingDataService.java
  14. 10
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/WarehouseMappingDataServiceImpl.java
  15. 34
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/CarsLoadApiController.java
  16. 8
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java
  17. 32
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/OpenOrderController.java
  18. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java
  19. 19
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml
  20. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java
  21. 27
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml
  22. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillOrderMapper.xml
  23. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderService.java
  24. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java
  25. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java
  26. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java
  27. 57
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
  28. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java
  29. 10
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java
  30. 72
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

4
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IInventoryDetailClient.java

@ -24,6 +24,10 @@ public interface IInventoryDetailClient {
@GetMapping(API_PREFIX + "/findAllTrayType")
List<InventoryDetailEntity> findAllTrayType(@RequestParam String orderCode,@RequestParam Integer inventoryId);
@GetMapping(API_PREFIX + "/findStatusByInventoryIdAndOrderPackageCode")
Integer findStatusByInventoryIdAndOrderPackageCode(@RequestParam Integer inventoryId, @RequestParam String orderPackageCode);
// @GetMapping(API_PREFIX + "/getEntityByOrderCode")
// OrderCountEntity getEntityByOrderCode(@RequestParam String orderCode, @RequestParam Integer oldWarehouseId);

2
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/WaybillDetailDTO.java

@ -8,7 +8,7 @@ import java.math.BigDecimal;
@Data
public class WaybillDetailDTO implements Serializable {
private Long waybillDetailId;
private Long id;
private Integer updateType;
private Integer chargeType;//计价方式 1件 2方 3公斤

3
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceEntity.java

@ -140,4 +140,7 @@ public class TrunklineAdvanceEntity extends TenantEntity {
@ApiModelProperty(name = "是否有包件",notes = "")
private Integer hasPackage = 1;
@ApiModelProperty(name = "创建人名称",notes = "")
private String createUserName;
}

2
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/UnloadPackageVO.java

@ -7,11 +7,13 @@ import java.io.Serializable;
@Data
public class UnloadPackageVO implements Serializable {
private Long loadScanId;
private String orderPackageCode;
private Integer num;
private Integer unloadNum;
private String trayName;
private String trayCode;
private String scanStatus;
private String unloadNodeName;
}

2
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/UnloadScanOrderVO.java

@ -13,6 +13,8 @@ public class UnloadScanOrderVO implements Serializable {
private String orderCode;
private Integer loadingNum;
private Integer unloadNum;
private Integer unloadAbnormal;
private Integer totalNumber;
private List<UnloadPackageVO> unloadPackageList = new ArrayList<>();

8
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWaybillEntity.java

@ -421,4 +421,12 @@ public class WarehouseWaybillEntity extends TenantEntity {
@ApiModelProperty(value = "到站编码")
private String destinationCode;
@ApiModelProperty(value = "货号")
private String goodsCode;
@ApiModelProperty(value = "审核人id")
private Long checkUserId;
@ApiModelProperty(value = "审核人名称")
private String checkUserName;
}

5
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/InventoryDetailClient.java

@ -29,4 +29,9 @@ public class InventoryDetailClient implements IInventoryDetailClient{
public List<InventoryDetailEntity> findAllTrayType(String orderCode,Integer inventoryId) {
return inventoryDetailService.findAllTrayType(orderCode,inventoryId);
}
@Override
public Integer findStatusByInventoryIdAndOrderPackageCode(Integer inventoryId, String orderPackageCode) {
return inventoryDetailService.findStatusByInventoryIdAndOrderPackageCode(inventoryId,orderPackageCode);
}
}

2
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IInventoryDetailService.java

@ -13,4 +13,6 @@ public interface IInventoryDetailService {
List<InventoryDetailEntity> findAllTrayType(String orderCode,Integer inventoryId);
Integer findStatusByInventoryIdAndOrderPackageCode(Integer inventoryId, String orderPackageCode);
}

21
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/InventoryDetailServiceImpl.java

@ -1,5 +1,6 @@
package com.logpm.oldproject.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.oldproject.entity.InventoryDetailEntity;
import com.logpm.oldproject.mapper.InventoryDetailMapper;
import com.logpm.oldproject.service.IInventoryDetailService;
@ -7,6 +8,7 @@ import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
@Service
@AllArgsConstructor
@ -29,4 +31,23 @@ public class InventoryDetailServiceImpl implements IInventoryDetailService {
return inventoryDetailMapper.findAllTrayType(orderCode,inventoryId);
}
@Override
public Integer findStatusByInventoryIdAndOrderPackageCode(Integer inventoryId, String orderPackageCode) {
QueryWrapper<InventoryDetailEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("inventory_id",inventoryId)
.eq("unitNo",orderPackageCode);
InventoryDetailEntity inventoryDetailEntity = inventoryDetailMapper.selectOne(queryWrapper);
if(Objects.isNull(inventoryDetailEntity)){
return 0;
}else{
Integer status = inventoryDetailEntity.getStatus();
if(status.equals(1)){
return 0;
}else if(status.equals(2)){
return 1;
}
}
return 0;
}
}

34
blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncOrderInfoToPlatform.java

@ -1,8 +1,10 @@
package com.logpm.patch.jobhandle;
import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.feign.IDistributionStockArticleClient;
import com.logpm.oldproject.entity.AdvanceDetailEntity;
import com.logpm.oldproject.entity.AdvanceEntity;
import com.logpm.oldproject.entity.DetailProductEntity;
@ -61,6 +63,8 @@ public class SyncOrderInfoToPlatform {
private final IWayBillClient wayBillClient;
private final IAdvanceDetailClient advanceDetailClient;
private final IWarehouseWaybillClient warehouseWaybillClient;
private final IInventoryDetailClient inventoryDetailClient;
private final IDistributionStockArticleClient distributionStockArticleClient;
@XxlJob("syncOrderInfo")
@ -565,6 +569,36 @@ public class SyncOrderInfoToPlatform {
return ReturnT.SUCCESS;
}
@XxlJob("clearPackageStatus")
public ReturnT<String> clearPackageStatus(String param) {
log.info("############clearPackageStatus: 清洗包件状态");
List<WarehouseMappingDataEntity> warehouseMappingDataEntityList = warehouseMappingDataService.getWarehouseMapping();
if(warehouseMappingDataEntityList.isEmpty()){
log.warn("###############syncZeroOrderInfo: 当前没有配置需要同步的仓库信息");
return ReturnT.FAIL;
}
WarehouseMappingDataEntity warehouseMappingDataEntity = warehouseMappingDataEntityList.get(0);
Long newWarehouseId = warehouseMappingDataEntity.getNewWarehouseId();
Integer inventoryId = warehouseMappingDataEntity.getInventoryId();
List<JSONObject> ls = warehouseMappingDataService.findTotalCountByWarehouseId(newWarehouseId);
for (JSONObject l : ls) {
Long packageId = l.getLong("packageId");
String orderPackageCode = l.getStr("orderPackageCode");
String orderCode = l.getStr("orderCode");
Integer status = inventoryDetailClient.findStatusByInventoryIdAndOrderPackageCode(inventoryId,orderPackageCode);
if(status.equals(1)){
warehouseMappingDataService.updatePackageStatus("20",packageId);
distributionStockArticleClient.updateOrderInfo(orderCode,newWarehouseId);
}
}
return ReturnT.SUCCESS;
}
}

4
blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.java

@ -46,4 +46,8 @@ public interface WarehouseMappingDataMapper {
void deletedAdvanceByNotId(@Param("advanceId") Long advanceId, @Param("orderCode") String orderCode);
void deletedAdcanceDetailByNotId(@Param("advanceId") Long advanceId, @Param("orderCode") String orderCode);
List<JSONObject> findTotalCountByWarehouseId(@Param("newWarehouseId") Long newWarehouseId);
void updatePackageStatus(@Param("packageStatuss") String packageStatuss, @Param("packageId") Long packageId);
}

15
blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml

@ -133,4 +133,19 @@
and advance_id != #{advanceId}
</delete>
<select id="findTotalCountByWarehouseId" resultType="cn.hutool.json.JSONObject">
select ldpl.id packageId,
ldpl.order_package_code orderPackageCode,
ldpl.order_code orderCode
from logpm_distribution_parcel_list ldpl
where warehouse_id = #{newWarehouseId}
and order_package_status != '20'
</select>
<update id="updatePackageStatus" >
update logpm_distribution_parcel_list
set order_package_status = #{packageStatuss}
where id = #{packageId}
</update>
</mapper>

4
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/IWarehouseMappingDataService.java

@ -42,4 +42,8 @@ public interface IWarehouseMappingDataService {
void deletedAdvanceByNotId(Long advanceId, String orderCode);
void deletedAdcanceDetailByNotId(Long advanceId, String orderCode);
List<JSONObject> findTotalCountByWarehouseId(Long newWarehouseId);
void updatePackageStatus(String packageStatuss, Long packageId);
}

10
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/WarehouseMappingDataServiceImpl.java

@ -106,4 +106,14 @@ public class WarehouseMappingDataServiceImpl implements IWarehouseMappingDataSer
public void deletedAdcanceDetailByNotId(Long advanceId, String orderCode) {
warehouseMappingDataMapper.deletedAdcanceDetailByNotId(advanceId,orderCode);
}
@Override
public List<JSONObject> findTotalCountByWarehouseId(Long newWarehouseId) {
return warehouseMappingDataMapper.findTotalCountByWarehouseId(newWarehouseId);
}
@Override
public void updatePackageStatus(String packageStatuss, Long packageId) {
warehouseMappingDataMapper.updatePackageStatus(packageStatuss,packageId);
}
}

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

@ -905,4 +905,38 @@ public class CarsLoadApiController {
}
@ResponseBody
@PostMapping("/findLoadZeroList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询配载中的零担列表", notes = "传入loadCarsDTO")
public R findLoadZeroList(@RequestBody LoadCarsDTO loadCarsDTO) {
String method = "############findLoadZeroList: ";
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,"仓库信息为空");
}
loadCarsDTO.setWarehouseId(myCurrentWarehouse.getId());
loadCarsDTO.setWarehouseName(myCurrentWarehouse.getName());
if(Objects.isNull(loadId)){
log.warn(method+"配载Id为空 loadId={}",loadId);
return R.fail(405,"配载Id为空");
}
return carsLoadService.findLoadZeroList(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,"系统异常");
}
}
}

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

@ -177,10 +177,10 @@ public class CarsLoadController {
return R.fail(400,"配载id为空");
}
if(Objects.isNull(assistantId)){
log.warn(method+"副驾id为空 assistantId={}",assistantId);
return R.fail(400,"副驾id为空");
}
// if(Objects.isNull(assistantId)){
// log.warn(method+"副驾id为空 assistantId={}",assistantId);
// return R.fail(400,"副驾id为空");
// }
if(Objects.isNull(driverId)){
log.warn(method+"司机id为空 driverId={}",driverId);

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

@ -1142,5 +1142,37 @@ public class OpenOrderController {
}
@ResponseBody
@PostMapping("/checkWaybill")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "审核运单", notes = "传入openOrderDTO")
public R checkWaybill(@RequestBody OpenOrderDTO openOrderDTO) {
String method = "############checkWaybill: ";
log.info(method + "请求参数{}", openOrderDTO);
Long waybillId = openOrderDTO.getWaybillId();
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(403,"仓库信息为空");
}
openOrderDTO.setWarehouseId(myCurrentWarehouse.getId());
openOrderDTO.setWarehouseName(myCurrentWarehouse.getName());
return openOrderService.checkWaybill(openOrderDTO);
}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,"系统异常");
}
}
}

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

@ -37,4 +37,6 @@ public interface TrunklineAdvanceDetailMapper extends BaseMapper<TrunklineAdvanc
List<String> findOrderPackageCodesByAdvanceId(@Param("advanceId") Long advanceId);
void deleteAdvanceDetailById(@Param("advanceDetailId") Long advanceDetailId);
Integer findTotalNumByOrderCode(@Param("orderCode") String orderCode);
}

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

@ -10,7 +10,10 @@
</update>
<select id="findList" resultType="com.logpm.trunkline.vo.TrunklineAdvanceDetailVO">
select ltad.waybill_no waybillNo,
select ltad.id id,
ltad.warehouse_id warehouseId,
ltad.warehouse_name warehouseName,
ltad.waybill_no waybillNo,
ltad.order_code orderCode,
lta.train_number trainNumber,
ltad.package_status packageStatus,
@ -24,7 +27,10 @@
ltad.service_num serviceNum,
ltad.quantity quantity,
lwtg.tray_code trayCode,
lwt.pallet_name trayName
lwt.pallet_name trayName,
ltad.system_type systemType,
ltad.weight weight,
ltad.volume volume
from logpm_trunkline_advance_detail ltad
left join logpm_trunkline_advance lta on lta.id = ltad.advance_id
left join logpm_warehouse_tray_goods lwtg on lwtg.association_value = ltad.order_package_code
@ -78,7 +84,7 @@
</select>
<select id="advanceDetailPageList" resultType="com.logpm.trunkline.vo.TrunklineAdvanceDetailVO">
select *
select ltad.*
from logpm_trunkline_advance_detail ltad
where ltad.is_deleted = 0
<if test="param.advanceId != null">
@ -150,4 +156,11 @@
where id = #{advanceDetailId}
</delete>
<select id="findTotalNumByOrderCode" resultType="int">
select count(*)
from logpm_trunkline_advance_detail
where order_code = #{orderCode}
and is_deleted = 0
</select>
</mapper>

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

@ -73,4 +73,8 @@ public interface TrunklineCarsLoadScanMapper extends BaseMapper<TrunklineCarsLoa
Integer findRealSignNumBySignOrderId(@Param("signOrderId") Long signOrderId);
void updateFinalNodeIdAndFinalNodeNameById(@Param("loadScanId") Long loadScanId, @Param("finalNodeId") Long finalNodeId, @Param("finalNodeName") String finalNodeName);
Integer findPlanUnloadNumByLoadIdAndFinalNodeId(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId);
List<TrunklineCarsLoadScanEntity> findNotUnloadZeroList(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId);
}

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

@ -139,6 +139,17 @@
and ltcls.type = 1
group by ltcls.waybill_no,
ltcls.order_code
</select>
<select id="findNotUnloadZeroList" resultType="com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity">
select *
from logpm_trunkline_cars_load_scan
where is_deleted = 0
and scan_status = '1'
and load_id = #{loadId}
and final_node_id = #{warehouseId}
and `type` = 2
</select>
<select id="findUnloadPackageList" resultType="com.logpm.trunkline.vo.UnloadPackageVO">
@ -147,7 +158,8 @@
unload_num unloadNum,
tray_code trayCode,
tray_name trayName,
scan_status scanStatus
scan_status scanStatus,
unload_node_name unloadNodeName
from logpm_trunkline_cars_load_scan
where load_id = #{loadId}
and final_node_id = #{warehouseId}
@ -159,14 +171,14 @@
select IFNULL(sum(num),0)
from logpm_trunkline_cars_load_scan
where load_id = #{loadId}
and scan_status != "1"
and scan_status != '1'
</select>
<select id="findUnloadNumByLoadIdAndNodeId" resultType="int">
select IFNULL(sum(num),0)
from logpm_trunkline_cars_load_scan
where load_id = #{loadId}
and warehouse_id = #{nodeId}
and unload_node_id = #{nodeId}
and scan_status != '1'
</select>
@ -287,4 +299,13 @@
final_node_name = #{finalNodeName}
where id = #{loadScanId}
</update>
<select id="findPlanUnloadNumByLoadIdAndFinalNodeId" resultType="int">
select sum(IFNULL(num,0))
from logpm_trunkline_cars_load_scan
where load_id = #{loadId}
and final_node_id = #{warehouseId}
</select>
</mapper>

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillOrderMapper.xml

@ -20,7 +20,7 @@
from logpm_trunkline_waybill_order ltwo
left join logpm_trunkline_advance lta on lta.id = ltwo.advance_id
where ltwo.is_deleted = 0
and ltwo.id = #{waybillId}
and ltwo.waybill_id = #{waybillId}
</select>
<select id="findWaybillIdByAdvanceId" resultType="Long">

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

@ -63,6 +63,9 @@ public interface IOpenOrderService {
R importOrderNoPackage(Long warehouseId, String warehouseName, MultipartFile file) throws IOException;
R checkWaybill(OpenOrderDTO openOrderDTO);
// R findWaybillInfo(String waybillNo);
}

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

@ -47,4 +47,6 @@ public interface ITrunklineAdvanceDetailService extends BaseService<TrunklineAdv
void deleteByAdvanceId(Long advanceId);
R deleteAdvanceDetail(AdvanceDetailDTO advanceDetailDTO);
Integer findTotalNumByOrderCode(String orderCode);
}

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

@ -70,4 +70,8 @@ public interface ITrunklineCarsLoadScanService extends BaseService<TrunklineCars
void updateFinalNodeIdAndFinalNodeNameById(Long loadScanId, Long finalNodeId, String finalNodeName);
Integer findPlanUnloadNumByLoadIdAndFinalNodeId(Long loadId, Long warehouseId);
List<TrunklineCarsLoadScanEntity> findNotUnloadZeroList(Long loadId, Long warehouseId);
}

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

@ -167,4 +167,7 @@ public interface ITrunklineCarsLoadService extends BaseService<TrunklineCarsLoad
R updateBelongToWarehouseBySignOrderId(LoadCarsDTO loadCarsDTO);
R manualLoading(LoadCarsDTO loadCarsDTO, String remark);
R findLoadZeroList(LoadCarsDTO loadCarsDTO);
}

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

@ -271,6 +271,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
waybillEntity.setDocumentMakingTime(CommonUtil.StringToDate(openOrderDTO.getOpenOrderDate()));
waybillEntity.setReceiptNum(openOrderDTO.getReceiptNum());
waybillEntity.setCustomerTrain(openOrderDTO.getTrainNumber());
waybillEntity.setGoodsCode(openOrderDTO.getGoodsCode());
Long shipperId = openOrderDTO.getShipperId();
if(Objects.isNull(shipperId)){
//如果发货单位没有id值,则把发货单位信息自动添加到client中
@ -491,6 +492,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
waybillTrackEntity.setTrackType("10");
waybillTrackEntity.setRefer("创建运单");
waybillTrackEntity.setOperationRemark("创建运单"+waybillNo+",时间:"+ CommonUtil.dateToString(waybillEntity.getCreateTime()));
waybillTrackEntity.setCreateUserName(AuthUtil.getNickName());
trunklineWaybillTrackService.save(waybillTrackEntity);
Integer totalCount = waybillEntity.getTotalCount();
@ -563,6 +565,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
waybillEntity.setDestination(openOrderDTO.getDestination());
waybillEntity.setDestinationCode(openOrderDTO.getDestinationCode());
waybillEntity.setGoodsName(openOrderDTO.getGoodsName());
waybillEntity.setGoodsCode(openOrderDTO.getGoodsCode());
waybillEntity.setTotalCount(openOrderDTO.getTotalCount());
waybillEntity.setTotalVolume(openOrderDTO.getTotalVolume());
waybillEntity.setTotalWeight(openOrderDTO.getTotalWeghit());
@ -663,6 +666,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
waybillTrackEntity.setTrackType("10");
waybillTrackEntity.setRefer("创建运单");
waybillTrackEntity.setOperationRemark("创建运单"+waybillNo+",时间:"+ CommonUtil.dateToString(new Date()));
waybillTrackEntity.setCreateUserName(AuthUtil.getNickName());
trunklineWaybillTrackService.save(waybillTrackEntity);
@ -1097,6 +1101,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
trunklineAdvanceEntity.setFreezeStatus("0");
trunklineAdvanceEntity.setLegacyStatus("0");
trunklineAdvanceEntity.setDeliveryDate(CommonUtil.StringToDate(importCustomizedOuPaiDTO.getDueDateStr()));
trunklineAdvanceEntity.setCreateUserName(AuthUtil.getUserName());
advanceService.save(trunklineAdvanceEntity);
}else{
Long advanceId = trunklineAdvanceEntity.getId();
@ -1206,6 +1211,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
trunklineAdvanceEntity.setFreezeStatus("0");
trunklineAdvanceEntity.setLegacyStatus("0");
trunklineAdvanceEntity.setDeliveryDate(CommonUtil.StringToDate(importStandardOuPaiDTO.getDueDateStr()));
trunklineAdvanceEntity.setCreateUserName(AuthUtil.getUserName());
advanceService.save(trunklineAdvanceEntity);
}else{
Long advanceId = trunklineAdvanceEntity.getId();
@ -1350,7 +1356,6 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
warehouseWaybillClient.updateEntity(waybillEntity);
try{
String waybillNo = openOrderDTO.getWaybillNo();
TrunklineWaybillTrackEntity waybillTrackEntity = new TrunklineWaybillTrackEntity();
@ -1361,7 +1366,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
waybillTrackEntity.setTrackType("30");
waybillTrackEntity.setRefer("修改运单");
waybillTrackEntity.setOperationRemark("修改运单"+waybillNo+",时间:"+ CommonUtil.dateToString(waybillEntity.getCreateTime())+","+updateMsg);
waybillTrackEntity.setCreateUserName(AuthUtil.getUserName());
waybillTrackEntity.setCreateUserName(AuthUtil.getNickName());
trunklineWaybillTrackService.save(waybillTrackEntity);
}catch (Exception e){
@ -1543,6 +1548,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
trunklineAdvanceEntity.setFreezeStatus("0");
trunklineAdvanceEntity.setLegacyStatus("0");
trunklineAdvanceEntity.setHasPackage(0);
trunklineAdvanceEntity.setCreateUserName(AuthUtil.getUserName());
advanceService.save(trunklineAdvanceEntity);
}
@ -1585,6 +1591,45 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
return R.success("导入成功");
}
@Override
public R checkWaybill(OpenOrderDTO openOrderDTO) {
Long waybillId = openOrderDTO.getWaybillId();
Long warehouseId = openOrderDTO.getWarehouseId();
String warehouseName = openOrderDTO.getWarehouseName();
WarehouseWaybillEntity warehouseWaybillEntity = warehouseWaybillClient.findByWaybillId(waybillId);
if(Objects.isNull(warehouseWaybillEntity)){
log.warn("##############checkWaybill: 运单信息不存在");
return R.fail(405,"运单信息不存在");
}
warehouseWaybillEntity.setCheckUserId(AuthUtil.getUserId());
warehouseWaybillEntity.setCheckUserName(AuthUtil.getNickName());
warehouseWaybillClient.updateEntity(warehouseWaybillEntity);
try{
String waybillNo = warehouseWaybillEntity.getWaybillNo();
TrunklineWaybillTrackEntity waybillTrackEntity = new TrunklineWaybillTrackEntity();
waybillTrackEntity.setWarehouseId(warehouseId);
waybillTrackEntity.setWarehouseName(warehouseName);
waybillTrackEntity.setWaybillId(waybillId);
waybillTrackEntity.setWaybillNo(waybillNo);
waybillTrackEntity.setTrackType("40");
waybillTrackEntity.setRefer("审核运单");
waybillTrackEntity.setOperationRemark("审核运单"+waybillNo+",时间:"+ CommonUtil.dateToString(new Date())+", 审核人:"+AuthUtil.getNickName());
waybillTrackEntity.setCreateUserName(AuthUtil.getNickName());
trunklineWaybillTrackService.save(waybillTrackEntity);
}catch (Exception e){
log.warn("###############checkWaybill: 存入日志失败");
}
return R.success("审核成功");
}
private String verifyData(OpenOrderDTO openOrderDTO, WarehouseWaybillEntity waybillEntity) {
log.info("###################verifyData: 验证改单数据");
StringBuilder stringBuilder = new StringBuilder();
@ -1661,7 +1706,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
List<WaybillDetailDTO> removeList = openOrderDTO.getRemoveList();
for (WaybillDetailDTO waybillDetailDTO : removeList) {
Long waybillDetailId = waybillDetailDTO.getWaybillDetailId();
Long waybillDetailId = waybillDetailDTO.getId();
WarehouseWayBillDetail warehouseWayBillDetail = warehouseWaybillDetailClient.findEntityByWaybillDetailId(waybillDetailId);
if(Objects.isNull(warehouseWayBillDetail)){
@ -1691,7 +1736,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
}else if(2 == updateType){
//更新
Long waybillDetailId = waybillDetailDTO.getWaybillDetailId();
Long waybillDetailId = waybillDetailDTO.getId();
WarehouseWayBillDetail warehouseWayBillDetail = warehouseWaybillDetailClient.findEntityByWaybillDetailId(waybillDetailId);
if(Objects.isNull(warehouseWayBillDetail)){
log.warn("#################verifyUpdateData: 明细不存在");
@ -1970,7 +2015,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
List<WaybillDetailDTO> removeList = openOrderDTO.getRemoveList();
for (WaybillDetailDTO waybillDetailDTO : removeList) {
Long waybillDetailId = waybillDetailDTO.getWaybillDetailId();
Long waybillDetailId = waybillDetailDTO.getId();
WarehouseWayBillDetail warehouseWayBillDetail = warehouseWaybillDetailClient.findEntityByWaybillDetailId(waybillDetailId);
if(Objects.isNull(warehouseWayBillDetail)){
@ -2013,7 +2058,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
}else if(2 == updateType){
//更新
Long waybillDetailId = waybillDetailDTO.getWaybillDetailId();
Long waybillDetailId = waybillDetailDTO.getId();
WarehouseWayBillDetail warehouseWayBillDetail = warehouseWaybillDetailClient.findEntityByWaybillDetailId(waybillDetailId);
if(Objects.isNull(warehouseWayBillDetail)){
log.warn("#################verifyUpdateData: 明细不存在");

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

@ -220,4 +220,9 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl<Trunkline
return R.success("删除成功");
}
@Override
public Integer findTotalNumByOrderCode(String orderCode) {
return baseMapper.findTotalNumByOrderCode(orderCode);
}
}

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

@ -167,4 +167,14 @@ public class TrunklineCarsLoadScanServiceImpl extends BaseServiceImpl<TrunklineC
baseMapper.updateFinalNodeIdAndFinalNodeNameById(loadScanId,finalNodeId,finalNodeName);
}
@Override
public Integer findPlanUnloadNumByLoadIdAndFinalNodeId(Long loadId, Long warehouseId) {
return baseMapper.findPlanUnloadNumByLoadIdAndFinalNodeId(loadId,warehouseId);
}
@Override
public List<TrunklineCarsLoadScanEntity> findNotUnloadZeroList(Long loadId, Long warehouseId) {
return baseMapper.findNotUnloadZeroList(loadId,warehouseId);
}
}

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

@ -231,7 +231,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
log.warn("#############startCarByLoadId: 车辆已发车 nodeStatus={}",nodeStatus);
throw new CustomerException(405,"车辆已发车");
}
if(Objects.isNull(startDate)){
if(!Objects.isNull(startDate)){
log.warn("#############startCarByLoadId: 车辆已发车 nodeStatus={}",nodeStatus);
throw new CustomerException(405,"车辆已发车");
}
@ -2061,6 +2061,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
for (TrunklineCarsLoadVO trunklineCarsLoadVO:records){
String loadStatus = trunklineCarsLoadVO.getLoadStatus();
String value = DictBizCache.getValue(DictBizConstant.CARS_LOAD_STATUS, loadStatus);
Integer realLoadingNumber = trunklineCarsLoadVO.getRealLoadingNumber();
Integer unloadNumber = trunklineCarsLoadVO.getUnloadNumber();
trunklineCarsLoadVO.setRealLoadingNumber(realLoadingNumber-unloadNumber);
trunklineCarsLoadVO.setLoadStatus(value);
}
pageList.setRecords(records);
@ -2449,7 +2452,6 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.fail(405,"打托失败");
}
orders = orderCode;
}
Map<String,Object> map = new HashMap<>();
@ -3325,6 +3327,22 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.success("装车完成");
}
@Override
public R findLoadZeroList(LoadCarsDTO loadCarsDTO) {
Long loadId = loadCarsDTO.getLoadId();
Long warehouseId = loadCarsDTO.getWarehouseId();
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if(Objects.isNull(carsLoadEntity)){
log.warn("##########findLoadZeroList: 查询配载计划的零担卸车数据");
return R.fail(405,"查询配载计划的零担卸车数据");
}
List<TrunklineCarsLoadScanEntity> ls = trunklineCarsLoadScanService.findNotUnloadZeroList(loadId,warehouseId);
return R.data(ls);
}
@Override
public R loadingTrayInfo(LoadCarsDTO loadCarsDTO) {
log.info("##############loadingTrayInfo: 查询托盘的货物信息");
@ -3429,6 +3447,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
log.warn("##################findCarsLoadingDetail: 配载or三方计划不存在 loadId={}",loadId);
return R.fail(405,"计划不存在");
}
Integer realLoadingNumber = carsLoadEntity.getRealLoadingNumber();
Integer unloadNumber = carsLoadEntity.getUnloadNumber();
carsLoadEntity.setRealLoadingNumber(realLoadingNumber - unloadNumber);
//计划订单包件数
List<LoadScanOrderVO> loadScanOrderList = trunklineCarsOrderService.findLoadScanPackageWithOrder(loadId,warehouseId);
@ -3568,13 +3591,28 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Long loadId = trunklineCarsLoadVO.getId();
TrunklineCarsLoadLineEntity carsLoadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndNodeId(loadId, warehouseId);
Integer sort = carsLoadLineEntity.getSort();
String nodeStatus1 = carsLoadLineEntity.getNodeStatus();
TrunklineCarsLoadLineEntity upCarsLoadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndSort(loadId, sort - 1);
String nodeStatus = upCarsLoadLineEntity.getNodeStatus();
if("20".equals(nodeStatus)){
trunklineCarsLoadVO.setLastStartCarStatus(1);
}else{
trunklineCarsLoadVO.setLastStartCarStatus(0);
if(!"20".equals(nodeStatus)){
trunklineCarsLoadVO.setLastStartCarStatus(0);
}else{
if(!"20".equals(nodeStatus1)){
trunklineCarsLoadVO.setLastStartCarStatus(1);
}else{
trunklineCarsLoadVO.setLastStartCarStatus(0);
}
}
// if("20".equals(nodeStatus)){
// trunklineCarsLoadVO.setLastStartCarStatus(1);
// }else{
// trunklineCarsLoadVO.setLastStartCarStatus(0);
// }
Integer realLoadingNumber = trunklineCarsLoadVO.getRealLoadingNumber();
Integer unloadNumber = trunklineCarsLoadVO.getUnloadNumber();
trunklineCarsLoadVO.setRealLoadingNumber(realLoadingNumber-unloadNumber);
}
pageList.setRecords(records);
return R.data(pageList);
@ -3985,7 +4023,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
newStockArticleEntity.setOrderReceiveStatus("20");
newStockArticleEntity.setOrderStatus("10");
newStockArticleEntity.setHandQuantity(enterNun);
newStockArticleEntity.setIncomingNum(enterNun);
newStockArticleEntity.setIncomingNum(stockArticleEntity.getIncomingNum());
newStockArticleEntity.setWarehouse(basicdataWarehouseEntity.getName());
newStockArticleEntity.setWarehouseId(basicdataWarehouseEntity.getId());
Long orderId = distributionStockArticleClient.addData(newStockArticleEntity);
if(orderId != 0){
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListClient.findEntityListByOrderCode(orderCode, fromWarehouseId);
@ -4001,7 +4041,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
}else{
Integer handQuantity = newStockArticleEntity.getHandQuantity()+enterNun;
Integer incomingNum = newStockArticleEntity.getIncomingNum()+enterNun;
Integer incomingNum = newStockArticleEntity.getIncomingNum();
Integer totalNumber = newStockArticleEntity.getTotalNumber();
if(incomingNum == totalNumber){
@ -4081,15 +4121,14 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.fail(405,"配载计划信息不存在");
}
Integer planUnloadNum = 0;
//查询已扫描卸车的包件
List<UnloadScanOrderVO> unloadScanOrderList = trunklineCarsLoadScanService.findPackageWithOrderList(loadId,warehouseId);
for (UnloadScanOrderVO unloadScanOrderVO : unloadScanOrderList) {
Integer loadingNum = unloadScanOrderVO.getLoadingNum();
planUnloadNum = planUnloadNum +loadingNum;
String waybillNo = unloadScanOrderVO.getWaybillNo();
String orderCode = unloadScanOrderVO.getOrderCode();
Integer totalNumber = trunklineAdvanceDetailService.findTotalNumByOrderCode(orderCode);
unloadScanOrderVO.setTotalNumber(totalNumber);
List<UnloadPackageVO> unloadPackageList = trunklineCarsLoadScanService.findUnloadPackageList(loadId,warehouseId,waybillNo,orderCode);
unloadScanOrderVO.setUnloadPackageList(unloadPackageList);
}
@ -4098,7 +4137,6 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
List<UnloadZeroVO> zeroList = trunklineCarsOrderService.findUnloadZeroList(loadId,warehouseId);
for (UnloadZeroVO unloadZeroVO : zeroList) {
Integer loadingNum = unloadZeroVO.getLoadingNum();
planUnloadNum = planUnloadNum +loadingNum;
String waybillNo = unloadZeroVO.getWaybillNo();
String orderCode = unloadZeroVO.getOrderCode();
List<UnloadPackageVO> unloadPackageList = trunklineCarsLoadScanService.findUnloadPackageList(loadId,warehouseId,waybillNo,orderCode);
@ -4108,14 +4146,22 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//查询异常列表
QueryWrapper<TrunklineCarsLoadScanEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("load_id",loadId)
.eq("warehouse_id",warehouseId)
.eq("unload_node_id",warehouseId)
.eq("unload_abnormal",1);
List<TrunklineCarsLoadScanEntity> exceptionList = trunklineCarsLoadScanService.list(queryWrapper);
TrunklineCarsLoadVO trunklineCarsLoadVO = new TrunklineCarsLoadVO();
BeanUtil.copy(carsLoadEntity,trunklineCarsLoadVO);
//查询计划卸车数量
Integer planUnloadNum = trunklineCarsLoadScanService.findPlanUnloadNumByLoadIdAndFinalNodeId(loadId,warehouseId);
TrunklineCarsLoadLineEntity loadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndNodeId(loadId, warehouseId);
BeanUtil.copy(carsLoadEntity,trunklineCarsLoadVO);
Integer realLoadingNumber = trunklineCarsLoadVO.getRealLoadingNumber();
Integer unloadNumber = trunklineCarsLoadVO.getUnloadNumber();
trunklineCarsLoadVO.setUnloadNumber(loadLineEntity.getUnloadNumber());
trunklineCarsLoadVO.setRealLoadingNumber(realLoadingNumber-unloadNumber);
trunklineCarsLoadVO.setUnloadScanOrderList(unloadScanOrderList);
trunklineCarsLoadVO.setUnloadZeroList(zeroList);
trunklineCarsLoadVO.setExceptionList(exceptionList);

Loading…
Cancel
Save