瀏覽代碼

起跺装运单组坯号字段新增

qiangxuan 4 月之前
父節點
當前提交
d83504ec47

+ 0 - 14
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/stackingAndLoadingVehicles/controller/StackingAndLoadingVehiclesController.java

@@ -69,20 +69,6 @@ public class StackingAndLoadingVehiclesController extends JeecgController<Stacki
 		 return Result.OK(res);
 	 }
 
-	/**
-	 *   添加
-	 *
-	 * @param loadingParams
-	 * @return
-	 */
-	@AutoLog(value = "钢坯上垛-添加")
-	@ApiOperation(value="钢坯上垛-添加", notes="钢坯上垛-添加")
-	@PostMapping(value = "/add")
-	public Result<String> add(@RequestBody LoadingParams loadingParams) {
-		stackingAndLoadingVehiclesService.saveUpperStacking(loadingParams);
-		return Result.OK("钢坯上垛成功!");
-	}
-
 	 /**
 	  *   添加或保存
 	  *

+ 6 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/stackingAndLoadingVehicles/entity/StackingUpLog.java

@@ -110,4 +110,10 @@ public class StackingUpLog implements Serializable {
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "日期")
     private Date createDate;
+    /**
+     * 组坯号
+     */
+    @Excel(name = "组坯号", width = 15)
+    @ApiModelProperty(value = "组坯号", required = true)
+    private String assemblyNumber;
 }

+ 0 - 2
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/stackingAndLoadingVehicles/service/IStackingAndLoadingVehiclesService.java

@@ -15,8 +15,6 @@ import java.util.List;
  */
 public interface IStackingAndLoadingVehiclesService extends IService<StackingAndLoadingVehicles> {
 
-    void saveUpperStacking(LoadingParams loadingParams);
-
     List<StackingAndLoadingVehicles> getListByTypeConfigId(String typeConfigId);
 
     JSONObject loadingHandle(LoadingParams loadingParams);

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

@@ -20,7 +20,6 @@ import org.jeecg.modules.billet.billetHotsendChangeShift.entity.BilletHotsendCha
 import org.jeecg.modules.billet.billetHotsendChangeShift.service.IBilletHotsendChangeShiftService;
 import org.jeecg.modules.billet.billetHotsendConfig.entity.BilletHotsendTypeConfig;
 import org.jeecg.modules.billet.billetHotsendConfig.service.IBilletHotsendTypeConfigService;
-import org.jeecg.modules.billet.operateLog.service.IOperateLogService;
 import org.jeecg.modules.billet.rollClubThree.entity.RollClubThree;
 import org.jeecg.modules.billet.rollClubThree.entity.RollClubThreeDetails;
 import org.jeecg.modules.billet.rollClubThree.service.IRollClubThreeDetailsService;
@@ -86,8 +85,6 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
     @Autowired
     private IStorageCarLogService storageCarLogService;
     @Autowired
-    private IOperateLogService operateLogService;
-    @Autowired
     private StackingAndLoadingVehiclesMapper stackingAndLoadingVehiclesMapper;
     @Autowired
     private IRollOutShippDetailsService rollOutShippDetailsService;
@@ -112,30 +109,6 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
     @Autowired
     private IRollHeightDetailsService rollHeightDetailsService;
 
-    @Override
-    public void saveUpperStacking(LoadingParams loadingParams) {
-        // 根据billetHotsendTypeConfigId 查询基础垛位信息
-        BilletHotsendTypeConfig billetHotsendTypeConfig = billetHotsendTypeConfigService.getById(loadingParams.getBilletHotsendTypeConfigId());
-        // 保存 钢坯上垛后信息至 公共容器
-        List<StackingAndLoadingVehicles> stackingAndLoadingVehiclesList = loadingParams.getStackingAndLoadingVehiclesList();
-        stackingAndLoadingVehiclesList.forEach(x ->{
-            StackingAndLoadingVehicles stackingAndLoadingVehicles = new StackingAndLoadingVehicles();
-            BeanUtils.copyProperties(x, stackingAndLoadingVehicles);
-            stackingAndLoadingVehicles.setStackAddr(billetHotsendTypeConfig.getTypeName());
-            stackingAndLoadingVehicles.setTypeConfigId(billetHotsendTypeConfig.getId());
-            baseMapper.insert(stackingAndLoadingVehicles);
-        });
-        // 保存上垛信息日志
-        List<StackingUpLog> stackingUpLogList = new ArrayList<>();
-        stackingAndLoadingVehiclesList.forEach(y ->{
-            StackingUpLog stackingUpLog = new StackingUpLog();
-            BeanUtils.copyProperties(y, stackingUpLog);
-            stackingUpLog.setBilletNo(y.getBilletNos());
-            stackingUpLog.setCreateDate(new Date());
-        });
-        stackingUpLogService.saveBatch(stackingUpLogList);
-    }
-
     @Override
     public List<StackingAndLoadingVehicles> getListByTypeConfigId(String typeConfigId) {
         LambdaQueryWrapper<StackingAndLoadingVehicles> queryWrapper = new LambdaQueryWrapper<>();
@@ -166,6 +139,10 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
                 .eq(BilletBasicInfo::getCcmNo, Integer.valueOf(billetHotsend.getCcmNo()))
                 .in(BilletBasicInfo::getBilletNo, billetNosList);
         List<BilletBasicInfo> billetBasicInfoList = billetBasicInfoService.list(queryWrapperBB);
+        if (billetBasicInfoList.size() == 0) {
+            result.put("fail", "钢坯基础信息为空,垛位装车保存失败");
+            return result;
+        }
         List<RollClubCommon> rollClubCommonList= new ArrayList<>();
         billetBasicInfoList.forEach(x ->{
             RollClubCommon rollClubCommon = new RollClubCommon();
@@ -225,6 +202,16 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
         storageBill.setAmountTotal((oConvertUtils.isNotEmpty(storageBill.getAmountTotal()) ? storageBill.getAmountTotal() : 0) + stackingAndLoadingVehiclesList.size() * 4);
         storageBill.setDestination(loadingParams.getDestination());
         storageBill.setTypeConfigId(loadingParams.getDestinationId());
+        String existingAssemblyNumber = storageBill.getAssemblyNumber();
+        String distinctAssemblyNumber = billetBasicInfoList.stream()
+                .map(BilletBasicInfo::getAssemblyNumber)
+                .filter(assemblyNumber -> assemblyNumber!= null)
+                .distinct()
+                .collect(Collectors.joining(","));
+        String finalAssemblyNumber = Optional.ofNullable(existingAssemblyNumber)
+                .map(s -> s + "," + distinctAssemblyNumber)
+                .orElse(distinctAssemblyNumber);
+        storageBill.setAssemblyNumber(finalAssemblyNumber);
         storageBillService.updateById(storageBill);
         result.put("success", "堆垛保存操作成功");
         return result;
@@ -719,6 +706,10 @@ 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)){
+                log.info("{}{}", "堆垛起剁日志保存失败,钢坯基础信息不存在!", x.getBilletNos());
+                return;
+            }
             BilletBasicInfo billetBasicInfo = billetBasicInfoList.stream().findFirst().orElse(null);
             stackingUpLog.setAmount(4); // 支数
             stackingUpLog.setLayer(x.getLayer());// 堆垛层号(1-20)
@@ -726,6 +717,13 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
             stackingUpLog.setShift(billetBasicInfo.getShift());
             stackingUpLog.setShiftGroup(billetBasicInfo.getShiftGroup());
             stackingUpLog.setStackAddr(billetHotsendTypeConfig.getTypeName());
+            // 使用Stream对assemblyNumber去重,过滤null值并用逗号连接成一个String
+            String distinctAssemblyNumber = billetBasicInfoList.stream()
+                    .map(BilletBasicInfo::getAssemblyNumber) // 提取assemblyNumber字段
+                    .filter(assemblyNumber -> assemblyNumber != null) // 过滤掉null值
+                    .distinct() // 去重
+                    .collect(Collectors.joining(",")); // 用逗号连接成一个字符串
+            stackingUpLog.setAssemblyNumber(distinctAssemblyNumber);
             stackingUpLogList.add(stackingUpLog);
         });
         stackingUpLogService.saveBatch(stackingUpLogList);

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

@@ -154,4 +154,11 @@ public class StorageBill implements Serializable {
     @Excel(name = "车位号", width = 15)
     @ApiModelProperty(value = "车位号")
     private Integer positionNum;
+
+    /**
+     * 组坯号
+     */
+    @Excel(name = "组坯号", width = 15)
+    @ApiModelProperty(value = "组坯号", required = true)
+    private String assemblyNumber;
 }