Răsfoiți Sursa

新增棒一、棒二、棒三、高线、上若五个工作台的班次信息查询接口

lingpeng.li 1 lună în urmă
părinte
comite
ff8a22bd31
20 a modificat fișierele cu 1640 adăugiri și 553 ștergeri
  1. 195 183
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollClubOne/controller/RollClubOneDetailsController.java
  2. 4 0
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollClubOne/service/IRollClubOneDetailsService.java
  3. 155 5
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollClubOne/service/impl/RollClubOneDetailsServiceImpl.java
  4. 135 128
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollClubThree/controller/RollClubThreeDetailsController.java
  5. 4 1
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollClubThree/service/IRollClubThreeDetailsService.java
  6. 210 14
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollClubThree/service/impl/RollClubThreeDetailsServiceImpl.java
  7. 12 3
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollClubTwo/controller/RollClubTwoDetailsController.java
  8. 4 1
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollClubTwo/service/IRollClubTwoDetailsService.java
  9. 212 13
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollClubTwo/service/impl/RollClubTwoDetailsServiceImpl.java
  10. 194 185
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollHeight/controller/RollHeightDetailsController.java
  11. 3 0
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollHeight/service/IRollHeightDetailsService.java
  12. 154 3
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollHeight/service/impl/RollHeightDetailsServiceImpl.java
  13. 12 3
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollOutShipp/controller/RollOutShippDetailsController.java
  14. 4 1
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollOutShipp/service/IRollOutShippDetailsService.java
  15. 210 12
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollOutShipp/service/impl/RollOutShippDetailsServiceImpl.java
  16. 17 0
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/dto/RollDetailQueryDTO.java
  17. 53 0
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/vo/RollChargeDetailsPageVO.java
  18. 12 0
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/vo/RollChargeDetailsVO.java
  19. 49 0
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/vo/RollSendDetailsPageVO.java
  20. 1 1
      zgztBus/jeecg-server-cloud/jeecg-cloud-nacos/src/main/resources/application.yml

+ 195 - 183
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollClubOne/controller/RollClubOneDetailsController.java

@@ -16,6 +16,7 @@ import org.jeecg.modules.billet.rollClubOne.entity.RollClubOneDetails;
 import org.jeecg.modules.billet.rollClubOne.service.IRollClubOneDetailsService;
 import org.jeecg.modules.billet.storageBill.dto.RollDetailQueryDTO;
 import org.jeecg.modules.billet.storageBill.vo.RollOnDutyDataVo;
+import org.jeecg.modules.billet.storageBill.vo.RollSendDetailsPageVO;
 import org.jeecg.modules.billet.storageBill.vo.RollSendDetailsVO;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -31,122 +32,122 @@ import java.util.List;
 /**
  * @Description: 棒一明细信息
  * @Author: jeecg-boot
- * @Date:   2024-11-20
+ * @Date: 2024-11-20
  * @Version: V1.0
  */
-@Api(tags="棒一明细信息")
+@Api(tags = "棒一明细信息")
 @RestController
 @RequestMapping("/rollClubOneDetails")
 @Slf4j
 public class RollClubOneDetailsController extends JeecgController<RollClubOneDetails, IRollClubOneDetailsService> {
-	@Autowired
-	private IRollClubOneDetailsService rollClubOneDetailsService;
-	
-	/**
-	 * 分页列表查询
-	 *
-	 * @param rollClubOneDetails
-	 * @param pageNo
-	 * @param pageSize
-	 * @param req
-	 * @return
-	 */
-	//@AutoLog(value = "棒一明细信息-分页列表查询")
-	@ApiOperation(value="棒一明细信息-分页列表查询", notes="棒一明细信息-分页列表查询")
-	@GetMapping(value = "/list")
-	public Result<IPage<RollClubOneDetails>> queryPageList(RollClubOneDetails rollClubOneDetails,
-								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
-								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
-								   HttpServletRequest req) {
-		QueryWrapper<RollClubOneDetails> queryWrapper = QueryGenerator.initQueryWrapper(rollClubOneDetails, req.getParameterMap());
-		Page<RollClubOneDetails> page = new Page<RollClubOneDetails>(pageNo, pageSize);
-		IPage<RollClubOneDetails> pageList = rollClubOneDetailsService.page(page, queryWrapper);
-		return Result.OK(pageList);
-	}
-	
-	/**
-	 *   添加
-	 *
-	 * @param rollClubOneDetails
-	 * @return
-	 */
-	@AutoLog(value = "棒一明细信息-添加")
-	@ApiOperation(value="棒一明细信息-添加", notes="棒一明细信息-添加")
-	@RequiresPermissions("rollClubOneDetails:roll_club_one_details:add")
-	@PostMapping(value = "/add")
-	public Result<String> add(@RequestBody RollClubOneDetails rollClubOneDetails) {
-		rollClubOneDetailsService.save(rollClubOneDetails);
-		return Result.OK("添加成功!");
-	}
-	
-	/**
-	 *  编辑
-	 *
-	 * @param rollClubOneDetails
-	 * @return
-	 */
-	@AutoLog(value = "棒一明细信息-编辑")
-	@ApiOperation(value="棒一明细信息-编辑", notes="棒一明细信息-编辑")
-	@RequiresPermissions("rollClubOneDetails:roll_club_one_details:edit")
-	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
-	public Result<String> edit(@RequestBody RollClubOneDetails rollClubOneDetails) {
-		rollClubOneDetailsService.updateById(rollClubOneDetails);
-		return Result.OK("编辑成功!");
-	}
-	
-	/**
-	 *   通过id删除
-	 *
-	 * @param id
-	 * @return
-	 */
-	@AutoLog(value = "棒一明细信息-通过id删除")
-	@ApiOperation(value="棒一明细信息-通过id删除", notes="棒一明细信息-通过id删除")
-	@RequiresPermissions("rollClubOneDetails:roll_club_one_details:delete")
-	@DeleteMapping(value = "/delete")
-	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
-		rollClubOneDetailsService.removeById(id);
-		return Result.OK("删除成功!");
-	}
-	
-	/**
-	 *  批量删除
-	 *
-	 * @param ids
-	 * @return
-	 */
-	@AutoLog(value = "棒一明细信息-批量删除")
-	@ApiOperation(value="棒一明细信息-批量删除", notes="棒一明细信息-批量删除")
-	@RequiresPermissions("rollClubOneDetails:roll_club_one_details:deleteBatch")
-	@DeleteMapping(value = "/deleteBatch")
-	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
-		this.rollClubOneDetailsService.removeByIds(Arrays.asList(ids.split(",")));
-		return Result.OK("批量删除成功!");
-	}
-	
-	/**
-	 * 通过id查询
-	 *
-	 * @param id
-	 * @return
-	 */
-	//@AutoLog(value = "棒一明细信息-通过id查询")
-	@ApiOperation(value="棒一明细信息-通过id查询", notes="棒一明细信息-通过id查询")
-	@GetMapping(value = "/queryById")
-	public Result<RollClubOneDetails> queryById(@RequestParam(name="id",required=true) String id) {
-		RollClubOneDetails rollClubOneDetails = rollClubOneDetailsService.getById(id);
-		if(rollClubOneDetails==null) {
-			return Result.error("未找到对应数据");
-		}
-		return Result.OK(rollClubOneDetails);
-	}
+    @Autowired
+    private IRollClubOneDetailsService rollClubOneDetailsService;
 
     /**
-    * 导出excel
-    *
-    * @param request
-    * @param rollClubOneDetails
-    */
+     * 分页列表查询
+     *
+     * @param rollClubOneDetails
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    //@AutoLog(value = "棒一明细信息-分页列表查询")
+    @ApiOperation(value = "棒一明细信息-分页列表查询", notes = "棒一明细信息-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<RollClubOneDetails>> queryPageList(RollClubOneDetails rollClubOneDetails,
+                                                           @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                           @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                           HttpServletRequest req) {
+        QueryWrapper<RollClubOneDetails> queryWrapper = QueryGenerator.initQueryWrapper(rollClubOneDetails, req.getParameterMap());
+        Page<RollClubOneDetails> page = new Page<RollClubOneDetails>(pageNo, pageSize);
+        IPage<RollClubOneDetails> pageList = rollClubOneDetailsService.page(page, queryWrapper);
+        return Result.OK(pageList);
+    }
+
+    /**
+     * 添加
+     *
+     * @param rollClubOneDetails
+     * @return
+     */
+    @AutoLog(value = "棒一明细信息-添加")
+    @ApiOperation(value = "棒一明细信息-添加", notes = "棒一明细信息-添加")
+    @RequiresPermissions("rollClubOneDetails:roll_club_one_details:add")
+    @PostMapping(value = "/add")
+    public Result<String> add(@RequestBody RollClubOneDetails rollClubOneDetails) {
+        rollClubOneDetailsService.save(rollClubOneDetails);
+        return Result.OK("添加成功!");
+    }
+
+    /**
+     * 编辑
+     *
+     * @param rollClubOneDetails
+     * @return
+     */
+    @AutoLog(value = "棒一明细信息-编辑")
+    @ApiOperation(value = "棒一明细信息-编辑", notes = "棒一明细信息-编辑")
+    @RequiresPermissions("rollClubOneDetails:roll_club_one_details:edit")
+    @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
+    public Result<String> edit(@RequestBody RollClubOneDetails rollClubOneDetails) {
+        rollClubOneDetailsService.updateById(rollClubOneDetails);
+        return Result.OK("编辑成功!");
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "棒一明细信息-通过id删除")
+    @ApiOperation(value = "棒一明细信息-通过id删除", notes = "棒一明细信息-通过id删除")
+    @RequiresPermissions("rollClubOneDetails:roll_club_one_details:delete")
+    @DeleteMapping(value = "/delete")
+    public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
+        rollClubOneDetailsService.removeById(id);
+        return Result.OK("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "棒一明细信息-批量删除")
+    @ApiOperation(value = "棒一明细信息-批量删除", notes = "棒一明细信息-批量删除")
+    @RequiresPermissions("rollClubOneDetails:roll_club_one_details:deleteBatch")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        this.rollClubOneDetailsService.removeByIds(Arrays.asList(ids.split(",")));
+        return Result.OK("批量删除成功!");
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    //@AutoLog(value = "棒一明细信息-通过id查询")
+    @ApiOperation(value = "棒一明细信息-通过id查询", notes = "棒一明细信息-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<RollClubOneDetails> queryById(@RequestParam(name = "id", required = true) String id) {
+        RollClubOneDetails rollClubOneDetails = rollClubOneDetailsService.getById(id);
+        if (rollClubOneDetails == null) {
+            return Result.error("未找到对应数据");
+        }
+        return Result.OK(rollClubOneDetails);
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param rollClubOneDetails
+     */
     @RequiresPermissions("rollClubOneDetails:roll_club_one_details:exportXls")
     @RequestMapping(value = "/exportXls")
     public ModelAndView exportXls(HttpServletRequest request, RollClubOneDetails rollClubOneDetails) {
@@ -154,12 +155,12 @@ public class RollClubOneDetailsController extends JeecgController<RollClubOneDet
     }
 
     /**
-      * 通过excel导入数据
-    *
-    * @param request
-    * @param response
-    * @return
-    */
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
     @RequiresPermissions("rollClubOneDetails:roll_club_one_details:importExcel")
     @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
     public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
@@ -167,73 +168,84 @@ public class RollClubOneDetailsController extends JeecgController<RollClubOneDet
     }
 
 
-	@ApiOperation(value = "棒一热送单信息-分页列表查询", notes = "棒一热送单信息-分页列表查询")
-	@GetMapping(value = "/hotSendRollClubOneList")
-	public Result<IPage<HotSendRollClubOneDetails>> queryHotSendPageList(RollClubOneDetails rollClubOneDetails,
-																		 @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-																		 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-																		 HttpServletRequest req) {
-		QueryWrapper<RollClubOneDetails> queryWrapper = QueryGenerator.initQueryWrapper(rollClubOneDetails, req.getParameterMap());
-
-		queryWrapper.isNotNull("heat_no");
-		// 添加分组条件
-		queryWrapper.groupBy("heat_no");
-
-		// 如果需要统计每组的 hotsendSum 总和,可以添加聚合函数
-		queryWrapper.select("MAX(id) AS id", "GROUP_CONCAT( DISTINCT ccm_no ) AS ccmNo",
-				"GROUP_CONCAT( DISTINCT shift_group ) AS shiftGroup", "GROUP_CONCAT( DISTINCT shift ) AS shift",
-				"heat_no", "GROUP_CONCAT( DISTINCT steel ) AS steel", "MAX(start_num) AS startNum",
-				"MAX(end_num) AS endNum", "GROUP_CONCAT( DISTINCT spec ) AS spec",
-				"MAX(blank_output) AS blankOutput", "GROUP_CONCAT( DISTINCT size ) AS size",
-				"GROUP_CONCAT( DISTINCT license_plate ) AS licensePlate",
-				"GROUP_CONCAT( DISTINCT assembly_number ) AS assemblyNumber",
-				"MAX(create_time) as createTime", "COUNT(*) as hotsendSum");
-		Page<RollClubOneDetails> page = new Page<>(pageNo, pageSize);
-		IPage<RollClubOneDetails> pageList = rollClubOneDetailsService.page(page, queryWrapper);
-
-		List<HotSendRollClubOneDetails> hotSendRollClubOneDetailsList = new ArrayList<>();
-
-		List<RollClubOneDetails> records = pageList.getRecords();
-		records.forEach(x -> {
-			HotSendRollClubOneDetails hotSendRollClubOneDetails = new HotSendRollClubOneDetails();
-			hotSendRollClubOneDetails.setDestination("棒一");
-			hotSendRollClubOneDetails.setHotsendSum(x.getHotsendSum());
-			BeanUtils.copyProperties(x, hotSendRollClubOneDetails);
-			hotSendRollClubOneDetailsList.add(hotSendRollClubOneDetails);
-		});
-
-		// 创建一个新的分页对象,封装 hotSendRollClubOneDetailsList
-		Page<HotSendRollClubOneDetails> hotSendPage = new Page<>(pageNo, pageSize, pageList.getTotal());
-		hotSendPage.setRecords(hotSendRollClubOneDetailsList);
-
-		return Result.OK(hotSendPage);
-	}
-
-	 @ApiOperation(value="棒一热送单明细查询", notes="棒一热送单明细查询")
-	 @GetMapping(value = "/hotSendRollClubOneDetailList")
-	 public Result<List<RollClubOneDetails>> queryHotSendDetailList(@RequestParam(name="ccmNo") String ccmNo, @RequestParam(name="heatNo") String heatNo) {
-		 // 根据铸机号、炉号查询棒一明细,返回List<RollClubOneDetails>
-		 QueryWrapper<RollClubOneDetails> queryWrapper = new QueryWrapper<>();
-		 queryWrapper.eq("ccm_no", ccmNo);
-		 queryWrapper.eq("heat_no", heatNo);
-		 queryWrapper.orderByDesc("create_time");
-		 List<RollClubOneDetails> rollClubOneDetails = rollClubOneDetailsService.list(queryWrapper);
-		 return Result.OK(rollClubOneDetails);
-	 }
-
-	@ApiOperation(value = "轧钢棒一工作台信息", notes = "轧钢棒一工作台信息")
-	@GetMapping(value = "/rollClubOneWorkbenches")
-	public Result<RollOnDutyDataVo> rollClubOneWorkbenches(@RequestParam(name = "ccmNo") String ccmNo) {
-
-		RollOnDutyDataVo rollOnDutyVo = rollClubOneDetailsService.queryOnDutyRecord(ccmNo);
-		return Result.OK(rollOnDutyVo);
-	}
-
-	@ApiOperation(value = "轧钢棒一工作台总接收明细信息", notes = "轧钢棒一工作台总接收明细信息")
-	@GetMapping(value = "/rollClubOneWorkbenchesDetail")
-	public Result<RollSendDetailsVO> rollClubOneWorkbenchesDetail(RollDetailQueryDTO queryDTO) {
-
-		RollSendDetailsVO rollSendDetailsVO = rollClubOneDetailsService.queryWorkbenchesDetail(queryDTO);
-		return Result.OK(rollSendDetailsVO);
-	}
+    @ApiOperation(value = "棒一热送单信息-分页列表查询", notes = "棒一热送单信息-分页列表查询")
+    @GetMapping(value = "/hotSendRollClubOneList")
+    public Result<IPage<HotSendRollClubOneDetails>> queryHotSendPageList(RollClubOneDetails rollClubOneDetails,
+                                                                         @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                                         @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                                         HttpServletRequest req) {
+        QueryWrapper<RollClubOneDetails> queryWrapper = QueryGenerator.initQueryWrapper(rollClubOneDetails, req.getParameterMap());
+
+        queryWrapper.isNotNull("heat_no");
+        // 添加分组条件
+        queryWrapper.groupBy("heat_no");
+
+        // 如果需要统计每组的 hotsendSum 总和,可以添加聚合函数
+        queryWrapper.select("MAX(id) AS id", "GROUP_CONCAT( DISTINCT ccm_no ) AS ccmNo",
+                "GROUP_CONCAT( DISTINCT shift_group ) AS shiftGroup", "GROUP_CONCAT( DISTINCT shift ) AS shift",
+                "heat_no", "GROUP_CONCAT( DISTINCT steel ) AS steel", "MAX(start_num) AS startNum",
+                "MAX(end_num) AS endNum", "GROUP_CONCAT( DISTINCT spec ) AS spec",
+                "MAX(blank_output) AS blankOutput", "GROUP_CONCAT( DISTINCT size ) AS size",
+                "GROUP_CONCAT( DISTINCT license_plate ) AS licensePlate",
+                "GROUP_CONCAT( DISTINCT assembly_number ) AS assemblyNumber",
+                "MAX(create_time) as createTime", "COUNT(*) as hotsendSum");
+        Page<RollClubOneDetails> page = new Page<>(pageNo, pageSize);
+        IPage<RollClubOneDetails> pageList = rollClubOneDetailsService.page(page, queryWrapper);
+
+        List<HotSendRollClubOneDetails> hotSendRollClubOneDetailsList = new ArrayList<>();
+
+        List<RollClubOneDetails> records = pageList.getRecords();
+        records.forEach(x -> {
+            HotSendRollClubOneDetails hotSendRollClubOneDetails = new HotSendRollClubOneDetails();
+            hotSendRollClubOneDetails.setDestination("棒一");
+            hotSendRollClubOneDetails.setHotsendSum(x.getHotsendSum());
+            BeanUtils.copyProperties(x, hotSendRollClubOneDetails);
+            hotSendRollClubOneDetailsList.add(hotSendRollClubOneDetails);
+        });
+
+        // 创建一个新的分页对象,封装 hotSendRollClubOneDetailsList
+        Page<HotSendRollClubOneDetails> hotSendPage = new Page<>(pageNo, pageSize, pageList.getTotal());
+        hotSendPage.setRecords(hotSendRollClubOneDetailsList);
+
+        return Result.OK(hotSendPage);
+    }
+
+    @ApiOperation(value = "棒一热送单明细查询", notes = "棒一热送单明细查询")
+    @GetMapping(value = "/hotSendRollClubOneDetailList")
+    public Result<List<RollClubOneDetails>> queryHotSendDetailList(@RequestParam(name = "ccmNo") String ccmNo, @RequestParam(name = "heatNo") String heatNo) {
+        // 根据铸机号、炉号查询棒一明细,返回List<RollClubOneDetails>
+        QueryWrapper<RollClubOneDetails> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("ccm_no", ccmNo);
+        queryWrapper.eq("heat_no", heatNo);
+        queryWrapper.orderByDesc("create_time");
+        List<RollClubOneDetails> rollClubOneDetails = rollClubOneDetailsService.list(queryWrapper);
+        return Result.OK(rollClubOneDetails);
+    }
+
+    @ApiOperation(value = "轧钢棒一工作台信息", notes = "轧钢棒一工作台信息")
+    @GetMapping(value = "/rollClubOneWorkbenches")
+    public Result<RollOnDutyDataVo> rollClubOneWorkbenches(@RequestParam(name = "ccmNo") String ccmNo) {
+
+        RollOnDutyDataVo rollOnDutyVo = rollClubOneDetailsService.queryOnDutyRecord(ccmNo);
+        return Result.OK(rollOnDutyVo);
+    }
+
+    @ApiOperation(value = "轧钢棒一工作台总接收明细信息", notes = "轧钢棒一工作台总接收明细信息")
+    @GetMapping(value = "/rollClubOneWorkbenchesDetail")
+    public Result<RollSendDetailsVO> rollClubOneWorkbenchesDetail(RollDetailQueryDTO queryDTO) {
+
+        RollSendDetailsVO rollSendDetailsVO = rollClubOneDetailsService.queryWorkbenchesDetail(queryDTO);
+        return Result.OK(rollSendDetailsVO);
+    }
+
+
+    @ApiOperation(value = "轧钢棒一工作台根据班次天次查询总接收明细信息", notes = "轧钢棒一工作台根据班次天次查询总接收明细信息")
+    @GetMapping(value = "/rollClubOneWorkbenchesQuery")
+    public Result<RollSendDetailsPageVO> rollClubOneWorkbenchesQuery(RollDetailQueryDTO queryDTO) {
+
+        RollSendDetailsPageVO rollSendDetailsVO = rollClubOneDetailsService.rollClubOneWorkbenchesQuery(queryDTO);
+        return Result.OK(rollSendDetailsVO);
+    }
+
+
 }

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

@@ -1,9 +1,11 @@
 package org.jeecg.modules.billet.rollClubOne.service;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.modules.billet.rollClubOne.entity.RollClubOneDetails;
 import org.jeecg.modules.billet.storageBill.dto.RollDetailQueryDTO;
 import org.jeecg.modules.billet.storageBill.vo.RollOnDutyDataVo;
+import org.jeecg.modules.billet.storageBill.vo.RollSendDetailsPageVO;
 import org.jeecg.modules.billet.storageBill.vo.RollSendDetailsVO;
 
 /**
@@ -17,4 +19,6 @@ public interface IRollClubOneDetailsService extends IService<RollClubOneDetails>
     RollOnDutyDataVo queryOnDutyRecord(String ccmNo);
 
     RollSendDetailsVO queryWorkbenchesDetail(RollDetailQueryDTO queryDTO);
+
+    RollSendDetailsPageVO rollClubOneWorkbenchesQuery(RollDetailQueryDTO queryDTO);
 }

+ 155 - 5
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollClubOne/service/impl/RollClubOneDetailsServiceImpl.java

@@ -1,8 +1,11 @@
 package org.jeecg.modules.billet.rollClubOne.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang.StringUtils;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.billet.billetHotsendChangeShift.entity.BilletHotsendChangeShift;
@@ -14,6 +17,7 @@ import org.jeecg.modules.billet.storageBill.dto.RollDetailQueryDTO;
 import org.jeecg.modules.billet.storageBill.mapper.StorageBillMapper;
 import org.jeecg.modules.billet.storageBill.vo.RollOnDutyDataVo;
 import org.jeecg.modules.billet.storageBill.vo.RollOnDutyInfoVo;
+import org.jeecg.modules.billet.storageBill.vo.RollSendDetailsPageVO;
 import org.jeecg.modules.billet.storageBill.vo.RollSendDetailsVO;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,15 +27,13 @@ import org.springframework.stereotype.Service;
 import java.math.BigDecimal;
 import java.time.LocalDate;
 import java.time.format.DateTimeFormatter;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
  * @Description: 棒一明细信息
  * @Author: jeecg-boot
- * @Date:   2024-11-20
+ * @Date: 2024-11-20
  * @Version: V1.0
  */
 
@@ -95,7 +97,6 @@ public class RollClubOneDetailsServiceImpl extends ServiceImpl<RollClubOneDetail
     }
 
 
-
     @Override
     public RollSendDetailsVO queryWorkbenchesDetail(RollDetailQueryDTO queryDTO) {
 
@@ -203,6 +204,155 @@ public class RollClubOneDetailsServiceImpl extends ServiceImpl<RollClubOneDetail
     }
 
 
+    @Override
+    public RollSendDetailsPageVO rollClubOneWorkbenchesQuery(RollDetailQueryDTO queryDTO) {
+
+        RollSendDetailsPageVO rollSendDetailsVO = new RollSendDetailsPageVO();
+
+        if (queryDTO == null) {
+            return rollSendDetailsVO;
+        }
+
+        LambdaQueryWrapper<BilletHotsendChangeShift> changeShiftQueryWrapper = new LambdaQueryWrapper<>();
+
+        if (StringUtils.isNotBlank(queryDTO.getCcmNo())) {
+            changeShiftQueryWrapper.eq(BilletHotsendChangeShift::getCcmNo, queryDTO.getCcmNo());
+        }
+        if (StringUtils.isNotBlank(queryDTO.getShiftGroup())) {
+            changeShiftQueryWrapper.eq(BilletHotsendChangeShift::getShiftGroup, queryDTO.getShiftGroup());
+        }
+        if (StringUtils.isNotBlank(queryDTO.getShift())) {
+            changeShiftQueryWrapper.eq(BilletHotsendChangeShift::getShift, queryDTO.getShift());
+        }
+
+        Date beginDate = queryDTO.getBeginCreateDate();
+        Date endDate = queryDTO.getEndCreateDate();
+        if (beginDate != null) {
+            changeShiftQueryWrapper.ge(BilletHotsendChangeShift::getCreateTime, DateUtils.getStartOfDayByDate(beginDate));
+        }
+        if (endDate != null) {
+            changeShiftQueryWrapper.le(BilletHotsendChangeShift::getCreateTime, DateUtils.getEndOfDayByDate(endDate));
+        }
+
+        List<BilletHotsendChangeShift> changeShiftList = billetHotsendChangeShiftService.list(changeShiftQueryWrapper);
+
+        if (CollectionUtils.isEmpty(changeShiftList)) {
+            return rollSendDetailsVO;
+        }
+
+        Set<String> ccmNos = changeShiftList.stream()
+                .map(BilletHotsendChangeShift::getCcmNo)
+                .filter(StringUtils::isNotBlank)
+                .collect(Collectors.toSet());
+
+        LambdaQueryWrapper<RollClubOneDetails> rollDetailsWrapper = new LambdaQueryWrapper<>();
+        rollDetailsWrapper.in(RollClubOneDetails::getCcmNo, ccmNos);
+        if (beginDate != null) {
+            rollDetailsWrapper.ge(RollClubOneDetails::getCreateTime, DateUtils.getStartOfDayByDate(beginDate));
+        }
+        if (endDate != null) {
+            rollDetailsWrapper.le(RollClubOneDetails::getCreateTime, DateUtils.getEndOfDayByDate(endDate));
+        }
+
+        List<RollClubOneDetails> allDetails = baseMapper.selectList(rollDetailsWrapper);
+        Map<String, List<RollClubOneDetails>> groupedDetails = allDetails.stream()
+                .collect(Collectors.groupingBy(d ->
+                        DateUtils.formatDate(d.getCreateTime()) + "_" +
+                                d.getCcmNo() + "_" +
+                                d.getShiftGroup() + "_" +
+                                d.getShift()
+                ));
+
+        List<RollSendDetailsPageVO.RollHistoryDetail> allHistoryDetails = new ArrayList<>();
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+
+        for (BilletHotsendChangeShift billet : changeShiftList) {
+
+            if (billet.getChangeShiftTime() == null) {
+                billet.setChangeShiftTime(new Date());
+            }
+
+            String dateKeyT = DateUtils.formatDate(billet.getCreateTime());
+            String key = dateKeyT + "_" + billet.getCcmNo() + "_" + billet.getShiftGroup() + "_" + billet.getShift();
+            List<RollClubOneDetails> matchedDetails = groupedDetails.getOrDefault(key, Collections.emptyList());
+
+            List<RollSendDetailsPageVO.RollHistoryDetail> rollHistoryDetails = matchedDetails.stream()
+                    .filter(d -> {
+                        Date create = d.getCreateTime();
+                        return create != null &&
+                                (create.after(billet.getCreateTime()) || create.equals(billet.getCreateTime())) &&
+                                (create.before(billet.getChangeShiftTime()) || create.equals(billet.getChangeShiftTime()));
+                    })
+                    .collect(Collectors.groupingBy(detail -> DateUtils.formatDate(detail.getCreateTime())))
+                    .entrySet().stream()
+                    .map(entry -> {
+                        String dateKey = entry.getKey();
+                        List<RollClubOneDetails> detailList = entry.getValue();
+
+                        int count = detailList.size();
+                        BigDecimal weight = detailList.stream()
+                                .map(d -> BigDecimal.valueOf(d.getBlankOutput()))
+                                .reduce(BigDecimal.ZERO, BigDecimal::add)
+                                .setScale(4, BigDecimal.ROUND_HALF_UP);
+
+                        RollSendDetailsPageVO.RollHistoryDetail historyDetail = new RollSendDetailsPageVO.RollHistoryDetail();
+                        historyDetail.setCurrentDate(dateKey);
+                        historyDetail.setCurrentDateAmount(count);
+                        historyDetail.setCurrentDateWeight(weight);
+                        historyDetail.setShift(billet.getShift());
+                        historyDetail.setShiftGroup(billet.getShiftGroup());
+
+                        List<RollSendDetailsPageVO.CurrentDateDetail> sizeDetails = detailList.stream()
+                                .collect(Collectors.groupingBy(RollClubOneDetails::getSize))
+                                .entrySet().stream()
+                                .map(e -> {
+                                    RollSendDetailsPageVO.CurrentDateDetail detail = new RollSendDetailsPageVO.CurrentDateDetail();
+                                    detail.setSize(e.getKey());
+                                    detail.setAmount(e.getValue().size());
+                                    detail.setBlankOutput(e.getValue().stream()
+                                            .map(d -> BigDecimal.valueOf(d.getBlankOutput()))
+                                            .reduce(BigDecimal.ZERO, BigDecimal::add)
+                                            .setScale(4, BigDecimal.ROUND_HALF_UP));
+                                    return detail;
+                                }).collect(Collectors.toList());
+
+                        historyDetail.setCurrentDateDetails(sizeDetails);
+                        return historyDetail;
+                    }).collect(Collectors.toList());
+
+            // 如果匹配不到明细,也添加默认空记录
+            if (rollHistoryDetails.isEmpty()) {
+                RollSendDetailsPageVO.RollHistoryDetail emptyDetail = new RollSendDetailsPageVO.RollHistoryDetail();
+                emptyDetail.setCurrentDate(dateKeyT);
+                emptyDetail.setCurrentDateAmount(0);
+                emptyDetail.setCurrentDateWeight(BigDecimal.ZERO.setScale(4, BigDecimal.ROUND_HALF_UP));
+                emptyDetail.setShift(billet.getShift());
+                emptyDetail.setShiftGroup(billet.getShiftGroup());
+                emptyDetail.setCurrentDateDetails(Collections.emptyList());
+                rollHistoryDetails.add(emptyDetail);
+            }
+
+            allHistoryDetails.addAll(rollHistoryDetails);
+        }
+
+
+        allHistoryDetails.sort(Comparator.comparing(
+                d -> LocalDate.parse(d.getCurrentDate(), formatter), Comparator.reverseOrder()));
+
+        int pageNo = queryDTO.getPageNo() != null ? queryDTO.getPageNo() : 1;
+        int pageSize = queryDTO.getPageSize() != null ? queryDTO.getPageSize() : 10;
+        int total = allHistoryDetails.size();
+        int start = Math.min((pageNo - 1) * pageSize, total);
+        int end = Math.min(start + pageSize, total);
+
+        Page<RollSendDetailsPageVO.RollHistoryDetail> page = new Page<>(pageNo, pageSize, total);
+        page.setRecords(allHistoryDetails.subList(start, end));
+
+        rollSendDetailsVO.setRollHistoryDetails(page);
+        return rollSendDetailsVO;
+    }
+
+
     /**
      * 从Redis中获取班组班别
      *

+ 135 - 128
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollClubThree/controller/RollClubThreeDetailsController.java

@@ -14,6 +14,7 @@ import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.modules.billet.rollClubThree.entity.RollClubThreeDetails;
 import org.jeecg.modules.billet.rollClubThree.service.IRollClubThreeDetailsService;
 import org.jeecg.modules.billet.storageBill.dto.RollDetailQueryDTO;
+import org.jeecg.modules.billet.storageBill.vo.RollChargeDetailsPageVO;
 import org.jeecg.modules.billet.storageBill.vo.RollChargeDetailsVO;
 import org.jeecg.modules.billet.storageBill.vo.RollOnDutyDataVo;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -24,125 +25,125 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.util.Arrays;
 
- /**
+/**
  * @Description: 棒三明细信息
  * @Author: jeecg-boot
- * @Date:   2024-11-20
+ * @Date: 2024-11-20
  * @Version: V1.0
  */
-@Api(tags="棒三明细信息")
+@Api(tags = "棒三明细信息")
 @RestController
 @RequestMapping("/rollClubThreeDetails")
 @Slf4j
 public class RollClubThreeDetailsController extends JeecgController<RollClubThreeDetails, IRollClubThreeDetailsService> {
-	@Autowired
-	private IRollClubThreeDetailsService rollClubThreeDetailsService;
-	
-	/**
-	 * 分页列表查询
-	 *
-	 * @param rollClubThreeDetails
-	 * @param pageNo
-	 * @param pageSize
-	 * @param req
-	 * @return
-	 */
-	//@AutoLog(value = "棒三明细信息-分页列表查询")
-	@ApiOperation(value="棒三明细信息-分页列表查询", notes="棒三明细信息-分页列表查询")
-	@GetMapping(value = "/list")
-	public Result<IPage<RollClubThreeDetails>> queryPageList(RollClubThreeDetails rollClubThreeDetails,
-								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
-								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
-								   HttpServletRequest req) {
-		QueryWrapper<RollClubThreeDetails> queryWrapper = QueryGenerator.initQueryWrapper(rollClubThreeDetails, req.getParameterMap());
-		Page<RollClubThreeDetails> page = new Page<RollClubThreeDetails>(pageNo, pageSize);
-		IPage<RollClubThreeDetails> pageList = rollClubThreeDetailsService.page(page, queryWrapper);
-		return Result.OK(pageList);
-	}
-	
-	/**
-	 *   添加
-	 *
-	 * @param rollClubThreeDetails
-	 * @return
-	 */
-	@AutoLog(value = "棒三明细信息-添加")
-	@ApiOperation(value="棒三明细信息-添加", notes="棒三明细信息-添加")
-	@RequiresPermissions("rollClubThreeDetails:roll_club_three_details:add")
-	@PostMapping(value = "/add")
-	public Result<String> add(@RequestBody RollClubThreeDetails rollClubThreeDetails) {
-		rollClubThreeDetailsService.save(rollClubThreeDetails);
-		return Result.OK("添加成功!");
-	}
-	
-	/**
-	 *  编辑
-	 *
-	 * @param rollClubThreeDetails
-	 * @return
-	 */
-	@AutoLog(value = "棒三明细信息-编辑")
-	@ApiOperation(value="棒三明细信息-编辑", notes="棒三明细信息-编辑")
-	@RequiresPermissions("rollClubThreeDetails:roll_club_three_details:edit")
-	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
-	public Result<String> edit(@RequestBody RollClubThreeDetails rollClubThreeDetails) {
-		rollClubThreeDetailsService.updateById(rollClubThreeDetails);
-		return Result.OK("编辑成功!");
-	}
-	
-	/**
-	 *   通过id删除
-	 *
-	 * @param id
-	 * @return
-	 */
-	@AutoLog(value = "棒三明细信息-通过id删除")
-	@ApiOperation(value="棒三明细信息-通过id删除", notes="棒三明细信息-通过id删除")
-	@RequiresPermissions("rollClubThreeDetails:roll_club_three_details:delete")
-	@DeleteMapping(value = "/delete")
-	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
-		rollClubThreeDetailsService.removeById(id);
-		return Result.OK("删除成功!");
-	}
-	
-	/**
-	 *  批量删除
-	 *
-	 * @param ids
-	 * @return
-	 */
-	@AutoLog(value = "棒三明细信息-批量删除")
-	@ApiOperation(value="棒三明细信息-批量删除", notes="棒三明细信息-批量删除")
-	@RequiresPermissions("rollClubThreeDetails:roll_club_three_details:deleteBatch")
-	@DeleteMapping(value = "/deleteBatch")
-	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
-		this.rollClubThreeDetailsService.removeByIds(Arrays.asList(ids.split(",")));
-		return Result.OK("批量删除成功!");
-	}
-	
-	/**
-	 * 通过id查询
-	 *
-	 * @param id
-	 * @return
-	 */
-	//@AutoLog(value = "棒三明细信息-通过id查询")
-	@ApiOperation(value="棒三明细信息-通过id查询", notes="棒三明细信息-通过id查询")
-	@GetMapping(value = "/queryById")
-	public Result<RollClubThreeDetails> queryById(@RequestParam(name="id",required=true) String id) {
-		RollClubThreeDetails rollClubThreeDetails = rollClubThreeDetailsService.getById(id);
-		if(rollClubThreeDetails==null) {
-			return Result.error("未找到对应数据");
-		}
-		return Result.OK(rollClubThreeDetails);
-	}
+    @Autowired
+    private IRollClubThreeDetailsService rollClubThreeDetailsService;
 
     /**
-    * 导出excel
-    *
-    * @param request
-    * @param rollClubThreeDetails
-    */
+     * 分页列表查询
+     *
+     * @param rollClubThreeDetails
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    //@AutoLog(value = "棒三明细信息-分页列表查询")
+    @ApiOperation(value = "棒三明细信息-分页列表查询", notes = "棒三明细信息-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<RollClubThreeDetails>> queryPageList(RollClubThreeDetails rollClubThreeDetails,
+                                                             @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                             @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                             HttpServletRequest req) {
+        QueryWrapper<RollClubThreeDetails> queryWrapper = QueryGenerator.initQueryWrapper(rollClubThreeDetails, req.getParameterMap());
+        Page<RollClubThreeDetails> page = new Page<RollClubThreeDetails>(pageNo, pageSize);
+        IPage<RollClubThreeDetails> pageList = rollClubThreeDetailsService.page(page, queryWrapper);
+        return Result.OK(pageList);
+    }
+
+    /**
+     * 添加
+     *
+     * @param rollClubThreeDetails
+     * @return
+     */
+    @AutoLog(value = "棒三明细信息-添加")
+    @ApiOperation(value = "棒三明细信息-添加", notes = "棒三明细信息-添加")
+    @RequiresPermissions("rollClubThreeDetails:roll_club_three_details:add")
+    @PostMapping(value = "/add")
+    public Result<String> add(@RequestBody RollClubThreeDetails rollClubThreeDetails) {
+        rollClubThreeDetailsService.save(rollClubThreeDetails);
+        return Result.OK("添加成功!");
+    }
+
+    /**
+     * 编辑
+     *
+     * @param rollClubThreeDetails
+     * @return
+     */
+    @AutoLog(value = "棒三明细信息-编辑")
+    @ApiOperation(value = "棒三明细信息-编辑", notes = "棒三明细信息-编辑")
+    @RequiresPermissions("rollClubThreeDetails:roll_club_three_details:edit")
+    @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
+    public Result<String> edit(@RequestBody RollClubThreeDetails rollClubThreeDetails) {
+        rollClubThreeDetailsService.updateById(rollClubThreeDetails);
+        return Result.OK("编辑成功!");
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "棒三明细信息-通过id删除")
+    @ApiOperation(value = "棒三明细信息-通过id删除", notes = "棒三明细信息-通过id删除")
+    @RequiresPermissions("rollClubThreeDetails:roll_club_three_details:delete")
+    @DeleteMapping(value = "/delete")
+    public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
+        rollClubThreeDetailsService.removeById(id);
+        return Result.OK("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "棒三明细信息-批量删除")
+    @ApiOperation(value = "棒三明细信息-批量删除", notes = "棒三明细信息-批量删除")
+    @RequiresPermissions("rollClubThreeDetails:roll_club_three_details:deleteBatch")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        this.rollClubThreeDetailsService.removeByIds(Arrays.asList(ids.split(",")));
+        return Result.OK("批量删除成功!");
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    //@AutoLog(value = "棒三明细信息-通过id查询")
+    @ApiOperation(value = "棒三明细信息-通过id查询", notes = "棒三明细信息-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<RollClubThreeDetails> queryById(@RequestParam(name = "id", required = true) String id) {
+        RollClubThreeDetails rollClubThreeDetails = rollClubThreeDetailsService.getById(id);
+        if (rollClubThreeDetails == null) {
+            return Result.error("未找到对应数据");
+        }
+        return Result.OK(rollClubThreeDetails);
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param rollClubThreeDetails
+     */
     @RequiresPermissions("rollClubThreeDetails:roll_club_three_details:exportXls")
     @RequestMapping(value = "/exportXls")
     public ModelAndView exportXls(HttpServletRequest request, RollClubThreeDetails rollClubThreeDetails) {
@@ -150,12 +151,12 @@ public class RollClubThreeDetailsController extends JeecgController<RollClubThre
     }
 
     /**
-      * 通过excel导入数据
-    *
-    * @param request
-    * @param response
-    * @return
-    */
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
     @RequiresPermissions("rollClubThreeDetails:roll_club_three_details:importExcel")
     @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
     public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
@@ -163,25 +164,31 @@ public class RollClubThreeDetailsController extends JeecgController<RollClubThre
     }
 
 
-	 @ApiOperation(value = "轧钢棒三工作台信息", notes = "轧钢棒三工作台信息")
-	 @GetMapping(value = "/rollClubThreeWorkbenches")
-	 public Result<RollOnDutyDataVo> rollClubThreeWorkbenches(@RequestParam(name = "ccmNo") String ccmNo,
-															  @RequestParam(name="currentDate", required = false) String currentDate) {
+    @ApiOperation(value = "轧钢棒三工作台信息", notes = "轧钢棒三工作台信息")
+    @GetMapping(value = "/rollClubThreeWorkbenches")
+    public Result<RollOnDutyDataVo> rollClubThreeWorkbenches(RollDetailQueryDTO queryDTO) {
 
-		 RollOnDutyDataVo rollOnDutyVo = rollClubThreeDetailsService.queryOnDutyRecord(ccmNo,currentDate);
-		 return Result.OK(rollOnDutyVo);
-	 }
+        RollOnDutyDataVo rollOnDutyVo = rollClubThreeDetailsService.queryOnDutyRecord(queryDTO);
+        return Result.OK(rollOnDutyVo);
+    }
 
 
-	 @ApiOperation(value = "轧钢棒三工作台总接收明细信息", notes = "轧钢棒三工作台总接收明细信息")
-	 @GetMapping(value = "/rollClubThreeWorkbenchesDetail")
-	 public Result<RollChargeDetailsVO> rollClubThreeWorkbenchesDetail(RollDetailQueryDTO queryDTO) {
+    @ApiOperation(value = "轧钢棒三工作台总接收明细信息", notes = "轧钢棒三工作台总接收明细信息")
+    @GetMapping(value = "/rollClubThreeWorkbenchesDetail")
+    public Result<RollChargeDetailsVO> rollClubThreeWorkbenchesDetail(RollDetailQueryDTO queryDTO) {
 
-		 RollChargeDetailsVO rollChargeDetailsVO = rollClubThreeDetailsService.queryWorkbenchesDetail(queryDTO);
-		 return Result.OK(rollChargeDetailsVO);
-	 }
+        RollChargeDetailsVO rollChargeDetailsVO = rollClubThreeDetailsService.queryWorkbenchesDetail(queryDTO);
+        return Result.OK(rollChargeDetailsVO);
+    }
 
 
+    @ApiOperation(value = "轧钢棒三工作台根据班次天次查询总接收明细信息", notes = "轧钢棒三工作台根据班次天次查询总接收明细信息")
+    @GetMapping(value = "/rollClubThreeWorkbenchesQuery")
+    public Result<RollChargeDetailsPageVO> rollClubThreeWorkbenchesQuery(RollDetailQueryDTO queryDTO) {
+
+        RollChargeDetailsPageVO rollChargeDetailsVO = rollClubThreeDetailsService.rollClubThreeWorkbenchesQuery(queryDTO);
+        return Result.OK(rollChargeDetailsVO);
+    }
 
 
 }

+ 4 - 1
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollClubThree/service/IRollClubThreeDetailsService.java

@@ -4,6 +4,7 @@ package org.jeecg.modules.billet.rollClubThree.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.modules.billet.rollClubThree.entity.RollClubThreeDetails;
 import org.jeecg.modules.billet.storageBill.dto.RollDetailQueryDTO;
+import org.jeecg.modules.billet.storageBill.vo.RollChargeDetailsPageVO;
 import org.jeecg.modules.billet.storageBill.vo.RollChargeDetailsVO;
 import org.jeecg.modules.billet.storageBill.vo.RollOnDutyDataVo;
 import org.jeecg.modules.billet.storageBill.vo.RollOnDutyRecordVo;
@@ -16,8 +17,10 @@ import org.jeecg.modules.billet.storageBill.vo.RollOnDutyRecordVo;
  */
 public interface IRollClubThreeDetailsService extends IService<RollClubThreeDetails> {
 
-    RollOnDutyDataVo queryOnDutyRecord(String ccmNo,String currentDate);
+    RollOnDutyDataVo queryOnDutyRecord(RollDetailQueryDTO queryDTO);
 
     RollChargeDetailsVO queryWorkbenchesDetail(RollDetailQueryDTO queryDTO);
 
+    RollChargeDetailsPageVO rollClubThreeWorkbenchesQuery(RollDetailQueryDTO queryDTO);
+
 }

+ 210 - 14
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollClubThree/service/impl/RollClubThreeDetailsServiceImpl.java

@@ -2,8 +2,11 @@ package org.jeecg.modules.billet.rollClubThree.service.impl;
 
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang.StringUtils;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.billet.billetHotsendChangeShift.entity.BilletHotsendChangeShift;
@@ -11,6 +14,7 @@ import org.jeecg.modules.billet.billetHotsendChangeShift.service.IBilletHotsendC
 import org.jeecg.modules.billet.rollClubThree.entity.RollClubThreeDetails;
 import org.jeecg.modules.billet.rollClubThree.mapper.RollClubThreeDetailsMapper;
 import org.jeecg.modules.billet.rollClubThree.service.IRollClubThreeDetailsService;
+import org.jeecg.modules.billet.rollClubTwo.entity.RollClubTwoDetails;
 import org.jeecg.modules.billet.storageBill.dto.RollDetailQueryDTO;
 import org.jeecg.modules.billet.storageBill.entity.StorageBill;
 import org.jeecg.modules.billet.storageBill.mapper.StorageBillMapper;
@@ -21,6 +25,7 @@ import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
 import java.time.LocalDate;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
@@ -29,7 +34,7 @@ import java.util.stream.Collectors;
 /**
  * @Description: 棒三明细信息
  * @Author: jeecg-boot
- * @Date:   2024-11-20
+ * @Date: 2024-11-20
  * @Version: V1.0
  */
 
@@ -48,18 +53,23 @@ public class RollClubThreeDetailsServiceImpl extends ServiceImpl<RollClubThreeDe
     private StorageBillMapper storageBillMapper;
 
     @Override
-    public RollOnDutyDataVo queryOnDutyRecord(String ccmNo,String currentDate) {
+    public RollOnDutyDataVo queryOnDutyRecord(RollDetailQueryDTO queryDTO) {
         RollOnDutyDataVo rollOnDutyVo = new RollOnDutyDataVo();
 
-        // 1. 从 Redis 获取班次信息
-        String shiftGroup = getShiftInfo(ccmNo, "class:shift:group:%s");
-        String shift = getShiftInfo(ccmNo, "class:shift:%s");
+        // 1. 获取班次信息(优先使用 queryDTO 中的值,否则从 Redis 获取)
+        String shiftGroup = StringUtils.isNotBlank(queryDTO.getShiftGroup())
+                ? queryDTO.getShiftGroup()
+                : getShiftInfo(queryDTO.getCcmNo(), "class:shift:group:%s");
+
+        String shift = StringUtils.isNotBlank(queryDTO.getShift())
+                ? queryDTO.getShift()
+                : getShiftInfo(queryDTO.getCcmNo(), "class:shift:%s");
 
         rollOnDutyVo.setShiftGroup(shiftGroup);
         rollOnDutyVo.setShift(shift);
         // 2. 获取交班记录
         LambdaQueryWrapper<BilletHotsendChangeShift> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(BilletHotsendChangeShift::getCcmNo, ccmNo)
+        queryWrapper.eq(BilletHotsendChangeShift::getCcmNo, queryDTO.getCcmNo())
                 .eq(BilletHotsendChangeShift::getShift, shift)
                 .eq(BilletHotsendChangeShift::getShiftGroup, shiftGroup)
                 .orderByDesc(BilletHotsendChangeShift::getCreateTime)
@@ -67,26 +77,30 @@ public class RollClubThreeDetailsServiceImpl extends ServiceImpl<RollClubThreeDe
 
         BilletHotsendChangeShift billetHotsendChangeShift = billetHotsendChangeShiftService.getOne(queryWrapper);
         if (billetHotsendChangeShift == null) {
-            log.info("{}{}", "查询当班装运单信息失败,交班记录为空!", ccmNo + "失败时间:" + new Date());
+            log.info("{}{}", "查询当班装运单信息失败,交班记录为空!", queryDTO.getCcmNo() + "失败时间:" + new Date());
             return rollOnDutyVo;
         }
 
         // 3. 查询当班装运单信息
         LambdaQueryWrapper<StorageBill> billQueryWrapper = new LambdaQueryWrapper<>();
 
-        billQueryWrapper.eq(StorageBill::getCcmNo, ccmNo)
+        billQueryWrapper.eq(StorageBill::getCcmNo, queryDTO.getCcmNo())
                 .eq(StorageBill::getDestination, "棒三")
+                .eq(StorageBill::getShift, shift)
+                .eq(StorageBill::getShiftGroup, shiftGroup)
                 .gt(StorageBill::getAmountTotal, 0);
 
-        if (oConvertUtils.isEmpty(currentDate)) {
+        if (oConvertUtils.isEmpty(queryDTO.getCurrentDate())) {
             billQueryWrapper.between(StorageBill::getCreateTime, billetHotsendChangeShift.getCreateTime(), new Date());
         } else {
-            billQueryWrapper.between(StorageBill::getCreateTime, DateUtils.getStartOfDay(currentDate), DateUtils.getEndOfDay(currentDate));
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+            String dateStr = sdf.format(queryDTO.getCurrentDate());
+            billQueryWrapper.between(StorageBill::getCreateTime, DateUtils.getStartOfDay(dateStr), DateUtils.getEndOfDay(dateStr));
         }
 
         List<StorageBill> storageBillList = storageBillMapper.selectList(billQueryWrapper);
         if (oConvertUtils.listIsEmpty(storageBillList)) {
-            log.info("{}{}", "查询当班装运单信息为空!", ccmNo);
+            log.info("{}{}", "查询当班装运单信息为空!", queryDTO.getCcmNo());
         }
 
         // 4. 查询棒三明细数据
@@ -95,7 +109,9 @@ public class RollClubThreeDetailsServiceImpl extends ServiceImpl<RollClubThreeDe
 
         if (!billIds.isEmpty()) {
             LambdaQueryWrapper<RollClubThreeDetails> rollClubQuery = new LambdaQueryWrapper<>();
-            rollClubQuery.eq(RollClubThreeDetails::getCcmNo, ccmNo)
+            rollClubQuery.eq(RollClubThreeDetails::getCcmNo, queryDTO.getCcmNo())
+                    .eq(RollClubThreeDetails::getShift, shift)
+                    .eq(RollClubThreeDetails::getShiftGroup, shiftGroup)
                     .in(RollClubThreeDetails::getStorageBillId, billIds);
             rollClubThreeDetailsList = baseMapper.selectList(rollClubQuery);
         }
@@ -118,7 +134,7 @@ public class RollClubThreeDetailsServiceImpl extends ServiceImpl<RollClubThreeDe
 
         // 6. 查询 Info 数据
         LambdaQueryWrapper<RollClubThreeDetails> infoQueryWrapper = new LambdaQueryWrapper<>();
-        infoQueryWrapper.eq(RollClubThreeDetails::getCcmNo, ccmNo)
+        infoQueryWrapper.eq(RollClubThreeDetails::getCcmNo, queryDTO.getCcmNo())
                 .eq(RollClubThreeDetails::getShift, shift)
                 .eq(RollClubThreeDetails::getShiftGroup, shiftGroup)
                 .between(RollClubThreeDetails::getCreateTime, billetHotsendChangeShift.getCreateTime(), new Date());
@@ -151,6 +167,13 @@ public class RollClubThreeDetailsServiceImpl extends ServiceImpl<RollClubThreeDe
                 .eq(StorageBill::getDestination, "棒三")
                 .gt(StorageBill::getAmountTotal, 0);
 
+        if (StringUtils.isNotBlank(queryDTO.getShiftGroup())) {
+            billQueryWrapper.eq(StorageBill::getShiftGroup, queryDTO.getShiftGroup());
+        }
+        if (StringUtils.isNotBlank(queryDTO.getShift())) {
+            billQueryWrapper.eq(StorageBill::getShift, queryDTO.getShift());
+        }
+
 
         Date beginDate = queryDTO.getBeginCreateDate();
         Date endDate = queryDTO.getEndCreateDate();
@@ -175,7 +198,7 @@ public class RollClubThreeDetailsServiceImpl extends ServiceImpl<RollClubThreeDe
         List<StorageBill> storageBillList = storageBillMapper.selectList(billQueryWrapper);
 
         if (oConvertUtils.listIsEmpty(storageBillList)) {
-            return  rollChargeDetailsVO;
+            return rollChargeDetailsVO;
         }
 
         List<String> billIds = storageBillList.stream().map(StorageBill::getId).collect(Collectors.toList());
@@ -276,6 +299,179 @@ public class RollClubThreeDetailsServiceImpl extends ServiceImpl<RollClubThreeDe
         return rollChargeDetailsVO;
     }
 
+    @Override
+    public RollChargeDetailsPageVO rollClubThreeWorkbenchesQuery(RollDetailQueryDTO queryDTO) {
+
+        RollChargeDetailsPageVO rollChargeDetailsVO = new RollChargeDetailsPageVO();
+
+        if (queryDTO == null) {
+            return rollChargeDetailsVO;
+        }
+
+        // Step 1: 查询换班数据
+        LambdaQueryWrapper<BilletHotsendChangeShift> changeShiftQueryWrapper = new LambdaQueryWrapper<>();
+        if (StringUtils.isNotBlank(queryDTO.getCcmNo())) {
+            changeShiftQueryWrapper.eq(BilletHotsendChangeShift::getCcmNo, queryDTO.getCcmNo());
+        }
+        if (StringUtils.isNotBlank(queryDTO.getShiftGroup())) {
+            changeShiftQueryWrapper.eq(BilletHotsendChangeShift::getShiftGroup, queryDTO.getShiftGroup());
+        }
+        if (StringUtils.isNotBlank(queryDTO.getShift())) {
+            changeShiftQueryWrapper.eq(BilletHotsendChangeShift::getShift, queryDTO.getShift());
+        }
+        Date beginDate = queryDTO.getBeginCreateDate();
+        Date endDate = queryDTO.getEndCreateDate();
+        if (beginDate != null) {
+            changeShiftQueryWrapper.ge(BilletHotsendChangeShift::getCreateTime, DateUtils.getStartOfDayByDate(beginDate));
+        }
+        if (endDate != null) {
+            changeShiftQueryWrapper.le(BilletHotsendChangeShift::getCreateTime, DateUtils.getEndOfDayByDate(endDate));
+        }
+
+        List<BilletHotsendChangeShift> changeShiftList = billetHotsendChangeShiftService.list(changeShiftQueryWrapper);
+        if (CollectionUtils.isEmpty(changeShiftList)) {
+            return rollChargeDetailsVO;
+        }
+
+        // Step 2: 提前查询所有 StorageBill
+        LambdaQueryWrapper<StorageBill> billQueryWrapper = new LambdaQueryWrapper<>();
+        billQueryWrapper.eq(StorageBill::getDestination, "棒三")
+                .gt(StorageBill::getAmountTotal, 0);
+
+        if (StringUtils.isNotBlank(queryDTO.getCcmNo())) {
+            billQueryWrapper.eq(StorageBill::getCcmNo, queryDTO.getCcmNo());
+        }
+        if (beginDate != null) {
+            billQueryWrapper.ge(StorageBill::getCreateTime, DateUtils.getStartOfDayByDate(beginDate));
+        }
+        if (endDate != null) {
+            billQueryWrapper.le(StorageBill::getCreateTime, DateUtils.getEndOfDayByDate(endDate));
+        }
+
+        List<StorageBill> allBills = storageBillMapper.selectList(billQueryWrapper);
+
+        // 构建 storageBillMap key: ccmNo|shiftGroup|shift
+        Map<String, List<StorageBill>> groupedBills = allBills.stream()
+                .collect(Collectors.groupingBy(b -> b.getCcmNo() + "|" + b.getShiftGroup() + "|" + b.getShift()));
+
+        // Step 3: 提前查询所有涉及的 RollClubTwoDetails
+        List<String> allBillIds = allBills.stream().map(StorageBill::getId).collect(Collectors.toList());
+        List<RollClubThreeDetails> allDetails = Collections.emptyList();
+        if (!allBillIds.isEmpty()) {
+            LambdaQueryWrapper<RollClubThreeDetails> detailQueryWrapper = new LambdaQueryWrapper<>();
+            detailQueryWrapper.in(RollClubThreeDetails::getStorageBillId, allBillIds);
+            allDetails = baseMapper.selectList(detailQueryWrapper);
+        }
+
+        // 按 storageBillId 分组
+        Map<String, List<RollClubThreeDetails>> billDetailMap = allDetails.stream()
+                .collect(Collectors.groupingBy(RollClubThreeDetails::getStorageBillId));
+
+        // Step 4: 聚合数据
+        Map<String, RollChargeDetailsPageVO.RollHistoryDetail> mergedDetailMap = new HashMap<>();
+        for (BilletHotsendChangeShift shift : changeShiftList) {
+            String keyDate = DateUtils.formatDate(shift.getCreateTime());
+            String mapKey = keyDate + "|" + shift.getShiftGroup() + "|" + shift.getShift();
+            String billKey = shift.getCcmNo() + "|" + shift.getShiftGroup() + "|" + shift.getShift();
+
+            List<StorageBill> relatedBills = groupedBills.getOrDefault(billKey, Collections.emptyList());
+            List<String> billIds = relatedBills.stream()
+                    .filter(b -> {
+                        Date ct = b.getCreateTime();
+                        return ct != null &&
+                                !ct.before(shift.getCreateTime()) &&
+                                !ct.after(Optional.ofNullable(shift.getChangeShiftTime()).orElse(new Date()));
+                    })
+                    .map(StorageBill::getId)
+                    .collect(Collectors.toList());
+
+            List<RollClubThreeDetails> rollDetails = billIds.stream()
+                    .flatMap(id -> billDetailMap.getOrDefault(id, Collections.emptyList()).stream())
+                    .collect(Collectors.toList());
+
+            RollChargeDetailsPageVO.RollHistoryDetail detail = mergedDetailMap.getOrDefault(mapKey, new RollChargeDetailsPageVO.RollHistoryDetail());
+            detail.setCurrentDate(keyDate);
+            detail.setShift(shift.getShift());
+            detail.setShiftGroup(shift.getShiftGroup());
+
+            if (detail.getCarNum() == null) {
+                detail.setCarNum((int) billIds.stream().filter(Objects::nonNull).collect(Collectors.toSet()).size());
+            }
+
+            if (CollectionUtils.isEmpty(rollDetails)) {
+                detail.setCurrentDateAmount(Optional.ofNullable(detail.getCurrentDateAmount()).orElse(0));
+                detail.setCurrentDateWeight(Optional.ofNullable(detail.getCurrentDateWeight()).orElse(BigDecimal.ZERO.setScale(4, BigDecimal.ROUND_HALF_UP)));
+                detail.setCurrentDateDetails(Optional.ofNullable(detail.getCurrentDateDetails()).orElse(new ArrayList<>()));
+                mergedDetailMap.put(mapKey, detail);
+                continue;
+            }
+
+            // 累加支数
+            int count = rollDetails.stream().mapToInt(d -> (d.getStackAddr() == null || d.getStackAddr().isEmpty()) ? 1 : 4).sum();
+            detail.setCurrentDateAmount(Optional.ofNullable(detail.getCurrentDateAmount()).orElse(0) + count);
+
+            // 累加出坯量
+            BigDecimal blankOutput = rollDetails.stream()
+                    .map(d -> BigDecimal.valueOf(d.getBlankOutput()))
+                    .reduce(BigDecimal.ZERO, BigDecimal::add)
+                    .setScale(4, BigDecimal.ROUND_HALF_UP);
+            detail.setCurrentDateWeight(Optional.ofNullable(detail.getCurrentDateWeight()).orElse(BigDecimal.ZERO).add(blankOutput));
+
+            // 明细分组
+            Map<String, RollChargeDetailsPageVO.CurrentDateDetail> sizeMap = Optional.ofNullable(detail.getCurrentDateDetails())
+                    .orElse(new ArrayList<>())
+                    .stream().collect(Collectors.toMap(
+                            RollChargeDetailsPageVO.CurrentDateDetail::getSize,
+                            d -> d,
+                            (d1, d2) -> d1
+                    ));
+
+            Map<String, List<RollClubThreeDetails>> sizeGroup = rollDetails.stream().collect(Collectors.groupingBy(RollClubThreeDetails::getSize));
+            for (Map.Entry<String, List<RollClubThreeDetails>> entry : sizeGroup.entrySet()) {
+                String size = entry.getKey();
+                List<RollClubThreeDetails> list = entry.getValue();
+
+                int sizeCount = list.stream().mapToInt(d -> (d.getStackAddr() == null || d.getStackAddr().isEmpty()) ? 1 : 4).sum();
+                BigDecimal sizeWeight = list.stream()
+                        .map(d -> BigDecimal.valueOf(d.getBlankOutput()))
+                        .reduce(BigDecimal.ZERO, BigDecimal::add)
+                        .setScale(4, BigDecimal.ROUND_HALF_UP);
+
+                RollChargeDetailsPageVO.CurrentDateDetail sizeDetail = sizeMap.getOrDefault(size, new RollChargeDetailsPageVO.CurrentDateDetail());
+                sizeDetail.setSize(size);
+                sizeDetail.setAmount(Optional.ofNullable(sizeDetail.getAmount()).orElse(0) + sizeCount);
+                sizeDetail.setBlankOutput(Optional.ofNullable(sizeDetail.getBlankOutput()).orElse(BigDecimal.ZERO).add(sizeWeight));
+
+                sizeMap.put(size, sizeDetail);
+            }
+
+            detail.setCurrentDateDetails(new ArrayList<>(sizeMap.values()));
+            mergedDetailMap.put(mapKey, detail);
+        }
+
+        // Step 5: 排序与分页
+        List<RollChargeDetailsPageVO.RollHistoryDetail> rollAllDetails = new ArrayList<>(mergedDetailMap.values());
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+        rollAllDetails.sort(Comparator.comparing(
+                d -> LocalDate.parse(d.getCurrentDate(), formatter),
+                Comparator.reverseOrder()
+        ));
+
+        // 设置默认值,如果 queryDTO.getPageNo() 为 null,则默认值为 1;如果 queryDTO.getPageSize() 为 null,则默认值为 10
+        int pageNo = (queryDTO.getPageNo() != null) ? queryDTO.getPageNo() : 1;
+        int pageSize = (queryDTO.getPageSize() != null) ? queryDTO.getPageSize() : 10;
+
+        int startIndex = (pageNo - 1) * pageSize;
+        int endIndex = Math.min(startIndex + pageSize, rollAllDetails.size());
+        List<RollChargeDetailsPageVO.RollHistoryDetail> pagedList = rollAllDetails.subList(startIndex, endIndex);
+
+        Page<RollChargeDetailsPageVO.RollHistoryDetail> page = new Page<>(pageNo, pageSize, rollAllDetails.size());
+        page.setRecords(pagedList);
+        rollChargeDetailsVO.setRollHistoryDetails(page);
+
+        return rollChargeDetailsVO;
+    }
+
 
     /**
      * 从Redis中获取班组班别

+ 12 - 3
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollClubTwo/controller/RollClubTwoDetailsController.java

@@ -14,8 +14,10 @@ import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.modules.billet.rollClubTwo.entity.RollClubTwoDetails;
 import org.jeecg.modules.billet.rollClubTwo.service.IRollClubTwoDetailsService;
 import org.jeecg.modules.billet.storageBill.dto.RollDetailQueryDTO;
+import org.jeecg.modules.billet.storageBill.vo.RollChargeDetailsPageVO;
 import org.jeecg.modules.billet.storageBill.vo.RollChargeDetailsVO;
 import org.jeecg.modules.billet.storageBill.vo.RollOnDutyDataVo;
+import org.jeecg.modules.billet.storageBill.vo.RollSendDetailsVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
@@ -165,10 +167,9 @@ public class RollClubTwoDetailsController extends JeecgController<RollClubTwoDet
 
     @ApiOperation(value = "轧钢棒二工作台信息", notes = "轧钢棒二工作台信息")
     @GetMapping(value = "/rollClubTwoWorkbenches")
-    public Result<RollOnDutyDataVo> rollClubTwoWorkbenches(@RequestParam(name = "ccmNo") String ccmNo,
-                                                           @RequestParam(name="currentDate", required = false) String currentDate) {
+    public Result<RollOnDutyDataVo> rollClubTwoWorkbenches(RollDetailQueryDTO queryDTO) {
 
-        RollOnDutyDataVo rollOnDutyVo = rollClubTwoDetailsService.queryOnDutyRecord(ccmNo,currentDate);
+        RollOnDutyDataVo rollOnDutyVo = rollClubTwoDetailsService.queryOnDutyRecord(queryDTO);
         return Result.OK(rollOnDutyVo);
     }
 
@@ -181,4 +182,12 @@ public class RollClubTwoDetailsController extends JeecgController<RollClubTwoDet
         return Result.OK(rollChargeDetailsVO);
     }
 
+    @ApiOperation(value = "轧钢棒二工作台根据班次天次查询总接收明细信息", notes = "轧钢棒二工作台根据班次天次查询总接收明细信息")
+    @GetMapping(value = "/rollClubTwoWorkbenchesQuery")
+    public Result<RollChargeDetailsPageVO> rollClubTwoWorkbenchesQuery(RollDetailQueryDTO queryDTO) {
+
+        RollChargeDetailsPageVO rollChargeDetailsVO = rollClubTwoDetailsService.rollClubTwoWorkbenchesQuery(queryDTO);
+        return Result.OK(rollChargeDetailsVO);
+    }
+
 }

+ 4 - 1
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollClubTwo/service/IRollClubTwoDetailsService.java

@@ -3,6 +3,7 @@ package org.jeecg.modules.billet.rollClubTwo.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.modules.billet.rollClubTwo.entity.RollClubTwoDetails;
 import org.jeecg.modules.billet.storageBill.dto.RollDetailQueryDTO;
+import org.jeecg.modules.billet.storageBill.vo.RollChargeDetailsPageVO;
 import org.jeecg.modules.billet.storageBill.vo.RollChargeDetailsVO;
 import org.jeecg.modules.billet.storageBill.vo.RollOnDutyDataVo;
 
@@ -14,8 +15,10 @@ import org.jeecg.modules.billet.storageBill.vo.RollOnDutyDataVo;
  */
 public interface IRollClubTwoDetailsService extends IService<RollClubTwoDetails> {
 
-    RollOnDutyDataVo queryOnDutyRecord(String ccmNo,String currentDate);
+    RollOnDutyDataVo queryOnDutyRecord(RollDetailQueryDTO queryDTO);
 
     RollChargeDetailsVO queryWorkbenchesDetail(RollDetailQueryDTO queryDTO);
 
+    RollChargeDetailsPageVO rollClubTwoWorkbenchesQuery(RollDetailQueryDTO queryDTO);
+
 }

+ 212 - 13
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollClubTwo/service/impl/RollClubTwoDetailsServiceImpl.java

@@ -2,8 +2,11 @@ package org.jeecg.modules.billet.rollClubTwo.service.impl;
 
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang.StringUtils;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.billet.billetHotsendChangeShift.entity.BilletHotsendChangeShift;
@@ -21,9 +24,12 @@ import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
 import java.time.LocalDate;
+import java.time.ZoneId;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
+import java.util.function.Function;
 import java.util.stream.Collectors;
 
 /**
@@ -47,18 +53,23 @@ public class RollClubTwoDetailsServiceImpl extends ServiceImpl<RollClubTwoDetail
     private StorageBillMapper storageBillMapper;
 
     @Override
-    public RollOnDutyDataVo queryOnDutyRecord(String ccmNo,String currentDate) {
+    public RollOnDutyDataVo queryOnDutyRecord(RollDetailQueryDTO queryDTO) {
         RollOnDutyDataVo rollOnDutyVo = new RollOnDutyDataVo();
 
-        // 1. 从 Redis 获取班次信息
-        String shiftGroup = getShiftInfo(ccmNo, "class:shift:group:%s");
-        String shift = getShiftInfo(ccmNo, "class:shift:%s");
+        // 1. 获取班次信息(优先使用 queryDTO 中的值,否则从 Redis 获取)
+        String shiftGroup = StringUtils.isNotBlank(queryDTO.getShiftGroup())
+                ? queryDTO.getShiftGroup()
+                : getShiftInfo(queryDTO.getCcmNo(), "class:shift:group:%s");
+
+        String shift = StringUtils.isNotBlank(queryDTO.getShift())
+                ? queryDTO.getShift()
+                : getShiftInfo(queryDTO.getCcmNo(), "class:shift:%s");
 
         rollOnDutyVo.setShiftGroup(shiftGroup);
         rollOnDutyVo.setShift(shift);
         // 2. 获取交班记录
         LambdaQueryWrapper<BilletHotsendChangeShift> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(BilletHotsendChangeShift::getCcmNo, ccmNo)
+        queryWrapper.eq(BilletHotsendChangeShift::getCcmNo, queryDTO.getCcmNo())
                 .eq(BilletHotsendChangeShift::getShift, shift)
                 .eq(BilletHotsendChangeShift::getShiftGroup, shiftGroup)
                 .orderByDesc(BilletHotsendChangeShift::getCreateTime)
@@ -66,26 +77,30 @@ public class RollClubTwoDetailsServiceImpl extends ServiceImpl<RollClubTwoDetail
 
         BilletHotsendChangeShift billetHotsendChangeShift = billetHotsendChangeShiftService.getOne(queryWrapper);
         if (billetHotsendChangeShift == null) {
-            log.info("{}{}", "查询当班装运单信息失败,交班记录为空!", ccmNo + "失败时间:" + new Date());
+            log.info("{}{}", "查询当班装运单信息失败,交班记录为空!", queryDTO.getCcmNo() + "失败时间:" + new Date());
             return rollOnDutyVo;
         }
 
         // 3. 查询当班装运单信息
         LambdaQueryWrapper<StorageBill> billQueryWrapper = new LambdaQueryWrapper<>();
 
-        billQueryWrapper.eq(StorageBill::getCcmNo, ccmNo)
+        billQueryWrapper.eq(StorageBill::getCcmNo, queryDTO.getCcmNo())
                 .eq(StorageBill::getDestination, "棒二")
+                .eq(StorageBill::getShift,shift)
+                .eq(StorageBill::getShiftGroup, shiftGroup)
                 .gt(StorageBill::getAmountTotal, 0);
 
-        if (oConvertUtils.isEmpty(currentDate)) {
+        if (oConvertUtils.isEmpty(queryDTO.getCurrentDate())) {
             billQueryWrapper.between(StorageBill::getCreateTime, billetHotsendChangeShift.getCreateTime(), new Date());
         } else {
-            billQueryWrapper.between(StorageBill::getCreateTime, DateUtils.getStartOfDay(currentDate), DateUtils.getEndOfDay(currentDate));
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+            String dateStr = sdf.format(queryDTO.getCurrentDate());
+            billQueryWrapper.between(StorageBill::getCreateTime, DateUtils.getStartOfDay(dateStr), DateUtils.getEndOfDay(dateStr));
         }
 
         List<StorageBill> storageBillList = storageBillMapper.selectList(billQueryWrapper);
         if (oConvertUtils.listIsEmpty(storageBillList)) {
-            log.info("{}{}", "查询当班装运单信息为空!", ccmNo);
+            log.info("{}{}", "查询当班装运单信息为空!", queryDTO.getCcmNo());
         }
 
         // 4. 查询棒二明细数据
@@ -94,7 +109,9 @@ public class RollClubTwoDetailsServiceImpl extends ServiceImpl<RollClubTwoDetail
 
         if (!billIds.isEmpty()) {
             LambdaQueryWrapper<RollClubTwoDetails> rollClubQuery = new LambdaQueryWrapper<>();
-            rollClubQuery.eq(RollClubTwoDetails::getCcmNo, ccmNo)
+            rollClubQuery.eq(RollClubTwoDetails::getCcmNo, queryDTO.getCcmNo())
+                    .eq(RollClubTwoDetails::getShift, shift)
+                    .eq(RollClubTwoDetails::getShiftGroup, shiftGroup)
                     .in(RollClubTwoDetails::getStorageBillId, billIds);
             rollClubTwoDetailsList = baseMapper.selectList(rollClubQuery);
         }
@@ -117,7 +134,7 @@ public class RollClubTwoDetailsServiceImpl extends ServiceImpl<RollClubTwoDetail
 
         // 6. 查询 Info 数据
         LambdaQueryWrapper<RollClubTwoDetails> infoQueryWrapper = new LambdaQueryWrapper<>();
-        infoQueryWrapper.eq(RollClubTwoDetails::getCcmNo, ccmNo)
+        infoQueryWrapper.eq(RollClubTwoDetails::getCcmNo, queryDTO.getCcmNo())
                 .eq(RollClubTwoDetails::getShift, shift)
                 .eq(RollClubTwoDetails::getShiftGroup, shiftGroup)
                 .between(RollClubTwoDetails::getCreateTime, billetHotsendChangeShift.getCreateTime(), new Date());
@@ -148,6 +165,13 @@ public class RollClubTwoDetailsServiceImpl extends ServiceImpl<RollClubTwoDetail
                 .eq(StorageBill::getDestination, "棒二")
                 .gt(StorageBill::getAmountTotal, 0);
 
+        if (StringUtils.isNotBlank(queryDTO.getShiftGroup())) {
+            billQueryWrapper.eq(StorageBill::getShiftGroup, queryDTO.getShiftGroup());
+        }
+        if (StringUtils.isNotBlank(queryDTO.getShift())) {
+            billQueryWrapper.eq(StorageBill::getShift, queryDTO.getShift());
+        }
+
 
         Date beginDate = queryDTO.getBeginCreateDate();
         Date endDate = queryDTO.getEndCreateDate();
@@ -172,7 +196,7 @@ public class RollClubTwoDetailsServiceImpl extends ServiceImpl<RollClubTwoDetail
         List<StorageBill> storageBillList = storageBillMapper.selectList(billQueryWrapper);
 
         if (oConvertUtils.listIsEmpty(storageBillList)) {
-           return  rollChargeDetailsVO;
+            return rollChargeDetailsVO;
         }
 
         // 4. 查询棒二明细数据
@@ -276,6 +300,181 @@ public class RollClubTwoDetailsServiceImpl extends ServiceImpl<RollClubTwoDetail
     }
 
 
+    @Override
+    public RollChargeDetailsPageVO rollClubTwoWorkbenchesQuery(RollDetailQueryDTO queryDTO) {
+        RollChargeDetailsPageVO rollChargeDetailsVO = new RollChargeDetailsPageVO();
+
+        if (queryDTO == null) {
+            return rollChargeDetailsVO;
+        }
+
+        // Step 1: 查询换班数据
+        LambdaQueryWrapper<BilletHotsendChangeShift> changeShiftQueryWrapper = new LambdaQueryWrapper<>();
+        if (StringUtils.isNotBlank(queryDTO.getCcmNo())) {
+            changeShiftQueryWrapper.eq(BilletHotsendChangeShift::getCcmNo, queryDTO.getCcmNo());
+        }
+        if (StringUtils.isNotBlank(queryDTO.getShiftGroup())) {
+            changeShiftQueryWrapper.eq(BilletHotsendChangeShift::getShiftGroup, queryDTO.getShiftGroup());
+        }
+        if (StringUtils.isNotBlank(queryDTO.getShift())) {
+            changeShiftQueryWrapper.eq(BilletHotsendChangeShift::getShift, queryDTO.getShift());
+        }
+        Date beginDate = queryDTO.getBeginCreateDate();
+        Date endDate = queryDTO.getEndCreateDate();
+        if (beginDate != null) {
+            changeShiftQueryWrapper.ge(BilletHotsendChangeShift::getCreateTime, DateUtils.getStartOfDayByDate(beginDate));
+        }
+        if (endDate != null) {
+            changeShiftQueryWrapper.le(BilletHotsendChangeShift::getCreateTime, DateUtils.getEndOfDayByDate(endDate));
+        }
+
+        List<BilletHotsendChangeShift> changeShiftList = billetHotsendChangeShiftService.list(changeShiftQueryWrapper);
+        if (CollectionUtils.isEmpty(changeShiftList)) {
+            return rollChargeDetailsVO;
+        }
+
+        // Step 2: 提前查询所有 StorageBill
+        LambdaQueryWrapper<StorageBill> billQueryWrapper = new LambdaQueryWrapper<>();
+        billQueryWrapper.eq(StorageBill::getDestination, "棒二")
+                .gt(StorageBill::getAmountTotal, 0);
+
+        if (StringUtils.isNotBlank(queryDTO.getCcmNo())) {
+            billQueryWrapper.eq(StorageBill::getCcmNo, queryDTO.getCcmNo());
+        }
+        if (beginDate != null) {
+            billQueryWrapper.ge(StorageBill::getCreateTime, DateUtils.getStartOfDayByDate(beginDate));
+        }
+        if (endDate != null) {
+            billQueryWrapper.le(StorageBill::getCreateTime, DateUtils.getEndOfDayByDate(endDate));
+        }
+
+        List<StorageBill> allBills = storageBillMapper.selectList(billQueryWrapper);
+
+        // 构建 storageBillMap key: ccmNo|shiftGroup|shift
+        Map<String, List<StorageBill>> groupedBills = allBills.stream()
+                .collect(Collectors.groupingBy(b -> b.getCcmNo() + "|" + b.getShiftGroup() + "|" + b.getShift()));
+
+        // Step 3: 提前查询所有涉及的 RollClubTwoDetails
+        List<String> allBillIds = allBills.stream().map(StorageBill::getId).collect(Collectors.toList());
+        List<RollClubTwoDetails> allDetails = Collections.emptyList();
+        if (!allBillIds.isEmpty()) {
+            LambdaQueryWrapper<RollClubTwoDetails> detailQueryWrapper = new LambdaQueryWrapper<>();
+            detailQueryWrapper.in(RollClubTwoDetails::getStorageBillId, allBillIds);
+            allDetails = baseMapper.selectList(detailQueryWrapper);
+        }
+
+        // 按 storageBillId 分组
+        Map<String, List<RollClubTwoDetails>> billDetailMap = allDetails.stream()
+                .collect(Collectors.groupingBy(RollClubTwoDetails::getStorageBillId));
+
+        // Step 4: 聚合数据
+        Map<String, RollChargeDetailsPageVO.RollHistoryDetail> mergedDetailMap = new HashMap<>();
+        for (BilletHotsendChangeShift shift : changeShiftList) {
+            String keyDate = DateUtils.formatDate(shift.getCreateTime());
+            String mapKey = keyDate + "|" + shift.getShiftGroup() + "|" + shift.getShift();
+            String billKey = shift.getCcmNo() + "|" + shift.getShiftGroup() + "|" + shift.getShift();
+
+            List<StorageBill> relatedBills = groupedBills.getOrDefault(billKey, Collections.emptyList());
+            List<String> billIds = relatedBills.stream()
+                    .filter(b -> {
+                        Date ct = b.getCreateTime();
+                        return ct != null &&
+                                !ct.before(shift.getCreateTime()) &&
+                                !ct.after(Optional.ofNullable(shift.getChangeShiftTime()).orElse(new Date()));
+                    })
+                    .map(StorageBill::getId)
+                    .collect(Collectors.toList());
+
+            List<RollClubTwoDetails> rollDetails = billIds.stream()
+                    .flatMap(id -> billDetailMap.getOrDefault(id, Collections.emptyList()).stream())
+                    .collect(Collectors.toList());
+
+            RollChargeDetailsPageVO.RollHistoryDetail detail = mergedDetailMap.getOrDefault(mapKey, new RollChargeDetailsPageVO.RollHistoryDetail());
+            detail.setCurrentDate(keyDate);
+            detail.setShift(shift.getShift());
+            detail.setShiftGroup(shift.getShiftGroup());
+
+            if (detail.getCarNum() == null) {
+                detail.setCarNum((int) billIds.stream().filter(Objects::nonNull).collect(Collectors.toSet()).size());
+            }
+
+            if (CollectionUtils.isEmpty(rollDetails)) {
+                detail.setCurrentDateAmount(Optional.ofNullable(detail.getCurrentDateAmount()).orElse(0));
+                detail.setCurrentDateWeight(Optional.ofNullable(detail.getCurrentDateWeight()).orElse(BigDecimal.ZERO.setScale(4, BigDecimal.ROUND_HALF_UP)));
+                detail.setCurrentDateDetails(Optional.ofNullable(detail.getCurrentDateDetails()).orElse(new ArrayList<>()));
+                mergedDetailMap.put(mapKey, detail);
+                continue;
+            }
+
+            // 累加支数
+            int count = rollDetails.stream().mapToInt(d -> (d.getStackAddr() == null || d.getStackAddr().isEmpty()) ? 1 : 4).sum();
+            detail.setCurrentDateAmount(Optional.ofNullable(detail.getCurrentDateAmount()).orElse(0) + count);
+
+            // 累加出坯量
+            BigDecimal blankOutput = rollDetails.stream()
+                    .map(d -> BigDecimal.valueOf(d.getBlankOutput()))
+                    .reduce(BigDecimal.ZERO, BigDecimal::add)
+                    .setScale(4, BigDecimal.ROUND_HALF_UP);
+            detail.setCurrentDateWeight(Optional.ofNullable(detail.getCurrentDateWeight()).orElse(BigDecimal.ZERO).add(blankOutput));
+
+            // 明细分组
+            Map<String, RollChargeDetailsPageVO.CurrentDateDetail> sizeMap = Optional.ofNullable(detail.getCurrentDateDetails())
+                    .orElse(new ArrayList<>())
+                    .stream().collect(Collectors.toMap(
+                            RollChargeDetailsPageVO.CurrentDateDetail::getSize,
+                            d -> d,
+                            (d1, d2) -> d1
+                    ));
+
+            Map<String, List<RollClubTwoDetails>> sizeGroup = rollDetails.stream().collect(Collectors.groupingBy(RollClubTwoDetails::getSize));
+            for (Map.Entry<String, List<RollClubTwoDetails>> entry : sizeGroup.entrySet()) {
+                String size = entry.getKey();
+                List<RollClubTwoDetails> list = entry.getValue();
+
+                int sizeCount = list.stream().mapToInt(d -> (d.getStackAddr() == null || d.getStackAddr().isEmpty()) ? 1 : 4).sum();
+                BigDecimal sizeWeight = list.stream()
+                        .map(d -> BigDecimal.valueOf(d.getBlankOutput()))
+                        .reduce(BigDecimal.ZERO, BigDecimal::add)
+                        .setScale(4, BigDecimal.ROUND_HALF_UP);
+
+                RollChargeDetailsPageVO.CurrentDateDetail sizeDetail = sizeMap.getOrDefault(size, new RollChargeDetailsPageVO.CurrentDateDetail());
+                sizeDetail.setSize(size);
+                sizeDetail.setAmount(Optional.ofNullable(sizeDetail.getAmount()).orElse(0) + sizeCount);
+                sizeDetail.setBlankOutput(Optional.ofNullable(sizeDetail.getBlankOutput()).orElse(BigDecimal.ZERO).add(sizeWeight));
+
+                sizeMap.put(size, sizeDetail);
+            }
+
+            detail.setCurrentDateDetails(new ArrayList<>(sizeMap.values()));
+            mergedDetailMap.put(mapKey, detail);
+        }
+
+        // Step 5: 排序与分页
+        List<RollChargeDetailsPageVO.RollHistoryDetail> rollAllDetails = new ArrayList<>(mergedDetailMap.values());
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+        rollAllDetails.sort(Comparator.comparing(
+                d -> LocalDate.parse(d.getCurrentDate(), formatter),
+                Comparator.reverseOrder()
+        ));
+
+        // 设置默认值,如果 queryDTO.getPageNo() 为 null,则默认值为 1;如果 queryDTO.getPageSize() 为 null,则默认值为 10
+        int pageNo = (queryDTO.getPageNo() != null) ? queryDTO.getPageNo() : 1;
+        int pageSize = (queryDTO.getPageSize() != null) ? queryDTO.getPageSize() : 10;
+
+        int startIndex = (pageNo - 1) * pageSize;
+        int endIndex = Math.min(startIndex + pageSize, rollAllDetails.size());
+        List<RollChargeDetailsPageVO.RollHistoryDetail> pagedList = rollAllDetails.subList(startIndex, endIndex);
+
+        Page<RollChargeDetailsPageVO.RollHistoryDetail> page = new Page<>(pageNo, pageSize, rollAllDetails.size());
+        page.setRecords(pagedList);
+        rollChargeDetailsVO.setRollHistoryDetails(page);
+
+        return rollChargeDetailsVO;
+    }
+
+
+
+
     /**
      * 从Redis中获取班组班别
      *

+ 194 - 185
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollHeight/controller/RollHeightDetailsController.java

@@ -16,6 +16,7 @@ import org.jeecg.modules.billet.rollHeight.entity.RollHeightDetails;
 import org.jeecg.modules.billet.rollHeight.service.IRollHeightDetailsService;
 import org.jeecg.modules.billet.storageBill.dto.RollDetailQueryDTO;
 import org.jeecg.modules.billet.storageBill.vo.RollOnDutyDataVo;
+import org.jeecg.modules.billet.storageBill.vo.RollSendDetailsPageVO;
 import org.jeecg.modules.billet.storageBill.vo.RollSendDetailsVO;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -31,122 +32,122 @@ import java.util.List;
 /**
  * @Description: 高线明细信息
  * @Author: jeecg-boot
- * @Date:   2024-11-20
+ * @Date: 2024-11-20
  * @Version: V1.0
  */
-@Api(tags="高线明细信息")
+@Api(tags = "高线明细信息")
 @RestController
 @RequestMapping("/rollHeightDetails")
 @Slf4j
 public class RollHeightDetailsController extends JeecgController<RollHeightDetails, IRollHeightDetailsService> {
-	@Autowired
-	private IRollHeightDetailsService rollHeightDetailsService;
-	
-	/**
-	 * 分页列表查询
-	 *
-	 * @param rollHeightDetails
-	 * @param pageNo
-	 * @param pageSize
-	 * @param req
-	 * @return
-	 */
-	//@AutoLog(value = "高线明细信息-分页列表查询")
-	@ApiOperation(value="高线明细信息-分页列表查询", notes="高线明细信息-分页列表查询")
-	@GetMapping(value = "/list")
-	public Result<IPage<RollHeightDetails>> queryPageList(RollHeightDetails rollHeightDetails,
-								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
-								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
-								   HttpServletRequest req) {
-		QueryWrapper<RollHeightDetails> queryWrapper = QueryGenerator.initQueryWrapper(rollHeightDetails, req.getParameterMap());
-		Page<RollHeightDetails> page = new Page<RollHeightDetails>(pageNo, pageSize);
-		IPage<RollHeightDetails> pageList = rollHeightDetailsService.page(page, queryWrapper);
-		return Result.OK(pageList);
-	}
-	
-	/**
-	 *   添加
-	 *
-	 * @param rollHeightDetails
-	 * @return
-	 */
-	@AutoLog(value = "高线明细信息-添加")
-	@ApiOperation(value="高线明细信息-添加", notes="高线明细信息-添加")
-	@RequiresPermissions("rollHeightDetails:roll_height_details:add")
-	@PostMapping(value = "/add")
-	public Result<String> add(@RequestBody RollHeightDetails rollHeightDetails) {
-		rollHeightDetailsService.save(rollHeightDetails);
-		return Result.OK("添加成功!");
-	}
-	
-	/**
-	 *  编辑
-	 *
-	 * @param rollHeightDetails
-	 * @return
-	 */
-	@AutoLog(value = "高线明细信息-编辑")
-	@ApiOperation(value="高线明细信息-编辑", notes="高线明细信息-编辑")
-	@RequiresPermissions("rollHeightDetails:roll_height_details:edit")
-	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
-	public Result<String> edit(@RequestBody RollHeightDetails rollHeightDetails) {
-		rollHeightDetailsService.updateById(rollHeightDetails);
-		return Result.OK("编辑成功!");
-	}
-	
-	/**
-	 *   通过id删除
-	 *
-	 * @param id
-	 * @return
-	 */
-	@AutoLog(value = "高线明细信息-通过id删除")
-	@ApiOperation(value="高线明细信息-通过id删除", notes="高线明细信息-通过id删除")
-	@RequiresPermissions("rollHeightDetails:roll_height_details:delete")
-	@DeleteMapping(value = "/delete")
-	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
-		rollHeightDetailsService.removeById(id);
-		return Result.OK("删除成功!");
-	}
-	
-	/**
-	 *  批量删除
-	 *
-	 * @param ids
-	 * @return
-	 */
-	@AutoLog(value = "高线明细信息-批量删除")
-	@ApiOperation(value="高线明细信息-批量删除", notes="高线明细信息-批量删除")
-	@RequiresPermissions("rollHeightDetails:roll_height_details:deleteBatch")
-	@DeleteMapping(value = "/deleteBatch")
-	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
-		this.rollHeightDetailsService.removeByIds(Arrays.asList(ids.split(",")));
-		return Result.OK("批量删除成功!");
-	}
-	
-	/**
-	 * 通过id查询
-	 *
-	 * @param id
-	 * @return
-	 */
-	//@AutoLog(value = "高线明细信息-通过id查询")
-	@ApiOperation(value="高线明细信息-通过id查询", notes="高线明细信息-通过id查询")
-	@GetMapping(value = "/queryById")
-	public Result<RollHeightDetails> queryById(@RequestParam(name="id",required=true) String id) {
-		RollHeightDetails rollHeightDetails = rollHeightDetailsService.getById(id);
-		if(rollHeightDetails==null) {
-			return Result.error("未找到对应数据");
-		}
-		return Result.OK(rollHeightDetails);
-	}
+    @Autowired
+    private IRollHeightDetailsService rollHeightDetailsService;
 
     /**
-    * 导出excel
-    *
-    * @param request
-    * @param rollHeightDetails
-    */
+     * 分页列表查询
+     *
+     * @param rollHeightDetails
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    //@AutoLog(value = "高线明细信息-分页列表查询")
+    @ApiOperation(value = "高线明细信息-分页列表查询", notes = "高线明细信息-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<RollHeightDetails>> queryPageList(RollHeightDetails rollHeightDetails,
+                                                          @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                          @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                          HttpServletRequest req) {
+        QueryWrapper<RollHeightDetails> queryWrapper = QueryGenerator.initQueryWrapper(rollHeightDetails, req.getParameterMap());
+        Page<RollHeightDetails> page = new Page<RollHeightDetails>(pageNo, pageSize);
+        IPage<RollHeightDetails> pageList = rollHeightDetailsService.page(page, queryWrapper);
+        return Result.OK(pageList);
+    }
+
+    /**
+     * 添加
+     *
+     * @param rollHeightDetails
+     * @return
+     */
+    @AutoLog(value = "高线明细信息-添加")
+    @ApiOperation(value = "高线明细信息-添加", notes = "高线明细信息-添加")
+    @RequiresPermissions("rollHeightDetails:roll_height_details:add")
+    @PostMapping(value = "/add")
+    public Result<String> add(@RequestBody RollHeightDetails rollHeightDetails) {
+        rollHeightDetailsService.save(rollHeightDetails);
+        return Result.OK("添加成功!");
+    }
+
+    /**
+     * 编辑
+     *
+     * @param rollHeightDetails
+     * @return
+     */
+    @AutoLog(value = "高线明细信息-编辑")
+    @ApiOperation(value = "高线明细信息-编辑", notes = "高线明细信息-编辑")
+    @RequiresPermissions("rollHeightDetails:roll_height_details:edit")
+    @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
+    public Result<String> edit(@RequestBody RollHeightDetails rollHeightDetails) {
+        rollHeightDetailsService.updateById(rollHeightDetails);
+        return Result.OK("编辑成功!");
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "高线明细信息-通过id删除")
+    @ApiOperation(value = "高线明细信息-通过id删除", notes = "高线明细信息-通过id删除")
+    @RequiresPermissions("rollHeightDetails:roll_height_details:delete")
+    @DeleteMapping(value = "/delete")
+    public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
+        rollHeightDetailsService.removeById(id);
+        return Result.OK("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "高线明细信息-批量删除")
+    @ApiOperation(value = "高线明细信息-批量删除", notes = "高线明细信息-批量删除")
+    @RequiresPermissions("rollHeightDetails:roll_height_details:deleteBatch")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        this.rollHeightDetailsService.removeByIds(Arrays.asList(ids.split(",")));
+        return Result.OK("批量删除成功!");
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    //@AutoLog(value = "高线明细信息-通过id查询")
+    @ApiOperation(value = "高线明细信息-通过id查询", notes = "高线明细信息-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<RollHeightDetails> queryById(@RequestParam(name = "id", required = true) String id) {
+        RollHeightDetails rollHeightDetails = rollHeightDetailsService.getById(id);
+        if (rollHeightDetails == null) {
+            return Result.error("未找到对应数据");
+        }
+        return Result.OK(rollHeightDetails);
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param rollHeightDetails
+     */
     @RequiresPermissions("rollHeightDetails:roll_height_details:exportXls")
     @RequestMapping(value = "/exportXls")
     public ModelAndView exportXls(HttpServletRequest request, RollHeightDetails rollHeightDetails) {
@@ -154,12 +155,12 @@ public class RollHeightDetailsController extends JeecgController<RollHeightDetai
     }
 
     /**
-      * 通过excel导入数据
-    *
-    * @param request
-    * @param response
-    * @return
-    */
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
     @RequiresPermissions("rollHeightDetails:roll_height_details:importExcel")
     @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
     public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
@@ -167,75 +168,83 @@ public class RollHeightDetailsController extends JeecgController<RollHeightDetai
     }
 
 
-	@ApiOperation(value = "高线热送单信息-分页列表查询", notes = "高线热送单信息-分页列表查询")
-	@GetMapping(value = "/hotSendRollHeightList")
-	public Result<IPage<HotSendRollHeightDetails>> queryHotSendPageList(RollHeightDetails rollHeightDetails,
-																		@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-																		@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-																		HttpServletRequest req) {
-		QueryWrapper<RollHeightDetails> queryWrapper = QueryGenerator.initQueryWrapper(rollHeightDetails, req.getParameterMap());
-
-		queryWrapper.isNotNull("heat_no");
-		// 添加分组条件
-		queryWrapper.groupBy("heat_no");
-
-		// 如果需要统计每组的 hotsendSum 总和,可以添加聚合函数
-		queryWrapper.select("MAX(id) AS id", "GROUP_CONCAT( DISTINCT ccm_no ) AS ccmNo",
-				"GROUP_CONCAT( DISTINCT shift_group ) AS shiftGroup", "GROUP_CONCAT( DISTINCT shift ) AS shift",
-				"heat_no", "GROUP_CONCAT( DISTINCT steel ) AS steel", "MAX(start_num) AS startNum",
-				"MAX(end_num) AS endNum", "GROUP_CONCAT( DISTINCT spec ) AS spec",
-				"MAX(blank_output) AS blankOutput", "GROUP_CONCAT( DISTINCT size ) AS size",
-				"GROUP_CONCAT( DISTINCT license_plate ) AS licensePlate",
-				"GROUP_CONCAT( DISTINCT assembly_number ) AS assemblyNumber",
-				"MAX(create_time) as createTime", "COUNT(*) as hotsendSum");
-		Page<RollHeightDetails> page = new Page<>(pageNo, pageSize);
-
-		IPage<RollHeightDetails> pageList = rollHeightDetailsService.page(page, queryWrapper);
-
-		List<HotSendRollHeightDetails> hotSendRollClubOneDetailsList = new ArrayList<>();
-
-		List<RollHeightDetails> records = pageList.getRecords();
-		records.forEach(x -> {
-			HotSendRollHeightDetails hotSendRollHeightDetails = new HotSendRollHeightDetails();
-			hotSendRollHeightDetails.setDestination("高线");
-			hotSendRollHeightDetails.setHotsendSum(x.getHotsendSum());
-			BeanUtils.copyProperties(x, hotSendRollHeightDetails);
-			hotSendRollClubOneDetailsList.add(hotSendRollHeightDetails);
-		});
-
-		// 创建一个新的分页对象,封装 hotSendRollClubOneDetailsList
-		Page<HotSendRollHeightDetails> hotSendPage = new Page<>(pageNo, pageSize, pageList.getTotal());
-		hotSendPage.setRecords(hotSendRollClubOneDetailsList);
-
-		return Result.OK(hotSendPage);
-	}
-
-
-	@ApiOperation(value="高线热送单明细查询", notes="高线热送单明细查询")
-	@GetMapping(value = "/hotSendRollHeightDetailList")
-	public Result<List<RollHeightDetails>> queryHotSendDetailList(@RequestParam(name="ccmNo") String ccmNo, @RequestParam(name="heatNo") String heatNo) {
-		// 根据铸机号、炉号查询棒一明细,返回List<RollHeightDetails>
-		QueryWrapper<RollHeightDetails> queryWrapper = new QueryWrapper<>();
-		queryWrapper.eq("ccm_no", ccmNo);
-		queryWrapper.eq("heat_no", heatNo);
-		queryWrapper.orderByDesc("create_time");
-		List<RollHeightDetails> rollHeightDetailsList = rollHeightDetailsService.list(queryWrapper);
-		return Result.OK(rollHeightDetailsList);
-	}
-
-	@ApiOperation(value = "轧钢高线工作台信息", notes = "轧钢高线工作台信息")
-	@GetMapping(value = "/rollHeightWorkbenches")
-	public Result<RollOnDutyDataVo> rollHeightWorkbenches(@RequestParam(name = "ccmNo") String ccmNo) {
-
-		RollOnDutyDataVo rollOnDutyVo = rollHeightDetailsService.queryOnDutyRecord(ccmNo);
-		return Result.OK(rollOnDutyVo);
-	}
-
-	@ApiOperation(value = "轧钢高线工作台总接收明细信息", notes = "轧钢高线工作台总接收明细信息")
-	@GetMapping(value = "/rollHeightWorkbenchesDetail")
-	public Result<RollSendDetailsVO> rollHeightWorkbenchesDetail(RollDetailQueryDTO queryDTO) {
-
-		RollSendDetailsVO rollSendDetailsVO = rollHeightDetailsService.queryWorkbenchesDetail(queryDTO);
-		return Result.OK(rollSendDetailsVO);
-	}
+    @ApiOperation(value = "高线热送单信息-分页列表查询", notes = "高线热送单信息-分页列表查询")
+    @GetMapping(value = "/hotSendRollHeightList")
+    public Result<IPage<HotSendRollHeightDetails>> queryHotSendPageList(RollHeightDetails rollHeightDetails,
+                                                                        @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                                        @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                                        HttpServletRequest req) {
+        QueryWrapper<RollHeightDetails> queryWrapper = QueryGenerator.initQueryWrapper(rollHeightDetails, req.getParameterMap());
+
+        queryWrapper.isNotNull("heat_no");
+        // 添加分组条件
+        queryWrapper.groupBy("heat_no");
+
+        // 如果需要统计每组的 hotsendSum 总和,可以添加聚合函数
+        queryWrapper.select("MAX(id) AS id", "GROUP_CONCAT( DISTINCT ccm_no ) AS ccmNo",
+                "GROUP_CONCAT( DISTINCT shift_group ) AS shiftGroup", "GROUP_CONCAT( DISTINCT shift ) AS shift",
+                "heat_no", "GROUP_CONCAT( DISTINCT steel ) AS steel", "MAX(start_num) AS startNum",
+                "MAX(end_num) AS endNum", "GROUP_CONCAT( DISTINCT spec ) AS spec",
+                "MAX(blank_output) AS blankOutput", "GROUP_CONCAT( DISTINCT size ) AS size",
+                "GROUP_CONCAT( DISTINCT license_plate ) AS licensePlate",
+                "GROUP_CONCAT( DISTINCT assembly_number ) AS assemblyNumber",
+                "MAX(create_time) as createTime", "COUNT(*) as hotsendSum");
+        Page<RollHeightDetails> page = new Page<>(pageNo, pageSize);
+
+        IPage<RollHeightDetails> pageList = rollHeightDetailsService.page(page, queryWrapper);
+
+        List<HotSendRollHeightDetails> hotSendRollClubOneDetailsList = new ArrayList<>();
+
+        List<RollHeightDetails> records = pageList.getRecords();
+        records.forEach(x -> {
+            HotSendRollHeightDetails hotSendRollHeightDetails = new HotSendRollHeightDetails();
+            hotSendRollHeightDetails.setDestination("高线");
+            hotSendRollHeightDetails.setHotsendSum(x.getHotsendSum());
+            BeanUtils.copyProperties(x, hotSendRollHeightDetails);
+            hotSendRollClubOneDetailsList.add(hotSendRollHeightDetails);
+        });
+
+        // 创建一个新的分页对象,封装 hotSendRollClubOneDetailsList
+        Page<HotSendRollHeightDetails> hotSendPage = new Page<>(pageNo, pageSize, pageList.getTotal());
+        hotSendPage.setRecords(hotSendRollClubOneDetailsList);
+
+        return Result.OK(hotSendPage);
+    }
+
+
+    @ApiOperation(value = "高线热送单明细查询", notes = "高线热送单明细查询")
+    @GetMapping(value = "/hotSendRollHeightDetailList")
+    public Result<List<RollHeightDetails>> queryHotSendDetailList(@RequestParam(name = "ccmNo") String ccmNo, @RequestParam(name = "heatNo") String heatNo) {
+        // 根据铸机号、炉号查询棒一明细,返回List<RollHeightDetails>
+        QueryWrapper<RollHeightDetails> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("ccm_no", ccmNo);
+        queryWrapper.eq("heat_no", heatNo);
+        queryWrapper.orderByDesc("create_time");
+        List<RollHeightDetails> rollHeightDetailsList = rollHeightDetailsService.list(queryWrapper);
+        return Result.OK(rollHeightDetailsList);
+    }
+
+    @ApiOperation(value = "轧钢高线工作台信息", notes = "轧钢高线工作台信息")
+    @GetMapping(value = "/rollHeightWorkbenches")
+    public Result<RollOnDutyDataVo> rollHeightWorkbenches(@RequestParam(name = "ccmNo") String ccmNo) {
+
+        RollOnDutyDataVo rollOnDutyVo = rollHeightDetailsService.queryOnDutyRecord(ccmNo);
+        return Result.OK(rollOnDutyVo);
+    }
+
+    @ApiOperation(value = "轧钢高线工作台总接收明细信息", notes = "轧钢高线工作台总接收明细信息")
+    @GetMapping(value = "/rollHeightWorkbenchesDetail")
+    public Result<RollSendDetailsVO> rollHeightWorkbenchesDetail(RollDetailQueryDTO queryDTO) {
+
+        RollSendDetailsVO rollSendDetailsVO = rollHeightDetailsService.queryWorkbenchesDetail(queryDTO);
+        return Result.OK(rollSendDetailsVO);
+    }
+
+    @ApiOperation(value = "轧钢高线工作台根据班次天次查询总接收明细信息", notes = "轧钢高线工作台根据班次天次查询总接收明细信息")
+    @GetMapping(value = "/rollHeightWorkbenchesQuery")
+    public Result<RollSendDetailsPageVO> rollHeightWorkbenchesQuery(RollDetailQueryDTO queryDTO) {
+
+        RollSendDetailsPageVO rollSendDetailsVO = rollHeightDetailsService.rollHeightWorkbenchesQuery(queryDTO);
+        return Result.OK(rollSendDetailsVO);
+    }
 }

+ 3 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollHeight/service/IRollHeightDetailsService.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.modules.billet.rollHeight.entity.RollHeightDetails;
 import org.jeecg.modules.billet.storageBill.dto.RollDetailQueryDTO;
 import org.jeecg.modules.billet.storageBill.vo.RollOnDutyDataVo;
+import org.jeecg.modules.billet.storageBill.vo.RollSendDetailsPageVO;
 import org.jeecg.modules.billet.storageBill.vo.RollSendDetailsVO;
 
 /**
@@ -18,4 +19,6 @@ public interface IRollHeightDetailsService extends IService<RollHeightDetails> {
 
     RollSendDetailsVO queryWorkbenchesDetail(RollDetailQueryDTO queryDTO);
 
+    RollSendDetailsPageVO rollHeightWorkbenchesQuery(RollDetailQueryDTO queryDTO);
+
 }

+ 154 - 3
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollHeight/service/impl/RollHeightDetailsServiceImpl.java

@@ -1,12 +1,16 @@
 package org.jeecg.modules.billet.rollHeight.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang.StringUtils;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.billet.billetHotsendChangeShift.entity.BilletHotsendChangeShift;
 import org.jeecg.modules.billet.billetHotsendChangeShift.service.IBilletHotsendChangeShiftService;
+import org.jeecg.modules.billet.rollClubOne.entity.RollClubOneDetails;
 import org.jeecg.modules.billet.rollHeight.entity.RollHeightDetails;
 import org.jeecg.modules.billet.rollHeight.mapper.RollHeightDetailsMapper;
 import org.jeecg.modules.billet.rollHeight.service.IRollHeightDetailsService;
@@ -14,6 +18,7 @@ import org.jeecg.modules.billet.storageBill.dto.RollDetailQueryDTO;
 import org.jeecg.modules.billet.storageBill.mapper.StorageBillMapper;
 import org.jeecg.modules.billet.storageBill.vo.RollOnDutyDataVo;
 import org.jeecg.modules.billet.storageBill.vo.RollOnDutyInfoVo;
+import org.jeecg.modules.billet.storageBill.vo.RollSendDetailsPageVO;
 import org.jeecg.modules.billet.storageBill.vo.RollSendDetailsVO;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,9 +28,7 @@ import org.springframework.stereotype.Service;
 import java.math.BigDecimal;
 import java.time.LocalDate;
 import java.time.format.DateTimeFormatter;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -201,6 +204,154 @@ public class RollHeightDetailsServiceImpl extends ServiceImpl<RollHeightDetailsM
         return rollSendDetailsVO;
     }
 
+    @Override
+    public RollSendDetailsPageVO rollHeightWorkbenchesQuery(RollDetailQueryDTO queryDTO) {
+
+        RollSendDetailsPageVO rollSendDetailsVO = new RollSendDetailsPageVO();
+
+        if (queryDTO == null) {
+            return rollSendDetailsVO;
+        }
+
+        LambdaQueryWrapper<BilletHotsendChangeShift> changeShiftQueryWrapper = new LambdaQueryWrapper<>();
+
+        if (StringUtils.isNotBlank(queryDTO.getCcmNo())) {
+            changeShiftQueryWrapper.eq(BilletHotsendChangeShift::getCcmNo, queryDTO.getCcmNo());
+        }
+        if (StringUtils.isNotBlank(queryDTO.getShiftGroup())) {
+            changeShiftQueryWrapper.eq(BilletHotsendChangeShift::getShiftGroup, queryDTO.getShiftGroup());
+        }
+        if (StringUtils.isNotBlank(queryDTO.getShift())) {
+            changeShiftQueryWrapper.eq(BilletHotsendChangeShift::getShift, queryDTO.getShift());
+        }
+
+        Date beginDate = queryDTO.getBeginCreateDate();
+        Date endDate = queryDTO.getEndCreateDate();
+        if (beginDate != null) {
+            changeShiftQueryWrapper.ge(BilletHotsendChangeShift::getCreateTime, DateUtils.getStartOfDayByDate(beginDate));
+        }
+        if (endDate != null) {
+            changeShiftQueryWrapper.le(BilletHotsendChangeShift::getCreateTime, DateUtils.getEndOfDayByDate(endDate));
+        }
+
+        List<BilletHotsendChangeShift> changeShiftList = billetHotsendChangeShiftService.list(changeShiftQueryWrapper);
+
+        if (CollectionUtils.isEmpty(changeShiftList)) {
+            return rollSendDetailsVO;
+        }
+
+        Set<String> ccmNos = changeShiftList.stream()
+                .map(BilletHotsendChangeShift::getCcmNo)
+                .filter(StringUtils::isNotBlank)
+                .collect(Collectors.toSet());
+
+        LambdaQueryWrapper<RollHeightDetails> rollDetailsWrapper = new LambdaQueryWrapper<>();
+        rollDetailsWrapper.in(RollHeightDetails::getCcmNo, ccmNos);
+        if (beginDate != null) {
+            rollDetailsWrapper.ge(RollHeightDetails::getCreateTime, DateUtils.getStartOfDayByDate(beginDate));
+        }
+        if (endDate != null) {
+            rollDetailsWrapper.le(RollHeightDetails::getCreateTime, DateUtils.getEndOfDayByDate(endDate));
+        }
+
+        List<RollHeightDetails> allDetails = baseMapper.selectList(rollDetailsWrapper);
+        Map<String, List<RollHeightDetails>> groupedDetails = allDetails.stream()
+                .collect(Collectors.groupingBy(d ->
+                        DateUtils.formatDate(d.getCreateTime()) + "_" +
+                                d.getCcmNo() + "_" +
+                                d.getShiftGroup() + "_" +
+                                d.getShift()
+                ));
+
+        List<RollSendDetailsPageVO.RollHistoryDetail> allHistoryDetails = new ArrayList<>();
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+
+        for (BilletHotsendChangeShift billet : changeShiftList) {
+
+            if (billet.getChangeShiftTime() == null) {
+                billet.setChangeShiftTime(new Date());
+            }
+
+            String dateKeyT = DateUtils.formatDate(billet.getCreateTime());
+            String key = dateKeyT + "_" + billet.getCcmNo() + "_" + billet.getShiftGroup() + "_" + billet.getShift();
+            List<RollHeightDetails> matchedDetails = groupedDetails.getOrDefault(key, Collections.emptyList());
+
+            List<RollSendDetailsPageVO.RollHistoryDetail> rollHistoryDetails = matchedDetails.stream()
+                    .filter(d -> {
+                        Date create = d.getCreateTime();
+                        return create != null &&
+                                (create.after(billet.getCreateTime()) || create.equals(billet.getCreateTime())) &&
+                                (create.before(billet.getChangeShiftTime()) || create.equals(billet.getChangeShiftTime()));
+                    })
+                    .collect(Collectors.groupingBy(detail -> DateUtils.formatDate(detail.getCreateTime())))
+                    .entrySet().stream()
+                    .map(entry -> {
+                        String dateKey = entry.getKey();
+                        List<RollHeightDetails> detailList = entry.getValue();
+
+                        int count = detailList.size();
+                        BigDecimal weight = detailList.stream()
+                                .map(d -> BigDecimal.valueOf(d.getBlankOutput()))
+                                .reduce(BigDecimal.ZERO, BigDecimal::add)
+                                .setScale(4, BigDecimal.ROUND_HALF_UP);
+
+                        RollSendDetailsPageVO.RollHistoryDetail historyDetail = new RollSendDetailsPageVO.RollHistoryDetail();
+                        historyDetail.setCurrentDate(dateKey);
+                        historyDetail.setCurrentDateAmount(count);
+                        historyDetail.setCurrentDateWeight(weight);
+                        historyDetail.setShift(billet.getShift());
+                        historyDetail.setShiftGroup(billet.getShiftGroup());
+
+                        List<RollSendDetailsPageVO.CurrentDateDetail> sizeDetails = detailList.stream()
+                                .collect(Collectors.groupingBy(RollHeightDetails::getSize))
+                                .entrySet().stream()
+                                .map(e -> {
+                                    RollSendDetailsPageVO.CurrentDateDetail detail = new RollSendDetailsPageVO.CurrentDateDetail();
+                                    detail.setSize(e.getKey());
+                                    detail.setAmount(e.getValue().size());
+                                    detail.setBlankOutput(e.getValue().stream()
+                                            .map(d -> BigDecimal.valueOf(d.getBlankOutput()))
+                                            .reduce(BigDecimal.ZERO, BigDecimal::add)
+                                            .setScale(4, BigDecimal.ROUND_HALF_UP));
+                                    return detail;
+                                }).collect(Collectors.toList());
+
+                        historyDetail.setCurrentDateDetails(sizeDetails);
+                        return historyDetail;
+                    }).collect(Collectors.toList());
+
+            // 如果匹配不到明细,也添加默认空记录
+            if (rollHistoryDetails.isEmpty()) {
+                RollSendDetailsPageVO.RollHistoryDetail emptyDetail = new RollSendDetailsPageVO.RollHistoryDetail();
+                emptyDetail.setCurrentDate(dateKeyT);
+                emptyDetail.setCurrentDateAmount(0);
+                emptyDetail.setCurrentDateWeight(BigDecimal.ZERO.setScale(4, BigDecimal.ROUND_HALF_UP));
+                emptyDetail.setShift(billet.getShift());
+                emptyDetail.setShiftGroup(billet.getShiftGroup());
+                emptyDetail.setCurrentDateDetails(Collections.emptyList());
+                rollHistoryDetails.add(emptyDetail);
+            }
+
+            allHistoryDetails.addAll(rollHistoryDetails);
+        }
+
+
+        allHistoryDetails.sort(Comparator.comparing(
+                d -> LocalDate.parse(d.getCurrentDate(), formatter), Comparator.reverseOrder()));
+
+        int pageNo = queryDTO.getPageNo() != null ? queryDTO.getPageNo() : 1;
+        int pageSize = queryDTO.getPageSize() != null ? queryDTO.getPageSize() : 10;
+        int total = allHistoryDetails.size();
+        int start = Math.min((pageNo - 1) * pageSize, total);
+        int end = Math.min(start + pageSize, total);
+
+        Page<RollSendDetailsPageVO.RollHistoryDetail> page = new Page<>(pageNo, pageSize, total);
+        page.setRecords(allHistoryDetails.subList(start, end));
+
+        rollSendDetailsVO.setRollHistoryDetails(page);
+        return rollSendDetailsVO;
+    }
+
 
     /**
      * 从Redis中获取班组班别

+ 12 - 3
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollOutShipp/controller/RollOutShippDetailsController.java

@@ -14,6 +14,7 @@ import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.modules.billet.rollOutShipp.entity.RollOutShippDetails;
 import org.jeecg.modules.billet.rollOutShipp.service.IRollOutShippDetailsService;
 import org.jeecg.modules.billet.storageBill.dto.RollDetailQueryDTO;
+import org.jeecg.modules.billet.storageBill.vo.RollChargeDetailsPageVO;
 import org.jeecg.modules.billet.storageBill.vo.RollChargeDetailsVO;
 import org.jeecg.modules.billet.storageBill.vo.RollOnDutyDataVo;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -164,10 +165,9 @@ public class RollOutShippDetailsController extends JeecgController<RollOutShippD
 
 	 @ApiOperation(value = "轧钢外运工作台信息", notes = "轧钢外运工作台信息")
 	 @GetMapping(value = "/rollOutShippWorkbenches")
-	 public Result<RollOnDutyDataVo> rollOutShippWorkbenches(@RequestParam(name = "ccmNo") String ccmNo,
-															 @RequestParam(name="currentDate", required = false) String currentDate) {
+	 public Result<RollOnDutyDataVo> rollOutShippWorkbenches(RollDetailQueryDTO queryDTO) {
 
-		 RollOnDutyDataVo rollOnDutyVo = rollOutShippDetailsService.queryOnDutyRecord(ccmNo,currentDate);
+		 RollOnDutyDataVo rollOnDutyVo = rollOutShippDetailsService.queryOnDutyRecord(queryDTO);
 		 return Result.OK(rollOnDutyVo);
 	 }
 
@@ -179,4 +179,13 @@ public class RollOutShippDetailsController extends JeecgController<RollOutShippD
 		 RollChargeDetailsVO rollChargeDetailsVO = rollOutShippDetailsService.queryWorkbenchesDetail(queryDTO);
 		 return Result.OK(rollChargeDetailsVO);
 	 }
+
+
+	 @ApiOperation(value = "轧钢外运工作台根据班次天次查询总接收明细信息", notes = "轧钢外运工作台根据班次天次查询总接收明细信息")
+	 @GetMapping(value = "/rollOutShippWorkbenchesQuery")
+	 public Result<RollChargeDetailsPageVO> rollOutShippWorkbenchesQuery(RollDetailQueryDTO queryDTO) {
+
+		 RollChargeDetailsPageVO rollChargeDetailsVO = rollOutShippDetailsService.rollOutShippWorkbenchesQuery(queryDTO);
+		 return Result.OK(rollChargeDetailsVO);
+	 }
 }

+ 4 - 1
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollOutShipp/service/IRollOutShippDetailsService.java

@@ -3,6 +3,7 @@ package org.jeecg.modules.billet.rollOutShipp.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.modules.billet.rollOutShipp.entity.RollOutShippDetails;
 import org.jeecg.modules.billet.storageBill.dto.RollDetailQueryDTO;
+import org.jeecg.modules.billet.storageBill.vo.RollChargeDetailsPageVO;
 import org.jeecg.modules.billet.storageBill.vo.RollChargeDetailsVO;
 import org.jeecg.modules.billet.storageBill.vo.RollOnDutyDataVo;
 
@@ -14,8 +15,10 @@ import org.jeecg.modules.billet.storageBill.vo.RollOnDutyDataVo;
  */
 public interface IRollOutShippDetailsService extends IService<RollOutShippDetails> {
 
-    RollOnDutyDataVo queryOnDutyRecord(String ccmNo,String currentDate);
+    RollOnDutyDataVo queryOnDutyRecord(RollDetailQueryDTO queryDTO);
 
     RollChargeDetailsVO queryWorkbenchesDetail(RollDetailQueryDTO queryDTO);
 
+    RollChargeDetailsPageVO rollOutShippWorkbenchesQuery(RollDetailQueryDTO queryDTO);
+
 }

+ 210 - 12
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollOutShipp/service/impl/RollOutShippDetailsServiceImpl.java

@@ -1,12 +1,17 @@
 package org.jeecg.modules.billet.rollOutShipp.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang.StringUtils;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.billet.billetHotsendChangeShift.entity.BilletHotsendChangeShift;
 import org.jeecg.modules.billet.billetHotsendChangeShift.service.IBilletHotsendChangeShiftService;
+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.rollOutShipp.mapper.RollOutShippDetailsMapper;
 import org.jeecg.modules.billet.rollOutShipp.service.IRollOutShippDetailsService;
@@ -20,6 +25,7 @@ import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
 import java.time.LocalDate;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
@@ -46,18 +52,23 @@ public class RollOutShippDetailsServiceImpl extends ServiceImpl<RollOutShippDeta
     private StorageBillMapper storageBillMapper;
 
     @Override
-    public RollOnDutyDataVo queryOnDutyRecord(String ccmNo,String currentDate) {
+    public RollOnDutyDataVo queryOnDutyRecord(RollDetailQueryDTO queryDTO) {
         RollOnDutyDataVo rollOnDutyVo = new RollOnDutyDataVo();
 
-        // 1. 从 Redis 获取班次信息
-        String shiftGroup = getShiftInfo(ccmNo, "class:shift:group:%s");
-        String shift = getShiftInfo(ccmNo, "class:shift:%s");
+        // 1. 获取班次信息(优先使用 queryDTO 中的值,否则从 Redis 获取)
+        String shiftGroup = StringUtils.isNotBlank(queryDTO.getShiftGroup())
+                ? queryDTO.getShiftGroup()
+                : getShiftInfo(queryDTO.getCcmNo(), "class:shift:group:%s");
+
+        String shift = StringUtils.isNotBlank(queryDTO.getShift())
+                ? queryDTO.getShift()
+                : getShiftInfo(queryDTO.getCcmNo(), "class:shift:%s");
 
         rollOnDutyVo.setShiftGroup(shiftGroup);
         rollOnDutyVo.setShift(shift);
         // 2. 获取交班记录
         LambdaQueryWrapper<BilletHotsendChangeShift> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(BilletHotsendChangeShift::getCcmNo, ccmNo)
+        queryWrapper.eq(BilletHotsendChangeShift::getCcmNo, queryDTO.getCcmNo())
                 .eq(BilletHotsendChangeShift::getShift, shift)
                 .eq(BilletHotsendChangeShift::getShiftGroup, shiftGroup)
                 .orderByDesc(BilletHotsendChangeShift::getCreateTime)
@@ -65,26 +76,30 @@ public class RollOutShippDetailsServiceImpl extends ServiceImpl<RollOutShippDeta
 
         BilletHotsendChangeShift billetHotsendChangeShift = billetHotsendChangeShiftService.getOne(queryWrapper);
         if (billetHotsendChangeShift == null) {
-            log.info("{}{}", "查询当班装运单信息失败,交班记录为空!", ccmNo + "失败时间:" + new Date());
+            log.info("{}{}", "查询当班装运单信息失败,交班记录为空!", queryDTO.getCcmNo() + "失败时间:" + new Date());
             return rollOnDutyVo;
         }
 
         // 3. 查询当班装运单信息
         LambdaQueryWrapper<StorageBill> billQueryWrapper = new LambdaQueryWrapper<>();
 
-        billQueryWrapper.eq(StorageBill::getCcmNo, ccmNo)
+        billQueryWrapper.eq(StorageBill::getCcmNo, queryDTO.getCcmNo())
                 .eq(StorageBill::getDestination, "上若")
+                .eq(StorageBill::getShift,shift)
+                .eq(StorageBill::getShiftGroup, shiftGroup)
                 .gt(StorageBill::getAmountTotal, 0);
 
-        if (oConvertUtils.isEmpty(currentDate)) {
+        if (oConvertUtils.isEmpty(queryDTO.getCurrentDate())) {
             billQueryWrapper.between(StorageBill::getCreateTime, billetHotsendChangeShift.getCreateTime(), new Date());
         } else {
-            billQueryWrapper.between(StorageBill::getCreateTime, DateUtils.getStartOfDay(currentDate), DateUtils.getEndOfDay(currentDate));
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+            String dateStr = sdf.format(queryDTO.getCurrentDate());
+            billQueryWrapper.between(StorageBill::getCreateTime, DateUtils.getStartOfDay(dateStr), DateUtils.getEndOfDay(dateStr));
         }
 
         List<StorageBill> storageBillList = storageBillMapper.selectList(billQueryWrapper);
         if (oConvertUtils.listIsEmpty(storageBillList)) {
-            log.info("{}{}", "查询当班装运单信息为空!", ccmNo);
+            log.info("{}{}", "查询当班装运单信息为空!", queryDTO.getCcmNo());
         }
 
         // 4. 查询上若明细数据
@@ -93,7 +108,9 @@ public class RollOutShippDetailsServiceImpl extends ServiceImpl<RollOutShippDeta
 
         if (!billIds.isEmpty()) {
             LambdaQueryWrapper<RollOutShippDetails> rollClubQuery = new LambdaQueryWrapper<>();
-            rollClubQuery.eq(RollOutShippDetails::getCcmNo, ccmNo)
+            rollClubQuery.eq(RollOutShippDetails::getCcmNo, queryDTO.getCcmNo())
+                    .eq(RollOutShippDetails::getShift, shift)
+                    .eq(RollOutShippDetails::getShiftGroup, shiftGroup)
                     .in(RollOutShippDetails::getStorageBillId, billIds);
             rollOutShippDetailsList = baseMapper.selectList(rollClubQuery);
         }
@@ -116,7 +133,7 @@ public class RollOutShippDetailsServiceImpl extends ServiceImpl<RollOutShippDeta
 
         // 6. 查询 Info 数据
         LambdaQueryWrapper<RollOutShippDetails> infoQueryWrapper = new LambdaQueryWrapper<>();
-        infoQueryWrapper.eq(RollOutShippDetails::getCcmNo, ccmNo)
+        infoQueryWrapper.eq(RollOutShippDetails::getCcmNo, queryDTO.getCcmNo())
                 .eq(RollOutShippDetails::getShift, shift)
                 .eq(RollOutShippDetails::getShiftGroup, shiftGroup)
                 .between(RollOutShippDetails::getCreateTime, billetHotsendChangeShift.getCreateTime(), new Date());
@@ -149,6 +166,13 @@ public class RollOutShippDetailsServiceImpl extends ServiceImpl<RollOutShippDeta
                 .eq(StorageBill::getDestination, "上若")
                 .gt(StorageBill::getAmountTotal, 0);
 
+        if (StringUtils.isNotBlank(queryDTO.getShiftGroup())) {
+            billQueryWrapper.eq(StorageBill::getShiftGroup, queryDTO.getShiftGroup());
+        }
+        if (StringUtils.isNotBlank(queryDTO.getShift())) {
+            billQueryWrapper.eq(StorageBill::getShift, queryDTO.getShift());
+        }
+
 
         Date beginDate = queryDTO.getBeginCreateDate();
         Date endDate = queryDTO.getEndCreateDate();
@@ -271,6 +295,180 @@ public class RollOutShippDetailsServiceImpl extends ServiceImpl<RollOutShippDeta
         return rollChargeDetailsVO;
     }
 
+    @Override
+    public RollChargeDetailsPageVO rollOutShippWorkbenchesQuery(RollDetailQueryDTO queryDTO) {
+
+        RollChargeDetailsPageVO rollChargeDetailsVO = new RollChargeDetailsPageVO();
+
+        if (queryDTO == null) {
+            return rollChargeDetailsVO;
+        }
+
+        // Step 1: 查询换班数据
+        LambdaQueryWrapper<BilletHotsendChangeShift> changeShiftQueryWrapper = new LambdaQueryWrapper<>();
+        if (StringUtils.isNotBlank(queryDTO.getCcmNo())) {
+            changeShiftQueryWrapper.eq(BilletHotsendChangeShift::getCcmNo, queryDTO.getCcmNo());
+        }
+        if (StringUtils.isNotBlank(queryDTO.getShiftGroup())) {
+            changeShiftQueryWrapper.eq(BilletHotsendChangeShift::getShiftGroup, queryDTO.getShiftGroup());
+        }
+        if (StringUtils.isNotBlank(queryDTO.getShift())) {
+            changeShiftQueryWrapper.eq(BilletHotsendChangeShift::getShift, queryDTO.getShift());
+        }
+        Date beginDate = queryDTO.getBeginCreateDate();
+        Date endDate = queryDTO.getEndCreateDate();
+        if (beginDate != null) {
+            changeShiftQueryWrapper.ge(BilletHotsendChangeShift::getCreateTime, DateUtils.getStartOfDayByDate(beginDate));
+        }
+        if (endDate != null) {
+            changeShiftQueryWrapper.le(BilletHotsendChangeShift::getCreateTime, DateUtils.getEndOfDayByDate(endDate));
+        }
+
+        List<BilletHotsendChangeShift> changeShiftList = billetHotsendChangeShiftService.list(changeShiftQueryWrapper);
+        if (CollectionUtils.isEmpty(changeShiftList)) {
+            return rollChargeDetailsVO;
+        }
+
+        // Step 2: 提前查询所有 StorageBill
+        LambdaQueryWrapper<StorageBill> billQueryWrapper = new LambdaQueryWrapper<>();
+        billQueryWrapper.eq(StorageBill::getDestination, "上若")
+                .gt(StorageBill::getAmountTotal, 0);
+
+        if (StringUtils.isNotBlank(queryDTO.getCcmNo())) {
+            billQueryWrapper.eq(StorageBill::getCcmNo, queryDTO.getCcmNo());
+        }
+        if (beginDate != null) {
+            billQueryWrapper.ge(StorageBill::getCreateTime, DateUtils.getStartOfDayByDate(beginDate));
+        }
+        if (endDate != null) {
+            billQueryWrapper.le(StorageBill::getCreateTime, DateUtils.getEndOfDayByDate(endDate));
+        }
+
+        List<StorageBill> allBills = storageBillMapper.selectList(billQueryWrapper);
+
+        // 构建 storageBillMap key: ccmNo|shiftGroup|shift
+        Map<String, List<StorageBill>> groupedBills = allBills.stream()
+                .collect(Collectors.groupingBy(b -> b.getCcmNo() + "|" + b.getShiftGroup() + "|" + b.getShift()));
+
+        // Step 3: 提前查询所有涉及的 RollClubTwoDetails
+        List<String> allBillIds = allBills.stream().map(StorageBill::getId).collect(Collectors.toList());
+        List<RollOutShippDetails> allDetails = Collections.emptyList();
+        if (!allBillIds.isEmpty()) {
+            LambdaQueryWrapper<RollOutShippDetails> detailQueryWrapper = new LambdaQueryWrapper<>();
+            detailQueryWrapper.in(RollOutShippDetails::getStorageBillId, allBillIds);
+            allDetails = baseMapper.selectList(detailQueryWrapper);
+        }
+
+        // 按 storageBillId 分组
+        Map<String, List<RollOutShippDetails>> billDetailMap = allDetails.stream()
+                .collect(Collectors.groupingBy(RollOutShippDetails::getStorageBillId));
+
+        // Step 4: 聚合数据
+        Map<String, RollChargeDetailsPageVO.RollHistoryDetail> mergedDetailMap = new HashMap<>();
+        for (BilletHotsendChangeShift shift : changeShiftList) {
+            String keyDate = DateUtils.formatDate(shift.getCreateTime());
+            String mapKey = keyDate + "|" + shift.getShiftGroup() + "|" + shift.getShift();
+            String billKey = shift.getCcmNo() + "|" + shift.getShiftGroup() + "|" + shift.getShift();
+
+            List<StorageBill> relatedBills = groupedBills.getOrDefault(billKey, Collections.emptyList());
+            List<String> billIds = relatedBills.stream()
+                    .filter(b -> {
+                        Date ct = b.getCreateTime();
+                        return ct != null &&
+                                !ct.before(shift.getCreateTime()) &&
+                                !ct.after(Optional.ofNullable(shift.getChangeShiftTime()).orElse(new Date()));
+                    })
+                    .map(StorageBill::getId)
+                    .collect(Collectors.toList());
+
+            List<RollOutShippDetails> rollDetails = billIds.stream()
+                    .flatMap(id -> billDetailMap.getOrDefault(id, Collections.emptyList()).stream())
+                    .collect(Collectors.toList());
+
+            RollChargeDetailsPageVO.RollHistoryDetail detail = mergedDetailMap.getOrDefault(mapKey, new RollChargeDetailsPageVO.RollHistoryDetail());
+            detail.setCurrentDate(keyDate);
+            detail.setShift(shift.getShift());
+            detail.setShiftGroup(shift.getShiftGroup());
+
+            if (detail.getCarNum() == null) {
+                detail.setCarNum((int) billIds.stream().filter(Objects::nonNull).collect(Collectors.toSet()).size());
+            }
+
+            if (CollectionUtils.isEmpty(rollDetails)) {
+                detail.setCurrentDateAmount(Optional.ofNullable(detail.getCurrentDateAmount()).orElse(0));
+                detail.setCurrentDateWeight(Optional.ofNullable(detail.getCurrentDateWeight()).orElse(BigDecimal.ZERO.setScale(4, BigDecimal.ROUND_HALF_UP)));
+                detail.setCurrentDateDetails(Optional.ofNullable(detail.getCurrentDateDetails()).orElse(new ArrayList<>()));
+                mergedDetailMap.put(mapKey, detail);
+                continue;
+            }
+
+            // 累加支数
+            int count = rollDetails.stream().mapToInt(d -> (d.getStackAddr() == null || d.getStackAddr().isEmpty()) ? 1 : 4).sum();
+            detail.setCurrentDateAmount(Optional.ofNullable(detail.getCurrentDateAmount()).orElse(0) + count);
+
+            // 累加出坯量
+            BigDecimal blankOutput = rollDetails.stream()
+                    .map(d -> BigDecimal.valueOf(d.getBlankOutput()))
+                    .reduce(BigDecimal.ZERO, BigDecimal::add)
+                    .setScale(4, BigDecimal.ROUND_HALF_UP);
+            detail.setCurrentDateWeight(Optional.ofNullable(detail.getCurrentDateWeight()).orElse(BigDecimal.ZERO).add(blankOutput));
+
+            // 明细分组
+            Map<String, RollChargeDetailsPageVO.CurrentDateDetail> sizeMap = Optional.ofNullable(detail.getCurrentDateDetails())
+                    .orElse(new ArrayList<>())
+                    .stream().collect(Collectors.toMap(
+                            RollChargeDetailsPageVO.CurrentDateDetail::getSize,
+                            d -> d,
+                            (d1, d2) -> d1
+                    ));
+
+            Map<String, List<RollOutShippDetails>> sizeGroup = rollDetails.stream().collect(Collectors.groupingBy(RollOutShippDetails::getSize));
+            for (Map.Entry<String, List<RollOutShippDetails>> entry : sizeGroup.entrySet()) {
+                String size = entry.getKey();
+                List<RollOutShippDetails> list = entry.getValue();
+
+                int sizeCount = list.stream().mapToInt(d -> (d.getStackAddr() == null || d.getStackAddr().isEmpty()) ? 1 : 4).sum();
+                BigDecimal sizeWeight = list.stream()
+                        .map(d -> BigDecimal.valueOf(d.getBlankOutput()))
+                        .reduce(BigDecimal.ZERO, BigDecimal::add)
+                        .setScale(4, BigDecimal.ROUND_HALF_UP);
+
+                RollChargeDetailsPageVO.CurrentDateDetail sizeDetail = sizeMap.getOrDefault(size, new RollChargeDetailsPageVO.CurrentDateDetail());
+                sizeDetail.setSize(size);
+                sizeDetail.setAmount(Optional.ofNullable(sizeDetail.getAmount()).orElse(0) + sizeCount);
+                sizeDetail.setBlankOutput(Optional.ofNullable(sizeDetail.getBlankOutput()).orElse(BigDecimal.ZERO).add(sizeWeight));
+
+                sizeMap.put(size, sizeDetail);
+            }
+
+            detail.setCurrentDateDetails(new ArrayList<>(sizeMap.values()));
+            mergedDetailMap.put(mapKey, detail);
+        }
+
+        // Step 5: 排序与分页
+        List<RollChargeDetailsPageVO.RollHistoryDetail> rollAllDetails = new ArrayList<>(mergedDetailMap.values());
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+        rollAllDetails.sort(Comparator.comparing(
+                d -> LocalDate.parse(d.getCurrentDate(), formatter),
+                Comparator.reverseOrder()
+        ));
+
+        // 设置默认值,如果 queryDTO.getPageNo() 为 null,则默认值为 1;如果 queryDTO.getPageSize() 为 null,则默认值为 10
+        int pageNo = (queryDTO.getPageNo() != null) ? queryDTO.getPageNo() : 1;
+        int pageSize = (queryDTO.getPageSize() != null) ? queryDTO.getPageSize() : 10;
+
+        int startIndex = (pageNo - 1) * pageSize;
+        int endIndex = Math.min(startIndex + pageSize, rollAllDetails.size());
+        List<RollChargeDetailsPageVO.RollHistoryDetail> pagedList = rollAllDetails.subList(startIndex, endIndex);
+
+        Page<RollChargeDetailsPageVO.RollHistoryDetail> page = new Page<>(pageNo, pageSize, rollAllDetails.size());
+        page.setRecords(pagedList);
+        rollChargeDetailsVO.setRollHistoryDetails(page);
+
+        return rollChargeDetailsVO;
+
+    }
+
 
     /**
      * 从Redis中获取班组班别

+ 17 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/dto/RollDetailQueryDTO.java

@@ -1,6 +1,9 @@
 package org.jeecg.modules.billet.storageBill.dto;
 
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import org.jeecg.common.aspect.annotation.Dict;
+import org.jeecgframework.poi.excel.annotation.Excel;
 import org.springframework.format.annotation.DateTimeFormat;
 
 import java.util.Date;
@@ -15,4 +18,18 @@ public class RollDetailQueryDTO {
 
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     private Date endCreateDate;
+
+    @ApiModelProperty(value = "班组")
+    private String shiftGroup;
+
+    @ApiModelProperty(value = "班别")
+    private String shift;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    private Date currentDate;
+
+    private Integer pageNo;
+
+    private Integer pageSize;
+
 }

+ 53 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/vo/RollChargeDetailsPageVO.java

@@ -0,0 +1,53 @@
+package org.jeecg.modules.billet.storageBill.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+@Data
+public class RollChargeDetailsPageVO {
+
+    private Page<RollChargeDetailsPageVO.RollHistoryDetail> rollHistoryDetails;
+
+    @Data
+    public static class RollHistoryDetail {
+
+        public String currentDate;
+
+        @ApiModelProperty(value = "当天支数")
+        private Integer currentDateAmount;
+
+        @ApiModelProperty(value = "当天出坯量")
+        private BigDecimal currentDateWeight;
+
+        @ApiModelProperty(value = "当天车次")
+        private Integer carNum;
+
+        @ApiModelProperty(value = "班组")
+        private String shiftGroup;
+
+        @ApiModelProperty(value = "班别")
+        private String shift;
+
+        private List<RollChargeDetailsPageVO.CurrentDateDetail> currentDateDetails;
+
+    }
+
+    @Data
+    public static class CurrentDateDetail {
+
+        @ApiModelProperty(value = "定尺")
+        private String size;
+
+        @ApiModelProperty(value = "支数")
+        private Integer amount;
+
+        @ApiModelProperty(value = "出坯量")
+        private BigDecimal blankOutput;
+
+
+    }
+}

+ 12 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/vo/RollChargeDetailsVO.java

@@ -2,11 +2,13 @@ package org.jeecg.modules.billet.storageBill.vo;
 
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 import java.math.BigDecimal;
 import java.util.List;
 
 @Data
+@NoArgsConstructor
 public class RollChargeDetailsVO {
 
     @ApiModelProperty(value = "总支数")
@@ -17,6 +19,12 @@ public class RollChargeDetailsVO {
 
     private List<RollChargeDetailsVO.RollHistoryDetail> rollHistoryDetails;
 
+    public RollChargeDetailsVO(Integer amountTotal, BigDecimal totalWeight, List<RollHistoryDetail> rollHistoryDetails) {
+        this.amountTotal = amountTotal;
+        this.totalWeight = totalWeight;
+        this.rollHistoryDetails = rollHistoryDetails;
+    }
+
     @Data
     public static class RollHistoryDetail {
 
@@ -31,6 +39,8 @@ public class RollChargeDetailsVO {
         @ApiModelProperty(value = "当天车次")
         private Integer carNum;
 
+
+
         private List<RollChargeDetailsVO.CurrentDateDetail> currentDateDetails;
 
     }
@@ -47,5 +57,7 @@ public class RollChargeDetailsVO {
         @ApiModelProperty(value = "出坯量")
         private BigDecimal blankOutput;
 
+
     }
+
 }

+ 49 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/vo/RollSendDetailsPageVO.java

@@ -0,0 +1,49 @@
+package org.jeecg.modules.billet.storageBill.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+@Data
+public class RollSendDetailsPageVO {
+
+    private Page<RollSendDetailsPageVO.RollHistoryDetail> rollHistoryDetails;
+
+    @Data
+    public static class RollHistoryDetail {
+
+        public String currentDate;
+
+        @ApiModelProperty(value = "支数")
+        private Integer currentDateAmount;
+
+        @ApiModelProperty(value = "出坯量")
+        private BigDecimal currentDateWeight;
+
+        @ApiModelProperty(value = "班组")
+        private String shiftGroup;
+
+        @ApiModelProperty(value = "班别")
+        private String shift;
+
+        private List<RollSendDetailsPageVO.CurrentDateDetail> currentDateDetails;
+
+    }
+
+    @Data
+    public static class CurrentDateDetail {
+
+        @ApiModelProperty(value = "定尺")
+        private String size;
+
+        @ApiModelProperty(value = "支数")
+        private Integer amount;
+
+        @ApiModelProperty(value = "出坯量")
+        private BigDecimal blankOutput;
+
+    }
+}

+ 1 - 1
zgztBus/jeecg-server-cloud/jeecg-cloud-nacos/src/main/resources/application.yml

@@ -15,7 +15,7 @@ db:
   url:
 #    '0': jdbc:mysql://192.168.1.190:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
 #  研发环境
-   '0': jdbc:mysql://123.57.213.14:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
+   '0': jdbc:mysql://123.57.213.14:33066/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
 #  本地环境
 #   '0': jdbc:mysql://127.0.0.1:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
   user: