|
|
|
@ -15,6 +15,7 @@ import org.springblade.core.mp.support.Query; |
|
|
|
import org.springblade.core.secure.BladeUser; |
|
|
|
import org.springblade.core.secure.BladeUser; |
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
|
|
|
import org.springblade.wms.mapper.StGoodsMapper; |
|
|
|
import org.springblade.wms.pojo.entity.StGoods; |
|
|
|
import org.springblade.wms.pojo.entity.StGoods; |
|
|
|
import org.springblade.wms.pojo.entity.StRealtimeStock; |
|
|
|
import org.springblade.wms.pojo.entity.StRealtimeStock; |
|
|
|
import org.springblade.wms.pojo.entity.StUserRight; |
|
|
|
import org.springblade.wms.pojo.entity.StUserRight; |
|
|
|
@ -31,6 +32,8 @@ import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @version 1.0 |
|
|
|
* @version 1.0 |
|
|
|
@ -57,6 +60,8 @@ public class StComboxController { |
|
|
|
IStGoodsExtService stGoodsExtService; |
|
|
|
IStGoodsExtService stGoodsExtService; |
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
IStClassRequestService stClassRequestService; |
|
|
|
IStClassRequestService stClassRequestService; |
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
StGoodsMapper stGoodsMapper; |
|
|
|
/*@Resource |
|
|
|
/*@Resource |
|
|
|
ISysClient sysClient;*/ |
|
|
|
ISysClient sysClient;*/ |
|
|
|
|
|
|
|
|
|
|
|
@ -207,6 +212,47 @@ public class StComboxController { |
|
|
|
return R.data(pages); |
|
|
|
return R.data(pages); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/getStockByStorehouseAndGoods") |
|
|
|
|
|
|
|
@ApiOperationSupport(order = 8) |
|
|
|
|
|
|
|
@ApiLog("查询所有库存信息") |
|
|
|
|
|
|
|
@Operation(summary = "库房组件", description = "传入coStorehouse") |
|
|
|
|
|
|
|
public R<List<StRealtimeStockVO>> getStockByStorehouseAndGoods(StStorehouseVO stStorehouse, Query query) { |
|
|
|
|
|
|
|
// 1. 获取当前登录用户信息
|
|
|
|
|
|
|
|
// BladeUser user = AuthUtil.getUser();
|
|
|
|
|
|
|
|
// stStorehouse.setDeptId(userInfo.getDeptId());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 2. 强制不分页
|
|
|
|
|
|
|
|
query.setSize(-1); |
|
|
|
|
|
|
|
query.setCurrent(1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String urTypeStorehouse = StUserRight.UR_TYPE_STOREHOUSE; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 3. 调用分页查询
|
|
|
|
|
|
|
|
IPage<StStorehouseVO> storehousePages = stStorehouseService.selectStorehousePage(Condition.getPage(query), stStorehouse, AuthUtil.getUserId(), urTypeStorehouse); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 3. 取出 库房ID(shId)
|
|
|
|
|
|
|
|
List<Long> shIdList = storehousePages.getRecords().stream() |
|
|
|
|
|
|
|
.map(StStorehouseVO::getId) |
|
|
|
|
|
|
|
.filter(Objects::nonNull) |
|
|
|
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 如果没有库房,直接返回空
|
|
|
|
|
|
|
|
if (CollUtil.isEmpty(shIdList)) { |
|
|
|
|
|
|
|
return R.data(new ArrayList<>()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 4. 取出 物料ID(从传入的 stStorehouse 里拿)
|
|
|
|
|
|
|
|
StGoods goods = stGoodsMapper.queryByCode(stStorehouse.getGoodsCode()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 5. 调用 实时库存查询(传入 物料ID + 库房ID)
|
|
|
|
|
|
|
|
List<StRealtimeStockVO> allStockList = new ArrayList<>(); |
|
|
|
|
|
|
|
for (Long shId : shIdList) { |
|
|
|
|
|
|
|
IPage<StRealtimeStockVO> stockPage = stRealtimeStockService.selectByGoodsIdShId(Condition.getPage(query), goods.getId(), shId, null, null); |
|
|
|
|
|
|
|
allStockList.addAll(stockPage.getRecords()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return R.data(allStockList); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/outboundGoods") |
|
|
|
@GetMapping("/outboundGoods") |
|
|
|
@ApiOperationSupport(order = 6) |
|
|
|
@ApiOperationSupport(order = 6) |
|
|
|
@ApiLog("班组提请可选物料") |
|
|
|
@ApiLog("班组提请可选物料") |
|
|
|
|