Sfoglia il codice sorgente

钢坯装运单手动发车逻辑调整

qiangxuan 4 mesi fa
parent
commit
9f32d142bc

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

@@ -1,5 +1,6 @@
 package org.jeecg.modules.billet.storageBill.controller;
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -233,9 +234,17 @@ public class StorageBillController extends JeecgController<StorageBill, IStorage
 	@PostMapping(value = "/startCar")
 	public Result<String> startCar(@RequestBody StorageBill storageBill) {
 		StorageBill isStorageBill = storageBillService.getById(storageBill.getId());
-		if (oConvertUtils.isNotEmpty(isStorageBill.getOutTime()) && storageBill.getLicensePlate().equals(isStorageBill.getLicensePlate())) {
+		if (oConvertUtils.isNotEmpty(isStorageBill.getOutTime())) {
 			return Result.OK("该车已发车,请勿重复发车!");
 		}
+		if (!storageBill.getLicensePlate().equals(isStorageBill.getLicensePlate())) {
+			return Result.OK("车牌不一致,发车失败!");
+		}
+		// 判断装运单,是否有装运信息,装运总支数为0时,手动发车失败
+		if (storageBill.getAmountTotal() == 0 || isStorageBill.getAmountTotal() == null) {
+			log.info("{}{}","装运信息为空,手动发车失败!", JSON.toJSON(isStorageBill));
+			return Result.OK("装运信息为空,发车失败!");
+		}
 		storageBill.setOutTime(new Date());
 		storageBill.setUpdateTime(new Date());
 		storageBillService.updateById(storageBill);

+ 9 - 9
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/service/impl/StorageBillServiceImpl.java

@@ -259,15 +259,15 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
                 result.put("fail", "存在未发车车辆,新增钢坯装运单失败!");
                 return result;
             }
-            // 判断车位是否存在未发车车辆
-            List<StorageBill> storageBillList =  baseMapper.selectList(new LambdaQueryWrapper<StorageBill>()
-                    .eq(StorageBill::getPositionNum, storageBill.getPositionNum())
-                    .isNull(StorageBill::getOutTime));
-            if (oConvertUtils.listIsNotEmpty(storageBillList)){
-                log.info("该车位存在未发车车辆,车牌号为:{},新增钢坯装运单失败!", storageBill.getLicensePlate());
-                result.put("fail", "该车位存在未发车车辆,新增钢坯装运单失败!");
-                return result;
-            }
+            // 判断车位是否存在未发车车辆(2025/3.3,暂时注释,等自动化发车车位发车完善后,在添加此段逻辑)
+//            List<StorageBill> storageBillList =  baseMapper.selectList(new LambdaQueryWrapper<StorageBill>()
+//                    .eq(StorageBill::getPositionNum, storageBill.getPositionNum())
+//                    .isNull(StorageBill::getOutTime));
+//            if (oConvertUtils.listIsNotEmpty(storageBillList)){
+//                log.info("该车位存在未发车车辆,车牌号为:{},新增钢坯装运单失败!", storageBill.getLicensePlate());
+//                result.put("fail", "该车位存在未发车车辆,新增钢坯装运单失败!");
+//                return result;
+//            }
             storageBill.setArrivalTime(new Date());// 到达时间
             LambdaQueryWrapper<StorageBill> queryWrapper1 = new LambdaQueryWrapper<>();
             queryWrapper1.eq(StorageBill::getCcmNo, storageBill.getCcmNo())