无关风月
2024-12-20 6818ba08ca3d242bbccde602d5b8fa71ee6d3b94
manage/src/main/java/com/jilongda/manage/controller/TWarehousingController.java
@@ -58,6 +58,10 @@
    private TModelService modelService;
    @Autowired
    private TLensSeriesService lensSeriesService;
    @Autowired
    private TStoreService storeService;
    @Autowired
    private TBrandService brandService;
    /**
     * 通过型号查询色号列表
     */
@@ -127,11 +131,38 @@
    /**
     * 库存明细记录列表
     */
    @ApiOperation(value = "镜片库存明细记录列表")
    @ApiOperation(value = "镜片库存明细记录列表--库存详情")
    @PostMapping(value = "/detailLensList")
    public ApiResult<PageInfo<TLensWarehousingDetailVO>> detailLensList(@RequestBody TWarehousingDetailLensQuery query) {
        PageInfo<TLensWarehousingDetailVO> frameWarehousingDetailVOPageInfo = warehousingService.detailListLens(query);
        return ApiResult.success(frameWarehousingDetailVOPageInfo);
    public ApiResult<TLensGoodsDetailVO> detailLensList(Integer id) {
        TLensGoodsDetailVO tLensGoodsDetailVO = new TLensGoodsDetailVO();
        TLensGoods byId = lensGoodsService.getById(id);
        TStore byId1 = storeService.getById(byId.getStoreId());
        if (byId1!=null){
            tLensGoodsDetailVO.setStoreName(byId1.getName());
        }
        TLensSeries byId2 = lensSeriesService.getById(byId.getSeriesId());
        if (byId2!=null){
            Integer brandId = byId2.getBrandId();
            TBrand byId3 = brandService.getById(brandId);
            String t1 = "";
            switch (byId.getLensType()){
                case 1:
                    t1="球面";
                    break;
                case 2:
                    t1="非球面";
                    break;
                case 3:
                    t1="双非";
                    break;
            }
            tLensGoodsDetailVO.setTitle(byId3.getName()+byId2.getName()+t1+" "+byId.getRefractiveIndex());
        }
        // 查询这个商品的库存明细
        List<TLensWarehousingDetail> list = lensWarehousingDetailService.lambdaQuery().eq(TLensWarehousingDetail::getSeriesId, byId.getSeriesId())
                .eq(TLensWarehousingDetail::getRefractiveIndex, byId.getRefractiveIndex()).list();
        tLensGoodsDetailVO.setList(list);
        return ApiResult.success(tLensGoodsDetailVO);
    }
    /**