qiangxuan 6 månader sedan
förälder
incheckning
fc8b89de7d

+ 39 - 38
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/actualControl/billetActual/billetActual/controller/BilletBasicInfoController.java

@@ -10,6 +10,7 @@ import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.base.controller.JeecgController;
 import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.actualControl.billetActual.billetActual.entity.BilletBasicInfo;
 import org.jeecg.modules.actualControl.billetActual.billetActual.service.IBilletBasicInfoService;
 import org.jeecg.modules.billet.billetHotsendConfig.entity.BilletHotsendTypeConfig;
@@ -39,7 +40,7 @@ public class BilletBasicInfoController extends JeecgController<BilletBasicInfo,
 
 	@Autowired
 	private IBilletHotsendTypeConfigService billetHotsendTypeConfigService;
-	
+
 	/**
 	 * 分页列表查询
 	 *
@@ -66,7 +67,7 @@ public class BilletBasicInfoController extends JeecgController<BilletBasicInfo,
 		List<BilletBasicInfo> list = pageList.getRecords();
 		// 处理钢坯目的地信息
 		list.forEach(item ->{
-			if(item.getBhtcId() != null && !item.getBhtcId().isEmpty()){ // 归属了目的地
+			if(oConvertUtils.isNotEmpty(item.getBhtcId())){ // 归属了目的地
 				BilletHotsendTypeConfig billetHotsendTypeConfig = billetHotsendTypeConfigService.getById(item.getBhtcId());
 				item.setBhtcId(billetHotsendTypeConfig.getTypeName());
 			}
@@ -74,7 +75,7 @@ public class BilletBasicInfoController extends JeecgController<BilletBasicInfo,
 		pageList.setRecords(list);
 		return Result.OK(pageList);
 	}
-	
+
 	/**
 	 *   添加
 	 *
@@ -88,7 +89,7 @@ public class BilletBasicInfoController extends JeecgController<BilletBasicInfo,
 		billetBasicInfoService.save(billetBasicInfo);
 		return Result.OK("添加成功!");
 	}
-	
+
 	/**
 	 *  编辑
 	 *
@@ -102,7 +103,7 @@ public class BilletBasicInfoController extends JeecgController<BilletBasicInfo,
 		billetBasicInfoService.updateById(billetBasicInfo);
 		return Result.OK("编辑成功!");
 	}
-	
+
 	/**
 	 *   通过id删除
 	 *
@@ -116,7 +117,7 @@ public class BilletBasicInfoController extends JeecgController<BilletBasicInfo,
 		billetBasicInfoService.removeById(id);
 		return Result.OK("删除成功!");
 	}
-	
+
 	/**
 	 *  批量删除
 	 *
@@ -130,7 +131,7 @@ public class BilletBasicInfoController extends JeecgController<BilletBasicInfo,
 		this.billetBasicInfoService.removeByIds(Arrays.asList(ids.split(",")));
 		return Result.OK("批量删除成功!");
 	}
-	
+
 	/**
 	 * 通过id查询
 	 *
@@ -148,39 +149,39 @@ public class BilletBasicInfoController extends JeecgController<BilletBasicInfo,
 		return Result.OK(billetBasicInfo);
 	}
 
-    /**
-    * 导出excel
-    *
-    * @param request
-    * @param billetBasicInfo
-    */
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, BilletBasicInfo billetBasicInfo) {
-        return super.exportXls(request, billetBasicInfo, BilletBasicInfo.class, "钢坯基础信息");
-    }
+	/**
+	 * 导出excel
+	 *
+	 * @param request
+	 * @param billetBasicInfo
+	 */
+	@RequestMapping(value = "/exportXls")
+	public ModelAndView exportXls(HttpServletRequest request, BilletBasicInfo billetBasicInfo) {
+		return super.exportXls(request, billetBasicInfo, BilletBasicInfo.class, "钢坯基础信息");
+	}
 
-    /**
-      * 通过excel导入数据
-    *
-    * @param request
-    * @param response
-    * @return
-    */
-    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
-    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
-        return super.importExcel(request, response, BilletBasicInfo.class);
-    }
+	/**
+	 * 通过excel导入数据
+	 *
+	 * @param request
+	 * @param response
+	 * @return
+	 */
+	@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+	public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+		return super.importExcel(request, response, BilletBasicInfo.class);
+	}
 
-	 @AutoLog(value = "钢坯定尺信息-通过铸机和炉号")
-	 @ApiOperation(value="钢坯定尺信息-通过铸机和炉号", notes="钢坯定尺信息-通过铸机和炉号")
-	 @GetMapping(value = "/queryBilletLength")
-	 public Result<?> queryBilletLengthList(@RequestParam(name="ccmNo") Integer ccmNo, @RequestParam(name="heatNo") String heatNo) {
-		 List<Integer> billetLengthList = billetBasicInfoService.queryBilletLengthList(ccmNo, heatNo);
-		 if (billetLengthList.size() == 0){
-			 return Result.error("当前浇铸炉号不存在!");
-		 }
-		 return Result.OK(billetLengthList);
-	 }
+	@AutoLog(value = "钢坯定尺信息-通过铸机和炉号")
+	@ApiOperation(value="钢坯定尺信息-通过铸机和炉号", notes="钢坯定尺信息-通过铸机和炉号")
+	@GetMapping(value = "/queryBilletLength")
+	public Result<?> queryBilletLengthList(@RequestParam(name="ccmNo") Integer ccmNo, @RequestParam(name="heatNo") String heatNo) {
+		List<Integer> billetLengthList = billetBasicInfoService.queryBilletLengthList(ccmNo, heatNo);
+		if (billetLengthList.size() == 0){
+			return Result.error("当前浇铸炉号不存在!");
+		}
+		return Result.OK(billetLengthList);
+	}
 
 	@AutoLog(value = "钢坯类型名称信息-通过铸机号")
 	@ApiOperation(value="钢坯类型名称信息-通过铸机号", notes="钢坯类型名称信息-通过铸机号")

+ 12 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/actualControl/heatsActuals/entity/HeatsActuals.java

@@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
+import org.jeecg.common.aspect.annotation.Dict;
 import org.jeecgframework.poi.excel.annotation.Excel;
 import org.springframework.format.annotation.DateTimeFormat;
 
@@ -117,4 +118,15 @@ public class HeatsActuals implements Serializable {
     @ApiModelProperty(value = "编辑条件",required = true)
     private String optype;
 
+    /**班组*/
+    @Excel(name = "班组", width = 15)
+    @ApiModelProperty(value = "班组")
+    @Dict(dicCode = "lg_bz")
+    private String shiftGroup;
+    /**班别*/
+    @Excel(name = "班别", width = 15)
+    @ApiModelProperty(value = "班别")
+    @Dict(dicCode = "lg_bb")
+    private String shift;
+
 }

+ 67 - 33
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsend/service/impl/BilletHotsendBaseServiceImpl.java

@@ -2,11 +2,14 @@ package org.jeecg.modules.billet.billetHotsend.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 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.util.oConvertUtils;
 import org.jeecg.modules.actualControl.billetActual.billetActual.entity.BilletBasicInfo;
 import org.jeecg.modules.actualControl.billetActual.billetActual.service.IBilletBasicInfoService;
+import org.jeecg.modules.actualControl.heatsActuals.entity.HeatsActuals;
+import org.jeecg.modules.actualControl.heatsActuals.service.IHeatsActualsService;
 import org.jeecg.modules.billet.billetHotsend.entity.BilletHotsend;
 import org.jeecg.modules.billet.billetHotsend.entity.BilletHotsendDetailsVo;
 import org.jeecg.modules.billet.billetHotsend.entity.RollClubCommon;
@@ -98,7 +101,8 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 	private IBilletBasicInfoService billetBasicInfoService;
 	@Autowired
 	private IBilletHotsendTypeConfigService billetHotsendTypeConfigService;
-
+	@Autowired
+	private IHeatsActualsService heatsActualsService;
 	@Override
 	public void updateDesc(BilletHotsend billetHotsend) {
 		RulerDefaultConfig last = rulerDefaultConfigService.getLast(billetHotsend.getCcmNo());
@@ -310,15 +314,26 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 		BilletHotsendTypeConfig billetHotsendTypeConfig = billetHotsendTypeConfigService.getById(billetHotsendDetailsVo.getBilletHotsendTypeConfigId());
 		List<RollClubCommon> rollClubCommonList = billetHotsendDetailsVo.getRollClubCommonList();
 		BilletHotsend billetHotsend = new BilletHotsend();
+
 		// 新保存 钢坯热送基础信息
 		BeanUtils.copyProperties(billetHotsendDetailsVo.getBilletHotsend(), billetHotsend);
 		billetHotsend.setCreateDate(new Date());
 //		billetHotsend.setAmountTotal(rollClubCommonList.size()); //总支数
+		LambdaQueryWrapper<HeatsActuals> queryWrapperHA = new LambdaQueryWrapper();
+		queryWrapperHA.eq(HeatsActuals::getCasterCode, billetHotsend.getCcmNo()).eq(HeatsActuals::getHeatsCode, billetHotsend.getHeatNo());
+		HeatsActuals heatsActuals = heatsActualsService.getOne(queryWrapperHA);
 		LambdaQueryWrapper<BilletHotsend> queryWrapper = new LambdaQueryWrapper<>();
-		queryWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
-				.eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
-				.eq(BilletHotsend::getShift, billetHotsend.getShift())
-				.eq(BilletHotsend::getShiftGroup, billetHotsend.getShiftGroup());
+		if (oConvertUtils.isEmpty(heatsActuals)){
+			queryWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
+					.eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
+					.eq(BilletHotsend::getShift, billetHotsend.getShift())
+					.eq(BilletHotsend::getShiftGroup, billetHotsend.getShiftGroup());
+		}else {
+			queryWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
+					.eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
+					.eq(BilletHotsend::getShift, heatsActuals.getShift())
+					.eq(BilletHotsend::getShiftGroup, heatsActuals.getShiftGroup());
+		}
 		BilletHotsend check = baseMapper.selectOne(queryWrapper);
 		if (oConvertUtils.isNotEmpty(check) && oConvertUtils.listIsEmpty(rollClubCommonList)){
 			return;
@@ -337,15 +352,15 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 			return;
 		}else {
 			if ("roll_club_one".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
-				billetHotsend.setRollcluboneNum(check.getRollcluboneNum() + rollClubCommonList.size());
+				billetHotsend.setRollcluboneNum(oConvertUtils.isEmpty(check.getRollcluboneNum()) ? rollClubCommonList.size() : check.getRollcluboneNum() + rollClubCommonList.size());
 			}else if ("roll_club_two".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
-				billetHotsend.setRollclubtwoNum(check.getRollclubtwoNum() + rollClubCommonList.size());
+				billetHotsend.setRollclubtwoNum(oConvertUtils.isEmpty(check.getRollclubtwoNum()) ? rollClubCommonList.size() : check.getRollclubtwoNum() + rollClubCommonList.size());
 			}else if ("roll_club_three".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
-				billetHotsend.setRollclubthreeNum(check.getRollclubthreeNum() + rollClubCommonList.size());
+				billetHotsend.setRollclubthreeNum(oConvertUtils.isEmpty(check.getRollclubthreeNum()) ? rollClubCommonList.size() : check.getRollclubthreeNum() + rollClubCommonList.size());
 			}else if ("roll_height".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
-				billetHotsend.setRollheightNum(check.getRollheightNum() + rollClubCommonList.size());
+				billetHotsend.setRollheightNum(oConvertUtils.isEmpty(check.getRollheightNum()) ? rollClubCommonList.size() : check.getRollheightNum() + rollClubCommonList.size());
 			}else if ("roll_out_shipp".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
-				billetHotsend.setRolloutshippNum(check.getRolloutshippNum() + rollClubCommonList.size());
+				billetHotsend.setRolloutshippNum(oConvertUtils.isEmpty(check.getRolloutshippNum()) ? rollClubCommonList.size() : check.getRolloutshippNum() + rollClubCommonList.size());
 			}
 			LambdaUpdateWrapper<BilletHotsend> updateWrapper = new LambdaUpdateWrapper<>();
 			updateWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
@@ -385,8 +400,10 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 			rollClubCommonList.forEach(x ->{
 				RollClubOneDetails rollClubOneDetails = new RollClubOneDetails();
 				BeanUtils.copyProperties(x, rollClubOneDetails);
+				rollClubOneDetails.setId(String.valueOf(IdWorker.getId()));
 				rollClubOneDetails.setShift(billetHotsend.getShift());
 				rollClubOneDetails.setShiftGroup(billetHotsend.getShiftGroup());
+				rollClubOneDetails.setCreateTime(new Date());
 				billetNos.add(x.getBilletNo());
 				rollClubOneDetailsList.add(rollClubOneDetails);
 			});
@@ -419,10 +436,12 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 			rollClubCommonList.forEach(x ->{
 				RollClubTwoDetails rollClubTwoDetails = new RollClubTwoDetails();
 				BeanUtils.copyProperties(x, rollClubTwoDetails);
+				rollClubTwoDetails.setId(String.valueOf(IdWorker.getId()));
 				rollClubTwoDetails.setShift(billetHotsend.getShift());
 				rollClubTwoDetails.setShiftGroup(billetHotsend.getShiftGroup());
 				rollClubTwoDetails.setStorageBillId(storageBill.getId());
 				rollClubTwoDetails.setLicensePlate(storageBill.getLicensePlate());
+				rollClubTwoDetails.setCreateTime(new Date());
 				billetNos.add(x.getBilletNo());
 				rollClubTwoDetailsList.add(rollClubTwoDetails);
 			});
@@ -457,10 +476,12 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 			rollClubCommonList.forEach(x ->{
 				RollClubThreeDetails rollClubThreeDetails = new RollClubThreeDetails();
 				BeanUtils.copyProperties(x, rollClubThreeDetails);
+				rollClubThreeDetails.setId(String.valueOf(IdWorker.getId()));
 				rollClubThreeDetails.setShift(billetHotsend.getShift());
 				rollClubThreeDetails.setShiftGroup(billetHotsend.getShiftGroup());
 				rollClubThreeDetails.setStorageBillId(storageBill.getId());
 				rollClubThreeDetails.setLicensePlate(storageBill.getLicensePlate());
+				rollClubThreeDetails.setCreateTime(new Date());
 				billetNos.add(x.getBilletNo());
 				rollClubThreeDetailsList.add(rollClubThreeDetails);
 			});
@@ -495,9 +516,11 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 			rollClubCommonList.forEach(x ->{
 				RollHeightDetails rollHeightDetails = new RollHeightDetails();
 				BeanUtils.copyProperties(x, rollHeightDetails);
+				rollHeightDetails.setId(String.valueOf(IdWorker.getId()));
 				rollHeightDetails.setShift(billetHotsend.getShift());
 				rollHeightDetails.setShiftGroup(billetHotsend.getShiftGroup());
 				billetNos.add(x.getBilletNo());
+				rollHeightDetails.setCreateTime(new Date());
 				rollHeightDetailsList.add(rollHeightDetails);
 			});
 			rollHeightDetailsService.saveBatch(rollHeightDetailsList);
@@ -532,10 +555,12 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 			rollClubCommonList.forEach(x ->{
 				RollOutShippDetails rollOutShippDetails = new RollOutShippDetails();
 				BeanUtils.copyProperties(x, rollOutShippDetails);
+				rollOutShippDetails.setId(String.valueOf(IdWorker.getId()));
 				rollOutShippDetails.setShift(billetHotsend.getShift());
 				rollOutShippDetails.setShiftGroup(billetHotsend.getShiftGroup());
 				rollOutShippDetails.setStorageBillId(storageBill.getId());
 				rollOutShippDetails.setLicensePlate(storageBill.getLicensePlate());
+				rollOutShippDetails.setCreateTime(new Date());
 				billetNos.add(x.getBilletNo());
 				rollOutShippDetailsList.add(rollOutShippDetails);
 			});
@@ -618,24 +643,23 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 		BeanUtils.copyProperties(billetHotsendDetailsVo.getBilletHotsend(), billetHotsend);
 		billetHotsend.setCreateDate(new Date());
 		//	billetHotsend.setAmountTotal(rollClubCommonList.size()); //总支数
+		LambdaQueryWrapper<HeatsActuals> queryWrapperHA = new LambdaQueryWrapper();
+		queryWrapperHA.eq(HeatsActuals::getCasterCode, billetHotsend.getCcmNo()).eq(HeatsActuals::getHeatsCode, billetHotsend.getHeatNo());
+		HeatsActuals heatsActuals = heatsActualsService.getOne(queryWrapperHA);
 		LambdaQueryWrapper<BilletHotsend> queryWrapper = new LambdaQueryWrapper<>();
-		queryWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
-				.eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
-				.eq(BilletHotsend::getShift, billetHotsend.getShift())
-				.eq(BilletHotsend::getShiftGroup, billetHotsend.getShiftGroup());
+		if (oConvertUtils.isEmpty(heatsActuals)){
+			queryWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
+					.eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
+					.eq(BilletHotsend::getShift, billetHotsend.getShift())
+					.eq(BilletHotsend::getShiftGroup, billetHotsend.getShiftGroup());
+		}else {
+			queryWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
+					.eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
+					.eq(BilletHotsend::getShift, heatsActuals.getShift())
+					.eq(BilletHotsend::getShiftGroup, heatsActuals.getShiftGroup());
+		}
 		BilletHotsend check = baseMapper.selectOne(queryWrapper);
 		if (oConvertUtils.isEmpty(check) && oConvertUtils.listIsEmpty(rollClubCommonList)){
-			if ("roll_club_one".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
-				billetHotsend.setRollcluboneNum(rollClubCommonList.size());
-			}else if ("roll_club_two".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
-				billetHotsend.setRollclubtwoNum(rollClubCommonList.size());
-			}else if ("roll_club_three".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
-				billetHotsend.setRollclubthreeNum(rollClubCommonList.size());
-			}else if ("roll_height".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
-				billetHotsend.setRollheightNum(rollClubCommonList.size());
-			}else if ("roll_out_shipp".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
-				billetHotsend.setRolloutshippNum(rollClubCommonList.size());
-			}
 			billetHotsend.setRollclubtwoNum(0);
 			billetHotsend.setRollcluboneNum(0);
 			billetHotsend.setRolloutshippNum(0);
@@ -643,18 +667,18 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 			billetHotsend.setRollclubthreeNum(0);
 			baseMapper.insert(billetHotsend);
 			billetHotsend.setId(check.getId());
-			operateLogService.add(billetHotsend,null,BilletHotsend.class);
+			operateLogService.add(billetHotsend,null, BilletHotsend.class);
 		}else {
 			if ("roll_club_one".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
-				billetHotsend.setRollcluboneNum(check.getRollcluboneNum() + rollClubCommonList.size());
+				billetHotsend.setRollcluboneNum(oConvertUtils.isEmpty(check.getRollcluboneNum()) ? rollClubCommonList.size() : check.getRollcluboneNum() + rollClubCommonList.size());
 			}else if ("roll_club_two".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
-				billetHotsend.setRollclubtwoNum(check.getRollclubtwoNum() + rollClubCommonList.size());
+				billetHotsend.setRollclubtwoNum(oConvertUtils.isEmpty(check.getRollclubtwoNum()) ? rollClubCommonList.size() : check.getRollclubtwoNum() + rollClubCommonList.size());
 			}else if ("roll_club_three".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
-				billetHotsend.setRollclubthreeNum(check.getRollclubthreeNum() + rollClubCommonList.size());
+				billetHotsend.setRollclubthreeNum(oConvertUtils.isEmpty(check.getRollclubthreeNum()) ? rollClubCommonList.size() : check.getRollclubthreeNum() + rollClubCommonList.size());
 			}else if ("roll_height".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
-				billetHotsend.setRollheightNum(check.getRollheightNum() + rollClubCommonList.size());
+				billetHotsend.setRollheightNum(oConvertUtils.isEmpty(check.getRollheightNum()) ? rollClubCommonList.size() : check.getRollheightNum() + rollClubCommonList.size());
 			}else if ("roll_out_shipp".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
-				billetHotsend.setRolloutshippNum(check.getRolloutshippNum() + rollClubCommonList.size());
+				billetHotsend.setRolloutshippNum(oConvertUtils.isEmpty(check.getRolloutshippNum()) ? rollClubCommonList.size() : check.getRolloutshippNum() + rollClubCommonList.size());
 			}
 			LambdaUpdateWrapper<BilletHotsend> updateWrapper = new LambdaUpdateWrapper<>();
 			updateWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
@@ -689,13 +713,15 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 				rollClubOne.setId(rollClubOne1.getId());
 				rollClubOneService.updateById(rollClubOne);
 			}
-			// 保存棒明细信息
+			// 保存棒明细信息
 			List<RollClubOneDetails> rollClubOneDetailsList = new ArrayList<>();
 			rollClubCommonList.forEach(x ->{
 				RollClubOneDetails rollClubOneDetails = new RollClubOneDetails();
 				BeanUtils.copyProperties(x, rollClubOneDetails);
+				rollClubOneDetails.setId(String.valueOf(IdWorker.getId()));
 				rollClubOneDetails.setShift(billetHotsend.getShift());
 				rollClubOneDetails.setShiftGroup(billetHotsend.getShiftGroup());
+				rollClubOneDetails.setCreateTime(new Date());
 				billetNos.add(x.getBilletNo());
 				rollClubOneDetailsList.add(rollClubOneDetails);
 			});
@@ -703,7 +729,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 		}
 
 		if ("roll_club_two".equals(billetHotsendDetailsVo.getBelongTable())){
-			// 保存棒信息
+			// 保存棒信息
 			RollClubTwo rollClubTwo = new RollClubTwo();
 			BeanUtils.copyProperties(billetHotsend, rollClubTwo);
 			rollClubTwo.setSize(rollClubCommonList.stream().findFirst().orElse(null).getSize()); //定尺
@@ -728,10 +754,12 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 			rollClubCommonList.forEach(x ->{
 				RollClubTwoDetails rollClubTwoDetails = new RollClubTwoDetails();
 				BeanUtils.copyProperties(x, rollClubTwoDetails);
+				rollClubTwoDetails.setId(String.valueOf(IdWorker.getId()));
 				rollClubTwoDetails.setShift(billetHotsend.getShift());
 				rollClubTwoDetails.setShiftGroup(billetHotsend.getShiftGroup());
 				rollClubTwoDetails.setStorageBillId(storageBill.getId());
 				rollClubTwoDetails.setLicensePlate(storageBill.getLicensePlate());
+				rollClubTwoDetails.setCreateTime(new Date());
 				billetNos.add(x.getBilletNo());
 				rollClubTwoDetailsList.add(rollClubTwoDetails);
 			});
@@ -765,10 +793,12 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 			rollClubCommonList.forEach(x ->{
 				RollClubThreeDetails rollClubThreeDetails = new RollClubThreeDetails();
 				BeanUtils.copyProperties(x, rollClubThreeDetails);
+				rollClubThreeDetails.setId(String.valueOf(IdWorker.getId()));
 				rollClubThreeDetails.setShift(billetHotsend.getShift());
 				rollClubThreeDetails.setShiftGroup(billetHotsend.getShiftGroup());
 				rollClubThreeDetails.setStorageBillId(storageBill.getId());
 				rollClubThreeDetails.setLicensePlate(storageBill.getLicensePlate());
+				rollClubThreeDetails.setCreateTime(new Date());
 				billetNos.add(x.getBilletNo());
 				rollClubThreeDetailsList.add(rollClubThreeDetails);
 			});
@@ -802,8 +832,10 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 			rollClubCommonList.forEach(x ->{
 				RollHeightDetails rollHeightDetails = new RollHeightDetails();
 				BeanUtils.copyProperties(x, rollHeightDetails);
+				rollHeightDetails.setId(String.valueOf(IdWorker.getId()));
 				rollHeightDetails.setShift(billetHotsend.getShift());
 				rollHeightDetails.setShiftGroup(billetHotsend.getShiftGroup());
+				rollHeightDetails.setCreateTime(new Date());
 				billetNos.add(x.getBilletNo());
 				rollHeightDetailsList.add(rollHeightDetails);
 			});
@@ -838,10 +870,12 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 			rollClubCommonList.forEach(x ->{
 				RollOutShippDetails rollOutShippDetails = new RollOutShippDetails();
 				BeanUtils.copyProperties(x, rollOutShippDetails);
+				rollOutShippDetails.setId(String.valueOf(IdWorker.getId()));
 				rollOutShippDetails.setShift(billetHotsend.getShift());
 				rollOutShippDetails.setShiftGroup(billetHotsend.getShiftGroup());
 				rollOutShippDetails.setStorageBillId(storageBill.getId());
 				rollOutShippDetails.setLicensePlate(storageBill.getLicensePlate());
+				rollOutShippDetails.setCreateTime(new Date());
 				billetNos.add(x.getBilletNo());
 				rollOutShippDetailsList.add(rollOutShippDetails);
 			});

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

@@ -3,11 +3,14 @@ package org.jeecg.modules.billet.stackingAndLoadingVehicles.service.impl;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 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.util.oConvertUtils;
 import org.jeecg.modules.actualControl.billetActual.billetActual.entity.BilletBasicInfo;
 import org.jeecg.modules.actualControl.billetActual.billetActual.service.IBilletBasicInfoService;
+import org.jeecg.modules.actualControl.heatsActuals.entity.HeatsActuals;
+import org.jeecg.modules.actualControl.heatsActuals.service.IHeatsActualsService;
 import org.jeecg.modules.billet.billetHotsend.entity.BilletHotsend;
 import org.jeecg.modules.billet.billetHotsend.entity.RollClubCommon;
 import org.jeecg.modules.billet.billetHotsend.entity.RulerDefaultConfig;
@@ -72,6 +75,8 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
     private IOperateLogService operateLogService;
     @Autowired
     private StackingAndLoadingVehiclesMapper stackingAndLoadingVehiclesMapper;
+    @Autowired
+    private IHeatsActualsService heatsActualsService;
 
     @Override
     public List<List<StackingAndLoadingVehicles>> getListBySatck(String typeConfigId) {
@@ -456,11 +461,21 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
         BilletHotsend billetHotsend = new BilletHotsend();
         //1 新保存 钢坯热送基础信息
         BeanUtils.copyProperties(loadingParams.getBilletHotsend(), billetHotsend);
+        LambdaQueryWrapper<HeatsActuals> queryWrapperHA = new LambdaQueryWrapper();
+        queryWrapperHA.eq(HeatsActuals::getCasterCode, billetHotsend.getCcmNo()).eq(HeatsActuals::getHeatsCode, billetHotsend.getHeatNo());
+        HeatsActuals heatsActuals = heatsActualsService.getOne(queryWrapperHA);
         LambdaQueryWrapper<BilletHotsend> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
-                .eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
-                .eq(BilletHotsend::getShift, billetHotsend.getShift())
-                .eq(BilletHotsend::getShiftGroup, billetHotsend.getShiftGroup());
+        if (oConvertUtils.isEmpty(heatsActuals)){
+            queryWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
+                    .eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
+                    .eq(BilletHotsend::getShift, billetHotsend.getShift())
+                    .eq(BilletHotsend::getShiftGroup, billetHotsend.getShiftGroup());
+        }else {
+            queryWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
+                    .eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
+                    .eq(BilletHotsend::getShift, heatsActuals.getShift())
+                    .eq(BilletHotsend::getShiftGroup, heatsActuals.getShiftGroup());
+        }
         BilletHotsend idExistBh = billetHotsendBaseService.getOne(queryWrapper);
         if (oConvertUtils.isEmpty(idExistBh)){
             log.info("{}{}", "钢坯热送基础信息不存在,垛位装车失败!", JSON.toJSONString(loadingParams));
@@ -499,6 +514,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
         stackingAndLoadingVehiclesList.forEach(x ->{
             StackingDownLog stackingDownLog = new StackingDownLog();
             BeanUtils.copyProperties(x, stackingDownLog);
+            stackingDownLog.setId(String.valueOf(IdWorker.getId()));
             stackingDownLog.setBilletNo(x.getBilletNos());
             stackingDownLog.setStorageBillId(loadingParams.getStorageBill().getId());
             stackingDownLog.setStackStorey(x.getLayer());// 堆垛层号(1-20)
@@ -544,11 +560,21 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
         BilletHotsend billetHotsend = new BilletHotsend();
         //1 新保存 钢坯热送基础信息
         BeanUtils.copyProperties(loadingParams.getBilletHotsend(), billetHotsend);
+        LambdaQueryWrapper<HeatsActuals> queryWrapperHA = new LambdaQueryWrapper();
+        queryWrapperHA.eq(HeatsActuals::getCasterCode, billetHotsend.getCcmNo()).eq(HeatsActuals::getHeatsCode, billetHotsend.getHeatNo());
+        HeatsActuals heatsActuals = heatsActualsService.getOne(queryWrapperHA);
         LambdaQueryWrapper<BilletHotsend> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
-                .eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
-                .eq(BilletHotsend::getShift, billetHotsend.getShift())
-                .eq(BilletHotsend::getShiftGroup, billetHotsend.getShiftGroup());
+        if (oConvertUtils.isEmpty(heatsActuals)){
+            queryWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
+                    .eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
+                    .eq(BilletHotsend::getShift, billetHotsend.getShift())
+                    .eq(BilletHotsend::getShiftGroup, billetHotsend.getShiftGroup());
+        }else {
+            queryWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
+                    .eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
+                    .eq(BilletHotsend::getShift, heatsActuals.getShift())
+                    .eq(BilletHotsend::getShiftGroup, heatsActuals.getShiftGroup());
+        }
         BilletHotsend idExistBh = billetHotsendBaseService.getOne(queryWrapper);
         if (oConvertUtils.isEmpty(idExistBh)){
             log.info("{}{}", "钢坯热送基础信息不存在,垛位发车失败!", JSON.toJSONString(loadingParams));
@@ -588,6 +614,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
         stackingAndLoadingVehiclesList.forEach(x ->{
             StackingDownLog stackingDownLog = new StackingDownLog();
             BeanUtils.copyProperties(x, stackingDownLog);
+            stackingDownLog.setId(String.valueOf(IdWorker.getId()));
             stackingDownLog.setBilletNo(x.getBilletNos());
             stackingDownLog.setStorageBillId(loadingParams.getStorageBill().getId());// 装运单ID
             stackingDownLog.setStackStorey(x.getLayer());
@@ -659,11 +686,21 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
         BilletHotsend billetHotsend = new BilletHotsend();
         //1 新保存 钢坯热送基础信息
         BeanUtils.copyProperties(loadingParams.getBilletHotsend(), billetHotsend);
+        LambdaQueryWrapper<HeatsActuals> queryWrapperHA = new LambdaQueryWrapper();
+        queryWrapperHA.eq(HeatsActuals::getCasterCode, billetHotsend.getCcmNo()).eq(HeatsActuals::getHeatsCode, billetHotsend.getHeatNo());
+        HeatsActuals heatsActuals = heatsActualsService.getOne(queryWrapperHA);
         LambdaQueryWrapper<BilletHotsend> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
-                .eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
-                .eq(BilletHotsend::getShift, billetHotsend.getShift())
-                .eq(BilletHotsend::getShiftGroup, billetHotsend.getShiftGroup());
+        if (oConvertUtils.isEmpty(heatsActuals)){
+            queryWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
+                    .eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
+                    .eq(BilletHotsend::getShift, billetHotsend.getShift())
+                    .eq(BilletHotsend::getShiftGroup, billetHotsend.getShiftGroup());
+        }else {
+            queryWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
+                    .eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
+                    .eq(BilletHotsend::getShift, heatsActuals.getShift())
+                    .eq(BilletHotsend::getShiftGroup, heatsActuals.getShiftGroup());
+        }
         BilletHotsend idExistBh = billetHotsendBaseService.getOne(queryWrapper);
         if (oConvertUtils.isNotEmpty(idExistBh) && oConvertUtils.listIsEmpty(rollClubCommonList)){
             return;
@@ -702,6 +739,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
         stackingAndLoadingVehiclesList.forEach(x ->{
             StackingUpLog stackingUpLog = new StackingUpLog();
             BeanUtils.copyProperties(x, stackingUpLog);
+            stackingUpLog.setId(String.valueOf(IdWorker.getId()));
             stackingUpLog.setBilletNo(x.getBilletNos());
             stackingUpLog.setAmount(4); // 支数
             stackingUpLog.setLayer(x.getLayer());// 堆垛层号(1-20)

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

@@ -94,6 +94,16 @@ public class StorageBillController extends JeecgController<StorageBill, IStorage
 	 @ApiOperation(value="钢坯装运单-添加", notes="钢坯装运单-添加")
 	 @PostMapping(value = "/add")
 	 public Result<String> add(@RequestBody StorageBill storageBill) {
+
+		 //
+		 LambdaQueryWrapper<StorageBill> queryWrapper = new LambdaQueryWrapper<>();
+		 queryWrapper.eq(StorageBill::getCcmNo, storageBill.getCcmNo())
+				 	 .eq(StorageBill::getLicensePlate, storageBill.getLicensePlate())
+				     .isNull(StorageBill::getOutTime);
+		 StorageBill isStorageBill = storageBillService.getOne(queryWrapper);
+		 if (oConvertUtils.isNotEmpty(isStorageBill)){
+			 return Result.OK("该车存在未发车车辆,新增钢坯装运单失败!");
+		 }
 		 storageBill.setCarAllNum(oConvertUtils.listIsEmpty(storageBillService.list()) ? 0 : storageBillService.list().size() + 1);// 车次总序号
 		 storageBill.setDateTime(new Date());// 日期
 		 storageBill.setArrivalTime(new Date());// 到达时间