Browse Source

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

master
zhenghaoyu 2 days ago
parent
commit
3f5711f2fb
  1. 24
      blade-biz-common/src/main/java/org/springblade/common/constant/order/OrderSplitStatusConstant.java
  2. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockArticleEntity.java
  3. 10
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/queryOrderVO.java
  4. 4
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineAdvanceDetailClient.java
  5. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSplitOrderTaskController.java
  6. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSplitOrderTaskService.java
  7. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  8. 74
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java
  9. 23
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  10. 18
      blade-service/logpm-factory-data/logpm-factory-data-paterson/src/main/java/com/logpm/factorydata/paterson/interceptor/FactoryAccountsInterceptor.java
  11. 4
      blade-service/logpm-report/src/main/java/com/logpm/report/config/MybatisPlusConfig.java
  12. 26
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml
  13. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/TrunklinePickupMapper.xml
  14. 6
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/QualityDispatchNumberServiceImpl.java
  15. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportDeliverServiceImpl.java
  16. 7
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineAdvanceDetailClient.java
  17. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java
  18. 11
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml
  19. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java
  20. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java
  21. 42
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

24
blade-biz-common/src/main/java/org/springblade/common/constant/order/OrderSplitStatusConstant.java

@ -0,0 +1,24 @@
package org.springblade.common.constant.order;
import lombok.Getter;
/**
* 订单拆单状态
* 状态0=1=进行中
*/
@Getter
public enum OrderSplitStatusConstant {
No("无",0),
InProgress("进行中",1);
private final String name;
private final Integer value;
OrderSplitStatusConstant(String name, Integer value) {
this.name = name;
this.value = value;
}
}

3
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockArticleEntity.java

@ -454,6 +454,9 @@ public class DistributionStockArticleEntity extends TenantEntity {
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "拆单状态")
private Integer splitStatus;
/**
/* * 未入库数量
*//*

10
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/queryOrderVO.java

@ -1,9 +1,8 @@
package com.logpm.distribution.vo.app;
import com.alibaba.fastjson.JSONObject;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.vo.DistributionParcelListVO;
import com.logpm.distribution.vo.DistributionStockListInfoVO;
import com.logpm.distribution.vo.DistributionStockListVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -42,4 +41,11 @@ public class queryOrderVO extends DistributionStockArticleEntity {
private Integer inventoryNum;
/**
* 未入库包件列表
*/
@ApiModelProperty(value = "未入库包件列表")
private List<JSONObject> noIncomingList;
}

4
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineAdvanceDetailClient.java

@ -1,7 +1,6 @@
package com.logpm.trunkline.feign;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
import org.springblade.common.constant.ModuleNameConstant;
import org.springblade.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
@ -48,4 +47,7 @@ public interface ITrunklineAdvanceDetailClient {
@PostMapping(API_PREFIX + "/maintainMaterial")
R maintainMaterial(@RequestBody Map<String,Object> map);
@GetMapping(API_PREFIX+"/findListByStockArticleId")
List<TrunklineAdvanceDetailEntity> findListByStockArticleId(@RequestParam Long stockArticleId, @RequestParam Long warehouseId);
}

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSplitOrderTaskController.java

@ -117,6 +117,11 @@ public class DistributionSplitOrderTaskController {
return distributionSplitOrderTaskService.checkOrderCode(orderCode);
}
@GetMapping("/check-order-code-by-stock-article-id")
public R<String> checkOrderCode(Long stockArticleId) {
return distributionSplitOrderTaskService.checkOrderCode(stockArticleId);
}
@GetMapping("/get-package-code-by-order-code")
public R<IPage<SplitPackageOrderVO>> getPackageCodeByOrderCode(Query query, String orderCode) {
return distributionSplitOrderTaskService.getPackageCodeByOrderCode(query, orderCode);
@ -126,4 +131,9 @@ public class DistributionSplitOrderTaskController {
public R<List<SplitPackageOrderVO>> getPackageCodeByTaskId(Long taskId) {
return distributionSplitOrderTaskService.getPackageCodeByTaskId( taskId);
}
@GetMapping("/get-allow-split-order-number")
public R<Long> getAllowSplitOrderNumber(Long stockArticleId){
return R.data(distributionSplitOrderTaskService.getSplitOrderAllowCount(stockArticleId));
}
}

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

@ -117,6 +117,10 @@ public interface IDistributionSplitOrderTaskService extends BaseService<Distribu
R<String> checkOrderCode(String orderCode);
R<String> checkOrderCode(Long stockArticleId);
long getSplitOrderAllowCount(Long stockArticleId);
R<List<SplitPackageOrderVO>> getPackageCodeByTaskId(Long taskId);
R<IPage<SplitPackageOrderVO>> getPackageCodeByOrderCode(Query query, String orderCode);

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

@ -6881,7 +6881,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionReservationPackageService.save(reservationPackageEntity);
Map<String, List> map = new HashMap<>();
map.put("1", Collections.singletonList(reservationPackageEntity));
NodeFanoutMsg<ReservationVO> nodeFanoutMsg = distributionReservationService.buildNodeFanoutMsgByReservation(reservationEntity, map, BizOperationEnums.MODIFY);
NodeFanoutMsg<ReservationVO> nodeFanoutMsg = distributionReservationService.buildNodeFanoutMsgByReservation(reservationEntity, map, BizOperationEnums.ADD);
distributionNodeWorkService.planReservation(nodeFanoutMsg,AuthUtil.getUser());
//维护包件的预约状态
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(distributionLoadscanAbnormalEntity.getPackageId());

74
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java

@ -28,13 +28,9 @@ import com.logpm.distribution.vo.DistributionSplitOrderTaskVO;
import com.logpm.distribution.vo.SplitPackageOrderVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.order.OrderReservationStatusConstant;
import org.springblade.common.constant.order.OrderSplitAllTaskStateConstant;
import org.springblade.common.constant.order.OrderSplitStateConstant;
import org.springblade.common.constant.order.OrderStatusConstant;
import org.springblade.common.constant.order.*;
import org.springblade.common.constant.orderpackage.*;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.mp.base.BaseEntity;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
@ -42,9 +38,7 @@ import org.springblade.core.redis.lock.LockType;
import org.springblade.core.redis.lock.RedisLockClient;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.system.cache.UserCache;
import org.springblade.system.entity.User;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.feign.IUserClient;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -136,7 +130,8 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
if (distributionStockArticle == null) {
return R.fail("原订单信息错误");
}
if (!Objects.equals(distributionStockArticle.getOrderStatus(), OrderStatusConstant.ruku.getValue())
if (distributionStockArticle.getOrderStatus().equals(OrderStatusConstant.chuku.getValue())
|| distributionStockArticle.getOrderStatus().equals(OrderStatusConstant.qianshou.getValue())
|| Objects.equals(distributionStockArticle.getReservationStatus(), OrderReservationStatusConstant.yiyueyue.getValue())) {
return R.fail("订单"+ distributionStockArticle.getOrderCode() +"不允许拆单");
}
@ -162,8 +157,12 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
.map(DistributionSplitOrderTaskEntity::getTaskNumber)
.mapToInt(Integer::intValue)
.sum();
long tipNumber = packageAllCount > packageAllowCount ? packageAllowCount : packageAllowCount - 1;
if (packageAllowCount < taskNumber) {
return R.fail("拆单数大于订单包件数量,请重新填写,目前可拆单数量:" + packageAllowCount);
return R.fail("拆单包件数量不足,请重新填写,目前可拆单数量:" + tipNumber);
}
if (packageAllCount <= taskNumber) {
return R.fail("拆单数需要小于订单总数量,请重新填写,目前可拆单数量:" + tipNumber);
}
taskLock(stockArticleId, () -> {
@ -190,6 +189,9 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
save(distributionSplitOrderTaskEntity);
distributionSplitOrderLogService.record(distributionSplitOrderTaskEntity, "创建拆单任务", AuthUtil.getUser().getUserName());
}
distributionStockArticle.setSplitStatus(OrderSplitStatusConstant.InProgress.getValue());
distributionStockArticleService.updateById(distributionStockArticle);
});
} catch (Exception e) {
@ -792,6 +794,12 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
distributionSplitOrderAllTaskService.updateById(allTask);
list.forEach(this::cancelTask);
distributionStockArticleService.update(
Wrappers.<DistributionStockArticleEntity>lambdaUpdate()
.eq(DistributionStockArticleEntity::getId, allTask.getStockArticleId())
.set(DistributionStockArticleEntity::getSplitStatus, OrderSplitStatusConstant.No.getValue())
);
return R.success("success");
}
@ -822,6 +830,12 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
.eq(DistributionSplitOrderTaskEntity::getState, OrderSplitStateConstant.finish.getValue())
).forEach(this::packageTransfer);
distributionStockArticleService.update(
Wrappers.<DistributionStockArticleEntity>lambdaUpdate()
.eq(DistributionStockArticleEntity::getId, allTask.getStockArticleId())
.set(DistributionStockArticleEntity::getSplitStatus, OrderSplitStatusConstant.No.getValue())
);
return R.success("success");
}
@ -933,7 +947,7 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
List<Map<String, Object>> maps = baseMapper.selectMaps(
Wrappers.<DistributionSplitOrderTaskEntity>query()
.select("split_order_all_task_id", "SUM(number) as number")
.eq("split_order_all_task_id", taskIds)
.in("split_order_all_task_id", taskIds)
.in("state", OrderSplitStateConstant.InProgress.getValue(), OrderSplitStateConstant.finish.getValue())
.groupBy("split_order_all_task_id")
);
@ -993,6 +1007,46 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
return R.success("");
}
@Override
public R<String> checkOrderCode(Long stockArticleId){
DistributionStockArticleEntity distributionStockArticle = distributionStockArticleService.getById(stockArticleId);
if (distributionStockArticle == null) {
return R.fail("原订单信息错误");
}
if (distributionStockArticle.getOrderStatus().equals(OrderStatusConstant.chuku.getValue())
|| distributionStockArticle.getOrderStatus().equals(OrderStatusConstant.qianshou.getValue())
|| Objects.equals(distributionStockArticle.getReservationStatus(), OrderReservationStatusConstant.yiyueyue.getValue())) {
return R.fail("订单"+ distributionStockArticle.getOrderCode() +"不允许拆单");
}
long packageAllowCount = getSplitOrderAllowCount(stockArticleId);
long packageAllCount = getSplitOrderAllCount(stockArticleId);
if (packageAllowCount == 0 || packageAllCount == 1) {
return R.fail("订单"+ distributionStockArticle.getOrderCode() +"包件数量不足,不允许拆单");
}
boolean exists = exists(
Wrappers.<DistributionSplitOrderTaskEntity>lambdaQuery()
.eq(DistributionSplitOrderTaskEntity::getStockArticleId, stockArticleId)
.eq(DistributionSplitOrderTaskEntity::getState, OrderSplitStateConstant.InProgress.getValue())
);
if (exists) {
return R.fail("订单"+ distributionStockArticle.getOrderCode() +"正在拆单中,不允许重复拆单");
}
boolean hasSplit = exists(
Wrappers.<DistributionSplitOrderTaskEntity>lambdaQuery()
.eq(DistributionSplitOrderTaskEntity::getNewStockArticleId, stockArticleId)
);
if (hasSplit){
return R.fail("订单"+ distributionStockArticle.getOrderCode() +"已是拆单订单,不允许再次拆单");
}
return R.success("");
}
@Override
public R<IPage<SplitPackageOrderVO>> getPackageCodeByOrderCode(Query query, String orderCode) {
IPage<DistributionParcelListEntity> page = Condition.getPage(query);

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

@ -1189,10 +1189,16 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
@Override
public queryOrderVO queryOrderVOCont(String condition, Integer i) {
//获取当前登录人仓库
List<BasicdataWarehouseEntity> myWarehouseList = warehouseClient.getMyWatchWarehouse();
List<Long> collect = myWarehouseList.stream()
.map(BasicdataWarehouseEntity::getId)
.collect(Collectors.toList());
// List<BasicdataWarehouseEntity> myWarehouseList = warehouseClient.getMyWatchWarehouse();
// List<Long> collect = myWarehouseList.stream()
// .map(BasicdataWarehouseEntity::getId)
// .collect(Collectors.toList());
List<Long> collect = new ArrayList<>();
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
Long warehouseId = myCurrentWarehouse.getId();
collect.add(warehouseId);
//查询包条(库存品)所在订单
queryOrderVO queryOrderVO;
if (i == 1) {
@ -1207,12 +1213,21 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
Long id = queryOrderVO.getId();
//查询订单下的所有包条
List<DistributionParcelListEntity> distributionParcelListEntitys = distributionParcelListMapper.selectListByOderId(id, collect);
//查询订单下的所有库存品
List<DistributionStockListVO> distributionStockListVOS = distributionParcelListMapper.selectStockListByOderId(id, collect);
//查询订单下所有未入库的包件
List<TrunklineAdvanceDetailEntity> advanceDetailEntities = trunklineAdvanceDetailClient.findListByStockArticleId(id,warehouseId);
List<JSONObject> noIncomingPackage = new ArrayList<>();
advanceDetailEntities.forEach(advanceDetailEntity -> {
noIncomingPackage.add(JSONObject.parseObject(JSONObject.toJSONString(advanceDetailEntity)));
});
queryOrderVO.setWrapNum(distributionParcelListEntitys.size());
queryOrderVO.setInventoryNum(distributionStockListVOS.size());
queryOrderVO.setList(distributionParcelListEntitys);
queryOrderVO.setStockList(distributionStockListVOS);
queryOrderVO.setNoIncomingList(noIncomingPackage);
return queryOrderVO;
}

18
blade-service/logpm-factory-data/logpm-factory-data-paterson/src/main/java/com/logpm/factorydata/paterson/interceptor/FactoryAccountsInterceptor.java

@ -1,6 +1,9 @@
package com.logpm.factorydata.paterson.interceptor;
import cn.hutool.core.codec.Base64;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.digest.MD5;
@ -35,7 +38,6 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.time.Instant;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
@ -93,13 +95,23 @@ public class FactoryAccountsInterceptor implements HandlerInterceptor {
FactoryAuthVO authVO = jpFactoryShipmentService.findFactoryAuth(companyCode);
if (ObjectUtil.isNotEmpty(authVO)) {
Long authTime1 = authVO.getAuthTime();
long secondTimestamp = Instant.now().getEpochSecond();
// 验证时间 不能大于5秒
long secondTimestamp = DateUtil.current();
DateTime currentDate = DateUtil.date();
// 验证时间
if (secondTimestamp - authTime > authTime1) {
log.info("##########preHandle: 时间戳过期");
returnJson(response, JSONObject.toJSONString(R.fail("认证不通过,时间戳过期")));
return false;
}
// 将 authTime 转换为时间并与当前时间比较
DateTime authDateTime = DateUtil.date(authTime); // 将时间戳转换为 DateTime
// 将 authTime 转换为时间并与当前时间比较
long timeDifferenceInSeconds = DateUtil.between(authDateTime, currentDate, DateUnit.MS);
if (timeDifferenceInSeconds > authTime1) {
log.info("##########preHandle: 认证时间过期");
returnJson(response, JSONObject.toJSONString(R.fail("认证不通过,认证时间过期")));
return false;
}
// 验证签名
String auth = authVO.getAppKey();
String md5Hex = Base64.encode(MD5.create().digestHex(params + auth + authTime)).toUpperCase();

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

@ -21,7 +21,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
* @create 2024-03-08 13:59
*/
@Configuration
@MapperScan("com.baomidou.cloud.service.*.mapper*r")
@MapperScan("com.baomidou.cloud.service.*.mapper*")
public class MybatisPlusConfig implements WebMvcConfigurer {
// @Bean
@ -63,7 +63,7 @@ public class MybatisPlusConfig implements WebMvcConfigurer {
AnnotationAwareOrderComparator.sort(queryInterceptorArray);
paginationInterceptor.setQueryInterceptors(queryInterceptorArray);
}
paginationInterceptor.setMaxLimit(mybatisPlusProperties.getPageLimit());
paginationInterceptor.setMaxLimit(-1L);
paginationInterceptor.setOverflow(mybatisPlusProperties.getOverflow());
paginationInterceptor.setOptimizeJoin(mybatisPlusProperties.getOptimizeJoin());
paginationInterceptor.setDbType(DbType.MYSQL);

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

@ -238,14 +238,20 @@
count(lta.waybill_id) openNum,
sum( IF(ltcls.id IS NOT NULL AND ltcll.start_date is not null,1,0) ) startNum,
count(lta.id)-sum( IF(ltcls.id IS NOT NULL AND ltcll.start_date is not null,1,0) ) noOutNum,
sum(if( ltcls.id is null and now() > DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) noOutOverNum,
sum(if( (ltcls.id IS NULL OR ltcll.start_date IS NULL) and now() > DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) noOutOverNum,
sum(if(ltcll.start_date &lt;= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) onTimeNum,
IFNULL(round(sum(if(ltcll.start_date &lt;= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0))/count(lta.id)*100,2),'0.00') onTimeRate,
round(sum(TIMESTAMPDIFF(SECOND, lta.create_time, ltcll.start_date))/count(ltcls.id)/3600,1) avgTime
from logpm_trunkline_advance_detail lta
left join logpm_warehouse_waybill lww on lww.id = lta.waybill_id
left join logpm_warehouse_warehouse waw on waw.id = lta.warehouse_id
left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = lta.order_package_code and ltcls.warehouse_id = lta.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4
left join (
SELECT
t1.*
FROM logpm_trunkline_cars_load_scan t1
LEFT JOIN logpm_trunkline_cars_load_scan t2 ON t1.scan_code = t2.scan_code AND t1.create_time &lt; t2.create_time
WHERE t2.scan_code IS NULL
) ltcls on ltcls.scan_code = lta.order_package_code and ltcls.warehouse_id = lta.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4
left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id
where lta.create_time &gt; '2024-10-22 00:00:00'
and lww.document_making_time &gt; '2024-10-22 00:00:00'
@ -299,14 +305,20 @@
count(lta.waybill_id) openNum,
sum( IF(ltcls.id IS NOT NULL AND ltcll.start_date is not null,1,0) ) startNum,
count(lta.id)-sum( IF(ltcls.id IS NOT NULL AND ltcll.start_date is not null,1,0) ) noOutNum,
sum(if( ltcls.id is null and now() > DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) noOutOverNum,
sum(if( (ltcls.id IS NULL OR ltcll.start_date IS NULL) and now() > DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) noOutOverNum,
sum(if(ltcll.start_date &lt;= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) onTimeNum,
IFNULL(concat(round(sum(if(ltcll.start_date &lt;= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0))/count(ltcls.id)*100,2),'%'),'0.00%') onTimeRate,
IFNULL(concat(round(sum(if(ltcll.start_date &lt;= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0))/count(lta.id)*100,2),'%'),'0.00%') onTimeRate,
round(sum(TIMESTAMPDIFF(SECOND, lta.create_time, ltcll.start_date))/count(ltcls.id)/3600,1) avgTime
from logpm_trunkline_advance_detail lta
left join logpm_warehouse_waybill lww on lww.id = lta.waybill_id
left join logpm_warehouse_warehouse waw on waw.id = lta.warehouse_id
left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = lta.order_package_code and ltcls.warehouse_id = lta.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4
left join (
SELECT
t1.*
FROM logpm_trunkline_cars_load_scan t1
LEFT JOIN logpm_trunkline_cars_load_scan t2 ON t1.scan_code = t2.scan_code AND t1.create_time &lt; t2.create_time
WHERE t2.scan_code IS NULL
) ltcls on ltcls.scan_code = lta.order_package_code and ltcls.warehouse_id = lta.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4
left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id
where lta.create_time &gt; '2024-10-22 00:00:00'
and lww.document_making_time &gt; '2024-10-22 00:00:00'
@ -2826,7 +2838,7 @@
</if>
<if test="param.startDetailType != null and param.startDetailType ==4">
and ltcls.id is null
and now() &lt;= DATE_ADD( ltad.create_time, INTERVAL #{param.hoursTime} HOUR )
and now() > DATE_ADD( ltad.create_time, INTERVAL #{param.hoursTime} HOUR )
</if>
group by ltad.id
</select>
@ -2928,7 +2940,7 @@
</if>
<if test="param.startDetailType != null and param.startDetailType ==4">
and ltcls.id is null
and now() &lt;= DATE_ADD( ltad.create_time, INTERVAL #{param.hoursTime} HOUR )
and now() > DATE_ADD( ltad.create_time, INTERVAL #{param.hoursTime} HOUR )
</if>
group by ltad.id
</select>

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

@ -295,7 +295,7 @@
when ifnull(ldsa.type_service, '1') = '4' then '三方中转' end as type_service,
count(distinct t.order_code) orderNum, sum(t.quantity) num
from logpm_distribution_parcel_list t
join logpm_distribution_stock_article ldsa on ldsa.order_code = t.order_code and ldsa.is_deleted = 0
join logpm_distribution_stock_article ldsa on ldsa.id = t.stock_article_id and ldsa.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 ldsa.type_service != '2'

6
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/QualityDispatchNumberServiceImpl.java

@ -57,7 +57,7 @@ public class QualityDispatchNumberServiceImpl implements QualityDispatchNumberSe
throw new ServiceException("时间不能为空");
}
page.setPages(1);
page.setSize(-1);
page.setSize(Integer.MAX_VALUE);
if (StrUtil.isEmpty(query.getWarehouseName())) {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (ObjectUtil.isNotEmpty(myCurrentWarehouse)) {
@ -128,7 +128,7 @@ public class QualityDispatchNumberServiceImpl implements QualityDispatchNumberSe
throw new ServiceException("时间不能为空");
}
page.setPages(1);
page.setSize(-1);
page.setSize(Integer.MAX_VALUE);
if (StrUtil.isEmpty(query.getWarehouseName())) {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (ObjectUtil.isNotEmpty(myCurrentWarehouse)) {
@ -204,7 +204,7 @@ public class QualityDispatchNumberServiceImpl implements QualityDispatchNumberSe
public void exporTask(HttpServletResponse response, QualityDispatchTaskQuery query) {
IPage<QualityDispatchTaskVO> page = Condition.getPage(query);
page.setPages(1);
page.setSize(-1);
page.setSize(Integer.MAX_VALUE);
List<QualityDispatchTaskVO> list = getQualityDispatchTaskVOS(query, page);
ExcelUtil.export(response, list, QualityDispatchTaskVO.class);
}

2
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportDeliverServiceImpl.java

@ -458,7 +458,7 @@ public class ReportDeliverServiceImpl implements ReportDeliverService {
public void exportDetailsV3(HttpServletResponse response, DevilerDetailsQuery query) {
IPage<ReportDetailVO> page = Condition.getPage(query);
page.setPages(1);
page.setSize(-1);
page.setSize(Integer.MAX_VALUE);
Integer more = 1;
if (StrUtil.isEmpty(query.getWarehouseNameRange())) {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();

7
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineAdvanceDetailClient.java

@ -5,13 +5,13 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.service.ITrunklineAdvanceDetailService;
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@ -72,4 +72,9 @@ public class TrunklineAdvanceDetailClient implements ITrunklineAdvanceDetailClie
return advanceDetailService.maintainMaterial(map);
}
@Override
public List<TrunklineAdvanceDetailEntity> findListByStockArticleId(Long stockArticleId, Long warehouseId) {
return advanceDetailService.findListByStockArticleId(stockArticleId,warehouseId);
}
}

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

@ -107,4 +107,5 @@ public interface TrunklineAdvanceDetailMapper extends BaseMapper<TrunklineAdvanc
void deleteListByIds(@Param("advanceDetailIdList") List<Long> advanceDetailIdList);
List<TrunklineAdvanceDetailEntity> findListByStockArticleId(@Param("stockArticleId") Long stockArticleId, @Param("warehouseId") Long warehouseId);
}

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

@ -748,4 +748,15 @@
</foreach>
</delete>
<select id="findListByStockArticleId" resultType="com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity">
select ltad.*
from logpm_trunkline_advance_detail ltad
left join logpm_distribution_parcel_list ldpl on ldpl.order_package_code = ltad.order_package_code
where ldpl.stock_article_id = #{stockArticleId}
and ldpl.warehouse_id = #{warehouseId}
and ltad.is_deleted = 0
and ldpl.is_deleted = 0
and ldpl.id is null
</select>
</mapper>

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

@ -129,4 +129,6 @@ public interface ITrunklineAdvanceDetailService extends BaseService<TrunklineAdv
* @return
*/
R maintainMaterial(Map<String, Object> map);
List<TrunklineAdvanceDetailEntity> findListByStockArticleId(Long stockArticleId, Long warehouseId);
}

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

@ -974,4 +974,9 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl<Trunkline
return R.success("操作成功");
}
@Override
public List<TrunklineAdvanceDetailEntity> findListByStockArticleId(Long stockArticleId, Long warehouseId) {
return baseMapper.findListByStockArticleId(stockArticleId,warehouseId);
}
}

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

@ -2267,39 +2267,39 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadLinePhotoService.saveBatch(addUrlList);
}
TrunklineCarsLoadLineEntity updateEntity = new TrunklineCarsLoadLineEntity();
updateEntity.setId(carsLoadLineId);
// TrunklineCarsLoadLineEntity updateEntity = new TrunklineCarsLoadLineEntity();
// updateEntity.setId(carsLoadLineId);
List<TrunklineCarsLoadLinePhotoEntity> qualityList = carsLoadLinePhotoService.findListByLoadIdAndWarehouseId(loadId, warehouseId, 30, null);
//把qualityList通过position=2进行过滤生成新的list
List<TrunklineCarsLoadLinePhotoEntity> qualityListHou = qualityList.stream().filter(item -> item.getPosition().equals(2)).collect(Collectors.toList());
if(qualityListHou.size() == 0){
updateEntity.setIsUnloadPhoto(0);
trunklineCarsLoadLineService.updateById(updateEntity);
carsLoadLine.setIsUnloadPhoto(0);
trunklineCarsLoadLineService.updateById(carsLoadLine);
return R.success("上传成功");
}
List<TrunklineCarsLoadLinePhotoEntity> qualityListZuo = qualityList.stream().filter(item -> item.getPosition().equals(3)).collect(Collectors.toList());
if(qualityListZuo.size() == 0){
updateEntity.setIsUnloadPhoto(0);
trunklineCarsLoadLineService.updateById(updateEntity);
carsLoadLine.setIsUnloadPhoto(0);
trunklineCarsLoadLineService.updateById(carsLoadLine);
return R.success("上传成功");
}
List<TrunklineCarsLoadLinePhotoEntity> qualityListYou = qualityList.stream().filter(item -> item.getPosition().equals(4)).collect(Collectors.toList());
if(qualityListYou.size() == 0){
updateEntity.setIsUnloadPhoto(0);
trunklineCarsLoadLineService.updateById(updateEntity);
carsLoadLine.setIsUnloadPhoto(0);
trunklineCarsLoadLineService.updateById(carsLoadLine);
return R.success("上传成功");
}
List<TrunklineCarsLoadLinePhotoEntity> protectionList = carsLoadLinePhotoService.findListByLoadIdAndWarehouseId(loadId, warehouseId, 31, 2);
if(protectionList.size() == 0){
updateEntity.setIsUnloadPhoto(0);
trunklineCarsLoadLineService.updateById(updateEntity);
carsLoadLine.setIsUnloadPhoto(0);
trunklineCarsLoadLineService.updateById(carsLoadLine);
return R.success("上传成功");
}
updateEntity.setIsUnloadPhoto(1);
trunklineCarsLoadLineService.updateById(updateEntity);
carsLoadLine.setIsUnloadPhoto(1);
trunklineCarsLoadLineService.updateById(carsLoadLine);
return R.success("上传成功");
}
@ -12582,7 +12582,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
List<String> orderPackageCodes = new ArrayList<>();
orderPackageCodes.add(orderPackageCode);
String content = "包件在 " + warehouseName + "卸车,车次号:"+carsLoadEntity.getCarsNo()+" 卸车方式:" + IncomingTypeEnum.getValue(incomingType)+ (StringUtil.isNotBlank(unloadTrayName)?"托盘:"+unloadTrayName:"");
if(NumberUtil.equals(isData,0)){
content = "包件在 " + warehouseName + "卸车,车次号:"+carsLoadEntity.getCarsNo()+" 卸车方式:系统无编码 卸车(只记录未入库)";
}
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseName, WorkNodeEnums.UNLOAD_INCOMING_WAREHOUSE.getCode(), content);
carsLoadAsyncService.sendFactoryData(orderCode,orderPackageCode,warehouseId,warehouseName);
@ -13802,6 +13806,19 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.fail(405, "仓库信息不存在");
}
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(warehouseId);
if(!Objects.isNull(warehouseConfig)){
Integer isTrunklineUnloadPhoto = warehouseConfig.getIsTrunklineUnloadPhoto();
if(NumberUtil.equals(isTrunklineUnloadPhoto,1)){
//限制装车之前上传图片
Integer isUnloadPhoto = loadLineEntity.getIsUnloadPhoto();
if(NumberUtil.equals(isUnloadPhoto,0)){
log.warn("##############unloadZero: 节点还未上传卸车前图片 isUnloadPhoto={}", isUnloadPhoto);
return R.fail(405, "节点还未上传卸车前图片");
}
}
}
String warehouseName = basicdataWarehouseEntity.getName();
WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNo);
@ -13839,6 +13856,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.fail(405, "零担信息卸车数量大于装车件数");
}
carsLoadScanEntity.setUnloadNum(enterNun);
carsLoadScanEntity.setUnloadNodeId(warehouseId);
carsLoadScanEntity.setUnloadNodeName(warehouseName);

Loading…
Cancel
Save