Browse Source

1.bug修复

pre-production
zhenghaoyu 1 day ago
parent
commit
f2e1e4443c
  1. 10
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/queryOrderVO.java
  2. 4
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineAdvanceDetailClient.java
  3. 23
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  4. 26
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml
  5. 7
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineAdvanceDetailClient.java
  6. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java
  7. 11
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml
  8. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java
  9. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java
  10. 42
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

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);
}

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;
}

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>

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