Browse Source

Merge remote-tracking branch 'origin/pre-production'

master
zhenghaoyu 3 weeks ago
parent
commit
55c8eb8882
  1. 7
      blade-biz-common/src/main/java/org/springblade/common/annotations/Master.java
  2. 5
      blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicNoticeController.java
  3. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataClientController.java
  4. 816
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java
  5. 45
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  6. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  7. 22
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  8. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
  9. 16
      blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomNodeDataPushListener.java
  10. 11
      blade-service/logpm-report/src/main/java/com/logpm/report/config/MyBatisConfig.java
  11. 64
      blade-service/logpm-report/src/main/java/com/logpm/report/config/MybatisPlusConfig.java
  12. 16
      blade-service/logpm-report/src/main/java/com/logpm/report/controller/TrunklinePickupController.java
  13. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/dto/AllTrunklineTimeDetailDTO.java
  14. 1
      blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportIncomingDTO.java
  15. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportStartTimeDetailDTO.java
  16. 67
      blade-service/logpm-report/src/main/java/com/logpm/report/interceptor/MasterCommentInterceptor.java
  17. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.java
  18. 81
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.xml
  19. 28
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportQuallityMapper.xml
  20. 64
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml
  21. 4
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/TrunklinePickupMapper.java
  22. 94
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/TrunklinePickupMapper.xml
  23. 6
      blade-service/logpm-report/src/main/java/com/logpm/report/query/TrunklinePickupEfficiencyDetailQuery.java
  24. 4
      blade-service/logpm-report/src/main/java/com/logpm/report/service/TrunklinePickupService.java
  25. 157
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportIncomingServiceImpl.java
  26. 54
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/TrunklinePickupServiceImpl.java
  27. 1
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportDeptIncomingNumVO.java
  28. 141
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/trunklinebillloading/TrunklinePickupEfficiencyCostVO.java
  29. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml
  30. 37
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java
  31. 12
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
  32. 63
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  33. 12
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/config/MyBatisConfig.java
  34. 99
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/interceptor/MasterCommentInterceptor.java
  35. 25
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java
  36. 62
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java

7
blade-biz-common/src/main/java/org/springblade/common/annotations/Master.java

@ -0,0 +1,7 @@
package org.springblade.common.annotations;
import java.lang.annotation.*;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Master {
}

5
blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicNoticeController.java

@ -102,6 +102,11 @@ public class BasicNoticeController extends BladeController {
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入notice")
public R<List<BasicNoticeVO>> list() {
if(AuthUtil.isAdmin()){
return R.data(null);
}
LambdaQueryWrapper<BasicNotice> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.orderByDesc(BasicNotice::getReleaseTime);
List<BasicNotice> list = noticeService.list(lambdaQueryWrapper);

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataClientController.java

@ -79,7 +79,7 @@ public class BasicdataClientController extends BladeController {
private final IBasicdataStoreBusinessService basicdataStoreBusinessService;
private final IBasicdataStoreContactService basicdataStoreContactService;
private final IUserClient userClient;
/**
* 基础客户表 详情

816
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java

File diff suppressed because it is too large Load Diff

45
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -5975,8 +5975,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
loadscanEntity.setIsZero(1);
distributionLoadscanService.save(loadscanEntity);
distributionLoadscanEntityLists.add(loadscanEntity);
distributionLoadscanEntityLists.add(loadscanEntity);
num = loadscanEntity.getLoadedNub();
@ -6356,23 +6354,45 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
nodeFanoutMsg.setOperator(AuthUtil.getNickName());
nodeFanoutMsg.setOperatorTime(distributionDeliveryListEntity.getUpdateTime());
// DistributionTaskVO taskVO = buildDistributionTaskVO(distributionDeliveryListEntity, AuthUtil.getUserId());
org.springblade.common.model.DistributionSignforVO distributionLoadVO = new org.springblade.common.model.DistributionSignforVO();
if (distributionLoadscanEntityLists.isEmpty()) {
return null;
}
// 司机名称
String driverName = "";
String driverId = "";
// 车牌
String carNumer = "";
// 车牌
String carId = "";
if (!distributionLoadscanEntityLists.isEmpty()) {
DistributionLoadscanEntity distributionLoadscanEntity = distributionLoadscanEntityLists.get(0);
distributionLoadVO.setDriverName(distributionLoadscanEntity.getDriverName());
distributionLoadVO.setDriverId(distributionLoadscanEntity.getDriverId());
distributionLoadVO.setVehicleName(distributionLoadscanEntity.getVehicleName());
distributionLoadVO.setVehicleId(distributionLoadscanEntity.getVehicleId());
driverName = distributionLoadscanEntity.getDriverName();
driverId = distributionLoadscanEntity.getDriverId();
carNumer = distributionLoadscanEntity.getVehicleName();
carId = distributionLoadscanEntity.getVehicleId();
} else {
DistributionLoadscaninvnEntity distributionLoadscaninvnEntity = distributionLoadscaninvnEntityLists.get(0);
driverName = distributionLoadscaninvnEntity.getDriverName();
driverId = distributionLoadscaninvnEntity.getDriverId();
carNumer = distributionLoadscaninvnEntity.getVehicleName();
carId = distributionLoadscaninvnEntity.getVehicleId();
}
distributionLoadVO.setDriverName(driverName);
distributionLoadVO.setDriverId(driverId);
distributionLoadVO.setVehicleName(carNumer);
distributionLoadVO.setVehicleId(carId);
distributionLoadVO.setReservationCode(reservationEntity.getReservationCode());
distributionLoadVO.setTrainNumber(distributionDeliveryListEntity.getTrainNumber());
distributionLoadVO.setReservationId(reservationEntity.getId());
if (StringUtil.isNotBlank(distributionLoadscanEntity.getVehicleName())) {
if (StringUtil.isNotBlank(carNumer)) {
// 获取车辆类型
BasicCarModelEntity nc = iBasicCarModelClient.getCarModelByCarNumber(distributionLoadscanEntity.getVehicleName());
BasicCarModelEntity nc = iBasicCarModelClient.getCarModelByCarNumber(carNumer);
if (nc != null) {
distributionLoadVO.setCarType(nc.getVehicleModel());
distributionLoadVO.setCarTypeId(nc.getId());
@ -6425,6 +6445,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
packageData.setPackageType(PackageTypeEnums.INV);
}
packageData.setNumber(1);
data.add(packageData);
}
distributionLoadVO.setPackageDataList(data);
nodeFanoutMsg.setMain(distributionLoadVO);

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

@ -3221,8 +3221,11 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
public Integer findOrderTotalNumByOrderPackageCodes(List<String> orderPackageCodes, Long warehouseId) {
List<String> orderCodes = distributionParcelListService.findOrderCodesByOrderPackageCodes(orderPackageCodes, warehouseId);
if(!orderCodes.isEmpty()){
return baseMapper.findOrderTotalNumByOrderCodes(orderCodes, warehouseId);
}
return 0;
}
@Override
public List<DistributionSignforStockArticleVO> signforListDetail(Long id) {

22
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

@ -5057,6 +5057,11 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
R r = warehouseUpdownTypeClient.downStock(list);
//查询当前库位最早入库的库存品
distributionStockService.save(distributionStockEntity);
// 备货作业节点
NodeFanoutMsg<StockUpVO> nodeFanoutMsg = buildStockUpNodeDataByStock(stockupEntity, distributionStockEntity);
if (ObjectUtils.isNotNull(nodeFanoutMsg)) {
distributionNodeWorkService.planStock(nodeFanoutMsg, AuthUtil.getUser());
}
//对码值进行使用状态标记
one.setCodeStatus("1");
disStockOrdercodeRecoService.updateById(one);
@ -5205,6 +5210,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
DisStockListDetailEntity disStockListDetailEntity = getDisStockListDetailEntity(inventoryPackageList, parcelListEntity, distributionStockListEntity.getId());
distributionStockEntity.setParcelListId(disStockListDetailEntity.getId());
disStockListDetailService.updateById(disStockListDetailEntity);
//对原库存品进行冻结数的扣减
distributionStockListMapper.decreaseStockListQuantityOccupied(stockListId, num);
//对新增库存品进行冻结数量增加
@ -5230,7 +5236,13 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
if (!logList.isEmpty()) {
trunklinePackageTrackLogClient.addPackageTrackLog(logList);
}
distributionStockService.save(distributionStockEntity);
// 备货作业节点
NodeFanoutMsg<StockUpVO> nodeFanoutMsg = buildStockUpNodeDataByStock(stockupEntity, distributionStockEntity);
if (ObjectUtils.isNotNull(nodeFanoutMsg)) {
distributionNodeWorkService.planStock(nodeFanoutMsg, AuthUtil.getUser());
}
return Resp.scanSuccess(PdaAudioLingoStatus.saomiaochenggong.getName(), "");
}
@ -6364,6 +6376,11 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
R r = warehouseUpdownTypeClient.downStock(list);
//查询当前库位最早入库的库存品
distributionStockService.save(distributionStockEntity);
// 备货作业节点
NodeFanoutMsg<StockUpVO> nodeFanoutMsg = buildStockUpNodeDataByStock(stockupEntity, distributionStockEntity);
if (ObjectUtils.isNotNull(nodeFanoutMsg)) {
distributionNodeWorkService.planStock(nodeFanoutMsg, AuthUtil.getUser());
}
//对码值进行使用状态标记
one.setCodeStatus("1");
disStockOrdercodeRecoService.updateById(one);
@ -6518,6 +6535,11 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
//进行下架
warehouseUpdownTypeClient.downPackage(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "备货包件下架");
distributionStockService.save(distributionStockEntity);
// 备货作业节点
NodeFanoutMsg<StockUpVO> nodeFanoutMsg = buildStockUpNodeDataByStock(stockupEntity, distributionStockEntity);
if (ObjectUtils.isNotNull(nodeFanoutMsg)) {
distributionNodeWorkService.planStock(nodeFanoutMsg, AuthUtil.getUser());
}
return Resp.scanSuccess(PdaAudioLingoStatus.saomiaochenggong.getName(), "");
}

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

@ -1452,7 +1452,8 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
// 进行签收扫描数据补录
distributionBillLadingScanService.saveBatch(ladingScanEntities);
// String collect = ladingScanEntities.stream().map(DistributionBillLadingScanEntity::getPacketBarCode).collect(Collectors.joining(","));
NodeFanoutMsg<PickUpByScanVO> nodeFanoutMsg = buildNodeFanoutMsgBySign(billLadingEntity, ladingScanEntities, AuthUtil.getUser(), myCurrentWarehouse);
iDistributionNodeWorkService.signByBill(nodeFanoutMsg, AuthUtil.getUser());
// 进行日志记录
// warehouseUpdownTypeClient.downPackageAndDelTrayAndIsUpdate(collect, myCurrentWarehouse.getId(), "后台PC自提签收下架", false);
@ -1483,6 +1484,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
.eq(DistributionBillLadingScanEntity::getBillLadingId, distrilbutionBillLading.getId())
);
return R.success("操作成功");
}

16
blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomNodeDataPushListener.java

@ -48,6 +48,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 监听业务系统推送给志邦的节点数据
@ -113,6 +114,20 @@ public class ZbomNodeDataPushListener {
String warehouseName = content.get(0).getStr("warehouseName");
String orderCode = content.get(0).getStr("orderCode");
// 根据运单号和自编码分组查询出对应的数量
// 末端仓卸车确认 判断包件是否是末端仓,是 推送,不是 跳过
if (ObjectUtil.equals(workNodeEnums.getCode(), WorkNodeEnums.END_WAREHOUSE_UNLOADING.getCode())) {
content = content.stream().filter(item -> {
String currentWarehouse = item.getStr("warehouseName");
String destinationWarehouse = item.getStr("destinationWarehouse");
if (StrUtil.equals(currentWarehouse, destinationWarehouse)) {
return true;
}
return false;
}).collect(Collectors.toList());
}
if (CollUtil.isEmpty(content)) {
return;
}
List<NodeDataDTO> orders = orderPackageService.findOrderCodebypackageCodes(content);
Map<String, NodeDataDTO> nodeDataMap = new HashMap<>();
if (CollUtil.isNotEmpty(orders)) {
@ -161,6 +176,7 @@ public class ZbomNodeDataPushListener {
List<NodeConfirmParamDTO> nodeConfirmLsit = new ArrayList<>();
Map<String, SendMsg> sendMsgMap = new HashMap<>();
// 构建提交参数
buildParam(entries, node, workNodeEnums, orders, noSignNumberMap, nodeOrderMap, nodeConfirmLsit, sendMsgMap, warehouseName);
if (CollUtil.isNotEmpty(nodeConfirmLsit)) {
for (NodeConfirmParamDTO nodeConfirmParam : nodeConfirmLsit) {

11
blade-service/logpm-report/src/main/java/com/logpm/report/config/MyBatisConfig.java

@ -0,0 +1,11 @@
package com.logpm.report.config;
//@Configuration
public class MyBatisConfig {
// @Bean
// public MasterCommentInterceptor masterCommentInterceptor() {
// return new MasterCommentInterceptor();
// }
}

64
blade-service/logpm-report/src/main/java/com/logpm/report/config/MybatisPlusConfig.java

@ -2,10 +2,19 @@ package com.logpm.report.config;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.TenantLineInnerInterceptor;
import com.logpm.report.interceptor.MasterCommentInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springblade.core.mp.intercept.QueryInterceptor;
import org.springblade.core.mp.plugins.BladePaginationInterceptor;
import org.springblade.core.mp.props.MybatisPlusProperties;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.core.annotation.AnnotationAwareOrderComparator;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
* @author zhaoqiaobo
@ -13,12 +22,59 @@ import org.springframework.context.annotation.Configuration;
*/
@Configuration
@MapperScan("com.baomidou.cloud.service.*.mapper*r")
public class MybatisPlusConfig {
public class MybatisPlusConfig implements WebMvcConfigurer {
// @Bean
// public MybatisPlusInterceptor mybatisPlusInterceptor(){
// MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
// interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
// return interceptor;
// }
// @Bean
// public MasterCommentInterceptor masterCommentInterceptor() {
// return new MasterCommentInterceptor();
// }
/**
* mybatis-plus 拦截器集合
*/
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor(){
// @ConditionalOnMissingBean(MybatisPlusInterceptor.class)
@Primary
public MybatisPlusInterceptor mybatisPlusInterceptor(ObjectProvider<QueryInterceptor[]> queryInterceptors,
TenantLineInnerInterceptor tenantLineInnerInterceptor,
MybatisPlusProperties mybatisPlusProperties) {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
// 配置租户拦截器
if (mybatisPlusProperties.getTenantMode()) {
interceptor.addInnerInterceptor(tenantLineInnerInterceptor);
}
// 配置分页拦截器
BladePaginationInterceptor paginationInterceptor = new BladePaginationInterceptor();
// 配置自定义查询拦截器
QueryInterceptor[] queryInterceptorArray = queryInterceptors.getIfAvailable();
if (ObjectUtil.isNotEmpty(queryInterceptorArray)) {
AnnotationAwareOrderComparator.sort(queryInterceptorArray);
paginationInterceptor.setQueryInterceptors(queryInterceptorArray);
}
paginationInterceptor.setMaxLimit(mybatisPlusProperties.getPageLimit());
paginationInterceptor.setOverflow(mybatisPlusProperties.getOverflow());
paginationInterceptor.setOptimizeJoin(mybatisPlusProperties.getOptimizeJoin());
paginationInterceptor.setDbType(DbType.MYSQL);
interceptor.addInnerInterceptor(paginationInterceptor);
// 添加性能分析插件(开发环境使用,生产环境移除)
// interceptor.addInnerInterceptor(new PerformanceInterceptor());
//拼接sql头拦截器
interceptor.addInnerInterceptor(new MasterCommentInterceptor());
return interceptor;
}

16
blade-service/logpm-report/src/main/java/com/logpm/report/controller/TrunklinePickupController.java

@ -8,6 +8,7 @@ import com.logpm.report.query.TrunklinePickupEfficiencyDetailQuery;
import com.logpm.report.query.TrunklinePickupEfficiencyQuery;
import com.logpm.report.service.TrunklinePickupService;
import com.logpm.report.vo.trunklinebillloading.B2BDeliverTimelinessVO;
import com.logpm.report.vo.trunklinebillloading.TrunklinePickupEfficiencyCostVO;
import com.logpm.report.vo.trunklinebillloading.TrunklinePickupEfficiencyDetailVO;
import com.logpm.report.vo.trunklinebillloading.TrunklinePickupEfficiencyVO;
import io.swagger.annotations.Api;
@ -71,6 +72,21 @@ public class TrunklinePickupController {
trunklinePickupService.exportEfficiencyDetail(response, query);
}
@GetMapping("/efficiencyCost")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "干线成本报表", notes = "干线成本报表")
public R<IPage<TrunklinePickupEfficiencyCostVO>> efficiencyCostPage(TrunklinePickupEfficiencyDetailQuery query) {
IPage<TrunklinePickupEfficiencyCostVO> pages = trunklinePickupService.efficiencyCostPage(query);
return R.data(pages);
}
@GetMapping("/exportEfficiencyCost")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "导出干线成本报表", notes = "导出干线成本报表")
public void exportEfficiencyCost(HttpServletResponse response, TrunklinePickupEfficiencyDetailQuery query) {
trunklinePickupService.exportEfficiencyCost(response, query);
}
@GetMapping("/b2BDeliveryTimeliness")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "2B业务配送时效表", notes = "2B业务配送时效表")

2
blade-service/logpm-report/src/main/java/com/logpm/report/dto/AllTrunklineTimeDetailDTO.java

@ -47,7 +47,7 @@ public class AllTrunklineTimeDetailDTO implements Serializable {
private String serviceNum;
private String trainNumber;
private Integer isDesIncomging;
private Integer isDesIncoming;
private Integer isOverTime; // 未超时 0 超时1

1
blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportIncomingDTO.java

@ -28,5 +28,6 @@ public class ReportIncomingDTO implements Serializable {
private List<String> brands;
private String consignee;
private Integer type;
}

2
blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportStartTimeDetailDTO.java

@ -41,7 +41,7 @@ public class ReportStartTimeDetailDTO implements Serializable {
private String serviceNum;
private String trainNumber;
private Integer isDesIncomging;
private Integer isStarting;
private Integer isOverTime; // 未超时 0 超时1
//开单件数 1

67
blade-service/logpm-report/src/main/java/com/logpm/report/interceptor/MasterCommentInterceptor.java

@ -0,0 +1,67 @@
package com.logpm.report.interceptor;
import com.baomidou.mybatisplus.core.toolkit.PluginUtils;
import com.baomidou.mybatisplus.extension.plugins.inner.InnerInterceptor;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.executor.statement.StatementHandler;
import org.apache.ibatis.mapping.BoundSql;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.mapping.SqlCommandType;
import org.apache.ibatis.plugin.Intercepts;
import org.apache.ibatis.plugin.Signature;
import org.springblade.common.annotations.Master;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.sql.Connection;
@Intercepts({
@Signature(
type = StatementHandler.class,
method = "prepare",
args = {Connection.class, Integer.class}
)
})
@Slf4j
public class MasterCommentInterceptor implements InnerInterceptor {
@Override
public void beforePrepare(StatementHandler sh, Connection connection, Integer transactionTimeout) {
PluginUtils.MPStatementHandler handler = PluginUtils.mpStatementHandler(sh);
MappedStatement ms = handler.mappedStatement();
SqlCommandType sct = ms.getSqlCommandType();
Method method = getMethodFromMappedStatement(ms);
if (method != null && method.isAnnotationPresent(Master.class)) {
BoundSql boundSql = handler.boundSql();
String sql = boundSql.getSql();
sql = "/*MASTER*/ " + sql;
try {
Field field = boundSql.getClass().getDeclaredField("sql");
field.setAccessible(true);
field.set(boundSql, sql);
} catch (NoSuchFieldException e) {
log.error("NoSuchFieldException:", e);
} catch (IllegalAccessException e) {
log.error("IllegalAccessException:", e);
}
}
}
private Method getMethodFromMappedStatement(MappedStatement ms) {
try {
String methodName = ms.getId().substring(ms.getId().lastIndexOf(".") + 1);
Class<?> mapperClass = Class.forName(ms.getId().substring(0, ms.getId().lastIndexOf(".")));
for (Method method : mapperClass.getMethods()) {
if (method.getName().equals(methodName)) {
return method;
}
}
} catch (ClassNotFoundException e) {
// 忽略异常
}
return null;
}
}

2
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.java

@ -6,6 +6,7 @@ import com.logpm.report.dto.ReportIncomingDetailDTO;
import com.logpm.report.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springblade.common.annotations.Master;
import java.util.List;
@ -13,6 +14,7 @@ import java.util.List;
public interface ReportIncomingMapper {
@Master
IPage<ReportDeptIncomingVO> deptIncomingPage(IPage<Object> page, @Param("param") ReportIncomingDTO reportIncomingDTO);
List<ReportDeptIncomingNumVO> findIncomingNum( @Param("param") ReportIncomingDTO reportIncomingDTO);

81
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.xml

@ -99,8 +99,15 @@
<if test="param.brands == null or param.brands.size() == 0 ">
'全部' brand,
</if>
YEAR(lww.document_making_time) nian,
MONTH(lww.document_making_time) yue,
<if test="param.type != null and param.type == 1">
YEAR(lww.document_making_time) timeStr,
</if>
<if test="param.type != null and param.type == 2">
CONCAT(YEAR(lww.document_making_time),'-Q',QUARTER(lww.document_making_time)) timeStr,
</if>
<if test="param.type != null and param.type == 3">
CONCAT(YEAR(lww.document_making_time),'-',MONTH(lww.document_making_time)) timeStr,
</if>
count(lww.id) waybillNum,
sum(lww.total_count) num,
sum(IFNULL(lww.total_weight,0)) weight,
@ -149,7 +156,19 @@
<if test="param.endTime != null ">
and lww.document_making_time &lt;= #{param.endTime}
</if>
group by YEAR(lww.document_making_time),
group by
<trim suffixOverrides=",">
<if test="param.type != null and param.type == 1">
YEAR(lww.document_making_time),
</if>
<if test="param.type != null and param.type == 2">
YEAR(lww.document_making_time),
QUARTER(lww.document_making_time),
</if>
<if test="param.type != null and param.type == 3">
YEAR(lww.document_making_time),
MONTH(lww.document_making_time),
</if>
<if test="param.businessLines != null and param.businessLines.size() > 0 ">
waw.business_line,
</if>
@ -164,7 +183,7 @@
<if test="param.brands != null and param.brands.size() > 0 ">
lww.brand,
</if>
MONTH(lww.document_making_time)
</trim>
</select>
@ -251,8 +270,15 @@
<if test="param.brands == null or param.brands.size() == 0 ">
'全部' brand,
</if>
YEAR(lww.document_making_time) nian,
MONTH(lww.document_making_time) yue,
<if test="param.type != null and param.type == 1">
YEAR(lww.document_making_time) timeStr,
</if>
<if test="param.type != null and param.type == 2">
CONCAT(YEAR(lww.document_making_time),'-Q',QUARTER(lww.document_making_time)) timeStr,
</if>
<if test="param.type != null and param.type == 3">
CONCAT(YEAR(lww.document_making_time),'-',MONTH(lww.document_making_time)) timeStr,
</if>
case when lww.waybill_type = '1' then count(ldpl.id)
when lww.waybill_type = '2' then sum(ldpn.quantity) end stockNum,
case when lww.waybill_type = '1' then sum(IF(ldpl.order_package_status='70',1,0))
@ -293,7 +319,19 @@
<if test="param.endTime != null ">
and lww.document_making_time &lt;= #{param.endTime}
</if>
group by YEAR(lww.document_making_time),
group by
<trim suffixOverrides=",">
<if test="param.type != null and param.type == 1">
YEAR(lww.document_making_time),
</if>
<if test="param.type != null and param.type == 2">
YEAR(lww.document_making_time),
QUARTER(lww.document_making_time),
</if>
<if test="param.type != null and param.type == 3">
YEAR(lww.document_making_time),
MONTH(lww.document_making_time),
</if>
<if test="param.businessLines != null and param.businessLines.size() > 0 ">
waw.business_line,
</if>
@ -306,7 +344,7 @@
<if test="param.brands != null and param.brands.size() > 0 ">
lww.brand,
</if>
MONTH(lww.document_making_time)
</trim>
</select>
@ -399,8 +437,15 @@
<if test="param.brands == null or param.brands.size() == 0 ">
'全部' brand,
</if>
YEAR(lww.document_making_time) nian,
MONTH(lww.document_making_time) yue,
<if test="param.type != null and param.type == 1">
YEAR(lww.document_making_time) timeStr,
</if>
<if test="param.type != null and param.type == 2">
CONCAT(YEAR(lww.document_making_time),'-Q',QUARTER(lww.document_making_time)) timeStr,
</if>
<if test="param.type != null and param.type == 3">
CONCAT(YEAR(lww.document_making_time),'-',MONTH(lww.document_making_time)) timeStr,
</if>
count(lww.id) waybillNum,
sum(lww.total_count) num,
sum(IFNULL(lww.total_weight,0)) weight,
@ -449,7 +494,19 @@
<if test="param.endTime != null ">
and lww.document_making_time &lt;= #{param.endTime}
</if>
group by YEAR(lww.document_making_time),
group by
<trim suffixOverrides=",">
<if test="param.type != null and param.type == 1">
YEAR(lww.document_making_time),
</if>
<if test="param.type != null and param.type == 2">
YEAR(lww.document_making_time),
QUARTER(lww.document_making_time),
</if>
<if test="param.type != null and param.type == 3">
YEAR(lww.document_making_time),
MONTH(lww.document_making_time),
</if>
<if test="param.businessLines != null and param.businessLines.size() > 0 ">
waw.business_line,
</if>
@ -464,7 +521,7 @@
<if test="param.brands != null and param.brands.size() > 0 ">
lww.brand,
</if>
MONTH(lww.document_making_time)
</trim>
</select>
<select id="consigineeIncomingPage" resultType="com.logpm.report.vo.ReportDeptIncomingVO">

28
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportQuallityMapper.xml

@ -157,6 +157,12 @@
and lww.departure_warehouse_id = #{param.departureWarehouseId}
and lww.destination_warehouse_id = #{param.destinationWarehouseId}
and lww.brand = #{param.brand}
<if test="param.startTime != null ">
and lww.create_time &gt;= #{param.startTime}
</if>
<if test="param.endTime != null ">
and lww.create_time &lt;= #{param.endTime}
</if>
<if test="param.updateWaybillDetailType != null and param.updateWaybillDetailType == 3">
and ltwt.refer = '发车前修改'
</if>
@ -188,8 +194,20 @@
lww.destination_warehouse_id destinationWarehouseId,
lww.destination_warehouse_name destinationWarehouseName,
lww.brand brand,
lww.waybill_status waybillStatus,
lww.waybill_type waybillType,
case when lww.waybill_status='10' then '部分入库'
when lww.waybill_status='20' then '入库'
when lww.waybill_status='30' then '部分中转'
when lww.waybill_status='40' then '中转'
when lww.waybill_status='50' then '目的仓部分到达'
when lww.waybill_status='60' then '目的仓到达'
when lww.waybill_status='70' then '配送部分装车'
when lww.waybill_status='80' then '配送装车'
when lww.waybill_status='90' then '部分签收'
when lww.waybill_status='100' then '已签收'
else '未知' end waybillStatus,
CASE WHEN lww.waybill_type=1 THEN '订制品'
WHEN lww.waybill_type=2 THEN '零担'
ELSE '未知' END waybillType,
lww.agent agent,
lww.create_time createTime,
ltwt.create_time applyTime,
@ -208,6 +226,12 @@
and lww.departure_warehouse_id = #{param.departureWarehouseId}
and lww.destination_warehouse_id = #{param.destinationWarehouseId}
and lww.brand = #{param.brand}
<if test="param.startTime != null ">
and lww.create_time &gt;= #{param.startTime}
</if>
<if test="param.endTime != null ">
and lww.create_time &lt;= #{param.endTime}
</if>
<if test="param.updateWaybillDetailType != null and param.updateWaybillDetailType == 3">
and ltwt.refer = '发车前修改'
</if>

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

@ -569,7 +569,7 @@
sum(ldpl.quantity) incomingNum,
count(ltcls.id) outNum,
sum(ldpl.quantity)-count(ltcls.id) noOutNum,
sum(if(ldpl.order_package_status='20' and now() &lt; DATE_ADD( ldpl.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0 )) noOutOverNum,
sum(if(ldpl.order_package_status='20' and now() &gt; DATE_ADD( ldpl.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0 )) noOutOverNum,
sum(if(ltcll.start_date &lt; DATE_ADD( ldpl.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) outOnTimeNum,
IFNULL(round(sum(if(ltcll.start_date &lt; DATE_ADD( ldpl.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0))/count(ltcls.id)*100,2),'0.00') outOnTimeRate,
round(sum(TIMESTAMPDIFF(SECOND, ldpl.create_time, ltcll.start_date))/count(ltcls.id)/3600,1) avgTime
@ -638,7 +638,7 @@
sum(ldpl.quantity) incomingNum,
count(ltcls.id) outNum,
sum(ldpl.quantity)-count(ltcls.id) noOutNum,
sum(if(ldpl.order_package_status='20' and now() &lt; DATE_ADD( ldpl.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0 )) noOutOverNum,
sum(if(ldpl.order_package_status='20' and now() &gt; DATE_ADD( ldpl.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0 )) noOutOverNum,
sum(if(ltcll.start_date &lt;= DATE_ADD( ldpl.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) outOnTimeNum,
IFNULL(concat(round(sum(if(ltcll.start_date &lt;= DATE_ADD( ldpl.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0))/count(ltcls.id)*100,2),'%'),'0.00%') outOnTimeRate,
round(sum(TIMESTAMPDIFF(SECOND, ldpl.create_time, ltcll.start_date))/count(ltcls.id)/3600,1) avgTime
@ -2547,8 +2547,8 @@
ldpl.create_time desIncomgingTime,
round(TIMESTAMPDIFF(SECOND,ltad.create_time,ldpl.create_time)/3600,1) incomingHours,
IFNULL(lrat.hours_time,#{param.hoursTime}) hoursTime,
case when round(TIMESTAMPDIFF(SECOND,ltad.create_time,ldpl.create_time)/3600,1)&lt;=IFNULL(lrat.hours_time,#{param.hoursTime}) then '0'
when round(TIMESTAMPDIFF(SECOND,ltad.create_time,ldpl.create_time)/3600,1)>IFNULL(lrat.hours_time,#{param.hoursTime}) then '1'
case when round(TIMESTAMPDIFF(SECOND,ltad.create_time,IFNULL(ldpl.create_time,NOW()))/3600,1)&lt;=IFNULL(lrat.hours_time,#{param.hoursTime}) then '0'
when round(TIMESTAMPDIFF(SECOND,ltad.create_time,IFNULL(ldpl.create_time,NOW()))/3600,1)>IFNULL(lrat.hours_time,#{param.hoursTime}) then '1'
else '未知' end isOverTime
from logpm_trunkline_advance_detail ltad
left join logpm_trunkline_advance lta on lta.id = ltad.advance_id
@ -2589,14 +2589,14 @@
<if test="param.trainNumber != null and param.trainNumber != ''">
and ltad.train_number like concat('%',#{param.trainNumber},'%')
</if>
<if test="param.isDesIncomging != null">
and IF(ldpl.id IS NULL,0,1) = #{param.isDesIncomging}
<if test="param.isDesIncoming != null">
and IF(ldpl.id IS NULL,0,1) = #{param.isDesIncoming}
</if>
<if test="param.isOverTime != null and param.isOverTime ==0">
and round(TIMESTAMPDIFF(SECOND,ltad.create_time,ldpl.create_time)/3600,1)&lt;=IFNULL(lrat.hours_time,#{param.hoursTime})
and round(TIMESTAMPDIFF(SECOND,ltad.create_time,IFNULL(ldpl.create_time,NOW()))/3600,1)&lt;=IFNULL(lrat.hours_time,#{param.hoursTime})
</if>
<if test="param.isOverTime != null and param.isOverTime ==1">
and round(TIMESTAMPDIFF(SECOND,ltad.create_time,ldpl.create_time)/3600,1)>IFNULL(lrat.hours_time,#{param.hoursTime})
and round(TIMESTAMPDIFF(SECOND,ltad.create_time,IFNULL(ldpl.create_time,NOW()))/3600,1)>IFNULL(lrat.hours_time,#{param.hoursTime})
</if>
<if test="param.allTrunklineTimeDetailType != null and param.allTrunklineTimeDetailType ==2">
and ldpl.id IS NOT NULL
@ -2606,7 +2606,7 @@
</if>
<if test="param.allTrunklineTimeDetailType != null and param.allTrunklineTimeDetailType ==4">
and ldpl.id IS NOT NULL
and round(TIMESTAMPDIFF(SECOND,ltad.create_time,ldpl.create_time)/3600,1)&lt;=IFNULL(lrat.hours_time,#{param.hoursTime})
and round(TIMESTAMPDIFF(SECOND,ltad.create_time,IFNULL(ldpl.create_time,NOW()))/3600,1)&lt;=IFNULL(lrat.hours_time,#{param.hoursTime})
</if>
@ -2639,8 +2639,8 @@
ldpl.create_time desIncomgingTime,
round(TIMESTAMPDIFF(SECOND,ltad.create_time,ldpl.create_time)/3600,1) incomingHours,
IFNULL(lrat.hours_time,#{param.hoursTime}) hoursTime,
case when round(TIMESTAMPDIFF(SECOND,ltad.create_time,ldpl.create_time)/3600,1)&lt;=IFNULL(lrat.hours_time,#{param.hoursTime}) then '未超时'
when round(TIMESTAMPDIFF(SECOND,ltad.create_time,ldpl.create_time)/3600,1)>IFNULL(lrat.hours_time,#{param.hoursTime}) then '超时'
case when round(TIMESTAMPDIFF(SECOND,ltad.create_time,IFNULL(ldpl.create_time,NOW()))/3600,1)&lt;=IFNULL(lrat.hours_time,#{param.hoursTime}) then '未超时'
when round(TIMESTAMPDIFF(SECOND,ltad.create_time,IFNULL(ldpl.create_time,NOW()))/3600,1)>IFNULL(lrat.hours_time,#{param.hoursTime}) then '超时'
else '未知' end isOverTime
from logpm_trunkline_advance_detail ltad
left join logpm_trunkline_advance lta on lta.id = ltad.advance_id
@ -2681,14 +2681,14 @@
<if test="param.trainNumber != null and param.trainNumber != ''">
and ltad.train_number like concat('%',#{param.trainNumber},'%')
</if>
<if test="param.isDesIncomging != null">
and IF(ldpl.id IS NULL,0,1) = #{param.isDesIncomging}
<if test="param.isDesIncoming != null">
and IF(ldpl.id IS NULL,0,1) = #{param.isDesIncoming}
</if>
<if test="param.isOverTime != null and param.isOverTime ==0">
and round(TIMESTAMPDIFF(SECOND,ltad.create_time,ldpl.create_time)/3600,1)&lt;=IFNULL(lrat.hours_time,#{param.hoursTime})
and round(TIMESTAMPDIFF(SECOND,ltad.create_time,IFNULL(ldpl.create_time,NOW()))/3600,1)&lt;=IFNULL(lrat.hours_time,#{param.hoursTime})
</if>
<if test="param.isOverTime != null and param.isOverTime ==1">
and round(TIMESTAMPDIFF(SECOND,ltad.create_time,ldpl.create_time)/3600,1)>IFNULL(lrat.hours_time,#{param.hoursTime})
and round(TIMESTAMPDIFF(SECOND,ltad.create_time,IFNULL(ldpl.create_time,NOW()))/3600,1)>IFNULL(lrat.hours_time,#{param.hoursTime})
</if>
<if test="param.allTrunklineTimeDetailType != null and param.allTrunklineTimeDetailType ==2">
and ldpl.id IS NOT NULL
@ -2698,7 +2698,7 @@
</if>
<if test="param.allTrunklineTimeDetailType != null and param.allTrunklineTimeDetailType ==4">
and ldpl.id IS NOT NULL
and round(TIMESTAMPDIFF(SECOND,ltad.create_time,ldpl.create_time)/3600,1)&lt;=IFNULL(lrat.hours_time,#{param.hoursTime})
and round(TIMESTAMPDIFF(SECOND,ltad.create_time,IFNULL(ldpl.create_time,NOW()))/3600,1)&lt;=IFNULL(lrat.hours_time,#{param.hoursTime})
</if>
</select>
@ -2776,8 +2776,8 @@
<if test="param.trainNumber != null and param.trainNumber != ''">
and ltad.train_number like concat('%',#{param.trainNumber},'%')
</if>
<if test="param.isDesIncomging != null">
and if(ltcll.start_date is null,0,1) = #{param.isDesIncomging}
<if test="param.isStarting != null">
and if(ltcll.start_date is null,0,1) = #{param.isStarting}
</if>
<if test="param.isOverTime != null and param.isOverTime ==0">
and round(TIMESTAMPDIFF(SECOND,ltad.incoming_time,IFNULL(ltcll.start_date,NOW()))/3600,1)&lt;=#{param.hoursTime}
@ -2876,8 +2876,8 @@
<if test="param.trainNumber != null and param.trainNumber != ''">
and ltad.train_number like concat('%',#{param.trainNumber},'%')
</if>
<if test="param.isDesIncomging != null">
and if(ltcll.start_date is null,0,1) = #{param.isDesIncomging}
<if test="param.isStarting != null">
and if(ltcll.start_date is null,0,1) = #{param.isStarting}
</if>
<if test="param.isOverTime != null and param.isOverTime ==0">
and round(TIMESTAMPDIFF(SECOND,ltad.incoming_time,IFNULL(ltcll.start_date,NOW()))/3600,1)&lt;=#{param.hoursTime}
@ -2929,9 +2929,9 @@
if(ltcll.start_date is null,0,1) isStarting,
ltcll.start_date startTime,
round(TIMESTAMPDIFF(SECOND,ldpl.create_time,IFNULL(ltcll.start_date,NOW()))/3600,1) startHours,
72 hoursTime,
case when round(TIMESTAMPDIFF(SECOND,ldpl.create_time,IFNULL(ltcll.start_date,NOW()))/3600,1)&lt;=72 then '未超时'
when round(TIMESTAMPDIFF(SECOND,ldpl.create_time,IFNULL(ltcll.start_date,NOW()))/3600,1)>72 then '超时'
#{param.hoursTime} hoursTime,
case when round(TIMESTAMPDIFF(SECOND,ldpl.create_time,IFNULL(ltcll.start_date,NOW()))/3600,1)&lt;=#{param.hoursTime} then '0'
when round(TIMESTAMPDIFF(SECOND,ldpl.create_time,IFNULL(ltcll.start_date,NOW()))/3600,1)>#{param.hoursTime} then '1'
else '未知' end isOverTime
from logpm_distribution_parcel_list ldpl
left join logpm_trunkline_advance lta on lta.id = ldpl.advance_id
@ -2976,8 +2976,8 @@
<if test="param.trainNumber != null and param.trainNumber != ''">
and ldpl.train_number like concat('%',#{param.trainNumber},'%')
</if>
<if test="param.isDesIncomging != null">
and if(ltcll.start_date is null,0,1) = #{param.isDesIncomging}
<if test="param.isStarting != null">
and if(ltcll.start_date is null,0,1) = #{param.isStarting}
</if>
<if test="param.isOverTime != null and param.isOverTime ==0">
and round(TIMESTAMPDIFF(SECOND,ldpl.create_time,IFNULL(ltcll.start_date,NOW()))/3600,1)&lt;=#{param.hoursTime}
@ -2993,7 +2993,7 @@
</if>
<if test="param.startDetailType != null and param.startDetailType ==3">
and ltcls.id is null
and now() &lt;= DATE_ADD( ldpl.create_time, INTERVAL #{param.hoursTime} HOUR )
and now() &gt;= DATE_ADD( ldpl.create_time, INTERVAL #{param.hoursTime} HOUR )
</if>
@ -3027,9 +3027,9 @@
if(ltcll.start_date is null,0,1) isStarting,
ltcll.start_date startTime,
round(TIMESTAMPDIFF(SECOND,ldpl.create_time,IFNULL(ltcll.start_date,NOW()))/3600,1) startHours,
72 hoursTime,
case when round(TIMESTAMPDIFF(SECOND,ldpl.create_time,IFNULL(ltcll.start_date,NOW()))/3600,1)&lt;=72 then '未超时'
when round(TIMESTAMPDIFF(SECOND,ldpl.create_time,IFNULL(ltcll.start_date,NOW()))/3600,1)>72 then '超时'
#{param.hoursTime} hoursTime,
case when round(TIMESTAMPDIFF(SECOND,ldpl.create_time,IFNULL(ltcll.start_date,NOW()))/3600,1)&lt;=#{param.hoursTime} then '未超时'
when round(TIMESTAMPDIFF(SECOND,ldpl.create_time,IFNULL(ltcll.start_date,NOW()))/3600,1)>#{param.hoursTime} then '超时'
else '未知' end isOverTime
from logpm_distribution_parcel_list ldpl
left join logpm_trunkline_advance lta on lta.id = ldpl.advance_id
@ -3074,8 +3074,8 @@
<if test="param.trainNumber != null and param.trainNumber != ''">
and ldpl.train_number like concat('%',#{param.trainNumber},'%')
</if>
<if test="param.isDesIncomging != null">
and if(ltcll.start_date is null,0,1) = #{param.isDesIncomging}
<if test="param.isStarting != null">
and if(ltcll.start_date is null,0,1) = #{param.isStarting}
</if>
<if test="param.isOverTime != null and param.isOverTime ==0">
and round(TIMESTAMPDIFF(SECOND,ldpl.create_time,IFNULL(ltcll.start_date,NOW()))/3600,1)&lt;=#{param.hoursTime}
@ -3091,7 +3091,7 @@
</if>
<if test="param.startDetailType != null and param.startDetailType ==3">
and ltcls.id is null
and now() &lt;= DATE_ADD( ldpl.create_time, INTERVAL #{param.hoursTime} HOUR )
and now() &gt;= DATE_ADD( ldpl.create_time, INTERVAL #{param.hoursTime} HOUR )
</if>
</select>

4
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/TrunklinePickupMapper.java

@ -7,6 +7,7 @@ import com.logpm.report.query.B2BDeliveryTimelinessQuery;
import com.logpm.report.query.TrunklinePickupEfficiencyDetailQuery;
import com.logpm.report.query.TrunklinePickupEfficiencyQuery;
import com.logpm.report.vo.trunklinebillloading.B2BDeliverTimelinessVO;
import com.logpm.report.vo.trunklinebillloading.TrunklinePickupEfficiencyCostVO;
import com.logpm.report.vo.trunklinebillloading.TrunklinePickupEfficiencyDetailVO;
import com.logpm.report.vo.trunklinebillloading.TrunklinePickupEfficiencyVO;
import org.apache.ibatis.annotations.Mapper;
@ -24,4 +25,7 @@ public interface TrunklinePickupMapper {
List<TrunklinePickupEfficiencyDetailVO> efficiencyDetailPage(@Param("page") IPage<TrunklinePickupEfficiencyDetailVO> page, @Param("query") TrunklinePickupEfficiencyDetailQuery query, @Param("qualifieTime") int qualifieTime, @Param("warehouseEntities") List<BasicdataWarehouseEntity> warehouseEntityList);
List<B2BDeliverTimelinessVO> b2BDeliveryTimelinessPage(@Param("page") IPage<B2BDeliverTimelinessVO> page, @Param("query") B2BDeliveryTimelinessQuery query, @Param("qualifieTime") int qualifieTime, @Param("warehouseEntities") List<BasicdataWarehouseEntity> warehouseEntityList);
List<TrunklinePickupEfficiencyCostVO> efficiencyCostPage(@Param("page") IPage<TrunklinePickupEfficiencyCostVO> page, @Param("query") TrunklinePickupEfficiencyDetailQuery query, @Param("qualifieTime") int qualifieTime, @Param("warehouseEntities") List<BasicdataWarehouseEntity> warehouseEntityList);
}

94
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/TrunklinePickupMapper.xml

@ -25,30 +25,30 @@
count(distinct ltb.billlading_code) pickupTruckCount,
ifnull(sum(ltb.plan_num), '0') totalPickupItemCount,
ifnull(sum(ltb.real_num), '0') pickedUpItemCount,
CASE
concat(CASE
WHEN SUM(ltb.plan_num) = 0 THEN '0'
ELSE ifnull(TRIM(TRAILING '.00' FROM FORMAT(ROUND(SUM(ltb.real_num) * 100.0 / SUM(ltb.plan_num), 2), 2)),
'0')
END AS pickupRate,
END,'%') AS pickupRate,
ifnull(sum(tt.num), '0') scannedPickupItemCount,
CASE
concat(CASE
WHEN SUM(ltb.real_num) = 0 THEN '0'
ELSE ifnull(TRIM(TRAILING '.00' FROM FORMAT(ROUND(SUM(tt.num) * 100.0 / SUM(ltb.real_num), 2), 2)), '0')
END AS scanRate,
ifnull(SUM(ttt.num), '0') batchPickupItemCount,
CASE
WHEN SUM(ltb.real_num) = 0 THEN '0'
ELSE ifnull(TRIM(TRAILING '.00' FROM FORMAT(ROUND(SUM(ttt.num) * 100.0 / SUM(ltb.real_num), 2), 2)), '0')
END AS batchPickupRate,
END,'%') AS scanRate,
(ifnull(sum(ltb.real_num), 0) - ifnull(sum(tt.num), 0)) batchPickupItemCount,
case
when sum(ltb.real_num) = 0 then '0'
else ifnull(TRIM(TRAILING '.00' from FORMAT(ROUND((ifnull(sum(ltb.real_num), 0) - ifnull(sum(tt.num), 0)) * 100.0 / sum(ltb.real_num), 2), 2)),
'0') end as batchPickupRate,
ifnull(sum(com.num), 0) completedPickupCount,
ifnull(sum(com.wcwcs), 0) qualifiedPickupCountWithin,
ifnull(sum(nocom.wwccs), 0) overdueIncompleteCount,
ifnull(sum(com.wccs), 0) overdueCompletedCount,
ifnull(avg(com.zq), 0) averagePickupCycle,
CASE
round(ifnull(avg(com.zq), 0),2) averagePickupCycle,
concat(CASE
WHEN SUM(com.num) = 0 THEN '0'
ELSE ifnull(TRIM(TRAILING '.00' FROM FORMAT(ROUND(SUM(com.wcwcs) * 100.0 / SUM(com.num), 2), 2)), '0')
END AS qualifiedPickupRate
END,'%') AS qualifiedPickupRate
from logpm_trunkline_billlading ltb
left join logpm_warehouse_warehouse lww on lww.id = ltb.warehouse_id
left join (select t.billlading_id, count(*) num
@ -61,13 +61,13 @@
group by t.billlading_id) ttt on ttt.billlading_id = ltb.id
left join(select t.id,
1 num,
TIMESTAMPDIFF(HOUR, t.create_time, ifnull(t.end_time,now())) zq,
case when TIMESTAMPDIFF(HOUR, t.create_time, ifnull(t.end_time,now())) > #{qualifieTime} then 1 else 0 end wccs,
case when TIMESTAMPDIFF(HOUR, t.create_time, ifnull(t.end_time,now())) <![CDATA[ <= ]]> #{qualifieTime} then 1 else 0 end wcwcs
round(TIMESTAMPDIFF(SECOND, t.create_time, t.end_time)/3600,2) zq,
case when round(TIMESTAMPDIFF(SECOND, t.create_time, t.end_time)/3600,2) > #{qualifieTime} then 1 else 0 end wccs,
case when round(TIMESTAMPDIFF(SECOND, t.create_time, t.end_time)/3600,2) <![CDATA[ <= ]]> #{qualifieTime} then 1 else 0 end wcwcs
from logpm_trunkline_billlading t
where t.billlading_status in ('3', '4')) com on com.id = ltb.id
left join(select t.id,
case when TIMESTAMPDIFF(HOUR, t.create_time, ifnull(t.end_time,now())) > #{qualifieTime} then 1 else 0 end wwccs
case when round(TIMESTAMPDIFF(SECOND, t.create_time, t.end_time)/3600,2) > #{qualifieTime} then 1 else 0 end wwccs
from logpm_trunkline_billlading t
where t.billlading_status in ('1', '2')) nocom on nocom.id = ltb.id
where ltb.is_deleted = 0 and ltb.billlading_status != 5
@ -110,6 +110,10 @@
<select id="efficiencyDetailPage"
resultType="com.logpm.report.vo.trunklinebillloading.TrunklinePickupEfficiencyDetailVO">
<include refid="efficiencyDetailSql"/>
</select>
<sql id="efficiencyDetailSql">
select
ltb.create_time pickupCreateTime,
ltb.billlading_code pickupBatch,
@ -133,12 +137,17 @@
ltb.real_volume volume,
ltb.plan_volume plannedVolume,
ltb.create_user createUserId,
TIMESTAMPDIFF(HOUR, ltb.create_time, ifnull(ltb.end_time,now())) actualPickupDuration,
round(TIMESTAMPDIFF(SECOND, ltb.create_time, ifnull(ltb.end_time,now()))/3600,2) actualPickupDuration,
rpec.time standardPickupDuration,
case
when TIMESTAMPDIFF(HOUR, ltb.create_time, ifnull(ltb.end_time,now())) > rpec.time then '是'
else '否' end pickupTimeout
when round(TIMESTAMPDIFF(SECOND, ltb.create_time, ifnull(ltb.end_time,now()))/3600,2) > rpec.time then '是'
else '否' end pickupTimeout,
case when lbda.type = '1' then '自有' when lbda.type = '2' then '加盟' when lbda.type = '3' then '外调' when lbda.type = '4' then '临调' end trainType,
lbcm.vehicle_model settlementType
from logpm_trunkline_billlading ltb
left join logpm_basicdata_driver_artery lbda on ltb.driver_id = lbda.id and lbda.is_deleted = 0
left join logpm_basicdata_vehicle lbv on lbv.vehicle_nub = ltb.car_number and lbv.is_deleted = 0
left join logpm_basic_car_model lbcm on lbcm.id = lbv.vehicle_model_id and lbcm.is_deleted = 0
left join logpm_warehouse_warehouse lww on lww.id = ltb.warehouse_id
left join logpm_report_pickup_efficiency_config rpec on rpec.type = 1
left join logpm_trunkline_billlading_line ltbl on ltbl.billlading_id = ltb.id and ltbl.is_deleted = 0
@ -182,14 +191,20 @@
<if test="query.driverPhone != null and query.driverPhone != ''">
and ltb.driver_phone like concat('%',#{query.driverPhone},'%')
</if>
<if test="query.settlementType != null and query.settlementType != ''">
and lbcm.vehicle_model like concat('%',#{query.settlementType},'%')
</if>
<if test="query.trainType != null and query.trainType != ''">
and case when lbda.type = '1' then '自有' when lbda.type = '2' then '加盟' when lbda.type = '3' then '外调' when lbda.type = '4' then '临调' end like concat('%',#{query.trainType},'%')
</if>
<if test="query.warehouseName != null and query.warehouseName != ''">
and ltb.warehouse_name = #{query.warehouseName}
</if>
<if test="query.pickupStartTimeStart != null and query.pickupStartTimeStart != ''">
and ltb.create_time >= #{query.pickupStartTimeStart}
and ltb.start_time >= #{query.pickupStartTimeStart}
</if>
<if test="query.pickupStartTimeEnd != null and query.pickupStartTimeEnd != ''">
and ltb.create_time &lt;= #{query.pickupStartTimeEnd}
and ltb.start_time &lt;= #{query.pickupStartTimeEnd}
</if>
<if test="query.pickupEndTimeStart != null and query.pickupEndTimeStart != ''">
and ltb.end_time >= #{query.pickupEndTimeStart}
@ -199,10 +214,10 @@
</if>
<if test="query.pickupTimeout != null and query.pickupTimeout != ''">
<if test="query.pickupTimeout == '否'.toString() ">
and TIMESTAMPDIFF(HOUR, ltb.create_time, ifnull(ltb.end_time,now())) &lt;= rpec.time
and round(TIMESTAMPDIFF(SECOND, ltb.create_time, ifnull(ltb.end_time,now()))/3600,2) &lt;= rpec.time
</if>
<if test="query.pickupTimeout == '是'.toString() ">
and TIMESTAMPDIFF(HOUR, ltb.create_time,ifnull(ltb.end_time,now())) > rpec.time
and round(TIMESTAMPDIFF(SECOND, ltb.create_time, ifnull(ltb.end_time,now()))/3600,2) > rpec.time
</if>
</if>
<if test="query.pickupStatus != null and query.pickupStatus != ''">
@ -217,20 +232,20 @@
</if>
<if test="query.type == 3">
and ltb.billlading_status in ('3', '4')
and TIMESTAMPDIFF(HOUR, ltb.create_time,ifnull(ltb.end_time,now())) &lt;= rpec.time
and round(TIMESTAMPDIFF(SECOND, ltb.create_time, ifnull(ltb.end_time,now()))/3600,2) &lt;= rpec.time
</if>
<if test="query.type == 4">
and ltb.billlading_status in ('1', '2')
and TIMESTAMPDIFF(HOUR, ltb.create_time, ifnull(ltb.end_time,now())) > rpec.time
and round(TIMESTAMPDIFF(SECOND, ltb.create_time, ifnull(ltb.end_time,now()))/3600,2) > rpec.time
</if>
<if test="query.type == 5">
and ltb.billlading_status in ('3', '4')
and TIMESTAMPDIFF(HOUR, ltb.create_time, ifnull(ltb.end_time,now())) > rpec.time
and round(TIMESTAMPDIFF(SECOND, ltb.create_time, ifnull(ltb.end_time,now()))/3600,2) > rpec.time
</if>
</if>
group by ltb.id
order by ltb.create_time desc
</select>
</sql>
<select id="b2BDeliveryTimelinessPage" resultType="com.logpm.report.vo.trunklinebillloading.B2BDeliverTimelinessVO">
select
@ -261,11 +276,17 @@
ifnull(sum(t.orderNum),0) orderNum,
ifnull(sum(t.num),0) num,
ifnull(sum(tt.signNum),0) signNum,
case when ifnull(sum(t.num),0) = 0 then 0 else round(ifnull(sum(tt.signNum),0)/ifnull(sum(t.num),0)) end signRate,
case when ifnull(sum(tt.signNum),0) = 0 then 0 else round(ifnull(sum(tt.batchNum),0)/ifnull(sum(tt.signNum),0)) end batchRate,
ifnull(sum(tt.batchNum),0) batchNum,
ifnull(sum(tt.hgNum),0) signOnTimeNum,
case when ifnull(sum(t.num),0) = 0 then 0 else round(ifnull(sum(tt.hgNum),0)/ifnull(sum(t.num),0)) end signOnTimeRate
concat(case
when ifnull(sum(t.num), 0) = 0 then 0
else round((ifnull(sum(tt.signNum), 0)*100) / ifnull(sum(t.num), 0),2) end, '%') as signRate,
concat(case
when ifnull(sum(tt.signNum), 0) = 0 then 0
else round((ifnull(sum(tt.batchNum), 0)*100) / ifnull(sum(tt.signNum), 0),2) end, '%') as batchRate,
ifnull(sum(tt.batchNum), 0) as batchNum,
ifnull(sum(tt.hgNum), 0) as signOnTimeNum,
concat(case
when ifnull(sum(t.num), 0) = 0 then 0
else round((ifnull(sum(tt.hgNum), 0)*100) / ifnull(sum(t.num), 0),2) end, '%') as signOnTimeRate
from (select lww.business_line, t.warehouse, t.brand_name,
case when ifnull(lbc.type_service,1) = 1 then '商配'
when ifnull(lbc.type_service,1) = 2 then '市配'
@ -278,7 +299,7 @@
left join logpm_basicdata_client lbc on lbc.client_name = lww1.consignee and lbc.is_deleted = 0
left join logpm_warehouse_warehouse lww on lww.id = t.warehouse_id
where t.warehouse_entry_time_end >= #{query.startCreateTime} and t.warehouse_entry_time_end &lt;= #{query.endCreateTime}
and t.is_transfer = 0
and t.is_transfer = 0 and (lbc.type_service != 2 or lbc.type_service is null)
<if test="query.businessLineRange != null and query.businessLineRange != ''">
and lww.business_line in
<foreach collection="query.businessLineRange.split(',')" item="businessLine" open="(" separator="," close=")">
@ -338,7 +359,7 @@
left join logpm_warehouse_waybill lww1 on lww1.waybill_no = t.waybill_number and lww1.is_deleted = 0
left join logpm_basicdata_client lbc on lbc.client_name = lww1.consignee and lbc.is_deleted = 0
where t.end_warehouse_in_time >= #{query.startCreateTime} and t.end_warehouse_in_time &lt;= #{query.endCreateTime}
and t.sign_num is not null
and t.sign_num is not null and (lbc.type_service != 2 or lbc.type_service is null)
<if test="query.businessLineRange != null and query.businessLineRange != ''">
and t.business_unit in
<foreach collection="query.businessLineRange.split(',')" item="businessLine" open="(" separator="," close=")">
@ -404,4 +425,9 @@
</trim>
</if>
</select>
<select id="efficiencyCostPage"
resultType="com.logpm.report.vo.trunklinebillloading.TrunklinePickupEfficiencyCostVO">
<include refid="efficiencyDetailSql"/>
</select>
</mapper>

6
blade-service/logpm-report/src/main/java/com/logpm/report/query/TrunklinePickupEfficiencyDetailQuery.java

@ -65,6 +65,12 @@ public class TrunklinePickupEfficiencyDetailQuery extends Query {
@ApiModelProperty(value = "提货是否超时")
private String pickupTimeout;
@ApiModelProperty(value = "车次类型")
private String trainType;
@ApiModelProperty(value = "车辆结算类型")
private String settlementType;
@ApiModelProperty(value = "1提货车次数 2提货完成数 3提货合格数 4超时未完成数 5超时完成数")
private Integer type;

4
blade-service/logpm-report/src/main/java/com/logpm/report/service/TrunklinePickupService.java

@ -5,6 +5,7 @@ import com.logpm.report.query.B2BDeliveryTimelinessQuery;
import com.logpm.report.query.TrunklinePickupEfficiencyDetailQuery;
import com.logpm.report.query.TrunklinePickupEfficiencyQuery;
import com.logpm.report.vo.trunklinebillloading.B2BDeliverTimelinessVO;
import com.logpm.report.vo.trunklinebillloading.TrunklinePickupEfficiencyCostVO;
import com.logpm.report.vo.trunklinebillloading.TrunklinePickupEfficiencyDetailVO;
import com.logpm.report.vo.trunklinebillloading.TrunklinePickupEfficiencyVO;
@ -24,4 +25,7 @@ public interface TrunklinePickupService {
void exportB2BDeliveryTimeliness(HttpServletResponse response, B2BDeliveryTimelinessQuery query);
IPage<TrunklinePickupEfficiencyCostVO> efficiencyCostPage(TrunklinePickupEfficiencyDetailQuery query);
void exportEfficiencyCost(HttpServletResponse response, TrunklinePickupEfficiencyDetailQuery query);
}

157
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportIncomingServiceImpl.java

@ -515,79 +515,11 @@ public class ReportIncomingServiceImpl implements IReportIncomingService {
page.setCurrent(reportIncomingDTO.getPageNum());
page.setSize(reportIncomingDTO.getPageSize());
String year = reportIncomingDTO.getYear();
String month = reportIncomingDTO.getMonth();
String startTimeStr = reportIncomingDTO.getStartTimeStr();
String endTimeStr = reportIncomingDTO.getEndTimeStr();
String timeStr = null;
if(StringUtil.isNotBlank(startTimeStr) && StringUtil.isNotBlank(endTimeStr)){
reportIncomingDTO.setStartTime(CommonUtil.getStartByDateStr(startTimeStr));
reportIncomingDTO.setEndTime(CommonUtil.getEndByDateStr(endTimeStr));
timeStr=startTimeStr+"至"+endTimeStr;
}else{
if(StringUtil.isNotBlank(month)){
Calendar instance = Calendar.getInstance();
if(StringUtil.isBlank(year)){
log.info("############deptIncomingPage:请选择年份");
return R.fail(405,"请选择年份");
}
try{
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
final Date parse = sdf.parse(year+"-"+month);
reportIncomingDTO.setStartTime(CommonUtil.StringToDate(sdf1.format(parse)));
final Calendar cal = Calendar.getInstance();
cal.setTime(parse);
final int last = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
cal.set(Calendar.DAY_OF_MONTH, last);
cal.add(Calendar.DATE, +1);
cal.add(Calendar.SECOND, -1);
reportIncomingDTO.setEndTime(cal.getTime());
timeStr = year+"年"+month+"月";
}catch (Exception e){
log.info("############deptIncomingPage:");
return R.fail(405,"请选择年份");
}
}else{
if(StringUtil.isNotBlank(year)){
Calendar instance = Calendar.getInstance();
instance.set(Calendar.YEAR,Integer.parseInt(year));
instance.set(Calendar.MONTH,Calendar.JANUARY);
instance.set(Calendar.DAY_OF_MONTH,1);
instance.set(Calendar.HOUR_OF_DAY, 0);
instance.set(Calendar.MINUTE, 0);
instance.set(Calendar.SECOND, 0);
instance.set(Calendar.MILLISECOND, 0);
reportIncomingDTO.setStartTime(instance.getTime());
instance.set(Calendar.MONTH,Calendar.DECEMBER);
instance.set(Calendar.DAY_OF_MONTH,31);
instance.set(Calendar.HOUR_OF_DAY, 23);
instance.set(Calendar.MINUTE, 59);
instance.set(Calendar.SECOND, 59);
instance.set(Calendar.MILLISECOND, 999);
reportIncomingDTO.setEndTime(instance.getTime());
timeStr = year+"年";
}else{
Calendar instance = Calendar.getInstance();
instance.set(Calendar.HOUR_OF_DAY, 23);
instance.set(Calendar.MINUTE, 59);
instance.set(Calendar.SECOND, 59);
instance.set(Calendar.MILLISECOND, 999);
reportIncomingDTO.setEndTime(instance.getTime());
instance.add(Calendar.DATE, -7);
instance.set(Calendar.HOUR_OF_DAY, 0);
instance.set(Calendar.MINUTE, 0);
instance.set(Calendar.SECOND, 0);
instance.set(Calendar.MILLISECOND, 0);
reportIncomingDTO.setStartTime(instance.getTime());
timeStr=CommonUtil.dateToStringGeneral(reportIncomingDTO.getStartTime())+"至"+CommonUtil.dateToStringGeneral(reportIncomingDTO.getEndTime());
}
}
}
IPage<ReportDeptIncomingVO> iPage = reportIncomingMapper.deptIncomingPageNew(page,reportIncomingDTO);
@ -595,10 +527,10 @@ public class ReportIncomingServiceImpl implements IReportIncomingService {
List<ReportDeptIncomingNumVO> ls = reportIncomingMapper.findIncomingNumNew(reportIncomingDTO);
//把ls转化为以businessLine,brand,departureWarehouseName,destinationWarehouseName为key的map
Map<String, ReportDeptIncomingNumVO> map = ls.stream()
.collect(Collectors.toMap(t-> t.getBusinessLine()+"&&"+t.getBrand()+"&&"+t.getDepartureWarehouseName()+"&&"+t.getDestinationWarehouseName()+"&&"+t.getNian()+"&&"+t.getYue(), reportDeptIncomingNumVO -> reportDeptIncomingNumVO));
.collect(Collectors.toMap(t-> t.getBusinessLine()+"&&"+t.getBrand()+"&&"+t.getDepartureWarehouseName()+"&&"+t.getDestinationWarehouseName()+"&&"+t.getTimeStr(), reportDeptIncomingNumVO -> reportDeptIncomingNumVO));
List<ReportDeptIncomingVO> records = iPage.getRecords();
String finalTimeStr = timeStr;
// String finalTimeStr = timeStr;
records.forEach(reportDeptIncomingVO -> {
String businessLine = reportDeptIncomingVO.getBusinessLine();
String brand = reportDeptIncomingVO.getBrand();
@ -606,8 +538,9 @@ public class ReportIncomingServiceImpl implements IReportIncomingService {
String destinationWarehouseName = reportDeptIncomingVO.getDestinationWarehouseName();
String nian = reportDeptIncomingVO.getNian();
String yue = reportDeptIncomingVO.getYue();
reportDeptIncomingVO.setTimeStr(finalTimeStr);
ReportDeptIncomingNumVO reportDeptIncomingNumVO = map.get(businessLine + "&&" + brand + "&&" + departureWarehouseName + "&&" + destinationWarehouseName+"&&"+nian+"&&"+yue);
String timeStr = reportDeptIncomingVO.getTimeStr();
// reportDeptIncomingVO.setTimeStr(finalTimeStr);
ReportDeptIncomingNumVO reportDeptIncomingNumVO = map.get(businessLine + "&&" + brand + "&&" + departureWarehouseName + "&&" + destinationWarehouseName+"&&"+timeStr);
if(!Objects.isNull(reportDeptIncomingNumVO)){
reportDeptIncomingVO.setStockNum(reportDeptIncomingNumVO.getStockNum());
reportDeptIncomingVO.setSignNum(reportDeptIncomingNumVO.getSignNum());
@ -620,79 +553,11 @@ public class ReportIncomingServiceImpl implements IReportIncomingService {
@Override
public void deptIncomingExportNew(ReportIncomingDTO reportIncomingDTO, HttpServletResponse response) {
String year = reportIncomingDTO.getYear();
String month = reportIncomingDTO.getMonth();
String startTimeStr = reportIncomingDTO.getStartTimeStr();
String endTimeStr = reportIncomingDTO.getEndTimeStr();
String timeStr = null;
if(StringUtil.isNotBlank(startTimeStr) && StringUtil.isNotBlank(endTimeStr)){
reportIncomingDTO.setStartTime(CommonUtil.getStartByDateStr(startTimeStr));
reportIncomingDTO.setEndTime(CommonUtil.getEndByDateStr(endTimeStr));
timeStr=startTimeStr+"至"+endTimeStr;
}else{
if(StringUtil.isNotBlank(month)){
Calendar instance = Calendar.getInstance();
if(StringUtil.isBlank(year)){
log.info("############deptIncomingPage:请选择年份");
throw new CustomerException(405,"请选择年份");
}
try{
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
final Date parse = sdf.parse(year+"-"+month);
reportIncomingDTO.setStartTime(CommonUtil.StringToDate(sdf1.format(parse)));
final Calendar cal = Calendar.getInstance();
cal.setTime(parse);
final int last = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
cal.set(Calendar.DAY_OF_MONTH, last);
cal.add(Calendar.DATE, +1);
cal.add(Calendar.SECOND, -1);
reportIncomingDTO.setEndTime(cal.getTime());
timeStr = year+"年"+month+"月";
}catch (Exception e){
log.info("############deptIncomingPage:请选择年份11111");
throw new CustomerException(405,"请选择年份");
}
}else{
if(StringUtil.isNotBlank(year)){
Calendar instance = Calendar.getInstance();
instance.set(Calendar.YEAR,Integer.parseInt(year));
instance.set(Calendar.MONTH,Calendar.JANUARY);
instance.set(Calendar.DAY_OF_MONTH,1);
instance.set(Calendar.HOUR_OF_DAY, 0);
instance.set(Calendar.MINUTE, 0);
instance.set(Calendar.SECOND, 0);
instance.set(Calendar.MILLISECOND, 0);
reportIncomingDTO.setStartTime(instance.getTime());
instance.set(Calendar.MONTH,Calendar.DECEMBER);
instance.set(Calendar.DAY_OF_MONTH,31);
instance.set(Calendar.HOUR_OF_DAY, 23);
instance.set(Calendar.MINUTE, 59);
instance.set(Calendar.SECOND, 59);
instance.set(Calendar.MILLISECOND, 999);
reportIncomingDTO.setEndTime(instance.getTime());
timeStr = year+"年";
}else{
Calendar instance = Calendar.getInstance();
instance.set(Calendar.HOUR_OF_DAY, 23);
instance.set(Calendar.MINUTE, 59);
instance.set(Calendar.SECOND, 59);
instance.set(Calendar.MILLISECOND, 999);
reportIncomingDTO.setEndTime(instance.getTime());
instance.add(Calendar.DATE, -7);
instance.set(Calendar.HOUR_OF_DAY, 0);
instance.set(Calendar.MINUTE, 0);
instance.set(Calendar.SECOND, 0);
instance.set(Calendar.MILLISECOND, 0);
reportIncomingDTO.setStartTime(instance.getTime());
timeStr=CommonUtil.dateToStringGeneral(reportIncomingDTO.getStartTime())+"至"+CommonUtil.dateToStringGeneral(reportIncomingDTO.getEndTime());
}
}
}
List<ReportDeptIncomingExportVO> list = reportIncomingMapper.deptIncomingExportNew(reportIncomingDTO);
@ -700,9 +565,7 @@ public class ReportIncomingServiceImpl implements IReportIncomingService {
List<ReportDeptIncomingNumVO> ls = reportIncomingMapper.findIncomingNumNew(reportIncomingDTO);
//把ls转化为以businessLine,brand,departureWarehouseName,destinationWarehouseName为key的map
Map<String, ReportDeptIncomingNumVO> map = ls.stream()
.collect(Collectors.toMap(t-> t.getBusinessLine()+"&&"+t.getBrand()+"&&"+t.getDepartureWarehouseName()+"&&"+t.getDestinationWarehouseName()+"&&"+t.getNian()+"&&"+t.getYue(), reportDeptIncomingNumVO -> reportDeptIncomingNumVO));
String finalTimeStr = timeStr;
.collect(Collectors.toMap(t-> t.getBusinessLine()+"&&"+t.getBrand()+"&&"+t.getDepartureWarehouseName()+"&&"+t.getDestinationWarehouseName()+"&&"+t.getTimeStr(), reportDeptIncomingNumVO -> reportDeptIncomingNumVO));
list.forEach(reportDeptIncomingVO -> {
String businessLine = reportDeptIncomingVO.getBusinessLine();
String brand = reportDeptIncomingVO.getBrand();
@ -710,9 +573,9 @@ public class ReportIncomingServiceImpl implements IReportIncomingService {
String destinationWarehouseName = reportDeptIncomingVO.getDestinationWarehouseName();
String nian = reportDeptIncomingVO.getNian();
String yue = reportDeptIncomingVO.getYue();
reportDeptIncomingVO.setTimeStr(finalTimeStr);
String timeStr = reportDeptIncomingVO.getTimeStr();
ReportDeptIncomingNumVO reportDeptIncomingNumVO = map.get(businessLine + "&&" + brand + "&&" + departureWarehouseName + "&&" + destinationWarehouseName+"&&"+nian+"&&"+yue);
ReportDeptIncomingNumVO reportDeptIncomingNumVO = map.get(businessLine + "&&" + brand + "&&" + departureWarehouseName + "&&" + destinationWarehouseName+"&&"+timeStr);
if(!Objects.isNull(reportDeptIncomingNumVO)){
reportDeptIncomingVO.setStockNum(reportDeptIncomingNumVO.getStockNum());
reportDeptIncomingVO.setSignNum(reportDeptIncomingNumVO.getSignNum());

54
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/TrunklinePickupServiceImpl.java

@ -13,6 +13,7 @@ import com.logpm.report.query.TrunklinePickupEfficiencyDetailQuery;
import com.logpm.report.query.TrunklinePickupEfficiencyQuery;
import com.logpm.report.service.TrunklinePickupService;
import com.logpm.report.vo.trunklinebillloading.B2BDeliverTimelinessVO;
import com.logpm.report.vo.trunklinebillloading.TrunklinePickupEfficiencyCostVO;
import com.logpm.report.vo.trunklinebillloading.TrunklinePickupEfficiencyDetailVO;
import com.logpm.report.vo.trunklinebillloading.TrunklinePickupEfficiencyVO;
import lombok.AllArgsConstructor;
@ -179,4 +180,57 @@ public class TrunklinePickupServiceImpl implements TrunklinePickupService {
List<B2BDeliverTimelinessVO> records = trunklinePickupEfficiencyVOIPage.getRecords();
ExcelUtil.export(response, "2B配送时效报表", "sheet1", records, B2BDeliverTimelinessVO.class);
}
@Override
public IPage<TrunklinePickupEfficiencyCostVO> efficiencyCostPage(TrunklinePickupEfficiencyDetailQuery query) {
IPage<TrunklinePickupEfficiencyCostVO> page = Condition.getPage(query);
// 条件中存在仓库
List<BasicdataWarehouseEntity> warehouseEntityList = new ArrayList<>();
// 是否切库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (ObjectUtil.isNotEmpty(myCurrentWarehouse)) {
warehouseEntityList.add(myCurrentWarehouse);
} else {
// 服务仓
List<BasicdataWarehouseEntity> warehouseEntities = warehouseClient.getMyWarehouseList();
if (CollUtil.isNotEmpty(warehouseEntities)) {
warehouseEntityList.addAll(warehouseEntities);
}
}
// 获取租户配置信息
int qualifieTime = trunklinePickupMapper.findConfig(1);
List<TrunklinePickupEfficiencyCostVO> list = trunklinePickupMapper.efficiencyCostPage(page, query, qualifieTime, warehouseEntityList);
if(CollUtil.isNotEmpty(list)){
String updateUserIds = list.stream()
.filter(vo -> ObjectUtil.isNotEmpty(vo.getCreateUserId()))
.map(TrunklinePickupEfficiencyCostVO::getCreateUserId)
.collect(Collectors.joining(","));
Map<String, String> userMap = new HashMap<>();
if (StrUtil.isNotEmpty(updateUserIds)) {
R<List<User>> listR = iUserClient.userInfoByIds(AuthUtil.getTenantId(), updateUserIds);
if (R.isSuccess(listR)) {
List<User> data = listR.getData();
for (User datum : data) {
userMap.put(Convert.toStr(datum.getId()), datum.getRealName());
}
}
}
for (TrunklinePickupEfficiencyCostVO trunklinePickupEfficiencyDetailVO : list) {
String createUserId = trunklinePickupEfficiencyDetailVO.getCreateUserId();
if (StrUtil.isNotEmpty(createUserId)) {
trunklinePickupEfficiencyDetailVO.setCreateUserName(userMap.get(createUserId));
}
}
}
return page.setRecords(list);
}
@Override
public void exportEfficiencyCost(HttpServletResponse response, TrunklinePickupEfficiencyDetailQuery query) {
query.setCurrent(1);
query.setSize(-1);
IPage<TrunklinePickupEfficiencyCostVO> trunklinePickupEfficiencyVOIPage = efficiencyCostPage(query);
List<TrunklinePickupEfficiencyCostVO> records = trunklinePickupEfficiencyVOIPage.getRecords();
ExcelUtil.export(response, "干线提货成本报表", "sheet1", records, TrunklinePickupEfficiencyCostVO.class);
}
}

1
blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportDeptIncomingNumVO.java

@ -14,6 +14,7 @@ public class ReportDeptIncomingNumVO implements Serializable {
private String consignee;//收货单位
private String nian;//年
private String yue;//月
private String timeStr;//时间
private Integer stockNum;
private Integer signNum;

141
blade-service/logpm-report/src/main/java/com/logpm/report/vo/trunklinebillloading/TrunklinePickupEfficiencyCostVO.java

@ -0,0 +1,141 @@
package com.logpm.report.vo.trunklinebillloading;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* 干线时效明细 报表 vo
*
* @author zhaoqiaobo
* @create 2024-03-06 16:02
*/
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
@ApiModel(value = "干线时效明细报表", description = "干线时效明细报表")
@Data
public class TrunklinePickupEfficiencyCostVO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "提货创建时间")
@ExcelProperty(value = "提货创建时间")
private String pickupCreateTime;
@ApiModelProperty(value = "提货批次")
@ExcelProperty(value = "提货批次")
private String pickupBatch;
@ApiModelProperty(value = "车牌号")
@ExcelProperty(value = "车牌号")
private String vehicleLicenseNumber;
@ApiModelProperty(value = "司机名称")
@ExcelProperty(value = "司机名称")
private String driverName;
@ApiModelProperty(value = "司机电话")
@ExcelProperty(value = "司机电话")
private String driverPhone;
@ApiModelProperty(value = "仓库名称")
@ExcelProperty(value = "仓库名称")
private String warehouseName;
@ApiModelProperty(value = "线路名称")
@ExcelProperty(value = "线路名称")
private String routeName;
@ApiModelProperty(value = "提货开始时间")
@ExcelProperty(value = "提货开始时间")
private String pickupStartTime;
@ApiModelProperty(value = "提货完成时间")
@ExcelProperty(value = "提货完成时间")
private String pickupEndTime;
@ApiModelProperty(value = "提货状态")
@ExcelProperty(value = "提货状态")
private String pickupStatus;
@ApiModelProperty(value = "计费模式")
@ExcelProperty(value = "计费模式")
private String billingMode;
@ApiModelProperty(value = "提货费用")
@ExcelProperty(value = "提货费用")
private String pickupFee;
@ApiModelProperty(value = "备注")
@ExcelProperty(value = "备注")
private String remarks;
@ApiModelProperty(value = "承运商")
@ExcelProperty(value = "承运商")
private String carrier;
@ApiModelProperty(value = "单数")
@ExcelProperty(value = "单数")
private String orderCount;
@ApiModelProperty(value = "件数")
@ExcelProperty(value = "件数")
private String itemQuantity;
@ApiModelProperty(value = "预计件数")
@ExcelProperty(value = "预计件数")
private String estimatedItemQuantity;
@ApiModelProperty(value = "重量")
@ExcelProperty(value = "重量")
private String weight;
@ApiModelProperty(value = "计划重量")
@ExcelProperty(value = "计划重量")
private String plannedWeight;
@ApiModelProperty(value = "体积")
@ExcelProperty(value = "体积")
private String volume;
@ApiModelProperty(value = "计划体积")
@ExcelProperty(value = "计划体积")
private String plannedVolume;
@ApiModelProperty(value = "实际提货时效")
@ExcelProperty(value = "实际提货时效")
private String actualPickupDuration;
@ApiModelProperty(value = "提货标准时效")
@ExcelProperty(value = "提货标准时效")
private String standardPickupDuration;
@ApiModelProperty(value = "提货是否超时")
@ExcelProperty(value = "提货是否超时")
private String pickupTimeout;
@ApiModelProperty(value = "创建人id")
@ExcelIgnore
private String createUserId;
@ApiModelProperty(value = "创建人")
@ExcelProperty(value = "创建人")
private String createUserName;
@ApiModelProperty(value = "车次类型")
@ExcelProperty(value = "车次类型")
private String trainType;
@ApiModelProperty(value = "车辆结算类型")
@ExcelProperty(value = "车辆结算类型")
private String settlementType;
}

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

@ -188,6 +188,9 @@
<if test="param.loadCarsNo != null and param.loadCarsNo != ''">
and Locate(#{param.loadCarsNo},ltcl.cars_no) > 0
</if>
<if test="param.loadStatus != null and param.loadStatus != ''">
and ltcl.load_status = #{param.loadStatus}
</if>
<if test="param.createTimeStart != null ">
and ltcl.create_time &gt;= #{param.createTimeStart}
</if>
@ -518,6 +521,7 @@
ltcl.is_settlement isSettlement,
ltcl.customer_type customerType,
ltcl.start_time startTime,
ltcl.arrive_time arriveTime,
ltcl.plan_loading_number planLoadingNumber,
ltcl.real_loading_number realLoadingNumber,
ltcl.unload_number unloadNumber,

37
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java

@ -23,6 +23,7 @@ import org.springblade.common.annotations.LogpmAsync;
import org.springblade.common.constant.broadcast.FanoutConstants;
import org.springblade.common.model.FanoutMsg;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.system.cache.UserCache;
@ -76,6 +77,9 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService {
private IDistributionParcelListClient distributionParcelListClient;
@Autowired
private ITrunklineCarsLoadScanService carsLoadScanService;
@Autowired
private BladeRedis bladeRedis;
@LogpmAsync("asyncExecutor")
@ -127,6 +131,15 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService {
// DynamicDataSourceContextHolder.clear();
}
private String buildKey(Long waybillId, String trackType, String refer, String operationRemark,Long userId, Long warehouseId){
StringBuffer stringBu = new StringBuffer();
stringBu.append(waybillId)
.append(trackType).append(refer).append(operationRemark).append(userId).append(warehouseId);
return stringBu.toString();
}
@Override
public void saveAbnormalLog(Long waybillId, String waybillNo, String trackType, String refer, String operationRemark, String nickName, Long userId, Long warehouseId, String warehouseName) {
if(Objects.isNull(waybillId)){
@ -139,9 +152,15 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService {
queryWrapper.eq("warehouse_id",warehouseId)
.eq("waybill_id",waybillId)
.eq("track_type",trackType);
TrunklineWaybillTrackEntity waybillTrackEntity = trunklineWaybillTrackService.getOne(queryWrapper);
if(Objects.isNull(waybillTrackEntity)){
waybillTrackEntity = new TrunklineWaybillTrackEntity();
List<TrunklineWaybillTrackEntity> list = trunklineWaybillTrackService.list(queryWrapper);
if(list.isEmpty()){
String key =buildKey(waybillId, waybillNo, trackType, refer, userId, warehouseId);
Object o = bladeRedis.get(key);
if(Objects.isNull(o)){
// 对这个保存方法进行10s的缓存锁 避免数据库的读写延迟
bladeRedis.setEx(key, "进入", 10L);
TrunklineWaybillTrackEntity waybillTrackEntity = new TrunklineWaybillTrackEntity();
waybillTrackEntity.setWarehouseId(warehouseId);
waybillTrackEntity.setWarehouseName(warehouseName);
waybillTrackEntity.setWaybillId(waybillId);
@ -153,6 +172,10 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService {
waybillTrackEntity.setCheckStatus(1);
waybillTrackEntity.setCheckTime(new Date());
trunklineWaybillTrackService.save(waybillTrackEntity);
}else{
log.warn("saveAbnormalLog >>>> 重复保存,不做处理");
}
}
}else{
TrunklineWaybillTrackEntity waybillTrackEntity = new TrunklineWaybillTrackEntity();
@ -176,8 +199,8 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService {
Long loadId = carsLoadLineEntity.getLoadId();
Integer sort = carsLoadLineEntity.getSort();
String tenantId = AuthUtil.getTenantId();
BladeUser user = AuthUtil.getUser();
// String tenantId = AuthUtil.getTenantId();
// BladeUser user = AuthUtil.getUser();
// DynamicDataSourceContextHolder.push(tenantId);
TrunklineCarsLoadEntity carsLoadEntity = trunklineCarsLoadService.getById(loadId);
@ -227,8 +250,8 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService {
Long loadId = carsLoadLineEntity.getLoadId();
Integer sort = carsLoadLineEntity.getSort();
String tenantId = AuthUtil.getTenantId();
BladeUser user = AuthUtil.getUser();
// String tenantId = AuthUtil.getTenantId();
// BladeUser user = AuthUtil.getUser();
// DynamicDataSourceContextHolder.push(tenantId);
TrunklineCarsLoadEntity carsLoadEntity = trunklineCarsLoadService.getById(loadId);

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

@ -3061,9 +3061,6 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
String warehouseName = openOrderDTO.getWarehouseName();
String editReson = openOrderDTO.getEditReson();
String refer = openOrderDTO.getRefer();
if(StringUtil.isBlank(refer)){
refer = " ";
}
List<TrunklineAdvanceDetailEntity> updateAdvanceDetailList = openOrderDTO.getUpdateAdvanceDetailList();
WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillId(waybillId);
@ -3149,9 +3146,14 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
advanceDetailService.updateBatchById(updateAdvanceDetailList);
}
// String operationRemark = "修改运单"+waybillNo+",时间:"+ CommonUtil.dateToString(waybillEntity.getCreateTime())+","+updateMsg;
String operationRemark = "备注:" + refer + " 修改内容:" + updateMsg;
if(StringUtil.isBlank(refer)){
operationRemark = "修改内容:" + updateMsg;
}
//异步存入日志
openOrderAsyncService.saveUpdateLog(waybillId, waybillNo, "888", editReson, "备注:" + refer + " 修改内容:" + updateMsg, AuthUtil.getNickName(), AuthUtil.getUserId(), warehouseId, warehouseName, waybillEntity);
openOrderAsyncService.saveUpdateLog(waybillId, waybillNo, "888", editReson, operationRemark, AuthUtil.getNickName(), AuthUtil.getUserId(), warehouseId, warehouseName, waybillEntity);
// List<WarehouseWayBillDetail> wayBillDetailList = warehouseWaybillDetailClient.findListByWaybillNo(waybillNo);

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

@ -540,6 +540,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
.packageCode(data.getPackageCode())
.waybillNumber(data.getWaybillNumber())
.warehouseName(warehouseEntity.getName())
.destinationWarehouse(data.getEndWarehouseName())
.waybillStartWarehouse(data.getStartWarehouseName())
.orderCode(data.getOrderCode())
.build();
}).collect(Collectors.toList()))
@ -860,7 +862,14 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//中间网点发车
trunklineCarsLoadLineService.updateStartTime(currentCarsLoadLineEntity.getId(),"10",null,null,null);
baseMapper.updateStartTime(loadId,"20",null);
Integer sort1 = currentCarsLoadLineEntity.getSort();
TrunklineCarsLoadLineEntity carsLoadLine = trunklineCarsLoadLineService.findEntityByLoadIdAndSort(loadId, sort1 - 1);
if(!Objects.isNull(carsLoadLine)){
baseMapper.updateStartTime(loadId,"20",carsLoadLine.getStartDate());
}
// carsLoadEntity.setLoadStatus("20");
// carsLoadEntity.setStartTime(null);
// updateById(carsLoadEntity);
@ -3339,12 +3348,28 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
throw new CustomerException(400, "三方中转节点不存在");
}
String deliveryType = carsLoadEntity.getDeliveryType();
if("1".equals(deliveryType)){
List<Long> scanLoadIds = trunklineCarsLoadScanService.findAllIdListByLoadIdAndScanStatus(loadId,"1");
// List<Long> scanLoadIds = trunklineCarsLoadScanService.findAllIdListByLoadIdAndNoScanStatus(loadId,"3");
return signLoadScanByIds(scanLoadIds,warehouseId);
}else if("2".equals(deliveryType)){
List<Long> scanLoadIds = trunklineCarsLoadScanService.findAllIdListByLoadIdAndScanStatus(loadId,"2");
return signLoadScanByIds(scanLoadIds,warehouseId);
}else{
log.warn("#############signCars: 三方中转送货方式不存在 loadId={}", loadId);
return R.fail(405,"三方中转送货方式不存在");
}
// List<Long> scanLoadIds = trunklineCarsLoadScanService.findAllIdListByLoadIdAndNoScanStatus(loadId,"3");
// List<Long> scanLoadIds = trunklineCarsLoadScanService.findAllIdListByLoadIdAndScanStatus(loadId,"2");
//
// return signLoadScanByIds(scanLoadIds,warehouseId);
// carsLoadEntity.setSignTime(new Date());
// carsLoadEntity.setLoadStatus("90");
// updateById(carsLoadEntity);
@ -3402,6 +3427,15 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
@Override
public R loadingDetail(LoadCarsDTO loadCarsDTO) {
Long loadId = loadCarsDTO.getLoadId();
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if(Objects.isNull(carsLoadEntity)){
log.warn("################loadingDetail: 配载信息不存在 loadId={}",loadId);
return R.fail(405,"配载信息不存在");
}
IPage<Object> page = new Page<>();
page.setCurrent(loadCarsDTO.getPageNum());
page.setSize(loadCarsDTO.getPageSize());
@ -3437,6 +3471,16 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
});
}
pageList.setRecords(records);
// Map<String, Object> map = new HashMap<>();
// map.put("data", pageList);
//
// String loadType = carsLoadEntity.getLoadType();
// String deliveryType = carsLoadEntity.getDeliveryType();
// map.put("loadType",loadType);
// map.put("deliveryType",deliveryType);
return R.data(pageList);
}
@ -10790,9 +10834,20 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
.filter(parcelListEntity -> !"20".equals(parcelListEntity.getOrderPackageStatus()))
.collect(Collectors.toList());
int allTotal = packageList.size();
if(CollUtil.isNotEmpty(noStockParcelListEntityList)){
log.warn("##################loadingTrayPackageList: 存在不在库的包件 warehouseId={}", warehouseId);
throw new CustomerException(405, "存在不在库的包件");
int size = noStockParcelListEntityList.size();
if(NumberUtil.equals(allTotal,size)){
log.warn("##################loadingTrayPackageList: 托盘已经装车 warehouseId={}", warehouseId);
throw new CustomerException(405, "托盘已经装车");
}else{
log.warn("##################loadingTrayPackageList: 托盘数据异常 warehouseId={}", warehouseId);
throw new CustomerException(405, "托盘数据异常,请联系管理员");
}
}
List<String> noPlanPackageList = new ArrayList<>();

12
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/config/MyBatisConfig.java

@ -0,0 +1,12 @@
package com.logpm.warehouse.config;
import com.logpm.warehouse.interceptor.MasterCommentInterceptor;
import org.springframework.context.annotation.Bean;
//@Configuration
public class MyBatisConfig {
// @Bean
// public MasterCommentInterceptor masterCommentInterceptor() {
// return new MasterCommentInterceptor();
// }
}

99
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/interceptor/MasterCommentInterceptor.java

@ -0,0 +1,99 @@
package com.logpm.warehouse.interceptor;
import org.apache.ibatis.mapping.BoundSql;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.plugin.Interceptor;
import org.apache.ibatis.plugin.Invocation;
import org.apache.ibatis.plugin.Plugin;
import org.springblade.common.annotations.Master;
import java.lang.reflect.Method;
import java.util.Properties;
//@Intercepts({
// @Signature(
// type = Executor.class,
// method = "query",
// args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class}
// )
//})
public class MasterCommentInterceptor implements Interceptor {
@Override
public Object intercept(Invocation invocation) throws Throwable {
// 获取当前执行的 MappedStatement
MappedStatement ms = (MappedStatement) invocation.getArgs()[0];
// 检查方法是否标记了 @Master 注解
Method method = getMethodFromMappedStatement(ms);
if (method != null && method.isAnnotationPresent(Master.class)) {
// 获取原始 SQL
BoundSql boundSql = ms.getBoundSql(invocation.getArgs()[1]);
String originalSql = boundSql.getSql();
// 添加 /*master*/ 注释
String newSql = "/*FORCE_MASTER*/ " + originalSql;
// 创建新的 BoundSql 和 MappedStatement
BoundSql newBoundSql = new BoundSql(
ms.getConfiguration(),
newSql,
boundSql.getParameterMappings(),
boundSql.getParameterObject()
);
MappedStatement newMs = rebuildMappedStatement(ms, newBoundSql);
// 替换原参数中的 MappedStatement
invocation.getArgs()[0] = newMs;
}
return invocation.proceed();
}
// 根据 MappedStatement 获取对应的 Method
private Method getMethodFromMappedStatement(MappedStatement ms) {
try {
String methodName = ms.getId().substring(ms.getId().lastIndexOf(".") + 1);
Class<?> mapperClass = Class.forName(ms.getId().substring(0, ms.getId().lastIndexOf(".")));
for (Method method : mapperClass.getMethods()) {
if (method.getName().equals(methodName)) {
return method;
}
}
} catch (ClassNotFoundException e) {
// 忽略异常
}
return null;
}
// 重建 MappedStatement(避免缓存污染)
private MappedStatement rebuildMappedStatement(MappedStatement ms, BoundSql newBoundSql) {
MappedStatement.Builder builder = new MappedStatement.Builder(
ms.getConfiguration(),
ms.getId() + "-master",
ms.getSqlSource(),
ms.getSqlCommandType()
);
builder.resource(ms.getResource())
.fetchSize(ms.getFetchSize())
.statementType(ms.getStatementType())
.keyGenerator(ms.getKeyGenerator())
.keyProperty(String.join(",", ms.getKeyProperties()))
.timeout(ms.getTimeout())
.parameterMap(ms.getParameterMap())
.resultMaps(ms.getResultMaps())
.resultSetType(ms.getResultSetType())
.cache(ms.getCache())
.flushCacheRequired(ms.isFlushCacheRequired())
.useCache(ms.isUseCache())
.databaseId(ms.getDatabaseId());
return builder.build();
}
@Override
public Object plugin(Object target) {
return Plugin.wrap(target, this);
}
@Override
public void setProperties(Properties properties) {}
}

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

@ -495,9 +495,15 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
}
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, warehouseId);
if (Objects.isNull(parcelListEntity)) {
TrunklineAdvanceDetailEntity trunklineAdvanceDetail = trunklineAdvanceDetailClient.findEntityByOrderPackageCode(orderPackageCode);
if(Objects.isNull(trunklineAdvanceDetail)){
log.warn("##############orderScanOrderPackageCode: 包件不存在 orderPackageCode={} warehouseId={}", orderPackageCode, warehouseId);
return Resp.scanFail(2001, "包件不存在", "系统无编码");
}
log.warn("##############orderScanOrderPackageCode: 包件不在当前仓 orderPackageCode={} warehouseId={}", orderPackageCode, warehouseId);
return Resp.scanFail(2001, "包件不在当前仓", "包件不在当前仓");
}
String orderPackageStatus = parcelListEntity.getOrderPackageStatus();
if (!"20".equals(orderPackageStatus)) {
log.warn("##############orderScanOrderPackageCode: 包件已不在库 orderPackageCode={} warehouseId={}", orderPackageCode, warehouseId);
@ -536,7 +542,13 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
if (Objects.isNull(trayTypeEntity)) {
//如果为空则该托盘为空
//第一次存入数据
try{
trayTypeEntity = saveTrayTypeByOrderPackageCode(trayType, trayCode, trayId, parcelListEntity, stockArticleEntity, warehouseId);
}catch (CustomerException e){
return R.fail(e.code,e.message);
}catch (Exception e){
return R.fail(500,e.getMessage());
}
}
String tt = trayTypeEntity.getTrayType();
Long filterId = trayTypeEntity.getFilterId();
@ -1112,7 +1124,13 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
if (Objects.isNull(trayTypeEntity)) {
//如果为空则该托盘为空
//第一次存入数据
try{
trayTypeEntity = saveTrayTypeByOrderPackageCode(trayType, trayCode, trayId, parcelListEntity, stockArticleEntity, warehouseId);
}catch (CustomerException e){
return R.fail(e.code,e.message);
}catch (Exception e){
return R.fail(500,e.getMessage());
}
}
String filterValue = trayTypeEntity.getFilterValue();
@ -1386,7 +1404,14 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
if (Objects.isNull(trayTypeEntity)) {
//如果为空则该托盘为空
//第一次存入数据
try{
trayTypeEntity = saveTrayTypeByOrderPackageCode(trayType, trayCode, trayId, parcelListEntity, stockArticleEntity, warehouseId);
}catch (CustomerException e){
return R.fail(e.code,e.message);
}catch (Exception e){
return R.fail(500,e.getMessage());
}
}
String tt = trayTypeEntity.getTrayType();
Long filterId = trayTypeEntity.getFilterId();

62
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java

@ -15,6 +15,8 @@ import com.logpm.distribution.feign.IDistributionParcelListClient;
import com.logpm.distribution.feign.IDistributionStockArticleClient;
import com.logpm.distribution.feign.IDistributionStockListClient;
import com.logpm.distribution.feign.IDistributionStockListInfoClient;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.feign.ITrunklineAdvanceDetailClient;
import com.logpm.warehouse.bean.Resp;
import com.logpm.warehouse.dto.*;
import com.logpm.warehouse.entity.*;
@ -69,6 +71,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
private final ISendFanoutService sendFanoutService;
private final IWarehousePackageTrackLogService warehousePackageTrackLogService;
private final BladeRedis bladeRedis;
private final ITrunklineAdvanceDetailClient trunklineAdvanceDetailClient;
@Override
public boolean packageChangeStock(List<String> orderPackageCodes) {
@ -508,15 +511,21 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
//包条码查询服务号维度
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(code, warehouseId);
if (Objects.isNull(parcelListEntity)) {
log.warn("#################findUpShelfScanGoods: 包件信息不存在 code={}", code);
throw new CustomerException(403, "包件信息不存在");
TrunklineAdvanceDetailEntity trunklineAdvanceDetail = trunklineAdvanceDetailClient.findEntityByOrderPackageCode(code);
if(Objects.isNull(trunklineAdvanceDetail)){
log.warn("##############findUpShelfScanGoods: 包件不存在 orderPackageCode={} warehouseId={}", code, warehouseId);
throw new CustomerException(403, "系统无编码");
}
String orderCode = parcelListEntity.getOrderCode();
Long wid = parcelListEntity.getWarehouseId();
if (!wid.equals(warehouseId)) {
log.warn("#################findUpShelfScanGoods: 包件不在当前仓库 orderPackageCode={}", code);
throw new CustomerException(403, "包件不在当前仓库");
log.warn("##############findUpShelfScanGoods: 包件不在当前仓 orderPackageCode={} warehouseId={}", code, warehouseId);
throw new CustomerException(403, "包件不在当前仓");
}
String orderCode = parcelListEntity.getOrderCode();
// Long wid = parcelListEntity.getWarehouseId();
// if (!wid.equals(warehouseId)) {
// log.warn("#################findUpShelfScanGoods: 包件不在当前仓库 orderPackageCode={}", code);
// throw new CustomerException(403, "包件不在当前仓库");
// }
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
if (Objects.isNull(stockArticleEntity)) {
log.warn("#################findUpShelfScanGoods: 订单信息不存在 orderCode={}", orderCode);
@ -544,15 +553,22 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
} else if (upshelfScanType == 2) {
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(code, warehouseId);
if (Objects.isNull(parcelListEntity)) {
log.warn("#################findUpShelfScanGoods: 包件信息不存在 orderPackageCode={}", code);
throw new CustomerException(403, "包件信息不存在");
TrunklineAdvanceDetailEntity trunklineAdvanceDetail = trunklineAdvanceDetailClient.findEntityByOrderPackageCode(code);
if(Objects.isNull(trunklineAdvanceDetail)){
log.warn("##############findUpShelfScanGoods: 包件不存在 orderPackageCode={} warehouseId={}", code, warehouseId);
throw new CustomerException(403, "系统无编码");
}
String orderCode = parcelListEntity.getOrderCode();
Long wid = parcelListEntity.getWarehouseId();
if (!wid.equals(warehouseId)) {
log.warn("#################findUpShelfScanGoods: 包件不在当前仓库 orderPackageCode={}", code);
throw new CustomerException(403, "包件不在当前仓库");
log.warn("##############findUpShelfScanGoods: 包件不在当前仓 orderPackageCode={} warehouseId={}", code, warehouseId);
throw new CustomerException(403, "包件不在当前仓");
}
String orderCode = parcelListEntity.getOrderCode();
// Long wid = parcelListEntity.getWarehouseId();
// if (!wid.equals(warehouseId)) {
// log.warn("#################findUpShelfScanGoods: 包件不在当前仓库 orderPackageCode={}", code);
// throw new CustomerException(403, "包件不在当前仓库");
// }
Map map = distributionStockArticleClient.findShelfNumByOrderCodeAndWarehouseId(orderCode, warehouseId);
if (Objects.isNull(map)) {
@ -573,14 +589,20 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
//包条码查询服务号维度
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(code, warehouseId);
if (Objects.isNull(parcelListEntity)) {
log.warn("#################findUpShelfScanGoods: 包件信息不存在 code={}", code);
throw new CustomerException(403, "包件信息不存在");
TrunklineAdvanceDetailEntity trunklineAdvanceDetail = trunklineAdvanceDetailClient.findEntityByOrderPackageCode(code);
if(Objects.isNull(trunklineAdvanceDetail)){
log.warn("##############findUpShelfScanGoods: 包件不存在 orderPackageCode={} warehouseId={}", code, warehouseId);
throw new CustomerException(403, "系统无编码");
}
Long wid = parcelListEntity.getWarehouseId();
if (!wid.equals(warehouseId)) {
log.warn("#################findUpShelfScanGoods: 包件不在当前仓库 orderPackageCode={}", code);
throw new CustomerException(403, "包件不在当前仓库");
log.warn("##############findUpShelfScanGoods: 包件不在当前仓 orderPackageCode={} warehouseId={}", code, warehouseId);
throw new CustomerException(403, "包件不在当前仓");
}
// Long wid = parcelListEntity.getWarehouseId();
// if (!wid.equals(warehouseId)) {
// log.warn("#################findUpShelfScanGoods: 包件不在当前仓库 orderPackageCode={}", code);
// throw new CustomerException(403, "包件不在当前仓库");
// }
String orderCode = parcelListEntity.getOrderCode();
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
if (Objects.isNull(stockArticleEntity)) {

Loading…
Cancel
Save