qiangxuan 6 сар өмнө
parent
commit
89945dbc3b

+ 1 - 3
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/stackingAndLoadingVehicles/entity/StackingAndLoadingVehicles.java

@@ -1,8 +1,6 @@
 package org.jeecg.modules.billet.stackingAndLoadingVehicles.entity;
 
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.*;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;

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

@@ -70,6 +70,8 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
     private IStorageCarLogService storageCarLogService;
     @Autowired
     private IOperateLogService operateLogService;
+    @Autowired
+    private StackingAndLoadingVehiclesMapper stackingAndLoadingVehiclesMapper;
 
     @Override
     public List<List<StackingAndLoadingVehicles>> getListBySatck(String typeConfigId) {
@@ -464,7 +466,8 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
             log.info("{}{}", "钢坯热送基础信息不存在,垛位装车失败!", JSON.toJSONString(loadingParams));
             return;
         }else {
-            billetHotsend.setStackNum(idExistBh.getStackNum() - stackingAndLoadingVehiclesList.size()); // 堆垛总数
+            int result = Integer.compare(idExistBh.getStackNum(), stackingAndLoadingVehiclesList.size());
+            billetHotsend.setStackNum(result > 0 ? idExistBh.getStackNum() - stackingAndLoadingVehiclesList.size() : 0);
             LambdaUpdateWrapper<BilletHotsend> updateWrapper = new LambdaUpdateWrapper<>();
             updateWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
                     .eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
@@ -474,22 +477,19 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
         }
         // 根据铸机号、位置、层数、类型配置ID更新 初始化容器中的垛位信息
         stackingAndLoadingVehiclesList.forEach(x ->{
-            LambdaUpdateWrapper<StackingAndLoadingVehicles> queryWrapperSA = new LambdaUpdateWrapper<>();
-            queryWrapperSA.eq(StackingAndLoadingVehicles::getCcmNo, x.getCcmNo())
-                    .eq(StackingAndLoadingVehicles::getLayer, x.getLayer())
-                    .eq(StackingAndLoadingVehicles::getAddress, x.getAddress())
-                    .eq(StackingAndLoadingVehicles::getTypeConfigId, loadingParams.getBilletHotsendTypeConfigId());;
+            LambdaUpdateWrapper<StackingAndLoadingVehicles> updateWrapper = new LambdaUpdateWrapper();
+            updateWrapper.eq(StackingAndLoadingVehicles::getId, x.getId())
+                    .set(StackingAndLoadingVehicles::getBilletNos, null)
+                    .set(StackingAndLoadingVehicles::getSpec, null)
+                    .set(StackingAndLoadingVehicles::getSteel, null)
+                    .set(StackingAndLoadingVehicles::getSize, null)
+                    .set(StackingAndLoadingVehicles::getShift, null)
+                    .set(StackingAndLoadingVehicles::getHeatNo, null)
+                    .set(StackingAndLoadingVehicles::getCreateDate, null)
+                    .set(StackingAndLoadingVehicles::getShiftGroup, null);
             StackingAndLoadingVehicles stackingAndLoadingVehicles = new StackingAndLoadingVehicles();
             BeanUtils.copyProperties(x, stackingAndLoadingVehicles);
-            stackingAndLoadingVehicles.setBilletNos(null);
-            stackingAndLoadingVehicles.setSpec(null);
-            stackingAndLoadingVehicles.setSteel(null);
-            stackingAndLoadingVehicles.setSize(null);
-            stackingAndLoadingVehicles.setShift(null);
-            stackingAndLoadingVehicles.setHeatNo(null);
-            stackingAndLoadingVehicles.setShiftGroup(null);
-            stackingAndLoadingVehicles.setCreateDate(null);
-            baseMapper.update(stackingAndLoadingVehicles, queryWrapperSA);
+            stackingAndLoadingVehiclesMapper.update(stackingAndLoadingVehicles, updateWrapper);
         });
 
         // 3 保存 下垛日志    stacking_up_log
@@ -549,7 +549,8 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
             log.info("{}{}", "钢坯热送基础信息不存在,垛位发车失败!", JSON.toJSONString(loadingParams));
             return;
         } else {
-            billetHotsend.setStackNum(idExistBh.getStackNum() - stackingAndLoadingVehiclesList.size()); // 堆垛总数
+            int result = Integer.compare(idExistBh.getStackNum(), stackingAndLoadingVehiclesList.size());
+            billetHotsend.setStackNum(result > 0 ? idExistBh.getStackNum() - stackingAndLoadingVehiclesList.size() : 0);// 垛位总数
             LambdaUpdateWrapper<BilletHotsend> updateWrapper = new LambdaUpdateWrapper<>();
             updateWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
                     .eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
@@ -560,22 +561,19 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
 
         // 3 发车后,动态更新容器中的垛位信息 初始化
         stackingAndLoadingVehiclesList.forEach(x ->{
-            LambdaUpdateWrapper<StackingAndLoadingVehicles> queryWrapperSA = new LambdaUpdateWrapper<>();
-            queryWrapperSA.eq(StackingAndLoadingVehicles::getCcmNo, x.getCcmNo())
-                    .eq(StackingAndLoadingVehicles::getLayer, x.getLayer())
-                    .eq(StackingAndLoadingVehicles::getAddress, x.getAddress())
-                    .eq(StackingAndLoadingVehicles::getTypeConfigId, loadingParams.getBilletHotsendTypeConfigId());;
-            StackingAndLoadingVehicles stackingAndLoadingVehicles = createInitializedVehicle();
+            LambdaUpdateWrapper<StackingAndLoadingVehicles> updateWrapper = new LambdaUpdateWrapper();
+            updateWrapper.eq(StackingAndLoadingVehicles::getId, x.getId())
+                    .set(StackingAndLoadingVehicles::getBilletNos, null)
+                    .set(StackingAndLoadingVehicles::getSpec, null)
+                    .set(StackingAndLoadingVehicles::getSteel, null)
+                    .set(StackingAndLoadingVehicles::getSize, null)
+                    .set(StackingAndLoadingVehicles::getShift, null)
+                    .set(StackingAndLoadingVehicles::getHeatNo, null)
+                    .set(StackingAndLoadingVehicles::getCreateDate, null)
+                    .set(StackingAndLoadingVehicles::getShiftGroup, null);
+            StackingAndLoadingVehicles stackingAndLoadingVehicles = new StackingAndLoadingVehicles();
             BeanUtils.copyProperties(x, stackingAndLoadingVehicles);
-            stackingAndLoadingVehicles.setBilletNos(null);
-            stackingAndLoadingVehicles.setSpec(null);
-            stackingAndLoadingVehicles.setSteel(null);
-            stackingAndLoadingVehicles.setSize(null);
-            stackingAndLoadingVehicles.setShift(null);
-            stackingAndLoadingVehicles.setHeatNo(null);
-            stackingAndLoadingVehicles.setShiftGroup(null);
-            stackingAndLoadingVehicles.setCreateDate(null);
-            baseMapper.update(stackingAndLoadingVehicles, queryWrapperSA);
+            stackingAndLoadingVehiclesMapper.update(stackingAndLoadingVehicles, updateWrapper);
         });
 
         // 4 保存 下垛日志    stacking_down_log
@@ -585,6 +583,8 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
             BeanUtils.copyProperties(x, stackingDownLog);
             stackingDownLog.setBilletNo(x.getBilletNos());
             stackingDownLog.setStorageBillId(loadingParams.getStorageBill().getId());// 装运单ID
+            stackingDownLog.setStackStorey(x.getLayer());
+            stackingDownLog.setStackNum(x.getAddress());
             stackingDownLogList.add(stackingDownLog);
         });
         stackingDownLogService.saveBatch(stackingDownLogList);

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

@@ -19,6 +19,7 @@ import org.jeecg.modules.billet.storageBill.entity.StorageBill;
 import org.jeecg.modules.billet.storageBill.service.IStorageBillService;
 import org.jeecg.modules.billet.storageBill.service.ITripsManageService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
 
@@ -48,6 +49,9 @@ public class StorageBillController extends JeecgController<StorageBill, IStorage
 	@Autowired
 	private ITripsManageService tripsManageService;
 
+	@Autowired
+	public RedisTemplate redisTemplate;
+
 	/**
 	 * 分页列表查询
 	 *
@@ -85,6 +89,12 @@ public class StorageBillController extends JeecgController<StorageBill, IStorage
 		 storageBill.setArrivalTime(new Date());// 到达时间
 		 storageBill.setCarNum(0);
 		 storageBill.setAmountTotal(oConvertUtils.isEmpty(storageBill.getAmountTotal()) ? 0 : storageBill.getAmountTotal());
+		 String keyShiftGroup = String.format("class:shift:group:%s", storageBill.getCcmNo());
+		 String keyShift = String.format("class:shift:%s", storageBill.getCcmNo());
+		 String text1 = oConvertUtils.getString(redisTemplate.opsForValue().get(keyShiftGroup));
+		 String text2 = oConvertUtils.getString(redisTemplate.opsForValue().get(keyShift));
+		 storageBill.setShiftGroup(text1);
+		 storageBill.setShift(text2);
 		 storageBillService.save(storageBill);
 		 operateLogService.add(storageBill,null,StorageBill.class);
 		 return Result.OK("添加成功!");
@@ -222,7 +232,7 @@ public class StorageBillController extends JeecgController<StorageBill, IStorage
 	 /**
 	  * 通过铸机号查询未发车的车辆信息
 	  *
-	  * @param castMachine
+	  * @param ccmNo
 	  * @return
 	  */
 	 @ApiOperation(value="查询未发车的车辆信息-通过铸机号查询", notes="查询未发车的车辆信息-通过铸机号查询")