|
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.util.DateUtils;
|
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
|
import org.jeecg.modules.actualControl.billetActual.billetActual.entity.BilletBasicInfo;
|
|
@@ -45,6 +46,7 @@ import org.jeecg.modules.billet.stackingAndLoadingVehicles.service.IStackingDown
|
|
|
import org.jeecg.modules.billet.stackingAndLoadingVehicles.service.IStackingUpLogService;
|
|
|
import org.jeecg.modules.billet.stackingAndLoadingVehicles.vo.ClipLayerVo;
|
|
|
import org.jeecg.modules.billet.stackingAndLoadingVehicles.vo.LoadingParams;
|
|
|
+import org.jeecg.modules.billet.stackingAndLoadingVehicles.vo.StackLocationChangeVO;
|
|
|
import org.jeecg.modules.billet.storageBill.entity.StorageBill;
|
|
|
import org.jeecg.modules.billet.storageBill.service.IStorageBillService;
|
|
|
import org.jeecg.modules.billet.storageCarLog.entity.StorageCarLog;
|
|
@@ -1044,6 +1046,50 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
return stackingAndLoadingVehiclesMapper.selectByBilletNos(billetNos);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public String stackLocationChangeHandle(StackLocationChangeVO stackLocationChangeVO) {
|
|
|
+ StackingAndLoadingVehicles stackingAndLoadingVehicles = baseMapper.selectById(stackLocationChangeVO.getStackId());
|
|
|
+ if (stackingAndLoadingVehicles == null) {
|
|
|
+ return "原垛位容器位置,未找到对应数据";
|
|
|
+ }
|
|
|
+ if (oConvertUtils.isEmpty(stackingAndLoadingVehicles.getBilletNos())) {
|
|
|
+ return "该位置钢坯信息不存在,操作失败!";
|
|
|
+ }
|
|
|
+
|
|
|
+ StackingAndLoadingVehicles newStackingAndLoadingVehicles = baseMapper.selectById(stackLocationChangeVO.getLocationChangeId());
|
|
|
+ if (newStackingAndLoadingVehicles == null) {
|
|
|
+ return "变更后的位置,未找到对应数据";
|
|
|
+ }
|
|
|
+ if (oConvertUtils.isNotEmpty(newStackingAndLoadingVehicles.getBilletNos())) {
|
|
|
+ return "垛位容器位置被占用,操作失败!";
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ // 原位置清空
|
|
|
+ List<StackingAndLoadingVehicles> stackingAndLoadingVehiclesList = new ArrayList<>();
|
|
|
+ stackingAndLoadingVehiclesList.add(stackingAndLoadingVehicles);
|
|
|
+ batchUpdateStackingAndLoadingVehicles(stackingAndLoadingVehiclesList);
|
|
|
+
|
|
|
+ // 填充新位置
|
|
|
+ newStackingAndLoadingVehicles.setCcmNo(stackingAndLoadingVehicles.getCcmNo());
|
|
|
+ newStackingAndLoadingVehicles.setHeatNo(stackingAndLoadingVehicles.getHeatNo());
|
|
|
+ newStackingAndLoadingVehicles.setBilletNos(stackingAndLoadingVehicles.getBilletNos());
|
|
|
+ newStackingAndLoadingVehicles.setShiftGroup(stackingAndLoadingVehicles.getShiftGroup());
|
|
|
+ newStackingAndLoadingVehicles.setShift(stackingAndLoadingVehicles.getShift());
|
|
|
+ newStackingAndLoadingVehicles.setSize(stackingAndLoadingVehicles.getSize());
|
|
|
+ newStackingAndLoadingVehicles.setSpec(stackingAndLoadingVehicles.getSpec());
|
|
|
+ newStackingAndLoadingVehicles.setSteel(stackingAndLoadingVehicles.getSteel());
|
|
|
+ newStackingAndLoadingVehicles.setCreateDate(new Date());
|
|
|
+ log.info("{}{}", ">>>>>B端垛位位置变换,新容器位置:", JSON.toJSON(newStackingAndLoadingVehicles));
|
|
|
+ baseMapper.updateById(newStackingAndLoadingVehicles);
|
|
|
+ return "垛位容器位置变更成功!";
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("垛位容器位置变更发生异常", e);
|
|
|
+ throw new RuntimeException("垛位容器位置变更失败,事务已回滚", e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 初始化堆垛公共容器
|
|
|
* @param stackingAndLoadingVehiclesList
|