|
@@ -11,17 +11,21 @@ import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
import org.jeecg.common.system.base.controller.JeecgController;
|
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
|
+import org.jeecg.modules.billet.rollHeight.entity.HotSendRollHeightDetails;
|
|
|
import org.jeecg.modules.billet.rollHeight.entity.RollHeightDetails;
|
|
|
import org.jeecg.modules.billet.rollHeight.service.IRollHeightDetailsService;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
|
|
|
- /**
|
|
|
+/**
|
|
|
* @Description: 高线明细信息
|
|
|
* @Author: jeecg-boot
|
|
|
* @Date: 2024-11-20
|
|
@@ -159,4 +163,60 @@ public class RollHeightDetailsController extends JeecgController<RollHeightDetai
|
|
|
return super.importExcel(request, response, RollHeightDetails.class);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @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);
|
|
|
+ }
|
|
|
}
|