|
@@ -1,8 +1,10 @@
|
|
|
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.extension.service.impl.ServiceImpl;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
|
import org.jeecg.modules.actualControl.billetActual.billetActual.entity.BilletBasicInfo;
|
|
|
import org.jeecg.modules.actualControl.billetActual.billetActual.service.IBilletBasicInfoService;
|
|
@@ -59,6 +61,7 @@ import java.util.stream.Collectors;
|
|
|
* @Version: V1.0
|
|
|
*/
|
|
|
@Service
|
|
|
+@Slf4j
|
|
|
public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingAndLoadingVehiclesMapper, StackingAndLoadingVehicles> implements IStackingAndLoadingVehiclesService {
|
|
|
|
|
|
@Autowired
|
|
@@ -477,12 +480,34 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
|
|
|
@Override
|
|
|
public void loadingHandle(LoadingParams loadingParams) {
|
|
|
+ // 根据billetHotsendTypeConfigId 查询基础垛位信息
|
|
|
+ BilletHotsendTypeConfig billetHotsendTypeConfig = billetHotsendTypeConfigService.getById(loadingParams.getBilletHotsendTypeConfigId());
|
|
|
+ if (oConvertUtils.isEmpty(billetHotsendTypeConfig)){
|
|
|
+ log.info("{}{}", "垛位保存或发车,查询基础钢坯类型配置信息为空!", JSON.toJSONString(loadingParams));
|
|
|
+ return;
|
|
|
+ }
|
|
|
List<StackingAndLoadingVehicles> stackingAndLoadingVehiclesListParam = loadingParams.getStackingAndLoadingVehiclesList();
|
|
|
StorageBill storageBill = loadingParams.getStorageBill();
|
|
|
- // 2 先移除 堆垛公共容器中的记录 stacking_and_loading_vehicles
|
|
|
+ // 1 保存或更新 钢坯热送基础信息 billet_hotsend
|
|
|
+ BilletHotsend billetHotsend = new BilletHotsend();
|
|
|
+ BeanUtils.copyProperties(loadingParams.getBilletHotsend(), billetHotsend);
|
|
|
+ billetHotsend.setCreateDate(new Date());
|
|
|
+ if ("stacking_and_loading_vehicles".equals(loadingParams.getBelongTable()) && "1".equals(billetHotsendTypeConfig.getBelongTable())){
|
|
|
+ billetHotsend.setStackNum(stackingAndLoadingVehiclesListParam.size() * 4); // 堆垛总支数
|
|
|
+ }
|
|
|
+// billetHotsend.setAmountTotal(stackingAndLoadingVehiclesListParam.size());// 总支数
|
|
|
+ if (billetHotsend.getIsUpd()){
|
|
|
+ billetHotsendBaseService.save(billetHotsend);
|
|
|
+ }else {
|
|
|
+ LambdaUpdateWrapper<BilletHotsend> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
+ updateWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo()).eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo());
|
|
|
+ billetHotsendBaseService.update(billetHotsend, updateWrapper);
|
|
|
+ }
|
|
|
+ // 2 先查询堆垛公共容器中的信息,在批量移除 堆垛公共容器中的记录 stacking_and_loading_vehicles
|
|
|
List<String> ids = stackingAndLoadingVehiclesListParam.stream().map(StackingAndLoadingVehicles::getId).collect(Collectors.toList());
|
|
|
List<StackingAndLoadingVehicles> stackingAndLoadingVehiclesList = baseMapper.selectBatchIds(ids);
|
|
|
if (oConvertUtils.listIsEmpty(stackingAndLoadingVehiclesList)){
|
|
|
+ log.info("{}{}", "垛位保存或发车,堆垛容器信息信息为空!", JSON.toJSONString(loadingParams));
|
|
|
return;
|
|
|
}
|
|
|
baseMapper.deleteBatchIds(stackingAndLoadingVehiclesList.stream().map(StackingAndLoadingVehicles::getId).collect(Collectors.toList()));
|
|
@@ -500,20 +525,9 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
stackingDownLogList.add(stackingDownLog);
|
|
|
});
|
|
|
stackingDownLogService.saveBatch(stackingDownLogList);
|
|
|
- // 4 保存或更新 钢坯热送基础信息 billet_hotsend
|
|
|
- BilletHotsend billetHotsend = new BilletHotsend();
|
|
|
- BeanUtils.copyProperties(loadingParams.getBilletHotsend(), billetHotsend);
|
|
|
- billetHotsend.setCreateDate(new Date());
|
|
|
- billetHotsend.setAmountTotal(stackingAndLoadingVehiclesListParam.size());// 总支数
|
|
|
- if (billetHotsend.getIsUpd()){
|
|
|
- billetHotsendBaseService.save(billetHotsend);
|
|
|
- }else {
|
|
|
- LambdaUpdateWrapper<BilletHotsend> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
- updateWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo()).eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo());
|
|
|
- billetHotsendBaseService.update(billetHotsend, updateWrapper);
|
|
|
- }
|
|
|
+
|
|
|
List<String> billetNos = new ArrayList<>();
|
|
|
- // 5 根据所属表 保存对应的棒线和对象信息,明细信息 roll_club_two、roll_club_two_details、roll_club_three、roll_club_three_details、roll_out_shipp、roll_out_shipp_details
|
|
|
+ // 4 根据所属表 保存对应的棒线和对象信息,明细信息 roll_club_two、roll_club_two_details、roll_club_three、roll_club_three_details、roll_out_shipp、roll_out_shipp_details
|
|
|
if ("roll_club_two".equals(loadingParams.getBelongTable())){
|
|
|
// 保存棒一信息
|
|
|
RollClubTwo rollClubTwo = new RollClubTwo();
|
|
@@ -590,7 +604,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
});
|
|
|
rollOutShippDetailsService.saveBatch(rollOutShippDetailsList);
|
|
|
}
|
|
|
- //查询并批量更新钢坯基础信息 belongTable
|
|
|
+ //5 查询并批量更新钢坯基础信息 belongTable
|
|
|
LambdaQueryWrapper<BilletBasicInfo> queryWrapper = new LambdaQueryWrapper<BilletBasicInfo>()
|
|
|
.eq(BilletBasicInfo::getCcmNo, Integer.valueOf(billetHotsend.getCcmNo()))
|
|
|
.eq(BilletBasicInfo::getHeatNo, billetHotsend.getHeatNo())
|
|
@@ -609,6 +623,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
x.setBelongTable("roll_out_shipp");
|
|
|
}
|
|
|
x.setUpdateTime(new Date());
|
|
|
+ x.setBhtcId(loadingParams.getBilletHotsendTypeConfigId());
|
|
|
});
|
|
|
billetBasicInfoService.saveOrUpdateBatch(billetBasicInfoList);
|
|
|
/**
|
|
@@ -663,8 +678,6 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
count = rollOutShippDetailsList.stream().count();
|
|
|
}
|
|
|
}
|
|
|
- // 根据billetHotsendTypeConfigId 查询基础垛位信息
|
|
|
- BilletHotsendTypeConfig billetHotsendTypeConfig = billetHotsendTypeConfigService.getById(loadingParams.getBilletHotsendTypeConfigId());
|
|
|
storageCarLog.setDestination(billetHotsendTypeConfig.getTypeName());// 目的地
|
|
|
storageCarLog.setCarNm(storageCarLog.getCarNm());// 车号
|
|
|
// storageCarLog.setFixedWeight();// 定重
|