Quellcode durchsuchen

Merge branch 'master' of 123.57.213.14:guoqiang.duan/zgzt-bus-java

guoqiang vor 8 Monaten
Ursprung
Commit
a99a6c21a4

+ 3 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsend/entity/BilletHotsendDetailsVo.java

@@ -23,4 +23,7 @@ public class BilletHotsendDetailsVo {
 
     private String belongTypeName;
 
+    private String destination;
+
+    private String destinationId;
 }

+ 20 - 7
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsend/service/impl/BilletHotsendBaseServiceImpl.java

@@ -50,6 +50,7 @@ import org.jeecg.modules.billet.storageCarLog.service.IStorageCarLogService;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.util.ArrayList;
 import java.util.Comparator;
@@ -310,6 +311,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 	}
 
 	@Override
+	@Transactional
 	public JSONObject saveBilletHotsendDetails(BilletHotsendDetailsVo billetHotsendDetailsVo) {
 		JSONObject result = new JSONObject();
 		// 根据billetHotsendTypeConfigId 查询基础垛位信息
@@ -622,7 +624,6 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 		//查询并批量更新钢坯基础信息 belongTable
 		LambdaQueryWrapper<BilletBasicInfo> queryWrapperls = new LambdaQueryWrapper<BilletBasicInfo>()
 				.eq(BilletBasicInfo::getCcmNo, Integer.valueOf(billetHotsend.getCcmNo()))
-				.eq(BilletBasicInfo::getHeatNo, billetHotsend.getHeatNo())
 				.in(BilletBasicInfo::getBilletNo, billetNos);
 		List<BilletBasicInfo> billetBasicInfoList = billetBasicInfoService.list(queryWrapperls);
 		billetBasicInfoList.forEach(x ->{
@@ -641,15 +642,21 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 			x.setUpdateTime(new Date());
 		});
 		billetBasicInfoService.saveOrUpdateBatch(billetBasicInfoList);
-
+		if (oConvertUtils.isEmpty(billetHotsendDetailsVo.getStorageBill()) || billetHotsendDetailsVo.getStorageBill() == null){
+			result.put("success", "新增高线成功!");
+			return result;
+		}
 		// 更新装运单 车次总序号、本车车次
 		LambdaQueryWrapper<StorageBill> queryWrapperSB = new LambdaQueryWrapper<>();
 		queryWrapperSB.eq(StorageBill::getId, billetHotsendDetailsVo.getStorageBill().getId());
 		StorageBill storageBillInfo = storageBillService.getOne(queryWrapperSB);
-		// 更新装运单 车次总序号、本车车次
+		if (oConvertUtils.isEmpty(storageBillInfo)){
+			storageBill.setAmountTotal(rollClubCommonList.size());
+		}else {
+			storageBill.setAmountTotal(storageBillInfo.getAmountTotal() + rollClubCommonList.size());
+		}
 		storageBill.setTypeConfigId(billetHotsendDetailsVo.getBilletHotsendTypeConfigId()); // 钢坯配置类型ID
 		storageBill.setDestination(billetHotsendDetailsVo.getBelongTypeName());// 目的地
-		storageBill.setAmountTotal(storageBillInfo.getAmountTotal() + rollClubCommonList.size());
 		storageBillService.updateById(storageBill);
 		result.put("success", "新增钢坯热送成功!");
 		return result;
@@ -698,6 +705,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 	}
 
 	@Override
+	@Transactional
 	public void saveBilletHotsendDetailsCar(BilletHotsendDetailsVo billetHotsendDetailsVo) {
 		// 根据billetHotsendTypeConfigId 查询基础垛位信息
 		BilletHotsendTypeConfig billetHotsendTypeConfig = billetHotsendTypeConfigService.getById(billetHotsendDetailsVo.getBilletHotsendTypeConfigId());
@@ -1004,7 +1012,6 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 		//查询并批量更新钢坯基础信息 belongTable
 		LambdaQueryWrapper<BilletBasicInfo> queryWrapperls = new LambdaQueryWrapper<BilletBasicInfo>()
 				.eq(BilletBasicInfo::getCcmNo, Integer.valueOf(billetHotsend.getCcmNo()))
-				.eq(BilletBasicInfo::getHeatNo, billetHotsend.getHeatNo())
 				.in(BilletBasicInfo::getBilletNo, billetNos);
 		List<BilletBasicInfo> billetBasicInfoList = billetBasicInfoService.list(queryWrapperls);
 		billetBasicInfoList.forEach(x ->{
@@ -1025,13 +1032,19 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 		billetBasicInfoService.saveOrUpdateBatch(billetBasicInfoList);
 
 		// 更新装运单 车次总序号、本车车次
+		if (oConvertUtils.isEmpty(billetHotsendDetailsVo.getStorageBill()) || billetHotsendDetailsVo.getStorageBill() == null){
+			return;
+		}
 		LambdaQueryWrapper<StorageBill> queryWrapperSB = new LambdaQueryWrapper<>();
 		queryWrapperSB.eq(StorageBill::getId, billetHotsendDetailsVo.getStorageBill().getId());
 		StorageBill storageBillInfo = storageBillService.getOne(queryWrapperSB);
-
+		if (oConvertUtils.isEmpty(storageBillInfo)){
+			storageBill.setAmountTotal(rollClubCommonList.size());
+		}else {
+			storageBill.setAmountTotal(storageBillInfo.getAmountTotal() + rollClubCommonList.size());
+		}
 		storageBill.setTypeConfigId(billetHotsendDetailsVo.getBilletHotsendTypeConfigId()); // 钢坯配置类型ID
 		storageBill.setDestination(billetHotsendDetailsVo.getBelongTypeName());// 目的地
-		storageBill.setAmountTotal(storageBillInfo.getAmountTotal() + rollClubCommonList.size());
 		storageBill.setOutTime(new Date());
 		storageBillService.updateById(storageBill);
 		// 生成储运单

+ 22 - 15
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/stackingAndLoadingVehicles/service/impl/StackingAndLoadingVehiclesServiceImpl.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.billet.stackingAndLoadingVehicles.service.impl;
 
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
@@ -35,6 +36,7 @@ import org.jeecg.modules.billet.storageCarLog.service.IStorageCarLogService;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.util.*;
 import java.util.concurrent.atomic.AtomicBoolean;
@@ -452,6 +454,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
     }
 
     @Override
+    @Transactional
     public void loadingHandle(LoadingParams loadingParams) {
         // 根据billetHotsendTypeConfigId 查询基础垛位信息
         BilletHotsendTypeConfig billetHotsendTypeConfig = billetHotsendTypeConfigService.getById(loadingParams.getBilletHotsendTypeConfigId());
@@ -476,8 +479,13 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
                 .eq(BilletHotsend::getShiftGroup, cacheShintGroup);
         BilletHotsend idExistBh = billetHotsendBaseService.getOne(queryWrapper);
         if (oConvertUtils.isNotEmpty(idExistBh)){
+            if (idExistBh.getStackNum() < stackingAndLoadingVehiclesList.size() * 4){
+                billetHotsend.setStackNum(stackingAndLoadingVehiclesList.size() * 4); // 堆垛总支数
+                log.info("{}{}", ">>>>>>>>>堆垛总支数计算出现异常:", JSON.toJSON(loadingParams));
+            }else {
+                billetHotsend.setStackNum(idExistBh.getStackNum() - stackingAndLoadingVehiclesList.size() * 4); // 堆垛总支数
+            }
             // 钢坯热送基础信息存在,但是钢坯信息不存在 直接返回
-            billetHotsend.setStackNum(idExistBh.getStackNum() - stackingAndLoadingVehiclesList.size() * 4); // 堆垛总支数
             LambdaUpdateWrapper<BilletHotsend> updateWrapper = new LambdaUpdateWrapper<>();
             updateWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
                     .eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
@@ -549,15 +557,17 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
         billetBasicInfoList.forEach(x ->{
             x.setBelongTable("stacking_and_loading_vehicles");
             x.setUpdateTime(new Date());
-            x.setBhtcId(loadingParams.getBilletHotsendTypeConfigId());
+            x.setBhtcId(loadingParams.getDestinationId());
         });
         billetBasicInfoService.saveOrUpdateBatch(billetBasicInfoList);
         StorageBill storageBill = loadingParams.getStorageBill();
         storageBill.setAmountTotal(stackingAndLoadingVehiclesList.size() * 4);
+        storageBill.setDestination(loadingParams.getDestination());
         storageBillService.updateById(storageBill);
     }
 
     @Override
+    @Transactional
     public void stackDepartHandle(LoadingParams loadingParams) {
         // 根据billetHotsendTypeConfigId 查询基础垛位信息
         BilletHotsendTypeConfig billetHotsendTypeConfig = billetHotsendTypeConfigService.getById(loadingParams.getBilletHotsendTypeConfigId());
@@ -582,8 +592,13 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
                 .eq(BilletHotsend::getShiftGroup, cacheShintGroup);
         BilletHotsend idExistBh = billetHotsendBaseService.getOne(queryWrapper);
         if (oConvertUtils.isNotEmpty(idExistBh)){
+            if (idExistBh.getStackNum() < stackingAndLoadingVehiclesList.size() * 4){
+                billetHotsend.setStackNum(stackingAndLoadingVehiclesList.size() * 4); // 堆垛总支数
+                log.info("{}{}", ">>>>>>>>>堆垛总支数计算出现异常:", JSON.toJSON(loadingParams));
+            }else {
+                billetHotsend.setStackNum(idExistBh.getStackNum() - stackingAndLoadingVehiclesList.size() * 4); // 堆垛总支数
+            }
             // 钢坯热送基础信息存在,但是钢坯信息不存在 直接返回
-            billetHotsend.setStackNum(idExistBh.getStackNum() - stackingAndLoadingVehiclesList.size() * 4); // 堆垛总支数
             LambdaUpdateWrapper<BilletHotsend> updateWrapper = new LambdaUpdateWrapper<>();
             updateWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
                     .eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
@@ -647,32 +662,24 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
         //5 查询并批量更新钢坯基础信息 belongTable
         LambdaQueryWrapper<BilletBasicInfo> queryWrapperBB = new LambdaQueryWrapper<BilletBasicInfo>()
                 .eq(BilletBasicInfo::getCcmNo, Integer.valueOf(billetHotsend.getCcmNo()))
-                .eq(BilletBasicInfo::getHeatNo, billetHotsend.getHeatNo())
                 .in(BilletBasicInfo::getBilletNo, billetNosList);
         List<BilletBasicInfo> billetBasicInfoList = billetBasicInfoService.list(queryWrapperBB);
         billetBasicInfoList.forEach(x ->{
             x.setBelongTable("stacking_and_loading_vehicles");
-            x.setBhtcId(loadingParams.getBilletHotsendTypeConfigId());
+            x.setBhtcId(loadingParams.getDestinationId());
         });
         billetBasicInfoService.saveOrUpdateBatch(billetBasicInfoList);
         // 6 更新装运单 storage_bill 新增储运信息
         StorageBill storageBill = loadingParams.getStorageBill();
-        LambdaQueryWrapper<StorageBill> queryWrapperSB = new LambdaQueryWrapper<>();
-        queryWrapperSB.eq(StorageBill::getCcmNo, storageBill.getCcmNo())
-                     .eq(StorageBill::getShift, finalCacheShint1)
-                   .eq(StorageBill::getShiftGroup, finalCacheShintGroup1)
-                    .eq(StorageBill::getLicensePlate, storageBill.getLicensePlate());
-        List<StorageBill> storageBillList = storageBillService.list(queryWrapperSB);
-        storageBill.setCarNum(oConvertUtils.listIsEmpty(storageBillList) ? 0 : storageBillList.size() + 1);// 本车车次
         storageBill.setTypeConfigId(loadingParams.getBilletHotsendTypeConfigId()); // 钢坯配置类型ID
-        storageBill.setDestination(loadingParams.getStorageBill().getDestination());// 目的地
+        storageBill.setDestination(loadingParams.getDestination());// 目的地
         storageBill.setAmountTotal(storageBill.getAmountTotal() + stackingAndLoadingVehiclesList.size() * 4);
         storageBill.setOutTime(new Date());
         storageBillService.updateById(storageBill);
         // 7 发车后,新增钢坯堆垛储运信息,生成储运单 storage_car_log
         StorageCarLog storageCarLog = new StorageCarLog();
         BeanUtils.copyProperties(storageBill, storageCarLog);
-        storageCarLog.setDestination(billetHotsendTypeConfig.getTypeName());// 目的地
+        storageCarLog.setDestination(loadingParams.getDestination());// 目的地
         storageCarLog.setCarNm(storageBill.getLicensePlate());// 车牌号
         storageCarLog.setTypeConfigId(billetHotsendTypeConfig.getId()); // 钢坯配置类型ID
         storageCarLog.setHeatNo(billetHotsend.getHeatNo());
@@ -690,6 +697,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
     }
 
     @Override
+    @Transactional
     public void addStackInfo(LoadingParams loadingParams) {
         // 根据billetHotsendTypeConfigId 查询基础垛位信息
         BilletHotsendTypeConfig billetHotsendTypeConfig = billetHotsendTypeConfigService.getById(loadingParams.getBilletHotsendTypeConfigId());
@@ -778,7 +786,6 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
         //5 查询并批量更新钢坯基础信息 belongTable
         LambdaQueryWrapper<BilletBasicInfo> queryWrapperBB = new LambdaQueryWrapper<BilletBasicInfo>()
                 .eq(BilletBasicInfo::getCcmNo, Integer.valueOf(billetHotsend.getCcmNo()))
-                .eq(BilletBasicInfo::getHeatNo, billetHotsend.getHeatNo())
                 .in(BilletBasicInfo::getBilletNo, billetNosList);
         List<BilletBasicInfo> billetBasicInfoList = billetBasicInfoService.list(queryWrapperBB);
         billetBasicInfoList.forEach(x ->{

+ 9 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/stackingAndLoadingVehicles/vo/LoadingParams.java

@@ -1,10 +1,12 @@
 package org.jeecg.modules.billet.stackingAndLoadingVehicles.vo;
 
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import org.jeecg.modules.billet.billetHotsend.entity.BilletHotsend;
 import org.jeecg.modules.billet.billetHotsend.entity.RollClubCommon;
 import org.jeecg.modules.billet.stackingAndLoadingVehicles.entity.StackingAndLoadingVehicles;
 import org.jeecg.modules.billet.storageBill.entity.StorageBill;
+import org.jeecgframework.poi.excel.annotation.Excel;
 
 import java.util.List;
 
@@ -41,4 +43,11 @@ public class LoadingParams {
      */
     private String belongTable;
 
+    @Excel(name = "目的地", width = 15)
+    @ApiModelProperty(value = "目的地")
+    private String destination;
+
+    @Excel(name = "目的地ID", width = 15)
+    @ApiModelProperty(value = "目的地ID")
+    private String destinationId;
 }

+ 26 - 3
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/controller/StorageBillController.java

@@ -19,6 +19,9 @@ import org.jeecg.modules.billet.storageBill.entity.BilletHotsendDetails;
 import org.jeecg.modules.billet.storageBill.entity.StorageBill;
 import org.jeecg.modules.billet.storageBill.service.IStorageBillService;
 import org.jeecg.modules.billet.storageBill.service.ITripsManageService;
+import org.jeecg.modules.billet.storageCarLog.entity.StorageCarLog;
+import org.jeecg.modules.billet.storageCarLog.service.IStorageCarLogService;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.web.bind.annotation.*;
@@ -54,6 +57,9 @@ public class StorageBillController extends JeecgController<StorageBill, IStorage
 	@Autowired
 	public RedisTemplate redisTemplate;
 
+	@Autowired
+	private IStorageCarLogService storageCarLogService;
+
 	/**
 	 * 分页列表查询
 	 *
@@ -161,10 +167,27 @@ public class StorageBillController extends JeecgController<StorageBill, IStorage
 	@ApiOperation(value="钢坯装运单-发车", notes="钢坯装运单-发车")
 	@PostMapping(value = "/startCar")
 	public Result<String> startCar(@RequestBody StorageBill storageBill) {
-		storageBill.setCreateTime(new Date());
-		storageBillService.save(storageBill);
+
+		StorageBill isStorageBill = storageBillService.getById(storageBill);
+		if (oConvertUtils.isNotEmpty(isStorageBill.getOutTime()) && storageBill.getLicensePlate().equals(isStorageBill.getLicensePlate())) {
+			return Result.OK("该车已发车,请勿重复发车!");
+		}
+		storageBill.setOutTime(new Date());
+		storageBill.setUpdateTime(new Date());
+		storageBillService.updateById(storageBill);
+		// 7 发车后,新增钢坯堆垛储运信息,生成储运单 storage_car_log
+		StorageCarLog storageCarLog = new StorageCarLog();
+		BeanUtils.copyProperties(storageBill, storageCarLog);
+		storageCarLog.setCarNm(storageBill.getLicensePlate());// 车牌号
+//		storageCarLog.setTypeConfigId(billetHotsendTypeConfig.getId()); // 钢坯配置类型ID
+//		storageCarLog.setHeatNo(billetHotsend.getHeatNo());
+//		storageCarLog.setFixedWeight();// 定重
+//      storageCarLog.setSize(storageBill.getSize());// 定尺
+		// 查询上垛记录,计算出总支数
+		storageCarLog.setAmount(storageBill.getAmountTotal());// 支数
+		storageCarLogService.save(storageCarLog);
 		operateLogService.add(storageBill,null,StorageBill.class);
-		return Result.OK("添加成功!");
+		return Result.OK("钢坯装运单-发车成功!");
 	}
 	
 	/**

+ 2 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/entity/BilletHotsendDetails.java

@@ -19,4 +19,6 @@ public class BilletHotsendDetails {
 
     private List<StackingDownLog> stackingDownLogList;
 
+    private List<StackingDownLogDetails> stackingDownLogDetailsList;
+
 }

+ 86 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/entity/StackingDownLogDetails.java

@@ -0,0 +1,86 @@
+package org.jeecg.modules.billet.storageBill.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+@Data
+public class StackingDownLogDetails {
+    /**id*/
+    @TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "id")
+    private String id;
+    /**创建人*/
+    @ApiModelProperty(value = "创建人")
+    private String createBy;
+    /**创建日期*/
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建日期")
+    private Date createTime;
+    /**更新人*/
+    @ApiModelProperty(value = "更新人")
+    private String updateBy;
+    /**更新日期*/
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "更新日期")
+    private Date updateTime;
+    /**所属部门*/
+    @ApiModelProperty(value = "所属部门")
+    private String sysOrgCode;
+    /**炉号*/
+    @Excel(name = "炉号", width = 15)
+    @ApiModelProperty(value = "炉号")
+    private String heatNo;
+    /**铸机号*/
+    @Excel(name = "铸机号", width = 15)
+    @ApiModelProperty(value = "铸机号")
+    private String ccmNo;
+    /**班组*/
+    @Excel(name = "班组", width = 15)
+    @ApiModelProperty(value = "班组")
+    private String shiftGroup;
+    /**班别*/
+    @Excel(name = "班别", width = 15)
+    @ApiModelProperty(value = "班别")
+    private String shift;
+    /**坯号*/
+    @Excel(name = "坯号", width = 15)
+    @ApiModelProperty(value = "坯号")
+    private String billetNo;
+    /**装运单ID*/
+    @Excel(name = "装运单ID", width = 15)
+    @ApiModelProperty(value = "装运单ID")
+    private String storageBillId;
+    /**堆垛层号(1-20)*/
+    @Excel(name = "堆垛层号(1-20)", width = 15)
+    @ApiModelProperty(value = "堆垛层号(1-20)")
+    private String stackStorey;
+    /**堆垛编号(1-9)*/
+    @Excel(name = "堆垛编号(1-9)", width = 15)
+    @ApiModelProperty(value = "堆垛编号(1-9)")
+    private String stackNum;
+    /**垛位*/
+    @Excel(name = "垛位", width = 15)
+    @ApiModelProperty(value = "垛位")
+    private String stackAddr;
+    /**钢种*/
+    @Excel(name = "钢种", width = 15)
+    @ApiModelProperty(value = "钢种",required = true)
+    private String grade;
+    /**定尺*/
+    @Excel(name = "定尺", width = 15)
+    @ApiModelProperty(value = "定尺",required = true)
+    private Integer length;
+    /**规格*/
+    @Excel(name = "规格", width = 15)
+    @ApiModelProperty(value = "规格",required = true)
+    private String spec;
+}

+ 25 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/service/impl/StorageBillServiceImpl.java

@@ -20,13 +20,17 @@ import org.jeecg.modules.billet.stackingAndLoadingVehicles.entity.StackingDownLo
 import org.jeecg.modules.billet.stackingAndLoadingVehicles.service.IStackingDownLogService;
 import org.jeecg.modules.billet.storageBill.entity.BilletHotsendDetails;
 import org.jeecg.modules.billet.storageBill.entity.GetStatsResponse;
+import org.jeecg.modules.billet.storageBill.entity.StackingDownLogDetails;
 import org.jeecg.modules.billet.storageBill.entity.StorageBill;
 import org.jeecg.modules.billet.storageBill.mapper.StorageBillMapper;
 import org.jeecg.modules.billet.storageBill.service.IStorageBillService;
 import org.jeecg.modules.billet.storageCarLog.service.IStorageCarLogService;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -132,8 +136,29 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
         result.setRollClubThreeDetailsList(rollClubThreeDetailsList);
         List<RollOutShippDetails> rollOutShippDetailsList = rollOutShippDetailsService.list(new LambdaQueryWrapper<RollOutShippDetails>().eq(RollOutShippDetails::getStorageBillId, storageBill.getId()));
         result.setRollOutShippDetailsList(rollOutShippDetailsList);
+        List<StackingDownLogDetails> stackingDownLogDetailsList = new ArrayList<>();
         List<StackingDownLog> stackingDownLogList = stackingDownLogService.list(new LambdaQueryWrapper<StackingDownLog>().eq(StackingDownLog::getStorageBillId, storageBill.getId()));
+        if (oConvertUtils.listIsEmpty(stackingDownLogList)){
+            result.setStackingDownLogList(stackingDownLogList);
+            result.setStackingDownLogDetailsList(stackingDownLogDetailsList);
+            return result;
+        }
+        StackingDownLog stackingDownLog = stackingDownLogList.stream().findFirst().orElse(null);
+        List<String> stringList = Arrays.stream(stackingDownLog.getBilletNo().split(","))
+                .collect(Collectors.toList());
+        LambdaQueryWrapper<BilletBasicInfo> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(BilletBasicInfo::getBilletNo, stringList.get(0));
+        BilletBasicInfo billetBasicInfo = billetBasicInfoService.list(queryWrapper).stream().findFirst().orElse(null);
+        stackingDownLogList.forEach(x ->{
+            StackingDownLogDetails stackingDownLogDetails = new StackingDownLogDetails();
+            BeanUtils.copyProperties(x, stackingDownLogDetails);
+            stackingDownLogDetails.setGrade(billetBasicInfo.getGrade());
+            stackingDownLogDetails.setSpec(billetBasicInfo.getSpec());
+            stackingDownLogDetails.setLength(billetBasicInfo.getLength());
+            stackingDownLogDetailsList.add(stackingDownLogDetails);
+        });
         result.setStackingDownLogList(stackingDownLogList);
+        result.setStackingDownLogDetailsList(stackingDownLogDetailsList);
         return result;
     }