Bläddra i källkod

Merge branch 'master' of http://123.57.213.14:3001/zgzt/dosb-sys-java

guoqiang 2 veckor sedan
förälder
incheckning
8b1a32c4c5

+ 43 - 56
zgzt-sys-java/jeecg-module-conn/src/main/java/org/jeecg/modules/billetActual/service/impl/BilletHotsendBaseServiceImpl.java

@@ -266,7 +266,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 		String address = jsonObject.getString("address");
 		String liftingTime = jsonObject.getString("liftingTime");
 		String location = jsonObject.getString("location");
-		String vehicleNumber = jsonObject.getString("vehicleNumber");
+
 		if (oConvertUtils.isEmpty(billetNos) || oConvertUtils.isEmpty(positionNum)){
 			log.info("{}{}", "参数为空,C端自动化热装<保存>失败!", jsonObject);
 			return;
@@ -281,7 +281,6 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 			queryWrapper2.eq(StorageBill::getCcmNo, ccmNo);
 		}
 		StorageBill isStorageBill = storageBillService.getOne(queryWrapper2);
-
 		// 取钢坯号的第九位字符
 		ccmNo = Optional.ofNullable(billetNos)
 				.filter(s -> !s.isEmpty())
@@ -291,16 +290,11 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 				.filter(num -> num.length() >= 9)
 				.map(num -> String.valueOf(num.charAt(8)))
 				.orElse("");
-
+		
+		log.info("C端自动化热装铸机号:{}", ccmNo);
 		String shiftGroup = shiftGroupHandle(ccmNo);
 		String shift = shiftHandle(ccmNo);
-		log.info("C端自动化热装缓存中的班组、班别:{}", ccmNo + "#:" + shiftGroup + ":" + shift);
-		if (oConvertUtils.isEmpty(shiftGroup) || oConvertUtils.isEmpty(shift)){
-			log.info("{}{}", "班组班别获取为空,C端自动化热装<保存>失败!", JSON.toJSON(isStorageBill));
-			return;
-		}
-		log.info("C端自动化热装装运单信息:{}", JSON.toJSONString(isStorageBill));
-		// 更新装运单确认铸机号
+		// 更具装运单确认铸机号
 		if (oConvertUtils.isNotEmpty(isStorageBill) && oConvertUtils.isEmpty(isStorageBill.getCcmNo())) {
 			// 更新铸机号,到装运单
 			isStorageBill.setCcmNo(ccmNo);
@@ -308,6 +302,11 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 			isStorageBill.setShift(shift);
 			storageBillService.updateById(isStorageBill);
 		}
+		log.info("C端自动化缓存中的班组、班别:{}", shiftGroup + ":" + shift);
+		if (oConvertUtils.isEmpty(shiftGroup) || oConvertUtils.isEmpty(shift)){
+			log.info("{}{}", "班组班别获取为空,C端自动化热装<保存>失败!", JSON.toJSON(isStorageBill));
+			return;
+		}
 
 		BilletHotsend billetHotsends = new BilletHotsend();
 		billetHotsends.setCcmNo(ccmNo);
@@ -316,11 +315,30 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 		billetHotsends.setIsUpd(false);
 		billetHotsendDetailsVo.setBilletHotsend(billetHotsends);
 
-		// 独立事务热装保存行车吊运单
 		BilletLiftingBill billetLiftingBill = new BilletLiftingBill();
+		// 独立保存行车吊运单
 		billetLiftingBill.setId(String.valueOf(IdWorker.getId()));
-		saveBilletLiftingBillsHotCharge(billetLiftingBill.getId(), ccmNo,  billetNos, shiftGroup, shift, vehicleNumber, location, address, destination, layer, positionNum, plateOrStack, liftingTime);
-
+		billetLiftingBill.setCcmNo(ccmNo);
+		billetLiftingBill.setBilletsNo(billetNos);
+		billetLiftingBill.setShiftGroup(shiftGroup);
+		billetLiftingBill.setShift(shift);
+		billetLiftingBill.setVehicleNumber(jsonObject.getString("vehicleNumber"));
+		billetLiftingBill.setLocation(location);
+		billetLiftingBill.setAddress(address);
+		billetLiftingBill.setLiftingType("1");
+		billetLiftingBill.setBelongType("1");
+		billetLiftingBill.setDestination(destination);
+		billetLiftingBill.setLayer(layer);
+		billetLiftingBill.setPositionNum(Integer.valueOf(positionNum));
+		billetLiftingBill.setPlateOrStack(plateOrStack);
+		if (oConvertUtils.isNotEmpty(liftingTime)){
+			billetLiftingBill.setLiftingTime(DateUtils.str2Date(liftingTime, DateUtils.datetimeFormat.get()));
+		}
+		billetLiftingBill.setRemark("热装吊运单");
+		billetLiftingBill.setBilletWeight(0.00);
+		log.info("C端自动化热装——吊运单信息: {}", JSON.toJSON(billetLiftingBill));
+		saveBilletLiftingBillsHotCharge(billetLiftingBill);
+		log.info("C端自动化热装保存吊运单成功: {}", billetLiftingBill.getBilletsNo());
 		// 根据坯号查询 对应的钢坯基础信息
 		String[] billetNosparts = billetNos.split(",");
 		//4 获取所有的坯号集合
@@ -329,6 +347,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 				.isNull(BilletBasicInfo::getBelongTable)
 				.isNull(BilletBasicInfo::getBhtcId);
 		List<BilletBasicInfo> billetBasicInfoLists = billetBasicInfoService.list(queryWrapper1);
+		log.info("111自动化热装钢坯实绩: {}", billetNosparts);
 		if (oConvertUtils.listIsEmpty(billetBasicInfoLists)){
 			// 循环三次处理
 			for (int i = 0; i < 6; i++) {
@@ -344,6 +363,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 				}
 			}
 		}
+		log.info("222自动化热装钢坯实绩: {}", billetNosparts);
 		if (oConvertUtils.listIsEmpty(billetBasicInfoLists)){
 			log.info("{}{}", "钢坯基础信息不存在,C端自动化热装<保存>失败!", jsonObject);
 			BilletAutoException billetAutoException = createBilletAutoException(ccmNo, billetNos, shiftGroupHandle(ccmNo), shiftHandle(ccmNo), null);
@@ -367,9 +387,10 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 				return;
 			}
 		}
+		log.info("333自动化热装吊运单更新: {}", billetNosparts);
 		// 查询更新后的装运单信息
-		StorageBill storageBill = new StorageBill();
-		if (oConvertUtils.isEmpty(isStorageBill)) {
+		StorageBill storageBill = storageBillService.getById(isStorageBill.getId());
+		if (oConvertUtils.isEmpty(storageBill)) {
 			//  验证空的装运单 循环三次处理
 			for (int i = 0; i < 6; i++) {
 				// 延迟10秒
@@ -378,13 +399,13 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 				} catch (InterruptedException e) {
 					e.printStackTrace();
 				}
-				storageBill = storageBillService.getOne(queryWrapper2);
+				storageBill = storageBillService.getById(isStorageBill.getId());
 				if (!oConvertUtils.isEmpty(storageBill)){
 					break;
 				}
 			}
 		}
-		log.info("C端自动化热装,60秒延迟查询最终装运单对象: {}", JSON.toJSON(storageBill));
+		log.info("444自动化热装装运单查询: {}", JSON.toJSON(storageBill));
 		// 钢坯装运单
 		if (oConvertUtils.isEmpty(storageBill)) {
 			log.info("未查询钢坯装运单信息,车位号为:{},C端自动化热装<保存>失败!", positionNum);
@@ -395,7 +416,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 			billetAutoException.setShiftGroup(shiftGroup);
 			billetAutoException.setShift(shift);
 			billetAutoException.setCreateTime(new Date());
-			billetAutoException.setRemark("车位号:" + positionNum + ", 车牌号为:" + licensePlate);
+			billetAutoException.setRemark(licensePlate);
 			billetAutoException.setMassage("未查询钢坯装运单信息,C端自动化热装<保存>失败!");
 			billetAutoExceptionService.save(billetAutoException);
 			return;
@@ -420,6 +441,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 			billetHotsendDetailsVo.setBelongTypeName(billetHotsendTypeConfig.getTypeName());
 			billetHotsendDetailsVo.setBilletHotsendTypeConfigId(billetHotsendTypeConfig.getId());
 		}
+		log.info("555自动化热装数据组装: {}", billetHotsendDetailsVo.getBilletHotsendTypeConfigId());
 		List<RollClubCommon> rollClubCommonLists= new ArrayList<>();
 		AtomicInteger startNum = new AtomicInteger(0);
 		String finalCcmNo = ccmNo;
@@ -440,7 +462,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 
 		saveBilletCommomTrucking(billetHotsendDetailsVo);
 
-		log.info("{}{}", "C端自动化热装<保存>操作成功:", billetNos);
+		log.info("{}{}", "C端自动化热装<保存>操作成功:", jsonObject);
 
 	}
 
@@ -627,46 +649,11 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 
 	/**
 	 * 轧钢外运热装,吊运单保存
-	 * @param ccmNo
-	 * @param billetNos
-	 * @param shiftGroup
-	 * @param shift
-	 * @param vehicleNumber
-	 * @param location
-	 * @param address
-	 * @param destination
-	 * @param layer
-	 * @param positionNum
-	 * @param plateOrStack
-	 * @param liftingTime
+	 * @param billetLiftingBill
 	 */
 	@Transactional(propagation = org.springframework.transaction.annotation.Propagation.REQUIRES_NEW)
-	public void saveBilletLiftingBillsHotCharge(String id, String ccmNo, String billetNos, String shiftGroup, String shift, String vehicleNumber,
-												String location, String address, String destination, String layer, String positionNum,
-												String plateOrStack, String liftingTime) {
+	public void saveBilletLiftingBillsHotCharge(BilletLiftingBill billetLiftingBill) {
 		try {
-			BilletLiftingBill billetLiftingBill = new BilletLiftingBill();
-			// 独立保存行车吊运单
-			billetLiftingBill.setId(id);
-			billetLiftingBill.setCcmNo(ccmNo);
-			billetLiftingBill.setBilletsNo(billetNos);
-			billetLiftingBill.setShiftGroup(shiftGroup);
-			billetLiftingBill.setShift(shift);
-			billetLiftingBill.setVehicleNumber(vehicleNumber);
-			billetLiftingBill.setLocation(location);
-			billetLiftingBill.setAddress(address);
-			billetLiftingBill.setLiftingType("1");
-			billetLiftingBill.setBelongType("1");
-			billetLiftingBill.setDestination(destination);
-			billetLiftingBill.setLayer(layer);
-			billetLiftingBill.setPositionNum(Integer.valueOf(positionNum));
-			billetLiftingBill.setPlateOrStack(plateOrStack);
-			if (oConvertUtils.isNotEmpty(liftingTime)){
-				billetLiftingBill.setLiftingTime(DateUtils.str2Date(liftingTime, DateUtils.datetimeFormat.get()));
-			}
-			billetLiftingBill.setRemark("热装吊运单");
-			billetLiftingBill.setBilletWeight(0.00);
-			log.info("C端自动化热装保存吊运单成功: {}", billetLiftingBill);
 			billetLiftingBillService.save(billetLiftingBill);
 		} catch (Exception e) {
 			log.error("轧钢外运热装保存单个吊运单失败: {}", e.getMessage(), e);