|
|
|
|
@ -1,6 +1,5 @@ |
|
|
|
|
package org.springblade.wms.controller; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
|
|
|
|
@ -23,14 +22,12 @@ import org.springblade.core.tool.utils.DateUtil; |
|
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
|
import org.springblade.wms.excel.StErpWarehouseTransferExcel; |
|
|
|
|
import org.springblade.wms.pojo.entity.StErpWarehouseTransfer; |
|
|
|
|
import org.springblade.wms.pojo.entity.StMoldBase; |
|
|
|
|
import org.springblade.wms.pojo.vo.StErpWarehouseTransferVO; |
|
|
|
|
import org.springblade.wms.service.IStErpWarehouseTransferService; |
|
|
|
|
import org.springblade.wms.service.IStMoldBaseService; |
|
|
|
|
import org.springblade.wms.wrapper.StErpWarehouseTransferWrapper; |
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
@ -106,24 +103,24 @@ public class StErpWarehouseTransferController extends BladeController { |
|
|
|
|
IPage<StErpWarehouseTransferVO> pages = stErpWarehouseTransferService.selectStErpWarehouseTransferPage(Condition.getPage(query), stErpWarehouseTransfer); |
|
|
|
|
|
|
|
|
|
/* 4. 逐条查子表*/ |
|
|
|
|
for (StErpWarehouseTransferVO transfer : pages.getRecords()) { |
|
|
|
|
// 判断是否是模架
|
|
|
|
|
List<StMoldBase> childrenList = stMoldBaseService.getByGoodsId(transfer.getGoodsId()); |
|
|
|
|
String parentKey = transfer.getId().toString(); |
|
|
|
|
transfer.setKey(parentKey); |
|
|
|
|
if (CollUtil.isNotEmpty(childrenList)) { |
|
|
|
|
List<StErpWarehouseTransfer> children = new ArrayList<>(); |
|
|
|
|
for (StMoldBase moldBase : childrenList) { |
|
|
|
|
StErpWarehouseTransfer child = new StErpWarehouseTransfer(); |
|
|
|
|
child.setGoodsId(moldBase.getMaterialGoodsId()); |
|
|
|
|
child.setUnitPrice(moldBase.getPrice()); |
|
|
|
|
child.setKey(parentKey + "-" + moldBase.getId()); |
|
|
|
|
child.setOutQuantity(moldBase.getQuantity() * transfer.getOutQuantity()); |
|
|
|
|
children.add(child); |
|
|
|
|
} |
|
|
|
|
transfer.setChildren(children); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// for (StErpWarehouseTransferVO transfer : pages.getRecords()) {
|
|
|
|
|
// // 判断是否是模架
|
|
|
|
|
// List<StMoldBase> childrenList = stMoldBaseService.getByGoodsId(transfer.getGoodsId());
|
|
|
|
|
// String parentKey = transfer.getId().toString();
|
|
|
|
|
// transfer.setKey(parentKey);
|
|
|
|
|
// if (CollUtil.isNotEmpty(childrenList)) {
|
|
|
|
|
// List<StErpWarehouseTransfer> children = new ArrayList<>();
|
|
|
|
|
// for (StMoldBase moldBase : childrenList) {
|
|
|
|
|
// StErpWarehouseTransfer child = new StErpWarehouseTransfer();
|
|
|
|
|
// child.setGoodsId(moldBase.getMaterialGoodsId());
|
|
|
|
|
// child.setUnitPrice(moldBase.getPrice());
|
|
|
|
|
// child.setKey(parentKey + "-" + moldBase.getId());
|
|
|
|
|
// child.setOutQuantity(moldBase.getQuantity() * transfer.getOutQuantity());
|
|
|
|
|
// children.add(child);
|
|
|
|
|
// }
|
|
|
|
|
// transfer.setChildren(children);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
return R.data(pages); |
|
|
|
|
} |
|
|
|
|
|