|
@@ -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);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|