Browse Source

1.干线-暂存单导入,装车数据无回显bug修复

master
zhenghaoyu 11 months ago
parent
commit
4e657d4ea6
  1. 1
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/WaybillCarsLoadVO.java
  2. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java
  3. 15
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml
  4. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/AdvanceToLoadListener.java
  5. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java
  6. 17
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java
  7. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java
  8. 34
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

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

@ -13,6 +13,7 @@ public class WaybillCarsLoadVO implements Serializable {
private String carsLineName;
private Date startTime;
private Date arriveTime;
private Date signTime;
private String carNumber;
private String driverName;
private String driverMobile;

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

@ -128,4 +128,6 @@ public interface TrunklineCarsLoadScanMapper extends BaseMapper<TrunklineCarsLoa
List<WaybillCarsLoadVO> findWaybillTransferInfo(@Param("waybillId") Long waybillId);
List<LoadingDetailExportVO> loadingDetailExport(@Param("param") LoadCarsDTO loadCarsDTO);
Integer findSignNumByLoadId(@Param("loadId") Long loadId);
}

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

@ -574,12 +574,13 @@
<select id="findWaybillTransferInfo" resultType="com.logpm.trunkline.vo.WaybillCarsLoadVO">
select ltcl.cars_no carsNo,
ltcl.load_status loadStatus,
ltcl.cars_line_name carsLineName,
ltcl.carrier_name carsLineName,
ltcl.start_time startTime,
ltcl.arrive_time arriveTime,
ltcl.car_number carNumber,
ltcl.driver_name driverName,
ltcl.driver_mobile driverMobile,
ltcl.sign_time signTime,
IF(ltcl.delivery_type=1,'',ltcl.car_number) carNumber,
IF(ltcl.delivery_type=1,'物流到仓自提',ltcl.driver_name) driverName,
IF(ltcl.delivery_type=1,'',ltcl.driver_mobile) driverMobile,
ltcl.remark remark
from logpm_trunkline_cars_load_scan ltcls
left join logpm_trunkline_cars_load ltcl on ltcl.id = ltcls.load_id
@ -620,5 +621,11 @@
order by ltcls.create_time asc
</select>
<select id="findSignNumByLoadId" resultType="int">
select sum(num)
from logpm_trunkline_cars_load_scan
where load_id = #{loadId}
and scan_status = '3'
</select>
</mapper>

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

@ -80,6 +80,9 @@ public class AdvanceToLoadListener {
inComingDTO.setOrderPackageCode(orderPackageCode);
inComingDTO.setWarehouseId(warehouseId);
inComingDTO.setWarehouseName(warehouseName);
inComingDTO.setTenantId(advanceDetailEntity.getTenantId());
inComingDTO.setUserId(advanceDetailEntity.getCreateUser());
inComingDTO.setDeptId(advanceDetailEntity.getCreateDept());
R r = inComingService.incomingPackage(inComingDTO);
if(r.getCode() == 200){
carsLoadScanEntity.setFromWarehouseId(warehouseId);

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

@ -123,4 +123,6 @@ public interface ITrunklineCarsLoadScanService extends BaseService<TrunklineCars
List<WaybillCarsLoadVO> findWaybillTransferInfo(Long waybillId);
List<LoadingDetailExportVO> loadingDetailExport(LoadCarsDTO loadCarsDTO);
Integer findSignNumByLoadId(Long loadId);
}

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

@ -1,5 +1,6 @@
package com.logpm.trunkline.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basic.entity.BasicMaterialEntity;
@ -36,10 +37,7 @@ import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.*;
@Slf4j
@Service
@ -84,9 +82,18 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
}
Long userId = AuthUtil.getUserId();
Long deptId = null;
String deptIds = AuthUtil.getDeptId();
String[] split = deptIds.split(",");
Long deptId = Long.parseLong(split[0]);
if(Objects.isNull(userId)){
userId = advanceDetailEntity.getCreateUser();
}
if(CollUtil.isEmpty(Arrays.asList(split))){
deptId = Long.parseLong(split[0]);
}
if(Objects.isNull(deptId)){
userId = advanceDetailEntity.getCreateDept();
}
//2.查询订单信息
int total = baseMapper.getAllTotalNum(orderCode);

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

@ -303,4 +303,9 @@ public class TrunklineCarsLoadScanServiceImpl extends BaseServiceImpl<TrunklineC
return baseMapper.loadingDetailExport(loadCarsDTO);
}
@Override
public Integer findSignNumByLoadId(Long loadId) {
return baseMapper.findSignNumByLoadId(loadId);
}
}

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

@ -1788,6 +1788,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
trunklineCarsLoadLineService.updateById(carsLoadLineEntity);
carsLoadEntity.setLoadStatus("10");
carsLoadEntity.setStartTime(date);
updateById(carsLoadEntity);
try {
@ -1968,6 +1969,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
carsLoadEntity.setSignTime(new Date());
carsLoadEntity.setLoadStatus("90");
updateById(carsLoadEntity);
trunklineCarsLoadScanService.updateScanStatusByLoadId(loadId, "3");
@ -4073,15 +4075,45 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.fail(405, "数据id为空");
}
Long loadScanId = loadScanIds.get(0);
TrunklineCarsLoadScanEntity scanEntity = trunklineCarsLoadScanService.getById(loadScanId);
if(Objects.isNull(scanEntity)){
log.warn("############signLoadScanByIds: 数据信息不存在 loadScanId={}", loadScanId);
return R.fail(405, "数据信息不存在");
}
Long loadId = scanEntity.getLoadId();
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if(Objects.isNull(carsLoadEntity)){
log.warn("############signLoadScanByIds: 车辆配载信息不存在 loadId={}", loadId);
return R.fail(405, "车辆配载信息不存在");
}
Integer realLoadingNumber = carsLoadEntity.getRealLoadingNumber();
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
if (Objects.isNull(warehouseEntity)) {
log.warn("############signLoadScanByIds: 仓库信息不存在 warehouseId={}", warehouseId);
return R.fail(405, "仓库信息不存在");
}
Date date = new Date();
trunklineCarsLoadScanService.updateScanStatus(loadScanIds, "3");
List<String> orderPackageCodes = trunklineCarsLoadScanService.findSignListOrderPackageCodesByIds(loadScanIds);
//通过loadId查询是否所有包件都签收了
Integer num = trunklineCarsLoadScanService.findSignNumByLoadId(loadId);
if(realLoadingNumber.equals(num)){
carsLoadEntity.setSignTime(date);
carsLoadEntity.setLoadStatus("90");
}else{
if(num == 1){
carsLoadEntity.setSignTime(date);
carsLoadEntity.setLoadStatus("91");
}
}
updateById(carsLoadEntity);
//包件签收状态修改
distributionParcelListClient.updatePackageStatus(orderPackageCodes,warehouseId,"70");
@ -5006,6 +5038,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//无装车记录异常日志记录
try {
carsLoadAsyncService.abnormalListUnloadByLoadIdAndWarehouseId(loadId, warehouseId, warehouseName, loadScanId, AuthUtil.getTenantId(), AuthUtil.getUserId(), AuthUtil.getNickName(), Func.firstLong(AuthUtil.getDeptId()));
} catch (Exception e) {
log.warn("###############unloadPackage: 存入异常列表记录失败");

Loading…
Cancel
Save