Ver Fonte

棒一棒二外运列表添加组坯号展示

lingpeng.li há 6 meses atrás
pai
commit
80c6006c0b

+ 39 - 5
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollClubThree/controller/RollClubThreeController.java

@@ -13,13 +13,18 @@ import org.jeecg.modules.billet.operateLog.service.IOperateLogService;
 import org.jeecg.modules.billet.rollClubThree.entity.RollClubThree;
 import org.jeecg.modules.billet.rollClubThree.service.IRollClubThreeService;
 import org.jeecg.modules.billet.rollHeight.entity.DestinationStatistics;
+import org.jeecg.modules.billet.storageBill.entity.StorageBill;
+import org.jeecg.modules.billet.storageBill.service.IStorageBillService;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.List;
 
- /**
+/**
  * @Description: 轧钢棒三
  * @Author: jeecg-boot
  * @Date:   2024-05-06
@@ -34,7 +39,9 @@ public class RollClubThreeController {
 	private IRollClubThreeService rollClubThreeService;
 	 @Autowired
 	 private IOperateLogService operateLogService;
-	
+	@Autowired
+	private IStorageBillService storageBillService;
+
 	/**
 	 * 分页列表查询
 	 *
@@ -45,16 +52,43 @@ public class RollClubThreeController {
 	 * @return
 	 */
 	@AutoLog(value = "轧钢棒三-分页列表查询")
-	@ApiOperation(value="轧钢棒三-分页列表查询", notes="轧钢棒三-分页列表查询")
+	@ApiOperation(value = "轧钢棒三-分页列表查询", notes = "轧钢棒三-分页列表查询")
 	@GetMapping(value = "/list")
 	public Result<?> queryPageList(RollClubThree rollClubThree,
-								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
-								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+								   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
 								   HttpServletRequest req) {
 		QueryWrapper<RollClubThree> queryWrapper = QueryGenerator.initQueryWrapper(rollClubThree, req.getParameterMap());
 		Page<RollClubThree> page = new Page<RollClubThree>(pageNo, pageSize);
 		IPage<RollClubThree> pageList = rollClubThreeService.page(page, queryWrapper);
+		// 判空处理:如果没有数据直接返回空分页结果
+		if (pageList == null || pageList.getRecords() == null || pageList.getRecords().isEmpty()) {
+			return Result.OK(pageList);
+		}
+
+		List<RollClubThree> rollClubThreeList = new ArrayList<>();
+		pageList.getRecords().forEach(x -> {
+			if (x != null) { // 判空
+				RollClubThree clubThree = new RollClubThree();
+				BeanUtils.copyProperties(x, clubThree);
+
+				// 判空处理:如果 StorageBillId 不为空才查询关联数据
+				if (x.getStorageBillId() != null) {
+					StorageBill storageBill = storageBillService.getById(x.getStorageBillId());
+					if (storageBill != null) { // 判空
+						clubThree.setAssemblyNumber(storageBill.getAssemblyNumber());
+					}
+				}
+
+				rollClubThreeList.add(clubThree);
+			}
+		});
+
+		// 更新分页数据
+		pageList.setRecords(rollClubThreeList);
+
 		return Result.OK(pageList);
+
 	}
 	
 	/**

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

@@ -1,6 +1,7 @@
 package org.jeecg.modules.billet.rollClubThree.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -136,4 +137,11 @@ public class RollClubThree implements Serializable {
     @Excel(name = "装运单ID", width = 15)
     @ApiModelProperty(value = "装运单ID")
     private String storageBillId;
+
+    /**
+     * 组坯号
+     */
+    @ApiModelProperty(value = "组坯号", required = true)
+    @TableField(exist = false)
+    private String assemblyNumber;
 }

+ 37 - 7
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollClubTwo/controller/RollClubTwoController.java

@@ -13,13 +13,18 @@ import org.jeecg.modules.billet.operateLog.service.IOperateLogService;
 import org.jeecg.modules.billet.rollClubTwo.entity.RollClubTwo;
 import org.jeecg.modules.billet.rollClubTwo.service.IRollClubTwoService;
 import org.jeecg.modules.billet.rollHeight.entity.DestinationStatistics;
+import org.jeecg.modules.billet.storageBill.entity.StorageBill;
+import org.jeecg.modules.billet.storageBill.service.IStorageBillService;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.List;
 
- /**
+/**
  * @Description: 轧钢棒二
  * @Author: jeecg-boot
  * @Date:   2024-05-06
@@ -34,7 +39,9 @@ public class RollClubTwoController {
 	private IRollClubTwoService rollClubTwoService;
 	 @Autowired
 	 private IOperateLogService operateLogService;
-	
+	@Autowired
+	private IStorageBillService storageBillService;
+
 	/**
 	 * 分页列表查询
 	 *
@@ -45,15 +52,38 @@ public class RollClubTwoController {
 	 * @return
 	 */
 	@AutoLog(value = "轧钢棒二-分页列表查询")
-	@ApiOperation(value="轧钢棒二-分页列表查询", notes="轧钢棒二-分页列表查询")
+	@ApiOperation(value = "轧钢棒二-分页列表查询", notes = "轧钢棒二-分页列表查询")
 	@GetMapping(value = "/list")
-	public Result<?> queryPageList(RollClubTwo rollClubTwo,
-								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
-								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
-								   HttpServletRequest req) {
+	public Result<?> queryPageList(RollClubTwo rollClubTwo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
 		QueryWrapper<RollClubTwo> queryWrapper = QueryGenerator.initQueryWrapper(rollClubTwo, req.getParameterMap());
 		Page<RollClubTwo> page = new Page<RollClubTwo>(pageNo, pageSize);
 		IPage<RollClubTwo> pageList = rollClubTwoService.page(page, queryWrapper);
+		// 判空处理:如果没有数据直接返回空分页结果
+		if (pageList == null || pageList.getRecords() == null || pageList.getRecords().isEmpty()) {
+			return Result.OK(pageList);
+		}
+
+		List<RollClubTwo> rollClubTwoList = new ArrayList<>();
+		pageList.getRecords().forEach(x -> {
+			if (x != null) { // 判空
+				RollClubTwo clubTwo = new RollClubTwo();
+				BeanUtils.copyProperties(x, clubTwo);
+
+				// 判空处理:如果 StorageBillId 不为空才查询关联数据
+				if (x.getStorageBillId() != null) {
+					StorageBill storageBill = storageBillService.getById(x.getStorageBillId());
+					if (storageBill != null) { // 判空
+						clubTwo.setAssemblyNumber(storageBill.getAssemblyNumber());
+					}
+				}
+
+				rollClubTwoList.add(clubTwo);
+			}
+		});
+
+		// 更新分页数据
+		pageList.setRecords(rollClubTwoList);
+
 		return Result.OK(pageList);
 	}
 	

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

@@ -1,6 +1,7 @@
 package org.jeecg.modules.billet.rollClubTwo.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -136,4 +137,11 @@ public class RollClubTwo implements Serializable {
     @Excel(name = "装运单ID", width = 15)
     @ApiModelProperty(value = "装运单ID")
     private String storageBillId;
+
+    /**
+     * 组坯号
+     */
+    @ApiModelProperty(value = "组坯号", required = true)
+    @TableField(exist = false)
+    private String assemblyNumber;
 }

+ 39 - 5
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollOutShipp/controller/RollOutShippController.java

@@ -13,13 +13,18 @@ import org.jeecg.modules.billet.operateLog.service.IOperateLogService;
 import org.jeecg.modules.billet.rollHeight.entity.DestinationStatistics;
 import org.jeecg.modules.billet.rollOutShipp.entity.RollOutShipp;
 import org.jeecg.modules.billet.rollOutShipp.service.IRollOutShippService;
+import org.jeecg.modules.billet.storageBill.entity.StorageBill;
+import org.jeecg.modules.billet.storageBill.service.IStorageBillService;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.List;
 
- /**
+/**
  * @Description: 上若
  * @Author: jeecg-boot
  * @Date:   2024-05-06
@@ -34,7 +39,9 @@ public class RollOutShippController {
 	private IRollOutShippService rollOutShippService;
 	@Autowired
 	private IOperateLogService operateLogService;
-	
+	@Autowired
+	private IStorageBillService storageBillService;
+
 	/**
 	 * 分页列表查询
 	 *
@@ -45,15 +52,42 @@ public class RollOutShippController {
 	 * @return
 	 */
 	@AutoLog(value = "上若-分页列表查询")
-	@ApiOperation(value="上若-分页列表查询", notes="上若-分页列表查询")
+	@ApiOperation(value = "上若-分页列表查询", notes = "上若-分页列表查询")
 	@GetMapping(value = "/list")
 	public Result<?> queryPageList(RollOutShipp rollOutShipp,
-								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
-								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+								   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
 								   HttpServletRequest req) {
 		QueryWrapper<RollOutShipp> queryWrapper = QueryGenerator.initQueryWrapper(rollOutShipp, req.getParameterMap());
 		Page<RollOutShipp> page = new Page<RollOutShipp>(pageNo, pageSize);
 		IPage<RollOutShipp> pageList = rollOutShippService.page(page, queryWrapper);
+
+		// 判空处理:如果没有数据直接返回空分页结果
+		if (pageList == null || pageList.getRecords() == null || pageList.getRecords().isEmpty()) {
+			return Result.OK(pageList);
+		}
+
+		List<RollOutShipp> rollOutShippList = new ArrayList<>();
+		pageList.getRecords().forEach(x -> {
+			if (x != null) { // 判空
+				RollOutShipp outShipp = new RollOutShipp();
+				BeanUtils.copyProperties(x, outShipp);
+
+				// 判空处理:如果 StorageBillId 不为空才查询关联数据
+				if (x.getStorageBillId() != null) {
+					StorageBill storageBill = storageBillService.getById(x.getStorageBillId());
+					if (storageBill != null) { // 判空
+						outShipp.setAssemblyNumber(storageBill.getAssemblyNumber());
+					}
+				}
+
+				rollOutShippList.add(outShipp);
+			}
+		});
+
+		// 更新分页数据
+		pageList.setRecords(rollOutShippList);
+
 		return Result.OK(pageList);
 	}
 	

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

@@ -1,6 +1,7 @@
 package org.jeecg.modules.billet.rollOutShipp.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -136,4 +137,11 @@ public class RollOutShipp implements Serializable {
     @Excel(name = "装运单ID", width = 15)
     @ApiModelProperty(value = "装运单ID")
     private String storageBillId;
+
+    /**
+     * 组坯号
+     */
+    @ApiModelProperty(value = "组坯号", required = true)
+    @TableField(exist = false)
+    private String assemblyNumber;
 }