Browse Source

钢坯堆垛处理

qiangxuan 6 months ago
parent
commit
ec52800612

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

+ 3 - 2
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 查询基础垛位信息
@@ -607,7 +609,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 ->{
@@ -689,6 +690,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 	}
 
 	@Override
+	@Transactional
 	public void saveBilletHotsendDetailsCar(BilletHotsendDetailsVo billetHotsendDetailsVo) {
 		// 根据billetHotsendTypeConfigId 查询基础垛位信息
 		BilletHotsendTypeConfig billetHotsendTypeConfig = billetHotsendTypeConfigService.getById(billetHotsendDetailsVo.getBilletHotsendTypeConfigId());
@@ -980,7 +982,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 ->{

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

@@ -36,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;
@@ -453,6 +454,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
     }
 
     @Override
+    @Transactional
     public void loadingHandle(LoadingParams loadingParams) {
         // 根据billetHotsendTypeConfigId 查询基础垛位信息
         BilletHotsendTypeConfig billetHotsendTypeConfig = billetHotsendTypeConfigService.getById(loadingParams.getBilletHotsendTypeConfigId());
@@ -555,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());
@@ -658,25 +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();
         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());
@@ -694,6 +697,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
     }
 
     @Override
+    @Transactional
     public void addStackInfo(LoadingParams loadingParams) {
         // 根据billetHotsendTypeConfigId 查询基础垛位信息
         BilletHotsendTypeConfig billetHotsendTypeConfig = billetHotsendTypeConfigService.getById(loadingParams.getBilletHotsendTypeConfigId());
@@ -782,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;
 }

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

@@ -172,6 +172,7 @@ public class StorageBillController extends JeecgController<StorageBill, IStorage
 		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
@@ -181,7 +182,7 @@ public class StorageBillController extends JeecgController<StorageBill, IStorage
 //		storageCarLog.setTypeConfigId(billetHotsendTypeConfig.getId()); // 钢坯配置类型ID
 //		storageCarLog.setHeatNo(billetHotsend.getHeatNo());
 //		storageCarLog.setFixedWeight();// 定重
-//      storageCarLog.setSize();// 定尺
+//      storageCarLog.setSize(storageBill.getSize());// 定尺
 		// 查询上垛记录,计算出总支数
 		storageCarLog.setAmount(storageBill.getAmountTotal());// 支数
 		storageCarLogService.save(storageCarLog);

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