Browse Source

钢坯信息

qiangxuan 6 months ago
parent
commit
f2bcbaa4ca

+ 2 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsend/entity/BilletHotsendDetailsVo.java

@@ -21,4 +21,6 @@ public class BilletHotsendDetailsVo {
 
     private String billetHotsendTypeConfigId;
 
+    private String belongTypeName;
+
 }

+ 8 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsend/entity/RollClubCommon.java

@@ -155,4 +155,12 @@ public class RollClubCommon {
     @ApiModelProperty(value = "是否已编辑")
     private Boolean isUpd;
 
+    /**钢种*/
+    @Excel(name = "钢种", width = 15)
+    @ApiModelProperty(value = "钢种",required = true)
+    private String grade;
+    /**定尺*/
+    @Excel(name = "定尺", width = 15)
+    @ApiModelProperty(value = "定尺",required = true)
+    private Integer length;
 }

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

@@ -423,7 +423,7 @@ 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();
@@ -431,6 +431,8 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 				rollClubOneDetails.setId(String.valueOf(IdWorker.getId()));
 				rollClubOneDetails.setShift(billetHotsend.getShift());
 				rollClubOneDetails.setShiftGroup(billetHotsend.getShiftGroup());
+				rollClubOneDetails.setSize(String.valueOf(x.getLength()));
+				rollClubOneDetails.setSteel(x.getGrade());
 				rollClubOneDetails.setCreateTime(new Date());
 				billetNos.add(x.getBilletNo());
 				rollClubOneDetailsList.add(rollClubOneDetails);
@@ -469,6 +471,8 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 				rollClubTwoDetails.setShiftGroup(billetHotsend.getShiftGroup());
 				rollClubTwoDetails.setStorageBillId(storageBill.getId());
 				rollClubTwoDetails.setLicensePlate(storageBill.getLicensePlate());
+				rollClubTwoDetails.setSize(String.valueOf(x.getLength()));
+				rollClubTwoDetails.setSteel(x.getGrade());
 				rollClubTwoDetails.setCreateTime(new Date());
 				billetNos.add(x.getBilletNo());
 				rollClubTwoDetailsList.add(rollClubTwoDetails);
@@ -509,6 +513,8 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 				rollClubThreeDetails.setShiftGroup(billetHotsend.getShiftGroup());
 				rollClubThreeDetails.setStorageBillId(storageBill.getId());
 				rollClubThreeDetails.setLicensePlate(storageBill.getLicensePlate());
+				rollClubThreeDetails.setSize(String.valueOf(x.getLength()));
+				rollClubThreeDetails.setSteel(x.getGrade());
 				rollClubThreeDetails.setCreateTime(new Date());
 				billetNos.add(x.getBilletNo());
 				rollClubThreeDetailsList.add(rollClubThreeDetails);
@@ -547,6 +553,8 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 				rollHeightDetails.setId(String.valueOf(IdWorker.getId()));
 				rollHeightDetails.setShift(billetHotsend.getShift());
 				rollHeightDetails.setShiftGroup(billetHotsend.getShiftGroup());
+				rollHeightDetails.setSize(String.valueOf(x.getLength()));
+				rollHeightDetails.setSteel(x.getGrade());
 				billetNos.add(x.getBilletNo());
 				rollHeightDetails.setCreateTime(new Date());
 				rollHeightDetailsList.add(rollHeightDetails);
@@ -588,6 +596,8 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 				rollOutShippDetails.setShiftGroup(billetHotsend.getShiftGroup());
 				rollOutShippDetails.setStorageBillId(storageBill.getId());
 				rollOutShippDetails.setLicensePlate(storageBill.getLicensePlate());
+				rollOutShippDetails.setSize(String.valueOf(x.getLength()));
+				rollOutShippDetails.setSteel(x.getGrade());
 				rollOutShippDetails.setCreateTime(new Date());
 				billetNos.add(x.getBilletNo());
 				rollOutShippDetailsList.add(rollOutShippDetails);
@@ -617,6 +627,15 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 		});
 		billetBasicInfoService.saveOrUpdateBatch(billetBasicInfoList);
 
+		// 更新装运单 车次总序号、本车车次
+		LambdaQueryWrapper<StorageBill> queryWrapperSB = new LambdaQueryWrapper<>();
+		queryWrapperSB.eq(StorageBill::getId, billetHotsendDetailsVo.getStorageBill().getId());
+		StorageBill storageBillInfo = storageBillService.getOne(queryWrapperSB);
+		// 更新装运单 车次总序号、本车车次
+		storageBill.setTypeConfigId(billetHotsendDetailsVo.getBilletHotsendTypeConfigId()); // 钢坯配置类型ID
+		storageBill.setDestination(billetHotsendDetailsVo.getBelongTypeName());// 目的地
+		storageBill.setAmountTotal(storageBillInfo.getAmountTotal() + rollClubCommonList.size());
+		storageBillService.updateById(storageBill);
 		result.put("success", "新增钢坯热送成功!");
 		return result;
 	}
@@ -782,6 +801,8 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 				rollClubOneDetails.setId(String.valueOf(IdWorker.getId()));
 				rollClubOneDetails.setShift(billetHotsend.getShift());
 				rollClubOneDetails.setShiftGroup(billetHotsend.getShiftGroup());
+				rollClubOneDetails.setSize(String.valueOf(x.getLength()));
+				rollClubOneDetails.setSteel(x.getGrade());
 				rollClubOneDetails.setCreateTime(new Date());
 				billetNos.add(x.getBilletNo());
 				rollClubOneDetailsList.add(rollClubOneDetails);
@@ -820,6 +841,8 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 				rollClubTwoDetails.setShiftGroup(billetHotsend.getShiftGroup());
 				rollClubTwoDetails.setStorageBillId(storageBill.getId());
 				rollClubTwoDetails.setLicensePlate(storageBill.getLicensePlate());
+				rollClubTwoDetails.setSize(String.valueOf(x.getLength()));
+				rollClubTwoDetails.setSteel(x.getGrade());
 				rollClubTwoDetails.setCreateTime(new Date());
 				billetNos.add(x.getBilletNo());
 				rollClubTwoDetailsList.add(rollClubTwoDetails);
@@ -860,6 +883,8 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 				rollClubThreeDetails.setStorageBillId(storageBill.getId());
 				rollClubThreeDetails.setLicensePlate(storageBill.getLicensePlate());
 				rollClubThreeDetails.setCreateTime(new Date());
+				rollClubThreeDetails.setSize(String.valueOf(x.getLength()));
+				rollClubThreeDetails.setSteel(x.getGrade());
 				billetNos.add(x.getBilletNo());
 				rollClubThreeDetailsList.add(rollClubThreeDetails);
 			});
@@ -897,6 +922,8 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 				rollHeightDetails.setShift(billetHotsend.getShift());
 				rollHeightDetails.setShiftGroup(billetHotsend.getShiftGroup());
 				rollHeightDetails.setCreateTime(new Date());
+				rollHeightDetails.setSize(String.valueOf(x.getLength()));
+				rollHeightDetails.setSteel(x.getGrade());
 				billetNos.add(x.getBilletNo());
 				rollHeightDetailsList.add(rollHeightDetails);
 			});
@@ -937,6 +964,8 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 				rollOutShippDetails.setStorageBillId(storageBill.getId());
 				rollOutShippDetails.setLicensePlate(storageBill.getLicensePlate());
 				rollOutShippDetails.setCreateTime(new Date());
+				rollOutShippDetails.setSize(String.valueOf(x.getLength()));
+				rollOutShippDetails.setSteel(x.getGrade());
 				billetNos.add(x.getBilletNo());
 				rollOutShippDetailsList.add(rollOutShippDetails);
 			});
@@ -967,15 +996,12 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 
 		// 更新装运单 车次总序号、本车车次
 		LambdaQueryWrapper<StorageBill> queryWrapperSB = new LambdaQueryWrapper<>();
-		queryWrapperSB.eq(StorageBill::getCcmNo, storageBill.getCcmNo())
-				.eq(StorageBill::getShift, storageBill.getShift())
-				.eq(StorageBill::getShiftGroup, storageBill.getShiftGroup())
-				.eq(StorageBill::getLicensePlate, storageBill.getLicensePlate());
-		List<StorageBill> storageBillList = storageBillService.list(queryWrapperSB);
-		storageBill.setCarNum(oConvertUtils.listIsEmpty(storageBillList) ? 0 : storageBillList.size() + 1);// 本车车次
+		queryWrapperSB.eq(StorageBill::getId, billetHotsendDetailsVo.getStorageBill().getId());
+		StorageBill storageBillInfo = storageBillService.getOne(queryWrapperSB);
+
 		storageBill.setTypeConfigId(billetHotsendDetailsVo.getBilletHotsendTypeConfigId()); // 钢坯配置类型ID
-		storageBill.setDestination(billetHotsendDetailsVo.getStorageBill().getDestination());// 目的地
-		storageBill.setAmountTotal(rollClubCommonList.size());
+		storageBill.setDestination(billetHotsendDetailsVo.getBelongTypeName());// 目的地
+		storageBill.setAmountTotal(storageBillInfo.getAmountTotal() + rollClubCommonList.size());
 		storageBill.setOutTime(new Date());
 		storageBillService.updateById(storageBill);
 		// 生成储运单

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

@@ -27,6 +27,7 @@ import org.springframework.web.servlet.ModelAndView;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.util.Arrays;
+import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 
@@ -111,10 +112,37 @@ public class StorageBillController extends JeecgController<StorageBill, IStorage
 			 return Result.OK("存在未发车车辆,新增钢坯装运单失败!");
 		 }
 		 storageBill.setCarAllNum(oConvertUtils.listIsEmpty(storageBillService.list()) ? 0 : storageBillService.list().size() + 1);// 车次总序号
-		 storageBill.setDateTime(new Date());// 日期
 		 storageBill.setArrivalTime(new Date());// 到达时间
-		 storageBill.setCarNum(0);
-		 storageBill.setAmountTotal(oConvertUtils.isEmpty(storageBill.getAmountTotal()) ? 0 : storageBill.getAmountTotal());
+
+		 // 获取当天开始时间 00:00:00
+		 Calendar startCalendar = Calendar.getInstance();
+		 startCalendar.setTime(new Date());
+		 startCalendar.set(Calendar.HOUR_OF_DAY, 0);
+		 startCalendar.set(Calendar.MINUTE, 0);
+		 startCalendar.set(Calendar.SECOND, 0);
+		 Date startOfDay = startCalendar.getTime();
+		 // 获取当天结束时间 23:59:59
+		 Calendar endCalendar = Calendar.getInstance();
+		 endCalendar.setTime(new Date());
+		 endCalendar.set(Calendar.HOUR_OF_DAY, 23);
+		 endCalendar.set(Calendar.MINUTE, 59);
+		 endCalendar.set(Calendar.SECOND, 59);
+		 Date endOfDay = endCalendar.getTime();
+
+		 LambdaQueryWrapper<StorageBill> queryWrapper1 = new LambdaQueryWrapper<>();
+		 queryWrapper1.eq(StorageBill::getCcmNo, storageBill.getCcmNo())
+				 .eq(StorageBill::getLicensePlate, storageBill.getLicensePlate())
+				 .eq(StorageBill::getShiftGroup, text1)
+				 .eq(StorageBill::getShift, text2).between(StorageBill::getCreateTime, startOfDay, endOfDay);
+
+		 LambdaQueryWrapper<StorageBill> queryWrapper2 = new LambdaQueryWrapper<>();
+		 queryWrapper2.eq(StorageBill::getCcmNo, storageBill.getCcmNo())
+				 .eq(StorageBill::getShiftGroup, text1)
+				 .eq(StorageBill::getShift, text2).between(StorageBill::getCreateTime, startOfDay, endOfDay);
+		 List<StorageBill> storageBillList = storageBillService.list(queryWrapper1);
+		 storageBill.setCarNum(storageBillList.size() + 1);
+		 storageBill.setCarAllNum(storageBillService.list(queryWrapper2).size() + 1);
+		 storageBill.setAmountTotal(0);
 		 storageBill.setShiftGroup(text1);
 		 storageBill.setShift(text2);
 		 storageBillService.save(storageBill);
@@ -266,6 +294,20 @@ public class StorageBillController extends JeecgController<StorageBill, IStorage
 		 return Result.OK(storageBillList);
 	 }
 
+	/**
+	 * 通过铸机号查询未发车的车辆信息
+	 *
+	 * @param ccmNo
+	 * @return
+	 */
+	@ApiOperation(value="查询未发车的车辆信息-通过铸机号查询", notes="查询未发车的车辆信息-通过铸机号查询")
+	@GetMapping(value = "/queryNoDepartByCcmNo")
+	public Result<List<StorageBill>> queryNoDepartByCcmNo(@RequestParam(name="ccmNo") String ccmNo, @RequestParam(name="destination") String destination) {
+		List<StorageBill> storageBillList = storageBillService.findCar(ccmNo, destination);
+		return Result.OK(storageBillList);
+	}
+
+
 	@ApiOperation(value="发车", notes="发车")
 	@PostMapping(value = "/depart")
 	public Result<?> loading(@RequestBody BilletHotsendDetailsVo billetHotsendDetailsVo){

+ 2 - 2
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/entity/BilletHotsendDetails.java

@@ -1,10 +1,10 @@
 package org.jeecg.modules.billet.storageBill.entity;
 
 import lombok.Data;
-import org.jeecg.modules.actualControl.billetActual.billetActual.entity.BilletBasicInfo;
 import org.jeecg.modules.billet.rollClubThree.entity.RollClubThreeDetails;
 import org.jeecg.modules.billet.rollClubTwo.entity.RollClubTwoDetails;
 import org.jeecg.modules.billet.rollOutShipp.entity.RollOutShippDetails;
+import org.jeecg.modules.billet.stackingAndLoadingVehicles.entity.StackingDownLog;
 
 import java.util.List;
 
@@ -17,6 +17,6 @@ public class BilletHotsendDetails {
 
     private List<RollOutShippDetails> rollOutShippDetailsList;
 
-    private List<BilletBasicInfo> billetBasicInfoList;
+    private List<StackingDownLog> stackingDownLogList;
 
 }

+ 5 - 4
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/mapper/StorageBillMapper.java

@@ -1,13 +1,12 @@
 package org.jeecg.modules.billet.storageBill.mapper;
 
-import java.util.HashMap;
-import java.util.List;
-
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.billet.storageBill.entity.CastAndBtTypeStats;
 import org.jeecg.modules.billet.storageBill.entity.CastStats;
 import org.jeecg.modules.billet.storageBill.entity.StorageBill;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import java.util.List;
 
 /**
  * @Description: 钢坯装运单
@@ -22,4 +21,6 @@ public interface StorageBillMapper extends BaseMapper<StorageBill> {
     CastStats castStats(String castMachine);
 
     CastAndBtTypeStats castAndBtTypeStats(@Param("castMachine") String castMachine, @Param("btype") String btype);
+
+    List<StorageBill> findCar(@Param("ccmNo") String ccmNo, @Param("destination") String destination);
 }

+ 4 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/mapper/xml/StorageBillMapper.xml

@@ -99,4 +99,8 @@
                 AND library = '3'
         )as sr
     </select>
+
+    <select id="findCar" resultType="org.jeecg.modules.billet.storageBill.entity.StorageBill">
+        SELECT * FROM storage_bill WHERE ccm_no = #{ccmNo} AND arrival_time IS NOT NULL AND out_time IS NULL AND (destination IS NULL OR destination = #{destination});
+    </select>
 </mapper>

+ 4 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/service/IStorageBillService.java

@@ -6,6 +6,8 @@ import org.jeecg.modules.billet.storageBill.entity.BilletHotsendDetails;
 import org.jeecg.modules.billet.storageBill.entity.GetStatsResponse;
 import org.jeecg.modules.billet.storageBill.entity.StorageBill;
 
+import java.util.List;
+
 /**
  * @Description: 钢坯装运单
  * @Author: jeecg-boot
@@ -22,4 +24,6 @@ public interface IStorageBillService extends IService<StorageBill> {
     void departHandle(BilletHotsendDetailsVo billetHotsendDetailsVo);
 
     BilletHotsendDetails findBilletHotsendDetails(StorageBill storageBill);
+
+    List<StorageBill> findCar(String ccmNo, String destination);
 }

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

@@ -16,6 +16,8 @@ import org.jeecg.modules.billet.rollClubTwo.entity.RollClubTwoDetails;
 import org.jeecg.modules.billet.rollClubTwo.service.IRollClubTwoDetailsService;
 import org.jeecg.modules.billet.rollOutShipp.entity.RollOutShippDetails;
 import org.jeecg.modules.billet.rollOutShipp.service.IRollOutShippDetailsService;
+import org.jeecg.modules.billet.stackingAndLoadingVehicles.entity.StackingDownLog;
+import org.jeecg.modules.billet.stackingAndLoadingVehicles.service.IStackingDownLogService;
 import org.jeecg.modules.billet.storageBill.entity.BilletHotsendDetails;
 import org.jeecg.modules.billet.storageBill.entity.GetStatsResponse;
 import org.jeecg.modules.billet.storageBill.entity.StorageBill;
@@ -60,6 +62,9 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
     @Autowired
     private IBilletBasicInfoService billetBasicInfoService;
 
+    @Autowired
+    private IStackingDownLogService stackingDownLogService;
+
     @Override
     public void subCarTimes(Integer times) {
         storageBillMapper.subCarTimes(times);
@@ -121,21 +126,19 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
         if (oConvertUtils.isEmpty(billetHotsendTypeConfig)){
             return null;
         }
-        // 如果是5号机棒二、棒三、上若  6号机 棒二、棒三 查询对应的明细信息
-        if ("1".equals(billetHotsendTypeConfig.getIsTrucking().toString()) && "棒二".equals(billetHotsendTypeConfig.getTypeName())){
-            List<RollClubTwoDetails> rollClubTwoDetailsList = rollClubTwoDetailsService.list(new LambdaQueryWrapper<RollClubTwoDetails>().eq(RollClubTwoDetails::getStorageBillId, storageBill.getId()).eq(RollClubTwoDetails::getCcmNo,  storageBill.getCcmNo()));
-            result.setRollClubTwoDetailsList(rollClubTwoDetailsList);
-        }else if ("1".equals(billetHotsendTypeConfig.getIsTrucking().toString()) && "棒三".equals(billetHotsendTypeConfig.getTypeName())){
-            List<RollClubThreeDetails> rollClubThreeDetailsList = rollClubThreeDetailsService.list(new LambdaQueryWrapper<RollClubThreeDetails>().eq(RollClubThreeDetails::getStorageBillId, storageBill.getId()).eq(RollClubThreeDetails::getCcmNo, storageBill.getCcmNo()));
-            result.setRollClubThreeDetailsList(rollClubThreeDetailsList);
-        }else if ("1".equals(billetHotsendTypeConfig.getIsTrucking().toString()) && "上若".equals(billetHotsendTypeConfig.getTypeName())){
-            List<RollOutShippDetails> rollOutShippDetailsList = rollOutShippDetailsService.list(new LambdaQueryWrapper<RollOutShippDetails>().eq(RollOutShippDetails::getStorageBillId, storageBill.getId()).eq(RollOutShippDetails::getCcmNo, storageBill.getCcmNo()));
-            result.setRollOutShippDetailsList(rollOutShippDetailsList);
-        }else {
-            // 其他所有非车运的查询钢坯基础信息
-            List<BilletBasicInfo> billetBasicInfoList = billetBasicInfoService.list(new LambdaQueryWrapper<BilletBasicInfo>().eq(BilletBasicInfo::getBhtcId, storageBill.getTypeConfigId()).eq(BilletBasicInfo::getCcmNo, storageBill.getCcmNo()));
-            result.setBilletBasicInfoList(billetBasicInfoList);
-        }
+        List<RollClubTwoDetails> rollClubTwoDetailsList = rollClubTwoDetailsService.list(new LambdaQueryWrapper<RollClubTwoDetails>().eq(RollClubTwoDetails::getStorageBillId, storageBill.getId()));
+        result.setRollClubTwoDetailsList(rollClubTwoDetailsList);
+        List<RollClubThreeDetails> rollClubThreeDetailsList = rollClubThreeDetailsService.list(new LambdaQueryWrapper<RollClubThreeDetails>().eq(RollClubThreeDetails::getStorageBillId, storageBill.getId()));
+        result.setRollClubThreeDetailsList(rollClubThreeDetailsList);
+        List<RollOutShippDetails> rollOutShippDetailsList = rollOutShippDetailsService.list(new LambdaQueryWrapper<RollOutShippDetails>().eq(RollOutShippDetails::getStorageBillId, storageBill.getId()));
+        result.setRollOutShippDetailsList(rollOutShippDetailsList);
+        List<StackingDownLog> stackingDownLogList = stackingDownLogService.list(new LambdaQueryWrapper<StackingDownLog>().eq(StackingDownLog::getStorageBillId, storageBill.getId()));
+        result.setStackingDownLogList(stackingDownLogList);
         return result;
     }
+
+    @Override
+    public List<StorageBill> findCar(String ccmNo, String destination) {
+        return storageBillMapper.findCar(ccmNo, destination);
+    }
 }