Browse Source

1.零担手动装车逻辑bug修复

pre-production
zhenghaoyu 2 months ago
parent
commit
85e6099957
  1. 14
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml
  2. 12
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportOpenTimeVO.java
  3. 29
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

14
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml

@ -13,8 +13,10 @@
IFNULL(round(sum(if(lta.waybill_status = '0',1,0))/count(lta.id)*100,2),'0.00') noOpenRate,
sum(if(lta.waybill_status='0' and lta.freeze_status = '1',1,0)) noOpenHasFreezeNum,
IFNULL(round(sum(if(lta.waybill_status='0' and lta.freeze_status = '1',1,0))/count(lta.id)*100,2),'0.00') noOpenHasFreezeRate,
sum(if(lta.waybill_status='0' and lta.freeze_status = '0',1,0)) noOpenNoFreezeNum,
IFNULL(round(sum(if(lta.waybill_status='0' and lta.freeze_status = '0',1,0))/count(lta.id)*100,2),'0.00') noOpenNoFreezeRate,
sum(if(lta.waybill_status='0'and now() <= DATE_ADD( lta.create_time, INTERVAL 48 HOUR ),1,0)) noOpenNoChaoNum,
IFNULL(round(sum(if(lta.waybill_status='0'and now() <= DATE_ADD( lta.create_time, INTERVAL 48 HOUR ),1,0))/count(lta.id)*100,2),'0.00') noOpenNoChaoRate,
sum(if(lta.waybill_status='0'and now() > DATE_ADD( lta.create_time, INTERVAL 48 HOUR ),1,0)) noOpenChaoNum,
IFNULL(round(sum(if(lta.waybill_status='0'and now() > DATE_ADD( lta.create_time, INTERVAL 48 HOUR ),1,0))/count(lta.id)*100,2),'0.00') noOpenChaoRate,
sum(IF( lta.waybill_status='1' and lww.create_time <= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ), 1, 0 )) onTimeNum,
sum(IF( lta.waybill_status='1' and lww.create_time > DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ), 1, 0 )) overTimeNum,
IFNULL(round(sum(IF( lta.waybill_status='1' and lww.create_time <= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ), 1, 0 ))/sum(if(lta.waybill_status='1',1,0))*100,2),'0.00') onTimeRate,
@ -65,8 +67,10 @@
IFNULL(concat(round(sum(if(lta.waybill_status = '0',1,0))/count(lta.id)*100,2),'%'),'0.00%') noOpenRate,
sum(if(lta.waybill_status='0' and lta.freeze_status = '1',1,0)) noOpenHasFreezeNum,
IFNULL(concat(round(sum(if(lta.waybill_status='0' and lta.freeze_status = '1',1,0))/count(lta.id)*100,2),'%'),'0.00%') noOpenHasFreezeRate,
sum(if(lta.waybill_status='0' and lta.freeze_status = '0',1,0)) noOpenNoFreezeNum,
IFNULL(concat(round(sum(if(lta.waybill_status='0' and lta.freeze_status = '0',1,0))/count(lta.id)*100,2),'%'),'0.00%') noOpenNoFreezeRate,
sum(if(lta.waybill_status='0'and now() <= DATE_ADD( lta.create_time, INTERVAL 48 HOUR ),1,0)) noOpenNoChaoNum,
IFNULL(concat(round(sum(if(lta.waybill_status='0'and now() <= DATE_ADD( lta.create_time, INTERVAL 48 HOUR ),1,0))/count(lta.id)*100,2),'%'),'0.00%') noOpenNoChaoRate,
sum(if(lta.waybill_status='0'and now() > DATE_ADD( lta.create_time, INTERVAL 48 HOUR ),1,0)) noOpenChaoNum,
IFNULL(concat(round(sum(if(lta.waybill_status='0'and now() > DATE_ADD( lta.create_time, INTERVAL 48 HOUR ),1,0))/count(lta.id)*100,2),'%'),'0.00%') noOpenChaoRate,
sum(IF( lta.waybill_status='1' and lww.create_time <= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ), 1, 0 )) onTimeNum,
sum(IF( lta.waybill_status='1' and lww.create_time > DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ), 1, 0 )) overTimeNum,
IFNULL(concat(round(sum(IF( lta.waybill_status='1' and lww.create_time <= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ), 1, 0 ))/sum(if(lta.waybill_status='1',1,0))*100,2),'%'),'0.00%') onTimeRate,
@ -117,7 +121,7 @@
sum(if(lww.check_status=1,1,0)) hasCheckNum,
IFNULL(round(sum(if(lww.check_status=1,1,0))/count(lww.id)*100,2),'0.00') hasCheckRate,
sum(IF( lww.check_status=1 and lww.check_time <= DATE_ADD( lww.create_time, INTERVAL #{param.hoursTime} HOUR ), 1, 0 )) onTimeCheckNum,
IFNULL(round(sum(IF( lww.check_status=1 and lww.check_time <= DATE_ADD( lww.create_time, INTERVAL #{param.hoursTime} HOUR ), 1, 0 ))/sum(if(lww.check_status=1,1,0))*100,2),'0.00') onTimeCheckRate,
IFNULL(round(sum(IF( lww.check_status=1 and lww.check_time <= DATE_ADD( lww.create_time, INTERVAL #{param.hoursTime} HOUR ), 1, 0 ))/count(lww.id)*100,2),'0.00') onTimeCheckRate,
IFNULL(round(sum(TIMESTAMPDIFF(SECOND, lww.create_time, lww.check_time))/sum(if(lww.check_status=1,1,0))/3600,1),'0.0') avgCheckTime
from logpm_warehouse_waybill lww
left join logpm_warehouse_warehouse waw on waw.id = lww.departure_warehouse_id

12
blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportOpenTimeVO.java

@ -29,10 +29,14 @@ public class ReportOpenTimeVO implements Serializable {
private Integer noOpenHasFreezeNum;
@ExcelProperty(value = "未开单已冻结占比")
private String noOpenHasFreezeRate;
@ExcelProperty(value = "未开单未处理数")
private Integer noOpenNoFreezeNum;
@ExcelProperty(value = "未处理占比")
private String noOpenNoFreezeRate;
@ExcelProperty(value = "未开单未超时数")
private Integer noOpenNoChaoNum;
@ExcelProperty(value = "未开单未超时占比")
private String noOpenNoChaoRate;
@ExcelProperty(value = "未开单超时数")
private Integer noOpenChaoNum;
@ExcelProperty(value = "未开单超时占比")
private String noOpenChaoRate;
@ExcelProperty(value = "准时开单数")
private Integer onTimeNum;
@ExcelProperty(value = "超期开单数")

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

@ -33,7 +33,6 @@ import com.logpm.distribution.feign.IDistributionStockArticleClient;
import com.logpm.distribution.vo.DistributionParcelListVO;
import com.logpm.distribution.vo.ZeroPackageSupplyVO;
import com.logpm.factorydata.enums.BrandEnums;
import com.logpm.factorydata.feign.IFactoryDataClient;
import com.logpm.factorydata.util.FactoryDataMessageSender;
import com.logpm.factorydata.vo.NodePushMsg;
import com.logpm.factorydata.vo.PushData;
@ -41,7 +40,6 @@ import com.logpm.trunkline.bean.Resp;
import com.logpm.trunkline.dto.*;
import com.logpm.trunkline.entity.*;
import com.logpm.trunkline.excel.TrunklineCarsLoadExcel;
import com.logpm.trunkline.feign.ITrunklinePackageTrackLogClient;
import com.logpm.trunkline.mapper.TrunklineCarsLoadMapper;
import com.logpm.trunkline.service.*;
import com.logpm.trunkline.vo.*;
@ -55,16 +53,12 @@ import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;
import org.springblade.common.annotations.RepeatSubmit;
import org.springblade.common.constant.*;
import org.springblade.common.constant.broadcast.FanoutConstants;
import org.springblade.common.constant.carsload.CarsLoadLogTypeConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.model.FanoutMsg;
import org.springblade.common.model.NodeFanoutMsg;
import org.springblade.common.utils.CommonUtil;
import org.springblade.common.utils.QRCodeUtil;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
@ -4065,21 +4059,21 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
scanZeroDetailEntity.setScanId(finalLoadScanId);
scanZeroDetailEntity.setGoodsName(entityByWaybillDetailId.getProductName());
scanZeroDetailEntity.setPackageId(entity.getId());
scanZeroDetailEntity.setLoadingNum(entityByWaybillDetailId.getNum());
scanZeroDetailEntity.setLoadingNum(entity.getQuantity());
scanZeroDetailEntity.setUnloadNum(0);
zeroDetailList.add(scanZeroDetailEntity);
Integer quantity = entity.getQuantity();
Long parceListId = entity.getId();
DistributionParcelListEntity updateEntity = new DistributionParcelListEntity();
updateEntity.setId(entity.getId());
updateEntity.setQuantity(quantity-entityByWaybillDetailId.getNum());
updateEntity.setQuantity(quantity-entity.getQuantity());
updateEntity.setOrderCode(entity.getOrderCode());
updateEntity.setWarehouseId(entity.getWarehouseId());
updateParceList.add(updateEntity);
DistributionParcelNumberEntity parcelNumberEntity = parcelNumberMapByParceListId.get(parceListId);
DistributionParcelNumberEntity updateNumberEntity = new DistributionParcelNumberEntity();
updateNumberEntity.setId(parcelNumberEntity.getId());
updateNumberEntity.setHandQuantity(parcelNumberEntity.getHandQuantity()-entityByWaybillDetailId.getNum());
updateNumberEntity.setHandQuantity(parcelNumberEntity.getHandQuantity()-entity.getQuantity());
updateParceNumberList.add(updateNumberEntity);
});
}
@ -11183,7 +11177,18 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
distributionStockArticleClient.updateByBatchId(updateStockArticleList);
}
if(CollUtil.isNotEmpty(updateParceListList)){
distributionParcelListClient.updateList(updateParceListList);
//把updateParceListList每100个分成一组
List<List<DistributionParcelListEntity>> groupedLists = new ArrayList<>();
int batchSize = 100;
for (int i = 0; i < updateParceListList.size(); i += batchSize) {
int end = Math.min(i + batchSize, updateParceListList.size());
groupedLists.add(updateParceListList.subList(i, end));
}
groupedLists.forEach(groupedList -> {
distributionParcelListClient.updateList(groupedList);
});
}
if(CollUtil.isNotEmpty(loadIdSet)){
loadIdSet.forEach(loadId -> {
@ -11191,9 +11196,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
});
}
Long loadId = loadIdSet.stream().findFirst().get();
// Long loadId = loadIdSet.stream().findFirst().get();
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
// TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
//TODO 暂时注释
// carsLoadAsyncService.sendReportRemoveScanData(AuthUtil.getUserId(),AuthUtil.getNickName(),warehouseId,warehouseName,carsLoadScanEntityList,carsLoadEntity);

Loading…
Cancel
Save