|
@@ -63,7 +63,7 @@ import java.util.stream.Collectors;
|
|
|
/**
|
|
|
* @Description: 垛位装车
|
|
|
* @Author: jeecg-boot
|
|
|
- * @Date: 2024-05-22
|
|
|
+ * @Date: 2024-05-22
|
|
|
* @Version: V1.0
|
|
|
*/
|
|
|
@Service
|
|
@@ -129,7 +129,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
// 获取所有的坯号集合
|
|
|
List<String> billetNosList = stackingAndLoadingVehiclesList.stream().map(StackingAndLoadingVehicles::getBilletNos)
|
|
|
.flatMap(billetNos -> {
|
|
|
- if (billetNos!= null) {
|
|
|
+ if (billetNos != null) {
|
|
|
return java.util.stream.Stream.of(billetNos.split(","));
|
|
|
} else {
|
|
|
return java.util.stream.Stream.empty();
|
|
@@ -143,17 +143,17 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
result.put("fail", "钢坯基础信息为空,垛位装车保存失败");
|
|
|
return result;
|
|
|
}
|
|
|
- List<RollClubCommon> rollClubCommonList= new ArrayList<>();
|
|
|
- billetBasicInfoList.forEach(x ->{
|
|
|
+ List<RollClubCommon> rollClubCommonList = new ArrayList<>();
|
|
|
+ billetBasicInfoList.forEach(x -> {
|
|
|
RollClubCommon rollClubCommon = new RollClubCommon();
|
|
|
BeanUtils.copyProperties(x, rollClubCommon);
|
|
|
rollClubCommon.setCcmNo(x.getCcmNo().toString());
|
|
|
rollClubCommonList.add(rollClubCommon);
|
|
|
});
|
|
|
|
|
|
- StorageBill storageBill =loadingParams.getStorageBill();
|
|
|
+ StorageBill storageBill = loadingParams.getStorageBill();
|
|
|
String rollHeightStorageBillId = String.valueOf(IdWorker.getId());
|
|
|
- handleStackDepartCommon(billetHotsend, stackingAndLoadingVehiclesList, loadingParams, billetHotsendTypeConfig, storageBill, rollHeightStorageBillId);
|
|
|
+ handleStackDepartCommon(billetHotsend, stackingAndLoadingVehiclesList, loadingParams, billetHotsendTypeConfig, storageBill, rollHeightStorageBillId, rollClubCommonList);
|
|
|
|
|
|
// 先根据垛位容器中的铸机号和炉号 查询钢坯热送基础信息
|
|
|
Map<String, List<RollClubCommon>> rollClubCommonListttt = groupByShiftAttributes(rollClubCommonList);
|
|
@@ -166,10 +166,10 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
LambdaQueryWrapper<BilletHotsend> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
|
|
|
.eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
|
|
|
- .eq(BilletHotsend::getShift, billetHotsend.getShift())
|
|
|
+ .eq(BilletHotsend::getShift, billetHotsend.getShift())
|
|
|
.eq(BilletHotsend::getShiftGroup, billetHotsend.getShiftGroup());
|
|
|
BilletHotsend idExistBh = billetHotsendBaseService.getOne(queryWrapper);
|
|
|
- if (oConvertUtils.isEmpty(idExistBh)){
|
|
|
+ if (oConvertUtils.isEmpty(idExistBh)) {
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
result.put("fail", "钢坯热送单为空,垛位装车保存失败");
|
|
|
return result;
|
|
@@ -177,11 +177,11 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
billetHotsend.setId(idExistBh.getId());
|
|
|
// billetHotsend.setStackNum(idExistBh.getStackNum() - groupRollClubCommonList.size());
|
|
|
// 钢坯热送基础信息存在,但是钢坯信息不存在 直接返回
|
|
|
- if ("roll_club_two".equals(loadingParams.getDestinationTable())){
|
|
|
+ if ("roll_club_two".equals(loadingParams.getDestinationTable())) {
|
|
|
billetHotsend.setRollclubtwoNum(oConvertUtils.isNotEmpty(idExistBh.getRollclubtwoNum()) ? idExistBh.getRollclubtwoNum() + groupRollClubCommonList.size() : groupRollClubCommonList.size());
|
|
|
- }else if ("roll_club_three".equals(loadingParams.getDestinationTable())){
|
|
|
+ } else if ("roll_club_three".equals(loadingParams.getDestinationTable())) {
|
|
|
billetHotsend.setRollclubthreeNum(oConvertUtils.isNotEmpty(idExistBh.getRollclubthreeNum()) ? idExistBh.getRollclubthreeNum() + groupRollClubCommonList.size() : groupRollClubCommonList.size());
|
|
|
- }else if ("roll_out_shipp".equals(loadingParams.getDestinationTable())){
|
|
|
+ } else if ("roll_out_shipp".equals(loadingParams.getDestinationTable())) {
|
|
|
billetHotsend.setRolloutshippNum(oConvertUtils.isNotEmpty(idExistBh.getRolloutshippNum()) ? idExistBh.getRolloutshippNum() + groupRollClubCommonList.size() : groupRollClubCommonList.size());
|
|
|
}
|
|
|
billetHotsend.setUpdateTime(new Date());
|
|
@@ -189,7 +189,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
}
|
|
|
|
|
|
//5 查询并批量更新钢坯基础信息 belongTable
|
|
|
- billetBasicInfoList.forEach(x ->{
|
|
|
+ billetBasicInfoList.forEach(x -> {
|
|
|
x.setBelongTable(loadingParams.getDestinationTable());
|
|
|
x.setBhtcId(loadingParams.getDestinationId());
|
|
|
x.setUpdateTime(new Date());
|
|
@@ -204,16 +204,16 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
storageBill.setTypeConfigId(loadingParams.getDestinationId());
|
|
|
String distinctAssemblyNumber = billetBasicInfoList.stream()
|
|
|
.map(BilletBasicInfo::getAssemblyNumber)
|
|
|
- .filter(assemblyNumber -> assemblyNumber!= null)
|
|
|
+ .filter(assemblyNumber -> assemblyNumber != null)
|
|
|
.distinct()
|
|
|
.collect(Collectors.joining(","));
|
|
|
- if (oConvertUtils.isNotEmpty(storageBill)){
|
|
|
+ if (oConvertUtils.isNotEmpty(storageBill)) {
|
|
|
String existingAssemblyNumber = storageBill.getAssemblyNumber();
|
|
|
String finalAssemblyNumber = Optional.ofNullable(existingAssemblyNumber)
|
|
|
.map(s -> s + "," + distinctAssemblyNumber)
|
|
|
.orElse(distinctAssemblyNumber);
|
|
|
storageBill.setAssemblyNumber(finalAssemblyNumber);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
storageBill.setAssemblyNumber(distinctAssemblyNumber);
|
|
|
}
|
|
|
storageBillService.updateById(storageBill);
|
|
@@ -223,19 +223,20 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
|
|
|
/**
|
|
|
* 堆垛保存、堆垛发车公共处理
|
|
|
+ *
|
|
|
* @param billetHotsend
|
|
|
* @param stackingAndLoadingVehiclesList
|
|
|
* @param loadingParams
|
|
|
* @param billetHotsendTypeConfig
|
|
|
* @param storageBill
|
|
|
*/
|
|
|
- private void handleStackDepartCommon(BilletHotsend billetHotsend, List<StackingAndLoadingVehicles> stackingAndLoadingVehiclesList, LoadingParams loadingParams, BilletHotsendTypeConfig billetHotsendTypeConfig, StorageBill storageBill, String rollHeightStorageBillId){
|
|
|
+ private void handleStackDepartCommon(BilletHotsend billetHotsend, List<StackingAndLoadingVehicles> stackingAndLoadingVehiclesList, LoadingParams loadingParams, BilletHotsendTypeConfig billetHotsendTypeConfig, StorageBill storageBill, String rollHeightStorageBillId, List<RollClubCommon> rollClubCommonList) {
|
|
|
String keyShiftGroup = String.format("class:shift:group:%s", billetHotsend.getCcmNo());
|
|
|
String keyShift = String.format("class:shift:%s", billetHotsend.getCcmNo());
|
|
|
String finalCacheShintGroup = redisTemplate.opsForValue().get(keyShiftGroup).toString();
|
|
|
String finalCacheShint = redisTemplate.opsForValue().get(keyShift).toString();
|
|
|
// 根据铸机号、位置、层数、类型配置ID更新 初始化容器中的垛位信息
|
|
|
- stackingAndLoadingVehiclesList.forEach(x ->{
|
|
|
+ stackingAndLoadingVehiclesList.forEach(x -> {
|
|
|
LambdaUpdateWrapper<StackingAndLoadingVehicles> updateWrapper = new LambdaUpdateWrapper();
|
|
|
updateWrapper.eq(StackingAndLoadingVehicles::getId, x.getId())
|
|
|
.set(StackingAndLoadingVehicles::getBilletNos, null)
|
|
@@ -257,7 +258,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
List<RollOutShippDetails> addRollOutShippDetailsList = new ArrayList<>();
|
|
|
List<RollHeightDetails> rollHeightDetailsList = new ArrayList<>();
|
|
|
|
|
|
- stackingAndLoadingVehiclesList.forEach(x ->{
|
|
|
+ stackingAndLoadingVehiclesList.forEach(x -> {
|
|
|
StackingDownLog stackingDownLog = new StackingDownLog();
|
|
|
BeanUtils.copyProperties(x, stackingDownLog);
|
|
|
stackingDownLog.setId(String.valueOf(IdWorker.getId()));
|
|
@@ -267,7 +268,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
LambdaQueryWrapper<BilletBasicInfo> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.in(BilletBasicInfo::getBilletNo, Arrays.asList(parts));
|
|
|
List<BilletBasicInfo> billetBasicInfoList = billetBasicInfoService.list(queryWrapper);
|
|
|
- if (oConvertUtils.listIsEmpty(billetBasicInfoList)){
|
|
|
+ if (oConvertUtils.listIsEmpty(billetBasicInfoList)) {
|
|
|
log.info("{}{}", "未查询到钢坯基础信息,堆垛操作失败!:", Arrays.asList(parts));
|
|
|
return;
|
|
|
}
|
|
@@ -285,8 +286,8 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
stackingDownLog.setShiftGroup(finalCacheShintGroup);
|
|
|
// stackingUpLog.setFromStackingId(stackingAndLoadingVehicles.getId());
|
|
|
stackingDownLogList.add(stackingDownLog);
|
|
|
- if ("roll_club_two".equals(loadingParams.getDestinationTable())){
|
|
|
- billetBasicInfoList.forEach(y ->{
|
|
|
+ if ("roll_club_two".equals(loadingParams.getDestinationTable())) {
|
|
|
+ billetBasicInfoList.forEach(y -> {
|
|
|
LambdaQueryWrapper<RollClubTwo> queryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
queryWrapper1.eq(RollClubTwo::getCcmNo, y.getCcmNo().toString())
|
|
|
.eq(RollClubTwo::getHeatNo, y.getHeatNo())
|
|
@@ -295,7 +296,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
.eq(RollClubTwo::getStorageBillId, storageBill.getId());
|
|
|
RollClubTwo rollClubTwo1 = rollClubTwoService.getOne(queryWrapper1);
|
|
|
RollClubTwo rollClubTwo = new RollClubTwo();
|
|
|
- if (oConvertUtils.isEmpty(rollClubTwo1)){
|
|
|
+ if (oConvertUtils.isEmpty(rollClubTwo1)) {
|
|
|
// 堆垛保存时 目的地为为棒二 保存棒二信息
|
|
|
rollClubTwo.setId(String.valueOf(IdWorker.getId()));
|
|
|
rollClubTwo.setCcmNo(y.getCcmNo().toString());
|
|
@@ -311,7 +312,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
rollClubTwo.setCreateDate(new Date());
|
|
|
rollClubTwo.setCreateTime(new Date());
|
|
|
rollClubTwoService.save(rollClubTwo);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
// 堆垛发车时
|
|
|
rollClubTwo.setId(rollClubTwo1.getId());
|
|
|
rollClubTwo.setAmountTotal(rollClubTwo1.getAmountTotal() + 1);// 总支数
|
|
@@ -335,8 +336,8 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
rollClubTwoDetails.setId(String.valueOf(IdWorker.getId()));
|
|
|
rollClubTwoDetails.setBlankOutput(billetWeightTotal);//出坯量
|
|
|
addRollClubTwoDetailsList.add(rollClubTwoDetails);
|
|
|
- }else if ("roll_club_three".equals(loadingParams.getDestinationTable())){
|
|
|
- billetBasicInfoList.forEach(y ->{
|
|
|
+ } else if ("roll_club_three".equals(loadingParams.getDestinationTable())) {
|
|
|
+ billetBasicInfoList.forEach(y -> {
|
|
|
LambdaQueryWrapper<RollClubThree> queryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
queryWrapper1.eq(RollClubThree::getCcmNo, y.getCcmNo().toString())
|
|
|
.eq(RollClubThree::getHeatNo, y.getHeatNo())
|
|
@@ -345,7 +346,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
.eq(RollClubThree::getStorageBillId, storageBill.getId());
|
|
|
RollClubThree rollClubThree1 = rollClubThreeService.getOne(queryWrapper1);
|
|
|
RollClubThree rollClubThree = new RollClubThree();
|
|
|
- if (oConvertUtils.isEmpty(rollClubThree1)){
|
|
|
+ if (oConvertUtils.isEmpty(rollClubThree1)) {
|
|
|
// 堆垛保存发车时 目的地为为棒三 保存棒三信息
|
|
|
rollClubThree.setId(String.valueOf(IdWorker.getId()));
|
|
|
rollClubThree.setCcmNo(y.getCcmNo().toString());
|
|
@@ -361,7 +362,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
rollClubThree.setCreateDate(new Date());
|
|
|
rollClubThree.setCreateTime(new Date());
|
|
|
rollClubThreeService.save(rollClubThree);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
// 堆垛保存发车时 目的地为为棒三 更新棒三信息
|
|
|
rollClubThree.setId(rollClubThree1.getId());
|
|
|
rollClubThree.setAmountTotal(rollClubThree1.getAmountTotal() + 1);// 总支数
|
|
@@ -386,8 +387,8 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
rollClubThreeDetails.setId(String.valueOf(IdWorker.getId()));
|
|
|
rollClubThreeDetails.setBlankOutput(billetWeightTotal);//出坯量
|
|
|
addRollClubThreeDetailsList.add(rollClubThreeDetails);
|
|
|
- }else if ("roll_out_shipp".equals(loadingParams.getDestinationTable())){
|
|
|
- billetBasicInfoList.forEach(y ->{
|
|
|
+ } else if ("roll_out_shipp".equals(loadingParams.getDestinationTable())) {
|
|
|
+ billetBasicInfoList.forEach(y -> {
|
|
|
LambdaQueryWrapper<RollOutShipp> queryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
queryWrapper1.eq(RollOutShipp::getCcmNo, y.getCcmNo().toString())
|
|
|
.eq(RollOutShipp::getHeatNo, y.getHeatNo())
|
|
@@ -396,7 +397,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
.eq(RollOutShipp::getStorageBillId, storageBill.getId());
|
|
|
RollOutShipp rollOutShipp1 = rollOutShippService.getOne(queryWrapper1);
|
|
|
RollOutShipp rollOutShipp = new RollOutShipp();
|
|
|
- if (oConvertUtils.isEmpty(rollOutShipp1)){
|
|
|
+ if (oConvertUtils.isEmpty(rollOutShipp1)) {
|
|
|
// 堆垛保存发车时 目的地为为上若 保存上若信息
|
|
|
rollOutShipp.setId(String.valueOf(IdWorker.getId()));
|
|
|
rollOutShipp.setCcmNo(y.getCcmNo().toString());
|
|
@@ -412,7 +413,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
rollOutShipp.setCreateDate(new Date());
|
|
|
rollOutShipp.setCreateTime(new Date());
|
|
|
rollOutShippService.save(rollOutShipp);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
// 堆垛保存发车时 目的地为为上若 更新上若信息
|
|
|
rollOutShipp.setId(rollOutShipp1.getId());
|
|
|
rollOutShipp.setAmountTotal(rollOutShipp1.getAmountTotal() + 1);// 总支数
|
|
@@ -437,16 +438,23 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
rollOutShippDetails.setUpdateTime(new Date());
|
|
|
rollOutShippDetails.setBlankOutput(billetWeightTotal);//出坯量
|
|
|
addRollOutShippDetailsList.add(rollOutShippDetails);
|
|
|
- }else if ("roll_height".equals(loadingParams.getDestinationTable())){
|
|
|
- billetBasicInfoList.forEach(y ->{
|
|
|
+ } else if ("roll_height".equals(loadingParams.getDestinationTable())) {
|
|
|
+ billetBasicInfoList.forEach(y -> {
|
|
|
LambdaQueryWrapper<RollHeight> queryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
queryWrapper1.eq(RollHeight::getCcmNo, billetHotsend.getCcmNo())
|
|
|
.eq(RollHeight::getHeatNo, billetHotsend.getHeatNo())
|
|
|
.eq(RollHeight::getShift, billetHotsend.getShift())
|
|
|
.eq(RollHeight::getShiftGroup, billetHotsend.getShiftGroup());
|
|
|
RollHeight rollHeight1 = rollHeightService.getOne(queryWrapper1);
|
|
|
+
|
|
|
RollHeight rollHeight = new RollHeight();
|
|
|
- if (oConvertUtils.isEmpty(rollHeight1)){
|
|
|
+ if (oConvertUtils.isEmpty(rollHeight1)) {
|
|
|
+
|
|
|
+ String distinctAssemblyNumber = rollClubCommonList.stream()
|
|
|
+ .map(RollClubCommon::getAssemblyNumber)
|
|
|
+ .filter(assemblyNumber -> assemblyNumber != null)
|
|
|
+ .distinct()
|
|
|
+ .collect(Collectors.joining(","));
|
|
|
// 堆垛保存发车时 目的地为高线时 保存上若信息
|
|
|
rollHeight.setId(String.valueOf(IdWorker.getId()));
|
|
|
rollHeight.setCcmNo(y.getCcmNo().toString());
|
|
@@ -460,13 +468,37 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
rollHeight.setBlankOutput(oConvertUtils.isEmpty(y.getBilletWeight()) ? 0L : y.getBilletWeight());
|
|
|
rollHeight.setCreateDate(new Date());
|
|
|
rollHeight.setCreateTime(new Date());
|
|
|
+ rollHeight.setAssemblyNumber(distinctAssemblyNumber); // 设置去重后的 assemblyNumber
|
|
|
rollHeightService.save(rollHeight);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
// 堆垛发车时 目的地为高线 更新高线信息
|
|
|
rollHeight.setId(rollHeight1.getId());
|
|
|
rollHeight.setAmountTotal(rollHeight1.getAmountTotal() + 1);// 总支数
|
|
|
rollHeight.setBlankOutput(rollHeight1.getBlankOutput() + y.getBilletWeight());
|
|
|
rollHeight.setUpdateTime(new Date());
|
|
|
+
|
|
|
+ String assemblyNumber = "";
|
|
|
+ if (oConvertUtils.isNotEmpty(rollHeight1.getAssemblyNumber())) {
|
|
|
+ assemblyNumber = rollHeight1.getAssemblyNumber() + "," + rollClubCommonList.stream()
|
|
|
+ .map(RollClubCommon::getAssemblyNumber)
|
|
|
+ .filter(t -> t != null)
|
|
|
+ .distinct()
|
|
|
+ .collect(Collectors.joining(","));
|
|
|
+ // 对 assemblyNumber 进行二次去重
|
|
|
+ String finalAssemblyNumber = Arrays.stream(assemblyNumber.split(","))
|
|
|
+ .filter(s -> !s.isEmpty())
|
|
|
+ .distinct()
|
|
|
+ .collect(Collectors.joining(","));
|
|
|
+ rollHeight.setAssemblyNumber(finalAssemblyNumber);
|
|
|
+ } else {
|
|
|
+ assemblyNumber = rollClubCommonList.stream()
|
|
|
+ .map(RollClubCommon::getAssemblyNumber)
|
|
|
+ .filter(n -> n != null)
|
|
|
+ .distinct()
|
|
|
+ .collect(Collectors.joining(","));
|
|
|
+ rollHeight.setAssemblyNumber(assemblyNumber);
|
|
|
+ }
|
|
|
+
|
|
|
rollHeightService.updateById(rollHeight);
|
|
|
}
|
|
|
});
|
|
@@ -491,13 +523,13 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
});
|
|
|
stackingDownLogService.saveBatch(stackingDownLogList);
|
|
|
// 根据所去的目的地 保存到对应的明细表
|
|
|
- if ("roll_club_two".equals(loadingParams.getDestinationTable())){
|
|
|
+ if ("roll_club_two".equals(loadingParams.getDestinationTable())) {
|
|
|
rollClubTwoDetailsService.saveBatch(addRollClubTwoDetailsList);
|
|
|
- }else if ("roll_club_three".equals(loadingParams.getDestinationTable())){
|
|
|
+ } else if ("roll_club_three".equals(loadingParams.getDestinationTable())) {
|
|
|
rollClubThreeDetailsService.saveBatch(addRollClubThreeDetailsList);
|
|
|
- }else if ("roll_out_shipp".equals(loadingParams.getDestinationTable())){
|
|
|
+ } else if ("roll_out_shipp".equals(loadingParams.getDestinationTable())) {
|
|
|
rollOutShippDetailsService.saveBatch(addRollOutShippDetailsList);
|
|
|
- }else if ("roll_height".equals(loadingParams.getDestinationTable())){
|
|
|
+ } else if ("roll_height".equals(loadingParams.getDestinationTable())) {
|
|
|
rollHeightDetailsService.saveBatch(rollHeightDetailsList);
|
|
|
}
|
|
|
}
|
|
@@ -515,7 +547,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
// 获取所有的坯号集合
|
|
|
List<String> billetNosList = stackingAndLoadingVehiclesList.stream().map(StackingAndLoadingVehicles::getBilletNos)
|
|
|
.flatMap(billetNos -> {
|
|
|
- if (billetNos!= null) {
|
|
|
+ if (billetNos != null) {
|
|
|
return java.util.stream.Stream.of(billetNos.split(","));
|
|
|
} else {
|
|
|
return java.util.stream.Stream.empty();
|
|
@@ -525,21 +557,21 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
.eq(BilletBasicInfo::getCcmNo, Integer.valueOf(billetHotsend.getCcmNo()))
|
|
|
.in(BilletBasicInfo::getBilletNo, billetNosList);
|
|
|
List<BilletBasicInfo> billetBasicInfoList = billetBasicInfoService.list(queryWrapperBB);
|
|
|
- if (oConvertUtils.listIsEmpty(billetBasicInfoList)){
|
|
|
+ if (oConvertUtils.listIsEmpty(billetBasicInfoList)) {
|
|
|
result.put("fail", "钢坯基础信息不存在,堆垛发车保存失败!");
|
|
|
return result;
|
|
|
}
|
|
|
- List<RollClubCommon> rollClubCommonList= new ArrayList<>();
|
|
|
- billetBasicInfoList.forEach(x ->{
|
|
|
+ List<RollClubCommon> rollClubCommonList = new ArrayList<>();
|
|
|
+ billetBasicInfoList.forEach(x -> {
|
|
|
RollClubCommon rollClubCommon = new RollClubCommon();
|
|
|
BeanUtils.copyProperties(x, rollClubCommon);
|
|
|
rollClubCommon.setCcmNo(x.getCcmNo().toString());
|
|
|
rollClubCommonList.add(rollClubCommon);
|
|
|
});
|
|
|
|
|
|
- StorageBill storageBill =loadingParams.getStorageBill();
|
|
|
+ StorageBill storageBill = loadingParams.getStorageBill();
|
|
|
String rollHeightStorageBillId = String.valueOf(IdWorker.getId());
|
|
|
- handleStackDepartCommon(billetHotsend, stackingAndLoadingVehiclesList, loadingParams, billetHotsendTypeConfig, storageBill, rollHeightStorageBillId);
|
|
|
+ handleStackDepartCommon(billetHotsend, stackingAndLoadingVehiclesList, loadingParams, billetHotsendTypeConfig, storageBill, rollHeightStorageBillId, rollClubCommonList);
|
|
|
Map<String, List<RollClubCommon>> rollClubCommonListttt = groupByShiftAttributes(rollClubCommonList);
|
|
|
for (Map.Entry<String, List<RollClubCommon>> entry : rollClubCommonListttt.entrySet()) {
|
|
|
String[] parts = entry.getKey().split(",");
|
|
@@ -550,10 +582,10 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
LambdaQueryWrapper<BilletHotsend> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
|
|
|
.eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
|
|
|
- .eq(BilletHotsend::getShift, billetHotsend.getShift())
|
|
|
+ .eq(BilletHotsend::getShift, billetHotsend.getShift())
|
|
|
.eq(BilletHotsend::getShiftGroup, billetHotsend.getShiftGroup());
|
|
|
BilletHotsend idExistBh = billetHotsendBaseService.getOne(queryWrapper);
|
|
|
- if (oConvertUtils.isEmpty(idExistBh)){
|
|
|
+ if (oConvertUtils.isEmpty(idExistBh)) {
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
result.put("fail", "钢坯热送单为空,垛位发车失败");
|
|
|
return result;
|
|
@@ -561,20 +593,20 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
billetHotsend.setId(idExistBh.getId());
|
|
|
// billetHotsend.setStackNum(idExistBh.getStackNum() - groupRollClubCommonList.size());
|
|
|
// 钢坯热送基础信息存在,但是钢坯信息不存在 直接返回
|
|
|
- if ("roll_club_two".equals(loadingParams.getDestinationTable())){
|
|
|
+ if ("roll_club_two".equals(loadingParams.getDestinationTable())) {
|
|
|
billetHotsend.setRollclubtwoNum(oConvertUtils.isNotEmpty(idExistBh.getRollclubtwoNum()) ? idExistBh.getRollclubtwoNum() + groupRollClubCommonList.size() : groupRollClubCommonList.size());
|
|
|
- }else if ("roll_club_three".equals(loadingParams.getDestinationTable())){
|
|
|
+ } else if ("roll_club_three".equals(loadingParams.getDestinationTable())) {
|
|
|
billetHotsend.setRollclubthreeNum(oConvertUtils.isNotEmpty(idExistBh.getRollclubthreeNum()) ? idExistBh.getRollclubthreeNum() + groupRollClubCommonList.size() : groupRollClubCommonList.size());
|
|
|
- }else if ("roll_out_shipp".equals(loadingParams.getDestinationTable())){
|
|
|
+ } else if ("roll_out_shipp".equals(loadingParams.getDestinationTable())) {
|
|
|
billetHotsend.setRolloutshippNum(oConvertUtils.isNotEmpty(idExistBh.getRolloutshippNum()) ? idExistBh.getRolloutshippNum() + groupRollClubCommonList.size() : groupRollClubCommonList.size());
|
|
|
- }else if ("roll_height".equals(loadingParams.getDestinationTable())){
|
|
|
+ } else if ("roll_height".equals(loadingParams.getDestinationTable())) {
|
|
|
billetHotsend.setRollheightNum(oConvertUtils.isNotEmpty(idExistBh.getRollheightNum()) ? idExistBh.getRollheightNum() + groupRollClubCommonList.size() : groupRollClubCommonList.size());
|
|
|
}
|
|
|
billetHotsend.setUpdateTime(new Date());
|
|
|
billetHotsendBaseService.updateById(billetHotsend);
|
|
|
}
|
|
|
//5 获取所有的坯号集合 查询并批量更新钢坯基础信息 belongTable
|
|
|
- billetBasicInfoList.forEach(x ->{
|
|
|
+ billetBasicInfoList.forEach(x -> {
|
|
|
x.setBelongTable(loadingParams.getDestinationTable());
|
|
|
x.setBhtcId(loadingParams.getDestinationId());
|
|
|
});
|
|
@@ -585,7 +617,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
List<String> heatNoList = new ArrayList<>();
|
|
|
|
|
|
long count = 0L;
|
|
|
- if ("roll_club_two".equals(loadingParams.getDestinationTable())){
|
|
|
+ if ("roll_club_two".equals(loadingParams.getDestinationTable())) {
|
|
|
LambdaQueryWrapper<RollClubTwoDetails> queryWrapperRC = new LambdaQueryWrapper();
|
|
|
queryWrapperRC.eq(RollClubTwoDetails::getCcmNo, storageBill.getCcmNo()).eq(RollClubTwoDetails::getStorageBillId, storageBill.getId());
|
|
|
List<RollClubTwoDetails> rollClubTwoDetailsList = rollClubTwoDetailsService.list(queryWrapperRC);
|
|
@@ -593,11 +625,11 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
.collect(Collectors.toList());
|
|
|
heatNoList = rollClubTwoDetailsList.stream().map(RollClubTwoDetails::getHeatNo).distinct()
|
|
|
.collect(Collectors.toList());
|
|
|
- if (oConvertUtils.listIsNotEmpty(rollClubTwoDetailsList)){
|
|
|
+ if (oConvertUtils.listIsNotEmpty(rollClubTwoDetailsList)) {
|
|
|
count = rollClubTwoDetailsList.stream().count();
|
|
|
}
|
|
|
}
|
|
|
- if ("roll_club_three".equals(loadingParams.getDestinationTable())){
|
|
|
+ if ("roll_club_three".equals(loadingParams.getDestinationTable())) {
|
|
|
LambdaQueryWrapper<RollClubThreeDetails> queryWrapperCT = new LambdaQueryWrapper();
|
|
|
queryWrapperCT.eq(RollClubThreeDetails::getCcmNo, storageBill.getCcmNo()).eq(RollClubThreeDetails::getStorageBillId, storageBill.getId());
|
|
|
List<RollClubThreeDetails> rollClubThreeDetailsList = rollClubThreeDetailsService.list(queryWrapperCT);
|
|
@@ -605,11 +637,11 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
.collect(Collectors.toList());
|
|
|
heatNoList = rollClubThreeDetailsList.stream().map(RollClubThreeDetails::getHeatNo).distinct()
|
|
|
.collect(Collectors.toList());
|
|
|
- if (oConvertUtils.listIsNotEmpty(rollClubThreeDetailsList)){
|
|
|
+ if (oConvertUtils.listIsNotEmpty(rollClubThreeDetailsList)) {
|
|
|
count = rollClubThreeDetailsList.stream().count();
|
|
|
}
|
|
|
}
|
|
|
- if ("roll_out_shipp".equals(loadingParams.getDestinationTable())){
|
|
|
+ if ("roll_out_shipp".equals(loadingParams.getDestinationTable())) {
|
|
|
LambdaQueryWrapper<RollOutShippDetails> queryWrapperROS = new LambdaQueryWrapper();
|
|
|
queryWrapperROS.eq(RollOutShippDetails::getCcmNo, storageBill.getCcmNo()).eq(RollOutShippDetails::getStorageBillId, storageBill.getId());
|
|
|
List<RollOutShippDetails> rollOutShippDetailsList = rollOutShippDetailsService.list(queryWrapperROS);
|
|
@@ -617,11 +649,11 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
.collect(Collectors.toList());
|
|
|
heatNoList = rollOutShippDetailsList.stream().map(RollOutShippDetails::getHeatNo).distinct()
|
|
|
.collect(Collectors.toList());
|
|
|
- if (oConvertUtils.listIsNotEmpty(rollOutShippDetailsList)){
|
|
|
+ if (oConvertUtils.listIsNotEmpty(rollOutShippDetailsList)) {
|
|
|
count = rollOutShippDetailsList.stream().count();
|
|
|
}
|
|
|
}
|
|
|
- if ("roll_height".equals(loadingParams.getDestinationTable())){
|
|
|
+ if ("roll_height".equals(loadingParams.getDestinationTable())) {
|
|
|
heatNoList = rollClubCommonList.stream().map(RollClubCommon::getHeatNo).distinct().collect(Collectors.toList());
|
|
|
List<Integer> sizeHeightList = rollClubCommonList.stream().map(RollClubCommon::getLength).distinct().collect(Collectors.toList());
|
|
|
List<String> sizeLists = sizeHeightList.stream().map(String::valueOf).collect(Collectors.toList());
|
|
@@ -630,7 +662,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
storageBillInfo.setId(rollHeightStorageBillId);
|
|
|
String distinctAssemblyNumber = billetBasicInfoList.stream()
|
|
|
.map(BilletBasicInfo::getAssemblyNumber)
|
|
|
- .filter(assemblyNumber -> assemblyNumber!= null)
|
|
|
+ .filter(assemblyNumber -> assemblyNumber != null)
|
|
|
.distinct()
|
|
|
.collect(Collectors.joining(","));
|
|
|
storageBillInfo.setAssemblyNumber(distinctAssemblyNumber);
|
|
@@ -655,17 +687,17 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
|
|
|
String distinctAssemblyNumber = billetBasicInfoList.stream()
|
|
|
.map(BilletBasicInfo::getAssemblyNumber)
|
|
|
- .filter(assemblyNumber -> assemblyNumber!= null)
|
|
|
+ .filter(assemblyNumber -> assemblyNumber != null)
|
|
|
.distinct()
|
|
|
.collect(Collectors.joining(","));
|
|
|
|
|
|
- if (oConvertUtils.isNotEmpty(storageBill)){
|
|
|
+ if (oConvertUtils.isNotEmpty(storageBill)) {
|
|
|
String existingAssemblyNumber = storageBill.getAssemblyNumber();
|
|
|
String finalAssemblyNumber = Optional.ofNullable(existingAssemblyNumber)
|
|
|
.map(s -> s + "," + distinctAssemblyNumber)
|
|
|
.orElse(distinctAssemblyNumber);
|
|
|
storageBill.setAssemblyNumber(finalAssemblyNumber);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
storageBill.setAssemblyNumber(distinctAssemblyNumber);
|
|
|
}
|
|
|
|
|
@@ -678,7 +710,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
queryWrappersd.eq(StackingDownLog::getCcmNo, storageBill.getCcmNo()).eq(StackingDownLog::getStorageBillId, storageBill.getId());
|
|
|
List<StackingDownLog> stackingDownLogs = stackingDownLogService.list(queryWrappersd);
|
|
|
|
|
|
- Integer bx =Integer.valueOf((int) count);
|
|
|
+ Integer bx = Integer.valueOf((int) count);
|
|
|
Integer dd = stackingDownLogs.size() * 4 + bx;
|
|
|
storageCarLog.setDestination(loadingParams.getDestination());// 目的地
|
|
|
storageCarLog.setCarNm(storageBill.getLicensePlate());// 车牌号
|
|
@@ -694,18 +726,19 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
|
|
|
/**
|
|
|
* 堆垛保存 公共方法
|
|
|
+ *
|
|
|
* @param billetHotsend
|
|
|
* @param stackingAndLoadingVehiclesList
|
|
|
* @param loadingParams
|
|
|
* @param billetHotsendTypeConfig
|
|
|
*/
|
|
|
- private void handleAddStackInfo(BilletHotsend billetHotsend, List<StackingAndLoadingVehicles> stackingAndLoadingVehiclesList, LoadingParams loadingParams, BilletHotsendTypeConfig billetHotsendTypeConfig){
|
|
|
+ private void handleAddStackInfo(BilletHotsend billetHotsend, List<StackingAndLoadingVehicles> stackingAndLoadingVehiclesList, LoadingParams loadingParams, BilletHotsendTypeConfig billetHotsendTypeConfig) {
|
|
|
String keyShiftGroup = String.format("class:shift:group:%s", billetHotsend.getCcmNo());
|
|
|
String keyShift = String.format("class:shift:%s", billetHotsend.getCcmNo());
|
|
|
String finalCacheShintGroup = redisTemplate.opsForValue().get(keyShiftGroup).toString();
|
|
|
String finalCacheShint = redisTemplate.opsForValue().get(keyShift).toString();
|
|
|
// 2 发车后,动态更新容器中的垛位信息 初始化
|
|
|
- stackingAndLoadingVehiclesList.forEach(x ->{
|
|
|
+ stackingAndLoadingVehiclesList.forEach(x -> {
|
|
|
LambdaUpdateWrapper<StackingAndLoadingVehicles> queryWrapperSA = new LambdaUpdateWrapper<>();
|
|
|
queryWrapperSA.eq(StackingAndLoadingVehicles::getCcmNo, x.getCcmNo())
|
|
|
.eq(StackingAndLoadingVehicles::getLayer, x.getLayer())
|
|
@@ -727,7 +760,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
});
|
|
|
// 3 保存 起垛日志 stacking_up_log
|
|
|
List<StackingUpLog> stackingUpLogList = new ArrayList<>();
|
|
|
- stackingAndLoadingVehiclesList.forEach(x ->{
|
|
|
+ stackingAndLoadingVehiclesList.forEach(x -> {
|
|
|
StackingUpLog stackingUpLog = new StackingUpLog();
|
|
|
BeanUtils.copyProperties(x, stackingUpLog);
|
|
|
stackingUpLog.setId(String.valueOf(IdWorker.getId()));
|
|
@@ -738,7 +771,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
LambdaQueryWrapper<BilletBasicInfo> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.in(BilletBasicInfo::getBilletNo, Arrays.asList(parts));
|
|
|
List<BilletBasicInfo> billetBasicInfoList = billetBasicInfoService.list(queryWrapper);
|
|
|
- if (oConvertUtils.listIsEmpty(billetBasicInfoList)){
|
|
|
+ if (oConvertUtils.listIsEmpty(billetBasicInfoList)) {
|
|
|
log.info("{}{}", "堆垛起剁日志保存失败,钢坯基础信息不存在!", x.getBilletNos());
|
|
|
return;
|
|
|
}
|
|
@@ -769,7 +802,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
public JSONObject addStackInfo(LoadingParams loadingParams) {
|
|
|
JSONObject result = new JSONObject();
|
|
|
List<StackingAndLoadingVehicles> stackingAndLoadingVehiclesList = loadingParams.getStackingAndLoadingVehiclesList();
|
|
|
- if (oConvertUtils.listIsEmpty(stackingAndLoadingVehiclesList)){
|
|
|
+ if (oConvertUtils.listIsEmpty(stackingAndLoadingVehiclesList)) {
|
|
|
result.put("fail", "堆垛信息为空,保存失败");
|
|
|
return result;
|
|
|
}
|
|
@@ -780,7 +813,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
|
|
|
handleAddStackInfo(billetHotsend, stackingAndLoadingVehiclesList, loadingParams, billetHotsendTypeConfig);
|
|
|
|
|
|
- List<RollClubCommon> rollClubCommonList= loadingParams.getRollClubCommonList();
|
|
|
+ List<RollClubCommon> rollClubCommonList = loadingParams.getRollClubCommonList();
|
|
|
Map<String, List<RollClubCommon>> rollClubCommonListttt = groupByShiftAttributes(rollClubCommonList);
|
|
|
for (Map.Entry<String, List<RollClubCommon>> entry : rollClubCommonListttt.entrySet()) {
|
|
|
String[] parts = entry.getKey().split(",");
|
|
@@ -791,10 +824,10 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
LambdaQueryWrapper<BilletHotsend> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
|
|
|
.eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
|
|
|
- .eq(BilletHotsend::getShift, billetHotsend.getShift())
|
|
|
+ .eq(BilletHotsend::getShift, billetHotsend.getShift())
|
|
|
.eq(BilletHotsend::getShiftGroup, billetHotsend.getShiftGroup());
|
|
|
BilletHotsend idExistBh = billetHotsendBaseService.getOne(queryWrapper);
|
|
|
- if (oConvertUtils.isEmpty(idExistBh)){
|
|
|
+ if (oConvertUtils.isEmpty(idExistBh)) {
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
result.put("fail", "钢坯热送单为空,新增堆垛保存失败");
|
|
|
return result;
|
|
@@ -809,7 +842,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
//4 获取所有的坯号集合
|
|
|
List<String> billetNosList = stackingAndLoadingVehiclesList.stream().map(StackingAndLoadingVehicles::getBilletNos)
|
|
|
.flatMap(billetNoss -> {
|
|
|
- if (billetNoss!= null) {
|
|
|
+ if (billetNoss != null) {
|
|
|
return java.util.stream.Stream.of(billetNoss.split(","));
|
|
|
} else {
|
|
|
return java.util.stream.Stream.empty();
|
|
@@ -820,7 +853,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
.eq(BilletBasicInfo::getCcmNo, Integer.valueOf(billetHotsend.getCcmNo()))
|
|
|
.in(BilletBasicInfo::getBilletNo, billetNosList);
|
|
|
List<BilletBasicInfo> billetBasicInfoList = billetBasicInfoService.list(queryWrapperBB);
|
|
|
- billetBasicInfoList.forEach(x ->{
|
|
|
+ billetBasicInfoList.forEach(x -> {
|
|
|
x.setBelongTable("stacking_and_loading_vehicles");
|
|
|
x.setBhtcId(loadingParams.getBilletHotsendTypeConfigId());
|
|
|
});
|
|
@@ -833,12 +866,12 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
@Transactional
|
|
|
public String judgeDiscardHandle(LoadingParams loadingParams) {
|
|
|
List<StackingAndLoadingVehicles> stackingAndLoadingVehiclesList = loadingParams.getStackingAndLoadingVehiclesList();
|
|
|
- if (oConvertUtils.listIsEmpty(stackingAndLoadingVehiclesList)){
|
|
|
+ if (oConvertUtils.listIsEmpty(stackingAndLoadingVehiclesList)) {
|
|
|
return "钢坯叛废记录不存在!";
|
|
|
}
|
|
|
List<BilletHotsendAbandons> billetHotsendAbandonsList = new ArrayList<>();
|
|
|
// 2 发车后,动态更新容器中的垛位信息 初始化
|
|
|
- stackingAndLoadingVehiclesList.forEach(x ->{
|
|
|
+ stackingAndLoadingVehiclesList.forEach(x -> {
|
|
|
// 叛废后,动态更新容器中的垛位信息 初始化
|
|
|
LambdaUpdateWrapper<StackingAndLoadingVehicles> updateWrapper = new LambdaUpdateWrapper();
|
|
|
updateWrapper.eq(StackingAndLoadingVehicles::getId, x.getId())
|
|
@@ -878,7 +911,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
.eq(BilletHotsend::getShift, x.getShift())
|
|
|
.eq(BilletHotsend::getShiftGroup, x.getShiftGroup());
|
|
|
BilletHotsend idExistBh = billetHotsendBaseService.getOne(queryWrapperBH);
|
|
|
- if (oConvertUtils.isNotEmpty(idExistBh)){
|
|
|
+ if (oConvertUtils.isNotEmpty(idExistBh)) {
|
|
|
log.info("{}{}", ">>>>>更新钢坯热送基础信息叛废支数:", JSON.toJSON(idExistBh));
|
|
|
idExistBh.setWasteNum(oConvertUtils.isEmpty(idExistBh.getWasteNum()) ? 4 : idExistBh.getWasteNum() + 4);
|
|
|
// idExistBh.setStackNum(idExistBh.getStackNum() - 4);
|
|
@@ -893,7 +926,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
.eq(BilletHotsendChangeShift::getShift, loadingParams.getBilletHotsend().getShift())
|
|
|
.eq(BilletHotsendChangeShift::getShiftGroup, loadingParams.getBilletHotsend().getShiftGroup());
|
|
|
BilletHotsendChangeShift billetHotsendChangeShift = billetHotsendChangeShiftService.getOne(queryWrapperCS);
|
|
|
- if (oConvertUtils.isNotEmpty(billetHotsendChangeShift)){
|
|
|
+ if (oConvertUtils.isNotEmpty(billetHotsendChangeShift)) {
|
|
|
billetHotsendChangeShift.setWasteAmount(oConvertUtils.isEmpty(billetHotsendChangeShift.getWasteAmount()) ? stackingAndLoadingVehiclesList.size() : billetHotsendChangeShift.getWasteAmount() + stackingAndLoadingVehiclesList.size() * 4);
|
|
|
billetHotsendChangeShift.setUpdateTime(new Date());
|
|
|
billetHotsendChangeShiftService.updateById(billetHotsendChangeShift);
|
|
@@ -904,14 +937,17 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
|
|
|
/**
|
|
|
* 根据班组班别对钢坯信息进行分组
|
|
|
+ *
|
|
|
* @param rollClubCommonList
|
|
|
* @return
|
|
|
*/
|
|
|
public static Map<String, List<RollClubCommon>> groupByShiftAttributes(List<RollClubCommon> rollClubCommonList) {
|
|
|
return rollClubCommonList.stream().collect(Collectors.groupingBy(rollClubCommon -> rollClubCommon.getHeatNo() + "," + rollClubCommon.getShiftGroup() + "," + rollClubCommon.getShift()));
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 初始化StackingAndLoadingVehicles对象
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
private StackingAndLoadingVehicles createInitializedVehicle() {
|
|
@@ -930,11 +966,11 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
/**
|
|
|
* 根据铸机号、班次、班别查询当天交班记录,并根据提供的日志列表更新相应的总支数
|
|
|
*
|
|
|
- * @param ccmNo 铸机号
|
|
|
- * @param cacheShint 班次信息
|
|
|
+ * @param ccmNo 铸机号
|
|
|
+ * @param cacheShint 班次信息
|
|
|
* @param cacheShintGroup 班别信息
|
|
|
- * @param sum 总支数
|
|
|
- * @param type 操作类型,用于区分是热装还是起跺,比如 "hotSend" 表示热装,"stackUp" 表示起跺
|
|
|
+ * @param sum 总支数
|
|
|
+ * @param type 操作类型,用于区分是热装还是起跺,比如 "hotSend" 表示热装,"stackUp" 表示起跺
|
|
|
*/
|
|
|
public void updateShiftInfoByType(String ccmNo, String cacheShint, String cacheShintGroup, Integer sum, String type) {
|
|
|
LambdaQueryWrapper<BilletHotsendChangeShift> queryWrapperCS = new LambdaQueryWrapper<>();
|
|
@@ -944,12 +980,12 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
.between(BilletHotsendChangeShift::getCreateTime, DateUtils.getStartOfDay(), DateUtils.getEndOfDay());
|
|
|
BilletHotsendChangeShift billetHotsendChangeShift = billetHotsendChangeShiftService.getOne(queryWrapperCS);
|
|
|
if (oConvertUtils.isNotEmpty(billetHotsendChangeShift)) {
|
|
|
- String operationName = type.equals("hotSend")? "热装" : "起跺";
|
|
|
+ String operationName = type.equals("hotSend") ? "热装" : "起跺";
|
|
|
log.info("{}{}", ">>>>>堆垛统计当前班次" + operationName + "总支数:", sum + "班组:" + cacheShintGroup + "班次:" + cacheShint);
|
|
|
billetHotsendChangeShift.setUpdateTime(new Date());
|
|
|
- if ("hotSend".equals(type)){
|
|
|
+ if ("hotSend".equals(type)) {
|
|
|
billetHotsendChangeShift.setHotfeignAmount(billetHotsendChangeShift.getHotfeignAmount() + sum);
|
|
|
- }else if ("stackingUp".equals(type)){
|
|
|
+ } else if ("stackingUp".equals(type)) {
|
|
|
billetHotsendChangeShift.setStackAmount(billetHotsendChangeShift.getStackAmount() + sum);
|
|
|
}
|
|
|
billetHotsendChangeShiftService.updateById(billetHotsendChangeShift);
|
|
@@ -959,6 +995,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
|
|
|
/**
|
|
|
* 处理高线 装运单信息
|
|
|
+ *
|
|
|
* @param loadingParams
|
|
|
* @param rollClubCommonList
|
|
|
* @param sizeList
|
|
@@ -992,13 +1029,14 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
storageBillInfo.setSize(String.join(",", sizeList));
|
|
|
storageBillInfo.setDateTime(new Date());
|
|
|
storageBillInfo.setCreateTime(new Date());
|
|
|
- String uniqueCode = DateUtils.date2Str(new Date(), DateUtils.yyyymmddhhmmss.get()) + "-" + loadingParams.getBilletHotsend().getCcmNo() + "#" + ShiftEnum.fromCode(loadingParams.getBilletHotsend().getShift()).name() + "-" + ShiftGroupEnum.fromCode(loadingParams.getBilletHotsend().getShiftGroup()).name() ;
|
|
|
+ String uniqueCode = DateUtils.date2Str(new Date(), DateUtils.yyyymmddhhmmss.get()) + "-" + loadingParams.getBilletHotsend().getCcmNo() + "#" + ShiftEnum.fromCode(loadingParams.getBilletHotsend().getShift()).name() + "-" + ShiftGroupEnum.fromCode(loadingParams.getBilletHotsend().getShiftGroup()).name();
|
|
|
storageBillInfo.setUniqueCode(uniqueCode);
|
|
|
return storageBillInfo;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 处理储运记录
|
|
|
+ *
|
|
|
* @param storageBill
|
|
|
* @param rollClubCommonList
|
|
|
* @param heatNoList
|