Browse Source

1.干线bug,运单bug修复

dist.1.3.0
zhenghaoyu 5 months ago
parent
commit
c0e28d2719
  1. 4
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java
  2. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java
  3. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java
  4. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  5. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java
  6. 78
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  7. 9
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillPackageServiceImpl.java
  8. 7
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillTrackServiceImpl.java

4
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java

@ -207,4 +207,8 @@ public interface IDistributionStockArticleClient {
@GetMapping(API_PREFIX + "/findStockNumByWaybillNo") @GetMapping(API_PREFIX + "/findStockNumByWaybillNo")
Integer findStockNumByWaybillNo(@RequestParam String waybillNo, @RequestParam Long departureWarehouseId); Integer findStockNumByWaybillNo(@RequestParam String waybillNo, @RequestParam Long departureWarehouseId);
@GetMapping(API_PREFIX + "/findSignNumByWaybillNo")
Integer findSignNumByWaybillNo(@RequestParam String waybillNo, @RequestParam Long destinationWarehouseId);
} }

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java

@ -409,4 +409,9 @@ public class DistributionStockArticleClient implements IDistributionStockArticle
return distributionStockArticleService.findStockNumByWaybillNo(waybillNo,departureWarehouseId); return distributionStockArticleService.findStockNumByWaybillNo(waybillNo,departureWarehouseId);
} }
@Override
public Integer findSignNumByWaybillNo(String waybillNo, Long destinationWarehouseId) {
return distributionStockArticleService.findSignNumByWaybillNo(waybillNo,destinationWarehouseId);
}
} }

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java

@ -233,4 +233,5 @@ public interface DistributionStockArticleMapper extends BaseMapper<DistributionS
Integer findStockNumByWaybillNo(@Param("waybillNo") String waybillNo, @Param("departureWarehouseId") Long departureWarehouseId); Integer findStockNumByWaybillNo(@Param("waybillNo") String waybillNo, @Param("departureWarehouseId") Long departureWarehouseId);
Integer findSignNumByWaybillNo(@Param("waybillNo") String waybillNo, @Param("destinationWarehouseId") Long destinationWarehouseId);
} }

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml

@ -2057,4 +2057,11 @@
and waybill_number = #{waybillNo} and waybill_number = #{waybillNo}
</select> </select>
<select id="findSignNumByWaybillNo" resultType="int">
select IFNULL(SUM(signin_quantity),0)
from logpm_distribution_stock_article
where warehouse_id = #{destinationWarehouseId}
and waybill_number = #{waybillNo}
</select>
</mapper> </mapper>

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java

@ -317,4 +317,7 @@ public interface IDistributionStockArticleService extends BaseService<Distributi
Integer findIncomingNumByWaybillNo(String waybillNo, Long destinationWarehouseId); Integer findIncomingNumByWaybillNo(String waybillNo, Long destinationWarehouseId);
Integer findStockNumByWaybillNo(String waybillNo, Long departureWarehouseId); Integer findStockNumByWaybillNo(String waybillNo, Long departureWarehouseId);
Integer findSignNumByWaybillNo(String waybillNo, Long destinationWarehouseId);
} }

78
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java

@ -1431,6 +1431,8 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
return; return;
} }
DistributionStockArticleEntity updateEntity = new DistributionStockArticleEntity();
updateEntity.setId(stockArticleEntity.getId());
String isZero = stockArticleEntity.getIsZero(); String isZero = stockArticleEntity.getIsZero();
if ("1".equals(isZero)) { if ("1".equals(isZero)) {
log.warn("##############updateOrderInfoByDistributionStockArticleEntity: 零担不更新 orderCode={} warehouseId={}", stockArticleEntity.getOrderCode(), stockArticleEntity.getWarehouseId()); log.warn("##############updateOrderInfoByDistributionStockArticleEntity: 零担不更新 orderCode={} warehouseId={}", stockArticleEntity.getOrderCode(), stockArticleEntity.getWarehouseId());
@ -1516,83 +1518,82 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
} }
} }
stockArticleEntity.setWaybillNumber(orderWaybillNo); updateEntity.setWaybillNumber(orderWaybillNo);
stockArticleEntity.setWarehouseEntryTime(new Date(firstEntryTime)); updateEntity.setWarehouseEntryTime(new Date(firstEntryTime));
stockArticleEntity.setWarehouseEntryTimeEnd(new Date(lastEntryTime)); updateEntity.setWarehouseEntryTimeEnd(new Date(lastEntryTime));
if (incomingNum == 0) { if (incomingNum == 0) {
stockArticleEntity.setOrderReceiveStatus("10"); updateEntity.setOrderReceiveStatus("10");
stockArticleEntity.setCompleteSet(1); updateEntity.setCompleteSet(1);
stockArticleEntity.setOrderStatus("0"); updateEntity.setOrderStatus("0");
stockArticleEntity.setReservationStatus("10"); updateEntity.setReservationStatus("10");
stockArticleEntity.setGroundingStatus("10"); updateEntity.setGroundingStatus("10");
} else if (0 < incomingNum && incomingNum < totalNumber) { } else if (0 < incomingNum && incomingNum < totalNumber) {
stockArticleEntity.setOrderReceiveStatus("20"); updateEntity.setOrderReceiveStatus("20");
stockArticleEntity.setCompleteSet(1); updateEntity.setCompleteSet(1);
if (signNum == 0) { if (signNum == 0) {
if (handleNum == 0) { if (handleNum == 0) {
stockArticleEntity.setOrderStatus("20"); updateEntity.setOrderStatus("20");
} else if (0 < handleNum && handleNum < totalNumber) { } else if (0 < handleNum && handleNum < totalNumber) {
stockArticleEntity.setOrderStatus("20"); updateEntity.setOrderStatus("20");
} else { } else {
stockArticleEntity.setOrderStatus("20"); updateEntity.setOrderStatus("20");
} }
} else { } else {
stockArticleEntity.setOrderStatus("70"); updateEntity.setOrderStatus("70");
} }
if (reservationNum == 0) { if (reservationNum == 0) {
stockArticleEntity.setReservationStatus("10"); updateEntity.setReservationStatus("10");
} else { } else {
stockArticleEntity.setReservationStatus("20"); updateEntity.setReservationStatus("20");
} }
if (groundingNum == 0) { if (groundingNum == 0) {
stockArticleEntity.setGroundingStatus("10"); updateEntity.setGroundingStatus("10");
} else { } else {
stockArticleEntity.setGroundingStatus("20"); updateEntity.setGroundingStatus("20");
} }
} else { } else {
stockArticleEntity.setOrderReceiveStatus("30"); updateEntity.setOrderReceiveStatus("30");
stockArticleEntity.setCompleteSet(2); updateEntity.setCompleteSet(2);
if (signNum == 0) { if (signNum == 0) {
if (handleNum == 0) { if (handleNum == 0) {
stockArticleEntity.setOrderStatus("20"); updateEntity.setOrderStatus("20");
} else if (0 < handleNum && handleNum < totalNumber) { } else if (0 < handleNum && handleNum < totalNumber) {
stockArticleEntity.setOrderStatus("20"); updateEntity.setOrderStatus("20");
} else { } else {
stockArticleEntity.setOrderStatus("20"); updateEntity.setOrderStatus("20");
} }
} else { } else {
if (signNum.equals(totalNumber)) { if (signNum.equals(totalNumber)) {
stockArticleEntity.setOrderStatus("80"); updateEntity.setOrderStatus("80");
} else { } else {
stockArticleEntity.setOrderStatus("70"); updateEntity.setOrderStatus("70");
} }
} }
if (reservationNum == 0) { if (reservationNum == 0) {
stockArticleEntity.setReservationStatus("10"); updateEntity.setReservationStatus("10");
} else if (reservationNum > 0 && reservationNum < totalNumber) { } else if (reservationNum > 0 && reservationNum < totalNumber) {
stockArticleEntity.setReservationStatus("20"); updateEntity.setReservationStatus("20");
} else { } else {
stockArticleEntity.setReservationStatus("30"); updateEntity.setReservationStatus("30");
} }
if (groundingNum == 0) { if (groundingNum == 0) {
stockArticleEntity.setGroundingStatus("10"); updateEntity.setGroundingStatus("10");
} else if (groundingNum > 0 && groundingNum < totalNumber) { } else if (groundingNum > 0 && groundingNum < totalNumber) {
stockArticleEntity.setGroundingStatus("20"); updateEntity.setGroundingStatus("20");
} else { } else {
stockArticleEntity.setGroundingStatus("30"); updateEntity.setGroundingStatus("30");
} }
} }
stockArticleEntity.setIncomingNum(incomingNum); updateEntity.setSigninQuantity(signNum);
stockArticleEntity.setHandQuantity(handleNum); updateEntity.setIncomingNum(incomingNum);
updateById(stockArticleEntity); updateEntity.setHandQuantity(handleNum);
updateById(updateEntity);
} }
@Override @Override
@ -2654,6 +2655,11 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
return baseMapper.findStockNumByWaybillNo(waybillNo,departureWarehouseId); return baseMapper.findStockNumByWaybillNo(waybillNo,departureWarehouseId);
} }
@Override
public Integer findSignNumByWaybillNo(String waybillNo, Long destinationWarehouseId) {
return baseMapper.findSignNumByWaybillNo(waybillNo,destinationWarehouseId);
}
/** /**
* @param page * @param page
* @param distributionSignforStockArticle * @param distributionSignforStockArticle

9
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillPackageServiceImpl.java

@ -139,6 +139,14 @@ public class TrunklineWaybillPackageServiceImpl extends BaseServiceImpl<Trunklin
}else if(waybillType == 2){ }else if(waybillType == 2){
WarehouseWaybillEntity updateEntity = new WarehouseWaybillEntity(); WarehouseWaybillEntity updateEntity = new WarehouseWaybillEntity();
updateEntity.setId(waybillEntity.getId()); updateEntity.setId(waybillEntity.getId());
Integer signNum = distributionStockArticleClient.findSignNumByWaybillNo(waybillNo,destinationWarehouseId);
if(signNum != 0){
if(signNum == totalCount){
updateEntity.setWaybillStatus("100");
}else{
updateEntity.setWaybillStatus("90");
}
}else{
Integer incomingNum = distributionStockArticleClient.findIncomingNumByWaybillNo(waybillNo, destinationWarehouseId); Integer incomingNum = distributionStockArticleClient.findIncomingNumByWaybillNo(waybillNo, destinationWarehouseId);
Integer stockNum = distributionStockArticleClient.findStockNumByWaybillNo(waybillNo,departureWarehouseId); Integer stockNum = distributionStockArticleClient.findStockNumByWaybillNo(waybillNo,departureWarehouseId);
if(incomingNum == 0){ if(incomingNum == 0){
@ -158,6 +166,7 @@ public class TrunklineWaybillPackageServiceImpl extends BaseServiceImpl<Trunklin
updateEntity.setWaybillStatus("50"); updateEntity.setWaybillStatus("50");
} }
} }
}
warehouseWaybillClient.updateEntity(updateEntity); warehouseWaybillClient.updateEntity(updateEntity);
} }

7
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillTrackServiceImpl.java

@ -8,6 +8,7 @@ import com.logpm.trunkline.entity.TrunklineWaybillTrackEntity;
import com.logpm.trunkline.mapper.TrunklineWaybillTrackMapper; import com.logpm.trunkline.mapper.TrunklineWaybillTrackMapper;
import com.logpm.trunkline.service.IOpenOrderAsyncService; import com.logpm.trunkline.service.IOpenOrderAsyncService;
import com.logpm.trunkline.service.ITrunklineWaybillOrderService; import com.logpm.trunkline.service.ITrunklineWaybillOrderService;
import com.logpm.trunkline.service.ITrunklineWaybillPackageService;
import com.logpm.trunkline.service.ITrunklineWaybillTrackService; import com.logpm.trunkline.service.ITrunklineWaybillTrackService;
import com.logpm.trunkline.vo.TrunklineWaybillTrackVO; import com.logpm.trunkline.vo.TrunklineWaybillTrackVO;
import com.logpm.warehouse.entity.WarehouseWaybillEntity; import com.logpm.warehouse.entity.WarehouseWaybillEntity;
@ -31,6 +32,7 @@ public class TrunklineWaybillTrackServiceImpl extends BaseServiceImpl<TrunklineW
private final IWarehouseWaybillClient warehouseWaybillClient; private final IWarehouseWaybillClient warehouseWaybillClient;
private final IOpenOrderAsyncService openOrderAsyncService; private final IOpenOrderAsyncService openOrderAsyncService;
private final ITrunklineWaybillOrderService waybillOrderService; private final ITrunklineWaybillOrderService waybillOrderService;
private final ITrunklineWaybillPackageService trunklineWaybillPackageService;
@Override @Override
public List<TrunklineWaybillTrackEntity> findWaybillLog(Long waybillId, String trackType) { public List<TrunklineWaybillTrackEntity> findWaybillLog(Long waybillId, String trackType) {
@ -111,7 +113,7 @@ public class TrunklineWaybillTrackServiceImpl extends BaseServiceImpl<TrunklineW
//存入签收日志 //存入签收日志
String operationRemark = warehouseName+" "+typeStr+num+"件,车次号:"+trainNumber+",司机:"+driverName+",车牌号:"+carNumber+",签收人"+ signUser+",签收单:"+signOrderCode+",签收时间"+ CommonUtil.dateToStringGeneral(signTime); String operationRemark = warehouseName+" "+typeStr+num+"件,车次号:"+trainNumber+",司机:"+driverName+",车牌号:"+carNumber+",签收人"+ signUser+",签收单:"+signOrderCode+",签收时间"+ CommonUtil.dateToStringGeneral(signTime);
openOrderAsyncService.saveLog(waybillId,waybillNo,"100",warehouseName+" "+typeStr,operationRemark,nickName,userId,warehouseId,warehouseName); openOrderAsyncService.saveLog(waybillId,waybillNo,"100",warehouseName+" "+typeStr,operationRemark,nickName,userId,warehouseId,warehouseName);
if(type != 2){
warehouseWaybillEntity.setWaybillStatus("100"); warehouseWaybillEntity.setWaybillStatus("100");
//需要更新运单的状态 //需要更新运单的状态
@ -133,6 +135,9 @@ public class TrunklineWaybillTrackServiceImpl extends BaseServiceImpl<TrunklineW
waybillOrderService.updateById(waybillOrderEntity); waybillOrderService.updateById(waybillOrderEntity);
} }
} }
}else{
trunklineWaybillPackageService.updateWaybillStatus(warehouseWaybillEntity);
}
} }
private void addPackageWaybillTrackLog(WaybillLogDTO waybillLogDTO,Long waybillId) { private void addPackageWaybillTrackLog(WaybillLogDTO waybillLogDTO,Long waybillId) {

Loading…
Cancel
Save